diff --git a/CHANGES.md b/CHANGES.md index f264bb446..07312f006 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -58,7 +58,7 @@ Panel instances provide two decorators `layout()` and `callback()` which are used to implement the UI and the interaction behaviour, respectively. The functionality is provided by the - `https://github.com/bcdev/chartlets` Python library. + [Chartlets](https://bcdev.github.io/chartlets/) Python library. A working example can be found in `examples/serve/panels-demo`. * The xcube test helper module `test.s3test` has been enhanced to support diff --git a/environment.yml b/environment.yml index 05d83f91e..2f3808f34 100644 --- a/environment.yml +++ b/environment.yml @@ -46,7 +46,7 @@ dependencies: - altair - pip - pip: - - chartlets + - chartlets >=0.0.28 # Testing - flake8 >=3.7 - kerchunk diff --git a/examples/serve/panels-demo/my_viewer_ext/__init__.py b/examples/serve/panels-demo/my_viewer_ext/__init__.py index 711cc1644..40c1bf33a 100644 --- a/examples/serve/panels-demo/my_viewer_ext/__init__.py +++ b/examples/serve/panels-demo/my_viewer_ext/__init__.py @@ -1,5 +1,7 @@ from chartlets import Extension from .my_panel_1 import panel as my_panel_1 +from .my_panel_2 import panel as my_panel_2 ext = Extension(__name__) ext.add(my_panel_1) +ext.add(my_panel_2) diff --git a/examples/serve/panels-demo/my_viewer_ext/my_panel_1.py b/examples/serve/panels-demo/my_viewer_ext/my_panel_1.py index ffcd6693d..0ec10de9e 100644 --- a/examples/serve/panels-demo/my_viewer_ext/my_panel_1.py +++ b/examples/serve/panels-demo/my_viewer_ext/my_panel_1.py @@ -1,83 +1,226 @@ +import altair as alt +import numpy as np +import pandas as pd +import pyproj +import shapely +import shapely.ops from chartlets import Component, Input, State, Output -from chartlets.components import Box, Dropdown, Checkbox, Typography +from chartlets.components import Box, Button, CircularProgress, Plot, Select +from xcube.constants import CRS_CRS84 +from xcube.core.geom import mask_dataset_by_geometry, normalize_geometry +from xcube.core.gridmapping import GridMapping from xcube.webapi.viewer.contrib import Panel -from xcube.webapi.viewer.contrib import get_datasets_ctx +from xcube.webapi.viewer.contrib import get_dataset from xcube.server.api import Context -panel = Panel(__name__, title="Panel B") +panel = Panel(__name__, title="2D Histogram") -COLORS = [("red", 0), ("green", 1), ("blue", 2), ("yellow", 3)] +# Number of bins in x and y directions. +# This results in columns of 4096 items. +# Vega Altair's maximum is 5000. +NUM_BINS_MAX = 64 -@panel.layout( - Input(source="app", property="controlState.selectedDatasetId"), -) -def render_panel( - ctx: Context, - dataset_id: str = "", -) -> Component: +@panel.layout(State("@app", "selectedDatasetId")) +def render_panel(ctx: Context, dataset_id: str | None = None) -> Component: + dataset = get_dataset(ctx, dataset_id) - opaque = False - color = 0 + plot = Plot(id="plot", chart=None, style={"paddingTop": 6}) - opaque_checkbox = Checkbox( - id="opaque", - value=opaque, - label="Opaque", - ) + var_names, var_name_1, var_name_2 = get_var_select_options(dataset) - color_dropdown = Dropdown( - id="color", - value=color, - label="Color", - options=COLORS, - style={"flexGrow": 0, "minWidth": 80}, + select_var_1 = Select( + id="select_var_1", label="Variable 1", value=var_name_1, options=var_names + ) + select_var_2 = Select( + id="select_var_2", label="Variable 2", value=var_name_2, options=var_names ) - info_text = Typography( - id="info_text", text=update_info_text(ctx, dataset_id, opaque, color) + button = Button(id="button", text="Update", style={"maxWidth": 100}) + + controls = Box( + children=[select_var_1, select_var_2, button], + style={ + "display": "flex", + "flexDirection": "row", + "alignItems": "center", + "gap": 6, + "padding": 6, + }, ) return Box( + children=[plot, controls], style={ "display": "flex", "flexDirection": "column", + "alignItems": "center", "width": "100%", "height": "100%", - "gap": "6px", + "gap": 6, + "padding": 6, }, - children=[opaque_checkbox, color_dropdown, info_text], ) -# noinspection PyUnusedLocal @panel.callback( - Input(source="app", property="controlState.selectedDatasetId"), - Input("opaque"), - Input("color"), - State("info_text", "text"), - Output("info_text", "text"), + State("@app", "selectedDatasetId"), + State("@app", "selectedTimeLabel"), + State("@app", "selectedPlaceGeometry"), + State("select_var_1"), + State("select_var_2"), + Input("button", "clicked"), + Output("plot", "chart"), ) -def update_info_text( +def update_plot( ctx: Context, - dataset_id: str = "", - opaque: bool = False, - color: int = 0, - info_text: str = "", -) -> str: - ds_ctx = get_datasets_ctx(ctx) - ds_configs = ds_ctx.get_dataset_configs() - - opaque = opaque or False - color = color if color is not None else 0 - return ( - f"The dataset is {dataset_id}," - f" the color is {COLORS[color][0]} and" - f" it {'is' if opaque else 'is not'} opaque." - f" The length of the last info text" - f" was {len(info_text or "")}." - f" The number of datasets is {len(ds_configs)}." + dataset_id: str | None = None, + time_label: float | None = None, + place_geometry: str | None = None, + var_1_name: str | None = None, + var_2_name: str | None = None, + _clicked: bool | None = None, # trigger, will always be True +) -> alt.Chart | None: + dataset = get_dataset(ctx, dataset_id) + if dataset is None or not place_geometry or not var_1_name or not var_2_name: + # TODO: set error message in panel UI + print("panel disabled") + return None + + if "time" in dataset.coords: + if time_label: + dataset = dataset.sel(time=pd.Timestamp(time_label[0:-1]), method="nearest") + else: + dataset = dataset.isel(time=-1) + + grid_mapping = GridMapping.from_dataset(dataset) + place_geometry = normalize_geometry(place_geometry) + if place_geometry is not None and not grid_mapping.crs.is_geographic: + project = pyproj.Transformer.from_crs( + CRS_CRS84, grid_mapping.crs, always_xy=True + ).transform + place_geometry = shapely.ops.transform(project, place_geometry) + + dataset = mask_dataset_by_geometry(dataset, place_geometry) + if dataset is None: + # TODO: set error message in panel UI + print("dataset is None after masking, invalid geometry?") + return None + + var_1_data: np.ndarray = dataset[var_1_name].values.ravel() + var_2_data: np.ndarray = dataset[var_2_name].values.ravel() + var_1_range = [np.nanmin(var_1_data), np.nanmax(var_1_data)] + var_2_range = [np.nanmin(var_2_data), np.nanmax(var_2_data)] + num_bins = min(NUM_BINS_MAX, var_1_data.size) + hist2d, x_edges, y_edges = np.histogram2d( + var_1_data, + var_2_data, + bins=num_bins, + range=np.array([var_1_range, var_2_range]), + density=True, ) + # x and y 2D arrays with bin centers + x, y = np.meshgrid(np.arange(num_bins), np.arange(num_bins)) + # z = hist2d + z = np.where(hist2d > 0.0, hist2d, np.nan).T + source = pd.DataFrame( + {var_1_name: x.ravel(), var_2_name: y.ravel(), "z": z.ravel()} + ) + # TODO: use edges or center coordinates as tick labels. + x_centers = x_edges[0:-1] + np.diff(x_edges) / 2 + y_centers = y_edges[0:-1] + np.diff(y_edges) / 2 + # TODO: limit number of ticks on axes to, e.g., 10. + # TODO: allow chart to be adjusted to available container (
) size. + chart = ( + alt.Chart(source) + .mark_rect() + .encode( + x=alt.X( + f"{var_1_name}:O", + # scale=alt.Scale(bins=x_centers), + ), + y=alt.Y( + f"{var_2_name}:O", + sort="descending", + # scale=alt.Scale(bins=y_centers), + ), + color=alt.Color("z:Q", scale=alt.Scale(scheme="viridis"), title="Density"), + ) + ).properties(width=360, height=360) + + return chart + + +@panel.callback( + Input("@app", "selectedDatasetId"), + Input("@app", "selectedPlaceGeometry"), + Output("button", "disabled"), +) +def set_button_disablement( + _ctx: Context, + dataset_id: str | None = None, + place_geometry: str | None = None, +) -> bool: + return not dataset_id or not place_geometry + + +@panel.callback( + Input("@app", "selectedDatasetId"), + State("select_var_1", "value"), + State("select_var_2", "value"), + Output("select_var_1", "options"), + Output("select_var_1", "value"), + Output("select_var_2", "options"), + Output("select_var_2", "value"), +) +def populate_selects( + ctx: Context, + dataset_id: str | None = None, + var_name_1: str | None = None, + var_name_2: str | None = None, +) -> tuple[list, str | None, list, str | None]: + dataset = get_dataset(ctx, dataset_id) + var_names, var_name_1, var_name_2 = get_var_select_options( + dataset, var_name_1, var_name_2 + ) + return var_names, var_name_1, var_names, var_name_2 + + +def get_var_select_options( + dataset, + var_name_1: str | None = None, + var_name_2: str | None = None, +) -> tuple[list, str | None, str | None]: + + if dataset is not None: + var_names = [ + var_name + for var_name, var in dataset.data_vars.items() + if len(var.dims) >= 1 + ] + else: + var_names = [] + + if var_names: + if not var_name_1 or var_name_1 not in var_names: + var_name_1 = var_names[0] + if not var_name_2 or var_name_2 not in var_names: + var_name_2 = var_names[0] + + return var_names, var_name_1, var_name_2 + + +# TODO: Doesn't work. We need to ensure that show_progress() returns +# before update_plot() +# @panel.callback( +# Input("button", "clicked"), +# Output("button", ""), +# ) +def show_progress( + _ctx: Context, + _clicked: bool | None = None, # trigger, will always be True +) -> alt.Chart | None: + return CircularProgress(id="button", size=28) diff --git a/examples/serve/panels-demo/my_viewer_ext/my_panel_2.py b/examples/serve/panels-demo/my_viewer_ext/my_panel_2.py new file mode 100644 index 000000000..059b1816e --- /dev/null +++ b/examples/serve/panels-demo/my_viewer_ext/my_panel_2.py @@ -0,0 +1,85 @@ +from chartlets import Component, Input, State, Output +from chartlets.components import Box, Select, Checkbox, Typography + +from xcube.webapi.viewer.contrib import Panel +from xcube.webapi.viewer.contrib import get_datasets_ctx +from xcube.server.api import Context + + +panel = Panel(__name__, title="Panel B") + + +COLORS = [(0, "red"), (1, "green"), (2, "blue"), (3, "yellow")] + + +@panel.layout( + State("@app", "selectedDatasetId"), +) +def render_panel( + ctx: Context, + dataset_id: str = "", +) -> Component: + + opaque = False + color = 0 + + opaque_checkbox = Checkbox( + id="opaque", + value=opaque, + label="Opaque", + ) + + color_select = Select( + id="color", + value=color, + label="Color", + options=COLORS, + style={"flexGrow": 0, "minWidth": 80}, + ) + + info_text = Typography( + id="info_text", children=update_info_text(ctx, dataset_id, opaque, color) + ) + + return Box( + style={ + "display": "flex", + "flexDirection": "column", + "width": "100%", + "height": "100%", + "gap": "6px", + }, + children=[opaque_checkbox, color_select, info_text], + ) + + +# noinspection PyUnusedLocal +@panel.callback( + Input("@app", "selectedDatasetId"), + Input("opaque"), + Input("color"), + State("info_text", "children"), + Output("info_text", "children"), +) +def update_info_text( + ctx: Context, + dataset_id: str = "", + opaque: bool = False, + color: int = 0, + info_children: list[str] = "", +) -> list[str]: + ds_ctx = get_datasets_ctx(ctx) + ds_configs = ds_ctx.get_dataset_configs() + + info_text = info_children[0] if info_children else "" + + opaque = opaque or False + color = color if color is not None else 0 + return [ + f"The dataset is {dataset_id}," + f" the color is {COLORS[color][1]} and" + f" it {'is' if opaque else 'is not'} opaque." + f" The length of the last info text" + f" was {len(info_text or "")}." + f" The number of datasets is {len(ds_configs)}." + ] diff --git a/pyproject.toml b/pyproject.toml index 4f52fbd2c..0e4a89c9e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -23,6 +23,7 @@ dependencies = [ "cftime>=1.6.3", "click>=8.0", "cmocean>=2.0", + "chartlets>=0.0.28", "dask>=2021.6", "dask-image>=0.6", "deprecated>=1.2", diff --git a/test/webapi/res/viewer/extensions/my_ext/my_panel_a.py b/test/webapi/res/viewer/extensions/my_ext/my_panel_a.py index d9ac8a7a8..53dc944b3 100644 --- a/test/webapi/res/viewer/extensions/my_ext/my_panel_a.py +++ b/test/webapi/res/viewer/extensions/my_ext/my_panel_a.py @@ -1,5 +1,5 @@ from chartlets import Component, Input, State, Output -from chartlets.components import Box, Dropdown, Checkbox, Typography +from chartlets.components import Box, Select, Checkbox, Typography from xcube.webapi.viewer.contrib import Panel from xcube.webapi.viewer.contrib import get_datasets_ctx @@ -9,11 +9,11 @@ panel = Panel(__name__, title="Panel A") -COLORS = [("red", 0), ("green", 1), ("blue", 2), ("yellow", 3)] +COLORS = [(0, "red"), (1, "green"), (2, "blue"), (3, "yellow")] @panel.layout( - Input(source="app", property="controlState.selectedDatasetId"), + State("@app", "selectedDatasetId"), ) def render_panel( ctx: Context, @@ -29,7 +29,7 @@ def render_panel( label="Opaque", ) - color_dropdown = Dropdown( + color_Select = Select( id="color", value=color, label="Color", @@ -38,7 +38,7 @@ def render_panel( ) info_text = Typography( - id="info_text", text=update_info_text(ctx, dataset_id, opaque, color) + id="info_text", children=[update_info_text(ctx, dataset_id, opaque, color)] ) return Box( @@ -49,13 +49,13 @@ def render_panel( "height": "100%", "gap": "6px", }, - children=[opaque_checkbox, color_dropdown, info_text], + children=[opaque_checkbox, color_Select, info_text], ) # noinspection PyUnusedLocal @panel.callback( - Input(source="app", property="controlState.selectedDatasetId"), + Input("@app", "selectedDatasetId"), Input("opaque"), Input("color"), State("info_text", "text"), @@ -75,7 +75,7 @@ def update_info_text( color = color if color is not None else 0 return ( f"The dataset is {dataset_id}," - f" the color is {COLORS[color][0]} and" + f" the color is {COLORS[color][1]} and" f" it {'is' if opaque else 'is not'} opaque." f" The length of the last info text" f" was {len(info_text or "")}." diff --git a/test/webapi/res/viewer/extensions/my_ext/my_panel_b.py b/test/webapi/res/viewer/extensions/my_ext/my_panel_b.py index ffcd6693d..44cc9f5f9 100644 --- a/test/webapi/res/viewer/extensions/my_ext/my_panel_b.py +++ b/test/webapi/res/viewer/extensions/my_ext/my_panel_b.py @@ -1,5 +1,5 @@ from chartlets import Component, Input, State, Output -from chartlets.components import Box, Dropdown, Checkbox, Typography +from chartlets.components import Box, Select, Checkbox, Typography from xcube.webapi.viewer.contrib import Panel from xcube.webapi.viewer.contrib import get_datasets_ctx @@ -9,11 +9,11 @@ panel = Panel(__name__, title="Panel B") -COLORS = [("red", 0), ("green", 1), ("blue", 2), ("yellow", 3)] +COLORS = [(0, "red"), (1, "green"), (2, "blue"), (3, "yellow")] @panel.layout( - Input(source="app", property="controlState.selectedDatasetId"), + State("@app", "selectedDatasetId"), ) def render_panel( ctx: Context, @@ -29,7 +29,7 @@ def render_panel( label="Opaque", ) - color_dropdown = Dropdown( + color_Select = Select( id="color", value=color, label="Color", @@ -38,7 +38,7 @@ def render_panel( ) info_text = Typography( - id="info_text", text=update_info_text(ctx, dataset_id, opaque, color) + id="info_text", children=[update_info_text(ctx, dataset_id, opaque, color)] ) return Box( @@ -49,13 +49,13 @@ def render_panel( "height": "100%", "gap": "6px", }, - children=[opaque_checkbox, color_dropdown, info_text], + children=[opaque_checkbox, color_Select, info_text], ) # noinspection PyUnusedLocal @panel.callback( - Input(source="app", property="controlState.selectedDatasetId"), + Input("@app", "selectedDatasetId"), Input("opaque"), Input("color"), State("info_text", "text"), @@ -75,7 +75,7 @@ def update_info_text( color = color if color is not None else 0 return ( f"The dataset is {dataset_id}," - f" the color is {COLORS[color][0]} and" + f" the color is {COLORS[color][1]} and" f" it {'is' if opaque else 'is not'} opaque." f" The length of the last info text" f" was {len(info_text or "")}." diff --git a/test/webapi/viewer/test_routes.py b/test/webapi/viewer/test_routes.py index 9698bd01c..e48cf9e44 100644 --- a/test/webapi/viewer/test_routes.py +++ b/test/webapi/viewer/test_routes.py @@ -144,38 +144,35 @@ def test_viewer_ext_callback(self): "stateChanges": [ { "id": "info_text", - "link": "component", "property": "text", - "value": ( - "The dataset is , the color is green " - "and it is opaque. The length of the " - "last info text was 0. The number of " - "datasets is 1." - ), + "value": "The dataset is , the color is green and " + "it is opaque. The length of the last " + "info text was 0. The number of " + "datasets is 1.", } ], } ] expected_layout_result = { - "components": [ + "children": [ {"id": "opaque", "label": "Opaque", "type": "Checkbox", "value": False}, { "id": "color", "label": "Color", - "options": [["red", 0], ["green", 1], ["blue", 2], ["yellow", 3]], + "options": [[0, "red"], [1, "green"], [2, "blue"], [3, "yellow"]], "style": {"flexGrow": 0, "minWidth": 80}, - "type": "Dropdown", + "type": "Select", "value": 0, }, { - "id": "info_text", - "text": ( + "children": [ "The dataset is , the color is red and it " "is not opaque. The length of the last " - "info text was 0. The number of datasets " - "is 1." - ), + "info text was 0. The number of " + "datasets is 1." + ], + "id": "info_text", "type": "Typography", }, ], @@ -223,21 +220,18 @@ def test_viewer_ext_callback(self): }, "inputs": [ { - "link": "app", - "property": "controlState.selectedDatasetId", + "id": "@app", + "property": "selectedDatasetId", }, - {"id": "opaque", "link": "component", "property": "value"}, - {"id": "color", "link": "component", "property": "value"}, + {"id": "opaque", "property": "value"}, + {"id": "color", "property": "value"}, { "id": "info_text", - "link": "component", "noTrigger": True, "property": "text", }, ], - "outputs": [ - {"id": "info_text", "link": "component", "property": "text"} - ], + "outputs": [{"id": "info_text", "property": "text"}], } ], "extension": "my_ext", @@ -255,7 +249,11 @@ def test_viewer_ext_callback(self): "returnType": {"class": "Component", "type": "object"}, }, "inputs": [ - {"link": "app", "property": "controlState.selectedDatasetId"} + { + "id": "@app", + "noTrigger": True, + "property": "selectedDatasetId", + } ], }, "name": "my_ext.my_panel_a", @@ -291,21 +289,18 @@ def test_viewer_ext_callback(self): }, "inputs": [ { - "link": "app", - "property": "controlState.selectedDatasetId", + "id": "@app", + "property": "selectedDatasetId", }, - {"id": "opaque", "link": "component", "property": "value"}, - {"id": "color", "link": "component", "property": "value"}, + {"id": "opaque", "property": "value"}, + {"id": "color", "property": "value"}, { "id": "info_text", - "link": "component", "noTrigger": True, "property": "text", }, ], - "outputs": [ - {"id": "info_text", "link": "component", "property": "text"} - ], + "outputs": [{"id": "info_text", "property": "text"}], } ], "extension": "my_ext", @@ -323,7 +318,11 @@ def test_viewer_ext_callback(self): "returnType": {"class": "Component", "type": "object"}, }, "inputs": [ - {"link": "app", "property": "controlState.selectedDatasetId"} + { + "id": "@app", + "noTrigger": True, + "property": "selectedDatasetId", + } ], }, "name": "my_ext.my_panel_b", diff --git a/xcube/webapi/viewer/contrib/__init__.py b/xcube/webapi/viewer/contrib/__init__.py index 2cff08958..b9efda0ea 100644 --- a/xcube/webapi/viewer/contrib/__init__.py +++ b/xcube/webapi/viewer/contrib/__init__.py @@ -1,3 +1,4 @@ from .helpers import get_datasets_ctx +from .helpers import get_dataset from .panel import Panel diff --git a/xcube/webapi/viewer/contrib/helpers.py b/xcube/webapi/viewer/contrib/helpers.py index 9d02e63c1..c1ef469fd 100644 --- a/xcube/webapi/viewer/contrib/helpers.py +++ b/xcube/webapi/viewer/contrib/helpers.py @@ -1,6 +1,12 @@ +import xarray as xr + from xcube.webapi.datasets.context import DatasetsContext from xcube.server.api import Context def get_datasets_ctx(ctx: Context) -> DatasetsContext: return ctx.get_api_ctx("datasets") + + +def get_dataset(ctx: Context, dataset_id: str | None = None) -> xr.Dataset | None: + return get_datasets_ctx(ctx).get_dataset(dataset_id) if dataset_id else None diff --git a/xcube/webapi/viewer/dist/assets/index-C5oSmiUD.js b/xcube/webapi/viewer/dist/assets/index-Bau6iqYV.js similarity index 60% rename from xcube/webapi/viewer/dist/assets/index-C5oSmiUD.js rename to xcube/webapi/viewer/dist/assets/index-Bau6iqYV.js index d390ce0ee..3a544558d 100644 --- a/xcube/webapi/viewer/dist/assets/index-C5oSmiUD.js +++ b/xcube/webapi/viewer/dist/assets/index-Bau6iqYV.js @@ -1,4 +1,4 @@ -var yYe=Object.defineProperty;var xYe=(t,e,n)=>e in t?yYe(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n;var gn=(t,e,n)=>xYe(t,typeof e!="symbol"?e+"":e,n);function bYe(t,e){for(var n=0;nr[i]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))r(i);new MutationObserver(i=>{for(const o of i)if(o.type==="childList")for(const s of o.addedNodes)s.tagName==="LINK"&&s.rel==="modulepreload"&&r(s)}).observe(document,{childList:!0,subtree:!0});function n(i){const o={};return i.integrity&&(o.integrity=i.integrity),i.referrerPolicy&&(o.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?o.credentials="include":i.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function r(i){if(i.ep)return;i.ep=!0;const o=n(i);fetch(i.href,o)}})();var ei=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function on(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function LEe(t){if(t.__esModule)return t;var e=t.default;if(typeof e=="function"){var n=function r(){return this instanceof r?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};n.prototype=e.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(t).forEach(function(r){var i=Object.getOwnPropertyDescriptor(t,r);Object.defineProperty(n,r,i.get?i:{enumerable:!0,get:function(){return t[r]}})}),n}var $Ee={exports:{}},hj={},FEe={exports:{}},kn={};/** +var GYe=Object.defineProperty;var HYe=(t,e,n)=>e in t?GYe(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n;var gn=(t,e,n)=>HYe(t,typeof e!="symbol"?e+"":e,n);function qYe(t,e){for(var n=0;nr[i]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))r(i);new MutationObserver(i=>{for(const o of i)if(o.type==="childList")for(const s of o.addedNodes)s.tagName==="LINK"&&s.rel==="modulepreload"&&r(s)}).observe(document,{childList:!0,subtree:!0});function n(i){const o={};return i.integrity&&(o.integrity=i.integrity),i.referrerPolicy&&(o.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?o.credentials="include":i.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function r(i){if(i.ep)return;i.ep=!0;const o=n(i);fetch(i.href,o)}})();var ei=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function sn(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function l2e(t){if(t.__esModule)return t;var e=t.default;if(typeof e=="function"){var n=function r(){return this instanceof r?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};n.prototype=e.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(t).forEach(function(r){var i=Object.getOwnPropertyDescriptor(t,r);Object.defineProperty(n,r,i.get?i:{enumerable:!0,get:function(){return t[r]}})}),n}var c2e={exports:{}},cj={},u2e={exports:{}},Tn={};/** * @license React * react.production.min.js * @@ -6,7 +6,7 @@ var yYe=Object.defineProperty;var xYe=(t,e,n)=>e in t?yYe(t,e,{enumerable:!0,con * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var lM=Symbol.for("react.element"),wYe=Symbol.for("react.portal"),_Ye=Symbol.for("react.fragment"),SYe=Symbol.for("react.strict_mode"),CYe=Symbol.for("react.profiler"),OYe=Symbol.for("react.provider"),EYe=Symbol.for("react.context"),TYe=Symbol.for("react.forward_ref"),kYe=Symbol.for("react.suspense"),AYe=Symbol.for("react.memo"),PYe=Symbol.for("react.lazy"),Xce=Symbol.iterator;function MYe(t){return t===null||typeof t!="object"?null:(t=Xce&&t[Xce]||t["@@iterator"],typeof t=="function"?t:null)}var NEe={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},zEe=Object.assign,jEe={};function VC(t,e,n){this.props=t,this.context=e,this.refs=jEe,this.updater=n||NEe}VC.prototype.isReactComponent={};VC.prototype.setState=function(t,e){if(typeof t!="object"&&typeof t!="function"&&t!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,t,e,"setState")};VC.prototype.forceUpdate=function(t){this.updater.enqueueForceUpdate(this,t,"forceUpdate")};function BEe(){}BEe.prototype=VC.prototype;function XZ(t,e,n){this.props=t,this.context=e,this.refs=jEe,this.updater=n||NEe}var YZ=XZ.prototype=new BEe;YZ.constructor=XZ;zEe(YZ,VC.prototype);YZ.isPureReactComponent=!0;var Yce=Array.isArray,UEe=Object.prototype.hasOwnProperty,QZ={current:null},WEe={key:!0,ref:!0,__self:!0,__source:!0};function VEe(t,e,n){var r,i={},o=null,s=null;if(e!=null)for(r in e.ref!==void 0&&(s=e.ref),e.key!==void 0&&(o=""+e.key),e)UEe.call(e,r)&&!WEe.hasOwnProperty(r)&&(i[r]=e[r]);var a=arguments.length-2;if(a===1)i.children=n;else if(1e in t?yYe(t,e,{enumerable:!0,con * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var $Ye=D,FYe=Symbol.for("react.element"),NYe=Symbol.for("react.fragment"),zYe=Object.prototype.hasOwnProperty,jYe=$Ye.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,BYe={key:!0,ref:!0,__self:!0,__source:!0};function HEe(t,e,n){var r,i={},o=null,s=null;n!==void 0&&(o=""+n),e.key!==void 0&&(o=""+e.key),e.ref!==void 0&&(s=e.ref);for(r in e)zYe.call(e,r)&&!BYe.hasOwnProperty(r)&&(i[r]=e[r]);if(t&&t.defaultProps)for(r in e=t.defaultProps,e)i[r]===void 0&&(i[r]=e[r]);return{$$typeof:FYe,type:t,key:o,ref:s,props:i,_owner:jYe.current}}hj.Fragment=NYe;hj.jsx=HEe;hj.jsxs=HEe;$Ee.exports=hj;var C=$Ee.exports,$G={},qEe={exports:{}},Pc={},XEe={exports:{}},YEe={};/** + */var cQe=D,uQe=Symbol.for("react.element"),fQe=Symbol.for("react.fragment"),dQe=Object.prototype.hasOwnProperty,hQe=cQe.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,pQe={key:!0,ref:!0,__self:!0,__source:!0};function x2e(t,e,n){var r,i={},o=null,s=null;n!==void 0&&(o=""+n),e.key!==void 0&&(o=""+e.key),e.ref!==void 0&&(s=e.ref);for(r in e)dQe.call(e,r)&&!pQe.hasOwnProperty(r)&&(i[r]=e[r]);if(t&&t.defaultProps)for(r in e=t.defaultProps,e)i[r]===void 0&&(i[r]=e[r]);return{$$typeof:uQe,type:t,key:o,ref:s,props:i,_owner:hQe.current}}cj.Fragment=fQe;cj.jsx=x2e;cj.jsxs=x2e;c2e.exports=cj;var C=c2e.exports,KG={},b2e={exports:{}},Ac={},w2e={exports:{}},_2e={};/** * @license React * scheduler.production.min.js * @@ -22,7 +22,7 @@ var yYe=Object.defineProperty;var xYe=(t,e,n)=>e in t?yYe(t,e,{enumerable:!0,con * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */(function(t){function e($,z){var L=$.length;$.push(z);e:for(;0>>1,N=$[j];if(0>>1;ji(q,L))Yi(le,q)?($[j]=le,$[Y]=L,j=Y):($[j]=q,$[H]=L,j=H);else if(Yi(le,L))$[j]=le,$[Y]=L,j=Y;else break e}}return z}function i($,z){var L=$.sortIndex-z.sortIndex;return L!==0?L:$.id-z.id}if(typeof performance=="object"&&typeof performance.now=="function"){var o=performance;t.unstable_now=function(){return o.now()}}else{var s=Date,a=s.now();t.unstable_now=function(){return s.now()-a}}var l=[],c=[],u=1,f=null,d=3,h=!1,p=!1,g=!1,m=typeof setTimeout=="function"?setTimeout:null,v=typeof clearTimeout=="function"?clearTimeout:null,y=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function x($){for(var z=n(c);z!==null;){if(z.callback===null)r(c);else if(z.startTime<=$)r(c),z.sortIndex=z.expirationTime,e(l,z);else break;z=n(c)}}function b($){if(g=!1,x($),!p)if(n(l)!==null)p=!0,I(w);else{var z=n(c);z!==null&&B(b,z.startTime-$)}}function w($,z){p=!1,g&&(g=!1,v(O),O=-1),h=!0;var L=d;try{for(x(z),f=n(l);f!==null&&(!(f.expirationTime>z)||$&&!M());){var j=f.callback;if(typeof j=="function"){f.callback=null,d=f.priorityLevel;var N=j(f.expirationTime<=z);z=t.unstable_now(),typeof N=="function"?f.callback=N:f===n(l)&&r(l),x(z)}else r(l);f=n(l)}if(f!==null)var F=!0;else{var H=n(c);H!==null&&B(b,H.startTime-z),F=!1}return F}finally{f=null,d=L,h=!1}}var _=!1,S=null,O=-1,k=5,E=-1;function M(){return!(t.unstable_now()-E$||125<$?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):k=0<$?Math.floor(1e3/$):5},t.unstable_getCurrentPriorityLevel=function(){return d},t.unstable_getFirstCallbackNode=function(){return n(l)},t.unstable_next=function($){switch(d){case 1:case 2:case 3:var z=3;break;default:z=d}var L=d;d=z;try{return $()}finally{d=L}},t.unstable_pauseExecution=function(){},t.unstable_requestPaint=function(){},t.unstable_runWithPriority=function($,z){switch($){case 1:case 2:case 3:case 4:case 5:break;default:$=3}var L=d;d=$;try{return z()}finally{d=L}},t.unstable_scheduleCallback=function($,z,L){var j=t.unstable_now();switch(typeof L=="object"&&L!==null?(L=L.delay,L=typeof L=="number"&&0j?($.sortIndex=L,e(c,$),n(l)===null&&$===n(c)&&(g?(v(O),O=-1):g=!0,B(b,L-j))):($.sortIndex=N,e(l,$),p||h||(p=!0,I(w))),$},t.unstable_shouldYield=M,t.unstable_wrapCallback=function($){var z=d;return function(){var L=d;d=z;try{return $.apply(this,arguments)}finally{d=L}}}})(YEe);XEe.exports=YEe;var UYe=XEe.exports;/** + */(function(t){function e(N,z){var L=N.length;N.push(z);e:for(;0>>1,F=N[B];if(0>>1;B<$;){var q=2*(B+1)-1,G=N[q],Y=q+1,le=N[Y];if(0>i(G,L))Yi(le,G)?(N[B]=le,N[Y]=L,B=Y):(N[B]=G,N[q]=L,B=q);else if(Yi(le,L))N[B]=le,N[Y]=L,B=Y;else break e}}return z}function i(N,z){var L=N.sortIndex-z.sortIndex;return L!==0?L:N.id-z.id}if(typeof performance=="object"&&typeof performance.now=="function"){var o=performance;t.unstable_now=function(){return o.now()}}else{var s=Date,a=s.now();t.unstable_now=function(){return s.now()-a}}var l=[],c=[],u=1,f=null,d=3,h=!1,p=!1,g=!1,m=typeof setTimeout=="function"?setTimeout:null,v=typeof clearTimeout=="function"?clearTimeout:null,y=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function x(N){for(var z=n(c);z!==null;){if(z.callback===null)r(c);else if(z.startTime<=N)r(c),z.sortIndex=z.expirationTime,e(l,z);else break;z=n(c)}}function b(N){if(g=!1,x(N),!p)if(n(l)!==null)p=!0,I(w);else{var z=n(c);z!==null&&j(b,z.startTime-N)}}function w(N,z){p=!1,g&&(g=!1,v(O),O=-1),h=!0;var L=d;try{for(x(z),f=n(l);f!==null&&(!(f.expirationTime>z)||N&&!P());){var B=f.callback;if(typeof B=="function"){f.callback=null,d=f.priorityLevel;var F=B(f.expirationTime<=z);z=t.unstable_now(),typeof F=="function"?f.callback=F:f===n(l)&&r(l),x(z)}else r(l);f=n(l)}if(f!==null)var $=!0;else{var q=n(c);q!==null&&j(b,q.startTime-z),$=!1}return $}finally{f=null,d=L,h=!1}}var _=!1,S=null,O=-1,k=5,E=-1;function P(){return!(t.unstable_now()-EN||125B?(N.sortIndex=L,e(c,N),n(l)===null&&N===n(c)&&(g?(v(O),O=-1):g=!0,j(b,L-B))):(N.sortIndex=F,e(l,N),p||h||(p=!0,I(w))),N},t.unstable_shouldYield=P,t.unstable_wrapCallback=function(N){var z=d;return function(){var L=d;d=z;try{return N.apply(this,arguments)}finally{d=L}}}})(_2e);w2e.exports=_2e;var gQe=w2e.exports;/** * @license React * react-dom.production.min.js * @@ -30,28 +30,28 @@ var yYe=Object.defineProperty;var xYe=(t,e,n)=>e in t?yYe(t,e,{enumerable:!0,con * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var WYe=D,xc=UYe;function et(t){for(var e="https://reactjs.org/docs/error-decoder.html?invariant="+t,n=1;n"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),FG=Object.prototype.hasOwnProperty,VYe=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,Kce={},Zce={};function GYe(t){return FG.call(Zce,t)?!0:FG.call(Kce,t)?!1:VYe.test(t)?Zce[t]=!0:(Kce[t]=!0,!1)}function HYe(t,e,n,r){if(n!==null&&n.type===0)return!1;switch(typeof e){case"function":case"symbol":return!0;case"boolean":return r?!1:n!==null?!n.acceptsBooleans:(t=t.toLowerCase().slice(0,5),t!=="data-"&&t!=="aria-");default:return!1}}function qYe(t,e,n,r){if(e===null||typeof e>"u"||HYe(t,e,n,r))return!0;if(r)return!1;if(n!==null)switch(n.type){case 3:return!e;case 4:return e===!1;case 5:return isNaN(e);case 6:return isNaN(e)||1>e}return!1}function Fa(t,e,n,r,i,o,s){this.acceptsBooleans=e===2||e===3||e===4,this.attributeName=r,this.attributeNamespace=i,this.mustUseProperty=n,this.propertyName=t,this.type=e,this.sanitizeURL=o,this.removeEmptyString=s}var _s={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(t){_s[t]=new Fa(t,0,!1,t,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(t){var e=t[0];_s[e]=new Fa(e,1,!1,t[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(t){_s[t]=new Fa(t,2,!1,t.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(t){_s[t]=new Fa(t,2,!1,t,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(t){_s[t]=new Fa(t,3,!1,t.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(t){_s[t]=new Fa(t,3,!0,t,null,!1,!1)});["capture","download"].forEach(function(t){_s[t]=new Fa(t,4,!1,t,null,!1,!1)});["cols","rows","size","span"].forEach(function(t){_s[t]=new Fa(t,6,!1,t,null,!1,!1)});["rowSpan","start"].forEach(function(t){_s[t]=new Fa(t,5,!1,t.toLowerCase(),null,!1,!1)});var ZZ=/[\-:]([a-z])/g;function JZ(t){return t[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(t){var e=t.replace(ZZ,JZ);_s[e]=new Fa(e,1,!1,t,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(t){var e=t.replace(ZZ,JZ);_s[e]=new Fa(e,1,!1,t,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(t){var e=t.replace(ZZ,JZ);_s[e]=new Fa(e,1,!1,t,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(t){_s[t]=new Fa(t,1,!1,t.toLowerCase(),null,!1,!1)});_s.xlinkHref=new Fa("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(t){_s[t]=new Fa(t,1,!1,t.toLowerCase(),null,!0,!0)});function eJ(t,e,n,r){var i=_s.hasOwnProperty(e)?_s[e]:null;(i!==null?i.type!==0:r||!(2"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),ZG=Object.prototype.hasOwnProperty,vQe=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,gue={},mue={};function yQe(t){return ZG.call(mue,t)?!0:ZG.call(gue,t)?!1:vQe.test(t)?mue[t]=!0:(gue[t]=!0,!1)}function xQe(t,e,n,r){if(n!==null&&n.type===0)return!1;switch(typeof e){case"function":case"symbol":return!0;case"boolean":return r?!1:n!==null?!n.acceptsBooleans:(t=t.toLowerCase().slice(0,5),t!=="data-"&&t!=="aria-");default:return!1}}function bQe(t,e,n,r){if(e===null||typeof e>"u"||xQe(t,e,n,r))return!0;if(r)return!1;if(n!==null)switch(n.type){case 3:return!e;case 4:return e===!1;case 5:return isNaN(e);case 6:return isNaN(e)||1>e}return!1}function La(t,e,n,r,i,o,s){this.acceptsBooleans=e===2||e===3||e===4,this.attributeName=r,this.attributeNamespace=i,this.mustUseProperty=n,this.propertyName=t,this.type=e,this.sanitizeURL=o,this.removeEmptyString=s}var ws={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(t){ws[t]=new La(t,0,!1,t,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(t){var e=t[0];ws[e]=new La(e,1,!1,t[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(t){ws[t]=new La(t,2,!1,t.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(t){ws[t]=new La(t,2,!1,t,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(t){ws[t]=new La(t,3,!1,t.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(t){ws[t]=new La(t,3,!0,t,null,!1,!1)});["capture","download"].forEach(function(t){ws[t]=new La(t,4,!1,t,null,!1,!1)});["cols","rows","size","span"].forEach(function(t){ws[t]=new La(t,6,!1,t,null,!1,!1)});["rowSpan","start"].forEach(function(t){ws[t]=new La(t,5,!1,t.toLowerCase(),null,!1,!1)});var pJ=/[\-:]([a-z])/g;function gJ(t){return t[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(t){var e=t.replace(pJ,gJ);ws[e]=new La(e,1,!1,t,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(t){var e=t.replace(pJ,gJ);ws[e]=new La(e,1,!1,t,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(t){var e=t.replace(pJ,gJ);ws[e]=new La(e,1,!1,t,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(t){ws[t]=new La(t,1,!1,t.toLowerCase(),null,!1,!1)});ws.xlinkHref=new La("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(t){ws[t]=new La(t,1,!1,t.toLowerCase(),null,!0,!0)});function mJ(t,e,n,r){var i=ws.hasOwnProperty(e)?ws[e]:null;(i!==null?i.type!==0:r||!(2a||i[s]!==o[a]){var l=` -`+i[s].replace(" at new "," at ");return t.displayName&&l.includes("")&&(l=l.replace("",t.displayName)),l}while(1<=s&&0<=a);break}}}finally{_8=!1,Error.prepareStackTrace=n}return(t=t?t.displayName||t.name:"")?W2(t):""}function XYe(t){switch(t.tag){case 5:return W2(t.type);case 16:return W2("Lazy");case 13:return W2("Suspense");case 19:return W2("SuspenseList");case 0:case 2:case 15:return t=S8(t.type,!1),t;case 11:return t=S8(t.type.render,!1),t;case 1:return t=S8(t.type,!0),t;default:return""}}function BG(t){if(t==null)return null;if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t;switch(t){case Vw:return"Fragment";case Ww:return"Portal";case NG:return"Profiler";case tJ:return"StrictMode";case zG:return"Suspense";case jG:return"SuspenseList"}if(typeof t=="object")switch(t.$$typeof){case ZEe:return(t.displayName||"Context")+".Consumer";case KEe:return(t._context.displayName||"Context")+".Provider";case nJ:var e=t.render;return t=t.displayName,t||(t=e.displayName||e.name||"",t=t!==""?"ForwardRef("+t+")":"ForwardRef"),t;case rJ:return e=t.displayName||null,e!==null?e:BG(t.type)||"Memo";case Nm:e=t._payload,t=t._init;try{return BG(t(e))}catch{}}return null}function YYe(t){var e=t.type;switch(t.tag){case 24:return"Cache";case 9:return(e.displayName||"Context")+".Consumer";case 10:return(e._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return t=e.render,t=t.displayName||t.name||"",e.displayName||(t!==""?"ForwardRef("+t+")":"ForwardRef");case 7:return"Fragment";case 5:return e;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return BG(e);case 8:return e===tJ?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e}return null}function Xv(t){switch(typeof t){case"boolean":case"number":case"string":case"undefined":return t;case"object":return t;default:return""}}function e2e(t){var e=t.type;return(t=t.nodeName)&&t.toLowerCase()==="input"&&(e==="checkbox"||e==="radio")}function QYe(t){var e=e2e(t)?"checked":"value",n=Object.getOwnPropertyDescriptor(t.constructor.prototype,e),r=""+t[e];if(!t.hasOwnProperty(e)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var i=n.get,o=n.set;return Object.defineProperty(t,e,{configurable:!0,get:function(){return i.call(this)},set:function(s){r=""+s,o.call(this,s)}}),Object.defineProperty(t,e,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(s){r=""+s},stopTracking:function(){t._valueTracker=null,delete t[e]}}}}function RD(t){t._valueTracker||(t._valueTracker=QYe(t))}function t2e(t){if(!t)return!1;var e=t._valueTracker;if(!e)return!0;var n=e.getValue(),r="";return t&&(r=e2e(t)?t.checked?"true":"false":t.value),t=r,t!==n?(e.setValue(t),!0):!1}function rF(t){if(t=t||(typeof document<"u"?document:void 0),typeof t>"u")return null;try{return t.activeElement||t.body}catch{return t.body}}function UG(t,e){var n=e.checked;return Oi({},e,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??t._wrapperState.initialChecked})}function eue(t,e){var n=e.defaultValue==null?"":e.defaultValue,r=e.checked!=null?e.checked:e.defaultChecked;n=Xv(e.value!=null?e.value:n),t._wrapperState={initialChecked:r,initialValue:n,controlled:e.type==="checkbox"||e.type==="radio"?e.checked!=null:e.value!=null}}function n2e(t,e){e=e.checked,e!=null&&eJ(t,"checked",e,!1)}function WG(t,e){n2e(t,e);var n=Xv(e.value),r=e.type;if(n!=null)r==="number"?(n===0&&t.value===""||t.value!=n)&&(t.value=""+n):t.value!==""+n&&(t.value=""+n);else if(r==="submit"||r==="reset"){t.removeAttribute("value");return}e.hasOwnProperty("value")?VG(t,e.type,n):e.hasOwnProperty("defaultValue")&&VG(t,e.type,Xv(e.defaultValue)),e.checked==null&&e.defaultChecked!=null&&(t.defaultChecked=!!e.defaultChecked)}function tue(t,e,n){if(e.hasOwnProperty("value")||e.hasOwnProperty("defaultValue")){var r=e.type;if(!(r!=="submit"&&r!=="reset"||e.value!==void 0&&e.value!==null))return;e=""+t._wrapperState.initialValue,n||e===t.value||(t.value=e),t.defaultValue=e}n=t.name,n!==""&&(t.name=""),t.defaultChecked=!!t._wrapperState.initialChecked,n!==""&&(t.name=n)}function VG(t,e,n){(e!=="number"||rF(t.ownerDocument)!==t)&&(n==null?t.defaultValue=""+t._wrapperState.initialValue:t.defaultValue!==""+n&&(t.defaultValue=""+n))}var V2=Array.isArray;function S_(t,e,n,r){if(t=t.options,e){e={};for(var i=0;i"+e.valueOf().toString()+"",e=DD.firstChild;t.firstChild;)t.removeChild(t.firstChild);for(;e.firstChild;)t.appendChild(e.firstChild)}});function Fk(t,e){if(e){var n=t.firstChild;if(n&&n===t.lastChild&&n.nodeType===3){n.nodeValue=e;return}}t.textContent=e}var zT={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},KYe=["Webkit","ms","Moz","O"];Object.keys(zT).forEach(function(t){KYe.forEach(function(e){e=e+t.charAt(0).toUpperCase()+t.substring(1),zT[e]=zT[t]})});function s2e(t,e,n){return e==null||typeof e=="boolean"||e===""?"":n||typeof e!="number"||e===0||zT.hasOwnProperty(t)&&zT[t]?(""+e).trim():e+"px"}function a2e(t,e){t=t.style;for(var n in e)if(e.hasOwnProperty(n)){var r=n.indexOf("--")===0,i=s2e(n,e[n],r);n==="float"&&(n="cssFloat"),r?t.setProperty(n,i):t[n]=i}}var ZYe=Oi({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function qG(t,e){if(e){if(ZYe[t]&&(e.children!=null||e.dangerouslySetInnerHTML!=null))throw Error(et(137,t));if(e.dangerouslySetInnerHTML!=null){if(e.children!=null)throw Error(et(60));if(typeof e.dangerouslySetInnerHTML!="object"||!("__html"in e.dangerouslySetInnerHTML))throw Error(et(61))}if(e.style!=null&&typeof e.style!="object")throw Error(et(62))}}function XG(t,e){if(t.indexOf("-")===-1)return typeof e.is=="string";switch(t){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var YG=null;function iJ(t){return t=t.target||t.srcElement||window,t.correspondingUseElement&&(t=t.correspondingUseElement),t.nodeType===3?t.parentNode:t}var QG=null,C_=null,O_=null;function iue(t){if(t=fM(t)){if(typeof QG!="function")throw Error(et(280));var e=t.stateNode;e&&(e=yj(e),QG(t.stateNode,t.type,e))}}function l2e(t){C_?O_?O_.push(t):O_=[t]:C_=t}function c2e(){if(C_){var t=C_,e=O_;if(O_=C_=null,iue(t),e)for(t=0;t>>=0,t===0?32:31-(cQe(t)/uQe|0)|0}var ID=64,LD=4194304;function G2(t){switch(t&-t){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return t&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return t}}function aF(t,e){var n=t.pendingLanes;if(n===0)return 0;var r=0,i=t.suspendedLanes,o=t.pingedLanes,s=n&268435455;if(s!==0){var a=s&~i;a!==0?r=G2(a):(o&=s,o!==0&&(r=G2(o)))}else s=n&~i,s!==0?r=G2(s):o!==0&&(r=G2(o));if(r===0)return 0;if(e!==0&&e!==r&&!(e&i)&&(i=r&-r,o=e&-e,i>=o||i===16&&(o&4194240)!==0))return e;if(r&4&&(r|=n&16),e=t.entangledLanes,e!==0)for(t=t.entanglements,e&=r;0n;n++)e.push(t);return e}function cM(t,e,n){t.pendingLanes|=e,e!==536870912&&(t.suspendedLanes=0,t.pingedLanes=0),t=t.eventTimes,e=31-Mf(e),t[e]=n}function pQe(t,e){var n=t.pendingLanes&~e;t.pendingLanes=e,t.suspendedLanes=0,t.pingedLanes=0,t.expiredLanes&=e,t.mutableReadLanes&=e,t.entangledLanes&=e,e=t.entanglements;var r=t.eventTimes;for(t=t.expirationTimes;0=BT),hue=" ",pue=!1;function A2e(t,e){switch(t){case"keyup":return UQe.indexOf(e.keyCode)!==-1;case"keydown":return e.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function P2e(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var Gw=!1;function VQe(t,e){switch(t){case"compositionend":return P2e(e);case"keypress":return e.which!==32?null:(pue=!0,hue);case"textInput":return t=e.data,t===hue&&pue?null:t;default:return null}}function GQe(t,e){if(Gw)return t==="compositionend"||!dJ&&A2e(t,e)?(t=T2e(),H$=cJ=av=null,Gw=!1,t):null;switch(t){case"paste":return null;case"keypress":if(!(e.ctrlKey||e.altKey||e.metaKey)||e.ctrlKey&&e.altKey){if(e.char&&1=e)return{node:n,offset:e-t};t=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=yue(n)}}function I2e(t,e){return t&&e?t===e?!0:t&&t.nodeType===3?!1:e&&e.nodeType===3?I2e(t,e.parentNode):"contains"in t?t.contains(e):t.compareDocumentPosition?!!(t.compareDocumentPosition(e)&16):!1:!1}function L2e(){for(var t=window,e=rF();e instanceof t.HTMLIFrameElement;){try{var n=typeof e.contentWindow.location.href=="string"}catch{n=!1}if(n)t=e.contentWindow;else break;e=rF(t.document)}return e}function hJ(t){var e=t&&t.nodeName&&t.nodeName.toLowerCase();return e&&(e==="input"&&(t.type==="text"||t.type==="search"||t.type==="tel"||t.type==="url"||t.type==="password")||e==="textarea"||t.contentEditable==="true")}function eKe(t){var e=L2e(),n=t.focusedElem,r=t.selectionRange;if(e!==n&&n&&n.ownerDocument&&I2e(n.ownerDocument.documentElement,n)){if(r!==null&&hJ(n)){if(e=r.start,t=r.end,t===void 0&&(t=e),"selectionStart"in n)n.selectionStart=e,n.selectionEnd=Math.min(t,n.value.length);else if(t=(e=n.ownerDocument||document)&&e.defaultView||window,t.getSelection){t=t.getSelection();var i=n.textContent.length,o=Math.min(r.start,i);r=r.end===void 0?o:Math.min(r.end,i),!t.extend&&o>r&&(i=r,r=o,o=i),i=xue(n,o);var s=xue(n,r);i&&s&&(t.rangeCount!==1||t.anchorNode!==i.node||t.anchorOffset!==i.offset||t.focusNode!==s.node||t.focusOffset!==s.offset)&&(e=e.createRange(),e.setStart(i.node,i.offset),t.removeAllRanges(),o>r?(t.addRange(e),t.extend(s.node,s.offset)):(e.setEnd(s.node,s.offset),t.addRange(e)))}}for(e=[],t=n;t=t.parentNode;)t.nodeType===1&&e.push({element:t,left:t.scrollLeft,top:t.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n=document.documentMode,Hw=null,nH=null,WT=null,rH=!1;function bue(t,e,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;rH||Hw==null||Hw!==rF(r)||(r=Hw,"selectionStart"in r&&hJ(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),WT&&Wk(WT,r)||(WT=r,r=uF(nH,"onSelect"),0Yw||(t.current=cH[Yw],cH[Yw]=null,Yw--)}function jr(t,e){Yw++,cH[Yw]=t.current,t.current=e}var Yv={},ta=Ay(Yv),ul=Ay(!1),Qx=Yv;function cS(t,e){var n=t.type.contextTypes;if(!n)return Yv;var r=t.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===e)return r.__reactInternalMemoizedMaskedChildContext;var i={},o;for(o in n)i[o]=e[o];return r&&(t=t.stateNode,t.__reactInternalMemoizedUnmaskedChildContext=e,t.__reactInternalMemoizedMaskedChildContext=i),i}function fl(t){return t=t.childContextTypes,t!=null}function dF(){ni(ul),ni(ta)}function Tue(t,e,n){if(ta.current!==Yv)throw Error(et(168));jr(ta,e),jr(ul,n)}function V2e(t,e,n){var r=t.stateNode;if(e=e.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var i in r)if(!(i in e))throw Error(et(108,YYe(t)||"Unknown",i));return Oi({},n,r)}function hF(t){return t=(t=t.stateNode)&&t.__reactInternalMemoizedMergedChildContext||Yv,Qx=ta.current,jr(ta,t),jr(ul,ul.current),!0}function kue(t,e,n){var r=t.stateNode;if(!r)throw Error(et(169));n?(t=V2e(t,e,Qx),r.__reactInternalMemoizedMergedChildContext=t,ni(ul),ni(ta),jr(ta,t)):ni(ul),jr(ul,n)}var Dp=null,xj=!1,F8=!1;function G2e(t){Dp===null?Dp=[t]:Dp.push(t)}function dKe(t){xj=!0,G2e(t)}function Py(){if(!F8&&Dp!==null){F8=!0;var t=0,e=br;try{var n=Dp;for(br=1;t>=s,i-=s,Gp=1<<32-Mf(e)+i|n<O?(k=S,S=null):k=S.sibling;var E=d(v,S,x[O],b);if(E===null){S===null&&(S=k);break}t&&S&&E.alternate===null&&e(v,S),y=o(E,y,O),_===null?w=E:_.sibling=E,_=E,S=k}if(O===x.length)return n(v,S),li&&I0(v,O),w;if(S===null){for(;OO?(k=S,S=null):k=S.sibling;var M=d(v,S,E.value,b);if(M===null){S===null&&(S=k);break}t&&S&&M.alternate===null&&e(v,S),y=o(M,y,O),_===null?w=M:_.sibling=M,_=M,S=k}if(E.done)return n(v,S),li&&I0(v,O),w;if(S===null){for(;!E.done;O++,E=x.next())E=f(v,E.value,b),E!==null&&(y=o(E,y,O),_===null?w=E:_.sibling=E,_=E);return li&&I0(v,O),w}for(S=r(v,S);!E.done;O++,E=x.next())E=h(S,v,O,E.value,b),E!==null&&(t&&E.alternate!==null&&S.delete(E.key===null?O:E.key),y=o(E,y,O),_===null?w=E:_.sibling=E,_=E);return t&&S.forEach(function(A){return e(v,A)}),li&&I0(v,O),w}function m(v,y,x,b){if(typeof x=="object"&&x!==null&&x.type===Vw&&x.key===null&&(x=x.props.children),typeof x=="object"&&x!==null){switch(x.$$typeof){case MD:e:{for(var w=x.key,_=y;_!==null;){if(_.key===w){if(w=x.type,w===Vw){if(_.tag===7){n(v,_.sibling),y=i(_,x.props.children),y.return=v,v=y;break e}}else if(_.elementType===w||typeof w=="object"&&w!==null&&w.$$typeof===Nm&&Mue(w)===_.type){n(v,_.sibling),y=i(_,x.props),y.ref=CE(v,_,x),y.return=v,v=y;break e}n(v,_);break}else e(v,_);_=_.sibling}x.type===Vw?(y=Ex(x.props.children,v.mode,b,x.key),y.return=v,v=y):(b=e3(x.type,x.key,x.props,null,v.mode,b),b.ref=CE(v,y,x),b.return=v,v=b)}return s(v);case Ww:e:{for(_=x.key;y!==null;){if(y.key===_)if(y.tag===4&&y.stateNode.containerInfo===x.containerInfo&&y.stateNode.implementation===x.implementation){n(v,y.sibling),y=i(y,x.children||[]),y.return=v,v=y;break e}else{n(v,y);break}else e(v,y);y=y.sibling}y=G8(x,v.mode,b),y.return=v,v=y}return s(v);case Nm:return _=x._init,m(v,y,_(x._payload),b)}if(V2(x))return p(v,y,x,b);if(xE(x))return g(v,y,x,b);UD(v,x)}return typeof x=="string"&&x!==""||typeof x=="number"?(x=""+x,y!==null&&y.tag===6?(n(v,y.sibling),y=i(y,x),y.return=v,v=y):(n(v,y),y=V8(x,v.mode,b),y.return=v,v=y),s(v)):n(v,y)}return m}var fS=Y2e(!0),Q2e=Y2e(!1),mF=Ay(null),vF=null,Zw=null,vJ=null;function yJ(){vJ=Zw=vF=null}function xJ(t){var e=mF.current;ni(mF),t._currentValue=e}function dH(t,e,n){for(;t!==null;){var r=t.alternate;if((t.childLanes&e)!==e?(t.childLanes|=e,r!==null&&(r.childLanes|=e)):r!==null&&(r.childLanes&e)!==e&&(r.childLanes|=e),t===n)break;t=t.return}}function T_(t,e){vF=t,vJ=Zw=null,t=t.dependencies,t!==null&&t.firstContext!==null&&(t.lanes&e&&(sl=!0),t.firstContext=null)}function bu(t){var e=t._currentValue;if(vJ!==t)if(t={context:t,memoizedValue:e,next:null},Zw===null){if(vF===null)throw Error(et(308));Zw=t,vF.dependencies={lanes:0,firstContext:t}}else Zw=Zw.next=t;return e}var sx=null;function bJ(t){sx===null?sx=[t]:sx.push(t)}function K2e(t,e,n,r){var i=e.interleaved;return i===null?(n.next=n,bJ(e)):(n.next=i.next,i.next=n),e.interleaved=n,Og(t,r)}function Og(t,e){t.lanes|=e;var n=t.alternate;for(n!==null&&(n.lanes|=e),n=t,t=t.return;t!==null;)t.childLanes|=e,n=t.alternate,n!==null&&(n.childLanes|=e),n=t,t=t.return;return n.tag===3?n.stateNode:null}var zm=!1;function wJ(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Z2e(t,e){t=t.updateQueue,e.updateQueue===t&&(e.updateQueue={baseState:t.baseState,firstBaseUpdate:t.firstBaseUpdate,lastBaseUpdate:t.lastBaseUpdate,shared:t.shared,effects:t.effects})}function ng(t,e){return{eventTime:t,lane:e,tag:0,payload:null,callback:null,next:null}}function Rv(t,e,n){var r=t.updateQueue;if(r===null)return null;if(r=r.shared,Hn&2){var i=r.pending;return i===null?e.next=e:(e.next=i.next,i.next=e),r.pending=e,Og(t,n)}return i=r.interleaved,i===null?(e.next=e,bJ(r)):(e.next=i.next,i.next=e),r.interleaved=e,Og(t,n)}function X$(t,e,n){if(e=e.updateQueue,e!==null&&(e=e.shared,(n&4194240)!==0)){var r=e.lanes;r&=t.pendingLanes,n|=r,e.lanes=n,sJ(t,n)}}function Rue(t,e){var n=t.updateQueue,r=t.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var i=null,o=null;if(n=n.firstBaseUpdate,n!==null){do{var s={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};o===null?i=o=s:o=o.next=s,n=n.next}while(n!==null);o===null?i=o=e:o=o.next=e}else i=o=e;n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:o,shared:r.shared,effects:r.effects},t.updateQueue=n;return}t=n.lastBaseUpdate,t===null?n.firstBaseUpdate=e:t.next=e,n.lastBaseUpdate=e}function yF(t,e,n,r){var i=t.updateQueue;zm=!1;var o=i.firstBaseUpdate,s=i.lastBaseUpdate,a=i.shared.pending;if(a!==null){i.shared.pending=null;var l=a,c=l.next;l.next=null,s===null?o=c:s.next=c,s=l;var u=t.alternate;u!==null&&(u=u.updateQueue,a=u.lastBaseUpdate,a!==s&&(a===null?u.firstBaseUpdate=c:a.next=c,u.lastBaseUpdate=l))}if(o!==null){var f=i.baseState;s=0,u=c=l=null,a=o;do{var d=a.lane,h=a.eventTime;if((r&d)===d){u!==null&&(u=u.next={eventTime:h,lane:0,tag:a.tag,payload:a.payload,callback:a.callback,next:null});e:{var p=t,g=a;switch(d=e,h=n,g.tag){case 1:if(p=g.payload,typeof p=="function"){f=p.call(h,f,d);break e}f=p;break e;case 3:p.flags=p.flags&-65537|128;case 0:if(p=g.payload,d=typeof p=="function"?p.call(h,f,d):p,d==null)break e;f=Oi({},f,d);break e;case 2:zm=!0}}a.callback!==null&&a.lane!==0&&(t.flags|=64,d=i.effects,d===null?i.effects=[a]:d.push(a))}else h={eventTime:h,lane:d,tag:a.tag,payload:a.payload,callback:a.callback,next:null},u===null?(c=u=h,l=f):u=u.next=h,s|=d;if(a=a.next,a===null){if(a=i.shared.pending,a===null)break;d=a,a=d.next,d.next=null,i.lastBaseUpdate=d,i.shared.pending=null}}while(!0);if(u===null&&(l=f),i.baseState=l,i.firstBaseUpdate=c,i.lastBaseUpdate=u,e=i.shared.interleaved,e!==null){i=e;do s|=i.lane,i=i.next;while(i!==e)}else o===null&&(i.shared.lanes=0);Jx|=s,t.lanes=s,t.memoizedState=f}}function Due(t,e,n){if(t=e.effects,e.effects=null,t!==null)for(e=0;en?n:4,t(!0);var r=z8.transition;z8.transition={};try{t(!1),e()}finally{br=n,z8.transition=r}}function gTe(){return wu().memoizedState}function mKe(t,e,n){var r=Iv(t);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},mTe(t))vTe(e,n);else if(n=K2e(t,e,n,r),n!==null){var i=Oa();Rf(n,t,r,i),yTe(n,e,r)}}function vKe(t,e,n){var r=Iv(t),i={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(mTe(t))vTe(e,i);else{var o=t.alternate;if(t.lanes===0&&(o===null||o.lanes===0)&&(o=e.lastRenderedReducer,o!==null))try{var s=e.lastRenderedState,a=o(s,n);if(i.hasEagerState=!0,i.eagerState=a,Ff(a,s)){var l=e.interleaved;l===null?(i.next=i,bJ(e)):(i.next=l.next,l.next=i),e.interleaved=i;return}}catch{}finally{}n=K2e(t,e,i,r),n!==null&&(i=Oa(),Rf(n,t,r,i),yTe(n,e,r))}}function mTe(t){var e=t.alternate;return t===Ci||e!==null&&e===Ci}function vTe(t,e){VT=bF=!0;var n=t.pending;n===null?e.next=e:(e.next=n.next,n.next=e),t.pending=e}function yTe(t,e,n){if(n&4194240){var r=e.lanes;r&=t.pendingLanes,n|=r,e.lanes=n,sJ(t,n)}}var wF={readContext:bu,useCallback:ks,useContext:ks,useEffect:ks,useImperativeHandle:ks,useInsertionEffect:ks,useLayoutEffect:ks,useMemo:ks,useReducer:ks,useRef:ks,useState:ks,useDebugValue:ks,useDeferredValue:ks,useTransition:ks,useMutableSource:ks,useSyncExternalStore:ks,useId:ks,unstable_isNewReconciler:!1},yKe={readContext:bu,useCallback:function(t,e){return Od().memoizedState=[t,e===void 0?null:e],t},useContext:bu,useEffect:Lue,useImperativeHandle:function(t,e,n){return n=n!=null?n.concat([t]):null,Q$(4194308,4,uTe.bind(null,e,t),n)},useLayoutEffect:function(t,e){return Q$(4194308,4,t,e)},useInsertionEffect:function(t,e){return Q$(4,2,t,e)},useMemo:function(t,e){var n=Od();return e=e===void 0?null:e,t=t(),n.memoizedState=[t,e],t},useReducer:function(t,e,n){var r=Od();return e=n!==void 0?n(e):e,r.memoizedState=r.baseState=e,t={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:t,lastRenderedState:e},r.queue=t,t=t.dispatch=mKe.bind(null,Ci,t),[r.memoizedState,t]},useRef:function(t){var e=Od();return t={current:t},e.memoizedState=t},useState:Iue,useDebugValue:AJ,useDeferredValue:function(t){return Od().memoizedState=t},useTransition:function(){var t=Iue(!1),e=t[0];return t=gKe.bind(null,t[1]),Od().memoizedState=t,[e,t]},useMutableSource:function(){},useSyncExternalStore:function(t,e,n){var r=Ci,i=Od();if(li){if(n===void 0)throw Error(et(407));n=n()}else{if(n=e(),jo===null)throw Error(et(349));Zx&30||nTe(r,e,n)}i.memoizedState=n;var o={value:n,getSnapshot:e};return i.queue=o,Lue(iTe.bind(null,r,o,t),[t]),r.flags|=2048,Kk(9,rTe.bind(null,r,o,n,e),void 0,null),n},useId:function(){var t=Od(),e=jo.identifierPrefix;if(li){var n=Hp,r=Gp;n=(r&~(1<<32-Mf(r)-1)).toString(32)+n,e=":"+e+"R"+n,n=Yk++,0")&&(l=l.replace("",t.displayName)),l}while(1<=s&&0<=a);break}}}finally{_8=!1,Error.prepareStackTrace=n}return(t=t?t.displayName||t.name:"")?U2(t):""}function wQe(t){switch(t.tag){case 5:return U2(t.type);case 16:return U2("Lazy");case 13:return U2("Suspense");case 19:return U2("SuspenseList");case 0:case 2:case 15:return t=S8(t.type,!1),t;case 11:return t=S8(t.type.render,!1),t;case 1:return t=S8(t.type,!0),t;default:return""}}function nH(t){if(t==null)return null;if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t;switch(t){case Ww:return"Fragment";case Uw:return"Portal";case JG:return"Profiler";case vJ:return"StrictMode";case eH:return"Suspense";case tH:return"SuspenseList"}if(typeof t=="object")switch(t.$$typeof){case O2e:return(t.displayName||"Context")+".Consumer";case C2e:return(t._context.displayName||"Context")+".Provider";case yJ:var e=t.render;return t=t.displayName,t||(t=e.displayName||e.name||"",t=t!==""?"ForwardRef("+t+")":"ForwardRef"),t;case xJ:return e=t.displayName||null,e!==null?e:nH(t.type)||"Memo";case $m:e=t._payload,t=t._init;try{return nH(t(e))}catch{}}return null}function _Qe(t){var e=t.type;switch(t.tag){case 24:return"Cache";case 9:return(e.displayName||"Context")+".Consumer";case 10:return(e._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return t=e.render,t=t.displayName||t.name||"",e.displayName||(t!==""?"ForwardRef("+t+")":"ForwardRef");case 7:return"Fragment";case 5:return e;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return nH(e);case 8:return e===vJ?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e}return null}function qv(t){switch(typeof t){case"boolean":case"number":case"string":case"undefined":return t;case"object":return t;default:return""}}function T2e(t){var e=t.type;return(t=t.nodeName)&&t.toLowerCase()==="input"&&(e==="checkbox"||e==="radio")}function SQe(t){var e=T2e(t)?"checked":"value",n=Object.getOwnPropertyDescriptor(t.constructor.prototype,e),r=""+t[e];if(!t.hasOwnProperty(e)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var i=n.get,o=n.set;return Object.defineProperty(t,e,{configurable:!0,get:function(){return i.call(this)},set:function(s){r=""+s,o.call(this,s)}}),Object.defineProperty(t,e,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(s){r=""+s},stopTracking:function(){t._valueTracker=null,delete t[e]}}}}function AD(t){t._valueTracker||(t._valueTracker=SQe(t))}function k2e(t){if(!t)return!1;var e=t._valueTracker;if(!e)return!0;var n=e.getValue(),r="";return t&&(r=T2e(t)?t.checked?"true":"false":t.value),t=r,t!==n?(e.setValue(t),!0):!1}function J3(t){if(t=t||(typeof document<"u"?document:void 0),typeof t>"u")return null;try{return t.activeElement||t.body}catch{return t.body}}function rH(t,e){var n=e.checked;return Ei({},e,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??t._wrapperState.initialChecked})}function yue(t,e){var n=e.defaultValue==null?"":e.defaultValue,r=e.checked!=null?e.checked:e.defaultChecked;n=qv(e.value!=null?e.value:n),t._wrapperState={initialChecked:r,initialValue:n,controlled:e.type==="checkbox"||e.type==="radio"?e.checked!=null:e.value!=null}}function A2e(t,e){e=e.checked,e!=null&&mJ(t,"checked",e,!1)}function iH(t,e){A2e(t,e);var n=qv(e.value),r=e.type;if(n!=null)r==="number"?(n===0&&t.value===""||t.value!=n)&&(t.value=""+n):t.value!==""+n&&(t.value=""+n);else if(r==="submit"||r==="reset"){t.removeAttribute("value");return}e.hasOwnProperty("value")?oH(t,e.type,n):e.hasOwnProperty("defaultValue")&&oH(t,e.type,qv(e.defaultValue)),e.checked==null&&e.defaultChecked!=null&&(t.defaultChecked=!!e.defaultChecked)}function xue(t,e,n){if(e.hasOwnProperty("value")||e.hasOwnProperty("defaultValue")){var r=e.type;if(!(r!=="submit"&&r!=="reset"||e.value!==void 0&&e.value!==null))return;e=""+t._wrapperState.initialValue,n||e===t.value||(t.value=e),t.defaultValue=e}n=t.name,n!==""&&(t.name=""),t.defaultChecked=!!t._wrapperState.initialChecked,n!==""&&(t.name=n)}function oH(t,e,n){(e!=="number"||J3(t.ownerDocument)!==t)&&(n==null?t.defaultValue=""+t._wrapperState.initialValue:t.defaultValue!==""+n&&(t.defaultValue=""+n))}var W2=Array.isArray;function __(t,e,n,r){if(t=t.options,e){e={};for(var i=0;i"+e.valueOf().toString()+"",e=PD.firstChild;t.firstChild;)t.removeChild(t.firstChild);for(;e.firstChild;)t.appendChild(e.firstChild)}});function $k(t,e){if(e){var n=t.firstChild;if(n&&n===t.lastChild&&n.nodeType===3){n.nodeValue=e;return}}t.textContent=e}var NT={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},CQe=["Webkit","ms","Moz","O"];Object.keys(NT).forEach(function(t){CQe.forEach(function(e){e=e+t.charAt(0).toUpperCase()+t.substring(1),NT[e]=NT[t]})});function D2e(t,e,n){return e==null||typeof e=="boolean"||e===""?"":n||typeof e!="number"||e===0||NT.hasOwnProperty(t)&&NT[t]?(""+e).trim():e+"px"}function I2e(t,e){t=t.style;for(var n in e)if(e.hasOwnProperty(n)){var r=n.indexOf("--")===0,i=D2e(n,e[n],r);n==="float"&&(n="cssFloat"),r?t.setProperty(n,i):t[n]=i}}var OQe=Ei({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function lH(t,e){if(e){if(OQe[t]&&(e.children!=null||e.dangerouslySetInnerHTML!=null))throw Error(et(137,t));if(e.dangerouslySetInnerHTML!=null){if(e.children!=null)throw Error(et(60));if(typeof e.dangerouslySetInnerHTML!="object"||!("__html"in e.dangerouslySetInnerHTML))throw Error(et(61))}if(e.style!=null&&typeof e.style!="object")throw Error(et(62))}}function cH(t,e){if(t.indexOf("-")===-1)return typeof e.is=="string";switch(t){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var uH=null;function bJ(t){return t=t.target||t.srcElement||window,t.correspondingUseElement&&(t=t.correspondingUseElement),t.nodeType===3?t.parentNode:t}var fH=null,S_=null,C_=null;function _ue(t){if(t=fM(t)){if(typeof fH!="function")throw Error(et(280));var e=t.stateNode;e&&(e=pj(e),fH(t.stateNode,t.type,e))}}function L2e(t){S_?C_?C_.push(t):C_=[t]:S_=t}function $2e(){if(S_){var t=S_,e=C_;if(C_=S_=null,_ue(t),e)for(t=0;t>>=0,t===0?32:31-($Qe(t)/FQe|0)|0}var MD=64,RD=4194304;function V2(t){switch(t&-t){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return t&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return t}}function rF(t,e){var n=t.pendingLanes;if(n===0)return 0;var r=0,i=t.suspendedLanes,o=t.pingedLanes,s=n&268435455;if(s!==0){var a=s&~i;a!==0?r=V2(a):(o&=s,o!==0&&(r=V2(o)))}else s=n&~i,s!==0?r=V2(s):o!==0&&(r=V2(o));if(r===0)return 0;if(e!==0&&e!==r&&!(e&i)&&(i=r&-r,o=e&-e,i>=o||i===16&&(o&4194240)!==0))return e;if(r&4&&(r|=n&16),e=t.entangledLanes,e!==0)for(t=t.entanglements,e&=r;0n;n++)e.push(t);return e}function cM(t,e,n){t.pendingLanes|=e,e!==536870912&&(t.suspendedLanes=0,t.pingedLanes=0),t=t.eventTimes,e=31-Mf(e),t[e]=n}function BQe(t,e){var n=t.pendingLanes&~e;t.pendingLanes=e,t.suspendedLanes=0,t.pingedLanes=0,t.expiredLanes&=e,t.mutableReadLanes&=e,t.entangledLanes&=e,e=t.entanglements;var r=t.eventTimes;for(t=t.expirationTimes;0=jT),Mue=" ",Rue=!1;function nTe(t,e){switch(t){case"keyup":return gKe.indexOf(e.keyCode)!==-1;case"keydown":return e.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function rTe(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var Vw=!1;function vKe(t,e){switch(t){case"compositionend":return rTe(e);case"keypress":return e.which!==32?null:(Rue=!0,Mue);case"textInput":return t=e.data,t===Mue&&Rue?null:t;default:return null}}function yKe(t,e){if(Vw)return t==="compositionend"||!kJ&&nTe(t,e)?(t=eTe(),U$=OJ=sv=null,Vw=!1,t):null;switch(t){case"paste":return null;case"keypress":if(!(e.ctrlKey||e.altKey||e.metaKey)||e.ctrlKey&&e.altKey){if(e.char&&1=e)return{node:n,offset:e-t};t=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=$ue(n)}}function aTe(t,e){return t&&e?t===e?!0:t&&t.nodeType===3?!1:e&&e.nodeType===3?aTe(t,e.parentNode):"contains"in t?t.contains(e):t.compareDocumentPosition?!!(t.compareDocumentPosition(e)&16):!1:!1}function lTe(){for(var t=window,e=J3();e instanceof t.HTMLIFrameElement;){try{var n=typeof e.contentWindow.location.href=="string"}catch{n=!1}if(n)t=e.contentWindow;else break;e=J3(t.document)}return e}function AJ(t){var e=t&&t.nodeName&&t.nodeName.toLowerCase();return e&&(e==="input"&&(t.type==="text"||t.type==="search"||t.type==="tel"||t.type==="url"||t.type==="password")||e==="textarea"||t.contentEditable==="true")}function TKe(t){var e=lTe(),n=t.focusedElem,r=t.selectionRange;if(e!==n&&n&&n.ownerDocument&&aTe(n.ownerDocument.documentElement,n)){if(r!==null&&AJ(n)){if(e=r.start,t=r.end,t===void 0&&(t=e),"selectionStart"in n)n.selectionStart=e,n.selectionEnd=Math.min(t,n.value.length);else if(t=(e=n.ownerDocument||document)&&e.defaultView||window,t.getSelection){t=t.getSelection();var i=n.textContent.length,o=Math.min(r.start,i);r=r.end===void 0?o:Math.min(r.end,i),!t.extend&&o>r&&(i=r,r=o,o=i),i=Fue(n,o);var s=Fue(n,r);i&&s&&(t.rangeCount!==1||t.anchorNode!==i.node||t.anchorOffset!==i.offset||t.focusNode!==s.node||t.focusOffset!==s.offset)&&(e=e.createRange(),e.setStart(i.node,i.offset),t.removeAllRanges(),o>r?(t.addRange(e),t.extend(s.node,s.offset)):(e.setEnd(s.node,s.offset),t.addRange(e)))}}for(e=[],t=n;t=t.parentNode;)t.nodeType===1&&e.push({element:t,left:t.scrollLeft,top:t.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n=document.documentMode,Gw=null,vH=null,UT=null,yH=!1;function Nue(t,e,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;yH||Gw==null||Gw!==J3(r)||(r=Gw,"selectionStart"in r&&AJ(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),UT&&Uk(UT,r)||(UT=r,r=sF(vH,"onSelect"),0Xw||(t.current=CH[Xw],CH[Xw]=null,Xw--)}function jr(t,e){Xw++,CH[Xw]=t.current,t.current=e}var Xv={},Js=ky(Xv),ll=ky(!1),Qx=Xv;function cS(t,e){var n=t.type.contextTypes;if(!n)return Xv;var r=t.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===e)return r.__reactInternalMemoizedMaskedChildContext;var i={},o;for(o in n)i[o]=e[o];return r&&(t=t.stateNode,t.__reactInternalMemoizedUnmaskedChildContext=e,t.__reactInternalMemoizedMaskedChildContext=i),i}function cl(t){return t=t.childContextTypes,t!=null}function lF(){ri(ll),ri(Js)}function Gue(t,e,n){if(Js.current!==Xv)throw Error(et(168));jr(Js,e),jr(ll,n)}function vTe(t,e,n){var r=t.stateNode;if(e=e.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var i in r)if(!(i in e))throw Error(et(108,_Qe(t)||"Unknown",i));return Ei({},n,r)}function cF(t){return t=(t=t.stateNode)&&t.__reactInternalMemoizedMergedChildContext||Xv,Qx=Js.current,jr(Js,t),jr(ll,ll.current),!0}function Hue(t,e,n){var r=t.stateNode;if(!r)throw Error(et(169));n?(t=vTe(t,e,Qx),r.__reactInternalMemoizedMergedChildContext=t,ri(ll),ri(Js),jr(Js,t)):ri(ll),jr(ll,n)}var Pp=null,gj=!1,F8=!1;function yTe(t){Pp===null?Pp=[t]:Pp.push(t)}function zKe(t){gj=!0,yTe(t)}function Ay(){if(!F8&&Pp!==null){F8=!0;var t=0,e=br;try{var n=Pp;for(br=1;t>=s,i-=s,Up=1<<32-Mf(e)+i|n<O?(k=S,S=null):k=S.sibling;var E=d(v,S,x[O],b);if(E===null){S===null&&(S=k);break}t&&S&&E.alternate===null&&e(v,S),y=o(E,y,O),_===null?w=E:_.sibling=E,_=E,S=k}if(O===x.length)return n(v,S),ui&&I0(v,O),w;if(S===null){for(;OO?(k=S,S=null):k=S.sibling;var P=d(v,S,E.value,b);if(P===null){S===null&&(S=k);break}t&&S&&P.alternate===null&&e(v,S),y=o(P,y,O),_===null?w=P:_.sibling=P,_=P,S=k}if(E.done)return n(v,S),ui&&I0(v,O),w;if(S===null){for(;!E.done;O++,E=x.next())E=f(v,E.value,b),E!==null&&(y=o(E,y,O),_===null?w=E:_.sibling=E,_=E);return ui&&I0(v,O),w}for(S=r(v,S);!E.done;O++,E=x.next())E=h(S,v,O,E.value,b),E!==null&&(t&&E.alternate!==null&&S.delete(E.key===null?O:E.key),y=o(E,y,O),_===null?w=E:_.sibling=E,_=E);return t&&S.forEach(function(A){return e(v,A)}),ui&&I0(v,O),w}function m(v,y,x,b){if(typeof x=="object"&&x!==null&&x.type===Ww&&x.key===null&&(x=x.props.children),typeof x=="object"&&x!==null){switch(x.$$typeof){case kD:e:{for(var w=x.key,_=y;_!==null;){if(_.key===w){if(w=x.type,w===Ww){if(_.tag===7){n(v,_.sibling),y=i(_,x.props.children),y.return=v,v=y;break e}}else if(_.elementType===w||typeof w=="object"&&w!==null&&w.$$typeof===$m&&Yue(w)===_.type){n(v,_.sibling),y=i(_,x.props),y.ref=SE(v,_,x),y.return=v,v=y;break e}n(v,_);break}else e(v,_);_=_.sibling}x.type===Ww?(y=Ex(x.props.children,v.mode,b,x.key),y.return=v,v=y):(b=Q$(x.type,x.key,x.props,null,v.mode,b),b.ref=SE(v,y,x),b.return=v,v=b)}return s(v);case Uw:e:{for(_=x.key;y!==null;){if(y.key===_)if(y.tag===4&&y.stateNode.containerInfo===x.containerInfo&&y.stateNode.implementation===x.implementation){n(v,y.sibling),y=i(y,x.children||[]),y.return=v,v=y;break e}else{n(v,y);break}else e(v,y);y=y.sibling}y=G8(x,v.mode,b),y.return=v,v=y}return s(v);case $m:return _=x._init,m(v,y,_(x._payload),b)}if(W2(x))return p(v,y,x,b);if(yE(x))return g(v,y,x,b);zD(v,x)}return typeof x=="string"&&x!==""||typeof x=="number"?(x=""+x,y!==null&&y.tag===6?(n(v,y.sibling),y=i(y,x),y.return=v,v=y):(n(v,y),y=V8(x,v.mode,b),y.return=v,v=y),s(v)):n(v,y)}return m}var fS=_Te(!0),STe=_Te(!1),dF=ky(null),hF=null,Kw=null,DJ=null;function IJ(){DJ=Kw=hF=null}function LJ(t){var e=dF.current;ri(dF),t._currentValue=e}function TH(t,e,n){for(;t!==null;){var r=t.alternate;if((t.childLanes&e)!==e?(t.childLanes|=e,r!==null&&(r.childLanes|=e)):r!==null&&(r.childLanes&e)!==e&&(r.childLanes|=e),t===n)break;t=t.return}}function E_(t,e){hF=t,DJ=Kw=null,t=t.dependencies,t!==null&&t.firstContext!==null&&(t.lanes&e&&(il=!0),t.firstContext=null)}function bu(t){var e=t._currentValue;if(DJ!==t)if(t={context:t,memoizedValue:e,next:null},Kw===null){if(hF===null)throw Error(et(308));Kw=t,hF.dependencies={lanes:0,firstContext:t}}else Kw=Kw.next=t;return e}var sx=null;function $J(t){sx===null?sx=[t]:sx.push(t)}function CTe(t,e,n,r){var i=e.interleaved;return i===null?(n.next=n,$J(e)):(n.next=i.next,i.next=n),e.interleaved=n,_g(t,r)}function _g(t,e){t.lanes|=e;var n=t.alternate;for(n!==null&&(n.lanes|=e),n=t,t=t.return;t!==null;)t.childLanes|=e,n=t.alternate,n!==null&&(n.childLanes|=e),n=t,t=t.return;return n.tag===3?n.stateNode:null}var Fm=!1;function FJ(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function OTe(t,e){t=t.updateQueue,e.updateQueue===t&&(e.updateQueue={baseState:t.baseState,firstBaseUpdate:t.firstBaseUpdate,lastBaseUpdate:t.lastBaseUpdate,shared:t.shared,effects:t.effects})}function Jp(t,e){return{eventTime:t,lane:e,tag:0,payload:null,callback:null,next:null}}function Mv(t,e,n){var r=t.updateQueue;if(r===null)return null;if(r=r.shared,Hn&2){var i=r.pending;return i===null?e.next=e:(e.next=i.next,i.next=e),r.pending=e,_g(t,n)}return i=r.interleaved,i===null?(e.next=e,$J(r)):(e.next=i.next,i.next=e),r.interleaved=e,_g(t,n)}function V$(t,e,n){if(e=e.updateQueue,e!==null&&(e=e.shared,(n&4194240)!==0)){var r=e.lanes;r&=t.pendingLanes,n|=r,e.lanes=n,_J(t,n)}}function Que(t,e){var n=t.updateQueue,r=t.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var i=null,o=null;if(n=n.firstBaseUpdate,n!==null){do{var s={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};o===null?i=o=s:o=o.next=s,n=n.next}while(n!==null);o===null?i=o=e:o=o.next=e}else i=o=e;n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:o,shared:r.shared,effects:r.effects},t.updateQueue=n;return}t=n.lastBaseUpdate,t===null?n.firstBaseUpdate=e:t.next=e,n.lastBaseUpdate=e}function pF(t,e,n,r){var i=t.updateQueue;Fm=!1;var o=i.firstBaseUpdate,s=i.lastBaseUpdate,a=i.shared.pending;if(a!==null){i.shared.pending=null;var l=a,c=l.next;l.next=null,s===null?o=c:s.next=c,s=l;var u=t.alternate;u!==null&&(u=u.updateQueue,a=u.lastBaseUpdate,a!==s&&(a===null?u.firstBaseUpdate=c:a.next=c,u.lastBaseUpdate=l))}if(o!==null){var f=i.baseState;s=0,u=c=l=null,a=o;do{var d=a.lane,h=a.eventTime;if((r&d)===d){u!==null&&(u=u.next={eventTime:h,lane:0,tag:a.tag,payload:a.payload,callback:a.callback,next:null});e:{var p=t,g=a;switch(d=e,h=n,g.tag){case 1:if(p=g.payload,typeof p=="function"){f=p.call(h,f,d);break e}f=p;break e;case 3:p.flags=p.flags&-65537|128;case 0:if(p=g.payload,d=typeof p=="function"?p.call(h,f,d):p,d==null)break e;f=Ei({},f,d);break e;case 2:Fm=!0}}a.callback!==null&&a.lane!==0&&(t.flags|=64,d=i.effects,d===null?i.effects=[a]:d.push(a))}else h={eventTime:h,lane:d,tag:a.tag,payload:a.payload,callback:a.callback,next:null},u===null?(c=u=h,l=f):u=u.next=h,s|=d;if(a=a.next,a===null){if(a=i.shared.pending,a===null)break;d=a,a=d.next,d.next=null,i.lastBaseUpdate=d,i.shared.pending=null}}while(!0);if(u===null&&(l=f),i.baseState=l,i.firstBaseUpdate=c,i.lastBaseUpdate=u,e=i.shared.interleaved,e!==null){i=e;do s|=i.lane,i=i.next;while(i!==e)}else o===null&&(i.shared.lanes=0);Jx|=s,t.lanes=s,t.memoizedState=f}}function Kue(t,e,n){if(t=e.effects,e.effects=null,t!==null)for(e=0;en?n:4,t(!0);var r=z8.transition;z8.transition={};try{t(!1),e()}finally{br=n,z8.transition=r}}function UTe(){return wu().memoizedState}function WKe(t,e,n){var r=Dv(t);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},WTe(t))VTe(e,n);else if(n=CTe(t,e,n,r),n!==null){var i=Sa();Rf(n,t,r,i),GTe(n,e,r)}}function VKe(t,e,n){var r=Dv(t),i={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(WTe(t))VTe(e,i);else{var o=t.alternate;if(t.lanes===0&&(o===null||o.lanes===0)&&(o=e.lastRenderedReducer,o!==null))try{var s=e.lastRenderedState,a=o(s,n);if(i.hasEagerState=!0,i.eagerState=a,Ff(a,s)){var l=e.interleaved;l===null?(i.next=i,$J(e)):(i.next=l.next,l.next=i),e.interleaved=i;return}}catch{}finally{}n=CTe(t,e,i,r),n!==null&&(i=Sa(),Rf(n,t,r,i),GTe(n,e,r))}}function WTe(t){var e=t.alternate;return t===Oi||e!==null&&e===Oi}function VTe(t,e){WT=mF=!0;var n=t.pending;n===null?e.next=e:(e.next=n.next,n.next=e),t.pending=e}function GTe(t,e,n){if(n&4194240){var r=e.lanes;r&=t.pendingLanes,n|=r,e.lanes=n,_J(t,n)}}var vF={readContext:bu,useCallback:Ts,useContext:Ts,useEffect:Ts,useImperativeHandle:Ts,useInsertionEffect:Ts,useLayoutEffect:Ts,useMemo:Ts,useReducer:Ts,useRef:Ts,useState:Ts,useDebugValue:Ts,useDeferredValue:Ts,useTransition:Ts,useMutableSource:Ts,useSyncExternalStore:Ts,useId:Ts,unstable_isNewReconciler:!1},GKe={readContext:bu,useCallback:function(t,e){return Sd().memoizedState=[t,e===void 0?null:e],t},useContext:bu,useEffect:Jue,useImperativeHandle:function(t,e,n){return n=n!=null?n.concat([t]):null,H$(4194308,4,FTe.bind(null,e,t),n)},useLayoutEffect:function(t,e){return H$(4194308,4,t,e)},useInsertionEffect:function(t,e){return H$(4,2,t,e)},useMemo:function(t,e){var n=Sd();return e=e===void 0?null:e,t=t(),n.memoizedState=[t,e],t},useReducer:function(t,e,n){var r=Sd();return e=n!==void 0?n(e):e,r.memoizedState=r.baseState=e,t={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:t,lastRenderedState:e},r.queue=t,t=t.dispatch=WKe.bind(null,Oi,t),[r.memoizedState,t]},useRef:function(t){var e=Sd();return t={current:t},e.memoizedState=t},useState:Zue,useDebugValue:GJ,useDeferredValue:function(t){return Sd().memoizedState=t},useTransition:function(){var t=Zue(!1),e=t[0];return t=UKe.bind(null,t[1]),Sd().memoizedState=t,[e,t]},useMutableSource:function(){},useSyncExternalStore:function(t,e,n){var r=Oi,i=Sd();if(ui){if(n===void 0)throw Error(et(407));n=n()}else{if(n=e(),jo===null)throw Error(et(349));Zx&30||ATe(r,e,n)}i.memoizedState=n;var o={value:n,getSnapshot:e};return i.queue=o,Jue(MTe.bind(null,r,o,t),[t]),r.flags|=2048,Qk(9,PTe.bind(null,r,o,n,e),void 0,null),n},useId:function(){var t=Sd(),e=jo.identifierPrefix;if(ui){var n=Wp,r=Up;n=(r&~(1<<32-Mf(r)-1)).toString(32)+n,e=":"+e+"R"+n,n=Xk++,0<\/script>",t=t.removeChild(t.firstChild)):typeof r.is=="string"?t=s.createElement(n,{is:r.is}):(t=s.createElement(n),n==="select"&&(s=t,r.multiple?s.multiple=!0:r.size&&(s.size=r.size))):t=s.createElementNS(t,n),t[Fd]=e,t[Hk]=r,kTe(t,e,!1,!1),e.stateNode=t;e:{switch(s=XG(n,r),n){case"dialog":qr("cancel",t),qr("close",t),i=r;break;case"iframe":case"object":case"embed":qr("load",t),i=r;break;case"video":case"audio":for(i=0;ipS&&(e.flags|=128,r=!0,OE(o,!1),e.lanes=4194304)}else{if(!r)if(t=xF(s),t!==null){if(e.flags|=128,r=!0,n=t.updateQueue,n!==null&&(e.updateQueue=n,e.flags|=4),OE(o,!0),o.tail===null&&o.tailMode==="hidden"&&!s.alternate&&!li)return As(e),null}else 2*Gi()-o.renderingStartTime>pS&&n!==1073741824&&(e.flags|=128,r=!0,OE(o,!1),e.lanes=4194304);o.isBackwards?(s.sibling=e.child,e.child=s):(n=o.last,n!==null?n.sibling=s:e.child=s,o.last=s)}return o.tail!==null?(e=o.tail,o.rendering=e,o.tail=e.sibling,o.renderingStartTime=Gi(),e.sibling=null,n=bi.current,jr(bi,r?n&1|2:n&1),e):(As(e),null);case 22:case 23:return LJ(),r=e.memoizedState!==null,t!==null&&t.memoizedState!==null!==r&&(e.flags|=8192),r&&e.mode&1?Xl&1073741824&&(As(e),e.subtreeFlags&6&&(e.flags|=8192)):As(e),null;case 24:return null;case 25:return null}throw Error(et(156,e.tag))}function EKe(t,e){switch(gJ(e),e.tag){case 1:return fl(e.type)&&dF(),t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 3:return dS(),ni(ul),ni(ta),CJ(),t=e.flags,t&65536&&!(t&128)?(e.flags=t&-65537|128,e):null;case 5:return SJ(e),null;case 13:if(ni(bi),t=e.memoizedState,t!==null&&t.dehydrated!==null){if(e.alternate===null)throw Error(et(340));uS()}return t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 19:return ni(bi),null;case 4:return dS(),null;case 10:return xJ(e.type._context),null;case 22:case 23:return LJ(),null;case 24:return null;default:return null}}var VD=!1,Ws=!1,TKe=typeof WeakSet=="function"?WeakSet:Set,Ot=null;function Jw(t,e){var n=t.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){Ii(t,e,r)}else n.current=null}function wH(t,e,n){try{n()}catch(r){Ii(t,e,r)}}var Hue=!1;function kKe(t,e){if(iH=lF,t=L2e(),hJ(t)){if("selectionStart"in t)var n={start:t.selectionStart,end:t.selectionEnd};else e:{n=(n=t.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var i=r.anchorOffset,o=r.focusNode;r=r.focusOffset;try{n.nodeType,o.nodeType}catch{n=null;break e}var s=0,a=-1,l=-1,c=0,u=0,f=t,d=null;t:for(;;){for(var h;f!==n||i!==0&&f.nodeType!==3||(a=s+i),f!==o||r!==0&&f.nodeType!==3||(l=s+r),f.nodeType===3&&(s+=f.nodeValue.length),(h=f.firstChild)!==null;)d=f,f=h;for(;;){if(f===t)break t;if(d===n&&++c===i&&(a=s),d===o&&++u===r&&(l=s),(h=f.nextSibling)!==null)break;f=d,d=f.parentNode}f=h}n=a===-1||l===-1?null:{start:a,end:l}}else n=null}n=n||{start:0,end:0}}else n=null;for(oH={focusedElem:t,selectionRange:n},lF=!1,Ot=e;Ot!==null;)if(e=Ot,t=e.child,(e.subtreeFlags&1028)!==0&&t!==null)t.return=e,Ot=t;else for(;Ot!==null;){e=Ot;try{var p=e.alternate;if(e.flags&1024)switch(e.tag){case 0:case 11:case 15:break;case 1:if(p!==null){var g=p.memoizedProps,m=p.memoizedState,v=e.stateNode,y=v.getSnapshotBeforeUpdate(e.elementType===e.type?g:lf(e.type,g),m);v.__reactInternalSnapshotBeforeUpdate=y}break;case 3:var x=e.stateNode.containerInfo;x.nodeType===1?x.textContent="":x.nodeType===9&&x.documentElement&&x.removeChild(x.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(et(163))}}catch(b){Ii(e,e.return,b)}if(t=e.sibling,t!==null){t.return=e.return,Ot=t;break}Ot=e.return}return p=Hue,Hue=!1,p}function GT(t,e,n){var r=e.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var i=r=r.next;do{if((i.tag&t)===t){var o=i.destroy;i.destroy=void 0,o!==void 0&&wH(e,n,o)}i=i.next}while(i!==r)}}function _j(t,e){if(e=e.updateQueue,e=e!==null?e.lastEffect:null,e!==null){var n=e=e.next;do{if((n.tag&t)===t){var r=n.create;n.destroy=r()}n=n.next}while(n!==e)}}function _H(t){var e=t.ref;if(e!==null){var n=t.stateNode;switch(t.tag){case 5:t=n;break;default:t=n}typeof e=="function"?e(t):e.current=t}}function MTe(t){var e=t.alternate;e!==null&&(t.alternate=null,MTe(e)),t.child=null,t.deletions=null,t.sibling=null,t.tag===5&&(e=t.stateNode,e!==null&&(delete e[Fd],delete e[Hk],delete e[lH],delete e[uKe],delete e[fKe])),t.stateNode=null,t.return=null,t.dependencies=null,t.memoizedProps=null,t.memoizedState=null,t.pendingProps=null,t.stateNode=null,t.updateQueue=null}function RTe(t){return t.tag===5||t.tag===3||t.tag===4}function que(t){e:for(;;){for(;t.sibling===null;){if(t.return===null||RTe(t.return))return null;t=t.return}for(t.sibling.return=t.return,t=t.sibling;t.tag!==5&&t.tag!==6&&t.tag!==18;){if(t.flags&2||t.child===null||t.tag===4)continue e;t.child.return=t,t=t.child}if(!(t.flags&2))return t.stateNode}}function SH(t,e,n){var r=t.tag;if(r===5||r===6)t=t.stateNode,e?n.nodeType===8?n.parentNode.insertBefore(t,e):n.insertBefore(t,e):(n.nodeType===8?(e=n.parentNode,e.insertBefore(t,n)):(e=n,e.appendChild(t)),n=n._reactRootContainer,n!=null||e.onclick!==null||(e.onclick=fF));else if(r!==4&&(t=t.child,t!==null))for(SH(t,e,n),t=t.sibling;t!==null;)SH(t,e,n),t=t.sibling}function CH(t,e,n){var r=t.tag;if(r===5||r===6)t=t.stateNode,e?n.insertBefore(t,e):n.appendChild(t);else if(r!==4&&(t=t.child,t!==null))for(CH(t,e,n),t=t.sibling;t!==null;)CH(t,e,n),t=t.sibling}var es=null,ff=!1;function lm(t,e,n){for(n=n.child;n!==null;)DTe(t,e,n),n=n.sibling}function DTe(t,e,n){if(lh&&typeof lh.onCommitFiberUnmount=="function")try{lh.onCommitFiberUnmount(pj,n)}catch{}switch(n.tag){case 5:Ws||Jw(n,e);case 6:var r=es,i=ff;es=null,lm(t,e,n),es=r,ff=i,es!==null&&(ff?(t=es,n=n.stateNode,t.nodeType===8?t.parentNode.removeChild(n):t.removeChild(n)):es.removeChild(n.stateNode));break;case 18:es!==null&&(ff?(t=es,n=n.stateNode,t.nodeType===8?$8(t.parentNode,n):t.nodeType===1&&$8(t,n),Bk(t)):$8(es,n.stateNode));break;case 4:r=es,i=ff,es=n.stateNode.containerInfo,ff=!0,lm(t,e,n),es=r,ff=i;break;case 0:case 11:case 14:case 15:if(!Ws&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){i=r=r.next;do{var o=i,s=o.destroy;o=o.tag,s!==void 0&&(o&2||o&4)&&wH(n,e,s),i=i.next}while(i!==r)}lm(t,e,n);break;case 1:if(!Ws&&(Jw(n,e),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(a){Ii(n,e,a)}lm(t,e,n);break;case 21:lm(t,e,n);break;case 22:n.mode&1?(Ws=(r=Ws)||n.memoizedState!==null,lm(t,e,n),Ws=r):lm(t,e,n);break;default:lm(t,e,n)}}function Xue(t){var e=t.updateQueue;if(e!==null){t.updateQueue=null;var n=t.stateNode;n===null&&(n=t.stateNode=new TKe),e.forEach(function(r){var i=FKe.bind(null,t,r);n.has(r)||(n.add(r),r.then(i,i))})}}function Hu(t,e){var n=e.deletions;if(n!==null)for(var r=0;ri&&(i=s),r&=~o}if(r=i,r=Gi()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*PKe(r/1960))-r,10t?16:t,lv===null)var r=!1;else{if(t=lv,lv=null,CF=0,Hn&6)throw Error(et(331));var i=Hn;for(Hn|=4,Ot=t.current;Ot!==null;){var o=Ot,s=o.child;if(Ot.flags&16){var a=o.deletions;if(a!==null){for(var l=0;lGi()-DJ?Ox(t,0):RJ|=n),dl(t,e)}function BTe(t,e){e===0&&(t.mode&1?(e=LD,LD<<=1,!(LD&130023424)&&(LD=4194304)):e=1);var n=Oa();t=Og(t,e),t!==null&&(cM(t,e,n),dl(t,n))}function $Ke(t){var e=t.memoizedState,n=0;e!==null&&(n=e.retryLane),BTe(t,n)}function FKe(t,e){var n=0;switch(t.tag){case 13:var r=t.stateNode,i=t.memoizedState;i!==null&&(n=i.retryLane);break;case 19:r=t.stateNode;break;default:throw Error(et(314))}r!==null&&r.delete(e),BTe(t,n)}var UTe;UTe=function(t,e,n){if(t!==null)if(t.memoizedProps!==e.pendingProps||ul.current)sl=!0;else{if(!(t.lanes&n)&&!(e.flags&128))return sl=!1,CKe(t,e,n);sl=!!(t.flags&131072)}else sl=!1,li&&e.flags&1048576&&H2e(e,gF,e.index);switch(e.lanes=0,e.tag){case 2:var r=e.type;K$(t,e),t=e.pendingProps;var i=cS(e,ta.current);T_(e,n),i=EJ(null,e,r,t,i,n);var o=TJ();return e.flags|=1,typeof i=="object"&&i!==null&&typeof i.render=="function"&&i.$$typeof===void 0?(e.tag=1,e.memoizedState=null,e.updateQueue=null,fl(r)?(o=!0,hF(e)):o=!1,e.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,wJ(e),i.updater=wj,e.stateNode=i,i._reactInternals=e,pH(e,r,t,n),e=vH(null,e,r,!0,o,n)):(e.tag=0,li&&o&&pJ(e),ga(null,e,i,n),e=e.child),e;case 16:r=e.elementType;e:{switch(K$(t,e),t=e.pendingProps,i=r._init,r=i(r._payload),e.type=r,i=e.tag=zKe(r),t=lf(r,t),i){case 0:e=mH(null,e,r,t,n);break e;case 1:e=Wue(null,e,r,t,n);break e;case 11:e=Bue(null,e,r,t,n);break e;case 14:e=Uue(null,e,r,lf(r.type,t),n);break e}throw Error(et(306,r,""))}return e;case 0:return r=e.type,i=e.pendingProps,i=e.elementType===r?i:lf(r,i),mH(t,e,r,i,n);case 1:return r=e.type,i=e.pendingProps,i=e.elementType===r?i:lf(r,i),Wue(t,e,r,i,n);case 3:e:{if(OTe(e),t===null)throw Error(et(387));r=e.pendingProps,o=e.memoizedState,i=o.element,Z2e(t,e),yF(e,r,null,n);var s=e.memoizedState;if(r=s.element,o.isDehydrated)if(o={element:r,isDehydrated:!1,cache:s.cache,pendingSuspenseBoundaries:s.pendingSuspenseBoundaries,transitions:s.transitions},e.updateQueue.baseState=o,e.memoizedState=o,e.flags&256){i=hS(Error(et(423)),e),e=Vue(t,e,r,n,i);break e}else if(r!==i){i=hS(Error(et(424)),e),e=Vue(t,e,r,n,i);break e}else for(sc=Mv(e.stateNode.containerInfo.firstChild),dc=e,li=!0,vf=null,n=Q2e(e,null,r,n),e.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(uS(),r===i){e=Eg(t,e,n);break e}ga(t,e,r,n)}e=e.child}return e;case 5:return J2e(e),t===null&&fH(e),r=e.type,i=e.pendingProps,o=t!==null?t.memoizedProps:null,s=i.children,sH(r,i)?s=null:o!==null&&sH(r,o)&&(e.flags|=32),CTe(t,e),ga(t,e,s,n),e.child;case 6:return t===null&&fH(e),null;case 13:return ETe(t,e,n);case 4:return _J(e,e.stateNode.containerInfo),r=e.pendingProps,t===null?e.child=fS(e,null,r,n):ga(t,e,r,n),e.child;case 11:return r=e.type,i=e.pendingProps,i=e.elementType===r?i:lf(r,i),Bue(t,e,r,i,n);case 7:return ga(t,e,e.pendingProps,n),e.child;case 8:return ga(t,e,e.pendingProps.children,n),e.child;case 12:return ga(t,e,e.pendingProps.children,n),e.child;case 10:e:{if(r=e.type._context,i=e.pendingProps,o=e.memoizedProps,s=i.value,jr(mF,r._currentValue),r._currentValue=s,o!==null)if(Ff(o.value,s)){if(o.children===i.children&&!ul.current){e=Eg(t,e,n);break e}}else for(o=e.child,o!==null&&(o.return=e);o!==null;){var a=o.dependencies;if(a!==null){s=o.child;for(var l=a.firstContext;l!==null;){if(l.context===r){if(o.tag===1){l=ng(-1,n&-n),l.tag=2;var c=o.updateQueue;if(c!==null){c=c.shared;var u=c.pending;u===null?l.next=l:(l.next=u.next,u.next=l),c.pending=l}}o.lanes|=n,l=o.alternate,l!==null&&(l.lanes|=n),dH(o.return,n,e),a.lanes|=n;break}l=l.next}}else if(o.tag===10)s=o.type===e.type?null:o.child;else if(o.tag===18){if(s=o.return,s===null)throw Error(et(341));s.lanes|=n,a=s.alternate,a!==null&&(a.lanes|=n),dH(s,n,e),s=o.sibling}else s=o.child;if(s!==null)s.return=o;else for(s=o;s!==null;){if(s===e){s=null;break}if(o=s.sibling,o!==null){o.return=s.return,s=o;break}s=s.return}o=s}ga(t,e,i.children,n),e=e.child}return e;case 9:return i=e.type,r=e.pendingProps.children,T_(e,n),i=bu(i),r=r(i),e.flags|=1,ga(t,e,r,n),e.child;case 14:return r=e.type,i=lf(r,e.pendingProps),i=lf(r.type,i),Uue(t,e,r,i,n);case 15:return _Te(t,e,e.type,e.pendingProps,n);case 17:return r=e.type,i=e.pendingProps,i=e.elementType===r?i:lf(r,i),K$(t,e),e.tag=1,fl(r)?(t=!0,hF(e)):t=!1,T_(e,n),xTe(e,r,i),pH(e,r,i,n),vH(null,e,r,!0,t,n);case 19:return TTe(t,e,n);case 22:return STe(t,e,n)}throw Error(et(156,e.tag))};function WTe(t,e){return m2e(t,e)}function NKe(t,e,n,r){this.tag=t,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=e,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function tu(t,e,n,r){return new NKe(t,e,n,r)}function FJ(t){return t=t.prototype,!(!t||!t.isReactComponent)}function zKe(t){if(typeof t=="function")return FJ(t)?1:0;if(t!=null){if(t=t.$$typeof,t===nJ)return 11;if(t===rJ)return 14}return 2}function Lv(t,e){var n=t.alternate;return n===null?(n=tu(t.tag,e,t.key,t.mode),n.elementType=t.elementType,n.type=t.type,n.stateNode=t.stateNode,n.alternate=t,t.alternate=n):(n.pendingProps=e,n.type=t.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=t.flags&14680064,n.childLanes=t.childLanes,n.lanes=t.lanes,n.child=t.child,n.memoizedProps=t.memoizedProps,n.memoizedState=t.memoizedState,n.updateQueue=t.updateQueue,e=t.dependencies,n.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext},n.sibling=t.sibling,n.index=t.index,n.ref=t.ref,n}function e3(t,e,n,r,i,o){var s=2;if(r=t,typeof t=="function")FJ(t)&&(s=1);else if(typeof t=="string")s=5;else e:switch(t){case Vw:return Ex(n.children,i,o,e);case tJ:s=8,i|=8;break;case NG:return t=tu(12,n,e,i|2),t.elementType=NG,t.lanes=o,t;case zG:return t=tu(13,n,e,i),t.elementType=zG,t.lanes=o,t;case jG:return t=tu(19,n,e,i),t.elementType=jG,t.lanes=o,t;case JEe:return Cj(n,i,o,e);default:if(typeof t=="object"&&t!==null)switch(t.$$typeof){case KEe:s=10;break e;case ZEe:s=9;break e;case nJ:s=11;break e;case rJ:s=14;break e;case Nm:s=16,r=null;break e}throw Error(et(130,t==null?t:typeof t,""))}return e=tu(s,n,e,i),e.elementType=t,e.type=r,e.lanes=o,e}function Ex(t,e,n,r){return t=tu(7,t,r,e),t.lanes=n,t}function Cj(t,e,n,r){return t=tu(22,t,r,e),t.elementType=JEe,t.lanes=n,t.stateNode={isHidden:!1},t}function V8(t,e,n){return t=tu(6,t,null,e),t.lanes=n,t}function G8(t,e,n){return e=tu(4,t.children!==null?t.children:[],t.key,e),e.lanes=n,e.stateNode={containerInfo:t.containerInfo,pendingChildren:null,implementation:t.implementation},e}function jKe(t,e,n,r,i){this.tag=e,this.containerInfo=t,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=O8(0),this.expirationTimes=O8(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=O8(0),this.identifierPrefix=r,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function NJ(t,e,n,r,i,o,s,a,l){return t=new jKe(t,e,n,a,l),e===1?(e=1,o===!0&&(e|=8)):e=0,o=tu(3,null,null,e),t.current=o,o.stateNode=t,o.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},wJ(o),t}function BKe(t,e,n){var r=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(qTe)}catch(t){console.error(t)}}qTe(),qEe.exports=Pc;var qC=qEe.exports;const qD=on(qC);var nfe=qC;$G.createRoot=nfe.createRoot,$G.hydrateRoot=nfe.hydrateRoot;var XTe={exports:{}},HKe="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED",qKe=HKe,XKe=qKe;function YTe(){}function QTe(){}QTe.resetWarningCache=YTe;var YKe=function(){function t(r,i,o,s,a,l){if(l!==XKe){var c=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw c.name="Invariant Violation",c}}t.isRequired=t;function e(){return t}var n={array:t,bigint:t,bool:t,func:t,number:t,object:t,string:t,symbol:t,any:t,arrayOf:e,element:t,elementType:t,instanceOf:e,node:t,objectOf:e,oneOf:e,oneOfType:e,shape:e,exact:e,checkPropTypes:QTe,resetWarningCache:YTe};return n.PropTypes=n,n};XTe.exports=YKe();var hM=XTe.exports;const pe=on(hM);var Aj=de.createContext(null);function QKe(t){t()}var KTe=QKe,KKe=function(e){return KTe=e},ZKe=function(){return KTe};function JKe(){var t=ZKe(),e=null,n=null;return{clear:function(){e=null,n=null},notify:function(){t(function(){for(var i=e;i;)i.callback(),i=i.next})},get:function(){for(var i=[],o=e;o;)i.push(o),o=o.next;return i},subscribe:function(i){var o=!0,s=n={callback:i,next:null,prev:n};return s.prev?s.prev.next=s:e=s,function(){!o||e===null||(o=!1,s.next?s.next.prev=s.prev:n=s.prev,s.prev?s.prev.next=s.next:e=s.next)}}}}var rfe={notify:function(){},get:function(){return[]}};function ZTe(t,e){var n,r=rfe;function i(f){return l(),r.subscribe(f)}function o(){r.notify()}function s(){u.onStateChange&&u.onStateChange()}function a(){return!!n}function l(){n||(n=e?e.addNestedSub(s):t.subscribe(s),r=JKe())}function c(){n&&(n(),n=void 0,r.clear(),r=rfe)}var u={addNestedSub:i,notifyNestedSubs:o,handleChangeWrapper:s,isSubscribed:a,trySubscribe:l,tryUnsubscribe:c,getListeners:function(){return r}};return u}var JTe=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u"?D.useLayoutEffect:D.useEffect;function eZe(t){var e=t.store,n=t.context,r=t.children,i=D.useMemo(function(){var a=ZTe(e);return{store:e,subscription:a}},[e]),o=D.useMemo(function(){return e.getState()},[e]);JTe(function(){var a=i.subscription;return a.onStateChange=a.notifyNestedSubs,a.trySubscribe(),o!==e.getState()&&a.notifyNestedSubs(),function(){a.tryUnsubscribe(),a.onStateChange=null}},[i,o]);var s=n||Aj;return de.createElement(s.Provider,{value:i},r)}function ve(){return ve=Object.assign?Object.assign.bind():function(t){for(var e=1;e<\/script>",t=t.removeChild(t.firstChild)):typeof r.is=="string"?t=s.createElement(n,{is:r.is}):(t=s.createElement(n),n==="select"&&(s=t,r.multiple?s.multiple=!0:r.size&&(s.size=r.size))):t=s.createElementNS(t,n),t[Ld]=e,t[Gk]=r,tke(t,e,!1,!1),e.stateNode=t;e:{switch(s=cH(n,r),n){case"dialog":qr("cancel",t),qr("close",t),i=r;break;case"iframe":case"object":case"embed":qr("load",t),i=r;break;case"video":case"audio":for(i=0;ipS&&(e.flags|=128,r=!0,CE(o,!1),e.lanes=4194304)}else{if(!r)if(t=gF(s),t!==null){if(e.flags|=128,r=!0,n=t.updateQueue,n!==null&&(e.updateQueue=n,e.flags|=4),CE(o,!0),o.tail===null&&o.tailMode==="hidden"&&!s.alternate&&!ui)return ks(e),null}else 2*Vi()-o.renderingStartTime>pS&&n!==1073741824&&(e.flags|=128,r=!0,CE(o,!1),e.lanes=4194304);o.isBackwards?(s.sibling=e.child,e.child=s):(n=o.last,n!==null?n.sibling=s:e.child=s,o.last=s)}return o.tail!==null?(e=o.tail,o.rendering=e,o.tail=e.sibling,o.renderingStartTime=Vi(),e.sibling=null,n=wi.current,jr(wi,r?n&1|2:n&1),e):(ks(e),null);case 22:case 23:return KJ(),r=e.memoizedState!==null,t!==null&&t.memoizedState!==null!==r&&(e.flags|=8192),r&&e.mode&1?Hl&1073741824&&(ks(e),e.subtreeFlags&6&&(e.flags|=8192)):ks(e),null;case 24:return null;case 25:return null}throw Error(et(156,e.tag))}function JKe(t,e){switch(MJ(e),e.tag){case 1:return cl(e.type)&&lF(),t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 3:return dS(),ri(ll),ri(Js),jJ(),t=e.flags,t&65536&&!(t&128)?(e.flags=t&-65537|128,e):null;case 5:return zJ(e),null;case 13:if(ri(wi),t=e.memoizedState,t!==null&&t.dehydrated!==null){if(e.alternate===null)throw Error(et(340));uS()}return t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 19:return ri(wi),null;case 4:return dS(),null;case 10:return LJ(e.type._context),null;case 22:case 23:return KJ(),null;case 24:return null;default:return null}}var BD=!1,Us=!1,eZe=typeof WeakSet=="function"?WeakSet:Set,Ot=null;function Zw(t,e){var n=t.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){Li(t,e,r)}else n.current=null}function $H(t,e,n){try{n()}catch(r){Li(t,e,r)}}var ufe=!1;function tZe(t,e){if(xH=iF,t=lTe(),AJ(t)){if("selectionStart"in t)var n={start:t.selectionStart,end:t.selectionEnd};else e:{n=(n=t.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var i=r.anchorOffset,o=r.focusNode;r=r.focusOffset;try{n.nodeType,o.nodeType}catch{n=null;break e}var s=0,a=-1,l=-1,c=0,u=0,f=t,d=null;t:for(;;){for(var h;f!==n||i!==0&&f.nodeType!==3||(a=s+i),f!==o||r!==0&&f.nodeType!==3||(l=s+r),f.nodeType===3&&(s+=f.nodeValue.length),(h=f.firstChild)!==null;)d=f,f=h;for(;;){if(f===t)break t;if(d===n&&++c===i&&(a=s),d===o&&++u===r&&(l=s),(h=f.nextSibling)!==null)break;f=d,d=f.parentNode}f=h}n=a===-1||l===-1?null:{start:a,end:l}}else n=null}n=n||{start:0,end:0}}else n=null;for(bH={focusedElem:t,selectionRange:n},iF=!1,Ot=e;Ot!==null;)if(e=Ot,t=e.child,(e.subtreeFlags&1028)!==0&&t!==null)t.return=e,Ot=t;else for(;Ot!==null;){e=Ot;try{var p=e.alternate;if(e.flags&1024)switch(e.tag){case 0:case 11:case 15:break;case 1:if(p!==null){var g=p.memoizedProps,m=p.memoizedState,v=e.stateNode,y=v.getSnapshotBeforeUpdate(e.elementType===e.type?g:lf(e.type,g),m);v.__reactInternalSnapshotBeforeUpdate=y}break;case 3:var x=e.stateNode.containerInfo;x.nodeType===1?x.textContent="":x.nodeType===9&&x.documentElement&&x.removeChild(x.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(et(163))}}catch(b){Li(e,e.return,b)}if(t=e.sibling,t!==null){t.return=e.return,Ot=t;break}Ot=e.return}return p=ufe,ufe=!1,p}function VT(t,e,n){var r=e.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var i=r=r.next;do{if((i.tag&t)===t){var o=i.destroy;i.destroy=void 0,o!==void 0&&$H(e,n,o)}i=i.next}while(i!==r)}}function yj(t,e){if(e=e.updateQueue,e=e!==null?e.lastEffect:null,e!==null){var n=e=e.next;do{if((n.tag&t)===t){var r=n.create;n.destroy=r()}n=n.next}while(n!==e)}}function FH(t){var e=t.ref;if(e!==null){var n=t.stateNode;switch(t.tag){case 5:t=n;break;default:t=n}typeof e=="function"?e(t):e.current=t}}function ike(t){var e=t.alternate;e!==null&&(t.alternate=null,ike(e)),t.child=null,t.deletions=null,t.sibling=null,t.tag===5&&(e=t.stateNode,e!==null&&(delete e[Ld],delete e[Gk],delete e[SH],delete e[FKe],delete e[NKe])),t.stateNode=null,t.return=null,t.dependencies=null,t.memoizedProps=null,t.memoizedState=null,t.pendingProps=null,t.stateNode=null,t.updateQueue=null}function oke(t){return t.tag===5||t.tag===3||t.tag===4}function ffe(t){e:for(;;){for(;t.sibling===null;){if(t.return===null||oke(t.return))return null;t=t.return}for(t.sibling.return=t.return,t=t.sibling;t.tag!==5&&t.tag!==6&&t.tag!==18;){if(t.flags&2||t.child===null||t.tag===4)continue e;t.child.return=t,t=t.child}if(!(t.flags&2))return t.stateNode}}function NH(t,e,n){var r=t.tag;if(r===5||r===6)t=t.stateNode,e?n.nodeType===8?n.parentNode.insertBefore(t,e):n.insertBefore(t,e):(n.nodeType===8?(e=n.parentNode,e.insertBefore(t,n)):(e=n,e.appendChild(t)),n=n._reactRootContainer,n!=null||e.onclick!==null||(e.onclick=aF));else if(r!==4&&(t=t.child,t!==null))for(NH(t,e,n),t=t.sibling;t!==null;)NH(t,e,n),t=t.sibling}function zH(t,e,n){var r=t.tag;if(r===5||r===6)t=t.stateNode,e?n.insertBefore(t,e):n.appendChild(t);else if(r!==4&&(t=t.child,t!==null))for(zH(t,e,n),t=t.sibling;t!==null;)zH(t,e,n),t=t.sibling}var es=null,ff=!1;function am(t,e,n){for(n=n.child;n!==null;)ske(t,e,n),n=n.sibling}function ske(t,e,n){if(oh&&typeof oh.onCommitFiberUnmount=="function")try{oh.onCommitFiberUnmount(uj,n)}catch{}switch(n.tag){case 5:Us||Zw(n,e);case 6:var r=es,i=ff;es=null,am(t,e,n),es=r,ff=i,es!==null&&(ff?(t=es,n=n.stateNode,t.nodeType===8?t.parentNode.removeChild(n):t.removeChild(n)):es.removeChild(n.stateNode));break;case 18:es!==null&&(ff?(t=es,n=n.stateNode,t.nodeType===8?$8(t.parentNode,n):t.nodeType===1&&$8(t,n),jk(t)):$8(es,n.stateNode));break;case 4:r=es,i=ff,es=n.stateNode.containerInfo,ff=!0,am(t,e,n),es=r,ff=i;break;case 0:case 11:case 14:case 15:if(!Us&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){i=r=r.next;do{var o=i,s=o.destroy;o=o.tag,s!==void 0&&(o&2||o&4)&&$H(n,e,s),i=i.next}while(i!==r)}am(t,e,n);break;case 1:if(!Us&&(Zw(n,e),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(a){Li(n,e,a)}am(t,e,n);break;case 21:am(t,e,n);break;case 22:n.mode&1?(Us=(r=Us)||n.memoizedState!==null,am(t,e,n),Us=r):am(t,e,n);break;default:am(t,e,n)}}function dfe(t){var e=t.updateQueue;if(e!==null){t.updateQueue=null;var n=t.stateNode;n===null&&(n=t.stateNode=new eZe),e.forEach(function(r){var i=uZe.bind(null,t,r);n.has(r)||(n.add(r),r.then(i,i))})}}function Hu(t,e){var n=e.deletions;if(n!==null)for(var r=0;ri&&(i=s),r&=~o}if(r=i,r=Vi()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*rZe(r/1960))-r,10t?16:t,av===null)var r=!1;else{if(t=av,av=null,bF=0,Hn&6)throw Error(et(331));var i=Hn;for(Hn|=4,Ot=t.current;Ot!==null;){var o=Ot,s=o.child;if(Ot.flags&16){var a=o.deletions;if(a!==null){for(var l=0;lVi()-YJ?Ox(t,0):XJ|=n),ul(t,e)}function pke(t,e){e===0&&(t.mode&1?(e=RD,RD<<=1,!(RD&130023424)&&(RD=4194304)):e=1);var n=Sa();t=_g(t,e),t!==null&&(cM(t,e,n),ul(t,n))}function cZe(t){var e=t.memoizedState,n=0;e!==null&&(n=e.retryLane),pke(t,n)}function uZe(t,e){var n=0;switch(t.tag){case 13:var r=t.stateNode,i=t.memoizedState;i!==null&&(n=i.retryLane);break;case 19:r=t.stateNode;break;default:throw Error(et(314))}r!==null&&r.delete(e),pke(t,n)}var gke;gke=function(t,e,n){if(t!==null)if(t.memoizedProps!==e.pendingProps||ll.current)il=!0;else{if(!(t.lanes&n)&&!(e.flags&128))return il=!1,KKe(t,e,n);il=!!(t.flags&131072)}else il=!1,ui&&e.flags&1048576&&xTe(e,fF,e.index);switch(e.lanes=0,e.tag){case 2:var r=e.type;q$(t,e),t=e.pendingProps;var i=cS(e,Js.current);E_(e,n),i=UJ(null,e,r,t,i,n);var o=WJ();return e.flags|=1,typeof i=="object"&&i!==null&&typeof i.render=="function"&&i.$$typeof===void 0?(e.tag=1,e.memoizedState=null,e.updateQueue=null,cl(r)?(o=!0,cF(e)):o=!1,e.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,FJ(e),i.updater=vj,e.stateNode=i,i._reactInternals=e,AH(e,r,t,n),e=RH(null,e,r,!0,o,n)):(e.tag=0,ui&&o&&PJ(e),ha(null,e,i,n),e=e.child),e;case 16:r=e.elementType;e:{switch(q$(t,e),t=e.pendingProps,i=r._init,r=i(r._payload),e.type=r,i=e.tag=dZe(r),t=lf(r,t),i){case 0:e=MH(null,e,r,t,n);break e;case 1:e=afe(null,e,r,t,n);break e;case 11:e=ofe(null,e,r,t,n);break e;case 14:e=sfe(null,e,r,lf(r.type,t),n);break e}throw Error(et(306,r,""))}return e;case 0:return r=e.type,i=e.pendingProps,i=e.elementType===r?i:lf(r,i),MH(t,e,r,i,n);case 1:return r=e.type,i=e.pendingProps,i=e.elementType===r?i:lf(r,i),afe(t,e,r,i,n);case 3:e:{if(ZTe(e),t===null)throw Error(et(387));r=e.pendingProps,o=e.memoizedState,i=o.element,OTe(t,e),pF(e,r,null,n);var s=e.memoizedState;if(r=s.element,o.isDehydrated)if(o={element:r,isDehydrated:!1,cache:s.cache,pendingSuspenseBoundaries:s.pendingSuspenseBoundaries,transitions:s.transitions},e.updateQueue.baseState=o,e.memoizedState=o,e.flags&256){i=hS(Error(et(423)),e),e=lfe(t,e,r,n,i);break e}else if(r!==i){i=hS(Error(et(424)),e),e=lfe(t,e,r,n,i);break e}else for(ic=Pv(e.stateNode.containerInfo.firstChild),uc=e,ui=!0,vf=null,n=STe(e,null,r,n),e.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(uS(),r===i){e=Sg(t,e,n);break e}ha(t,e,r,n)}e=e.child}return e;case 5:return ETe(e),t===null&&EH(e),r=e.type,i=e.pendingProps,o=t!==null?t.memoizedProps:null,s=i.children,wH(r,i)?s=null:o!==null&&wH(r,o)&&(e.flags|=32),KTe(t,e),ha(t,e,s,n),e.child;case 6:return t===null&&EH(e),null;case 13:return JTe(t,e,n);case 4:return NJ(e,e.stateNode.containerInfo),r=e.pendingProps,t===null?e.child=fS(e,null,r,n):ha(t,e,r,n),e.child;case 11:return r=e.type,i=e.pendingProps,i=e.elementType===r?i:lf(r,i),ofe(t,e,r,i,n);case 7:return ha(t,e,e.pendingProps,n),e.child;case 8:return ha(t,e,e.pendingProps.children,n),e.child;case 12:return ha(t,e,e.pendingProps.children,n),e.child;case 10:e:{if(r=e.type._context,i=e.pendingProps,o=e.memoizedProps,s=i.value,jr(dF,r._currentValue),r._currentValue=s,o!==null)if(Ff(o.value,s)){if(o.children===i.children&&!ll.current){e=Sg(t,e,n);break e}}else for(o=e.child,o!==null&&(o.return=e);o!==null;){var a=o.dependencies;if(a!==null){s=o.child;for(var l=a.firstContext;l!==null;){if(l.context===r){if(o.tag===1){l=Jp(-1,n&-n),l.tag=2;var c=o.updateQueue;if(c!==null){c=c.shared;var u=c.pending;u===null?l.next=l:(l.next=u.next,u.next=l),c.pending=l}}o.lanes|=n,l=o.alternate,l!==null&&(l.lanes|=n),TH(o.return,n,e),a.lanes|=n;break}l=l.next}}else if(o.tag===10)s=o.type===e.type?null:o.child;else if(o.tag===18){if(s=o.return,s===null)throw Error(et(341));s.lanes|=n,a=s.alternate,a!==null&&(a.lanes|=n),TH(s,n,e),s=o.sibling}else s=o.child;if(s!==null)s.return=o;else for(s=o;s!==null;){if(s===e){s=null;break}if(o=s.sibling,o!==null){o.return=s.return,s=o;break}s=s.return}o=s}ha(t,e,i.children,n),e=e.child}return e;case 9:return i=e.type,r=e.pendingProps.children,E_(e,n),i=bu(i),r=r(i),e.flags|=1,ha(t,e,r,n),e.child;case 14:return r=e.type,i=lf(r,e.pendingProps),i=lf(r.type,i),sfe(t,e,r,i,n);case 15:return YTe(t,e,e.type,e.pendingProps,n);case 17:return r=e.type,i=e.pendingProps,i=e.elementType===r?i:lf(r,i),q$(t,e),e.tag=1,cl(r)?(t=!0,cF(e)):t=!1,E_(e,n),HTe(e,r,i),AH(e,r,i,n),RH(null,e,r,!0,t,n);case 19:return eke(t,e,n);case 22:return QTe(t,e,n)}throw Error(et(156,e.tag))};function mke(t,e){return W2e(t,e)}function fZe(t,e,n,r){this.tag=t,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=e,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function tu(t,e,n,r){return new fZe(t,e,n,r)}function JJ(t){return t=t.prototype,!(!t||!t.isReactComponent)}function dZe(t){if(typeof t=="function")return JJ(t)?1:0;if(t!=null){if(t=t.$$typeof,t===yJ)return 11;if(t===xJ)return 14}return 2}function Iv(t,e){var n=t.alternate;return n===null?(n=tu(t.tag,e,t.key,t.mode),n.elementType=t.elementType,n.type=t.type,n.stateNode=t.stateNode,n.alternate=t,t.alternate=n):(n.pendingProps=e,n.type=t.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=t.flags&14680064,n.childLanes=t.childLanes,n.lanes=t.lanes,n.child=t.child,n.memoizedProps=t.memoizedProps,n.memoizedState=t.memoizedState,n.updateQueue=t.updateQueue,e=t.dependencies,n.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext},n.sibling=t.sibling,n.index=t.index,n.ref=t.ref,n}function Q$(t,e,n,r,i,o){var s=2;if(r=t,typeof t=="function")JJ(t)&&(s=1);else if(typeof t=="string")s=5;else e:switch(t){case Ww:return Ex(n.children,i,o,e);case vJ:s=8,i|=8;break;case JG:return t=tu(12,n,e,i|2),t.elementType=JG,t.lanes=o,t;case eH:return t=tu(13,n,e,i),t.elementType=eH,t.lanes=o,t;case tH:return t=tu(19,n,e,i),t.elementType=tH,t.lanes=o,t;case E2e:return bj(n,i,o,e);default:if(typeof t=="object"&&t!==null)switch(t.$$typeof){case C2e:s=10;break e;case O2e:s=9;break e;case yJ:s=11;break e;case xJ:s=14;break e;case $m:s=16,r=null;break e}throw Error(et(130,t==null?t:typeof t,""))}return e=tu(s,n,e,i),e.elementType=t,e.type=r,e.lanes=o,e}function Ex(t,e,n,r){return t=tu(7,t,r,e),t.lanes=n,t}function bj(t,e,n,r){return t=tu(22,t,r,e),t.elementType=E2e,t.lanes=n,t.stateNode={isHidden:!1},t}function V8(t,e,n){return t=tu(6,t,null,e),t.lanes=n,t}function G8(t,e,n){return e=tu(4,t.children!==null?t.children:[],t.key,e),e.lanes=n,e.stateNode={containerInfo:t.containerInfo,pendingChildren:null,implementation:t.implementation},e}function hZe(t,e,n,r,i){this.tag=e,this.containerInfo=t,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=O8(0),this.expirationTimes=O8(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=O8(0),this.identifierPrefix=r,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function eee(t,e,n,r,i,o,s,a,l){return t=new hZe(t,e,n,a,l),e===1?(e=1,o===!0&&(e|=8)):e=0,o=tu(3,null,null,e),t.current=o,o.stateNode=t,o.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},FJ(o),t}function pZe(t,e,n){var r=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(bke)}catch(t){console.error(t)}}bke(),b2e.exports=Ac;var HC=b2e.exports;const VD=sn(HC);var bfe=HC;KG.createRoot=bfe.createRoot,KG.hydrateRoot=bfe.hydrateRoot;var wke={exports:{}},xZe="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED",bZe=xZe,wZe=bZe;function _ke(){}function Ske(){}Ske.resetWarningCache=_ke;var _Ze=function(){function t(r,i,o,s,a,l){if(l!==wZe){var c=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw c.name="Invariant Violation",c}}t.isRequired=t;function e(){return t}var n={array:t,bigint:t,bool:t,func:t,number:t,object:t,string:t,symbol:t,any:t,arrayOf:e,element:t,elementType:t,instanceOf:e,node:t,objectOf:e,oneOf:e,oneOfType:e,shape:e,exact:e,checkPropTypes:Ske,resetWarningCache:_ke};return n.PropTypes=n,n};wke.exports=_Ze();var hM=wke.exports;const pe=sn(hM);var Oj=de.createContext(null);function SZe(t){t()}var Cke=SZe,CZe=function(e){return Cke=e},OZe=function(){return Cke};function EZe(){var t=OZe(),e=null,n=null;return{clear:function(){e=null,n=null},notify:function(){t(function(){for(var i=e;i;)i.callback(),i=i.next})},get:function(){for(var i=[],o=e;o;)i.push(o),o=o.next;return i},subscribe:function(i){var o=!0,s=n={callback:i,next:null,prev:n};return s.prev?s.prev.next=s:e=s,function(){!o||e===null||(o=!1,s.next?s.next.prev=s.prev:n=s.prev,s.prev?s.prev.next=s.next:e=s.next)}}}}var wfe={notify:function(){},get:function(){return[]}};function Oke(t,e){var n,r=wfe;function i(f){return l(),r.subscribe(f)}function o(){r.notify()}function s(){u.onStateChange&&u.onStateChange()}function a(){return!!n}function l(){n||(n=e?e.addNestedSub(s):t.subscribe(s),r=EZe())}function c(){n&&(n(),n=void 0,r.clear(),r=wfe)}var u={addNestedSub:i,notifyNestedSubs:o,handleChangeWrapper:s,isSubscribed:a,trySubscribe:l,tryUnsubscribe:c,getListeners:function(){return r}};return u}var Eke=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u"?D.useLayoutEffect:D.useEffect;function TZe(t){var e=t.store,n=t.context,r=t.children,i=D.useMemo(function(){var a=Oke(e);return{store:e,subscription:a}},[e]),o=D.useMemo(function(){return e.getState()},[e]);Eke(function(){var a=i.subscription;return a.onStateChange=a.notifyNestedSubs,a.trySubscribe(),o!==e.getState()&&a.notifyNestedSubs(),function(){a.tryUnsubscribe(),a.onStateChange=null}},[i,o]);var s=n||Oj;return de.createElement(s.Provider,{value:i},r)}function ve(){return ve=Object.assign?Object.assign.bind():function(t){for(var e=1;e=0;r--){var i=e[r](t);if(i)return i}return function(o,s){throw new Error("Invalid value of type "+typeof t+" for "+n+" argument when connecting component "+s.wrappedComponentName+".")}}function ZZe(t,e){return t===e}function JZe(t){var e={},n=e.connectHOC,r=n===void 0?DZe:n,i=e.mapStateToPropsFactories,o=i===void 0?BZe:i,s=e.mapDispatchToPropsFactories,a=s===void 0?NZe:s,l=e.mergePropsFactories,c=l===void 0?HZe:l,u=e.selectorFactory,f=u===void 0?QZe:u;return function(h,p,g,m){m===void 0&&(m={});var v=m,y=v.pure,x=y===void 0?!0:y,b=v.areStatesEqual,w=b===void 0?ZZe:b,_=v.areOwnPropsEqual,S=_===void 0?H8:_,O=v.areStatePropsEqual,k=O===void 0?H8:O,E=v.areMergedPropsEqual,M=E===void 0?H8:E,A=Dt(v,KZe),P=q8(h,o,"mapStateToProps"),T=q8(p,a,"mapDispatchToProps"),R=q8(g,c,"mergeProps");return r(f,ve({methodName:"connect",getDisplayName:function(B){return"Connect("+B+")"},shouldHandleStateChanges:!!h,initMapStateToProps:P,initMapDispatchToProps:T,initMergeProps:R,pure:x,areStatesEqual:w,areOwnPropsEqual:S,areStatePropsEqual:k,areMergedPropsEqual:M},A))}}const Rn=JZe();KKe(qC.unstable_batchedUpdates);function Tg(t){"@babel/helpers - typeof";return Tg=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Tg(t)}function eJe(t,e){if(Tg(t)!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e||"default");if(Tg(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function fke(t){var e=eJe(t,"string");return Tg(e)=="symbol"?e:e+""}function yt(t,e,n){return(e=fke(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function ufe(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function ffe(t){for(var e=1;e"u"&&(n=e,e=void 0),typeof n<"u"){if(typeof n!="function")throw new Error(Bl(1));return n(dke)(t,e)}if(typeof t!="function")throw new Error(Bl(2));var i=t,o=e,s=[],a=s,l=!1;function c(){a===s&&(a=s.slice())}function u(){if(l)throw new Error(Bl(3));return o}function f(g){if(typeof g!="function")throw new Error(Bl(4));if(l)throw new Error(Bl(5));var m=!0;return c(),a.push(g),function(){if(m){if(l)throw new Error(Bl(6));m=!1,c();var y=a.indexOf(g);a.splice(y,1),s=null}}}function d(g){if(!tJe(g))throw new Error(Bl(7));if(typeof g.type>"u")throw new Error(Bl(8));if(l)throw new Error(Bl(9));try{l=!0,o=i(o,g)}finally{l=!1}for(var m=s=a,v=0;v"u"?"undefined":R(j);return N!=="object"?N:j===Math?"math":j===null?"null":Array.isArray(j)?"array":Object.prototype.toString.call(j)==="[object Date]"?"date":typeof j.toString=="function"&&/^\/.*\//.test(j.toString())?"regexp":"object"}function f(j,N,F,H,q,Y,le){q=q||[],le=le||[];var K=q.slice(0);if(typeof Y<"u"){if(H){if(typeof H=="function"&&H(K,Y))return;if((typeof H>"u"?"undefined":R(H))==="object"){if(H.prefilter&&H.prefilter(K,Y))return;if(H.normalize){var ee=H.normalize(K,Y,j,N);ee&&(j=ee[0],N=ee[1])}}}K.push(Y)}u(j)==="regexp"&&u(N)==="regexp"&&(j=j.toString(),N=N.toString());var re=typeof j>"u"?"undefined":R(j),me=typeof N>"u"?"undefined":R(N),te=re!=="undefined"||le&&le[le.length-1].lhs&&le[le.length-1].lhs.hasOwnProperty(Y),ae=me!=="undefined"||le&&le[le.length-1].rhs&&le[le.length-1].rhs.hasOwnProperty(Y);if(!te&&ae)F(new s(K,N));else if(!ae&&te)F(new a(K,j));else if(u(j)!==u(N))F(new o(K,j,N));else if(u(j)==="date"&&j-N!==0)F(new o(K,j,N));else if(re==="object"&&j!==null&&N!==null)if(le.filter(function(V){return V.lhs===j}).length)j!==N&&F(new o(K,j,N));else{if(le.push({lhs:j,rhs:N}),Array.isArray(j)){var U;for(j.length,U=0;U=N.length?F(new l(K,U,new a(void 0,j[U]))):f(j[U],N[U],F,H,K,U,le);for(;U=0?(f(j[V],N[V],F,H,K,V,le),ne=c(ne,Z)):f(j[V],void 0,F,H,K,V,le)}),ne.forEach(function(V){f(void 0,N[V],F,H,K,V,le)})}le.length=le.length-1}else j!==N&&(re==="number"&&isNaN(j)&&isNaN(N)||F(new o(K,j,N)))}function d(j,N,F,H){return H=H||[],f(j,N,function(q){q&&H.push(q)},F),H.length?H:void 0}function h(j,N,F){if(F.path&&F.path.length){var H,q=j[N],Y=F.path.length-1;for(H=0;H"u"&&(H[F.path[q]]=typeof F.path[q]=="number"?[]:{}),H=H[F.path[q]];switch(F.kind){case"A":h(F.path?H[F.path[q]]:H,F.index,F.item);break;case"D":delete H[F.path[q]];break;case"E":case"N":H[F.path[q]]=F.rhs}}}function g(j,N,F){if(F.path&&F.path.length){var H,q=j[N],Y=F.path.length-1;for(H=0;H"u"&&(Y[F.path[H]]={}),Y=Y[F.path[H]];switch(F.kind){case"A":g(Y[F.path[H]],F.index,F.item);break;case"D":Y[F.path[H]]=F.lhs;break;case"E":Y[F.path[H]]=F.lhs;break;case"N":delete Y[F.path[H]]}}}function v(j,N,F){if(j&&N){var H=function(q){F&&!F(j,N,q)||p(j,N,q)};f(j,N,H)}}function y(j){return"color: "+$[j].color+"; font-weight: bold"}function x(j){var N=j.kind,F=j.path,H=j.lhs,q=j.rhs,Y=j.index,le=j.item;switch(N){case"E":return[F.join("."),H,"→",q];case"N":return[F.join("."),q];case"D":return[F.join(".")];case"A":return[F.join(".")+"["+Y+"]",le];default:return[]}}function b(j,N,F,H){var q=d(j,N);try{H?F.groupCollapsed("diff"):F.group("diff")}catch{F.log("diff")}q?q.forEach(function(Y){var le=Y.kind,K=x(Y);F.log.apply(F,["%c "+$[le].text,y(le)].concat(I(K)))}):F.log("—— no diff ——");try{F.groupEnd()}catch{F.log("—— diff end —— ")}}function w(j,N,F,H){switch(typeof j>"u"?"undefined":R(j)){case"object":return typeof j[H]=="function"?j[H].apply(j,I(F)):j[H];case"function":return j(N);default:return j}}function _(j){var N=j.timestamp,F=j.duration;return function(H,q,Y){var le=["action"];return le.push("%c"+String(H.type)),N&&le.push("%c@ "+q),F&&le.push("%c(in "+Y.toFixed(2)+" ms)"),le.join(" ")}}function S(j,N){var F=N.logger,H=N.actionTransformer,q=N.titleFormatter,Y=q===void 0?_(N):q,le=N.collapsed,K=N.colors,ee=N.level,re=N.diff,me=typeof N.titleFormatter>"u";j.forEach(function(te,ae){var U=te.started,oe=te.startedTime,ne=te.action,V=te.prevState,X=te.error,Z=te.took,he=te.nextState,xe=j[ae+1];xe&&(he=xe.prevState,Z=xe.started-U);var G=H(ne),W=typeof le=="function"?le(function(){return he},ne,te):le,J=P(oe),se=K.title?"color: "+K.title(G)+";":"",ye=["color: gray; font-weight: lighter;"];ye.push(se),N.timestamp&&ye.push("color: gray; font-weight: lighter;"),N.duration&&ye.push("color: gray; font-weight: lighter;");var ie=Y(G,J,Z);try{W?K.title&&me?F.groupCollapsed.apply(F,["%c "+ie].concat(ye)):F.groupCollapsed(ie):K.title&&me?F.group.apply(F,["%c "+ie].concat(ye)):F.group(ie)}catch{F.log(ie)}var fe=w(ee,G,[V],"prevState"),Q=w(ee,G,[G],"action"),_e=w(ee,G,[X,V],"error"),we=w(ee,G,[he],"nextState");if(fe)if(K.prevState){var Ie="color: "+K.prevState(V)+"; font-weight: bold";F[fe]("%c prev state",Ie,V)}else F[fe]("prev state",V);if(Q)if(K.action){var Pe="color: "+K.action(G)+"; font-weight: bold";F[Q]("%c action ",Pe,G)}else F[Q]("action ",G);if(X&&_e)if(K.error){var Me="color: "+K.error(X,V)+"; font-weight: bold;";F[_e]("%c error ",Me,X)}else F[_e]("error ",X);if(we)if(K.nextState){var Te="color: "+K.nextState(he)+"; font-weight: bold";F[we]("%c next state",Te,he)}else F[we]("next state",he);re&&b(V,he,F,W);try{F.groupEnd()}catch{F.log("—— log end ——")}})}function O(){var j=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},N=Object.assign({},z,j),F=N.logger,H=N.stateTransformer,q=N.errorTransformer,Y=N.predicate,le=N.logErrors,K=N.diffPredicate;if(typeof F>"u")return function(){return function(re){return function(me){return re(me)}}};if(j.getState&&j.dispatch)return console.error(`[redux-logger] redux-logger not installed. Make sure to pass logger instance as middleware: + */var $j=60103,Fj=60106,pM=60107,gM=60108,mM=60114,vM=60109,yM=60110,xM=60112,bM=60113,cee=60120,wM=60115,_M=60116,Rke=60121,Dke=60122,Ike=60117,Lke=60129,$ke=60131;if(typeof Symbol=="function"&&Symbol.for){var Zo=Symbol.for;$j=Zo("react.element"),Fj=Zo("react.portal"),pM=Zo("react.fragment"),gM=Zo("react.strict_mode"),mM=Zo("react.profiler"),vM=Zo("react.provider"),yM=Zo("react.context"),xM=Zo("react.forward_ref"),bM=Zo("react.suspense"),cee=Zo("react.suspense_list"),wM=Zo("react.memo"),_M=Zo("react.lazy"),Rke=Zo("react.block"),Dke=Zo("react.server.block"),Ike=Zo("react.fundamental"),Lke=Zo("react.debug_trace_mode"),$ke=Zo("react.legacy_hidden")}function Zf(t){if(typeof t=="object"&&t!==null){var e=t.$$typeof;switch(e){case $j:switch(t=t.type,t){case pM:case mM:case gM:case bM:case cee:return t;default:switch(t=t&&t.$$typeof,t){case yM:case xM:case _M:case wM:case vM:return t;default:return e}}case Fj:return e}}}var BZe=vM,UZe=$j,WZe=xM,VZe=pM,GZe=_M,HZe=wM,qZe=Fj,XZe=mM,YZe=gM,QZe=bM;$r.ContextConsumer=yM;$r.ContextProvider=BZe;$r.Element=UZe;$r.ForwardRef=WZe;$r.Fragment=VZe;$r.Lazy=GZe;$r.Memo=HZe;$r.Portal=qZe;$r.Profiler=XZe;$r.StrictMode=YZe;$r.Suspense=QZe;$r.isAsyncMode=function(){return!1};$r.isConcurrentMode=function(){return!1};$r.isContextConsumer=function(t){return Zf(t)===yM};$r.isContextProvider=function(t){return Zf(t)===vM};$r.isElement=function(t){return typeof t=="object"&&t!==null&&t.$$typeof===$j};$r.isForwardRef=function(t){return Zf(t)===xM};$r.isFragment=function(t){return Zf(t)===pM};$r.isLazy=function(t){return Zf(t)===_M};$r.isMemo=function(t){return Zf(t)===wM};$r.isPortal=function(t){return Zf(t)===Fj};$r.isProfiler=function(t){return Zf(t)===mM};$r.isStrictMode=function(t){return Zf(t)===gM};$r.isSuspense=function(t){return Zf(t)===bM};$r.isValidElementType=function(t){return typeof t=="string"||typeof t=="function"||t===pM||t===mM||t===Lke||t===gM||t===bM||t===cee||t===$ke||typeof t=="object"&&t!==null&&(t.$$typeof===_M||t.$$typeof===wM||t.$$typeof===vM||t.$$typeof===yM||t.$$typeof===xM||t.$$typeof===Ike||t.$$typeof===Rke||t[0]===Dke)};$r.typeOf=Zf;Mke.exports=$r;var KZe=Mke.exports,ZZe=["getDisplayName","methodName","renderCountProp","shouldHandleStateChanges","storeKey","withRef","forwardRef","context"],JZe=["reactReduxForwardedRef"],eJe=[],tJe=[null,null];function nJe(t,e){var n=t[1];return[e.payload,n+1]}function Ofe(t,e,n){Eke(function(){return t.apply(void 0,e)},n)}function rJe(t,e,n,r,i,o,s){t.current=r,e.current=i,n.current=!1,o.current&&(o.current=null,s())}function iJe(t,e,n,r,i,o,s,a,l,c){if(t){var u=!1,f=null,d=function(){if(!u){var g=e.getState(),m,v;try{m=r(g,i.current)}catch(y){v=y,f=y}v||(f=null),m===o.current?s.current||l():(o.current=m,a.current=m,s.current=!0,c({type:"STORE_UPDATED",payload:{error:v}}))}};n.onStateChange=d,n.trySubscribe(),d();var h=function(){if(u=!0,n.tryUnsubscribe(),n.onStateChange=null,f)throw f};return h}}var oJe=function(){return[null,0]};function sJe(t,e){e===void 0&&(e={});var n=e,r=n.getDisplayName,i=r===void 0?function(x){return"ConnectAdvanced("+x+")"}:r,o=n.methodName,s=o===void 0?"connectAdvanced":o,a=n.renderCountProp,l=a===void 0?void 0:a,c=n.shouldHandleStateChanges,u=c===void 0?!0:c,f=n.storeKey,d=f===void 0?"store":f;n.withRef;var h=n.forwardRef,p=h===void 0?!1:h,g=n.context,m=g===void 0?Oj:g,v=Rt(n,ZZe),y=m;return function(b){var w=b.displayName||b.name||"Component",_=i(w),S=ve({},v,{getDisplayName:i,methodName:s,renderCountProp:l,shouldHandleStateChanges:u,storeKey:d,displayName:_,wrappedComponentName:w,WrappedComponent:b}),O=v.pure;function k(T){return t(T.dispatch,S)}var E=O?D.useMemo:function(T){return T()};function P(T){var M=D.useMemo(function(){var Z=T.reactReduxForwardedRef,he=Rt(T,JZe);return[T.context,Z,he]},[T]),I=M[0],j=M[1],N=M[2],z=D.useMemo(function(){return I&&I.Consumer&&KZe.isContextConsumer(de.createElement(I.Consumer,null))?I:y},[I,y]),L=D.useContext(z),B=!!T.store&&!!T.store.getState&&!!T.store.dispatch;L&&L.store;var F=B?T.store:L.store,$=D.useMemo(function(){return k(F)},[F]),q=D.useMemo(function(){if(!u)return tJe;var Z=Oke(F,B?null:L.subscription),he=Z.notifyNestedSubs.bind(Z);return[Z,he]},[F,B,L]),G=q[0],Y=q[1],le=D.useMemo(function(){return B?L:ve({},L,{subscription:G})},[B,L,G]),K=D.useReducer(nJe,eJe,oJe),ee=K[0],re=ee[0],ge=K[1];if(re&&re.error)throw re.error;var te=D.useRef(),ae=D.useRef(N),U=D.useRef(),oe=D.useRef(!1),ne=E(function(){return U.current&&N===ae.current?U.current:$(F.getState(),N)},[F,re,N]);Ofe(rJe,[ae,te,oe,N,ne,U,Y]),Ofe(iJe,[u,F,G,$,ae,te,oe,U,Y,ge],[F,G,$]);var V=D.useMemo(function(){return de.createElement(b,ve({},ne,{ref:j}))},[j,b,ne]),X=D.useMemo(function(){return u?de.createElement(z.Provider,{value:le},V):V},[z,V,le]);return X}var A=O?de.memo(P):P;if(A.WrappedComponent=b,A.displayName=P.displayName=_,p){var R=de.forwardRef(function(M,I){return de.createElement(A,ve({},M,{reactReduxForwardedRef:I}))});return R.displayName=_,R.WrappedComponent=b,VH(R,b)}return VH(A,b)}}function Efe(t,e){return t===e?t!==0||e!==0||1/t===1/e:t!==t&&e!==e}function H8(t,e){if(Efe(t,e))return!0;if(typeof t!="object"||t===null||typeof e!="object"||e===null)return!1;var n=Object.keys(t),r=Object.keys(e);if(n.length!==r.length)return!1;for(var i=0;i=0;r--){var i=e[r](t);if(i)return i}return function(o,s){throw new Error("Invalid value of type "+typeof t+" for "+n+" argument when connecting component "+s.wrappedComponentName+".")}}function OJe(t,e){return t===e}function EJe(t){var e={},n=e.connectHOC,r=n===void 0?sJe:n,i=e.mapStateToPropsFactories,o=i===void 0?pJe:i,s=e.mapDispatchToPropsFactories,a=s===void 0?fJe:s,l=e.mergePropsFactories,c=l===void 0?xJe:l,u=e.selectorFactory,f=u===void 0?SJe:u;return function(h,p,g,m){m===void 0&&(m={});var v=m,y=v.pure,x=y===void 0?!0:y,b=v.areStatesEqual,w=b===void 0?OJe:b,_=v.areOwnPropsEqual,S=_===void 0?H8:_,O=v.areStatePropsEqual,k=O===void 0?H8:O,E=v.areMergedPropsEqual,P=E===void 0?H8:E,A=Rt(v,CJe),R=q8(h,o,"mapStateToProps"),T=q8(p,a,"mapDispatchToProps"),M=q8(g,c,"mergeProps");return r(f,ve({methodName:"connect",getDisplayName:function(j){return"Connect("+j+")"},shouldHandleStateChanges:!!h,initMapStateToProps:R,initMapDispatchToProps:T,initMergeProps:M,pure:x,areStatesEqual:w,areOwnPropsEqual:S,areStatePropsEqual:k,areMergedPropsEqual:P},A))}}const Rn=EJe();CZe(HC.unstable_batchedUpdates);function Cg(t){"@babel/helpers - typeof";return Cg=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Cg(t)}function TJe(t,e){if(Cg(t)!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e||"default");if(Cg(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Nke(t){var e=TJe(t,"string");return Cg(e)=="symbol"?e:e+""}function yt(t,e,n){return(e=Nke(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function kfe(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function Afe(t){for(var e=1;e"u"&&(n=e,e=void 0),typeof n<"u"){if(typeof n!="function")throw new Error(zl(1));return n(zke)(t,e)}if(typeof t!="function")throw new Error(zl(2));var i=t,o=e,s=[],a=s,l=!1;function c(){a===s&&(a=s.slice())}function u(){if(l)throw new Error(zl(3));return o}function f(g){if(typeof g!="function")throw new Error(zl(4));if(l)throw new Error(zl(5));var m=!0;return c(),a.push(g),function(){if(m){if(l)throw new Error(zl(6));m=!1,c();var y=a.indexOf(g);a.splice(y,1),s=null}}}function d(g){if(!kJe(g))throw new Error(zl(7));if(typeof g.type>"u")throw new Error(zl(8));if(l)throw new Error(zl(9));try{l=!0,o=i(o,g)}finally{l=!1}for(var m=s=a,v=0;v"u"?"undefined":M(B);return F!=="object"?F:B===Math?"math":B===null?"null":Array.isArray(B)?"array":Object.prototype.toString.call(B)==="[object Date]"?"date":typeof B.toString=="function"&&/^\/.*\//.test(B.toString())?"regexp":"object"}function f(B,F,$,q,G,Y,le){G=G||[],le=le||[];var K=G.slice(0);if(typeof Y<"u"){if(q){if(typeof q=="function"&&q(K,Y))return;if((typeof q>"u"?"undefined":M(q))==="object"){if(q.prefilter&&q.prefilter(K,Y))return;if(q.normalize){var ee=q.normalize(K,Y,B,F);ee&&(B=ee[0],F=ee[1])}}}K.push(Y)}u(B)==="regexp"&&u(F)==="regexp"&&(B=B.toString(),F=F.toString());var re=typeof B>"u"?"undefined":M(B),ge=typeof F>"u"?"undefined":M(F),te=re!=="undefined"||le&&le[le.length-1].lhs&&le[le.length-1].lhs.hasOwnProperty(Y),ae=ge!=="undefined"||le&&le[le.length-1].rhs&&le[le.length-1].rhs.hasOwnProperty(Y);if(!te&&ae)$(new s(K,F));else if(!ae&&te)$(new a(K,B));else if(u(B)!==u(F))$(new o(K,B,F));else if(u(B)==="date"&&B-F!==0)$(new o(K,B,F));else if(re==="object"&&B!==null&&F!==null)if(le.filter(function(V){return V.lhs===B}).length)B!==F&&$(new o(K,B,F));else{if(le.push({lhs:B,rhs:F}),Array.isArray(B)){var U;for(B.length,U=0;U=F.length?$(new l(K,U,new a(void 0,B[U]))):f(B[U],F[U],$,q,K,U,le);for(;U=0?(f(B[V],F[V],$,q,K,V,le),ne=c(ne,Z)):f(B[V],void 0,$,q,K,V,le)}),ne.forEach(function(V){f(void 0,F[V],$,q,K,V,le)})}le.length=le.length-1}else B!==F&&(re==="number"&&isNaN(B)&&isNaN(F)||$(new o(K,B,F)))}function d(B,F,$,q){return q=q||[],f(B,F,function(G){G&&q.push(G)},$),q.length?q:void 0}function h(B,F,$){if($.path&&$.path.length){var q,G=B[F],Y=$.path.length-1;for(q=0;q"u"&&(q[$.path[G]]=typeof $.path[G]=="number"?[]:{}),q=q[$.path[G]];switch($.kind){case"A":h($.path?q[$.path[G]]:q,$.index,$.item);break;case"D":delete q[$.path[G]];break;case"E":case"N":q[$.path[G]]=$.rhs}}}function g(B,F,$){if($.path&&$.path.length){var q,G=B[F],Y=$.path.length-1;for(q=0;q"u"&&(Y[$.path[q]]={}),Y=Y[$.path[q]];switch($.kind){case"A":g(Y[$.path[q]],$.index,$.item);break;case"D":Y[$.path[q]]=$.lhs;break;case"E":Y[$.path[q]]=$.lhs;break;case"N":delete Y[$.path[q]]}}}function v(B,F,$){if(B&&F){var q=function(G){$&&!$(B,F,G)||p(B,F,G)};f(B,F,q)}}function y(B){return"color: "+N[B].color+"; font-weight: bold"}function x(B){var F=B.kind,$=B.path,q=B.lhs,G=B.rhs,Y=B.index,le=B.item;switch(F){case"E":return[$.join("."),q,"→",G];case"N":return[$.join("."),G];case"D":return[$.join(".")];case"A":return[$.join(".")+"["+Y+"]",le];default:return[]}}function b(B,F,$,q){var G=d(B,F);try{q?$.groupCollapsed("diff"):$.group("diff")}catch{$.log("diff")}G?G.forEach(function(Y){var le=Y.kind,K=x(Y);$.log.apply($,["%c "+N[le].text,y(le)].concat(I(K)))}):$.log("—— no diff ——");try{$.groupEnd()}catch{$.log("—— diff end —— ")}}function w(B,F,$,q){switch(typeof B>"u"?"undefined":M(B)){case"object":return typeof B[q]=="function"?B[q].apply(B,I($)):B[q];case"function":return B(F);default:return B}}function _(B){var F=B.timestamp,$=B.duration;return function(q,G,Y){var le=["action"];return le.push("%c"+String(q.type)),F&&le.push("%c@ "+G),$&&le.push("%c(in "+Y.toFixed(2)+" ms)"),le.join(" ")}}function S(B,F){var $=F.logger,q=F.actionTransformer,G=F.titleFormatter,Y=G===void 0?_(F):G,le=F.collapsed,K=F.colors,ee=F.level,re=F.diff,ge=typeof F.titleFormatter>"u";B.forEach(function(te,ae){var U=te.started,oe=te.startedTime,ne=te.action,V=te.prevState,X=te.error,Z=te.took,he=te.nextState,xe=B[ae+1];xe&&(he=xe.prevState,Z=xe.started-U);var H=q(ne),W=typeof le=="function"?le(function(){return he},ne,te):le,J=R(oe),se=K.title?"color: "+K.title(H)+";":"",ye=["color: gray; font-weight: lighter;"];ye.push(se),F.timestamp&&ye.push("color: gray; font-weight: lighter;"),F.duration&&ye.push("color: gray; font-weight: lighter;");var ie=Y(H,J,Z);try{W?K.title&&ge?$.groupCollapsed.apply($,["%c "+ie].concat(ye)):$.groupCollapsed(ie):K.title&&ge?$.group.apply($,["%c "+ie].concat(ye)):$.group(ie)}catch{$.log(ie)}var fe=w(ee,H,[V],"prevState"),Q=w(ee,H,[H],"action"),_e=w(ee,H,[X,V],"error"),we=w(ee,H,[he],"nextState");if(fe)if(K.prevState){var Ie="color: "+K.prevState(V)+"; font-weight: bold";$[fe]("%c prev state",Ie,V)}else $[fe]("prev state",V);if(Q)if(K.action){var Pe="color: "+K.action(H)+"; font-weight: bold";$[Q]("%c action ",Pe,H)}else $[Q]("action ",H);if(X&&_e)if(K.error){var Me="color: "+K.error(X,V)+"; font-weight: bold;";$[_e]("%c error ",Me,X)}else $[_e]("error ",X);if(we)if(K.nextState){var Te="color: "+K.nextState(he)+"; font-weight: bold";$[we]("%c next state",Te,he)}else $[we]("next state",he);re&&b(V,he,$,W);try{$.groupEnd()}catch{$.log("—— log end ——")}})}function O(){var B=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},F=Object.assign({},z,B),$=F.logger,q=F.stateTransformer,G=F.errorTransformer,Y=F.predicate,le=F.logErrors,K=F.diffPredicate;if(typeof $>"u")return function(){return function(re){return function(ge){return re(ge)}}};if(B.getState&&B.dispatch)return console.error(`[redux-logger] redux-logger not installed. Make sure to pass logger instance as middleware: // Logger with default options import { logger } from 'redux-logger' const store = createStore( @@ -67,20 +67,20 @@ const store = createStore( reducer, applyMiddleware(logger) ) -`),function(){return function(re){return function(me){return re(me)}}};var ee=[];return function(re){var me=re.getState;return function(te){return function(ae){if(typeof Y=="function"&&!Y(me,ae))return te(ae);var U={};ee.push(U),U.started=T.now(),U.startedTime=new Date,U.prevState=H(me()),U.action=ae;var oe=void 0;if(le)try{oe=te(ae)}catch(V){U.error=q(V)}else oe=te(ae);U.took=T.now()-U.started,U.nextState=H(me());var ne=N.diff&&typeof K=="function"?K(me,ae):N.diff;if(S(ee,Object.assign({},N,{diff:ne})),ee.length=0,U.error)throw U.error;return oe}}}}var k,E,M=function(j,N){return new Array(N+1).join(j)},A=function(j,N){return M("0",N-j.toString().length)+j},P=function(j){return A(j.getHours(),2)+":"+A(j.getMinutes(),2)+":"+A(j.getSeconds(),2)+"."+A(j.getMilliseconds(),3)},T=typeof performance<"u"&&performance!==null&&typeof performance.now=="function"?performance:Date,R=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(j){return typeof j}:function(j){return j&&typeof Symbol=="function"&&j.constructor===Symbol&&j!==Symbol.prototype?"symbol":typeof j},I=function(j){if(Array.isArray(j)){for(var N=0,F=Array(j.length);N"u"?"undefined":R(ei))==="object"&&ei?ei:typeof window<"u"?window:{},E=k.DeepDiff,E&&B.push(function(){typeof E<"u"&&k.DeepDiff===d&&(k.DeepDiff=E,E=void 0)}),r(o,i),r(s,i),r(a,i),r(l,i),Object.defineProperties(d,{diff:{value:d,enumerable:!0},observableDiff:{value:f,enumerable:!0},applyDiff:{value:v,enumerable:!0},applyChange:{value:p,enumerable:!0},revertChange:{value:m,enumerable:!0},isConflict:{value:function(){return typeof E<"u"},enumerable:!0},noConflict:{value:function(){return B&&(B.forEach(function(j){j()}),B=null),d},enumerable:!0}});var $={E:{color:"#2196F3",text:"CHANGED:"},N:{color:"#4CAF50",text:"ADDED:"},D:{color:"#F44336",text:"DELETED:"},A:{color:"#2196F3",text:"ARRAY:"}},z={level:"log",logger:console,logErrors:!0,collapsed:void 0,predicate:void 0,duration:!1,timestamp:!0,stateTransformer:function(j){return j},actionTransformer:function(j){return j},errorTransformer:function(j){return j},colors:{title:function(){return"inherit"},prevState:function(){return"#9E9E9E"},action:function(){return"#03A9F4"},nextState:function(){return"#4CAF50"},error:function(){return"#F20404"}},diff:!1,diffPredicate:void 0,transformer:void 0},L=function(){var j=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},N=j.dispatch,F=j.getState;return typeof N=="function"||typeof F=="function"?O()({dispatch:N,getState:F}):void console.error(` +`),function(){return function(re){return function(ge){return re(ge)}}};var ee=[];return function(re){var ge=re.getState;return function(te){return function(ae){if(typeof Y=="function"&&!Y(ge,ae))return te(ae);var U={};ee.push(U),U.started=T.now(),U.startedTime=new Date,U.prevState=q(ge()),U.action=ae;var oe=void 0;if(le)try{oe=te(ae)}catch(V){U.error=G(V)}else oe=te(ae);U.took=T.now()-U.started,U.nextState=q(ge());var ne=F.diff&&typeof K=="function"?K(ge,ae):F.diff;if(S(ee,Object.assign({},F,{diff:ne})),ee.length=0,U.error)throw U.error;return oe}}}}var k,E,P=function(B,F){return new Array(F+1).join(B)},A=function(B,F){return P("0",F-B.toString().length)+B},R=function(B){return A(B.getHours(),2)+":"+A(B.getMinutes(),2)+":"+A(B.getSeconds(),2)+"."+A(B.getMilliseconds(),3)},T=typeof performance<"u"&&performance!==null&&typeof performance.now=="function"?performance:Date,M=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(B){return typeof B}:function(B){return B&&typeof Symbol=="function"&&B.constructor===Symbol&&B!==Symbol.prototype?"symbol":typeof B},I=function(B){if(Array.isArray(B)){for(var F=0,$=Array(B.length);F"u"?"undefined":M(ei))==="object"&&ei?ei:typeof window<"u"?window:{},E=k.DeepDiff,E&&j.push(function(){typeof E<"u"&&k.DeepDiff===d&&(k.DeepDiff=E,E=void 0)}),r(o,i),r(s,i),r(a,i),r(l,i),Object.defineProperties(d,{diff:{value:d,enumerable:!0},observableDiff:{value:f,enumerable:!0},applyDiff:{value:v,enumerable:!0},applyChange:{value:p,enumerable:!0},revertChange:{value:m,enumerable:!0},isConflict:{value:function(){return typeof E<"u"},enumerable:!0},noConflict:{value:function(){return j&&(j.forEach(function(B){B()}),j=null),d},enumerable:!0}});var N={E:{color:"#2196F3",text:"CHANGED:"},N:{color:"#4CAF50",text:"ADDED:"},D:{color:"#F44336",text:"DELETED:"},A:{color:"#2196F3",text:"ARRAY:"}},z={level:"log",logger:console,logErrors:!0,collapsed:void 0,predicate:void 0,duration:!1,timestamp:!0,stateTransformer:function(B){return B},actionTransformer:function(B){return B},errorTransformer:function(B){return B},colors:{title:function(){return"inherit"},prevState:function(){return"#9E9E9E"},action:function(){return"#03A9F4"},nextState:function(){return"#4CAF50"},error:function(){return"#F20404"}},diff:!1,diffPredicate:void 0,transformer:void 0},L=function(){var B=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},F=B.dispatch,$=B.getState;return typeof F=="function"||typeof $=="function"?O()({dispatch:F,getState:$}):void console.error(` [redux-logger v3] BREAKING CHANGE [redux-logger v3] Since 3.0.0 redux-logger exports by default logger with default settings. [redux-logger v3] Change [redux-logger v3] import createLogger from 'redux-logger' [redux-logger v3] to [redux-logger v3] import { createLogger } from 'redux-logger' -`)};n.defaults=z,n.createLogger=O,n.logger=L,n.default=L,Object.defineProperty(n,"__esModule",{value:!0})})})(PH,PH.exports);var iJe=PH.exports;function hke(t){var e=function(r){var i=r.dispatch,o=r.getState;return function(s){return function(a){return typeof a=="function"?a(i,o,t):s(a)}}};return e}var pke=hke();pke.withExtraArgument=hke;const Jk={black:"#000",white:"#fff"},jm={50:"#ffebee",100:"#ffcdd2",200:"#ef9a9a",300:"#e57373",400:"#ef5350",500:"#f44336",600:"#e53935",700:"#d32f2f",800:"#c62828",900:"#b71c1c",A100:"#ff8a80",A200:"#ff5252",A400:"#ff1744",A700:"#d50000"},gke={50:"#fce4ec",100:"#f8bbd0",200:"#f48fb1",300:"#f06292",400:"#ec407a",500:"#e91e63",600:"#d81b60",700:"#c2185b",800:"#ad1457",900:"#880e4f",A100:"#ff80ab",A200:"#ff4081",A400:"#f50057",A700:"#c51162"},Bm={50:"#f3e5f5",100:"#e1bee7",200:"#ce93d8",300:"#ba68c8",400:"#ab47bc",500:"#9c27b0",600:"#8e24aa",700:"#7b1fa2",800:"#6a1b9a",900:"#4a148c",A100:"#ea80fc",A200:"#e040fb",A400:"#d500f9",A700:"#aa00ff"},oJe={50:"#ede7f6",100:"#d1c4e9",200:"#b39ddb",300:"#9575cd",400:"#7e57c2",500:"#673ab7",600:"#5e35b1",700:"#512da8",800:"#4527a0",900:"#311b92",A100:"#b388ff",A200:"#7c4dff",A400:"#651fff",A700:"#6200ea"},mke={50:"#e8eaf6",100:"#c5cae9",200:"#9fa8da",300:"#7986cb",400:"#5c6bc0",500:"#3f51b5",600:"#3949ab",700:"#303f9f",800:"#283593",900:"#1a237e",A100:"#8c9eff",A200:"#536dfe",A400:"#3d5afe",A700:"#304ffe"},Um={50:"#e3f2fd",100:"#bbdefb",200:"#90caf9",300:"#64b5f6",400:"#42a5f5",500:"#2196f3",600:"#1e88e5",700:"#1976d2",800:"#1565c0",900:"#0d47a1",A100:"#82b1ff",A200:"#448aff",A400:"#2979ff",A700:"#2962ff"},Wm={50:"#e1f5fe",100:"#b3e5fc",200:"#81d4fa",300:"#4fc3f7",400:"#29b6f6",500:"#03a9f4",600:"#039be5",700:"#0288d1",800:"#0277bd",900:"#01579b",A100:"#80d8ff",A200:"#40c4ff",A400:"#00b0ff",A700:"#0091ea"},vke={50:"#e0f7fa",100:"#b2ebf2",200:"#80deea",300:"#4dd0e1",400:"#26c6da",500:"#00bcd4",600:"#00acc1",700:"#0097a7",800:"#00838f",900:"#006064",A100:"#84ffff",A200:"#18ffff",A400:"#00e5ff",A700:"#00b8d4"},yke={50:"#e0f2f1",100:"#b2dfdb",200:"#80cbc4",300:"#4db6ac",400:"#26a69a",500:"#009688",600:"#00897b",700:"#00796b",800:"#00695c",900:"#004d40",A100:"#a7ffeb",A200:"#64ffda",A400:"#1de9b6",A700:"#00bfa5"},Ip={50:"#e8f5e9",100:"#c8e6c9",200:"#a5d6a7",300:"#81c784",400:"#66bb6a",500:"#4caf50",600:"#43a047",700:"#388e3c",800:"#2e7d32",900:"#1b5e20",A100:"#b9f6ca",A200:"#69f0ae",A400:"#00e676",A700:"#00c853"},sJe={50:"#f1f8e9",100:"#dcedc8",200:"#c5e1a5",300:"#aed581",400:"#9ccc65",500:"#8bc34a",600:"#7cb342",700:"#689f38",800:"#558b2f",900:"#33691e",A100:"#ccff90",A200:"#b2ff59",A400:"#76ff03",A700:"#64dd17"},xke={50:"#f9fbe7",100:"#f0f4c3",200:"#e6ee9c",300:"#dce775",400:"#d4e157",500:"#cddc39",600:"#c0ca33",700:"#afb42b",800:"#9e9d24",900:"#827717",A100:"#f4ff81",A200:"#eeff41",A400:"#c6ff00",A700:"#aeea00"},bke={50:"#fffde7",100:"#fff9c4",200:"#fff59d",300:"#fff176",400:"#ffee58",500:"#ffeb3b",600:"#fdd835",700:"#fbc02d",800:"#f9a825",900:"#f57f17",A100:"#ffff8d",A200:"#ffff00",A400:"#ffea00",A700:"#ffd600"},wke={50:"#fff8e1",100:"#ffecb3",200:"#ffe082",300:"#ffd54f",400:"#ffca28",500:"#ffc107",600:"#ffb300",700:"#ffa000",800:"#ff8f00",900:"#ff6f00",A100:"#ffe57f",A200:"#ffd740",A400:"#ffc400",A700:"#ffab00"},q0={50:"#fff3e0",100:"#ffe0b2",200:"#ffcc80",300:"#ffb74d",400:"#ffa726",500:"#ff9800",600:"#fb8c00",700:"#f57c00",800:"#ef6c00",900:"#e65100",A100:"#ffd180",A200:"#ffab40",A400:"#ff9100",A700:"#ff6d00"},Tx={50:"#fbe9e7",100:"#ffccbc",200:"#ffab91",300:"#ff8a65",400:"#ff7043",500:"#ff5722",600:"#f4511e",700:"#e64a19",800:"#d84315",900:"#bf360c",A100:"#ff9e80",A200:"#ff6e40",A400:"#ff3d00",A700:"#dd2c00"},_ke={50:"#efebe9",100:"#d7ccc8",200:"#bcaaa4",300:"#a1887f",400:"#8d6e63",500:"#795548",600:"#6d4c41",700:"#5d4037",800:"#4e342e",900:"#3e2723",A100:"#d7ccc8",A200:"#bcaaa4",A400:"#8d6e63",A700:"#5d4037"},Ske={50:"#fafafa",100:"#f5f5f5",200:"#eeeeee",300:"#e0e0e0",400:"#bdbdbd",500:"#9e9e9e",600:"#757575",700:"#616161",800:"#424242",900:"#212121",A100:"#f5f5f5",A200:"#eeeeee",A400:"#bdbdbd",A700:"#616161"},aJe={50:"#eceff1",100:"#cfd8dc",200:"#b0bec5",300:"#90a4ae",400:"#78909c",500:"#607d8b",600:"#546e7a",700:"#455a64",800:"#37474f",900:"#263238",A100:"#cfd8dc",A200:"#b0bec5",A400:"#78909c",A700:"#455a64"};function kg(t,...e){const n=new URL(`https://mui.com/production-error/?code=${t}`);return e.forEach(r=>n.searchParams.append("args[]",r)),`Minified MUI error #${t}; visit ${n} for the full message.`}const Df="$$material";function Cke(t){var e=Object.create(null);return function(n){return e[n]===void 0&&(e[n]=t(n)),e[n]}}var lJe=/^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|abbr|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|disableRemotePlayback|download|draggable|encType|enterKeyHint|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|translate|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|incremental|fallback|inert|itemProp|itemScope|itemType|itemID|itemRef|on|option|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/,cJe=Cke(function(t){return lJe.test(t)||t.charCodeAt(0)===111&&t.charCodeAt(1)===110&&t.charCodeAt(2)<91}),uJe=!1;function fJe(t){if(t.sheet)return t.sheet;for(var e=0;e0?rs(XC,--wl):0,gS--,io===10&&(gS=1,Wj--),io}function hc(){return io=wl2||tA(io)>3?"":" "}function SJe(t,e){for(;--e&&hc()&&!(io<48||io>102||io>57&&io<65||io>70&&io<97););return SM(t,t3()+(e<6&&uh()==32&&hc()==32))}function RH(t){for(;hc();)switch(io){case t:return wl;case 34:case 39:t!==34&&t!==39&&RH(io);break;case 40:t===41&&RH(t);break;case 92:hc();break}return wl}function CJe(t,e){for(;hc()&&t+io!==57;)if(t+io===84&&uh()===47)break;return"/*"+SM(e,wl-1)+"*"+Uj(t===47?t:hc())}function OJe(t){for(;!tA(uh());)hc();return SM(t,wl)}function EJe(t){return Mke(r3("",null,null,null,[""],t=Pke(t),0,[0],t))}function r3(t,e,n,r,i,o,s,a,l){for(var c=0,u=0,f=s,d=0,h=0,p=0,g=1,m=1,v=1,y=0,x="",b=i,w=o,_=r,S=x;m;)switch(p=y,y=hc()){case 40:if(p!=108&&rs(S,f-1)==58){MH(S+=ir(n3(y),"&","&\f"),"&\f")!=-1&&(v=-1);break}case 34:case 39:case 91:S+=n3(y);break;case 9:case 10:case 13:case 32:S+=_Je(p);break;case 92:S+=SJe(t3()-1,7);continue;case 47:switch(uh()){case 42:case 47:XD(TJe(CJe(hc(),t3()),e,n),l);break;default:S+="/"}break;case 123*g:a[c++]=Dd(S)*v;case 125*g:case 59:case 0:switch(y){case 0:case 125:m=0;case 59+u:v==-1&&(S=ir(S,/\f/g,"")),h>0&&Dd(S)-f&&XD(h>32?gfe(S+";",r,n,f-1):gfe(ir(S," ","")+";",r,n,f-2),l);break;case 59:S+=";";default:if(XD(_=pfe(S,e,n,c,u,i,a,x,b=[],w=[],f),o),y===123)if(u===0)r3(S,e,_,_,b,o,f,a,w);else switch(d===99&&rs(S,3)===110?100:d){case 100:case 108:case 109:case 115:r3(t,_,_,r&&XD(pfe(t,_,_,0,0,i,a,x,i,b=[],f),w),i,w,f,a,r?b:w);break;default:r3(S,_,_,_,[""],w,0,a,w)}}c=u=h=0,g=v=1,x=S="",f=s;break;case 58:f=1+Dd(S),h=p;default:if(g<1){if(y==123)--g;else if(y==125&&g++==0&&wJe()==125)continue}switch(S+=Uj(y),y*g){case 38:v=u>0?1:(S+="\f",-1);break;case 44:a[c++]=(Dd(S)-1)*v,v=1;break;case 64:uh()===45&&(S+=n3(hc())),d=uh(),u=f=Dd(x=S+=OJe(t3())),y++;break;case 45:p===45&&Dd(S)==2&&(g=0)}}return o}function pfe(t,e,n,r,i,o,s,a,l,c,u){for(var f=i-1,d=i===0?o:[""],h=KJ(d),p=0,g=0,m=0;p0?d[v]+" "+y:ir(y,/&\f/g,d[v])))&&(l[m++]=x);return Vj(t,e,n,i===0?YJ:a,l,c,u)}function TJe(t,e,n){return Vj(t,e,n,Eke,Uj(bJe()),eA(t,2,-2),0)}function gfe(t,e,n,r){return Vj(t,e,n,QJ,eA(t,0,r),eA(t,r+1,-1),r)}function A_(t,e){for(var n="",r=KJ(t),i=0;i6)switch(rs(t,e+1)){case 109:if(rs(t,e+4)!==45)break;case 102:return ir(t,/(.+:)(.+)-([^]+)/,"$1"+nr+"$2-$3$1"+kF+(rs(t,e+3)==108?"$3":"$2-$3"))+t;case 115:return~MH(t,"stretch")?Rke(ir(t,"stretch","fill-available"),e)+t:t}break;case 4949:if(rs(t,e+1)!==115)break;case 6444:switch(rs(t,Dd(t)-3-(~MH(t,"!important")&&10))){case 107:return ir(t,":",":"+nr)+t;case 101:return ir(t,/(.+:)([^;!]+)(;|!.+)?/,"$1"+nr+(rs(t,14)===45?"inline-":"")+"box$3$1"+nr+"$2$3$1"+Is+"$2box$3")+t}break;case 5936:switch(rs(t,e+11)){case 114:return nr+t+Is+ir(t,/[svh]\w+-[tblr]{2}/,"tb")+t;case 108:return nr+t+Is+ir(t,/[svh]\w+-[tblr]{2}/,"tb-rl")+t;case 45:return nr+t+Is+ir(t,/[svh]\w+-[tblr]{2}/,"lr")+t}return nr+t+Is+t+t}return t}var $Je=function(e,n,r,i){if(e.length>-1&&!e.return)switch(e.type){case QJ:e.return=Rke(e.value,e.length);break;case Tke:return A_([TE(e,{value:ir(e.value,"@","@"+nr)})],i);case YJ:if(e.length)return xJe(e.props,function(o){switch(yJe(o,/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":return A_([TE(e,{props:[ir(o,/:(read-\w+)/,":"+kF+"$1")]})],i);case"::placeholder":return A_([TE(e,{props:[ir(o,/:(plac\w+)/,":"+nr+"input-$1")]}),TE(e,{props:[ir(o,/:(plac\w+)/,":"+kF+"$1")]}),TE(e,{props:[ir(o,/:(plac\w+)/,Is+"input-$1")]})],i)}return""})}},FJe=[$Je],Dke=function(e){var n=e.key;if(n==="css"){var r=document.querySelectorAll("style[data-emotion]:not([data-s])");Array.prototype.forEach.call(r,function(g){var m=g.getAttribute("data-emotion");m.indexOf(" ")!==-1&&(document.head.appendChild(g),g.setAttribute("data-s",""))})}var i=e.stylisPlugins||FJe,o={},s,a=[];s=e.container||document.head,Array.prototype.forEach.call(document.querySelectorAll('style[data-emotion^="'+n+' "]'),function(g){for(var m=g.getAttribute("data-emotion").split(" "),v=1;v=4;++r,i-=4)n=t.charCodeAt(r)&255|(t.charCodeAt(++r)&255)<<8|(t.charCodeAt(++r)&255)<<16|(t.charCodeAt(++r)&255)<<24,n=(n&65535)*1540483477+((n>>>16)*59797<<16),n^=n>>>24,e=(n&65535)*1540483477+((n>>>16)*59797<<16)^(e&65535)*1540483477+((e>>>16)*59797<<16);switch(i){case 3:e^=(t.charCodeAt(r+2)&255)<<16;case 2:e^=(t.charCodeAt(r+1)&255)<<8;case 1:e^=t.charCodeAt(r)&255,e=(e&65535)*1540483477+((e>>>16)*59797<<16)}return e^=e>>>13,e=(e&65535)*1540483477+((e>>>16)*59797<<16),((e^e>>>15)>>>0).toString(36)}var BJe={animationIterationCount:1,aspectRatio:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,scale:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1},UJe=!1,WJe=/[A-Z]|^ms/g,VJe=/_EMO_([^_]+?)_([^]*?)_EMO_/g,$ke=function(e){return e.charCodeAt(1)===45},vfe=function(e){return e!=null&&typeof e!="boolean"},Y8=Cke(function(t){return $ke(t)?t:t.replace(WJe,"-$&").toLowerCase()}),yfe=function(e,n){switch(e){case"animation":case"animationName":if(typeof n=="string")return n.replace(VJe,function(r,i,o){return Id={name:i,styles:o,next:Id},i})}return BJe[e]!==1&&!$ke(e)&&typeof n=="number"&&n!==0?n+"px":n},GJe="Component selectors can only be used in conjunction with @emotion/babel-plugin, the swc Emotion plugin, or another Emotion-aware compiler transform.";function nA(t,e,n){if(n==null)return"";var r=n;if(r.__emotion_styles!==void 0)return r;switch(typeof n){case"boolean":return"";case"object":{var i=n;if(i.anim===1)return Id={name:i.name,styles:i.styles,next:Id},i.name;var o=n;if(o.styles!==void 0){var s=o.next;if(s!==void 0)for(;s!==void 0;)Id={name:s.name,styles:s.styles,next:Id},s=s.next;var a=o.styles+";";return a}return HJe(t,e,n)}case"function":{if(t!==void 0){var l=Id,c=n(t);return Id=l,nA(t,e,c)}break}}var u=n;if(e==null)return u;var f=e[u];return f!==void 0?f:u}function HJe(t,e,n){var r="";if(Array.isArray(n))for(var i=0;i96?KJe:ZJe},_fe=function(e,n,r){var i;if(n){var o=n.shouldForwardProp;i=e.__emotion_forwardProp&&o?function(s){return e.__emotion_forwardProp(s)&&o(s)}:o}return typeof i!="function"&&r&&(i=e.__emotion_forwardProp),i},JJe=!1,eet=function(e){var n=e.cache,r=e.serialized,i=e.isStringTag;return Ike(n,r,i),XJe(function(){return Lke(n,r,i)}),null},tet=function t(e,n){var r=e.__emotion_real===e,i=r&&e.__emotion_base||e,o,s;n!==void 0&&(o=n.label,s=n.target);var a=_fe(e,n,r),l=a||wfe(i),c=!l("as");return function(){var u=arguments,f=r&&e.__emotion_styles!==void 0?e.__emotion_styles.slice(0):[];if(o!==void 0&&f.push("label:"+o+";"),u[0]==null||u[0].raw===void 0)f.push.apply(f,u);else{f.push(u[0][0]);for(var d=u.length,h=1;h{const e=Dke(t);class n extends Oke{constructor(i){super(i),this.prepend=e.sheet.prepend}}return e.sheet=new n({key:e.key,nonce:e.sheet.nonce,container:e.sheet.container,speedy:e.sheet.isSpeedy,prepend:e.sheet.prepend,insertionPoint:e.sheet.insertionPoint}),e};let IH;typeof document=="object"&&(IH=ret({key:"css",prepend:!0}));function iet(t){const{injectFirst:e,children:n}=t;return e&&IH?C.jsx(YJe,{value:IH,children:n}):n}function oet(t){return t==null||Object.keys(t).length===0}function jke(t){const{styles:e,defaultTheme:n={}}=t,r=typeof e=="function"?i=>e(oet(i)?n:i):e;return C.jsx(QJe,{styles:r})}/** +`)};n.defaults=z,n.createLogger=O,n.logger=L,n.default=L,Object.defineProperty(n,"__esModule",{value:!0})})})(GH,GH.exports);var MJe=GH.exports;function jke(t){var e=function(r){var i=r.dispatch,o=r.getState;return function(s){return function(a){return typeof a=="function"?a(i,o,t):s(a)}}};return e}var Bke=jke();Bke.withExtraArgument=jke;const Zk={black:"#000",white:"#fff"},Nm={50:"#ffebee",100:"#ffcdd2",200:"#ef9a9a",300:"#e57373",400:"#ef5350",500:"#f44336",600:"#e53935",700:"#d32f2f",800:"#c62828",900:"#b71c1c",A100:"#ff8a80",A200:"#ff5252",A400:"#ff1744",A700:"#d50000"},Uke={50:"#fce4ec",100:"#f8bbd0",200:"#f48fb1",300:"#f06292",400:"#ec407a",500:"#e91e63",600:"#d81b60",700:"#c2185b",800:"#ad1457",900:"#880e4f",A100:"#ff80ab",A200:"#ff4081",A400:"#f50057",A700:"#c51162"},zm={50:"#f3e5f5",100:"#e1bee7",200:"#ce93d8",300:"#ba68c8",400:"#ab47bc",500:"#9c27b0",600:"#8e24aa",700:"#7b1fa2",800:"#6a1b9a",900:"#4a148c",A100:"#ea80fc",A200:"#e040fb",A400:"#d500f9",A700:"#aa00ff"},RJe={50:"#ede7f6",100:"#d1c4e9",200:"#b39ddb",300:"#9575cd",400:"#7e57c2",500:"#673ab7",600:"#5e35b1",700:"#512da8",800:"#4527a0",900:"#311b92",A100:"#b388ff",A200:"#7c4dff",A400:"#651fff",A700:"#6200ea"},Wke={50:"#e8eaf6",100:"#c5cae9",200:"#9fa8da",300:"#7986cb",400:"#5c6bc0",500:"#3f51b5",600:"#3949ab",700:"#303f9f",800:"#283593",900:"#1a237e",A100:"#8c9eff",A200:"#536dfe",A400:"#3d5afe",A700:"#304ffe"},jm={50:"#e3f2fd",100:"#bbdefb",200:"#90caf9",300:"#64b5f6",400:"#42a5f5",500:"#2196f3",600:"#1e88e5",700:"#1976d2",800:"#1565c0",900:"#0d47a1",A100:"#82b1ff",A200:"#448aff",A400:"#2979ff",A700:"#2962ff"},Bm={50:"#e1f5fe",100:"#b3e5fc",200:"#81d4fa",300:"#4fc3f7",400:"#29b6f6",500:"#03a9f4",600:"#039be5",700:"#0288d1",800:"#0277bd",900:"#01579b",A100:"#80d8ff",A200:"#40c4ff",A400:"#00b0ff",A700:"#0091ea"},Vke={50:"#e0f7fa",100:"#b2ebf2",200:"#80deea",300:"#4dd0e1",400:"#26c6da",500:"#00bcd4",600:"#00acc1",700:"#0097a7",800:"#00838f",900:"#006064",A100:"#84ffff",A200:"#18ffff",A400:"#00e5ff",A700:"#00b8d4"},Gke={50:"#e0f2f1",100:"#b2dfdb",200:"#80cbc4",300:"#4db6ac",400:"#26a69a",500:"#009688",600:"#00897b",700:"#00796b",800:"#00695c",900:"#004d40",A100:"#a7ffeb",A200:"#64ffda",A400:"#1de9b6",A700:"#00bfa5"},Mp={50:"#e8f5e9",100:"#c8e6c9",200:"#a5d6a7",300:"#81c784",400:"#66bb6a",500:"#4caf50",600:"#43a047",700:"#388e3c",800:"#2e7d32",900:"#1b5e20",A100:"#b9f6ca",A200:"#69f0ae",A400:"#00e676",A700:"#00c853"},DJe={50:"#f1f8e9",100:"#dcedc8",200:"#c5e1a5",300:"#aed581",400:"#9ccc65",500:"#8bc34a",600:"#7cb342",700:"#689f38",800:"#558b2f",900:"#33691e",A100:"#ccff90",A200:"#b2ff59",A400:"#76ff03",A700:"#64dd17"},Hke={50:"#f9fbe7",100:"#f0f4c3",200:"#e6ee9c",300:"#dce775",400:"#d4e157",500:"#cddc39",600:"#c0ca33",700:"#afb42b",800:"#9e9d24",900:"#827717",A100:"#f4ff81",A200:"#eeff41",A400:"#c6ff00",A700:"#aeea00"},qke={50:"#fffde7",100:"#fff9c4",200:"#fff59d",300:"#fff176",400:"#ffee58",500:"#ffeb3b",600:"#fdd835",700:"#fbc02d",800:"#f9a825",900:"#f57f17",A100:"#ffff8d",A200:"#ffff00",A400:"#ffea00",A700:"#ffd600"},Xke={50:"#fff8e1",100:"#ffecb3",200:"#ffe082",300:"#ffd54f",400:"#ffca28",500:"#ffc107",600:"#ffb300",700:"#ffa000",800:"#ff8f00",900:"#ff6f00",A100:"#ffe57f",A200:"#ffd740",A400:"#ffc400",A700:"#ffab00"},q0={50:"#fff3e0",100:"#ffe0b2",200:"#ffcc80",300:"#ffb74d",400:"#ffa726",500:"#ff9800",600:"#fb8c00",700:"#f57c00",800:"#ef6c00",900:"#e65100",A100:"#ffd180",A200:"#ffab40",A400:"#ff9100",A700:"#ff6d00"},Tx={50:"#fbe9e7",100:"#ffccbc",200:"#ffab91",300:"#ff8a65",400:"#ff7043",500:"#ff5722",600:"#f4511e",700:"#e64a19",800:"#d84315",900:"#bf360c",A100:"#ff9e80",A200:"#ff6e40",A400:"#ff3d00",A700:"#dd2c00"},Yke={50:"#efebe9",100:"#d7ccc8",200:"#bcaaa4",300:"#a1887f",400:"#8d6e63",500:"#795548",600:"#6d4c41",700:"#5d4037",800:"#4e342e",900:"#3e2723",A100:"#d7ccc8",A200:"#bcaaa4",A400:"#8d6e63",A700:"#5d4037"},Qke={50:"#fafafa",100:"#f5f5f5",200:"#eeeeee",300:"#e0e0e0",400:"#bdbdbd",500:"#9e9e9e",600:"#757575",700:"#616161",800:"#424242",900:"#212121",A100:"#f5f5f5",A200:"#eeeeee",A400:"#bdbdbd",A700:"#616161"},IJe={50:"#eceff1",100:"#cfd8dc",200:"#b0bec5",300:"#90a4ae",400:"#78909c",500:"#607d8b",600:"#546e7a",700:"#455a64",800:"#37474f",900:"#263238",A100:"#cfd8dc",A200:"#b0bec5",A400:"#78909c",A700:"#455a64"};function Og(t,...e){const n=new URL(`https://mui.com/production-error/?code=${t}`);return e.forEach(r=>n.searchParams.append("args[]",r)),`Minified MUI error #${t}; visit ${n} for the full message.`}const Df="$$material";function Kke(t){var e=Object.create(null);return function(n){return e[n]===void 0&&(e[n]=t(n)),e[n]}}var LJe=/^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|abbr|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|disableRemotePlayback|download|draggable|encType|enterKeyHint|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|translate|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|incremental|fallback|inert|itemProp|itemScope|itemType|itemID|itemRef|on|option|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/,$Je=Kke(function(t){return LJe.test(t)||t.charCodeAt(0)===111&&t.charCodeAt(1)===110&&t.charCodeAt(2)<91}),FJe=!1;function NJe(t){if(t.sheet)return t.sheet;for(var e=0;e0?rs(qC,--xl):0,gS--,ro===10&&(gS=1,zj--),ro}function fc(){return ro=xl2||eA(ro)>3?"":" "}function QJe(t,e){for(;--e&&fc()&&!(ro<48||ro>102||ro>57&&ro<65||ro>70&&ro<97););return SM(t,K$()+(e<6&&ah()==32&&fc()==32))}function qH(t){for(;fc();)switch(ro){case t:return xl;case 34:case 39:t!==34&&t!==39&&qH(ro);break;case 40:t===41&&qH(t);break;case 92:fc();break}return xl}function KJe(t,e){for(;fc()&&t+ro!==57;)if(t+ro===84&&ah()===47)break;return"/*"+SM(e,xl-1)+"*"+Nj(t===47?t:fc())}function ZJe(t){for(;!eA(ah());)fc();return SM(t,xl)}function JJe(t){return iAe(J$("",null,null,null,[""],t=rAe(t),0,[0],t))}function J$(t,e,n,r,i,o,s,a,l){for(var c=0,u=0,f=s,d=0,h=0,p=0,g=1,m=1,v=1,y=0,x="",b=i,w=o,_=r,S=x;m;)switch(p=y,y=fc()){case 40:if(p!=108&&rs(S,f-1)==58){HH(S+=ir(Z$(y),"&","&\f"),"&\f")!=-1&&(v=-1);break}case 34:case 39:case 91:S+=Z$(y);break;case 9:case 10:case 13:case 32:S+=YJe(p);break;case 92:S+=QJe(K$()-1,7);continue;case 47:switch(ah()){case 42:case 47:GD(eet(KJe(fc(),K$()),e,n),l);break;default:S+="/"}break;case 123*g:a[c++]=Md(S)*v;case 125*g:case 59:case 0:switch(y){case 0:case 125:m=0;case 59+u:v==-1&&(S=ir(S,/\f/g,"")),h>0&&Md(S)-f&&GD(h>32?Dfe(S+";",r,n,f-1):Dfe(ir(S," ","")+";",r,n,f-2),l);break;case 59:S+=";";default:if(GD(_=Rfe(S,e,n,c,u,i,a,x,b=[],w=[],f),o),y===123)if(u===0)J$(S,e,_,_,b,o,f,a,w);else switch(d===99&&rs(S,3)===110?100:d){case 100:case 108:case 109:case 115:J$(t,_,_,r&&GD(Rfe(t,_,_,0,0,i,a,x,i,b=[],f),w),i,w,f,a,r?b:w);break;default:J$(S,_,_,_,[""],w,0,a,w)}}c=u=h=0,g=v=1,x=S="",f=s;break;case 58:f=1+Md(S),h=p;default:if(g<1){if(y==123)--g;else if(y==125&&g++==0&&XJe()==125)continue}switch(S+=Nj(y),y*g){case 38:v=u>0?1:(S+="\f",-1);break;case 44:a[c++]=(Md(S)-1)*v,v=1;break;case 64:ah()===45&&(S+=Z$(fc())),d=ah(),u=f=Md(x=S+=ZJe(K$())),y++;break;case 45:p===45&&Md(S)==2&&(g=0)}}return o}function Rfe(t,e,n,r,i,o,s,a,l,c,u){for(var f=i-1,d=i===0?o:[""],h=hee(d),p=0,g=0,m=0;p0?d[v]+" "+y:ir(y,/&\f/g,d[v])))&&(l[m++]=x);return jj(t,e,n,i===0?fee:a,l,c,u)}function eet(t,e,n){return jj(t,e,n,Jke,Nj(qJe()),Jk(t,2,-2),0)}function Dfe(t,e,n,r){return jj(t,e,n,dee,Jk(t,0,r),Jk(t,r+1,-1),r)}function k_(t,e){for(var n="",r=hee(t),i=0;i6)switch(rs(t,e+1)){case 109:if(rs(t,e+4)!==45)break;case 102:return ir(t,/(.+:)(.+)-([^]+)/,"$1"+nr+"$2-$3$1"+CF+(rs(t,e+3)==108?"$3":"$2-$3"))+t;case 115:return~HH(t,"stretch")?oAe(ir(t,"stretch","fill-available"),e)+t:t}break;case 4949:if(rs(t,e+1)!==115)break;case 6444:switch(rs(t,Md(t)-3-(~HH(t,"!important")&&10))){case 107:return ir(t,":",":"+nr)+t;case 101:return ir(t,/(.+:)([^;!]+)(;|!.+)?/,"$1"+nr+(rs(t,14)===45?"inline-":"")+"box$3$1"+nr+"$2$3$1"+Ds+"$2box$3")+t}break;case 5936:switch(rs(t,e+11)){case 114:return nr+t+Ds+ir(t,/[svh]\w+-[tblr]{2}/,"tb")+t;case 108:return nr+t+Ds+ir(t,/[svh]\w+-[tblr]{2}/,"tb-rl")+t;case 45:return nr+t+Ds+ir(t,/[svh]\w+-[tblr]{2}/,"lr")+t}return nr+t+Ds+t+t}return t}var uet=function(e,n,r,i){if(e.length>-1&&!e.return)switch(e.type){case dee:e.return=oAe(e.value,e.length);break;case eAe:return k_([EE(e,{value:ir(e.value,"@","@"+nr)})],i);case fee:if(e.length)return HJe(e.props,function(o){switch(GJe(o,/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":return k_([EE(e,{props:[ir(o,/:(read-\w+)/,":"+CF+"$1")]})],i);case"::placeholder":return k_([EE(e,{props:[ir(o,/:(plac\w+)/,":"+nr+"input-$1")]}),EE(e,{props:[ir(o,/:(plac\w+)/,":"+CF+"$1")]}),EE(e,{props:[ir(o,/:(plac\w+)/,Ds+"input-$1")]})],i)}return""})}},fet=[uet],sAe=function(e){var n=e.key;if(n==="css"){var r=document.querySelectorAll("style[data-emotion]:not([data-s])");Array.prototype.forEach.call(r,function(g){var m=g.getAttribute("data-emotion");m.indexOf(" ")!==-1&&(document.head.appendChild(g),g.setAttribute("data-s",""))})}var i=e.stylisPlugins||fet,o={},s,a=[];s=e.container||document.head,Array.prototype.forEach.call(document.querySelectorAll('style[data-emotion^="'+n+' "]'),function(g){for(var m=g.getAttribute("data-emotion").split(" "),v=1;v=4;++r,i-=4)n=t.charCodeAt(r)&255|(t.charCodeAt(++r)&255)<<8|(t.charCodeAt(++r)&255)<<16|(t.charCodeAt(++r)&255)<<24,n=(n&65535)*1540483477+((n>>>16)*59797<<16),n^=n>>>24,e=(n&65535)*1540483477+((n>>>16)*59797<<16)^(e&65535)*1540483477+((e>>>16)*59797<<16);switch(i){case 3:e^=(t.charCodeAt(r+2)&255)<<16;case 2:e^=(t.charCodeAt(r+1)&255)<<8;case 1:e^=t.charCodeAt(r)&255,e=(e&65535)*1540483477+((e>>>16)*59797<<16)}return e^=e>>>13,e=(e&65535)*1540483477+((e>>>16)*59797<<16),((e^e>>>15)>>>0).toString(36)}var get={animationIterationCount:1,aspectRatio:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,scale:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1},met=!1,vet=/[A-Z]|^ms/g,yet=/_EMO_([^_]+?)_([^]*?)_EMO_/g,cAe=function(e){return e.charCodeAt(1)===45},Lfe=function(e){return e!=null&&typeof e!="boolean"},Y8=Kke(function(t){return cAe(t)?t:t.replace(vet,"-$&").toLowerCase()}),$fe=function(e,n){switch(e){case"animation":case"animationName":if(typeof n=="string")return n.replace(yet,function(r,i,o){return Rd={name:i,styles:o,next:Rd},i})}return get[e]!==1&&!cAe(e)&&typeof n=="number"&&n!==0?n+"px":n},xet="Component selectors can only be used in conjunction with @emotion/babel-plugin, the swc Emotion plugin, or another Emotion-aware compiler transform.";function tA(t,e,n){if(n==null)return"";var r=n;if(r.__emotion_styles!==void 0)return r;switch(typeof n){case"boolean":return"";case"object":{var i=n;if(i.anim===1)return Rd={name:i.name,styles:i.styles,next:Rd},i.name;var o=n;if(o.styles!==void 0){var s=o.next;if(s!==void 0)for(;s!==void 0;)Rd={name:s.name,styles:s.styles,next:Rd},s=s.next;var a=o.styles+";";return a}return bet(t,e,n)}case"function":{if(t!==void 0){var l=Rd,c=n(t);return Rd=l,tA(t,e,c)}break}}var u=n;if(e==null)return u;var f=e[u];return f!==void 0?f:u}function bet(t,e,n){var r="";if(Array.isArray(n))for(var i=0;i96?Eet:Tet},jfe=function(e,n,r){var i;if(n){var o=n.shouldForwardProp;i=e.__emotion_forwardProp&&o?function(s){return e.__emotion_forwardProp(s)&&o(s)}:o}return typeof i!="function"&&r&&(i=e.__emotion_forwardProp),i},ket=!1,Aet=function(e){var n=e.cache,r=e.serialized,i=e.isStringTag;return aAe(n,r,i),_et(function(){return lAe(n,r,i)}),null},Pet=function t(e,n){var r=e.__emotion_real===e,i=r&&e.__emotion_base||e,o,s;n!==void 0&&(o=n.label,s=n.target);var a=jfe(e,n,r),l=a||zfe(i),c=!l("as");return function(){var u=arguments,f=r&&e.__emotion_styles!==void 0?e.__emotion_styles.slice(0):[];if(o!==void 0&&f.push("label:"+o+";"),u[0]==null||u[0].raw===void 0)f.push.apply(f,u);else{f.push(u[0][0]);for(var d=u.length,h=1;h{const e=sAe(t);class n extends Zke{constructor(i){super(i),this.prepend=e.sheet.prepend}}return e.sheet=new n({key:e.key,nonce:e.sheet.nonce,container:e.sheet.container,speedy:e.sheet.isSpeedy,prepend:e.sheet.prepend,insertionPoint:e.sheet.insertionPoint}),e};let YH;typeof document=="object"&&(YH=Ret({key:"css",prepend:!0}));function Det(t){const{injectFirst:e,children:n}=t;return e&&YH?C.jsx(Cet,{value:YH,children:n}):n}function Iet(t){return t==null||Object.keys(t).length===0}function hAe(t){const{styles:e,defaultTheme:n={}}=t,r=typeof e=="function"?i=>e(Iet(i)?n:i):e;return C.jsx(Oet,{styles:r})}/** * @mui/styled-engine v6.1.5 * * @license MIT * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */function Bke(t,e){return DH(t,e)}function set(t,e){Array.isArray(t.__emotion_styles)&&(t.__emotion_styles=e(t.__emotion_styles))}const Sfe=[];function Cfe(t){return Sfe[0]=t,Gj(Sfe)}function Nd(t){if(typeof t!="object"||t===null)return!1;const e=Object.getPrototypeOf(t);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(Symbol.toStringTag in t)&&!(Symbol.iterator in t)}function Uke(t){if(!Nd(t))return t;const e={};return Object.keys(t).forEach(n=>{e[n]=Uke(t[n])}),e}function Bo(t,e,n={clone:!0}){const r=n.clone?{...t}:t;return Nd(t)&&Nd(e)&&Object.keys(e).forEach(i=>{Nd(e[i])&&Object.prototype.hasOwnProperty.call(t,i)&&Nd(t[i])?r[i]=Bo(t[i],e[i],n):n.clone?r[i]=Nd(e[i])?Uke(e[i]):e[i]:r[i]=e[i]}),r}const aet=t=>{const e=Object.keys(t).map(n=>({key:n,val:t[n]}))||[];return e.sort((n,r)=>n.val-r.val),e.reduce((n,r)=>({...n,[r.key]:r.val}),{})};function cet(t){const{values:e={xs:0,sm:600,md:900,lg:1200,xl:1536},unit:n="px",step:r=5,...i}=t,o=aet(e),s=Object.keys(o);function a(d){return`@media (min-width:${typeof e[d]=="number"?e[d]:d}${n})`}function l(d){return`@media (max-width:${(typeof e[d]=="number"?e[d]:d)-r/100}${n})`}function c(d,h){const p=s.indexOf(h);return`@media (min-width:${typeof e[d]=="number"?e[d]:d}${n}) and (max-width:${(p!==-1&&typeof e[s[p]]=="number"?e[s[p]]:h)-r/100}${n})`}function u(d){return s.indexOf(d)+1r.startsWith("@container")).sort((r,i)=>{var s,a;const o=/min-width:\s*([0-9.]+)/;return+(((s=r.match(o))==null?void 0:s[1])||0)-+(((a=i.match(o))==null?void 0:a[1])||0)});return n.length?n.reduce((r,i)=>{const o=e[i];return delete r[i],r[i]=o,r},{...e}):e}function fet(t,e){return e==="@"||e.startsWith("@")&&(t.some(n=>e.startsWith(`@${n}`))||!!e.match(/^@\d/))}function det(t,e){const n=e.match(/^@([^/]+)?\/?(.+)?$/);if(!n)return null;const[,r,i]=n,o=Number.isNaN(+r)?r||0:+r;return t.containerQueries(i).up(o)}function het(t){const e=(o,s)=>o.replace("@media",s?`@container ${s}`:"@container");function n(o,s){o.up=(...a)=>e(t.breakpoints.up(...a),s),o.down=(...a)=>e(t.breakpoints.down(...a),s),o.between=(...a)=>e(t.breakpoints.between(...a),s),o.only=(...a)=>e(t.breakpoints.only(...a),s),o.not=(...a)=>{const l=e(t.breakpoints.not(...a),s);return l.includes("not all and")?l.replace("not all and ","").replace("min-width:","width<").replace("max-width:","width>").replace("and","or"):l}}const r={},i=o=>(n(r,o),r);return n(i),{...t,containerQueries:i}}const pet={borderRadius:4};function XT(t,e){return e?Bo(t,e,{clone:!1}):t}const qj={xs:0,sm:600,md:900,lg:1200,xl:1536},Ofe={keys:["xs","sm","md","lg","xl"],up:t=>`@media (min-width:${qj[t]}px)`},get={containerQueries:t=>({up:e=>{let n=typeof e=="number"?e:qj[e]||e;return typeof n=="number"&&(n=`${n}px`),t?`@container ${t} (min-width:${n})`:`@container (min-width:${n})`}})};function _u(t,e,n){const r=t.theme||{};if(Array.isArray(e)){const o=r.breakpoints||Ofe;return e.reduce((s,a,l)=>(s[o.up(o.keys[l])]=n(e[l]),s),{})}if(typeof e=="object"){const o=r.breakpoints||Ofe;return Object.keys(e).reduce((s,a)=>{if(fet(o.keys,a)){const l=det(r.containerQueries?r:get,a);l&&(s[l]=n(e[a],a))}else if(Object.keys(o.values||qj).includes(a)){const l=o.up(a);s[l]=n(e[a],a)}else{const l=a;s[l]=e[l]}return s},{})}return n(e)}function met(t={}){var n;return((n=t.keys)==null?void 0:n.reduce((r,i)=>{const o=t.up(i);return r[o]={},r},{}))||{}}function vet(t,e){return t.reduce((n,r)=>{const i=n[r];return(!i||Object.keys(i).length===0)&&delete n[r],n},e)}function yet(t,e){if(typeof t!="object")return{};const n={},r=Object.keys(e);return Array.isArray(t)?r.forEach((i,o)=>{o{t[i]!=null&&(n[i]=!0)}),n}function Xj({values:t,breakpoints:e,base:n}){const r=n||yet(t,e),i=Object.keys(r);if(i.length===0)return t;let o;return i.reduce((s,a,l)=>(Array.isArray(t)?(s[a]=t[l]!=null?t[l]:t[o],o=l):typeof t=="object"?(s[a]=t[a]!=null?t[a]:t[o],o=a):s[a]=t,s),{})}function De(t){if(typeof t!="string")throw new Error(kg(7));return t.charAt(0).toUpperCase()+t.slice(1)}function mS(t,e,n=!0){if(!e||typeof e!="string")return null;if(t&&t.vars&&n){const r=`vars.${e}`.split(".").reduce((i,o)=>i&&i[o]?i[o]:null,t);if(r!=null)return r}return e.split(".").reduce((r,i)=>r&&r[i]!=null?r[i]:null,t)}function AF(t,e,n,r=n){let i;return typeof t=="function"?i=t(n):Array.isArray(t)?i=t[n]||r:i=mS(t,n)||r,e&&(i=e(i,r,t)),i}function Ki(t){const{prop:e,cssProperty:n=t.prop,themeKey:r,transform:i}=t,o=s=>{if(s[e]==null)return null;const a=s[e],l=s.theme,c=mS(l,r)||{};return _u(s,a,f=>{let d=AF(c,i,f);return f===d&&typeof f=="string"&&(d=AF(c,i,`${e}${f==="default"?"":De(f)}`,f)),n===!1?d:{[n]:d}})};return o.propTypes={},o.filterProps=[e],o}function xet(t){const e={};return n=>(e[n]===void 0&&(e[n]=t(n)),e[n])}const bet={m:"margin",p:"padding"},wet={t:"Top",r:"Right",b:"Bottom",l:"Left",x:["Left","Right"],y:["Top","Bottom"]},Efe={marginX:"mx",marginY:"my",paddingX:"px",paddingY:"py"},_et=xet(t=>{if(t.length>2)if(Efe[t])t=Efe[t];else return[t];const[e,n]=t.split(""),r=bet[e],i=wet[n]||"";return Array.isArray(i)?i.map(o=>r+o):[r+i]}),JJ=["m","mt","mr","mb","ml","mx","my","margin","marginTop","marginRight","marginBottom","marginLeft","marginX","marginY","marginInline","marginInlineStart","marginInlineEnd","marginBlock","marginBlockStart","marginBlockEnd"],eee=["p","pt","pr","pb","pl","px","py","padding","paddingTop","paddingRight","paddingBottom","paddingLeft","paddingX","paddingY","paddingInline","paddingInlineStart","paddingInlineEnd","paddingBlock","paddingBlockStart","paddingBlockEnd"];[...JJ,...eee];function OM(t,e,n,r){const i=mS(t,e,!0)??n;return typeof i=="number"||typeof i=="string"?o=>typeof o=="string"?o:typeof i=="string"?`calc(${o} * ${i})`:i*o:Array.isArray(i)?o=>{if(typeof o=="string")return o;const s=Math.abs(o),a=i[s];return o>=0?a:typeof a=="number"?-a:`-${a}`}:typeof i=="function"?i:()=>{}}function tee(t){return OM(t,"spacing",8)}function EM(t,e){return typeof e=="string"||e==null?e:t(e)}function Cet(t,e){return n=>t.reduce((r,i)=>(r[i]=EM(e,n),r),{})}function Oet(t,e,n,r){if(!e.includes(n))return null;const i=_et(n),o=Cet(i,r),s=t[n];return _u(t,s,o)}function Wke(t,e){const n=tee(t.theme);return Object.keys(t).map(r=>Oet(t,e,r,n)).reduce(XT,{})}function ki(t){return Wke(t,JJ)}ki.propTypes={};ki.filterProps=JJ;function Ai(t){return Wke(t,eee)}Ai.propTypes={};Ai.filterProps=eee;function Vke(t=8,e=tee({spacing:t})){if(t.mui)return t;const n=(...r)=>(r.length===0?[1]:r).map(o=>{const s=e(o);return typeof s=="number"?`${s}px`:s}).join(" ");return n.mui=!0,n}function Yj(...t){const e=t.reduce((r,i)=>(i.filterProps.forEach(o=>{r[o]=i}),r),{}),n=r=>Object.keys(r).reduce((i,o)=>e[o]?XT(i,e[o](r)):i,{});return n.propTypes={},n.filterProps=t.reduce((r,i)=>r.concat(i.filterProps),[]),n}function qc(t){return typeof t!="number"?t:`${t}px solid`}function $u(t,e){return Ki({prop:t,themeKey:"borders",transform:e})}const Eet=$u("border",qc),Tet=$u("borderTop",qc),ket=$u("borderRight",qc),Aet=$u("borderBottom",qc),Pet=$u("borderLeft",qc),Met=$u("borderColor"),Ret=$u("borderTopColor"),Det=$u("borderRightColor"),Iet=$u("borderBottomColor"),Let=$u("borderLeftColor"),$et=$u("outline",qc),Fet=$u("outlineColor"),Qj=t=>{if(t.borderRadius!==void 0&&t.borderRadius!==null){const e=OM(t.theme,"shape.borderRadius",4),n=r=>({borderRadius:EM(e,r)});return _u(t,t.borderRadius,n)}return null};Qj.propTypes={};Qj.filterProps=["borderRadius"];Yj(Eet,Tet,ket,Aet,Pet,Met,Ret,Det,Iet,Let,Qj,$et,Fet);const Kj=t=>{if(t.gap!==void 0&&t.gap!==null){const e=OM(t.theme,"spacing",8),n=r=>({gap:EM(e,r)});return _u(t,t.gap,n)}return null};Kj.propTypes={};Kj.filterProps=["gap"];const Zj=t=>{if(t.columnGap!==void 0&&t.columnGap!==null){const e=OM(t.theme,"spacing",8),n=r=>({columnGap:EM(e,r)});return _u(t,t.columnGap,n)}return null};Zj.propTypes={};Zj.filterProps=["columnGap"];const Jj=t=>{if(t.rowGap!==void 0&&t.rowGap!==null){const e=OM(t.theme,"spacing",8),n=r=>({rowGap:EM(e,r)});return _u(t,t.rowGap,n)}return null};Jj.propTypes={};Jj.filterProps=["rowGap"];const Net=Ki({prop:"gridColumn"}),zet=Ki({prop:"gridRow"}),jet=Ki({prop:"gridAutoFlow"}),Bet=Ki({prop:"gridAutoColumns"}),Uet=Ki({prop:"gridAutoRows"}),Wet=Ki({prop:"gridTemplateColumns"}),Vet=Ki({prop:"gridTemplateRows"}),Get=Ki({prop:"gridTemplateAreas"}),Het=Ki({prop:"gridArea"});Yj(Kj,Zj,Jj,Net,zet,jet,Bet,Uet,Wet,Vet,Get,Het);function P_(t,e){return e==="grey"?e:t}const qet=Ki({prop:"color",themeKey:"palette",transform:P_}),Xet=Ki({prop:"bgcolor",cssProperty:"backgroundColor",themeKey:"palette",transform:P_}),Yet=Ki({prop:"backgroundColor",themeKey:"palette",transform:P_});Yj(qet,Xet,Yet);function Jl(t){return t<=1&&t!==0?`${t*100}%`:t}const Qet=Ki({prop:"width",transform:Jl}),nee=t=>{if(t.maxWidth!==void 0&&t.maxWidth!==null){const e=n=>{var i,o,s,a,l;const r=((s=(o=(i=t.theme)==null?void 0:i.breakpoints)==null?void 0:o.values)==null?void 0:s[n])||qj[n];return r?((l=(a=t.theme)==null?void 0:a.breakpoints)==null?void 0:l.unit)!=="px"?{maxWidth:`${r}${t.theme.breakpoints.unit}`}:{maxWidth:r}:{maxWidth:Jl(n)}};return _u(t,t.maxWidth,e)}return null};nee.filterProps=["maxWidth"];const Ket=Ki({prop:"minWidth",transform:Jl}),Zet=Ki({prop:"height",transform:Jl}),Jet=Ki({prop:"maxHeight",transform:Jl}),ett=Ki({prop:"minHeight",transform:Jl});Ki({prop:"size",cssProperty:"width",transform:Jl});Ki({prop:"size",cssProperty:"height",transform:Jl});const ttt=Ki({prop:"boxSizing"});Yj(Qet,nee,Ket,Zet,Jet,ett,ttt);const TM={border:{themeKey:"borders",transform:qc},borderTop:{themeKey:"borders",transform:qc},borderRight:{themeKey:"borders",transform:qc},borderBottom:{themeKey:"borders",transform:qc},borderLeft:{themeKey:"borders",transform:qc},borderColor:{themeKey:"palette"},borderTopColor:{themeKey:"palette"},borderRightColor:{themeKey:"palette"},borderBottomColor:{themeKey:"palette"},borderLeftColor:{themeKey:"palette"},outline:{themeKey:"borders",transform:qc},outlineColor:{themeKey:"palette"},borderRadius:{themeKey:"shape.borderRadius",style:Qj},color:{themeKey:"palette",transform:P_},bgcolor:{themeKey:"palette",cssProperty:"backgroundColor",transform:P_},backgroundColor:{themeKey:"palette",transform:P_},p:{style:Ai},pt:{style:Ai},pr:{style:Ai},pb:{style:Ai},pl:{style:Ai},px:{style:Ai},py:{style:Ai},padding:{style:Ai},paddingTop:{style:Ai},paddingRight:{style:Ai},paddingBottom:{style:Ai},paddingLeft:{style:Ai},paddingX:{style:Ai},paddingY:{style:Ai},paddingInline:{style:Ai},paddingInlineStart:{style:Ai},paddingInlineEnd:{style:Ai},paddingBlock:{style:Ai},paddingBlockStart:{style:Ai},paddingBlockEnd:{style:Ai},m:{style:ki},mt:{style:ki},mr:{style:ki},mb:{style:ki},ml:{style:ki},mx:{style:ki},my:{style:ki},margin:{style:ki},marginTop:{style:ki},marginRight:{style:ki},marginBottom:{style:ki},marginLeft:{style:ki},marginX:{style:ki},marginY:{style:ki},marginInline:{style:ki},marginInlineStart:{style:ki},marginInlineEnd:{style:ki},marginBlock:{style:ki},marginBlockStart:{style:ki},marginBlockEnd:{style:ki},displayPrint:{cssProperty:!1,transform:t=>({"@media print":{display:t}})},display:{},overflow:{},textOverflow:{},visibility:{},whiteSpace:{},flexBasis:{},flexDirection:{},flexWrap:{},justifyContent:{},alignItems:{},alignContent:{},order:{},flex:{},flexGrow:{},flexShrink:{},alignSelf:{},justifyItems:{},justifySelf:{},gap:{style:Kj},rowGap:{style:Jj},columnGap:{style:Zj},gridColumn:{},gridRow:{},gridAutoFlow:{},gridAutoColumns:{},gridAutoRows:{},gridTemplateColumns:{},gridTemplateRows:{},gridTemplateAreas:{},gridArea:{},position:{},zIndex:{themeKey:"zIndex"},top:{},right:{},bottom:{},left:{},boxShadow:{themeKey:"shadows"},width:{transform:Jl},maxWidth:{style:nee},minWidth:{transform:Jl},height:{transform:Jl},maxHeight:{transform:Jl},minHeight:{transform:Jl},boxSizing:{},font:{themeKey:"font"},fontFamily:{themeKey:"typography"},fontSize:{themeKey:"typography"},fontStyle:{themeKey:"typography"},fontWeight:{themeKey:"typography"},letterSpacing:{},textTransform:{},lineHeight:{},textAlign:{},typography:{cssProperty:!1,themeKey:"typography"}};function ntt(...t){const e=t.reduce((r,i)=>r.concat(Object.keys(i)),[]),n=new Set(e);return t.every(r=>n.size===Object.keys(r).length)}function rtt(t,e){return typeof t=="function"?t(e):t}function itt(){function t(n,r,i,o){const s={[n]:r,theme:i},a=o[n];if(!a)return{[n]:r};const{cssProperty:l=n,themeKey:c,transform:u,style:f}=a;if(r==null)return null;if(c==="typography"&&r==="inherit")return{[n]:r};const d=mS(i,c)||{};return f?f(s):_u(s,r,p=>{let g=AF(d,u,p);return p===g&&typeof p=="string"&&(g=AF(d,u,`${n}${p==="default"?"":De(p)}`,p)),l===!1?g:{[l]:g}})}function e(n){const{sx:r,theme:i={}}=n||{};if(!r)return null;const o=i.unstable_sxConfig??TM;function s(a){let l=a;if(typeof a=="function")l=a(i);else if(typeof a!="object")return a;if(!l)return null;const c=met(i.breakpoints),u=Object.keys(c);let f=c;return Object.keys(l).forEach(d=>{const h=rtt(l[d],i);if(h!=null)if(typeof h=="object")if(o[d])f=XT(f,t(d,h,i,o));else{const p=_u({theme:i},h,g=>({[d]:g}));ntt(p,h)?f[d]=e({sx:h,theme:i}):f=XT(f,p)}else f=XT(f,t(d,h,i,o))}),uet(i,vet(u,f))}return Array.isArray(r)?r.map(s):s(r)}return e}const Qv=itt();Qv.filterProps=["sx"];function ott(t,e){var r;const n=this;if(n.vars){if(!((r=n.colorSchemes)!=null&&r[t])||typeof n.getColorSchemeSelector!="function")return{};let i=n.getColorSchemeSelector(t);return i==="&"?e:((i.includes("data-")||i.includes("."))&&(i=`*:where(${i.replace(/\s*&$/,"")}) &`),{[i]:e})}return n.palette.mode===t?e:{}}function ree(t={},...e){const{breakpoints:n={},palette:r={},spacing:i,shape:o={},...s}=t,a=cet(n),l=Vke(i);let c=Bo({breakpoints:a,direction:"ltr",components:{},palette:{mode:"light",...r},spacing:l,shape:{...pet,...o}},s);return c=het(c),c.applyStyles=ott,c=e.reduce((u,f)=>Bo(u,f),c),c.unstable_sxConfig={...TM,...s==null?void 0:s.unstable_sxConfig},c.unstable_sx=function(f){return Qv({sx:f,theme:this})},c}function stt(t){return Object.keys(t).length===0}function iee(t=null){const e=D.useContext(Hj);return!e||stt(e)?t:e}const att=ree();function X1(t=att){return iee(t)}function ltt({styles:t,themeId:e,defaultTheme:n={}}){const r=X1(n),i=typeof t=="function"?t(e&&r[e]||r):t;return C.jsx(jke,{styles:i})}const ctt=t=>{var r;const e={systemProps:{},otherProps:{}},n=((r=t==null?void 0:t.theme)==null?void 0:r.unstable_sxConfig)??TM;return Object.keys(t).forEach(i=>{n[i]?e.systemProps[i]=t[i]:e.otherProps[i]=t[i]}),e};function oee(t){const{sx:e,...n}=t,{systemProps:r,otherProps:i}=ctt(n);let o;return Array.isArray(e)?o=[r,...e]:typeof e=="function"?o=(...s)=>{const a=e(...s);return Nd(a)?{...r,...a}:r}:o={...r,...e},{...i,sx:o}}const Tfe=t=>t,utt=()=>{let t=Tfe;return{configure(e){t=e},generate(e){return t(e)},reset(){t=Tfe}}},Gke=utt();function Hke(t){var e,n,r="";if(typeof t=="string"||typeof t=="number")r+=t;else if(typeof t=="object")if(Array.isArray(t)){var i=t.length;for(e=0;ea!=="theme"&&a!=="sx"&&a!=="as"})(Qv);return D.forwardRef(function(l,c){const u=X1(n),{className:f,component:d="div",...h}=oee(l);return C.jsx(o,{as:d,ref:c,className:Oe(f,i?i(r):r),theme:e&&u[e]||u,...h})})}const dtt={active:"active",checked:"checked",completed:"completed",disabled:"disabled",error:"error",expanded:"expanded",focused:"focused",focusVisible:"focusVisible",open:"open",readOnly:"readOnly",required:"required",selected:"selected"};function Ye(t,e,n="Mui"){const r=dtt[e];return r?`${n}-${r}`:`${Gke.generate(t)}-${e}`}function qe(t,e,n="Mui"){const r={};return e.forEach(i=>{r[i]=Ye(t,i,n)}),r}function qke(t){const{variants:e,...n}=t,r={variants:e,style:Cfe(n),isProcessed:!0};return r.style===n||e&&e.forEach(i=>{typeof i.style!="function"&&(i.style=Cfe(i.style))}),r}const htt=ree();function i3(t){return t!=="ownerState"&&t!=="theme"&&t!=="sx"&&t!=="as"}function ptt(t){return t?(e,n)=>n[t]:null}function gtt(t,e,n){t.theme=vtt(t.theme)?n:t.theme[e]||t.theme}function o3(t,e){const n=typeof e=="function"?e(t):e;if(Array.isArray(n))return n.flatMap(r=>o3(t,r));if(Array.isArray(n==null?void 0:n.variants)){let r;if(n.isProcessed)r=n.style;else{const{variants:i,...o}=n;r=o}return Xke(t,n.variants,[r])}return n!=null&&n.isProcessed?n.style:n}function Xke(t,e,n=[]){var i;let r;e:for(let o=0;o{set(a,w=>w.filter(_=>_!==Qv));const{name:c,slot:u,skipVariantsResolver:f,skipSx:d,overridesResolver:h=ptt(xtt(u)),...p}=l,g=f!==void 0?f:u&&u!=="Root"&&u!=="root"||!1,m=d||!1;let v=i3;u==="Root"||u==="root"?v=r:u?v=i:ytt(a)&&(v=void 0);const y=Bke(a,{shouldForwardProp:v,label:mtt(),...p}),x=w=>{if(typeof w=="function"&&w.__emotion_real!==w)return function(S){return o3(S,w)};if(Nd(w)){const _=qke(w);return _.variants?function(O){return o3(O,_)}:_.style}return w},b=(...w)=>{const _=[],S=w.map(x),O=[];if(_.push(o),c&&h&&O.push(function(A){var I,B;const T=(B=(I=A.theme.components)==null?void 0:I[c])==null?void 0:B.styleOverrides;if(!T)return null;const R={};for(const $ in T)R[$]=o3(A,T[$]);return h(A,R)}),c&&!g&&O.push(function(A){var R,I;const P=A.theme,T=(I=(R=P==null?void 0:P.components)==null?void 0:R[c])==null?void 0:I.variants;return T?Xke(A,T):null}),m||O.push(Qv),Array.isArray(S[0])){const M=S.shift(),A=new Array(_.length).fill(""),P=new Array(O.length).fill("");let T;T=[...A,...M,...P],T.raw=[...A,...M.raw,...P],_.unshift(T)}const k=[..._,...S,...O],E=y(...k);return a.muiName&&(E.muiName=a.muiName),E};return y.withConfig&&(b.withConfig=y.withConfig),b}}function mtt(t,e){return void 0}function vtt(t){for(const e in t)return!1;return!0}function ytt(t){return typeof t=="string"&&t.charCodeAt(0)>96}function xtt(t){return t&&t.charAt(0).toLowerCase()+t.slice(1)}const oa=Yke();function vS(t,e){const n={...e};for(const r in t)if(Object.prototype.hasOwnProperty.call(t,r)){const i=r;if(i==="components"||i==="slots")n[i]={...t[i],...n[i]};else if(i==="componentsProps"||i==="slotProps"){const o=t[i],s=e[i];if(!s)n[i]=o||{};else if(!o)n[i]=s;else{n[i]={...s};for(const a in o)if(Object.prototype.hasOwnProperty.call(o,a)){const l=a;n[i][l]=vS(o[l],s[l])}}}else n[i]===void 0&&(n[i]=t[i])}return n}function Qke(t){const{theme:e,name:n,props:r}=t;return!e||!e.components||!e.components[n]||!e.components[n].defaultProps?r:vS(e.components[n].defaultProps,r)}function btt({props:t,name:e,defaultTheme:n,themeId:r}){let i=X1(n);return r&&(i=i[r]||i),Qke({theme:i,name:e,props:t})}const Ei=typeof window<"u"?D.useLayoutEffect:D.useEffect;function wtt(t,e,n,r,i){const[o,s]=D.useState(()=>i&&n?n(t).matches:r?r(t).matches:e);return Ei(()=>{if(!n)return;const a=n(t),l=()=>{s(a.matches)};return l(),a.addEventListener("change",l),()=>{a.removeEventListener("change",l)}},[t,n]),o}const _tt={...nF},Kke=_tt.useSyncExternalStore;function Stt(t,e,n,r,i){const o=D.useCallback(()=>e,[e]),s=D.useMemo(()=>{if(i&&n)return()=>n(t).matches;if(r!==null){const{matches:u}=r(t);return()=>u}return o},[o,t,r,i,n]),[a,l]=D.useMemo(()=>{if(n===null)return[o,()=>()=>{}];const u=n(t);return[()=>u.matches,f=>(u.addEventListener("change",f),()=>{u.removeEventListener("change",f)})]},[o,n,t]);return Kke(l,a,s)}function Zke(t,e={}){const n=iee(),r=typeof window<"u"&&typeof window.matchMedia<"u",{defaultMatches:i=!1,matchMedia:o=r?window.matchMedia:null,ssrMatchMedia:s=null,noSsr:a=!1}=Qke({name:"MuiUseMediaQuery",props:e,theme:n});let l=typeof t=="function"?t(n):t;return l=l.replace(/^@media( ?)/m,""),(Kke!==void 0?Stt:wtt)(l,i,o,s,a)}function Pw(t,e=Number.MIN_SAFE_INTEGER,n=Number.MAX_SAFE_INTEGER){return Math.max(e,Math.min(t,n))}function see(t,e=0,n=1){return Pw(t,e,n)}function Ctt(t){t=t.slice(1);const e=new RegExp(`.{1,${t.length>=6?2:1}}`,"g");let n=t.match(e);return n&&n[0].length===1&&(n=n.map(r=>r+r)),n?`rgb${n.length===4?"a":""}(${n.map((r,i)=>i<3?parseInt(r,16):Math.round(parseInt(r,16)/255*1e3)/1e3).join(", ")})`:""}function Kv(t){if(t.type)return t;if(t.charAt(0)==="#")return Kv(Ctt(t));const e=t.indexOf("("),n=t.substring(0,e);if(!["rgb","rgba","hsl","hsla","color"].includes(n))throw new Error(kg(9,t));let r=t.substring(e+1,t.length-1),i;if(n==="color"){if(r=r.split(" "),i=r.shift(),r.length===4&&r[3].charAt(0)==="/"&&(r[3]=r[3].slice(1)),!["srgb","display-p3","a98-rgb","prophoto-rgb","rec-2020"].includes(i))throw new Error(kg(10,i))}else r=r.split(",");return r=r.map(o=>parseFloat(o)),{type:n,values:r,colorSpace:i}}const Ott=t=>{const e=Kv(t);return e.values.slice(0,3).map((n,r)=>e.type.includes("hsl")&&r!==0?`${n}%`:n).join(" ")},q2=(t,e)=>{try{return Ott(t)}catch{return t}};function e4(t){const{type:e,colorSpace:n}=t;let{values:r}=t;return e.includes("rgb")?r=r.map((i,o)=>o<3?parseInt(i,10):i):e.includes("hsl")&&(r[1]=`${r[1]}%`,r[2]=`${r[2]}%`),e.includes("color")?r=`${n} ${r.join(" ")}`:r=`${r.join(", ")}`,`${e}(${r})`}function Jke(t){t=Kv(t);const{values:e}=t,n=e[0],r=e[1]/100,i=e[2]/100,o=r*Math.min(i,1-i),s=(c,u=(c+n/30)%12)=>i-o*Math.max(Math.min(u-3,9-u,1),-1);let a="rgb";const l=[Math.round(s(0)*255),Math.round(s(8)*255),Math.round(s(4)*255)];return t.type==="hsla"&&(a+="a",l.push(e[3])),e4({type:a,values:l})}function LH(t){t=Kv(t);let e=t.type==="hsl"||t.type==="hsla"?Kv(Jke(t)).values:t.values;return e=e.map(n=>(t.type!=="color"&&(n/=255),n<=.03928?n/12.92:((n+.055)/1.055)**2.4)),Number((.2126*e[0]+.7152*e[1]+.0722*e[2]).toFixed(3))}function Ett(t,e){const n=LH(t),r=LH(e);return(Math.max(n,r)+.05)/(Math.min(n,r)+.05)}function Tt(t,e){return t=Kv(t),e=see(e),(t.type==="rgb"||t.type==="hsl")&&(t.type+="a"),t.type==="color"?t.values[3]=`/${e}`:t.values[3]=e,e4(t)}function YD(t,e,n){try{return Tt(t,e)}catch{return t}}function Ag(t,e){if(t=Kv(t),e=see(e),t.type.includes("hsl"))t.values[2]*=1-e;else if(t.type.includes("rgb")||t.type.includes("color"))for(let n=0;n<3;n+=1)t.values[n]*=1-e;return e4(t)}function Pr(t,e,n){try{return Ag(t,e)}catch{return t}}function Pg(t,e){if(t=Kv(t),e=see(e),t.type.includes("hsl"))t.values[2]+=(100-t.values[2])*e;else if(t.type.includes("rgb"))for(let n=0;n<3;n+=1)t.values[n]+=(255-t.values[n])*e;else if(t.type.includes("color"))for(let n=0;n<3;n+=1)t.values[n]+=(1-t.values[n])*e;return e4(t)}function Mr(t,e,n){try{return Pg(t,e)}catch{return t}}function eAe(t,e=.15){return LH(t)>.5?Ag(t,e):Pg(t,e)}function QD(t,e,n){try{return eAe(t,e)}catch{return t}}const tAe=pe.oneOfType([pe.func,pe.object]);function $H(...t){return t.reduce((e,n)=>n==null?e:function(...i){e.apply(this,i),n.apply(this,i)},()=>{})}function kM(t,e=166){let n;function r(...i){const o=()=>{t.apply(this,i)};clearTimeout(n),n=setTimeout(o,e)}return r.clear=()=>{clearTimeout(n)},r}function s3(t,e){var n,r,i;return D.isValidElement(t)&&e.indexOf(t.type.muiName??((i=(r=(n=t.type)==null?void 0:n._payload)==null?void 0:r.value)==null?void 0:i.muiName))!==-1}function mi(t){return t&&t.ownerDocument||document}function bc(t){return mi(t).defaultView||window}function FH(t,e){typeof t=="function"?t(e):t&&(t.current=e)}let kfe=0;function Ttt(t){const[e,n]=D.useState(t),r=t||e;return D.useEffect(()=>{e==null&&(kfe+=1,n(`mui-${kfe}`))},[e]),r}const ktt={...nF},Afe=ktt.useId;function Jf(t){if(Afe!==void 0){const e=Afe();return t??e}return Ttt(t)}function wc({controlled:t,default:e,name:n,state:r="value"}){const{current:i}=D.useRef(t!==void 0),[o,s]=D.useState(e),a=i?t:o,l=D.useCallback(c=>{i||s(c)},[]);return[a,l]}function st(t){const e=D.useRef(t);return Ei(()=>{e.current=t}),D.useRef((...n)=>(0,e.current)(...n)).current}function dn(...t){return D.useMemo(()=>t.every(e=>e==null)?null:e=>{t.forEach(n=>{FH(n,e)})},t)}const Pfe={};function nAe(t,e){const n=D.useRef(Pfe);return n.current===Pfe&&(n.current=t(e)),n}const Att=[];function Ptt(t){D.useEffect(t,Att)}class t4{constructor(){gn(this,"currentId",null);gn(this,"clear",()=>{this.currentId!==null&&(clearTimeout(this.currentId),this.currentId=null)});gn(this,"disposeEffect",()=>this.clear)}static create(){return new t4}start(e,n){this.clear(),this.currentId=setTimeout(()=>{this.currentId=null,n()},e)}}function cv(){const t=nAe(t4.create).current;return Ptt(t.disposeEffect),t}function Zv(t){try{return t.matches(":focus-visible")}catch{}return!1}function rAe(t=window){const e=t.document.documentElement.clientWidth;return t.innerWidth-e}function Mtt(t){return D.Children.toArray(t).filter(e=>D.isValidElement(e))}const iAe={border:0,clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"absolute",whiteSpace:"nowrap",width:"1px"};function Xe(t,e,n=void 0){const r={};for(const i in t){const o=t[i];let s="",a=!0;for(let l=0;lr.match(/^on[A-Z]/)&&typeof t[r]=="function"&&!e.includes(r)).forEach(r=>{n[r]=t[r]}),n}function Mfe(t){if(t===void 0)return{};const e={};return Object.keys(t).filter(n=>!(n.match(/^on[A-Z]/)&&typeof t[n]=="function")).forEach(n=>{e[n]=t[n]}),e}function oAe(t){const{getSlotProps:e,additionalProps:n,externalSlotProps:r,externalForwardedProps:i,className:o}=t;if(!e){const h=Oe(n==null?void 0:n.className,o,i==null?void 0:i.className,r==null?void 0:r.className),p={...n==null?void 0:n.style,...i==null?void 0:i.style,...r==null?void 0:r.style},g={...n,...i,...r};return h.length>0&&(g.className=h),Object.keys(p).length>0&&(g.style=p),{props:g,internalRef:void 0}}const s=kx({...i,...r}),a=Mfe(r),l=Mfe(i),c=e(s),u=Oe(c==null?void 0:c.className,n==null?void 0:n.className,o,i==null?void 0:i.className,r==null?void 0:r.className),f={...c==null?void 0:c.style,...n==null?void 0:n.style,...i==null?void 0:i.style,...r==null?void 0:r.style},d={...c,...n,...l,...a};return u.length>0&&(d.className=u),Object.keys(f).length>0&&(d.style=f),{props:d,internalRef:c.ref}}function rA(t,e,n){return typeof t=="function"?t(e,n):t}function Zt(t){var f;const{elementType:e,externalSlotProps:n,ownerState:r,skipResolvingSlotProps:i=!1,...o}=t,s=i?{}:rA(n,r),{props:a,internalRef:l}=oAe({...o,externalSlotProps:s}),c=dn(l,s==null?void 0:s.ref,(f=t.additionalProps)==null?void 0:f.ref);return t_(e,{...a,ref:c},r)}function My(t){var e;return parseInt(D.version,10)>=19?((e=t==null?void 0:t.props)==null?void 0:e.ref)||null:(t==null?void 0:t.ref)||null}const sAe=D.createContext(null);function n4(){return D.useContext(sAe)}const Dtt=typeof Symbol=="function"&&Symbol.for,aAe=Dtt?Symbol.for("mui.nested"):"__THEME_NESTED__";function Itt(t,e){return typeof e=="function"?e(t):{...t,...e}}function Ltt(t){const{children:e,theme:n}=t,r=n4(),i=D.useMemo(()=>{const o=r===null?{...n}:Itt(r,n);return o!=null&&(o[aAe]=r!==null),o},[n,r]);return C.jsx(sAe.Provider,{value:i,children:e})}const lAe=D.createContext();function $tt({value:t,...e}){return C.jsx(lAe.Provider,{value:t??!0,...e})}const Ho=()=>D.useContext(lAe)??!1,cAe=D.createContext(void 0);function Ftt({value:t,children:e}){return C.jsx(cAe.Provider,{value:t,children:e})}function Ntt(t){const{theme:e,name:n,props:r}=t;if(!e||!e.components||!e.components[n])return r;const i=e.components[n];return i.defaultProps?vS(i.defaultProps,r):!i.styleOverrides&&!i.variants?vS(i,r):r}function ztt({props:t,name:e}){const n=D.useContext(cAe);return Ntt({props:t,name:e,theme:{components:n}})}const Rfe={};function Dfe(t,e,n,r=!1){return D.useMemo(()=>{const i=t&&e[t]||e;if(typeof n=="function"){const o=n(i),s=t?{...e,[t]:o}:o;return r?()=>s:s}return t?{...e,[t]:n}:{...e,...n}},[t,e,n,r])}function uAe(t){const{children:e,theme:n,themeId:r}=t,i=iee(Rfe),o=n4()||Rfe,s=Dfe(r,i,n),a=Dfe(r,o,n,!0),l=s.direction==="rtl";return C.jsx(Ltt,{theme:a,children:C.jsx(Hj.Provider,{value:s,children:C.jsx($tt,{value:l,children:C.jsx(Ftt,{value:s==null?void 0:s.components,children:e})})})})}const Ife={theme:void 0};function jtt(t){let e,n;return function(i){let o=e;return(o===void 0||i.theme!==n)&&(Ife.theme=i.theme,o=qke(t(Ife)),e=o,n=i.theme),o}}const aee="mode",lee="color-scheme",Btt="data-color-scheme";function Utt(t){const{defaultMode:e="system",defaultLightColorScheme:n="light",defaultDarkColorScheme:r="dark",modeStorageKey:i=aee,colorSchemeStorageKey:o=lee,attribute:s=Btt,colorSchemeNode:a="document.documentElement",nonce:l}=t||{};let c="",u=s;if(s==="class"&&(u=".%s"),s==="data"&&(u="[data-%s]"),u.startsWith(".")){const d=u.substring(1);c+=`${a}.classList.remove('${d}'.replace('%s', light), '${d}'.replace('%s', dark)); + */function pAe(t,e){return XH(t,e)}function Let(t,e){Array.isArray(t.__emotion_styles)&&(t.__emotion_styles=e(t.__emotion_styles))}const Bfe=[];function Ufe(t){return Bfe[0]=t,Bj(Bfe)}function $d(t){if(typeof t!="object"||t===null)return!1;const e=Object.getPrototypeOf(t);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(Symbol.toStringTag in t)&&!(Symbol.iterator in t)}function gAe(t){if(!$d(t))return t;const e={};return Object.keys(t).forEach(n=>{e[n]=gAe(t[n])}),e}function Bo(t,e,n={clone:!0}){const r=n.clone?{...t}:t;return $d(t)&&$d(e)&&Object.keys(e).forEach(i=>{$d(e[i])&&Object.prototype.hasOwnProperty.call(t,i)&&$d(t[i])?r[i]=Bo(t[i],e[i],n):n.clone?r[i]=$d(e[i])?gAe(e[i]):e[i]:r[i]=e[i]}),r}const $et=t=>{const e=Object.keys(t).map(n=>({key:n,val:t[n]}))||[];return e.sort((n,r)=>n.val-r.val),e.reduce((n,r)=>({...n,[r.key]:r.val}),{})};function Fet(t){const{values:e={xs:0,sm:600,md:900,lg:1200,xl:1536},unit:n="px",step:r=5,...i}=t,o=$et(e),s=Object.keys(o);function a(d){return`@media (min-width:${typeof e[d]=="number"?e[d]:d}${n})`}function l(d){return`@media (max-width:${(typeof e[d]=="number"?e[d]:d)-r/100}${n})`}function c(d,h){const p=s.indexOf(h);return`@media (min-width:${typeof e[d]=="number"?e[d]:d}${n}) and (max-width:${(p!==-1&&typeof e[s[p]]=="number"?e[s[p]]:h)-r/100}${n})`}function u(d){return s.indexOf(d)+1r.startsWith("@container")).sort((r,i)=>{var s,a;const o=/min-width:\s*([0-9.]+)/;return+(((s=r.match(o))==null?void 0:s[1])||0)-+(((a=i.match(o))==null?void 0:a[1])||0)});return n.length?n.reduce((r,i)=>{const o=e[i];return delete r[i],r[i]=o,r},{...e}):e}function zet(t,e){return e==="@"||e.startsWith("@")&&(t.some(n=>e.startsWith(`@${n}`))||!!e.match(/^@\d/))}function jet(t,e){const n=e.match(/^@([^/]+)?\/?(.+)?$/);if(!n)return null;const[,r,i]=n,o=Number.isNaN(+r)?r||0:+r;return t.containerQueries(i).up(o)}function Bet(t){const e=(o,s)=>o.replace("@media",s?`@container ${s}`:"@container");function n(o,s){o.up=(...a)=>e(t.breakpoints.up(...a),s),o.down=(...a)=>e(t.breakpoints.down(...a),s),o.between=(...a)=>e(t.breakpoints.between(...a),s),o.only=(...a)=>e(t.breakpoints.only(...a),s),o.not=(...a)=>{const l=e(t.breakpoints.not(...a),s);return l.includes("not all and")?l.replace("not all and ","").replace("min-width:","width<").replace("max-width:","width>").replace("and","or"):l}}const r={},i=o=>(n(r,o),r);return n(i),{...t,containerQueries:i}}const Uet={borderRadius:4};function qT(t,e){return e?Bo(t,e,{clone:!1}):t}const Wj={xs:0,sm:600,md:900,lg:1200,xl:1536},Wfe={keys:["xs","sm","md","lg","xl"],up:t=>`@media (min-width:${Wj[t]}px)`},Wet={containerQueries:t=>({up:e=>{let n=typeof e=="number"?e:Wj[e]||e;return typeof n=="number"&&(n=`${n}px`),t?`@container ${t} (min-width:${n})`:`@container (min-width:${n})`}})};function _u(t,e,n){const r=t.theme||{};if(Array.isArray(e)){const o=r.breakpoints||Wfe;return e.reduce((s,a,l)=>(s[o.up(o.keys[l])]=n(e[l]),s),{})}if(typeof e=="object"){const o=r.breakpoints||Wfe;return Object.keys(e).reduce((s,a)=>{if(zet(o.keys,a)){const l=jet(r.containerQueries?r:Wet,a);l&&(s[l]=n(e[a],a))}else if(Object.keys(o.values||Wj).includes(a)){const l=o.up(a);s[l]=n(e[a],a)}else{const l=a;s[l]=e[l]}return s},{})}return n(e)}function Vet(t={}){var n;return((n=t.keys)==null?void 0:n.reduce((r,i)=>{const o=t.up(i);return r[o]={},r},{}))||{}}function Get(t,e){return t.reduce((n,r)=>{const i=n[r];return(!i||Object.keys(i).length===0)&&delete n[r],n},e)}function Het(t,e){if(typeof t!="object")return{};const n={},r=Object.keys(e);return Array.isArray(t)?r.forEach((i,o)=>{o{t[i]!=null&&(n[i]=!0)}),n}function Vj({values:t,breakpoints:e,base:n}){const r=n||Het(t,e),i=Object.keys(r);if(i.length===0)return t;let o;return i.reduce((s,a,l)=>(Array.isArray(t)?(s[a]=t[l]!=null?t[l]:t[o],o=l):typeof t=="object"?(s[a]=t[a]!=null?t[a]:t[o],o=a):s[a]=t,s),{})}function Re(t){if(typeof t!="string")throw new Error(Og(7));return t.charAt(0).toUpperCase()+t.slice(1)}function mS(t,e,n=!0){if(!e||typeof e!="string")return null;if(t&&t.vars&&n){const r=`vars.${e}`.split(".").reduce((i,o)=>i&&i[o]?i[o]:null,t);if(r!=null)return r}return e.split(".").reduce((r,i)=>r&&r[i]!=null?r[i]:null,t)}function OF(t,e,n,r=n){let i;return typeof t=="function"?i=t(n):Array.isArray(t)?i=t[n]||r:i=mS(t,n)||r,e&&(i=e(i,r,t)),i}function Qi(t){const{prop:e,cssProperty:n=t.prop,themeKey:r,transform:i}=t,o=s=>{if(s[e]==null)return null;const a=s[e],l=s.theme,c=mS(l,r)||{};return _u(s,a,f=>{let d=OF(c,i,f);return f===d&&typeof f=="string"&&(d=OF(c,i,`${e}${f==="default"?"":Re(f)}`,f)),n===!1?d:{[n]:d}})};return o.propTypes={},o.filterProps=[e],o}function qet(t){const e={};return n=>(e[n]===void 0&&(e[n]=t(n)),e[n])}const Xet={m:"margin",p:"padding"},Yet={t:"Top",r:"Right",b:"Bottom",l:"Left",x:["Left","Right"],y:["Top","Bottom"]},Vfe={marginX:"mx",marginY:"my",paddingX:"px",paddingY:"py"},Qet=qet(t=>{if(t.length>2)if(Vfe[t])t=Vfe[t];else return[t];const[e,n]=t.split(""),r=Xet[e],i=Yet[n]||"";return Array.isArray(i)?i.map(o=>r+o):[r+i]}),gee=["m","mt","mr","mb","ml","mx","my","margin","marginTop","marginRight","marginBottom","marginLeft","marginX","marginY","marginInline","marginInlineStart","marginInlineEnd","marginBlock","marginBlockStart","marginBlockEnd"],mee=["p","pt","pr","pb","pl","px","py","padding","paddingTop","paddingRight","paddingBottom","paddingLeft","paddingX","paddingY","paddingInline","paddingInlineStart","paddingInlineEnd","paddingBlock","paddingBlockStart","paddingBlockEnd"];[...gee,...mee];function OM(t,e,n,r){const i=mS(t,e,!0)??n;return typeof i=="number"||typeof i=="string"?o=>typeof o=="string"?o:typeof i=="string"?`calc(${o} * ${i})`:i*o:Array.isArray(i)?o=>{if(typeof o=="string")return o;const s=Math.abs(o),a=i[s];return o>=0?a:typeof a=="number"?-a:`-${a}`}:typeof i=="function"?i:()=>{}}function vee(t){return OM(t,"spacing",8)}function EM(t,e){return typeof e=="string"||e==null?e:t(e)}function Ket(t,e){return n=>t.reduce((r,i)=>(r[i]=EM(e,n),r),{})}function Zet(t,e,n,r){if(!e.includes(n))return null;const i=Qet(n),o=Ket(i,r),s=t[n];return _u(t,s,o)}function mAe(t,e){const n=vee(t.theme);return Object.keys(t).map(r=>Zet(t,e,r,n)).reduce(qT,{})}function Ai(t){return mAe(t,gee)}Ai.propTypes={};Ai.filterProps=gee;function Pi(t){return mAe(t,mee)}Pi.propTypes={};Pi.filterProps=mee;function vAe(t=8,e=vee({spacing:t})){if(t.mui)return t;const n=(...r)=>(r.length===0?[1]:r).map(o=>{const s=e(o);return typeof s=="number"?`${s}px`:s}).join(" ");return n.mui=!0,n}function Gj(...t){const e=t.reduce((r,i)=>(i.filterProps.forEach(o=>{r[o]=i}),r),{}),n=r=>Object.keys(r).reduce((i,o)=>e[o]?qT(i,e[o](r)):i,{});return n.propTypes={},n.filterProps=t.reduce((r,i)=>r.concat(i.filterProps),[]),n}function Hc(t){return typeof t!="number"?t:`${t}px solid`}function $u(t,e){return Qi({prop:t,themeKey:"borders",transform:e})}const Jet=$u("border",Hc),ett=$u("borderTop",Hc),ttt=$u("borderRight",Hc),ntt=$u("borderBottom",Hc),rtt=$u("borderLeft",Hc),itt=$u("borderColor"),ott=$u("borderTopColor"),stt=$u("borderRightColor"),att=$u("borderBottomColor"),ltt=$u("borderLeftColor"),ctt=$u("outline",Hc),utt=$u("outlineColor"),Hj=t=>{if(t.borderRadius!==void 0&&t.borderRadius!==null){const e=OM(t.theme,"shape.borderRadius",4),n=r=>({borderRadius:EM(e,r)});return _u(t,t.borderRadius,n)}return null};Hj.propTypes={};Hj.filterProps=["borderRadius"];Gj(Jet,ett,ttt,ntt,rtt,itt,ott,stt,att,ltt,Hj,ctt,utt);const qj=t=>{if(t.gap!==void 0&&t.gap!==null){const e=OM(t.theme,"spacing",8),n=r=>({gap:EM(e,r)});return _u(t,t.gap,n)}return null};qj.propTypes={};qj.filterProps=["gap"];const Xj=t=>{if(t.columnGap!==void 0&&t.columnGap!==null){const e=OM(t.theme,"spacing",8),n=r=>({columnGap:EM(e,r)});return _u(t,t.columnGap,n)}return null};Xj.propTypes={};Xj.filterProps=["columnGap"];const Yj=t=>{if(t.rowGap!==void 0&&t.rowGap!==null){const e=OM(t.theme,"spacing",8),n=r=>({rowGap:EM(e,r)});return _u(t,t.rowGap,n)}return null};Yj.propTypes={};Yj.filterProps=["rowGap"];const ftt=Qi({prop:"gridColumn"}),dtt=Qi({prop:"gridRow"}),htt=Qi({prop:"gridAutoFlow"}),ptt=Qi({prop:"gridAutoColumns"}),gtt=Qi({prop:"gridAutoRows"}),mtt=Qi({prop:"gridTemplateColumns"}),vtt=Qi({prop:"gridTemplateRows"}),ytt=Qi({prop:"gridTemplateAreas"}),xtt=Qi({prop:"gridArea"});Gj(qj,Xj,Yj,ftt,dtt,htt,ptt,gtt,mtt,vtt,ytt,xtt);function A_(t,e){return e==="grey"?e:t}const btt=Qi({prop:"color",themeKey:"palette",transform:A_}),wtt=Qi({prop:"bgcolor",cssProperty:"backgroundColor",themeKey:"palette",transform:A_}),_tt=Qi({prop:"backgroundColor",themeKey:"palette",transform:A_});Gj(btt,wtt,_tt);function Kl(t){return t<=1&&t!==0?`${t*100}%`:t}const Stt=Qi({prop:"width",transform:Kl}),yee=t=>{if(t.maxWidth!==void 0&&t.maxWidth!==null){const e=n=>{var i,o,s,a,l;const r=((s=(o=(i=t.theme)==null?void 0:i.breakpoints)==null?void 0:o.values)==null?void 0:s[n])||Wj[n];return r?((l=(a=t.theme)==null?void 0:a.breakpoints)==null?void 0:l.unit)!=="px"?{maxWidth:`${r}${t.theme.breakpoints.unit}`}:{maxWidth:r}:{maxWidth:Kl(n)}};return _u(t,t.maxWidth,e)}return null};yee.filterProps=["maxWidth"];const Ctt=Qi({prop:"minWidth",transform:Kl}),Ott=Qi({prop:"height",transform:Kl}),Ett=Qi({prop:"maxHeight",transform:Kl}),Ttt=Qi({prop:"minHeight",transform:Kl});Qi({prop:"size",cssProperty:"width",transform:Kl});Qi({prop:"size",cssProperty:"height",transform:Kl});const ktt=Qi({prop:"boxSizing"});Gj(Stt,yee,Ctt,Ott,Ett,Ttt,ktt);const TM={border:{themeKey:"borders",transform:Hc},borderTop:{themeKey:"borders",transform:Hc},borderRight:{themeKey:"borders",transform:Hc},borderBottom:{themeKey:"borders",transform:Hc},borderLeft:{themeKey:"borders",transform:Hc},borderColor:{themeKey:"palette"},borderTopColor:{themeKey:"palette"},borderRightColor:{themeKey:"palette"},borderBottomColor:{themeKey:"palette"},borderLeftColor:{themeKey:"palette"},outline:{themeKey:"borders",transform:Hc},outlineColor:{themeKey:"palette"},borderRadius:{themeKey:"shape.borderRadius",style:Hj},color:{themeKey:"palette",transform:A_},bgcolor:{themeKey:"palette",cssProperty:"backgroundColor",transform:A_},backgroundColor:{themeKey:"palette",transform:A_},p:{style:Pi},pt:{style:Pi},pr:{style:Pi},pb:{style:Pi},pl:{style:Pi},px:{style:Pi},py:{style:Pi},padding:{style:Pi},paddingTop:{style:Pi},paddingRight:{style:Pi},paddingBottom:{style:Pi},paddingLeft:{style:Pi},paddingX:{style:Pi},paddingY:{style:Pi},paddingInline:{style:Pi},paddingInlineStart:{style:Pi},paddingInlineEnd:{style:Pi},paddingBlock:{style:Pi},paddingBlockStart:{style:Pi},paddingBlockEnd:{style:Pi},m:{style:Ai},mt:{style:Ai},mr:{style:Ai},mb:{style:Ai},ml:{style:Ai},mx:{style:Ai},my:{style:Ai},margin:{style:Ai},marginTop:{style:Ai},marginRight:{style:Ai},marginBottom:{style:Ai},marginLeft:{style:Ai},marginX:{style:Ai},marginY:{style:Ai},marginInline:{style:Ai},marginInlineStart:{style:Ai},marginInlineEnd:{style:Ai},marginBlock:{style:Ai},marginBlockStart:{style:Ai},marginBlockEnd:{style:Ai},displayPrint:{cssProperty:!1,transform:t=>({"@media print":{display:t}})},display:{},overflow:{},textOverflow:{},visibility:{},whiteSpace:{},flexBasis:{},flexDirection:{},flexWrap:{},justifyContent:{},alignItems:{},alignContent:{},order:{},flex:{},flexGrow:{},flexShrink:{},alignSelf:{},justifyItems:{},justifySelf:{},gap:{style:qj},rowGap:{style:Yj},columnGap:{style:Xj},gridColumn:{},gridRow:{},gridAutoFlow:{},gridAutoColumns:{},gridAutoRows:{},gridTemplateColumns:{},gridTemplateRows:{},gridTemplateAreas:{},gridArea:{},position:{},zIndex:{themeKey:"zIndex"},top:{},right:{},bottom:{},left:{},boxShadow:{themeKey:"shadows"},width:{transform:Kl},maxWidth:{style:yee},minWidth:{transform:Kl},height:{transform:Kl},maxHeight:{transform:Kl},minHeight:{transform:Kl},boxSizing:{},font:{themeKey:"font"},fontFamily:{themeKey:"typography"},fontSize:{themeKey:"typography"},fontStyle:{themeKey:"typography"},fontWeight:{themeKey:"typography"},letterSpacing:{},textTransform:{},lineHeight:{},textAlign:{},typography:{cssProperty:!1,themeKey:"typography"}};function Att(...t){const e=t.reduce((r,i)=>r.concat(Object.keys(i)),[]),n=new Set(e);return t.every(r=>n.size===Object.keys(r).length)}function Ptt(t,e){return typeof t=="function"?t(e):t}function Mtt(){function t(n,r,i,o){const s={[n]:r,theme:i},a=o[n];if(!a)return{[n]:r};const{cssProperty:l=n,themeKey:c,transform:u,style:f}=a;if(r==null)return null;if(c==="typography"&&r==="inherit")return{[n]:r};const d=mS(i,c)||{};return f?f(s):_u(s,r,p=>{let g=OF(d,u,p);return p===g&&typeof p=="string"&&(g=OF(d,u,`${n}${p==="default"?"":Re(p)}`,p)),l===!1?g:{[l]:g}})}function e(n){const{sx:r,theme:i={}}=n||{};if(!r)return null;const o=i.unstable_sxConfig??TM;function s(a){let l=a;if(typeof a=="function")l=a(i);else if(typeof a!="object")return a;if(!l)return null;const c=Vet(i.breakpoints),u=Object.keys(c);let f=c;return Object.keys(l).forEach(d=>{const h=Ptt(l[d],i);if(h!=null)if(typeof h=="object")if(o[d])f=qT(f,t(d,h,i,o));else{const p=_u({theme:i},h,g=>({[d]:g}));Att(p,h)?f[d]=e({sx:h,theme:i}):f=qT(f,p)}else f=qT(f,t(d,h,i,o))}),Net(i,Get(u,f))}return Array.isArray(r)?r.map(s):s(r)}return e}const Yv=Mtt();Yv.filterProps=["sx"];function Rtt(t,e){var r;const n=this;if(n.vars){if(!((r=n.colorSchemes)!=null&&r[t])||typeof n.getColorSchemeSelector!="function")return{};let i=n.getColorSchemeSelector(t);return i==="&"?e:((i.includes("data-")||i.includes("."))&&(i=`*:where(${i.replace(/\s*&$/,"")}) &`),{[i]:e})}return n.palette.mode===t?e:{}}function xee(t={},...e){const{breakpoints:n={},palette:r={},spacing:i,shape:o={},...s}=t,a=Fet(n),l=vAe(i);let c=Bo({breakpoints:a,direction:"ltr",components:{},palette:{mode:"light",...r},spacing:l,shape:{...Uet,...o}},s);return c=Bet(c),c.applyStyles=Rtt,c=e.reduce((u,f)=>Bo(u,f),c),c.unstable_sxConfig={...TM,...s==null?void 0:s.unstable_sxConfig},c.unstable_sx=function(f){return Yv({sx:f,theme:this})},c}function Dtt(t){return Object.keys(t).length===0}function bee(t=null){const e=D.useContext(Uj);return!e||Dtt(e)?t:e}const Itt=xee();function Xb(t=Itt){return bee(t)}function Ltt({styles:t,themeId:e,defaultTheme:n={}}){const r=Xb(n),i=typeof t=="function"?t(e&&r[e]||r):t;return C.jsx(hAe,{styles:i})}const $tt=t=>{var r;const e={systemProps:{},otherProps:{}},n=((r=t==null?void 0:t.theme)==null?void 0:r.unstable_sxConfig)??TM;return Object.keys(t).forEach(i=>{n[i]?e.systemProps[i]=t[i]:e.otherProps[i]=t[i]}),e};function wee(t){const{sx:e,...n}=t,{systemProps:r,otherProps:i}=$tt(n);let o;return Array.isArray(e)?o=[r,...e]:typeof e=="function"?o=(...s)=>{const a=e(...s);return $d(a)?{...r,...a}:r}:o={...r,...e},{...i,sx:o}}const Gfe=t=>t,Ftt=()=>{let t=Gfe;return{configure(e){t=e},generate(e){return t(e)},reset(){t=Gfe}}},yAe=Ftt();function xAe(t){var e,n,r="";if(typeof t=="string"||typeof t=="number")r+=t;else if(typeof t=="object")if(Array.isArray(t)){var i=t.length;for(e=0;ea!=="theme"&&a!=="sx"&&a!=="as"})(Yv);return D.forwardRef(function(l,c){const u=Xb(n),{className:f,component:d="div",...h}=wee(l);return C.jsx(o,{as:d,ref:c,className:Oe(f,i?i(r):r),theme:e&&u[e]||u,...h})})}const ztt={active:"active",checked:"checked",completed:"completed",disabled:"disabled",error:"error",expanded:"expanded",focused:"focused",focusVisible:"focusVisible",open:"open",readOnly:"readOnly",required:"required",selected:"selected"};function Ye(t,e,n="Mui"){const r=ztt[e];return r?`${n}-${r}`:`${yAe.generate(t)}-${e}`}function He(t,e,n="Mui"){const r={};return e.forEach(i=>{r[i]=Ye(t,i,n)}),r}function bAe(t){const{variants:e,...n}=t,r={variants:e,style:Ufe(n),isProcessed:!0};return r.style===n||e&&e.forEach(i=>{typeof i.style!="function"&&(i.style=Ufe(i.style))}),r}const jtt=xee();function e3(t){return t!=="ownerState"&&t!=="theme"&&t!=="sx"&&t!=="as"}function Btt(t){return t?(e,n)=>n[t]:null}function Utt(t,e,n){t.theme=Vtt(t.theme)?n:t.theme[e]||t.theme}function t3(t,e){const n=typeof e=="function"?e(t):e;if(Array.isArray(n))return n.flatMap(r=>t3(t,r));if(Array.isArray(n==null?void 0:n.variants)){let r;if(n.isProcessed)r=n.style;else{const{variants:i,...o}=n;r=o}return wAe(t,n.variants,[r])}return n!=null&&n.isProcessed?n.style:n}function wAe(t,e,n=[]){var i;let r;e:for(let o=0;o{Let(a,w=>w.filter(_=>_!==Yv));const{name:c,slot:u,skipVariantsResolver:f,skipSx:d,overridesResolver:h=Btt(Htt(u)),...p}=l,g=f!==void 0?f:u&&u!=="Root"&&u!=="root"||!1,m=d||!1;let v=e3;u==="Root"||u==="root"?v=r:u?v=i:Gtt(a)&&(v=void 0);const y=pAe(a,{shouldForwardProp:v,label:Wtt(),...p}),x=w=>{if(typeof w=="function"&&w.__emotion_real!==w)return function(S){return t3(S,w)};if($d(w)){const _=bAe(w);return _.variants?function(O){return t3(O,_)}:_.style}return w},b=(...w)=>{const _=[],S=w.map(x),O=[];if(_.push(o),c&&h&&O.push(function(A){var I,j;const T=(j=(I=A.theme.components)==null?void 0:I[c])==null?void 0:j.styleOverrides;if(!T)return null;const M={};for(const N in T)M[N]=t3(A,T[N]);return h(A,M)}),c&&!g&&O.push(function(A){var M,I;const R=A.theme,T=(I=(M=R==null?void 0:R.components)==null?void 0:M[c])==null?void 0:I.variants;return T?wAe(A,T):null}),m||O.push(Yv),Array.isArray(S[0])){const P=S.shift(),A=new Array(_.length).fill(""),R=new Array(O.length).fill("");let T;T=[...A,...P,...R],T.raw=[...A,...P.raw,...R],_.unshift(T)}const k=[..._,...S,...O],E=y(...k);return a.muiName&&(E.muiName=a.muiName),E};return y.withConfig&&(b.withConfig=y.withConfig),b}}function Wtt(t,e){return void 0}function Vtt(t){for(const e in t)return!1;return!0}function Gtt(t){return typeof t=="string"&&t.charCodeAt(0)>96}function Htt(t){return t&&t.charAt(0).toLowerCase()+t.slice(1)}const ra=_Ae();function vS(t,e){const n={...e};for(const r in t)if(Object.prototype.hasOwnProperty.call(t,r)){const i=r;if(i==="components"||i==="slots")n[i]={...t[i],...n[i]};else if(i==="componentsProps"||i==="slotProps"){const o=t[i],s=e[i];if(!s)n[i]=o||{};else if(!o)n[i]=s;else{n[i]={...s};for(const a in o)if(Object.prototype.hasOwnProperty.call(o,a)){const l=a;n[i][l]=vS(o[l],s[l])}}}else n[i]===void 0&&(n[i]=t[i])}return n}function SAe(t){const{theme:e,name:n,props:r}=t;return!e||!e.components||!e.components[n]||!e.components[n].defaultProps?r:vS(e.components[n].defaultProps,r)}function qtt({props:t,name:e,defaultTheme:n,themeId:r}){let i=Xb(n);return r&&(i=i[r]||i),SAe({theme:i,name:e,props:t})}const Ti=typeof window<"u"?D.useLayoutEffect:D.useEffect;function Xtt(t,e,n,r,i){const[o,s]=D.useState(()=>i&&n?n(t).matches:r?r(t).matches:e);return Ti(()=>{if(!n)return;const a=n(t),l=()=>{s(a.matches)};return l(),a.addEventListener("change",l),()=>{a.removeEventListener("change",l)}},[t,n]),o}const Ytt={...Z3},CAe=Ytt.useSyncExternalStore;function Qtt(t,e,n,r,i){const o=D.useCallback(()=>e,[e]),s=D.useMemo(()=>{if(i&&n)return()=>n(t).matches;if(r!==null){const{matches:u}=r(t);return()=>u}return o},[o,t,r,i,n]),[a,l]=D.useMemo(()=>{if(n===null)return[o,()=>()=>{}];const u=n(t);return[()=>u.matches,f=>(u.addEventListener("change",f),()=>{u.removeEventListener("change",f)})]},[o,n,t]);return CAe(l,a,s)}function OAe(t,e={}){const n=bee(),r=typeof window<"u"&&typeof window.matchMedia<"u",{defaultMatches:i=!1,matchMedia:o=r?window.matchMedia:null,ssrMatchMedia:s=null,noSsr:a=!1}=SAe({name:"MuiUseMediaQuery",props:e,theme:n});let l=typeof t=="function"?t(n):t;return l=l.replace(/^@media( ?)/m,""),(CAe!==void 0?Qtt:Xtt)(l,i,o,s,a)}function Aw(t,e=Number.MIN_SAFE_INTEGER,n=Number.MAX_SAFE_INTEGER){return Math.max(e,Math.min(t,n))}function _ee(t,e=0,n=1){return Aw(t,e,n)}function Ktt(t){t=t.slice(1);const e=new RegExp(`.{1,${t.length>=6?2:1}}`,"g");let n=t.match(e);return n&&n[0].length===1&&(n=n.map(r=>r+r)),n?`rgb${n.length===4?"a":""}(${n.map((r,i)=>i<3?parseInt(r,16):Math.round(parseInt(r,16)/255*1e3)/1e3).join(", ")})`:""}function Qv(t){if(t.type)return t;if(t.charAt(0)==="#")return Qv(Ktt(t));const e=t.indexOf("("),n=t.substring(0,e);if(!["rgb","rgba","hsl","hsla","color"].includes(n))throw new Error(Og(9,t));let r=t.substring(e+1,t.length-1),i;if(n==="color"){if(r=r.split(" "),i=r.shift(),r.length===4&&r[3].charAt(0)==="/"&&(r[3]=r[3].slice(1)),!["srgb","display-p3","a98-rgb","prophoto-rgb","rec-2020"].includes(i))throw new Error(Og(10,i))}else r=r.split(",");return r=r.map(o=>parseFloat(o)),{type:n,values:r,colorSpace:i}}const Ztt=t=>{const e=Qv(t);return e.values.slice(0,3).map((n,r)=>e.type.includes("hsl")&&r!==0?`${n}%`:n).join(" ")},H2=(t,e)=>{try{return Ztt(t)}catch{return t}};function Qj(t){const{type:e,colorSpace:n}=t;let{values:r}=t;return e.includes("rgb")?r=r.map((i,o)=>o<3?parseInt(i,10):i):e.includes("hsl")&&(r[1]=`${r[1]}%`,r[2]=`${r[2]}%`),e.includes("color")?r=`${n} ${r.join(" ")}`:r=`${r.join(", ")}`,`${e}(${r})`}function EAe(t){t=Qv(t);const{values:e}=t,n=e[0],r=e[1]/100,i=e[2]/100,o=r*Math.min(i,1-i),s=(c,u=(c+n/30)%12)=>i-o*Math.max(Math.min(u-3,9-u,1),-1);let a="rgb";const l=[Math.round(s(0)*255),Math.round(s(8)*255),Math.round(s(4)*255)];return t.type==="hsla"&&(a+="a",l.push(e[3])),Qj({type:a,values:l})}function QH(t){t=Qv(t);let e=t.type==="hsl"||t.type==="hsla"?Qv(EAe(t)).values:t.values;return e=e.map(n=>(t.type!=="color"&&(n/=255),n<=.03928?n/12.92:((n+.055)/1.055)**2.4)),Number((.2126*e[0]+.7152*e[1]+.0722*e[2]).toFixed(3))}function Jtt(t,e){const n=QH(t),r=QH(e);return(Math.max(n,r)+.05)/(Math.min(n,r)+.05)}function kt(t,e){return t=Qv(t),e=_ee(e),(t.type==="rgb"||t.type==="hsl")&&(t.type+="a"),t.type==="color"?t.values[3]=`/${e}`:t.values[3]=e,Qj(t)}function HD(t,e,n){try{return kt(t,e)}catch{return t}}function Eg(t,e){if(t=Qv(t),e=_ee(e),t.type.includes("hsl"))t.values[2]*=1-e;else if(t.type.includes("rgb")||t.type.includes("color"))for(let n=0;n<3;n+=1)t.values[n]*=1-e;return Qj(t)}function Pr(t,e,n){try{return Eg(t,e)}catch{return t}}function Tg(t,e){if(t=Qv(t),e=_ee(e),t.type.includes("hsl"))t.values[2]+=(100-t.values[2])*e;else if(t.type.includes("rgb"))for(let n=0;n<3;n+=1)t.values[n]+=(255-t.values[n])*e;else if(t.type.includes("color"))for(let n=0;n<3;n+=1)t.values[n]+=(1-t.values[n])*e;return Qj(t)}function Mr(t,e,n){try{return Tg(t,e)}catch{return t}}function TAe(t,e=.15){return QH(t)>.5?Eg(t,e):Tg(t,e)}function qD(t,e,n){try{return TAe(t,e)}catch{return t}}const kAe=pe.oneOfType([pe.func,pe.object]);function KH(...t){return t.reduce((e,n)=>n==null?e:function(...i){e.apply(this,i),n.apply(this,i)},()=>{})}function kM(t,e=166){let n;function r(...i){const o=()=>{t.apply(this,i)};clearTimeout(n),n=setTimeout(o,e)}return r.clear=()=>{clearTimeout(n)},r}function n3(t,e){var n,r,i;return D.isValidElement(t)&&e.indexOf(t.type.muiName??((i=(r=(n=t.type)==null?void 0:n._payload)==null?void 0:r.value)==null?void 0:i.muiName))!==-1}function vi(t){return t&&t.ownerDocument||document}function xc(t){return vi(t).defaultView||window}function ZH(t,e){typeof t=="function"?t(e):t&&(t.current=e)}let Hfe=0;function ent(t){const[e,n]=D.useState(t),r=t||e;return D.useEffect(()=>{e==null&&(Hfe+=1,n(`mui-${Hfe}`))},[e]),r}const tnt={...Z3},qfe=tnt.useId;function Jf(t){if(qfe!==void 0){const e=qfe();return t??e}return ent(t)}function bc({controlled:t,default:e,name:n,state:r="value"}){const{current:i}=D.useRef(t!==void 0),[o,s]=D.useState(e),a=i?t:o,l=D.useCallback(c=>{i||s(c)},[]);return[a,l]}function st(t){const e=D.useRef(t);return Ti(()=>{e.current=t}),D.useRef((...n)=>(0,e.current)(...n)).current}function dn(...t){return D.useMemo(()=>t.every(e=>e==null)?null:e=>{t.forEach(n=>{ZH(n,e)})},t)}const Xfe={};function AAe(t,e){const n=D.useRef(Xfe);return n.current===Xfe&&(n.current=t(e)),n}const nnt=[];function rnt(t){D.useEffect(t,nnt)}class Kj{constructor(){gn(this,"currentId",null);gn(this,"clear",()=>{this.currentId!==null&&(clearTimeout(this.currentId),this.currentId=null)});gn(this,"disposeEffect",()=>this.clear)}static create(){return new Kj}start(e,n){this.clear(),this.currentId=setTimeout(()=>{this.currentId=null,n()},e)}}function lv(){const t=AAe(Kj.create).current;return rnt(t.disposeEffect),t}function Kv(t){try{return t.matches(":focus-visible")}catch{}return!1}function PAe(t=window){const e=t.document.documentElement.clientWidth;return t.innerWidth-e}function int(t){return D.Children.toArray(t).filter(e=>D.isValidElement(e))}const MAe={border:0,clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"absolute",whiteSpace:"nowrap",width:"1px"};function qe(t,e,n=void 0){const r={};for(const i in t){const o=t[i];let s="",a=!0;for(let l=0;lr.match(/^on[A-Z]/)&&typeof t[r]=="function"&&!e.includes(r)).forEach(r=>{n[r]=t[r]}),n}function Yfe(t){if(t===void 0)return{};const e={};return Object.keys(t).filter(n=>!(n.match(/^on[A-Z]/)&&typeof t[n]=="function")).forEach(n=>{e[n]=t[n]}),e}function RAe(t){const{getSlotProps:e,additionalProps:n,externalSlotProps:r,externalForwardedProps:i,className:o}=t;if(!e){const h=Oe(n==null?void 0:n.className,o,i==null?void 0:i.className,r==null?void 0:r.className),p={...n==null?void 0:n.style,...i==null?void 0:i.style,...r==null?void 0:r.style},g={...n,...i,...r};return h.length>0&&(g.className=h),Object.keys(p).length>0&&(g.style=p),{props:g,internalRef:void 0}}const s=kx({...i,...r}),a=Yfe(r),l=Yfe(i),c=e(s),u=Oe(c==null?void 0:c.className,n==null?void 0:n.className,o,i==null?void 0:i.className,r==null?void 0:r.className),f={...c==null?void 0:c.style,...n==null?void 0:n.style,...i==null?void 0:i.style,...r==null?void 0:r.style},d={...c,...n,...l,...a};return u.length>0&&(d.className=u),Object.keys(f).length>0&&(d.style=f),{props:d,internalRef:c.ref}}function nA(t,e,n){return typeof t=="function"?t(e,n):t}function Zt(t){var f;const{elementType:e,externalSlotProps:n,ownerState:r,skipResolvingSlotProps:i=!1,...o}=t,s=i?{}:nA(n,r),{props:a,internalRef:l}=RAe({...o,externalSlotProps:s}),c=dn(l,s==null?void 0:s.ref,(f=t.additionalProps)==null?void 0:f.ref);return e_(e,{...a,ref:c},r)}function Py(t){var e;return parseInt(D.version,10)>=19?((e=t==null?void 0:t.props)==null?void 0:e.ref)||null:(t==null?void 0:t.ref)||null}const DAe=D.createContext(null);function Zj(){return D.useContext(DAe)}const snt=typeof Symbol=="function"&&Symbol.for,IAe=snt?Symbol.for("mui.nested"):"__THEME_NESTED__";function ant(t,e){return typeof e=="function"?e(t):{...t,...e}}function lnt(t){const{children:e,theme:n}=t,r=Zj(),i=D.useMemo(()=>{const o=r===null?{...n}:ant(r,n);return o!=null&&(o[IAe]=r!==null),o},[n,r]);return C.jsx(DAe.Provider,{value:i,children:e})}const LAe=D.createContext();function cnt({value:t,...e}){return C.jsx(LAe.Provider,{value:t??!0,...e})}const Ho=()=>D.useContext(LAe)??!1,$Ae=D.createContext(void 0);function unt({value:t,children:e}){return C.jsx($Ae.Provider,{value:t,children:e})}function fnt(t){const{theme:e,name:n,props:r}=t;if(!e||!e.components||!e.components[n])return r;const i=e.components[n];return i.defaultProps?vS(i.defaultProps,r):!i.styleOverrides&&!i.variants?vS(i,r):r}function dnt({props:t,name:e}){const n=D.useContext($Ae);return fnt({props:t,name:e,theme:{components:n}})}const Qfe={};function Kfe(t,e,n,r=!1){return D.useMemo(()=>{const i=t&&e[t]||e;if(typeof n=="function"){const o=n(i),s=t?{...e,[t]:o}:o;return r?()=>s:s}return t?{...e,[t]:n}:{...e,...n}},[t,e,n,r])}function FAe(t){const{children:e,theme:n,themeId:r}=t,i=bee(Qfe),o=Zj()||Qfe,s=Kfe(r,i,n),a=Kfe(r,o,n,!0),l=s.direction==="rtl";return C.jsx(lnt,{theme:a,children:C.jsx(Uj.Provider,{value:s,children:C.jsx(cnt,{value:l,children:C.jsx(unt,{value:s==null?void 0:s.components,children:e})})})})}const Zfe={theme:void 0};function hnt(t){let e,n;return function(i){let o=e;return(o===void 0||i.theme!==n)&&(Zfe.theme=i.theme,o=bAe(t(Zfe)),e=o,n=i.theme),o}}const See="mode",Cee="color-scheme",pnt="data-color-scheme";function gnt(t){const{defaultMode:e="system",defaultLightColorScheme:n="light",defaultDarkColorScheme:r="dark",modeStorageKey:i=See,colorSchemeStorageKey:o=Cee,attribute:s=pnt,colorSchemeNode:a="document.documentElement",nonce:l}=t||{};let c="",u=s;if(s==="class"&&(u=".%s"),s==="data"&&(u="[data-%s]"),u.startsWith(".")){const d=u.substring(1);c+=`${a}.classList.remove('${d}'.replace('%s', light), '${d}'.replace('%s', dark)); ${a}.classList.add('${d}'.replace('%s', colorScheme));`}const f=u.match(/\[([^\]]+)\]/);if(f){const[d,h]=f[1].split("=");h||(c+=`${a}.removeAttribute('${d}'.replace('%s', light)); ${a}.removeAttribute('${d}'.replace('%s', dark));`),c+=` ${a}.setAttribute('${d}'.replace('%s', colorScheme), ${h?`${h}.replace('%s', colorScheme)`:'""'});`}else c+=`${a}.setAttribute('${u}', colorScheme);`;return C.jsx("script",{suppressHydrationWarning:!0,nonce:typeof window>"u"?l:"",dangerouslySetInnerHTML:{__html:`(function() { @@ -107,15 +107,15 @@ try { if (colorScheme) { ${c} } -} catch(e){}})();`}},"mui-color-scheme-init")}function Lfe(t){if(typeof window<"u"&&typeof window.matchMedia=="function"&&t==="system")return window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}function fAe(t,e){if(t.mode==="light"||t.mode==="system"&&t.systemMode==="light")return e("light");if(t.mode==="dark"||t.mode==="system"&&t.systemMode==="dark")return e("dark")}function Wtt(t){return fAe(t,e=>{if(e==="light")return t.lightColorScheme;if(e==="dark")return t.darkColorScheme})}function Q8(t,e){if(typeof window>"u")return;let n;try{n=localStorage.getItem(t)||void 0,n||localStorage.setItem(t,e)}catch{}return n||e}function Vtt(t){const{defaultMode:e="light",defaultLightColorScheme:n,defaultDarkColorScheme:r,supportedColorSchemes:i=[],modeStorageKey:o=aee,colorSchemeStorageKey:s=lee,storageWindow:a=typeof window>"u"?void 0:window}=t,l=i.join(","),c=i.length>1,[u,f]=D.useState(()=>{const x=Q8(o,e),b=Q8(`${s}-light`,n),w=Q8(`${s}-dark`,r);return{mode:x,systemMode:Lfe(x),lightColorScheme:b,darkColorScheme:w}}),[,d]=D.useState(!1),h=D.useRef(!1);D.useEffect(()=>{c&&d(!0),h.current=!0},[c]);const p=Wtt(u),g=D.useCallback(x=>{f(b=>{if(x===b.mode)return b;const w=x??e;try{localStorage.setItem(o,w)}catch{}return{...b,mode:w,systemMode:Lfe(w)}})},[o,e]),m=D.useCallback(x=>{x?typeof x=="string"?x&&!l.includes(x)?console.error(`\`${x}\` does not exist in \`theme.colorSchemes\`.`):f(b=>{const w={...b};return fAe(b,_=>{try{localStorage.setItem(`${s}-${_}`,x)}catch{}_==="light"&&(w.lightColorScheme=x),_==="dark"&&(w.darkColorScheme=x)}),w}):f(b=>{const w={...b},_=x.light===null?n:x.light,S=x.dark===null?r:x.dark;if(_)if(!l.includes(_))console.error(`\`${_}\` does not exist in \`theme.colorSchemes\`.`);else{w.lightColorScheme=_;try{localStorage.setItem(`${s}-light`,_)}catch{}}if(S)if(!l.includes(S))console.error(`\`${S}\` does not exist in \`theme.colorSchemes\`.`);else{w.darkColorScheme=S;try{localStorage.setItem(`${s}-dark`,S)}catch{}}return w}):f(b=>{try{localStorage.setItem(`${s}-light`,n),localStorage.setItem(`${s}-dark`,r)}catch{}return{...b,lightColorScheme:n,darkColorScheme:r}})},[l,s,n,r]),v=D.useCallback(x=>{u.mode==="system"&&f(b=>{const w=x!=null&&x.matches?"dark":"light";return b.systemMode===w?b:{...b,systemMode:w}})},[u.mode]),y=D.useRef(v);return y.current=v,D.useEffect(()=>{if(typeof window.matchMedia!="function"||!c)return;const x=(...w)=>y.current(...w),b=window.matchMedia("(prefers-color-scheme: dark)");return b.addListener(x),x(b),()=>{b.removeListener(x)}},[c]),D.useEffect(()=>{if(a&&c){const x=b=>{const w=b.newValue;typeof b.key=="string"&&b.key.startsWith(s)&&(!w||l.match(w))&&(b.key.endsWith("light")&&m({light:w}),b.key.endsWith("dark")&&m({dark:w})),b.key===o&&(!w||["light","dark","system"].includes(w))&&g(w||e)};return a.addEventListener("storage",x),()=>{a.removeEventListener("storage",x)}}},[m,g,o,s,l,e,a,c]),{...u,mode:h.current||!c?u.mode:void 0,systemMode:h.current||!c?u.systemMode:void 0,colorScheme:h.current||!c?p:void 0,setMode:g,setColorScheme:m}}const Gtt="*{-webkit-transition:none!important;-moz-transition:none!important;-o-transition:none!important;-ms-transition:none!important;transition:none!important}";function Htt(t){const{themeId:e,theme:n={},modeStorageKey:r=aee,colorSchemeStorageKey:i=lee,disableTransitionOnChange:o=!1,defaultColorScheme:s,resolveTheme:a}=t,l={allColorSchemes:[],colorScheme:void 0,darkColorScheme:void 0,lightColorScheme:void 0,mode:void 0,setColorScheme:()=>{},setMode:()=>{},systemMode:void 0},c=D.createContext(void 0),u=()=>D.useContext(c)||l;function f(g){var G,W,J,se,ye;const{children:m,theme:v,modeStorageKey:y=r,colorSchemeStorageKey:x=i,disableTransitionOnChange:b=o,storageWindow:w=typeof window>"u"?void 0:window,documentNode:_=typeof document>"u"?void 0:document,colorSchemeNode:S=typeof document>"u"?void 0:document.documentElement,disableNestedContext:O=!1,disableStyleSheetGeneration:k=!1,defaultMode:E="system"}=g,M=D.useRef(!1),A=n4(),P=D.useContext(c),T=!!P&&!O,R=D.useMemo(()=>v||(typeof n=="function"?n():n),[v]),I=R[e],{colorSchemes:B={},components:$={},cssVarPrefix:z,...L}=I||R,j=Object.keys(B).filter(ie=>!!B[ie]).join(","),N=D.useMemo(()=>j.split(","),[j]),F=typeof s=="string"?s:s.light,H=typeof s=="string"?s:s.dark,q=B[F]&&B[H]?E:((W=(G=B[L.defaultColorScheme])==null?void 0:G.palette)==null?void 0:W.mode)||((J=L.palette)==null?void 0:J.mode),{mode:Y,setMode:le,systemMode:K,lightColorScheme:ee,darkColorScheme:re,colorScheme:me,setColorScheme:te}=Vtt({supportedColorSchemes:N,defaultLightColorScheme:F,defaultDarkColorScheme:H,modeStorageKey:y,colorSchemeStorageKey:x,defaultMode:q,storageWindow:w});let ae=Y,U=me;T&&(ae=P.mode,U=P.colorScheme);const oe=U||L.defaultColorScheme,ne=((se=L.generateThemeVars)==null?void 0:se.call(L))||L.vars,V={...L,components:$,colorSchemes:B,cssVarPrefix:z,vars:ne};if(typeof V.generateSpacing=="function"&&(V.spacing=V.generateSpacing()),oe){const ie=B[oe];ie&&typeof ie=="object"&&Object.keys(ie).forEach(fe=>{ie[fe]&&typeof ie[fe]=="object"?V[fe]={...V[fe],...ie[fe]}:V[fe]=ie[fe]})}const X=L.colorSchemeSelector;D.useEffect(()=>{if(U&&S&&X&&X!=="media"){const ie=X;let fe=X;if(ie==="class"&&(fe=".%s"),ie==="data"&&(fe="[data-%s]"),ie!=null&&ie.startsWith("data-")&&!ie.includes("%s")&&(fe=`[${ie}="%s"]`),fe.startsWith("."))S.classList.remove(...N.map(Q=>fe.substring(1).replace("%s",Q))),S.classList.add(fe.substring(1).replace("%s",U));else{const Q=fe.replace("%s",U).match(/\[([^\]]+)\]/);if(Q){const[_e,we]=Q[1].split("=");we||N.forEach(Ie=>{S.removeAttribute(_e.replace(U,Ie))}),S.setAttribute(_e,we?we.replace(/"|'/g,""):"")}else S.setAttribute(fe,U)}}},[U,X,S,N]),D.useEffect(()=>{let ie;if(b&&M.current&&_){const fe=_.createElement("style");fe.appendChild(_.createTextNode(Gtt)),_.head.appendChild(fe),window.getComputedStyle(_.body),ie=setTimeout(()=>{_.head.removeChild(fe)},1)}return()=>{clearTimeout(ie)}},[U,b,_]),D.useEffect(()=>(M.current=!0,()=>{M.current=!1}),[]);const Z=D.useMemo(()=>({allColorSchemes:N,colorScheme:U,darkColorScheme:re,lightColorScheme:ee,mode:ae,setColorScheme:te,setMode:le,systemMode:K}),[N,U,re,ee,ae,te,le,K]);let he=!0;(k||L.cssVariables===!1||T&&(A==null?void 0:A.cssVarPrefix)===z)&&(he=!1);const xe=C.jsxs(D.Fragment,{children:[C.jsx(uAe,{themeId:I?e:void 0,theme:a?a(V):V,children:m}),he&&C.jsx(jke,{styles:((ye=V.generateStyleSheets)==null?void 0:ye.call(V))||[]})]});return T?xe:C.jsx(c.Provider,{value:Z,children:xe})}const d=typeof s=="string"?s:s.light,h=typeof s=="string"?s:s.dark;return{CssVarsProvider:f,useColorScheme:u,getInitColorSchemeScript:g=>Utt({colorSchemeStorageKey:i,defaultLightColorScheme:d,defaultDarkColorScheme:h,modeStorageKey:r,...g})}}function qtt(t=""){function e(...r){if(!r.length)return"";const i=r[0];return typeof i=="string"&&!i.match(/(#|\(|\)|(-?(\d*\.)?\d+)(px|em|%|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc))|^(-?(\d*\.)?\d+)$|(\d+ \d+ \d+)/)?`, var(--${t?`${t}-`:""}${i}${e(...r.slice(1))})`:`, ${i}`}return(r,...i)=>`var(--${t?`${t}-`:""}${r}${e(...i)})`}const $fe=(t,e,n,r=[])=>{let i=t;e.forEach((o,s)=>{s===e.length-1?Array.isArray(i)?i[Number(o)]=n:i&&typeof i=="object"&&(i[o]=n):i&&typeof i=="object"&&(i[o]||(i[o]=r.includes(o)?[]:{}),i=i[o])})},Xtt=(t,e,n)=>{function r(i,o=[],s=[]){Object.entries(i).forEach(([a,l])=>{(!n||n&&!n([...o,a]))&&l!=null&&(typeof l=="object"&&Object.keys(l).length>0?r(l,[...o,a],Array.isArray(l)?[...s,a]:s):e([...o,a],l,s))})}r(t)},Ytt=(t,e)=>typeof e=="number"?["lineHeight","fontWeight","opacity","zIndex"].some(r=>t.includes(r))||t[t.length-1].toLowerCase().includes("opacity")?e:`${e}px`:e;function K8(t,e){const{prefix:n,shouldSkipGeneratingVar:r}=e||{},i={},o={},s={};return Xtt(t,(a,l,c)=>{if((typeof l=="string"||typeof l=="number")&&(!r||!r(a,l))){const u=`--${n?`${n}-`:""}${a.join("-")}`,f=Ytt(a,l);Object.assign(i,{[u]:f}),$fe(o,a,`var(${u})`,c),$fe(s,a,`var(${u}, ${f})`,c)}},a=>a[0]==="vars"),{css:i,vars:o,varsWithDefaults:s}}function Qtt(t,e={}){const{getSelector:n=m,disableCssColorScheme:r,colorSchemeSelector:i}=e,{colorSchemes:o={},components:s,defaultColorScheme:a="light",...l}=t,{vars:c,css:u,varsWithDefaults:f}=K8(l,e);let d=f;const h={},{[a]:p,...g}=o;if(Object.entries(g||{}).forEach(([x,b])=>{const{vars:w,css:_,varsWithDefaults:S}=K8(b,e);d=Bo(d,S),h[x]={css:_,vars:w}}),p){const{css:x,vars:b,varsWithDefaults:w}=K8(p,e);d=Bo(d,w),h[a]={css:x,vars:b}}function m(x,b){var _,S;let w=i;if(i==="class"&&(w=".%s"),i==="data"&&(w="[data-%s]"),i!=null&&i.startsWith("data-")&&!i.includes("%s")&&(w=`[${i}="%s"]`),x){if(w==="media")return t.defaultColorScheme===x?":root":{[`@media (prefers-color-scheme: ${((S=(_=o[x])==null?void 0:_.palette)==null?void 0:S.mode)||x})`]:{":root":b}};if(w)return t.defaultColorScheme===x?`:root, ${w.replace("%s",String(x))}`:w.replace("%s",String(x))}return":root"}return{vars:d,generateThemeVars:()=>{let x={...c};return Object.entries(h).forEach(([,{vars:b}])=>{x=Bo(x,b)}),x},generateStyleSheets:()=>{var O,k;const x=[],b=t.defaultColorScheme||"light";function w(E,M){Object.keys(M).length&&x.push(typeof E=="string"?{[E]:{...M}}:E)}w(n(void 0,{...u}),u);const{[b]:_,...S}=h;if(_){const{css:E}=_,M=(k=(O=o[b])==null?void 0:O.palette)==null?void 0:k.mode,A=!r&&M?{colorScheme:M,...E}:{...E};w(n(b,{...A}),A)}return Object.entries(S).forEach(([E,{css:M}])=>{var T,R;const A=(R=(T=o[E])==null?void 0:T.palette)==null?void 0:R.mode,P=!r&&A?{colorScheme:A,...M}:{...M};w(n(E,{...P}),P)}),x}}}function Ktt(t){return function(n){return t==="media"?`@media (prefers-color-scheme: ${n})`:t?t.startsWith("data-")&&!t.includes("%s")?`[${t}="${n}"] &`:t==="class"?`.${n} &`:t==="data"?`[data-${n}] &`:`${t.replace("%s",n)} &`:"&"}}function dAe(){return{text:{primary:"rgba(0, 0, 0, 0.87)",secondary:"rgba(0, 0, 0, 0.6)",disabled:"rgba(0, 0, 0, 0.38)"},divider:"rgba(0, 0, 0, 0.12)",background:{paper:Jk.white,default:Jk.white},action:{active:"rgba(0, 0, 0, 0.54)",hover:"rgba(0, 0, 0, 0.04)",hoverOpacity:.04,selected:"rgba(0, 0, 0, 0.08)",selectedOpacity:.08,disabled:"rgba(0, 0, 0, 0.26)",disabledBackground:"rgba(0, 0, 0, 0.12)",disabledOpacity:.38,focus:"rgba(0, 0, 0, 0.12)",focusOpacity:.12,activatedOpacity:.12}}}const Ztt=dAe();function hAe(){return{text:{primary:Jk.white,secondary:"rgba(255, 255, 255, 0.7)",disabled:"rgba(255, 255, 255, 0.5)",icon:"rgba(255, 255, 255, 0.5)"},divider:"rgba(255, 255, 255, 0.12)",background:{paper:"#121212",default:"#121212"},action:{active:Jk.white,hover:"rgba(255, 255, 255, 0.08)",hoverOpacity:.08,selected:"rgba(255, 255, 255, 0.16)",selectedOpacity:.16,disabled:"rgba(255, 255, 255, 0.3)",disabledBackground:"rgba(255, 255, 255, 0.12)",disabledOpacity:.38,focus:"rgba(255, 255, 255, 0.12)",focusOpacity:.12,activatedOpacity:.24}}}const Ffe=hAe();function Nfe(t,e,n,r){const i=r.light||r,o=r.dark||r*1.5;t[e]||(t.hasOwnProperty(n)?t[e]=t[n]:e==="light"?t.light=Pg(t.main,i):e==="dark"&&(t.dark=Ag(t.main,o)))}function Jtt(t="light"){return t==="dark"?{main:Um[200],light:Um[50],dark:Um[400]}:{main:Um[700],light:Um[400],dark:Um[800]}}function ent(t="light"){return t==="dark"?{main:Bm[200],light:Bm[50],dark:Bm[400]}:{main:Bm[500],light:Bm[300],dark:Bm[700]}}function tnt(t="light"){return t==="dark"?{main:jm[500],light:jm[300],dark:jm[700]}:{main:jm[700],light:jm[400],dark:jm[800]}}function nnt(t="light"){return t==="dark"?{main:Wm[400],light:Wm[300],dark:Wm[700]}:{main:Wm[700],light:Wm[500],dark:Wm[900]}}function rnt(t="light"){return t==="dark"?{main:Ip[400],light:Ip[300],dark:Ip[700]}:{main:Ip[800],light:Ip[500],dark:Ip[900]}}function int(t="light"){return t==="dark"?{main:q0[400],light:q0[300],dark:q0[700]}:{main:"#ed6c02",light:q0[500],dark:q0[900]}}function cee(t){const{mode:e="light",contrastThreshold:n=3,tonalOffset:r=.2,...i}=t,o=t.primary||Jtt(e),s=t.secondary||ent(e),a=t.error||tnt(e),l=t.info||nnt(e),c=t.success||rnt(e),u=t.warning||int(e);function f(g){return Ett(g,Ffe.text.primary)>=n?Ffe.text.primary:Ztt.text.primary}const d=({color:g,name:m,mainShade:v=500,lightShade:y=300,darkShade:x=700})=>{if(g={...g},!g.main&&g[v]&&(g.main=g[v]),!g.hasOwnProperty("main"))throw new Error(kg(11,m?` (${m})`:"",v));if(typeof g.main!="string")throw new Error(kg(12,m?` (${m})`:"",JSON.stringify(g.main)));return Nfe(g,"light",y,r),Nfe(g,"dark",x,r),g.contrastText||(g.contrastText=f(g.main)),g};let h;return e==="light"?h=dAe():e==="dark"&&(h=hAe()),Bo({common:{...Jk},mode:e,primary:d({color:o,name:"primary"}),secondary:d({color:s,name:"secondary",mainShade:"A400",lightShade:"A200",darkShade:"A700"}),error:d({color:a,name:"error"}),warning:d({color:u,name:"warning"}),info:d({color:l,name:"info"}),success:d({color:c,name:"success"}),grey:Ske,contrastThreshold:n,getContrastText:f,augmentColor:d,tonalOffset:r,...h},i)}function ont(t){const e={};return Object.entries(t).forEach(r=>{const[i,o]=r;typeof o=="object"&&(e[i]=`${o.fontStyle?`${o.fontStyle} `:""}${o.fontVariant?`${o.fontVariant} `:""}${o.fontWeight?`${o.fontWeight} `:""}${o.fontStretch?`${o.fontStretch} `:""}${o.fontSize||""}${o.lineHeight?`/${o.lineHeight} `:""}${o.fontFamily||""}`)}),e}function snt(t,e){return{toolbar:{minHeight:56,[t.up("xs")]:{"@media (orientation: landscape)":{minHeight:48}},[t.up("sm")]:{minHeight:64}},...e}}function ant(t){return Math.round(t*1e5)/1e5}const zfe={textTransform:"uppercase"},jfe='"Roboto", "Helvetica", "Arial", sans-serif';function pAe(t,e){const{fontFamily:n=jfe,fontSize:r=14,fontWeightLight:i=300,fontWeightRegular:o=400,fontWeightMedium:s=500,fontWeightBold:a=700,htmlFontSize:l=16,allVariants:c,pxToRem:u,...f}=typeof e=="function"?e(t):e,d=r/14,h=u||(m=>`${m/l*d}rem`),p=(m,v,y,x,b)=>({fontFamily:n,fontWeight:m,fontSize:h(v),lineHeight:y,...n===jfe?{letterSpacing:`${ant(x/v)}em`}:{},...b,...c}),g={h1:p(i,96,1.167,-1.5),h2:p(i,60,1.2,-.5),h3:p(o,48,1.167,0),h4:p(o,34,1.235,.25),h5:p(o,24,1.334,0),h6:p(s,20,1.6,.15),subtitle1:p(o,16,1.75,.15),subtitle2:p(s,14,1.57,.1),body1:p(o,16,1.5,.15),body2:p(o,14,1.43,.15),button:p(s,14,1.75,.4,zfe),caption:p(o,12,1.66,.4),overline:p(o,12,2.66,1,zfe),inherit:{fontFamily:"inherit",fontWeight:"inherit",fontSize:"inherit",lineHeight:"inherit",letterSpacing:"inherit"}};return Bo({htmlFontSize:l,pxToRem:h,fontFamily:n,fontSize:r,fontWeightLight:i,fontWeightRegular:o,fontWeightMedium:s,fontWeightBold:a,...g},f,{clone:!1})}const lnt=.2,cnt=.14,unt=.12;function oi(...t){return[`${t[0]}px ${t[1]}px ${t[2]}px ${t[3]}px rgba(0,0,0,${lnt})`,`${t[4]}px ${t[5]}px ${t[6]}px ${t[7]}px rgba(0,0,0,${cnt})`,`${t[8]}px ${t[9]}px ${t[10]}px ${t[11]}px rgba(0,0,0,${unt})`].join(",")}const fnt=["none",oi(0,2,1,-1,0,1,1,0,0,1,3,0),oi(0,3,1,-2,0,2,2,0,0,1,5,0),oi(0,3,3,-2,0,3,4,0,0,1,8,0),oi(0,2,4,-1,0,4,5,0,0,1,10,0),oi(0,3,5,-1,0,5,8,0,0,1,14,0),oi(0,3,5,-1,0,6,10,0,0,1,18,0),oi(0,4,5,-2,0,7,10,1,0,2,16,1),oi(0,5,5,-3,0,8,10,1,0,3,14,2),oi(0,5,6,-3,0,9,12,1,0,3,16,2),oi(0,6,6,-3,0,10,14,1,0,4,18,3),oi(0,6,7,-4,0,11,15,1,0,4,20,3),oi(0,7,8,-4,0,12,17,2,0,5,22,4),oi(0,7,8,-4,0,13,19,2,0,5,24,4),oi(0,7,9,-4,0,14,21,2,0,5,26,4),oi(0,8,9,-5,0,15,22,2,0,6,28,5),oi(0,8,10,-5,0,16,24,2,0,6,30,5),oi(0,8,11,-5,0,17,26,2,0,6,32,5),oi(0,9,11,-5,0,18,28,2,0,7,34,6),oi(0,9,12,-6,0,19,29,2,0,7,36,6),oi(0,10,13,-6,0,20,31,3,0,8,38,7),oi(0,10,13,-6,0,21,33,3,0,8,40,7),oi(0,10,14,-6,0,22,35,3,0,8,42,7),oi(0,11,14,-7,0,23,36,3,0,9,44,8),oi(0,11,15,-7,0,24,38,3,0,9,46,8)],dnt={easeInOut:"cubic-bezier(0.4, 0, 0.2, 1)",easeOut:"cubic-bezier(0.0, 0, 0.2, 1)",easeIn:"cubic-bezier(0.4, 0, 1, 1)",sharp:"cubic-bezier(0.4, 0, 0.6, 1)"},gAe={shortest:150,shorter:200,short:250,standard:300,complex:375,enteringScreen:225,leavingScreen:195};function Bfe(t){return`${Math.round(t)}ms`}function hnt(t){if(!t)return 0;const e=t/36;return Math.min(Math.round((4+15*e**.25+e/5)*10),3e3)}function pnt(t){const e={...dnt,...t.easing},n={...gAe,...t.duration};return{getAutoHeightDuration:hnt,create:(i=["all"],o={})=>{const{duration:s=n.standard,easing:a=e.easeInOut,delay:l=0,...c}=o;return(Array.isArray(i)?i:[i]).map(u=>`${u} ${typeof s=="string"?s:Bfe(s)} ${a} ${typeof l=="string"?l:Bfe(l)}`).join(",")},...t,easing:e,duration:n}}const gnt={mobileStepper:1e3,fab:1050,speedDial:1050,appBar:1100,drawer:1200,modal:1300,snackbar:1400,tooltip:1500};function mnt(t){return Nd(t)||typeof t>"u"||typeof t=="string"||typeof t=="boolean"||typeof t=="number"||Array.isArray(t)}function mAe(t={}){const e={...t};function n(r){const i=Object.entries(r);for(let o=0;o{if(e==="light")return t.lightColorScheme;if(e==="dark")return t.darkColorScheme})}function Q8(t,e){if(typeof window>"u")return;let n;try{n=localStorage.getItem(t)||void 0,n||localStorage.setItem(t,e)}catch{}return n||e}function vnt(t){const{defaultMode:e="light",defaultLightColorScheme:n,defaultDarkColorScheme:r,supportedColorSchemes:i=[],modeStorageKey:o=See,colorSchemeStorageKey:s=Cee,storageWindow:a=typeof window>"u"?void 0:window}=t,l=i.join(","),c=i.length>1,[u,f]=D.useState(()=>{const x=Q8(o,e),b=Q8(`${s}-light`,n),w=Q8(`${s}-dark`,r);return{mode:x,systemMode:Jfe(x),lightColorScheme:b,darkColorScheme:w}}),[,d]=D.useState(!1),h=D.useRef(!1);D.useEffect(()=>{c&&d(!0),h.current=!0},[c]);const p=mnt(u),g=D.useCallback(x=>{f(b=>{if(x===b.mode)return b;const w=x??e;try{localStorage.setItem(o,w)}catch{}return{...b,mode:w,systemMode:Jfe(w)}})},[o,e]),m=D.useCallback(x=>{x?typeof x=="string"?x&&!l.includes(x)?console.error(`\`${x}\` does not exist in \`theme.colorSchemes\`.`):f(b=>{const w={...b};return NAe(b,_=>{try{localStorage.setItem(`${s}-${_}`,x)}catch{}_==="light"&&(w.lightColorScheme=x),_==="dark"&&(w.darkColorScheme=x)}),w}):f(b=>{const w={...b},_=x.light===null?n:x.light,S=x.dark===null?r:x.dark;if(_)if(!l.includes(_))console.error(`\`${_}\` does not exist in \`theme.colorSchemes\`.`);else{w.lightColorScheme=_;try{localStorage.setItem(`${s}-light`,_)}catch{}}if(S)if(!l.includes(S))console.error(`\`${S}\` does not exist in \`theme.colorSchemes\`.`);else{w.darkColorScheme=S;try{localStorage.setItem(`${s}-dark`,S)}catch{}}return w}):f(b=>{try{localStorage.setItem(`${s}-light`,n),localStorage.setItem(`${s}-dark`,r)}catch{}return{...b,lightColorScheme:n,darkColorScheme:r}})},[l,s,n,r]),v=D.useCallback(x=>{u.mode==="system"&&f(b=>{const w=x!=null&&x.matches?"dark":"light";return b.systemMode===w?b:{...b,systemMode:w}})},[u.mode]),y=D.useRef(v);return y.current=v,D.useEffect(()=>{if(typeof window.matchMedia!="function"||!c)return;const x=(...w)=>y.current(...w),b=window.matchMedia("(prefers-color-scheme: dark)");return b.addListener(x),x(b),()=>{b.removeListener(x)}},[c]),D.useEffect(()=>{if(a&&c){const x=b=>{const w=b.newValue;typeof b.key=="string"&&b.key.startsWith(s)&&(!w||l.match(w))&&(b.key.endsWith("light")&&m({light:w}),b.key.endsWith("dark")&&m({dark:w})),b.key===o&&(!w||["light","dark","system"].includes(w))&&g(w||e)};return a.addEventListener("storage",x),()=>{a.removeEventListener("storage",x)}}},[m,g,o,s,l,e,a,c]),{...u,mode:h.current||!c?u.mode:void 0,systemMode:h.current||!c?u.systemMode:void 0,colorScheme:h.current||!c?p:void 0,setMode:g,setColorScheme:m}}const ynt="*{-webkit-transition:none!important;-moz-transition:none!important;-o-transition:none!important;-ms-transition:none!important;transition:none!important}";function xnt(t){const{themeId:e,theme:n={},modeStorageKey:r=See,colorSchemeStorageKey:i=Cee,disableTransitionOnChange:o=!1,defaultColorScheme:s,resolveTheme:a}=t,l={allColorSchemes:[],colorScheme:void 0,darkColorScheme:void 0,lightColorScheme:void 0,mode:void 0,setColorScheme:()=>{},setMode:()=>{},systemMode:void 0},c=D.createContext(void 0),u=()=>D.useContext(c)||l;function f(g){var H,W,J,se,ye;const{children:m,theme:v,modeStorageKey:y=r,colorSchemeStorageKey:x=i,disableTransitionOnChange:b=o,storageWindow:w=typeof window>"u"?void 0:window,documentNode:_=typeof document>"u"?void 0:document,colorSchemeNode:S=typeof document>"u"?void 0:document.documentElement,disableNestedContext:O=!1,disableStyleSheetGeneration:k=!1,defaultMode:E="system"}=g,P=D.useRef(!1),A=Zj(),R=D.useContext(c),T=!!R&&!O,M=D.useMemo(()=>v||(typeof n=="function"?n():n),[v]),I=M[e],{colorSchemes:j={},components:N={},cssVarPrefix:z,...L}=I||M,B=Object.keys(j).filter(ie=>!!j[ie]).join(","),F=D.useMemo(()=>B.split(","),[B]),$=typeof s=="string"?s:s.light,q=typeof s=="string"?s:s.dark,G=j[$]&&j[q]?E:((W=(H=j[L.defaultColorScheme])==null?void 0:H.palette)==null?void 0:W.mode)||((J=L.palette)==null?void 0:J.mode),{mode:Y,setMode:le,systemMode:K,lightColorScheme:ee,darkColorScheme:re,colorScheme:ge,setColorScheme:te}=vnt({supportedColorSchemes:F,defaultLightColorScheme:$,defaultDarkColorScheme:q,modeStorageKey:y,colorSchemeStorageKey:x,defaultMode:G,storageWindow:w});let ae=Y,U=ge;T&&(ae=R.mode,U=R.colorScheme);const oe=U||L.defaultColorScheme,ne=((se=L.generateThemeVars)==null?void 0:se.call(L))||L.vars,V={...L,components:N,colorSchemes:j,cssVarPrefix:z,vars:ne};if(typeof V.generateSpacing=="function"&&(V.spacing=V.generateSpacing()),oe){const ie=j[oe];ie&&typeof ie=="object"&&Object.keys(ie).forEach(fe=>{ie[fe]&&typeof ie[fe]=="object"?V[fe]={...V[fe],...ie[fe]}:V[fe]=ie[fe]})}const X=L.colorSchemeSelector;D.useEffect(()=>{if(U&&S&&X&&X!=="media"){const ie=X;let fe=X;if(ie==="class"&&(fe=".%s"),ie==="data"&&(fe="[data-%s]"),ie!=null&&ie.startsWith("data-")&&!ie.includes("%s")&&(fe=`[${ie}="%s"]`),fe.startsWith("."))S.classList.remove(...F.map(Q=>fe.substring(1).replace("%s",Q))),S.classList.add(fe.substring(1).replace("%s",U));else{const Q=fe.replace("%s",U).match(/\[([^\]]+)\]/);if(Q){const[_e,we]=Q[1].split("=");we||F.forEach(Ie=>{S.removeAttribute(_e.replace(U,Ie))}),S.setAttribute(_e,we?we.replace(/"|'/g,""):"")}else S.setAttribute(fe,U)}}},[U,X,S,F]),D.useEffect(()=>{let ie;if(b&&P.current&&_){const fe=_.createElement("style");fe.appendChild(_.createTextNode(ynt)),_.head.appendChild(fe),window.getComputedStyle(_.body),ie=setTimeout(()=>{_.head.removeChild(fe)},1)}return()=>{clearTimeout(ie)}},[U,b,_]),D.useEffect(()=>(P.current=!0,()=>{P.current=!1}),[]);const Z=D.useMemo(()=>({allColorSchemes:F,colorScheme:U,darkColorScheme:re,lightColorScheme:ee,mode:ae,setColorScheme:te,setMode:le,systemMode:K}),[F,U,re,ee,ae,te,le,K]);let he=!0;(k||L.cssVariables===!1||T&&(A==null?void 0:A.cssVarPrefix)===z)&&(he=!1);const xe=C.jsxs(D.Fragment,{children:[C.jsx(FAe,{themeId:I?e:void 0,theme:a?a(V):V,children:m}),he&&C.jsx(hAe,{styles:((ye=V.generateStyleSheets)==null?void 0:ye.call(V))||[]})]});return T?xe:C.jsx(c.Provider,{value:Z,children:xe})}const d=typeof s=="string"?s:s.light,h=typeof s=="string"?s:s.dark;return{CssVarsProvider:f,useColorScheme:u,getInitColorSchemeScript:g=>gnt({colorSchemeStorageKey:i,defaultLightColorScheme:d,defaultDarkColorScheme:h,modeStorageKey:r,...g})}}function bnt(t=""){function e(...r){if(!r.length)return"";const i=r[0];return typeof i=="string"&&!i.match(/(#|\(|\)|(-?(\d*\.)?\d+)(px|em|%|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc))|^(-?(\d*\.)?\d+)$|(\d+ \d+ \d+)/)?`, var(--${t?`${t}-`:""}${i}${e(...r.slice(1))})`:`, ${i}`}return(r,...i)=>`var(--${t?`${t}-`:""}${r}${e(...i)})`}const ede=(t,e,n,r=[])=>{let i=t;e.forEach((o,s)=>{s===e.length-1?Array.isArray(i)?i[Number(o)]=n:i&&typeof i=="object"&&(i[o]=n):i&&typeof i=="object"&&(i[o]||(i[o]=r.includes(o)?[]:{}),i=i[o])})},wnt=(t,e,n)=>{function r(i,o=[],s=[]){Object.entries(i).forEach(([a,l])=>{(!n||n&&!n([...o,a]))&&l!=null&&(typeof l=="object"&&Object.keys(l).length>0?r(l,[...o,a],Array.isArray(l)?[...s,a]:s):e([...o,a],l,s))})}r(t)},_nt=(t,e)=>typeof e=="number"?["lineHeight","fontWeight","opacity","zIndex"].some(r=>t.includes(r))||t[t.length-1].toLowerCase().includes("opacity")?e:`${e}px`:e;function K8(t,e){const{prefix:n,shouldSkipGeneratingVar:r}=e||{},i={},o={},s={};return wnt(t,(a,l,c)=>{if((typeof l=="string"||typeof l=="number")&&(!r||!r(a,l))){const u=`--${n?`${n}-`:""}${a.join("-")}`,f=_nt(a,l);Object.assign(i,{[u]:f}),ede(o,a,`var(${u})`,c),ede(s,a,`var(${u}, ${f})`,c)}},a=>a[0]==="vars"),{css:i,vars:o,varsWithDefaults:s}}function Snt(t,e={}){const{getSelector:n=m,disableCssColorScheme:r,colorSchemeSelector:i}=e,{colorSchemes:o={},components:s,defaultColorScheme:a="light",...l}=t,{vars:c,css:u,varsWithDefaults:f}=K8(l,e);let d=f;const h={},{[a]:p,...g}=o;if(Object.entries(g||{}).forEach(([x,b])=>{const{vars:w,css:_,varsWithDefaults:S}=K8(b,e);d=Bo(d,S),h[x]={css:_,vars:w}}),p){const{css:x,vars:b,varsWithDefaults:w}=K8(p,e);d=Bo(d,w),h[a]={css:x,vars:b}}function m(x,b){var _,S;let w=i;if(i==="class"&&(w=".%s"),i==="data"&&(w="[data-%s]"),i!=null&&i.startsWith("data-")&&!i.includes("%s")&&(w=`[${i}="%s"]`),x){if(w==="media")return t.defaultColorScheme===x?":root":{[`@media (prefers-color-scheme: ${((S=(_=o[x])==null?void 0:_.palette)==null?void 0:S.mode)||x})`]:{":root":b}};if(w)return t.defaultColorScheme===x?`:root, ${w.replace("%s",String(x))}`:w.replace("%s",String(x))}return":root"}return{vars:d,generateThemeVars:()=>{let x={...c};return Object.entries(h).forEach(([,{vars:b}])=>{x=Bo(x,b)}),x},generateStyleSheets:()=>{var O,k;const x=[],b=t.defaultColorScheme||"light";function w(E,P){Object.keys(P).length&&x.push(typeof E=="string"?{[E]:{...P}}:E)}w(n(void 0,{...u}),u);const{[b]:_,...S}=h;if(_){const{css:E}=_,P=(k=(O=o[b])==null?void 0:O.palette)==null?void 0:k.mode,A=!r&&P?{colorScheme:P,...E}:{...E};w(n(b,{...A}),A)}return Object.entries(S).forEach(([E,{css:P}])=>{var T,M;const A=(M=(T=o[E])==null?void 0:T.palette)==null?void 0:M.mode,R=!r&&A?{colorScheme:A,...P}:{...P};w(n(E,{...R}),R)}),x}}}function Cnt(t){return function(n){return t==="media"?`@media (prefers-color-scheme: ${n})`:t?t.startsWith("data-")&&!t.includes("%s")?`[${t}="${n}"] &`:t==="class"?`.${n} &`:t==="data"?`[data-${n}] &`:`${t.replace("%s",n)} &`:"&"}}function zAe(){return{text:{primary:"rgba(0, 0, 0, 0.87)",secondary:"rgba(0, 0, 0, 0.6)",disabled:"rgba(0, 0, 0, 0.38)"},divider:"rgba(0, 0, 0, 0.12)",background:{paper:Zk.white,default:Zk.white},action:{active:"rgba(0, 0, 0, 0.54)",hover:"rgba(0, 0, 0, 0.04)",hoverOpacity:.04,selected:"rgba(0, 0, 0, 0.08)",selectedOpacity:.08,disabled:"rgba(0, 0, 0, 0.26)",disabledBackground:"rgba(0, 0, 0, 0.12)",disabledOpacity:.38,focus:"rgba(0, 0, 0, 0.12)",focusOpacity:.12,activatedOpacity:.12}}}const Ont=zAe();function jAe(){return{text:{primary:Zk.white,secondary:"rgba(255, 255, 255, 0.7)",disabled:"rgba(255, 255, 255, 0.5)",icon:"rgba(255, 255, 255, 0.5)"},divider:"rgba(255, 255, 255, 0.12)",background:{paper:"#121212",default:"#121212"},action:{active:Zk.white,hover:"rgba(255, 255, 255, 0.08)",hoverOpacity:.08,selected:"rgba(255, 255, 255, 0.16)",selectedOpacity:.16,disabled:"rgba(255, 255, 255, 0.3)",disabledBackground:"rgba(255, 255, 255, 0.12)",disabledOpacity:.38,focus:"rgba(255, 255, 255, 0.12)",focusOpacity:.12,activatedOpacity:.24}}}const tde=jAe();function nde(t,e,n,r){const i=r.light||r,o=r.dark||r*1.5;t[e]||(t.hasOwnProperty(n)?t[e]=t[n]:e==="light"?t.light=Tg(t.main,i):e==="dark"&&(t.dark=Eg(t.main,o)))}function Ent(t="light"){return t==="dark"?{main:jm[200],light:jm[50],dark:jm[400]}:{main:jm[700],light:jm[400],dark:jm[800]}}function Tnt(t="light"){return t==="dark"?{main:zm[200],light:zm[50],dark:zm[400]}:{main:zm[500],light:zm[300],dark:zm[700]}}function knt(t="light"){return t==="dark"?{main:Nm[500],light:Nm[300],dark:Nm[700]}:{main:Nm[700],light:Nm[400],dark:Nm[800]}}function Ant(t="light"){return t==="dark"?{main:Bm[400],light:Bm[300],dark:Bm[700]}:{main:Bm[700],light:Bm[500],dark:Bm[900]}}function Pnt(t="light"){return t==="dark"?{main:Mp[400],light:Mp[300],dark:Mp[700]}:{main:Mp[800],light:Mp[500],dark:Mp[900]}}function Mnt(t="light"){return t==="dark"?{main:q0[400],light:q0[300],dark:q0[700]}:{main:"#ed6c02",light:q0[500],dark:q0[900]}}function Oee(t){const{mode:e="light",contrastThreshold:n=3,tonalOffset:r=.2,...i}=t,o=t.primary||Ent(e),s=t.secondary||Tnt(e),a=t.error||knt(e),l=t.info||Ant(e),c=t.success||Pnt(e),u=t.warning||Mnt(e);function f(g){return Jtt(g,tde.text.primary)>=n?tde.text.primary:Ont.text.primary}const d=({color:g,name:m,mainShade:v=500,lightShade:y=300,darkShade:x=700})=>{if(g={...g},!g.main&&g[v]&&(g.main=g[v]),!g.hasOwnProperty("main"))throw new Error(Og(11,m?` (${m})`:"",v));if(typeof g.main!="string")throw new Error(Og(12,m?` (${m})`:"",JSON.stringify(g.main)));return nde(g,"light",y,r),nde(g,"dark",x,r),g.contrastText||(g.contrastText=f(g.main)),g};let h;return e==="light"?h=zAe():e==="dark"&&(h=jAe()),Bo({common:{...Zk},mode:e,primary:d({color:o,name:"primary"}),secondary:d({color:s,name:"secondary",mainShade:"A400",lightShade:"A200",darkShade:"A700"}),error:d({color:a,name:"error"}),warning:d({color:u,name:"warning"}),info:d({color:l,name:"info"}),success:d({color:c,name:"success"}),grey:Qke,contrastThreshold:n,getContrastText:f,augmentColor:d,tonalOffset:r,...h},i)}function Rnt(t){const e={};return Object.entries(t).forEach(r=>{const[i,o]=r;typeof o=="object"&&(e[i]=`${o.fontStyle?`${o.fontStyle} `:""}${o.fontVariant?`${o.fontVariant} `:""}${o.fontWeight?`${o.fontWeight} `:""}${o.fontStretch?`${o.fontStretch} `:""}${o.fontSize||""}${o.lineHeight?`/${o.lineHeight} `:""}${o.fontFamily||""}`)}),e}function Dnt(t,e){return{toolbar:{minHeight:56,[t.up("xs")]:{"@media (orientation: landscape)":{minHeight:48}},[t.up("sm")]:{minHeight:64}},...e}}function Int(t){return Math.round(t*1e5)/1e5}const rde={textTransform:"uppercase"},ide='"Roboto", "Helvetica", "Arial", sans-serif';function BAe(t,e){const{fontFamily:n=ide,fontSize:r=14,fontWeightLight:i=300,fontWeightRegular:o=400,fontWeightMedium:s=500,fontWeightBold:a=700,htmlFontSize:l=16,allVariants:c,pxToRem:u,...f}=typeof e=="function"?e(t):e,d=r/14,h=u||(m=>`${m/l*d}rem`),p=(m,v,y,x,b)=>({fontFamily:n,fontWeight:m,fontSize:h(v),lineHeight:y,...n===ide?{letterSpacing:`${Int(x/v)}em`}:{},...b,...c}),g={h1:p(i,96,1.167,-1.5),h2:p(i,60,1.2,-.5),h3:p(o,48,1.167,0),h4:p(o,34,1.235,.25),h5:p(o,24,1.334,0),h6:p(s,20,1.6,.15),subtitle1:p(o,16,1.75,.15),subtitle2:p(s,14,1.57,.1),body1:p(o,16,1.5,.15),body2:p(o,14,1.43,.15),button:p(s,14,1.75,.4,rde),caption:p(o,12,1.66,.4),overline:p(o,12,2.66,1,rde),inherit:{fontFamily:"inherit",fontWeight:"inherit",fontSize:"inherit",lineHeight:"inherit",letterSpacing:"inherit"}};return Bo({htmlFontSize:l,pxToRem:h,fontFamily:n,fontSize:r,fontWeightLight:i,fontWeightRegular:o,fontWeightMedium:s,fontWeightBold:a,...g},f,{clone:!1})}const Lnt=.2,$nt=.14,Fnt=.12;function ai(...t){return[`${t[0]}px ${t[1]}px ${t[2]}px ${t[3]}px rgba(0,0,0,${Lnt})`,`${t[4]}px ${t[5]}px ${t[6]}px ${t[7]}px rgba(0,0,0,${$nt})`,`${t[8]}px ${t[9]}px ${t[10]}px ${t[11]}px rgba(0,0,0,${Fnt})`].join(",")}const Nnt=["none",ai(0,2,1,-1,0,1,1,0,0,1,3,0),ai(0,3,1,-2,0,2,2,0,0,1,5,0),ai(0,3,3,-2,0,3,4,0,0,1,8,0),ai(0,2,4,-1,0,4,5,0,0,1,10,0),ai(0,3,5,-1,0,5,8,0,0,1,14,0),ai(0,3,5,-1,0,6,10,0,0,1,18,0),ai(0,4,5,-2,0,7,10,1,0,2,16,1),ai(0,5,5,-3,0,8,10,1,0,3,14,2),ai(0,5,6,-3,0,9,12,1,0,3,16,2),ai(0,6,6,-3,0,10,14,1,0,4,18,3),ai(0,6,7,-4,0,11,15,1,0,4,20,3),ai(0,7,8,-4,0,12,17,2,0,5,22,4),ai(0,7,8,-4,0,13,19,2,0,5,24,4),ai(0,7,9,-4,0,14,21,2,0,5,26,4),ai(0,8,9,-5,0,15,22,2,0,6,28,5),ai(0,8,10,-5,0,16,24,2,0,6,30,5),ai(0,8,11,-5,0,17,26,2,0,6,32,5),ai(0,9,11,-5,0,18,28,2,0,7,34,6),ai(0,9,12,-6,0,19,29,2,0,7,36,6),ai(0,10,13,-6,0,20,31,3,0,8,38,7),ai(0,10,13,-6,0,21,33,3,0,8,40,7),ai(0,10,14,-6,0,22,35,3,0,8,42,7),ai(0,11,14,-7,0,23,36,3,0,9,44,8),ai(0,11,15,-7,0,24,38,3,0,9,46,8)],znt={easeInOut:"cubic-bezier(0.4, 0, 0.2, 1)",easeOut:"cubic-bezier(0.0, 0, 0.2, 1)",easeIn:"cubic-bezier(0.4, 0, 1, 1)",sharp:"cubic-bezier(0.4, 0, 0.6, 1)"},UAe={shortest:150,shorter:200,short:250,standard:300,complex:375,enteringScreen:225,leavingScreen:195};function ode(t){return`${Math.round(t)}ms`}function jnt(t){if(!t)return 0;const e=t/36;return Math.min(Math.round((4+15*e**.25+e/5)*10),3e3)}function Bnt(t){const e={...znt,...t.easing},n={...UAe,...t.duration};return{getAutoHeightDuration:jnt,create:(i=["all"],o={})=>{const{duration:s=n.standard,easing:a=e.easeInOut,delay:l=0,...c}=o;return(Array.isArray(i)?i:[i]).map(u=>`${u} ${typeof s=="string"?s:ode(s)} ${a} ${typeof l=="string"?l:ode(l)}`).join(",")},...t,easing:e,duration:n}}const Unt={mobileStepper:1e3,fab:1050,speedDial:1050,appBar:1100,drawer:1200,modal:1300,snackbar:1400,tooltip:1500};function Wnt(t){return $d(t)||typeof t>"u"||typeof t=="string"||typeof t=="boolean"||typeof t=="number"||Array.isArray(t)}function WAe(t={}){const e={...t};function n(r){const i=Object.entries(r);for(let o=0;oBo(h,p),d),d.unstable_sxConfig={...TM,...c==null?void 0:c.unstable_sxConfig},d.unstable_sx=function(p){return Qv({sx:p,theme:this})},d.toRuntimeSource=mAe,d}function zH(t){let e;return t<1?e=5.11916*t**2:e=4.5*Math.log(t+1)+2,Math.round(e*10)/1e3}const vnt=[...Array(25)].map((t,e)=>{if(e===0)return"none";const n=zH(e);return`linear-gradient(rgba(255 255 255 / ${n}), rgba(255 255 255 / ${n}))`});function vAe(t){return{inputPlaceholder:t==="dark"?.5:.42,inputUnderline:t==="dark"?.7:.42,switchTrackDisabled:t==="dark"?.2:.12,switchTrack:t==="dark"?.3:.38}}function yAe(t){return t==="dark"?vnt:[]}function ynt(t){const{palette:e={mode:"light"},opacity:n,overlays:r,...i}=t,o=cee(e);return{palette:o,opacity:{...vAe(o.mode),...n},overlays:r||yAe(o.mode),...i}}function xnt(t){var e;return!!t[0].match(/(cssVarPrefix|colorSchemeSelector|rootSelector|typography|mixins|breakpoints|direction|transitions)/)||!!t[0].match(/sxConfig$/)||t[0]==="palette"&&!!((e=t[1])!=null&&e.match(/(mode|contrastThreshold|tonalOffset)/))}const bnt=t=>[...[...Array(25)].map((e,n)=>`--${t?`${t}-`:""}overlays-${n}`),`--${t?`${t}-`:""}palette-AppBar-darkBg`,`--${t?`${t}-`:""}palette-AppBar-darkColor`],wnt=t=>(e,n)=>{const r=t.rootSelector||":root",i=t.colorSchemeSelector;let o=i;if(i==="class"&&(o=".%s"),i==="data"&&(o="[data-%s]"),i!=null&&i.startsWith("data-")&&!i.includes("%s")&&(o=`[${i}="%s"]`),t.defaultColorScheme===e){if(e==="dark"){const s={};return bnt(t.cssVarPrefix).forEach(a=>{s[a]=n[a],delete n[a]}),o==="media"?{[r]:n,"@media (prefers-color-scheme: dark)":{[r]:s}}:o?{[o.replace("%s",e)]:s,[`${r}, ${o.replace("%s",e)}`]:n}:{[r]:{...n,...s}}}if(o&&o!=="media")return`${r}, ${o.replace("%s",String(e))}`}else if(e){if(o==="media")return{[`@media (prefers-color-scheme: ${String(e)})`]:{[r]:n}};if(o)return o.replace("%s",String(e))}return r};function _nt(t,e){e.forEach(n=>{t[n]||(t[n]={})})}function Ne(t,e,n){!t[e]&&n&&(t[e]=n)}function X2(t){return!t||!t.startsWith("hsl")?t:Jke(t)}function sp(t,e){`${e}Channel`in t||(t[`${e}Channel`]=q2(X2(t[e]),`MUI: Can't create \`palette.${e}Channel\` because \`palette.${e}\` is not one of these formats: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla(), color(). -To suppress this warning, you need to explicitly provide the \`palette.${e}Channel\` as a string (in rgb format, for example "12 12 12") or undefined if you want to remove the channel token.`))}function Snt(t){return typeof t=="number"?`${t}px`:typeof t=="string"||typeof t=="function"||Array.isArray(t)?t:"8px"}const pd=t=>{try{return t()}catch{}},Cnt=(t="mui")=>qtt(t);function Z8(t,e,n,r){if(!e)return;e=e===!0?{}:e;const i=r==="dark"?"dark":"light";if(!n){t[r]=ynt({...e,palette:{mode:i,...e==null?void 0:e.palette}});return}const{palette:o,...s}=NH({...n,palette:{mode:i,...e==null?void 0:e.palette}});return t[r]={...e,palette:o,opacity:{...vAe(i),...e==null?void 0:e.opacity},overlays:(e==null?void 0:e.overlays)||yAe(i)},s}function Ont(t={},...e){const{colorSchemes:n={light:!0},defaultColorScheme:r,disableCssColorScheme:i=!1,cssVarPrefix:o="mui",shouldSkipGeneratingVar:s=xnt,colorSchemeSelector:a=n.light&&n.dark?"media":void 0,rootSelector:l=":root",...c}=t,u=Object.keys(n)[0],f=r||(n.light&&u!=="light"?"light":u),d=Cnt(o),{[f]:h,light:p,dark:g,...m}=n,v={...m};let y=h;if((f==="dark"&&!("dark"in n)||f==="light"&&!("light"in n))&&(y=!0),!y)throw new Error(kg(21,f));const x=Z8(v,y,c,f);p&&!v.light&&Z8(v,p,void 0,"light"),g&&!v.dark&&Z8(v,g,void 0,"dark");let b={defaultColorScheme:f,...x,cssVarPrefix:o,colorSchemeSelector:a,rootSelector:l,getCssVar:d,colorSchemes:v,font:{...ont(x.typography),...x.font},spacing:Snt(c.spacing)};Object.keys(b.colorSchemes).forEach(k=>{const E=b.colorSchemes[k].palette,M=A=>{const P=A.split("-"),T=P[1],R=P[2];return d(A,E[T][R])};if(E.mode==="light"&&(Ne(E.common,"background","#fff"),Ne(E.common,"onBackground","#000")),E.mode==="dark"&&(Ne(E.common,"background","#000"),Ne(E.common,"onBackground","#fff")),_nt(E,["Alert","AppBar","Avatar","Button","Chip","FilledInput","LinearProgress","Skeleton","Slider","SnackbarContent","SpeedDialAction","StepConnector","StepContent","Switch","TableCell","Tooltip"]),E.mode==="light"){Ne(E.Alert,"errorColor",Pr(E.error.light,.6)),Ne(E.Alert,"infoColor",Pr(E.info.light,.6)),Ne(E.Alert,"successColor",Pr(E.success.light,.6)),Ne(E.Alert,"warningColor",Pr(E.warning.light,.6)),Ne(E.Alert,"errorFilledBg",M("palette-error-main")),Ne(E.Alert,"infoFilledBg",M("palette-info-main")),Ne(E.Alert,"successFilledBg",M("palette-success-main")),Ne(E.Alert,"warningFilledBg",M("palette-warning-main")),Ne(E.Alert,"errorFilledColor",pd(()=>E.getContrastText(E.error.main))),Ne(E.Alert,"infoFilledColor",pd(()=>E.getContrastText(E.info.main))),Ne(E.Alert,"successFilledColor",pd(()=>E.getContrastText(E.success.main))),Ne(E.Alert,"warningFilledColor",pd(()=>E.getContrastText(E.warning.main))),Ne(E.Alert,"errorStandardBg",Mr(E.error.light,.9)),Ne(E.Alert,"infoStandardBg",Mr(E.info.light,.9)),Ne(E.Alert,"successStandardBg",Mr(E.success.light,.9)),Ne(E.Alert,"warningStandardBg",Mr(E.warning.light,.9)),Ne(E.Alert,"errorIconColor",M("palette-error-main")),Ne(E.Alert,"infoIconColor",M("palette-info-main")),Ne(E.Alert,"successIconColor",M("palette-success-main")),Ne(E.Alert,"warningIconColor",M("palette-warning-main")),Ne(E.AppBar,"defaultBg",M("palette-grey-100")),Ne(E.Avatar,"defaultBg",M("palette-grey-400")),Ne(E.Button,"inheritContainedBg",M("palette-grey-300")),Ne(E.Button,"inheritContainedHoverBg",M("palette-grey-A100")),Ne(E.Chip,"defaultBorder",M("palette-grey-400")),Ne(E.Chip,"defaultAvatarColor",M("palette-grey-700")),Ne(E.Chip,"defaultIconColor",M("palette-grey-700")),Ne(E.FilledInput,"bg","rgba(0, 0, 0, 0.06)"),Ne(E.FilledInput,"hoverBg","rgba(0, 0, 0, 0.09)"),Ne(E.FilledInput,"disabledBg","rgba(0, 0, 0, 0.12)"),Ne(E.LinearProgress,"primaryBg",Mr(E.primary.main,.62)),Ne(E.LinearProgress,"secondaryBg",Mr(E.secondary.main,.62)),Ne(E.LinearProgress,"errorBg",Mr(E.error.main,.62)),Ne(E.LinearProgress,"infoBg",Mr(E.info.main,.62)),Ne(E.LinearProgress,"successBg",Mr(E.success.main,.62)),Ne(E.LinearProgress,"warningBg",Mr(E.warning.main,.62)),Ne(E.Skeleton,"bg",`rgba(${M("palette-text-primaryChannel")} / 0.11)`),Ne(E.Slider,"primaryTrack",Mr(E.primary.main,.62)),Ne(E.Slider,"secondaryTrack",Mr(E.secondary.main,.62)),Ne(E.Slider,"errorTrack",Mr(E.error.main,.62)),Ne(E.Slider,"infoTrack",Mr(E.info.main,.62)),Ne(E.Slider,"successTrack",Mr(E.success.main,.62)),Ne(E.Slider,"warningTrack",Mr(E.warning.main,.62));const A=QD(E.background.default,.8);Ne(E.SnackbarContent,"bg",A),Ne(E.SnackbarContent,"color",pd(()=>E.getContrastText(A))),Ne(E.SpeedDialAction,"fabHoverBg",QD(E.background.paper,.15)),Ne(E.StepConnector,"border",M("palette-grey-400")),Ne(E.StepContent,"border",M("palette-grey-400")),Ne(E.Switch,"defaultColor",M("palette-common-white")),Ne(E.Switch,"defaultDisabledColor",M("palette-grey-100")),Ne(E.Switch,"primaryDisabledColor",Mr(E.primary.main,.62)),Ne(E.Switch,"secondaryDisabledColor",Mr(E.secondary.main,.62)),Ne(E.Switch,"errorDisabledColor",Mr(E.error.main,.62)),Ne(E.Switch,"infoDisabledColor",Mr(E.info.main,.62)),Ne(E.Switch,"successDisabledColor",Mr(E.success.main,.62)),Ne(E.Switch,"warningDisabledColor",Mr(E.warning.main,.62)),Ne(E.TableCell,"border",Mr(YD(E.divider,1),.88)),Ne(E.Tooltip,"bg",YD(E.grey[700],.92))}if(E.mode==="dark"){Ne(E.Alert,"errorColor",Mr(E.error.light,.6)),Ne(E.Alert,"infoColor",Mr(E.info.light,.6)),Ne(E.Alert,"successColor",Mr(E.success.light,.6)),Ne(E.Alert,"warningColor",Mr(E.warning.light,.6)),Ne(E.Alert,"errorFilledBg",M("palette-error-dark")),Ne(E.Alert,"infoFilledBg",M("palette-info-dark")),Ne(E.Alert,"successFilledBg",M("palette-success-dark")),Ne(E.Alert,"warningFilledBg",M("palette-warning-dark")),Ne(E.Alert,"errorFilledColor",pd(()=>E.getContrastText(E.error.dark))),Ne(E.Alert,"infoFilledColor",pd(()=>E.getContrastText(E.info.dark))),Ne(E.Alert,"successFilledColor",pd(()=>E.getContrastText(E.success.dark))),Ne(E.Alert,"warningFilledColor",pd(()=>E.getContrastText(E.warning.dark))),Ne(E.Alert,"errorStandardBg",Pr(E.error.light,.9)),Ne(E.Alert,"infoStandardBg",Pr(E.info.light,.9)),Ne(E.Alert,"successStandardBg",Pr(E.success.light,.9)),Ne(E.Alert,"warningStandardBg",Pr(E.warning.light,.9)),Ne(E.Alert,"errorIconColor",M("palette-error-main")),Ne(E.Alert,"infoIconColor",M("palette-info-main")),Ne(E.Alert,"successIconColor",M("palette-success-main")),Ne(E.Alert,"warningIconColor",M("palette-warning-main")),Ne(E.AppBar,"defaultBg",M("palette-grey-900")),Ne(E.AppBar,"darkBg",M("palette-background-paper")),Ne(E.AppBar,"darkColor",M("palette-text-primary")),Ne(E.Avatar,"defaultBg",M("palette-grey-600")),Ne(E.Button,"inheritContainedBg",M("palette-grey-800")),Ne(E.Button,"inheritContainedHoverBg",M("palette-grey-700")),Ne(E.Chip,"defaultBorder",M("palette-grey-700")),Ne(E.Chip,"defaultAvatarColor",M("palette-grey-300")),Ne(E.Chip,"defaultIconColor",M("palette-grey-300")),Ne(E.FilledInput,"bg","rgba(255, 255, 255, 0.09)"),Ne(E.FilledInput,"hoverBg","rgba(255, 255, 255, 0.13)"),Ne(E.FilledInput,"disabledBg","rgba(255, 255, 255, 0.12)"),Ne(E.LinearProgress,"primaryBg",Pr(E.primary.main,.5)),Ne(E.LinearProgress,"secondaryBg",Pr(E.secondary.main,.5)),Ne(E.LinearProgress,"errorBg",Pr(E.error.main,.5)),Ne(E.LinearProgress,"infoBg",Pr(E.info.main,.5)),Ne(E.LinearProgress,"successBg",Pr(E.success.main,.5)),Ne(E.LinearProgress,"warningBg",Pr(E.warning.main,.5)),Ne(E.Skeleton,"bg",`rgba(${M("palette-text-primaryChannel")} / 0.13)`),Ne(E.Slider,"primaryTrack",Pr(E.primary.main,.5)),Ne(E.Slider,"secondaryTrack",Pr(E.secondary.main,.5)),Ne(E.Slider,"errorTrack",Pr(E.error.main,.5)),Ne(E.Slider,"infoTrack",Pr(E.info.main,.5)),Ne(E.Slider,"successTrack",Pr(E.success.main,.5)),Ne(E.Slider,"warningTrack",Pr(E.warning.main,.5));const A=QD(E.background.default,.98);Ne(E.SnackbarContent,"bg",A),Ne(E.SnackbarContent,"color",pd(()=>E.getContrastText(A))),Ne(E.SpeedDialAction,"fabHoverBg",QD(E.background.paper,.15)),Ne(E.StepConnector,"border",M("palette-grey-600")),Ne(E.StepContent,"border",M("palette-grey-600")),Ne(E.Switch,"defaultColor",M("palette-grey-300")),Ne(E.Switch,"defaultDisabledColor",M("palette-grey-600")),Ne(E.Switch,"primaryDisabledColor",Pr(E.primary.main,.55)),Ne(E.Switch,"secondaryDisabledColor",Pr(E.secondary.main,.55)),Ne(E.Switch,"errorDisabledColor",Pr(E.error.main,.55)),Ne(E.Switch,"infoDisabledColor",Pr(E.info.main,.55)),Ne(E.Switch,"successDisabledColor",Pr(E.success.main,.55)),Ne(E.Switch,"warningDisabledColor",Pr(E.warning.main,.55)),Ne(E.TableCell,"border",Pr(YD(E.divider,1),.68)),Ne(E.Tooltip,"bg",YD(E.grey[700],.92))}sp(E.background,"default"),sp(E.background,"paper"),sp(E.common,"background"),sp(E.common,"onBackground"),sp(E,"divider"),Object.keys(E).forEach(A=>{const P=E[A];P&&typeof P=="object"&&(P.main&&Ne(E[A],"mainChannel",q2(X2(P.main))),P.light&&Ne(E[A],"lightChannel",q2(X2(P.light))),P.dark&&Ne(E[A],"darkChannel",q2(X2(P.dark))),P.contrastText&&Ne(E[A],"contrastTextChannel",q2(X2(P.contrastText))),A==="text"&&(sp(E[A],"primary"),sp(E[A],"secondary")),A==="action"&&(P.active&&sp(E[A],"active"),P.selected&&sp(E[A],"selected")))})}),b=e.reduce((k,E)=>Bo(k,E),b);const w={prefix:o,disableCssColorScheme:i,shouldSkipGeneratingVar:s,getSelector:wnt(b)},{vars:_,generateThemeVars:S,generateStyleSheets:O}=Qtt(b,w);return b.vars=_,Object.entries(b.colorSchemes[b.defaultColorScheme]).forEach(([k,E])=>{b[k]=E}),b.generateThemeVars=S,b.generateStyleSheets=O,b.generateSpacing=function(){return Vke(c.spacing,tee(this))},b.getColorSchemeSelector=Ktt(a),b.spacing=b.generateSpacing(),b.shouldSkipGeneratingVar=s,b.unstable_sxConfig={...TM,...c==null?void 0:c.unstable_sxConfig},b.unstable_sx=function(E){return Qv({sx:E,theme:this})},b.toRuntimeSource=mAe,b}function Ufe(t,e,n){t.colorSchemes&&n&&(t.colorSchemes[e]={...n!==!0&&n,palette:cee({...n===!0?{}:n.palette,mode:e})})}function r4(t={},...e){const{palette:n,cssVariables:r=!1,colorSchemes:i=n?void 0:{light:!0},defaultColorScheme:o=n==null?void 0:n.mode,...s}=t,a=o||"light",l=i==null?void 0:i[a],c={...i,...n?{[a]:{...typeof l!="boolean"&&l,palette:n}}:void 0};if(r===!1){if(!("colorSchemes"in t))return NH(t,...e);let u=n;"palette"in t||c[a]&&(c[a]!==!0?u=c[a].palette:a==="dark"&&(u={mode:"dark"}));const f=NH({...t,palette:u},...e);return f.defaultColorScheme=a,f.colorSchemes=c,f.palette.mode==="light"&&(f.colorSchemes.light={...c.light!==!0&&c.light,palette:f.palette},Ufe(f,"dark",c.dark)),f.palette.mode==="dark"&&(f.colorSchemes.dark={...c.dark!==!0&&c.dark,palette:f.palette},Ufe(f,"light",c.light)),f}return!n&&!("light"in c)&&a==="light"&&(c.light=!0),Ont({...s,colorSchemes:c,defaultColorScheme:a,...typeof r!="boolean"&&r},...e)}const i4=r4();function Na(){const t=X1(i4);return t[Df]||t}function An({props:t,name:e}){return btt({props:t,name:e,defaultTheme:i4,themeId:Df})}function o4(t){return t!=="ownerState"&&t!=="theme"&&t!=="sx"&&t!=="as"}const qo=t=>o4(t)&&t!=="classes",be=Yke({themeId:Df,defaultTheme:i4,rootShouldForwardProp:qo});function Wfe({theme:t,...e}){const n=Df in t?t[Df]:void 0;return C.jsx(uAe,{...e,themeId:n?Df:void 0,theme:n||t})}const KD={attribute:"data-mui-color-scheme",colorSchemeStorageKey:"mui-color-scheme",defaultLightColorScheme:"light",defaultDarkColorScheme:"dark",modeStorageKey:"mui-mode"},{CssVarsProvider:Ent,useColorScheme:Xqn,getInitColorSchemeScript:Yqn}=Htt({themeId:Df,theme:()=>r4({cssVariables:!0}),colorSchemeStorageKey:KD.colorSchemeStorageKey,modeStorageKey:KD.modeStorageKey,defaultColorScheme:{light:KD.defaultLightColorScheme,dark:KD.defaultDarkColorScheme},resolveTheme:t=>{const e={...t,typography:pAe(t.palette,t.typography)};return e.unstable_sx=function(r){return Qv({sx:r,theme:this})},e}}),Tnt=Ent;function knt({theme:t,...e}){return typeof t=="function"?C.jsx(Wfe,{theme:t,...e}):"colorSchemes"in(Df in t?t[Df]:t)?C.jsx(Tnt,{theme:t,...e}):C.jsx(Wfe,{theme:t,...e})}function Ant(t){return C.jsx(ltt,{...t,defaultTheme:i4,themeId:Df})}function uee(t){return function(n){return C.jsx(Ant,{styles:typeof t=="function"?r=>t({theme:r,...n}):t})}}function Pnt(){return oee}const kt=jtt;function wt(t){return ztt(t)}function Mnt(t){return Ye("MuiSvgIcon",t)}qe("MuiSvgIcon",["root","colorPrimary","colorSecondary","colorAction","colorError","colorDisabled","fontSizeInherit","fontSizeSmall","fontSizeMedium","fontSizeLarge"]);const Rnt=t=>{const{color:e,fontSize:n,classes:r}=t,i={root:["root",e!=="inherit"&&`color${De(e)}`,`fontSize${De(n)}`]};return Xe(i,Mnt,r)},Dnt=be("svg",{name:"MuiSvgIcon",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,n.color!=="inherit"&&e[`color${De(n.color)}`],e[`fontSize${De(n.fontSize)}`]]}})(kt(({theme:t})=>{var e,n,r,i,o,s,a,l,c,u,f,d,h,p;return{userSelect:"none",width:"1em",height:"1em",display:"inline-block",flexShrink:0,transition:(i=(e=t.transitions)==null?void 0:e.create)==null?void 0:i.call(e,"fill",{duration:(r=(n=(t.vars??t).transitions)==null?void 0:n.duration)==null?void 0:r.shorter}),variants:[{props:g=>!g.hasSvgAsChild,style:{fill:"currentColor"}},{props:{fontSize:"inherit"},style:{fontSize:"inherit"}},{props:{fontSize:"small"},style:{fontSize:((s=(o=t.typography)==null?void 0:o.pxToRem)==null?void 0:s.call(o,20))||"1.25rem"}},{props:{fontSize:"medium"},style:{fontSize:((l=(a=t.typography)==null?void 0:a.pxToRem)==null?void 0:l.call(a,24))||"1.5rem"}},{props:{fontSize:"large"},style:{fontSize:((u=(c=t.typography)==null?void 0:c.pxToRem)==null?void 0:u.call(c,35))||"2.1875rem"}},...Object.entries((t.vars??t).palette).filter(([,g])=>g&&g.main).map(([g])=>{var m,v;return{props:{color:g},style:{color:(v=(m=(t.vars??t).palette)==null?void 0:m[g])==null?void 0:v.main}}}),{props:{color:"action"},style:{color:(d=(f=(t.vars??t).palette)==null?void 0:f.action)==null?void 0:d.active}},{props:{color:"disabled"},style:{color:(p=(h=(t.vars??t).palette)==null?void 0:h.action)==null?void 0:p.disabled}},{props:{color:"inherit"},style:{color:void 0}}]}})),PF=D.forwardRef(function(e,n){const r=wt({props:e,name:"MuiSvgIcon"}),{children:i,className:o,color:s="inherit",component:a="svg",fontSize:l="medium",htmlColor:c,inheritViewBox:u=!1,titleAccess:f,viewBox:d="0 0 24 24",...h}=r,p=D.isValidElement(i)&&i.type==="svg",g={...r,color:s,component:a,fontSize:l,instanceFontSize:e.fontSize,inheritViewBox:u,viewBox:d,hasSvgAsChild:p},m={};u||(m.viewBox=d);const v=Rnt(g);return C.jsxs(Dnt,{as:a,className:Oe(v.root,o),focusable:"false",color:c,"aria-hidden":f?void 0:!0,role:f?"img":void 0,ref:n,...m,...h,...p&&i.props,ownerState:g,children:[p?i.props.children:i,f?C.jsx("title",{children:f}):null]})});PF&&(PF.muiName="SvgIcon");function lt(t,e){function n(r,i){return C.jsx(PF,{"data-testid":`${e}Icon`,ref:i,...r,children:t})}return n.muiName=PF.muiName,D.memo(D.forwardRef(n))}var kr={};/** +export default theme;`}function JH(t={},...e){const{breakpoints:n,mixins:r={},spacing:i,palette:o={},transitions:s={},typography:a={},shape:l,...c}=t;if(t.vars)throw new Error(Og(20));const u=Oee(o),f=xee(t);let d=Bo(f,{mixins:Dnt(f.breakpoints,r),palette:u,shadows:Nnt.slice(),typography:BAe(u,a),transitions:Bnt(s),zIndex:{...Unt}});return d=Bo(d,c),d=e.reduce((h,p)=>Bo(h,p),d),d.unstable_sxConfig={...TM,...c==null?void 0:c.unstable_sxConfig},d.unstable_sx=function(p){return Yv({sx:p,theme:this})},d.toRuntimeSource=WAe,d}function eq(t){let e;return t<1?e=5.11916*t**2:e=4.5*Math.log(t+1)+2,Math.round(e*10)/1e3}const Vnt=[...Array(25)].map((t,e)=>{if(e===0)return"none";const n=eq(e);return`linear-gradient(rgba(255 255 255 / ${n}), rgba(255 255 255 / ${n}))`});function VAe(t){return{inputPlaceholder:t==="dark"?.5:.42,inputUnderline:t==="dark"?.7:.42,switchTrackDisabled:t==="dark"?.2:.12,switchTrack:t==="dark"?.3:.38}}function GAe(t){return t==="dark"?Vnt:[]}function Gnt(t){const{palette:e={mode:"light"},opacity:n,overlays:r,...i}=t,o=Oee(e);return{palette:o,opacity:{...VAe(o.mode),...n},overlays:r||GAe(o.mode),...i}}function Hnt(t){var e;return!!t[0].match(/(cssVarPrefix|colorSchemeSelector|rootSelector|typography|mixins|breakpoints|direction|transitions)/)||!!t[0].match(/sxConfig$/)||t[0]==="palette"&&!!((e=t[1])!=null&&e.match(/(mode|contrastThreshold|tonalOffset)/))}const qnt=t=>[...[...Array(25)].map((e,n)=>`--${t?`${t}-`:""}overlays-${n}`),`--${t?`${t}-`:""}palette-AppBar-darkBg`,`--${t?`${t}-`:""}palette-AppBar-darkColor`],Xnt=t=>(e,n)=>{const r=t.rootSelector||":root",i=t.colorSchemeSelector;let o=i;if(i==="class"&&(o=".%s"),i==="data"&&(o="[data-%s]"),i!=null&&i.startsWith("data-")&&!i.includes("%s")&&(o=`[${i}="%s"]`),t.defaultColorScheme===e){if(e==="dark"){const s={};return qnt(t.cssVarPrefix).forEach(a=>{s[a]=n[a],delete n[a]}),o==="media"?{[r]:n,"@media (prefers-color-scheme: dark)":{[r]:s}}:o?{[o.replace("%s",e)]:s,[`${r}, ${o.replace("%s",e)}`]:n}:{[r]:{...n,...s}}}if(o&&o!=="media")return`${r}, ${o.replace("%s",String(e))}`}else if(e){if(o==="media")return{[`@media (prefers-color-scheme: ${String(e)})`]:{[r]:n}};if(o)return o.replace("%s",String(e))}return r};function Ynt(t,e){e.forEach(n=>{t[n]||(t[n]={})})}function Ne(t,e,n){!t[e]&&n&&(t[e]=n)}function q2(t){return!t||!t.startsWith("hsl")?t:EAe(t)}function rp(t,e){`${e}Channel`in t||(t[`${e}Channel`]=H2(q2(t[e]),`MUI: Can't create \`palette.${e}Channel\` because \`palette.${e}\` is not one of these formats: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla(), color(). +To suppress this warning, you need to explicitly provide the \`palette.${e}Channel\` as a string (in rgb format, for example "12 12 12") or undefined if you want to remove the channel token.`))}function Qnt(t){return typeof t=="number"?`${t}px`:typeof t=="string"||typeof t=="function"||Array.isArray(t)?t:"8px"}const hd=t=>{try{return t()}catch{}},Knt=(t="mui")=>bnt(t);function Z8(t,e,n,r){if(!e)return;e=e===!0?{}:e;const i=r==="dark"?"dark":"light";if(!n){t[r]=Gnt({...e,palette:{mode:i,...e==null?void 0:e.palette}});return}const{palette:o,...s}=JH({...n,palette:{mode:i,...e==null?void 0:e.palette}});return t[r]={...e,palette:o,opacity:{...VAe(i),...e==null?void 0:e.opacity},overlays:(e==null?void 0:e.overlays)||GAe(i)},s}function Znt(t={},...e){const{colorSchemes:n={light:!0},defaultColorScheme:r,disableCssColorScheme:i=!1,cssVarPrefix:o="mui",shouldSkipGeneratingVar:s=Hnt,colorSchemeSelector:a=n.light&&n.dark?"media":void 0,rootSelector:l=":root",...c}=t,u=Object.keys(n)[0],f=r||(n.light&&u!=="light"?"light":u),d=Knt(o),{[f]:h,light:p,dark:g,...m}=n,v={...m};let y=h;if((f==="dark"&&!("dark"in n)||f==="light"&&!("light"in n))&&(y=!0),!y)throw new Error(Og(21,f));const x=Z8(v,y,c,f);p&&!v.light&&Z8(v,p,void 0,"light"),g&&!v.dark&&Z8(v,g,void 0,"dark");let b={defaultColorScheme:f,...x,cssVarPrefix:o,colorSchemeSelector:a,rootSelector:l,getCssVar:d,colorSchemes:v,font:{...Rnt(x.typography),...x.font},spacing:Qnt(c.spacing)};Object.keys(b.colorSchemes).forEach(k=>{const E=b.colorSchemes[k].palette,P=A=>{const R=A.split("-"),T=R[1],M=R[2];return d(A,E[T][M])};if(E.mode==="light"&&(Ne(E.common,"background","#fff"),Ne(E.common,"onBackground","#000")),E.mode==="dark"&&(Ne(E.common,"background","#000"),Ne(E.common,"onBackground","#fff")),Ynt(E,["Alert","AppBar","Avatar","Button","Chip","FilledInput","LinearProgress","Skeleton","Slider","SnackbarContent","SpeedDialAction","StepConnector","StepContent","Switch","TableCell","Tooltip"]),E.mode==="light"){Ne(E.Alert,"errorColor",Pr(E.error.light,.6)),Ne(E.Alert,"infoColor",Pr(E.info.light,.6)),Ne(E.Alert,"successColor",Pr(E.success.light,.6)),Ne(E.Alert,"warningColor",Pr(E.warning.light,.6)),Ne(E.Alert,"errorFilledBg",P("palette-error-main")),Ne(E.Alert,"infoFilledBg",P("palette-info-main")),Ne(E.Alert,"successFilledBg",P("palette-success-main")),Ne(E.Alert,"warningFilledBg",P("palette-warning-main")),Ne(E.Alert,"errorFilledColor",hd(()=>E.getContrastText(E.error.main))),Ne(E.Alert,"infoFilledColor",hd(()=>E.getContrastText(E.info.main))),Ne(E.Alert,"successFilledColor",hd(()=>E.getContrastText(E.success.main))),Ne(E.Alert,"warningFilledColor",hd(()=>E.getContrastText(E.warning.main))),Ne(E.Alert,"errorStandardBg",Mr(E.error.light,.9)),Ne(E.Alert,"infoStandardBg",Mr(E.info.light,.9)),Ne(E.Alert,"successStandardBg",Mr(E.success.light,.9)),Ne(E.Alert,"warningStandardBg",Mr(E.warning.light,.9)),Ne(E.Alert,"errorIconColor",P("palette-error-main")),Ne(E.Alert,"infoIconColor",P("palette-info-main")),Ne(E.Alert,"successIconColor",P("palette-success-main")),Ne(E.Alert,"warningIconColor",P("palette-warning-main")),Ne(E.AppBar,"defaultBg",P("palette-grey-100")),Ne(E.Avatar,"defaultBg",P("palette-grey-400")),Ne(E.Button,"inheritContainedBg",P("palette-grey-300")),Ne(E.Button,"inheritContainedHoverBg",P("palette-grey-A100")),Ne(E.Chip,"defaultBorder",P("palette-grey-400")),Ne(E.Chip,"defaultAvatarColor",P("palette-grey-700")),Ne(E.Chip,"defaultIconColor",P("palette-grey-700")),Ne(E.FilledInput,"bg","rgba(0, 0, 0, 0.06)"),Ne(E.FilledInput,"hoverBg","rgba(0, 0, 0, 0.09)"),Ne(E.FilledInput,"disabledBg","rgba(0, 0, 0, 0.12)"),Ne(E.LinearProgress,"primaryBg",Mr(E.primary.main,.62)),Ne(E.LinearProgress,"secondaryBg",Mr(E.secondary.main,.62)),Ne(E.LinearProgress,"errorBg",Mr(E.error.main,.62)),Ne(E.LinearProgress,"infoBg",Mr(E.info.main,.62)),Ne(E.LinearProgress,"successBg",Mr(E.success.main,.62)),Ne(E.LinearProgress,"warningBg",Mr(E.warning.main,.62)),Ne(E.Skeleton,"bg",`rgba(${P("palette-text-primaryChannel")} / 0.11)`),Ne(E.Slider,"primaryTrack",Mr(E.primary.main,.62)),Ne(E.Slider,"secondaryTrack",Mr(E.secondary.main,.62)),Ne(E.Slider,"errorTrack",Mr(E.error.main,.62)),Ne(E.Slider,"infoTrack",Mr(E.info.main,.62)),Ne(E.Slider,"successTrack",Mr(E.success.main,.62)),Ne(E.Slider,"warningTrack",Mr(E.warning.main,.62));const A=qD(E.background.default,.8);Ne(E.SnackbarContent,"bg",A),Ne(E.SnackbarContent,"color",hd(()=>E.getContrastText(A))),Ne(E.SpeedDialAction,"fabHoverBg",qD(E.background.paper,.15)),Ne(E.StepConnector,"border",P("palette-grey-400")),Ne(E.StepContent,"border",P("palette-grey-400")),Ne(E.Switch,"defaultColor",P("palette-common-white")),Ne(E.Switch,"defaultDisabledColor",P("palette-grey-100")),Ne(E.Switch,"primaryDisabledColor",Mr(E.primary.main,.62)),Ne(E.Switch,"secondaryDisabledColor",Mr(E.secondary.main,.62)),Ne(E.Switch,"errorDisabledColor",Mr(E.error.main,.62)),Ne(E.Switch,"infoDisabledColor",Mr(E.info.main,.62)),Ne(E.Switch,"successDisabledColor",Mr(E.success.main,.62)),Ne(E.Switch,"warningDisabledColor",Mr(E.warning.main,.62)),Ne(E.TableCell,"border",Mr(HD(E.divider,1),.88)),Ne(E.Tooltip,"bg",HD(E.grey[700],.92))}if(E.mode==="dark"){Ne(E.Alert,"errorColor",Mr(E.error.light,.6)),Ne(E.Alert,"infoColor",Mr(E.info.light,.6)),Ne(E.Alert,"successColor",Mr(E.success.light,.6)),Ne(E.Alert,"warningColor",Mr(E.warning.light,.6)),Ne(E.Alert,"errorFilledBg",P("palette-error-dark")),Ne(E.Alert,"infoFilledBg",P("palette-info-dark")),Ne(E.Alert,"successFilledBg",P("palette-success-dark")),Ne(E.Alert,"warningFilledBg",P("palette-warning-dark")),Ne(E.Alert,"errorFilledColor",hd(()=>E.getContrastText(E.error.dark))),Ne(E.Alert,"infoFilledColor",hd(()=>E.getContrastText(E.info.dark))),Ne(E.Alert,"successFilledColor",hd(()=>E.getContrastText(E.success.dark))),Ne(E.Alert,"warningFilledColor",hd(()=>E.getContrastText(E.warning.dark))),Ne(E.Alert,"errorStandardBg",Pr(E.error.light,.9)),Ne(E.Alert,"infoStandardBg",Pr(E.info.light,.9)),Ne(E.Alert,"successStandardBg",Pr(E.success.light,.9)),Ne(E.Alert,"warningStandardBg",Pr(E.warning.light,.9)),Ne(E.Alert,"errorIconColor",P("palette-error-main")),Ne(E.Alert,"infoIconColor",P("palette-info-main")),Ne(E.Alert,"successIconColor",P("palette-success-main")),Ne(E.Alert,"warningIconColor",P("palette-warning-main")),Ne(E.AppBar,"defaultBg",P("palette-grey-900")),Ne(E.AppBar,"darkBg",P("palette-background-paper")),Ne(E.AppBar,"darkColor",P("palette-text-primary")),Ne(E.Avatar,"defaultBg",P("palette-grey-600")),Ne(E.Button,"inheritContainedBg",P("palette-grey-800")),Ne(E.Button,"inheritContainedHoverBg",P("palette-grey-700")),Ne(E.Chip,"defaultBorder",P("palette-grey-700")),Ne(E.Chip,"defaultAvatarColor",P("palette-grey-300")),Ne(E.Chip,"defaultIconColor",P("palette-grey-300")),Ne(E.FilledInput,"bg","rgba(255, 255, 255, 0.09)"),Ne(E.FilledInput,"hoverBg","rgba(255, 255, 255, 0.13)"),Ne(E.FilledInput,"disabledBg","rgba(255, 255, 255, 0.12)"),Ne(E.LinearProgress,"primaryBg",Pr(E.primary.main,.5)),Ne(E.LinearProgress,"secondaryBg",Pr(E.secondary.main,.5)),Ne(E.LinearProgress,"errorBg",Pr(E.error.main,.5)),Ne(E.LinearProgress,"infoBg",Pr(E.info.main,.5)),Ne(E.LinearProgress,"successBg",Pr(E.success.main,.5)),Ne(E.LinearProgress,"warningBg",Pr(E.warning.main,.5)),Ne(E.Skeleton,"bg",`rgba(${P("palette-text-primaryChannel")} / 0.13)`),Ne(E.Slider,"primaryTrack",Pr(E.primary.main,.5)),Ne(E.Slider,"secondaryTrack",Pr(E.secondary.main,.5)),Ne(E.Slider,"errorTrack",Pr(E.error.main,.5)),Ne(E.Slider,"infoTrack",Pr(E.info.main,.5)),Ne(E.Slider,"successTrack",Pr(E.success.main,.5)),Ne(E.Slider,"warningTrack",Pr(E.warning.main,.5));const A=qD(E.background.default,.98);Ne(E.SnackbarContent,"bg",A),Ne(E.SnackbarContent,"color",hd(()=>E.getContrastText(A))),Ne(E.SpeedDialAction,"fabHoverBg",qD(E.background.paper,.15)),Ne(E.StepConnector,"border",P("palette-grey-600")),Ne(E.StepContent,"border",P("palette-grey-600")),Ne(E.Switch,"defaultColor",P("palette-grey-300")),Ne(E.Switch,"defaultDisabledColor",P("palette-grey-600")),Ne(E.Switch,"primaryDisabledColor",Pr(E.primary.main,.55)),Ne(E.Switch,"secondaryDisabledColor",Pr(E.secondary.main,.55)),Ne(E.Switch,"errorDisabledColor",Pr(E.error.main,.55)),Ne(E.Switch,"infoDisabledColor",Pr(E.info.main,.55)),Ne(E.Switch,"successDisabledColor",Pr(E.success.main,.55)),Ne(E.Switch,"warningDisabledColor",Pr(E.warning.main,.55)),Ne(E.TableCell,"border",Pr(HD(E.divider,1),.68)),Ne(E.Tooltip,"bg",HD(E.grey[700],.92))}rp(E.background,"default"),rp(E.background,"paper"),rp(E.common,"background"),rp(E.common,"onBackground"),rp(E,"divider"),Object.keys(E).forEach(A=>{const R=E[A];R&&typeof R=="object"&&(R.main&&Ne(E[A],"mainChannel",H2(q2(R.main))),R.light&&Ne(E[A],"lightChannel",H2(q2(R.light))),R.dark&&Ne(E[A],"darkChannel",H2(q2(R.dark))),R.contrastText&&Ne(E[A],"contrastTextChannel",H2(q2(R.contrastText))),A==="text"&&(rp(E[A],"primary"),rp(E[A],"secondary")),A==="action"&&(R.active&&rp(E[A],"active"),R.selected&&rp(E[A],"selected")))})}),b=e.reduce((k,E)=>Bo(k,E),b);const w={prefix:o,disableCssColorScheme:i,shouldSkipGeneratingVar:s,getSelector:Xnt(b)},{vars:_,generateThemeVars:S,generateStyleSheets:O}=Snt(b,w);return b.vars=_,Object.entries(b.colorSchemes[b.defaultColorScheme]).forEach(([k,E])=>{b[k]=E}),b.generateThemeVars=S,b.generateStyleSheets=O,b.generateSpacing=function(){return vAe(c.spacing,vee(this))},b.getColorSchemeSelector=Cnt(a),b.spacing=b.generateSpacing(),b.shouldSkipGeneratingVar=s,b.unstable_sxConfig={...TM,...c==null?void 0:c.unstable_sxConfig},b.unstable_sx=function(E){return Yv({sx:E,theme:this})},b.toRuntimeSource=WAe,b}function sde(t,e,n){t.colorSchemes&&n&&(t.colorSchemes[e]={...n!==!0&&n,palette:Oee({...n===!0?{}:n.palette,mode:e})})}function Jj(t={},...e){const{palette:n,cssVariables:r=!1,colorSchemes:i=n?void 0:{light:!0},defaultColorScheme:o=n==null?void 0:n.mode,...s}=t,a=o||"light",l=i==null?void 0:i[a],c={...i,...n?{[a]:{...typeof l!="boolean"&&l,palette:n}}:void 0};if(r===!1){if(!("colorSchemes"in t))return JH(t,...e);let u=n;"palette"in t||c[a]&&(c[a]!==!0?u=c[a].palette:a==="dark"&&(u={mode:"dark"}));const f=JH({...t,palette:u},...e);return f.defaultColorScheme=a,f.colorSchemes=c,f.palette.mode==="light"&&(f.colorSchemes.light={...c.light!==!0&&c.light,palette:f.palette},sde(f,"dark",c.dark)),f.palette.mode==="dark"&&(f.colorSchemes.dark={...c.dark!==!0&&c.dark,palette:f.palette},sde(f,"light",c.light)),f}return!n&&!("light"in c)&&a==="light"&&(c.light=!0),Znt({...s,colorSchemes:c,defaultColorScheme:a,...typeof r!="boolean"&&r},...e)}const e4=Jj();function $a(){const t=Xb(e4);return t[Df]||t}function kn({props:t,name:e}){return qtt({props:t,name:e,defaultTheme:e4,themeId:Df})}function t4(t){return t!=="ownerState"&&t!=="theme"&&t!=="sx"&&t!=="as"}const qo=t=>t4(t)&&t!=="classes",be=_Ae({themeId:Df,defaultTheme:e4,rootShouldForwardProp:qo});function ade({theme:t,...e}){const n=Df in t?t[Df]:void 0;return C.jsx(FAe,{...e,themeId:n?Df:void 0,theme:n||t})}const XD={attribute:"data-mui-color-scheme",colorSchemeStorageKey:"mui-color-scheme",defaultLightColorScheme:"light",defaultDarkColorScheme:"dark",modeStorageKey:"mui-mode"},{CssVarsProvider:Jnt,useColorScheme:Wqn,getInitColorSchemeScript:Vqn}=xnt({themeId:Df,theme:()=>Jj({cssVariables:!0}),colorSchemeStorageKey:XD.colorSchemeStorageKey,modeStorageKey:XD.modeStorageKey,defaultColorScheme:{light:XD.defaultLightColorScheme,dark:XD.defaultDarkColorScheme},resolveTheme:t=>{const e={...t,typography:BAe(t.palette,t.typography)};return e.unstable_sx=function(r){return Yv({sx:r,theme:this})},e}}),ert=Jnt;function trt({theme:t,...e}){return typeof t=="function"?C.jsx(ade,{theme:t,...e}):"colorSchemes"in(Df in t?t[Df]:t)?C.jsx(ert,{theme:t,...e}):C.jsx(ade,{theme:t,...e})}function nrt(t){return C.jsx(Ltt,{...t,defaultTheme:e4,themeId:Df})}function Eee(t){return function(n){return C.jsx(nrt,{styles:typeof t=="function"?r=>t({theme:r,...n}):t})}}function rrt(){return wee}const Tt=hnt;function wt(t){return dnt(t)}function irt(t){return Ye("MuiSvgIcon",t)}He("MuiSvgIcon",["root","colorPrimary","colorSecondary","colorAction","colorError","colorDisabled","fontSizeInherit","fontSizeSmall","fontSizeMedium","fontSizeLarge"]);const ort=t=>{const{color:e,fontSize:n,classes:r}=t,i={root:["root",e!=="inherit"&&`color${Re(e)}`,`fontSize${Re(n)}`]};return qe(i,irt,r)},srt=be("svg",{name:"MuiSvgIcon",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,n.color!=="inherit"&&e[`color${Re(n.color)}`],e[`fontSize${Re(n.fontSize)}`]]}})(Tt(({theme:t})=>{var e,n,r,i,o,s,a,l,c,u,f,d,h,p;return{userSelect:"none",width:"1em",height:"1em",display:"inline-block",flexShrink:0,transition:(i=(e=t.transitions)==null?void 0:e.create)==null?void 0:i.call(e,"fill",{duration:(r=(n=(t.vars??t).transitions)==null?void 0:n.duration)==null?void 0:r.shorter}),variants:[{props:g=>!g.hasSvgAsChild,style:{fill:"currentColor"}},{props:{fontSize:"inherit"},style:{fontSize:"inherit"}},{props:{fontSize:"small"},style:{fontSize:((s=(o=t.typography)==null?void 0:o.pxToRem)==null?void 0:s.call(o,20))||"1.25rem"}},{props:{fontSize:"medium"},style:{fontSize:((l=(a=t.typography)==null?void 0:a.pxToRem)==null?void 0:l.call(a,24))||"1.5rem"}},{props:{fontSize:"large"},style:{fontSize:((u=(c=t.typography)==null?void 0:c.pxToRem)==null?void 0:u.call(c,35))||"2.1875rem"}},...Object.entries((t.vars??t).palette).filter(([,g])=>g&&g.main).map(([g])=>{var m,v;return{props:{color:g},style:{color:(v=(m=(t.vars??t).palette)==null?void 0:m[g])==null?void 0:v.main}}}),{props:{color:"action"},style:{color:(d=(f=(t.vars??t).palette)==null?void 0:f.action)==null?void 0:d.active}},{props:{color:"disabled"},style:{color:(p=(h=(t.vars??t).palette)==null?void 0:h.action)==null?void 0:p.disabled}},{props:{color:"inherit"},style:{color:void 0}}]}})),EF=D.forwardRef(function(e,n){const r=wt({props:e,name:"MuiSvgIcon"}),{children:i,className:o,color:s="inherit",component:a="svg",fontSize:l="medium",htmlColor:c,inheritViewBox:u=!1,titleAccess:f,viewBox:d="0 0 24 24",...h}=r,p=D.isValidElement(i)&&i.type==="svg",g={...r,color:s,component:a,fontSize:l,instanceFontSize:e.fontSize,inheritViewBox:u,viewBox:d,hasSvgAsChild:p},m={};u||(m.viewBox=d);const v=ort(g);return C.jsxs(srt,{as:a,className:Oe(v.root,o),focusable:"false",color:c,"aria-hidden":f?void 0:!0,role:f?"img":void 0,ref:n,...m,...h,...p&&i.props,ownerState:g,children:[p?i.props.children:i,f?C.jsx("title",{children:f}):null]})});EF&&(EF.muiName="SvgIcon");function ct(t,e){function n(r,i){return C.jsx(EF,{"data-testid":`${e}Icon`,ref:i,...r,children:t})}return n.muiName=EF.muiName,D.memo(D.forwardRef(n))}var kr={};/** * @license React * react-is.production.min.js * @@ -123,7 +123,7 @@ To suppress this warning, you need to explicitly provide the \`palette.${e}Chann * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var fee=Symbol.for("react.element"),dee=Symbol.for("react.portal"),s4=Symbol.for("react.fragment"),a4=Symbol.for("react.strict_mode"),l4=Symbol.for("react.profiler"),c4=Symbol.for("react.provider"),u4=Symbol.for("react.context"),Int=Symbol.for("react.server_context"),f4=Symbol.for("react.forward_ref"),d4=Symbol.for("react.suspense"),h4=Symbol.for("react.suspense_list"),p4=Symbol.for("react.memo"),g4=Symbol.for("react.lazy"),Lnt=Symbol.for("react.offscreen"),xAe;xAe=Symbol.for("react.module.reference");function Fu(t){if(typeof t=="object"&&t!==null){var e=t.$$typeof;switch(e){case fee:switch(t=t.type,t){case s4:case l4:case a4:case d4:case h4:return t;default:switch(t=t&&t.$$typeof,t){case Int:case u4:case f4:case g4:case p4:case c4:return t;default:return e}}case dee:return e}}}kr.ContextConsumer=u4;kr.ContextProvider=c4;kr.Element=fee;kr.ForwardRef=f4;kr.Fragment=s4;kr.Lazy=g4;kr.Memo=p4;kr.Portal=dee;kr.Profiler=l4;kr.StrictMode=a4;kr.Suspense=d4;kr.SuspenseList=h4;kr.isAsyncMode=function(){return!1};kr.isConcurrentMode=function(){return!1};kr.isContextConsumer=function(t){return Fu(t)===u4};kr.isContextProvider=function(t){return Fu(t)===c4};kr.isElement=function(t){return typeof t=="object"&&t!==null&&t.$$typeof===fee};kr.isForwardRef=function(t){return Fu(t)===f4};kr.isFragment=function(t){return Fu(t)===s4};kr.isLazy=function(t){return Fu(t)===g4};kr.isMemo=function(t){return Fu(t)===p4};kr.isPortal=function(t){return Fu(t)===dee};kr.isProfiler=function(t){return Fu(t)===l4};kr.isStrictMode=function(t){return Fu(t)===a4};kr.isSuspense=function(t){return Fu(t)===d4};kr.isSuspenseList=function(t){return Fu(t)===h4};kr.isValidElementType=function(t){return typeof t=="string"||typeof t=="function"||t===s4||t===l4||t===a4||t===d4||t===h4||t===Lnt||typeof t=="object"&&t!==null&&(t.$$typeof===g4||t.$$typeof===p4||t.$$typeof===c4||t.$$typeof===u4||t.$$typeof===f4||t.$$typeof===xAe||t.getModuleId!==void 0)};kr.typeOf=Fu;function MF(t,e){return MF=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,r){return n.__proto__=r,n},MF(t,e)}function AM(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,MF(t,e)}function $nt(t,e){return t.classList?!!e&&t.classList.contains(e):(" "+(t.className.baseVal||t.className)+" ").indexOf(" "+e+" ")!==-1}function Fnt(t,e){t.classList?t.classList.add(e):$nt(t,e)||(typeof t.className=="string"?t.className=t.className+" "+e:t.setAttribute("class",(t.className&&t.className.baseVal||"")+" "+e))}function Vfe(t,e){return t.replace(new RegExp("(^|\\s)"+e+"(?:\\s|$)","g"),"$1").replace(/\s+/g," ").replace(/^\s*|\s*$/g,"")}function Nnt(t,e){t.classList?t.classList.remove(e):typeof t.className=="string"?t.className=Vfe(t.className,e):t.setAttribute("class",Vfe(t.className&&t.className.baseVal||"",e))}const Gfe={disabled:!1},RF=de.createContext(null);var bAe=function(e){return e.scrollTop},Y2="unmounted",$0="exited",F0="entering",Mw="entered",jH="exiting",Dc=function(t){AM(e,t);function e(r,i){var o;o=t.call(this,r,i)||this;var s=i,a=s&&!s.isMounting?r.enter:r.appear,l;return o.appearStatus=null,r.in?a?(l=$0,o.appearStatus=F0):l=Mw:r.unmountOnExit||r.mountOnEnter?l=Y2:l=$0,o.state={status:l},o.nextCallback=null,o}e.getDerivedStateFromProps=function(i,o){var s=i.in;return s&&o.status===Y2?{status:$0}:null};var n=e.prototype;return n.componentDidMount=function(){this.updateStatus(!0,this.appearStatus)},n.componentDidUpdate=function(i){var o=null;if(i!==this.props){var s=this.state.status;this.props.in?s!==F0&&s!==Mw&&(o=F0):(s===F0||s===Mw)&&(o=jH)}this.updateStatus(!1,o)},n.componentWillUnmount=function(){this.cancelNextCallback()},n.getTimeouts=function(){var i=this.props.timeout,o,s,a;return o=s=a=i,i!=null&&typeof i!="number"&&(o=i.exit,s=i.enter,a=i.appear!==void 0?i.appear:s),{exit:o,enter:s,appear:a}},n.updateStatus=function(i,o){if(i===void 0&&(i=!1),o!==null)if(this.cancelNextCallback(),o===F0){if(this.props.unmountOnExit||this.props.mountOnEnter){var s=this.props.nodeRef?this.props.nodeRef.current:qD.findDOMNode(this);s&&bAe(s)}this.performEnter(i)}else this.performExit();else this.props.unmountOnExit&&this.state.status===$0&&this.setState({status:Y2})},n.performEnter=function(i){var o=this,s=this.props.enter,a=this.context?this.context.isMounting:i,l=this.props.nodeRef?[a]:[qD.findDOMNode(this),a],c=l[0],u=l[1],f=this.getTimeouts(),d=a?f.appear:f.enter;if(!i&&!s||Gfe.disabled){this.safeSetState({status:Mw},function(){o.props.onEntered(c)});return}this.props.onEnter(c,u),this.safeSetState({status:F0},function(){o.props.onEntering(c,u),o.onTransitionEnd(d,function(){o.safeSetState({status:Mw},function(){o.props.onEntered(c,u)})})})},n.performExit=function(){var i=this,o=this.props.exit,s=this.getTimeouts(),a=this.props.nodeRef?void 0:qD.findDOMNode(this);if(!o||Gfe.disabled){this.safeSetState({status:$0},function(){i.props.onExited(a)});return}this.props.onExit(a),this.safeSetState({status:jH},function(){i.props.onExiting(a),i.onTransitionEnd(s.exit,function(){i.safeSetState({status:$0},function(){i.props.onExited(a)})})})},n.cancelNextCallback=function(){this.nextCallback!==null&&(this.nextCallback.cancel(),this.nextCallback=null)},n.safeSetState=function(i,o){o=this.setNextCallback(o),this.setState(i,o)},n.setNextCallback=function(i){var o=this,s=!0;return this.nextCallback=function(a){s&&(s=!1,o.nextCallback=null,i(a))},this.nextCallback.cancel=function(){s=!1},this.nextCallback},n.onTransitionEnd=function(i,o){this.setNextCallback(o);var s=this.props.nodeRef?this.props.nodeRef.current:qD.findDOMNode(this),a=i==null&&!this.props.addEndListener;if(!s||a){setTimeout(this.nextCallback,0);return}if(this.props.addEndListener){var l=this.props.nodeRef?[this.nextCallback]:[s,this.nextCallback],c=l[0],u=l[1];this.props.addEndListener(c,u)}i!=null&&setTimeout(this.nextCallback,i)},n.render=function(){var i=this.state.status;if(i===Y2)return null;var o=this.props,s=o.children;o.in,o.mountOnEnter,o.unmountOnExit,o.appear,o.enter,o.exit,o.timeout,o.addEndListener,o.onEnter,o.onEntering,o.onEntered,o.onExit,o.onExiting,o.onExited,o.nodeRef;var a=Dt(o,["children","in","mountOnEnter","unmountOnExit","appear","enter","exit","timeout","addEndListener","onEnter","onEntering","onEntered","onExit","onExiting","onExited","nodeRef"]);return de.createElement(RF.Provider,{value:null},typeof s=="function"?s(i,a):de.cloneElement(de.Children.only(s),a))},e}(de.Component);Dc.contextType=RF;Dc.propTypes={};function Fb(){}Dc.defaultProps={in:!1,mountOnEnter:!1,unmountOnExit:!1,appear:!1,enter:!0,exit:!0,onEnter:Fb,onEntering:Fb,onEntered:Fb,onExit:Fb,onExiting:Fb,onExited:Fb};Dc.UNMOUNTED=Y2;Dc.EXITED=$0;Dc.ENTERING=F0;Dc.ENTERED=Mw;Dc.EXITING=jH;var znt=function(e,n){return e&&n&&n.split(" ").forEach(function(r){return Fnt(e,r)})},J8=function(e,n){return e&&n&&n.split(" ").forEach(function(r){return Nnt(e,r)})},hee=function(t){AM(e,t);function e(){for(var r,i=arguments.length,o=new Array(i),s=0;st.scrollTop;function Jv(t,e){const{timeout:n,easing:r,style:i={}}=t;return{duration:i.transitionDuration??(typeof n=="number"?n:n[e.mode]||0),easing:i.transitionTimingFunction??(typeof r=="object"?r[e.mode]:r),delay:i.transitionDelay}}function Gnt(t){return Ye("MuiCollapse",t)}qe("MuiCollapse",["root","horizontal","vertical","entered","hidden","wrapper","wrapperInner"]);const Hnt=t=>{const{orientation:e,classes:n}=t,r={root:["root",`${e}`],entered:["entered"],hidden:["hidden"],wrapper:["wrapper",`${e}`],wrapperInner:["wrapperInner",`${e}`]};return Xe(r,Gnt,n)},qnt=be("div",{name:"MuiCollapse",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,e[n.orientation],n.state==="entered"&&e.entered,n.state==="exited"&&!n.in&&n.collapsedSize==="0px"&&e.hidden]}})(kt(({theme:t})=>({height:0,overflow:"hidden",transition:t.transitions.create("height"),variants:[{props:{orientation:"horizontal"},style:{height:"auto",width:0,transition:t.transitions.create("width")}},{props:{state:"entered"},style:{height:"auto",overflow:"visible"}},{props:{state:"entered",orientation:"horizontal"},style:{width:"auto"}},{props:({ownerState:e})=>e.state==="exited"&&!e.in&&e.collapsedSize==="0px",style:{visibility:"hidden"}}]}))),Xnt=be("div",{name:"MuiCollapse",slot:"Wrapper",overridesResolver:(t,e)=>e.wrapper})({display:"flex",width:"100%",variants:[{props:{orientation:"horizontal"},style:{width:"auto",height:"100%"}}]}),Ynt=be("div",{name:"MuiCollapse",slot:"WrapperInner",overridesResolver:(t,e)=>e.wrapperInner})({width:"100%",variants:[{props:{orientation:"horizontal"},style:{width:"auto",height:"100%"}}]}),DF=D.forwardRef(function(e,n){const r=wt({props:e,name:"MuiCollapse"}),{addEndListener:i,children:o,className:s,collapsedSize:a="0px",component:l,easing:c,in:u,onEnter:f,onEntered:d,onEntering:h,onExit:p,onExited:g,onExiting:m,orientation:v="vertical",style:y,timeout:x=gAe.standard,TransitionComponent:b=Dc,...w}=r,_={...r,orientation:v,collapsedSize:a},S=Hnt(_),O=Na(),k=cv(),E=D.useRef(null),M=D.useRef(),A=typeof a=="number"?`${a}px`:a,P=v==="horizontal",T=P?"width":"height",R=D.useRef(null),I=dn(n,R),B=Y=>le=>{if(Y){const K=R.current;le===void 0?Y(K):Y(K,le)}},$=()=>E.current?E.current[P?"clientWidth":"clientHeight"]:0,z=B((Y,le)=>{E.current&&P&&(E.current.style.position="absolute"),Y.style[T]=A,f&&f(Y,le)}),L=B((Y,le)=>{const K=$();E.current&&P&&(E.current.style.position="");const{duration:ee,easing:re}=Jv({style:y,timeout:x,easing:c},{mode:"enter"});if(x==="auto"){const me=O.transitions.getAutoHeightDuration(K);Y.style.transitionDuration=`${me}ms`,M.current=me}else Y.style.transitionDuration=typeof ee=="string"?ee:`${ee}ms`;Y.style[T]=`${K}px`,Y.style.transitionTimingFunction=re,h&&h(Y,le)}),j=B((Y,le)=>{Y.style[T]="auto",d&&d(Y,le)}),N=B(Y=>{Y.style[T]=`${$()}px`,p&&p(Y)}),F=B(g),H=B(Y=>{const le=$(),{duration:K,easing:ee}=Jv({style:y,timeout:x,easing:c},{mode:"exit"});if(x==="auto"){const re=O.transitions.getAutoHeightDuration(le);Y.style.transitionDuration=`${re}ms`,M.current=re}else Y.style.transitionDuration=typeof K=="string"?K:`${K}ms`;Y.style[T]=A,Y.style.transitionTimingFunction=ee,m&&m(Y)}),q=Y=>{x==="auto"&&k.start(M.current||0,Y),i&&i(R.current,Y)};return C.jsx(b,{in:u,onEnter:z,onEntered:j,onEntering:L,onExit:N,onExited:F,onExiting:H,addEndListener:q,nodeRef:R,timeout:x==="auto"?null:x,...w,children:(Y,le)=>C.jsx(qnt,{as:l,className:Oe(S.root,s,{entered:S.entered,exited:!u&&A==="0px"&&S.hidden}[Y]),style:{[P?"minWidth":"minHeight"]:A,...y},ref:I,...le,ownerState:{..._,state:Y},children:C.jsx(Xnt,{ownerState:{..._,state:Y},className:S.wrapper,ref:E,children:C.jsx(Ynt,{ownerState:{..._,state:Y},className:S.wrapperInner,children:o})})})})});DF&&(DF.muiSupportAuto=!0);function Qnt(t){return Ye("MuiPaper",t)}qe("MuiPaper",["root","rounded","outlined","elevation","elevation0","elevation1","elevation2","elevation3","elevation4","elevation5","elevation6","elevation7","elevation8","elevation9","elevation10","elevation11","elevation12","elevation13","elevation14","elevation15","elevation16","elevation17","elevation18","elevation19","elevation20","elevation21","elevation22","elevation23","elevation24"]);const Knt=t=>{const{square:e,elevation:n,variant:r,classes:i}=t,o={root:["root",r,!e&&"rounded",r==="elevation"&&`elevation${n}`]};return Xe(o,Qnt,i)},Znt=be("div",{name:"MuiPaper",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,e[n.variant],!n.square&&e.rounded,n.variant==="elevation"&&e[`elevation${n.elevation}`]]}})(kt(({theme:t})=>({backgroundColor:(t.vars||t).palette.background.paper,color:(t.vars||t).palette.text.primary,transition:t.transitions.create("box-shadow"),variants:[{props:({ownerState:e})=>!e.square,style:{borderRadius:t.shape.borderRadius}},{props:{variant:"outlined"},style:{border:`1px solid ${(t.vars||t).palette.divider}`}},{props:{variant:"elevation"},style:{boxShadow:"var(--Paper-shadow)",backgroundImage:"var(--Paper-overlay)"}}]}))),Al=D.forwardRef(function(e,n){var h;const r=wt({props:e,name:"MuiPaper"}),i=Na(),{className:o,component:s="div",elevation:a=1,square:l=!1,variant:c="elevation",...u}=r,f={...r,component:s,elevation:a,square:l,variant:c},d=Knt(f);return C.jsx(Znt,{as:s,ownerState:f,className:Oe(d.root,o),ref:n,...u,style:{...c==="elevation"&&{"--Paper-shadow":(i.vars||i).shadows[a],...i.vars&&{"--Paper-overlay":(h=i.vars.overlays)==null?void 0:h[a]},...!i.vars&&i.palette.mode==="dark"&&{"--Paper-overlay":`linear-gradient(${Tt("#fff",zH(a))}, ${Tt("#fff",zH(a))})`}},...u.style}})});function ec(t,e){const{className:n,elementType:r,ownerState:i,externalForwardedProps:o,getSlotOwnerState:s,internalForwardedProps:a,...l}=e,{component:c,slots:u={[t]:void 0},slotProps:f={[t]:void 0},...d}=o,h=u[t]||r,p=rA(f[t],i),{props:{component:g,...m},internalRef:v}=oAe({className:n,...l,externalForwardedProps:t==="root"?d:void 0,externalSlotProps:p}),y=dn(v,p==null?void 0:p.ref,e.ref),x=s?s(m):{},b={...i,...x},w=t==="root"?g||c:g,_=t_(h,{...t==="root"&&!c&&!u[t]&&a,...t!=="root"&&!u[t]&&a,...m,...w&&{as:w},ref:y},b);return Object.keys(x).forEach(S=>{delete _[S]}),[h,_]}class IF{constructor(){gn(this,"mountEffect",()=>{this.shouldMount&&!this.didMount&&this.ref.current!==null&&(this.didMount=!0,this.mounted.resolve())});this.ref={current:null},this.mounted=null,this.didMount=!1,this.shouldMount=!1,this.setShouldMount=null}static create(){return new IF}static use(){const e=nAe(IF.create).current,[n,r]=D.useState(!1);return e.shouldMount=n,e.setShouldMount=r,D.useEffect(e.mountEffect,[n]),e}mount(){return this.mounted||(this.mounted=ert(),this.shouldMount=!0,this.setShouldMount(this.shouldMount)),this.mounted}start(...e){this.mount().then(()=>{var n;return(n=this.ref.current)==null?void 0:n.start(...e)})}stop(...e){this.mount().then(()=>{var n;return(n=this.ref.current)==null?void 0:n.stop(...e)})}pulsate(...e){this.mount().then(()=>{var n;return(n=this.ref.current)==null?void 0:n.pulsate(...e)})}}function Jnt(){return IF.use()}function ert(){let t,e;const n=new Promise((r,i)=>{t=r,e=i});return n.resolve=t,n.reject=e,n}function trt(t){const{className:e,classes:n,pulsate:r=!1,rippleX:i,rippleY:o,rippleSize:s,in:a,onExited:l,timeout:c}=t,[u,f]=D.useState(!1),d=Oe(e,n.ripple,n.rippleVisible,r&&n.ripplePulsate),h={width:s,height:s,top:-(s/2)+o,left:-(s/2)+i},p=Oe(n.child,u&&n.childLeaving,r&&n.childPulsate);return!a&&!u&&f(!0),D.useEffect(()=>{if(!a&&l!=null){const g=setTimeout(l,c);return()=>{clearTimeout(g)}}},[l,a,c]),C.jsx("span",{className:d,style:h,children:C.jsx("span",{className:p})})}const Vc=qe("MuiTouchRipple",["root","ripple","rippleVisible","ripplePulsate","child","childLeaving","childPulsate"]),BH=550,nrt=80,rrt=CM` + */var Tee=Symbol.for("react.element"),kee=Symbol.for("react.portal"),n4=Symbol.for("react.fragment"),r4=Symbol.for("react.strict_mode"),i4=Symbol.for("react.profiler"),o4=Symbol.for("react.provider"),s4=Symbol.for("react.context"),art=Symbol.for("react.server_context"),a4=Symbol.for("react.forward_ref"),l4=Symbol.for("react.suspense"),c4=Symbol.for("react.suspense_list"),u4=Symbol.for("react.memo"),f4=Symbol.for("react.lazy"),lrt=Symbol.for("react.offscreen"),HAe;HAe=Symbol.for("react.module.reference");function Fu(t){if(typeof t=="object"&&t!==null){var e=t.$$typeof;switch(e){case Tee:switch(t=t.type,t){case n4:case i4:case r4:case l4:case c4:return t;default:switch(t=t&&t.$$typeof,t){case art:case s4:case a4:case f4:case u4:case o4:return t;default:return e}}case kee:return e}}}kr.ContextConsumer=s4;kr.ContextProvider=o4;kr.Element=Tee;kr.ForwardRef=a4;kr.Fragment=n4;kr.Lazy=f4;kr.Memo=u4;kr.Portal=kee;kr.Profiler=i4;kr.StrictMode=r4;kr.Suspense=l4;kr.SuspenseList=c4;kr.isAsyncMode=function(){return!1};kr.isConcurrentMode=function(){return!1};kr.isContextConsumer=function(t){return Fu(t)===s4};kr.isContextProvider=function(t){return Fu(t)===o4};kr.isElement=function(t){return typeof t=="object"&&t!==null&&t.$$typeof===Tee};kr.isForwardRef=function(t){return Fu(t)===a4};kr.isFragment=function(t){return Fu(t)===n4};kr.isLazy=function(t){return Fu(t)===f4};kr.isMemo=function(t){return Fu(t)===u4};kr.isPortal=function(t){return Fu(t)===kee};kr.isProfiler=function(t){return Fu(t)===i4};kr.isStrictMode=function(t){return Fu(t)===r4};kr.isSuspense=function(t){return Fu(t)===l4};kr.isSuspenseList=function(t){return Fu(t)===c4};kr.isValidElementType=function(t){return typeof t=="string"||typeof t=="function"||t===n4||t===i4||t===r4||t===l4||t===c4||t===lrt||typeof t=="object"&&t!==null&&(t.$$typeof===f4||t.$$typeof===u4||t.$$typeof===o4||t.$$typeof===s4||t.$$typeof===a4||t.$$typeof===HAe||t.getModuleId!==void 0)};kr.typeOf=Fu;function TF(t,e){return TF=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,r){return n.__proto__=r,n},TF(t,e)}function AM(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,TF(t,e)}function crt(t,e){return t.classList?!!e&&t.classList.contains(e):(" "+(t.className.baseVal||t.className)+" ").indexOf(" "+e+" ")!==-1}function urt(t,e){t.classList?t.classList.add(e):crt(t,e)||(typeof t.className=="string"?t.className=t.className+" "+e:t.setAttribute("class",(t.className&&t.className.baseVal||"")+" "+e))}function lde(t,e){return t.replace(new RegExp("(^|\\s)"+e+"(?:\\s|$)","g"),"$1").replace(/\s+/g," ").replace(/^\s*|\s*$/g,"")}function frt(t,e){t.classList?t.classList.remove(e):typeof t.className=="string"?t.className=lde(t.className,e):t.setAttribute("class",lde(t.className&&t.className.baseVal||"",e))}const cde={disabled:!1},kF=de.createContext(null);var qAe=function(e){return e.scrollTop},X2="unmounted",$0="exited",F0="entering",Pw="entered",tq="exiting",Rc=function(t){AM(e,t);function e(r,i){var o;o=t.call(this,r,i)||this;var s=i,a=s&&!s.isMounting?r.enter:r.appear,l;return o.appearStatus=null,r.in?a?(l=$0,o.appearStatus=F0):l=Pw:r.unmountOnExit||r.mountOnEnter?l=X2:l=$0,o.state={status:l},o.nextCallback=null,o}e.getDerivedStateFromProps=function(i,o){var s=i.in;return s&&o.status===X2?{status:$0}:null};var n=e.prototype;return n.componentDidMount=function(){this.updateStatus(!0,this.appearStatus)},n.componentDidUpdate=function(i){var o=null;if(i!==this.props){var s=this.state.status;this.props.in?s!==F0&&s!==Pw&&(o=F0):(s===F0||s===Pw)&&(o=tq)}this.updateStatus(!1,o)},n.componentWillUnmount=function(){this.cancelNextCallback()},n.getTimeouts=function(){var i=this.props.timeout,o,s,a;return o=s=a=i,i!=null&&typeof i!="number"&&(o=i.exit,s=i.enter,a=i.appear!==void 0?i.appear:s),{exit:o,enter:s,appear:a}},n.updateStatus=function(i,o){if(i===void 0&&(i=!1),o!==null)if(this.cancelNextCallback(),o===F0){if(this.props.unmountOnExit||this.props.mountOnEnter){var s=this.props.nodeRef?this.props.nodeRef.current:VD.findDOMNode(this);s&&qAe(s)}this.performEnter(i)}else this.performExit();else this.props.unmountOnExit&&this.state.status===$0&&this.setState({status:X2})},n.performEnter=function(i){var o=this,s=this.props.enter,a=this.context?this.context.isMounting:i,l=this.props.nodeRef?[a]:[VD.findDOMNode(this),a],c=l[0],u=l[1],f=this.getTimeouts(),d=a?f.appear:f.enter;if(!i&&!s||cde.disabled){this.safeSetState({status:Pw},function(){o.props.onEntered(c)});return}this.props.onEnter(c,u),this.safeSetState({status:F0},function(){o.props.onEntering(c,u),o.onTransitionEnd(d,function(){o.safeSetState({status:Pw},function(){o.props.onEntered(c,u)})})})},n.performExit=function(){var i=this,o=this.props.exit,s=this.getTimeouts(),a=this.props.nodeRef?void 0:VD.findDOMNode(this);if(!o||cde.disabled){this.safeSetState({status:$0},function(){i.props.onExited(a)});return}this.props.onExit(a),this.safeSetState({status:tq},function(){i.props.onExiting(a),i.onTransitionEnd(s.exit,function(){i.safeSetState({status:$0},function(){i.props.onExited(a)})})})},n.cancelNextCallback=function(){this.nextCallback!==null&&(this.nextCallback.cancel(),this.nextCallback=null)},n.safeSetState=function(i,o){o=this.setNextCallback(o),this.setState(i,o)},n.setNextCallback=function(i){var o=this,s=!0;return this.nextCallback=function(a){s&&(s=!1,o.nextCallback=null,i(a))},this.nextCallback.cancel=function(){s=!1},this.nextCallback},n.onTransitionEnd=function(i,o){this.setNextCallback(o);var s=this.props.nodeRef?this.props.nodeRef.current:VD.findDOMNode(this),a=i==null&&!this.props.addEndListener;if(!s||a){setTimeout(this.nextCallback,0);return}if(this.props.addEndListener){var l=this.props.nodeRef?[this.nextCallback]:[s,this.nextCallback],c=l[0],u=l[1];this.props.addEndListener(c,u)}i!=null&&setTimeout(this.nextCallback,i)},n.render=function(){var i=this.state.status;if(i===X2)return null;var o=this.props,s=o.children;o.in,o.mountOnEnter,o.unmountOnExit,o.appear,o.enter,o.exit,o.timeout,o.addEndListener,o.onEnter,o.onEntering,o.onEntered,o.onExit,o.onExiting,o.onExited,o.nodeRef;var a=Rt(o,["children","in","mountOnEnter","unmountOnExit","appear","enter","exit","timeout","addEndListener","onEnter","onEntering","onEntered","onExit","onExiting","onExited","nodeRef"]);return de.createElement(kF.Provider,{value:null},typeof s=="function"?s(i,a):de.cloneElement(de.Children.only(s),a))},e}(de.Component);Rc.contextType=kF;Rc.propTypes={};function F1(){}Rc.defaultProps={in:!1,mountOnEnter:!1,unmountOnExit:!1,appear:!1,enter:!0,exit:!0,onEnter:F1,onEntering:F1,onEntered:F1,onExit:F1,onExiting:F1,onExited:F1};Rc.UNMOUNTED=X2;Rc.EXITED=$0;Rc.ENTERING=F0;Rc.ENTERED=Pw;Rc.EXITING=tq;var drt=function(e,n){return e&&n&&n.split(" ").forEach(function(r){return urt(e,r)})},J8=function(e,n){return e&&n&&n.split(" ").forEach(function(r){return frt(e,r)})},Aee=function(t){AM(e,t);function e(){for(var r,i=arguments.length,o=new Array(i),s=0;st.scrollTop;function Zv(t,e){const{timeout:n,easing:r,style:i={}}=t;return{duration:i.transitionDuration??(typeof n=="number"?n:n[e.mode]||0),easing:i.transitionTimingFunction??(typeof r=="object"?r[e.mode]:r),delay:i.transitionDelay}}function yrt(t){return Ye("MuiCollapse",t)}He("MuiCollapse",["root","horizontal","vertical","entered","hidden","wrapper","wrapperInner"]);const xrt=t=>{const{orientation:e,classes:n}=t,r={root:["root",`${e}`],entered:["entered"],hidden:["hidden"],wrapper:["wrapper",`${e}`],wrapperInner:["wrapperInner",`${e}`]};return qe(r,yrt,n)},brt=be("div",{name:"MuiCollapse",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,e[n.orientation],n.state==="entered"&&e.entered,n.state==="exited"&&!n.in&&n.collapsedSize==="0px"&&e.hidden]}})(Tt(({theme:t})=>({height:0,overflow:"hidden",transition:t.transitions.create("height"),variants:[{props:{orientation:"horizontal"},style:{height:"auto",width:0,transition:t.transitions.create("width")}},{props:{state:"entered"},style:{height:"auto",overflow:"visible"}},{props:{state:"entered",orientation:"horizontal"},style:{width:"auto"}},{props:({ownerState:e})=>e.state==="exited"&&!e.in&&e.collapsedSize==="0px",style:{visibility:"hidden"}}]}))),wrt=be("div",{name:"MuiCollapse",slot:"Wrapper",overridesResolver:(t,e)=>e.wrapper})({display:"flex",width:"100%",variants:[{props:{orientation:"horizontal"},style:{width:"auto",height:"100%"}}]}),_rt=be("div",{name:"MuiCollapse",slot:"WrapperInner",overridesResolver:(t,e)=>e.wrapperInner})({width:"100%",variants:[{props:{orientation:"horizontal"},style:{width:"auto",height:"100%"}}]}),AF=D.forwardRef(function(e,n){const r=wt({props:e,name:"MuiCollapse"}),{addEndListener:i,children:o,className:s,collapsedSize:a="0px",component:l,easing:c,in:u,onEnter:f,onEntered:d,onEntering:h,onExit:p,onExited:g,onExiting:m,orientation:v="vertical",style:y,timeout:x=UAe.standard,TransitionComponent:b=Rc,...w}=r,_={...r,orientation:v,collapsedSize:a},S=xrt(_),O=$a(),k=lv(),E=D.useRef(null),P=D.useRef(),A=typeof a=="number"?`${a}px`:a,R=v==="horizontal",T=R?"width":"height",M=D.useRef(null),I=dn(n,M),j=Y=>le=>{if(Y){const K=M.current;le===void 0?Y(K):Y(K,le)}},N=()=>E.current?E.current[R?"clientWidth":"clientHeight"]:0,z=j((Y,le)=>{E.current&&R&&(E.current.style.position="absolute"),Y.style[T]=A,f&&f(Y,le)}),L=j((Y,le)=>{const K=N();E.current&&R&&(E.current.style.position="");const{duration:ee,easing:re}=Zv({style:y,timeout:x,easing:c},{mode:"enter"});if(x==="auto"){const ge=O.transitions.getAutoHeightDuration(K);Y.style.transitionDuration=`${ge}ms`,P.current=ge}else Y.style.transitionDuration=typeof ee=="string"?ee:`${ee}ms`;Y.style[T]=`${K}px`,Y.style.transitionTimingFunction=re,h&&h(Y,le)}),B=j((Y,le)=>{Y.style[T]="auto",d&&d(Y,le)}),F=j(Y=>{Y.style[T]=`${N()}px`,p&&p(Y)}),$=j(g),q=j(Y=>{const le=N(),{duration:K,easing:ee}=Zv({style:y,timeout:x,easing:c},{mode:"exit"});if(x==="auto"){const re=O.transitions.getAutoHeightDuration(le);Y.style.transitionDuration=`${re}ms`,P.current=re}else Y.style.transitionDuration=typeof K=="string"?K:`${K}ms`;Y.style[T]=A,Y.style.transitionTimingFunction=ee,m&&m(Y)}),G=Y=>{x==="auto"&&k.start(P.current||0,Y),i&&i(M.current,Y)};return C.jsx(b,{in:u,onEnter:z,onEntered:B,onEntering:L,onExit:F,onExited:$,onExiting:q,addEndListener:G,nodeRef:M,timeout:x==="auto"?null:x,...w,children:(Y,le)=>C.jsx(brt,{as:l,className:Oe(S.root,s,{entered:S.entered,exited:!u&&A==="0px"&&S.hidden}[Y]),style:{[R?"minWidth":"minHeight"]:A,...y},ref:I,...le,ownerState:{..._,state:Y},children:C.jsx(wrt,{ownerState:{..._,state:Y},className:S.wrapper,ref:E,children:C.jsx(_rt,{ownerState:{..._,state:Y},className:S.wrapperInner,children:o})})})})});AF&&(AF.muiSupportAuto=!0);function Srt(t){return Ye("MuiPaper",t)}He("MuiPaper",["root","rounded","outlined","elevation","elevation0","elevation1","elevation2","elevation3","elevation4","elevation5","elevation6","elevation7","elevation8","elevation9","elevation10","elevation11","elevation12","elevation13","elevation14","elevation15","elevation16","elevation17","elevation18","elevation19","elevation20","elevation21","elevation22","elevation23","elevation24"]);const Crt=t=>{const{square:e,elevation:n,variant:r,classes:i}=t,o={root:["root",r,!e&&"rounded",r==="elevation"&&`elevation${n}`]};return qe(o,Srt,i)},Ort=be("div",{name:"MuiPaper",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,e[n.variant],!n.square&&e.rounded,n.variant==="elevation"&&e[`elevation${n.elevation}`]]}})(Tt(({theme:t})=>({backgroundColor:(t.vars||t).palette.background.paper,color:(t.vars||t).palette.text.primary,transition:t.transitions.create("box-shadow"),variants:[{props:({ownerState:e})=>!e.square,style:{borderRadius:t.shape.borderRadius}},{props:{variant:"outlined"},style:{border:`1px solid ${(t.vars||t).palette.divider}`}},{props:{variant:"elevation"},style:{boxShadow:"var(--Paper-shadow)",backgroundImage:"var(--Paper-overlay)"}}]}))),Tl=D.forwardRef(function(e,n){var h;const r=wt({props:e,name:"MuiPaper"}),i=$a(),{className:o,component:s="div",elevation:a=1,square:l=!1,variant:c="elevation",...u}=r,f={...r,component:s,elevation:a,square:l,variant:c},d=Crt(f);return C.jsx(Ort,{as:s,ownerState:f,className:Oe(d.root,o),ref:n,...u,style:{...c==="elevation"&&{"--Paper-shadow":(i.vars||i).shadows[a],...i.vars&&{"--Paper-overlay":(h=i.vars.overlays)==null?void 0:h[a]},...!i.vars&&i.palette.mode==="dark"&&{"--Paper-overlay":`linear-gradient(${kt("#fff",eq(a))}, ${kt("#fff",eq(a))})`}},...u.style}})});function Zl(t,e){const{className:n,elementType:r,ownerState:i,externalForwardedProps:o,getSlotOwnerState:s,internalForwardedProps:a,...l}=e,{component:c,slots:u={[t]:void 0},slotProps:f={[t]:void 0},...d}=o,h=u[t]||r,p=nA(f[t],i),{props:{component:g,...m},internalRef:v}=RAe({className:n,...l,externalForwardedProps:t==="root"?d:void 0,externalSlotProps:p}),y=dn(v,p==null?void 0:p.ref,e.ref),x=s?s(m):{},b={...i,...x},w=t==="root"?g||c:g,_=e_(h,{...t==="root"&&!c&&!u[t]&&a,...t!=="root"&&!u[t]&&a,...m,...w&&{as:w},ref:y},b);return Object.keys(x).forEach(S=>{delete _[S]}),[h,_]}class PF{constructor(){gn(this,"mountEffect",()=>{this.shouldMount&&!this.didMount&&this.ref.current!==null&&(this.didMount=!0,this.mounted.resolve())});this.ref={current:null},this.mounted=null,this.didMount=!1,this.shouldMount=!1,this.setShouldMount=null}static create(){return new PF}static use(){const e=AAe(PF.create).current,[n,r]=D.useState(!1);return e.shouldMount=n,e.setShouldMount=r,D.useEffect(e.mountEffect,[n]),e}mount(){return this.mounted||(this.mounted=Trt(),this.shouldMount=!0,this.setShouldMount(this.shouldMount)),this.mounted}start(...e){this.mount().then(()=>{var n;return(n=this.ref.current)==null?void 0:n.start(...e)})}stop(...e){this.mount().then(()=>{var n;return(n=this.ref.current)==null?void 0:n.stop(...e)})}pulsate(...e){this.mount().then(()=>{var n;return(n=this.ref.current)==null?void 0:n.pulsate(...e)})}}function Ert(){return PF.use()}function Trt(){let t,e;const n=new Promise((r,i)=>{t=r,e=i});return n.resolve=t,n.reject=e,n}function krt(t){const{className:e,classes:n,pulsate:r=!1,rippleX:i,rippleY:o,rippleSize:s,in:a,onExited:l,timeout:c}=t,[u,f]=D.useState(!1),d=Oe(e,n.ripple,n.rippleVisible,r&&n.ripplePulsate),h={width:s,height:s,top:-(s/2)+o,left:-(s/2)+i},p=Oe(n.child,u&&n.childLeaving,r&&n.childPulsate);return!a&&!u&&f(!0),D.useEffect(()=>{if(!a&&l!=null){const g=setTimeout(l,c);return()=>{clearTimeout(g)}}},[l,a,c]),C.jsx("span",{className:d,style:h,children:C.jsx("span",{className:p})})}const Wc=He("MuiTouchRipple",["root","ripple","rippleVisible","ripplePulsate","child","childLeaving","childPulsate"]),nq=550,Art=80,Prt=CM` 0% { transform: scale(0); opacity: 0.1; @@ -133,7 +133,7 @@ To suppress this warning, you need to explicitly provide the \`palette.${e}Chann transform: scale(1); opacity: 0.3; } -`,irt=CM` +`,Mrt=CM` 0% { opacity: 1; } @@ -141,7 +141,7 @@ To suppress this warning, you need to explicitly provide the \`palette.${e}Chann 100% { opacity: 0; } -`,ort=CM` +`,Rrt=CM` 0% { transform: scale(1); } @@ -153,23 +153,23 @@ To suppress this warning, you need to explicitly provide the \`palette.${e}Chann 100% { transform: scale(1); } -`,srt=be("span",{name:"MuiTouchRipple",slot:"Root"})({overflow:"hidden",pointerEvents:"none",position:"absolute",zIndex:0,top:0,right:0,bottom:0,left:0,borderRadius:"inherit"}),art=be(trt,{name:"MuiTouchRipple",slot:"Ripple"})` +`,Drt=be("span",{name:"MuiTouchRipple",slot:"Root"})({overflow:"hidden",pointerEvents:"none",position:"absolute",zIndex:0,top:0,right:0,bottom:0,left:0,borderRadius:"inherit"}),Irt=be(krt,{name:"MuiTouchRipple",slot:"Ripple"})` opacity: 0; position: absolute; - &.${Vc.rippleVisible} { + &.${Wc.rippleVisible} { opacity: 0.3; transform: scale(1); - animation-name: ${rrt}; - animation-duration: ${BH}ms; + animation-name: ${Prt}; + animation-duration: ${nq}ms; animation-timing-function: ${({theme:t})=>t.transitions.easing.easeInOut}; } - &.${Vc.ripplePulsate} { + &.${Wc.ripplePulsate} { animation-duration: ${({theme:t})=>t.transitions.duration.shorter}ms; } - & .${Vc.child} { + & .${Wc.child} { opacity: 1; display: block; width: 100%; @@ -178,26 +178,26 @@ To suppress this warning, you need to explicitly provide the \`palette.${e}Chann background-color: currentColor; } - & .${Vc.childLeaving} { + & .${Wc.childLeaving} { opacity: 0; - animation-name: ${irt}; - animation-duration: ${BH}ms; + animation-name: ${Mrt}; + animation-duration: ${nq}ms; animation-timing-function: ${({theme:t})=>t.transitions.easing.easeInOut}; } - & .${Vc.childPulsate} { + & .${Wc.childPulsate} { position: absolute; /* @noflip */ left: 0px; top: 0; - animation-name: ${ort}; + animation-name: ${Rrt}; animation-duration: 2500ms; animation-timing-function: ${({theme:t})=>t.transitions.easing.easeInOut}; animation-iteration-count: infinite; animation-delay: 200ms; } -`,lrt=D.forwardRef(function(e,n){const r=wt({props:e,name:"MuiTouchRipple"}),{center:i=!1,classes:o={},className:s,...a}=r,[l,c]=D.useState([]),u=D.useRef(0),f=D.useRef(null);D.useEffect(()=>{f.current&&(f.current(),f.current=null)},[l]);const d=D.useRef(!1),h=cv(),p=D.useRef(null),g=D.useRef(null),m=D.useCallback(b=>{const{pulsate:w,rippleX:_,rippleY:S,rippleSize:O,cb:k}=b;c(E=>[...E,C.jsx(art,{classes:{ripple:Oe(o.ripple,Vc.ripple),rippleVisible:Oe(o.rippleVisible,Vc.rippleVisible),ripplePulsate:Oe(o.ripplePulsate,Vc.ripplePulsate),child:Oe(o.child,Vc.child),childLeaving:Oe(o.childLeaving,Vc.childLeaving),childPulsate:Oe(o.childPulsate,Vc.childPulsate)},timeout:BH,pulsate:w,rippleX:_,rippleY:S,rippleSize:O},u.current)]),u.current+=1,f.current=k},[o]),v=D.useCallback((b={},w={},_=()=>{})=>{const{pulsate:S=!1,center:O=i||w.pulsate,fakeElement:k=!1}=w;if((b==null?void 0:b.type)==="mousedown"&&d.current){d.current=!1;return}(b==null?void 0:b.type)==="touchstart"&&(d.current=!0);const E=k?null:g.current,M=E?E.getBoundingClientRect():{width:0,height:0,left:0,top:0};let A,P,T;if(O||b===void 0||b.clientX===0&&b.clientY===0||!b.clientX&&!b.touches)A=Math.round(M.width/2),P=Math.round(M.height/2);else{const{clientX:R,clientY:I}=b.touches&&b.touches.length>0?b.touches[0]:b;A=Math.round(R-M.left),P=Math.round(I-M.top)}if(O)T=Math.sqrt((2*M.width**2+M.height**2)/3),T%2===0&&(T+=1);else{const R=Math.max(Math.abs((E?E.clientWidth:0)-A),A)*2+2,I=Math.max(Math.abs((E?E.clientHeight:0)-P),P)*2+2;T=Math.sqrt(R**2+I**2)}b!=null&&b.touches?p.current===null&&(p.current=()=>{m({pulsate:S,rippleX:A,rippleY:P,rippleSize:T,cb:_})},h.start(nrt,()=>{p.current&&(p.current(),p.current=null)})):m({pulsate:S,rippleX:A,rippleY:P,rippleSize:T,cb:_})},[i,m,h]),y=D.useCallback(()=>{v({},{pulsate:!0})},[v]),x=D.useCallback((b,w)=>{if(h.clear(),(b==null?void 0:b.type)==="touchend"&&p.current){p.current(),p.current=null,h.start(0,()=>{x(b,w)});return}p.current=null,c(_=>_.length>0?_.slice(1):_),f.current=w},[h]);return D.useImperativeHandle(n,()=>({pulsate:y,start:v,stop:x}),[y,v,x]),C.jsx(srt,{className:Oe(Vc.root,o.root,s),ref:g,...a,children:C.jsx(PM,{component:null,exit:!0,children:l})})});function crt(t){return Ye("MuiButtonBase",t)}const urt=qe("MuiButtonBase",["root","disabled","focusVisible"]),frt=t=>{const{disabled:e,focusVisible:n,focusVisibleClassName:r,classes:i}=t,s=Xe({root:["root",e&&"disabled",n&&"focusVisible"]},crt,i);return n&&r&&(s.root+=` ${r}`),s},drt=be("button",{name:"MuiButtonBase",slot:"Root",overridesResolver:(t,e)=>e.root})({display:"inline-flex",alignItems:"center",justifyContent:"center",position:"relative",boxSizing:"border-box",WebkitTapHighlightColor:"transparent",backgroundColor:"transparent",outline:0,border:0,margin:0,borderRadius:0,padding:0,cursor:"pointer",userSelect:"none",verticalAlign:"middle",MozAppearance:"none",WebkitAppearance:"none",textDecoration:"none",color:"inherit","&::-moz-focus-inner":{borderStyle:"none"},[`&.${urt.disabled}`]:{pointerEvents:"none",cursor:"default"},"@media print":{colorAdjust:"exact"}}),Nf=D.forwardRef(function(e,n){const r=wt({props:e,name:"MuiButtonBase"}),{action:i,centerRipple:o=!1,children:s,className:a,component:l="button",disabled:c=!1,disableRipple:u=!1,disableTouchRipple:f=!1,focusRipple:d=!1,focusVisibleClassName:h,LinkComponent:p="a",onBlur:g,onClick:m,onContextMenu:v,onDragLeave:y,onFocus:x,onFocusVisible:b,onKeyDown:w,onKeyUp:_,onMouseDown:S,onMouseLeave:O,onMouseUp:k,onTouchEnd:E,onTouchMove:M,onTouchStart:A,tabIndex:P=0,TouchRippleProps:T,touchRippleRef:R,type:I,...B}=r,$=D.useRef(null),z=Jnt(),L=dn(z.ref,R),[j,N]=D.useState(!1);c&&j&&N(!1),D.useImperativeHandle(i,()=>({focusVisible:()=>{N(!0),$.current.focus()}}),[]);const F=z.shouldMount&&!u&&!c;D.useEffect(()=>{j&&d&&!u&&z.pulsate()},[u,d,j,z]);function H(W,J,se=f){return st(ye=>(J&&J(ye),se||z[W](ye),!0))}const q=H("start",S),Y=H("stop",v),le=H("stop",y),K=H("stop",k),ee=H("stop",W=>{j&&W.preventDefault(),O&&O(W)}),re=H("start",A),me=H("stop",E),te=H("stop",M),ae=H("stop",W=>{Zv(W.target)||N(!1),g&&g(W)},!1),U=st(W=>{$.current||($.current=W.currentTarget),Zv(W.target)&&(N(!0),b&&b(W)),x&&x(W)}),oe=()=>{const W=$.current;return l&&l!=="button"&&!(W.tagName==="A"&&W.href)},ne=st(W=>{d&&!W.repeat&&j&&W.key===" "&&z.stop(W,()=>{z.start(W)}),W.target===W.currentTarget&&oe()&&W.key===" "&&W.preventDefault(),w&&w(W),W.target===W.currentTarget&&oe()&&W.key==="Enter"&&!c&&(W.preventDefault(),m&&m(W))}),V=st(W=>{d&&W.key===" "&&j&&!W.defaultPrevented&&z.stop(W,()=>{z.pulsate(W)}),_&&_(W),m&&W.target===W.currentTarget&&oe()&&W.key===" "&&!W.defaultPrevented&&m(W)});let X=l;X==="button"&&(B.href||B.to)&&(X=p);const Z={};X==="button"?(Z.type=I===void 0?"button":I,Z.disabled=c):(!B.href&&!B.to&&(Z.role="button"),c&&(Z["aria-disabled"]=c));const he=dn(n,$),xe={...r,centerRipple:o,component:l,disabled:c,disableRipple:u,disableTouchRipple:f,focusRipple:d,tabIndex:P,focusVisible:j},G=frt(xe);return C.jsxs(drt,{as:X,className:Oe(G.root,a),ownerState:xe,onBlur:ae,onClick:m,onContextMenu:Y,onFocus:U,onKeyDown:ne,onKeyUp:V,onMouseDown:q,onMouseLeave:ee,onMouseUp:K,onDragLeave:le,onTouchEnd:me,onTouchMove:te,onTouchStart:re,ref:he,tabIndex:c?-1:P,type:I,...Z,...B,children:[s,F?C.jsx(lrt,{ref:L,center:o,...T}):null]})});function hrt(t){return typeof t.main=="string"}function prt(t,e=[]){if(!hrt(t))return!1;for(const n of e)if(!t.hasOwnProperty(n)||typeof t[n]!="string")return!1;return!0}function di(t=[]){return([,e])=>e&&prt(e,t)}function grt(t){return Ye("MuiIconButton",t)}const mrt=qe("MuiIconButton",["root","disabled","colorInherit","colorPrimary","colorSecondary","colorError","colorInfo","colorSuccess","colorWarning","edgeStart","edgeEnd","sizeSmall","sizeMedium","sizeLarge"]),vrt=t=>{const{classes:e,disabled:n,color:r,edge:i,size:o}=t,s={root:["root",n&&"disabled",r!=="default"&&`color${De(r)}`,i&&`edge${De(i)}`,`size${De(o)}`]};return Xe(s,grt,e)},yrt=be(Nf,{name:"MuiIconButton",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,n.color!=="default"&&e[`color${De(n.color)}`],n.edge&&e[`edge${De(n.edge)}`],e[`size${De(n.size)}`]]}})(kt(({theme:t})=>({textAlign:"center",flex:"0 0 auto",fontSize:t.typography.pxToRem(24),padding:8,borderRadius:"50%",color:(t.vars||t).palette.action.active,transition:t.transitions.create("background-color",{duration:t.transitions.duration.shortest}),variants:[{props:e=>!e.disableRipple,style:{"--IconButton-hoverBg":t.vars?`rgba(${t.vars.palette.action.activeChannel} / ${t.vars.palette.action.hoverOpacity})`:Tt(t.palette.action.active,t.palette.action.hoverOpacity),"&:hover":{backgroundColor:"var(--IconButton-hoverBg)","@media (hover: none)":{backgroundColor:"transparent"}}}},{props:{edge:"start"},style:{marginLeft:-12}},{props:{edge:"start",size:"small"},style:{marginLeft:-3}},{props:{edge:"end"},style:{marginRight:-12}},{props:{edge:"end",size:"small"},style:{marginRight:-3}}]})),kt(({theme:t})=>({variants:[{props:{color:"inherit"},style:{color:"inherit"}},...Object.entries(t.palette).filter(di()).map(([e])=>({props:{color:e},style:{color:(t.vars||t).palette[e].main}})),...Object.entries(t.palette).filter(di()).map(([e])=>({props:{color:e},style:{"--IconButton-hoverBg":t.vars?`rgba(${(t.vars||t).palette[e].mainChannel} / ${t.vars.palette.action.hoverOpacity})`:Tt((t.vars||t).palette[e].main,t.palette.action.hoverOpacity)}})),{props:{size:"small"},style:{padding:5,fontSize:t.typography.pxToRem(18)}},{props:{size:"large"},style:{padding:12,fontSize:t.typography.pxToRem(28)}}],[`&.${mrt.disabled}`]:{backgroundColor:"transparent",color:(t.vars||t).palette.action.disabled}}))),Ht=D.forwardRef(function(e,n){const r=wt({props:e,name:"MuiIconButton"}),{edge:i=!1,children:o,className:s,color:a="default",disabled:l=!1,disableFocusRipple:c=!1,size:u="medium",...f}=r,d={...r,edge:i,color:a,disabled:l,disableFocusRipple:c,size:u},h=vrt(d);return C.jsx(yrt,{className:Oe(h.root,s),centerRipple:!0,focusRipple:!c,disabled:l,ref:n,...f,ownerState:d,children:o})});function xrt(t){return Ye("MuiTypography",t)}const LF=qe("MuiTypography",["root","h1","h2","h3","h4","h5","h6","subtitle1","subtitle2","body1","body2","inherit","button","caption","overline","alignLeft","alignRight","alignCenter","alignJustify","noWrap","gutterBottom","paragraph"]),brt={primary:!0,secondary:!0,error:!0,info:!0,success:!0,warning:!0,textPrimary:!0,textSecondary:!0,textDisabled:!0},wrt=Pnt(),_rt=t=>{const{align:e,gutterBottom:n,noWrap:r,paragraph:i,variant:o,classes:s}=t,a={root:["root",o,t.align!=="inherit"&&`align${De(e)}`,n&&"gutterBottom",r&&"noWrap",i&&"paragraph"]};return Xe(a,xrt,s)},Srt=be("span",{name:"MuiTypography",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,n.variant&&e[n.variant],n.align!=="inherit"&&e[`align${De(n.align)}`],n.noWrap&&e.noWrap,n.gutterBottom&&e.gutterBottom,n.paragraph&&e.paragraph]}})(kt(({theme:t})=>{var e;return{margin:0,variants:[{props:{variant:"inherit"},style:{font:"inherit",lineHeight:"inherit",letterSpacing:"inherit"}},...Object.entries(t.typography).filter(([n,r])=>n!=="inherit"&&r&&typeof r=="object").map(([n,r])=>({props:{variant:n},style:r})),...Object.entries(t.palette).filter(di()).map(([n])=>({props:{color:n},style:{color:(t.vars||t).palette[n].main}})),...Object.entries(((e=t.palette)==null?void 0:e.text)||{}).filter(([,n])=>typeof n=="string").map(([n])=>({props:{color:`text${De(n)}`},style:{color:(t.vars||t).palette.text[n]}})),{props:({ownerState:n})=>n.align!=="inherit",style:{textAlign:"var(--Typography-textAlign)"}},{props:({ownerState:n})=>n.noWrap,style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}},{props:({ownerState:n})=>n.gutterBottom,style:{marginBottom:"0.35em"}},{props:({ownerState:n})=>n.paragraph,style:{marginBottom:16}}]}})),Hfe={h1:"h1",h2:"h2",h3:"h3",h4:"h4",h5:"h5",h6:"h6",subtitle1:"h6",subtitle2:"h6",body1:"p",body2:"p",inherit:"p"},Jt=D.forwardRef(function(e,n){const{color:r,...i}=wt({props:e,name:"MuiTypography"}),o=!brt[r],s=wrt({...i,...o&&{color:r}}),{align:a="inherit",className:l,component:c,gutterBottom:u=!1,noWrap:f=!1,paragraph:d=!1,variant:h="body1",variantMapping:p=Hfe,...g}=s,m={...s,align:a,color:r,className:l,component:c,gutterBottom:u,noWrap:f,paragraph:d,variant:h,variantMapping:p},v=c||(d?"p":p[h]||Hfe[h])||"span",y=_rt(m);return C.jsx(Srt,{as:v,ref:n,className:Oe(y.root,l),...g,ownerState:m,style:{...a!=="inherit"&&{"--Typography-textAlign":a},...g.style}})});function Crt(t){return Ye("MuiAppBar",t)}qe("MuiAppBar",["root","positionFixed","positionAbsolute","positionSticky","positionStatic","positionRelative","colorDefault","colorPrimary","colorSecondary","colorInherit","colorTransparent","colorError","colorInfo","colorSuccess","colorWarning"]);const Ort=t=>{const{color:e,position:n,classes:r}=t,i={root:["root",`color${De(e)}`,`position${De(n)}`]};return Xe(i,Crt,r)},qfe=(t,e)=>t?`${t==null?void 0:t.replace(")","")}, ${e})`:e,Ert=be(Al,{name:"MuiAppBar",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,e[`position${De(n.position)}`],e[`color${De(n.color)}`]]}})(kt(({theme:t})=>({display:"flex",flexDirection:"column",width:"100%",boxSizing:"border-box",flexShrink:0,variants:[{props:{position:"fixed"},style:{position:"fixed",zIndex:(t.vars||t).zIndex.appBar,top:0,left:"auto",right:0,"@media print":{position:"absolute"}}},{props:{position:"absolute"},style:{position:"absolute",zIndex:(t.vars||t).zIndex.appBar,top:0,left:"auto",right:0}},{props:{position:"sticky"},style:{position:"sticky",zIndex:(t.vars||t).zIndex.appBar,top:0,left:"auto",right:0}},{props:{position:"static"},style:{position:"static"}},{props:{position:"relative"},style:{position:"relative"}},{props:{color:"inherit"},style:{"--AppBar-color":"inherit"}},{props:{color:"default"},style:{"--AppBar-background":t.vars?t.vars.palette.AppBar.defaultBg:t.palette.grey[100],"--AppBar-color":t.vars?t.vars.palette.text.primary:t.palette.getContrastText(t.palette.grey[100]),...t.applyStyles("dark",{"--AppBar-background":t.vars?t.vars.palette.AppBar.defaultBg:t.palette.grey[900],"--AppBar-color":t.vars?t.vars.palette.text.primary:t.palette.getContrastText(t.palette.grey[900])})}},...Object.entries(t.palette).filter(di(["contrastText"])).map(([e])=>({props:{color:e},style:{"--AppBar-background":(t.vars??t).palette[e].main,"--AppBar-color":(t.vars??t).palette[e].contrastText}})),{props:e=>e.enableColorOnDark===!0&&!["inherit","transparent"].includes(e.color),style:{backgroundColor:"var(--AppBar-background)",color:"var(--AppBar-color)"}},{props:e=>e.enableColorOnDark===!1&&!["inherit","transparent"].includes(e.color),style:{backgroundColor:"var(--AppBar-background)",color:"var(--AppBar-color)",...t.applyStyles("dark",{backgroundColor:t.vars?qfe(t.vars.palette.AppBar.darkBg,"var(--AppBar-background)"):null,color:t.vars?qfe(t.vars.palette.AppBar.darkColor,"var(--AppBar-color)"):null})}},{props:{color:"transparent"},style:{"--AppBar-background":"transparent","--AppBar-color":"inherit",backgroundColor:"var(--AppBar-background)",color:"var(--AppBar-color)",...t.applyStyles("dark",{backgroundImage:"none"})}}]}))),wAe=D.forwardRef(function(e,n){const r=wt({props:e,name:"MuiAppBar"}),{className:i,color:o="primary",enableColorOnDark:s=!1,position:a="fixed",...l}=r,c={...r,color:o,position:a,enableColorOnDark:s},u=Ort(c);return C.jsx(Ert,{square:!0,component:"header",ownerState:c,elevation:4,className:Oe(u.root,i,a==="fixed"&&"mui-fixed"),ref:n,...l})});var hl="top",Su="bottom",Cu="right",pl="left",mee="auto",MM=[hl,Su,Cu,pl],yS="start",iA="end",Trt="clippingParents",_Ae="viewport",kE="popper",krt="reference",Xfe=MM.reduce(function(t,e){return t.concat([e+"-"+yS,e+"-"+iA])},[]),SAe=[].concat(MM,[mee]).reduce(function(t,e){return t.concat([e,e+"-"+yS,e+"-"+iA])},[]),Art="beforeRead",Prt="read",Mrt="afterRead",Rrt="beforeMain",Drt="main",Irt="afterMain",Lrt="beforeWrite",$rt="write",Frt="afterWrite",Nrt=[Art,Prt,Mrt,Rrt,Drt,Irt,Lrt,$rt,Frt];function Ch(t){return t?(t.nodeName||"").toLowerCase():null}function _c(t){if(t==null)return window;if(t.toString()!=="[object Window]"){var e=t.ownerDocument;return e&&e.defaultView||window}return t}function t1(t){var e=_c(t).Element;return t instanceof e||t instanceof Element}function fu(t){var e=_c(t).HTMLElement;return t instanceof e||t instanceof HTMLElement}function vee(t){if(typeof ShadowRoot>"u")return!1;var e=_c(t).ShadowRoot;return t instanceof e||t instanceof ShadowRoot}function zrt(t){var e=t.state;Object.keys(e.elements).forEach(function(n){var r=e.styles[n]||{},i=e.attributes[n]||{},o=e.elements[n];!fu(o)||!Ch(o)||(Object.assign(o.style,r),Object.keys(i).forEach(function(s){var a=i[s];a===!1?o.removeAttribute(s):o.setAttribute(s,a===!0?"":a)}))})}function jrt(t){var e=t.state,n={popper:{position:e.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(e.elements.popper.style,n.popper),e.styles=n,e.elements.arrow&&Object.assign(e.elements.arrow.style,n.arrow),function(){Object.keys(e.elements).forEach(function(r){var i=e.elements[r],o=e.attributes[r]||{},s=Object.keys(e.styles.hasOwnProperty(r)?e.styles[r]:n[r]),a=s.reduce(function(l,c){return l[c]="",l},{});!fu(i)||!Ch(i)||(Object.assign(i.style,a),Object.keys(o).forEach(function(l){i.removeAttribute(l)}))})}}const Brt={name:"applyStyles",enabled:!0,phase:"write",fn:zrt,effect:jrt,requires:["computeStyles"]};function fh(t){return t.split("-")[0]}var Ax=Math.max,$F=Math.min,xS=Math.round;function UH(){var t=navigator.userAgentData;return t!=null&&t.brands&&Array.isArray(t.brands)?t.brands.map(function(e){return e.brand+"/"+e.version}).join(" "):navigator.userAgent}function CAe(){return!/^((?!chrome|android).)*safari/i.test(UH())}function bS(t,e,n){e===void 0&&(e=!1),n===void 0&&(n=!1);var r=t.getBoundingClientRect(),i=1,o=1;e&&fu(t)&&(i=t.offsetWidth>0&&xS(r.width)/t.offsetWidth||1,o=t.offsetHeight>0&&xS(r.height)/t.offsetHeight||1);var s=t1(t)?_c(t):window,a=s.visualViewport,l=!CAe()&&n,c=(r.left+(l&&a?a.offsetLeft:0))/i,u=(r.top+(l&&a?a.offsetTop:0))/o,f=r.width/i,d=r.height/o;return{width:f,height:d,top:u,right:c+f,bottom:u+d,left:c,x:c,y:u}}function yee(t){var e=bS(t),n=t.offsetWidth,r=t.offsetHeight;return Math.abs(e.width-n)<=1&&(n=e.width),Math.abs(e.height-r)<=1&&(r=e.height),{x:t.offsetLeft,y:t.offsetTop,width:n,height:r}}function OAe(t,e){var n=e.getRootNode&&e.getRootNode();if(t.contains(e))return!0;if(n&&vee(n)){var r=e;do{if(r&&t.isSameNode(r))return!0;r=r.parentNode||r.host}while(r)}return!1}function Mg(t){return _c(t).getComputedStyle(t)}function Urt(t){return["table","td","th"].indexOf(Ch(t))>=0}function Ry(t){return((t1(t)?t.ownerDocument:t.document)||window.document).documentElement}function m4(t){return Ch(t)==="html"?t:t.assignedSlot||t.parentNode||(vee(t)?t.host:null)||Ry(t)}function Yfe(t){return!fu(t)||Mg(t).position==="fixed"?null:t.offsetParent}function Wrt(t){var e=/firefox/i.test(UH()),n=/Trident/i.test(UH());if(n&&fu(t)){var r=Mg(t);if(r.position==="fixed")return null}var i=m4(t);for(vee(i)&&(i=i.host);fu(i)&&["html","body"].indexOf(Ch(i))<0;){var o=Mg(i);if(o.transform!=="none"||o.perspective!=="none"||o.contain==="paint"||["transform","perspective"].indexOf(o.willChange)!==-1||e&&o.willChange==="filter"||e&&o.filter&&o.filter!=="none")return i;i=i.parentNode}return null}function RM(t){for(var e=_c(t),n=Yfe(t);n&&Urt(n)&&Mg(n).position==="static";)n=Yfe(n);return n&&(Ch(n)==="html"||Ch(n)==="body"&&Mg(n).position==="static")?e:n||Wrt(t)||e}function xee(t){return["top","bottom"].indexOf(t)>=0?"x":"y"}function YT(t,e,n){return Ax(t,$F(e,n))}function Vrt(t,e,n){var r=YT(t,e,n);return r>n?n:r}function EAe(){return{top:0,right:0,bottom:0,left:0}}function TAe(t){return Object.assign({},EAe(),t)}function kAe(t,e){return e.reduce(function(n,r){return n[r]=t,n},{})}var Grt=function(e,n){return e=typeof e=="function"?e(Object.assign({},n.rects,{placement:n.placement})):e,TAe(typeof e!="number"?e:kAe(e,MM))};function Hrt(t){var e,n=t.state,r=t.name,i=t.options,o=n.elements.arrow,s=n.modifiersData.popperOffsets,a=fh(n.placement),l=xee(a),c=[pl,Cu].indexOf(a)>=0,u=c?"height":"width";if(!(!o||!s)){var f=Grt(i.padding,n),d=yee(o),h=l==="y"?hl:pl,p=l==="y"?Su:Cu,g=n.rects.reference[u]+n.rects.reference[l]-s[l]-n.rects.popper[u],m=s[l]-n.rects.reference[l],v=RM(o),y=v?l==="y"?v.clientHeight||0:v.clientWidth||0:0,x=g/2-m/2,b=f[h],w=y-d[u]-f[p],_=y/2-d[u]/2+x,S=YT(b,_,w),O=l;n.modifiersData[r]=(e={},e[O]=S,e.centerOffset=S-_,e)}}function qrt(t){var e=t.state,n=t.options,r=n.element,i=r===void 0?"[data-popper-arrow]":r;i!=null&&(typeof i=="string"&&(i=e.elements.popper.querySelector(i),!i)||OAe(e.elements.popper,i)&&(e.elements.arrow=i))}const Xrt={name:"arrow",enabled:!0,phase:"main",fn:Hrt,effect:qrt,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function wS(t){return t.split("-")[1]}var Yrt={top:"auto",right:"auto",bottom:"auto",left:"auto"};function Qrt(t,e){var n=t.x,r=t.y,i=e.devicePixelRatio||1;return{x:xS(n*i)/i||0,y:xS(r*i)/i||0}}function Qfe(t){var e,n=t.popper,r=t.popperRect,i=t.placement,o=t.variation,s=t.offsets,a=t.position,l=t.gpuAcceleration,c=t.adaptive,u=t.roundOffsets,f=t.isFixed,d=s.x,h=d===void 0?0:d,p=s.y,g=p===void 0?0:p,m=typeof u=="function"?u({x:h,y:g}):{x:h,y:g};h=m.x,g=m.y;var v=s.hasOwnProperty("x"),y=s.hasOwnProperty("y"),x=pl,b=hl,w=window;if(c){var _=RM(n),S="clientHeight",O="clientWidth";if(_===_c(n)&&(_=Ry(n),Mg(_).position!=="static"&&a==="absolute"&&(S="scrollHeight",O="scrollWidth")),_=_,i===hl||(i===pl||i===Cu)&&o===iA){b=Su;var k=f&&_===w&&w.visualViewport?w.visualViewport.height:_[S];g-=k-r.height,g*=l?1:-1}if(i===pl||(i===hl||i===Su)&&o===iA){x=Cu;var E=f&&_===w&&w.visualViewport?w.visualViewport.width:_[O];h-=E-r.width,h*=l?1:-1}}var M=Object.assign({position:a},c&&Yrt),A=u===!0?Qrt({x:h,y:g},_c(n)):{x:h,y:g};if(h=A.x,g=A.y,l){var P;return Object.assign({},M,(P={},P[b]=y?"0":"",P[x]=v?"0":"",P.transform=(w.devicePixelRatio||1)<=1?"translate("+h+"px, "+g+"px)":"translate3d("+h+"px, "+g+"px, 0)",P))}return Object.assign({},M,(e={},e[b]=y?g+"px":"",e[x]=v?h+"px":"",e.transform="",e))}function Krt(t){var e=t.state,n=t.options,r=n.gpuAcceleration,i=r===void 0?!0:r,o=n.adaptive,s=o===void 0?!0:o,a=n.roundOffsets,l=a===void 0?!0:a,c={placement:fh(e.placement),variation:wS(e.placement),popper:e.elements.popper,popperRect:e.rects.popper,gpuAcceleration:i,isFixed:e.options.strategy==="fixed"};e.modifiersData.popperOffsets!=null&&(e.styles.popper=Object.assign({},e.styles.popper,Qfe(Object.assign({},c,{offsets:e.modifiersData.popperOffsets,position:e.options.strategy,adaptive:s,roundOffsets:l})))),e.modifiersData.arrow!=null&&(e.styles.arrow=Object.assign({},e.styles.arrow,Qfe(Object.assign({},c,{offsets:e.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:l})))),e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-placement":e.placement})}const Zrt={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:Krt,data:{}};var ZD={passive:!0};function Jrt(t){var e=t.state,n=t.instance,r=t.options,i=r.scroll,o=i===void 0?!0:i,s=r.resize,a=s===void 0?!0:s,l=_c(e.elements.popper),c=[].concat(e.scrollParents.reference,e.scrollParents.popper);return o&&c.forEach(function(u){u.addEventListener("scroll",n.update,ZD)}),a&&l.addEventListener("resize",n.update,ZD),function(){o&&c.forEach(function(u){u.removeEventListener("scroll",n.update,ZD)}),a&&l.removeEventListener("resize",n.update,ZD)}}const eit={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:Jrt,data:{}};var tit={left:"right",right:"left",bottom:"top",top:"bottom"};function a3(t){return t.replace(/left|right|bottom|top/g,function(e){return tit[e]})}var nit={start:"end",end:"start"};function Kfe(t){return t.replace(/start|end/g,function(e){return nit[e]})}function bee(t){var e=_c(t),n=e.pageXOffset,r=e.pageYOffset;return{scrollLeft:n,scrollTop:r}}function wee(t){return bS(Ry(t)).left+bee(t).scrollLeft}function rit(t,e){var n=_c(t),r=Ry(t),i=n.visualViewport,o=r.clientWidth,s=r.clientHeight,a=0,l=0;if(i){o=i.width,s=i.height;var c=CAe();(c||!c&&e==="fixed")&&(a=i.offsetLeft,l=i.offsetTop)}return{width:o,height:s,x:a+wee(t),y:l}}function iit(t){var e,n=Ry(t),r=bee(t),i=(e=t.ownerDocument)==null?void 0:e.body,o=Ax(n.scrollWidth,n.clientWidth,i?i.scrollWidth:0,i?i.clientWidth:0),s=Ax(n.scrollHeight,n.clientHeight,i?i.scrollHeight:0,i?i.clientHeight:0),a=-r.scrollLeft+wee(t),l=-r.scrollTop;return Mg(i||n).direction==="rtl"&&(a+=Ax(n.clientWidth,i?i.clientWidth:0)-o),{width:o,height:s,x:a,y:l}}function _ee(t){var e=Mg(t),n=e.overflow,r=e.overflowX,i=e.overflowY;return/auto|scroll|overlay|hidden/.test(n+i+r)}function AAe(t){return["html","body","#document"].indexOf(Ch(t))>=0?t.ownerDocument.body:fu(t)&&_ee(t)?t:AAe(m4(t))}function QT(t,e){var n;e===void 0&&(e=[]);var r=AAe(t),i=r===((n=t.ownerDocument)==null?void 0:n.body),o=_c(r),s=i?[o].concat(o.visualViewport||[],_ee(r)?r:[]):r,a=e.concat(s);return i?a:a.concat(QT(m4(s)))}function WH(t){return Object.assign({},t,{left:t.x,top:t.y,right:t.x+t.width,bottom:t.y+t.height})}function oit(t,e){var n=bS(t,!1,e==="fixed");return n.top=n.top+t.clientTop,n.left=n.left+t.clientLeft,n.bottom=n.top+t.clientHeight,n.right=n.left+t.clientWidth,n.width=t.clientWidth,n.height=t.clientHeight,n.x=n.left,n.y=n.top,n}function Zfe(t,e,n){return e===_Ae?WH(rit(t,n)):t1(e)?oit(e,n):WH(iit(Ry(t)))}function sit(t){var e=QT(m4(t)),n=["absolute","fixed"].indexOf(Mg(t).position)>=0,r=n&&fu(t)?RM(t):t;return t1(r)?e.filter(function(i){return t1(i)&&OAe(i,r)&&Ch(i)!=="body"}):[]}function ait(t,e,n,r){var i=e==="clippingParents"?sit(t):[].concat(e),o=[].concat(i,[n]),s=o[0],a=o.reduce(function(l,c){var u=Zfe(t,c,r);return l.top=Ax(u.top,l.top),l.right=$F(u.right,l.right),l.bottom=$F(u.bottom,l.bottom),l.left=Ax(u.left,l.left),l},Zfe(t,s,r));return a.width=a.right-a.left,a.height=a.bottom-a.top,a.x=a.left,a.y=a.top,a}function PAe(t){var e=t.reference,n=t.element,r=t.placement,i=r?fh(r):null,o=r?wS(r):null,s=e.x+e.width/2-n.width/2,a=e.y+e.height/2-n.height/2,l;switch(i){case hl:l={x:s,y:e.y-n.height};break;case Su:l={x:s,y:e.y+e.height};break;case Cu:l={x:e.x+e.width,y:a};break;case pl:l={x:e.x-n.width,y:a};break;default:l={x:e.x,y:e.y}}var c=i?xee(i):null;if(c!=null){var u=c==="y"?"height":"width";switch(o){case yS:l[c]=l[c]-(e[u]/2-n[u]/2);break;case iA:l[c]=l[c]+(e[u]/2-n[u]/2);break}}return l}function oA(t,e){e===void 0&&(e={});var n=e,r=n.placement,i=r===void 0?t.placement:r,o=n.strategy,s=o===void 0?t.strategy:o,a=n.boundary,l=a===void 0?Trt:a,c=n.rootBoundary,u=c===void 0?_Ae:c,f=n.elementContext,d=f===void 0?kE:f,h=n.altBoundary,p=h===void 0?!1:h,g=n.padding,m=g===void 0?0:g,v=TAe(typeof m!="number"?m:kAe(m,MM)),y=d===kE?krt:kE,x=t.rects.popper,b=t.elements[p?y:d],w=ait(t1(b)?b:b.contextElement||Ry(t.elements.popper),l,u,s),_=bS(t.elements.reference),S=PAe({reference:_,element:x,strategy:"absolute",placement:i}),O=WH(Object.assign({},x,S)),k=d===kE?O:_,E={top:w.top-k.top+v.top,bottom:k.bottom-w.bottom+v.bottom,left:w.left-k.left+v.left,right:k.right-w.right+v.right},M=t.modifiersData.offset;if(d===kE&&M){var A=M[i];Object.keys(E).forEach(function(P){var T=[Cu,Su].indexOf(P)>=0?1:-1,R=[hl,Su].indexOf(P)>=0?"y":"x";E[P]+=A[R]*T})}return E}function lit(t,e){e===void 0&&(e={});var n=e,r=n.placement,i=n.boundary,o=n.rootBoundary,s=n.padding,a=n.flipVariations,l=n.allowedAutoPlacements,c=l===void 0?SAe:l,u=wS(r),f=u?a?Xfe:Xfe.filter(function(p){return wS(p)===u}):MM,d=f.filter(function(p){return c.indexOf(p)>=0});d.length===0&&(d=f);var h=d.reduce(function(p,g){return p[g]=oA(t,{placement:g,boundary:i,rootBoundary:o,padding:s})[fh(g)],p},{});return Object.keys(h).sort(function(p,g){return h[p]-h[g]})}function cit(t){if(fh(t)===mee)return[];var e=a3(t);return[Kfe(t),e,Kfe(e)]}function uit(t){var e=t.state,n=t.options,r=t.name;if(!e.modifiersData[r]._skip){for(var i=n.mainAxis,o=i===void 0?!0:i,s=n.altAxis,a=s===void 0?!0:s,l=n.fallbackPlacements,c=n.padding,u=n.boundary,f=n.rootBoundary,d=n.altBoundary,h=n.flipVariations,p=h===void 0?!0:h,g=n.allowedAutoPlacements,m=e.options.placement,v=fh(m),y=v===m,x=l||(y||!p?[a3(m)]:cit(m)),b=[m].concat(x).reduce(function(H,q){return H.concat(fh(q)===mee?lit(e,{placement:q,boundary:u,rootBoundary:f,padding:c,flipVariations:p,allowedAutoPlacements:g}):q)},[]),w=e.rects.reference,_=e.rects.popper,S=new Map,O=!0,k=b[0],E=0;E=0,R=T?"width":"height",I=oA(e,{placement:M,boundary:u,rootBoundary:f,altBoundary:d,padding:c}),B=T?P?Cu:pl:P?Su:hl;w[R]>_[R]&&(B=a3(B));var $=a3(B),z=[];if(o&&z.push(I[A]<=0),a&&z.push(I[B]<=0,I[$]<=0),z.every(function(H){return H})){k=M,O=!1;break}S.set(M,z)}if(O)for(var L=p?3:1,j=function(q){var Y=b.find(function(le){var K=S.get(le);if(K)return K.slice(0,q).every(function(ee){return ee})});if(Y)return k=Y,"break"},N=L;N>0;N--){var F=j(N);if(F==="break")break}e.placement!==k&&(e.modifiersData[r]._skip=!0,e.placement=k,e.reset=!0)}}const fit={name:"flip",enabled:!0,phase:"main",fn:uit,requiresIfExists:["offset"],data:{_skip:!1}};function Jfe(t,e,n){return n===void 0&&(n={x:0,y:0}),{top:t.top-e.height-n.y,right:t.right-e.width+n.x,bottom:t.bottom-e.height+n.y,left:t.left-e.width-n.x}}function ede(t){return[hl,Cu,Su,pl].some(function(e){return t[e]>=0})}function dit(t){var e=t.state,n=t.name,r=e.rects.reference,i=e.rects.popper,o=e.modifiersData.preventOverflow,s=oA(e,{elementContext:"reference"}),a=oA(e,{altBoundary:!0}),l=Jfe(s,r),c=Jfe(a,i,o),u=ede(l),f=ede(c);e.modifiersData[n]={referenceClippingOffsets:l,popperEscapeOffsets:c,isReferenceHidden:u,hasPopperEscaped:f},e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-reference-hidden":u,"data-popper-escaped":f})}const hit={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:dit};function pit(t,e,n){var r=fh(t),i=[pl,hl].indexOf(r)>=0?-1:1,o=typeof n=="function"?n(Object.assign({},e,{placement:t})):n,s=o[0],a=o[1];return s=s||0,a=(a||0)*i,[pl,Cu].indexOf(r)>=0?{x:a,y:s}:{x:s,y:a}}function git(t){var e=t.state,n=t.options,r=t.name,i=n.offset,o=i===void 0?[0,0]:i,s=SAe.reduce(function(u,f){return u[f]=pit(f,e.rects,o),u},{}),a=s[e.placement],l=a.x,c=a.y;e.modifiersData.popperOffsets!=null&&(e.modifiersData.popperOffsets.x+=l,e.modifiersData.popperOffsets.y+=c),e.modifiersData[r]=s}const mit={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:git};function vit(t){var e=t.state,n=t.name;e.modifiersData[n]=PAe({reference:e.rects.reference,element:e.rects.popper,strategy:"absolute",placement:e.placement})}const yit={name:"popperOffsets",enabled:!0,phase:"read",fn:vit,data:{}};function xit(t){return t==="x"?"y":"x"}function bit(t){var e=t.state,n=t.options,r=t.name,i=n.mainAxis,o=i===void 0?!0:i,s=n.altAxis,a=s===void 0?!1:s,l=n.boundary,c=n.rootBoundary,u=n.altBoundary,f=n.padding,d=n.tether,h=d===void 0?!0:d,p=n.tetherOffset,g=p===void 0?0:p,m=oA(e,{boundary:l,rootBoundary:c,padding:f,altBoundary:u}),v=fh(e.placement),y=wS(e.placement),x=!y,b=xee(v),w=xit(b),_=e.modifiersData.popperOffsets,S=e.rects.reference,O=e.rects.popper,k=typeof g=="function"?g(Object.assign({},e.rects,{placement:e.placement})):g,E=typeof k=="number"?{mainAxis:k,altAxis:k}:Object.assign({mainAxis:0,altAxis:0},k),M=e.modifiersData.offset?e.modifiersData.offset[e.placement]:null,A={x:0,y:0};if(_){if(o){var P,T=b==="y"?hl:pl,R=b==="y"?Su:Cu,I=b==="y"?"height":"width",B=_[b],$=B+m[T],z=B-m[R],L=h?-O[I]/2:0,j=y===yS?S[I]:O[I],N=y===yS?-O[I]:-S[I],F=e.elements.arrow,H=h&&F?yee(F):{width:0,height:0},q=e.modifiersData["arrow#persistent"]?e.modifiersData["arrow#persistent"].padding:EAe(),Y=q[T],le=q[R],K=YT(0,S[I],H[I]),ee=x?S[I]/2-L-K-Y-E.mainAxis:j-K-Y-E.mainAxis,re=x?-S[I]/2+L+K+le+E.mainAxis:N+K+le+E.mainAxis,me=e.elements.arrow&&RM(e.elements.arrow),te=me?b==="y"?me.clientTop||0:me.clientLeft||0:0,ae=(P=M==null?void 0:M[b])!=null?P:0,U=B+ee-ae-te,oe=B+re-ae,ne=YT(h?$F($,U):$,B,h?Ax(z,oe):z);_[b]=ne,A[b]=ne-B}if(a){var V,X=b==="x"?hl:pl,Z=b==="x"?Su:Cu,he=_[w],xe=w==="y"?"height":"width",G=he+m[X],W=he-m[Z],J=[hl,pl].indexOf(v)!==-1,se=(V=M==null?void 0:M[w])!=null?V:0,ye=J?G:he-S[xe]-O[xe]-se+E.altAxis,ie=J?he+S[xe]+O[xe]-se-E.altAxis:W,fe=h&&J?Vrt(ye,he,ie):YT(h?ye:G,he,h?ie:W);_[w]=fe,A[w]=fe-he}e.modifiersData[r]=A}}const wit={name:"preventOverflow",enabled:!0,phase:"main",fn:bit,requiresIfExists:["offset"]};function _it(t){return{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}}function Sit(t){return t===_c(t)||!fu(t)?bee(t):_it(t)}function Cit(t){var e=t.getBoundingClientRect(),n=xS(e.width)/t.offsetWidth||1,r=xS(e.height)/t.offsetHeight||1;return n!==1||r!==1}function Oit(t,e,n){n===void 0&&(n=!1);var r=fu(e),i=fu(e)&&Cit(e),o=Ry(e),s=bS(t,i,n),a={scrollLeft:0,scrollTop:0},l={x:0,y:0};return(r||!r&&!n)&&((Ch(e)!=="body"||_ee(o))&&(a=Sit(e)),fu(e)?(l=bS(e,!0),l.x+=e.clientLeft,l.y+=e.clientTop):o&&(l.x=wee(o))),{x:s.left+a.scrollLeft-l.x,y:s.top+a.scrollTop-l.y,width:s.width,height:s.height}}function Eit(t){var e=new Map,n=new Set,r=[];t.forEach(function(o){e.set(o.name,o)});function i(o){n.add(o.name);var s=[].concat(o.requires||[],o.requiresIfExists||[]);s.forEach(function(a){if(!n.has(a)){var l=e.get(a);l&&i(l)}}),r.push(o)}return t.forEach(function(o){n.has(o.name)||i(o)}),r}function Tit(t){var e=Eit(t);return Nrt.reduce(function(n,r){return n.concat(e.filter(function(i){return i.phase===r}))},[])}function kit(t){var e;return function(){return e||(e=new Promise(function(n){Promise.resolve().then(function(){e=void 0,n(t())})})),e}}function Ait(t){var e=t.reduce(function(n,r){var i=n[r.name];return n[r.name]=i?Object.assign({},i,r,{options:Object.assign({},i.options,r.options),data:Object.assign({},i.data,r.data)}):r,n},{});return Object.keys(e).map(function(n){return e[n]})}var tde={placement:"bottom",modifiers:[],strategy:"absolute"};function nde(){for(var t=arguments.length,e=new Array(t),n=0;n{o||a(Dit(i)||document.body)},[i,o]),Ei(()=>{if(s&&!o)return FH(n,s),()=>{FH(n,null)}},[n,s,o]),o){if(D.isValidElement(r)){const c={ref:l};return D.cloneElement(r,c)}return C.jsx(D.Fragment,{children:r})}return C.jsx(D.Fragment,{children:s&&qC.createPortal(r,s)})});function Iit(t){return Ye("MuiPopper",t)}qe("MuiPopper",["root"]);function Lit(t,e){if(e==="ltr")return t;switch(t){case"bottom-end":return"bottom-start";case"bottom-start":return"bottom-end";case"top-end":return"top-start";case"top-start":return"top-end";default:return t}}function VH(t){return typeof t=="function"?t():t}function $it(t){return t.nodeType!==void 0}const Fit=t=>{const{classes:e}=t;return Xe({root:["root"]},Iit,e)},Nit={},zit=D.forwardRef(function(e,n){const{anchorEl:r,children:i,direction:o,disablePortal:s,modifiers:a,open:l,placement:c,popperOptions:u,popperRef:f,slotProps:d={},slots:h={},TransitionProps:p,ownerState:g,...m}=e,v=D.useRef(null),y=dn(v,n),x=D.useRef(null),b=dn(x,f),w=D.useRef(b);Ei(()=>{w.current=b},[b]),D.useImperativeHandle(f,()=>x.current,[]);const _=Lit(c,o),[S,O]=D.useState(_),[k,E]=D.useState(VH(r));D.useEffect(()=>{x.current&&x.current.forceUpdate()}),D.useEffect(()=>{r&&E(VH(r))},[r]),Ei(()=>{if(!k||!l)return;const R=$=>{O($.placement)};let I=[{name:"preventOverflow",options:{altBoundary:s}},{name:"flip",options:{altBoundary:s}},{name:"onUpdate",enabled:!0,phase:"afterWrite",fn:({state:$})=>{R($)}}];a!=null&&(I=I.concat(a)),u&&u.modifiers!=null&&(I=I.concat(u.modifiers));const B=Rit(k,v.current,{placement:_,...u,modifiers:I});return w.current(B),()=>{B.destroy(),w.current(null)}},[k,s,a,l,u,_]);const M={placement:S};p!==null&&(M.TransitionProps=p);const A=Fit(e),P=h.root??"div",T=Zt({elementType:P,externalSlotProps:d.root,externalForwardedProps:m,additionalProps:{role:"tooltip",ref:y},ownerState:e,className:A.root});return C.jsx(P,{...T,children:typeof i=="function"?i(M):i})}),jit=D.forwardRef(function(e,n){const{anchorEl:r,children:i,container:o,direction:s="ltr",disablePortal:a=!1,keepMounted:l=!1,modifiers:c,open:u,placement:f="bottom",popperOptions:d=Nit,popperRef:h,style:p,transition:g=!1,slotProps:m={},slots:v={},...y}=e,[x,b]=D.useState(!0),w=()=>{b(!1)},_=()=>{b(!0)};if(!l&&!u&&(!g||x))return null;let S;if(o)S=o;else if(r){const E=VH(r);S=E&&$it(E)?mi(E).body:mi(null).body}const O=!u&&l&&(!g||x)?"none":void 0,k=g?{in:u,onEnter:w,onExited:_}:void 0;return C.jsx(MAe,{disablePortal:a,container:S,children:C.jsx(zit,{anchorEl:r,direction:s,disablePortal:a,modifiers:c,ref:n,open:g?!x:u,placement:f,popperOptions:d,popperRef:h,slotProps:m,slots:v,...y,style:{position:"fixed",top:0,left:0,display:O,...p},TransitionProps:k,children:i})})}),Bit=be(jit,{name:"MuiPopper",slot:"Root",overridesResolver:(t,e)=>e.root})({}),See=D.forwardRef(function(e,n){const r=Ho(),i=wt({props:e,name:"MuiPopper"}),{anchorEl:o,component:s,components:a,componentsProps:l,container:c,disablePortal:u,keepMounted:f,modifiers:d,open:h,placement:p,popperOptions:g,popperRef:m,transition:v,slots:y,slotProps:x,...b}=i,w=(y==null?void 0:y.root)??(a==null?void 0:a.Root),_={anchorEl:o,container:c,disablePortal:u,keepMounted:f,modifiers:d,open:h,placement:p,popperOptions:g,popperRef:m,transition:v,...b};return C.jsx(Bit,{as:s,direction:r?"rtl":"ltr",slots:{root:w},slotProps:x??l,..._,ref:n})}),Uit=lt(C.jsx("path",{d:"M12 2C6.47 2 2 6.47 2 12s4.47 10 10 10 10-4.47 10-10S17.53 2 12 2zm5 13.59L15.59 17 12 13.41 8.41 17 7 15.59 10.59 12 7 8.41 8.41 7 12 10.59 15.59 7 17 8.41 13.41 12 17 15.59z"}),"Cancel");function Wit(t){return Ye("MuiChip",t)}const Cn=qe("MuiChip",["root","sizeSmall","sizeMedium","colorDefault","colorError","colorInfo","colorPrimary","colorSecondary","colorSuccess","colorWarning","disabled","clickable","clickableColorPrimary","clickableColorSecondary","deletable","deletableColorPrimary","deletableColorSecondary","outlined","filled","outlinedPrimary","outlinedSecondary","filledPrimary","filledSecondary","avatar","avatarSmall","avatarMedium","avatarColorPrimary","avatarColorSecondary","icon","iconSmall","iconMedium","iconColorPrimary","iconColorSecondary","label","labelSmall","labelMedium","deleteIcon","deleteIconSmall","deleteIconMedium","deleteIconColorPrimary","deleteIconColorSecondary","deleteIconOutlinedColorPrimary","deleteIconOutlinedColorSecondary","deleteIconFilledColorPrimary","deleteIconFilledColorSecondary","focusVisible"]),Vit=t=>{const{classes:e,disabled:n,size:r,color:i,iconColor:o,onDelete:s,clickable:a,variant:l}=t,c={root:["root",l,n&&"disabled",`size${De(r)}`,`color${De(i)}`,a&&"clickable",a&&`clickableColor${De(i)}`,s&&"deletable",s&&`deletableColor${De(i)}`,`${l}${De(i)}`],label:["label",`label${De(r)}`],avatar:["avatar",`avatar${De(r)}`,`avatarColor${De(i)}`],icon:["icon",`icon${De(r)}`,`iconColor${De(o)}`],deleteIcon:["deleteIcon",`deleteIcon${De(r)}`,`deleteIconColor${De(i)}`,`deleteIcon${De(l)}Color${De(i)}`]};return Xe(c,Wit,e)},Git=be("div",{name:"MuiChip",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t,{color:r,iconColor:i,clickable:o,onDelete:s,size:a,variant:l}=n;return[{[`& .${Cn.avatar}`]:e.avatar},{[`& .${Cn.avatar}`]:e[`avatar${De(a)}`]},{[`& .${Cn.avatar}`]:e[`avatarColor${De(r)}`]},{[`& .${Cn.icon}`]:e.icon},{[`& .${Cn.icon}`]:e[`icon${De(a)}`]},{[`& .${Cn.icon}`]:e[`iconColor${De(i)}`]},{[`& .${Cn.deleteIcon}`]:e.deleteIcon},{[`& .${Cn.deleteIcon}`]:e[`deleteIcon${De(a)}`]},{[`& .${Cn.deleteIcon}`]:e[`deleteIconColor${De(r)}`]},{[`& .${Cn.deleteIcon}`]:e[`deleteIcon${De(l)}Color${De(r)}`]},e.root,e[`size${De(a)}`],e[`color${De(r)}`],o&&e.clickable,o&&r!=="default"&&e[`clickableColor${De(r)})`],s&&e.deletable,s&&r!=="default"&&e[`deletableColor${De(r)}`],e[l],e[`${l}${De(r)}`]]}})(kt(({theme:t})=>{const e=t.palette.mode==="light"?t.palette.grey[700]:t.palette.grey[300];return{maxWidth:"100%",fontFamily:t.typography.fontFamily,fontSize:t.typography.pxToRem(13),display:"inline-flex",alignItems:"center",justifyContent:"center",height:32,color:(t.vars||t).palette.text.primary,backgroundColor:(t.vars||t).palette.action.selected,borderRadius:32/2,whiteSpace:"nowrap",transition:t.transitions.create(["background-color","box-shadow"]),cursor:"unset",outline:0,textDecoration:"none",border:0,padding:0,verticalAlign:"middle",boxSizing:"border-box",[`&.${Cn.disabled}`]:{opacity:(t.vars||t).palette.action.disabledOpacity,pointerEvents:"none"},[`& .${Cn.avatar}`]:{marginLeft:5,marginRight:-6,width:24,height:24,color:t.vars?t.vars.palette.Chip.defaultAvatarColor:e,fontSize:t.typography.pxToRem(12)},[`& .${Cn.avatarColorPrimary}`]:{color:(t.vars||t).palette.primary.contrastText,backgroundColor:(t.vars||t).palette.primary.dark},[`& .${Cn.avatarColorSecondary}`]:{color:(t.vars||t).palette.secondary.contrastText,backgroundColor:(t.vars||t).palette.secondary.dark},[`& .${Cn.avatarSmall}`]:{marginLeft:4,marginRight:-4,width:18,height:18,fontSize:t.typography.pxToRem(10)},[`& .${Cn.icon}`]:{marginLeft:5,marginRight:-6},[`& .${Cn.deleteIcon}`]:{WebkitTapHighlightColor:"transparent",color:t.vars?`rgba(${t.vars.palette.text.primaryChannel} / 0.26)`:Tt(t.palette.text.primary,.26),fontSize:22,cursor:"pointer",margin:"0 5px 0 -6px","&:hover":{color:t.vars?`rgba(${t.vars.palette.text.primaryChannel} / 0.4)`:Tt(t.palette.text.primary,.4)}},variants:[{props:{size:"small"},style:{height:24,[`& .${Cn.icon}`]:{fontSize:18,marginLeft:4,marginRight:-4},[`& .${Cn.deleteIcon}`]:{fontSize:16,marginRight:4,marginLeft:-4}}},...Object.entries(t.palette).filter(di(["contrastText"])).map(([n])=>({props:{color:n},style:{backgroundColor:(t.vars||t).palette[n].main,color:(t.vars||t).palette[n].contrastText,[`& .${Cn.deleteIcon}`]:{color:t.vars?`rgba(${t.vars.palette[n].contrastTextChannel} / 0.7)`:Tt(t.palette[n].contrastText,.7),"&:hover, &:active":{color:(t.vars||t).palette[n].contrastText}}}})),{props:n=>n.iconColor===n.color,style:{[`& .${Cn.icon}`]:{color:t.vars?t.vars.palette.Chip.defaultIconColor:e}}},{props:n=>n.iconColor===n.color&&n.color!=="default",style:{[`& .${Cn.icon}`]:{color:"inherit"}}},{props:{onDelete:!0},style:{[`&.${Cn.focusVisible}`]:{backgroundColor:t.vars?`rgba(${t.vars.palette.action.selectedChannel} / calc(${t.vars.palette.action.selectedOpacity} + ${t.vars.palette.action.focusOpacity}))`:Tt(t.palette.action.selected,t.palette.action.selectedOpacity+t.palette.action.focusOpacity)}}},...Object.entries(t.palette).filter(di(["dark"])).map(([n])=>({props:{color:n,onDelete:!0},style:{[`&.${Cn.focusVisible}`]:{background:(t.vars||t).palette[n].dark}}})),{props:{clickable:!0},style:{userSelect:"none",WebkitTapHighlightColor:"transparent",cursor:"pointer","&:hover":{backgroundColor:t.vars?`rgba(${t.vars.palette.action.selectedChannel} / calc(${t.vars.palette.action.selectedOpacity} + ${t.vars.palette.action.hoverOpacity}))`:Tt(t.palette.action.selected,t.palette.action.selectedOpacity+t.palette.action.hoverOpacity)},[`&.${Cn.focusVisible}`]:{backgroundColor:t.vars?`rgba(${t.vars.palette.action.selectedChannel} / calc(${t.vars.palette.action.selectedOpacity} + ${t.vars.palette.action.focusOpacity}))`:Tt(t.palette.action.selected,t.palette.action.selectedOpacity+t.palette.action.focusOpacity)},"&:active":{boxShadow:(t.vars||t).shadows[1]}}},...Object.entries(t.palette).filter(di(["dark"])).map(([n])=>({props:{color:n,clickable:!0},style:{[`&:hover, &.${Cn.focusVisible}`]:{backgroundColor:(t.vars||t).palette[n].dark}}})),{props:{variant:"outlined"},style:{backgroundColor:"transparent",border:t.vars?`1px solid ${t.vars.palette.Chip.defaultBorder}`:`1px solid ${t.palette.mode==="light"?t.palette.grey[400]:t.palette.grey[700]}`,[`&.${Cn.clickable}:hover`]:{backgroundColor:(t.vars||t).palette.action.hover},[`&.${Cn.focusVisible}`]:{backgroundColor:(t.vars||t).palette.action.focus},[`& .${Cn.avatar}`]:{marginLeft:4},[`& .${Cn.avatarSmall}`]:{marginLeft:2},[`& .${Cn.icon}`]:{marginLeft:4},[`& .${Cn.iconSmall}`]:{marginLeft:2},[`& .${Cn.deleteIcon}`]:{marginRight:5},[`& .${Cn.deleteIconSmall}`]:{marginRight:3}}},...Object.entries(t.palette).filter(di()).map(([n])=>({props:{variant:"outlined",color:n},style:{color:(t.vars||t).palette[n].main,border:`1px solid ${t.vars?`rgba(${t.vars.palette[n].mainChannel} / 0.7)`:Tt(t.palette[n].main,.7)}`,[`&.${Cn.clickable}:hover`]:{backgroundColor:t.vars?`rgba(${t.vars.palette[n].mainChannel} / ${t.vars.palette.action.hoverOpacity})`:Tt(t.palette[n].main,t.palette.action.hoverOpacity)},[`&.${Cn.focusVisible}`]:{backgroundColor:t.vars?`rgba(${t.vars.palette[n].mainChannel} / ${t.vars.palette.action.focusOpacity})`:Tt(t.palette[n].main,t.palette.action.focusOpacity)},[`& .${Cn.deleteIcon}`]:{color:t.vars?`rgba(${t.vars.palette[n].mainChannel} / 0.7)`:Tt(t.palette[n].main,.7),"&:hover, &:active":{color:(t.vars||t).palette[n].main}}}}))]}})),Hit=be("span",{name:"MuiChip",slot:"Label",overridesResolver:(t,e)=>{const{ownerState:n}=t,{size:r}=n;return[e.label,e[`label${De(r)}`]]}})({overflow:"hidden",textOverflow:"ellipsis",paddingLeft:12,paddingRight:12,whiteSpace:"nowrap",variants:[{props:{variant:"outlined"},style:{paddingLeft:11,paddingRight:11}},{props:{size:"small"},style:{paddingLeft:8,paddingRight:8}},{props:{size:"small",variant:"outlined"},style:{paddingLeft:7,paddingRight:7}}]});function rde(t){return t.key==="Backspace"||t.key==="Delete"}const RAe=D.forwardRef(function(e,n){const r=wt({props:e,name:"MuiChip"}),{avatar:i,className:o,clickable:s,color:a="default",component:l,deleteIcon:c,disabled:u=!1,icon:f,label:d,onClick:h,onDelete:p,onKeyDown:g,onKeyUp:m,size:v="medium",variant:y="filled",tabIndex:x,skipFocusWhenDisabled:b=!1,...w}=r,_=D.useRef(null),S=dn(_,n),O=z=>{z.stopPropagation(),p&&p(z)},k=z=>{z.currentTarget===z.target&&rde(z)&&z.preventDefault(),g&&g(z)},E=z=>{z.currentTarget===z.target&&p&&rde(z)&&p(z),m&&m(z)},M=s!==!1&&h?!0:s,A=M||p?Nf:l||"div",P={...r,component:A,disabled:u,size:v,color:a,iconColor:D.isValidElement(f)&&f.props.color||a,onDelete:!!p,clickable:M,variant:y},T=Vit(P),R=A===Nf?{component:l||"div",focusVisibleClassName:T.focusVisible,...p&&{disableRipple:!0}}:{};let I=null;p&&(I=c&&D.isValidElement(c)?D.cloneElement(c,{className:Oe(c.props.className,T.deleteIcon),onClick:O}):C.jsx(Uit,{className:Oe(T.deleteIcon),onClick:O}));let B=null;i&&D.isValidElement(i)&&(B=D.cloneElement(i,{className:Oe(T.avatar,i.props.className)}));let $=null;return f&&D.isValidElement(f)&&($=D.cloneElement(f,{className:Oe(T.icon,f.props.className)})),C.jsxs(Git,{as:A,className:Oe(T.root,o),disabled:M&&u?!0:void 0,onClick:h,onKeyDown:k,onKeyUp:E,ref:S,tabIndex:b&&u?-1:x,ownerState:P,...R,...w,children:[B||$,C.jsx(Hit,{className:Oe(T.label),ownerState:P,children:d}),I]})});function JD(t){return parseInt(t,10)||0}const qit={shadow:{visibility:"hidden",position:"absolute",overflow:"hidden",height:0,top:0,left:0,transform:"translateZ(0)"}};function Xit(t){return t==null||Object.keys(t).length===0||t.outerHeightStyle===0&&!t.overflowing}const Yit=D.forwardRef(function(e,n){const{onChange:r,maxRows:i,minRows:o=1,style:s,value:a,...l}=e,{current:c}=D.useRef(a!=null),u=D.useRef(null),f=dn(n,u),d=D.useRef(null),h=D.useRef(null),p=D.useCallback(()=>{const v=u.current,x=bc(v).getComputedStyle(v);if(x.width==="0px")return{outerHeightStyle:0,overflowing:!1};const b=h.current;b.style.width=x.width,b.value=v.value||e.placeholder||"x",b.value.slice(-1)===` -`&&(b.value+=" ");const w=x.boxSizing,_=JD(x.paddingBottom)+JD(x.paddingTop),S=JD(x.borderBottomWidth)+JD(x.borderTopWidth),O=b.scrollHeight;b.value="x";const k=b.scrollHeight;let E=O;o&&(E=Math.max(Number(o)*k,E)),i&&(E=Math.min(Number(i)*k,E)),E=Math.max(E,k);const M=E+(w==="border-box"?_+S:0),A=Math.abs(E-O)<=1;return{outerHeightStyle:M,overflowing:A}},[i,o,e.placeholder]),g=D.useCallback(()=>{const v=p();if(Xit(v))return;const y=v.outerHeightStyle,x=u.current;d.current!==y&&(d.current=y,x.style.height=`${y}px`),x.style.overflow=v.overflowing?"hidden":""},[p]);Ei(()=>{const v=()=>{g()};let y;const x=kM(v),b=u.current,w=bc(b);w.addEventListener("resize",x);let _;return typeof ResizeObserver<"u"&&(_=new ResizeObserver(v),_.observe(b)),()=>{x.clear(),cancelAnimationFrame(y),w.removeEventListener("resize",x),_&&_.disconnect()}},[p,g]),Ei(()=>{g()});const m=v=>{c||g(),r&&r(v)};return C.jsxs(D.Fragment,{children:[C.jsx("textarea",{value:a,onChange:m,ref:f,rows:o,style:s,...l}),C.jsx("textarea",{"aria-hidden":!0,className:e.className,readOnly:!0,ref:h,tabIndex:-1,style:{...qit.shadow,...s,paddingTop:0,paddingBottom:0}})]})});function rg(t){return typeof t=="string"}function Dy({props:t,states:e,muiFormControl:n}){return e.reduce((r,i)=>(r[i]=t[i],n&&typeof t[i]>"u"&&(r[i]=n[i]),r),{})}const v4=D.createContext(void 0);function za(){return D.useContext(v4)}function ide(t){return t!=null&&!(Array.isArray(t)&&t.length===0)}function FF(t,e=!1){return t&&(ide(t.value)&&t.value!==""||e&&ide(t.defaultValue)&&t.defaultValue!=="")}function Qit(t){return t.startAdornment}function Kit(t){return Ye("MuiInputBase",t)}const _S=qe("MuiInputBase",["root","formControl","focused","disabled","adornedStart","adornedEnd","error","sizeSmall","multiline","colorSecondary","fullWidth","hiddenLabel","readOnly","input","inputSizeSmall","inputMultiline","inputTypeSearch","inputAdornedStart","inputAdornedEnd","inputHiddenLabel"]);var ode;const y4=(t,e)=>{const{ownerState:n}=t;return[e.root,n.formControl&&e.formControl,n.startAdornment&&e.adornedStart,n.endAdornment&&e.adornedEnd,n.error&&e.error,n.size==="small"&&e.sizeSmall,n.multiline&&e.multiline,n.color&&e[`color${De(n.color)}`],n.fullWidth&&e.fullWidth,n.hiddenLabel&&e.hiddenLabel]},x4=(t,e)=>{const{ownerState:n}=t;return[e.input,n.size==="small"&&e.inputSizeSmall,n.multiline&&e.inputMultiline,n.type==="search"&&e.inputTypeSearch,n.startAdornment&&e.inputAdornedStart,n.endAdornment&&e.inputAdornedEnd,n.hiddenLabel&&e.inputHiddenLabel]},Zit=t=>{const{classes:e,color:n,disabled:r,error:i,endAdornment:o,focused:s,formControl:a,fullWidth:l,hiddenLabel:c,multiline:u,readOnly:f,size:d,startAdornment:h,type:p}=t,g={root:["root",`color${De(n)}`,r&&"disabled",i&&"error",l&&"fullWidth",s&&"focused",a&&"formControl",d&&d!=="medium"&&`size${De(d)}`,u&&"multiline",h&&"adornedStart",o&&"adornedEnd",c&&"hiddenLabel",f&&"readOnly"],input:["input",r&&"disabled",p==="search"&&"inputTypeSearch",u&&"inputMultiline",d==="small"&&"inputSizeSmall",c&&"inputHiddenLabel",h&&"inputAdornedStart",o&&"inputAdornedEnd",f&&"readOnly"]};return Xe(g,Kit,e)},b4=be("div",{name:"MuiInputBase",slot:"Root",overridesResolver:y4})(kt(({theme:t})=>({...t.typography.body1,color:(t.vars||t).palette.text.primary,lineHeight:"1.4375em",boxSizing:"border-box",position:"relative",cursor:"text",display:"inline-flex",alignItems:"center",[`&.${_S.disabled}`]:{color:(t.vars||t).palette.text.disabled,cursor:"default"},variants:[{props:({ownerState:e})=>e.multiline,style:{padding:"4px 0 5px"}},{props:({ownerState:e,size:n})=>e.multiline&&n==="small",style:{paddingTop:1}},{props:({ownerState:e})=>e.fullWidth,style:{width:"100%"}}]}))),w4=be("input",{name:"MuiInputBase",slot:"Input",overridesResolver:x4})(kt(({theme:t})=>{const e=t.palette.mode==="light",n={color:"currentColor",...t.vars?{opacity:t.vars.opacity.inputPlaceholder}:{opacity:e?.42:.5},transition:t.transitions.create("opacity",{duration:t.transitions.duration.shorter})},r={opacity:"0 !important"},i=t.vars?{opacity:t.vars.opacity.inputPlaceholder}:{opacity:e?.42:.5};return{font:"inherit",letterSpacing:"inherit",color:"currentColor",padding:"4px 0 5px",border:0,boxSizing:"content-box",background:"none",height:"1.4375em",margin:0,WebkitTapHighlightColor:"transparent",display:"block",minWidth:0,width:"100%","&::-webkit-input-placeholder":n,"&::-moz-placeholder":n,"&::-ms-input-placeholder":n,"&:focus":{outline:0},"&:invalid":{boxShadow:"none"},"&::-webkit-search-decoration":{WebkitAppearance:"none"},[`label[data-shrink=false] + .${_S.formControl} &`]:{"&::-webkit-input-placeholder":r,"&::-moz-placeholder":r,"&::-ms-input-placeholder":r,"&:focus::-webkit-input-placeholder":i,"&:focus::-moz-placeholder":i,"&:focus::-ms-input-placeholder":i},[`&.${_S.disabled}`]:{opacity:1,WebkitTextFillColor:(t.vars||t).palette.text.disabled},variants:[{props:({ownerState:o})=>!o.disableInjectingGlobalStyles,style:{animationName:"mui-auto-fill-cancel",animationDuration:"10ms","&:-webkit-autofill":{animationDuration:"5000s",animationName:"mui-auto-fill"}}},{props:{size:"small"},style:{paddingTop:1}},{props:({ownerState:o})=>o.multiline,style:{height:"auto",resize:"none",padding:0,paddingTop:0}},{props:{type:"search"},style:{MozAppearance:"textfield"}}]}})),sde=uee({"@keyframes mui-auto-fill":{from:{display:"block"}},"@keyframes mui-auto-fill-cancel":{from:{display:"block"}}}),Cee=D.forwardRef(function(e,n){const r=wt({props:e,name:"MuiInputBase"}),{"aria-describedby":i,autoComplete:o,autoFocus:s,className:a,color:l,components:c={},componentsProps:u={},defaultValue:f,disabled:d,disableInjectingGlobalStyles:h,endAdornment:p,error:g,fullWidth:m=!1,id:v,inputComponent:y="input",inputProps:x={},inputRef:b,margin:w,maxRows:_,minRows:S,multiline:O=!1,name:k,onBlur:E,onChange:M,onClick:A,onFocus:P,onKeyDown:T,onKeyUp:R,placeholder:I,readOnly:B,renderSuffix:$,rows:z,size:L,slotProps:j={},slots:N={},startAdornment:F,type:H="text",value:q,...Y}=r,le=x.value!=null?x.value:q,{current:K}=D.useRef(le!=null),ee=D.useRef(),re=D.useCallback(we=>{},[]),me=dn(ee,b,x.ref,re),[te,ae]=D.useState(!1),U=za(),oe=Dy({props:r,muiFormControl:U,states:["color","disabled","error","hiddenLabel","size","required","filled"]});oe.focused=U?U.focused:te,D.useEffect(()=>{!U&&d&&te&&(ae(!1),E&&E())},[U,d,te,E]);const ne=U&&U.onFilled,V=U&&U.onEmpty,X=D.useCallback(we=>{FF(we)?ne&&ne():V&&V()},[ne,V]);Ei(()=>{K&&X({value:le})},[le,X,K]);const Z=we=>{P&&P(we),x.onFocus&&x.onFocus(we),U&&U.onFocus?U.onFocus(we):ae(!0)},he=we=>{E&&E(we),x.onBlur&&x.onBlur(we),U&&U.onBlur?U.onBlur(we):ae(!1)},xe=(we,...Ie)=>{if(!K){const Pe=we.target||ee.current;if(Pe==null)throw new Error(kg(1));X({value:Pe.value})}x.onChange&&x.onChange(we,...Ie),M&&M(we,...Ie)};D.useEffect(()=>{X(ee.current)},[]);const G=we=>{ee.current&&we.currentTarget===we.target&&ee.current.focus(),A&&A(we)};let W=y,J=x;O&&W==="input"&&(z?J={type:void 0,minRows:z,maxRows:z,...J}:J={type:void 0,maxRows:_,minRows:S,...J},W=Yit);const se=we=>{X(we.animationName==="mui-auto-fill-cancel"?ee.current:{value:"x"})};D.useEffect(()=>{U&&U.setAdornedStart(!!F)},[U,F]);const ye={...r,color:oe.color||"primary",disabled:oe.disabled,endAdornment:p,error:oe.error,focused:oe.focused,formControl:U,fullWidth:m,hiddenLabel:oe.hiddenLabel,multiline:O,size:oe.size,startAdornment:F,type:H},ie=Zit(ye),fe=N.root||c.Root||b4,Q=j.root||u.root||{},_e=N.input||c.Input||w4;return J={...J,...j.input??u.input},C.jsxs(D.Fragment,{children:[!h&&typeof sde=="function"&&(ode||(ode=C.jsx(sde,{}))),C.jsxs(fe,{...Q,ref:n,onClick:G,...Y,...!rg(fe)&&{ownerState:{...ye,...Q.ownerState}},className:Oe(ie.root,Q.className,a,B&&"MuiInputBase-readOnly"),children:[F,C.jsx(v4.Provider,{value:null,children:C.jsx(_e,{"aria-invalid":oe.error,"aria-describedby":i,autoComplete:o,autoFocus:s,defaultValue:f,disabled:oe.disabled,id:v,onAnimationStart:se,name:k,placeholder:I,readOnly:B,required:oe.required,rows:z,value:le,onKeyDown:T,onKeyUp:R,type:H,...J,...!rg(_e)&&{as:W,ownerState:{...ye,...J.ownerState}},ref:me,className:Oe(ie.input,J.className,B&&"MuiInputBase-readOnly"),onBlur:he,onChange:xe,onFocus:Z})}),p,$?$({...oe,startAdornment:F}):null]})]})});function Jit(t){return Ye("MuiInput",t)}const AE={..._S,...qe("MuiInput",["root","underline","input"])};function eot(t){return Ye("MuiOutlinedInput",t)}const gd={..._S,...qe("MuiOutlinedInput",["root","notchedOutline","input"])};function tot(t){return Ye("MuiFilledInput",t)}const f0={..._S,...qe("MuiFilledInput",["root","underline","input","adornedStart","adornedEnd","sizeSmall","multiline","hiddenLabel"])},not=lt(C.jsx("path",{d:"M7 10l5 5 5-5z"}),"ArrowDropDown"),rot=lt(C.jsx("path",{d:"M12 12c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm0 2c-2.67 0-8 1.34-8 4v2h16v-2c0-2.66-5.33-4-8-4z"}),"Person");function iot(t){return Ye("MuiAvatar",t)}qe("MuiAvatar",["root","colorDefault","circular","rounded","square","img","fallback"]);const oot=t=>{const{classes:e,variant:n,colorDefault:r}=t;return Xe({root:["root",n,r&&"colorDefault"],img:["img"],fallback:["fallback"]},iot,e)},sot=be("div",{name:"MuiAvatar",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,e[n.variant],n.colorDefault&&e.colorDefault]}})(kt(({theme:t})=>({position:"relative",display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0,width:40,height:40,fontFamily:t.typography.fontFamily,fontSize:t.typography.pxToRem(20),lineHeight:1,borderRadius:"50%",overflow:"hidden",userSelect:"none",variants:[{props:{variant:"rounded"},style:{borderRadius:(t.vars||t).shape.borderRadius}},{props:{variant:"square"},style:{borderRadius:0}},{props:{colorDefault:!0},style:{color:(t.vars||t).palette.background.default,...t.vars?{backgroundColor:t.vars.palette.Avatar.defaultBg}:{backgroundColor:t.palette.grey[400],...t.applyStyles("dark",{backgroundColor:t.palette.grey[600]})}}}]}))),aot=be("img",{name:"MuiAvatar",slot:"Img",overridesResolver:(t,e)=>e.img})({width:"100%",height:"100%",textAlign:"center",objectFit:"cover",color:"transparent",textIndent:1e4}),lot=be(rot,{name:"MuiAvatar",slot:"Fallback",overridesResolver:(t,e)=>e.fallback})({width:"75%",height:"75%"});function cot({crossOrigin:t,referrerPolicy:e,src:n,srcSet:r}){const[i,o]=D.useState(!1);return D.useEffect(()=>{if(!n&&!r)return;o(!1);let s=!0;const a=new Image;return a.onload=()=>{s&&o("loaded")},a.onerror=()=>{s&&o("error")},a.crossOrigin=t,a.referrerPolicy=e,a.src=n,r&&(a.srcset=r),()=>{s=!1}},[t,e,n,r]),i}const eW=D.forwardRef(function(e,n){const r=wt({props:e,name:"MuiAvatar"}),{alt:i,children:o,className:s,component:a="div",slots:l={},slotProps:c={},imgProps:u,sizes:f,src:d,srcSet:h,variant:p="circular",...g}=r;let m=null;const v=cot({...u,src:d,srcSet:h}),y=d||h,x=y&&v!=="error",b={...r,colorDefault:!x,component:a,variant:p};delete b.ownerState;const w=oot(b),[_,S]=ec("img",{className:w.img,elementType:aot,externalForwardedProps:{slots:l,slotProps:{img:{...u,...c.img}}},additionalProps:{alt:i,src:d,srcSet:h,sizes:f},ownerState:b});return x?m=C.jsx(_,{...S}):o||o===0?m=o:y&&i?m=i[0]:m=C.jsx(lot,{ownerState:b,className:w.fallback}),C.jsx(sot,{as:a,className:Oe(w.root,s),ref:n,...g,ownerState:b,children:m})}),uot={entering:{opacity:1},entered:{opacity:1}},YC=D.forwardRef(function(e,n){const r=Na(),i={enter:r.transitions.duration.enteringScreen,exit:r.transitions.duration.leavingScreen},{addEndListener:o,appear:s=!0,children:a,easing:l,in:c,onEnter:u,onEntered:f,onEntering:d,onExit:h,onExited:p,onExiting:g,style:m,timeout:v=i,TransitionComponent:y=Dc,...x}=e,b=D.useRef(null),w=dn(b,My(a),n),_=T=>R=>{if(T){const I=b.current;R===void 0?T(I):T(I,R)}},S=_(d),O=_((T,R)=>{gee(T);const I=Jv({style:m,timeout:v,easing:l},{mode:"enter"});T.style.webkitTransition=r.transitions.create("opacity",I),T.style.transition=r.transitions.create("opacity",I),u&&u(T,R)}),k=_(f),E=_(g),M=_(T=>{const R=Jv({style:m,timeout:v,easing:l},{mode:"exit"});T.style.webkitTransition=r.transitions.create("opacity",R),T.style.transition=r.transitions.create("opacity",R),h&&h(T)}),A=_(p),P=T=>{o&&o(b.current,T)};return C.jsx(y,{appear:s,in:c,nodeRef:b,onEnter:O,onEntered:k,onEntering:S,onExit:M,onExited:A,onExiting:E,addEndListener:P,timeout:v,...x,children:(T,R)=>D.cloneElement(a,{style:{opacity:0,visibility:T==="exited"&&!c?"hidden":void 0,...uot[T],...m,...a.props.style},ref:w,...R})})});function fot(t){return Ye("MuiBackdrop",t)}qe("MuiBackdrop",["root","invisible"]);const dot=t=>{const{ownerState:e,...n}=t;return n},hot=t=>{const{classes:e,invisible:n}=t;return Xe({root:["root",n&&"invisible"]},fot,e)},pot=be("div",{name:"MuiBackdrop",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,n.invisible&&e.invisible]}})({position:"fixed",display:"flex",alignItems:"center",justifyContent:"center",right:0,bottom:0,top:0,left:0,backgroundColor:"rgba(0, 0, 0, 0.5)",WebkitTapHighlightColor:"transparent",variants:[{props:{invisible:!0},style:{backgroundColor:"transparent"}}]}),DAe=D.forwardRef(function(e,n){const r=wt({props:e,name:"MuiBackdrop"}),{children:i,className:o,component:s="div",invisible:a=!1,open:l,components:c={},componentsProps:u={},slotProps:f={},slots:d={},TransitionComponent:h,transitionDuration:p,...g}=r,m={...r,component:s,invisible:a},v=hot(m),y={transition:h,root:c.Root,...d},x={...u,...f},b={slots:y,slotProps:x},[w,_]=ec("root",{elementType:pot,externalForwardedProps:b,className:Oe(v.root,o),ownerState:m}),[S,O]=ec("transition",{elementType:YC,externalForwardedProps:b,ownerState:m}),k=dot(O);return C.jsx(S,{in:l,timeout:p,...g,...k,children:C.jsx(w,{"aria-hidden":!0,..._,classes:v,ref:n,children:i})})}),got=qe("MuiBox",["root"]),mot=r4(),ot=ftt({themeId:Df,defaultTheme:mot,defaultClassName:got.root,generateClassName:Gke.generate});function vot(t){return Ye("MuiButton",t)}const Nb=qe("MuiButton",["root","text","textInherit","textPrimary","textSecondary","textSuccess","textError","textInfo","textWarning","outlined","outlinedInherit","outlinedPrimary","outlinedSecondary","outlinedSuccess","outlinedError","outlinedInfo","outlinedWarning","contained","containedInherit","containedPrimary","containedSecondary","containedSuccess","containedError","containedInfo","containedWarning","disableElevation","focusVisible","disabled","colorInherit","colorPrimary","colorSecondary","colorSuccess","colorError","colorInfo","colorWarning","textSizeSmall","textSizeMedium","textSizeLarge","outlinedSizeSmall","outlinedSizeMedium","outlinedSizeLarge","containedSizeSmall","containedSizeMedium","containedSizeLarge","sizeMedium","sizeSmall","sizeLarge","fullWidth","startIcon","endIcon","icon","iconSizeSmall","iconSizeMedium","iconSizeLarge"]),yot=D.createContext({}),xot=D.createContext(void 0),bot=t=>{const{color:e,disableElevation:n,fullWidth:r,size:i,variant:o,classes:s}=t,a={root:["root",o,`${o}${De(e)}`,`size${De(i)}`,`${o}Size${De(i)}`,`color${De(e)}`,n&&"disableElevation",r&&"fullWidth"],label:["label"],startIcon:["icon","startIcon",`iconSize${De(i)}`],endIcon:["icon","endIcon",`iconSize${De(i)}`]},l=Xe(a,vot,s);return{...s,...l}},IAe=[{props:{size:"small"},style:{"& > *:nth-of-type(1)":{fontSize:18}}},{props:{size:"medium"},style:{"& > *:nth-of-type(1)":{fontSize:20}}},{props:{size:"large"},style:{"& > *:nth-of-type(1)":{fontSize:22}}}],wot=be(Nf,{shouldForwardProp:t=>qo(t)||t==="classes",name:"MuiButton",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,e[n.variant],e[`${n.variant}${De(n.color)}`],e[`size${De(n.size)}`],e[`${n.variant}Size${De(n.size)}`],n.color==="inherit"&&e.colorInherit,n.disableElevation&&e.disableElevation,n.fullWidth&&e.fullWidth]}})(kt(({theme:t})=>{const e=t.palette.mode==="light"?t.palette.grey[300]:t.palette.grey[800],n=t.palette.mode==="light"?t.palette.grey.A100:t.palette.grey[700];return{...t.typography.button,minWidth:64,padding:"6px 16px",border:0,borderRadius:(t.vars||t).shape.borderRadius,transition:t.transitions.create(["background-color","box-shadow","border-color","color"],{duration:t.transitions.duration.short}),"&:hover":{textDecoration:"none"},[`&.${Nb.disabled}`]:{color:(t.vars||t).palette.action.disabled},variants:[{props:{variant:"contained"},style:{color:"var(--variant-containedColor)",backgroundColor:"var(--variant-containedBg)",boxShadow:(t.vars||t).shadows[2],"&:hover":{boxShadow:(t.vars||t).shadows[4],"@media (hover: none)":{boxShadow:(t.vars||t).shadows[2]}},"&:active":{boxShadow:(t.vars||t).shadows[8]},[`&.${Nb.focusVisible}`]:{boxShadow:(t.vars||t).shadows[6]},[`&.${Nb.disabled}`]:{color:(t.vars||t).palette.action.disabled,boxShadow:(t.vars||t).shadows[0],backgroundColor:(t.vars||t).palette.action.disabledBackground}}},{props:{variant:"outlined"},style:{padding:"5px 15px",border:"1px solid currentColor",borderColor:"var(--variant-outlinedBorder, currentColor)",backgroundColor:"var(--variant-outlinedBg)",color:"var(--variant-outlinedColor)",[`&.${Nb.disabled}`]:{border:`1px solid ${(t.vars||t).palette.action.disabledBackground}`}}},{props:{variant:"text"},style:{padding:"6px 8px",color:"var(--variant-textColor)",backgroundColor:"var(--variant-textBg)"}},...Object.entries(t.palette).filter(di()).map(([r])=>({props:{color:r},style:{"--variant-textColor":(t.vars||t).palette[r].main,"--variant-outlinedColor":(t.vars||t).palette[r].main,"--variant-outlinedBorder":t.vars?`rgba(${t.vars.palette[r].mainChannel} / 0.5)`:Tt(t.palette[r].main,.5),"--variant-containedColor":(t.vars||t).palette[r].contrastText,"--variant-containedBg":(t.vars||t).palette[r].main,"@media (hover: hover)":{"&:hover":{"--variant-containedBg":(t.vars||t).palette[r].dark,"--variant-textBg":t.vars?`rgba(${t.vars.palette[r].mainChannel} / ${t.vars.palette.action.hoverOpacity})`:Tt(t.palette[r].main,t.palette.action.hoverOpacity),"--variant-outlinedBorder":(t.vars||t).palette[r].main,"--variant-outlinedBg":t.vars?`rgba(${t.vars.palette[r].mainChannel} / ${t.vars.palette.action.hoverOpacity})`:Tt(t.palette[r].main,t.palette.action.hoverOpacity)}}}})),{props:{color:"inherit"},style:{color:"inherit",borderColor:"currentColor","--variant-containedBg":t.vars?t.vars.palette.Button.inheritContainedBg:e,"@media (hover: hover)":{"&:hover":{"--variant-containedBg":t.vars?t.vars.palette.Button.inheritContainedHoverBg:n,"--variant-textBg":t.vars?`rgba(${t.vars.palette.text.primaryChannel} / ${t.vars.palette.action.hoverOpacity})`:Tt(t.palette.text.primary,t.palette.action.hoverOpacity),"--variant-outlinedBg":t.vars?`rgba(${t.vars.palette.text.primaryChannel} / ${t.vars.palette.action.hoverOpacity})`:Tt(t.palette.text.primary,t.palette.action.hoverOpacity)}}}},{props:{size:"small",variant:"text"},style:{padding:"4px 5px",fontSize:t.typography.pxToRem(13)}},{props:{size:"large",variant:"text"},style:{padding:"8px 11px",fontSize:t.typography.pxToRem(15)}},{props:{size:"small",variant:"outlined"},style:{padding:"3px 9px",fontSize:t.typography.pxToRem(13)}},{props:{size:"large",variant:"outlined"},style:{padding:"7px 21px",fontSize:t.typography.pxToRem(15)}},{props:{size:"small",variant:"contained"},style:{padding:"4px 10px",fontSize:t.typography.pxToRem(13)}},{props:{size:"large",variant:"contained"},style:{padding:"8px 22px",fontSize:t.typography.pxToRem(15)}},{props:{disableElevation:!0},style:{boxShadow:"none","&:hover":{boxShadow:"none"},[`&.${Nb.focusVisible}`]:{boxShadow:"none"},"&:active":{boxShadow:"none"},[`&.${Nb.disabled}`]:{boxShadow:"none"}}},{props:{fullWidth:!0},style:{width:"100%"}}]}})),_ot=be("span",{name:"MuiButton",slot:"StartIcon",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.startIcon,e[`iconSize${De(n.size)}`]]}})({display:"inherit",marginRight:8,marginLeft:-4,variants:[{props:{size:"small"},style:{marginLeft:-2}},...IAe]}),Sot=be("span",{name:"MuiButton",slot:"EndIcon",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.endIcon,e[`iconSize${De(n.size)}`]]}})({display:"inherit",marginRight:-4,marginLeft:8,variants:[{props:{size:"small"},style:{marginRight:-2}},...IAe]}),Vr=D.forwardRef(function(e,n){const r=D.useContext(yot),i=D.useContext(xot),o=vS(r,e),s=wt({props:o,name:"MuiButton"}),{children:a,color:l="primary",component:c="button",className:u,disabled:f=!1,disableElevation:d=!1,disableFocusRipple:h=!1,endIcon:p,focusVisibleClassName:g,fullWidth:m=!1,size:v="medium",startIcon:y,type:x,variant:b="text",...w}=s,_={...s,color:l,component:c,disabled:f,disableElevation:d,disableFocusRipple:h,fullWidth:m,size:v,type:x,variant:b},S=bot(_),O=y&&C.jsx(_ot,{className:S.startIcon,ownerState:_,children:y}),k=p&&C.jsx(Sot,{className:S.endIcon,ownerState:_,children:p}),E=i||"";return C.jsxs(wot,{ownerState:_,className:Oe(r.className,S.root,u,E),component:c,disabled:f,focusRipple:!h,focusVisibleClassName:Oe(S.focusVisible,g),ref:n,type:x,...w,classes:S,children:[O,a,k]})});function Cot(t){return Ye("MuiCard",t)}qe("MuiCard",["root"]);const Oot=t=>{const{classes:e}=t;return Xe({root:["root"]},Cot,e)},Eot=be(Al,{name:"MuiCard",slot:"Root",overridesResolver:(t,e)=>e.root})({overflow:"hidden"}),LAe=D.forwardRef(function(e,n){const r=wt({props:e,name:"MuiCard"}),{className:i,raised:o=!1,...s}=r,a={...r,raised:o},l=Oot(a);return C.jsx(Eot,{className:Oe(l.root,i),elevation:o?8:void 0,ref:n,ownerState:a,...s})});function Tot(t){return Ye("MuiCardActions",t)}qe("MuiCardActions",["root","spacing"]);const kot=t=>{const{classes:e,disableSpacing:n}=t;return Xe({root:["root",!n&&"spacing"]},Tot,e)},Aot=be("div",{name:"MuiCardActions",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,!n.disableSpacing&&e.spacing]}})({display:"flex",alignItems:"center",padding:8,variants:[{props:{disableSpacing:!1},style:{"& > :not(style) ~ :not(style)":{marginLeft:8}}}]}),$Ae=D.forwardRef(function(e,n){const r=wt({props:e,name:"MuiCardActions"}),{disableSpacing:i=!1,className:o,...s}=r,a={...r,disableSpacing:i},l=kot(a);return C.jsx(Aot,{className:Oe(l.root,o),ownerState:a,ref:n,...s})});function Pot(t){return Ye("MuiCardContent",t)}qe("MuiCardContent",["root"]);const Mot=t=>{const{classes:e}=t;return Xe({root:["root"]},Pot,e)},Rot=be("div",{name:"MuiCardContent",slot:"Root",overridesResolver:(t,e)=>e.root})({padding:16,"&:last-child":{paddingBottom:24}}),FAe=D.forwardRef(function(e,n){const r=wt({props:e,name:"MuiCardContent"}),{className:i,component:o="div",...s}=r,a={...r,component:o},l=Mot(a);return C.jsx(Rot,{as:o,className:Oe(l.root,i),ownerState:a,ref:n,...s})});function Dot(t){return Ye("MuiCardHeader",t)}const NF=qe("MuiCardHeader",["root","avatar","action","content","title","subheader"]),Iot=t=>{const{classes:e}=t;return Xe({root:["root"],avatar:["avatar"],action:["action"],content:["content"],title:["title"],subheader:["subheader"]},Dot,e)},Lot=be("div",{name:"MuiCardHeader",slot:"Root",overridesResolver:(t,e)=>({[`& .${NF.title}`]:e.title,[`& .${NF.subheader}`]:e.subheader,...e.root})})({display:"flex",alignItems:"center",padding:16}),$ot=be("div",{name:"MuiCardHeader",slot:"Avatar",overridesResolver:(t,e)=>e.avatar})({display:"flex",flex:"0 0 auto",marginRight:16}),Fot=be("div",{name:"MuiCardHeader",slot:"Action",overridesResolver:(t,e)=>e.action})({flex:"0 0 auto",alignSelf:"flex-start",marginTop:-4,marginRight:-8,marginBottom:-4}),Not=be("div",{name:"MuiCardHeader",slot:"Content",overridesResolver:(t,e)=>e.content})({flex:"1 1 auto",[`.${LF.root}:where(& .${NF.title})`]:{display:"block"},[`.${LF.root}:where(& .${NF.subheader})`]:{display:"block"}}),zot=D.forwardRef(function(e,n){const r=wt({props:e,name:"MuiCardHeader"}),{action:i,avatar:o,className:s,component:a="div",disableTypography:l=!1,subheader:c,subheaderTypographyProps:u,title:f,titleTypographyProps:d,...h}=r,p={...r,component:a,disableTypography:l},g=Iot(p);let m=f;m!=null&&m.type!==Jt&&!l&&(m=C.jsx(Jt,{variant:o?"body2":"h5",className:g.title,component:"span",...d,children:m}));let v=c;return v!=null&&v.type!==Jt&&!l&&(v=C.jsx(Jt,{variant:o?"body2":"body1",className:g.subheader,color:"textSecondary",component:"span",...u,children:v})),C.jsxs(Lot,{className:Oe(g.root,s),as:a,ref:n,ownerState:p,...h,children:[o&&C.jsx($ot,{className:g.avatar,ownerState:p,children:o}),C.jsxs(Not,{className:g.content,ownerState:p,children:[m,v]}),i&&C.jsx(Fot,{className:g.action,ownerState:p,children:i})]})});function jot(t){return Ye("MuiCardMedia",t)}qe("MuiCardMedia",["root","media","img"]);const Bot=t=>{const{classes:e,isMediaComponent:n,isImageComponent:r}=t;return Xe({root:["root",n&&"media",r&&"img"]},jot,e)},Uot=be("div",{name:"MuiCardMedia",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t,{isMediaComponent:r,isImageComponent:i}=n;return[e.root,r&&e.media,i&&e.img]}})({display:"block",backgroundSize:"cover",backgroundRepeat:"no-repeat",backgroundPosition:"center",variants:[{props:{isMediaComponent:!0},style:{width:"100%"}},{props:{isImageComponent:!0},style:{objectFit:"cover"}}]}),Wot=["video","audio","picture","iframe","img"],Vot=["picture","img"],Got=D.forwardRef(function(e,n){const r=wt({props:e,name:"MuiCardMedia"}),{children:i,className:o,component:s="div",image:a,src:l,style:c,...u}=r,f=Wot.includes(s),d=!f&&a?{backgroundImage:`url("${a}")`,...c}:c,h={...r,component:s,isMediaComponent:f,isImageComponent:Vot.includes(s)},p=Bot(h);return C.jsx(Uot,{className:Oe(p.root,o),as:s,role:!f&&a?"img":void 0,ref:n,style:d,ownerState:h,src:f?a||l:void 0,...u,children:i})});function Hot(t){return Ye("PrivateSwitchBase",t)}qe("PrivateSwitchBase",["root","checked","disabled","input","edgeStart","edgeEnd"]);const qot=t=>{const{classes:e,checked:n,disabled:r,edge:i}=t,o={root:["root",n&&"checked",r&&"disabled",i&&`edge${De(i)}`],input:["input"]};return Xe(o,Hot,e)},Xot=be(Nf)({padding:9,borderRadius:"50%",variants:[{props:{edge:"start",size:"small"},style:{marginLeft:-3}},{props:({edge:t,ownerState:e})=>t==="start"&&e.size!=="small",style:{marginLeft:-12}},{props:{edge:"end",size:"small"},style:{marginRight:-3}},{props:({edge:t,ownerState:e})=>t==="end"&&e.size!=="small",style:{marginRight:-12}}]}),Yot=be("input",{shouldForwardProp:qo})({cursor:"inherit",position:"absolute",opacity:0,width:"100%",height:"100%",top:0,left:0,margin:0,padding:0,zIndex:1}),Oee=D.forwardRef(function(e,n){const{autoFocus:r,checked:i,checkedIcon:o,className:s,defaultChecked:a,disabled:l,disableFocusRipple:c=!1,edge:u=!1,icon:f,id:d,inputProps:h,inputRef:p,name:g,onBlur:m,onChange:v,onFocus:y,readOnly:x,required:b=!1,tabIndex:w,type:_,value:S,...O}=e,[k,E]=wc({controlled:i,default:!!a,name:"SwitchBase",state:"checked"}),M=za(),A=z=>{y&&y(z),M&&M.onFocus&&M.onFocus(z)},P=z=>{m&&m(z),M&&M.onBlur&&M.onBlur(z)},T=z=>{if(z.nativeEvent.defaultPrevented)return;const L=z.target.checked;E(L),v&&v(z,L)};let R=l;M&&typeof R>"u"&&(R=M.disabled);const I=_==="checkbox"||_==="radio",B={...e,checked:k,disabled:R,disableFocusRipple:c,edge:u},$=qot(B);return C.jsxs(Xot,{component:"span",className:Oe($.root,s),centerRipple:!0,focusRipple:!c,disabled:R,tabIndex:null,role:void 0,onFocus:A,onBlur:P,ownerState:B,ref:n,...O,children:[C.jsx(Yot,{autoFocus:r,checked:i,defaultChecked:a,className:$.input,disabled:R,id:I?d:void 0,name:g,onChange:T,readOnly:x,ref:p,required:b,ownerState:B,tabIndex:w,type:_,..._==="checkbox"&&S===void 0?{}:{value:S},...h}),k?o:f]})}),Qot=lt(C.jsx("path",{d:"M19 5v14H5V5h14m0-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2z"}),"CheckBoxOutlineBlank"),Kot=lt(C.jsx("path",{d:"M19 3H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.11 0 2-.9 2-2V5c0-1.1-.89-2-2-2zm-9 14l-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z"}),"CheckBox"),Zot=lt(C.jsx("path",{d:"M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm-2 10H7v-2h10v2z"}),"IndeterminateCheckBox");function Jot(t){return Ye("MuiCheckbox",t)}const tW=qe("MuiCheckbox",["root","checked","disabled","indeterminate","colorPrimary","colorSecondary","sizeSmall","sizeMedium"]),est=t=>{const{classes:e,indeterminate:n,color:r,size:i}=t,o={root:["root",n&&"indeterminate",`color${De(r)}`,`size${De(i)}`]},s=Xe(o,Jot,e);return{...e,...s}},tst=be(Oee,{shouldForwardProp:t=>qo(t)||t==="classes",name:"MuiCheckbox",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,n.indeterminate&&e.indeterminate,e[`size${De(n.size)}`],n.color!=="default"&&e[`color${De(n.color)}`]]}})(kt(({theme:t})=>({color:(t.vars||t).palette.text.secondary,variants:[{props:{color:"default",disableRipple:!1},style:{"&:hover":{backgroundColor:t.vars?`rgba(${t.vars.palette.action.activeChannel} / ${t.vars.palette.action.hoverOpacity})`:Tt(t.palette.action.active,t.palette.action.hoverOpacity)}}},...Object.entries(t.palette).filter(di()).map(([e])=>({props:{color:e,disableRipple:!1},style:{"&:hover":{backgroundColor:t.vars?`rgba(${t.vars.palette[e].mainChannel} / ${t.vars.palette.action.hoverOpacity})`:Tt(t.palette[e].main,t.palette.action.hoverOpacity)}}})),...Object.entries(t.palette).filter(di()).map(([e])=>({props:{color:e},style:{[`&.${tW.checked}, &.${tW.indeterminate}`]:{color:(t.vars||t).palette[e].main},[`&.${tW.disabled}`]:{color:(t.vars||t).palette.action.disabled}}})),{props:{disableRipple:!1},style:{"&:hover":{"@media (hover: none)":{backgroundColor:"transparent"}}}}]}))),nst=C.jsx(Kot,{}),rst=C.jsx(Qot,{}),ist=C.jsx(Zot,{}),zF=D.forwardRef(function(e,n){const r=wt({props:e,name:"MuiCheckbox"}),{checkedIcon:i=nst,color:o="primary",icon:s=rst,indeterminate:a=!1,indeterminateIcon:l=ist,inputProps:c,size:u="medium",disableRipple:f=!1,className:d,...h}=r,p=a?l:s,g=a?l:i,m={...r,disableRipple:f,color:o,indeterminate:a,size:u},v=est(m);return C.jsx(tst,{type:"checkbox",inputProps:{"data-indeterminate":a,...c},icon:D.cloneElement(p,{fontSize:p.props.fontSize??u}),checkedIcon:D.cloneElement(g,{fontSize:g.props.fontSize??u}),ownerState:m,ref:n,className:Oe(v.root,d),disableRipple:f,...h,classes:v})});function ost(t){return Ye("MuiCircularProgress",t)}qe("MuiCircularProgress",["root","determinate","indeterminate","colorPrimary","colorSecondary","svg","circle","circleDeterminate","circleIndeterminate","circleDisableShrink"]);const cm=44,GH=CM` +`,Lrt=D.forwardRef(function(e,n){const r=wt({props:e,name:"MuiTouchRipple"}),{center:i=!1,classes:o={},className:s,...a}=r,[l,c]=D.useState([]),u=D.useRef(0),f=D.useRef(null);D.useEffect(()=>{f.current&&(f.current(),f.current=null)},[l]);const d=D.useRef(!1),h=lv(),p=D.useRef(null),g=D.useRef(null),m=D.useCallback(b=>{const{pulsate:w,rippleX:_,rippleY:S,rippleSize:O,cb:k}=b;c(E=>[...E,C.jsx(Irt,{classes:{ripple:Oe(o.ripple,Wc.ripple),rippleVisible:Oe(o.rippleVisible,Wc.rippleVisible),ripplePulsate:Oe(o.ripplePulsate,Wc.ripplePulsate),child:Oe(o.child,Wc.child),childLeaving:Oe(o.childLeaving,Wc.childLeaving),childPulsate:Oe(o.childPulsate,Wc.childPulsate)},timeout:nq,pulsate:w,rippleX:_,rippleY:S,rippleSize:O},u.current)]),u.current+=1,f.current=k},[o]),v=D.useCallback((b={},w={},_=()=>{})=>{const{pulsate:S=!1,center:O=i||w.pulsate,fakeElement:k=!1}=w;if((b==null?void 0:b.type)==="mousedown"&&d.current){d.current=!1;return}(b==null?void 0:b.type)==="touchstart"&&(d.current=!0);const E=k?null:g.current,P=E?E.getBoundingClientRect():{width:0,height:0,left:0,top:0};let A,R,T;if(O||b===void 0||b.clientX===0&&b.clientY===0||!b.clientX&&!b.touches)A=Math.round(P.width/2),R=Math.round(P.height/2);else{const{clientX:M,clientY:I}=b.touches&&b.touches.length>0?b.touches[0]:b;A=Math.round(M-P.left),R=Math.round(I-P.top)}if(O)T=Math.sqrt((2*P.width**2+P.height**2)/3),T%2===0&&(T+=1);else{const M=Math.max(Math.abs((E?E.clientWidth:0)-A),A)*2+2,I=Math.max(Math.abs((E?E.clientHeight:0)-R),R)*2+2;T=Math.sqrt(M**2+I**2)}b!=null&&b.touches?p.current===null&&(p.current=()=>{m({pulsate:S,rippleX:A,rippleY:R,rippleSize:T,cb:_})},h.start(Art,()=>{p.current&&(p.current(),p.current=null)})):m({pulsate:S,rippleX:A,rippleY:R,rippleSize:T,cb:_})},[i,m,h]),y=D.useCallback(()=>{v({},{pulsate:!0})},[v]),x=D.useCallback((b,w)=>{if(h.clear(),(b==null?void 0:b.type)==="touchend"&&p.current){p.current(),p.current=null,h.start(0,()=>{x(b,w)});return}p.current=null,c(_=>_.length>0?_.slice(1):_),f.current=w},[h]);return D.useImperativeHandle(n,()=>({pulsate:y,start:v,stop:x}),[y,v,x]),C.jsx(Drt,{className:Oe(Wc.root,o.root,s),ref:g,...a,children:C.jsx(PM,{component:null,exit:!0,children:l})})});function $rt(t){return Ye("MuiButtonBase",t)}const Frt=He("MuiButtonBase",["root","disabled","focusVisible"]),Nrt=t=>{const{disabled:e,focusVisible:n,focusVisibleClassName:r,classes:i}=t,s=qe({root:["root",e&&"disabled",n&&"focusVisible"]},$rt,i);return n&&r&&(s.root+=` ${r}`),s},zrt=be("button",{name:"MuiButtonBase",slot:"Root",overridesResolver:(t,e)=>e.root})({display:"inline-flex",alignItems:"center",justifyContent:"center",position:"relative",boxSizing:"border-box",WebkitTapHighlightColor:"transparent",backgroundColor:"transparent",outline:0,border:0,margin:0,borderRadius:0,padding:0,cursor:"pointer",userSelect:"none",verticalAlign:"middle",MozAppearance:"none",WebkitAppearance:"none",textDecoration:"none",color:"inherit","&::-moz-focus-inner":{borderStyle:"none"},[`&.${Frt.disabled}`]:{pointerEvents:"none",cursor:"default"},"@media print":{colorAdjust:"exact"}}),Nf=D.forwardRef(function(e,n){const r=wt({props:e,name:"MuiButtonBase"}),{action:i,centerRipple:o=!1,children:s,className:a,component:l="button",disabled:c=!1,disableRipple:u=!1,disableTouchRipple:f=!1,focusRipple:d=!1,focusVisibleClassName:h,LinkComponent:p="a",onBlur:g,onClick:m,onContextMenu:v,onDragLeave:y,onFocus:x,onFocusVisible:b,onKeyDown:w,onKeyUp:_,onMouseDown:S,onMouseLeave:O,onMouseUp:k,onTouchEnd:E,onTouchMove:P,onTouchStart:A,tabIndex:R=0,TouchRippleProps:T,touchRippleRef:M,type:I,...j}=r,N=D.useRef(null),z=Ert(),L=dn(z.ref,M),[B,F]=D.useState(!1);c&&B&&F(!1),D.useImperativeHandle(i,()=>({focusVisible:()=>{F(!0),N.current.focus()}}),[]);const $=z.shouldMount&&!u&&!c;D.useEffect(()=>{B&&d&&!u&&z.pulsate()},[u,d,B,z]);function q(W,J,se=f){return st(ye=>(J&&J(ye),se||z[W](ye),!0))}const G=q("start",S),Y=q("stop",v),le=q("stop",y),K=q("stop",k),ee=q("stop",W=>{B&&W.preventDefault(),O&&O(W)}),re=q("start",A),ge=q("stop",E),te=q("stop",P),ae=q("stop",W=>{Kv(W.target)||F(!1),g&&g(W)},!1),U=st(W=>{N.current||(N.current=W.currentTarget),Kv(W.target)&&(F(!0),b&&b(W)),x&&x(W)}),oe=()=>{const W=N.current;return l&&l!=="button"&&!(W.tagName==="A"&&W.href)},ne=st(W=>{d&&!W.repeat&&B&&W.key===" "&&z.stop(W,()=>{z.start(W)}),W.target===W.currentTarget&&oe()&&W.key===" "&&W.preventDefault(),w&&w(W),W.target===W.currentTarget&&oe()&&W.key==="Enter"&&!c&&(W.preventDefault(),m&&m(W))}),V=st(W=>{d&&W.key===" "&&B&&!W.defaultPrevented&&z.stop(W,()=>{z.pulsate(W)}),_&&_(W),m&&W.target===W.currentTarget&&oe()&&W.key===" "&&!W.defaultPrevented&&m(W)});let X=l;X==="button"&&(j.href||j.to)&&(X=p);const Z={};X==="button"?(Z.type=I===void 0?"button":I,Z.disabled=c):(!j.href&&!j.to&&(Z.role="button"),c&&(Z["aria-disabled"]=c));const he=dn(n,N),xe={...r,centerRipple:o,component:l,disabled:c,disableRipple:u,disableTouchRipple:f,focusRipple:d,tabIndex:R,focusVisible:B},H=Nrt(xe);return C.jsxs(zrt,{as:X,className:Oe(H.root,a),ownerState:xe,onBlur:ae,onClick:m,onContextMenu:Y,onFocus:U,onKeyDown:ne,onKeyUp:V,onMouseDown:G,onMouseLeave:ee,onMouseUp:K,onDragLeave:le,onTouchEnd:ge,onTouchMove:te,onTouchStart:re,ref:he,tabIndex:c?-1:R,type:I,...Z,...j,children:[s,$?C.jsx(Lrt,{ref:L,center:o,...T}):null]})});function jrt(t){return typeof t.main=="string"}function Brt(t,e=[]){if(!jrt(t))return!1;for(const n of e)if(!t.hasOwnProperty(n)||typeof t[n]!="string")return!1;return!0}function ii(t=[]){return([,e])=>e&&Brt(e,t)}function Urt(t){return Ye("MuiIconButton",t)}const Wrt=He("MuiIconButton",["root","disabled","colorInherit","colorPrimary","colorSecondary","colorError","colorInfo","colorSuccess","colorWarning","edgeStart","edgeEnd","sizeSmall","sizeMedium","sizeLarge"]),Vrt=t=>{const{classes:e,disabled:n,color:r,edge:i,size:o}=t,s={root:["root",n&&"disabled",r!=="default"&&`color${Re(r)}`,i&&`edge${Re(i)}`,`size${Re(o)}`]};return qe(s,Urt,e)},Grt=be(Nf,{name:"MuiIconButton",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,n.color!=="default"&&e[`color${Re(n.color)}`],n.edge&&e[`edge${Re(n.edge)}`],e[`size${Re(n.size)}`]]}})(Tt(({theme:t})=>({textAlign:"center",flex:"0 0 auto",fontSize:t.typography.pxToRem(24),padding:8,borderRadius:"50%",color:(t.vars||t).palette.action.active,transition:t.transitions.create("background-color",{duration:t.transitions.duration.shortest}),variants:[{props:e=>!e.disableRipple,style:{"--IconButton-hoverBg":t.vars?`rgba(${t.vars.palette.action.activeChannel} / ${t.vars.palette.action.hoverOpacity})`:kt(t.palette.action.active,t.palette.action.hoverOpacity),"&:hover":{backgroundColor:"var(--IconButton-hoverBg)","@media (hover: none)":{backgroundColor:"transparent"}}}},{props:{edge:"start"},style:{marginLeft:-12}},{props:{edge:"start",size:"small"},style:{marginLeft:-3}},{props:{edge:"end"},style:{marginRight:-12}},{props:{edge:"end",size:"small"},style:{marginRight:-3}}]})),Tt(({theme:t})=>({variants:[{props:{color:"inherit"},style:{color:"inherit"}},...Object.entries(t.palette).filter(ii()).map(([e])=>({props:{color:e},style:{color:(t.vars||t).palette[e].main}})),...Object.entries(t.palette).filter(ii()).map(([e])=>({props:{color:e},style:{"--IconButton-hoverBg":t.vars?`rgba(${(t.vars||t).palette[e].mainChannel} / ${t.vars.palette.action.hoverOpacity})`:kt((t.vars||t).palette[e].main,t.palette.action.hoverOpacity)}})),{props:{size:"small"},style:{padding:5,fontSize:t.typography.pxToRem(18)}},{props:{size:"large"},style:{padding:12,fontSize:t.typography.pxToRem(28)}}],[`&.${Wrt.disabled}`]:{backgroundColor:"transparent",color:(t.vars||t).palette.action.disabled}}))),Ht=D.forwardRef(function(e,n){const r=wt({props:e,name:"MuiIconButton"}),{edge:i=!1,children:o,className:s,color:a="default",disabled:l=!1,disableFocusRipple:c=!1,size:u="medium",...f}=r,d={...r,edge:i,color:a,disabled:l,disableFocusRipple:c,size:u},h=Vrt(d);return C.jsx(Grt,{className:Oe(h.root,s),centerRipple:!0,focusRipple:!c,disabled:l,ref:n,...f,ownerState:d,children:o})});function Hrt(t){return Ye("MuiTypography",t)}const MF=He("MuiTypography",["root","h1","h2","h3","h4","h5","h6","subtitle1","subtitle2","body1","body2","inherit","button","caption","overline","alignLeft","alignRight","alignCenter","alignJustify","noWrap","gutterBottom","paragraph"]),qrt={primary:!0,secondary:!0,error:!0,info:!0,success:!0,warning:!0,textPrimary:!0,textSecondary:!0,textDisabled:!0},Xrt=rrt(),Yrt=t=>{const{align:e,gutterBottom:n,noWrap:r,paragraph:i,variant:o,classes:s}=t,a={root:["root",o,t.align!=="inherit"&&`align${Re(e)}`,n&&"gutterBottom",r&&"noWrap",i&&"paragraph"]};return qe(a,Hrt,s)},Qrt=be("span",{name:"MuiTypography",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,n.variant&&e[n.variant],n.align!=="inherit"&&e[`align${Re(n.align)}`],n.noWrap&&e.noWrap,n.gutterBottom&&e.gutterBottom,n.paragraph&&e.paragraph]}})(Tt(({theme:t})=>{var e;return{margin:0,variants:[{props:{variant:"inherit"},style:{font:"inherit",lineHeight:"inherit",letterSpacing:"inherit"}},...Object.entries(t.typography).filter(([n,r])=>n!=="inherit"&&r&&typeof r=="object").map(([n,r])=>({props:{variant:n},style:r})),...Object.entries(t.palette).filter(ii()).map(([n])=>({props:{color:n},style:{color:(t.vars||t).palette[n].main}})),...Object.entries(((e=t.palette)==null?void 0:e.text)||{}).filter(([,n])=>typeof n=="string").map(([n])=>({props:{color:`text${Re(n)}`},style:{color:(t.vars||t).palette.text[n]}})),{props:({ownerState:n})=>n.align!=="inherit",style:{textAlign:"var(--Typography-textAlign)"}},{props:({ownerState:n})=>n.noWrap,style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}},{props:({ownerState:n})=>n.gutterBottom,style:{marginBottom:"0.35em"}},{props:({ownerState:n})=>n.paragraph,style:{marginBottom:16}}]}})),ude={h1:"h1",h2:"h2",h3:"h3",h4:"h4",h5:"h5",h6:"h6",subtitle1:"h6",subtitle2:"h6",body1:"p",body2:"p",inherit:"p"},Jt=D.forwardRef(function(e,n){const{color:r,...i}=wt({props:e,name:"MuiTypography"}),o=!qrt[r],s=Xrt({...i,...o&&{color:r}}),{align:a="inherit",className:l,component:c,gutterBottom:u=!1,noWrap:f=!1,paragraph:d=!1,variant:h="body1",variantMapping:p=ude,...g}=s,m={...s,align:a,color:r,className:l,component:c,gutterBottom:u,noWrap:f,paragraph:d,variant:h,variantMapping:p},v=c||(d?"p":p[h]||ude[h])||"span",y=Yrt(m);return C.jsx(Qrt,{as:v,ref:n,className:Oe(y.root,l),...g,ownerState:m,style:{...a!=="inherit"&&{"--Typography-textAlign":a},...g.style}})});function Krt(t){return Ye("MuiAppBar",t)}He("MuiAppBar",["root","positionFixed","positionAbsolute","positionSticky","positionStatic","positionRelative","colorDefault","colorPrimary","colorSecondary","colorInherit","colorTransparent","colorError","colorInfo","colorSuccess","colorWarning"]);const Zrt=t=>{const{color:e,position:n,classes:r}=t,i={root:["root",`color${Re(e)}`,`position${Re(n)}`]};return qe(i,Krt,r)},fde=(t,e)=>t?`${t==null?void 0:t.replace(")","")}, ${e})`:e,Jrt=be(Tl,{name:"MuiAppBar",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,e[`position${Re(n.position)}`],e[`color${Re(n.color)}`]]}})(Tt(({theme:t})=>({display:"flex",flexDirection:"column",width:"100%",boxSizing:"border-box",flexShrink:0,variants:[{props:{position:"fixed"},style:{position:"fixed",zIndex:(t.vars||t).zIndex.appBar,top:0,left:"auto",right:0,"@media print":{position:"absolute"}}},{props:{position:"absolute"},style:{position:"absolute",zIndex:(t.vars||t).zIndex.appBar,top:0,left:"auto",right:0}},{props:{position:"sticky"},style:{position:"sticky",zIndex:(t.vars||t).zIndex.appBar,top:0,left:"auto",right:0}},{props:{position:"static"},style:{position:"static"}},{props:{position:"relative"},style:{position:"relative"}},{props:{color:"inherit"},style:{"--AppBar-color":"inherit"}},{props:{color:"default"},style:{"--AppBar-background":t.vars?t.vars.palette.AppBar.defaultBg:t.palette.grey[100],"--AppBar-color":t.vars?t.vars.palette.text.primary:t.palette.getContrastText(t.palette.grey[100]),...t.applyStyles("dark",{"--AppBar-background":t.vars?t.vars.palette.AppBar.defaultBg:t.palette.grey[900],"--AppBar-color":t.vars?t.vars.palette.text.primary:t.palette.getContrastText(t.palette.grey[900])})}},...Object.entries(t.palette).filter(ii(["contrastText"])).map(([e])=>({props:{color:e},style:{"--AppBar-background":(t.vars??t).palette[e].main,"--AppBar-color":(t.vars??t).palette[e].contrastText}})),{props:e=>e.enableColorOnDark===!0&&!["inherit","transparent"].includes(e.color),style:{backgroundColor:"var(--AppBar-background)",color:"var(--AppBar-color)"}},{props:e=>e.enableColorOnDark===!1&&!["inherit","transparent"].includes(e.color),style:{backgroundColor:"var(--AppBar-background)",color:"var(--AppBar-color)",...t.applyStyles("dark",{backgroundColor:t.vars?fde(t.vars.palette.AppBar.darkBg,"var(--AppBar-background)"):null,color:t.vars?fde(t.vars.palette.AppBar.darkColor,"var(--AppBar-color)"):null})}},{props:{color:"transparent"},style:{"--AppBar-background":"transparent","--AppBar-color":"inherit",backgroundColor:"var(--AppBar-background)",color:"var(--AppBar-color)",...t.applyStyles("dark",{backgroundImage:"none"})}}]}))),XAe=D.forwardRef(function(e,n){const r=wt({props:e,name:"MuiAppBar"}),{className:i,color:o="primary",enableColorOnDark:s=!1,position:a="fixed",...l}=r,c={...r,color:o,position:a,enableColorOnDark:s},u=Zrt(c);return C.jsx(Jrt,{square:!0,component:"header",ownerState:c,elevation:4,className:Oe(u.root,i,a==="fixed"&&"mui-fixed"),ref:n,...l})});var fl="top",Su="bottom",Cu="right",dl="left",Ree="auto",MM=[fl,Su,Cu,dl],yS="start",rA="end",eit="clippingParents",YAe="viewport",TE="popper",tit="reference",dde=MM.reduce(function(t,e){return t.concat([e+"-"+yS,e+"-"+rA])},[]),QAe=[].concat(MM,[Ree]).reduce(function(t,e){return t.concat([e,e+"-"+yS,e+"-"+rA])},[]),nit="beforeRead",rit="read",iit="afterRead",oit="beforeMain",sit="main",ait="afterMain",lit="beforeWrite",cit="write",uit="afterWrite",fit=[nit,rit,iit,oit,sit,ait,lit,cit,uit];function wh(t){return t?(t.nodeName||"").toLowerCase():null}function wc(t){if(t==null)return window;if(t.toString()!=="[object Window]"){var e=t.ownerDocument;return e&&e.defaultView||window}return t}function tb(t){var e=wc(t).Element;return t instanceof e||t instanceof Element}function fu(t){var e=wc(t).HTMLElement;return t instanceof e||t instanceof HTMLElement}function Dee(t){if(typeof ShadowRoot>"u")return!1;var e=wc(t).ShadowRoot;return t instanceof e||t instanceof ShadowRoot}function dit(t){var e=t.state;Object.keys(e.elements).forEach(function(n){var r=e.styles[n]||{},i=e.attributes[n]||{},o=e.elements[n];!fu(o)||!wh(o)||(Object.assign(o.style,r),Object.keys(i).forEach(function(s){var a=i[s];a===!1?o.removeAttribute(s):o.setAttribute(s,a===!0?"":a)}))})}function hit(t){var e=t.state,n={popper:{position:e.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(e.elements.popper.style,n.popper),e.styles=n,e.elements.arrow&&Object.assign(e.elements.arrow.style,n.arrow),function(){Object.keys(e.elements).forEach(function(r){var i=e.elements[r],o=e.attributes[r]||{},s=Object.keys(e.styles.hasOwnProperty(r)?e.styles[r]:n[r]),a=s.reduce(function(l,c){return l[c]="",l},{});!fu(i)||!wh(i)||(Object.assign(i.style,a),Object.keys(o).forEach(function(l){i.removeAttribute(l)}))})}}const pit={name:"applyStyles",enabled:!0,phase:"write",fn:dit,effect:hit,requires:["computeStyles"]};function lh(t){return t.split("-")[0]}var Ax=Math.max,RF=Math.min,xS=Math.round;function rq(){var t=navigator.userAgentData;return t!=null&&t.brands&&Array.isArray(t.brands)?t.brands.map(function(e){return e.brand+"/"+e.version}).join(" "):navigator.userAgent}function KAe(){return!/^((?!chrome|android).)*safari/i.test(rq())}function bS(t,e,n){e===void 0&&(e=!1),n===void 0&&(n=!1);var r=t.getBoundingClientRect(),i=1,o=1;e&&fu(t)&&(i=t.offsetWidth>0&&xS(r.width)/t.offsetWidth||1,o=t.offsetHeight>0&&xS(r.height)/t.offsetHeight||1);var s=tb(t)?wc(t):window,a=s.visualViewport,l=!KAe()&&n,c=(r.left+(l&&a?a.offsetLeft:0))/i,u=(r.top+(l&&a?a.offsetTop:0))/o,f=r.width/i,d=r.height/o;return{width:f,height:d,top:u,right:c+f,bottom:u+d,left:c,x:c,y:u}}function Iee(t){var e=bS(t),n=t.offsetWidth,r=t.offsetHeight;return Math.abs(e.width-n)<=1&&(n=e.width),Math.abs(e.height-r)<=1&&(r=e.height),{x:t.offsetLeft,y:t.offsetTop,width:n,height:r}}function ZAe(t,e){var n=e.getRootNode&&e.getRootNode();if(t.contains(e))return!0;if(n&&Dee(n)){var r=e;do{if(r&&t.isSameNode(r))return!0;r=r.parentNode||r.host}while(r)}return!1}function kg(t){return wc(t).getComputedStyle(t)}function git(t){return["table","td","th"].indexOf(wh(t))>=0}function My(t){return((tb(t)?t.ownerDocument:t.document)||window.document).documentElement}function d4(t){return wh(t)==="html"?t:t.assignedSlot||t.parentNode||(Dee(t)?t.host:null)||My(t)}function hde(t){return!fu(t)||kg(t).position==="fixed"?null:t.offsetParent}function mit(t){var e=/firefox/i.test(rq()),n=/Trident/i.test(rq());if(n&&fu(t)){var r=kg(t);if(r.position==="fixed")return null}var i=d4(t);for(Dee(i)&&(i=i.host);fu(i)&&["html","body"].indexOf(wh(i))<0;){var o=kg(i);if(o.transform!=="none"||o.perspective!=="none"||o.contain==="paint"||["transform","perspective"].indexOf(o.willChange)!==-1||e&&o.willChange==="filter"||e&&o.filter&&o.filter!=="none")return i;i=i.parentNode}return null}function RM(t){for(var e=wc(t),n=hde(t);n&&git(n)&&kg(n).position==="static";)n=hde(n);return n&&(wh(n)==="html"||wh(n)==="body"&&kg(n).position==="static")?e:n||mit(t)||e}function Lee(t){return["top","bottom"].indexOf(t)>=0?"x":"y"}function XT(t,e,n){return Ax(t,RF(e,n))}function vit(t,e,n){var r=XT(t,e,n);return r>n?n:r}function JAe(){return{top:0,right:0,bottom:0,left:0}}function ePe(t){return Object.assign({},JAe(),t)}function tPe(t,e){return e.reduce(function(n,r){return n[r]=t,n},{})}var yit=function(e,n){return e=typeof e=="function"?e(Object.assign({},n.rects,{placement:n.placement})):e,ePe(typeof e!="number"?e:tPe(e,MM))};function xit(t){var e,n=t.state,r=t.name,i=t.options,o=n.elements.arrow,s=n.modifiersData.popperOffsets,a=lh(n.placement),l=Lee(a),c=[dl,Cu].indexOf(a)>=0,u=c?"height":"width";if(!(!o||!s)){var f=yit(i.padding,n),d=Iee(o),h=l==="y"?fl:dl,p=l==="y"?Su:Cu,g=n.rects.reference[u]+n.rects.reference[l]-s[l]-n.rects.popper[u],m=s[l]-n.rects.reference[l],v=RM(o),y=v?l==="y"?v.clientHeight||0:v.clientWidth||0:0,x=g/2-m/2,b=f[h],w=y-d[u]-f[p],_=y/2-d[u]/2+x,S=XT(b,_,w),O=l;n.modifiersData[r]=(e={},e[O]=S,e.centerOffset=S-_,e)}}function bit(t){var e=t.state,n=t.options,r=n.element,i=r===void 0?"[data-popper-arrow]":r;i!=null&&(typeof i=="string"&&(i=e.elements.popper.querySelector(i),!i)||ZAe(e.elements.popper,i)&&(e.elements.arrow=i))}const wit={name:"arrow",enabled:!0,phase:"main",fn:xit,effect:bit,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function wS(t){return t.split("-")[1]}var _it={top:"auto",right:"auto",bottom:"auto",left:"auto"};function Sit(t,e){var n=t.x,r=t.y,i=e.devicePixelRatio||1;return{x:xS(n*i)/i||0,y:xS(r*i)/i||0}}function pde(t){var e,n=t.popper,r=t.popperRect,i=t.placement,o=t.variation,s=t.offsets,a=t.position,l=t.gpuAcceleration,c=t.adaptive,u=t.roundOffsets,f=t.isFixed,d=s.x,h=d===void 0?0:d,p=s.y,g=p===void 0?0:p,m=typeof u=="function"?u({x:h,y:g}):{x:h,y:g};h=m.x,g=m.y;var v=s.hasOwnProperty("x"),y=s.hasOwnProperty("y"),x=dl,b=fl,w=window;if(c){var _=RM(n),S="clientHeight",O="clientWidth";if(_===wc(n)&&(_=My(n),kg(_).position!=="static"&&a==="absolute"&&(S="scrollHeight",O="scrollWidth")),_=_,i===fl||(i===dl||i===Cu)&&o===rA){b=Su;var k=f&&_===w&&w.visualViewport?w.visualViewport.height:_[S];g-=k-r.height,g*=l?1:-1}if(i===dl||(i===fl||i===Su)&&o===rA){x=Cu;var E=f&&_===w&&w.visualViewport?w.visualViewport.width:_[O];h-=E-r.width,h*=l?1:-1}}var P=Object.assign({position:a},c&&_it),A=u===!0?Sit({x:h,y:g},wc(n)):{x:h,y:g};if(h=A.x,g=A.y,l){var R;return Object.assign({},P,(R={},R[b]=y?"0":"",R[x]=v?"0":"",R.transform=(w.devicePixelRatio||1)<=1?"translate("+h+"px, "+g+"px)":"translate3d("+h+"px, "+g+"px, 0)",R))}return Object.assign({},P,(e={},e[b]=y?g+"px":"",e[x]=v?h+"px":"",e.transform="",e))}function Cit(t){var e=t.state,n=t.options,r=n.gpuAcceleration,i=r===void 0?!0:r,o=n.adaptive,s=o===void 0?!0:o,a=n.roundOffsets,l=a===void 0?!0:a,c={placement:lh(e.placement),variation:wS(e.placement),popper:e.elements.popper,popperRect:e.rects.popper,gpuAcceleration:i,isFixed:e.options.strategy==="fixed"};e.modifiersData.popperOffsets!=null&&(e.styles.popper=Object.assign({},e.styles.popper,pde(Object.assign({},c,{offsets:e.modifiersData.popperOffsets,position:e.options.strategy,adaptive:s,roundOffsets:l})))),e.modifiersData.arrow!=null&&(e.styles.arrow=Object.assign({},e.styles.arrow,pde(Object.assign({},c,{offsets:e.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:l})))),e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-placement":e.placement})}const Oit={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:Cit,data:{}};var YD={passive:!0};function Eit(t){var e=t.state,n=t.instance,r=t.options,i=r.scroll,o=i===void 0?!0:i,s=r.resize,a=s===void 0?!0:s,l=wc(e.elements.popper),c=[].concat(e.scrollParents.reference,e.scrollParents.popper);return o&&c.forEach(function(u){u.addEventListener("scroll",n.update,YD)}),a&&l.addEventListener("resize",n.update,YD),function(){o&&c.forEach(function(u){u.removeEventListener("scroll",n.update,YD)}),a&&l.removeEventListener("resize",n.update,YD)}}const Tit={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:Eit,data:{}};var kit={left:"right",right:"left",bottom:"top",top:"bottom"};function r3(t){return t.replace(/left|right|bottom|top/g,function(e){return kit[e]})}var Ait={start:"end",end:"start"};function gde(t){return t.replace(/start|end/g,function(e){return Ait[e]})}function $ee(t){var e=wc(t),n=e.pageXOffset,r=e.pageYOffset;return{scrollLeft:n,scrollTop:r}}function Fee(t){return bS(My(t)).left+$ee(t).scrollLeft}function Pit(t,e){var n=wc(t),r=My(t),i=n.visualViewport,o=r.clientWidth,s=r.clientHeight,a=0,l=0;if(i){o=i.width,s=i.height;var c=KAe();(c||!c&&e==="fixed")&&(a=i.offsetLeft,l=i.offsetTop)}return{width:o,height:s,x:a+Fee(t),y:l}}function Mit(t){var e,n=My(t),r=$ee(t),i=(e=t.ownerDocument)==null?void 0:e.body,o=Ax(n.scrollWidth,n.clientWidth,i?i.scrollWidth:0,i?i.clientWidth:0),s=Ax(n.scrollHeight,n.clientHeight,i?i.scrollHeight:0,i?i.clientHeight:0),a=-r.scrollLeft+Fee(t),l=-r.scrollTop;return kg(i||n).direction==="rtl"&&(a+=Ax(n.clientWidth,i?i.clientWidth:0)-o),{width:o,height:s,x:a,y:l}}function Nee(t){var e=kg(t),n=e.overflow,r=e.overflowX,i=e.overflowY;return/auto|scroll|overlay|hidden/.test(n+i+r)}function nPe(t){return["html","body","#document"].indexOf(wh(t))>=0?t.ownerDocument.body:fu(t)&&Nee(t)?t:nPe(d4(t))}function YT(t,e){var n;e===void 0&&(e=[]);var r=nPe(t),i=r===((n=t.ownerDocument)==null?void 0:n.body),o=wc(r),s=i?[o].concat(o.visualViewport||[],Nee(r)?r:[]):r,a=e.concat(s);return i?a:a.concat(YT(d4(s)))}function iq(t){return Object.assign({},t,{left:t.x,top:t.y,right:t.x+t.width,bottom:t.y+t.height})}function Rit(t,e){var n=bS(t,!1,e==="fixed");return n.top=n.top+t.clientTop,n.left=n.left+t.clientLeft,n.bottom=n.top+t.clientHeight,n.right=n.left+t.clientWidth,n.width=t.clientWidth,n.height=t.clientHeight,n.x=n.left,n.y=n.top,n}function mde(t,e,n){return e===YAe?iq(Pit(t,n)):tb(e)?Rit(e,n):iq(Mit(My(t)))}function Dit(t){var e=YT(d4(t)),n=["absolute","fixed"].indexOf(kg(t).position)>=0,r=n&&fu(t)?RM(t):t;return tb(r)?e.filter(function(i){return tb(i)&&ZAe(i,r)&&wh(i)!=="body"}):[]}function Iit(t,e,n,r){var i=e==="clippingParents"?Dit(t):[].concat(e),o=[].concat(i,[n]),s=o[0],a=o.reduce(function(l,c){var u=mde(t,c,r);return l.top=Ax(u.top,l.top),l.right=RF(u.right,l.right),l.bottom=RF(u.bottom,l.bottom),l.left=Ax(u.left,l.left),l},mde(t,s,r));return a.width=a.right-a.left,a.height=a.bottom-a.top,a.x=a.left,a.y=a.top,a}function rPe(t){var e=t.reference,n=t.element,r=t.placement,i=r?lh(r):null,o=r?wS(r):null,s=e.x+e.width/2-n.width/2,a=e.y+e.height/2-n.height/2,l;switch(i){case fl:l={x:s,y:e.y-n.height};break;case Su:l={x:s,y:e.y+e.height};break;case Cu:l={x:e.x+e.width,y:a};break;case dl:l={x:e.x-n.width,y:a};break;default:l={x:e.x,y:e.y}}var c=i?Lee(i):null;if(c!=null){var u=c==="y"?"height":"width";switch(o){case yS:l[c]=l[c]-(e[u]/2-n[u]/2);break;case rA:l[c]=l[c]+(e[u]/2-n[u]/2);break}}return l}function iA(t,e){e===void 0&&(e={});var n=e,r=n.placement,i=r===void 0?t.placement:r,o=n.strategy,s=o===void 0?t.strategy:o,a=n.boundary,l=a===void 0?eit:a,c=n.rootBoundary,u=c===void 0?YAe:c,f=n.elementContext,d=f===void 0?TE:f,h=n.altBoundary,p=h===void 0?!1:h,g=n.padding,m=g===void 0?0:g,v=ePe(typeof m!="number"?m:tPe(m,MM)),y=d===TE?tit:TE,x=t.rects.popper,b=t.elements[p?y:d],w=Iit(tb(b)?b:b.contextElement||My(t.elements.popper),l,u,s),_=bS(t.elements.reference),S=rPe({reference:_,element:x,strategy:"absolute",placement:i}),O=iq(Object.assign({},x,S)),k=d===TE?O:_,E={top:w.top-k.top+v.top,bottom:k.bottom-w.bottom+v.bottom,left:w.left-k.left+v.left,right:k.right-w.right+v.right},P=t.modifiersData.offset;if(d===TE&&P){var A=P[i];Object.keys(E).forEach(function(R){var T=[Cu,Su].indexOf(R)>=0?1:-1,M=[fl,Su].indexOf(R)>=0?"y":"x";E[R]+=A[M]*T})}return E}function Lit(t,e){e===void 0&&(e={});var n=e,r=n.placement,i=n.boundary,o=n.rootBoundary,s=n.padding,a=n.flipVariations,l=n.allowedAutoPlacements,c=l===void 0?QAe:l,u=wS(r),f=u?a?dde:dde.filter(function(p){return wS(p)===u}):MM,d=f.filter(function(p){return c.indexOf(p)>=0});d.length===0&&(d=f);var h=d.reduce(function(p,g){return p[g]=iA(t,{placement:g,boundary:i,rootBoundary:o,padding:s})[lh(g)],p},{});return Object.keys(h).sort(function(p,g){return h[p]-h[g]})}function $it(t){if(lh(t)===Ree)return[];var e=r3(t);return[gde(t),e,gde(e)]}function Fit(t){var e=t.state,n=t.options,r=t.name;if(!e.modifiersData[r]._skip){for(var i=n.mainAxis,o=i===void 0?!0:i,s=n.altAxis,a=s===void 0?!0:s,l=n.fallbackPlacements,c=n.padding,u=n.boundary,f=n.rootBoundary,d=n.altBoundary,h=n.flipVariations,p=h===void 0?!0:h,g=n.allowedAutoPlacements,m=e.options.placement,v=lh(m),y=v===m,x=l||(y||!p?[r3(m)]:$it(m)),b=[m].concat(x).reduce(function(q,G){return q.concat(lh(G)===Ree?Lit(e,{placement:G,boundary:u,rootBoundary:f,padding:c,flipVariations:p,allowedAutoPlacements:g}):G)},[]),w=e.rects.reference,_=e.rects.popper,S=new Map,O=!0,k=b[0],E=0;E=0,M=T?"width":"height",I=iA(e,{placement:P,boundary:u,rootBoundary:f,altBoundary:d,padding:c}),j=T?R?Cu:dl:R?Su:fl;w[M]>_[M]&&(j=r3(j));var N=r3(j),z=[];if(o&&z.push(I[A]<=0),a&&z.push(I[j]<=0,I[N]<=0),z.every(function(q){return q})){k=P,O=!1;break}S.set(P,z)}if(O)for(var L=p?3:1,B=function(G){var Y=b.find(function(le){var K=S.get(le);if(K)return K.slice(0,G).every(function(ee){return ee})});if(Y)return k=Y,"break"},F=L;F>0;F--){var $=B(F);if($==="break")break}e.placement!==k&&(e.modifiersData[r]._skip=!0,e.placement=k,e.reset=!0)}}const Nit={name:"flip",enabled:!0,phase:"main",fn:Fit,requiresIfExists:["offset"],data:{_skip:!1}};function vde(t,e,n){return n===void 0&&(n={x:0,y:0}),{top:t.top-e.height-n.y,right:t.right-e.width+n.x,bottom:t.bottom-e.height+n.y,left:t.left-e.width-n.x}}function yde(t){return[fl,Cu,Su,dl].some(function(e){return t[e]>=0})}function zit(t){var e=t.state,n=t.name,r=e.rects.reference,i=e.rects.popper,o=e.modifiersData.preventOverflow,s=iA(e,{elementContext:"reference"}),a=iA(e,{altBoundary:!0}),l=vde(s,r),c=vde(a,i,o),u=yde(l),f=yde(c);e.modifiersData[n]={referenceClippingOffsets:l,popperEscapeOffsets:c,isReferenceHidden:u,hasPopperEscaped:f},e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-reference-hidden":u,"data-popper-escaped":f})}const jit={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:zit};function Bit(t,e,n){var r=lh(t),i=[dl,fl].indexOf(r)>=0?-1:1,o=typeof n=="function"?n(Object.assign({},e,{placement:t})):n,s=o[0],a=o[1];return s=s||0,a=(a||0)*i,[dl,Cu].indexOf(r)>=0?{x:a,y:s}:{x:s,y:a}}function Uit(t){var e=t.state,n=t.options,r=t.name,i=n.offset,o=i===void 0?[0,0]:i,s=QAe.reduce(function(u,f){return u[f]=Bit(f,e.rects,o),u},{}),a=s[e.placement],l=a.x,c=a.y;e.modifiersData.popperOffsets!=null&&(e.modifiersData.popperOffsets.x+=l,e.modifiersData.popperOffsets.y+=c),e.modifiersData[r]=s}const Wit={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:Uit};function Vit(t){var e=t.state,n=t.name;e.modifiersData[n]=rPe({reference:e.rects.reference,element:e.rects.popper,strategy:"absolute",placement:e.placement})}const Git={name:"popperOffsets",enabled:!0,phase:"read",fn:Vit,data:{}};function Hit(t){return t==="x"?"y":"x"}function qit(t){var e=t.state,n=t.options,r=t.name,i=n.mainAxis,o=i===void 0?!0:i,s=n.altAxis,a=s===void 0?!1:s,l=n.boundary,c=n.rootBoundary,u=n.altBoundary,f=n.padding,d=n.tether,h=d===void 0?!0:d,p=n.tetherOffset,g=p===void 0?0:p,m=iA(e,{boundary:l,rootBoundary:c,padding:f,altBoundary:u}),v=lh(e.placement),y=wS(e.placement),x=!y,b=Lee(v),w=Hit(b),_=e.modifiersData.popperOffsets,S=e.rects.reference,O=e.rects.popper,k=typeof g=="function"?g(Object.assign({},e.rects,{placement:e.placement})):g,E=typeof k=="number"?{mainAxis:k,altAxis:k}:Object.assign({mainAxis:0,altAxis:0},k),P=e.modifiersData.offset?e.modifiersData.offset[e.placement]:null,A={x:0,y:0};if(_){if(o){var R,T=b==="y"?fl:dl,M=b==="y"?Su:Cu,I=b==="y"?"height":"width",j=_[b],N=j+m[T],z=j-m[M],L=h?-O[I]/2:0,B=y===yS?S[I]:O[I],F=y===yS?-O[I]:-S[I],$=e.elements.arrow,q=h&&$?Iee($):{width:0,height:0},G=e.modifiersData["arrow#persistent"]?e.modifiersData["arrow#persistent"].padding:JAe(),Y=G[T],le=G[M],K=XT(0,S[I],q[I]),ee=x?S[I]/2-L-K-Y-E.mainAxis:B-K-Y-E.mainAxis,re=x?-S[I]/2+L+K+le+E.mainAxis:F+K+le+E.mainAxis,ge=e.elements.arrow&&RM(e.elements.arrow),te=ge?b==="y"?ge.clientTop||0:ge.clientLeft||0:0,ae=(R=P==null?void 0:P[b])!=null?R:0,U=j+ee-ae-te,oe=j+re-ae,ne=XT(h?RF(N,U):N,j,h?Ax(z,oe):z);_[b]=ne,A[b]=ne-j}if(a){var V,X=b==="x"?fl:dl,Z=b==="x"?Su:Cu,he=_[w],xe=w==="y"?"height":"width",H=he+m[X],W=he-m[Z],J=[fl,dl].indexOf(v)!==-1,se=(V=P==null?void 0:P[w])!=null?V:0,ye=J?H:he-S[xe]-O[xe]-se+E.altAxis,ie=J?he+S[xe]+O[xe]-se-E.altAxis:W,fe=h&&J?vit(ye,he,ie):XT(h?ye:H,he,h?ie:W);_[w]=fe,A[w]=fe-he}e.modifiersData[r]=A}}const Xit={name:"preventOverflow",enabled:!0,phase:"main",fn:qit,requiresIfExists:["offset"]};function Yit(t){return{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}}function Qit(t){return t===wc(t)||!fu(t)?$ee(t):Yit(t)}function Kit(t){var e=t.getBoundingClientRect(),n=xS(e.width)/t.offsetWidth||1,r=xS(e.height)/t.offsetHeight||1;return n!==1||r!==1}function Zit(t,e,n){n===void 0&&(n=!1);var r=fu(e),i=fu(e)&&Kit(e),o=My(e),s=bS(t,i,n),a={scrollLeft:0,scrollTop:0},l={x:0,y:0};return(r||!r&&!n)&&((wh(e)!=="body"||Nee(o))&&(a=Qit(e)),fu(e)?(l=bS(e,!0),l.x+=e.clientLeft,l.y+=e.clientTop):o&&(l.x=Fee(o))),{x:s.left+a.scrollLeft-l.x,y:s.top+a.scrollTop-l.y,width:s.width,height:s.height}}function Jit(t){var e=new Map,n=new Set,r=[];t.forEach(function(o){e.set(o.name,o)});function i(o){n.add(o.name);var s=[].concat(o.requires||[],o.requiresIfExists||[]);s.forEach(function(a){if(!n.has(a)){var l=e.get(a);l&&i(l)}}),r.push(o)}return t.forEach(function(o){n.has(o.name)||i(o)}),r}function eot(t){var e=Jit(t);return fit.reduce(function(n,r){return n.concat(e.filter(function(i){return i.phase===r}))},[])}function tot(t){var e;return function(){return e||(e=new Promise(function(n){Promise.resolve().then(function(){e=void 0,n(t())})})),e}}function not(t){var e=t.reduce(function(n,r){var i=n[r.name];return n[r.name]=i?Object.assign({},i,r,{options:Object.assign({},i.options,r.options),data:Object.assign({},i.data,r.data)}):r,n},{});return Object.keys(e).map(function(n){return e[n]})}var xde={placement:"bottom",modifiers:[],strategy:"absolute"};function bde(){for(var t=arguments.length,e=new Array(t),n=0;n{o||a(sot(i)||document.body)},[i,o]),Ti(()=>{if(s&&!o)return ZH(n,s),()=>{ZH(n,null)}},[n,s,o]),o){if(D.isValidElement(r)){const c={ref:l};return D.cloneElement(r,c)}return C.jsx(D.Fragment,{children:r})}return C.jsx(D.Fragment,{children:s&&HC.createPortal(r,s)})});function aot(t){return Ye("MuiPopper",t)}He("MuiPopper",["root"]);function lot(t,e){if(e==="ltr")return t;switch(t){case"bottom-end":return"bottom-start";case"bottom-start":return"bottom-end";case"top-end":return"top-start";case"top-start":return"top-end";default:return t}}function oq(t){return typeof t=="function"?t():t}function cot(t){return t.nodeType!==void 0}const uot=t=>{const{classes:e}=t;return qe({root:["root"]},aot,e)},fot={},dot=D.forwardRef(function(e,n){const{anchorEl:r,children:i,direction:o,disablePortal:s,modifiers:a,open:l,placement:c,popperOptions:u,popperRef:f,slotProps:d={},slots:h={},TransitionProps:p,ownerState:g,...m}=e,v=D.useRef(null),y=dn(v,n),x=D.useRef(null),b=dn(x,f),w=D.useRef(b);Ti(()=>{w.current=b},[b]),D.useImperativeHandle(f,()=>x.current,[]);const _=lot(c,o),[S,O]=D.useState(_),[k,E]=D.useState(oq(r));D.useEffect(()=>{x.current&&x.current.forceUpdate()}),D.useEffect(()=>{r&&E(oq(r))},[r]),Ti(()=>{if(!k||!l)return;const M=N=>{O(N.placement)};let I=[{name:"preventOverflow",options:{altBoundary:s}},{name:"flip",options:{altBoundary:s}},{name:"onUpdate",enabled:!0,phase:"afterWrite",fn:({state:N})=>{M(N)}}];a!=null&&(I=I.concat(a)),u&&u.modifiers!=null&&(I=I.concat(u.modifiers));const j=oot(k,v.current,{placement:_,...u,modifiers:I});return w.current(j),()=>{j.destroy(),w.current(null)}},[k,s,a,l,u,_]);const P={placement:S};p!==null&&(P.TransitionProps=p);const A=uot(e),R=h.root??"div",T=Zt({elementType:R,externalSlotProps:d.root,externalForwardedProps:m,additionalProps:{role:"tooltip",ref:y},ownerState:e,className:A.root});return C.jsx(R,{...T,children:typeof i=="function"?i(P):i})}),hot=D.forwardRef(function(e,n){const{anchorEl:r,children:i,container:o,direction:s="ltr",disablePortal:a=!1,keepMounted:l=!1,modifiers:c,open:u,placement:f="bottom",popperOptions:d=fot,popperRef:h,style:p,transition:g=!1,slotProps:m={},slots:v={},...y}=e,[x,b]=D.useState(!0),w=()=>{b(!1)},_=()=>{b(!0)};if(!l&&!u&&(!g||x))return null;let S;if(o)S=o;else if(r){const E=oq(r);S=E&&cot(E)?vi(E).body:vi(null).body}const O=!u&&l&&(!g||x)?"none":void 0,k=g?{in:u,onEnter:w,onExited:_}:void 0;return C.jsx(iPe,{disablePortal:a,container:S,children:C.jsx(dot,{anchorEl:r,direction:s,disablePortal:a,modifiers:c,ref:n,open:g?!x:u,placement:f,popperOptions:d,popperRef:h,slotProps:m,slots:v,...y,style:{position:"fixed",top:0,left:0,display:O,...p},TransitionProps:k,children:i})})}),pot=be(hot,{name:"MuiPopper",slot:"Root",overridesResolver:(t,e)=>e.root})({}),zee=D.forwardRef(function(e,n){const r=Ho(),i=wt({props:e,name:"MuiPopper"}),{anchorEl:o,component:s,components:a,componentsProps:l,container:c,disablePortal:u,keepMounted:f,modifiers:d,open:h,placement:p,popperOptions:g,popperRef:m,transition:v,slots:y,slotProps:x,...b}=i,w=(y==null?void 0:y.root)??(a==null?void 0:a.Root),_={anchorEl:o,container:c,disablePortal:u,keepMounted:f,modifiers:d,open:h,placement:p,popperOptions:g,popperRef:m,transition:v,...b};return C.jsx(pot,{as:s,direction:r?"rtl":"ltr",slots:{root:w},slotProps:x??l,..._,ref:n})}),got=ct(C.jsx("path",{d:"M12 2C6.47 2 2 6.47 2 12s4.47 10 10 10 10-4.47 10-10S17.53 2 12 2zm5 13.59L15.59 17 12 13.41 8.41 17 7 15.59 10.59 12 7 8.41 8.41 7 12 10.59 15.59 7 17 8.41 13.41 12 17 15.59z"}),"Cancel");function mot(t){return Ye("MuiChip",t)}const Sn=He("MuiChip",["root","sizeSmall","sizeMedium","colorDefault","colorError","colorInfo","colorPrimary","colorSecondary","colorSuccess","colorWarning","disabled","clickable","clickableColorPrimary","clickableColorSecondary","deletable","deletableColorPrimary","deletableColorSecondary","outlined","filled","outlinedPrimary","outlinedSecondary","filledPrimary","filledSecondary","avatar","avatarSmall","avatarMedium","avatarColorPrimary","avatarColorSecondary","icon","iconSmall","iconMedium","iconColorPrimary","iconColorSecondary","label","labelSmall","labelMedium","deleteIcon","deleteIconSmall","deleteIconMedium","deleteIconColorPrimary","deleteIconColorSecondary","deleteIconOutlinedColorPrimary","deleteIconOutlinedColorSecondary","deleteIconFilledColorPrimary","deleteIconFilledColorSecondary","focusVisible"]),vot=t=>{const{classes:e,disabled:n,size:r,color:i,iconColor:o,onDelete:s,clickable:a,variant:l}=t,c={root:["root",l,n&&"disabled",`size${Re(r)}`,`color${Re(i)}`,a&&"clickable",a&&`clickableColor${Re(i)}`,s&&"deletable",s&&`deletableColor${Re(i)}`,`${l}${Re(i)}`],label:["label",`label${Re(r)}`],avatar:["avatar",`avatar${Re(r)}`,`avatarColor${Re(i)}`],icon:["icon",`icon${Re(r)}`,`iconColor${Re(o)}`],deleteIcon:["deleteIcon",`deleteIcon${Re(r)}`,`deleteIconColor${Re(i)}`,`deleteIcon${Re(l)}Color${Re(i)}`]};return qe(c,mot,e)},yot=be("div",{name:"MuiChip",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t,{color:r,iconColor:i,clickable:o,onDelete:s,size:a,variant:l}=n;return[{[`& .${Sn.avatar}`]:e.avatar},{[`& .${Sn.avatar}`]:e[`avatar${Re(a)}`]},{[`& .${Sn.avatar}`]:e[`avatarColor${Re(r)}`]},{[`& .${Sn.icon}`]:e.icon},{[`& .${Sn.icon}`]:e[`icon${Re(a)}`]},{[`& .${Sn.icon}`]:e[`iconColor${Re(i)}`]},{[`& .${Sn.deleteIcon}`]:e.deleteIcon},{[`& .${Sn.deleteIcon}`]:e[`deleteIcon${Re(a)}`]},{[`& .${Sn.deleteIcon}`]:e[`deleteIconColor${Re(r)}`]},{[`& .${Sn.deleteIcon}`]:e[`deleteIcon${Re(l)}Color${Re(r)}`]},e.root,e[`size${Re(a)}`],e[`color${Re(r)}`],o&&e.clickable,o&&r!=="default"&&e[`clickableColor${Re(r)})`],s&&e.deletable,s&&r!=="default"&&e[`deletableColor${Re(r)}`],e[l],e[`${l}${Re(r)}`]]}})(Tt(({theme:t})=>{const e=t.palette.mode==="light"?t.palette.grey[700]:t.palette.grey[300];return{maxWidth:"100%",fontFamily:t.typography.fontFamily,fontSize:t.typography.pxToRem(13),display:"inline-flex",alignItems:"center",justifyContent:"center",height:32,color:(t.vars||t).palette.text.primary,backgroundColor:(t.vars||t).palette.action.selected,borderRadius:32/2,whiteSpace:"nowrap",transition:t.transitions.create(["background-color","box-shadow"]),cursor:"unset",outline:0,textDecoration:"none",border:0,padding:0,verticalAlign:"middle",boxSizing:"border-box",[`&.${Sn.disabled}`]:{opacity:(t.vars||t).palette.action.disabledOpacity,pointerEvents:"none"},[`& .${Sn.avatar}`]:{marginLeft:5,marginRight:-6,width:24,height:24,color:t.vars?t.vars.palette.Chip.defaultAvatarColor:e,fontSize:t.typography.pxToRem(12)},[`& .${Sn.avatarColorPrimary}`]:{color:(t.vars||t).palette.primary.contrastText,backgroundColor:(t.vars||t).palette.primary.dark},[`& .${Sn.avatarColorSecondary}`]:{color:(t.vars||t).palette.secondary.contrastText,backgroundColor:(t.vars||t).palette.secondary.dark},[`& .${Sn.avatarSmall}`]:{marginLeft:4,marginRight:-4,width:18,height:18,fontSize:t.typography.pxToRem(10)},[`& .${Sn.icon}`]:{marginLeft:5,marginRight:-6},[`& .${Sn.deleteIcon}`]:{WebkitTapHighlightColor:"transparent",color:t.vars?`rgba(${t.vars.palette.text.primaryChannel} / 0.26)`:kt(t.palette.text.primary,.26),fontSize:22,cursor:"pointer",margin:"0 5px 0 -6px","&:hover":{color:t.vars?`rgba(${t.vars.palette.text.primaryChannel} / 0.4)`:kt(t.palette.text.primary,.4)}},variants:[{props:{size:"small"},style:{height:24,[`& .${Sn.icon}`]:{fontSize:18,marginLeft:4,marginRight:-4},[`& .${Sn.deleteIcon}`]:{fontSize:16,marginRight:4,marginLeft:-4}}},...Object.entries(t.palette).filter(ii(["contrastText"])).map(([n])=>({props:{color:n},style:{backgroundColor:(t.vars||t).palette[n].main,color:(t.vars||t).palette[n].contrastText,[`& .${Sn.deleteIcon}`]:{color:t.vars?`rgba(${t.vars.palette[n].contrastTextChannel} / 0.7)`:kt(t.palette[n].contrastText,.7),"&:hover, &:active":{color:(t.vars||t).palette[n].contrastText}}}})),{props:n=>n.iconColor===n.color,style:{[`& .${Sn.icon}`]:{color:t.vars?t.vars.palette.Chip.defaultIconColor:e}}},{props:n=>n.iconColor===n.color&&n.color!=="default",style:{[`& .${Sn.icon}`]:{color:"inherit"}}},{props:{onDelete:!0},style:{[`&.${Sn.focusVisible}`]:{backgroundColor:t.vars?`rgba(${t.vars.palette.action.selectedChannel} / calc(${t.vars.palette.action.selectedOpacity} + ${t.vars.palette.action.focusOpacity}))`:kt(t.palette.action.selected,t.palette.action.selectedOpacity+t.palette.action.focusOpacity)}}},...Object.entries(t.palette).filter(ii(["dark"])).map(([n])=>({props:{color:n,onDelete:!0},style:{[`&.${Sn.focusVisible}`]:{background:(t.vars||t).palette[n].dark}}})),{props:{clickable:!0},style:{userSelect:"none",WebkitTapHighlightColor:"transparent",cursor:"pointer","&:hover":{backgroundColor:t.vars?`rgba(${t.vars.palette.action.selectedChannel} / calc(${t.vars.palette.action.selectedOpacity} + ${t.vars.palette.action.hoverOpacity}))`:kt(t.palette.action.selected,t.palette.action.selectedOpacity+t.palette.action.hoverOpacity)},[`&.${Sn.focusVisible}`]:{backgroundColor:t.vars?`rgba(${t.vars.palette.action.selectedChannel} / calc(${t.vars.palette.action.selectedOpacity} + ${t.vars.palette.action.focusOpacity}))`:kt(t.palette.action.selected,t.palette.action.selectedOpacity+t.palette.action.focusOpacity)},"&:active":{boxShadow:(t.vars||t).shadows[1]}}},...Object.entries(t.palette).filter(ii(["dark"])).map(([n])=>({props:{color:n,clickable:!0},style:{[`&:hover, &.${Sn.focusVisible}`]:{backgroundColor:(t.vars||t).palette[n].dark}}})),{props:{variant:"outlined"},style:{backgroundColor:"transparent",border:t.vars?`1px solid ${t.vars.palette.Chip.defaultBorder}`:`1px solid ${t.palette.mode==="light"?t.palette.grey[400]:t.palette.grey[700]}`,[`&.${Sn.clickable}:hover`]:{backgroundColor:(t.vars||t).palette.action.hover},[`&.${Sn.focusVisible}`]:{backgroundColor:(t.vars||t).palette.action.focus},[`& .${Sn.avatar}`]:{marginLeft:4},[`& .${Sn.avatarSmall}`]:{marginLeft:2},[`& .${Sn.icon}`]:{marginLeft:4},[`& .${Sn.iconSmall}`]:{marginLeft:2},[`& .${Sn.deleteIcon}`]:{marginRight:5},[`& .${Sn.deleteIconSmall}`]:{marginRight:3}}},...Object.entries(t.palette).filter(ii()).map(([n])=>({props:{variant:"outlined",color:n},style:{color:(t.vars||t).palette[n].main,border:`1px solid ${t.vars?`rgba(${t.vars.palette[n].mainChannel} / 0.7)`:kt(t.palette[n].main,.7)}`,[`&.${Sn.clickable}:hover`]:{backgroundColor:t.vars?`rgba(${t.vars.palette[n].mainChannel} / ${t.vars.palette.action.hoverOpacity})`:kt(t.palette[n].main,t.palette.action.hoverOpacity)},[`&.${Sn.focusVisible}`]:{backgroundColor:t.vars?`rgba(${t.vars.palette[n].mainChannel} / ${t.vars.palette.action.focusOpacity})`:kt(t.palette[n].main,t.palette.action.focusOpacity)},[`& .${Sn.deleteIcon}`]:{color:t.vars?`rgba(${t.vars.palette[n].mainChannel} / 0.7)`:kt(t.palette[n].main,.7),"&:hover, &:active":{color:(t.vars||t).palette[n].main}}}}))]}})),xot=be("span",{name:"MuiChip",slot:"Label",overridesResolver:(t,e)=>{const{ownerState:n}=t,{size:r}=n;return[e.label,e[`label${Re(r)}`]]}})({overflow:"hidden",textOverflow:"ellipsis",paddingLeft:12,paddingRight:12,whiteSpace:"nowrap",variants:[{props:{variant:"outlined"},style:{paddingLeft:11,paddingRight:11}},{props:{size:"small"},style:{paddingLeft:8,paddingRight:8}},{props:{size:"small",variant:"outlined"},style:{paddingLeft:7,paddingRight:7}}]});function wde(t){return t.key==="Backspace"||t.key==="Delete"}const oPe=D.forwardRef(function(e,n){const r=wt({props:e,name:"MuiChip"}),{avatar:i,className:o,clickable:s,color:a="default",component:l,deleteIcon:c,disabled:u=!1,icon:f,label:d,onClick:h,onDelete:p,onKeyDown:g,onKeyUp:m,size:v="medium",variant:y="filled",tabIndex:x,skipFocusWhenDisabled:b=!1,...w}=r,_=D.useRef(null),S=dn(_,n),O=z=>{z.stopPropagation(),p&&p(z)},k=z=>{z.currentTarget===z.target&&wde(z)&&z.preventDefault(),g&&g(z)},E=z=>{z.currentTarget===z.target&&p&&wde(z)&&p(z),m&&m(z)},P=s!==!1&&h?!0:s,A=P||p?Nf:l||"div",R={...r,component:A,disabled:u,size:v,color:a,iconColor:D.isValidElement(f)&&f.props.color||a,onDelete:!!p,clickable:P,variant:y},T=vot(R),M=A===Nf?{component:l||"div",focusVisibleClassName:T.focusVisible,...p&&{disableRipple:!0}}:{};let I=null;p&&(I=c&&D.isValidElement(c)?D.cloneElement(c,{className:Oe(c.props.className,T.deleteIcon),onClick:O}):C.jsx(got,{className:Oe(T.deleteIcon),onClick:O}));let j=null;i&&D.isValidElement(i)&&(j=D.cloneElement(i,{className:Oe(T.avatar,i.props.className)}));let N=null;return f&&D.isValidElement(f)&&(N=D.cloneElement(f,{className:Oe(T.icon,f.props.className)})),C.jsxs(yot,{as:A,className:Oe(T.root,o),disabled:P&&u?!0:void 0,onClick:h,onKeyDown:k,onKeyUp:E,ref:S,tabIndex:b&&u?-1:x,ownerState:R,...M,...w,children:[j||N,C.jsx(xot,{className:Oe(T.label),ownerState:R,children:d}),I]})});function QD(t){return parseInt(t,10)||0}const bot={shadow:{visibility:"hidden",position:"absolute",overflow:"hidden",height:0,top:0,left:0,transform:"translateZ(0)"}};function wot(t){return t==null||Object.keys(t).length===0||t.outerHeightStyle===0&&!t.overflowing}const _ot=D.forwardRef(function(e,n){const{onChange:r,maxRows:i,minRows:o=1,style:s,value:a,...l}=e,{current:c}=D.useRef(a!=null),u=D.useRef(null),f=dn(n,u),d=D.useRef(null),h=D.useRef(null),p=D.useCallback(()=>{const v=u.current,x=xc(v).getComputedStyle(v);if(x.width==="0px")return{outerHeightStyle:0,overflowing:!1};const b=h.current;b.style.width=x.width,b.value=v.value||e.placeholder||"x",b.value.slice(-1)===` +`&&(b.value+=" ");const w=x.boxSizing,_=QD(x.paddingBottom)+QD(x.paddingTop),S=QD(x.borderBottomWidth)+QD(x.borderTopWidth),O=b.scrollHeight;b.value="x";const k=b.scrollHeight;let E=O;o&&(E=Math.max(Number(o)*k,E)),i&&(E=Math.min(Number(i)*k,E)),E=Math.max(E,k);const P=E+(w==="border-box"?_+S:0),A=Math.abs(E-O)<=1;return{outerHeightStyle:P,overflowing:A}},[i,o,e.placeholder]),g=D.useCallback(()=>{const v=p();if(wot(v))return;const y=v.outerHeightStyle,x=u.current;d.current!==y&&(d.current=y,x.style.height=`${y}px`),x.style.overflow=v.overflowing?"hidden":""},[p]);Ti(()=>{const v=()=>{g()};let y;const x=kM(v),b=u.current,w=xc(b);w.addEventListener("resize",x);let _;return typeof ResizeObserver<"u"&&(_=new ResizeObserver(v),_.observe(b)),()=>{x.clear(),cancelAnimationFrame(y),w.removeEventListener("resize",x),_&&_.disconnect()}},[p,g]),Ti(()=>{g()});const m=v=>{c||g(),r&&r(v)};return C.jsxs(D.Fragment,{children:[C.jsx("textarea",{value:a,onChange:m,ref:f,rows:o,style:s,...l}),C.jsx("textarea",{"aria-hidden":!0,className:e.className,readOnly:!0,ref:h,tabIndex:-1,style:{...bot.shadow,...s,paddingTop:0,paddingBottom:0}})]})});function eg(t){return typeof t=="string"}function Ry({props:t,states:e,muiFormControl:n}){return e.reduce((r,i)=>(r[i]=t[i],n&&typeof t[i]>"u"&&(r[i]=n[i]),r),{})}const h4=D.createContext(void 0);function Fa(){return D.useContext(h4)}function _de(t){return t!=null&&!(Array.isArray(t)&&t.length===0)}function DF(t,e=!1){return t&&(_de(t.value)&&t.value!==""||e&&_de(t.defaultValue)&&t.defaultValue!=="")}function Sot(t){return t.startAdornment}function Cot(t){return Ye("MuiInputBase",t)}const _S=He("MuiInputBase",["root","formControl","focused","disabled","adornedStart","adornedEnd","error","sizeSmall","multiline","colorSecondary","fullWidth","hiddenLabel","readOnly","input","inputSizeSmall","inputMultiline","inputTypeSearch","inputAdornedStart","inputAdornedEnd","inputHiddenLabel"]);var Sde;const p4=(t,e)=>{const{ownerState:n}=t;return[e.root,n.formControl&&e.formControl,n.startAdornment&&e.adornedStart,n.endAdornment&&e.adornedEnd,n.error&&e.error,n.size==="small"&&e.sizeSmall,n.multiline&&e.multiline,n.color&&e[`color${Re(n.color)}`],n.fullWidth&&e.fullWidth,n.hiddenLabel&&e.hiddenLabel]},g4=(t,e)=>{const{ownerState:n}=t;return[e.input,n.size==="small"&&e.inputSizeSmall,n.multiline&&e.inputMultiline,n.type==="search"&&e.inputTypeSearch,n.startAdornment&&e.inputAdornedStart,n.endAdornment&&e.inputAdornedEnd,n.hiddenLabel&&e.inputHiddenLabel]},Oot=t=>{const{classes:e,color:n,disabled:r,error:i,endAdornment:o,focused:s,formControl:a,fullWidth:l,hiddenLabel:c,multiline:u,readOnly:f,size:d,startAdornment:h,type:p}=t,g={root:["root",`color${Re(n)}`,r&&"disabled",i&&"error",l&&"fullWidth",s&&"focused",a&&"formControl",d&&d!=="medium"&&`size${Re(d)}`,u&&"multiline",h&&"adornedStart",o&&"adornedEnd",c&&"hiddenLabel",f&&"readOnly"],input:["input",r&&"disabled",p==="search"&&"inputTypeSearch",u&&"inputMultiline",d==="small"&&"inputSizeSmall",c&&"inputHiddenLabel",h&&"inputAdornedStart",o&&"inputAdornedEnd",f&&"readOnly"]};return qe(g,Cot,e)},m4=be("div",{name:"MuiInputBase",slot:"Root",overridesResolver:p4})(Tt(({theme:t})=>({...t.typography.body1,color:(t.vars||t).palette.text.primary,lineHeight:"1.4375em",boxSizing:"border-box",position:"relative",cursor:"text",display:"inline-flex",alignItems:"center",[`&.${_S.disabled}`]:{color:(t.vars||t).palette.text.disabled,cursor:"default"},variants:[{props:({ownerState:e})=>e.multiline,style:{padding:"4px 0 5px"}},{props:({ownerState:e,size:n})=>e.multiline&&n==="small",style:{paddingTop:1}},{props:({ownerState:e})=>e.fullWidth,style:{width:"100%"}}]}))),v4=be("input",{name:"MuiInputBase",slot:"Input",overridesResolver:g4})(Tt(({theme:t})=>{const e=t.palette.mode==="light",n={color:"currentColor",...t.vars?{opacity:t.vars.opacity.inputPlaceholder}:{opacity:e?.42:.5},transition:t.transitions.create("opacity",{duration:t.transitions.duration.shorter})},r={opacity:"0 !important"},i=t.vars?{opacity:t.vars.opacity.inputPlaceholder}:{opacity:e?.42:.5};return{font:"inherit",letterSpacing:"inherit",color:"currentColor",padding:"4px 0 5px",border:0,boxSizing:"content-box",background:"none",height:"1.4375em",margin:0,WebkitTapHighlightColor:"transparent",display:"block",minWidth:0,width:"100%","&::-webkit-input-placeholder":n,"&::-moz-placeholder":n,"&::-ms-input-placeholder":n,"&:focus":{outline:0},"&:invalid":{boxShadow:"none"},"&::-webkit-search-decoration":{WebkitAppearance:"none"},[`label[data-shrink=false] + .${_S.formControl} &`]:{"&::-webkit-input-placeholder":r,"&::-moz-placeholder":r,"&::-ms-input-placeholder":r,"&:focus::-webkit-input-placeholder":i,"&:focus::-moz-placeholder":i,"&:focus::-ms-input-placeholder":i},[`&.${_S.disabled}`]:{opacity:1,WebkitTextFillColor:(t.vars||t).palette.text.disabled},variants:[{props:({ownerState:o})=>!o.disableInjectingGlobalStyles,style:{animationName:"mui-auto-fill-cancel",animationDuration:"10ms","&:-webkit-autofill":{animationDuration:"5000s",animationName:"mui-auto-fill"}}},{props:{size:"small"},style:{paddingTop:1}},{props:({ownerState:o})=>o.multiline,style:{height:"auto",resize:"none",padding:0,paddingTop:0}},{props:{type:"search"},style:{MozAppearance:"textfield"}}]}})),Cde=Eee({"@keyframes mui-auto-fill":{from:{display:"block"}},"@keyframes mui-auto-fill-cancel":{from:{display:"block"}}}),jee=D.forwardRef(function(e,n){const r=wt({props:e,name:"MuiInputBase"}),{"aria-describedby":i,autoComplete:o,autoFocus:s,className:a,color:l,components:c={},componentsProps:u={},defaultValue:f,disabled:d,disableInjectingGlobalStyles:h,endAdornment:p,error:g,fullWidth:m=!1,id:v,inputComponent:y="input",inputProps:x={},inputRef:b,margin:w,maxRows:_,minRows:S,multiline:O=!1,name:k,onBlur:E,onChange:P,onClick:A,onFocus:R,onKeyDown:T,onKeyUp:M,placeholder:I,readOnly:j,renderSuffix:N,rows:z,size:L,slotProps:B={},slots:F={},startAdornment:$,type:q="text",value:G,...Y}=r,le=x.value!=null?x.value:G,{current:K}=D.useRef(le!=null),ee=D.useRef(),re=D.useCallback(we=>{},[]),ge=dn(ee,b,x.ref,re),[te,ae]=D.useState(!1),U=Fa(),oe=Ry({props:r,muiFormControl:U,states:["color","disabled","error","hiddenLabel","size","required","filled"]});oe.focused=U?U.focused:te,D.useEffect(()=>{!U&&d&&te&&(ae(!1),E&&E())},[U,d,te,E]);const ne=U&&U.onFilled,V=U&&U.onEmpty,X=D.useCallback(we=>{DF(we)?ne&&ne():V&&V()},[ne,V]);Ti(()=>{K&&X({value:le})},[le,X,K]);const Z=we=>{R&&R(we),x.onFocus&&x.onFocus(we),U&&U.onFocus?U.onFocus(we):ae(!0)},he=we=>{E&&E(we),x.onBlur&&x.onBlur(we),U&&U.onBlur?U.onBlur(we):ae(!1)},xe=(we,...Ie)=>{if(!K){const Pe=we.target||ee.current;if(Pe==null)throw new Error(Og(1));X({value:Pe.value})}x.onChange&&x.onChange(we,...Ie),P&&P(we,...Ie)};D.useEffect(()=>{X(ee.current)},[]);const H=we=>{ee.current&&we.currentTarget===we.target&&ee.current.focus(),A&&A(we)};let W=y,J=x;O&&W==="input"&&(z?J={type:void 0,minRows:z,maxRows:z,...J}:J={type:void 0,maxRows:_,minRows:S,...J},W=_ot);const se=we=>{X(we.animationName==="mui-auto-fill-cancel"?ee.current:{value:"x"})};D.useEffect(()=>{U&&U.setAdornedStart(!!$)},[U,$]);const ye={...r,color:oe.color||"primary",disabled:oe.disabled,endAdornment:p,error:oe.error,focused:oe.focused,formControl:U,fullWidth:m,hiddenLabel:oe.hiddenLabel,multiline:O,size:oe.size,startAdornment:$,type:q},ie=Oot(ye),fe=F.root||c.Root||m4,Q=B.root||u.root||{},_e=F.input||c.Input||v4;return J={...J,...B.input??u.input},C.jsxs(D.Fragment,{children:[!h&&typeof Cde=="function"&&(Sde||(Sde=C.jsx(Cde,{}))),C.jsxs(fe,{...Q,ref:n,onClick:H,...Y,...!eg(fe)&&{ownerState:{...ye,...Q.ownerState}},className:Oe(ie.root,Q.className,a,j&&"MuiInputBase-readOnly"),children:[$,C.jsx(h4.Provider,{value:null,children:C.jsx(_e,{"aria-invalid":oe.error,"aria-describedby":i,autoComplete:o,autoFocus:s,defaultValue:f,disabled:oe.disabled,id:v,onAnimationStart:se,name:k,placeholder:I,readOnly:j,required:oe.required,rows:z,value:le,onKeyDown:T,onKeyUp:M,type:q,...J,...!eg(_e)&&{as:W,ownerState:{...ye,...J.ownerState}},ref:ge,className:Oe(ie.input,J.className,j&&"MuiInputBase-readOnly"),onBlur:he,onChange:xe,onFocus:Z})}),p,N?N({...oe,startAdornment:$}):null]})]})});function Eot(t){return Ye("MuiInput",t)}const kE={..._S,...He("MuiInput",["root","underline","input"])};function Tot(t){return Ye("MuiOutlinedInput",t)}const pd={..._S,...He("MuiOutlinedInput",["root","notchedOutline","input"])};function kot(t){return Ye("MuiFilledInput",t)}const u0={..._S,...He("MuiFilledInput",["root","underline","input","adornedStart","adornedEnd","sizeSmall","multiline","hiddenLabel"])},Aot=ct(C.jsx("path",{d:"M7 10l5 5 5-5z"}),"ArrowDropDown"),Pot=ct(C.jsx("path",{d:"M12 12c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm0 2c-2.67 0-8 1.34-8 4v2h16v-2c0-2.66-5.33-4-8-4z"}),"Person");function Mot(t){return Ye("MuiAvatar",t)}He("MuiAvatar",["root","colorDefault","circular","rounded","square","img","fallback"]);const Rot=t=>{const{classes:e,variant:n,colorDefault:r}=t;return qe({root:["root",n,r&&"colorDefault"],img:["img"],fallback:["fallback"]},Mot,e)},Dot=be("div",{name:"MuiAvatar",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,e[n.variant],n.colorDefault&&e.colorDefault]}})(Tt(({theme:t})=>({position:"relative",display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0,width:40,height:40,fontFamily:t.typography.fontFamily,fontSize:t.typography.pxToRem(20),lineHeight:1,borderRadius:"50%",overflow:"hidden",userSelect:"none",variants:[{props:{variant:"rounded"},style:{borderRadius:(t.vars||t).shape.borderRadius}},{props:{variant:"square"},style:{borderRadius:0}},{props:{colorDefault:!0},style:{color:(t.vars||t).palette.background.default,...t.vars?{backgroundColor:t.vars.palette.Avatar.defaultBg}:{backgroundColor:t.palette.grey[400],...t.applyStyles("dark",{backgroundColor:t.palette.grey[600]})}}}]}))),Iot=be("img",{name:"MuiAvatar",slot:"Img",overridesResolver:(t,e)=>e.img})({width:"100%",height:"100%",textAlign:"center",objectFit:"cover",color:"transparent",textIndent:1e4}),Lot=be(Pot,{name:"MuiAvatar",slot:"Fallback",overridesResolver:(t,e)=>e.fallback})({width:"75%",height:"75%"});function $ot({crossOrigin:t,referrerPolicy:e,src:n,srcSet:r}){const[i,o]=D.useState(!1);return D.useEffect(()=>{if(!n&&!r)return;o(!1);let s=!0;const a=new Image;return a.onload=()=>{s&&o("loaded")},a.onerror=()=>{s&&o("error")},a.crossOrigin=t,a.referrerPolicy=e,a.src=n,r&&(a.srcset=r),()=>{s=!1}},[t,e,n,r]),i}const eW=D.forwardRef(function(e,n){const r=wt({props:e,name:"MuiAvatar"}),{alt:i,children:o,className:s,component:a="div",slots:l={},slotProps:c={},imgProps:u,sizes:f,src:d,srcSet:h,variant:p="circular",...g}=r;let m=null;const v=$ot({...u,src:d,srcSet:h}),y=d||h,x=y&&v!=="error",b={...r,colorDefault:!x,component:a,variant:p};delete b.ownerState;const w=Rot(b),[_,S]=Zl("img",{className:w.img,elementType:Iot,externalForwardedProps:{slots:l,slotProps:{img:{...u,...c.img}}},additionalProps:{alt:i,src:d,srcSet:h,sizes:f},ownerState:b});return x?m=C.jsx(_,{...S}):o||o===0?m=o:y&&i?m=i[0]:m=C.jsx(Lot,{ownerState:b,className:w.fallback}),C.jsx(Dot,{as:a,className:Oe(w.root,s),ref:n,...g,ownerState:b,children:m})}),Fot={entering:{opacity:1},entered:{opacity:1}},XC=D.forwardRef(function(e,n){const r=$a(),i={enter:r.transitions.duration.enteringScreen,exit:r.transitions.duration.leavingScreen},{addEndListener:o,appear:s=!0,children:a,easing:l,in:c,onEnter:u,onEntered:f,onEntering:d,onExit:h,onExited:p,onExiting:g,style:m,timeout:v=i,TransitionComponent:y=Rc,...x}=e,b=D.useRef(null),w=dn(b,Py(a),n),_=T=>M=>{if(T){const I=b.current;M===void 0?T(I):T(I,M)}},S=_(d),O=_((T,M)=>{Mee(T);const I=Zv({style:m,timeout:v,easing:l},{mode:"enter"});T.style.webkitTransition=r.transitions.create("opacity",I),T.style.transition=r.transitions.create("opacity",I),u&&u(T,M)}),k=_(f),E=_(g),P=_(T=>{const M=Zv({style:m,timeout:v,easing:l},{mode:"exit"});T.style.webkitTransition=r.transitions.create("opacity",M),T.style.transition=r.transitions.create("opacity",M),h&&h(T)}),A=_(p),R=T=>{o&&o(b.current,T)};return C.jsx(y,{appear:s,in:c,nodeRef:b,onEnter:O,onEntered:k,onEntering:S,onExit:P,onExited:A,onExiting:E,addEndListener:R,timeout:v,...x,children:(T,M)=>D.cloneElement(a,{style:{opacity:0,visibility:T==="exited"&&!c?"hidden":void 0,...Fot[T],...m,...a.props.style},ref:w,...M})})});function Not(t){return Ye("MuiBackdrop",t)}He("MuiBackdrop",["root","invisible"]);const zot=t=>{const{ownerState:e,...n}=t;return n},jot=t=>{const{classes:e,invisible:n}=t;return qe({root:["root",n&&"invisible"]},Not,e)},Bot=be("div",{name:"MuiBackdrop",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,n.invisible&&e.invisible]}})({position:"fixed",display:"flex",alignItems:"center",justifyContent:"center",right:0,bottom:0,top:0,left:0,backgroundColor:"rgba(0, 0, 0, 0.5)",WebkitTapHighlightColor:"transparent",variants:[{props:{invisible:!0},style:{backgroundColor:"transparent"}}]}),sPe=D.forwardRef(function(e,n){const r=wt({props:e,name:"MuiBackdrop"}),{children:i,className:o,component:s="div",invisible:a=!1,open:l,components:c={},componentsProps:u={},slotProps:f={},slots:d={},TransitionComponent:h,transitionDuration:p,...g}=r,m={...r,component:s,invisible:a},v=jot(m),y={transition:h,root:c.Root,...d},x={...u,...f},b={slots:y,slotProps:x},[w,_]=Zl("root",{elementType:Bot,externalForwardedProps:b,className:Oe(v.root,o),ownerState:m}),[S,O]=Zl("transition",{elementType:XC,externalForwardedProps:b,ownerState:m}),k=zot(O);return C.jsx(S,{in:l,timeout:p,...g,...k,children:C.jsx(w,{"aria-hidden":!0,..._,classes:v,ref:n,children:i})})}),Uot=He("MuiBox",["root"]),Wot=Jj(),ot=Ntt({themeId:Df,defaultTheme:Wot,defaultClassName:Uot.root,generateClassName:yAe.generate});function Vot(t){return Ye("MuiButton",t)}const N1=He("MuiButton",["root","text","textInherit","textPrimary","textSecondary","textSuccess","textError","textInfo","textWarning","outlined","outlinedInherit","outlinedPrimary","outlinedSecondary","outlinedSuccess","outlinedError","outlinedInfo","outlinedWarning","contained","containedInherit","containedPrimary","containedSecondary","containedSuccess","containedError","containedInfo","containedWarning","disableElevation","focusVisible","disabled","colorInherit","colorPrimary","colorSecondary","colorSuccess","colorError","colorInfo","colorWarning","textSizeSmall","textSizeMedium","textSizeLarge","outlinedSizeSmall","outlinedSizeMedium","outlinedSizeLarge","containedSizeSmall","containedSizeMedium","containedSizeLarge","sizeMedium","sizeSmall","sizeLarge","fullWidth","startIcon","endIcon","icon","iconSizeSmall","iconSizeMedium","iconSizeLarge"]),Got=D.createContext({}),Hot=D.createContext(void 0),qot=t=>{const{color:e,disableElevation:n,fullWidth:r,size:i,variant:o,classes:s}=t,a={root:["root",o,`${o}${Re(e)}`,`size${Re(i)}`,`${o}Size${Re(i)}`,`color${Re(e)}`,n&&"disableElevation",r&&"fullWidth"],label:["label"],startIcon:["icon","startIcon",`iconSize${Re(i)}`],endIcon:["icon","endIcon",`iconSize${Re(i)}`]},l=qe(a,Vot,s);return{...s,...l}},aPe=[{props:{size:"small"},style:{"& > *:nth-of-type(1)":{fontSize:18}}},{props:{size:"medium"},style:{"& > *:nth-of-type(1)":{fontSize:20}}},{props:{size:"large"},style:{"& > *:nth-of-type(1)":{fontSize:22}}}],Xot=be(Nf,{shouldForwardProp:t=>qo(t)||t==="classes",name:"MuiButton",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,e[n.variant],e[`${n.variant}${Re(n.color)}`],e[`size${Re(n.size)}`],e[`${n.variant}Size${Re(n.size)}`],n.color==="inherit"&&e.colorInherit,n.disableElevation&&e.disableElevation,n.fullWidth&&e.fullWidth]}})(Tt(({theme:t})=>{const e=t.palette.mode==="light"?t.palette.grey[300]:t.palette.grey[800],n=t.palette.mode==="light"?t.palette.grey.A100:t.palette.grey[700];return{...t.typography.button,minWidth:64,padding:"6px 16px",border:0,borderRadius:(t.vars||t).shape.borderRadius,transition:t.transitions.create(["background-color","box-shadow","border-color","color"],{duration:t.transitions.duration.short}),"&:hover":{textDecoration:"none"},[`&.${N1.disabled}`]:{color:(t.vars||t).palette.action.disabled},variants:[{props:{variant:"contained"},style:{color:"var(--variant-containedColor)",backgroundColor:"var(--variant-containedBg)",boxShadow:(t.vars||t).shadows[2],"&:hover":{boxShadow:(t.vars||t).shadows[4],"@media (hover: none)":{boxShadow:(t.vars||t).shadows[2]}},"&:active":{boxShadow:(t.vars||t).shadows[8]},[`&.${N1.focusVisible}`]:{boxShadow:(t.vars||t).shadows[6]},[`&.${N1.disabled}`]:{color:(t.vars||t).palette.action.disabled,boxShadow:(t.vars||t).shadows[0],backgroundColor:(t.vars||t).palette.action.disabledBackground}}},{props:{variant:"outlined"},style:{padding:"5px 15px",border:"1px solid currentColor",borderColor:"var(--variant-outlinedBorder, currentColor)",backgroundColor:"var(--variant-outlinedBg)",color:"var(--variant-outlinedColor)",[`&.${N1.disabled}`]:{border:`1px solid ${(t.vars||t).palette.action.disabledBackground}`}}},{props:{variant:"text"},style:{padding:"6px 8px",color:"var(--variant-textColor)",backgroundColor:"var(--variant-textBg)"}},...Object.entries(t.palette).filter(ii()).map(([r])=>({props:{color:r},style:{"--variant-textColor":(t.vars||t).palette[r].main,"--variant-outlinedColor":(t.vars||t).palette[r].main,"--variant-outlinedBorder":t.vars?`rgba(${t.vars.palette[r].mainChannel} / 0.5)`:kt(t.palette[r].main,.5),"--variant-containedColor":(t.vars||t).palette[r].contrastText,"--variant-containedBg":(t.vars||t).palette[r].main,"@media (hover: hover)":{"&:hover":{"--variant-containedBg":(t.vars||t).palette[r].dark,"--variant-textBg":t.vars?`rgba(${t.vars.palette[r].mainChannel} / ${t.vars.palette.action.hoverOpacity})`:kt(t.palette[r].main,t.palette.action.hoverOpacity),"--variant-outlinedBorder":(t.vars||t).palette[r].main,"--variant-outlinedBg":t.vars?`rgba(${t.vars.palette[r].mainChannel} / ${t.vars.palette.action.hoverOpacity})`:kt(t.palette[r].main,t.palette.action.hoverOpacity)}}}})),{props:{color:"inherit"},style:{color:"inherit",borderColor:"currentColor","--variant-containedBg":t.vars?t.vars.palette.Button.inheritContainedBg:e,"@media (hover: hover)":{"&:hover":{"--variant-containedBg":t.vars?t.vars.palette.Button.inheritContainedHoverBg:n,"--variant-textBg":t.vars?`rgba(${t.vars.palette.text.primaryChannel} / ${t.vars.palette.action.hoverOpacity})`:kt(t.palette.text.primary,t.palette.action.hoverOpacity),"--variant-outlinedBg":t.vars?`rgba(${t.vars.palette.text.primaryChannel} / ${t.vars.palette.action.hoverOpacity})`:kt(t.palette.text.primary,t.palette.action.hoverOpacity)}}}},{props:{size:"small",variant:"text"},style:{padding:"4px 5px",fontSize:t.typography.pxToRem(13)}},{props:{size:"large",variant:"text"},style:{padding:"8px 11px",fontSize:t.typography.pxToRem(15)}},{props:{size:"small",variant:"outlined"},style:{padding:"3px 9px",fontSize:t.typography.pxToRem(13)}},{props:{size:"large",variant:"outlined"},style:{padding:"7px 21px",fontSize:t.typography.pxToRem(15)}},{props:{size:"small",variant:"contained"},style:{padding:"4px 10px",fontSize:t.typography.pxToRem(13)}},{props:{size:"large",variant:"contained"},style:{padding:"8px 22px",fontSize:t.typography.pxToRem(15)}},{props:{disableElevation:!0},style:{boxShadow:"none","&:hover":{boxShadow:"none"},[`&.${N1.focusVisible}`]:{boxShadow:"none"},"&:active":{boxShadow:"none"},[`&.${N1.disabled}`]:{boxShadow:"none"}}},{props:{fullWidth:!0},style:{width:"100%"}}]}})),Yot=be("span",{name:"MuiButton",slot:"StartIcon",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.startIcon,e[`iconSize${Re(n.size)}`]]}})({display:"inherit",marginRight:8,marginLeft:-4,variants:[{props:{size:"small"},style:{marginLeft:-2}},...aPe]}),Qot=be("span",{name:"MuiButton",slot:"EndIcon",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.endIcon,e[`iconSize${Re(n.size)}`]]}})({display:"inherit",marginRight:-4,marginLeft:8,variants:[{props:{size:"small"},style:{marginRight:-2}},...aPe]}),Vr=D.forwardRef(function(e,n){const r=D.useContext(Got),i=D.useContext(Hot),o=vS(r,e),s=wt({props:o,name:"MuiButton"}),{children:a,color:l="primary",component:c="button",className:u,disabled:f=!1,disableElevation:d=!1,disableFocusRipple:h=!1,endIcon:p,focusVisibleClassName:g,fullWidth:m=!1,size:v="medium",startIcon:y,type:x,variant:b="text",...w}=s,_={...s,color:l,component:c,disabled:f,disableElevation:d,disableFocusRipple:h,fullWidth:m,size:v,type:x,variant:b},S=qot(_),O=y&&C.jsx(Yot,{className:S.startIcon,ownerState:_,children:y}),k=p&&C.jsx(Qot,{className:S.endIcon,ownerState:_,children:p}),E=i||"";return C.jsxs(Xot,{ownerState:_,className:Oe(r.className,S.root,u,E),component:c,disabled:f,focusRipple:!h,focusVisibleClassName:Oe(S.focusVisible,g),ref:n,type:x,...w,classes:S,children:[O,a,k]})});function Kot(t){return Ye("MuiCard",t)}He("MuiCard",["root"]);const Zot=t=>{const{classes:e}=t;return qe({root:["root"]},Kot,e)},Jot=be(Tl,{name:"MuiCard",slot:"Root",overridesResolver:(t,e)=>e.root})({overflow:"hidden"}),lPe=D.forwardRef(function(e,n){const r=wt({props:e,name:"MuiCard"}),{className:i,raised:o=!1,...s}=r,a={...r,raised:o},l=Zot(a);return C.jsx(Jot,{className:Oe(l.root,i),elevation:o?8:void 0,ref:n,ownerState:a,...s})});function est(t){return Ye("MuiCardActions",t)}He("MuiCardActions",["root","spacing"]);const tst=t=>{const{classes:e,disableSpacing:n}=t;return qe({root:["root",!n&&"spacing"]},est,e)},nst=be("div",{name:"MuiCardActions",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,!n.disableSpacing&&e.spacing]}})({display:"flex",alignItems:"center",padding:8,variants:[{props:{disableSpacing:!1},style:{"& > :not(style) ~ :not(style)":{marginLeft:8}}}]}),cPe=D.forwardRef(function(e,n){const r=wt({props:e,name:"MuiCardActions"}),{disableSpacing:i=!1,className:o,...s}=r,a={...r,disableSpacing:i},l=tst(a);return C.jsx(nst,{className:Oe(l.root,o),ownerState:a,ref:n,...s})});function rst(t){return Ye("MuiCardContent",t)}He("MuiCardContent",["root"]);const ist=t=>{const{classes:e}=t;return qe({root:["root"]},rst,e)},ost=be("div",{name:"MuiCardContent",slot:"Root",overridesResolver:(t,e)=>e.root})({padding:16,"&:last-child":{paddingBottom:24}}),uPe=D.forwardRef(function(e,n){const r=wt({props:e,name:"MuiCardContent"}),{className:i,component:o="div",...s}=r,a={...r,component:o},l=ist(a);return C.jsx(ost,{as:o,className:Oe(l.root,i),ownerState:a,ref:n,...s})});function sst(t){return Ye("MuiCardHeader",t)}const IF=He("MuiCardHeader",["root","avatar","action","content","title","subheader"]),ast=t=>{const{classes:e}=t;return qe({root:["root"],avatar:["avatar"],action:["action"],content:["content"],title:["title"],subheader:["subheader"]},sst,e)},lst=be("div",{name:"MuiCardHeader",slot:"Root",overridesResolver:(t,e)=>({[`& .${IF.title}`]:e.title,[`& .${IF.subheader}`]:e.subheader,...e.root})})({display:"flex",alignItems:"center",padding:16}),cst=be("div",{name:"MuiCardHeader",slot:"Avatar",overridesResolver:(t,e)=>e.avatar})({display:"flex",flex:"0 0 auto",marginRight:16}),ust=be("div",{name:"MuiCardHeader",slot:"Action",overridesResolver:(t,e)=>e.action})({flex:"0 0 auto",alignSelf:"flex-start",marginTop:-4,marginRight:-8,marginBottom:-4}),fst=be("div",{name:"MuiCardHeader",slot:"Content",overridesResolver:(t,e)=>e.content})({flex:"1 1 auto",[`.${MF.root}:where(& .${IF.title})`]:{display:"block"},[`.${MF.root}:where(& .${IF.subheader})`]:{display:"block"}}),dst=D.forwardRef(function(e,n){const r=wt({props:e,name:"MuiCardHeader"}),{action:i,avatar:o,className:s,component:a="div",disableTypography:l=!1,subheader:c,subheaderTypographyProps:u,title:f,titleTypographyProps:d,...h}=r,p={...r,component:a,disableTypography:l},g=ast(p);let m=f;m!=null&&m.type!==Jt&&!l&&(m=C.jsx(Jt,{variant:o?"body2":"h5",className:g.title,component:"span",...d,children:m}));let v=c;return v!=null&&v.type!==Jt&&!l&&(v=C.jsx(Jt,{variant:o?"body2":"body1",className:g.subheader,color:"textSecondary",component:"span",...u,children:v})),C.jsxs(lst,{className:Oe(g.root,s),as:a,ref:n,ownerState:p,...h,children:[o&&C.jsx(cst,{className:g.avatar,ownerState:p,children:o}),C.jsxs(fst,{className:g.content,ownerState:p,children:[m,v]}),i&&C.jsx(ust,{className:g.action,ownerState:p,children:i})]})});function hst(t){return Ye("MuiCardMedia",t)}He("MuiCardMedia",["root","media","img"]);const pst=t=>{const{classes:e,isMediaComponent:n,isImageComponent:r}=t;return qe({root:["root",n&&"media",r&&"img"]},hst,e)},gst=be("div",{name:"MuiCardMedia",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t,{isMediaComponent:r,isImageComponent:i}=n;return[e.root,r&&e.media,i&&e.img]}})({display:"block",backgroundSize:"cover",backgroundRepeat:"no-repeat",backgroundPosition:"center",variants:[{props:{isMediaComponent:!0},style:{width:"100%"}},{props:{isImageComponent:!0},style:{objectFit:"cover"}}]}),mst=["video","audio","picture","iframe","img"],vst=["picture","img"],yst=D.forwardRef(function(e,n){const r=wt({props:e,name:"MuiCardMedia"}),{children:i,className:o,component:s="div",image:a,src:l,style:c,...u}=r,f=mst.includes(s),d=!f&&a?{backgroundImage:`url("${a}")`,...c}:c,h={...r,component:s,isMediaComponent:f,isImageComponent:vst.includes(s)},p=pst(h);return C.jsx(gst,{className:Oe(p.root,o),as:s,role:!f&&a?"img":void 0,ref:n,style:d,ownerState:h,src:f?a||l:void 0,...u,children:i})});function xst(t){return Ye("PrivateSwitchBase",t)}He("PrivateSwitchBase",["root","checked","disabled","input","edgeStart","edgeEnd"]);const bst=t=>{const{classes:e,checked:n,disabled:r,edge:i}=t,o={root:["root",n&&"checked",r&&"disabled",i&&`edge${Re(i)}`],input:["input"]};return qe(o,xst,e)},wst=be(Nf)({padding:9,borderRadius:"50%",variants:[{props:{edge:"start",size:"small"},style:{marginLeft:-3}},{props:({edge:t,ownerState:e})=>t==="start"&&e.size!=="small",style:{marginLeft:-12}},{props:{edge:"end",size:"small"},style:{marginRight:-3}},{props:({edge:t,ownerState:e})=>t==="end"&&e.size!=="small",style:{marginRight:-12}}]}),_st=be("input",{shouldForwardProp:qo})({cursor:"inherit",position:"absolute",opacity:0,width:"100%",height:"100%",top:0,left:0,margin:0,padding:0,zIndex:1}),Bee=D.forwardRef(function(e,n){const{autoFocus:r,checked:i,checkedIcon:o,className:s,defaultChecked:a,disabled:l,disableFocusRipple:c=!1,edge:u=!1,icon:f,id:d,inputProps:h,inputRef:p,name:g,onBlur:m,onChange:v,onFocus:y,readOnly:x,required:b=!1,tabIndex:w,type:_,value:S,...O}=e,[k,E]=bc({controlled:i,default:!!a,name:"SwitchBase",state:"checked"}),P=Fa(),A=z=>{y&&y(z),P&&P.onFocus&&P.onFocus(z)},R=z=>{m&&m(z),P&&P.onBlur&&P.onBlur(z)},T=z=>{if(z.nativeEvent.defaultPrevented)return;const L=z.target.checked;E(L),v&&v(z,L)};let M=l;P&&typeof M>"u"&&(M=P.disabled);const I=_==="checkbox"||_==="radio",j={...e,checked:k,disabled:M,disableFocusRipple:c,edge:u},N=bst(j);return C.jsxs(wst,{component:"span",className:Oe(N.root,s),centerRipple:!0,focusRipple:!c,disabled:M,tabIndex:null,role:void 0,onFocus:A,onBlur:R,ownerState:j,ref:n,...O,children:[C.jsx(_st,{autoFocus:r,checked:i,defaultChecked:a,className:N.input,disabled:M,id:I?d:void 0,name:g,onChange:T,readOnly:x,ref:p,required:b,ownerState:j,tabIndex:w,type:_,..._==="checkbox"&&S===void 0?{}:{value:S},...h}),k?o:f]})}),Sst=ct(C.jsx("path",{d:"M19 5v14H5V5h14m0-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2z"}),"CheckBoxOutlineBlank"),Cst=ct(C.jsx("path",{d:"M19 3H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.11 0 2-.9 2-2V5c0-1.1-.89-2-2-2zm-9 14l-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z"}),"CheckBox"),Ost=ct(C.jsx("path",{d:"M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm-2 10H7v-2h10v2z"}),"IndeterminateCheckBox");function Est(t){return Ye("MuiCheckbox",t)}const tW=He("MuiCheckbox",["root","checked","disabled","indeterminate","colorPrimary","colorSecondary","sizeSmall","sizeMedium"]),Tst=t=>{const{classes:e,indeterminate:n,color:r,size:i}=t,o={root:["root",n&&"indeterminate",`color${Re(r)}`,`size${Re(i)}`]},s=qe(o,Est,e);return{...e,...s}},kst=be(Bee,{shouldForwardProp:t=>qo(t)||t==="classes",name:"MuiCheckbox",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,n.indeterminate&&e.indeterminate,e[`size${Re(n.size)}`],n.color!=="default"&&e[`color${Re(n.color)}`]]}})(Tt(({theme:t})=>({color:(t.vars||t).palette.text.secondary,variants:[{props:{color:"default",disableRipple:!1},style:{"&:hover":{backgroundColor:t.vars?`rgba(${t.vars.palette.action.activeChannel} / ${t.vars.palette.action.hoverOpacity})`:kt(t.palette.action.active,t.palette.action.hoverOpacity)}}},...Object.entries(t.palette).filter(ii()).map(([e])=>({props:{color:e,disableRipple:!1},style:{"&:hover":{backgroundColor:t.vars?`rgba(${t.vars.palette[e].mainChannel} / ${t.vars.palette.action.hoverOpacity})`:kt(t.palette[e].main,t.palette.action.hoverOpacity)}}})),...Object.entries(t.palette).filter(ii()).map(([e])=>({props:{color:e},style:{[`&.${tW.checked}, &.${tW.indeterminate}`]:{color:(t.vars||t).palette[e].main},[`&.${tW.disabled}`]:{color:(t.vars||t).palette.action.disabled}}})),{props:{disableRipple:!1},style:{"&:hover":{"@media (hover: none)":{backgroundColor:"transparent"}}}}]}))),Ast=C.jsx(Cst,{}),Pst=C.jsx(Sst,{}),Mst=C.jsx(Ost,{}),LF=D.forwardRef(function(e,n){const r=wt({props:e,name:"MuiCheckbox"}),{checkedIcon:i=Ast,color:o="primary",icon:s=Pst,indeterminate:a=!1,indeterminateIcon:l=Mst,inputProps:c,size:u="medium",disableRipple:f=!1,className:d,...h}=r,p=a?l:s,g=a?l:i,m={...r,disableRipple:f,color:o,indeterminate:a,size:u},v=Tst(m);return C.jsx(kst,{type:"checkbox",inputProps:{"data-indeterminate":a,...c},icon:D.cloneElement(p,{fontSize:p.props.fontSize??u}),checkedIcon:D.cloneElement(g,{fontSize:g.props.fontSize??u}),ownerState:m,ref:n,className:Oe(v.root,d),disableRipple:f,...h,classes:v})});function Rst(t){return Ye("MuiCircularProgress",t)}He("MuiCircularProgress",["root","determinate","indeterminate","colorPrimary","colorSecondary","svg","circle","circleDeterminate","circleIndeterminate","circleDisableShrink"]);const lm=44,sq=CM` 0% { transform: rotate(0deg); } @@ -205,7 +205,7 @@ To suppress this warning, you need to explicitly provide the \`palette.${e}Chann 100% { transform: rotate(360deg); } -`,HH=CM` +`,aq=CM` 0% { stroke-dasharray: 1px, 200px; stroke-dashoffset: 0; @@ -220,28 +220,30 @@ To suppress this warning, you need to explicitly provide the \`palette.${e}Chann stroke-dasharray: 100px, 200px; stroke-dashoffset: -125px; } -`,sst=typeof GH!="string"?ZJ` - animation: ${GH} 1.4s linear infinite; - `:null,ast=typeof HH!="string"?ZJ` - animation: ${HH} 1.4s ease-in-out infinite; - `:null,lst=t=>{const{classes:e,variant:n,color:r,disableShrink:i}=t,o={root:["root",n,`color${De(r)}`],svg:["svg"],circle:["circle",`circle${De(n)}`,i&&"circleDisableShrink"]};return Xe(o,ost,e)},cst=be("span",{name:"MuiCircularProgress",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,e[n.variant],e[`color${De(n.color)}`]]}})(kt(({theme:t})=>({display:"inline-block",variants:[{props:{variant:"determinate"},style:{transition:t.transitions.create("transform")}},{props:{variant:"indeterminate"},style:sst||{animation:`${GH} 1.4s linear infinite`}},...Object.entries(t.palette).filter(di()).map(([e])=>({props:{color:e},style:{color:(t.vars||t).palette[e].main}}))]}))),ust=be("svg",{name:"MuiCircularProgress",slot:"Svg",overridesResolver:(t,e)=>e.svg})({display:"block"}),fst=be("circle",{name:"MuiCircularProgress",slot:"Circle",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.circle,e[`circle${De(n.variant)}`],n.disableShrink&&e.circleDisableShrink]}})(kt(({theme:t})=>({stroke:"currentColor",variants:[{props:{variant:"determinate"},style:{transition:t.transitions.create("stroke-dashoffset")}},{props:{variant:"indeterminate"},style:{strokeDasharray:"80px, 200px",strokeDashoffset:0}},{props:({ownerState:e})=>e.variant==="indeterminate"&&!e.disableShrink,style:ast||{animation:`${HH} 1.4s ease-in-out infinite`}}]}))),Y1=D.forwardRef(function(e,n){const r=wt({props:e,name:"MuiCircularProgress"}),{className:i,color:o="primary",disableShrink:s=!1,size:a=40,style:l,thickness:c=3.6,value:u=0,variant:f="indeterminate",...d}=r,h={...r,color:o,disableShrink:s,size:a,thickness:c,value:u,variant:f},p=lst(h),g={},m={},v={};if(f==="determinate"){const y=2*Math.PI*((cm-c)/2);g.strokeDasharray=y.toFixed(3),v["aria-valuenow"]=Math.round(u),g.strokeDashoffset=`${((100-u)/100*y).toFixed(3)}px`,m.transform="rotate(-90deg)"}return C.jsx(cst,{className:Oe(p.root,i),style:{width:a,height:a,...m,...l},ownerState:h,ref:n,role:"progressbar",...v,...d,children:C.jsx(ust,{className:p.svg,ownerState:h,viewBox:`${cm/2} ${cm/2} ${cm} ${cm}`,children:C.jsx(fst,{className:p.circle,style:g,ownerState:h,cx:cm,cy:cm,r:(cm-c)/2,fill:"none",strokeWidth:c})})})});function ade(t){return t.substring(2).toLowerCase()}function dst(t,e){return e.documentElement.clientWidth(setTimeout(()=>{l.current=!0},0),()=>{l.current=!1}),[]);const u=dn(My(e),a),f=st(p=>{const g=c.current;c.current=!1;const m=mi(a.current);if(!l.current||!a.current||"clientX"in p&&dst(p,m))return;if(s.current){s.current=!1;return}let v;p.composedPath?v=p.composedPath().includes(a.current):v=!m.documentElement.contains(p.target)||a.current.contains(p.target),!v&&(n||!g)&&i(p)}),d=p=>g=>{c.current=!0;const m=e.props[p];m&&m(g)},h={ref:u};return o!==!1&&(h[o]=d(o)),D.useEffect(()=>{if(o!==!1){const p=ade(o),g=mi(a.current),m=()=>{s.current=!0};return g.addEventListener(p,f),g.addEventListener("touchmove",m),()=>{g.removeEventListener(p,f),g.removeEventListener("touchmove",m)}}},[f,o]),r!==!1&&(h[r]=d(r)),D.useEffect(()=>{if(r!==!1){const p=ade(r),g=mi(a.current);return g.addEventListener(p,f),()=>{g.removeEventListener(p,f)}}},[f,r]),C.jsx(D.Fragment,{children:D.cloneElement(e,h)})}const qH=typeof uee({})=="function",pst=(t,e)=>({WebkitFontSmoothing:"antialiased",MozOsxFontSmoothing:"grayscale",boxSizing:"border-box",WebkitTextSizeAdjust:"100%",...e&&!t.vars&&{colorScheme:t.palette.mode}}),gst=t=>({color:(t.vars||t).palette.text.primary,...t.typography.body1,backgroundColor:(t.vars||t).palette.background.default,"@media print":{backgroundColor:(t.vars||t).palette.common.white}}),NAe=(t,e=!1)=>{var o,s;const n={};e&&t.colorSchemes&&typeof t.getColorSchemeSelector=="function"&&Object.entries(t.colorSchemes).forEach(([a,l])=>{var u,f;const c=t.getColorSchemeSelector(a);c.startsWith("@")?n[c]={":root":{colorScheme:(u=l.palette)==null?void 0:u.mode}}:n[c.replace(/\s*&/,"")]={colorScheme:(f=l.palette)==null?void 0:f.mode}});let r={html:pst(t,e),"*, *::before, *::after":{boxSizing:"inherit"},"strong, b":{fontWeight:t.typography.fontWeightBold},body:{margin:0,...gst(t),"&::backdrop":{backgroundColor:(t.vars||t).palette.background.default}},...n};const i=(s=(o=t.components)==null?void 0:o.MuiCssBaseline)==null?void 0:s.styleOverrides;return i&&(r=[r,i]),r},l3="mui-ecs",mst=t=>{const e=NAe(t,!1),n=Array.isArray(e)?e[0]:e;return!t.vars&&n&&(n.html[`:root:has(${l3})`]={colorScheme:t.palette.mode}),t.colorSchemes&&Object.entries(t.colorSchemes).forEach(([r,i])=>{var s,a;const o=t.getColorSchemeSelector(r);o.startsWith("@")?n[o]={[`:root:not(:has(.${l3}))`]:{colorScheme:(s=i.palette)==null?void 0:s.mode}}:n[o.replace(/\s*&/,"")]={[`&:not(:has(.${l3}))`]:{colorScheme:(a=i.palette)==null?void 0:a.mode}}}),e},vst=uee(qH?({theme:t,enableColorScheme:e})=>NAe(t,e):({theme:t})=>mst(t));function yst(t){const e=wt({props:t,name:"MuiCssBaseline"}),{children:n,enableColorScheme:r=!1}=e;return C.jsxs(D.Fragment,{children:[qH&&C.jsx(vst,{enableColorScheme:r}),!qH&&!r&&C.jsx("span",{className:l3,style:{display:"none"}}),n]})}function xst(t){const e=mi(t);return e.body===t?bc(t).innerWidth>e.documentElement.clientWidth:t.scrollHeight>t.clientHeight}function KT(t,e){e?t.setAttribute("aria-hidden","true"):t.removeAttribute("aria-hidden")}function lde(t){return parseInt(bc(t).getComputedStyle(t).paddingRight,10)||0}function bst(t){const n=["TEMPLATE","SCRIPT","STYLE","LINK","MAP","META","NOSCRIPT","PICTURE","COL","COLGROUP","PARAM","SLOT","SOURCE","TRACK"].includes(t.tagName),r=t.tagName==="INPUT"&&t.getAttribute("type")==="hidden";return n||r}function cde(t,e,n,r,i){const o=[e,n,...r];[].forEach.call(t.children,s=>{const a=!o.includes(s),l=!bst(s);a&&l&&KT(s,i)})}function nW(t,e){let n=-1;return t.some((r,i)=>e(r)?(n=i,!0):!1),n}function wst(t,e){const n=[],r=t.container;if(!e.disableScrollLock){if(xst(r)){const s=rAe(bc(r));n.push({value:r.style.paddingRight,property:"padding-right",el:r}),r.style.paddingRight=`${lde(r)+s}px`;const a=mi(r).querySelectorAll(".mui-fixed");[].forEach.call(a,l=>{n.push({value:l.style.paddingRight,property:"padding-right",el:l}),l.style.paddingRight=`${lde(l)+s}px`})}let o;if(r.parentNode instanceof DocumentFragment)o=mi(r).body;else{const s=r.parentElement,a=bc(r);o=(s==null?void 0:s.nodeName)==="HTML"&&a.getComputedStyle(s).overflowY==="scroll"?s:r}n.push({value:o.style.overflow,property:"overflow",el:o},{value:o.style.overflowX,property:"overflow-x",el:o},{value:o.style.overflowY,property:"overflow-y",el:o}),o.style.overflow="hidden"}return()=>{n.forEach(({value:o,el:s,property:a})=>{o?s.style.setProperty(a,o):s.style.removeProperty(a)})}}function _st(t){const e=[];return[].forEach.call(t.children,n=>{n.getAttribute("aria-hidden")==="true"&&e.push(n)}),e}class Sst{constructor(){this.modals=[],this.containers=[]}add(e,n){let r=this.modals.indexOf(e);if(r!==-1)return r;r=this.modals.length,this.modals.push(e),e.modalRef&&KT(e.modalRef,!1);const i=_st(n);cde(n,e.mount,e.modalRef,i,!0);const o=nW(this.containers,s=>s.container===n);return o!==-1?(this.containers[o].modals.push(e),r):(this.containers.push({modals:[e],container:n,restore:null,hiddenSiblings:i}),r)}mount(e,n){const r=nW(this.containers,o=>o.modals.includes(e)),i=this.containers[r];i.restore||(i.restore=wst(i,n))}remove(e,n=!0){const r=this.modals.indexOf(e);if(r===-1)return r;const i=nW(this.containers,s=>s.modals.includes(e)),o=this.containers[i];if(o.modals.splice(o.modals.indexOf(e),1),this.modals.splice(r,1),o.modals.length===0)o.restore&&o.restore(),e.modalRef&&KT(e.modalRef,n),cde(o.container,e.mount,e.modalRef,o.hiddenSiblings,!1),this.containers.splice(i,1);else{const s=o.modals[o.modals.length-1];s.modalRef&&KT(s.modalRef,!1)}return r}isTopModal(e){return this.modals.length>0&&this.modals[this.modals.length-1]===e}}const Cst=["input","select","textarea","a[href]","button","[tabindex]","audio[controls]","video[controls]",'[contenteditable]:not([contenteditable="false"])'].join(",");function Ost(t){const e=parseInt(t.getAttribute("tabindex")||"",10);return Number.isNaN(e)?t.contentEditable==="true"||(t.nodeName==="AUDIO"||t.nodeName==="VIDEO"||t.nodeName==="DETAILS")&&t.getAttribute("tabindex")===null?0:t.tabIndex:e}function Est(t){if(t.tagName!=="INPUT"||t.type!=="radio"||!t.name)return!1;const e=r=>t.ownerDocument.querySelector(`input[type="radio"]${r}`);let n=e(`[name="${t.name}"]:checked`);return n||(n=e(`[name="${t.name}"]`)),n!==t}function Tst(t){return!(t.disabled||t.tagName==="INPUT"&&t.type==="hidden"||Est(t))}function kst(t){const e=[],n=[];return Array.from(t.querySelectorAll(Cst)).forEach((r,i)=>{const o=Ost(r);o===-1||!Tst(r)||(o===0?e.push(r):n.push({documentOrder:i,tabIndex:o,node:r}))}),n.sort((r,i)=>r.tabIndex===i.tabIndex?r.documentOrder-i.documentOrder:r.tabIndex-i.tabIndex).map(r=>r.node).concat(e)}function Ast(){return!0}function zAe(t){const{children:e,disableAutoFocus:n=!1,disableEnforceFocus:r=!1,disableRestoreFocus:i=!1,getTabbable:o=kst,isEnabled:s=Ast,open:a}=t,l=D.useRef(!1),c=D.useRef(null),u=D.useRef(null),f=D.useRef(null),d=D.useRef(null),h=D.useRef(!1),p=D.useRef(null),g=dn(My(e),p),m=D.useRef(null);D.useEffect(()=>{!a||!p.current||(h.current=!n)},[n,a]),D.useEffect(()=>{if(!a||!p.current)return;const x=mi(p.current);return p.current.contains(x.activeElement)||(p.current.hasAttribute("tabIndex")||p.current.setAttribute("tabIndex","-1"),h.current&&p.current.focus()),()=>{i||(f.current&&f.current.focus&&(l.current=!0,f.current.focus()),f.current=null)}},[a]),D.useEffect(()=>{if(!a||!p.current)return;const x=mi(p.current),b=S=>{m.current=S,!(r||!s()||S.key!=="Tab")&&x.activeElement===p.current&&S.shiftKey&&(l.current=!0,u.current&&u.current.focus())},w=()=>{var k,E;const S=p.current;if(S===null)return;if(!x.hasFocus()||!s()||l.current){l.current=!1;return}if(S.contains(x.activeElement)||r&&x.activeElement!==c.current&&x.activeElement!==u.current)return;if(x.activeElement!==d.current)d.current=null;else if(d.current!==null)return;if(!h.current)return;let O=[];if((x.activeElement===c.current||x.activeElement===u.current)&&(O=o(p.current)),O.length>0){const M=!!((k=m.current)!=null&&k.shiftKey&&((E=m.current)==null?void 0:E.key)==="Tab"),A=O[0],P=O[O.length-1];typeof A!="string"&&typeof P!="string"&&(M?P.focus():A.focus())}else S.focus()};x.addEventListener("focusin",w),x.addEventListener("keydown",b,!0);const _=setInterval(()=>{x.activeElement&&x.activeElement.tagName==="BODY"&&w()},50);return()=>{clearInterval(_),x.removeEventListener("focusin",w),x.removeEventListener("keydown",b,!0)}},[n,r,i,s,a,o]);const v=x=>{f.current===null&&(f.current=x.relatedTarget),h.current=!0,d.current=x.target;const b=e.props.onFocus;b&&b(x)},y=x=>{f.current===null&&(f.current=x.relatedTarget),h.current=!0};return C.jsxs(D.Fragment,{children:[C.jsx("div",{tabIndex:a?0:-1,onFocus:y,ref:c,"data-testid":"sentinelStart"}),D.cloneElement(e,{ref:g,onFocus:v}),C.jsx("div",{tabIndex:a?0:-1,onFocus:y,ref:u,"data-testid":"sentinelEnd"})]})}function Pst(t){return typeof t=="function"?t():t}function Mst(t){return t?t.props.hasOwnProperty("in"):!1}const eI=new Sst;function Rst(t){const{container:e,disableEscapeKeyDown:n=!1,disableScrollLock:r=!1,closeAfterTransition:i=!1,onTransitionEnter:o,onTransitionExited:s,children:a,onClose:l,open:c,rootRef:u}=t,f=D.useRef({}),d=D.useRef(null),h=D.useRef(null),p=dn(h,u),[g,m]=D.useState(!c),v=Mst(a);let y=!0;(t["aria-hidden"]==="false"||t["aria-hidden"]===!1)&&(y=!1);const x=()=>mi(d.current),b=()=>(f.current.modalRef=h.current,f.current.mount=d.current,f.current),w=()=>{eI.mount(b(),{disableScrollLock:r}),h.current&&(h.current.scrollTop=0)},_=st(()=>{const R=Pst(e)||x().body;eI.add(b(),R),h.current&&w()}),S=()=>eI.isTopModal(b()),O=st(R=>{d.current=R,R&&(c&&S()?w():h.current&&KT(h.current,y))}),k=D.useCallback(()=>{eI.remove(b(),y)},[y]);D.useEffect(()=>()=>{k()},[k]),D.useEffect(()=>{c?_():(!v||!i)&&k()},[c,k,v,i,_]);const E=R=>I=>{var B;(B=R.onKeyDown)==null||B.call(R,I),!(I.key!=="Escape"||I.which===229||!S())&&(n||(I.stopPropagation(),l&&l(I,"escapeKeyDown")))},M=R=>I=>{var B;(B=R.onClick)==null||B.call(R,I),I.target===I.currentTarget&&l&&l(I,"backdropClick")};return{getRootProps:(R={})=>{const I=kx(t);delete I.onTransitionEnter,delete I.onTransitionExited;const B={...I,...R};return{role:"presentation",...B,onKeyDown:E(B),ref:p}},getBackdropProps:(R={})=>{const I=R;return{"aria-hidden":!0,...I,onClick:M(I),open:c}},getTransitionProps:()=>{const R=()=>{m(!1),o&&o()},I=()=>{m(!0),s&&s(),i&&k()};return{onEnter:$H(R,a==null?void 0:a.props.onEnter),onExited:$H(I,a==null?void 0:a.props.onExited)}},rootRef:p,portalRef:O,isTopModal:S,exited:g,hasTransition:v}}function Dst(t){return Ye("MuiModal",t)}qe("MuiModal",["root","hidden","backdrop"]);const Ist=t=>{const{open:e,exited:n,classes:r}=t;return Xe({root:["root",!e&&n&&"hidden"],backdrop:["backdrop"]},Dst,r)},Lst=be("div",{name:"MuiModal",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,!n.open&&n.exited&&e.hidden]}})(kt(({theme:t})=>({position:"fixed",zIndex:(t.vars||t).zIndex.modal,right:0,bottom:0,top:0,left:0,variants:[{props:({ownerState:e})=>!e.open&&e.exited,style:{visibility:"hidden"}}]}))),$st=be(DAe,{name:"MuiModal",slot:"Backdrop",overridesResolver:(t,e)=>e.backdrop})({zIndex:-1}),jAe=D.forwardRef(function(e,n){const r=wt({name:"MuiModal",props:e}),{BackdropComponent:i=$st,BackdropProps:o,classes:s,className:a,closeAfterTransition:l=!1,children:c,container:u,component:f,components:d={},componentsProps:h={},disableAutoFocus:p=!1,disableEnforceFocus:g=!1,disableEscapeKeyDown:m=!1,disablePortal:v=!1,disableRestoreFocus:y=!1,disableScrollLock:x=!1,hideBackdrop:b=!1,keepMounted:w=!1,onBackdropClick:_,onClose:S,onTransitionEnter:O,onTransitionExited:k,open:E,slotProps:M={},slots:A={},theme:P,...T}=r,R={...r,closeAfterTransition:l,disableAutoFocus:p,disableEnforceFocus:g,disableEscapeKeyDown:m,disablePortal:v,disableRestoreFocus:y,disableScrollLock:x,hideBackdrop:b,keepMounted:w},{getRootProps:I,getBackdropProps:B,getTransitionProps:$,portalRef:z,isTopModal:L,exited:j,hasTransition:N}=Rst({...R,rootRef:n}),F={...R,exited:j},H=Ist(F),q={};if(c.props.tabIndex===void 0&&(q.tabIndex="-1"),N){const{onEnter:te,onExited:ae}=$();q.onEnter=te,q.onExited=ae}const Y={...T,slots:{root:d.Root,backdrop:d.Backdrop,...A},slotProps:{...h,...M}},[le,K]=ec("root",{elementType:Lst,externalForwardedProps:Y,getSlotProps:I,additionalProps:{ref:n,as:f},ownerState:F,className:Oe(a,H==null?void 0:H.root,!F.open&&F.exited&&(H==null?void 0:H.hidden))}),[ee,re]=ec("backdrop",{elementType:i,externalForwardedProps:Y,additionalProps:o,getSlotProps:te=>B({...te,onClick:ae=>{_&&_(ae),te!=null&&te.onClick&&te.onClick(ae)}}),className:Oe(o==null?void 0:o.className,H==null?void 0:H.backdrop),ownerState:F}),me=dn(o==null?void 0:o.ref,re.ref);return!w&&!E&&(!N||j)?null:C.jsx(MAe,{ref:z,container:u,disablePortal:v,children:C.jsxs(le,{...K,children:[!b&&i?C.jsx(ee,{...re,ref:me}):null,C.jsx(zAe,{disableEnforceFocus:g,disableAutoFocus:p,disableRestoreFocus:y,isEnabled:L,open:E,children:D.cloneElement(c,q)})]})})});function Fst(t){return Ye("MuiDialog",t)}const ZT=qe("MuiDialog",["root","scrollPaper","scrollBody","container","paper","paperScrollPaper","paperScrollBody","paperWidthFalse","paperWidthXs","paperWidthSm","paperWidthMd","paperWidthLg","paperWidthXl","paperFullWidth","paperFullScreen"]),BAe=D.createContext({}),Nst=be(DAe,{name:"MuiDialog",slot:"Backdrop",overrides:(t,e)=>e.backdrop})({zIndex:-1}),zst=t=>{const{classes:e,scroll:n,maxWidth:r,fullWidth:i,fullScreen:o}=t,s={root:["root"],container:["container",`scroll${De(n)}`],paper:["paper",`paperScroll${De(n)}`,`paperWidth${De(String(r))}`,i&&"paperFullWidth",o&&"paperFullScreen"]};return Xe(s,Fst,e)},jst=be(jAe,{name:"MuiDialog",slot:"Root",overridesResolver:(t,e)=>e.root})({"@media print":{position:"absolute !important"}}),Bst=be("div",{name:"MuiDialog",slot:"Container",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.container,e[`scroll${De(n.scroll)}`]]}})({height:"100%","@media print":{height:"auto"},outline:0,variants:[{props:{scroll:"paper"},style:{display:"flex",justifyContent:"center",alignItems:"center"}},{props:{scroll:"body"},style:{overflowY:"auto",overflowX:"hidden",textAlign:"center","&::after":{content:'""',display:"inline-block",verticalAlign:"middle",height:"100%",width:"0"}}}]}),Ust=be(Al,{name:"MuiDialog",slot:"Paper",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.paper,e[`scrollPaper${De(n.scroll)}`],e[`paperWidth${De(String(n.maxWidth))}`],n.fullWidth&&e.paperFullWidth,n.fullScreen&&e.paperFullScreen]}})(kt(({theme:t})=>({margin:32,position:"relative",overflowY:"auto","@media print":{overflowY:"visible",boxShadow:"none"},variants:[{props:{scroll:"paper"},style:{display:"flex",flexDirection:"column",maxHeight:"calc(100% - 64px)"}},{props:{scroll:"body"},style:{display:"inline-block",verticalAlign:"middle",textAlign:"initial"}},{props:({ownerState:e})=>!e.maxWidth,style:{maxWidth:"calc(100% - 64px)"}},{props:{maxWidth:"xs"},style:{maxWidth:t.breakpoints.unit==="px"?Math.max(t.breakpoints.values.xs,444):`max(${t.breakpoints.values.xs}${t.breakpoints.unit}, 444px)`,[`&.${ZT.paperScrollBody}`]:{[t.breakpoints.down(Math.max(t.breakpoints.values.xs,444)+32*2)]:{maxWidth:"calc(100% - 64px)"}}}},...Object.keys(t.breakpoints.values).filter(e=>e!=="xs").map(e=>({props:{maxWidth:e},style:{maxWidth:`${t.breakpoints.values[e]}${t.breakpoints.unit}`,[`&.${ZT.paperScrollBody}`]:{[t.breakpoints.down(t.breakpoints.values[e]+32*2)]:{maxWidth:"calc(100% - 64px)"}}}})),{props:({ownerState:e})=>e.fullWidth,style:{width:"calc(100% - 64px)"}},{props:({ownerState:e})=>e.fullScreen,style:{margin:0,width:"100%",maxWidth:"100%",height:"100%",maxHeight:"none",borderRadius:0,[`&.${ZT.paperScrollBody}`]:{margin:0,maxWidth:"100%"}}}]}))),ed=D.forwardRef(function(e,n){const r=wt({props:e,name:"MuiDialog"}),i=Na(),o={enter:i.transitions.duration.enteringScreen,exit:i.transitions.duration.leavingScreen},{"aria-describedby":s,"aria-labelledby":a,"aria-modal":l=!0,BackdropComponent:c,BackdropProps:u,children:f,className:d,disableEscapeKeyDown:h=!1,fullScreen:p=!1,fullWidth:g=!1,maxWidth:m="sm",onBackdropClick:v,onClick:y,onClose:x,open:b,PaperComponent:w=Al,PaperProps:_={},scroll:S="paper",TransitionComponent:O=YC,transitionDuration:k=o,TransitionProps:E,...M}=r,A={...r,disableEscapeKeyDown:h,fullScreen:p,fullWidth:g,maxWidth:m,scroll:S},P=zst(A),T=D.useRef(),R=z=>{T.current=z.target===z.currentTarget},I=z=>{y&&y(z),T.current&&(T.current=null,v&&v(z),x&&x(z,"backdropClick"))},B=Jf(a),$=D.useMemo(()=>({titleId:B}),[B]);return C.jsx(jst,{className:Oe(P.root,d),closeAfterTransition:!0,components:{Backdrop:Nst},componentsProps:{backdrop:{transitionDuration:k,as:c,...u}},disableEscapeKeyDown:h,onClose:x,open:b,ref:n,onClick:I,ownerState:A,...M,children:C.jsx(O,{appear:!0,in:b,timeout:k,role:"presentation",...E,children:C.jsx(Bst,{className:Oe(P.container),onMouseDown:R,ownerState:A,children:C.jsx(Ust,{as:w,elevation:24,role:"dialog","aria-describedby":s,"aria-labelledby":B,"aria-modal":l,..._,className:Oe(P.paper,_.className),ownerState:A,children:C.jsx(BAe.Provider,{value:$,children:f})})})})})});function Wst(t){return Ye("MuiDialogActions",t)}qe("MuiDialogActions",["root","spacing"]);const Vst=t=>{const{classes:e,disableSpacing:n}=t;return Xe({root:["root",!n&&"spacing"]},Wst,e)},Gst=be("div",{name:"MuiDialogActions",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,!n.disableSpacing&&e.spacing]}})({display:"flex",alignItems:"center",padding:8,justifyContent:"flex-end",flex:"0 0 auto",variants:[{props:({ownerState:t})=>!t.disableSpacing,style:{"& > :not(style) ~ :not(style)":{marginLeft:8}}}]}),Q1=D.forwardRef(function(e,n){const r=wt({props:e,name:"MuiDialogActions"}),{className:i,disableSpacing:o=!1,...s}=r,a={...r,disableSpacing:o},l=Vst(a);return C.jsx(Gst,{className:Oe(l.root,i),ownerState:a,ref:n,...s})});function Hst(t){return Ye("MuiDialogContent",t)}qe("MuiDialogContent",["root","dividers"]);function qst(t){return Ye("MuiDialogTitle",t)}const Xst=qe("MuiDialogTitle",["root"]),Yst=t=>{const{classes:e,dividers:n}=t;return Xe({root:["root",n&&"dividers"]},Hst,e)},Qst=be("div",{name:"MuiDialogContent",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,n.dividers&&e.dividers]}})(kt(({theme:t})=>({flex:"1 1 auto",WebkitOverflowScrolling:"touch",overflowY:"auto",padding:"20px 24px",variants:[{props:({ownerState:e})=>e.dividers,style:{padding:"16px 24px",borderTop:`1px solid ${(t.vars||t).palette.divider}`,borderBottom:`1px solid ${(t.vars||t).palette.divider}`}},{props:({ownerState:e})=>!e.dividers,style:{[`.${Xst.root} + &`]:{paddingTop:0}}}]}))),zf=D.forwardRef(function(e,n){const r=wt({props:e,name:"MuiDialogContent"}),{className:i,dividers:o=!1,...s}=r,a={...r,dividers:o},l=Yst(a);return C.jsx(Qst,{className:Oe(l.root,i),ownerState:a,ref:n,...s})});function Kst(t){return Ye("MuiDialogContentText",t)}qe("MuiDialogContentText",["root"]);const Zst=t=>{const{classes:e}=t,r=Xe({root:["root"]},Kst,e);return{...e,...r}},Jst=be(Jt,{shouldForwardProp:t=>qo(t)||t==="classes",name:"MuiDialogContentText",slot:"Root",overridesResolver:(t,e)=>e.root})({}),eat=D.forwardRef(function(e,n){const r=wt({props:e,name:"MuiDialogContentText"}),{children:i,className:o,...s}=r,a=Zst(s);return C.jsx(Jst,{component:"p",variant:"body1",color:"textSecondary",ref:n,ownerState:s,className:Oe(a.root,o),...r,classes:a})}),tat=t=>{const{classes:e}=t;return Xe({root:["root"]},qst,e)},nat=be(Jt,{name:"MuiDialogTitle",slot:"Root",overridesResolver:(t,e)=>e.root})({padding:"16px 24px",flex:"0 0 auto"}),Iy=D.forwardRef(function(e,n){const r=wt({props:e,name:"MuiDialogTitle"}),{className:i,id:o,...s}=r,a=r,l=tat(a),{titleId:c=o}=D.useContext(BAe);return C.jsx(nat,{component:"h2",className:Oe(l.root,i),ownerState:a,ref:n,variant:"h6",id:o??c,...s})});function rat(t){return Ye("MuiDivider",t)}const ude=qe("MuiDivider",["root","absolute","fullWidth","inset","middle","flexItem","light","vertical","withChildren","withChildrenVertical","textAlignRight","textAlignLeft","wrapper","wrapperVertical"]),iat=t=>{const{absolute:e,children:n,classes:r,flexItem:i,light:o,orientation:s,textAlign:a,variant:l}=t;return Xe({root:["root",e&&"absolute",l,o&&"light",s==="vertical"&&"vertical",i&&"flexItem",n&&"withChildren",n&&s==="vertical"&&"withChildrenVertical",a==="right"&&s!=="vertical"&&"textAlignRight",a==="left"&&s!=="vertical"&&"textAlignLeft"],wrapper:["wrapper",s==="vertical"&&"wrapperVertical"]},rat,r)},oat=be("div",{name:"MuiDivider",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,n.absolute&&e.absolute,e[n.variant],n.light&&e.light,n.orientation==="vertical"&&e.vertical,n.flexItem&&e.flexItem,n.children&&e.withChildren,n.children&&n.orientation==="vertical"&&e.withChildrenVertical,n.textAlign==="right"&&n.orientation!=="vertical"&&e.textAlignRight,n.textAlign==="left"&&n.orientation!=="vertical"&&e.textAlignLeft]}})(kt(({theme:t})=>({margin:0,flexShrink:0,borderWidth:0,borderStyle:"solid",borderColor:(t.vars||t).palette.divider,borderBottomWidth:"thin",variants:[{props:{absolute:!0},style:{position:"absolute",bottom:0,left:0,width:"100%"}},{props:{light:!0},style:{borderColor:t.vars?`rgba(${t.vars.palette.dividerChannel} / 0.08)`:Tt(t.palette.divider,.08)}},{props:{variant:"inset"},style:{marginLeft:72}},{props:{variant:"middle",orientation:"horizontal"},style:{marginLeft:t.spacing(2),marginRight:t.spacing(2)}},{props:{variant:"middle",orientation:"vertical"},style:{marginTop:t.spacing(1),marginBottom:t.spacing(1)}},{props:{orientation:"vertical"},style:{height:"100%",borderBottomWidth:0,borderRightWidth:"thin"}},{props:{flexItem:!0},style:{alignSelf:"stretch",height:"auto"}},{props:({ownerState:e})=>!!e.children,style:{display:"flex",whiteSpace:"nowrap",textAlign:"center",border:0,borderTopStyle:"solid",borderLeftStyle:"solid","&::before, &::after":{content:'""',alignSelf:"center"}}},{props:({ownerState:e})=>e.children&&e.orientation!=="vertical",style:{"&::before, &::after":{width:"100%",borderTop:`thin solid ${(t.vars||t).palette.divider}`,borderTopStyle:"inherit"}}},{props:({ownerState:e})=>e.orientation==="vertical"&&e.children,style:{flexDirection:"column","&::before, &::after":{height:"100%",borderLeft:`thin solid ${(t.vars||t).palette.divider}`,borderLeftStyle:"inherit"}}},{props:({ownerState:e})=>e.textAlign==="right"&&e.orientation!=="vertical",style:{"&::before":{width:"90%"},"&::after":{width:"10%"}}},{props:({ownerState:e})=>e.textAlign==="left"&&e.orientation!=="vertical",style:{"&::before":{width:"10%"},"&::after":{width:"90%"}}}]}))),sat=be("span",{name:"MuiDivider",slot:"Wrapper",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.wrapper,n.orientation==="vertical"&&e.wrapperVertical]}})(kt(({theme:t})=>({display:"inline-block",paddingLeft:`calc(${t.spacing(1)} * 1.2)`,paddingRight:`calc(${t.spacing(1)} * 1.2)`,variants:[{props:{orientation:"vertical"},style:{paddingTop:`calc(${t.spacing(1)} * 1.2)`,paddingBottom:`calc(${t.spacing(1)} * 1.2)`}}]}))),Oh=D.forwardRef(function(e,n){const r=wt({props:e,name:"MuiDivider"}),{absolute:i=!1,children:o,className:s,orientation:a="horizontal",component:l=o||a==="vertical"?"div":"hr",flexItem:c=!1,light:u=!1,role:f=l!=="hr"?"separator":void 0,textAlign:d="center",variant:h="fullWidth",...p}=r,g={...r,absolute:i,component:l,flexItem:c,light:u,orientation:a,role:f,textAlign:d,variant:h},m=iat(g);return C.jsx(oat,{as:l,className:Oe(m.root,s),role:f,ref:n,ownerState:g,"aria-orientation":f==="separator"&&(l!=="hr"||a==="vertical")?a:void 0,...p,children:o?C.jsx(sat,{className:m.wrapper,ownerState:g,children:o}):null})});Oh&&(Oh.muiSkipListHighlight=!0);function aat(t,e,n){const r=e.getBoundingClientRect(),i=n&&n.getBoundingClientRect(),o=bc(e);let s;if(e.fakeTransform)s=e.fakeTransform;else{const c=o.getComputedStyle(e);s=c.getPropertyValue("-webkit-transform")||c.getPropertyValue("transform")}let a=0,l=0;if(s&&s!=="none"&&typeof s=="string"){const c=s.split("(")[1].split(")")[0].split(",");a=parseInt(c[4],10),l=parseInt(c[5],10)}return t==="left"?i?`translateX(${i.right+a-r.left}px)`:`translateX(${o.innerWidth+a-r.left}px)`:t==="right"?i?`translateX(-${r.right-i.left-a}px)`:`translateX(-${r.left+r.width-a}px)`:t==="up"?i?`translateY(${i.bottom+l-r.top}px)`:`translateY(${o.innerHeight+l-r.top}px)`:i?`translateY(-${r.top-i.top+r.height-l}px)`:`translateY(-${r.top+r.height-l}px)`}function lat(t){return typeof t=="function"?t():t}function tI(t,e,n){const r=lat(n),i=aat(t,e,r);i&&(e.style.webkitTransform=i,e.style.transform=i)}const cat=D.forwardRef(function(e,n){const r=Na(),i={enter:r.transitions.easing.easeOut,exit:r.transitions.easing.sharp},o={enter:r.transitions.duration.enteringScreen,exit:r.transitions.duration.leavingScreen},{addEndListener:s,appear:a=!0,children:l,container:c,direction:u="down",easing:f=i,in:d,onEnter:h,onEntered:p,onEntering:g,onExit:m,onExited:v,onExiting:y,style:x,timeout:b=o,TransitionComponent:w=Dc,..._}=e,S=D.useRef(null),O=dn(My(l),S,n),k=$=>z=>{$&&(z===void 0?$(S.current):$(S.current,z))},E=k(($,z)=>{tI(u,$,c),gee($),h&&h($,z)}),M=k(($,z)=>{const L=Jv({timeout:b,style:x,easing:f},{mode:"enter"});$.style.webkitTransition=r.transitions.create("-webkit-transform",{...L}),$.style.transition=r.transitions.create("transform",{...L}),$.style.webkitTransform="none",$.style.transform="none",g&&g($,z)}),A=k(p),P=k(y),T=k($=>{const z=Jv({timeout:b,style:x,easing:f},{mode:"exit"});$.style.webkitTransition=r.transitions.create("-webkit-transform",z),$.style.transition=r.transitions.create("transform",z),tI(u,$,c),m&&m($)}),R=k($=>{$.style.webkitTransition="",$.style.transition="",v&&v($)}),I=$=>{s&&s(S.current,$)},B=D.useCallback(()=>{S.current&&tI(u,S.current,c)},[u,c]);return D.useEffect(()=>{if(d||u==="down"||u==="right")return;const $=kM(()=>{S.current&&tI(u,S.current,c)}),z=bc(S.current);return z.addEventListener("resize",$),()=>{$.clear(),z.removeEventListener("resize",$)}},[u,d,c]),D.useEffect(()=>{d||B()},[d,B]),C.jsx(w,{nodeRef:S,onEnter:E,onEntered:A,onEntering:M,onExit:T,onExited:R,onExiting:P,addEndListener:I,appear:a,in:d,timeout:b,..._,children:($,z)=>D.cloneElement(l,{ref:O,style:{visibility:$==="exited"&&!d?"hidden":void 0,...x,...l.props.style},...z})})}),uat=t=>{const{classes:e,disableUnderline:n,startAdornment:r,endAdornment:i,size:o,hiddenLabel:s,multiline:a}=t,l={root:["root",!n&&"underline",r&&"adornedStart",i&&"adornedEnd",o==="small"&&`size${De(o)}`,s&&"hiddenLabel",a&&"multiline"],input:["input"]},c=Xe(l,tot,e);return{...e,...c}},fat=be(b4,{shouldForwardProp:t=>qo(t)||t==="classes",name:"MuiFilledInput",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[...y4(t,e),!n.disableUnderline&&e.underline]}})(kt(({theme:t})=>{const e=t.palette.mode==="light",n=e?"rgba(0, 0, 0, 0.42)":"rgba(255, 255, 255, 0.7)",r=e?"rgba(0, 0, 0, 0.06)":"rgba(255, 255, 255, 0.09)",i=e?"rgba(0, 0, 0, 0.09)":"rgba(255, 255, 255, 0.13)",o=e?"rgba(0, 0, 0, 0.12)":"rgba(255, 255, 255, 0.12)";return{position:"relative",backgroundColor:t.vars?t.vars.palette.FilledInput.bg:r,borderTopLeftRadius:(t.vars||t).shape.borderRadius,borderTopRightRadius:(t.vars||t).shape.borderRadius,transition:t.transitions.create("background-color",{duration:t.transitions.duration.shorter,easing:t.transitions.easing.easeOut}),"&:hover":{backgroundColor:t.vars?t.vars.palette.FilledInput.hoverBg:i,"@media (hover: none)":{backgroundColor:t.vars?t.vars.palette.FilledInput.bg:r}},[`&.${f0.focused}`]:{backgroundColor:t.vars?t.vars.palette.FilledInput.bg:r},[`&.${f0.disabled}`]:{backgroundColor:t.vars?t.vars.palette.FilledInput.disabledBg:o},variants:[{props:({ownerState:s})=>!s.disableUnderline,style:{"&::after":{left:0,bottom:0,content:'""',position:"absolute",right:0,transform:"scaleX(0)",transition:t.transitions.create("transform",{duration:t.transitions.duration.shorter,easing:t.transitions.easing.easeOut}),pointerEvents:"none"},[`&.${f0.focused}:after`]:{transform:"scaleX(1) translateX(0)"},[`&.${f0.error}`]:{"&::before, &::after":{borderBottomColor:(t.vars||t).palette.error.main}},"&::before":{borderBottom:`1px solid ${t.vars?`rgba(${t.vars.palette.common.onBackgroundChannel} / ${t.vars.opacity.inputUnderline})`:n}`,left:0,bottom:0,content:'"\\00a0"',position:"absolute",right:0,transition:t.transitions.create("border-bottom-color",{duration:t.transitions.duration.shorter}),pointerEvents:"none"},[`&:hover:not(.${f0.disabled}, .${f0.error}):before`]:{borderBottom:`1px solid ${(t.vars||t).palette.text.primary}`},[`&.${f0.disabled}:before`]:{borderBottomStyle:"dotted"}}},...Object.entries(t.palette).filter(di()).map(([s])=>{var a;return{props:{disableUnderline:!1,color:s},style:{"&::after":{borderBottom:`2px solid ${(a=(t.vars||t).palette[s])==null?void 0:a.main}`}}}}),{props:({ownerState:s})=>s.startAdornment,style:{paddingLeft:12}},{props:({ownerState:s})=>s.endAdornment,style:{paddingRight:12}},{props:({ownerState:s})=>s.multiline,style:{padding:"25px 12px 8px"}},{props:({ownerState:s,size:a})=>s.multiline&&a==="small",style:{paddingTop:21,paddingBottom:4}},{props:({ownerState:s})=>s.multiline&&s.hiddenLabel,style:{paddingTop:16,paddingBottom:17}},{props:({ownerState:s})=>s.multiline&&s.hiddenLabel&&s.size==="small",style:{paddingTop:8,paddingBottom:9}}]}})),dat=be(w4,{name:"MuiFilledInput",slot:"Input",overridesResolver:x4})(kt(({theme:t})=>({paddingTop:25,paddingRight:12,paddingBottom:8,paddingLeft:12,...!t.vars&&{"&:-webkit-autofill":{WebkitBoxShadow:t.palette.mode==="light"?null:"0 0 0 100px #266798 inset",WebkitTextFillColor:t.palette.mode==="light"?null:"#fff",caretColor:t.palette.mode==="light"?null:"#fff",borderTopLeftRadius:"inherit",borderTopRightRadius:"inherit"}},...t.vars&&{"&:-webkit-autofill":{borderTopLeftRadius:"inherit",borderTopRightRadius:"inherit"},[t.getColorSchemeSelector("dark")]:{"&:-webkit-autofill":{WebkitBoxShadow:"0 0 0 100px #266798 inset",WebkitTextFillColor:"#fff",caretColor:"#fff"}}},variants:[{props:{size:"small"},style:{paddingTop:21,paddingBottom:4}},{props:({ownerState:e})=>e.hiddenLabel,style:{paddingTop:16,paddingBottom:17}},{props:({ownerState:e})=>e.startAdornment,style:{paddingLeft:0}},{props:({ownerState:e})=>e.endAdornment,style:{paddingRight:0}},{props:({ownerState:e})=>e.hiddenLabel&&e.size==="small",style:{paddingTop:8,paddingBottom:9}},{props:({ownerState:e})=>e.multiline,style:{paddingTop:0,paddingBottom:0,paddingLeft:0,paddingRight:0}}]}))),jF=D.forwardRef(function(e,n){const r=wt({props:e,name:"MuiFilledInput"}),{disableUnderline:i=!1,components:o={},componentsProps:s,fullWidth:a=!1,hiddenLabel:l,inputComponent:c="input",multiline:u=!1,slotProps:f,slots:d={},type:h="text",...p}=r,g={...r,disableUnderline:i,fullWidth:a,inputComponent:c,multiline:u,type:h},m=uat(r),v={root:{ownerState:g},input:{ownerState:g}},y=f??s?Bo(v,f??s):v,x=d.root??o.Root??fat,b=d.input??o.Input??dat;return C.jsx(Cee,{slots:{root:x,input:b},componentsProps:y,fullWidth:a,inputComponent:c,multiline:u,ref:n,type:h,...p,classes:m})});jF&&(jF.muiName="Input");function hat(t){return Ye("MuiFormControl",t)}qe("MuiFormControl",["root","marginNone","marginNormal","marginDense","fullWidth","disabled"]);const pat=t=>{const{classes:e,margin:n,fullWidth:r}=t,i={root:["root",n!=="none"&&`margin${De(n)}`,r&&"fullWidth"]};return Xe(i,hat,e)},gat=be("div",{name:"MuiFormControl",slot:"Root",overridesResolver:({ownerState:t},e)=>({...e.root,...e[`margin${De(t.margin)}`],...t.fullWidth&&e.fullWidth})})({display:"inline-flex",flexDirection:"column",position:"relative",minWidth:0,padding:0,margin:0,border:0,verticalAlign:"top",variants:[{props:{margin:"normal"},style:{marginTop:16,marginBottom:8}},{props:{margin:"dense"},style:{marginTop:8,marginBottom:4}},{props:{fullWidth:!0},style:{width:"100%"}}]}),Gg=D.forwardRef(function(e,n){const r=wt({props:e,name:"MuiFormControl"}),{children:i,className:o,color:s="primary",component:a="div",disabled:l=!1,error:c=!1,focused:u,fullWidth:f=!1,hiddenLabel:d=!1,margin:h="none",required:p=!1,size:g="medium",variant:m="outlined",...v}=r,y={...r,color:s,component:a,disabled:l,error:c,fullWidth:f,hiddenLabel:d,margin:h,required:p,size:g,variant:m},x=pat(y),[b,w]=D.useState(()=>{let P=!1;return i&&D.Children.forEach(i,T=>{if(!s3(T,["Input","Select"]))return;const R=s3(T,["Select"])?T.props.input:T;R&&Qit(R.props)&&(P=!0)}),P}),[_,S]=D.useState(()=>{let P=!1;return i&&D.Children.forEach(i,T=>{s3(T,["Input","Select"])&&(FF(T.props,!0)||FF(T.props.inputProps,!0))&&(P=!0)}),P}),[O,k]=D.useState(!1);l&&O&&k(!1);const E=u!==void 0&&!l?u:O;let M;D.useRef(!1);const A=D.useMemo(()=>({adornedStart:b,setAdornedStart:w,color:s,disabled:l,error:c,filled:_,focused:E,fullWidth:f,hiddenLabel:d,size:g,onBlur:()=>{k(!1)},onEmpty:()=>{S(!1)},onFilled:()=>{S(!0)},onFocus:()=>{k(!0)},registerEffect:M,required:p,variant:m}),[b,s,l,c,_,E,f,d,M,p,g,m]);return C.jsx(v4.Provider,{value:A,children:C.jsx(gat,{as:a,ownerState:y,className:Oe(x.root,o),ref:n,...v,children:i})})});function mat(t){return Ye("MuiFormControlLabel",t)}const Q2=qe("MuiFormControlLabel",["root","labelPlacementStart","labelPlacementTop","labelPlacementBottom","disabled","label","error","required","asterisk"]),vat=t=>{const{classes:e,disabled:n,labelPlacement:r,error:i,required:o}=t,s={root:["root",n&&"disabled",`labelPlacement${De(r)}`,i&&"error",o&&"required"],label:["label",n&&"disabled"],asterisk:["asterisk",i&&"error"]};return Xe(s,mat,e)},yat=be("label",{name:"MuiFormControlLabel",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[{[`& .${Q2.label}`]:e.label},e.root,e[`labelPlacement${De(n.labelPlacement)}`]]}})(kt(({theme:t})=>({display:"inline-flex",alignItems:"center",cursor:"pointer",verticalAlign:"middle",WebkitTapHighlightColor:"transparent",marginLeft:-11,marginRight:16,[`&.${Q2.disabled}`]:{cursor:"default"},[`& .${Q2.label}`]:{[`&.${Q2.disabled}`]:{color:(t.vars||t).palette.text.disabled}},variants:[{props:{labelPlacement:"start"},style:{flexDirection:"row-reverse",marginRight:-11}},{props:{labelPlacement:"top"},style:{flexDirection:"column-reverse"}},{props:{labelPlacement:"bottom"},style:{flexDirection:"column"}},{props:({labelPlacement:e})=>e==="start"||e==="top"||e==="bottom",style:{marginLeft:16}}]}))),xat=be("span",{name:"MuiFormControlLabel",slot:"Asterisk",overridesResolver:(t,e)=>e.asterisk})(kt(({theme:t})=>({[`&.${Q2.error}`]:{color:(t.vars||t).palette.error.main}}))),Px=D.forwardRef(function(e,n){const r=wt({props:e,name:"MuiFormControlLabel"}),{checked:i,className:o,componentsProps:s={},control:a,disabled:l,disableTypography:c,inputRef:u,label:f,labelPlacement:d="end",name:h,onChange:p,required:g,slots:m={},slotProps:v={},value:y,...x}=r,b=za(),w=l??a.props.disabled??(b==null?void 0:b.disabled),_=g??a.props.required,S={disabled:w,required:_};["checked","name","onChange","value","inputRef"].forEach(R=>{typeof a.props[R]>"u"&&typeof r[R]<"u"&&(S[R]=r[R])});const O=Dy({props:r,muiFormControl:b,states:["error"]}),k={...r,disabled:w,labelPlacement:d,required:_,error:O.error},E=vat(k),M={slots:m,slotProps:{...s,...v}},[A,P]=ec("typography",{elementType:Jt,externalForwardedProps:M,ownerState:k});let T=f;return T!=null&&T.type!==Jt&&!c&&(T=C.jsx(A,{component:"span",...P,className:Oe(E.label,P==null?void 0:P.className),children:T})),C.jsxs(yat,{className:Oe(E.root,o),ownerState:k,ref:n,...x,children:[D.cloneElement(a,S),_?C.jsxs("div",{children:[T,C.jsxs(xat,{ownerState:k,"aria-hidden":!0,className:E.asterisk,children:[" ","*"]})]}):T]})});function bat(t){return Ye("MuiFormGroup",t)}qe("MuiFormGroup",["root","row","error"]);const wat=t=>{const{classes:e,row:n,error:r}=t;return Xe({root:["root",n&&"row",r&&"error"]},bat,e)},_at=be("div",{name:"MuiFormGroup",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,n.row&&e.row]}})({display:"flex",flexDirection:"column",flexWrap:"wrap",variants:[{props:{row:!0},style:{flexDirection:"row"}}]}),Sat=D.forwardRef(function(e,n){const r=wt({props:e,name:"MuiFormGroup"}),{className:i,row:o=!1,...s}=r,a=za(),l=Dy({props:r,muiFormControl:a,states:["error"]}),c={...r,row:o,error:l.error},u=wat(c);return C.jsx(_at,{className:Oe(u.root,i),ownerState:c,ref:n,...s})});function Cat(t){return Ye("MuiFormHelperText",t)}const fde=qe("MuiFormHelperText",["root","error","disabled","sizeSmall","sizeMedium","contained","focused","filled","required"]);var dde;const Oat=t=>{const{classes:e,contained:n,size:r,disabled:i,error:o,filled:s,focused:a,required:l}=t,c={root:["root",i&&"disabled",o&&"error",r&&`size${De(r)}`,n&&"contained",a&&"focused",s&&"filled",l&&"required"]};return Xe(c,Cat,e)},Eat=be("p",{name:"MuiFormHelperText",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,n.size&&e[`size${De(n.size)}`],n.contained&&e.contained,n.filled&&e.filled]}})(kt(({theme:t})=>({color:(t.vars||t).palette.text.secondary,...t.typography.caption,textAlign:"left",marginTop:3,marginRight:0,marginBottom:0,marginLeft:0,[`&.${fde.disabled}`]:{color:(t.vars||t).palette.text.disabled},[`&.${fde.error}`]:{color:(t.vars||t).palette.error.main},variants:[{props:{size:"small"},style:{marginTop:4}},{props:({ownerState:e})=>e.contained,style:{marginLeft:14,marginRight:14}}]}))),Eee=D.forwardRef(function(e,n){const r=wt({props:e,name:"MuiFormHelperText"}),{children:i,className:o,component:s="p",disabled:a,error:l,filled:c,focused:u,margin:f,required:d,variant:h,...p}=r,g=za(),m=Dy({props:r,muiFormControl:g,states:["variant","size","disabled","error","filled","focused","required"]}),v={...r,component:s,contained:m.variant==="filled"||m.variant==="outlined",variant:m.variant,size:m.size,disabled:m.disabled,error:m.error,filled:m.filled,focused:m.focused,required:m.required};delete v.ownerState;const y=Oat(v);return C.jsx(Eat,{as:s,className:Oe(y.root,o),ref:n,...p,ownerState:v,children:i===" "?dde||(dde=C.jsx("span",{className:"notranslate",children:"​"})):i})});function Tat(t){return Ye("MuiFormLabel",t)}const JT=qe("MuiFormLabel",["root","colorSecondary","focused","disabled","error","filled","required","asterisk"]),kat=t=>{const{classes:e,color:n,focused:r,disabled:i,error:o,filled:s,required:a}=t,l={root:["root",`color${De(n)}`,i&&"disabled",o&&"error",s&&"filled",r&&"focused",a&&"required"],asterisk:["asterisk",o&&"error"]};return Xe(l,Tat,e)},Aat=be("label",{name:"MuiFormLabel",slot:"Root",overridesResolver:({ownerState:t},e)=>({...e.root,...t.color==="secondary"&&e.colorSecondary,...t.filled&&e.filled})})(kt(({theme:t})=>({color:(t.vars||t).palette.text.secondary,...t.typography.body1,lineHeight:"1.4375em",padding:0,position:"relative",variants:[...Object.entries(t.palette).filter(di()).map(([e])=>({props:{color:e},style:{[`&.${JT.focused}`]:{color:(t.vars||t).palette[e].main}}})),{props:{},style:{[`&.${JT.disabled}`]:{color:(t.vars||t).palette.text.disabled},[`&.${JT.error}`]:{color:(t.vars||t).palette.error.main}}}]}))),Pat=be("span",{name:"MuiFormLabel",slot:"Asterisk",overridesResolver:(t,e)=>e.asterisk})(kt(({theme:t})=>({[`&.${JT.error}`]:{color:(t.vars||t).palette.error.main}}))),Mat=D.forwardRef(function(e,n){const r=wt({props:e,name:"MuiFormLabel"}),{children:i,className:o,color:s,component:a="label",disabled:l,error:c,filled:u,focused:f,required:d,...h}=r,p=za(),g=Dy({props:r,muiFormControl:p,states:["color","required","focused","disabled","error","filled"]}),m={...r,color:g.color||"primary",component:a,disabled:g.disabled,error:g.error,filled:g.filled,focused:g.focused,required:g.required},v=kat(m);return C.jsxs(Aat,{as:a,ownerState:m,className:Oe(v.root,o),ref:n,...h,children:[i,g.required&&C.jsxs(Pat,{ownerState:m,"aria-hidden":!0,className:v.asterisk,children:[" ","*"]})]})}),hde=D.createContext();function Rat(t){return Ye("MuiGrid",t)}const Dat=[0,1,2,3,4,5,6,7,8,9,10],Iat=["column-reverse","column","row-reverse","row"],Lat=["nowrap","wrap-reverse","wrap"],PE=["auto",!0,1,2,3,4,5,6,7,8,9,10,11,12],sA=qe("MuiGrid",["root","container","item","zeroMinWidth",...Dat.map(t=>`spacing-xs-${t}`),...Iat.map(t=>`direction-xs-${t}`),...Lat.map(t=>`wrap-xs-${t}`),...PE.map(t=>`grid-xs-${t}`),...PE.map(t=>`grid-sm-${t}`),...PE.map(t=>`grid-md-${t}`),...PE.map(t=>`grid-lg-${t}`),...PE.map(t=>`grid-xl-${t}`)]);function $at({theme:t,ownerState:e}){let n;return t.breakpoints.keys.reduce((r,i)=>{let o={};if(e[i]&&(n=e[i]),!n)return r;if(n===!0)o={flexBasis:0,flexGrow:1,maxWidth:"100%"};else if(n==="auto")o={flexBasis:"auto",flexGrow:0,flexShrink:0,maxWidth:"none",width:"auto"};else{const s=Xj({values:e.columns,breakpoints:t.breakpoints.values}),a=typeof s=="object"?s[i]:s;if(a==null)return r;const l=`${Math.round(n/a*1e8)/1e6}%`;let c={};if(e.container&&e.item&&e.columnSpacing!==0){const u=t.spacing(e.columnSpacing);if(u!=="0px"){const f=`calc(${l} + ${u})`;c={flexBasis:f,maxWidth:f}}}o={flexBasis:l,flexGrow:0,maxWidth:l,...c}}return t.breakpoints.values[i]===0?Object.assign(r,o):r[t.breakpoints.up(i)]=o,r},{})}function Fat({theme:t,ownerState:e}){const n=Xj({values:e.direction,breakpoints:t.breakpoints.values});return _u({theme:t},n,r=>{const i={flexDirection:r};return r.startsWith("column")&&(i[`& > .${sA.item}`]={maxWidth:"none"}),i})}function UAe({breakpoints:t,values:e}){let n="";Object.keys(e).forEach(i=>{n===""&&e[i]!==0&&(n=i)});const r=Object.keys(t).sort((i,o)=>t[i]-t[o]);return r.slice(0,r.indexOf(n))}function Nat({theme:t,ownerState:e}){const{container:n,rowSpacing:r}=e;let i={};if(n&&r!==0){const o=Xj({values:r,breakpoints:t.breakpoints.values});let s;typeof o=="object"&&(s=UAe({breakpoints:t.breakpoints.values,values:o})),i=_u({theme:t},o,(a,l)=>{const c=t.spacing(a);return c!=="0px"?{marginTop:t.spacing(-a),[`& > .${sA.item}`]:{paddingTop:c}}:s!=null&&s.includes(l)?{}:{marginTop:0,[`& > .${sA.item}`]:{paddingTop:0}}})}return i}function zat({theme:t,ownerState:e}){const{container:n,columnSpacing:r}=e;let i={};if(n&&r!==0){const o=Xj({values:r,breakpoints:t.breakpoints.values});let s;typeof o=="object"&&(s=UAe({breakpoints:t.breakpoints.values,values:o})),i=_u({theme:t},o,(a,l)=>{const c=t.spacing(a);if(c!=="0px"){const u=t.spacing(-a);return{width:`calc(100% + ${c})`,marginLeft:u,[`& > .${sA.item}`]:{paddingLeft:c}}}return s!=null&&s.includes(l)?{}:{width:"100%",marginLeft:0,[`& > .${sA.item}`]:{paddingLeft:0}}})}return i}function jat(t,e,n={}){if(!t||t<=0)return[];if(typeof t=="string"&&!Number.isNaN(Number(t))||typeof t=="number")return[n[`spacing-xs-${String(t)}`]];const r=[];return e.forEach(i=>{const o=t[i];Number(o)>0&&r.push(n[`spacing-${i}-${String(o)}`])}),r}const Bat=be("div",{name:"MuiGrid",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t,{container:r,direction:i,item:o,spacing:s,wrap:a,zeroMinWidth:l,breakpoints:c}=n;let u=[];r&&(u=jat(s,c,e));const f=[];return c.forEach(d=>{const h=n[d];h&&f.push(e[`grid-${d}-${String(h)}`])}),[e.root,r&&e.container,o&&e.item,l&&e.zeroMinWidth,...u,i!=="row"&&e[`direction-xs-${String(i)}`],a!=="wrap"&&e[`wrap-xs-${String(a)}`],...f]}})(({ownerState:t})=>({boxSizing:"border-box",...t.container&&{display:"flex",flexWrap:"wrap",width:"100%"},...t.item&&{margin:0},...t.zeroMinWidth&&{minWidth:0},...t.wrap!=="wrap"&&{flexWrap:t.wrap}}),Fat,Nat,zat,$at);function Uat(t,e){if(!t||t<=0)return[];if(typeof t=="string"&&!Number.isNaN(Number(t))||typeof t=="number")return[`spacing-xs-${String(t)}`];const n=[];return e.forEach(r=>{const i=t[r];if(Number(i)>0){const o=`spacing-${r}-${String(i)}`;n.push(o)}}),n}const Wat=t=>{const{classes:e,container:n,direction:r,item:i,spacing:o,wrap:s,zeroMinWidth:a,breakpoints:l}=t;let c=[];n&&(c=Uat(o,l));const u=[];l.forEach(d=>{const h=t[d];h&&u.push(`grid-${d}-${String(h)}`)});const f={root:["root",n&&"container",i&&"item",a&&"zeroMinWidth",...c,r!=="row"&&`direction-xs-${String(r)}`,s!=="wrap"&&`wrap-xs-${String(s)}`,...u]};return Xe(f,Rat,e)},rW=D.forwardRef(function(e,n){const r=An({props:e,name:"MuiGrid"}),{breakpoints:i}=Na(),o=oee(r),{className:s,columns:a,columnSpacing:l,component:c="div",container:u=!1,direction:f="row",item:d=!1,rowSpacing:h,spacing:p=0,wrap:g="wrap",zeroMinWidth:m=!1,...v}=o,y=h||p,x=l||p,b=D.useContext(hde),w=u?a||12:b,_={},S={...v};i.keys.forEach(E=>{v[E]!=null&&(_[E]=v[E],delete S[E])});const O={...o,columns:w,container:u,direction:f,item:d,rowSpacing:y,columnSpacing:x,wrap:g,zeroMinWidth:m,spacing:p,..._,breakpoints:i.keys},k=Wat(O);return C.jsx(hde.Provider,{value:w,children:C.jsx(Bat,{ownerState:O,className:Oe(k.root,s),as:c,ref:n,...S})})});function XH(t){return`scale(${t}, ${t**2})`}const Vat={entering:{opacity:1,transform:XH(1)},entered:{opacity:1,transform:"none"}},iW=typeof navigator<"u"&&/^((?!chrome|android).)*(safari|mobile)/i.test(navigator.userAgent)&&/(os |version\/)15(.|_)4/i.test(navigator.userAgent),n1=D.forwardRef(function(e,n){const{addEndListener:r,appear:i=!0,children:o,easing:s,in:a,onEnter:l,onEntered:c,onEntering:u,onExit:f,onExited:d,onExiting:h,style:p,timeout:g="auto",TransitionComponent:m=Dc,...v}=e,y=cv(),x=D.useRef(),b=Na(),w=D.useRef(null),_=dn(w,My(o),n),S=R=>I=>{if(R){const B=w.current;I===void 0?R(B):R(B,I)}},O=S(u),k=S((R,I)=>{gee(R);const{duration:B,delay:$,easing:z}=Jv({style:p,timeout:g,easing:s},{mode:"enter"});let L;g==="auto"?(L=b.transitions.getAutoHeightDuration(R.clientHeight),x.current=L):L=B,R.style.transition=[b.transitions.create("opacity",{duration:L,delay:$}),b.transitions.create("transform",{duration:iW?L:L*.666,delay:$,easing:z})].join(","),l&&l(R,I)}),E=S(c),M=S(h),A=S(R=>{const{duration:I,delay:B,easing:$}=Jv({style:p,timeout:g,easing:s},{mode:"exit"});let z;g==="auto"?(z=b.transitions.getAutoHeightDuration(R.clientHeight),x.current=z):z=I,R.style.transition=[b.transitions.create("opacity",{duration:z,delay:B}),b.transitions.create("transform",{duration:iW?z:z*.666,delay:iW?B:B||z*.333,easing:$})].join(","),R.style.opacity=0,R.style.transform=XH(.75),f&&f(R)}),P=S(d),T=R=>{g==="auto"&&y.start(x.current||0,R),r&&r(w.current,R)};return C.jsx(m,{appear:i,in:a,nodeRef:w,onEnter:k,onEntered:E,onEntering:O,onExit:A,onExited:P,onExiting:M,addEndListener:T,timeout:g==="auto"?null:g,...v,children:(R,I)=>D.cloneElement(o,{style:{opacity:0,transform:XH(.75),visibility:R==="exited"&&!a?"hidden":void 0,...Vat[R],...p,...o.props.style},ref:_,...I})})});n1&&(n1.muiSupportAuto=!0);const Gat=t=>{const{classes:e,disableUnderline:n}=t,i=Xe({root:["root",!n&&"underline"],input:["input"]},Jit,e);return{...e,...i}},Hat=be(b4,{shouldForwardProp:t=>qo(t)||t==="classes",name:"MuiInput",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[...y4(t,e),!n.disableUnderline&&e.underline]}})(kt(({theme:t})=>{let n=t.palette.mode==="light"?"rgba(0, 0, 0, 0.42)":"rgba(255, 255, 255, 0.7)";return t.vars&&(n=`rgba(${t.vars.palette.common.onBackgroundChannel} / ${t.vars.opacity.inputUnderline})`),{position:"relative",variants:[{props:({ownerState:r})=>r.formControl,style:{"label + &":{marginTop:16}}},{props:({ownerState:r})=>!r.disableUnderline,style:{"&::after":{left:0,bottom:0,content:'""',position:"absolute",right:0,transform:"scaleX(0)",transition:t.transitions.create("transform",{duration:t.transitions.duration.shorter,easing:t.transitions.easing.easeOut}),pointerEvents:"none"},[`&.${AE.focused}:after`]:{transform:"scaleX(1) translateX(0)"},[`&.${AE.error}`]:{"&::before, &::after":{borderBottomColor:(t.vars||t).palette.error.main}},"&::before":{borderBottom:`1px solid ${n}`,left:0,bottom:0,content:'"\\00a0"',position:"absolute",right:0,transition:t.transitions.create("border-bottom-color",{duration:t.transitions.duration.shorter}),pointerEvents:"none"},[`&:hover:not(.${AE.disabled}, .${AE.error}):before`]:{borderBottom:`2px solid ${(t.vars||t).palette.text.primary}`,"@media (hover: none)":{borderBottom:`1px solid ${n}`}},[`&.${AE.disabled}:before`]:{borderBottomStyle:"dotted"}}},...Object.entries(t.palette).filter(di()).map(([r])=>({props:{color:r,disableUnderline:!1},style:{"&::after":{borderBottom:`2px solid ${(t.vars||t).palette[r].main}`}}}))]}})),qat=be(w4,{name:"MuiInput",slot:"Input",overridesResolver:x4})({}),Rg=D.forwardRef(function(e,n){const r=wt({props:e,name:"MuiInput"}),{disableUnderline:i=!1,components:o={},componentsProps:s,fullWidth:a=!1,inputComponent:l="input",multiline:c=!1,slotProps:u,slots:f={},type:d="text",...h}=r,p=Gat(r),m={root:{ownerState:{disableUnderline:i}}},v=u??s?Bo(u??s,m):m,y=f.root??o.Root??Hat,x=f.input??o.Input??qat;return C.jsx(Cee,{slots:{root:y,input:x},slotProps:v,fullWidth:a,inputComponent:l,multiline:c,ref:n,type:d,...h,classes:p})});Rg&&(Rg.muiName="Input");function Xat(t){return Ye("MuiInputAdornment",t)}const pde=qe("MuiInputAdornment",["root","filled","standard","outlined","positionStart","positionEnd","disablePointerEvents","hiddenLabel","sizeSmall"]);var gde;const Yat=(t,e)=>{const{ownerState:n}=t;return[e.root,e[`position${De(n.position)}`],n.disablePointerEvents===!0&&e.disablePointerEvents,e[n.variant]]},Qat=t=>{const{classes:e,disablePointerEvents:n,hiddenLabel:r,position:i,size:o,variant:s}=t,a={root:["root",n&&"disablePointerEvents",i&&`position${De(i)}`,s,r&&"hiddenLabel",o&&`size${De(o)}`]};return Xe(a,Xat,e)},Kat=be("div",{name:"MuiInputAdornment",slot:"Root",overridesResolver:Yat})(kt(({theme:t})=>({display:"flex",maxHeight:"2em",alignItems:"center",whiteSpace:"nowrap",color:(t.vars||t).palette.action.active,variants:[{props:{variant:"filled"},style:{[`&.${pde.positionStart}&:not(.${pde.hiddenLabel})`]:{marginTop:16}}},{props:{position:"start"},style:{marginRight:8}},{props:{position:"end"},style:{marginLeft:8}},{props:{disablePointerEvents:!0},style:{pointerEvents:"none"}}]}))),WAe=D.forwardRef(function(e,n){const r=wt({props:e,name:"MuiInputAdornment"}),{children:i,className:o,component:s="div",disablePointerEvents:a=!1,disableTypography:l=!1,position:c,variant:u,...f}=r,d=za()||{};let h=u;u&&d.variant,d&&!h&&(h=d.variant);const p={...r,hiddenLabel:d.hiddenLabel,size:d.size,disablePointerEvents:a,position:c,variant:h},g=Qat(p);return C.jsx(v4.Provider,{value:null,children:C.jsx(Kat,{as:s,ownerState:p,className:Oe(g.root,o),ref:n,...f,children:typeof i=="string"&&!l?C.jsx(Jt,{color:"textSecondary",children:i}):C.jsxs(D.Fragment,{children:[c==="start"?gde||(gde=C.jsx("span",{className:"notranslate",children:"​"})):null,i]})})})});function Zat(t){return Ye("MuiInputLabel",t)}qe("MuiInputLabel",["root","focused","disabled","error","required","asterisk","formControl","sizeSmall","shrink","animated","standard","filled","outlined"]);const Jat=t=>{const{classes:e,formControl:n,size:r,shrink:i,disableAnimation:o,variant:s,required:a}=t,l={root:["root",n&&"formControl",!o&&"animated",i&&"shrink",r&&r!=="normal"&&`size${De(r)}`,s],asterisk:[a&&"asterisk"]},c=Xe(l,Zat,e);return{...e,...c}},elt=be(Mat,{shouldForwardProp:t=>qo(t)||t==="classes",name:"MuiInputLabel",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[{[`& .${JT.asterisk}`]:e.asterisk},e.root,n.formControl&&e.formControl,n.size==="small"&&e.sizeSmall,n.shrink&&e.shrink,!n.disableAnimation&&e.animated,n.focused&&e.focused,e[n.variant]]}})(kt(({theme:t})=>({display:"block",transformOrigin:"top left",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",maxWidth:"100%",variants:[{props:({ownerState:e})=>e.formControl,style:{position:"absolute",left:0,top:0,transform:"translate(0, 20px) scale(1)"}},{props:{size:"small"},style:{transform:"translate(0, 17px) scale(1)"}},{props:({ownerState:e})=>e.shrink,style:{transform:"translate(0, -1.5px) scale(0.75)",transformOrigin:"top left",maxWidth:"133%"}},{props:({ownerState:e})=>!e.disableAnimation,style:{transition:t.transitions.create(["color","transform","max-width"],{duration:t.transitions.duration.shorter,easing:t.transitions.easing.easeOut})}},{props:{variant:"filled"},style:{zIndex:1,pointerEvents:"none",transform:"translate(12px, 16px) scale(1)",maxWidth:"calc(100% - 24px)"}},{props:{variant:"filled",size:"small"},style:{transform:"translate(12px, 13px) scale(1)"}},{props:({variant:e,ownerState:n})=>e==="filled"&&n.shrink,style:{userSelect:"none",pointerEvents:"auto",transform:"translate(12px, 7px) scale(0.75)",maxWidth:"calc(133% - 24px)"}},{props:({variant:e,ownerState:n,size:r})=>e==="filled"&&n.shrink&&r==="small",style:{transform:"translate(12px, 4px) scale(0.75)"}},{props:{variant:"outlined"},style:{zIndex:1,pointerEvents:"none",transform:"translate(14px, 16px) scale(1)",maxWidth:"calc(100% - 24px)"}},{props:{variant:"outlined",size:"small"},style:{transform:"translate(14px, 9px) scale(1)"}},{props:({variant:e,ownerState:n})=>e==="outlined"&&n.shrink,style:{userSelect:"none",pointerEvents:"auto",maxWidth:"calc(133% - 32px)",transform:"translate(14px, -9px) scale(0.75)"}}]}))),Ly=D.forwardRef(function(e,n){const r=wt({name:"MuiInputLabel",props:e}),{disableAnimation:i=!1,margin:o,shrink:s,variant:a,className:l,...c}=r,u=za();let f=s;typeof f>"u"&&u&&(f=u.filled||u.focused||u.adornedStart);const d=Dy({props:r,muiFormControl:u,states:["size","variant","required","focused"]}),h={...r,disableAnimation:i,formControl:u,shrink:f,size:d.size,variant:d.variant,required:d.required,focused:d.focused},p=Jat(h);return C.jsx(elt,{"data-shrink":f,ref:n,className:Oe(p.root,l),...c,ownerState:h,classes:p})});function tlt(t){return Ye("MuiLink",t)}const nlt=qe("MuiLink",["root","underlineNone","underlineHover","underlineAlways","button","focusVisible"]),rlt=({theme:t,ownerState:e})=>{const n=e.color,r=mS(t,`palette.${n}`,!1)||e.color,i=mS(t,`palette.${n}Channel`);return"vars"in t&&i?`rgba(${i} / 0.4)`:Tt(r,.4)},mde={primary:!0,secondary:!0,error:!0,info:!0,success:!0,warning:!0,textPrimary:!0,textSecondary:!0,textDisabled:!0},ilt=t=>{const{classes:e,component:n,focusVisible:r,underline:i}=t,o={root:["root",`underline${De(i)}`,n==="button"&&"button",r&&"focusVisible"]};return Xe(o,tlt,e)},olt=be(Jt,{name:"MuiLink",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,e[`underline${De(n.underline)}`],n.component==="button"&&e.button]}})(kt(({theme:t})=>({variants:[{props:{underline:"none"},style:{textDecoration:"none"}},{props:{underline:"hover"},style:{textDecoration:"none","&:hover":{textDecoration:"underline"}}},{props:{underline:"always"},style:{textDecoration:"underline","&:hover":{textDecorationColor:"inherit"}}},{props:({underline:e,ownerState:n})=>e==="always"&&n.color!=="inherit",style:{textDecorationColor:"var(--Link-underlineColor)"}},...Object.entries(t.palette).filter(di()).map(([e])=>({props:{underline:"always",color:e},style:{"--Link-underlineColor":t.vars?`rgba(${t.vars.palette[e].mainChannel} / 0.4)`:Tt(t.palette[e].main,.4)}})),{props:{underline:"always",color:"textPrimary"},style:{"--Link-underlineColor":t.vars?`rgba(${t.vars.palette.text.primaryChannel} / 0.4)`:Tt(t.palette.text.primary,.4)}},{props:{underline:"always",color:"textSecondary"},style:{"--Link-underlineColor":t.vars?`rgba(${t.vars.palette.text.secondaryChannel} / 0.4)`:Tt(t.palette.text.secondary,.4)}},{props:{underline:"always",color:"textDisabled"},style:{"--Link-underlineColor":(t.vars||t).palette.text.disabled}},{props:{component:"button"},style:{position:"relative",WebkitTapHighlightColor:"transparent",backgroundColor:"transparent",outline:0,border:0,margin:0,borderRadius:0,padding:0,cursor:"pointer",userSelect:"none",verticalAlign:"middle",MozAppearance:"none",WebkitAppearance:"none","&::-moz-focus-inner":{borderStyle:"none"},[`&.${nlt.focusVisible}`]:{outline:"auto"}}}]}))),slt=D.forwardRef(function(e,n){const r=wt({props:e,name:"MuiLink"}),i=Na(),{className:o,color:s="primary",component:a="a",onBlur:l,onFocus:c,TypographyClasses:u,underline:f="always",variant:d="inherit",sx:h,...p}=r,[g,m]=D.useState(!1),v=w=>{Zv(w.target)||m(!1),l&&l(w)},y=w=>{Zv(w.target)&&m(!0),c&&c(w)},x={...r,color:s,component:a,focusVisible:g,underline:f,variant:d},b=ilt(x);return C.jsx(olt,{color:s,className:Oe(b.root,o),classes:u,component:a,onBlur:v,onFocus:y,ref:n,ownerState:x,variant:d,...p,sx:[...mde[s]===void 0?[{color:s}]:[],...Array.isArray(h)?h:[h]],style:{...p.style,...f==="always"&&s!=="inherit"&&!mde[s]&&{"--Link-underlineColor":rlt({theme:i,ownerState:x})}}})}),If=D.createContext({});function alt(t){return Ye("MuiList",t)}qe("MuiList",["root","padding","dense","subheader"]);const llt=t=>{const{classes:e,disablePadding:n,dense:r,subheader:i}=t;return Xe({root:["root",!n&&"padding",r&&"dense",i&&"subheader"]},alt,e)},clt=be("ul",{name:"MuiList",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,!n.disablePadding&&e.padding,n.dense&&e.dense,n.subheader&&e.subheader]}})({listStyle:"none",margin:0,padding:0,position:"relative",variants:[{props:({ownerState:t})=>!t.disablePadding,style:{paddingTop:8,paddingBottom:8}},{props:({ownerState:t})=>t.subheader,style:{paddingTop:0}}]}),DM=D.forwardRef(function(e,n){const r=wt({props:e,name:"MuiList"}),{children:i,className:o,component:s="ul",dense:a=!1,disablePadding:l=!1,subheader:c,...u}=r,f=D.useMemo(()=>({dense:a}),[a]),d={...r,component:s,dense:a,disablePadding:l},h=llt(d);return C.jsx(If.Provider,{value:f,children:C.jsxs(clt,{as:s,className:Oe(h.root,o),ref:n,ownerState:d,...u,children:[c,i]})})});function ult(t){return Ye("MuiListItem",t)}qe("MuiListItem",["root","container","dense","alignItemsFlexStart","divider","gutters","padding","secondaryAction"]);function flt(t){return Ye("MuiListItemButton",t)}const Rw=qe("MuiListItemButton",["root","focusVisible","dense","alignItemsFlexStart","disabled","divider","gutters","selected"]),dlt=(t,e)=>{const{ownerState:n}=t;return[e.root,n.dense&&e.dense,n.alignItems==="flex-start"&&e.alignItemsFlexStart,n.divider&&e.divider,!n.disableGutters&&e.gutters]},hlt=t=>{const{alignItems:e,classes:n,dense:r,disabled:i,disableGutters:o,divider:s,selected:a}=t,c=Xe({root:["root",r&&"dense",!o&&"gutters",s&&"divider",i&&"disabled",e==="flex-start"&&"alignItemsFlexStart",a&&"selected"]},flt,n);return{...n,...c}},plt=be(Nf,{shouldForwardProp:t=>qo(t)||t==="classes",name:"MuiListItemButton",slot:"Root",overridesResolver:dlt})(kt(({theme:t})=>({display:"flex",flexGrow:1,justifyContent:"flex-start",alignItems:"center",position:"relative",textDecoration:"none",minWidth:0,boxSizing:"border-box",textAlign:"left",paddingTop:8,paddingBottom:8,transition:t.transitions.create("background-color",{duration:t.transitions.duration.shortest}),"&:hover":{textDecoration:"none",backgroundColor:(t.vars||t).palette.action.hover,"@media (hover: none)":{backgroundColor:"transparent"}},[`&.${Rw.selected}`]:{backgroundColor:t.vars?`rgba(${t.vars.palette.primary.mainChannel} / ${t.vars.palette.action.selectedOpacity})`:Tt(t.palette.primary.main,t.palette.action.selectedOpacity),[`&.${Rw.focusVisible}`]:{backgroundColor:t.vars?`rgba(${t.vars.palette.primary.mainChannel} / calc(${t.vars.palette.action.selectedOpacity} + ${t.vars.palette.action.focusOpacity}))`:Tt(t.palette.primary.main,t.palette.action.selectedOpacity+t.palette.action.focusOpacity)}},[`&.${Rw.selected}:hover`]:{backgroundColor:t.vars?`rgba(${t.vars.palette.primary.mainChannel} / calc(${t.vars.palette.action.selectedOpacity} + ${t.vars.palette.action.hoverOpacity}))`:Tt(t.palette.primary.main,t.palette.action.selectedOpacity+t.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:t.vars?`rgba(${t.vars.palette.primary.mainChannel} / ${t.vars.palette.action.selectedOpacity})`:Tt(t.palette.primary.main,t.palette.action.selectedOpacity)}},[`&.${Rw.focusVisible}`]:{backgroundColor:(t.vars||t).palette.action.focus},[`&.${Rw.disabled}`]:{opacity:(t.vars||t).palette.action.disabledOpacity},variants:[{props:({ownerState:e})=>e.divider,style:{borderBottom:`1px solid ${(t.vars||t).palette.divider}`,backgroundClip:"padding-box"}},{props:{alignItems:"flex-start"},style:{alignItems:"flex-start"}},{props:({ownerState:e})=>!e.disableGutters,style:{paddingLeft:16,paddingRight:16}},{props:({ownerState:e})=>e.dense,style:{paddingTop:4,paddingBottom:4}}]}))),VAe=D.forwardRef(function(e,n){const r=wt({props:e,name:"MuiListItemButton"}),{alignItems:i="center",autoFocus:o=!1,component:s="div",children:a,dense:l=!1,disableGutters:c=!1,divider:u=!1,focusVisibleClassName:f,selected:d=!1,className:h,...p}=r,g=D.useContext(If),m=D.useMemo(()=>({dense:l||g.dense||!1,alignItems:i,disableGutters:c}),[i,g.dense,l,c]),v=D.useRef(null);Ei(()=>{o&&v.current&&v.current.focus()},[o]);const y={...r,alignItems:i,dense:m.dense,disableGutters:c,divider:u,selected:d},x=hlt(y),b=dn(v,n);return C.jsx(If.Provider,{value:m,children:C.jsx(plt,{ref:b,href:p.href||p.to,component:(p.href||p.to)&&s==="div"?"button":s,focusVisibleClassName:Oe(x.focusVisible,f),ownerState:y,className:Oe(x.root,h),...p,classes:x,children:a})})});function glt(t){return Ye("MuiListItemSecondaryAction",t)}qe("MuiListItemSecondaryAction",["root","disableGutters"]);const mlt=t=>{const{disableGutters:e,classes:n}=t;return Xe({root:["root",e&&"disableGutters"]},glt,n)},vlt=be("div",{name:"MuiListItemSecondaryAction",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,n.disableGutters&&e.disableGutters]}})({position:"absolute",right:16,top:"50%",transform:"translateY(-50%)",variants:[{props:({ownerState:t})=>t.disableGutters,style:{right:0}}]}),aA=D.forwardRef(function(e,n){const r=wt({props:e,name:"MuiListItemSecondaryAction"}),{className:i,...o}=r,s=D.useContext(If),a={...r,disableGutters:s.disableGutters},l=mlt(a);return C.jsx(vlt,{className:Oe(l.root,i),ownerState:a,ref:n,...o})});aA.muiName="ListItemSecondaryAction";const ylt=(t,e)=>{const{ownerState:n}=t;return[e.root,n.dense&&e.dense,n.alignItems==="flex-start"&&e.alignItemsFlexStart,n.divider&&e.divider,!n.disableGutters&&e.gutters,!n.disablePadding&&e.padding,n.hasSecondaryAction&&e.secondaryAction]},xlt=t=>{const{alignItems:e,classes:n,dense:r,disableGutters:i,disablePadding:o,divider:s,hasSecondaryAction:a}=t;return Xe({root:["root",r&&"dense",!i&&"gutters",!o&&"padding",s&&"divider",e==="flex-start"&&"alignItemsFlexStart",a&&"secondaryAction"],container:["container"]},ult,n)},blt=be("div",{name:"MuiListItem",slot:"Root",overridesResolver:ylt})(kt(({theme:t})=>({display:"flex",justifyContent:"flex-start",alignItems:"center",position:"relative",textDecoration:"none",width:"100%",boxSizing:"border-box",textAlign:"left",variants:[{props:({ownerState:e})=>!e.disablePadding,style:{paddingTop:8,paddingBottom:8}},{props:({ownerState:e})=>!e.disablePadding&&e.dense,style:{paddingTop:4,paddingBottom:4}},{props:({ownerState:e})=>!e.disablePadding&&!e.disableGutters,style:{paddingLeft:16,paddingRight:16}},{props:({ownerState:e})=>!e.disablePadding&&!!e.secondaryAction,style:{paddingRight:48}},{props:({ownerState:e})=>!!e.secondaryAction,style:{[`& > .${Rw.root}`]:{paddingRight:48}}},{props:{alignItems:"flex-start"},style:{alignItems:"flex-start"}},{props:({ownerState:e})=>e.divider,style:{borderBottom:`1px solid ${(t.vars||t).palette.divider}`,backgroundClip:"padding-box"}},{props:({ownerState:e})=>e.button,style:{transition:t.transitions.create("background-color",{duration:t.transitions.duration.shortest}),"&:hover":{textDecoration:"none",backgroundColor:(t.vars||t).palette.action.hover,"@media (hover: none)":{backgroundColor:"transparent"}}}},{props:({ownerState:e})=>e.hasSecondaryAction,style:{paddingRight:48}}]}))),wlt=be("li",{name:"MuiListItem",slot:"Container",overridesResolver:(t,e)=>e.container})({position:"relative"}),M_=D.forwardRef(function(e,n){const r=wt({props:e,name:"MuiListItem"}),{alignItems:i="center",children:o,className:s,component:a,components:l={},componentsProps:c={},ContainerComponent:u="li",ContainerProps:{className:f,...d}={},dense:h=!1,disableGutters:p=!1,disablePadding:g=!1,divider:m=!1,secondaryAction:v,slotProps:y={},slots:x={},...b}=r,w=D.useContext(If),_=D.useMemo(()=>({dense:h||w.dense||!1,alignItems:i,disableGutters:p}),[i,w.dense,h,p]),S=D.useRef(null),O=D.Children.toArray(o),k=O.length&&s3(O[O.length-1],["ListItemSecondaryAction"]),E={...r,alignItems:i,dense:_.dense,disableGutters:p,disablePadding:g,divider:m,hasSecondaryAction:k},M=xlt(E),A=dn(S,n),P=x.root||l.Root||blt,T=y.root||c.root||{},R={className:Oe(M.root,T.className,s),...b};let I=a||"li";return k?(I=!R.component&&!a?"div":I,u==="li"&&(I==="li"?I="div":R.component==="li"&&(R.component="div")),C.jsx(If.Provider,{value:_,children:C.jsxs(wlt,{as:u,className:Oe(M.container,f),ref:A,ownerState:E,...d,children:[C.jsx(P,{...T,...!rg(P)&&{as:I,ownerState:{...E,...T.ownerState}},...R,children:O}),O.pop()]})})):C.jsx(If.Provider,{value:_,children:C.jsxs(P,{...T,as:I,ref:A,...!rg(P)&&{ownerState:{...E,...T.ownerState}},...R,children:[O,v&&C.jsx(aA,{children:v})]})})});function _lt(t){return Ye("MuiListItemIcon",t)}const vde=qe("MuiListItemIcon",["root","alignItemsFlexStart"]),Slt=t=>{const{alignItems:e,classes:n}=t;return Xe({root:["root",e==="flex-start"&&"alignItemsFlexStart"]},_lt,n)},Clt=be("div",{name:"MuiListItemIcon",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,n.alignItems==="flex-start"&&e.alignItemsFlexStart]}})(kt(({theme:t})=>({minWidth:56,color:(t.vars||t).palette.action.active,flexShrink:0,display:"inline-flex",variants:[{props:{alignItems:"flex-start"},style:{marginTop:8}}]}))),GAe=D.forwardRef(function(e,n){const r=wt({props:e,name:"MuiListItemIcon"}),{className:i,...o}=r,s=D.useContext(If),a={...r,alignItems:s.alignItems},l=Slt(a);return C.jsx(Clt,{className:Oe(l.root,i),ownerState:a,ref:n,...o})});function Olt(t){return Ye("MuiListItemText",t)}const n_=qe("MuiListItemText",["root","multiline","dense","inset","primary","secondary"]),Elt=t=>{const{classes:e,inset:n,primary:r,secondary:i,dense:o}=t;return Xe({root:["root",n&&"inset",o&&"dense",r&&i&&"multiline"],primary:["primary"],secondary:["secondary"]},Olt,e)},Tlt=be("div",{name:"MuiListItemText",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[{[`& .${n_.primary}`]:e.primary},{[`& .${n_.secondary}`]:e.secondary},e.root,n.inset&&e.inset,n.primary&&n.secondary&&e.multiline,n.dense&&e.dense]}})({flex:"1 1 auto",minWidth:0,marginTop:4,marginBottom:4,[`.${LF.root}:where(& .${n_.primary})`]:{display:"block"},[`.${LF.root}:where(& .${n_.secondary})`]:{display:"block"},variants:[{props:({ownerState:t})=>t.primary&&t.secondary,style:{marginTop:6,marginBottom:6}},{props:({ownerState:t})=>t.inset,style:{paddingLeft:56}}]}),du=D.forwardRef(function(e,n){const r=wt({props:e,name:"MuiListItemText"}),{children:i,className:o,disableTypography:s=!1,inset:a=!1,primary:l,primaryTypographyProps:c,secondary:u,secondaryTypographyProps:f,...d}=r,{dense:h}=D.useContext(If);let p=l??i,g=u;const m={...r,disableTypography:s,inset:a,primary:!!p,secondary:!!g,dense:h},v=Elt(m);return p!=null&&p.type!==Jt&&!s&&(p=C.jsx(Jt,{variant:h?"body2":"body1",className:v.primary,component:c!=null&&c.variant?void 0:"span",...c,children:p})),g!=null&&g.type!==Jt&&!s&&(g=C.jsx(Jt,{variant:"body2",className:v.secondary,color:"textSecondary",...f,children:g})),C.jsxs(Tlt,{className:Oe(v.root,o),ownerState:m,ref:n,...d,children:[p,g]})});function oW(t,e,n){return t===e?t.firstChild:e&&e.nextElementSibling?e.nextElementSibling:n?null:t.firstChild}function yde(t,e,n){return t===e?n?t.firstChild:t.lastChild:e&&e.previousElementSibling?e.previousElementSibling:n?null:t.lastChild}function HAe(t,e){if(e===void 0)return!0;let n=t.innerText;return n===void 0&&(n=t.textContent),n=n.trim().toLowerCase(),n.length===0?!1:e.repeating?n[0]===e.keys[0]:n.startsWith(e.keys.join(""))}function ME(t,e,n,r,i,o){let s=!1,a=i(t,e,e?n:!1);for(;a;){if(a===t.firstChild){if(s)return!1;s=!0}const l=r?!1:a.disabled||a.getAttribute("aria-disabled")==="true";if(!a.hasAttribute("tabindex")||!HAe(a,o)||l)a=i(t,a,n);else return a.focus(),!0}return!1}const _4=D.forwardRef(function(e,n){const{actions:r,autoFocus:i=!1,autoFocusItem:o=!1,children:s,className:a,disabledItemsFocusable:l=!1,disableListWrap:c=!1,onKeyDown:u,variant:f="selectedMenu",...d}=e,h=D.useRef(null),p=D.useRef({keys:[],repeating:!0,previousKeyMatched:!0,lastTime:null});Ei(()=>{i&&h.current.focus()},[i]),D.useImperativeHandle(r,()=>({adjustStyleForScrollbar:(x,{direction:b})=>{const w=!h.current.style.width;if(x.clientHeight{const b=h.current,w=x.key;if(x.ctrlKey||x.metaKey||x.altKey){u&&u(x);return}const S=mi(b).activeElement;if(w==="ArrowDown")x.preventDefault(),ME(b,S,c,l,oW);else if(w==="ArrowUp")x.preventDefault(),ME(b,S,c,l,yde);else if(w==="Home")x.preventDefault(),ME(b,null,c,l,oW);else if(w==="End")x.preventDefault(),ME(b,null,c,l,yde);else if(w.length===1){const O=p.current,k=w.toLowerCase(),E=performance.now();O.keys.length>0&&(E-O.lastTime>500?(O.keys=[],O.repeating=!0,O.previousKeyMatched=!0):O.repeating&&k!==O.keys[0]&&(O.repeating=!1)),O.lastTime=E,O.keys.push(k);const M=S&&!O.repeating&&HAe(S,O);O.previousKeyMatched&&(M||ME(b,S,!1,l,oW,O))?x.preventDefault():O.previousKeyMatched=!1}u&&u(x)},m=dn(h,n);let v=-1;D.Children.forEach(s,(x,b)=>{if(!D.isValidElement(x)){v===b&&(v+=1,v>=s.length&&(v=-1));return}x.props.disabled||(f==="selectedMenu"&&x.props.selected||v===-1)&&(v=b),v===b&&(x.props.disabled||x.props.muiSkipListHighlight||x.type.muiSkipListHighlight)&&(v+=1,v>=s.length&&(v=-1))});const y=D.Children.map(s,(x,b)=>{if(b===v){const w={};return o&&(w.autoFocus=!0),x.props.tabIndex===void 0&&f==="selectedMenu"&&(w.tabIndex=0),D.cloneElement(x,w)}return x});return C.jsx(DM,{role:"menu",ref:m,className:a,onKeyDown:g,tabIndex:i?0:-1,...d,children:y})});function klt(t){return Ye("MuiPopover",t)}qe("MuiPopover",["root","paper"]);function xde(t,e){let n=0;return typeof e=="number"?n=e:e==="center"?n=t.height/2:e==="bottom"&&(n=t.height),n}function bde(t,e){let n=0;return typeof e=="number"?n=e:e==="center"?n=t.width/2:e==="right"&&(n=t.width),n}function wde(t){return[t.horizontal,t.vertical].map(e=>typeof e=="number"?`${e}px`:e).join(" ")}function sW(t){return typeof t=="function"?t():t}const Alt=t=>{const{classes:e}=t;return Xe({root:["root"],paper:["paper"]},klt,e)},Plt=be(jAe,{name:"MuiPopover",slot:"Root",overridesResolver:(t,e)=>e.root})({}),qAe=be(Al,{name:"MuiPopover",slot:"Paper",overridesResolver:(t,e)=>e.paper})({position:"absolute",overflowY:"auto",overflowX:"hidden",minWidth:16,minHeight:16,maxWidth:"calc(100% - 32px)",maxHeight:"calc(100% - 32px)",outline:0}),K1=D.forwardRef(function(e,n){const r=wt({props:e,name:"MuiPopover"}),{action:i,anchorEl:o,anchorOrigin:s={vertical:"top",horizontal:"left"},anchorPosition:a,anchorReference:l="anchorEl",children:c,className:u,container:f,elevation:d=8,marginThreshold:h=16,open:p,PaperProps:g={},slots:m={},slotProps:v={},transformOrigin:y={vertical:"top",horizontal:"left"},TransitionComponent:x=n1,transitionDuration:b="auto",TransitionProps:{onEntering:w,..._}={},disableScrollLock:S=!1,...O}=r,k=(v==null?void 0:v.paper)??g,E=D.useRef(),M={...r,anchorOrigin:s,anchorReference:l,elevation:d,marginThreshold:h,externalPaperSlotProps:k,transformOrigin:y,TransitionComponent:x,transitionDuration:b,TransitionProps:_},A=Alt(M),P=D.useCallback(()=>{if(l==="anchorPosition")return a;const re=sW(o),te=(re&&re.nodeType===1?re:mi(E.current).body).getBoundingClientRect();return{top:te.top+xde(te,s.vertical),left:te.left+bde(te,s.horizontal)}},[o,s.horizontal,s.vertical,a,l]),T=D.useCallback(re=>({vertical:xde(re,y.vertical),horizontal:bde(re,y.horizontal)}),[y.horizontal,y.vertical]),R=D.useCallback(re=>{const me={width:re.offsetWidth,height:re.offsetHeight},te=T(me);if(l==="none")return{top:null,left:null,transformOrigin:wde(te)};const ae=P();let U=ae.top-te.vertical,oe=ae.left-te.horizontal;const ne=U+me.height,V=oe+me.width,X=bc(sW(o)),Z=X.innerHeight-h,he=X.innerWidth-h;if(h!==null&&UZ){const xe=ne-Z;U-=xe,te.vertical+=xe}if(h!==null&&oehe){const xe=V-he;oe-=xe,te.horizontal+=xe}return{top:`${Math.round(U)}px`,left:`${Math.round(oe)}px`,transformOrigin:wde(te)}},[o,l,P,T,h]),[I,B]=D.useState(p),$=D.useCallback(()=>{const re=E.current;if(!re)return;const me=R(re);me.top!==null&&re.style.setProperty("top",me.top),me.left!==null&&(re.style.left=me.left),re.style.transformOrigin=me.transformOrigin,B(!0)},[R]);D.useEffect(()=>(S&&window.addEventListener("scroll",$),()=>window.removeEventListener("scroll",$)),[o,S,$]);const z=(re,me)=>{w&&w(re,me),$()},L=()=>{B(!1)};D.useEffect(()=>{p&&$()}),D.useImperativeHandle(i,()=>p?{updatePosition:()=>{$()}}:null,[p,$]),D.useEffect(()=>{if(!p)return;const re=kM(()=>{$()}),me=bc(o);return me.addEventListener("resize",re),()=>{re.clear(),me.removeEventListener("resize",re)}},[o,p,$]);let j=b;b==="auto"&&!x.muiSupportAuto&&(j=void 0);const N=f||(o?mi(sW(o)).body:void 0),F={slots:m,slotProps:{...v,paper:k}},[H,q]=ec("paper",{elementType:qAe,externalForwardedProps:F,additionalProps:{elevation:d,className:Oe(A.paper,k==null?void 0:k.className),style:I?k.style:{...k.style,opacity:0}},ownerState:M}),[Y,{slotProps:le,...K}]=ec("root",{elementType:Plt,externalForwardedProps:F,additionalProps:{slotProps:{backdrop:{invisible:!0}},container:N,open:p},ownerState:M,className:Oe(A.root,u)}),ee=dn(E,q.ref);return C.jsx(Y,{...K,...!rg(Y)&&{slotProps:le,disableScrollLock:S},...O,ref:n,children:C.jsx(x,{appear:!0,in:p,onEntering:z,onExited:L,timeout:j,..._,children:C.jsx(H,{...q,ref:ee,children:c})})})});function Mlt(t){return Ye("MuiMenu",t)}qe("MuiMenu",["root","paper","list"]);const Rlt={vertical:"top",horizontal:"right"},Dlt={vertical:"top",horizontal:"left"},Ilt=t=>{const{classes:e}=t;return Xe({root:["root"],paper:["paper"],list:["list"]},Mlt,e)},Llt=be(K1,{shouldForwardProp:t=>qo(t)||t==="classes",name:"MuiMenu",slot:"Root",overridesResolver:(t,e)=>e.root})({}),$lt=be(qAe,{name:"MuiMenu",slot:"Paper",overridesResolver:(t,e)=>e.paper})({maxHeight:"calc(100% - 96px)",WebkitOverflowScrolling:"touch"}),Flt=be(_4,{name:"MuiMenu",slot:"List",overridesResolver:(t,e)=>e.list})({outline:0}),Z1=D.forwardRef(function(e,n){const r=wt({props:e,name:"MuiMenu"}),{autoFocus:i=!0,children:o,className:s,disableAutoFocusItem:a=!1,MenuListProps:l={},onClose:c,open:u,PaperProps:f={},PopoverClasses:d,transitionDuration:h="auto",TransitionProps:{onEntering:p,...g}={},variant:m="selectedMenu",slots:v={},slotProps:y={},...x}=r,b=Ho(),w={...r,autoFocus:i,disableAutoFocusItem:a,MenuListProps:l,onEntering:p,PaperProps:f,transitionDuration:h,TransitionProps:g,variant:m},_=Ilt(w),S=i&&!a&&u,O=D.useRef(null),k=(I,B)=>{O.current&&O.current.adjustStyleForScrollbar(I,{direction:b?"rtl":"ltr"}),p&&p(I,B)},E=I=>{I.key==="Tab"&&(I.preventDefault(),c&&c(I,"tabKeyDown"))};let M=-1;D.Children.map(o,(I,B)=>{D.isValidElement(I)&&(I.props.disabled||(m==="selectedMenu"&&I.props.selected||M===-1)&&(M=B))});const A=v.paper??$lt,P=y.paper??f,T=Zt({elementType:v.root,externalSlotProps:y.root,ownerState:w,className:[_.root,s]}),R=Zt({elementType:A,externalSlotProps:P,ownerState:w,className:_.paper});return C.jsx(Llt,{onClose:c,anchorOrigin:{vertical:"bottom",horizontal:b?"right":"left"},transformOrigin:b?Rlt:Dlt,slots:{paper:A,root:v.root},slotProps:{root:T,paper:R},open:u,ref:n,transitionDuration:h,TransitionProps:{onEntering:k,...g},ownerState:w,...x,classes:d,children:C.jsx(Flt,{onKeyDown:E,actions:O,autoFocus:i&&(M===-1||a),autoFocusItem:S,variant:m,...l,className:Oe(_.list,l.className),children:o})})});function Nlt(t){return Ye("MuiMenuItem",t)}const RE=qe("MuiMenuItem",["root","focusVisible","dense","disabled","divider","gutters","selected"]),zlt=(t,e)=>{const{ownerState:n}=t;return[e.root,n.dense&&e.dense,n.divider&&e.divider,!n.disableGutters&&e.gutters]},jlt=t=>{const{disabled:e,dense:n,divider:r,disableGutters:i,selected:o,classes:s}=t,l=Xe({root:["root",n&&"dense",e&&"disabled",!i&&"gutters",r&&"divider",o&&"selected"]},Nlt,s);return{...s,...l}},Blt=be(Nf,{shouldForwardProp:t=>qo(t)||t==="classes",name:"MuiMenuItem",slot:"Root",overridesResolver:zlt})(kt(({theme:t})=>({...t.typography.body1,display:"flex",justifyContent:"flex-start",alignItems:"center",position:"relative",textDecoration:"none",minHeight:48,paddingTop:6,paddingBottom:6,boxSizing:"border-box",whiteSpace:"nowrap","&:hover":{textDecoration:"none",backgroundColor:(t.vars||t).palette.action.hover,"@media (hover: none)":{backgroundColor:"transparent"}},[`&.${RE.selected}`]:{backgroundColor:t.vars?`rgba(${t.vars.palette.primary.mainChannel} / ${t.vars.palette.action.selectedOpacity})`:Tt(t.palette.primary.main,t.palette.action.selectedOpacity),[`&.${RE.focusVisible}`]:{backgroundColor:t.vars?`rgba(${t.vars.palette.primary.mainChannel} / calc(${t.vars.palette.action.selectedOpacity} + ${t.vars.palette.action.focusOpacity}))`:Tt(t.palette.primary.main,t.palette.action.selectedOpacity+t.palette.action.focusOpacity)}},[`&.${RE.selected}:hover`]:{backgroundColor:t.vars?`rgba(${t.vars.palette.primary.mainChannel} / calc(${t.vars.palette.action.selectedOpacity} + ${t.vars.palette.action.hoverOpacity}))`:Tt(t.palette.primary.main,t.palette.action.selectedOpacity+t.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:t.vars?`rgba(${t.vars.palette.primary.mainChannel} / ${t.vars.palette.action.selectedOpacity})`:Tt(t.palette.primary.main,t.palette.action.selectedOpacity)}},[`&.${RE.focusVisible}`]:{backgroundColor:(t.vars||t).palette.action.focus},[`&.${RE.disabled}`]:{opacity:(t.vars||t).palette.action.disabledOpacity},[`& + .${ude.root}`]:{marginTop:t.spacing(1),marginBottom:t.spacing(1)},[`& + .${ude.inset}`]:{marginLeft:52},[`& .${n_.root}`]:{marginTop:0,marginBottom:0},[`& .${n_.inset}`]:{paddingLeft:36},[`& .${vde.root}`]:{minWidth:36},variants:[{props:({ownerState:e})=>!e.disableGutters,style:{paddingLeft:16,paddingRight:16}},{props:({ownerState:e})=>e.divider,style:{borderBottom:`1px solid ${(t.vars||t).palette.divider}`,backgroundClip:"padding-box"}},{props:({ownerState:e})=>!e.dense,style:{[t.breakpoints.up("sm")]:{minHeight:"auto"}}},{props:({ownerState:e})=>e.dense,style:{minHeight:32,paddingTop:4,paddingBottom:4,...t.typography.body2,[`& .${vde.root} svg`]:{fontSize:"1.25rem"}}}]}))),_i=D.forwardRef(function(e,n){const r=wt({props:e,name:"MuiMenuItem"}),{autoFocus:i=!1,component:o="li",dense:s=!1,divider:a=!1,disableGutters:l=!1,focusVisibleClassName:c,role:u="menuitem",tabIndex:f,className:d,...h}=r,p=D.useContext(If),g=D.useMemo(()=>({dense:s||p.dense||!1,disableGutters:l}),[p.dense,s,l]),m=D.useRef(null);Ei(()=>{i&&m.current&&m.current.focus()},[i]);const v={...r,dense:g.dense,divider:a,disableGutters:l},y=jlt(r),x=dn(m,n);let b;return r.disabled||(b=f!==void 0?f:-1),C.jsx(If.Provider,{value:g,children:C.jsx(Blt,{ref:x,role:u,tabIndex:b,component:o,focusVisibleClassName:Oe(y.focusVisible,c),className:Oe(y.root,d),...h,ownerState:v,classes:y})})});function Ult(t){return Ye("MuiNativeSelect",t)}const Tee=qe("MuiNativeSelect",["root","select","multiple","filled","outlined","standard","disabled","icon","iconOpen","iconFilled","iconOutlined","iconStandard","nativeInput","error"]),Wlt=t=>{const{classes:e,variant:n,disabled:r,multiple:i,open:o,error:s}=t,a={select:["select",n,r&&"disabled",i&&"multiple",s&&"error"],icon:["icon",`icon${De(n)}`,o&&"iconOpen",r&&"disabled"]};return Xe(a,Ult,e)},XAe=be("select")(({theme:t})=>({MozAppearance:"none",WebkitAppearance:"none",userSelect:"none",borderRadius:0,cursor:"pointer","&:focus":{borderRadius:0},[`&.${Tee.disabled}`]:{cursor:"default"},"&[multiple]":{height:"auto"},"&:not([multiple]) option, &:not([multiple]) optgroup":{backgroundColor:(t.vars||t).palette.background.paper},variants:[{props:({ownerState:e})=>e.variant!=="filled"&&e.variant!=="outlined",style:{"&&&":{paddingRight:24,minWidth:16}}},{props:{variant:"filled"},style:{"&&&":{paddingRight:32}}},{props:{variant:"outlined"},style:{borderRadius:(t.vars||t).shape.borderRadius,"&:focus":{borderRadius:(t.vars||t).shape.borderRadius},"&&&":{paddingRight:32}}}]})),Vlt=be(XAe,{name:"MuiNativeSelect",slot:"Select",shouldForwardProp:qo,overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.select,e[n.variant],n.error&&e.error,{[`&.${Tee.multiple}`]:e.multiple}]}})({}),YAe=be("svg")(({theme:t})=>({position:"absolute",right:0,top:"calc(50% - .5em)",pointerEvents:"none",color:(t.vars||t).palette.action.active,[`&.${Tee.disabled}`]:{color:(t.vars||t).palette.action.disabled},variants:[{props:({ownerState:e})=>e.open,style:{transform:"rotate(180deg)"}},{props:{variant:"filled"},style:{right:7}},{props:{variant:"outlined"},style:{right:7}}]})),Glt=be(YAe,{name:"MuiNativeSelect",slot:"Icon",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.icon,n.variant&&e[`icon${De(n.variant)}`],n.open&&e.iconOpen]}})({}),Hlt=D.forwardRef(function(e,n){const{className:r,disabled:i,error:o,IconComponent:s,inputRef:a,variant:l="standard",...c}=e,u={...e,disabled:i,variant:l,error:o},f=Wlt(u);return C.jsxs(D.Fragment,{children:[C.jsx(Vlt,{ownerState:u,className:Oe(f.select,r),disabled:i,ref:a||n,...c}),e.multiple?null:C.jsx(Glt,{as:s,ownerState:u,className:f.icon})]})});var _de;const qlt=be("fieldset",{shouldForwardProp:qo})({textAlign:"left",position:"absolute",bottom:0,right:0,top:-5,left:0,margin:0,padding:"0 8px",pointerEvents:"none",borderRadius:"inherit",borderStyle:"solid",borderWidth:1,overflow:"hidden",minWidth:"0%"}),Xlt=be("legend",{shouldForwardProp:qo})(kt(({theme:t})=>({float:"unset",width:"auto",overflow:"hidden",variants:[{props:({ownerState:e})=>!e.withLabel,style:{padding:0,lineHeight:"11px",transition:t.transitions.create("width",{duration:150,easing:t.transitions.easing.easeOut})}},{props:({ownerState:e})=>e.withLabel,style:{display:"block",padding:0,height:11,fontSize:"0.75em",visibility:"hidden",maxWidth:.01,transition:t.transitions.create("max-width",{duration:50,easing:t.transitions.easing.easeOut}),whiteSpace:"nowrap","& > span":{paddingLeft:5,paddingRight:5,display:"inline-block",opacity:0,visibility:"visible"}}},{props:({ownerState:e})=>e.withLabel&&e.notched,style:{maxWidth:"100%",transition:t.transitions.create("max-width",{duration:100,easing:t.transitions.easing.easeOut,delay:50})}}]})));function Ylt(t){const{children:e,classes:n,className:r,label:i,notched:o,...s}=t,a=i!=null&&i!=="",l={...t,notched:o,withLabel:a};return C.jsx(qlt,{"aria-hidden":!0,className:r,ownerState:l,...s,children:C.jsx(Xlt,{ownerState:l,children:a?C.jsx("span",{children:i}):_de||(_de=C.jsx("span",{className:"notranslate",children:"​"}))})})}const Qlt=t=>{const{classes:e}=t,r=Xe({root:["root"],notchedOutline:["notchedOutline"],input:["input"]},eot,e);return{...e,...r}},Klt=be(b4,{shouldForwardProp:t=>qo(t)||t==="classes",name:"MuiOutlinedInput",slot:"Root",overridesResolver:y4})(kt(({theme:t})=>{const e=t.palette.mode==="light"?"rgba(0, 0, 0, 0.23)":"rgba(255, 255, 255, 0.23)";return{position:"relative",borderRadius:(t.vars||t).shape.borderRadius,[`&:hover .${gd.notchedOutline}`]:{borderColor:(t.vars||t).palette.text.primary},"@media (hover: none)":{[`&:hover .${gd.notchedOutline}`]:{borderColor:t.vars?`rgba(${t.vars.palette.common.onBackgroundChannel} / 0.23)`:e}},[`&.${gd.focused} .${gd.notchedOutline}`]:{borderWidth:2},variants:[...Object.entries(t.palette).filter(di()).map(([n])=>({props:{color:n},style:{[`&.${gd.focused} .${gd.notchedOutline}`]:{borderColor:(t.vars||t).palette[n].main}}})),{props:{},style:{[`&.${gd.error} .${gd.notchedOutline}`]:{borderColor:(t.vars||t).palette.error.main},[`&.${gd.disabled} .${gd.notchedOutline}`]:{borderColor:(t.vars||t).palette.action.disabled}}},{props:({ownerState:n})=>n.startAdornment,style:{paddingLeft:14}},{props:({ownerState:n})=>n.endAdornment,style:{paddingRight:14}},{props:({ownerState:n})=>n.multiline,style:{padding:"16.5px 14px"}},{props:({ownerState:n,size:r})=>n.multiline&&r==="small",style:{padding:"8.5px 14px"}}]}})),Zlt=be(Ylt,{name:"MuiOutlinedInput",slot:"NotchedOutline",overridesResolver:(t,e)=>e.notchedOutline})(kt(({theme:t})=>{const e=t.palette.mode==="light"?"rgba(0, 0, 0, 0.23)":"rgba(255, 255, 255, 0.23)";return{borderColor:t.vars?`rgba(${t.vars.palette.common.onBackgroundChannel} / 0.23)`:e}})),Jlt=be(w4,{name:"MuiOutlinedInput",slot:"Input",overridesResolver:x4})(kt(({theme:t})=>({padding:"16.5px 14px",...!t.vars&&{"&:-webkit-autofill":{WebkitBoxShadow:t.palette.mode==="light"?null:"0 0 0 100px #266798 inset",WebkitTextFillColor:t.palette.mode==="light"?null:"#fff",caretColor:t.palette.mode==="light"?null:"#fff",borderRadius:"inherit"}},...t.vars&&{"&:-webkit-autofill":{borderRadius:"inherit"},[t.getColorSchemeSelector("dark")]:{"&:-webkit-autofill":{WebkitBoxShadow:"0 0 0 100px #266798 inset",WebkitTextFillColor:"#fff",caretColor:"#fff"}}},variants:[{props:{size:"small"},style:{padding:"8.5px 14px"}},{props:({ownerState:e})=>e.multiline,style:{padding:0}},{props:({ownerState:e})=>e.startAdornment,style:{paddingLeft:0}},{props:({ownerState:e})=>e.endAdornment,style:{paddingRight:0}}]}))),BF=D.forwardRef(function(e,n){var r;const i=wt({props:e,name:"MuiOutlinedInput"}),{components:o={},fullWidth:s=!1,inputComponent:a="input",label:l,multiline:c=!1,notched:u,slots:f={},type:d="text",...h}=i,p=Qlt(i),g=za(),m=Dy({props:i,muiFormControl:g,states:["color","disabled","error","focused","hiddenLabel","size","required"]}),v={...i,color:m.color||"primary",disabled:m.disabled,error:m.error,focused:m.focused,formControl:g,fullWidth:s,hiddenLabel:m.hiddenLabel,multiline:c,size:m.size,type:d},y=f.root??o.Root??Klt,x=f.input??o.Input??Jlt;return C.jsx(Cee,{slots:{root:y,input:x},renderSuffix:b=>C.jsx(Zlt,{ownerState:v,className:p.notchedOutline,label:l!=null&&l!==""&&m.required?r||(r=C.jsxs(D.Fragment,{children:[l," ","*"]})):l,notched:typeof u<"u"?u:!!(b.startAdornment||b.filled||b.focused)}),fullWidth:s,inputComponent:a,multiline:c,ref:n,type:d,...h,classes:{...p,notchedOutline:null}})});BF&&(BF.muiName="Input");const ect=lt(C.jsx("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z"}),"RadioButtonUnchecked"),tct=lt(C.jsx("path",{d:"M8.465 8.465C9.37 7.56 10.62 7 12 7C14.76 7 17 9.24 17 12C17 13.38 16.44 14.63 15.535 15.535C14.63 16.44 13.38 17 12 17C9.24 17 7 14.76 7 12C7 10.62 7.56 9.37 8.465 8.465Z"}),"RadioButtonChecked"),nct=be("span",{shouldForwardProp:qo})({position:"relative",display:"flex"}),rct=be(ect)({transform:"scale(1)"}),ict=be(tct)(kt(({theme:t})=>({left:0,position:"absolute",transform:"scale(0)",transition:t.transitions.create("transform",{easing:t.transitions.easing.easeIn,duration:t.transitions.duration.shortest}),variants:[{props:{checked:!0},style:{transform:"scale(1)",transition:t.transitions.create("transform",{easing:t.transitions.easing.easeOut,duration:t.transitions.duration.shortest})}}]})));function QAe(t){const{checked:e=!1,classes:n={},fontSize:r}=t,i={...t,checked:e};return C.jsxs(nct,{className:n.root,ownerState:i,children:[C.jsx(rct,{fontSize:r,className:n.background,ownerState:i}),C.jsx(ict,{fontSize:r,className:n.dot,ownerState:i})]})}const KAe=D.createContext(void 0);function oct(){return D.useContext(KAe)}function sct(t){return Ye("MuiRadio",t)}const Sde=qe("MuiRadio",["root","checked","disabled","colorPrimary","colorSecondary","sizeSmall"]),act=t=>{const{classes:e,color:n,size:r}=t,i={root:["root",`color${De(n)}`,r!=="medium"&&`size${De(r)}`]};return{...e,...Xe(i,sct,e)}},lct=be(Oee,{shouldForwardProp:t=>qo(t)||t==="classes",name:"MuiRadio",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,n.size!=="medium"&&e[`size${De(n.size)}`],e[`color${De(n.color)}`]]}})(kt(({theme:t})=>({color:(t.vars||t).palette.text.secondary,[`&.${Sde.disabled}`]:{color:(t.vars||t).palette.action.disabled},variants:[{props:{color:"default",disabled:!1,disableRipple:!1},style:{"&:hover":{backgroundColor:t.vars?`rgba(${t.vars.palette.action.activeChannel} / ${t.vars.palette.action.hoverOpacity})`:Tt(t.palette.action.active,t.palette.action.hoverOpacity)}}},...Object.entries(t.palette).filter(di()).map(([e])=>({props:{color:e,disabled:!1,disableRipple:!1},style:{"&:hover":{backgroundColor:t.vars?`rgba(${t.vars.palette[e].mainChannel} / ${t.vars.palette.action.hoverOpacity})`:Tt(t.palette[e].main,t.palette.action.hoverOpacity)}}})),...Object.entries(t.palette).filter(di()).map(([e])=>({props:{color:e,disabled:!1},style:{[`&.${Sde.checked}`]:{color:(t.vars||t).palette[e].main}}})),{props:{disableRipple:!1},style:{"&:hover":{"@media (hover: none)":{backgroundColor:"transparent"}}}}]})));function cct(t,e){return typeof e=="object"&&e!==null?t===e:String(t)===String(e)}const Cde=C.jsx(QAe,{checked:!0}),Ode=C.jsx(QAe,{}),ek=D.forwardRef(function(e,n){const r=wt({props:e,name:"MuiRadio"}),{checked:i,checkedIcon:o=Cde,color:s="primary",icon:a=Ode,name:l,onChange:c,size:u="medium",className:f,disabled:d,disableRipple:h=!1,...p}=r,g=za();let m=d;g&&typeof m>"u"&&(m=g.disabled),m??(m=!1);const v={...r,disabled:m,disableRipple:h,color:s,size:u},y=act(v),x=oct();let b=i;const w=$H(c,x&&x.onChange);let _=l;return x&&(typeof b>"u"&&(b=cct(x.value,r.value)),typeof _>"u"&&(_=x.name)),C.jsx(lct,{type:"radio",icon:D.cloneElement(a,{fontSize:Ode.props.fontSize??u}),checkedIcon:D.cloneElement(o,{fontSize:Cde.props.fontSize??u}),disabled:m,ownerState:v,classes:y,name:_,checked:b,onChange:w,ref:n,className:Oe(y.root,f),...p})});function uct(t){return Ye("MuiRadioGroup",t)}qe("MuiRadioGroup",["root","row","error"]);const fct=t=>{const{classes:e,row:n,error:r}=t;return Xe({root:["root",n&&"row",r&&"error"]},uct,e)},kee=D.forwardRef(function(e,n){const{actions:r,children:i,className:o,defaultValue:s,name:a,onChange:l,value:c,...u}=e,f=D.useRef(null),d=fct(e),[h,p]=wc({controlled:c,default:s,name:"RadioGroup"});D.useImperativeHandle(r,()=>({focus:()=>{let y=f.current.querySelector("input:not(:disabled):checked");y||(y=f.current.querySelector("input:not(:disabled)")),y&&y.focus()}}),[]);const g=dn(n,f),m=Jf(a),v=D.useMemo(()=>({name:m,onChange(y){p(y.target.value),l&&l(y,y.target.value)},value:h}),[m,l,p,h]);return C.jsx(KAe.Provider,{value:v,children:C.jsx(Sat,{role:"radiogroup",ref:g,className:Oe(d.root,o),...u,children:i})})});function dct(t){return Ye("MuiSelect",t)}const DE=qe("MuiSelect",["root","select","multiple","filled","outlined","standard","disabled","focused","icon","iconOpen","iconFilled","iconOutlined","iconStandard","nativeInput","error"]);var Ede;const hct=be(XAe,{name:"MuiSelect",slot:"Select",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[{[`&.${DE.select}`]:e.select},{[`&.${DE.select}`]:e[n.variant]},{[`&.${DE.error}`]:e.error},{[`&.${DE.multiple}`]:e.multiple}]}})({[`&.${DE.select}`]:{height:"auto",minHeight:"1.4375em",textOverflow:"ellipsis",whiteSpace:"nowrap",overflow:"hidden"}}),pct=be(YAe,{name:"MuiSelect",slot:"Icon",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.icon,n.variant&&e[`icon${De(n.variant)}`],n.open&&e.iconOpen]}})({}),gct=be("input",{shouldForwardProp:t=>o4(t)&&t!=="classes",name:"MuiSelect",slot:"NativeInput",overridesResolver:(t,e)=>e.nativeInput})({bottom:0,left:0,position:"absolute",opacity:0,pointerEvents:"none",width:"100%",boxSizing:"border-box"});function Tde(t,e){return typeof e=="object"&&e!==null?t===e:String(t)===String(e)}function mct(t){return t==null||typeof t=="string"&&!t.trim()}const vct=t=>{const{classes:e,variant:n,disabled:r,multiple:i,open:o,error:s}=t,a={select:["select",n,r&&"disabled",i&&"multiple",s&&"error"],icon:["icon",`icon${De(n)}`,o&&"iconOpen",r&&"disabled"],nativeInput:["nativeInput"]};return Xe(a,dct,e)},yct=D.forwardRef(function(e,n){var Pe;const{"aria-describedby":r,"aria-label":i,autoFocus:o,autoWidth:s,children:a,className:l,defaultOpen:c,defaultValue:u,disabled:f,displayEmpty:d,error:h=!1,IconComponent:p,inputRef:g,labelId:m,MenuProps:v={},multiple:y,name:x,onBlur:b,onChange:w,onClose:_,onFocus:S,onOpen:O,open:k,readOnly:E,renderValue:M,SelectDisplayProps:A={},tabIndex:P,type:T,value:R,variant:I="standard",...B}=e,[$,z]=wc({controlled:R,default:u,name:"Select"}),[L,j]=wc({controlled:k,default:c,name:"Select"}),N=D.useRef(null),F=D.useRef(null),[H,q]=D.useState(null),{current:Y}=D.useRef(k!=null),[le,K]=D.useState(),ee=dn(n,g),re=D.useCallback(Me=>{F.current=Me,Me&&q(Me)},[]),me=H==null?void 0:H.parentNode;D.useImperativeHandle(ee,()=>({focus:()=>{F.current.focus()},node:N.current,value:$}),[$]),D.useEffect(()=>{c&&L&&H&&!Y&&(K(s?null:me.clientWidth),F.current.focus())},[H,s]),D.useEffect(()=>{o&&F.current.focus()},[o]),D.useEffect(()=>{if(!m)return;const Me=mi(F.current).getElementById(m);if(Me){const Te=()=>{getSelection().isCollapsed&&F.current.focus()};return Me.addEventListener("click",Te),()=>{Me.removeEventListener("click",Te)}}},[m]);const te=(Me,Te)=>{Me?O&&O(Te):_&&_(Te),Y||(K(s?null:me.clientWidth),j(Me))},ae=Me=>{Me.button===0&&(Me.preventDefault(),F.current.focus(),te(!0,Me))},U=Me=>{te(!1,Me)},oe=D.Children.toArray(a),ne=Me=>{const Te=oe.find(Le=>Le.props.value===Me.target.value);Te!==void 0&&(z(Te.props.value),w&&w(Me,Te))},V=Me=>Te=>{let Le;if(Te.currentTarget.hasAttribute("tabindex")){if(y){Le=Array.isArray($)?$.slice():[];const ue=$.indexOf(Me.props.value);ue===-1?Le.push(Me.props.value):Le.splice(ue,1)}else Le=Me.props.value;if(Me.props.onClick&&Me.props.onClick(Te),$!==Le&&(z(Le),w)){const ue=Te.nativeEvent||Te,$e=new ue.constructor(ue.type,ue);Object.defineProperty($e,"target",{writable:!0,value:{value:Le,name:x}}),w($e,Me)}y||te(!1,Te)}},X=Me=>{E||[" ","ArrowUp","ArrowDown","Enter"].includes(Me.key)&&(Me.preventDefault(),te(!0,Me))},Z=H!==null&&L,he=Me=>{!Z&&b&&(Object.defineProperty(Me,"target",{writable:!0,value:{value:$,name:x}}),b(Me))};delete B["aria-invalid"];let xe,G;const W=[];let J=!1;(FF({value:$})||d)&&(M?xe=M($):J=!0);const se=oe.map(Me=>{if(!D.isValidElement(Me))return null;let Te;if(y){if(!Array.isArray($))throw new Error(kg(2));Te=$.some(Le=>Tde(Le,Me.props.value)),Te&&J&&W.push(Me.props.children)}else Te=Tde($,Me.props.value),Te&&J&&(G=Me.props.children);return D.cloneElement(Me,{"aria-selected":Te?"true":"false",onClick:V(Me),onKeyUp:Le=>{Le.key===" "&&Le.preventDefault(),Me.props.onKeyUp&&Me.props.onKeyUp(Le)},role:"option",selected:Te,value:void 0,"data-value":Me.props.value})});J&&(y?W.length===0?xe=null:xe=W.reduce((Me,Te,Le)=>(Me.push(Te),Le{const{classes:e}=t;return e},Aee={name:"MuiSelect",overridesResolver:(t,e)=>e.root,shouldForwardProp:t=>qo(t)&&t!=="variant",slot:"Root"},bct=be(Rg,Aee)(""),wct=be(BF,Aee)(""),_ct=be(jF,Aee)(""),Hg=D.forwardRef(function(e,n){const r=An({name:"MuiSelect",props:e}),{autoWidth:i=!1,children:o,classes:s={},className:a,defaultOpen:l=!1,displayEmpty:c=!1,IconComponent:u=not,id:f,input:d,inputProps:h,label:p,labelId:g,MenuProps:m,multiple:v=!1,native:y=!1,onClose:x,onOpen:b,open:w,renderValue:_,SelectDisplayProps:S,variant:O="outlined",...k}=r,E=y?Hlt:yct,M=za(),A=Dy({props:r,muiFormControl:M,states:["variant","error"]}),P=A.variant||O,T={...r,variant:P,classes:s},R=xct(T),{root:I,...B}=R,$=d||{standard:C.jsx(bct,{ownerState:T}),outlined:C.jsx(wct,{label:p,ownerState:T}),filled:C.jsx(_ct,{ownerState:T})}[P],z=dn(n,My($));return C.jsx(D.Fragment,{children:D.cloneElement($,{inputComponent:E,inputProps:{children:o,error:A.error,IconComponent:u,variant:P,type:void 0,multiple:v,...y?{id:f}:{autoWidth:i,defaultOpen:l,displayEmpty:c,labelId:g,MenuProps:m,onClose:x,onOpen:b,open:w,renderValue:_,SelectDisplayProps:{id:f,...S}},...h,classes:h?Bo(B,h.classes):B,...d?d.props.inputProps:{}},...(v&&y||c)&&P==="outlined"?{notched:!0}:{},ref:z,className:Oe($.props.className,a,R.root),...!d&&{variant:P},...k})})});Hg.muiName="Select";function Sct(t,e,n=(r,i)=>r===i){return t.length===e.length&&t.every((r,i)=>n(r,e[i]))}const Cct=2;function ZAe(t,e){return t-e}function kde(t,e){const{index:n}=t.reduce((r,i,o)=>{const s=Math.abs(e-i);return r===null||s({left:`${t}%`}),leap:t=>({width:`${t}%`})},"horizontal-reverse":{offset:t=>({right:`${t}%`}),leap:t=>({width:`${t}%`})},vertical:{offset:t=>({bottom:`${t}%`}),leap:t=>({height:`${t}%`})}},Act=t=>t;let oI;function Pde(){return oI===void 0&&(typeof CSS<"u"&&typeof CSS.supports=="function"?oI=CSS.supports("touch-action","none"):oI=!0),oI}function Pct(t){const{"aria-labelledby":e,defaultValue:n,disabled:r=!1,disableSwap:i=!1,isRtl:o=!1,marks:s=!1,max:a=100,min:l=0,name:c,onChange:u,onChangeCommitted:f,orientation:d="horizontal",rootRef:h,scale:p=Act,step:g=1,shiftStep:m=10,tabIndex:v,value:y}=t,x=D.useRef(void 0),[b,w]=D.useState(-1),[_,S]=D.useState(-1),[O,k]=D.useState(!1),E=D.useRef(0),[M,A]=wc({controlled:y,default:n??l,name:"Slider"}),P=u&&((W,J,se)=>{const ye=W.nativeEvent||W,ie=new ye.constructor(ye.type,ye);Object.defineProperty(ie,"target",{writable:!0,value:{value:J,name:c}}),u(ie,J,se)}),T=Array.isArray(M);let R=T?M.slice().sort(ZAe):[M];R=R.map(W=>W==null?l:Pw(W,l,a));const I=s===!0&&g!==null?[...Array(Math.floor((a-l)/g)+1)].map((W,J)=>({value:l+g*J})):s||[],B=I.map(W=>W.value),[$,z]=D.useState(-1),L=D.useRef(null),j=dn(h,L),N=W=>J=>{var ye;const se=Number(J.currentTarget.getAttribute("data-index"));Zv(J.target)&&z(se),S(se),(ye=W==null?void 0:W.onFocus)==null||ye.call(W,J)},F=W=>J=>{var se;Zv(J.target)||z(-1),S(-1),(se=W==null?void 0:W.onBlur)==null||se.call(W,J)},H=(W,J)=>{const se=Number(W.currentTarget.getAttribute("data-index")),ye=R[se],ie=B.indexOf(ye);let fe=J;if(I&&g==null){const Q=B[B.length-1];fe>Q?fe=Q:feJ=>{var se;if(g!==null){const ye=Number(J.currentTarget.getAttribute("data-index")),ie=R[ye];let fe=null;(J.key==="ArrowLeft"||J.key==="ArrowDown")&&J.shiftKey||J.key==="PageDown"?fe=Math.max(ie-m,l):((J.key==="ArrowRight"||J.key==="ArrowUp")&&J.shiftKey||J.key==="PageUp")&&(fe=Math.min(ie+m,a)),fe!==null&&(H(J,fe),J.preventDefault())}(se=W==null?void 0:W.onKeyDown)==null||se.call(W,J)};Ei(()=>{var W;r&&L.current.contains(document.activeElement)&&((W=document.activeElement)==null||W.blur())},[r]),r&&b!==-1&&w(-1),r&&$!==-1&&z(-1);const Y=W=>J=>{var se;(se=W.onChange)==null||se.call(W,J),H(J,J.target.valueAsNumber)},le=D.useRef(void 0);let K=d;o&&d==="horizontal"&&(K+="-reverse");const ee=({finger:W,move:J=!1})=>{const{current:se}=L,{width:ye,height:ie,bottom:fe,left:Q}=se.getBoundingClientRect();let _e;K.startsWith("vertical")?_e=(fe-W.y)/ie:_e=(W.x-Q)/ye,K.includes("-reverse")&&(_e=1-_e);let we;if(we=Oct(_e,l,a),g)we=Tct(we,g,l);else{const Pe=kde(B,we);we=B[Pe]}we=Pw(we,l,a);let Ie=0;if(T){J?Ie=le.current:Ie=kde(R,we),i&&(we=Pw(we,R[Ie-1]||-1/0,R[Ie+1]||1/0));const Pe=we;we=Ade({values:R,newValue:we,index:Ie}),i&&J||(Ie=we.indexOf(Pe),le.current=Ie)}return{newValue:we,activeIndex:Ie}},re=st(W=>{const J=nI(W,x);if(!J)return;if(E.current+=1,W.type==="mousemove"&&W.buttons===0){me(W);return}const{newValue:se,activeIndex:ye}=ee({finger:J,move:!0});rI({sliderRef:L,activeIndex:ye,setActive:w}),A(se),!O&&E.current>Cct&&k(!0),P&&!iI(se,M)&&P(W,se,ye)}),me=st(W=>{const J=nI(W,x);if(k(!1),!J)return;const{newValue:se}=ee({finger:J,move:!0});w(-1),W.type==="touchend"&&S(-1),f&&f(W,se),x.current=void 0,ae()}),te=st(W=>{if(r)return;Pde()||W.preventDefault();const J=W.changedTouches[0];J!=null&&(x.current=J.identifier);const se=nI(W,x);if(se!==!1){const{newValue:ie,activeIndex:fe}=ee({finger:se});rI({sliderRef:L,activeIndex:fe,setActive:w}),A(ie),P&&!iI(ie,M)&&P(W,ie,fe)}E.current=0;const ye=mi(L.current);ye.addEventListener("touchmove",re,{passive:!0}),ye.addEventListener("touchend",me,{passive:!0})}),ae=D.useCallback(()=>{const W=mi(L.current);W.removeEventListener("mousemove",re),W.removeEventListener("mouseup",me),W.removeEventListener("touchmove",re),W.removeEventListener("touchend",me)},[me,re]);D.useEffect(()=>{const{current:W}=L;return W.addEventListener("touchstart",te,{passive:Pde()}),()=>{W.removeEventListener("touchstart",te),ae()}},[ae,te]),D.useEffect(()=>{r&&ae()},[r,ae]);const U=W=>J=>{var ie;if((ie=W.onMouseDown)==null||ie.call(W,J),r||J.defaultPrevented||J.button!==0)return;J.preventDefault();const se=nI(J,x);if(se!==!1){const{newValue:fe,activeIndex:Q}=ee({finger:se});rI({sliderRef:L,activeIndex:Q,setActive:w}),A(fe),P&&!iI(fe,M)&&P(J,fe,Q)}E.current=0;const ye=mi(L.current);ye.addEventListener("mousemove",re,{passive:!0}),ye.addEventListener("mouseup",me)},oe=UF(T?R[0]:l,l,a),ne=UF(R[R.length-1],l,a)-oe,V=(W={})=>{const J=kx(W),se={onMouseDown:U(J||{})},ye={...J,...se};return{...W,ref:j,...ye}},X=W=>J=>{var ye;(ye=W.onMouseOver)==null||ye.call(W,J);const se=Number(J.currentTarget.getAttribute("data-index"));S(se)},Z=W=>J=>{var se;(se=W.onMouseLeave)==null||se.call(W,J),S(-1)};return{active:b,axis:K,axisProps:kct,dragging:O,focusedThumbIndex:$,getHiddenInputProps:(W={})=>{const J=kx(W),se={onChange:Y(J||{}),onFocus:N(J||{}),onBlur:F(J||{}),onKeyDown:q(J||{})},ye={...J,...se};return{tabIndex:v,"aria-labelledby":e,"aria-orientation":d,"aria-valuemax":p(a),"aria-valuemin":p(l),name:c,type:"range",min:t.min,max:t.max,step:t.step===null&&t.marks?"any":t.step??void 0,disabled:r,...W,...ye,style:{...iAe,direction:o?"rtl":"ltr",width:"100%",height:"100%"}}},getRootProps:V,getThumbProps:(W={})=>{const J=kx(W),se={onMouseOver:X(J||{}),onMouseLeave:Z(J||{})};return{...W,...J,...se}},marks:I,open:_,range:T,rootRef:j,trackLeap:ne,trackOffset:oe,values:R,getThumbStyle:W=>({pointerEvents:b!==-1&&b!==W?"none":void 0})}}const Mct=t=>!t||!rg(t);function Rct(t){return Ye("MuiSlider",t)}const nu=qe("MuiSlider",["root","active","colorPrimary","colorSecondary","colorError","colorInfo","colorSuccess","colorWarning","disabled","dragging","focusVisible","mark","markActive","marked","markLabel","markLabelActive","rail","sizeSmall","thumb","thumbColorPrimary","thumbColorSecondary","thumbColorError","thumbColorSuccess","thumbColorInfo","thumbColorWarning","track","trackInverted","trackFalse","thumbSizeSmall","valueLabel","valueLabelOpen","valueLabelCircle","valueLabelLabel","vertical"]),Dct=t=>{const{open:e}=t;return{offset:Oe(e&&nu.valueLabelOpen),circle:nu.valueLabelCircle,label:nu.valueLabelLabel}};function Ict(t){const{children:e,className:n,value:r}=t,i=Dct(t);return e?D.cloneElement(e,{className:Oe(e.props.className)},C.jsxs(D.Fragment,{children:[e.props.children,C.jsx("span",{className:Oe(i.offset,n),"aria-hidden":!0,children:C.jsx("span",{className:i.circle,children:C.jsx("span",{className:i.label,children:r})})})]})):null}function Mde(t){return t}const Lct=be("span",{name:"MuiSlider",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,e[`color${De(n.color)}`],n.size!=="medium"&&e[`size${De(n.size)}`],n.marked&&e.marked,n.orientation==="vertical"&&e.vertical,n.track==="inverted"&&e.trackInverted,n.track===!1&&e.trackFalse]}})(kt(({theme:t})=>({borderRadius:12,boxSizing:"content-box",display:"inline-block",position:"relative",cursor:"pointer",touchAction:"none",WebkitTapHighlightColor:"transparent","@media print":{colorAdjust:"exact"},[`&.${nu.disabled}`]:{pointerEvents:"none",cursor:"default",color:(t.vars||t).palette.grey[400]},[`&.${nu.dragging}`]:{[`& .${nu.thumb}, & .${nu.track}`]:{transition:"none"}},variants:[...Object.entries(t.palette).filter(di()).map(([e])=>({props:{color:e},style:{color:(t.vars||t).palette[e].main}})),{props:{orientation:"horizontal"},style:{height:4,width:"100%",padding:"13px 0","@media (pointer: coarse)":{padding:"20px 0"}}},{props:{orientation:"horizontal",size:"small"},style:{height:2}},{props:{orientation:"horizontal",marked:!0},style:{marginBottom:20}},{props:{orientation:"vertical"},style:{height:"100%",width:4,padding:"0 13px","@media (pointer: coarse)":{padding:"0 20px"}}},{props:{orientation:"vertical",size:"small"},style:{width:2}},{props:{orientation:"vertical",marked:!0},style:{marginRight:44}}]}))),$ct=be("span",{name:"MuiSlider",slot:"Rail",overridesResolver:(t,e)=>e.rail})({display:"block",position:"absolute",borderRadius:"inherit",backgroundColor:"currentColor",opacity:.38,variants:[{props:{orientation:"horizontal"},style:{width:"100%",height:"inherit",top:"50%",transform:"translateY(-50%)"}},{props:{orientation:"vertical"},style:{height:"100%",width:"inherit",left:"50%",transform:"translateX(-50%)"}},{props:{track:"inverted"},style:{opacity:1}}]}),Fct=be("span",{name:"MuiSlider",slot:"Track",overridesResolver:(t,e)=>e.track})(kt(({theme:t})=>({display:"block",position:"absolute",borderRadius:"inherit",border:"1px solid currentColor",backgroundColor:"currentColor",transition:t.transitions.create(["left","width","bottom","height"],{duration:t.transitions.duration.shortest}),variants:[{props:{size:"small"},style:{border:"none"}},{props:{orientation:"horizontal"},style:{height:"inherit",top:"50%",transform:"translateY(-50%)"}},{props:{orientation:"vertical"},style:{width:"inherit",left:"50%",transform:"translateX(-50%)"}},{props:{track:!1},style:{display:"none"}},...Object.entries(t.palette).filter(di()).map(([e])=>({props:{color:e,track:"inverted"},style:{...t.vars?{backgroundColor:t.vars.palette.Slider[`${e}Track`],borderColor:t.vars.palette.Slider[`${e}Track`]}:{backgroundColor:Pg(t.palette[e].main,.62),borderColor:Pg(t.palette[e].main,.62),...t.applyStyles("dark",{backgroundColor:Ag(t.palette[e].main,.5)}),...t.applyStyles("dark",{borderColor:Ag(t.palette[e].main,.5)})}}}))]}))),Nct=be("span",{name:"MuiSlider",slot:"Thumb",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.thumb,e[`thumbColor${De(n.color)}`],n.size!=="medium"&&e[`thumbSize${De(n.size)}`]]}})(kt(({theme:t})=>({position:"absolute",width:20,height:20,boxSizing:"border-box",borderRadius:"50%",outline:0,backgroundColor:"currentColor",display:"flex",alignItems:"center",justifyContent:"center",transition:t.transitions.create(["box-shadow","left","bottom"],{duration:t.transitions.duration.shortest}),"&::before":{position:"absolute",content:'""',borderRadius:"inherit",width:"100%",height:"100%",boxShadow:(t.vars||t).shadows[2]},"&::after":{position:"absolute",content:'""',borderRadius:"50%",width:42,height:42,top:"50%",left:"50%",transform:"translate(-50%, -50%)"},[`&.${nu.disabled}`]:{"&:hover":{boxShadow:"none"}},variants:[{props:{size:"small"},style:{width:12,height:12,"&::before":{boxShadow:"none"}}},{props:{orientation:"horizontal"},style:{top:"50%",transform:"translate(-50%, -50%)"}},{props:{orientation:"vertical"},style:{left:"50%",transform:"translate(-50%, 50%)"}},...Object.entries(t.palette).filter(di()).map(([e])=>({props:{color:e},style:{[`&:hover, &.${nu.focusVisible}`]:{...t.vars?{boxShadow:`0px 0px 0px 8px rgba(${t.vars.palette[e].mainChannel} / 0.16)`}:{boxShadow:`0px 0px 0px 8px ${Tt(t.palette[e].main,.16)}`},"@media (hover: none)":{boxShadow:"none"}},[`&.${nu.active}`]:{...t.vars?{boxShadow:`0px 0px 0px 14px rgba(${t.vars.palette[e].mainChannel} / 0.16)`}:{boxShadow:`0px 0px 0px 14px ${Tt(t.palette[e].main,.16)}`}}}}))]}))),zct=be(Ict,{name:"MuiSlider",slot:"ValueLabel",overridesResolver:(t,e)=>e.valueLabel})(kt(({theme:t})=>({zIndex:1,whiteSpace:"nowrap",...t.typography.body2,fontWeight:500,transition:t.transitions.create(["transform"],{duration:t.transitions.duration.shortest}),position:"absolute",backgroundColor:(t.vars||t).palette.grey[600],borderRadius:2,color:(t.vars||t).palette.common.white,display:"flex",alignItems:"center",justifyContent:"center",padding:"0.25rem 0.75rem",variants:[{props:{orientation:"horizontal"},style:{transform:"translateY(-100%) scale(0)",top:"-10px",transformOrigin:"bottom center","&::before":{position:"absolute",content:'""',width:8,height:8,transform:"translate(-50%, 50%) rotate(45deg)",backgroundColor:"inherit",bottom:0,left:"50%"},[`&.${nu.valueLabelOpen}`]:{transform:"translateY(-100%) scale(1)"}}},{props:{orientation:"vertical"},style:{transform:"translateY(-50%) scale(0)",right:"30px",top:"50%",transformOrigin:"right center","&::before":{position:"absolute",content:'""',width:8,height:8,transform:"translate(-50%, -50%) rotate(45deg)",backgroundColor:"inherit",right:-8,top:"50%"},[`&.${nu.valueLabelOpen}`]:{transform:"translateY(-50%) scale(1)"}}},{props:{size:"small"},style:{fontSize:t.typography.pxToRem(12),padding:"0.25rem 0.5rem"}},{props:{orientation:"vertical",size:"small"},style:{right:"20px"}}]}))),jct=be("span",{name:"MuiSlider",slot:"Mark",shouldForwardProp:t=>o4(t)&&t!=="markActive",overridesResolver:(t,e)=>{const{markActive:n}=t;return[e.mark,n&&e.markActive]}})(kt(({theme:t})=>({position:"absolute",width:2,height:2,borderRadius:1,backgroundColor:"currentColor",variants:[{props:{orientation:"horizontal"},style:{top:"50%",transform:"translate(-1px, -50%)"}},{props:{orientation:"vertical"},style:{left:"50%",transform:"translate(-50%, 1px)"}},{props:{markActive:!0},style:{backgroundColor:(t.vars||t).palette.background.paper,opacity:.8}}]}))),Bct=be("span",{name:"MuiSlider",slot:"MarkLabel",shouldForwardProp:t=>o4(t)&&t!=="markLabelActive",overridesResolver:(t,e)=>e.markLabel})(kt(({theme:t})=>({...t.typography.body2,color:(t.vars||t).palette.text.secondary,position:"absolute",whiteSpace:"nowrap",variants:[{props:{orientation:"horizontal"},style:{top:30,transform:"translateX(-50%)","@media (pointer: coarse)":{top:40}}},{props:{orientation:"vertical"},style:{left:36,transform:"translateY(50%)","@media (pointer: coarse)":{left:44}}},{props:{markLabelActive:!0},style:{color:(t.vars||t).palette.text.primary}}]}))),Uct=t=>{const{disabled:e,dragging:n,marked:r,orientation:i,track:o,classes:s,color:a,size:l}=t,c={root:["root",e&&"disabled",n&&"dragging",r&&"marked",i==="vertical"&&"vertical",o==="inverted"&&"trackInverted",o===!1&&"trackFalse",a&&`color${De(a)}`,l&&`size${De(l)}`],rail:["rail"],track:["track"],mark:["mark"],markActive:["markActive"],markLabel:["markLabel"],markLabelActive:["markLabelActive"],valueLabel:["valueLabel"],thumb:["thumb",e&&"disabled",l&&`thumbSize${De(l)}`,a&&`thumbColor${De(a)}`],active:["active"],disabled:["disabled"],focusVisible:["focusVisible"]};return Xe(c,Rct,s)},Wct=({children:t})=>t,QC=D.forwardRef(function(e,n){const r=wt({props:e,name:"MuiSlider"}),i=Ho(),{"aria-label":o,"aria-valuetext":s,"aria-labelledby":a,component:l="span",components:c={},componentsProps:u={},color:f="primary",classes:d,className:h,disableSwap:p=!1,disabled:g=!1,getAriaLabel:m,getAriaValueText:v,marks:y=!1,max:x=100,min:b=0,name:w,onChange:_,onChangeCommitted:S,orientation:O="horizontal",shiftStep:k=10,size:E="medium",step:M=1,scale:A=Mde,slotProps:P,slots:T,tabIndex:R,track:I="normal",value:B,valueLabelDisplay:$="off",valueLabelFormat:z=Mde,...L}=r,j={...r,isRtl:i,max:x,min:b,classes:d,disabled:g,disableSwap:p,orientation:O,marks:y,color:f,size:E,step:M,shiftStep:k,scale:A,track:I,valueLabelDisplay:$,valueLabelFormat:z},{axisProps:N,getRootProps:F,getHiddenInputProps:H,getThumbProps:q,open:Y,active:le,axis:K,focusedThumbIndex:ee,range:re,dragging:me,marks:te,values:ae,trackOffset:U,trackLeap:oe,getThumbStyle:ne}=Pct({...j,rootRef:n});j.marked=te.length>0&&te.some(ut=>ut.label),j.dragging=me,j.focusedThumbIndex=ee;const V=Uct(j),X=(T==null?void 0:T.root)??c.Root??Lct,Z=(T==null?void 0:T.rail)??c.Rail??$ct,he=(T==null?void 0:T.track)??c.Track??Fct,xe=(T==null?void 0:T.thumb)??c.Thumb??Nct,G=(T==null?void 0:T.valueLabel)??c.ValueLabel??zct,W=(T==null?void 0:T.mark)??c.Mark??jct,J=(T==null?void 0:T.markLabel)??c.MarkLabel??Bct,se=(T==null?void 0:T.input)??c.Input??"input",ye=(P==null?void 0:P.root)??u.root,ie=(P==null?void 0:P.rail)??u.rail,fe=(P==null?void 0:P.track)??u.track,Q=(P==null?void 0:P.thumb)??u.thumb,_e=(P==null?void 0:P.valueLabel)??u.valueLabel,we=(P==null?void 0:P.mark)??u.mark,Ie=(P==null?void 0:P.markLabel)??u.markLabel,Pe=(P==null?void 0:P.input)??u.input,Me=Zt({elementType:X,getSlotProps:F,externalSlotProps:ye,externalForwardedProps:L,additionalProps:{...Mct(X)&&{as:l}},ownerState:{...j,...ye==null?void 0:ye.ownerState},className:[V.root,h]}),Te=Zt({elementType:Z,externalSlotProps:ie,ownerState:j,className:V.rail}),Le=Zt({elementType:he,externalSlotProps:fe,additionalProps:{style:{...N[K].offset(U),...N[K].leap(oe)}},ownerState:{...j,...fe==null?void 0:fe.ownerState},className:V.track}),ue=Zt({elementType:xe,getSlotProps:q,externalSlotProps:Q,ownerState:{...j,...Q==null?void 0:Q.ownerState},className:V.thumb}),$e=Zt({elementType:G,externalSlotProps:_e,ownerState:{...j,..._e==null?void 0:_e.ownerState},className:V.valueLabel}),Se=Zt({elementType:W,externalSlotProps:we,ownerState:j,className:V.mark}),He=Zt({elementType:J,externalSlotProps:Ie,ownerState:j,className:V.markLabel}),tt=Zt({elementType:se,getSlotProps:H,externalSlotProps:Pe,ownerState:j});return C.jsxs(X,{...Me,children:[C.jsx(Z,{...Te}),C.jsx(he,{...Le}),te.filter(ut=>ut.value>=b&&ut.value<=x).map((ut,qt)=>{const Dn=UF(ut.value,b,x),Ji=N[K].offset(Dn);let yn;return I===!1?yn=ae.includes(ut.value):yn=I==="normal"&&(re?ut.value>=ae[0]&&ut.value<=ae[ae.length-1]:ut.value<=ae[0])||I==="inverted"&&(re?ut.value<=ae[0]||ut.value>=ae[ae.length-1]:ut.value>=ae[0]),C.jsxs(D.Fragment,{children:[C.jsx(W,{"data-index":qt,...Se,...!rg(W)&&{markActive:yn},style:{...Ji,...Se.style},className:Oe(Se.className,yn&&V.markActive)}),ut.label!=null?C.jsx(J,{"aria-hidden":!0,"data-index":qt,...He,...!rg(J)&&{markLabelActive:yn},style:{...Ji,...He.style},className:Oe(V.markLabel,He.className,yn&&V.markLabelActive),children:ut.label}):null]},qt)}),ae.map((ut,qt)=>{const Dn=UF(ut,b,x),Ji=N[K].offset(Dn),yn=$==="off"?Wct:G;return C.jsx(yn,{...!rg(yn)&&{valueLabelFormat:z,valueLabelDisplay:$,value:typeof z=="function"?z(A(ut),qt):z,index:qt,open:Y===qt||le===qt||$==="on",disabled:g},...$e,children:C.jsx(xe,{"data-index":qt,...ue,className:Oe(V.thumb,ue.className,le===qt&&V.active,ee===qt&&V.focusVisible),style:{...Ji,...ne(qt),...ue.style},children:C.jsx(se,{"data-index":qt,"aria-label":m?m(qt):o,"aria-valuenow":A(ut),"aria-labelledby":a,"aria-valuetext":v?v(A(ut),qt):s,value:ae[qt],...tt})})},qt)})]})});function Vct(t={}){const{autoHideDuration:e=null,disableWindowBlurListener:n=!1,onClose:r,open:i,resumeHideDuration:o}=t,s=cv();D.useEffect(()=>{if(!i)return;function v(y){y.defaultPrevented||y.key==="Escape"&&(r==null||r(y,"escapeKeyDown"))}return document.addEventListener("keydown",v),()=>{document.removeEventListener("keydown",v)}},[i,r]);const a=st((v,y)=>{r==null||r(v,y)}),l=st(v=>{!r||v==null||s.start(v,()=>{a(null,"timeout")})});D.useEffect(()=>(i&&l(e),s.clear),[i,e,l,s]);const c=v=>{r==null||r(v,"clickaway")},u=s.clear,f=D.useCallback(()=>{e!=null&&l(o??e*.5)},[e,o,l]),d=v=>y=>{const x=v.onBlur;x==null||x(y),f()},h=v=>y=>{const x=v.onFocus;x==null||x(y),u()},p=v=>y=>{const x=v.onMouseEnter;x==null||x(y),u()},g=v=>y=>{const x=v.onMouseLeave;x==null||x(y),f()};return D.useEffect(()=>{if(!n&&i)return window.addEventListener("focus",f),window.addEventListener("blur",u),()=>{window.removeEventListener("focus",f),window.removeEventListener("blur",u)}},[n,i,f,u]),{getRootProps:(v={})=>{const y={...kx(t),...kx(v)};return{role:"presentation",...v,...y,onBlur:d(y),onFocus:h(y),onMouseEnter:p(y),onMouseLeave:g(y)}},onClickAway:c}}function Gct(t){return Ye("MuiSnackbarContent",t)}qe("MuiSnackbarContent",["root","message","action"]);const Hct=t=>{const{classes:e}=t;return Xe({root:["root"],action:["action"],message:["message"]},Gct,e)},qct=be(Al,{name:"MuiSnackbarContent",slot:"Root",overridesResolver:(t,e)=>e.root})(kt(({theme:t})=>{const e=t.palette.mode==="light"?.8:.98,n=eAe(t.palette.background.default,e);return{...t.typography.body2,color:t.vars?t.vars.palette.SnackbarContent.color:t.palette.getContrastText(n),backgroundColor:t.vars?t.vars.palette.SnackbarContent.bg:n,display:"flex",alignItems:"center",flexWrap:"wrap",padding:"6px 16px",borderRadius:(t.vars||t).shape.borderRadius,flexGrow:1,[t.breakpoints.up("sm")]:{flexGrow:"initial",minWidth:288}}})),Xct=be("div",{name:"MuiSnackbarContent",slot:"Message",overridesResolver:(t,e)=>e.message})({padding:"8px 0"}),Yct=be("div",{name:"MuiSnackbarContent",slot:"Action",overridesResolver:(t,e)=>e.action})({display:"flex",alignItems:"center",marginLeft:"auto",paddingLeft:16,marginRight:-8}),JAe=D.forwardRef(function(e,n){const r=wt({props:e,name:"MuiSnackbarContent"}),{action:i,className:o,message:s,role:a="alert",...l}=r,c=r,u=Hct(c);return C.jsxs(qct,{role:a,square:!0,elevation:6,className:Oe(u.root,o),ownerState:c,ref:n,...l,children:[C.jsx(Xct,{className:u.message,ownerState:c,children:s}),i?C.jsx(Yct,{className:u.action,ownerState:c,children:i}):null]})});function Qct(t){return Ye("MuiSnackbar",t)}qe("MuiSnackbar",["root","anchorOriginTopCenter","anchorOriginBottomCenter","anchorOriginTopRight","anchorOriginBottomRight","anchorOriginTopLeft","anchorOriginBottomLeft"]);const Kct=t=>{const{classes:e,anchorOrigin:n}=t,r={root:["root",`anchorOrigin${De(n.vertical)}${De(n.horizontal)}`]};return Xe(r,Qct,e)},Rde=be("div",{name:"MuiSnackbar",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,e[`anchorOrigin${De(n.anchorOrigin.vertical)}${De(n.anchorOrigin.horizontal)}`]]}})(kt(({theme:t})=>({zIndex:(t.vars||t).zIndex.snackbar,position:"fixed",display:"flex",left:8,right:8,justifyContent:"center",alignItems:"center",variants:[{props:({ownerState:e})=>e.anchorOrigin.vertical==="top",style:{top:8,[t.breakpoints.up("sm")]:{top:24}}},{props:({ownerState:e})=>e.anchorOrigin.vertical!=="top",style:{bottom:8,[t.breakpoints.up("sm")]:{bottom:24}}},{props:({ownerState:e})=>e.anchorOrigin.horizontal==="left",style:{justifyContent:"flex-start",[t.breakpoints.up("sm")]:{left:24,right:"auto"}}},{props:({ownerState:e})=>e.anchorOrigin.horizontal==="right",style:{justifyContent:"flex-end",[t.breakpoints.up("sm")]:{right:24,left:"auto"}}},{props:({ownerState:e})=>e.anchorOrigin.horizontal==="center",style:{[t.breakpoints.up("sm")]:{left:"50%",right:"auto",transform:"translateX(-50%)"}}}]}))),Zct=D.forwardRef(function(e,n){const r=wt({props:e,name:"MuiSnackbar"}),i=Na(),o={enter:i.transitions.duration.enteringScreen,exit:i.transitions.duration.leavingScreen},{action:s,anchorOrigin:{vertical:a,horizontal:l}={vertical:"bottom",horizontal:"left"},autoHideDuration:c=null,children:u,className:f,ClickAwayListenerProps:d,ContentProps:h,disableWindowBlurListener:p=!1,message:g,onBlur:m,onClose:v,onFocus:y,onMouseEnter:x,onMouseLeave:b,open:w,resumeHideDuration:_,TransitionComponent:S=n1,transitionDuration:O=o,TransitionProps:{onEnter:k,onExited:E,...M}={},...A}=r,P={...r,anchorOrigin:{vertical:a,horizontal:l},autoHideDuration:c,disableWindowBlurListener:p,TransitionComponent:S,transitionDuration:O},T=Kct(P),{getRootProps:R,onClickAway:I}=Vct({...P}),[B,$]=D.useState(!0),z=Zt({elementType:Rde,getSlotProps:R,externalForwardedProps:A,ownerState:P,additionalProps:{ref:n},className:[T.root,f]}),L=N=>{$(!0),E&&E(N)},j=(N,F)=>{$(!1),k&&k(N,F)};return!w&&B?null:C.jsx(hst,{onClickAway:I,...d,children:C.jsx(Rde,{...z,children:C.jsx(S,{appear:!0,in:w,timeout:O,direction:a==="top"?"down":"up",onEnter:j,onExited:L,...M,children:u||C.jsx(JAe,{message:g,action:s,...h})})})})});function Jct(t){return Ye("MuiTooltip",t)}const Mi=qe("MuiTooltip",["popper","popperInteractive","popperArrow","popperClose","tooltip","tooltipArrow","touch","tooltipPlacementLeft","tooltipPlacementRight","tooltipPlacementTop","tooltipPlacementBottom","arrow"]);function eut(t){return Math.round(t*1e5)/1e5}const tut=t=>{const{classes:e,disableInteractive:n,arrow:r,touch:i,placement:o}=t,s={popper:["popper",!n&&"popperInteractive",r&&"popperArrow"],tooltip:["tooltip",r&&"tooltipArrow",i&&"touch",`tooltipPlacement${De(o.split("-")[0])}`],arrow:["arrow"]};return Xe(s,Jct,e)},nut=be(See,{name:"MuiTooltip",slot:"Popper",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.popper,!n.disableInteractive&&e.popperInteractive,n.arrow&&e.popperArrow,!n.open&&e.popperClose]}})(kt(({theme:t})=>({zIndex:(t.vars||t).zIndex.tooltip,pointerEvents:"none",variants:[{props:({ownerState:e})=>!e.disableInteractive,style:{pointerEvents:"auto"}},{props:({open:e})=>!e,style:{pointerEvents:"none"}},{props:({ownerState:e})=>e.arrow,style:{[`&[data-popper-placement*="bottom"] .${Mi.arrow}`]:{top:0,marginTop:"-0.71em","&::before":{transformOrigin:"0 100%"}},[`&[data-popper-placement*="top"] .${Mi.arrow}`]:{bottom:0,marginBottom:"-0.71em","&::before":{transformOrigin:"100% 0"}},[`&[data-popper-placement*="right"] .${Mi.arrow}`]:{height:"1em",width:"0.71em","&::before":{transformOrigin:"100% 100%"}},[`&[data-popper-placement*="left"] .${Mi.arrow}`]:{height:"1em",width:"0.71em","&::before":{transformOrigin:"0 0"}}}},{props:({ownerState:e})=>e.arrow&&!e.isRtl,style:{[`&[data-popper-placement*="right"] .${Mi.arrow}`]:{left:0,marginLeft:"-0.71em"}}},{props:({ownerState:e})=>e.arrow&&!!e.isRtl,style:{[`&[data-popper-placement*="right"] .${Mi.arrow}`]:{right:0,marginRight:"-0.71em"}}},{props:({ownerState:e})=>e.arrow&&!e.isRtl,style:{[`&[data-popper-placement*="left"] .${Mi.arrow}`]:{right:0,marginRight:"-0.71em"}}},{props:({ownerState:e})=>e.arrow&&!!e.isRtl,style:{[`&[data-popper-placement*="left"] .${Mi.arrow}`]:{left:0,marginLeft:"-0.71em"}}}]}))),rut=be("div",{name:"MuiTooltip",slot:"Tooltip",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.tooltip,n.touch&&e.touch,n.arrow&&e.tooltipArrow,e[`tooltipPlacement${De(n.placement.split("-")[0])}`]]}})(kt(({theme:t})=>({backgroundColor:t.vars?t.vars.palette.Tooltip.bg:Tt(t.palette.grey[700],.92),borderRadius:(t.vars||t).shape.borderRadius,color:(t.vars||t).palette.common.white,fontFamily:t.typography.fontFamily,padding:"4px 8px",fontSize:t.typography.pxToRem(11),maxWidth:300,margin:2,wordWrap:"break-word",fontWeight:t.typography.fontWeightMedium,[`.${Mi.popper}[data-popper-placement*="left"] &`]:{transformOrigin:"right center"},[`.${Mi.popper}[data-popper-placement*="right"] &`]:{transformOrigin:"left center"},[`.${Mi.popper}[data-popper-placement*="top"] &`]:{transformOrigin:"center bottom",marginBottom:"14px"},[`.${Mi.popper}[data-popper-placement*="bottom"] &`]:{transformOrigin:"center top",marginTop:"14px"},variants:[{props:({ownerState:e})=>e.arrow,style:{position:"relative",margin:0}},{props:({ownerState:e})=>e.touch,style:{padding:"8px 16px",fontSize:t.typography.pxToRem(14),lineHeight:`${eut(16/14)}em`,fontWeight:t.typography.fontWeightRegular}},{props:({ownerState:e})=>!e.isRtl,style:{[`.${Mi.popper}[data-popper-placement*="left"] &`]:{marginRight:"14px"},[`.${Mi.popper}[data-popper-placement*="right"] &`]:{marginLeft:"14px"}}},{props:({ownerState:e})=>!e.isRtl&&e.touch,style:{[`.${Mi.popper}[data-popper-placement*="left"] &`]:{marginRight:"24px"},[`.${Mi.popper}[data-popper-placement*="right"] &`]:{marginLeft:"24px"}}},{props:({ownerState:e})=>!!e.isRtl,style:{[`.${Mi.popper}[data-popper-placement*="left"] &`]:{marginLeft:"14px"},[`.${Mi.popper}[data-popper-placement*="right"] &`]:{marginRight:"14px"}}},{props:({ownerState:e})=>!!e.isRtl&&e.touch,style:{[`.${Mi.popper}[data-popper-placement*="left"] &`]:{marginLeft:"24px"},[`.${Mi.popper}[data-popper-placement*="right"] &`]:{marginRight:"24px"}}},{props:({ownerState:e})=>e.touch,style:{[`.${Mi.popper}[data-popper-placement*="top"] &`]:{marginBottom:"24px"}}},{props:({ownerState:e})=>e.touch,style:{[`.${Mi.popper}[data-popper-placement*="bottom"] &`]:{marginTop:"24px"}}}]}))),iut=be("span",{name:"MuiTooltip",slot:"Arrow",overridesResolver:(t,e)=>e.arrow})(kt(({theme:t})=>({overflow:"hidden",position:"absolute",width:"1em",height:"0.71em",boxSizing:"border-box",color:t.vars?t.vars.palette.Tooltip.bg:Tt(t.palette.grey[700],.9),"&::before":{content:'""',margin:"auto",display:"block",width:"100%",height:"100%",backgroundColor:"currentColor",transform:"rotate(45deg)"}})));let sI=!1;const Dde=new t4;let IE={x:0,y:0};function aI(t,e){return(n,...r)=>{e&&e(n,...r),t(n,...r)}}const Rt=D.forwardRef(function(e,n){var Dn,Ji,yn;const r=wt({props:e,name:"MuiTooltip"}),{arrow:i=!1,children:o,classes:s,components:a={},componentsProps:l={},describeChild:c=!1,disableFocusListener:u=!1,disableHoverListener:f=!1,disableInteractive:d=!1,disableTouchListener:h=!1,enterDelay:p=100,enterNextDelay:g=0,enterTouchDelay:m=700,followCursor:v=!1,id:y,leaveDelay:x=0,leaveTouchDelay:b=1500,onClose:w,onOpen:_,open:S,placement:O="bottom",PopperComponent:k,PopperProps:E={},slotProps:M={},slots:A={},title:P,TransitionComponent:T=n1,TransitionProps:R,...I}=r,B=D.isValidElement(o)?o:C.jsx("span",{children:o}),$=Na(),z=Ho(),[L,j]=D.useState(),[N,F]=D.useState(null),H=D.useRef(!1),q=d||v,Y=cv(),le=cv(),K=cv(),ee=cv(),[re,me]=wc({controlled:S,default:!1,name:"Tooltip",state:"open"});let te=re;const ae=Jf(y),U=D.useRef(),oe=st(()=>{U.current!==void 0&&(document.body.style.WebkitUserSelect=U.current,U.current=void 0),ee.clear()});D.useEffect(()=>oe,[oe]);const ne=Gt=>{Dde.clear(),sI=!0,me(!0),_&&!te&&_(Gt)},V=st(Gt=>{Dde.start(800+x,()=>{sI=!1}),me(!1),w&&te&&w(Gt),Y.start($.transitions.duration.shortest,()=>{H.current=!1})}),X=Gt=>{H.current&&Gt.type!=="touchstart"||(L&&L.removeAttribute("title"),le.clear(),K.clear(),p||sI&&g?le.start(sI?g:p,()=>{ne(Gt)}):ne(Gt))},Z=Gt=>{le.clear(),K.start(x,()=>{V(Gt)})},[,he]=D.useState(!1),xe=Gt=>{Zv(Gt.target)||(he(!1),Z(Gt))},G=Gt=>{L||j(Gt.currentTarget),Zv(Gt.target)&&(he(!0),X(Gt))},W=Gt=>{H.current=!0;const fr=B.props;fr.onTouchStart&&fr.onTouchStart(Gt)},J=Gt=>{W(Gt),K.clear(),Y.clear(),oe(),U.current=document.body.style.WebkitUserSelect,document.body.style.WebkitUserSelect="none",ee.start(m,()=>{document.body.style.WebkitUserSelect=U.current,X(Gt)})},se=Gt=>{B.props.onTouchEnd&&B.props.onTouchEnd(Gt),oe(),K.start(b,()=>{V(Gt)})};D.useEffect(()=>{if(!te)return;function Gt(fr){fr.key==="Escape"&&V(fr)}return document.addEventListener("keydown",Gt),()=>{document.removeEventListener("keydown",Gt)}},[V,te]);const ye=dn(My(B),j,n);!P&&P!==0&&(te=!1);const ie=D.useRef(),fe=Gt=>{const fr=B.props;fr.onMouseMove&&fr.onMouseMove(Gt),IE={x:Gt.clientX,y:Gt.clientY},ie.current&&ie.current.update()},Q={},_e=typeof P=="string";c?(Q.title=!te&&_e&&!f?P:null,Q["aria-describedby"]=te?ae:null):(Q["aria-label"]=_e?P:null,Q["aria-labelledby"]=te&&!_e?ae:null);const we={...Q,...I,...B.props,className:Oe(I.className,B.props.className),onTouchStart:W,ref:ye,...v?{onMouseMove:fe}:{}},Ie={};h||(we.onTouchStart=J,we.onTouchEnd=se),f||(we.onMouseOver=aI(X,we.onMouseOver),we.onMouseLeave=aI(Z,we.onMouseLeave),q||(Ie.onMouseOver=X,Ie.onMouseLeave=Z)),u||(we.onFocus=aI(G,we.onFocus),we.onBlur=aI(xe,we.onBlur),q||(Ie.onFocus=G,Ie.onBlur=xe));const Pe=D.useMemo(()=>{var fr;let Gt=[{name:"arrow",enabled:!!N,options:{element:N,padding:4}}];return(fr=E.popperOptions)!=null&&fr.modifiers&&(Gt=Gt.concat(E.popperOptions.modifiers)),{...E.popperOptions,modifiers:Gt}},[N,E]),Me={...r,isRtl:z,arrow:i,disableInteractive:q,placement:O,PopperComponentProp:k,touch:H.current},Te=tut(Me),Le=A.popper??a.Popper??nut,ue=A.transition??a.Transition??T??n1,$e=A.tooltip??a.Tooltip??rut,Se=A.arrow??a.Arrow??iut,He=t_(Le,{...E,...M.popper??l.popper,className:Oe(Te.popper,E==null?void 0:E.className,(Dn=M.popper??l.popper)==null?void 0:Dn.className)},Me),tt=t_(ue,{...R,...M.transition??l.transition},Me),ut=t_($e,{...M.tooltip??l.tooltip,className:Oe(Te.tooltip,(Ji=M.tooltip??l.tooltip)==null?void 0:Ji.className)},Me),qt=t_(Se,{...M.arrow??l.arrow,className:Oe(Te.arrow,(yn=M.arrow??l.arrow)==null?void 0:yn.className)},Me);return C.jsxs(D.Fragment,{children:[D.cloneElement(B,we),C.jsx(Le,{as:k??See,placement:O,anchorEl:v?{getBoundingClientRect:()=>({top:IE.y,left:IE.x,right:IE.x,bottom:IE.y,width:0,height:0})}:L,popperRef:ie,open:L?te:!1,id:ae,transition:!0,...Ie,...He,popperOptions:Pe,children:({TransitionProps:Gt})=>C.jsx(ue,{timeout:$.transitions.duration.shorter,...Gt,...tt,children:C.jsxs($e,{...ut,children:[P,i?C.jsx(Se,{...qt,ref:F}):null]})})})]})});function out(t){return Ye("MuiSwitch",t)}const da=qe("MuiSwitch",["root","edgeStart","edgeEnd","switchBase","colorPrimary","colorSecondary","sizeSmall","sizeMedium","checked","disabled","input","thumb","track"]),sut=t=>{const{classes:e,edge:n,size:r,color:i,checked:o,disabled:s}=t,a={root:["root",n&&`edge${De(n)}`,`size${De(r)}`],switchBase:["switchBase",`color${De(i)}`,o&&"checked",s&&"disabled"],thumb:["thumb"],track:["track"],input:["input"]},l=Xe(a,out,e);return{...e,...l}},aut=be("span",{name:"MuiSwitch",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,n.edge&&e[`edge${De(n.edge)}`],e[`size${De(n.size)}`]]}})({display:"inline-flex",width:34+12*2,height:14+12*2,overflow:"hidden",padding:12,boxSizing:"border-box",position:"relative",flexShrink:0,zIndex:0,verticalAlign:"middle","@media print":{colorAdjust:"exact"},variants:[{props:{edge:"start"},style:{marginLeft:-8}},{props:{edge:"end"},style:{marginRight:-8}},{props:{size:"small"},style:{width:40,height:24,padding:7,[`& .${da.thumb}`]:{width:16,height:16},[`& .${da.switchBase}`]:{padding:4,[`&.${da.checked}`]:{transform:"translateX(16px)"}}}}]}),lut=be(Oee,{name:"MuiSwitch",slot:"SwitchBase",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.switchBase,{[`& .${da.input}`]:e.input},n.color!=="default"&&e[`color${De(n.color)}`]]}})(kt(({theme:t})=>({position:"absolute",top:0,left:0,zIndex:1,color:t.vars?t.vars.palette.Switch.defaultColor:`${t.palette.mode==="light"?t.palette.common.white:t.palette.grey[300]}`,transition:t.transitions.create(["left","transform"],{duration:t.transitions.duration.shortest}),[`&.${da.checked}`]:{transform:"translateX(20px)"},[`&.${da.disabled}`]:{color:t.vars?t.vars.palette.Switch.defaultDisabledColor:`${t.palette.mode==="light"?t.palette.grey[100]:t.palette.grey[600]}`},[`&.${da.checked} + .${da.track}`]:{opacity:.5},[`&.${da.disabled} + .${da.track}`]:{opacity:t.vars?t.vars.opacity.switchTrackDisabled:`${t.palette.mode==="light"?.12:.2}`},[`& .${da.input}`]:{left:"-100%",width:"300%"}})),kt(({theme:t})=>({"&:hover":{backgroundColor:t.vars?`rgba(${t.vars.palette.action.activeChannel} / ${t.vars.palette.action.hoverOpacity})`:Tt(t.palette.action.active,t.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}},variants:[...Object.entries(t.palette).filter(di(["light"])).map(([e])=>({props:{color:e},style:{[`&.${da.checked}`]:{color:(t.vars||t).palette[e].main,"&:hover":{backgroundColor:t.vars?`rgba(${t.vars.palette[e].mainChannel} / ${t.vars.palette.action.hoverOpacity})`:Tt(t.palette[e].main,t.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}},[`&.${da.disabled}`]:{color:t.vars?t.vars.palette.Switch[`${e}DisabledColor`]:`${t.palette.mode==="light"?Pg(t.palette[e].main,.62):Ag(t.palette[e].main,.55)}`}},[`&.${da.checked} + .${da.track}`]:{backgroundColor:(t.vars||t).palette[e].main}}}))]}))),cut=be("span",{name:"MuiSwitch",slot:"Track",overridesResolver:(t,e)=>e.track})(kt(({theme:t})=>({height:"100%",width:"100%",borderRadius:14/2,zIndex:-1,transition:t.transitions.create(["opacity","background-color"],{duration:t.transitions.duration.shortest}),backgroundColor:t.vars?t.vars.palette.common.onBackground:`${t.palette.mode==="light"?t.palette.common.black:t.palette.common.white}`,opacity:t.vars?t.vars.opacity.switchTrack:`${t.palette.mode==="light"?.38:.3}`}))),uut=be("span",{name:"MuiSwitch",slot:"Thumb",overridesResolver:(t,e)=>e.thumb})(kt(({theme:t})=>({boxShadow:(t.vars||t).shadows[1],backgroundColor:"currentColor",width:20,height:20,borderRadius:"50%"}))),ePe=D.forwardRef(function(e,n){const r=wt({props:e,name:"MuiSwitch"}),{className:i,color:o="primary",edge:s=!1,size:a="medium",sx:l,...c}=r,u={...r,color:o,edge:s,size:a},f=sut(u),d=C.jsx(uut,{className:f.thumb,ownerState:u});return C.jsxs(aut,{className:Oe(f.root,i),sx:l,ownerState:u,children:[C.jsx(lut,{type:"checkbox",icon:d,checkedIcon:d,ref:n,ownerState:u,...c,classes:{...f,root:f.switchBase}}),C.jsx(cut,{className:f.track,ownerState:u})]})});function fut(t){return Ye("MuiTab",t)}const Lc=qe("MuiTab",["root","labelIcon","textColorInherit","textColorPrimary","textColorSecondary","selected","disabled","fullWidth","wrapped","iconWrapper","icon"]),dut=t=>{const{classes:e,textColor:n,fullWidth:r,wrapped:i,icon:o,label:s,selected:a,disabled:l}=t,c={root:["root",o&&s&&"labelIcon",`textColor${De(n)}`,r&&"fullWidth",i&&"wrapped",a&&"selected",l&&"disabled"],icon:["iconWrapper","icon"]};return Xe(c,fut,e)},hut=be(Nf,{name:"MuiTab",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,n.label&&n.icon&&e.labelIcon,e[`textColor${De(n.textColor)}`],n.fullWidth&&e.fullWidth,n.wrapped&&e.wrapped,{[`& .${Lc.iconWrapper}`]:e.iconWrapper},{[`& .${Lc.icon}`]:e.icon}]}})(kt(({theme:t})=>({...t.typography.button,maxWidth:360,minWidth:90,position:"relative",minHeight:48,flexShrink:0,padding:"12px 16px",overflow:"hidden",whiteSpace:"normal",textAlign:"center",lineHeight:1.25,variants:[{props:({ownerState:e})=>e.label&&(e.iconPosition==="top"||e.iconPosition==="bottom"),style:{flexDirection:"column"}},{props:({ownerState:e})=>e.label&&e.iconPosition!=="top"&&e.iconPosition!=="bottom",style:{flexDirection:"row"}},{props:({ownerState:e})=>e.icon&&e.label,style:{minHeight:72,paddingTop:9,paddingBottom:9}},{props:({ownerState:e,iconPosition:n})=>e.icon&&e.label&&n==="top",style:{[`& > .${Lc.icon}`]:{marginBottom:6}}},{props:({ownerState:e,iconPosition:n})=>e.icon&&e.label&&n==="bottom",style:{[`& > .${Lc.icon}`]:{marginTop:6}}},{props:({ownerState:e,iconPosition:n})=>e.icon&&e.label&&n==="start",style:{[`& > .${Lc.icon}`]:{marginRight:t.spacing(1)}}},{props:({ownerState:e,iconPosition:n})=>e.icon&&e.label&&n==="end",style:{[`& > .${Lc.icon}`]:{marginLeft:t.spacing(1)}}},{props:{textColor:"inherit"},style:{color:"inherit",opacity:.6,[`&.${Lc.selected}`]:{opacity:1},[`&.${Lc.disabled}`]:{opacity:(t.vars||t).palette.action.disabledOpacity}}},{props:{textColor:"primary"},style:{color:(t.vars||t).palette.text.secondary,[`&.${Lc.selected}`]:{color:(t.vars||t).palette.primary.main},[`&.${Lc.disabled}`]:{color:(t.vars||t).palette.text.disabled}}},{props:{textColor:"secondary"},style:{color:(t.vars||t).palette.text.secondary,[`&.${Lc.selected}`]:{color:(t.vars||t).palette.secondary.main},[`&.${Lc.disabled}`]:{color:(t.vars||t).palette.text.disabled}}},{props:({ownerState:e})=>e.fullWidth,style:{flexShrink:1,flexGrow:1,flexBasis:0,maxWidth:"none"}},{props:({ownerState:e})=>e.wrapped,style:{fontSize:t.typography.pxToRem(12)}}]}))),SS=D.forwardRef(function(e,n){const r=wt({props:e,name:"MuiTab"}),{className:i,disabled:o=!1,disableFocusRipple:s=!1,fullWidth:a,icon:l,iconPosition:c="top",indicator:u,label:f,onChange:d,onClick:h,onFocus:p,selected:g,selectionFollowsFocus:m,textColor:v="inherit",value:y,wrapped:x=!1,...b}=r,w={...r,disabled:o,disableFocusRipple:s,selected:g,icon:!!l,iconPosition:c,label:!!f,fullWidth:a,textColor:v,wrapped:x},_=dut(w),S=l&&f&&D.isValidElement(l)?D.cloneElement(l,{className:Oe(_.icon,l.props.className)}):l,O=E=>{!g&&d&&d(E,y),h&&h(E)},k=E=>{m&&!g&&d&&d(E,y),p&&p(E)};return C.jsxs(hut,{focusRipple:!s,className:Oe(_.root,i),ref:n,role:"tab","aria-selected":g,disabled:o,onClick:O,onFocus:k,ownerState:w,tabIndex:g?0:-1,...b,children:[c==="top"||c==="start"?C.jsxs(D.Fragment,{children:[S,f]}):C.jsxs(D.Fragment,{children:[f,S]}),u]})}),tPe=D.createContext();function put(t){return Ye("MuiTable",t)}qe("MuiTable",["root","stickyHeader"]);const gut=t=>{const{classes:e,stickyHeader:n}=t;return Xe({root:["root",n&&"stickyHeader"]},put,e)},mut=be("table",{name:"MuiTable",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,n.stickyHeader&&e.stickyHeader]}})(kt(({theme:t})=>({display:"table",width:"100%",borderCollapse:"collapse",borderSpacing:0,"& caption":{...t.typography.body2,padding:t.spacing(2),color:(t.vars||t).palette.text.secondary,textAlign:"left",captionSide:"bottom"},variants:[{props:({ownerState:e})=>e.stickyHeader,style:{borderCollapse:"separate"}}]}))),Ide="table",Pee=D.forwardRef(function(e,n){const r=wt({props:e,name:"MuiTable"}),{className:i,component:o=Ide,padding:s="normal",size:a="medium",stickyHeader:l=!1,...c}=r,u={...r,component:o,padding:s,size:a,stickyHeader:l},f=gut(u),d=D.useMemo(()=>({padding:s,size:a,stickyHeader:l}),[s,a,l]);return C.jsx(tPe.Provider,{value:d,children:C.jsx(mut,{as:o,role:o===Ide?null:"table",ref:n,className:Oe(f.root,i),ownerState:u,...c})})}),S4=D.createContext();function vut(t){return Ye("MuiTableBody",t)}qe("MuiTableBody",["root"]);const yut=t=>{const{classes:e}=t;return Xe({root:["root"]},vut,e)},xut=be("tbody",{name:"MuiTableBody",slot:"Root",overridesResolver:(t,e)=>e.root})({display:"table-row-group"}),but={variant:"body"},Lde="tbody",Mee=D.forwardRef(function(e,n){const r=wt({props:e,name:"MuiTableBody"}),{className:i,component:o=Lde,...s}=r,a={...r,component:o},l=yut(a);return C.jsx(S4.Provider,{value:but,children:C.jsx(xut,{className:Oe(l.root,i),as:o,ref:n,role:o===Lde?null:"rowgroup",ownerState:a,...s})})});function wut(t){return Ye("MuiTableCell",t)}const _ut=qe("MuiTableCell",["root","head","body","footer","sizeSmall","sizeMedium","paddingCheckbox","paddingNone","alignLeft","alignCenter","alignRight","alignJustify","stickyHeader"]),Sut=t=>{const{classes:e,variant:n,align:r,padding:i,size:o,stickyHeader:s}=t,a={root:["root",n,s&&"stickyHeader",r!=="inherit"&&`align${De(r)}`,i!=="normal"&&`padding${De(i)}`,`size${De(o)}`]};return Xe(a,wut,e)},Cut=be("td",{name:"MuiTableCell",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,e[n.variant],e[`size${De(n.size)}`],n.padding!=="normal"&&e[`padding${De(n.padding)}`],n.align!=="inherit"&&e[`align${De(n.align)}`],n.stickyHeader&&e.stickyHeader]}})(kt(({theme:t})=>({...t.typography.body2,display:"table-cell",verticalAlign:"inherit",borderBottom:t.vars?`1px solid ${t.vars.palette.TableCell.border}`:`1px solid - ${t.palette.mode==="light"?Pg(Tt(t.palette.divider,1),.88):Ag(Tt(t.palette.divider,1),.68)}`,textAlign:"left",padding:16,variants:[{props:{variant:"head"},style:{color:(t.vars||t).palette.text.primary,lineHeight:t.typography.pxToRem(24),fontWeight:t.typography.fontWeightMedium}},{props:{variant:"body"},style:{color:(t.vars||t).palette.text.primary}},{props:{variant:"footer"},style:{color:(t.vars||t).palette.text.secondary,lineHeight:t.typography.pxToRem(21),fontSize:t.typography.pxToRem(12)}},{props:{size:"small"},style:{padding:"6px 16px",[`&.${_ut.paddingCheckbox}`]:{width:24,padding:"0 12px 0 16px","& > *":{padding:0}}}},{props:{padding:"checkbox"},style:{width:48,padding:"0 0 0 4px"}},{props:{padding:"none"},style:{padding:0}},{props:{align:"left"},style:{textAlign:"left"}},{props:{align:"center"},style:{textAlign:"center"}},{props:{align:"right"},style:{textAlign:"right",flexDirection:"row-reverse"}},{props:{align:"justify"},style:{textAlign:"justify"}},{props:({ownerState:e})=>e.stickyHeader,style:{position:"sticky",top:0,zIndex:2,backgroundColor:(t.vars||t).palette.background.default}}]}))),si=D.forwardRef(function(e,n){const r=wt({props:e,name:"MuiTableCell"}),{align:i="inherit",className:o,component:s,padding:a,scope:l,size:c,sortDirection:u,variant:f,...d}=r,h=D.useContext(tPe),p=D.useContext(S4),g=p&&p.variant==="head";let m;s?m=s:m=g?"th":"td";let v=l;m==="td"?v=void 0:!v&&g&&(v="col");const y=f||p&&p.variant,x={...r,align:i,component:m,padding:a||(h&&h.padding?h.padding:"normal"),size:c||(h&&h.size?h.size:"medium"),sortDirection:u,stickyHeader:y==="head"&&h&&h.stickyHeader,variant:y},b=Sut(x);let w=null;return u&&(w=u==="asc"?"ascending":"descending"),C.jsx(Cut,{as:m,ref:n,className:Oe(b.root,o),"aria-sort":w,scope:v,ownerState:x,...d})});function Out(t){return Ye("MuiTableContainer",t)}qe("MuiTableContainer",["root"]);const Eut=t=>{const{classes:e}=t;return Xe({root:["root"]},Out,e)},Tut=be("div",{name:"MuiTableContainer",slot:"Root",overridesResolver:(t,e)=>e.root})({width:"100%",overflowX:"auto"}),nPe=D.forwardRef(function(e,n){const r=wt({props:e,name:"MuiTableContainer"}),{className:i,component:o="div",...s}=r,a={...r,component:o},l=Eut(a);return C.jsx(Tut,{ref:n,as:o,className:Oe(l.root,i),ownerState:a,...s})});function kut(t){return Ye("MuiTableHead",t)}qe("MuiTableHead",["root"]);const Aut=t=>{const{classes:e}=t;return Xe({root:["root"]},kut,e)},Put=be("thead",{name:"MuiTableHead",slot:"Root",overridesResolver:(t,e)=>e.root})({display:"table-header-group"}),Mut={variant:"head"},$de="thead",Rut=D.forwardRef(function(e,n){const r=wt({props:e,name:"MuiTableHead"}),{className:i,component:o=$de,...s}=r,a={...r,component:o},l=Aut(a);return C.jsx(S4.Provider,{value:Mut,children:C.jsx(Put,{as:o,className:Oe(l.root,i),ref:n,role:o===$de?null:"rowgroup",ownerState:a,...s})})});function Dut(t){return Ye("MuiToolbar",t)}qe("MuiToolbar",["root","gutters","regular","dense"]);const Iut=t=>{const{classes:e,disableGutters:n,variant:r}=t;return Xe({root:["root",!n&&"gutters",r]},Dut,e)},Lut=be("div",{name:"MuiToolbar",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,!n.disableGutters&&e.gutters,e[n.variant]]}})(kt(({theme:t})=>({position:"relative",display:"flex",alignItems:"center",variants:[{props:({ownerState:e})=>!e.disableGutters,style:{paddingLeft:t.spacing(2),paddingRight:t.spacing(2),[t.breakpoints.up("sm")]:{paddingLeft:t.spacing(3),paddingRight:t.spacing(3)}}},{props:{variant:"dense"},style:{minHeight:48}},{props:{variant:"regular"},style:t.mixins.toolbar}]}))),C4=D.forwardRef(function(e,n){const r=wt({props:e,name:"MuiToolbar"}),{className:i,component:o="div",disableGutters:s=!1,variant:a="regular",...l}=r,c={...r,component:o,disableGutters:s,variant:a},u=Iut(c);return C.jsx(Lut,{as:o,className:Oe(u.root,i),ref:n,ownerState:c,...l})}),$ut=lt(C.jsx("path",{d:"M15.41 16.09l-4.58-4.59 4.58-4.59L14 5.5l-6 6 6 6z"}),"KeyboardArrowLeft"),Fut=lt(C.jsx("path",{d:"M8.59 16.34l4.58-4.59-4.58-4.59L10 5.75l6 6-6 6z"}),"KeyboardArrowRight");function Nut(t){return Ye("MuiTableRow",t)}const Fde=qe("MuiTableRow",["root","selected","hover","head","footer"]),zut=t=>{const{classes:e,selected:n,hover:r,head:i,footer:o}=t;return Xe({root:["root",n&&"selected",r&&"hover",i&&"head",o&&"footer"]},Nut,e)},jut=be("tr",{name:"MuiTableRow",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,n.head&&e.head,n.footer&&e.footer]}})(kt(({theme:t})=>({color:"inherit",display:"table-row",verticalAlign:"middle",outline:0,[`&.${Fde.hover}:hover`]:{backgroundColor:(t.vars||t).palette.action.hover},[`&.${Fde.selected}`]:{backgroundColor:t.vars?`rgba(${t.vars.palette.primary.mainChannel} / ${t.vars.palette.action.selectedOpacity})`:Tt(t.palette.primary.main,t.palette.action.selectedOpacity),"&:hover":{backgroundColor:t.vars?`rgba(${t.vars.palette.primary.mainChannel} / calc(${t.vars.palette.action.selectedOpacity} + ${t.vars.palette.action.hoverOpacity}))`:Tt(t.palette.primary.main,t.palette.action.selectedOpacity+t.palette.action.hoverOpacity)}}}))),Nde="tr",Ad=D.forwardRef(function(e,n){const r=wt({props:e,name:"MuiTableRow"}),{className:i,component:o=Nde,hover:s=!1,selected:a=!1,...l}=r,c=D.useContext(S4),u={...r,component:o,hover:s,selected:a,head:c&&c.variant==="head",footer:c&&c.variant==="footer"},f=zut(u);return C.jsx(jut,{as:o,ref:n,className:Oe(f.root,i),role:o===Nde?null:"row",ownerState:u,...l})});function But(t){return(1+Math.sin(Math.PI*t-Math.PI/2))/2}function Uut(t,e,n,r={},i=()=>{}){const{ease:o=But,duration:s=300}=r;let a=null;const l=e[t];let c=!1;const u=()=>{c=!0},f=d=>{if(c){i(new Error("Animation cancelled"));return}a===null&&(a=d);const h=Math.min(1,(d-a)/s);if(e[t]=o(h)*(n-l)+l,h>=1){requestAnimationFrame(()=>{i(null)});return}requestAnimationFrame(f)};return l===n?(i(new Error("Element already at target position")),u):(requestAnimationFrame(f),u)}const Wut={width:99,height:99,position:"absolute",top:-9999,overflow:"scroll"};function Vut(t){const{onChange:e,...n}=t,r=D.useRef(),i=D.useRef(null),o=()=>{r.current=i.current.offsetHeight-i.current.clientHeight};return Ei(()=>{const s=kM(()=>{const l=r.current;o(),l!==r.current&&e(r.current)}),a=bc(i.current);return a.addEventListener("resize",s),()=>{s.clear(),a.removeEventListener("resize",s)}},[e]),D.useEffect(()=>{o(),e(r.current)},[e]),C.jsx("div",{style:Wut,ref:i,...n})}function Gut(t){return Ye("MuiTabScrollButton",t)}const Hut=qe("MuiTabScrollButton",["root","vertical","horizontal","disabled"]),qut=t=>{const{classes:e,orientation:n,disabled:r}=t;return Xe({root:["root",n,r&&"disabled"]},Gut,e)},Xut=be(Nf,{name:"MuiTabScrollButton",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,n.orientation&&e[n.orientation]]}})({width:40,flexShrink:0,opacity:.8,[`&.${Hut.disabled}`]:{opacity:0},variants:[{props:{orientation:"vertical"},style:{width:"100%",height:40,"& svg":{transform:"var(--TabScrollButton-svgRotate)"}}}]}),Yut=D.forwardRef(function(e,n){const r=wt({props:e,name:"MuiTabScrollButton"}),{className:i,slots:o={},slotProps:s={},direction:a,orientation:l,disabled:c,...u}=r,f=Ho(),d={isRtl:f,...r},h=qut(d),p=o.StartScrollButtonIcon??$ut,g=o.EndScrollButtonIcon??Fut,m=Zt({elementType:p,externalSlotProps:s.startScrollButtonIcon,additionalProps:{fontSize:"small"},ownerState:d}),v=Zt({elementType:g,externalSlotProps:s.endScrollButtonIcon,additionalProps:{fontSize:"small"},ownerState:d});return C.jsx(Xut,{component:"div",className:Oe(h.root,i),ref:n,role:null,ownerState:d,tabIndex:null,...u,style:{...u.style,...l==="vertical"&&{"--TabScrollButton-svgRotate":`rotate(${f?-90:90}deg)`}},children:a==="left"?C.jsx(p,{...m}):C.jsx(g,{...v})})});function Qut(t){return Ye("MuiTabs",t)}const c3=qe("MuiTabs",["root","vertical","flexContainer","flexContainerVertical","centered","scroller","fixed","scrollableX","scrollableY","hideScrollbar","scrollButtons","scrollButtonsHideMobile","indicator"]),zde=(t,e)=>t===e?t.firstChild:e&&e.nextElementSibling?e.nextElementSibling:t.firstChild,jde=(t,e)=>t===e?t.lastChild:e&&e.previousElementSibling?e.previousElementSibling:t.lastChild,lI=(t,e,n)=>{let r=!1,i=n(t,e);for(;i;){if(i===t.firstChild){if(r)return;r=!0}const o=i.disabled||i.getAttribute("aria-disabled")==="true";if(!i.hasAttribute("tabindex")||o)i=n(t,i);else{i.focus();return}}},Kut=t=>{const{vertical:e,fixed:n,hideScrollbar:r,scrollableX:i,scrollableY:o,centered:s,scrollButtonsHideMobile:a,classes:l}=t;return Xe({root:["root",e&&"vertical"],scroller:["scroller",n&&"fixed",r&&"hideScrollbar",i&&"scrollableX",o&&"scrollableY"],flexContainer:["flexContainer",e&&"flexContainerVertical",s&&"centered"],indicator:["indicator"],scrollButtons:["scrollButtons",a&&"scrollButtonsHideMobile"],scrollableX:[i&&"scrollableX"],hideScrollbar:[r&&"hideScrollbar"]},Qut,l)},Zut=be("div",{name:"MuiTabs",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[{[`& .${c3.scrollButtons}`]:e.scrollButtons},{[`& .${c3.scrollButtons}`]:n.scrollButtonsHideMobile&&e.scrollButtonsHideMobile},e.root,n.vertical&&e.vertical]}})(kt(({theme:t})=>({overflow:"hidden",minHeight:48,WebkitOverflowScrolling:"touch",display:"flex",variants:[{props:({ownerState:e})=>e.vertical,style:{flexDirection:"column"}},{props:({ownerState:e})=>e.scrollButtonsHideMobile,style:{[`& .${c3.scrollButtons}`]:{[t.breakpoints.down("sm")]:{display:"none"}}}}]}))),Jut=be("div",{name:"MuiTabs",slot:"Scroller",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.scroller,n.fixed&&e.fixed,n.hideScrollbar&&e.hideScrollbar,n.scrollableX&&e.scrollableX,n.scrollableY&&e.scrollableY]}})({position:"relative",display:"inline-block",flex:"1 1 auto",whiteSpace:"nowrap",variants:[{props:({ownerState:t})=>t.fixed,style:{overflowX:"hidden",width:"100%"}},{props:({ownerState:t})=>t.hideScrollbar,style:{scrollbarWidth:"none","&::-webkit-scrollbar":{display:"none"}}},{props:({ownerState:t})=>t.scrollableX,style:{overflowX:"auto",overflowY:"hidden"}},{props:({ownerState:t})=>t.scrollableY,style:{overflowY:"auto",overflowX:"hidden"}}]}),eft=be("div",{name:"MuiTabs",slot:"FlexContainer",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.flexContainer,n.vertical&&e.flexContainerVertical,n.centered&&e.centered]}})({display:"flex",variants:[{props:({ownerState:t})=>t.vertical,style:{flexDirection:"column"}},{props:({ownerState:t})=>t.centered,style:{justifyContent:"center"}}]}),tft=be("span",{name:"MuiTabs",slot:"Indicator",overridesResolver:(t,e)=>e.indicator})(kt(({theme:t})=>({position:"absolute",height:2,bottom:0,width:"100%",transition:t.transitions.create(),variants:[{props:{indicatorColor:"primary"},style:{backgroundColor:(t.vars||t).palette.primary.main}},{props:{indicatorColor:"secondary"},style:{backgroundColor:(t.vars||t).palette.secondary.main}},{props:({ownerState:e})=>e.vertical,style:{height:"100%",width:2,right:0}}]}))),nft=be(Vut)({overflowX:"auto",overflowY:"hidden",scrollbarWidth:"none","&::-webkit-scrollbar":{display:"none"}}),Bde={},Ree=D.forwardRef(function(e,n){const r=wt({props:e,name:"MuiTabs"}),i=Na(),o=Ho(),{"aria-label":s,"aria-labelledby":a,action:l,centered:c=!1,children:u,className:f,component:d="div",allowScrollButtonsMobile:h=!1,indicatorColor:p="primary",onChange:g,orientation:m="horizontal",ScrollButtonComponent:v=Yut,scrollButtons:y="auto",selectionFollowsFocus:x,slots:b={},slotProps:w={},TabIndicatorProps:_={},TabScrollButtonProps:S={},textColor:O="primary",value:k,variant:E="standard",visibleScrollbar:M=!1,...A}=r,P=E==="scrollable",T=m==="vertical",R=T?"scrollTop":"scrollLeft",I=T?"top":"left",B=T?"bottom":"right",$=T?"clientHeight":"clientWidth",z=T?"height":"width",L={...r,component:d,allowScrollButtonsMobile:h,indicatorColor:p,orientation:m,vertical:T,scrollButtons:y,textColor:O,variant:E,visibleScrollbar:M,fixed:!P,hideScrollbar:P&&!M,scrollableX:P&&!T,scrollableY:P&&T,centered:c&&!P,scrollButtonsHideMobile:!h},j=Kut(L),N=Zt({elementType:b.StartScrollButtonIcon,externalSlotProps:w.startScrollButtonIcon,ownerState:L}),F=Zt({elementType:b.EndScrollButtonIcon,externalSlotProps:w.endScrollButtonIcon,ownerState:L}),[H,q]=D.useState(!1),[Y,le]=D.useState(Bde),[K,ee]=D.useState(!1),[re,me]=D.useState(!1),[te,ae]=D.useState(!1),[U,oe]=D.useState({overflow:"hidden",scrollbarWidth:0}),ne=new Map,V=D.useRef(null),X=D.useRef(null),Z=()=>{const Te=V.current;let Le;if(Te){const $e=Te.getBoundingClientRect();Le={clientWidth:Te.clientWidth,scrollLeft:Te.scrollLeft,scrollTop:Te.scrollTop,scrollWidth:Te.scrollWidth,top:$e.top,bottom:$e.bottom,left:$e.left,right:$e.right}}let ue;if(Te&&k!==!1){const $e=X.current.children;if($e.length>0){const Se=$e[ne.get(k)];ue=Se?Se.getBoundingClientRect():null}}return{tabsMeta:Le,tabMeta:ue}},he=st(()=>{const{tabsMeta:Te,tabMeta:Le}=Z();let ue=0,$e;T?($e="top",Le&&Te&&(ue=Le.top-Te.top+Te.scrollTop)):($e=o?"right":"left",Le&&Te&&(ue=(o?-1:1)*(Le[$e]-Te[$e]+Te.scrollLeft)));const Se={[$e]:ue,[z]:Le?Le[z]:0};if(typeof Y[$e]!="number"||typeof Y[z]!="number")le(Se);else{const He=Math.abs(Y[$e]-Se[$e]),tt=Math.abs(Y[z]-Se[z]);(He>=1||tt>=1)&&le(Se)}}),xe=(Te,{animation:Le=!0}={})=>{Le?Uut(R,V.current,Te,{duration:i.transitions.duration.standard}):V.current[R]=Te},G=Te=>{let Le=V.current[R];T?Le+=Te:Le+=Te*(o?-1:1),xe(Le)},W=()=>{const Te=V.current[$];let Le=0;const ue=Array.from(X.current.children);for(let $e=0;$eTe){$e===0&&(Le=Te);break}Le+=Se[$]}return Le},J=()=>{G(-1*W())},se=()=>{G(W())},ye=D.useCallback(Te=>{oe({overflow:null,scrollbarWidth:Te})},[]),ie=()=>{const Te={};Te.scrollbarSizeListener=P?C.jsx(nft,{onChange:ye,className:Oe(j.scrollableX,j.hideScrollbar)}):null;const ue=P&&(y==="auto"&&(K||re)||y===!0);return Te.scrollButtonStart=ue?C.jsx(v,{slots:{StartScrollButtonIcon:b.StartScrollButtonIcon},slotProps:{startScrollButtonIcon:N},orientation:m,direction:o?"right":"left",onClick:J,disabled:!K,...S,className:Oe(j.scrollButtons,S.className)}):null,Te.scrollButtonEnd=ue?C.jsx(v,{slots:{EndScrollButtonIcon:b.EndScrollButtonIcon},slotProps:{endScrollButtonIcon:F},orientation:m,direction:o?"left":"right",onClick:se,disabled:!re,...S,className:Oe(j.scrollButtons,S.className)}):null,Te},fe=st(Te=>{const{tabsMeta:Le,tabMeta:ue}=Z();if(!(!ue||!Le)){if(ue[I]Le[B]){const $e=Le[R]+(ue[B]-Le[B]);xe($e,{animation:Te})}}}),Q=st(()=>{P&&y!==!1&&ae(!te)});D.useEffect(()=>{const Te=kM(()=>{V.current&&he()});let Le;const ue=He=>{He.forEach(tt=>{tt.removedNodes.forEach(ut=>{Le==null||Le.unobserve(ut)}),tt.addedNodes.forEach(ut=>{Le==null||Le.observe(ut)})}),Te(),Q()},$e=bc(V.current);$e.addEventListener("resize",Te);let Se;return typeof ResizeObserver<"u"&&(Le=new ResizeObserver(Te),Array.from(X.current.children).forEach(He=>{Le.observe(He)})),typeof MutationObserver<"u"&&(Se=new MutationObserver(ue),Se.observe(X.current,{childList:!0})),()=>{Te.clear(),$e.removeEventListener("resize",Te),Se==null||Se.disconnect(),Le==null||Le.disconnect()}},[he,Q]),D.useEffect(()=>{const Te=Array.from(X.current.children),Le=Te.length;if(typeof IntersectionObserver<"u"&&Le>0&&P&&y!==!1){const ue=Te[0],$e=Te[Le-1],Se={root:V.current,threshold:.99},He=Dn=>{ee(!Dn[0].isIntersecting)},tt=new IntersectionObserver(He,Se);tt.observe(ue);const ut=Dn=>{me(!Dn[0].isIntersecting)},qt=new IntersectionObserver(ut,Se);return qt.observe($e),()=>{tt.disconnect(),qt.disconnect()}}},[P,y,te,u==null?void 0:u.length]),D.useEffect(()=>{q(!0)},[]),D.useEffect(()=>{he()}),D.useEffect(()=>{fe(Bde!==Y)},[fe,Y]),D.useImperativeHandle(l,()=>({updateIndicator:he,updateScrollButtons:Q}),[he,Q]);const _e=C.jsx(tft,{..._,className:Oe(j.indicator,_.className),ownerState:L,style:{...Y,..._.style}});let we=0;const Ie=D.Children.map(u,Te=>{if(!D.isValidElement(Te))return null;const Le=Te.props.value===void 0?we:Te.props.value;ne.set(Le,we);const ue=Le===k;return we+=1,D.cloneElement(Te,{fullWidth:E==="fullWidth",indicator:ue&&!H&&_e,selected:ue,selectionFollowsFocus:x,onChange:g,textColor:O,value:Le,...we===1&&k===!1&&!Te.props.tabIndex?{tabIndex:0}:{}})}),Pe=Te=>{const Le=X.current,ue=mi(Le).activeElement;if(ue.getAttribute("role")!=="tab")return;let Se=m==="horizontal"?"ArrowLeft":"ArrowUp",He=m==="horizontal"?"ArrowRight":"ArrowDown";switch(m==="horizontal"&&o&&(Se="ArrowRight",He="ArrowLeft"),Te.key){case Se:Te.preventDefault(),lI(Le,ue,jde);break;case He:Te.preventDefault(),lI(Le,ue,zde);break;case"Home":Te.preventDefault(),lI(Le,null,zde);break;case"End":Te.preventDefault(),lI(Le,null,jde);break}},Me=ie();return C.jsxs(Zut,{className:Oe(j.root,f),ownerState:L,ref:n,as:d,...A,children:[Me.scrollButtonStart,Me.scrollbarSizeListener,C.jsxs(Jut,{className:j.scroller,ownerState:L,style:{overflow:U.overflow,[T?`margin${o?"Left":"Right"}`:"marginBottom"]:M?void 0:-U.scrollbarWidth},ref:V,children:[C.jsx(eft,{"aria-label":s,"aria-labelledby":a,"aria-orientation":m==="vertical"?"vertical":null,className:j.flexContainer,ownerState:L,onKeyDown:Pe,ref:X,role:"tablist",children:Ie}),H&&_e]}),Me.scrollButtonEnd]})});function rft(t){return Ye("MuiTextField",t)}qe("MuiTextField",["root"]);const ift={standard:Rg,filled:jF,outlined:BF},oft=t=>{const{classes:e}=t;return Xe({root:["root"]},rft,e)},sft=be(Gg,{name:"MuiTextField",slot:"Root",overridesResolver:(t,e)=>e.root})({}),ui=D.forwardRef(function(e,n){const r=wt({props:e,name:"MuiTextField"}),{autoComplete:i,autoFocus:o=!1,children:s,className:a,color:l="primary",defaultValue:c,disabled:u=!1,error:f=!1,FormHelperTextProps:d,fullWidth:h=!1,helperText:p,id:g,InputLabelProps:m,inputProps:v,InputProps:y,inputRef:x,label:b,maxRows:w,minRows:_,multiline:S=!1,name:O,onBlur:k,onChange:E,onFocus:M,placeholder:A,required:P=!1,rows:T,select:R=!1,SelectProps:I,slots:B={},slotProps:$={},type:z,value:L,variant:j="outlined",...N}=r,F={...r,autoFocus:o,color:l,disabled:u,error:f,fullWidth:h,multiline:S,required:P,select:R,variant:j},H=oft(F),q=Jf(g),Y=p&&q?`${q}-helper-text`:void 0,le=b&&q?`${q}-label`:void 0,K=ift[j],ee={slots:B,slotProps:{input:y,inputLabel:m,htmlInput:v,formHelperText:d,select:I,...$}},re={},me=ee.slotProps.inputLabel;j==="outlined"&&(me&&typeof me.shrink<"u"&&(re.notched=me.shrink),re.label=b),R&&((!I||!I.native)&&(re.id=void 0),re["aria-describedby"]=void 0);const[te,ae]=ec("input",{elementType:K,externalForwardedProps:ee,additionalProps:re,ownerState:F}),[U,oe]=ec("inputLabel",{elementType:Ly,externalForwardedProps:ee,ownerState:F}),[ne,V]=ec("htmlInput",{elementType:"input",externalForwardedProps:ee,ownerState:F}),[X,Z]=ec("formHelperText",{elementType:Eee,externalForwardedProps:ee,ownerState:F}),[he,xe]=ec("select",{elementType:Hg,externalForwardedProps:ee,ownerState:F}),G=C.jsx(te,{"aria-describedby":Y,autoComplete:i,autoFocus:o,defaultValue:c,fullWidth:h,multiline:S,name:O,rows:T,maxRows:w,minRows:_,type:z,value:L,id:q,inputRef:x,onBlur:k,onChange:E,onFocus:M,placeholder:A,inputProps:V,slots:{input:B.htmlInput?ne:void 0},...ae});return C.jsxs(sft,{className:Oe(H.root,a),disabled:u,error:f,fullWidth:h,ref:n,required:P,color:l,variant:j,ownerState:F,...N,children:[b!=null&&b!==""&&C.jsx(U,{htmlFor:q,id:le,...oe,children:b}),R?C.jsx(he,{"aria-describedby":Y,id:q,labelId:le,value:L,input:G,...xe,children:s}):G,p&&C.jsx(X,{id:Y,...Z,children:p})]})});function aft(t){return Ye("MuiToggleButton",t)}const cx=qe("MuiToggleButton",["root","disabled","selected","standard","primary","secondary","sizeSmall","sizeMedium","sizeLarge","fullWidth"]),rPe=D.createContext({}),iPe=D.createContext(void 0);function lft(t,e){return e===void 0||t===void 0?!1:Array.isArray(e)?e.includes(t):t===e}const cft=t=>{const{classes:e,fullWidth:n,selected:r,disabled:i,size:o,color:s}=t,a={root:["root",r&&"selected",i&&"disabled",n&&"fullWidth",`size${De(o)}`,s]};return Xe(a,aft,e)},uft=be(Nf,{name:"MuiToggleButton",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,e[`size${De(n.size)}`]]}})(kt(({theme:t})=>({...t.typography.button,borderRadius:(t.vars||t).shape.borderRadius,padding:11,border:`1px solid ${(t.vars||t).palette.divider}`,color:(t.vars||t).palette.action.active,[`&.${cx.disabled}`]:{color:(t.vars||t).palette.action.disabled,border:`1px solid ${(t.vars||t).palette.action.disabledBackground}`},"&:hover":{textDecoration:"none",backgroundColor:t.vars?`rgba(${t.vars.palette.text.primaryChannel} / ${t.vars.palette.action.hoverOpacity})`:Tt(t.palette.text.primary,t.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}},variants:[{props:{color:"standard"},style:{[`&.${cx.selected}`]:{color:(t.vars||t).palette.text.primary,backgroundColor:t.vars?`rgba(${t.vars.palette.text.primaryChannel} / ${t.vars.palette.action.selectedOpacity})`:Tt(t.palette.text.primary,t.palette.action.selectedOpacity),"&:hover":{backgroundColor:t.vars?`rgba(${t.vars.palette.text.primaryChannel} / calc(${t.vars.palette.action.selectedOpacity} + ${t.vars.palette.action.hoverOpacity}))`:Tt(t.palette.text.primary,t.palette.action.selectedOpacity+t.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:t.vars?`rgba(${t.vars.palette.text.primaryChannel} / ${t.vars.palette.action.selectedOpacity})`:Tt(t.palette.text.primary,t.palette.action.selectedOpacity)}}}}},...Object.entries(t.palette).filter(di()).map(([e])=>({props:{color:e},style:{[`&.${cx.selected}`]:{color:(t.vars||t).palette[e].main,backgroundColor:t.vars?`rgba(${t.vars.palette[e].mainChannel} / ${t.vars.palette.action.selectedOpacity})`:Tt(t.palette[e].main,t.palette.action.selectedOpacity),"&:hover":{backgroundColor:t.vars?`rgba(${t.vars.palette[e].mainChannel} / calc(${t.vars.palette.action.selectedOpacity} + ${t.vars.palette.action.hoverOpacity}))`:Tt(t.palette[e].main,t.palette.action.selectedOpacity+t.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:t.vars?`rgba(${t.vars.palette[e].mainChannel} / ${t.vars.palette.action.selectedOpacity})`:Tt(t.palette[e].main,t.palette.action.selectedOpacity)}}}}})),{props:{fullWidth:!0},style:{width:"100%"}},{props:{size:"small"},style:{padding:7,fontSize:t.typography.pxToRem(13)}},{props:{size:"large"},style:{padding:15,fontSize:t.typography.pxToRem(15)}}]}))),yr=D.forwardRef(function(e,n){const{value:r,...i}=D.useContext(rPe),o=D.useContext(iPe),s=vS({...i,selected:lft(e.value,r)},e),a=wt({props:s,name:"MuiToggleButton"}),{children:l,className:c,color:u="standard",disabled:f=!1,disableFocusRipple:d=!1,fullWidth:h=!1,onChange:p,onClick:g,selected:m,size:v="medium",value:y,...x}=a,b={...a,color:u,disabled:f,disableFocusRipple:d,fullWidth:h,size:v},w=cft(b),_=O=>{g&&(g(O,y),O.defaultPrevented)||p&&p(O,y)},S=o||"";return C.jsx(uft,{className:Oe(i.className,w.root,c,S),disabled:f,focusRipple:!d,ref:n,onClick:_,onChange:p,value:y,ownerState:b,"aria-pressed":m,...x,children:l})});function fft(t){return Ye("MuiToggleButtonGroup",t)}const Hr=qe("MuiToggleButtonGroup",["root","selected","horizontal","vertical","disabled","grouped","groupedHorizontal","groupedVertical","fullWidth","firstButton","lastButton","middleButton"]),dft=t=>{const{classes:e,orientation:n,fullWidth:r,disabled:i}=t,o={root:["root",n,r&&"fullWidth"],grouped:["grouped",`grouped${De(n)}`,i&&"disabled"],firstButton:["firstButton"],lastButton:["lastButton"],middleButton:["middleButton"]};return Xe(o,fft,e)},hft=be("div",{name:"MuiToggleButtonGroup",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[{[`& .${Hr.grouped}`]:e.grouped},{[`& .${Hr.grouped}`]:e[`grouped${De(n.orientation)}`]},{[`& .${Hr.firstButton}`]:e.firstButton},{[`& .${Hr.lastButton}`]:e.lastButton},{[`& .${Hr.middleButton}`]:e.middleButton},e.root,n.orientation==="vertical"&&e.vertical,n.fullWidth&&e.fullWidth]}})(kt(({theme:t})=>({display:"inline-flex",borderRadius:(t.vars||t).shape.borderRadius,variants:[{props:{orientation:"vertical"},style:{flexDirection:"column",[`& .${Hr.grouped}`]:{[`&.${Hr.selected} + .${Hr.grouped}.${Hr.selected}`]:{borderTop:0,marginTop:0}},[`& .${Hr.firstButton},& .${Hr.middleButton}`]:{borderBottomLeftRadius:0,borderBottomRightRadius:0},[`& .${Hr.lastButton},& .${Hr.middleButton}`]:{marginTop:-1,borderTop:"1px solid transparent",borderTopLeftRadius:0,borderTopRightRadius:0},[`& .${Hr.lastButton}.${cx.disabled},& .${Hr.middleButton}.${cx.disabled}`]:{borderTop:"1px solid transparent"}}},{props:{fullWidth:!0},style:{width:"100%"}},{props:{orientation:"horizontal"},style:{[`& .${Hr.grouped}`]:{[`&.${Hr.selected} + .${Hr.grouped}.${Hr.selected}`]:{borderLeft:0,marginLeft:0}},[`& .${Hr.firstButton},& .${Hr.middleButton}`]:{borderTopRightRadius:0,borderBottomRightRadius:0},[`& .${Hr.lastButton},& .${Hr.middleButton}`]:{marginLeft:-1,borderLeft:"1px solid transparent",borderTopLeftRadius:0,borderBottomLeftRadius:0},[`& .${Hr.lastButton}.${cx.disabled},& .${Hr.middleButton}.${cx.disabled}`]:{borderLeft:"1px solid transparent"}}}]}))),KC=D.forwardRef(function(e,n){const r=wt({props:e,name:"MuiToggleButtonGroup"}),{children:i,className:o,color:s="standard",disabled:a=!1,exclusive:l=!1,fullWidth:c=!1,onChange:u,orientation:f="horizontal",size:d="medium",value:h,...p}=r,g={...r,disabled:a,fullWidth:c,orientation:f,size:d},m=dft(g),v=D.useCallback((S,O)=>{if(!u)return;const k=h&&h.indexOf(O);let E;h&&k>=0?(E=h.slice(),E.splice(k,1)):E=h?h.concat(O):[O],u(S,E)},[u,h]),y=D.useCallback((S,O)=>{u&&u(S,h===O?null:O)},[u,h]),x=D.useMemo(()=>({className:m.grouped,onChange:l?y:v,value:h,size:d,fullWidth:c,color:s,disabled:a}),[m.grouped,l,y,v,h,d,c,s,a]),b=Mtt(i),w=b.length,_=S=>{const O=S===0,k=S===w-1;return O&&k?"":O?m.firstButton:k?m.lastButton:m.middleButton};return C.jsx(hft,{role:"group",className:Oe(m.root,o),ref:n,ownerState:g,...p,children:C.jsx(rPe.Provider,{value:x,children:b.map((S,O)=>C.jsx(iPe.Provider,{value:_(O),children:S},O))})})}),pft="default",gft={id:"local",name:"Local Server",url:"http://localhost:8080"},mft={appBarTitle:"xcube Viewer",windowTitle:"xcube Viewer",windowIcon:null,compact:!1,themeName:"light",primaryColor:"blue",secondaryColor:"pink",organisationUrl:"https://xcube.readthedocs.io/",logoImage:"images/logo.png",logoWidth:32,baseMapUrl:"https://services.arcgisonline.com/arcgis/rest/services/World_Imagery/MapServer/tile/{z}/{y}/{x}",defaultAgg:"mean",polygonFillOpacity:.2,mapProjection:"EPSG:3857",allowDownloads:!0,allowRefresh:!0,allowSharing:!0,allowUserVariables:!0,allow3D:!0},cI={name:pft,server:gft,branding:mft};function vft(){const t=new URL(window.location.href),e=t.pathname.split("/"),n=e.length;return n>0?e[n-1]==="index.html"?new URL(e.slice(0,n-1).join("/"),window.location.origin):new URL(t.pathname,window.location.origin):new URL(window.location.origin)}const ZC=vft();function oPe(t,...e){let n=t;for(const r of e)r!==""&&(n.endsWith("/")?r.startsWith("/")?n+=r.substring(1):n+=r:r.startsWith("/")?n+=r:n+="/"+r);return n}const yft={amber:wke,blue:Um,blueGrey:aJe,brown:_ke,cyan:vke,deepOrange:Tx,deepPurple:oJe,green:Ip,grey:Ske,indigo:mke,lightBlue:Wm,lightGreen:sJe,lime:xke,orange:q0,pink:gke,purple:Bm,red:jm,teal:yke,yellow:bke};function Ude(t,e){const n=t[e];let r=null;if(typeof n=="string"?(r=yft[n]||null,r===null&&n.startsWith("#")&&(n.length===7||n.length===9)&&(r={main:n})):typeof n=="object"&&n!==null&&"main"in n&&(r=n),r!==null)t[e]=r;else throw new Error(`Value of branding.${e} is invalid: ${n}`)}function xft(t,e,n){const r=t[e];typeof r=="string"&&(t[e]=oPe(ZC.href,n,r))}function bft(t,e){return t={...t},Ude(t,"primaryColor"),Ude(t,"secondaryColor"),xft(t,"logoImage",e),t}function vr(t){return typeof t=="number"}function J1(t){return typeof t=="string"}function wft(t){return typeof t=="function"}function Wde(t){return t!==null&&typeof t=="object"&&t.constructor===Object}const jp=new URLSearchParams(window.location.search),af=class af{constructor(e,n,r,i){gn(this,"name");gn(this,"server");gn(this,"branding");gn(this,"authClient");this.name=e,this.server=n,this.branding=r,this.authClient=i}static async load(){let e=jp.get("configPath")||"config";const n=await this.loadRawConfig(e);n===cI&&(e="");const r=n.name||"default",i=this.getAuthConfig(n),o=this.getServerConfig(n),s=parseInt(jp.get("compact")||"0")!==0;let a=bft({...cI.branding,...n.branding,compact:s||n.branding.compact},e);return a=Gde(a,"allowUserVariables"),a=Gde(a,"allow3D"),af._instance=new af(r,o,a,i),a.windowTitle&&this.changeWindowTitle(a.windowTitle),a.windowIcon&&this.changeWindowIcon(a.windowIcon),af._instance}static getAuthConfig(e){let n=e.authClient&&{...e.authClient};const r=af.getAuthClientFromEnv();if(!n&&r.authority&&r.clientId&&(n={authority:r.authority,client_id:r.clientId}),n){if(r.authority){const i=r.authority;n={...n,authority:i}}if(r.clientId){const i=r.clientId;n={...n,client_id:i}}if(r.audience){const i=r.audience,o=n.extraQueryParams;n={...n,extraQueryParams:{...o,audience:i}}}}return n}static getServerConfig(e){const n={...cI.server,...e.server},r=af.getApiServerFromEnv();return n.id=jp.get("serverId")||r.id||n.id,n.name=jp.get("serverName")||r.name||n.name,n.url=jp.get("serverUrl")||r.url||n.url,n}static async loadRawConfig(e){let n=null,r=null;const i=oPe(ZC.href,e,"config.json");try{const o=await fetch(i);if(o.ok)n=await o.json();else{const{status:s,statusText:a}=o;r=`HTTP status ${s}`,a&&(r+=` (${a})`)}}catch(o){n=null,r=`${o}`}return n===null&&(n=cI),n}static get instance(){return af.assertConfigLoaded(),af._instance}static assertConfigLoaded(){if(!af._instance)throw new Error("internal error: configuration not available yet")}static changeWindowTitle(e){document.title=e}static changeWindowIcon(e){let n=document.querySelector('link[rel="icon"]');n!==null?n.href=e:(n=document.createElement("link"),n.rel="icon",n.href=e,document.head.appendChild(n))}static getAuthClientFromEnv(){return{authority:void 0,clientId:void 0,audience:void 0}}static getApiServerFromEnv(){return{id:void 0,name:void 0,url:void 0}}};gn(af,"_instance");let wn=af;const Dee=[["red",jm],["yellow",bke],["blue",Um],["pink",gke],["lightBlue",Wm],["green",Ip],["orange",q0],["lime",xke],["purple",Bm],["indigo",mke],["cyan",vke],["brown",_ke],["teal",yke]],_ft=(()=>{const t={};return Dee.forEach(([e,n])=>{t[e]=n}),t})(),Vde=Dee.map(([t,e])=>t);function Sft(t){return t==="light"?800:400}function r1(t){return Vde[t%Vde.length]}function sPe(t,e){const n=Sft(e);return _ft[t][n]}function Iee(t){return vr(t)||(t=wn.instance.branding.polygonFillOpacity),vr(t)?t:.25}const Cft={Mapbox:{param:"access_token",token:"pk.eyJ1IjoiZm9ybWFuIiwiYSI6ImNrM2JranV0bDBtenczb2szZG84djh6bWUifQ.q0UKwf4CWt5fcQwIDwF8Bg"}};function Oft(t){return Cft[t]}function Gde(t,e){const n=jp.get(e),r=n?!!parseInt(n):!!t[e];return{...t,[e]:r}}function K2(t){throw new Error('Could not dynamically require "'+t+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var aW={exports:{}};const Eft={},Tft=Object.freeze(Object.defineProperty({__proto__:null,default:Eft},Symbol.toStringTag,{value:"Module"})),kft=LEe(Tft);var Hde;function O4(){return Hde||(Hde=1,function(t,e){(function(n,r){t.exports=r()})(ei,function(){var n=n||function(r,i){var o;if(typeof window<"u"&&window.crypto&&(o=window.crypto),typeof self<"u"&&self.crypto&&(o=self.crypto),typeof globalThis<"u"&&globalThis.crypto&&(o=globalThis.crypto),!o&&typeof window<"u"&&window.msCrypto&&(o=window.msCrypto),!o&&typeof ei<"u"&&ei.crypto&&(o=ei.crypto),!o&&typeof K2=="function")try{o=kft}catch{}var s=function(){if(o){if(typeof o.getRandomValues=="function")try{return o.getRandomValues(new Uint32Array(1))[0]}catch{}if(typeof o.randomBytes=="function")try{return o.randomBytes(4).readInt32LE()}catch{}}throw new Error("Native crypto module could not be used to get secure random number.")},a=Object.create||function(){function y(){}return function(x){var b;return y.prototype=x,b=new y,y.prototype=null,b}}(),l={},c=l.lib={},u=c.Base=function(){return{extend:function(y){var x=a(this);return y&&x.mixIn(y),(!x.hasOwnProperty("init")||this.init===x.init)&&(x.init=function(){x.$super.init.apply(this,arguments)}),x.init.prototype=x,x.$super=this,x},create:function(){var y=this.extend();return y.init.apply(y,arguments),y},init:function(){},mixIn:function(y){for(var x in y)y.hasOwnProperty(x)&&(this[x]=y[x]);y.hasOwnProperty("toString")&&(this.toString=y.toString)},clone:function(){return this.init.prototype.extend(this)}}}(),f=c.WordArray=u.extend({init:function(y,x){y=this.words=y||[],x!=i?this.sigBytes=x:this.sigBytes=y.length*4},toString:function(y){return(y||h).stringify(this)},concat:function(y){var x=this.words,b=y.words,w=this.sigBytes,_=y.sigBytes;if(this.clamp(),w%4)for(var S=0;S<_;S++){var O=b[S>>>2]>>>24-S%4*8&255;x[w+S>>>2]|=O<<24-(w+S)%4*8}else for(var k=0;k<_;k+=4)x[w+k>>>2]=b[k>>>2];return this.sigBytes+=_,this},clamp:function(){var y=this.words,x=this.sigBytes;y[x>>>2]&=4294967295<<32-x%4*8,y.length=r.ceil(x/4)},clone:function(){var y=u.clone.call(this);return y.words=this.words.slice(0),y},random:function(y){for(var x=[],b=0;b>>2]>>>24-_%4*8&255;w.push((S>>>4).toString(16)),w.push((S&15).toString(16))}return w.join("")},parse:function(y){for(var x=y.length,b=[],w=0;w>>3]|=parseInt(y.substr(w,2),16)<<24-w%8*4;return new f.init(b,x/2)}},p=d.Latin1={stringify:function(y){for(var x=y.words,b=y.sigBytes,w=[],_=0;_>>2]>>>24-_%4*8&255;w.push(String.fromCharCode(S))}return w.join("")},parse:function(y){for(var x=y.length,b=[],w=0;w>>2]|=(y.charCodeAt(w)&255)<<24-w%4*8;return new f.init(b,x)}},g=d.Utf8={stringify:function(y){try{return decodeURIComponent(escape(p.stringify(y)))}catch{throw new Error("Malformed UTF-8 data")}},parse:function(y){return p.parse(unescape(encodeURIComponent(y)))}},m=c.BufferedBlockAlgorithm=u.extend({reset:function(){this._data=new f.init,this._nDataBytes=0},_append:function(y){typeof y=="string"&&(y=g.parse(y)),this._data.concat(y),this._nDataBytes+=y.sigBytes},_process:function(y){var x,b=this._data,w=b.words,_=b.sigBytes,S=this.blockSize,O=S*4,k=_/O;y?k=r.ceil(k):k=r.max((k|0)-this._minBufferSize,0);var E=k*S,M=r.min(E*4,_);if(E){for(var A=0;A>>7)^(k<<14|k>>>18)^k>>>3,M=f[O-2],A=(M<<15|M>>>17)^(M<<13|M>>>19)^M>>>10;f[O]=E+f[O-7]+A+f[O-16]}var P=b&w^~b&_,T=m&v^m&y^v&y,R=(m<<30|m>>>2)^(m<<19|m>>>13)^(m<<10|m>>>22),I=(b<<26|b>>>6)^(b<<21|b>>>11)^(b<<7|b>>>25),B=S+I+P+u[O]+f[O],$=R+T;S=_,_=w,w=b,b=x+B|0,x=y,y=v,v=m,m=B+$|0}g[0]=g[0]+m|0,g[1]=g[1]+v|0,g[2]=g[2]+y|0,g[3]=g[3]+x|0,g[4]=g[4]+b|0,g[5]=g[5]+w|0,g[6]=g[6]+_|0,g[7]=g[7]+S|0},_doFinalize:function(){var h=this._data,p=h.words,g=this._nDataBytes*8,m=h.sigBytes*8;return p[m>>>5]|=128<<24-m%32,p[(m+64>>>9<<4)+14]=r.floor(g/4294967296),p[(m+64>>>9<<4)+15]=g,h.sigBytes=p.length*4,this._process(),this._hash},clone:function(){var h=a.clone.call(this);return h._hash=this._hash.clone(),h}});i.SHA256=a._createHelper(d),i.HmacSHA256=a._createHmacHelper(d)}(Math),n.SHA256})})(aPe);var Mft=aPe.exports;const Rft=on(Mft);var lPe={exports:{}};(function(t,e){(function(n,r){t.exports=r(O4())})(ei,function(n){return function(){var r=n,i=r.lib,o=i.WordArray,s=r.enc;s.Base64={stringify:function(l){var c=l.words,u=l.sigBytes,f=this._map;l.clamp();for(var d=[],h=0;h>>2]>>>24-h%4*8&255,g=c[h+1>>>2]>>>24-(h+1)%4*8&255,m=c[h+2>>>2]>>>24-(h+2)%4*8&255,v=p<<16|g<<8|m,y=0;y<4&&h+y*.75>>6*(3-y)&63));var x=f.charAt(64);if(x)for(;d.length%4;)d.push(x);return d.join("")},parse:function(l){var c=l.length,u=this._map,f=this._reverseMap;if(!f){f=this._reverseMap=[];for(var d=0;d>>6-h%4*2,m=p|g;f[d>>>2]|=m<<24-d%4*8,d++}return o.create(f,d)}}(),n.enc.Base64})})(lPe);var Dft=lPe.exports;const qde=on(Dft);var cPe={exports:{}};(function(t,e){(function(n,r){t.exports=r(O4())})(ei,function(n){return n.enc.Utf8})})(cPe);var Ift=cPe.exports;const Lft=on(Ift);function YH(t){this.message=t}YH.prototype=new Error,YH.prototype.name="InvalidCharacterError";var Xde=typeof window<"u"&&window.atob&&window.atob.bind(window)||function(t){var e=String(t).replace(/=+$/,"");if(e.length%4==1)throw new YH("'atob' failed: The string to be decoded is not correctly encoded.");for(var n,r,i=0,o=0,s="";r=e.charAt(o++);~r&&(n=i%4?64*n+r:r,i++%4)?s+=String.fromCharCode(255&n>>(-2*i&6)):0)r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(r);return s};function $ft(t){var e=t.replace(/-/g,"+").replace(/_/g,"/");switch(e.length%4){case 0:break;case 2:e+="==";break;case 3:e+="=";break;default:throw"Illegal base64url string!"}try{return function(n){return decodeURIComponent(Xde(n).replace(/(.)/g,function(r,i){var o=i.charCodeAt(0).toString(16).toUpperCase();return o.length<2&&(o="0"+o),"%"+o}))}(e)}catch{return Xde(e)}}function WF(t){this.message=t}function Fft(t,e){if(typeof t!="string")throw new WF("Invalid token specified");var n=(e=e||{}).header===!0?0:1;try{return JSON.parse($ft(t.split(".")[n]))}catch(r){throw new WF("Invalid token specified: "+r.message)}}WF.prototype=new Error,WF.prototype.name="InvalidTokenError";var Nft={debug:()=>{},info:()=>{},warn:()=>{},error:()=>{}},Ed,Td,VF=(t=>(t[t.NONE=0]="NONE",t[t.ERROR=1]="ERROR",t[t.WARN=2]="WARN",t[t.INFO=3]="INFO",t[t.DEBUG=4]="DEBUG",t))(VF||{});(t=>{function e(){Ed=3,Td=Nft}t.reset=e;function n(i){if(!(0<=i&&i<=4))throw new Error("Invalid log level");Ed=i}t.setLevel=n;function r(i){Td=i}t.setLogger=r})(VF||(VF={}));var sn=class{constructor(t){this._name=t}debug(...t){Ed>=4&&Td.debug(sn._format(this._name,this._method),...t)}info(...t){Ed>=3&&Td.info(sn._format(this._name,this._method),...t)}warn(...t){Ed>=2&&Td.warn(sn._format(this._name,this._method),...t)}error(...t){Ed>=1&&Td.error(sn._format(this._name,this._method),...t)}throw(t){throw this.error(t),t}create(t){const e=Object.create(this);return e._method=t,e.debug("begin"),e}static createStatic(t,e){const n=new sn(`${t}.${e}`);return n.debug("begin"),n}static _format(t,e){const n=`[${t}]`;return e?`${n} ${e}:`:n}static debug(t,...e){Ed>=4&&Td.debug(sn._format(t),...e)}static info(t,...e){Ed>=3&&Td.info(sn._format(t),...e)}static warn(t,...e){Ed>=2&&Td.warn(sn._format(t),...e)}static error(t,...e){Ed>=1&&Td.error(sn._format(t),...e)}};VF.reset();var zft="10000000-1000-4000-8000-100000000000",Qd=class{static _randomWord(){return Pft.lib.WordArray.random(1).words[0]}static generateUUIDv4(){return zft.replace(/[018]/g,e=>(+e^Qd._randomWord()&15>>+e/4).toString(16)).replace(/-/g,"")}static generateCodeVerifier(){return Qd.generateUUIDv4()+Qd.generateUUIDv4()+Qd.generateUUIDv4()}static generateCodeChallenge(t){try{const e=Rft(t);return qde.stringify(e).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}catch(e){throw sn.error("CryptoUtils.generateCodeChallenge",e),e}}static generateBasicAuth(t,e){const n=Lft.parse([t,e].join(":"));return qde.stringify(n)}},Vm=class{constructor(e){this._name=e,this._logger=new sn(`Event('${this._name}')`),this._callbacks=[]}addHandler(e){return this._callbacks.push(e),()=>this.removeHandler(e)}removeHandler(e){const n=this._callbacks.lastIndexOf(e);n>=0&&this._callbacks.splice(n,1)}raise(...e){this._logger.debug("raise:",...e);for(const n of this._callbacks)n(...e)}},QH=class{static decode(t){try{return Fft(t)}catch(e){throw sn.error("JwtUtils.decode",e),e}}},Yde=class{static center({...t}){var e,n,r;return t.width==null&&(t.width=(e=[800,720,600,480].find(i=>i<=window.outerWidth/1.618))!=null?e:360),(n=t.left)!=null||(t.left=Math.max(0,Math.round(window.screenX+(window.outerWidth-t.width)/2))),t.height!=null&&((r=t.top)!=null||(t.top=Math.max(0,Math.round(window.screenY+(window.outerHeight-t.height)/2)))),t}static serialize(t){return Object.entries(t).filter(([,e])=>e!=null).map(([e,n])=>`${e}=${typeof n!="boolean"?n:n?"yes":"no"}`).join(",")}},hu=class extends Vm{constructor(){super(...arguments),this._logger=new sn(`Timer('${this._name}')`),this._timerHandle=null,this._expiration=0,this._callback=()=>{const e=this._expiration-hu.getEpochTime();this._logger.debug("timer completes in",e),this._expiration<=hu.getEpochTime()&&(this.cancel(),super.raise())}}static getEpochTime(){return Math.floor(Date.now()/1e3)}init(e){const n=this._logger.create("init");e=Math.max(Math.floor(e),1);const r=hu.getEpochTime()+e;if(this.expiration===r&&this._timerHandle){n.debug("skipping since already initialized for expiration at",this.expiration);return}this.cancel(),n.debug("using duration",e),this._expiration=r;const i=Math.min(e,5);this._timerHandle=setInterval(this._callback,i*1e3)}get expiration(){return this._expiration}cancel(){this._logger.create("cancel"),this._timerHandle&&(clearInterval(this._timerHandle),this._timerHandle=null)}},KH=class{static readParams(t,e="query"){if(!t)throw new TypeError("Invalid URL");const r=new URL(t,"http://127.0.0.1")[e==="fragment"?"hash":"search"];return new URLSearchParams(r.slice(1))}},i1=class extends Error{constructor(t,e){var n,r,i;if(super(t.error_description||t.error||""),this.form=e,this.name="ErrorResponse",!t.error)throw sn.error("ErrorResponse","No error passed"),new Error("No error passed");this.error=t.error,this.error_description=(n=t.error_description)!=null?n:null,this.error_uri=(r=t.error_uri)!=null?r:null,this.state=t.userState,this.session_state=(i=t.session_state)!=null?i:null}},Lee=class extends Error{constructor(t){super(t),this.name="ErrorTimeout"}},jft=class{constructor(t){this._logger=new sn("AccessTokenEvents"),this._expiringTimer=new hu("Access token expiring"),this._expiredTimer=new hu("Access token expired"),this._expiringNotificationTimeInSeconds=t.expiringNotificationTimeInSeconds}load(t){const e=this._logger.create("load");if(t.access_token&&t.expires_in!==void 0){const n=t.expires_in;if(e.debug("access token present, remaining duration:",n),n>0){let i=n-this._expiringNotificationTimeInSeconds;i<=0&&(i=1),e.debug("registering expiring timer, raising in",i,"seconds"),this._expiringTimer.init(i)}else e.debug("canceling existing expiring timer because we're past expiration."),this._expiringTimer.cancel();const r=n+1;e.debug("registering expired timer, raising in",r,"seconds"),this._expiredTimer.init(r)}else this._expiringTimer.cancel(),this._expiredTimer.cancel()}unload(){this._logger.debug("unload: canceling existing access token timers"),this._expiringTimer.cancel(),this._expiredTimer.cancel()}addAccessTokenExpiring(t){return this._expiringTimer.addHandler(t)}removeAccessTokenExpiring(t){this._expiringTimer.removeHandler(t)}addAccessTokenExpired(t){return this._expiredTimer.addHandler(t)}removeAccessTokenExpired(t){this._expiredTimer.removeHandler(t)}},Bft=class{constructor(t,e,n,r,i){this._callback=t,this._client_id=e,this._intervalInSeconds=r,this._stopOnError=i,this._logger=new sn("CheckSessionIFrame"),this._timer=null,this._session_state=null,this._message=s=>{s.origin===this._frame_origin&&s.source===this._frame.contentWindow&&(s.data==="error"?(this._logger.error("error message from check session op iframe"),this._stopOnError&&this.stop()):s.data==="changed"?(this._logger.debug("changed message from check session op iframe"),this.stop(),this._callback()):this._logger.debug(s.data+" message from check session op iframe"))};const o=new URL(n);this._frame_origin=o.origin,this._frame=window.document.createElement("iframe"),this._frame.style.visibility="hidden",this._frame.style.position="fixed",this._frame.style.left="-1000px",this._frame.style.top="0",this._frame.width="0",this._frame.height="0",this._frame.src=o.href}load(){return new Promise(t=>{this._frame.onload=()=>{t()},window.document.body.appendChild(this._frame),window.addEventListener("message",this._message,!1)})}start(t){if(this._session_state===t)return;this._logger.create("start"),this.stop(),this._session_state=t;const e=()=>{!this._frame.contentWindow||!this._session_state||this._frame.contentWindow.postMessage(this._client_id+" "+this._session_state,this._frame_origin)};e(),this._timer=setInterval(e,this._intervalInSeconds*1e3)}stop(){this._logger.create("stop"),this._session_state=null,this._timer&&(clearInterval(this._timer),this._timer=null)}},uPe=class{constructor(){this._logger=new sn("InMemoryWebStorage"),this._data={}}clear(){this._logger.create("clear"),this._data={}}getItem(t){return this._logger.create(`getItem('${t}')`),this._data[t]}setItem(t,e){this._logger.create(`setItem('${t}')`),this._data[t]=e}removeItem(t){this._logger.create(`removeItem('${t}')`),delete this._data[t]}get length(){return Object.getOwnPropertyNames(this._data).length}key(t){return Object.getOwnPropertyNames(this._data)[t]}},$ee=class{constructor(t=[],e=null,n={}){this._jwtHandler=e,this._extraHeaders=n,this._logger=new sn("JsonService"),this._contentTypes=[],this._contentTypes.push(...t,"application/json"),e&&this._contentTypes.push("application/jwt")}async fetchWithTimeout(t,e={}){const{timeoutInSeconds:n,...r}=e;if(!n)return await fetch(t,r);const i=new AbortController,o=setTimeout(()=>i.abort(),n*1e3);try{return await fetch(t,{...e,signal:i.signal})}catch(s){throw s instanceof DOMException&&s.name==="AbortError"?new Lee("Network timed out"):s}finally{clearTimeout(o)}}async getJson(t,{token:e,credentials:n}={}){const r=this._logger.create("getJson"),i={Accept:this._contentTypes.join(", ")};e&&(r.debug("token passed, setting Authorization header"),i.Authorization="Bearer "+e),this.appendExtraHeaders(i);let o;try{r.debug("url:",t),o=await this.fetchWithTimeout(t,{method:"GET",headers:i,credentials:n})}catch(l){throw r.error("Network Error"),l}r.debug("HTTP response received, status",o.status);const s=o.headers.get("Content-Type");if(s&&!this._contentTypes.find(l=>s.startsWith(l))&&r.throw(new Error(`Invalid response Content-Type: ${s??"undefined"}, from URL: ${t}`)),o.ok&&this._jwtHandler&&(s!=null&&s.startsWith("application/jwt")))return await this._jwtHandler(await o.text());let a;try{a=await o.json()}catch(l){throw r.error("Error parsing JSON response",l),o.ok?l:new Error(`${o.statusText} (${o.status})`)}if(!o.ok)throw r.error("Error from server:",a),a.error?new i1(a):new Error(`${o.statusText} (${o.status}): ${JSON.stringify(a)}`);return a}async postForm(t,{body:e,basicAuth:n,timeoutInSeconds:r,initCredentials:i}){const o=this._logger.create("postForm"),s={Accept:this._contentTypes.join(", "),"Content-Type":"application/x-www-form-urlencoded"};n!==void 0&&(s.Authorization="Basic "+n),this.appendExtraHeaders(s);let a;try{o.debug("url:",t),a=await this.fetchWithTimeout(t,{method:"POST",headers:s,body:e,timeoutInSeconds:r,credentials:i})}catch(f){throw o.error("Network error"),f}o.debug("HTTP response received, status",a.status);const l=a.headers.get("Content-Type");if(l&&!this._contentTypes.find(f=>l.startsWith(f)))throw new Error(`Invalid response Content-Type: ${l??"undefined"}, from URL: ${t}`);const c=await a.text();let u={};if(c)try{u=JSON.parse(c)}catch(f){throw o.error("Error parsing JSON response",f),a.ok?f:new Error(`${a.statusText} (${a.status})`)}if(!a.ok)throw o.error("Error from server:",u),u.error?new i1(u,e):new Error(`${a.statusText} (${a.status}): ${JSON.stringify(u)}`);return u}appendExtraHeaders(t){const e=this._logger.create("appendExtraHeaders"),n=Object.keys(this._extraHeaders),r=["authorization","accept","content-type"];n.length!==0&&n.forEach(i=>{if(r.includes(i.toLocaleLowerCase())){e.warn("Protected header could not be overridden",i,r);return}const o=typeof this._extraHeaders[i]=="function"?this._extraHeaders[i]():this._extraHeaders[i];o&&o!==""&&(t[i]=o)})}},Uft=class{constructor(t){this._settings=t,this._logger=new sn("MetadataService"),this._signingKeys=null,this._metadata=null,this._metadataUrl=this._settings.metadataUrl,this._jsonService=new $ee(["application/jwk-set+json"],null,this._settings.extraHeaders),this._settings.signingKeys&&(this._logger.debug("using signingKeys from settings"),this._signingKeys=this._settings.signingKeys),this._settings.metadata&&(this._logger.debug("using metadata from settings"),this._metadata=this._settings.metadata),this._settings.fetchRequestCredentials&&(this._logger.debug("using fetchRequestCredentials from settings"),this._fetchRequestCredentials=this._settings.fetchRequestCredentials)}resetSigningKeys(){this._signingKeys=null}async getMetadata(){const t=this._logger.create("getMetadata");if(this._metadata)return t.debug("using cached values"),this._metadata;if(!this._metadataUrl)throw t.throw(new Error("No authority or metadataUrl configured on settings")),null;t.debug("getting metadata from",this._metadataUrl);const e=await this._jsonService.getJson(this._metadataUrl,{credentials:this._fetchRequestCredentials});return t.debug("merging remote JSON with seed metadata"),this._metadata=Object.assign({},this._settings.metadataSeed,e),this._metadata}getIssuer(){return this._getMetadataProperty("issuer")}getAuthorizationEndpoint(){return this._getMetadataProperty("authorization_endpoint")}getUserInfoEndpoint(){return this._getMetadataProperty("userinfo_endpoint")}getTokenEndpoint(t=!0){return this._getMetadataProperty("token_endpoint",t)}getCheckSessionIframe(){return this._getMetadataProperty("check_session_iframe",!0)}getEndSessionEndpoint(){return this._getMetadataProperty("end_session_endpoint",!0)}getRevocationEndpoint(t=!0){return this._getMetadataProperty("revocation_endpoint",t)}getKeysEndpoint(t=!0){return this._getMetadataProperty("jwks_uri",t)}async _getMetadataProperty(t,e=!1){const n=this._logger.create(`_getMetadataProperty('${t}')`),r=await this.getMetadata();if(n.debug("resolved"),r[t]===void 0){if(e===!0){n.warn("Metadata does not contain optional property");return}n.throw(new Error("Metadata does not contain property "+t))}return r[t]}async getSigningKeys(){const t=this._logger.create("getSigningKeys");if(this._signingKeys)return t.debug("returning signingKeys from cache"),this._signingKeys;const e=await this.getKeysEndpoint(!1);t.debug("got jwks_uri",e);const n=await this._jsonService.getJson(e);if(t.debug("got key set",n),!Array.isArray(n.keys))throw t.throw(new Error("Missing keys on keyset")),null;return this._signingKeys=n.keys,this._signingKeys}},fPe=class{constructor({prefix:t="oidc.",store:e=localStorage}={}){this._logger=new sn("WebStorageStateStore"),this._store=e,this._prefix=t}async set(t,e){this._logger.create(`set('${t}')`),t=this._prefix+t,await this._store.setItem(t,e)}async get(t){return this._logger.create(`get('${t}')`),t=this._prefix+t,await this._store.getItem(t)}async remove(t){this._logger.create(`remove('${t}')`),t=this._prefix+t;const e=await this._store.getItem(t);return await this._store.removeItem(t),e}async getAllKeys(){this._logger.create("getAllKeys");const t=await this._store.length,e=[];for(let n=0;n{const r=this._logger.create("_getClaimsFromJwt");try{const i=QH.decode(n);return r.debug("JWT decoding successful"),i}catch(i){throw r.error("Error parsing JWT response"),i}},this._jsonService=new $ee(void 0,this._getClaimsFromJwt,this._settings.extraHeaders)}async getClaims(t){const e=this._logger.create("getClaims");t||this._logger.throw(new Error("No token passed"));const n=await this._metadataService.getUserInfoEndpoint();e.debug("got userinfo url",n);const r=await this._jsonService.getJson(n,{token:t,credentials:this._settings.fetchRequestCredentials});return e.debug("got claims",r),r}},hPe=class{constructor(t,e){this._settings=t,this._metadataService=e,this._logger=new sn("TokenClient"),this._jsonService=new $ee(this._settings.revokeTokenAdditionalContentTypes,null,this._settings.extraHeaders)}async exchangeCode({grant_type:t="authorization_code",redirect_uri:e=this._settings.redirect_uri,client_id:n=this._settings.client_id,client_secret:r=this._settings.client_secret,...i}){const o=this._logger.create("exchangeCode");n||o.throw(new Error("A client_id is required")),e||o.throw(new Error("A redirect_uri is required")),i.code||o.throw(new Error("A code is required"));const s=new URLSearchParams({grant_type:t,redirect_uri:e});for(const[u,f]of Object.entries(i))f!=null&&s.set(u,f);let a;switch(this._settings.client_authentication){case"client_secret_basic":if(!r)throw o.throw(new Error("A client_secret is required")),null;a=Qd.generateBasicAuth(n,r);break;case"client_secret_post":s.append("client_id",n),r&&s.append("client_secret",r);break}const l=await this._metadataService.getTokenEndpoint(!1);o.debug("got token endpoint");const c=await this._jsonService.postForm(l,{body:s,basicAuth:a,initCredentials:this._settings.fetchRequestCredentials});return o.debug("got response"),c}async exchangeCredentials({grant_type:t="password",client_id:e=this._settings.client_id,client_secret:n=this._settings.client_secret,scope:r=this._settings.scope,...i}){const o=this._logger.create("exchangeCredentials");e||o.throw(new Error("A client_id is required"));const s=new URLSearchParams({grant_type:t,scope:r});for(const[u,f]of Object.entries(i))f!=null&&s.set(u,f);let a;switch(this._settings.client_authentication){case"client_secret_basic":if(!n)throw o.throw(new Error("A client_secret is required")),null;a=Qd.generateBasicAuth(e,n);break;case"client_secret_post":s.append("client_id",e),n&&s.append("client_secret",n);break}const l=await this._metadataService.getTokenEndpoint(!1);o.debug("got token endpoint");const c=await this._jsonService.postForm(l,{body:s,basicAuth:a,initCredentials:this._settings.fetchRequestCredentials});return o.debug("got response"),c}async exchangeRefreshToken({grant_type:t="refresh_token",client_id:e=this._settings.client_id,client_secret:n=this._settings.client_secret,timeoutInSeconds:r,...i}){const o=this._logger.create("exchangeRefreshToken");e||o.throw(new Error("A client_id is required")),i.refresh_token||o.throw(new Error("A refresh_token is required"));const s=new URLSearchParams({grant_type:t});for(const[u,f]of Object.entries(i))f!=null&&s.set(u,f);let a;switch(this._settings.client_authentication){case"client_secret_basic":if(!n)throw o.throw(new Error("A client_secret is required")),null;a=Qd.generateBasicAuth(e,n);break;case"client_secret_post":s.append("client_id",e),n&&s.append("client_secret",n);break}const l=await this._metadataService.getTokenEndpoint(!1);o.debug("got token endpoint");const c=await this._jsonService.postForm(l,{body:s,basicAuth:a,timeoutInSeconds:r,initCredentials:this._settings.fetchRequestCredentials});return o.debug("got response"),c}async revoke(t){var e;const n=this._logger.create("revoke");t.token||n.throw(new Error("A token is required"));const r=await this._metadataService.getRevocationEndpoint(!1);n.debug(`got revocation endpoint, revoking ${(e=t.token_type_hint)!=null?e:"default token type"}`);const i=new URLSearchParams;for(const[o,s]of Object.entries(t))s!=null&&i.set(o,s);i.set("client_id",this._settings.client_id),this._settings.client_secret&&i.set("client_secret",this._settings.client_secret),await this._jsonService.postForm(r,{body:i}),n.debug("got response")}},Qft=class{constructor(t,e,n){this._settings=t,this._metadataService=e,this._claimsService=n,this._logger=new sn("ResponseValidator"),this._userInfoService=new Yft(this._settings,this._metadataService),this._tokenClient=new hPe(this._settings,this._metadataService)}async validateSigninResponse(t,e){const n=this._logger.create("validateSigninResponse");this._processSigninState(t,e),n.debug("state processed"),await this._processCode(t,e),n.debug("code processed"),t.isOpenId&&this._validateIdTokenAttributes(t),n.debug("tokens validated"),await this._processClaims(t,e==null?void 0:e.skipUserInfo,t.isOpenId),n.debug("claims processed")}async validateCredentialsResponse(t,e){const n=this._logger.create("validateCredentialsResponse");t.isOpenId&&this._validateIdTokenAttributes(t),n.debug("tokens validated"),await this._processClaims(t,e,t.isOpenId),n.debug("claims processed")}async validateRefreshResponse(t,e){var n,r;const i=this._logger.create("validateRefreshResponse");t.userState=e.data,(n=t.session_state)!=null||(t.session_state=e.session_state),(r=t.scope)!=null||(t.scope=e.scope),t.isOpenId&&t.id_token&&(this._validateIdTokenAttributes(t,e.id_token),i.debug("ID Token validated")),t.id_token||(t.id_token=e.id_token,t.profile=e.profile);const o=t.isOpenId&&!!t.id_token;await this._processClaims(t,!1,o),i.debug("claims processed")}validateSignoutResponse(t,e){const n=this._logger.create("validateSignoutResponse");if(e.id!==t.state&&n.throw(new Error("State does not match")),n.debug("state validated"),t.userState=e.data,t.error)throw n.warn("Response was error",t.error),new i1(t)}_processSigninState(t,e){var n;const r=this._logger.create("_processSigninState");if(e.id!==t.state&&r.throw(new Error("State does not match")),e.client_id||r.throw(new Error("No client_id on state")),e.authority||r.throw(new Error("No authority on state")),this._settings.authority!==e.authority&&r.throw(new Error("authority mismatch on settings vs. signin state")),this._settings.client_id&&this._settings.client_id!==e.client_id&&r.throw(new Error("client_id mismatch on settings vs. signin state")),r.debug("state validated"),t.userState=e.data,(n=t.scope)!=null||(t.scope=e.scope),t.error)throw r.warn("Response was error",t.error),new i1(t);e.code_verifier&&!t.code&&r.throw(new Error("Expected code in response"))}async _processClaims(t,e=!1,n=!0){const r=this._logger.create("_processClaims");if(t.profile=this._claimsService.filterProtocolClaims(t.profile),e||!this._settings.loadUserInfo||!t.access_token){r.debug("not loading user info");return}r.debug("loading user info");const i=await this._userInfoService.getClaims(t.access_token);r.debug("user info claims received from user info endpoint"),n&&i.sub!==t.profile.sub&&r.throw(new Error("subject from UserInfo response does not match subject in ID Token")),t.profile=this._claimsService.mergeClaims(t.profile,this._claimsService.filterProtocolClaims(i)),r.debug("user info claims received, updated profile:",t.profile)}async _processCode(t,e){const n=this._logger.create("_processCode");if(t.code){n.debug("Validating code");const r=await this._tokenClient.exchangeCode({client_id:e.client_id,client_secret:e.client_secret,code:t.code,redirect_uri:e.redirect_uri,code_verifier:e.code_verifier,...e.extraTokenParams});Object.assign(t,r)}else n.debug("No code to process")}_validateIdTokenAttributes(t,e){var n;const r=this._logger.create("_validateIdTokenAttributes");r.debug("decoding ID Token JWT");const i=QH.decode((n=t.id_token)!=null?n:"");if(i.sub||r.throw(new Error("ID Token is missing a subject claim")),e){const o=QH.decode(e);i.sub!==o.sub&&r.throw(new Error("sub in id_token does not match current sub")),i.auth_time&&i.auth_time!==o.auth_time&&r.throw(new Error("auth_time in id_token does not match original auth_time")),i.azp&&i.azp!==o.azp&&r.throw(new Error("azp in id_token does not match original azp")),!i.azp&&o.azp&&r.throw(new Error("azp not in id_token, but present in original id_token"))}t.profile=i}},CS=class{constructor(t){this.id=t.id||Qd.generateUUIDv4(),this.data=t.data,t.created&&t.created>0?this.created=t.created:this.created=hu.getEpochTime(),this.request_type=t.request_type}toStorageString(){return new sn("State").create("toStorageString"),JSON.stringify({id:this.id,data:this.data,created:this.created,request_type:this.request_type})}static fromStorageString(t){return sn.createStatic("State","fromStorageString"),new CS(JSON.parse(t))}static async clearStaleState(t,e){const n=sn.createStatic("State","clearStaleState"),r=hu.getEpochTime()-e,i=await t.getAllKeys();n.debug("got keys",i);for(let o=0;ov.searchParams.append("resource",x));for(const[y,x]of Object.entries({response_mode:a,...m,...h}))x!=null&&v.searchParams.append(y,x.toString());this.url=v.href}},Zft="openid",lW=class{constructor(t){this.access_token="",this.token_type="",this.profile={},this.state=t.get("state"),this.session_state=t.get("session_state"),this.error=t.get("error"),this.error_description=t.get("error_description"),this.error_uri=t.get("error_uri"),this.code=t.get("code")}get expires_in(){if(this.expires_at!==void 0)return this.expires_at-hu.getEpochTime()}set expires_in(t){typeof t=="string"&&(t=Number(t)),t!==void 0&&t>=0&&(this.expires_at=Math.floor(t)+hu.getEpochTime())}get isOpenId(){var t;return((t=this.scope)==null?void 0:t.split(" ").includes(Zft))||!!this.id_token}},Jft=class{constructor({url:t,state_data:e,id_token_hint:n,post_logout_redirect_uri:r,extraQueryParams:i,request_type:o}){if(this._logger=new sn("SignoutRequest"),!t)throw this._logger.error("ctor: No url passed"),new Error("url");const s=new URL(t);n&&s.searchParams.append("id_token_hint",n),r&&(s.searchParams.append("post_logout_redirect_uri",r),e&&(this.state=new CS({data:e,request_type:o}),s.searchParams.append("state",this.state.id)));for(const[a,l]of Object.entries({...i}))l!=null&&s.searchParams.append(a,l.toString());this.url=s.href}},edt=class{constructor(t){this.state=t.get("state"),this.error=t.get("error"),this.error_description=t.get("error_description"),this.error_uri=t.get("error_uri")}},tdt=["nbf","jti","auth_time","nonce","acr","amr","azp","at_hash"],ndt=["sub","iss","aud","exp","iat"],rdt=class{constructor(t){this._settings=t,this._logger=new sn("ClaimsService")}filterProtocolClaims(t){const e={...t};if(this._settings.filterProtocolClaims){let n;Array.isArray(this._settings.filterProtocolClaims)?n=this._settings.filterProtocolClaims:n=tdt;for(const r of n)ndt.includes(r)||delete e[r]}return e}mergeClaims(t,e){const n={...t};for(const[r,i]of Object.entries(e))for(const o of Array.isArray(i)?i:[i]){const s=n[r];s?Array.isArray(s)?s.includes(o)||s.push(o):n[r]!==o&&(typeof o=="object"&&this._settings.mergeClaims?n[r]=this.mergeClaims(s,o):n[r]=[s,o]):n[r]=o}return n}},idt=class{constructor(t){this._logger=new sn("OidcClient"),this.settings=new dPe(t),this.metadataService=new Uft(this.settings),this._claimsService=new rdt(this.settings),this._validator=new Qft(this.settings,this.metadataService,this._claimsService),this._tokenClient=new hPe(this.settings,this.metadataService)}async createSigninRequest({state:t,request:e,request_uri:n,request_type:r,id_token_hint:i,login_hint:o,skipUserInfo:s,nonce:a,response_type:l=this.settings.response_type,scope:c=this.settings.scope,redirect_uri:u=this.settings.redirect_uri,prompt:f=this.settings.prompt,display:d=this.settings.display,max_age:h=this.settings.max_age,ui_locales:p=this.settings.ui_locales,acr_values:g=this.settings.acr_values,resource:m=this.settings.resource,response_mode:v=this.settings.response_mode,extraQueryParams:y=this.settings.extraQueryParams,extraTokenParams:x=this.settings.extraTokenParams}){const b=this._logger.create("createSigninRequest");if(l!=="code")throw new Error("Only the Authorization Code flow (with PKCE) is supported");const w=await this.metadataService.getAuthorizationEndpoint();b.debug("Received authorization endpoint",w);const _=new Kft({url:w,authority:this.settings.authority,client_id:this.settings.client_id,redirect_uri:u,response_type:l,scope:c,state_data:t,prompt:f,display:d,max_age:h,ui_locales:p,id_token_hint:i,login_hint:o,acr_values:g,resource:m,request:e,request_uri:n,extraQueryParams:y,extraTokenParams:x,request_type:r,response_mode:v,client_secret:this.settings.client_secret,skipUserInfo:s,nonce:a,disablePKCE:this.settings.disablePKCE});await this.clearStaleState();const S=_.state;return await this.settings.stateStore.set(S.id,S.toStorageString()),_}async readSigninResponseState(t,e=!1){const n=this._logger.create("readSigninResponseState"),r=new lW(KH.readParams(t,this.settings.response_mode));if(!r.state)throw n.throw(new Error("No state in response")),null;const i=await this.settings.stateStore[e?"remove":"get"](r.state);if(!i)throw n.throw(new Error("No matching state found in storage")),null;return{state:Fee.fromStorageString(i),response:r}}async processSigninResponse(t){const e=this._logger.create("processSigninResponse"),{state:n,response:r}=await this.readSigninResponseState(t,!0);return e.debug("received state from storage; validating response"),await this._validator.validateSigninResponse(r,n),r}async processResourceOwnerPasswordCredentials({username:t,password:e,skipUserInfo:n=!1,extraTokenParams:r={}}){const i=await this._tokenClient.exchangeCredentials({username:t,password:e,...r}),o=new lW(new URLSearchParams);return Object.assign(o,i),await this._validator.validateCredentialsResponse(o,n),o}async useRefreshToken({state:t,timeoutInSeconds:e}){var n;const r=this._logger.create("useRefreshToken");let i;if(this.settings.refreshTokenAllowedScope===void 0)i=t.scope;else{const a=this.settings.refreshTokenAllowedScope.split(" ");i=(((n=t.scope)==null?void 0:n.split(" "))||[]).filter(c=>a.includes(c)).join(" ")}const o=await this._tokenClient.exchangeRefreshToken({refresh_token:t.refresh_token,scope:i,timeoutInSeconds:e}),s=new lW(new URLSearchParams);return Object.assign(s,o),r.debug("validating response",s),await this._validator.validateRefreshResponse(s,{...t,scope:i}),s}async createSignoutRequest({state:t,id_token_hint:e,request_type:n,post_logout_redirect_uri:r=this.settings.post_logout_redirect_uri,extraQueryParams:i=this.settings.extraQueryParams}={}){const o=this._logger.create("createSignoutRequest"),s=await this.metadataService.getEndSessionEndpoint();if(!s)throw o.throw(new Error("No end session endpoint")),null;o.debug("Received end session endpoint",s);const a=new Jft({url:s,id_token_hint:e,post_logout_redirect_uri:r,state_data:t,extraQueryParams:i,request_type:n});await this.clearStaleState();const l=a.state;return l&&(o.debug("Signout request has state to persist"),await this.settings.stateStore.set(l.id,l.toStorageString())),a}async readSignoutResponseState(t,e=!1){const n=this._logger.create("readSignoutResponseState"),r=new edt(KH.readParams(t,this.settings.response_mode));if(!r.state){if(n.debug("No state in response"),r.error)throw n.warn("Response was error:",r.error),new i1(r);return{state:void 0,response:r}}const i=await this.settings.stateStore[e?"remove":"get"](r.state);if(!i)throw n.throw(new Error("No matching state found in storage")),null;return{state:CS.fromStorageString(i),response:r}}async processSignoutResponse(t){const e=this._logger.create("processSignoutResponse"),{state:n,response:r}=await this.readSignoutResponseState(t,!0);return n?(e.debug("Received state from storage; validating response"),this._validator.validateSignoutResponse(r,n)):e.debug("No state from storage; skipping response validation"),r}clearStaleState(){return this._logger.create("clearStaleState"),CS.clearStaleState(this.settings.stateStore,this.settings.staleStateAgeInSeconds)}async revokeToken(t,e){return this._logger.create("revokeToken"),await this._tokenClient.revoke({token:t,token_type_hint:e})}},odt=class{constructor(t){this._userManager=t,this._logger=new sn("SessionMonitor"),this._start=async e=>{const n=e.session_state;if(!n)return;const r=this._logger.create("_start");if(e.profile?(this._sub=e.profile.sub,this._sid=e.profile.sid,r.debug("session_state",n,", sub",this._sub)):(this._sub=void 0,this._sid=void 0,r.debug("session_state",n,", anonymous user")),this._checkSessionIFrame){this._checkSessionIFrame.start(n);return}try{const i=await this._userManager.metadataService.getCheckSessionIframe();if(i){r.debug("initializing check session iframe");const o=this._userManager.settings.client_id,s=this._userManager.settings.checkSessionIntervalInSeconds,a=this._userManager.settings.stopCheckSessionOnError,l=new Bft(this._callback,o,i,s,a);await l.load(),this._checkSessionIFrame=l,l.start(n)}else r.warn("no check session iframe found in the metadata")}catch(i){r.error("Error from getCheckSessionIframe:",i instanceof Error?i.message:i)}},this._stop=()=>{const e=this._logger.create("_stop");if(this._sub=void 0,this._sid=void 0,this._checkSessionIFrame&&this._checkSessionIFrame.stop(),this._userManager.settings.monitorAnonymousSession){const n=setInterval(async()=>{clearInterval(n);try{const r=await this._userManager.querySessionStatus();if(r){const i={session_state:r.session_state,profile:r.sub&&r.sid?{sub:r.sub,sid:r.sid}:null};this._start(i)}}catch(r){e.error("error from querySessionStatus",r instanceof Error?r.message:r)}},1e3)}},this._callback=async()=>{const e=this._logger.create("_callback");try{const n=await this._userManager.querySessionStatus();let r=!0;n&&this._checkSessionIFrame?n.sub===this._sub?(r=!1,this._checkSessionIFrame.start(n.session_state),n.sid===this._sid?e.debug("same sub still logged in at OP, restarting check session iframe; session_state",n.session_state):(e.debug("same sub still logged in at OP, session state has changed, restarting check session iframe; session_state",n.session_state),this._userManager.events._raiseUserSessionChanged())):e.debug("different subject signed into OP",n.sub):e.debug("subject no longer signed into OP"),r?this._sub?this._userManager.events._raiseUserSignedOut():this._userManager.events._raiseUserSignedIn():e.debug("no change in session detected, no event to raise")}catch(n){this._sub&&(e.debug("Error calling queryCurrentSigninSession; raising signed out event",n),this._userManager.events._raiseUserSignedOut())}},t||this._logger.throw(new Error("No user manager passed")),this._userManager.events.addUserLoaded(this._start),this._userManager.events.addUserUnloaded(this._stop),this._init().catch(e=>{this._logger.error(e)})}async _init(){this._logger.create("_init");const t=await this._userManager.getUser();if(t)this._start(t);else if(this._userManager.settings.monitorAnonymousSession){const e=await this._userManager.querySessionStatus();if(e){const n={session_state:e.session_state,profile:e.sub&&e.sid?{sub:e.sub,sid:e.sid}:null};this._start(n)}}}},u3=class{constructor(t){var e;this.id_token=t.id_token,this.session_state=(e=t.session_state)!=null?e:null,this.access_token=t.access_token,this.refresh_token=t.refresh_token,this.token_type=t.token_type,this.scope=t.scope,this.profile=t.profile,this.expires_at=t.expires_at,this.state=t.userState}get expires_in(){if(this.expires_at!==void 0)return this.expires_at-hu.getEpochTime()}set expires_in(t){t!==void 0&&(this.expires_at=Math.floor(t)+hu.getEpochTime())}get expired(){const t=this.expires_in;if(t!==void 0)return t<=0}get scopes(){var t,e;return(e=(t=this.scope)==null?void 0:t.split(" "))!=null?e:[]}toStorageString(){return new sn("User").create("toStorageString"),JSON.stringify({id_token:this.id_token,session_state:this.session_state,access_token:this.access_token,refresh_token:this.refresh_token,token_type:this.token_type,scope:this.scope,profile:this.profile,expires_at:this.expires_at})}static fromStorageString(t){return sn.createStatic("User","fromStorageString"),new u3(JSON.parse(t))}},Qde="oidc-client",pPe=class{constructor(){this._abort=new Vm("Window navigation aborted"),this._disposeHandlers=new Set,this._window=null}async navigate(t){const e=this._logger.create("navigate");if(!this._window)throw new Error("Attempted to navigate on a disposed window");e.debug("setting URL in window"),this._window.location.replace(t.url);const{url:n,keepOpen:r}=await new Promise((i,o)=>{const s=a=>{var l;const c=a.data,u=(l=t.scriptOrigin)!=null?l:window.location.origin;if(!(a.origin!==u||(c==null?void 0:c.source)!==Qde)){try{const f=KH.readParams(c.url,t.response_mode).get("state");if(f||e.warn("no state found in response url"),a.source!==this._window&&f!==t.state)return}catch{this._dispose(),o(new Error("Invalid response from window"))}i(c)}};window.addEventListener("message",s,!1),this._disposeHandlers.add(()=>window.removeEventListener("message",s,!1)),this._disposeHandlers.add(this._abort.addHandler(a=>{this._dispose(),o(a)}))});return e.debug("got response from window"),this._dispose(),r||this.close(),{url:n}}_dispose(){this._logger.create("_dispose");for(const t of this._disposeHandlers)t();this._disposeHandlers.clear()}static _notifyParent(t,e,n=!1,r=window.location.origin){t.postMessage({source:Qde,url:e,keepOpen:n},r)}},gPe={location:!1,toolbar:!1,height:640},mPe="_blank",sdt=60,adt=2,vPe=10,ldt=class extends dPe{constructor(t){const{popup_redirect_uri:e=t.redirect_uri,popup_post_logout_redirect_uri:n=t.post_logout_redirect_uri,popupWindowFeatures:r=gPe,popupWindowTarget:i=mPe,redirectMethod:o="assign",redirectTarget:s="self",iframeNotifyParentOrigin:a=t.iframeNotifyParentOrigin,iframeScriptOrigin:l=t.iframeScriptOrigin,silent_redirect_uri:c=t.redirect_uri,silentRequestTimeoutInSeconds:u=vPe,automaticSilentRenew:f=!0,validateSubOnSilentRenew:d=!0,includeIdTokenInSilentRenew:h=!1,monitorSession:p=!1,monitorAnonymousSession:g=!1,checkSessionIntervalInSeconds:m=adt,query_status_response_type:v="code",stopCheckSessionOnError:y=!0,revokeTokenTypes:x=["access_token","refresh_token"],revokeTokensOnSignout:b=!1,includeIdTokenInSilentSignout:w=!1,accessTokenExpiringNotificationTimeInSeconds:_=sdt,userStore:S}=t;if(super(t),this.popup_redirect_uri=e,this.popup_post_logout_redirect_uri=n,this.popupWindowFeatures=r,this.popupWindowTarget=i,this.redirectMethod=o,this.redirectTarget=s,this.iframeNotifyParentOrigin=a,this.iframeScriptOrigin=l,this.silent_redirect_uri=c,this.silentRequestTimeoutInSeconds=u,this.automaticSilentRenew=f,this.validateSubOnSilentRenew=d,this.includeIdTokenInSilentRenew=h,this.monitorSession=p,this.monitorAnonymousSession=g,this.checkSessionIntervalInSeconds=m,this.stopCheckSessionOnError=y,this.query_status_response_type=v,this.revokeTokenTypes=x,this.revokeTokensOnSignout=b,this.includeIdTokenInSilentSignout=w,this.accessTokenExpiringNotificationTimeInSeconds=_,S)this.userStore=S;else{const O=typeof window<"u"?window.sessionStorage:new uPe;this.userStore=new fPe({store:O})}}},ZH=class extends pPe{constructor({silentRequestTimeoutInSeconds:t=vPe}){super(),this._logger=new sn("IFrameWindow"),this._timeoutInSeconds=t,this._frame=ZH.createHiddenIframe(),this._window=this._frame.contentWindow}static createHiddenIframe(){const t=window.document.createElement("iframe");return t.style.visibility="hidden",t.style.position="fixed",t.style.left="-1000px",t.style.top="0",t.width="0",t.height="0",t.setAttribute("sandbox","allow-scripts allow-same-origin allow-forms"),window.document.body.appendChild(t),t}async navigate(t){this._logger.debug("navigate: Using timeout of:",this._timeoutInSeconds);const e=setTimeout(()=>this._abort.raise(new Lee("IFrame timed out without a response")),this._timeoutInSeconds*1e3);return this._disposeHandlers.add(()=>clearTimeout(e)),await super.navigate(t)}close(){var t;this._frame&&(this._frame.parentNode&&(this._frame.addEventListener("load",e=>{var n;const r=e.target;(n=r.parentNode)==null||n.removeChild(r),this._abort.raise(new Error("IFrame removed from DOM"))},!0),(t=this._frame.contentWindow)==null||t.location.replace("about:blank")),this._frame=null),this._window=null}static notifyParent(t,e){return super._notifyParent(window.parent,t,!1,e)}},cdt=class{constructor(t){this._settings=t,this._logger=new sn("IFrameNavigator")}async prepare({silentRequestTimeoutInSeconds:t=this._settings.silentRequestTimeoutInSeconds}){return new ZH({silentRequestTimeoutInSeconds:t})}async callback(t){this._logger.create("callback"),ZH.notifyParent(t,this._settings.iframeNotifyParentOrigin)}},udt=500,Kde=class extends pPe{constructor({popupWindowTarget:t=mPe,popupWindowFeatures:e={}}){super(),this._logger=new sn("PopupWindow");const n=Yde.center({...gPe,...e});this._window=window.open(void 0,t,Yde.serialize(n))}async navigate(t){var e;(e=this._window)==null||e.focus();const n=setInterval(()=>{(!this._window||this._window.closed)&&this._abort.raise(new Error("Popup closed by user"))},udt);return this._disposeHandlers.add(()=>clearInterval(n)),await super.navigate(t)}close(){this._window&&(this._window.closed||(this._window.close(),this._abort.raise(new Error("Popup closed")))),this._window=null}static notifyOpener(t,e){if(!window.opener)throw new Error("No window.opener. Can't complete notification.");return super._notifyParent(window.opener,t,e)}},fdt=class{constructor(t){this._settings=t,this._logger=new sn("PopupNavigator")}async prepare({popupWindowFeatures:t=this._settings.popupWindowFeatures,popupWindowTarget:e=this._settings.popupWindowTarget}){return new Kde({popupWindowFeatures:t,popupWindowTarget:e})}async callback(t,e=!1){this._logger.create("callback"),Kde.notifyOpener(t,e)}},ddt=class{constructor(t){this._settings=t,this._logger=new sn("RedirectNavigator")}async prepare({redirectMethod:t=this._settings.redirectMethod,redirectTarget:e=this._settings.redirectTarget}){var n;this._logger.create("prepare");let r=window.self;e==="top"&&(r=(n=window.top)!=null?n:window.self);const i=r.location[t].bind(r.location);let o;return{navigate:async s=>{this._logger.create("navigate");const a=new Promise((l,c)=>{o=c});return i(s.url),await a},close:()=>{this._logger.create("close"),o==null||o(new Error("Redirect aborted")),r.stop()}}}},hdt=class extends jft{constructor(t){super({expiringNotificationTimeInSeconds:t.accessTokenExpiringNotificationTimeInSeconds}),this._logger=new sn("UserManagerEvents"),this._userLoaded=new Vm("User loaded"),this._userUnloaded=new Vm("User unloaded"),this._silentRenewError=new Vm("Silent renew error"),this._userSignedIn=new Vm("User signed in"),this._userSignedOut=new Vm("User signed out"),this._userSessionChanged=new Vm("User session changed")}load(t,e=!0){super.load(t),e&&this._userLoaded.raise(t)}unload(){super.unload(),this._userUnloaded.raise()}addUserLoaded(t){return this._userLoaded.addHandler(t)}removeUserLoaded(t){return this._userLoaded.removeHandler(t)}addUserUnloaded(t){return this._userUnloaded.addHandler(t)}removeUserUnloaded(t){return this._userUnloaded.removeHandler(t)}addSilentRenewError(t){return this._silentRenewError.addHandler(t)}removeSilentRenewError(t){return this._silentRenewError.removeHandler(t)}_raiseSilentRenewError(t){this._silentRenewError.raise(t)}addUserSignedIn(t){return this._userSignedIn.addHandler(t)}removeUserSignedIn(t){this._userSignedIn.removeHandler(t)}_raiseUserSignedIn(){this._userSignedIn.raise()}addUserSignedOut(t){return this._userSignedOut.addHandler(t)}removeUserSignedOut(t){this._userSignedOut.removeHandler(t)}_raiseUserSignedOut(){this._userSignedOut.raise()}addUserSessionChanged(t){return this._userSessionChanged.addHandler(t)}removeUserSessionChanged(t){this._userSessionChanged.removeHandler(t)}_raiseUserSessionChanged(){this._userSessionChanged.raise()}},pdt=class{constructor(t){this._userManager=t,this._logger=new sn("SilentRenewService"),this._isStarted=!1,this._retryTimer=new hu("Retry Silent Renew"),this._tokenExpiring=async()=>{const e=this._logger.create("_tokenExpiring");try{await this._userManager.signinSilent(),e.debug("silent token renewal successful")}catch(n){if(n instanceof Lee){e.warn("ErrorTimeout from signinSilent:",n,"retry in 5s"),this._retryTimer.init(5);return}e.error("Error from signinSilent:",n),this._userManager.events._raiseSilentRenewError(n)}}}async start(){const t=this._logger.create("start");if(!this._isStarted){this._isStarted=!0,this._userManager.events.addAccessTokenExpiring(this._tokenExpiring),this._retryTimer.addHandler(this._tokenExpiring);try{await this._userManager.getUser()}catch(e){t.error("getUser error",e)}}}stop(){this._isStarted&&(this._retryTimer.cancel(),this._retryTimer.removeHandler(this._tokenExpiring),this._userManager.events.removeAccessTokenExpiring(this._tokenExpiring),this._isStarted=!1)}},gdt=class{constructor(t){this.refresh_token=t.refresh_token,this.id_token=t.id_token,this.session_state=t.session_state,this.scope=t.scope,this.profile=t.profile,this.data=t.state}},mdt=class{constructor(t){this._logger=new sn("UserManager"),this.settings=new ldt(t),this._client=new idt(t),this._redirectNavigator=new ddt(this.settings),this._popupNavigator=new fdt(this.settings),this._iframeNavigator=new cdt(this.settings),this._events=new hdt(this.settings),this._silentRenewService=new pdt(this),this.settings.automaticSilentRenew&&this.startSilentRenew(),this._sessionMonitor=null,this.settings.monitorSession&&(this._sessionMonitor=new odt(this))}get events(){return this._events}get metadataService(){return this._client.metadataService}async getUser(){const t=this._logger.create("getUser"),e=await this._loadUser();return e?(t.info("user loaded"),this._events.load(e,!1),e):(t.info("user not found in storage"),null)}async removeUser(){const t=this._logger.create("removeUser");await this.storeUser(null),t.info("user removed from storage"),this._events.unload()}async signinRedirect(t={}){this._logger.create("signinRedirect");const{redirectMethod:e,...n}=t,r=await this._redirectNavigator.prepare({redirectMethod:e});await this._signinStart({request_type:"si:r",...n},r)}async signinRedirectCallback(t=window.location.href){const e=this._logger.create("signinRedirectCallback"),n=await this._signinEnd(t);return n.profile&&n.profile.sub?e.info("success, signed in subject",n.profile.sub):e.info("no subject"),n}async signinResourceOwnerCredentials({username:t,password:e,skipUserInfo:n=!1}){const r=this._logger.create("signinResourceOwnerCredential"),i=await this._client.processResourceOwnerPasswordCredentials({username:t,password:e,skipUserInfo:n,extraTokenParams:this.settings.extraTokenParams});r.debug("got signin response");const o=await this._buildUser(i);return o.profile&&o.profile.sub?r.info("success, signed in subject",o.profile.sub):r.info("no subject"),o}async signinPopup(t={}){const e=this._logger.create("signinPopup"),{popupWindowFeatures:n,popupWindowTarget:r,...i}=t,o=this.settings.popup_redirect_uri;o||e.throw(new Error("No popup_redirect_uri configured"));const s=await this._popupNavigator.prepare({popupWindowFeatures:n,popupWindowTarget:r}),a=await this._signin({request_type:"si:p",redirect_uri:o,display:"popup",...i},s);return a&&(a.profile&&a.profile.sub?e.info("success, signed in subject",a.profile.sub):e.info("no subject")),a}async signinPopupCallback(t=window.location.href,e=!1){const n=this._logger.create("signinPopupCallback");await this._popupNavigator.callback(t,e),n.info("success")}async signinSilent(t={}){var e;const n=this._logger.create("signinSilent"),{silentRequestTimeoutInSeconds:r,...i}=t;let o=await this._loadUser();if(o!=null&&o.refresh_token){n.debug("using refresh token");const c=new gdt(o);return await this._useRefreshToken(c)}const s=this.settings.silent_redirect_uri;s||n.throw(new Error("No silent_redirect_uri configured"));let a;o&&this.settings.validateSubOnSilentRenew&&(n.debug("subject prior to silent renew:",o.profile.sub),a=o.profile.sub);const l=await this._iframeNavigator.prepare({silentRequestTimeoutInSeconds:r});return o=await this._signin({request_type:"si:s",redirect_uri:s,prompt:"none",id_token_hint:this.settings.includeIdTokenInSilentRenew?o==null?void 0:o.id_token:void 0,...i},l,a),o&&((e=o.profile)!=null&&e.sub?n.info("success, signed in subject",o.profile.sub):n.info("no subject")),o}async _useRefreshToken(t){const e=await this._client.useRefreshToken({state:t,timeoutInSeconds:this.settings.silentRequestTimeoutInSeconds}),n=new u3({...t,...e});return await this.storeUser(n),this._events.load(n),n}async signinSilentCallback(t=window.location.href){const e=this._logger.create("signinSilentCallback");await this._iframeNavigator.callback(t),e.info("success")}async signinCallback(t=window.location.href){const{state:e}=await this._client.readSigninResponseState(t);switch(e.request_type){case"si:r":return await this.signinRedirectCallback(t);case"si:p":return await this.signinPopupCallback(t);case"si:s":return await this.signinSilentCallback(t);default:throw new Error("invalid response_type in state")}}async signoutCallback(t=window.location.href,e=!1){const{state:n}=await this._client.readSignoutResponseState(t);if(n)switch(n.request_type){case"so:r":await this.signoutRedirectCallback(t);break;case"so:p":await this.signoutPopupCallback(t,e);break;case"so:s":await this.signoutSilentCallback(t);break;default:throw new Error("invalid response_type in state")}}async querySessionStatus(t={}){const e=this._logger.create("querySessionStatus"),{silentRequestTimeoutInSeconds:n,...r}=t,i=this.settings.silent_redirect_uri;i||e.throw(new Error("No silent_redirect_uri configured"));const o=await this._loadUser(),s=await this._iframeNavigator.prepare({silentRequestTimeoutInSeconds:n}),a=await this._signinStart({request_type:"si:s",redirect_uri:i,prompt:"none",id_token_hint:this.settings.includeIdTokenInSilentRenew?o==null?void 0:o.id_token:void 0,response_type:this.settings.query_status_response_type,scope:"openid",skipUserInfo:!0,...r},s);try{const l=await this._client.processSigninResponse(a.url);return e.debug("got signin response"),l.session_state&&l.profile.sub?(e.info("success for subject",l.profile.sub),{session_state:l.session_state,sub:l.profile.sub,sid:l.profile.sid}):(e.info("success, user not authenticated"),null)}catch(l){if(this.settings.monitorAnonymousSession&&l instanceof i1)switch(l.error){case"login_required":case"consent_required":case"interaction_required":case"account_selection_required":return e.info("success for anonymous user"),{session_state:l.session_state}}throw l}}async _signin(t,e,n){const r=await this._signinStart(t,e);return await this._signinEnd(r.url,n)}async _signinStart(t,e){const n=this._logger.create("_signinStart");try{const r=await this._client.createSigninRequest(t);return n.debug("got signin request"),await e.navigate({url:r.url,state:r.state.id,response_mode:r.state.response_mode,scriptOrigin:this.settings.iframeScriptOrigin})}catch(r){throw n.debug("error after preparing navigator, closing navigator window"),e.close(),r}}async _signinEnd(t,e){const n=this._logger.create("_signinEnd"),r=await this._client.processSigninResponse(t);return n.debug("got signin response"),await this._buildUser(r,e)}async _buildUser(t,e){const n=this._logger.create("_buildUser"),r=new u3(t);if(e){if(e!==r.profile.sub)throw n.debug("current user does not match user returned from signin. sub from signin:",r.profile.sub),new i1({...t,error:"login_required"});n.debug("current user matches user returned from signin")}return await this.storeUser(r),n.debug("user stored"),this._events.load(r),r}async signoutRedirect(t={}){const e=this._logger.create("signoutRedirect"),{redirectMethod:n,...r}=t,i=await this._redirectNavigator.prepare({redirectMethod:n});await this._signoutStart({request_type:"so:r",post_logout_redirect_uri:this.settings.post_logout_redirect_uri,...r},i),e.info("success")}async signoutRedirectCallback(t=window.location.href){const e=this._logger.create("signoutRedirectCallback"),n=await this._signoutEnd(t);return e.info("success"),n}async signoutPopup(t={}){const e=this._logger.create("signoutPopup"),{popupWindowFeatures:n,popupWindowTarget:r,...i}=t,o=this.settings.popup_post_logout_redirect_uri,s=await this._popupNavigator.prepare({popupWindowFeatures:n,popupWindowTarget:r});await this._signout({request_type:"so:p",post_logout_redirect_uri:o,state:o==null?void 0:{},...i},s),e.info("success")}async signoutPopupCallback(t=window.location.href,e=!1){const n=this._logger.create("signoutPopupCallback");await this._popupNavigator.callback(t,e),n.info("success")}async _signout(t,e){const n=await this._signoutStart(t,e);return await this._signoutEnd(n.url)}async _signoutStart(t={},e){var n;const r=this._logger.create("_signoutStart");try{const i=await this._loadUser();r.debug("loaded current user from storage"),this.settings.revokeTokensOnSignout&&await this._revokeInternal(i);const o=t.id_token_hint||i&&i.id_token;o&&(r.debug("setting id_token_hint in signout request"),t.id_token_hint=o),await this.removeUser(),r.debug("user removed, creating signout request");const s=await this._client.createSignoutRequest(t);return r.debug("got signout request"),await e.navigate({url:s.url,state:(n=s.state)==null?void 0:n.id})}catch(i){throw r.debug("error after preparing navigator, closing navigator window"),e.close(),i}}async _signoutEnd(t){const e=this._logger.create("_signoutEnd"),n=await this._client.processSignoutResponse(t);return e.debug("got signout response"),n}async signoutSilent(t={}){var e;const n=this._logger.create("signoutSilent"),{silentRequestTimeoutInSeconds:r,...i}=t,o=this.settings.includeIdTokenInSilentSignout?(e=await this._loadUser())==null?void 0:e.id_token:void 0,s=this.settings.popup_post_logout_redirect_uri,a=await this._iframeNavigator.prepare({silentRequestTimeoutInSeconds:r});await this._signout({request_type:"so:s",post_logout_redirect_uri:s,id_token_hint:o,...i},a),n.info("success")}async signoutSilentCallback(t=window.location.href){const e=this._logger.create("signoutSilentCallback");await this._iframeNavigator.callback(t),e.info("success")}async revokeTokens(t){const e=await this._loadUser();await this._revokeInternal(e,t)}async _revokeInternal(t,e=this.settings.revokeTokenTypes){const n=this._logger.create("_revokeInternal");if(!t)return;const r=e.filter(i=>typeof t[i]=="string");if(!r.length){n.debug("no need to revoke due to no token(s)");return}for(const i of r)await this._client.revokeToken(t[i],i),n.info(`${i} revoked successfully`),i!=="access_token"&&(t[i]=null);await this.storeUser(t),n.debug("user stored"),this._events.load(t)}startSilentRenew(){this._logger.create("startSilentRenew"),this._silentRenewService.start()}stopSilentRenew(){this._silentRenewService.stop()}get _userStoreKey(){return`user:${this.settings.authority}:${this.settings.client_id}`}async _loadUser(){const t=this._logger.create("_loadUser"),e=await this.settings.userStore.get(this._userStoreKey);return e?(t.debug("user storageString loaded"),u3.fromStorageString(e)):(t.debug("no user storageString"),null)}async storeUser(t){const e=this._logger.create("storeUser");if(t){e.debug("storing user");const n=t.toStorageString();await this.settings.userStore.set(this._userStoreKey,n)}else this._logger.debug("removing user"),await this.settings.userStore.remove(this._userStoreKey)}async clearStaleState(){await this._client.clearStaleState()}},Nee=de.createContext(void 0);Nee.displayName="AuthContext";var vdt={isLoading:!0,isAuthenticated:!1},ydt=(t,e)=>{switch(e.type){case"INITIALISED":case"USER_LOADED":return{...t,user:e.user,isLoading:!1,isAuthenticated:e.user?!e.user.expired:!1,error:void 0};case"USER_UNLOADED":return{...t,user:void 0,isAuthenticated:!1};case"NAVIGATOR_INIT":return{...t,isLoading:!0,activeNavigator:e.method};case"NAVIGATOR_CLOSE":return{...t,isLoading:!1,activeNavigator:void 0};case"ERROR":return{...t,isLoading:!1,error:e.error};default:return{...t,isLoading:!1,error:new Error(`unknown type ${e.type}`)}}},xdt=(t=window.location)=>{let e=new URLSearchParams(t.search);return!!((e.get("code")||e.get("error"))&&e.get("state")||(e=new URLSearchParams(t.hash.replace("#","?")),(e.get("code")||e.get("error"))&&e.get("state")))},bdt=t=>e=>e instanceof Error?e:new Error(t),wdt=bdt("Login failed"),_dt=["clearStaleState","querySessionStatus","revokeTokens","startSilentRenew","stopSilentRenew"],Sdt=["signinPopup","signinSilent","signinRedirect","signoutPopup","signoutRedirect","signoutSilent"],cW=t=>()=>{throw new Error(`UserManager#${t} was called from an unsupported context. If this is a server-rendered page, defer this call with useEffect() or pass a custom UserManager implementation.`)},Cdt=typeof window>"u"?null:mdt,Odt=t=>{const{children:e,onSigninCallback:n,skipSigninCallback:r,onRemoveUser:i,onSignoutRedirect:o,onSignoutPopup:s,implementation:a=Cdt,userManager:l,...c}=t,[u]=D.useState(()=>l??(a?new a(c):{settings:c})),[f,d]=D.useReducer(ydt,vdt),h=D.useMemo(()=>Object.assign({settings:u.settings,events:u.events},Object.fromEntries(_dt.map(x=>{var b,w;return[x,(w=(b=u[x])==null?void 0:b.bind(u))!=null?w:cW(x)]})),Object.fromEntries(Sdt.map(x=>[x,u[x]?async(...b)=>{d({type:"NAVIGATOR_INIT",method:x});try{return await u[x](...b)}finally{d({type:"NAVIGATOR_CLOSE"})}}:cW(x)]))),[u]),p=D.useRef(!1);D.useEffect(()=>{!u||p.current||(p.current=!0,(async()=>{let x=null;try{xdt()&&!r&&(x=await u.signinCallback(),n&&n(x)),x=x||await u.getUser(),d({type:"INITIALISED",user:x})}catch(b){d({type:"ERROR",error:wdt(b)})}})())},[u,r,n]),D.useEffect(()=>{if(!u)return;const x=_=>{d({type:"USER_LOADED",user:_})};u.events.addUserLoaded(x);const b=()=>{d({type:"USER_UNLOADED"})};u.events.addUserUnloaded(b);const w=_=>{d({type:"ERROR",error:_})};return u.events.addSilentRenewError(w),()=>{u.events.removeUserLoaded(x),u.events.removeUserUnloaded(b),u.events.removeSilentRenewError(w)}},[u]);const g=D.useCallback(u?()=>u.removeUser().then(i):cW("removeUser"),[u,i]),m=D.useCallback(x=>h.signoutRedirect(x).then(o),[h.signoutRedirect,o]),v=D.useCallback(x=>h.signoutPopup(x).then(s),[h.signoutPopup,s]),y=D.useCallback(x=>h.signoutSilent(x),[h.signoutSilent]);return de.createElement(Nee.Provider,{value:{...f,...h,removeUser:g,signoutRedirect:m,signoutPopup:v,signoutSilent:y}},e)},Edt=()=>{const t=de.useContext(Nee);if(!t)throw new Error("AuthProvider context is undefined, please verify you are calling useAuth() as child of a component.");return t};const Zde="color:green;font-weight:bold;",Tdt="color:blue;font-weight:bold;";class kdt{constructor(e){gn(this,"_languages");gn(this,"_content");gn(this,"_locale");const n=Object.getOwnPropertyNames(e.languages);if(n.findIndex(i=>i==="en")<0)throw new Error('Internal error: locale "en" must be included in supported languages');const r={};e.dictionary.forEach((i,o)=>{n.forEach(a=>{if(!i[a])throw new Error(`Internal error: invalid entry at index ${o} in "./resources/lang.json": missing translation for locale: "${a}": ${i}`)});const s=Jde(i.en);r[s]&&console.warn(`Translation already defined for "${i.en}".`),r[s]=i}),this._languages=e.languages,this._content=r,this._locale="en"}get languages(){return this._languages}get locale(){return this._locale}set locale(e){const n=Object.getOwnPropertyNames(this._languages);if(n.findIndex(r=>r===e)<0){const r=e.split("-")[0];if(n.findIndex(i=>i===r)<0){console.error(`No translations found for locale "${e}", staying with "${this._locale}".`);return}else console.warn(`No translations found for locale "${e}", falling back to "${r}".`),e=r}this._locale=e}get(e,n){const r=Jde(e),i=this._content[r];let o;return i?(o=i[this._locale],o||(console.debug(`missing translation of phrase %c${e}`,Zde,` for locale %c${this._locale}`,Tdt),o=e)):(console.debug(`missing translation for phrase %c${e}`,Zde),o=e),n&&Object.keys(n).forEach(s=>{o=o.replace("${"+s+"}",`${n[s]}`)}),o}}const Adt=()=>{let t;return navigator.languages&&navigator.languages.length>0?t=navigator.languages[0]:t=navigator.language||navigator.userLanguage||navigator.browserLanguage||"en",t.split("-")[0]},Jde=t=>t.toLowerCase(),Pdt={en:"English",de:"Deutsch",se:"Svenska"},Mdt=[{en:"OK",de:"OK",se:"OK"},{en:"Cancel",de:"Abbrechen",se:"Avbryt"},{en:"Save",de:"Speichern",se:"Spara"},{en:"Select",de:"Auswählen",se:"Välj"},{en:"Add",de:"Hinzufügen",se:"Lägg till"},{en:"Edit",de:"Bearbeiten",se:"Redigera"},{en:"Remove",de:"Entfernen",se:"Ta bort"},{en:"Dataset",de:"Datensatz",se:"Dataset"},{en:"Variable",de:"Variable",se:"Variabel"},{en:"My places",de:"Meine Orte",se:"Mina platser"},{en:"Loading places",de:"Lade Orte",se:"Laddar platser"},{en:"Places",de:"Orte",se:"Platser"},{en:"Place",de:"Ort",se:"Plats"},{en:"Time",de:"Zeit",se:"Tid"},{en:"Missing time axis",de:"Fehlende Zeitachse",se:"Saknar tidsaxel"},{en:"Geometry type",de:"Geometry-Typ",se:"Geometri typ"},{en:"Point",de:"Punkt",se:"Punkt"},{en:"Polygon",de:"Polygon",se:"Polygon"},{en:"Circle",de:"Kreis",se:"Cirkel"},{en:"Multi",de:"Multi",se:"Multi"},{en:"Something went wrong.",de:"Irgendetwas lief schief.",se:"Något gick fel."},{en:"Time-Series",de:"Zeitserie",se:"Tidsserier"},{en:"Quantity",de:"Größe",se:"Kvantitet"},{en:"unknown units",de:"unbekannte Einheiten",se:"okända enheter"},{en:"Values",de:"Werte",se:"Värden"},{en:"Start",de:"Start",se:"Start"},{en:"Stop",de:"Stopp",se:"Stopp"},{en:"Please wait...",de:"Bitte warten...",se:"Vänta ..."},{en:"Loading data",de:"Lade Daten",se:"Laddar data"},{en:"Connecting to server",de:"Verbindung zum Server wird hergestellt",se:"Ansluta till servern"},{en:"Cannot reach server",de:"Kann Server nicht erreichen",se:"Kan inte nå servern"},{en:"Language",de:"Sprache",se:"Språk"},{en:"Settings",de:"Einstellungen",se:"Inställningar"},{en:"General",de:"Allgemein",se:"Allmänhet"},{en:"System Information",de:"Systeminformation",se:"Systeminformation"},{en:"version",de:"Version",se:"Version"},{en:"Server",de:"Server",se:"Server"},{en:"Add Server",de:"Server hinzufügen",se:"Lägg till server"},{en:"Edit Server",de:"Server bearbeiten",se:"Redigera server"},{en:"Select Server",de:"Server auswählen",se:"Välj server"},{en:"On",de:"An",se:"På"},{en:"Off",de:"Aus",se:"Av"},{en:"Time interval of the player",de:"Zeitintervall des Abspielers",se:"Spelarens tidsintervall"},{en:"Show chart after adding a place",de:"Diagram anzeigen, nachdem ein Ort hinzugefügt wurde",se:"Visa diagram efter att du har lagt till en plats"},{en:"Calculate standard deviation",de:"Berechne Standardabweichung",se:"Beräkna standardavvikelsen"},{en:"Calculate median instead of mean (disables standard deviation)",de:"Median statt Mittelwert berechnen (deaktiviert Standardabweichung)",se:"Beräkna median istället för medelvärde (inaktiverar standardavvikelse)"},{en:"Minimal number of data points in a time series update",de:"Minimale Anzahl Datenpunkte in einer Zeitreihen-Aktualisierung",se:"Minimalt antal datapunkter i en tidsserieuppdatering"},{en:"Map",de:"Karte",se:"Karta"},{en:"Projection",de:"Projektion",se:"Projektion"},{en:"Geographic",de:"Geografisch",se:"Geografiskt"},{en:"Mercator",de:"Mercator",se:"Mercator"},{en:"Image smoothing",de:"Bildglättung",se:"Bildutjämning"},{en:"Show dataset boundaries",de:"Datensatzgrenzen anzeigen",se:"Visa datauppsättningsgränser"},{en:"Base map",de:"Basiskarte",se:"Grundkarta"},{en:"Hide small values",de:"Kleine Werte ausblenden",se:"Dölja små värden"},{en:"Reverse",de:"Umkehren",se:"Omvänt"},{en:"Color",de:"Farbe",se:"Färg"},{en:"Opacity",de:"Opazität",se:"Opacitet"},{en:"Value Range",de:"Wertebereich",se:"Värdeintervall"},{en:"Assign min/max from color mapping values",de:"Min./Max. aus Farbzuordnungswerten übertragen",se:"Tilldela min/max från färgmappningsvärden"},{en:"Log-scaled",de:"Log-skaliert",se:"Log-skalad"},{en:"Logarithmic scaling",de:"Logarithmische Skalierung",se:"Logaritmisk skalning"},{en:"Others",de:"Andere",se:"Andra"},{en:"Dataset information",de:"Informationen zum Datensatz",se:"Information om dataset"},{en:"Variable information",de:"Informationen zur Variablen",se:"Information om variabeln"},{en:"Place information",de:"Informationen zum Ort",se:"Platsinformation"},{en:"Dimension names",de:"Namen der Dimensionen",se:"Dimensioner namn"},{en:"Dimension data types",de:"Datentypen der Dimensionen",se:"Dimensionsdatatyper"},{en:"Dimension lengths",de:"Länge der Dimensionen",se:"Måttlängder"},{en:"Time chunk size",de:"Zeitblockgröße",se:"Tidsblockstorlek"},{en:"Geographical extent",de:"Geografische Ausdehnung",se:"Geografisk omfattning"},{en:"Spatial reference system",de:"Räumliches Bezugssystem",se:"Rumsligt referenssystem"},{en:"Name",de:"Name",se:"Namn"},{en:"Title",de:"Titel",se:"Titel"},{en:"Units",de:"Einheiten",se:"Enheter"},{en:"Expression",de:"Ausdruck",se:"Uttryck"},{en:"Data type",de:"Datentyp",se:"Datatyp"},{en:"There is no information available for this location.",de:"Zu diesem Ort sind keine keine Informationen vorhanden.",se:"Det finns ingen information tillgänglig för den här platsen."},{en:"Log out",de:"Abmelden",se:"Logga ut"},{en:"Profile",de:"Profil",se:"Profil"},{en:"User Profile",de:"Nutzerprofil",se:"Användarprofil"},{en:"User name",de:"Nutzername",se:"Användarnamn"},{en:"E-mail",de:"E-mail",se:"E-post"},{en:"Nickname",de:"Spitzname",se:"Smeknamn"},{en:"verified",de:"verifiziert",se:"verified"},{en:"not verified",de:"nicht verifiziert",se:"inte verifierad"},{en:"RGB",de:"RGB",se:"RGB"},{en:"Imprint",de:"Impressum",se:"Avtryck"},{en:"User Manual",de:"Benutzerhandbuch",se:"Användarmanual"},{en:"Show time-series diagram",de:"Zeitserien-Diagramm anzeigen",se:"Visa tidsseriediagram"},{en:"Add Statistics",de:"Statistiken hinzufügen",se:"Lägg till statistik"},{en:"Help",de:"Hilfe",se:"Hjälp"},{en:"Copy snapshot of chart to clipboard",de:"Schnappschuss des Diagramms in die Zwischenablage kopieren",se:"Kopiera ögonblicksbild av diagrammet till urklipp"},{en:"Snapshot copied to clipboard",de:"Schnappschuss wurde in die Zwischenablage kopiert",se:"Ögonblicksbild har kopierats till urklipp"},{en:"Error copying snapshot to clipboard",de:"Fehler beim Kopieren des Schnappschusses in die Zwischenablage",se:"Det gick inte att kopiera ögonblicksbilden till urklipp"},{en:"Export data",de:"Daten exportieren",se:"Exportera data"},{en:"Export Settings",de:"Export-Einstellungen",se:"Exportera Inställningar"},{en:"Include time-series data",de:"Zeitseriendaten einschließen",se:"Inkludera tidsseriedata"},{en:"Include places data",de:"Ortsdaten einschließen",se:"Inkludera platsdata"},{en:"File name",de:"Dateiname",se:"Filnamn"},{en:"Separator for time-series data",de:"Trennzeichen für Zeitreihendaten",se:"Separator för tidsseriedata"},{en:"Combine place data in one file",de:"Ortsdaten in einer Datei zusammenfassen",se:"Kombinera platsdata i en fil"},{en:"As ZIP archive",de:"Als ZIP-Archiv",se:"Som ett ZIP-arkiv"},{en:"Download",de:"Herunterladen",se:"Ladda ner"},{en:"Locate place in map",de:"Lokalisiere Ort in Karte",se:"Leta upp plats på kartan"},{en:"Locate dataset in map",de:"Lokalisiere Datensatz in Karte",se:"Leta upp dataset på kartan"},{en:"Open information panel",de:"Informationsfeld öffnen",se:"Öppet informationsfält"},{en:"Select a place in map",de:"Ort in der Karte auswählen",se:"Välj plats på kartan"},{en:"Add a point location in map",de:"Punkt zur Karte hinzufügen",se:"Lägg till punkt på kartan"},{en:"Draw a polygon area in map",de:"Polygonale Fläche in der Karte zeichnen",se:"Rita en polygonal yta på kartan"},{en:"Draw a circular area in map",de:"Kreisförmige Fläche in der Karte zeichnen",se:"Rita ett cirkulärt område på kartan"},{en:"Rename place",de:"Ort umbenennen",se:"Byt namn på plats"},{en:"Style place",de:"Ort stylen",se:"Styla plats"},{en:"Remove place",de:"Ort entfernen",se:"Ta bort plats"},{en:"Rename place group",de:"Ortsgruppe umbenennen",se:"Byt namn på platsgrupp"},{en:"Remove places",de:"Orte entfernen",se:"Ta bort platser"},{en:"Show RGB layer instead",de:"Stattdessen RGB-Layer anzeigen",se:"Visa RGB-lager istället"},{en:"Auto-step through times in the dataset",de:"Zeiten im Datensatz automatisch durchlaufen",se:"Kör automatiskt genom tider i dataposten"},{en:"First time step",de:"Erster Zeitschritt",se:"Första tidssteg"},{en:"Last time step",de:"Letzter Zeitschritt",se:"Sista tidssteg"},{en:"Previous time step",de:"Vorheriger Zeitschritt",se:"Föregående tidssteg"},{en:"Next time step",de:"Nächster Zeitschritt",se:"Nästa tidssteg"},{en:"Select time in dataset",de:"Datensatz-Zeit auswählen",se:"Välj tid i dataset"},{en:"Refresh",de:"Aktualisieren",se:"Att uppdatera"},{en:"Accept and continue",de:"Akzeptieren und weiter",se:"Acceptera och fortsätt"},{en:"Leave",de:"Verlassen",se:"Lämna"},{en:"Import places",de:"Orte importieren",se:"Importera platser"},{en:"Text/CSV",de:"Text/CSV",se:"Text/CSV"},{en:"GeoJSON",de:"GeoJSON",se:"GeoJSON"},{en:"WKT",de:"WKT",se:"WKT"},{en:"Enter text or drag & drop a text file.",de:"Text eingeben oder Textdatei per Drag & Drop einfügen.",se:"Skriv in text eller dra och släpp en textfil."},{en:"From File",de:"Aus Datei",se:"Från fil"},{en:"Clear",de:"Löschen",se:"Tömma"},{en:"Options",de:"Optionen",se:"Alternativ"},{en:"Time (UTC, ISO-format)",de:"Zeit (UTC, ISO-Format)",se:"Tid (UTC, ISO-format)"},{en:"Group",de:"Gruppe",se:"Grupp"},{en:"Label",de:"Label",se:"Etikett"},{en:"Time property names",de:"Eigenschaftsnamen für Zeit",se:"Gruppegendomsnamn"},{en:"Group property names",de:"Eigenschaftsnamen für Gruppe",se:"Gruppegendomsnamn"},{en:"Label property names",de:"Eigenschaftsnamen für Label",se:"Etikett egendomsnamn"},{en:"Group prefix (used as fallback)",de:"Gruppen-Präfix (als Fallback verwendet)",se:"Gruppprefix (används som reserv)"},{en:"Label prefix (used as fallback)",de:"Label-Präfix (als Fallback verwendet)",se:"Etikettprefix (används som reserv)"},{en:"X/longitude column names",de:"Spaltennamen für y/Längengrad",se:"X/longitud kolumnnamn"},{en:"Y/latitude column names",de:"Spaltennamen für y/Breitengrad",se:"Y/latitud kolumnnamn"},{en:"Geometry column names",de:"Spaltennamen für Geometrie",se:"Geometrikolumnnamn"},{en:"Time column names",de:"Spaltennamen für Zeit",se:"Tidskolumnnamn"},{en:"Group column names",de:"Spaltennamen für Gruppe",se:"Gruppkolumnnamn"},{en:"Label column names",de:"Spaltennamen für Label",se:"Etikettkolumnnamn"},{en:"Separator character",de:"Trennzeichen",se:"Skiljetecken"},{en:"Comment character",de:"Kommentar-Zeichen",se:"Kommentar karaktär"},{en:"Quote character",de:"Zitierzeichen",se:"Citat karaktär"},{en:"Escape character",de:"Escape character",se:"Escape karaktär"},{en:"Not-a-number token",de:"Token für 'keine Zahl'",se:"Not-a-number token"},{en:"True token",de:"Token für 'wahr'",se:"Sann token"},{en:"False token",de:"Token für 'falsch'",se:"Falsk token"},{en:"Revoke consent",de:"Zustimmung widerrufen",se:"Återkalla samtycke "},{en:"Accepted",de:"Akzeptiert",se:"Accepterad"},{en:"Legal Agreement",de:"Rechtliches Übereinkommen",se:"Laglig Överenskommelse"},{en:"Privacy Notice",de:"Datenschutzhinweis",se:"Sekretessmeddelande"},{en:"WMS URL",de:"WMS URL",se:"WMS URL"},{en:"WMS Layer",de:"WMS Layer",se:"WMS Lager"},{en:"Add layer from a Web Map Service",de:"Layer aus einem Web Map Service hinzufügen",se:"Lägg till lager från en Web Map Service"},{en:"Add layer from a Tiled Web Map",de:"Layer aus einer Tiled Web Map hinzufügen",se:"Lägg till lager från en Tiled Web Map"},{en:"Show or hide layers panel",de:"Layer-Bedienfeld ein- oder ausblenden",se:"Visa eller dölj panelen Lager"},{en:"Turn layer split mode on or off",de:"Layer-Split-Modus ein- oder ausschalten",se:"Aktivera eller inaktivera lagerdelningsläget"},{en:"Turn info box on or off",de:"Infobox ein- oder ausschalten",se:"Slå på eller av informationsrutan"},{en:"Show or hide sidebar",de:"Seitenleiste ein- oder ausblenden",se:"Visa eller dölja sidofält"},{en:"Unknown color bar",de:"Unbekannte Farbskala",se:"Färgskala okänd"},{en:"Points",de:"Punkte",se:"Punkter"},{en:"Lines",de:"Linien",se:"Linjer"},{en:"Bars",de:"Balken",se:"Staplar"},{en:"Default chart type",de:"Diagrammtyp (default)",se:"Diagramtyp (default)"},{en:"User Base Maps",de:"Nutzer Basiskarte",se:"Användare Grundkarta"},{en:"Overlay",de:"Overlay (überlagernder Layer)",se:"Overlay (överliggande lager)"},{en:"User Overlays",de:"Nutzer Overlay",se:"Användare Overlay"},{en:"On dataset selection",de:"Bei Auswahl von Datensatz",se:"Vid val av dataset"},{en:"On place selection",de:"Bei Auswahl von Ort",se:"Vid val av plats"},{en:"Do nothing",de:"Nichts tun",se:"Gör ingenting"},{en:"Pan",de:"Verschieben",se:"Panorera"},{en:"Pan and zoom",de:"Verschieben und zoom",se:"Panorera och zooma"},{en:"User Layers",de:"Nutzer Layer",se:"Användare lager"},{en:"XYZ Layer URL",de:"XYZ-Layer URL",se:"XYZ lager URL"},{en:"Layer Title",de:"Layer Titel",se:"Lagertitel "},{en:"Layer Attribution",de:"Layer Attribution",se:"Lagerattribution"},{en:"Info",de:"Info",se:"Info"},{en:"Charts",de:"Diagramme",se:"Diagrammer"},{en:"Statistics",de:"Statistik",se:"Statistik"},{en:"Volume",de:"Volumen",se:"Volym"},{en:"Toggle zoom mode (or press CTRL key)",de:"Zoom-Modus umschalten (oder drücke CTRL-Taste)",se:"Växla zoomläge (eller tryck på CTRL-tangenten)"},{en:"Enter fixed y-range",de:"Festen y-Bereich angeben",se:"Ange fast y-intervall"},{en:"Toggle showing info popup on hover",de:"Anzeige des Info-Popups bei Hover umschalten",se:"Växla visning av popup-info vid hover"},{en:"Show points",de:"Punkte anzeigen",se:"Visa punkter"},{en:"Show lines",de:"Linien anzeigen",se:"Visa linjer"},{en:"Show bars",de:"Balken anzeigen",se:"Visa staplar"},{en:"Show standard deviation (if any)",de:"Standardabweichung anzeigen",se:"Visa standardavvikelsen"},{en:"Add time-series from places",de:"Zeitserien hinzufügen von Orten",se:"Lägg till tidsserier från platser"},{en:"Zoom to full range",de:"Zoom auf gesamten x-Bereich",se:"Zooma till hela x-intervallet"},{en:"Make it 2nd variable for comparison",de:"Festlegen als 2. Variable für Vergleich",se:"Ställ in som 2:a variabel för jämförelse"},{en:"Load Volume Data",de:"Lade Volumendaten",se:"Ladda volymdata"},{en:"Please note that the 3D volume rendering is still an experimental feature.",de:"Bitte beachte, dass das 3D-Volumen-Rendering noch eine experimentelle Funktion ist.",se:"Observera att 3D-volymrendering fortfarande är en experimentell funktion."},{en:"User-defined color bars.",de:"Benutzerdefinierte Farbskalen.",se:"Användardefinierade färgskalor."},{en:"Contin.",de:"Kontin.",se:"Kontin."},{en:"Stepwise",de:"Schrittw.",se:"Stegvis"},{en:"Categ.",de:"Kateg.",se:"Kateg."},{en:"Continuous color assignment, where each value represents a support point of a color gradient",de:"Kontinuierliche Farbzuordnung, bei der jeder Wert eine Stützstelle eines Farbverlaufs darstellt",se:"Kontinuerlig färgtilldelning där varje värde representerar en punkt i en färggradient"},{en:"Stepwise color mapping where values are bounds of value ranges mapped to the same color",de:"Schrittweise Farbzuordnung, bei der die Werte Bereichsgrenzen darstellen, die einer einzelnen Farbe zugeordnet werden",se:"Gradvis färgmappning, där värdena representerar intervallgränser mappade till en enda färg"},{en:"Values represent unique categories or indexes that are mapped to a color",de:"Werte stellen eindeutige Kategorien oder Indizes dar, die einer Farbe zugeordnet sind",se:"Värden representerar unika kategorier eller index som är mappade till en färg"},{en:"User",de:"Nutzer",se:"Användare"},{en:"Add Time-Series",de:"Zeitserien hinzufügen",se:"Lägg till tidsserier"},{en:"No time-series have been obtained yet. Select a variable and a place first.",de:"Es wurden noch keine Zeitreihen abgerufen. Wähle zuerst eine Variable und einen Ort aus.",se:"Inga tidsserier har hämtats ännu. Välj först en variabel och en plats."},{en:"Count",de:"Anzahl",se:"Antal"},{en:"Minimum",de:"Minimum",se:"Minimum"},{en:"Maximum",de:"Maximum",se:"Maximum"},{en:"Mean",de:"Mittelwert",se:"Medelvärde"},{en:"Deviation",de:"Abweichung",se:"Avvikelse"},{en:"Toggle adjustable x-range",de:"Anpassbaren x-Bereich umschalten",se:"Växla justerbart x-intervall"},{en:"pinned",de:"angepinnt",se:"fäst"},{en:"Compare Mode (Drag)",de:"Vergleichsmodus (Ziehen)",se:"Jämförelseläge (Dra)"},{en:"Point Info Mode (Hover)",de:"Punktinformationsmodus (Bewegen)",se:"Punktinformationsläge (Sväva)"},{en:"Dataset RGB",de:"Datensatz RGB",se:"Dataset RGB"},{en:"Dataset RGB 2",de:"Datensatz RGB 2",se:"Dataset RGB 2"},{en:"Dataset Variable",de:"Datensatz Variable",se:"Dataset Variabel"},{en:"Dataset Variable 2",de:"Datensatz Variable 2",se:"Dataset Variabel 2"},{en:"Dataset Boundary",de:"Datensatz Außengrenze",se:"Dataset Yttre Gräns"},{en:"Dataset Places",de:"Datensatz Orte",se:"Dataset Platser"},{en:"User Places",de:"Nutzer Orte",se:"Användare Platser"},{en:"Layers",de:"Layer",se:"Lager"},{en:"User Variables",de:"Nutzer-Variablen",se:"Användarvariabler"},{en:"Create and manage user variables",de:"Nutzer-Variablen erstellen und verwalten",se:"Skapa och hantera användarvariabler"},{en:"Manage user variables",de:"Nutzer-Variablen verwalten",se:"Hantera användarvariabler"},{en:"Add user variable",de:"Nutzer-Variable hinzufügen",se:"Lägg till användarvariabel"},{en:"Duplicate user variable",de:"Nutzer-Variable duplizieren",se:"Duplicera användarvariabel"},{en:"Edit user variable",de:"Nutzer-Variable bearbeiten",se:"Redigera användarvariabel"},{en:"Remove user variable",de:"Nutzer-Variable löschen",se:"Ta bort användarvariabel"},{en:"Use keys CTRL+SPACE to show autocompletions",de:"Tasten STRG+LEER benutzen, um Autovervollständigungen zu zeigen",se:"Använd tangenterna CTRL+MELLANSLAG för att visa autoslutföranden"},{en:"Display further elements to be used in expressions",de:"Weitere Elemente anzeigen, die in Ausdrücken verwendet werden können",se:"Visa fler element som kan användas i uttryck"},{en:"Variables",de:"Variablen",se:"Variabler"},{en:"Constants",de:"Konstanten",se:"Konstanter"},{en:"Array operators",de:"Array-Operatoren",se:"Arrayoperatorer"},{en:"Other operators",de:"Andere Operatoren",se:"Andra Operatorer"},{en:"Array functions",de:"Array-Funktionen",se:"Arrayfunktioner"},{en:"Other functions",de:"Andere Funktionen",se:"Andra funktioner"},{en:"Not a valid identifier",de:"Kein gültiger Bezeichner",se:"Inte en giltig identifierare"},{en:"Must not be empty",de:"Darf nicht leer sein",se:"Får inte vara tom"},{en:"Textual format",de:"Textformat",se:"Textformat"},{en:"Tabular format",de:"Tabellenformat",se:"Tabellformat"},{en:"JSON format",de:"JSON-Format",se:"JSON-format"},{en:"docs/privacy-note.en.md",de:"docs/privacy-note.de.md",se:"docs/privacy-note.se.md"},{en:"docs/add-layer-wms.en.md",de:"docs/add-layer-wms.de.md",se:"docs/add-layer-wms.se.md"},{en:"docs/add-layer-xyz.en.md",de:"docs/add-layer-xyz.de.md",se:"docs/add-layer-xyz.se.md"},{en:"docs/color-mappings.en.md",de:"docs/color-mappings.de.md",se:"docs/color-mappings.se.md"},{en:"docs/user-variables.en.md",de:"docs/user-variables.de.md",se:"docs/user-variables.se.md"}],Rdt={languages:Pdt,dictionary:Mdt},ge=new kdt(Rdt);ge.locale=Adt();class yPe extends D.Component{constructor(e){super(e),this.state={error:null}}static getDerivedStateFromError(e){return{error:e}}componentDidCatch(e,n){console.error(e),n.componentStack&&console.error(n.componentStack)}render(){if(!this.props.children)throw new Error("An ErrorBoundary requires at least one child");return this.state.error?C.jsxs("div",{children:[C.jsx("h2",{className:"errorBoundary-header",children:ge.get("Something went wrong.")}),C.jsxs("details",{className:"errorBoundary-details",style:{whiteSpace:"pre-wrap"},children:[this.state.error.toString(),C.jsx("br",{})]})]}):this.props.children}}const Ddt=({children:t})=>{const e=wn.instance.authClient;if(!e)return C.jsx(C.Fragment,{children:t});const n=o=>{console.info("handleSigninCallback:",o),window.history.replaceState({},document.title,window.location.pathname)},r=()=>{console.info("handleRemoveUser"),window.location.pathname="/"},i=ZC.href;return C.jsx(yPe,{children:C.jsx(Odt,{...e,loadUserInfo:!0,scope:"openid email profile",automaticSilentRenew:!0,redirect_uri:i,post_logout_redirect_uri:i,popup_post_logout_redirect_uri:i,onSigninCallback:n,onRemoveUser:r,children:t})})},xPe=lt(C.jsx("path",{d:"M11 18h2v-2h-2zm1-16C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8m0-14c-2.21 0-4 1.79-4 4h2c0-1.1.9-2 2-2s2 .9 2 2c0 2-3 1.75-3 5h2c0-2.25 3-2.5 3-5 0-2.21-1.79-4-4-4"}),"HelpOutline"),bPe=lt(C.jsx("path",{d:"M19.14 12.94c.04-.3.06-.61.06-.94 0-.32-.02-.64-.07-.94l2.03-1.58c.18-.14.23-.41.12-.61l-1.92-3.32c-.12-.22-.37-.29-.59-.22l-2.39.96c-.5-.38-1.03-.7-1.62-.94l-.36-2.54c-.04-.24-.24-.41-.48-.41h-3.84c-.24 0-.43.17-.47.41l-.36 2.54c-.59.24-1.13.57-1.62.94l-2.39-.96c-.22-.08-.47 0-.59.22L2.74 8.87c-.12.21-.08.47.12.61l2.03 1.58c-.05.3-.09.63-.09.94s.02.64.07.94l-2.03 1.58c-.18.14-.23.41-.12.61l1.92 3.32c.12.22.37.29.59.22l2.39-.96c.5.38 1.03.7 1.62.94l.36 2.54c.05.24.24.41.48.41h3.84c.24 0 .44-.17.47-.41l.36-2.54c.59-.24 1.13-.56 1.62-.94l2.39.96c.22.08.47 0 .59-.22l1.92-3.32c.12-.22.07-.47-.12-.61zM12 15.6c-1.98 0-3.6-1.62-3.6-3.6s1.62-3.6 3.6-3.6 3.6 1.62 3.6 3.6-1.62 3.6-3.6 3.6"}),"Settings"),wPe=lt(C.jsx("path",{d:"M17.65 6.35C16.2 4.9 14.21 4 12 4c-4.42 0-7.99 3.58-7.99 8s3.57 8 7.99 8c3.73 0 6.84-2.55 7.73-6h-2.08c-.82 2.33-3.04 4-5.65 4-3.31 0-6-2.69-6-6s2.69-6 6-6c1.66 0 3.14.69 4.22 1.78L13 11h7V4z"}),"Refresh"),_Pe=lt(C.jsx("path",{d:"M18 16.08c-.76 0-1.44.3-1.96.77L8.91 12.7c.05-.23.09-.46.09-.7s-.04-.47-.09-.7l7.05-4.11c.54.5 1.25.81 2.04.81 1.66 0 3-1.34 3-3s-1.34-3-3-3-3 1.34-3 3c0 .24.04.47.09.7L8.04 9.81C7.5 9.31 6.79 9 6 9c-1.66 0-3 1.34-3 3s1.34 3 3 3c.79 0 1.5-.31 2.04-.81l7.12 4.16c-.05.21-.08.43-.08.65 0 1.61 1.31 2.92 2.92 2.92s2.92-1.31 2.92-2.92-1.31-2.92-2.92-2.92"}),"Share"),Idt=lt([C.jsx("path",{d:"m21 5-9-4-9 4v6c0 5.55 3.84 10.74 9 12 2.3-.56 4.33-1.9 5.88-3.71l-3.12-3.12c-1.94 1.29-4.58 1.07-6.29-.64-1.95-1.95-1.95-5.12 0-7.07s5.12-1.95 7.07 0c1.71 1.71 1.92 4.35.64 6.29l2.9 2.9C20.29 15.69 21 13.38 21 11z"},"0"),C.jsx("circle",{cx:"12",cy:"12",r:"3"},"1")],"Policy"),SPe=lt(C.jsx("path",{d:"M19.35 10.04C18.67 6.59 15.64 4 12 4 9.11 4 6.6 5.64 5.35 8.04 2.34 8.36 0 10.91 0 14c0 3.31 2.69 6 6 6h13c2.76 0 5-2.24 5-5 0-2.64-2.05-4.78-4.65-4.96M17 13l-5 5-5-5h3V9h4v4z"}),"CloudDownload");var Nh=function(){function t(e){this.propagationStopped,this.defaultPrevented,this.type=e,this.target=null}return t.prototype.preventDefault=function(){this.defaultPrevented=!0},t.prototype.stopPropagation=function(){this.propagationStopped=!0},t}();const OS={PROPERTYCHANGE:"propertychange"};var zee=function(){function t(){this.disposed=!1}return t.prototype.dispose=function(){this.disposed||(this.disposed=!0,this.disposeInternal())},t.prototype.disposeInternal=function(){},t}();function Ldt(t,e,n){for(var r,i,o=o1,s=0,a=t.length,l=!1;s>1),i=+o(t[r],e),i<0?s=r+1:(a=r,l=!i);return l?s:~s}function o1(t,e){return t>e?1:t0){for(i=1;i0?i-1:i:t[i-1]-e0||s===0)})}function Mx(){return!0}function IM(){return!1}function s1(){}function Ndt(t){var e=!1,n,r,i;return function(){var o=Array.prototype.slice.call(arguments);return(!e||this!==i||!eb(o,r))&&(e=!0,i=this,r=o,n=t.apply(this,arguments)),n}}var fi=typeof Object.assign=="function"?Object.assign:function(t,e){if(t==null)throw new TypeError("Cannot convert undefined or null to object");for(var n=Object(t),r=1,i=arguments.length;r0:!1},e.prototype.removeEventListener=function(n,r){var i=this.listeners_&&this.listeners_[n];if(i){var o=i.indexOf(r);o!==-1&&(this.pendingRemovals_&&n in this.pendingRemovals_?(i[o]=s1,++this.pendingRemovals_[n]):(i.splice(o,1),i.length===0&&delete this.listeners_[n]))}},e}(zee);const nn={CHANGE:"change",ERROR:"error",BLUR:"blur",CLEAR:"clear",CONTEXTMENU:"contextmenu",CLICK:"click",DBLCLICK:"dblclick",DRAGENTER:"dragenter",DRAGOVER:"dragover",DROP:"drop",FOCUS:"focus",KEYDOWN:"keydown",KEYPRESS:"keypress",LOAD:"load",RESIZE:"resize",TOUCHMOVE:"touchmove",WHEEL:"wheel"};function zn(t,e,n,r,i){if(r&&r!==t&&(n=n.bind(r)),i){var o=n;n=function(){t.removeEventListener(e,n),o.apply(this,arguments)}}var s={target:t,type:e,listener:n};return t.addEventListener(e,n),s}function GF(t,e,n,r){return zn(t,e,n,r,!0)}function ri(t){t&&t.target&&(t.target.removeEventListener(t.type,t.listener),LM(t))}var jdt=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),$M=function(t){jdt(e,t);function e(){var n=t.call(this)||this;return n.on=n.onInternal,n.once=n.onceInternal,n.un=n.unInternal,n.revision_=0,n}return e.prototype.changed=function(){++this.revision_,this.dispatchEvent(nn.CHANGE)},e.prototype.getRevision=function(){return this.revision_},e.prototype.onInternal=function(n,r){if(Array.isArray(n)){for(var i=n.length,o=new Array(i),s=0;s=0||ey.match(/cpu (os|iphone os) 15_4 like mac os x/));var Ydt=ey.indexOf("webkit")!==-1&&ey.indexOf("edge")==-1,Qdt=ey.indexOf("macintosh")!==-1,TPe=typeof devicePixelRatio<"u"?devicePixelRatio:1,E4=typeof WorkerGlobalScope<"u"&&typeof OffscreenCanvas<"u"&&self instanceof WorkerGlobalScope,Kdt=typeof Image<"u"&&Image.prototype.decode,kPe=function(){var t=!1;try{var e=Object.defineProperty({},"passive",{get:function(){t=!0}});window.addEventListener("_",null,e),window.removeEventListener("_",null,e)}catch{}return t}();new Array(6);function dh(){return[1,0,0,1,0,0]}function Zdt(t,e,n,r,i,o,s){return t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=o,t[5]=s,t}function Jdt(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t}function Ui(t,e){var n=e[0],r=e[1];return e[0]=t[0]*n+t[2]*r+t[4],e[1]=t[1]*n+t[3]*r+t[5],e}function eht(t,e,n){return Zdt(t,e,0,0,n,0,0)}function Dg(t,e,n,r,i,o,s,a){var l=Math.sin(o),c=Math.cos(o);return t[0]=r*c,t[1]=i*l,t[2]=-r*l,t[3]=i*c,t[4]=s*r*c-a*r*l+e,t[5]=s*i*l+a*i*c+n,t}function Bee(t,e){var n=tht(e);bn(n!==0,32);var r=e[0],i=e[1],o=e[2],s=e[3],a=e[4],l=e[5];return t[0]=s/n,t[1]=-i/n,t[2]=-o/n,t[3]=r/n,t[4]=(o*l-s*a)/n,t[5]=-(r*l-i*a)/n,t}function tht(t){return t[0]*t[3]-t[1]*t[2]}var the;function APe(t){var e="matrix("+t.join(", ")+")";if(E4)return e;var n=the||(the=document.createElement("div"));return n.style.transform=e,n.style.transform}const Po={UNKNOWN:0,INTERSECTING:1,ABOVE:2,RIGHT:4,BELOW:8,LEFT:16};function nhe(t){for(var e=Sc(),n=0,r=t.length;ni&&(l=l|Po.RIGHT),ao&&(l=l|Po.ABOVE),l===Po.UNKNOWN&&(l=Po.INTERSECTING),l}function Sc(){return[1/0,1/0,-1/0,-1/0]}function Bf(t,e,n,r,i){return i?(i[0]=t,i[1]=e,i[2]=n,i[3]=r,i):[t,e,n,r]}function NM(t){return Bf(1/0,1/0,-1/0,-1/0,t)}function rht(t,e){var n=t[0],r=t[1];return Bf(n,r,n,r,e)}function MPe(t,e,n,r,i){var o=NM(i);return DPe(o,t,e,n,r)}function cA(t,e){return t[0]==e[0]&&t[2]==e[2]&&t[1]==e[1]&&t[3]==e[3]}function RPe(t,e){return e[0]t[2]&&(t[2]=e[2]),e[1]t[3]&&(t[3]=e[3]),t}function tk(t,e){e[0]t[2]&&(t[2]=e[0]),e[1]t[3]&&(t[3]=e[1])}function DPe(t,e,n,r,i){for(;ne[0]?r[0]=t[0]:r[0]=e[0],t[1]>e[1]?r[1]=t[1]:r[1]=e[1],t[2]=e[0]&&t[1]<=e[3]&&t[3]>=e[1]}function qee(t){return t[2]=s&&g<=l),!r&&o&Po.RIGHT&&!(i&Po.RIGHT)&&(m=h-(d-l)*p,r=m>=a&&m<=c),!r&&o&Po.BELOW&&!(i&Po.BELOW)&&(g=d-(h-a)/p,r=g>=s&&g<=l),!r&&o&Po.LEFT&&!(i&Po.LEFT)&&(m=h-(d-s)*p,r=m>=a&&m<=c)}return r}function lht(t,e,n,r){var i=[],o;i=[t[0],t[1],t[2],t[1],t[2],t[3],t[0],t[3]],e(i,i,2);for(var s=[],a=[],o=0,l=i.length;o=n[2])){var i=Kr(n),o=Math.floor((r[0]-n[0])/i),s=o*i;t[0]-=s,t[2]-=s}return t}function cht(t,e){if(e.canWrapX()){var n=e.getExtent();if(!isFinite(t[0])||!isFinite(t[2]))return[[n[0],t[1],n[2],t[3]]];IPe(t,e);var r=Kr(n);if(Kr(t)>r)return[[n[0],t[1],n[2],t[3]]];if(t[0]n[2])return[[t[0],t[1],n[2],t[3]],[n[0],t[1],t[2]-r,t[3]]]}return[t]}var LPe=function(){function t(e){this.code_=e.code,this.units_=e.units,this.extent_=e.extent!==void 0?e.extent:null,this.worldExtent_=e.worldExtent!==void 0?e.worldExtent:null,this.axisOrientation_=e.axisOrientation!==void 0?e.axisOrientation:"enu",this.global_=e.global!==void 0?e.global:!1,this.canWrapX_=!!(this.global_&&this.extent_),this.getPointResolutionFunc_=e.getPointResolution,this.defaultTileGrid_=null,this.metersPerUnit_=e.metersPerUnit}return t.prototype.canWrapX=function(){return this.canWrapX_},t.prototype.getCode=function(){return this.code_},t.prototype.getExtent=function(){return this.extent_},t.prototype.getUnits=function(){return this.units_},t.prototype.getMetersPerUnit=function(){return this.metersPerUnit_||jf[this.units_]},t.prototype.getWorldExtent=function(){return this.worldExtent_},t.prototype.getAxisOrientation=function(){return this.axisOrientation_},t.prototype.isGlobal=function(){return this.global_},t.prototype.setGlobal=function(e){this.global_=e,this.canWrapX_=!!(e&&this.extent_)},t.prototype.getDefaultTileGrid=function(){return this.defaultTileGrid_},t.prototype.setDefaultTileGrid=function(e){this.defaultTileGrid_=e},t.prototype.setExtent=function(e){this.extent_=e,this.canWrapX_=!!(this.global_&&e)},t.prototype.setWorldExtent=function(e){this.worldExtent_=e},t.prototype.setGetPointResolution=function(e){this.getPointResolutionFunc_=e},t.prototype.getPointResolutionFunc=function(){return this.getPointResolutionFunc_},t}();function so(t,e,n){return Math.min(Math.max(t,e),n)}var uht=function(){var t;return"cosh"in Math?t=Math.cosh:t=function(e){var n=Math.exp(e);return(n+1/n)/2},t}(),fht=function(){var t;return"log2"in Math?t=Math.log2:t=function(e){return Math.log(e)*Math.LOG2E},t}();function dht(t,e,n,r,i,o){var s=i-n,a=o-r;if(s!==0||a!==0){var l=((t-n)*s+(e-r)*a)/(s*s+a*a);l>1?(n=i,r=o):l>0&&(n+=s*l,r+=a*l)}return Rx(t,e,n,r)}function Rx(t,e,n,r){var i=n-t,o=r-e;return i*i+o*o}function hht(t){for(var e=t.length,n=0;ni&&(i=s,r=o)}if(i===0)return null;var a=t[r];t[r]=t[n],t[n]=a;for(var l=n+1;l=0;d--){f[d]=t[d][e]/t[d][d];for(var h=d-1;h>=0;h--)t[h][e]-=t[h][d]*f[d]}return f}function f3(t){return t*Math.PI/180}function $v(t,e){var n=t%e;return n*e<0?n+e:n}function Lp(t,e,n){return t+n*(e-t)}function $Pe(t,e){var n=Math.pow(10,e);return Math.round(t*n)/n}function uI(t,e){return Math.floor($Pe(t,e))}function fI(t,e){return Math.ceil($Pe(t,e))}var pht=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),zM=6378137,i_=Math.PI*zM,ght=[-i_,-i_,i_,i_],mht=[-180,-85,180,85],dI=zM*Math.log(Math.tan(Math.PI/2)),zb=function(t){pht(e,t);function e(n){return t.call(this,{code:n,units:Io.METERS,extent:ght,global:!0,worldExtent:mht,getPointResolution:function(r,i){return r/uht(i[1]/zM)}})||this}return e}(LPe),rhe=[new zb("EPSG:3857"),new zb("EPSG:102100"),new zb("EPSG:102113"),new zb("EPSG:900913"),new zb("http://www.opengis.net/def/crs/EPSG/0/3857"),new zb("http://www.opengis.net/gml/srs/epsg.xml#3857")];function vht(t,e,n){var r=t.length,i=n>1?n:2,o=e;o===void 0&&(i>2?o=t.slice():o=new Array(r));for(var s=0;sdI?a=dI:a<-dI&&(a=-dI),o[s+1]=a}return o}function yht(t,e,n){var r=t.length,i=n>1?n:2,o=e;o===void 0&&(i>2?o=t.slice():o=new Array(r));for(var s=0;ss)return 1;if(s>o)return-1}return 0}function Eht(t,e){return t[0]+=+e[0],t[1]+=+e[1],t}function qF(t,e){for(var n=!0,r=t.length-1;r>=0;--r)if(t[r]!=e[r]){n=!1;break}return n}function Xee(t,e){var n=Math.cos(e),r=Math.sin(e),i=t[0]*n-t[1]*r,o=t[1]*n+t[0]*r;return t[0]=i,t[1]=o,t}function Tht(t,e){return t[0]*=e,t[1]*=e,t}function kht(t,e){var n=t[0]-e[0],r=t[1]-e[1];return n*n+r*r}function FPe(t,e){if(e.canWrapX()){var n=Kr(e.getExtent()),r=Aht(t,e,n);r&&(t[0]-=r*n)}return t}function Aht(t,e,n){var r=e.getExtent(),i=0;if(e.canWrapX()&&(t[0]r[2])){var o=n||Kr(r);i=Math.floor((t[0]-r[0])/o)}return i}var Pht=63710088e-1;function she(t,e,n){var r=Pht,i=f3(t[1]),o=f3(e[1]),s=(o-i)/2,a=f3(e[0]-t[0])/2,l=Math.sin(s)*Math.sin(s)+Math.sin(a)*Math.sin(a)*Math.cos(i)*Math.cos(o);return 2*r*Math.atan2(Math.sqrt(l),Math.sqrt(1-l))}var iq=!0;function Mht(t){var e=!0;iq=!e}function Yee(t,e,n){var r;if(e!==void 0){for(var i=0,o=t.length;i=-180&&t[0]<=180&&t[1]>=-90&&t[1]<=90&&(iq=!1,console.warn("Call useGeographic() from ol/proj once to work with [longitude, latitude] coordinates.")),t}function jPe(t,e){return t}function ux(t,e){return t}function Fht(){ahe(rhe),ahe(ohe),Iht(ohe,rhe,vht,yht)}Fht();function Dx(t,e,n,r,i,o){for(var s=o||[],a=0,l=e;l1)f=n;else if(d>0){for(var h=0;hi&&(i=c),o=a,s=l}return i}function ete(t,e,n,r,i){for(var o=0,s=n.length;o0;){for(var f=c.pop(),d=c.pop(),h=0,p=t[d],g=t[d+1],m=t[f],v=t[f+1],y=d+r;yh&&(u=y,h=w)}h>i&&(l[(u-e)/r]=1,d+r0&&g>h)&&(p<0&&m0&&m>p)){c=f,u=d;continue}o[s++]=c,o[s++]=u,a=c,l=u,c=f,u=d}}return o[s++]=c,o[s++]=u,s}function GPe(t,e,n,r,i,o,s,a){for(var l=0,c=n.length;l1?s:2,b=o||new Array(x),p=0;p>1;io&&(c-a)*(o-l)-(i-a)*(u-l)>0&&s++:u<=o&&(c-a)*(o-l)-(i-a)*(u-l)<0&&s--,a=c,l=u}return s!==0}function ote(t,e,n,r,i,o){if(n.length===0||!fx(t,e,n[0],r,i,o))return!1;for(var s=1,a=n.length;s=i[0]&&o[2]<=i[2]||o[1]>=i[1]&&o[3]<=i[3]?!0:HPe(t,e,n,r,function(s,a){return aht(i,s,a)}):!1}function tpt(t,e,n,r,i){for(var o=0,s=n.length;ob&&(c=(u+f)/2,ote(t,e,n,r,c,p)&&(x=c,b=w)),u=f}return isNaN(x)&&(x=i[o]),s?(s.push(x,p,b),s):[x,p,b]}function cpt(t,e,n,r,i){for(var o=[],s=0,a=n.length;s0}function tMe(t,e,n,r,i){for(var o=0,s=n.length;o0){const n=e.map(r=>r.map(encodeURIComponent).join("=")).join("&");return t.includes("?")?t.endsWith("&")?t+n:t+"&"+n:t+"?"+n}return t}async function rMe(t,e){let n;try{if(n=await fetch(t,e),n.ok)return n}catch(i){throw i instanceof TypeError?(console.error(`Server did not respond for ${t}. May be caused by timeout, refused connection, network error, etc.`,i),new Error(ge.get("Cannot reach server"))):(console.error(i),i)}let r=n.statusText;try{const i=await n.json();if(i&&i.error){const o=i.error;console.error(o),o.message&&(r+=`: ${o.message}`)}}catch{}throw console.error(n),new nMe(n.status,r)}async function td(t,e,n){let r;wft(e)?n=e:r=e;const o=await(await rMe(t,r)).json();return n?n(o):o}const Rpt=/^#([A-Fa-f0-9]{8}|[A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/,Dpt=t=>{let e;if(t.includes(",")){const r=t.split(",");if(r.length===3||r.length===4){const i=[0,0,0,255];for(let o=0;o<3;o++){const s=Number.parseInt(r[o]);if(s<0||s>255)return;i[o]=s}if(r.length===4){if(e=hhe(r[3]),e===void 0)return;i[3]=e}return i}if(r.length!==2||(t=r[0],e=hhe(r[1]),e===void 0))return}const n=(t.startsWith("#")?oMe:Lpt)(t);if(n){if(n.length===3)return[...n,e===void 0?255:e];if(n.length===4&&e===void 0)return n}};function iMe(t){return"#"+t.map(e=>{const n=e.toString(16);return n.length===1?"0"+n:n}).join("")}function oMe(t){if(Rpt.test(t)){if(t.length===4)return[parseInt(t[1]+t[1],16),parseInt(t[2]+t[2],16),parseInt(t[3]+t[3],16)];if(t.length===7)return[parseInt(t.substring(1,3),16),parseInt(t.substring(3,5),16),parseInt(t.substring(5,7),16)];if(t.length===9)return[parseInt(t.substring(1,3),16),parseInt(t.substring(3,5),16),parseInt(t.substring(5,7),16),parseInt(t.substring(7,9),16)]}}const hhe=t=>{const e=Number.parseFloat(t);if(e===0)return 0;if(e===1)return 255;if(e>0&&e<1)return Math.round(256*e)},Ipt=t=>$pt[t.toLowerCase()],Lpt=t=>{const e=Ipt(t);if(e)return oMe(e)},$pt={aliceblue:"#F0F8FF",antiquewhite:"#FAEBD7",aqua:"#00FFFF",aquamarine:"#7FFFD4",azure:"#F0FFFF",beige:"#F5F5DC",bisque:"#FFE4C4",black:"#000000",blanchedalmond:"#FFEBCD",blue:"#0000FF",blueviolet:"#8A2BE2",brown:"#A52A2A",burlywood:"#DEB887",cadetblue:"#5F9EA0",chartreuse:"#7FFF00",chocolate:"#D2691E",coral:"#FF7F50",cornflowerblue:"#6495ED",cornsilk:"#FFF8DC",crimson:"#DC143C",cyan:"#00FFFF",darkblue:"#00008B",darkcyan:"#008B8B",darkgoldenrod:"#B8860B",darkgray:"#A9A9A9",darkgrey:"#A9A9A9",darkgreen:"#006400",darkkhaki:"#BDB76B",darkmagenta:"#8B008B",darkolivegreen:"#556B2F",darkorange:"#FF8C00",darkorchid:"#9932CC",darkred:"#8B0000",darksalmon:"#E9967A",darkseagreen:"#8FBC8F",darkslateblue:"#483D8B",darkslategray:"#2F4F4F",darkslategrey:"#2F4F4F",darkturquoise:"#00CED1",darkviolet:"#9400D3",deeppink:"#FF1493",deepskyblue:"#00BFFF",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1E90FF",firebrick:"#B22222",floralwhite:"#FFFAF0",forestgreen:"#228B22",fuchsia:"#FF00FF",gainsboro:"#DCDCDC",ghostwhite:"#F8F8FF",gold:"#FFD700",goldenrod:"#DAA520",gray:"#808080",grey:"#808080",green:"#008000",greenyellow:"#ADFF2F",honeydew:"#F0FFF0",hotpink:"#FF69B4",indianred:"#CD5C5C",indigo:"#4B0082",ivory:"#FFFFF0",khaki:"#F0E68C",lavender:"#E6E6FA",lavenderblush:"#FFF0F5",lawngreen:"#7CFC00",lemonchiffon:"#FFFACD",lightblue:"#ADD8E6",lightcoral:"#F08080",lightcyan:"#E0FFFF",lightgoldenrodyellow:"#FAFAD2",lightgray:"#D3D3D3",lightgrey:"#D3D3D3",lightgreen:"#90EE90",lightpink:"#FFB6C1",lightsalmon:"#FFA07A",lightseagreen:"#20B2AA",lightskyblue:"#87CEFA",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#B0C4DE",lightyellow:"#FFFFE0",lime:"#00FF00",limegreen:"#32CD32",linen:"#FAF0E6",magenta:"#FF00FF",maroon:"#800000",mediumaquamarine:"#66CDAA",mediumblue:"#0000CD",mediumorchid:"#BA55D3",mediumpurple:"#9370DB",mediumseagreen:"#3CB371",mediumslateblue:"#7B68EE",mediumspringgreen:"#00FA9A",mediumturquoise:"#48D1CC",mediumvioletred:"#C71585",midnightblue:"#191970",mintcream:"#F5FFFA",mistyrose:"#FFE4E1",moccasin:"#FFE4B5",navajowhite:"#FFDEAD",navy:"#000080",oldlace:"#FDF5E6",olive:"#808000",olivedrab:"#6B8E23",orange:"#FFA500",orangered:"#FF4500",orchid:"#DA70D6",palegoldenrod:"#EEE8AA",palegreen:"#98FB98",paleturquoise:"#AFEEEE",palevioletred:"#DB7093",papayawhip:"#FFEFD5",peachpuff:"#FFDAB9",peru:"#CD853F",pink:"#FFC0CB",plum:"#DDA0DD",powderblue:"#B0E0E6",purple:"#800080",rebeccapurple:"#663399",red:"#FF0000",rosybrown:"#BC8F8F",royalblue:"#4169E1",saddlebrown:"#8B4513",salmon:"#FA8072",sandybrown:"#F4A460",seagreen:"#2E8B57",seashell:"#FFF5EE",sienna:"#A0522D",silver:"#C0C0C0",skyblue:"#87CEEB",slateblue:"#6A5ACD",slategray:"#708090",slategrey:"#708090",snow:"#FFFAFA",springgreen:"#00FF7F",steelblue:"#4682B4",tan:"#D2B48C",teal:"#008080",thistle:"#D8BFD8",tomato:"#FF6347",turquoise:"#40E0D0",violet:"#EE82EE",wheat:"#F5DEB3",white:"#FFFFFF",whitesmoke:"#F5F5F5",yellow:"#FFFF00",yellowgreen:"#9ACD32"};function Fpt(t){return td(`${t}/colorbars`,Npt)}function Npt(t){const e=[],n={},r={};return t.forEach(i=>{const[o,s,a]=i,l=[];a.forEach(c=>{if(c.length===3){const[u,f,d]=c;l.push(u),n[u]=f,r[u]={name:d.name,type:d.type,colorRecords:d.colors.map(zpt)}}else if(c.length===2){const[u,f]=c;l.push(u),n[u]=f}}),e.push({title:o,description:s,names:l})}),{groups:e,images:n,customColorMaps:r}}function zpt(t){const e=jpt(t[1]),n=t[0];if(t.length===3){const r=t[2];return{value:n,color:e,label:r}}else return{value:n,color:e}}function jpt(t){return t?J1(t)?t:iMe(t):"#000000"}function Bpt(t,e){const n=Ny(`${t}/datasets`,[["details","1"]]),r=Fy(e);return td(n,r,Upt)}function Upt(t){return(t.datasets||[]).map(Wpt)}function Wpt(t){if(t.dimensions&&t.dimensions.length){let e=t.dimensions;const n=e.findIndex(r=>r.name==="time");if(n>-1){const r=e[n],i=r.coordinates;if(i&&i.length&&typeof i[0]=="string"){const o=i,s=o.map(a=>new Date(a).getTime());return e=[...e],e[n]={...r,coordinates:s,labels:o},{...t,dimensions:e}}}}return t}function Vpt(t,e,n,r){const i=Fy(r),o=encodeURIComponent(e),s=encodeURIComponent(n);return td(`${t}/datasets/${o}/places/${s}`,i)}function Gpt(t){return td(`${t}/expressions/capabilities`)}function Hpt(t){return td(`${t}/`)}function jM(t){return J1(t.expression)}function eO(t){return encodeURIComponent(J1(t)?t:t.id)}function BM(t){return encodeURIComponent(J1(t)?t:jM(t)?`${t.name}=${t.expression}`:t.name)}function qpt(t,e,n,r,i,o,s,a,l,c){let u,f=null;const d=[];a?(d.push(["aggMethods","median"]),u="median"):l?(d.push(["aggMethods","mean,std"]),u="mean",f="std"):(d.push(["aggMethods","mean"]),u="mean"),o&&d.push(["startDate",o]),s&&d.push(["endDate",s]);const h=Ny(`${t}/timeseries/${eO(e)}/${BM(n)}`,d),p={...Fy(c),method:"post",body:JSON.stringify(i)};return td(h,p,m=>{const v=m.result;if(!v||v.length===0)return null;const y=v.map(b=>({...b,time:new Date(b.time).getTime()}));return{source:{datasetId:e.id,datasetTitle:e.title,variableName:n.name,variableUnits:n.units||void 0,placeId:r,geometry:i,valueDataKey:u,errorDataKey:f},data:y}})}function Xpt(t,e,n,r,i,o){const s=i!==null?[["time",i]]:[],a=Ny(`${t}/statistics/${eO(e)}/${BM(n)}`,s),l={...Fy(o),method:"post",body:JSON.stringify(r.place.geometry)},c={dataset:e,variable:n,placeInfo:r,time:i};return td(a,l,u=>({source:c,statistics:u.result}))}function Ypt(t,e,n,r,i,o,s){const a=[["lon",r.toString()],["lat",i.toString()]];o&&a.push(["time",o]);const l=Ny(`${t}/statistics/${eO(e)}/${BM(n)}`,a);return td(l,Fy(s),c=>c.result?c.result:{})}function Qpt(t,e){const n=Ny(`${t}/maintenance/update`,[]),r=Fy(e);try{return td(n,r).then(()=>!0).catch(i=>(console.error(i),!1))}catch(i){return console.error(i),Promise.resolve(!1)}}function Kpt(t,e,n){const r=Ny(`${t}/viewer/state`,[["key",n]]);return td(r,Fy(e)).then(i=>i).catch(i=>`${i}`)}function Zpt(t,e,n){const r=Ny(`${t}/viewer/state`,[]),i={...Fy(e),method:"PUT",body:JSON.stringify(n)};try{return td(r,i).then(o=>o.key).catch(o=>{console.error(o)})}catch(o){return console.error(o),Promise.resolve(void 0)}}class ZF extends Error{}function Jpt(t,e){if(t===null)throw new ZF(`assertion failed: ${e} must not be null`)}function egt(t,e){if(typeof t>"u")throw new ZF(`assertion failed: ${e} must not be undefined`)}function tgt(t,e){Jpt(t,e),egt(t,e)}function uW(t,e){if(Array.isArray(t)){if(t.length===0)throw new ZF(`assertion failed: ${e} must be a non-empty array`)}else throw new ZF(`assertion failed: ${e} must be an array`)}function dA(t,e){return e&&t.find(n=>n.id===e)||null}function dq(t,e){return e&&t.variables.find(n=>n.name===e)||null}function ngt(t){return t.variables.findIndex(e=>J1(e.expression))}function lte(t){const e=ngt(t);return e>=0?[t.variables.slice(0,e),t.variables.slice(e)]:[t.variables,[]]}function sMe(t){tgt(t,"dataset"),uW(t.dimensions,"dataset.dimensions");const e=t.dimensions.find(n=>n.name==="time");return e?(uW(e.coordinates,"timeDimension.coordinates"),uW(e.labels,"timeDimension.labels"),e):null}function aMe(t){const e=sMe(t);if(!e)return null;const n=e.coordinates;return[n[0],n[n.length-1]]}var JF="NOT_FOUND";function rgt(t){var e;return{get:function(r){return e&&t(e.key,r)?e.value:JF},put:function(r,i){e={key:r,value:i}},getEntries:function(){return e?[e]:[]},clear:function(){e=void 0}}}function igt(t,e){var n=[];function r(a){var l=n.findIndex(function(u){return e(a,u.key)});if(l>-1){var c=n[l];return l>0&&(n.splice(l,1),n.unshift(c)),c.value}return JF}function i(a,l){r(a)===JF&&(n.unshift({key:a,value:l}),n.length>t&&n.pop())}function o(){return n}function s(){n=[]}return{get:r,put:i,getEntries:o,clear:s}}var ogt=function(e,n){return e===n};function sgt(t){return function(n,r){if(n===null||r===null||n.length!==r.length)return!1;for(var i=n.length,o=0;o1?e-1:0),r=1;r0&&o[0]!==a&&(o=[a,...o])}n.properties&&(s=phe(n.properties,o)),s===void 0&&(s=phe(n,o)),t[r]=s||i}function ggt(t,e){let n=e;if(t.properties)for(const r of Object.getOwnPropertyNames(t.properties)){if(!n.includes("${"))break;const i="${"+r+"}";n.includes(i)&&(n=n.replace(i,`${t.properties[r]}`))}return n}function phe(t,e){let n;for(const r of e)if(r in t)return t[r];return n}function UM(t){let e=[];for(const n of t)e=e.concat(n.toLowerCase(),n.toUpperCase(),n[0].toUpperCase()+n.substring(1).toLowerCase());return e}function fte(t,e){t.forEach(n=>{nO(n)&&n.features.forEach(r=>{e(n,r)})})}function mgt(t,e){const n=J1(e)?(r,i)=>i.id===e:e;for(const r of t)if(nO(r)){const i=r.features.find(o=>n(r,o));if(i)return M4(r,i)}return null}function vgt(t){const e=t.id+"";let n=0,r,i;if(e.length===0)return n;for(r=0;ri.id===e);if(n)return n;const r=t.placeGroups;if(r)for(const i in r){const o=cMe(r[i],e);if(o)return o}return null}function dte(t,e){if(e)for(const n of t){const r=cMe(n,e);if(r!==null)return r}return null}const uMe="User",fMe=`0.0: #23FF52 -0.5: red -1.0: 120,30,255`;function ygt(t,e,n){const r=new Uint8ClampedArray(4*n),i=t.length;if(e==="categorical"||e==="stepwise"){const o=e==="categorical"?i:i-1;for(let s=0,a=0;s(f.value-o)/(s-o));let l=0,c=a[0],u=a[1];for(let f=0,d=0;fu&&(l++,c=a[l],u=a[l+1]);const p=(h-c)/(u-c),[g,m,v,y]=t[l].color,[x,b,w,_]=t[l+1].color;r[d]=g+p*(x-g),r[d+1]=m+p*(b-m),r[d+2]=v+p*(w-v),r[d+3]=y+p*(_-y)}}return r}function xgt(t,e,n){const r=ygt(t,e,n.width),i=new ImageData(r,r.length/4,1);return createImageBitmap(i).then(o=>{const s=n.getContext("2d");s&&s.drawImage(o,0,0,n.width,n.height)})}function bgt(t){const{colorRecords:e,errorMessage:n}=hMe(t.code);if(!e)return Promise.resolve({errorMessage:n});const r=document.createElement("canvas");return r.width=256,r.height=1,xgt(e,t.type,r).then(()=>({imageData:r.toDataURL("image/png").split(",")[1]}))}function dMe(t){const{colorRecords:e}=hMe(t);if(e)return e.map(n=>({...n,color:iMe(n.color)}))}function hMe(t){try{return{colorRecords:wgt(t)}}catch(e){if(e instanceof SyntaxError)return{errorMessage:`${e.message}`};throw e}}function wgt(t){const e=[];t.split(` -`).map(o=>o.trim().split(":").map(s=>s.trim())).forEach((o,s)=>{if(o.length==2||o.length==3){const[a,l]=o,c=parseFloat(a),u=Dpt(l);if(!Number.isFinite(c))throw new SyntaxError(`Line ${s+1}: invalid value: ${a}`);if(!u)throw new SyntaxError(`Line ${s+1}: invalid color: ${l}`);o.length==3?e.push({value:c,color:u,label:o[2]}):e.push({value:c,color:u})}else if(o.length===1&&o[0]!=="")throw new SyntaxError(`Line ${s+1}: invalid color record: ${o[0]}`)});const n=e.length;if(n<2)throw new SyntaxError("At least two color records must be given");e.sort((o,s)=>o.value-s.value);const r=e[0].value,i=e[n-1].value;if(r===i)throw new SyntaxError("Values must form a range");return e}var hte={exports:{}};function _gt(t,e){var n=e&&e.cache?e.cache:kgt,r=e&&e.serializer?e.serializer:Tgt,i=e&&e.strategy?e.strategy:Cgt;return i(t,{cache:n,serializer:r})}function Sgt(t){return t==null||typeof t=="number"||typeof t=="boolean"}function pMe(t,e,n,r){var i=Sgt(r)?r:n(r),o=e.get(i);return typeof o>"u"&&(o=t.call(this,r),e.set(i,o)),o}function gMe(t,e,n){var r=Array.prototype.slice.call(arguments,3),i=n(r),o=e.get(i);return typeof o>"u"&&(o=t.apply(this,r),e.set(i,o)),o}function pte(t,e,n,r,i){return n.bind(e,t,r,i)}function Cgt(t,e){var n=t.length===1?pMe:gMe;return pte(t,this,n,e.cache.create(),e.serializer)}function Ogt(t,e){var n=gMe;return pte(t,this,n,e.cache.create(),e.serializer)}function Egt(t,e){var n=pMe;return pte(t,this,n,e.cache.create(),e.serializer)}function Tgt(){return JSON.stringify(arguments)}function R4(){this.cache=Object.create(null)}R4.prototype.has=function(t){return t in this.cache};R4.prototype.get=function(t){return this.cache[t]};R4.prototype.set=function(t,e){this.cache[t]=e};var kgt={create:function(){return new R4}};hte.exports=_gt;hte.exports.strategies={variadic:Ogt,monadic:Egt};var Agt=hte.exports;const Pgt=on(Agt),Qa={ADD:"add",REMOVE:"remove"};var mMe=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),ghe={LENGTH:"length"},pI=function(t){mMe(e,t);function e(n,r,i){var o=t.call(this,n)||this;return o.element=r,o.index=i,o}return e}(Nh),ru=function(t){mMe(e,t);function e(n,r){var i=t.call(this)||this;i.on,i.once,i.un;var o=r||{};if(i.unique_=!!o.unique,i.array_=n||[],i.unique_)for(var s=0,a=i.array_.length;s0;)this.pop()},e.prototype.extend=function(n){for(var r=0,i=n.length;r0&&t[1]>0}function vMe(t,e,n){return n===void 0&&(n=[0,0]),n[0]=t[0]*e+.5|0,n[1]=t[1]*e+.5|0,n}function tc(t,e){return Array.isArray(t)?t:(e===void 0?e=[t,t]:(e[0]=t,e[1]=t),e)}var yMe=function(){function t(e){this.opacity_=e.opacity,this.rotateWithView_=e.rotateWithView,this.rotation_=e.rotation,this.scale_=e.scale,this.scaleArray_=tc(e.scale),this.displacement_=e.displacement,this.declutterMode_=e.declutterMode}return t.prototype.clone=function(){var e=this.getScale();return new t({opacity:this.getOpacity(),scale:Array.isArray(e)?e.slice():e,rotation:this.getRotation(),rotateWithView:this.getRotateWithView(),displacement:this.getDisplacement().slice(),declutterMode:this.getDeclutterMode()})},t.prototype.getOpacity=function(){return this.opacity_},t.prototype.getRotateWithView=function(){return this.rotateWithView_},t.prototype.getRotation=function(){return this.rotation_},t.prototype.getScale=function(){return this.scale_},t.prototype.getScaleArray=function(){return this.scaleArray_},t.prototype.getDisplacement=function(){return this.displacement_},t.prototype.getDeclutterMode=function(){return this.declutterMode_},t.prototype.getAnchor=function(){return $t()},t.prototype.getImage=function(e){return $t()},t.prototype.getHitDetectionImage=function(){return $t()},t.prototype.getPixelRatio=function(e){return 1},t.prototype.getImageState=function(){return $t()},t.prototype.getImageSize=function(){return $t()},t.prototype.getOrigin=function(){return $t()},t.prototype.getSize=function(){return $t()},t.prototype.setDisplacement=function(e){this.displacement_=e},t.prototype.setOpacity=function(e){this.opacity_=e},t.prototype.setRotateWithView=function(e){this.rotateWithView_=e},t.prototype.setRotation=function(e){this.rotation_=e},t.prototype.setScale=function(e){this.scale_=e,this.scaleArray_=tc(e)},t.prototype.listenImageChange=function(e){$t()},t.prototype.load=function(){$t()},t.prototype.unlistenImageChange=function(e){$t()},t}(),Mgt=/^#([a-f0-9]{3}|[a-f0-9]{4}(?:[a-f0-9]{2}){0,2})$/i,Rgt=/^([a-z]*)$|^hsla?\(.*\)$/i;function xMe(t){return typeof t=="string"?t:bMe(t)}function Dgt(t){var e=document.createElement("div");if(e.style.color=t,e.style.color!==""){document.body.appendChild(e);var n=getComputedStyle(e).color;return document.body.removeChild(e),n}else return""}var Igt=function(){var t=1024,e={},n=0;return function(r){var i;if(e.hasOwnProperty(r))i=e[r];else{if(n>=t){var o=0;for(var s in e)o++&3||(delete e[s],--n)}i=Lgt(r),e[r]=i,++n}return i}}();function eN(t){return Array.isArray(t)?t:Igt(t)}function Lgt(t){var e,n,r,i,o;if(Rgt.exec(t)&&(t=Dgt(t)),Mgt.exec(t)){var s=t.length-1,a=void 0;s<=4?a=1:a=2;var l=s===4||s===8;e=parseInt(t.substr(1+0*a,a),16),n=parseInt(t.substr(1+1*a,a),16),r=parseInt(t.substr(1+2*a,a),16),l?i=parseInt(t.substr(1+3*a,a),16):i=255,a==1&&(e=(e<<4)+e,n=(n<<4)+n,r=(r<<4)+r,l&&(i=(i<<4)+i)),o=[e,n,r,i/255]}else t.indexOf("rgba(")==0?(o=t.slice(5,-1).split(",").map(Number),yhe(o)):t.indexOf("rgb(")==0?(o=t.slice(4,-1).split(",").map(Number),o.push(1),yhe(o)):bn(!1,14);return o}function yhe(t){return t[0]=so(t[0]+.5|0,0,255),t[1]=so(t[1]+.5|0,0,255),t[2]=so(t[2]+.5|0,0,255),t[3]=so(t[3],0,1),t}function bMe(t){var e=t[0];e!=(e|0)&&(e=e+.5|0);var n=t[1];n!=(n|0)&&(n=n+.5|0);var r=t[2];r!=(r|0)&&(r=r+.5|0);var i=t[3]===void 0?1:Math.round(t[3]*100)/100;return"rgba("+e+","+n+","+r+","+i+")"}function Kd(t){return Array.isArray(t)?bMe(t):t}function Cc(t,e,n,r){var i;return n&&n.length?i=n.shift():E4?i=new OffscreenCanvas(t||300,e||300):i=document.createElement("canvas"),t&&(i.width=t),e&&(i.height=e),i.getContext("2d",r)}function wMe(t){var e=t.canvas;e.width=1,e.height=1,t.clearRect(0,0,1,1)}function xhe(t,e){var n=e.parentNode;n&&n.replaceChild(t,e)}function hq(t){return t&&t.parentNode?t.parentNode.removeChild(t):null}function $gt(t){for(;t.lastChild;)t.removeChild(t.lastChild)}function Fgt(t,e){for(var n=t.childNodes,r=0;;++r){var i=n[r],o=e[r];if(!i&&!o)break;if(i!==o){if(!i){t.appendChild(o);continue}if(!o){t.removeChild(i),--r;continue}t.insertBefore(o,i)}}}var gI="ol-hidden",WM="ol-unselectable",gte="ol-control",bhe="ol-collapsed",Ngt=new RegExp(["^\\s*(?=(?:(?:[-a-z]+\\s*){0,2}(italic|oblique))?)","(?=(?:(?:[-a-z]+\\s*){0,2}(small-caps))?)","(?=(?:(?:[-a-z]+\\s*){0,2}(bold(?:er)?|lighter|[1-9]00 ))?)","(?:(?:normal|\\1|\\2|\\3)\\s*){0,3}((?:xx?-)?","(?:small|large)|medium|smaller|larger|[\\.\\d]+(?:\\%|in|[cem]m|ex|p[ctx]))","(?:\\s*\\/\\s*(normal|[\\.\\d]+(?:\\%|in|[cem]m|ex|p[ctx])?))",`?\\s*([-,\\"\\'\\sa-z]+?)\\s*$`].join(""),"i"),whe=["style","variant","weight","size","lineHeight","family"],_Me=function(t){var e=t.match(Ngt);if(!e)return null;for(var n={lineHeight:"normal",size:"1.2em",style:"normal",weight:"normal",variant:"normal"},r=0,i=whe.length;r{const{classes:e,variant:n,color:r,disableShrink:i}=t,o={root:["root",n,`color${Re(r)}`],svg:["svg"],circle:["circle",`circle${Re(n)}`,i&&"circleDisableShrink"]};return qe(o,Rst,e)},$st=be("span",{name:"MuiCircularProgress",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,e[n.variant],e[`color${Re(n.color)}`]]}})(Tt(({theme:t})=>({display:"inline-block",variants:[{props:{variant:"determinate"},style:{transition:t.transitions.create("transform")}},{props:{variant:"indeterminate"},style:Dst||{animation:`${sq} 1.4s linear infinite`}},...Object.entries(t.palette).filter(ii()).map(([e])=>({props:{color:e},style:{color:(t.vars||t).palette[e].main}}))]}))),Fst=be("svg",{name:"MuiCircularProgress",slot:"Svg",overridesResolver:(t,e)=>e.svg})({display:"block"}),Nst=be("circle",{name:"MuiCircularProgress",slot:"Circle",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.circle,e[`circle${Re(n.variant)}`],n.disableShrink&&e.circleDisableShrink]}})(Tt(({theme:t})=>({stroke:"currentColor",variants:[{props:{variant:"determinate"},style:{transition:t.transitions.create("stroke-dashoffset")}},{props:{variant:"indeterminate"},style:{strokeDasharray:"80px, 200px",strokeDashoffset:0}},{props:({ownerState:e})=>e.variant==="indeterminate"&&!e.disableShrink,style:Ist||{animation:`${aq} 1.4s ease-in-out infinite`}}]}))),Dy=D.forwardRef(function(e,n){const r=wt({props:e,name:"MuiCircularProgress"}),{className:i,color:o="primary",disableShrink:s=!1,size:a=40,style:l,thickness:c=3.6,value:u=0,variant:f="indeterminate",...d}=r,h={...r,color:o,disableShrink:s,size:a,thickness:c,value:u,variant:f},p=Lst(h),g={},m={},v={};if(f==="determinate"){const y=2*Math.PI*((lm-c)/2);g.strokeDasharray=y.toFixed(3),v["aria-valuenow"]=Math.round(u),g.strokeDashoffset=`${((100-u)/100*y).toFixed(3)}px`,m.transform="rotate(-90deg)"}return C.jsx($st,{className:Oe(p.root,i),style:{width:a,height:a,...m,...l},ownerState:h,ref:n,role:"progressbar",...v,...d,children:C.jsx(Fst,{className:p.svg,ownerState:h,viewBox:`${lm/2} ${lm/2} ${lm} ${lm}`,children:C.jsx(Nst,{className:p.circle,style:g,ownerState:h,cx:lm,cy:lm,r:(lm-c)/2,fill:"none",strokeWidth:c})})})});function Ode(t){return t.substring(2).toLowerCase()}function zst(t,e){return e.documentElement.clientWidth(setTimeout(()=>{l.current=!0},0),()=>{l.current=!1}),[]);const u=dn(Py(e),a),f=st(p=>{const g=c.current;c.current=!1;const m=vi(a.current);if(!l.current||!a.current||"clientX"in p&&zst(p,m))return;if(s.current){s.current=!1;return}let v;p.composedPath?v=p.composedPath().includes(a.current):v=!m.documentElement.contains(p.target)||a.current.contains(p.target),!v&&(n||!g)&&i(p)}),d=p=>g=>{c.current=!0;const m=e.props[p];m&&m(g)},h={ref:u};return o!==!1&&(h[o]=d(o)),D.useEffect(()=>{if(o!==!1){const p=Ode(o),g=vi(a.current),m=()=>{s.current=!0};return g.addEventListener(p,f),g.addEventListener("touchmove",m),()=>{g.removeEventListener(p,f),g.removeEventListener("touchmove",m)}}},[f,o]),r!==!1&&(h[r]=d(r)),D.useEffect(()=>{if(r!==!1){const p=Ode(r),g=vi(a.current);return g.addEventListener(p,f),()=>{g.removeEventListener(p,f)}}},[f,r]),C.jsx(D.Fragment,{children:D.cloneElement(e,h)})}const lq=typeof Eee({})=="function",Bst=(t,e)=>({WebkitFontSmoothing:"antialiased",MozOsxFontSmoothing:"grayscale",boxSizing:"border-box",WebkitTextSizeAdjust:"100%",...e&&!t.vars&&{colorScheme:t.palette.mode}}),Ust=t=>({color:(t.vars||t).palette.text.primary,...t.typography.body1,backgroundColor:(t.vars||t).palette.background.default,"@media print":{backgroundColor:(t.vars||t).palette.common.white}}),fPe=(t,e=!1)=>{var o,s;const n={};e&&t.colorSchemes&&typeof t.getColorSchemeSelector=="function"&&Object.entries(t.colorSchemes).forEach(([a,l])=>{var u,f;const c=t.getColorSchemeSelector(a);c.startsWith("@")?n[c]={":root":{colorScheme:(u=l.palette)==null?void 0:u.mode}}:n[c.replace(/\s*&/,"")]={colorScheme:(f=l.palette)==null?void 0:f.mode}});let r={html:Bst(t,e),"*, *::before, *::after":{boxSizing:"inherit"},"strong, b":{fontWeight:t.typography.fontWeightBold},body:{margin:0,...Ust(t),"&::backdrop":{backgroundColor:(t.vars||t).palette.background.default}},...n};const i=(s=(o=t.components)==null?void 0:o.MuiCssBaseline)==null?void 0:s.styleOverrides;return i&&(r=[r,i]),r},i3="mui-ecs",Wst=t=>{const e=fPe(t,!1),n=Array.isArray(e)?e[0]:e;return!t.vars&&n&&(n.html[`:root:has(${i3})`]={colorScheme:t.palette.mode}),t.colorSchemes&&Object.entries(t.colorSchemes).forEach(([r,i])=>{var s,a;const o=t.getColorSchemeSelector(r);o.startsWith("@")?n[o]={[`:root:not(:has(.${i3}))`]:{colorScheme:(s=i.palette)==null?void 0:s.mode}}:n[o.replace(/\s*&/,"")]={[`&:not(:has(.${i3}))`]:{colorScheme:(a=i.palette)==null?void 0:a.mode}}}),e},Vst=Eee(lq?({theme:t,enableColorScheme:e})=>fPe(t,e):({theme:t})=>Wst(t));function Gst(t){const e=wt({props:t,name:"MuiCssBaseline"}),{children:n,enableColorScheme:r=!1}=e;return C.jsxs(D.Fragment,{children:[lq&&C.jsx(Vst,{enableColorScheme:r}),!lq&&!r&&C.jsx("span",{className:i3,style:{display:"none"}}),n]})}function Hst(t){const e=vi(t);return e.body===t?xc(t).innerWidth>e.documentElement.clientWidth:t.scrollHeight>t.clientHeight}function QT(t,e){e?t.setAttribute("aria-hidden","true"):t.removeAttribute("aria-hidden")}function Ede(t){return parseInt(xc(t).getComputedStyle(t).paddingRight,10)||0}function qst(t){const n=["TEMPLATE","SCRIPT","STYLE","LINK","MAP","META","NOSCRIPT","PICTURE","COL","COLGROUP","PARAM","SLOT","SOURCE","TRACK"].includes(t.tagName),r=t.tagName==="INPUT"&&t.getAttribute("type")==="hidden";return n||r}function Tde(t,e,n,r,i){const o=[e,n,...r];[].forEach.call(t.children,s=>{const a=!o.includes(s),l=!qst(s);a&&l&&QT(s,i)})}function nW(t,e){let n=-1;return t.some((r,i)=>e(r)?(n=i,!0):!1),n}function Xst(t,e){const n=[],r=t.container;if(!e.disableScrollLock){if(Hst(r)){const s=PAe(xc(r));n.push({value:r.style.paddingRight,property:"padding-right",el:r}),r.style.paddingRight=`${Ede(r)+s}px`;const a=vi(r).querySelectorAll(".mui-fixed");[].forEach.call(a,l=>{n.push({value:l.style.paddingRight,property:"padding-right",el:l}),l.style.paddingRight=`${Ede(l)+s}px`})}let o;if(r.parentNode instanceof DocumentFragment)o=vi(r).body;else{const s=r.parentElement,a=xc(r);o=(s==null?void 0:s.nodeName)==="HTML"&&a.getComputedStyle(s).overflowY==="scroll"?s:r}n.push({value:o.style.overflow,property:"overflow",el:o},{value:o.style.overflowX,property:"overflow-x",el:o},{value:o.style.overflowY,property:"overflow-y",el:o}),o.style.overflow="hidden"}return()=>{n.forEach(({value:o,el:s,property:a})=>{o?s.style.setProperty(a,o):s.style.removeProperty(a)})}}function Yst(t){const e=[];return[].forEach.call(t.children,n=>{n.getAttribute("aria-hidden")==="true"&&e.push(n)}),e}class Qst{constructor(){this.modals=[],this.containers=[]}add(e,n){let r=this.modals.indexOf(e);if(r!==-1)return r;r=this.modals.length,this.modals.push(e),e.modalRef&&QT(e.modalRef,!1);const i=Yst(n);Tde(n,e.mount,e.modalRef,i,!0);const o=nW(this.containers,s=>s.container===n);return o!==-1?(this.containers[o].modals.push(e),r):(this.containers.push({modals:[e],container:n,restore:null,hiddenSiblings:i}),r)}mount(e,n){const r=nW(this.containers,o=>o.modals.includes(e)),i=this.containers[r];i.restore||(i.restore=Xst(i,n))}remove(e,n=!0){const r=this.modals.indexOf(e);if(r===-1)return r;const i=nW(this.containers,s=>s.modals.includes(e)),o=this.containers[i];if(o.modals.splice(o.modals.indexOf(e),1),this.modals.splice(r,1),o.modals.length===0)o.restore&&o.restore(),e.modalRef&&QT(e.modalRef,n),Tde(o.container,e.mount,e.modalRef,o.hiddenSiblings,!1),this.containers.splice(i,1);else{const s=o.modals[o.modals.length-1];s.modalRef&&QT(s.modalRef,!1)}return r}isTopModal(e){return this.modals.length>0&&this.modals[this.modals.length-1]===e}}const Kst=["input","select","textarea","a[href]","button","[tabindex]","audio[controls]","video[controls]",'[contenteditable]:not([contenteditable="false"])'].join(",");function Zst(t){const e=parseInt(t.getAttribute("tabindex")||"",10);return Number.isNaN(e)?t.contentEditable==="true"||(t.nodeName==="AUDIO"||t.nodeName==="VIDEO"||t.nodeName==="DETAILS")&&t.getAttribute("tabindex")===null?0:t.tabIndex:e}function Jst(t){if(t.tagName!=="INPUT"||t.type!=="radio"||!t.name)return!1;const e=r=>t.ownerDocument.querySelector(`input[type="radio"]${r}`);let n=e(`[name="${t.name}"]:checked`);return n||(n=e(`[name="${t.name}"]`)),n!==t}function eat(t){return!(t.disabled||t.tagName==="INPUT"&&t.type==="hidden"||Jst(t))}function tat(t){const e=[],n=[];return Array.from(t.querySelectorAll(Kst)).forEach((r,i)=>{const o=Zst(r);o===-1||!eat(r)||(o===0?e.push(r):n.push({documentOrder:i,tabIndex:o,node:r}))}),n.sort((r,i)=>r.tabIndex===i.tabIndex?r.documentOrder-i.documentOrder:r.tabIndex-i.tabIndex).map(r=>r.node).concat(e)}function nat(){return!0}function dPe(t){const{children:e,disableAutoFocus:n=!1,disableEnforceFocus:r=!1,disableRestoreFocus:i=!1,getTabbable:o=tat,isEnabled:s=nat,open:a}=t,l=D.useRef(!1),c=D.useRef(null),u=D.useRef(null),f=D.useRef(null),d=D.useRef(null),h=D.useRef(!1),p=D.useRef(null),g=dn(Py(e),p),m=D.useRef(null);D.useEffect(()=>{!a||!p.current||(h.current=!n)},[n,a]),D.useEffect(()=>{if(!a||!p.current)return;const x=vi(p.current);return p.current.contains(x.activeElement)||(p.current.hasAttribute("tabIndex")||p.current.setAttribute("tabIndex","-1"),h.current&&p.current.focus()),()=>{i||(f.current&&f.current.focus&&(l.current=!0,f.current.focus()),f.current=null)}},[a]),D.useEffect(()=>{if(!a||!p.current)return;const x=vi(p.current),b=S=>{m.current=S,!(r||!s()||S.key!=="Tab")&&x.activeElement===p.current&&S.shiftKey&&(l.current=!0,u.current&&u.current.focus())},w=()=>{var k,E;const S=p.current;if(S===null)return;if(!x.hasFocus()||!s()||l.current){l.current=!1;return}if(S.contains(x.activeElement)||r&&x.activeElement!==c.current&&x.activeElement!==u.current)return;if(x.activeElement!==d.current)d.current=null;else if(d.current!==null)return;if(!h.current)return;let O=[];if((x.activeElement===c.current||x.activeElement===u.current)&&(O=o(p.current)),O.length>0){const P=!!((k=m.current)!=null&&k.shiftKey&&((E=m.current)==null?void 0:E.key)==="Tab"),A=O[0],R=O[O.length-1];typeof A!="string"&&typeof R!="string"&&(P?R.focus():A.focus())}else S.focus()};x.addEventListener("focusin",w),x.addEventListener("keydown",b,!0);const _=setInterval(()=>{x.activeElement&&x.activeElement.tagName==="BODY"&&w()},50);return()=>{clearInterval(_),x.removeEventListener("focusin",w),x.removeEventListener("keydown",b,!0)}},[n,r,i,s,a,o]);const v=x=>{f.current===null&&(f.current=x.relatedTarget),h.current=!0,d.current=x.target;const b=e.props.onFocus;b&&b(x)},y=x=>{f.current===null&&(f.current=x.relatedTarget),h.current=!0};return C.jsxs(D.Fragment,{children:[C.jsx("div",{tabIndex:a?0:-1,onFocus:y,ref:c,"data-testid":"sentinelStart"}),D.cloneElement(e,{ref:g,onFocus:v}),C.jsx("div",{tabIndex:a?0:-1,onFocus:y,ref:u,"data-testid":"sentinelEnd"})]})}function rat(t){return typeof t=="function"?t():t}function iat(t){return t?t.props.hasOwnProperty("in"):!1}const KD=new Qst;function oat(t){const{container:e,disableEscapeKeyDown:n=!1,disableScrollLock:r=!1,closeAfterTransition:i=!1,onTransitionEnter:o,onTransitionExited:s,children:a,onClose:l,open:c,rootRef:u}=t,f=D.useRef({}),d=D.useRef(null),h=D.useRef(null),p=dn(h,u),[g,m]=D.useState(!c),v=iat(a);let y=!0;(t["aria-hidden"]==="false"||t["aria-hidden"]===!1)&&(y=!1);const x=()=>vi(d.current),b=()=>(f.current.modalRef=h.current,f.current.mount=d.current,f.current),w=()=>{KD.mount(b(),{disableScrollLock:r}),h.current&&(h.current.scrollTop=0)},_=st(()=>{const M=rat(e)||x().body;KD.add(b(),M),h.current&&w()}),S=()=>KD.isTopModal(b()),O=st(M=>{d.current=M,M&&(c&&S()?w():h.current&&QT(h.current,y))}),k=D.useCallback(()=>{KD.remove(b(),y)},[y]);D.useEffect(()=>()=>{k()},[k]),D.useEffect(()=>{c?_():(!v||!i)&&k()},[c,k,v,i,_]);const E=M=>I=>{var j;(j=M.onKeyDown)==null||j.call(M,I),!(I.key!=="Escape"||I.which===229||!S())&&(n||(I.stopPropagation(),l&&l(I,"escapeKeyDown")))},P=M=>I=>{var j;(j=M.onClick)==null||j.call(M,I),I.target===I.currentTarget&&l&&l(I,"backdropClick")};return{getRootProps:(M={})=>{const I=kx(t);delete I.onTransitionEnter,delete I.onTransitionExited;const j={...I,...M};return{role:"presentation",...j,onKeyDown:E(j),ref:p}},getBackdropProps:(M={})=>{const I=M;return{"aria-hidden":!0,...I,onClick:P(I),open:c}},getTransitionProps:()=>{const M=()=>{m(!1),o&&o()},I=()=>{m(!0),s&&s(),i&&k()};return{onEnter:KH(M,a==null?void 0:a.props.onEnter),onExited:KH(I,a==null?void 0:a.props.onExited)}},rootRef:p,portalRef:O,isTopModal:S,exited:g,hasTransition:v}}function sat(t){return Ye("MuiModal",t)}He("MuiModal",["root","hidden","backdrop"]);const aat=t=>{const{open:e,exited:n,classes:r}=t;return qe({root:["root",!e&&n&&"hidden"],backdrop:["backdrop"]},sat,r)},lat=be("div",{name:"MuiModal",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,!n.open&&n.exited&&e.hidden]}})(Tt(({theme:t})=>({position:"fixed",zIndex:(t.vars||t).zIndex.modal,right:0,bottom:0,top:0,left:0,variants:[{props:({ownerState:e})=>!e.open&&e.exited,style:{visibility:"hidden"}}]}))),cat=be(sPe,{name:"MuiModal",slot:"Backdrop",overridesResolver:(t,e)=>e.backdrop})({zIndex:-1}),hPe=D.forwardRef(function(e,n){const r=wt({name:"MuiModal",props:e}),{BackdropComponent:i=cat,BackdropProps:o,classes:s,className:a,closeAfterTransition:l=!1,children:c,container:u,component:f,components:d={},componentsProps:h={},disableAutoFocus:p=!1,disableEnforceFocus:g=!1,disableEscapeKeyDown:m=!1,disablePortal:v=!1,disableRestoreFocus:y=!1,disableScrollLock:x=!1,hideBackdrop:b=!1,keepMounted:w=!1,onBackdropClick:_,onClose:S,onTransitionEnter:O,onTransitionExited:k,open:E,slotProps:P={},slots:A={},theme:R,...T}=r,M={...r,closeAfterTransition:l,disableAutoFocus:p,disableEnforceFocus:g,disableEscapeKeyDown:m,disablePortal:v,disableRestoreFocus:y,disableScrollLock:x,hideBackdrop:b,keepMounted:w},{getRootProps:I,getBackdropProps:j,getTransitionProps:N,portalRef:z,isTopModal:L,exited:B,hasTransition:F}=oat({...M,rootRef:n}),$={...M,exited:B},q=aat($),G={};if(c.props.tabIndex===void 0&&(G.tabIndex="-1"),F){const{onEnter:te,onExited:ae}=N();G.onEnter=te,G.onExited=ae}const Y={...T,slots:{root:d.Root,backdrop:d.Backdrop,...A},slotProps:{...h,...P}},[le,K]=Zl("root",{elementType:lat,externalForwardedProps:Y,getSlotProps:I,additionalProps:{ref:n,as:f},ownerState:$,className:Oe(a,q==null?void 0:q.root,!$.open&&$.exited&&(q==null?void 0:q.hidden))}),[ee,re]=Zl("backdrop",{elementType:i,externalForwardedProps:Y,additionalProps:o,getSlotProps:te=>j({...te,onClick:ae=>{_&&_(ae),te!=null&&te.onClick&&te.onClick(ae)}}),className:Oe(o==null?void 0:o.className,q==null?void 0:q.backdrop),ownerState:$}),ge=dn(o==null?void 0:o.ref,re.ref);return!w&&!E&&(!F||B)?null:C.jsx(iPe,{ref:z,container:u,disablePortal:v,children:C.jsxs(le,{...K,children:[!b&&i?C.jsx(ee,{...re,ref:ge}):null,C.jsx(dPe,{disableEnforceFocus:g,disableAutoFocus:p,disableRestoreFocus:y,isEnabled:L,open:E,children:D.cloneElement(c,G)})]})})});function uat(t){return Ye("MuiDialog",t)}const KT=He("MuiDialog",["root","scrollPaper","scrollBody","container","paper","paperScrollPaper","paperScrollBody","paperWidthFalse","paperWidthXs","paperWidthSm","paperWidthMd","paperWidthLg","paperWidthXl","paperFullWidth","paperFullScreen"]),pPe=D.createContext({}),fat=be(sPe,{name:"MuiDialog",slot:"Backdrop",overrides:(t,e)=>e.backdrop})({zIndex:-1}),dat=t=>{const{classes:e,scroll:n,maxWidth:r,fullWidth:i,fullScreen:o}=t,s={root:["root"],container:["container",`scroll${Re(n)}`],paper:["paper",`paperScroll${Re(n)}`,`paperWidth${Re(String(r))}`,i&&"paperFullWidth",o&&"paperFullScreen"]};return qe(s,uat,e)},hat=be(hPe,{name:"MuiDialog",slot:"Root",overridesResolver:(t,e)=>e.root})({"@media print":{position:"absolute !important"}}),pat=be("div",{name:"MuiDialog",slot:"Container",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.container,e[`scroll${Re(n.scroll)}`]]}})({height:"100%","@media print":{height:"auto"},outline:0,variants:[{props:{scroll:"paper"},style:{display:"flex",justifyContent:"center",alignItems:"center"}},{props:{scroll:"body"},style:{overflowY:"auto",overflowX:"hidden",textAlign:"center","&::after":{content:'""',display:"inline-block",verticalAlign:"middle",height:"100%",width:"0"}}}]}),gat=be(Tl,{name:"MuiDialog",slot:"Paper",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.paper,e[`scrollPaper${Re(n.scroll)}`],e[`paperWidth${Re(String(n.maxWidth))}`],n.fullWidth&&e.paperFullWidth,n.fullScreen&&e.paperFullScreen]}})(Tt(({theme:t})=>({margin:32,position:"relative",overflowY:"auto","@media print":{overflowY:"visible",boxShadow:"none"},variants:[{props:{scroll:"paper"},style:{display:"flex",flexDirection:"column",maxHeight:"calc(100% - 64px)"}},{props:{scroll:"body"},style:{display:"inline-block",verticalAlign:"middle",textAlign:"initial"}},{props:({ownerState:e})=>!e.maxWidth,style:{maxWidth:"calc(100% - 64px)"}},{props:{maxWidth:"xs"},style:{maxWidth:t.breakpoints.unit==="px"?Math.max(t.breakpoints.values.xs,444):`max(${t.breakpoints.values.xs}${t.breakpoints.unit}, 444px)`,[`&.${KT.paperScrollBody}`]:{[t.breakpoints.down(Math.max(t.breakpoints.values.xs,444)+32*2)]:{maxWidth:"calc(100% - 64px)"}}}},...Object.keys(t.breakpoints.values).filter(e=>e!=="xs").map(e=>({props:{maxWidth:e},style:{maxWidth:`${t.breakpoints.values[e]}${t.breakpoints.unit}`,[`&.${KT.paperScrollBody}`]:{[t.breakpoints.down(t.breakpoints.values[e]+32*2)]:{maxWidth:"calc(100% - 64px)"}}}})),{props:({ownerState:e})=>e.fullWidth,style:{width:"calc(100% - 64px)"}},{props:({ownerState:e})=>e.fullScreen,style:{margin:0,width:"100%",maxWidth:"100%",height:"100%",maxHeight:"none",borderRadius:0,[`&.${KT.paperScrollBody}`]:{margin:0,maxWidth:"100%"}}}]}))),ed=D.forwardRef(function(e,n){const r=wt({props:e,name:"MuiDialog"}),i=$a(),o={enter:i.transitions.duration.enteringScreen,exit:i.transitions.duration.leavingScreen},{"aria-describedby":s,"aria-labelledby":a,"aria-modal":l=!0,BackdropComponent:c,BackdropProps:u,children:f,className:d,disableEscapeKeyDown:h=!1,fullScreen:p=!1,fullWidth:g=!1,maxWidth:m="sm",onBackdropClick:v,onClick:y,onClose:x,open:b,PaperComponent:w=Tl,PaperProps:_={},scroll:S="paper",TransitionComponent:O=XC,transitionDuration:k=o,TransitionProps:E,...P}=r,A={...r,disableEscapeKeyDown:h,fullScreen:p,fullWidth:g,maxWidth:m,scroll:S},R=dat(A),T=D.useRef(),M=z=>{T.current=z.target===z.currentTarget},I=z=>{y&&y(z),T.current&&(T.current=null,v&&v(z),x&&x(z,"backdropClick"))},j=Jf(a),N=D.useMemo(()=>({titleId:j}),[j]);return C.jsx(hat,{className:Oe(R.root,d),closeAfterTransition:!0,components:{Backdrop:fat},componentsProps:{backdrop:{transitionDuration:k,as:c,...u}},disableEscapeKeyDown:h,onClose:x,open:b,ref:n,onClick:I,ownerState:A,...P,children:C.jsx(O,{appear:!0,in:b,timeout:k,role:"presentation",...E,children:C.jsx(pat,{className:Oe(R.container),onMouseDown:M,ownerState:A,children:C.jsx(gat,{as:w,elevation:24,role:"dialog","aria-describedby":s,"aria-labelledby":j,"aria-modal":l,..._,className:Oe(R.paper,_.className),ownerState:A,children:C.jsx(pPe.Provider,{value:N,children:f})})})})})});function mat(t){return Ye("MuiDialogActions",t)}He("MuiDialogActions",["root","spacing"]);const vat=t=>{const{classes:e,disableSpacing:n}=t;return qe({root:["root",!n&&"spacing"]},mat,e)},yat=be("div",{name:"MuiDialogActions",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,!n.disableSpacing&&e.spacing]}})({display:"flex",alignItems:"center",padding:8,justifyContent:"flex-end",flex:"0 0 auto",variants:[{props:({ownerState:t})=>!t.disableSpacing,style:{"& > :not(style) ~ :not(style)":{marginLeft:8}}}]}),Yb=D.forwardRef(function(e,n){const r=wt({props:e,name:"MuiDialogActions"}),{className:i,disableSpacing:o=!1,...s}=r,a={...r,disableSpacing:o},l=vat(a);return C.jsx(yat,{className:Oe(l.root,i),ownerState:a,ref:n,...s})});function xat(t){return Ye("MuiDialogContent",t)}He("MuiDialogContent",["root","dividers"]);function bat(t){return Ye("MuiDialogTitle",t)}const wat=He("MuiDialogTitle",["root"]),_at=t=>{const{classes:e,dividers:n}=t;return qe({root:["root",n&&"dividers"]},xat,e)},Sat=be("div",{name:"MuiDialogContent",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,n.dividers&&e.dividers]}})(Tt(({theme:t})=>({flex:"1 1 auto",WebkitOverflowScrolling:"touch",overflowY:"auto",padding:"20px 24px",variants:[{props:({ownerState:e})=>e.dividers,style:{padding:"16px 24px",borderTop:`1px solid ${(t.vars||t).palette.divider}`,borderBottom:`1px solid ${(t.vars||t).palette.divider}`}},{props:({ownerState:e})=>!e.dividers,style:{[`.${wat.root} + &`]:{paddingTop:0}}}]}))),zf=D.forwardRef(function(e,n){const r=wt({props:e,name:"MuiDialogContent"}),{className:i,dividers:o=!1,...s}=r,a={...r,dividers:o},l=_at(a);return C.jsx(Sat,{className:Oe(l.root,i),ownerState:a,ref:n,...s})});function Cat(t){return Ye("MuiDialogContentText",t)}He("MuiDialogContentText",["root"]);const Oat=t=>{const{classes:e}=t,r=qe({root:["root"]},Cat,e);return{...e,...r}},Eat=be(Jt,{shouldForwardProp:t=>qo(t)||t==="classes",name:"MuiDialogContentText",slot:"Root",overridesResolver:(t,e)=>e.root})({}),Tat=D.forwardRef(function(e,n){const r=wt({props:e,name:"MuiDialogContentText"}),{children:i,className:o,...s}=r,a=Oat(s);return C.jsx(Eat,{component:"p",variant:"body1",color:"textSecondary",ref:n,ownerState:s,className:Oe(a.root,o),...r,classes:a})}),kat=t=>{const{classes:e}=t;return qe({root:["root"]},bat,e)},Aat=be(Jt,{name:"MuiDialogTitle",slot:"Root",overridesResolver:(t,e)=>e.root})({padding:"16px 24px",flex:"0 0 auto"}),Iy=D.forwardRef(function(e,n){const r=wt({props:e,name:"MuiDialogTitle"}),{className:i,id:o,...s}=r,a=r,l=kat(a),{titleId:c=o}=D.useContext(pPe);return C.jsx(Aat,{component:"h2",className:Oe(l.root,i),ownerState:a,ref:n,variant:"h6",id:o??c,...s})});function Pat(t){return Ye("MuiDivider",t)}const kde=He("MuiDivider",["root","absolute","fullWidth","inset","middle","flexItem","light","vertical","withChildren","withChildrenVertical","textAlignRight","textAlignLeft","wrapper","wrapperVertical"]),Mat=t=>{const{absolute:e,children:n,classes:r,flexItem:i,light:o,orientation:s,textAlign:a,variant:l}=t;return qe({root:["root",e&&"absolute",l,o&&"light",s==="vertical"&&"vertical",i&&"flexItem",n&&"withChildren",n&&s==="vertical"&&"withChildrenVertical",a==="right"&&s!=="vertical"&&"textAlignRight",a==="left"&&s!=="vertical"&&"textAlignLeft"],wrapper:["wrapper",s==="vertical"&&"wrapperVertical"]},Pat,r)},Rat=be("div",{name:"MuiDivider",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,n.absolute&&e.absolute,e[n.variant],n.light&&e.light,n.orientation==="vertical"&&e.vertical,n.flexItem&&e.flexItem,n.children&&e.withChildren,n.children&&n.orientation==="vertical"&&e.withChildrenVertical,n.textAlign==="right"&&n.orientation!=="vertical"&&e.textAlignRight,n.textAlign==="left"&&n.orientation!=="vertical"&&e.textAlignLeft]}})(Tt(({theme:t})=>({margin:0,flexShrink:0,borderWidth:0,borderStyle:"solid",borderColor:(t.vars||t).palette.divider,borderBottomWidth:"thin",variants:[{props:{absolute:!0},style:{position:"absolute",bottom:0,left:0,width:"100%"}},{props:{light:!0},style:{borderColor:t.vars?`rgba(${t.vars.palette.dividerChannel} / 0.08)`:kt(t.palette.divider,.08)}},{props:{variant:"inset"},style:{marginLeft:72}},{props:{variant:"middle",orientation:"horizontal"},style:{marginLeft:t.spacing(2),marginRight:t.spacing(2)}},{props:{variant:"middle",orientation:"vertical"},style:{marginTop:t.spacing(1),marginBottom:t.spacing(1)}},{props:{orientation:"vertical"},style:{height:"100%",borderBottomWidth:0,borderRightWidth:"thin"}},{props:{flexItem:!0},style:{alignSelf:"stretch",height:"auto"}},{props:({ownerState:e})=>!!e.children,style:{display:"flex",whiteSpace:"nowrap",textAlign:"center",border:0,borderTopStyle:"solid",borderLeftStyle:"solid","&::before, &::after":{content:'""',alignSelf:"center"}}},{props:({ownerState:e})=>e.children&&e.orientation!=="vertical",style:{"&::before, &::after":{width:"100%",borderTop:`thin solid ${(t.vars||t).palette.divider}`,borderTopStyle:"inherit"}}},{props:({ownerState:e})=>e.orientation==="vertical"&&e.children,style:{flexDirection:"column","&::before, &::after":{height:"100%",borderLeft:`thin solid ${(t.vars||t).palette.divider}`,borderLeftStyle:"inherit"}}},{props:({ownerState:e})=>e.textAlign==="right"&&e.orientation!=="vertical",style:{"&::before":{width:"90%"},"&::after":{width:"10%"}}},{props:({ownerState:e})=>e.textAlign==="left"&&e.orientation!=="vertical",style:{"&::before":{width:"10%"},"&::after":{width:"90%"}}}]}))),Dat=be("span",{name:"MuiDivider",slot:"Wrapper",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.wrapper,n.orientation==="vertical"&&e.wrapperVertical]}})(Tt(({theme:t})=>({display:"inline-block",paddingLeft:`calc(${t.spacing(1)} * 1.2)`,paddingRight:`calc(${t.spacing(1)} * 1.2)`,variants:[{props:{orientation:"vertical"},style:{paddingTop:`calc(${t.spacing(1)} * 1.2)`,paddingBottom:`calc(${t.spacing(1)} * 1.2)`}}]}))),_h=D.forwardRef(function(e,n){const r=wt({props:e,name:"MuiDivider"}),{absolute:i=!1,children:o,className:s,orientation:a="horizontal",component:l=o||a==="vertical"?"div":"hr",flexItem:c=!1,light:u=!1,role:f=l!=="hr"?"separator":void 0,textAlign:d="center",variant:h="fullWidth",...p}=r,g={...r,absolute:i,component:l,flexItem:c,light:u,orientation:a,role:f,textAlign:d,variant:h},m=Mat(g);return C.jsx(Rat,{as:l,className:Oe(m.root,s),role:f,ref:n,ownerState:g,"aria-orientation":f==="separator"&&(l!=="hr"||a==="vertical")?a:void 0,...p,children:o?C.jsx(Dat,{className:m.wrapper,ownerState:g,children:o}):null})});_h&&(_h.muiSkipListHighlight=!0);function Iat(t,e,n){const r=e.getBoundingClientRect(),i=n&&n.getBoundingClientRect(),o=xc(e);let s;if(e.fakeTransform)s=e.fakeTransform;else{const c=o.getComputedStyle(e);s=c.getPropertyValue("-webkit-transform")||c.getPropertyValue("transform")}let a=0,l=0;if(s&&s!=="none"&&typeof s=="string"){const c=s.split("(")[1].split(")")[0].split(",");a=parseInt(c[4],10),l=parseInt(c[5],10)}return t==="left"?i?`translateX(${i.right+a-r.left}px)`:`translateX(${o.innerWidth+a-r.left}px)`:t==="right"?i?`translateX(-${r.right-i.left-a}px)`:`translateX(-${r.left+r.width-a}px)`:t==="up"?i?`translateY(${i.bottom+l-r.top}px)`:`translateY(${o.innerHeight+l-r.top}px)`:i?`translateY(-${r.top-i.top+r.height-l}px)`:`translateY(-${r.top+r.height-l}px)`}function Lat(t){return typeof t=="function"?t():t}function ZD(t,e,n){const r=Lat(n),i=Iat(t,e,r);i&&(e.style.webkitTransform=i,e.style.transform=i)}const $at=D.forwardRef(function(e,n){const r=$a(),i={enter:r.transitions.easing.easeOut,exit:r.transitions.easing.sharp},o={enter:r.transitions.duration.enteringScreen,exit:r.transitions.duration.leavingScreen},{addEndListener:s,appear:a=!0,children:l,container:c,direction:u="down",easing:f=i,in:d,onEnter:h,onEntered:p,onEntering:g,onExit:m,onExited:v,onExiting:y,style:x,timeout:b=o,TransitionComponent:w=Rc,..._}=e,S=D.useRef(null),O=dn(Py(l),S,n),k=N=>z=>{N&&(z===void 0?N(S.current):N(S.current,z))},E=k((N,z)=>{ZD(u,N,c),Mee(N),h&&h(N,z)}),P=k((N,z)=>{const L=Zv({timeout:b,style:x,easing:f},{mode:"enter"});N.style.webkitTransition=r.transitions.create("-webkit-transform",{...L}),N.style.transition=r.transitions.create("transform",{...L}),N.style.webkitTransform="none",N.style.transform="none",g&&g(N,z)}),A=k(p),R=k(y),T=k(N=>{const z=Zv({timeout:b,style:x,easing:f},{mode:"exit"});N.style.webkitTransition=r.transitions.create("-webkit-transform",z),N.style.transition=r.transitions.create("transform",z),ZD(u,N,c),m&&m(N)}),M=k(N=>{N.style.webkitTransition="",N.style.transition="",v&&v(N)}),I=N=>{s&&s(S.current,N)},j=D.useCallback(()=>{S.current&&ZD(u,S.current,c)},[u,c]);return D.useEffect(()=>{if(d||u==="down"||u==="right")return;const N=kM(()=>{S.current&&ZD(u,S.current,c)}),z=xc(S.current);return z.addEventListener("resize",N),()=>{N.clear(),z.removeEventListener("resize",N)}},[u,d,c]),D.useEffect(()=>{d||j()},[d,j]),C.jsx(w,{nodeRef:S,onEnter:E,onEntered:A,onEntering:P,onExit:T,onExited:M,onExiting:R,addEndListener:I,appear:a,in:d,timeout:b,..._,children:(N,z)=>D.cloneElement(l,{ref:O,style:{visibility:N==="exited"&&!d?"hidden":void 0,...x,...l.props.style},...z})})}),Fat=t=>{const{classes:e,disableUnderline:n,startAdornment:r,endAdornment:i,size:o,hiddenLabel:s,multiline:a}=t,l={root:["root",!n&&"underline",r&&"adornedStart",i&&"adornedEnd",o==="small"&&`size${Re(o)}`,s&&"hiddenLabel",a&&"multiline"],input:["input"]},c=qe(l,kot,e);return{...e,...c}},Nat=be(m4,{shouldForwardProp:t=>qo(t)||t==="classes",name:"MuiFilledInput",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[...p4(t,e),!n.disableUnderline&&e.underline]}})(Tt(({theme:t})=>{const e=t.palette.mode==="light",n=e?"rgba(0, 0, 0, 0.42)":"rgba(255, 255, 255, 0.7)",r=e?"rgba(0, 0, 0, 0.06)":"rgba(255, 255, 255, 0.09)",i=e?"rgba(0, 0, 0, 0.09)":"rgba(255, 255, 255, 0.13)",o=e?"rgba(0, 0, 0, 0.12)":"rgba(255, 255, 255, 0.12)";return{position:"relative",backgroundColor:t.vars?t.vars.palette.FilledInput.bg:r,borderTopLeftRadius:(t.vars||t).shape.borderRadius,borderTopRightRadius:(t.vars||t).shape.borderRadius,transition:t.transitions.create("background-color",{duration:t.transitions.duration.shorter,easing:t.transitions.easing.easeOut}),"&:hover":{backgroundColor:t.vars?t.vars.palette.FilledInput.hoverBg:i,"@media (hover: none)":{backgroundColor:t.vars?t.vars.palette.FilledInput.bg:r}},[`&.${u0.focused}`]:{backgroundColor:t.vars?t.vars.palette.FilledInput.bg:r},[`&.${u0.disabled}`]:{backgroundColor:t.vars?t.vars.palette.FilledInput.disabledBg:o},variants:[{props:({ownerState:s})=>!s.disableUnderline,style:{"&::after":{left:0,bottom:0,content:'""',position:"absolute",right:0,transform:"scaleX(0)",transition:t.transitions.create("transform",{duration:t.transitions.duration.shorter,easing:t.transitions.easing.easeOut}),pointerEvents:"none"},[`&.${u0.focused}:after`]:{transform:"scaleX(1) translateX(0)"},[`&.${u0.error}`]:{"&::before, &::after":{borderBottomColor:(t.vars||t).palette.error.main}},"&::before":{borderBottom:`1px solid ${t.vars?`rgba(${t.vars.palette.common.onBackgroundChannel} / ${t.vars.opacity.inputUnderline})`:n}`,left:0,bottom:0,content:'"\\00a0"',position:"absolute",right:0,transition:t.transitions.create("border-bottom-color",{duration:t.transitions.duration.shorter}),pointerEvents:"none"},[`&:hover:not(.${u0.disabled}, .${u0.error}):before`]:{borderBottom:`1px solid ${(t.vars||t).palette.text.primary}`},[`&.${u0.disabled}:before`]:{borderBottomStyle:"dotted"}}},...Object.entries(t.palette).filter(ii()).map(([s])=>{var a;return{props:{disableUnderline:!1,color:s},style:{"&::after":{borderBottom:`2px solid ${(a=(t.vars||t).palette[s])==null?void 0:a.main}`}}}}),{props:({ownerState:s})=>s.startAdornment,style:{paddingLeft:12}},{props:({ownerState:s})=>s.endAdornment,style:{paddingRight:12}},{props:({ownerState:s})=>s.multiline,style:{padding:"25px 12px 8px"}},{props:({ownerState:s,size:a})=>s.multiline&&a==="small",style:{paddingTop:21,paddingBottom:4}},{props:({ownerState:s})=>s.multiline&&s.hiddenLabel,style:{paddingTop:16,paddingBottom:17}},{props:({ownerState:s})=>s.multiline&&s.hiddenLabel&&s.size==="small",style:{paddingTop:8,paddingBottom:9}}]}})),zat=be(v4,{name:"MuiFilledInput",slot:"Input",overridesResolver:g4})(Tt(({theme:t})=>({paddingTop:25,paddingRight:12,paddingBottom:8,paddingLeft:12,...!t.vars&&{"&:-webkit-autofill":{WebkitBoxShadow:t.palette.mode==="light"?null:"0 0 0 100px #266798 inset",WebkitTextFillColor:t.palette.mode==="light"?null:"#fff",caretColor:t.palette.mode==="light"?null:"#fff",borderTopLeftRadius:"inherit",borderTopRightRadius:"inherit"}},...t.vars&&{"&:-webkit-autofill":{borderTopLeftRadius:"inherit",borderTopRightRadius:"inherit"},[t.getColorSchemeSelector("dark")]:{"&:-webkit-autofill":{WebkitBoxShadow:"0 0 0 100px #266798 inset",WebkitTextFillColor:"#fff",caretColor:"#fff"}}},variants:[{props:{size:"small"},style:{paddingTop:21,paddingBottom:4}},{props:({ownerState:e})=>e.hiddenLabel,style:{paddingTop:16,paddingBottom:17}},{props:({ownerState:e})=>e.startAdornment,style:{paddingLeft:0}},{props:({ownerState:e})=>e.endAdornment,style:{paddingRight:0}},{props:({ownerState:e})=>e.hiddenLabel&&e.size==="small",style:{paddingTop:8,paddingBottom:9}},{props:({ownerState:e})=>e.multiline,style:{paddingTop:0,paddingBottom:0,paddingLeft:0,paddingRight:0}}]}))),$F=D.forwardRef(function(e,n){const r=wt({props:e,name:"MuiFilledInput"}),{disableUnderline:i=!1,components:o={},componentsProps:s,fullWidth:a=!1,hiddenLabel:l,inputComponent:c="input",multiline:u=!1,slotProps:f,slots:d={},type:h="text",...p}=r,g={...r,disableUnderline:i,fullWidth:a,inputComponent:c,multiline:u,type:h},m=Fat(r),v={root:{ownerState:g},input:{ownerState:g}},y=f??s?Bo(v,f??s):v,x=d.root??o.Root??Nat,b=d.input??o.Input??zat;return C.jsx(jee,{slots:{root:x,input:b},componentsProps:y,fullWidth:a,inputComponent:c,multiline:u,ref:n,type:h,...p,classes:m})});$F&&($F.muiName="Input");function jat(t){return Ye("MuiFormControl",t)}He("MuiFormControl",["root","marginNone","marginNormal","marginDense","fullWidth","disabled"]);const Bat=t=>{const{classes:e,margin:n,fullWidth:r}=t,i={root:["root",n!=="none"&&`margin${Re(n)}`,r&&"fullWidth"]};return qe(i,jat,e)},Uat=be("div",{name:"MuiFormControl",slot:"Root",overridesResolver:({ownerState:t},e)=>({...e.root,...e[`margin${Re(t.margin)}`],...t.fullWidth&&e.fullWidth})})({display:"inline-flex",flexDirection:"column",position:"relative",minWidth:0,padding:0,margin:0,border:0,verticalAlign:"top",variants:[{props:{margin:"normal"},style:{marginTop:16,marginBottom:8}},{props:{margin:"dense"},style:{marginTop:8,marginBottom:4}},{props:{fullWidth:!0},style:{width:"100%"}}]}),Ug=D.forwardRef(function(e,n){const r=wt({props:e,name:"MuiFormControl"}),{children:i,className:o,color:s="primary",component:a="div",disabled:l=!1,error:c=!1,focused:u,fullWidth:f=!1,hiddenLabel:d=!1,margin:h="none",required:p=!1,size:g="medium",variant:m="outlined",...v}=r,y={...r,color:s,component:a,disabled:l,error:c,fullWidth:f,hiddenLabel:d,margin:h,required:p,size:g,variant:m},x=Bat(y),[b,w]=D.useState(()=>{let R=!1;return i&&D.Children.forEach(i,T=>{if(!n3(T,["Input","Select"]))return;const M=n3(T,["Select"])?T.props.input:T;M&&Sot(M.props)&&(R=!0)}),R}),[_,S]=D.useState(()=>{let R=!1;return i&&D.Children.forEach(i,T=>{n3(T,["Input","Select"])&&(DF(T.props,!0)||DF(T.props.inputProps,!0))&&(R=!0)}),R}),[O,k]=D.useState(!1);l&&O&&k(!1);const E=u!==void 0&&!l?u:O;let P;D.useRef(!1);const A=D.useMemo(()=>({adornedStart:b,setAdornedStart:w,color:s,disabled:l,error:c,filled:_,focused:E,fullWidth:f,hiddenLabel:d,size:g,onBlur:()=>{k(!1)},onEmpty:()=>{S(!1)},onFilled:()=>{S(!0)},onFocus:()=>{k(!0)},registerEffect:P,required:p,variant:m}),[b,s,l,c,_,E,f,d,P,p,g,m]);return C.jsx(h4.Provider,{value:A,children:C.jsx(Uat,{as:a,ownerState:y,className:Oe(x.root,o),ref:n,...v,children:i})})});function Wat(t){return Ye("MuiFormControlLabel",t)}const Y2=He("MuiFormControlLabel",["root","labelPlacementStart","labelPlacementTop","labelPlacementBottom","disabled","label","error","required","asterisk"]),Vat=t=>{const{classes:e,disabled:n,labelPlacement:r,error:i,required:o}=t,s={root:["root",n&&"disabled",`labelPlacement${Re(r)}`,i&&"error",o&&"required"],label:["label",n&&"disabled"],asterisk:["asterisk",i&&"error"]};return qe(s,Wat,e)},Gat=be("label",{name:"MuiFormControlLabel",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[{[`& .${Y2.label}`]:e.label},e.root,e[`labelPlacement${Re(n.labelPlacement)}`]]}})(Tt(({theme:t})=>({display:"inline-flex",alignItems:"center",cursor:"pointer",verticalAlign:"middle",WebkitTapHighlightColor:"transparent",marginLeft:-11,marginRight:16,[`&.${Y2.disabled}`]:{cursor:"default"},[`& .${Y2.label}`]:{[`&.${Y2.disabled}`]:{color:(t.vars||t).palette.text.disabled}},variants:[{props:{labelPlacement:"start"},style:{flexDirection:"row-reverse",marginRight:-11}},{props:{labelPlacement:"top"},style:{flexDirection:"column-reverse"}},{props:{labelPlacement:"bottom"},style:{flexDirection:"column"}},{props:({labelPlacement:e})=>e==="start"||e==="top"||e==="bottom",style:{marginLeft:16}}]}))),Hat=be("span",{name:"MuiFormControlLabel",slot:"Asterisk",overridesResolver:(t,e)=>e.asterisk})(Tt(({theme:t})=>({[`&.${Y2.error}`]:{color:(t.vars||t).palette.error.main}}))),Px=D.forwardRef(function(e,n){const r=wt({props:e,name:"MuiFormControlLabel"}),{checked:i,className:o,componentsProps:s={},control:a,disabled:l,disableTypography:c,inputRef:u,label:f,labelPlacement:d="end",name:h,onChange:p,required:g,slots:m={},slotProps:v={},value:y,...x}=r,b=Fa(),w=l??a.props.disabled??(b==null?void 0:b.disabled),_=g??a.props.required,S={disabled:w,required:_};["checked","name","onChange","value","inputRef"].forEach(M=>{typeof a.props[M]>"u"&&typeof r[M]<"u"&&(S[M]=r[M])});const O=Ry({props:r,muiFormControl:b,states:["error"]}),k={...r,disabled:w,labelPlacement:d,required:_,error:O.error},E=Vat(k),P={slots:m,slotProps:{...s,...v}},[A,R]=Zl("typography",{elementType:Jt,externalForwardedProps:P,ownerState:k});let T=f;return T!=null&&T.type!==Jt&&!c&&(T=C.jsx(A,{component:"span",...R,className:Oe(E.label,R==null?void 0:R.className),children:T})),C.jsxs(Gat,{className:Oe(E.root,o),ownerState:k,ref:n,...x,children:[D.cloneElement(a,S),_?C.jsxs("div",{children:[T,C.jsxs(Hat,{ownerState:k,"aria-hidden":!0,className:E.asterisk,children:[" ","*"]})]}):T]})});function qat(t){return Ye("MuiFormGroup",t)}He("MuiFormGroup",["root","row","error"]);const Xat=t=>{const{classes:e,row:n,error:r}=t;return qe({root:["root",n&&"row",r&&"error"]},qat,e)},Yat=be("div",{name:"MuiFormGroup",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,n.row&&e.row]}})({display:"flex",flexDirection:"column",flexWrap:"wrap",variants:[{props:{row:!0},style:{flexDirection:"row"}}]}),Qat=D.forwardRef(function(e,n){const r=wt({props:e,name:"MuiFormGroup"}),{className:i,row:o=!1,...s}=r,a=Fa(),l=Ry({props:r,muiFormControl:a,states:["error"]}),c={...r,row:o,error:l.error},u=Xat(c);return C.jsx(Yat,{className:Oe(u.root,i),ownerState:c,ref:n,...s})});function Kat(t){return Ye("MuiFormHelperText",t)}const Ade=He("MuiFormHelperText",["root","error","disabled","sizeSmall","sizeMedium","contained","focused","filled","required"]);var Pde;const Zat=t=>{const{classes:e,contained:n,size:r,disabled:i,error:o,filled:s,focused:a,required:l}=t,c={root:["root",i&&"disabled",o&&"error",r&&`size${Re(r)}`,n&&"contained",a&&"focused",s&&"filled",l&&"required"]};return qe(c,Kat,e)},Jat=be("p",{name:"MuiFormHelperText",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,n.size&&e[`size${Re(n.size)}`],n.contained&&e.contained,n.filled&&e.filled]}})(Tt(({theme:t})=>({color:(t.vars||t).palette.text.secondary,...t.typography.caption,textAlign:"left",marginTop:3,marginRight:0,marginBottom:0,marginLeft:0,[`&.${Ade.disabled}`]:{color:(t.vars||t).palette.text.disabled},[`&.${Ade.error}`]:{color:(t.vars||t).palette.error.main},variants:[{props:{size:"small"},style:{marginTop:4}},{props:({ownerState:e})=>e.contained,style:{marginLeft:14,marginRight:14}}]}))),Uee=D.forwardRef(function(e,n){const r=wt({props:e,name:"MuiFormHelperText"}),{children:i,className:o,component:s="p",disabled:a,error:l,filled:c,focused:u,margin:f,required:d,variant:h,...p}=r,g=Fa(),m=Ry({props:r,muiFormControl:g,states:["variant","size","disabled","error","filled","focused","required"]}),v={...r,component:s,contained:m.variant==="filled"||m.variant==="outlined",variant:m.variant,size:m.size,disabled:m.disabled,error:m.error,filled:m.filled,focused:m.focused,required:m.required};delete v.ownerState;const y=Zat(v);return C.jsx(Jat,{as:s,className:Oe(y.root,o),ref:n,...p,ownerState:v,children:i===" "?Pde||(Pde=C.jsx("span",{className:"notranslate",children:"​"})):i})});function elt(t){return Ye("MuiFormLabel",t)}const ZT=He("MuiFormLabel",["root","colorSecondary","focused","disabled","error","filled","required","asterisk"]),tlt=t=>{const{classes:e,color:n,focused:r,disabled:i,error:o,filled:s,required:a}=t,l={root:["root",`color${Re(n)}`,i&&"disabled",o&&"error",s&&"filled",r&&"focused",a&&"required"],asterisk:["asterisk",o&&"error"]};return qe(l,elt,e)},nlt=be("label",{name:"MuiFormLabel",slot:"Root",overridesResolver:({ownerState:t},e)=>({...e.root,...t.color==="secondary"&&e.colorSecondary,...t.filled&&e.filled})})(Tt(({theme:t})=>({color:(t.vars||t).palette.text.secondary,...t.typography.body1,lineHeight:"1.4375em",padding:0,position:"relative",variants:[...Object.entries(t.palette).filter(ii()).map(([e])=>({props:{color:e},style:{[`&.${ZT.focused}`]:{color:(t.vars||t).palette[e].main}}})),{props:{},style:{[`&.${ZT.disabled}`]:{color:(t.vars||t).palette.text.disabled},[`&.${ZT.error}`]:{color:(t.vars||t).palette.error.main}}}]}))),rlt=be("span",{name:"MuiFormLabel",slot:"Asterisk",overridesResolver:(t,e)=>e.asterisk})(Tt(({theme:t})=>({[`&.${ZT.error}`]:{color:(t.vars||t).palette.error.main}}))),ilt=D.forwardRef(function(e,n){const r=wt({props:e,name:"MuiFormLabel"}),{children:i,className:o,color:s,component:a="label",disabled:l,error:c,filled:u,focused:f,required:d,...h}=r,p=Fa(),g=Ry({props:r,muiFormControl:p,states:["color","required","focused","disabled","error","filled"]}),m={...r,color:g.color||"primary",component:a,disabled:g.disabled,error:g.error,filled:g.filled,focused:g.focused,required:g.required},v=tlt(m);return C.jsxs(nlt,{as:a,ownerState:m,className:Oe(v.root,o),ref:n,...h,children:[i,g.required&&C.jsxs(rlt,{ownerState:m,"aria-hidden":!0,className:v.asterisk,children:[" ","*"]})]})}),Mde=D.createContext();function olt(t){return Ye("MuiGrid",t)}const slt=[0,1,2,3,4,5,6,7,8,9,10],alt=["column-reverse","column","row-reverse","row"],llt=["nowrap","wrap-reverse","wrap"],AE=["auto",!0,1,2,3,4,5,6,7,8,9,10,11,12],oA=He("MuiGrid",["root","container","item","zeroMinWidth",...slt.map(t=>`spacing-xs-${t}`),...alt.map(t=>`direction-xs-${t}`),...llt.map(t=>`wrap-xs-${t}`),...AE.map(t=>`grid-xs-${t}`),...AE.map(t=>`grid-sm-${t}`),...AE.map(t=>`grid-md-${t}`),...AE.map(t=>`grid-lg-${t}`),...AE.map(t=>`grid-xl-${t}`)]);function clt({theme:t,ownerState:e}){let n;return t.breakpoints.keys.reduce((r,i)=>{let o={};if(e[i]&&(n=e[i]),!n)return r;if(n===!0)o={flexBasis:0,flexGrow:1,maxWidth:"100%"};else if(n==="auto")o={flexBasis:"auto",flexGrow:0,flexShrink:0,maxWidth:"none",width:"auto"};else{const s=Vj({values:e.columns,breakpoints:t.breakpoints.values}),a=typeof s=="object"?s[i]:s;if(a==null)return r;const l=`${Math.round(n/a*1e8)/1e6}%`;let c={};if(e.container&&e.item&&e.columnSpacing!==0){const u=t.spacing(e.columnSpacing);if(u!=="0px"){const f=`calc(${l} + ${u})`;c={flexBasis:f,maxWidth:f}}}o={flexBasis:l,flexGrow:0,maxWidth:l,...c}}return t.breakpoints.values[i]===0?Object.assign(r,o):r[t.breakpoints.up(i)]=o,r},{})}function ult({theme:t,ownerState:e}){const n=Vj({values:e.direction,breakpoints:t.breakpoints.values});return _u({theme:t},n,r=>{const i={flexDirection:r};return r.startsWith("column")&&(i[`& > .${oA.item}`]={maxWidth:"none"}),i})}function gPe({breakpoints:t,values:e}){let n="";Object.keys(e).forEach(i=>{n===""&&e[i]!==0&&(n=i)});const r=Object.keys(t).sort((i,o)=>t[i]-t[o]);return r.slice(0,r.indexOf(n))}function flt({theme:t,ownerState:e}){const{container:n,rowSpacing:r}=e;let i={};if(n&&r!==0){const o=Vj({values:r,breakpoints:t.breakpoints.values});let s;typeof o=="object"&&(s=gPe({breakpoints:t.breakpoints.values,values:o})),i=_u({theme:t},o,(a,l)=>{const c=t.spacing(a);return c!=="0px"?{marginTop:t.spacing(-a),[`& > .${oA.item}`]:{paddingTop:c}}:s!=null&&s.includes(l)?{}:{marginTop:0,[`& > .${oA.item}`]:{paddingTop:0}}})}return i}function dlt({theme:t,ownerState:e}){const{container:n,columnSpacing:r}=e;let i={};if(n&&r!==0){const o=Vj({values:r,breakpoints:t.breakpoints.values});let s;typeof o=="object"&&(s=gPe({breakpoints:t.breakpoints.values,values:o})),i=_u({theme:t},o,(a,l)=>{const c=t.spacing(a);if(c!=="0px"){const u=t.spacing(-a);return{width:`calc(100% + ${c})`,marginLeft:u,[`& > .${oA.item}`]:{paddingLeft:c}}}return s!=null&&s.includes(l)?{}:{width:"100%",marginLeft:0,[`& > .${oA.item}`]:{paddingLeft:0}}})}return i}function hlt(t,e,n={}){if(!t||t<=0)return[];if(typeof t=="string"&&!Number.isNaN(Number(t))||typeof t=="number")return[n[`spacing-xs-${String(t)}`]];const r=[];return e.forEach(i=>{const o=t[i];Number(o)>0&&r.push(n[`spacing-${i}-${String(o)}`])}),r}const plt=be("div",{name:"MuiGrid",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t,{container:r,direction:i,item:o,spacing:s,wrap:a,zeroMinWidth:l,breakpoints:c}=n;let u=[];r&&(u=hlt(s,c,e));const f=[];return c.forEach(d=>{const h=n[d];h&&f.push(e[`grid-${d}-${String(h)}`])}),[e.root,r&&e.container,o&&e.item,l&&e.zeroMinWidth,...u,i!=="row"&&e[`direction-xs-${String(i)}`],a!=="wrap"&&e[`wrap-xs-${String(a)}`],...f]}})(({ownerState:t})=>({boxSizing:"border-box",...t.container&&{display:"flex",flexWrap:"wrap",width:"100%"},...t.item&&{margin:0},...t.zeroMinWidth&&{minWidth:0},...t.wrap!=="wrap"&&{flexWrap:t.wrap}}),ult,flt,dlt,clt);function glt(t,e){if(!t||t<=0)return[];if(typeof t=="string"&&!Number.isNaN(Number(t))||typeof t=="number")return[`spacing-xs-${String(t)}`];const n=[];return e.forEach(r=>{const i=t[r];if(Number(i)>0){const o=`spacing-${r}-${String(i)}`;n.push(o)}}),n}const mlt=t=>{const{classes:e,container:n,direction:r,item:i,spacing:o,wrap:s,zeroMinWidth:a,breakpoints:l}=t;let c=[];n&&(c=glt(o,l));const u=[];l.forEach(d=>{const h=t[d];h&&u.push(`grid-${d}-${String(h)}`)});const f={root:["root",n&&"container",i&&"item",a&&"zeroMinWidth",...c,r!=="row"&&`direction-xs-${String(r)}`,s!=="wrap"&&`wrap-xs-${String(s)}`,...u]};return qe(f,olt,e)},rW=D.forwardRef(function(e,n){const r=kn({props:e,name:"MuiGrid"}),{breakpoints:i}=$a(),o=wee(r),{className:s,columns:a,columnSpacing:l,component:c="div",container:u=!1,direction:f="row",item:d=!1,rowSpacing:h,spacing:p=0,wrap:g="wrap",zeroMinWidth:m=!1,...v}=o,y=h||p,x=l||p,b=D.useContext(Mde),w=u?a||12:b,_={},S={...v};i.keys.forEach(E=>{v[E]!=null&&(_[E]=v[E],delete S[E])});const O={...o,columns:w,container:u,direction:f,item:d,rowSpacing:y,columnSpacing:x,wrap:g,zeroMinWidth:m,spacing:p,..._,breakpoints:i.keys},k=mlt(O);return C.jsx(Mde.Provider,{value:w,children:C.jsx(plt,{ownerState:O,className:Oe(k.root,s),as:c,ref:n,...S})})});function cq(t){return`scale(${t}, ${t**2})`}const vlt={entering:{opacity:1,transform:cq(1)},entered:{opacity:1,transform:"none"}},iW=typeof navigator<"u"&&/^((?!chrome|android).)*(safari|mobile)/i.test(navigator.userAgent)&&/(os |version\/)15(.|_)4/i.test(navigator.userAgent),nb=D.forwardRef(function(e,n){const{addEndListener:r,appear:i=!0,children:o,easing:s,in:a,onEnter:l,onEntered:c,onEntering:u,onExit:f,onExited:d,onExiting:h,style:p,timeout:g="auto",TransitionComponent:m=Rc,...v}=e,y=lv(),x=D.useRef(),b=$a(),w=D.useRef(null),_=dn(w,Py(o),n),S=M=>I=>{if(M){const j=w.current;I===void 0?M(j):M(j,I)}},O=S(u),k=S((M,I)=>{Mee(M);const{duration:j,delay:N,easing:z}=Zv({style:p,timeout:g,easing:s},{mode:"enter"});let L;g==="auto"?(L=b.transitions.getAutoHeightDuration(M.clientHeight),x.current=L):L=j,M.style.transition=[b.transitions.create("opacity",{duration:L,delay:N}),b.transitions.create("transform",{duration:iW?L:L*.666,delay:N,easing:z})].join(","),l&&l(M,I)}),E=S(c),P=S(h),A=S(M=>{const{duration:I,delay:j,easing:N}=Zv({style:p,timeout:g,easing:s},{mode:"exit"});let z;g==="auto"?(z=b.transitions.getAutoHeightDuration(M.clientHeight),x.current=z):z=I,M.style.transition=[b.transitions.create("opacity",{duration:z,delay:j}),b.transitions.create("transform",{duration:iW?z:z*.666,delay:iW?j:j||z*.333,easing:N})].join(","),M.style.opacity=0,M.style.transform=cq(.75),f&&f(M)}),R=S(d),T=M=>{g==="auto"&&y.start(x.current||0,M),r&&r(w.current,M)};return C.jsx(m,{appear:i,in:a,nodeRef:w,onEnter:k,onEntered:E,onEntering:O,onExit:A,onExited:R,onExiting:P,addEndListener:T,timeout:g==="auto"?null:g,...v,children:(M,I)=>D.cloneElement(o,{style:{opacity:0,transform:cq(.75),visibility:M==="exited"&&!a?"hidden":void 0,...vlt[M],...p,...o.props.style},ref:_,...I})})});nb&&(nb.muiSupportAuto=!0);function ylt(t){return Ye("MuiIcon",t)}He("MuiIcon",["root","colorPrimary","colorSecondary","colorAction","colorError","colorDisabled","fontSizeInherit","fontSizeSmall","fontSizeMedium","fontSizeLarge"]);const xlt=t=>{const{color:e,fontSize:n,classes:r}=t,i={root:["root",e!=="inherit"&&`color${Re(e)}`,`fontSize${Re(n)}`]};return qe(i,ylt,r)},blt=be("span",{name:"MuiIcon",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,n.color!=="inherit"&&e[`color${Re(n.color)}`],e[`fontSize${Re(n.fontSize)}`]]}})(Tt(({theme:t})=>({userSelect:"none",width:"1em",height:"1em",overflow:"hidden",display:"inline-block",textAlign:"center",flexShrink:0,variants:[{props:{fontSize:"inherit"},style:{fontSize:"inherit"}},{props:{fontSize:"small"},style:{fontSize:t.typography.pxToRem(20)}},{props:{fontSize:"medium"},style:{fontSize:t.typography.pxToRem(24)}},{props:{fontSize:"large"},style:{fontSize:t.typography.pxToRem(36)}},{props:{color:"action"},style:{color:(t.vars||t).palette.action.active}},{props:{color:"disabled"},style:{color:(t.vars||t).palette.action.disabled}},{props:{color:"inherit"},style:{color:void 0}},...Object.entries(t.palette).filter(ii()).map(([e])=>({props:{color:e},style:{color:(t.vars||t).palette[e].main}}))]}))),sA=D.forwardRef(function(e,n){const r=wt({props:e,name:"MuiIcon"}),{baseClassName:i="material-icons",className:o,color:s="inherit",component:a="span",fontSize:l="medium",...c}=r,u={...r,baseClassName:i,color:s,component:a,fontSize:l},f=xlt(u);return C.jsx(blt,{as:a,className:Oe(i,"notranslate",f.root,o),ownerState:u,"aria-hidden":!0,ref:n,...c})});sA&&(sA.muiName="Icon");const wlt=t=>{const{classes:e,disableUnderline:n}=t,i=qe({root:["root",!n&&"underline"],input:["input"]},Eot,e);return{...e,...i}},_lt=be(m4,{shouldForwardProp:t=>qo(t)||t==="classes",name:"MuiInput",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[...p4(t,e),!n.disableUnderline&&e.underline]}})(Tt(({theme:t})=>{let n=t.palette.mode==="light"?"rgba(0, 0, 0, 0.42)":"rgba(255, 255, 255, 0.7)";return t.vars&&(n=`rgba(${t.vars.palette.common.onBackgroundChannel} / ${t.vars.opacity.inputUnderline})`),{position:"relative",variants:[{props:({ownerState:r})=>r.formControl,style:{"label + &":{marginTop:16}}},{props:({ownerState:r})=>!r.disableUnderline,style:{"&::after":{left:0,bottom:0,content:'""',position:"absolute",right:0,transform:"scaleX(0)",transition:t.transitions.create("transform",{duration:t.transitions.duration.shorter,easing:t.transitions.easing.easeOut}),pointerEvents:"none"},[`&.${kE.focused}:after`]:{transform:"scaleX(1) translateX(0)"},[`&.${kE.error}`]:{"&::before, &::after":{borderBottomColor:(t.vars||t).palette.error.main}},"&::before":{borderBottom:`1px solid ${n}`,left:0,bottom:0,content:'"\\00a0"',position:"absolute",right:0,transition:t.transitions.create("border-bottom-color",{duration:t.transitions.duration.shorter}),pointerEvents:"none"},[`&:hover:not(.${kE.disabled}, .${kE.error}):before`]:{borderBottom:`2px solid ${(t.vars||t).palette.text.primary}`,"@media (hover: none)":{borderBottom:`1px solid ${n}`}},[`&.${kE.disabled}:before`]:{borderBottomStyle:"dotted"}}},...Object.entries(t.palette).filter(ii()).map(([r])=>({props:{color:r,disableUnderline:!1},style:{"&::after":{borderBottom:`2px solid ${(t.vars||t).palette[r].main}`}}}))]}})),Slt=be(v4,{name:"MuiInput",slot:"Input",overridesResolver:g4})({}),Ag=D.forwardRef(function(e,n){const r=wt({props:e,name:"MuiInput"}),{disableUnderline:i=!1,components:o={},componentsProps:s,fullWidth:a=!1,inputComponent:l="input",multiline:c=!1,slotProps:u,slots:f={},type:d="text",...h}=r,p=wlt(r),m={root:{ownerState:{disableUnderline:i}}},v=u??s?Bo(u??s,m):m,y=f.root??o.Root??_lt,x=f.input??o.Input??Slt;return C.jsx(jee,{slots:{root:y,input:x},slotProps:v,fullWidth:a,inputComponent:l,multiline:c,ref:n,type:d,...h,classes:p})});Ag&&(Ag.muiName="Input");function Clt(t){return Ye("MuiInputAdornment",t)}const Rde=He("MuiInputAdornment",["root","filled","standard","outlined","positionStart","positionEnd","disablePointerEvents","hiddenLabel","sizeSmall"]);var Dde;const Olt=(t,e)=>{const{ownerState:n}=t;return[e.root,e[`position${Re(n.position)}`],n.disablePointerEvents===!0&&e.disablePointerEvents,e[n.variant]]},Elt=t=>{const{classes:e,disablePointerEvents:n,hiddenLabel:r,position:i,size:o,variant:s}=t,a={root:["root",n&&"disablePointerEvents",i&&`position${Re(i)}`,s,r&&"hiddenLabel",o&&`size${Re(o)}`]};return qe(a,Clt,e)},Tlt=be("div",{name:"MuiInputAdornment",slot:"Root",overridesResolver:Olt})(Tt(({theme:t})=>({display:"flex",maxHeight:"2em",alignItems:"center",whiteSpace:"nowrap",color:(t.vars||t).palette.action.active,variants:[{props:{variant:"filled"},style:{[`&.${Rde.positionStart}&:not(.${Rde.hiddenLabel})`]:{marginTop:16}}},{props:{position:"start"},style:{marginRight:8}},{props:{position:"end"},style:{marginLeft:8}},{props:{disablePointerEvents:!0},style:{pointerEvents:"none"}}]}))),mPe=D.forwardRef(function(e,n){const r=wt({props:e,name:"MuiInputAdornment"}),{children:i,className:o,component:s="div",disablePointerEvents:a=!1,disableTypography:l=!1,position:c,variant:u,...f}=r,d=Fa()||{};let h=u;u&&d.variant,d&&!h&&(h=d.variant);const p={...r,hiddenLabel:d.hiddenLabel,size:d.size,disablePointerEvents:a,position:c,variant:h},g=Elt(p);return C.jsx(h4.Provider,{value:null,children:C.jsx(Tlt,{as:s,ownerState:p,className:Oe(g.root,o),ref:n,...f,children:typeof i=="string"&&!l?C.jsx(Jt,{color:"textSecondary",children:i}):C.jsxs(D.Fragment,{children:[c==="start"?Dde||(Dde=C.jsx("span",{className:"notranslate",children:"​"})):null,i]})})})});function klt(t){return Ye("MuiInputLabel",t)}He("MuiInputLabel",["root","focused","disabled","error","required","asterisk","formControl","sizeSmall","shrink","animated","standard","filled","outlined"]);const Alt=t=>{const{classes:e,formControl:n,size:r,shrink:i,disableAnimation:o,variant:s,required:a}=t,l={root:["root",n&&"formControl",!o&&"animated",i&&"shrink",r&&r!=="normal"&&`size${Re(r)}`,s],asterisk:[a&&"asterisk"]},c=qe(l,klt,e);return{...e,...c}},Plt=be(ilt,{shouldForwardProp:t=>qo(t)||t==="classes",name:"MuiInputLabel",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[{[`& .${ZT.asterisk}`]:e.asterisk},e.root,n.formControl&&e.formControl,n.size==="small"&&e.sizeSmall,n.shrink&&e.shrink,!n.disableAnimation&&e.animated,n.focused&&e.focused,e[n.variant]]}})(Tt(({theme:t})=>({display:"block",transformOrigin:"top left",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",maxWidth:"100%",variants:[{props:({ownerState:e})=>e.formControl,style:{position:"absolute",left:0,top:0,transform:"translate(0, 20px) scale(1)"}},{props:{size:"small"},style:{transform:"translate(0, 17px) scale(1)"}},{props:({ownerState:e})=>e.shrink,style:{transform:"translate(0, -1.5px) scale(0.75)",transformOrigin:"top left",maxWidth:"133%"}},{props:({ownerState:e})=>!e.disableAnimation,style:{transition:t.transitions.create(["color","transform","max-width"],{duration:t.transitions.duration.shorter,easing:t.transitions.easing.easeOut})}},{props:{variant:"filled"},style:{zIndex:1,pointerEvents:"none",transform:"translate(12px, 16px) scale(1)",maxWidth:"calc(100% - 24px)"}},{props:{variant:"filled",size:"small"},style:{transform:"translate(12px, 13px) scale(1)"}},{props:({variant:e,ownerState:n})=>e==="filled"&&n.shrink,style:{userSelect:"none",pointerEvents:"auto",transform:"translate(12px, 7px) scale(0.75)",maxWidth:"calc(133% - 24px)"}},{props:({variant:e,ownerState:n,size:r})=>e==="filled"&&n.shrink&&r==="small",style:{transform:"translate(12px, 4px) scale(0.75)"}},{props:{variant:"outlined"},style:{zIndex:1,pointerEvents:"none",transform:"translate(14px, 16px) scale(1)",maxWidth:"calc(100% - 24px)"}},{props:{variant:"outlined",size:"small"},style:{transform:"translate(14px, 9px) scale(1)"}},{props:({variant:e,ownerState:n})=>e==="outlined"&&n.shrink,style:{userSelect:"none",pointerEvents:"auto",maxWidth:"calc(133% - 32px)",transform:"translate(14px, -9px) scale(0.75)"}}]}))),Ly=D.forwardRef(function(e,n){const r=wt({name:"MuiInputLabel",props:e}),{disableAnimation:i=!1,margin:o,shrink:s,variant:a,className:l,...c}=r,u=Fa();let f=s;typeof f>"u"&&u&&(f=u.filled||u.focused||u.adornedStart);const d=Ry({props:r,muiFormControl:u,states:["size","variant","required","focused"]}),h={...r,disableAnimation:i,formControl:u,shrink:f,size:d.size,variant:d.variant,required:d.required,focused:d.focused},p=Alt(h);return C.jsx(Plt,{"data-shrink":f,ref:n,className:Oe(p.root,l),...c,ownerState:h,classes:p})});function Mlt(t){return Ye("MuiLink",t)}const Rlt=He("MuiLink",["root","underlineNone","underlineHover","underlineAlways","button","focusVisible"]),Dlt=({theme:t,ownerState:e})=>{const n=e.color,r=mS(t,`palette.${n}`,!1)||e.color,i=mS(t,`palette.${n}Channel`);return"vars"in t&&i?`rgba(${i} / 0.4)`:kt(r,.4)},Ide={primary:!0,secondary:!0,error:!0,info:!0,success:!0,warning:!0,textPrimary:!0,textSecondary:!0,textDisabled:!0},Ilt=t=>{const{classes:e,component:n,focusVisible:r,underline:i}=t,o={root:["root",`underline${Re(i)}`,n==="button"&&"button",r&&"focusVisible"]};return qe(o,Mlt,e)},Llt=be(Jt,{name:"MuiLink",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,e[`underline${Re(n.underline)}`],n.component==="button"&&e.button]}})(Tt(({theme:t})=>({variants:[{props:{underline:"none"},style:{textDecoration:"none"}},{props:{underline:"hover"},style:{textDecoration:"none","&:hover":{textDecoration:"underline"}}},{props:{underline:"always"},style:{textDecoration:"underline","&:hover":{textDecorationColor:"inherit"}}},{props:({underline:e,ownerState:n})=>e==="always"&&n.color!=="inherit",style:{textDecorationColor:"var(--Link-underlineColor)"}},...Object.entries(t.palette).filter(ii()).map(([e])=>({props:{underline:"always",color:e},style:{"--Link-underlineColor":t.vars?`rgba(${t.vars.palette[e].mainChannel} / 0.4)`:kt(t.palette[e].main,.4)}})),{props:{underline:"always",color:"textPrimary"},style:{"--Link-underlineColor":t.vars?`rgba(${t.vars.palette.text.primaryChannel} / 0.4)`:kt(t.palette.text.primary,.4)}},{props:{underline:"always",color:"textSecondary"},style:{"--Link-underlineColor":t.vars?`rgba(${t.vars.palette.text.secondaryChannel} / 0.4)`:kt(t.palette.text.secondary,.4)}},{props:{underline:"always",color:"textDisabled"},style:{"--Link-underlineColor":(t.vars||t).palette.text.disabled}},{props:{component:"button"},style:{position:"relative",WebkitTapHighlightColor:"transparent",backgroundColor:"transparent",outline:0,border:0,margin:0,borderRadius:0,padding:0,cursor:"pointer",userSelect:"none",verticalAlign:"middle",MozAppearance:"none",WebkitAppearance:"none","&::-moz-focus-inner":{borderStyle:"none"},[`&.${Rlt.focusVisible}`]:{outline:"auto"}}}]}))),$lt=D.forwardRef(function(e,n){const r=wt({props:e,name:"MuiLink"}),i=$a(),{className:o,color:s="primary",component:a="a",onBlur:l,onFocus:c,TypographyClasses:u,underline:f="always",variant:d="inherit",sx:h,...p}=r,[g,m]=D.useState(!1),v=w=>{Kv(w.target)||m(!1),l&&l(w)},y=w=>{Kv(w.target)&&m(!0),c&&c(w)},x={...r,color:s,component:a,focusVisible:g,underline:f,variant:d},b=Ilt(x);return C.jsx(Llt,{color:s,className:Oe(b.root,o),classes:u,component:a,onBlur:v,onFocus:y,ref:n,ownerState:x,variant:d,...p,sx:[...Ide[s]===void 0?[{color:s}]:[],...Array.isArray(h)?h:[h]],style:{...p.style,...f==="always"&&s!=="inherit"&&!Ide[s]&&{"--Link-underlineColor":Dlt({theme:i,ownerState:x})}}})}),If=D.createContext({});function Flt(t){return Ye("MuiList",t)}He("MuiList",["root","padding","dense","subheader"]);const Nlt=t=>{const{classes:e,disablePadding:n,dense:r,subheader:i}=t;return qe({root:["root",!n&&"padding",r&&"dense",i&&"subheader"]},Flt,e)},zlt=be("ul",{name:"MuiList",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,!n.disablePadding&&e.padding,n.dense&&e.dense,n.subheader&&e.subheader]}})({listStyle:"none",margin:0,padding:0,position:"relative",variants:[{props:({ownerState:t})=>!t.disablePadding,style:{paddingTop:8,paddingBottom:8}},{props:({ownerState:t})=>t.subheader,style:{paddingTop:0}}]}),DM=D.forwardRef(function(e,n){const r=wt({props:e,name:"MuiList"}),{children:i,className:o,component:s="ul",dense:a=!1,disablePadding:l=!1,subheader:c,...u}=r,f=D.useMemo(()=>({dense:a}),[a]),d={...r,component:s,dense:a,disablePadding:l},h=Nlt(d);return C.jsx(If.Provider,{value:f,children:C.jsxs(zlt,{as:s,className:Oe(h.root,o),ref:n,ownerState:d,...u,children:[c,i]})})});function jlt(t){return Ye("MuiListItem",t)}He("MuiListItem",["root","container","dense","alignItemsFlexStart","divider","gutters","padding","secondaryAction"]);function Blt(t){return Ye("MuiListItemButton",t)}const Mw=He("MuiListItemButton",["root","focusVisible","dense","alignItemsFlexStart","disabled","divider","gutters","selected"]),Ult=(t,e)=>{const{ownerState:n}=t;return[e.root,n.dense&&e.dense,n.alignItems==="flex-start"&&e.alignItemsFlexStart,n.divider&&e.divider,!n.disableGutters&&e.gutters]},Wlt=t=>{const{alignItems:e,classes:n,dense:r,disabled:i,disableGutters:o,divider:s,selected:a}=t,c=qe({root:["root",r&&"dense",!o&&"gutters",s&&"divider",i&&"disabled",e==="flex-start"&&"alignItemsFlexStart",a&&"selected"]},Blt,n);return{...n,...c}},Vlt=be(Nf,{shouldForwardProp:t=>qo(t)||t==="classes",name:"MuiListItemButton",slot:"Root",overridesResolver:Ult})(Tt(({theme:t})=>({display:"flex",flexGrow:1,justifyContent:"flex-start",alignItems:"center",position:"relative",textDecoration:"none",minWidth:0,boxSizing:"border-box",textAlign:"left",paddingTop:8,paddingBottom:8,transition:t.transitions.create("background-color",{duration:t.transitions.duration.shortest}),"&:hover":{textDecoration:"none",backgroundColor:(t.vars||t).palette.action.hover,"@media (hover: none)":{backgroundColor:"transparent"}},[`&.${Mw.selected}`]:{backgroundColor:t.vars?`rgba(${t.vars.palette.primary.mainChannel} / ${t.vars.palette.action.selectedOpacity})`:kt(t.palette.primary.main,t.palette.action.selectedOpacity),[`&.${Mw.focusVisible}`]:{backgroundColor:t.vars?`rgba(${t.vars.palette.primary.mainChannel} / calc(${t.vars.palette.action.selectedOpacity} + ${t.vars.palette.action.focusOpacity}))`:kt(t.palette.primary.main,t.palette.action.selectedOpacity+t.palette.action.focusOpacity)}},[`&.${Mw.selected}:hover`]:{backgroundColor:t.vars?`rgba(${t.vars.palette.primary.mainChannel} / calc(${t.vars.palette.action.selectedOpacity} + ${t.vars.palette.action.hoverOpacity}))`:kt(t.palette.primary.main,t.palette.action.selectedOpacity+t.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:t.vars?`rgba(${t.vars.palette.primary.mainChannel} / ${t.vars.palette.action.selectedOpacity})`:kt(t.palette.primary.main,t.palette.action.selectedOpacity)}},[`&.${Mw.focusVisible}`]:{backgroundColor:(t.vars||t).palette.action.focus},[`&.${Mw.disabled}`]:{opacity:(t.vars||t).palette.action.disabledOpacity},variants:[{props:({ownerState:e})=>e.divider,style:{borderBottom:`1px solid ${(t.vars||t).palette.divider}`,backgroundClip:"padding-box"}},{props:{alignItems:"flex-start"},style:{alignItems:"flex-start"}},{props:({ownerState:e})=>!e.disableGutters,style:{paddingLeft:16,paddingRight:16}},{props:({ownerState:e})=>e.dense,style:{paddingTop:4,paddingBottom:4}}]}))),vPe=D.forwardRef(function(e,n){const r=wt({props:e,name:"MuiListItemButton"}),{alignItems:i="center",autoFocus:o=!1,component:s="div",children:a,dense:l=!1,disableGutters:c=!1,divider:u=!1,focusVisibleClassName:f,selected:d=!1,className:h,...p}=r,g=D.useContext(If),m=D.useMemo(()=>({dense:l||g.dense||!1,alignItems:i,disableGutters:c}),[i,g.dense,l,c]),v=D.useRef(null);Ti(()=>{o&&v.current&&v.current.focus()},[o]);const y={...r,alignItems:i,dense:m.dense,disableGutters:c,divider:u,selected:d},x=Wlt(y),b=dn(v,n);return C.jsx(If.Provider,{value:m,children:C.jsx(Vlt,{ref:b,href:p.href||p.to,component:(p.href||p.to)&&s==="div"?"button":s,focusVisibleClassName:Oe(x.focusVisible,f),ownerState:y,className:Oe(x.root,h),...p,classes:x,children:a})})});function Glt(t){return Ye("MuiListItemSecondaryAction",t)}He("MuiListItemSecondaryAction",["root","disableGutters"]);const Hlt=t=>{const{disableGutters:e,classes:n}=t;return qe({root:["root",e&&"disableGutters"]},Glt,n)},qlt=be("div",{name:"MuiListItemSecondaryAction",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,n.disableGutters&&e.disableGutters]}})({position:"absolute",right:16,top:"50%",transform:"translateY(-50%)",variants:[{props:({ownerState:t})=>t.disableGutters,style:{right:0}}]}),aA=D.forwardRef(function(e,n){const r=wt({props:e,name:"MuiListItemSecondaryAction"}),{className:i,...o}=r,s=D.useContext(If),a={...r,disableGutters:s.disableGutters},l=Hlt(a);return C.jsx(qlt,{className:Oe(l.root,i),ownerState:a,ref:n,...o})});aA.muiName="ListItemSecondaryAction";const Xlt=(t,e)=>{const{ownerState:n}=t;return[e.root,n.dense&&e.dense,n.alignItems==="flex-start"&&e.alignItemsFlexStart,n.divider&&e.divider,!n.disableGutters&&e.gutters,!n.disablePadding&&e.padding,n.hasSecondaryAction&&e.secondaryAction]},Ylt=t=>{const{alignItems:e,classes:n,dense:r,disableGutters:i,disablePadding:o,divider:s,hasSecondaryAction:a}=t;return qe({root:["root",r&&"dense",!i&&"gutters",!o&&"padding",s&&"divider",e==="flex-start"&&"alignItemsFlexStart",a&&"secondaryAction"],container:["container"]},jlt,n)},Qlt=be("div",{name:"MuiListItem",slot:"Root",overridesResolver:Xlt})(Tt(({theme:t})=>({display:"flex",justifyContent:"flex-start",alignItems:"center",position:"relative",textDecoration:"none",width:"100%",boxSizing:"border-box",textAlign:"left",variants:[{props:({ownerState:e})=>!e.disablePadding,style:{paddingTop:8,paddingBottom:8}},{props:({ownerState:e})=>!e.disablePadding&&e.dense,style:{paddingTop:4,paddingBottom:4}},{props:({ownerState:e})=>!e.disablePadding&&!e.disableGutters,style:{paddingLeft:16,paddingRight:16}},{props:({ownerState:e})=>!e.disablePadding&&!!e.secondaryAction,style:{paddingRight:48}},{props:({ownerState:e})=>!!e.secondaryAction,style:{[`& > .${Mw.root}`]:{paddingRight:48}}},{props:{alignItems:"flex-start"},style:{alignItems:"flex-start"}},{props:({ownerState:e})=>e.divider,style:{borderBottom:`1px solid ${(t.vars||t).palette.divider}`,backgroundClip:"padding-box"}},{props:({ownerState:e})=>e.button,style:{transition:t.transitions.create("background-color",{duration:t.transitions.duration.shortest}),"&:hover":{textDecoration:"none",backgroundColor:(t.vars||t).palette.action.hover,"@media (hover: none)":{backgroundColor:"transparent"}}}},{props:({ownerState:e})=>e.hasSecondaryAction,style:{paddingRight:48}}]}))),Klt=be("li",{name:"MuiListItem",slot:"Container",overridesResolver:(t,e)=>e.container})({position:"relative"}),P_=D.forwardRef(function(e,n){const r=wt({props:e,name:"MuiListItem"}),{alignItems:i="center",children:o,className:s,component:a,components:l={},componentsProps:c={},ContainerComponent:u="li",ContainerProps:{className:f,...d}={},dense:h=!1,disableGutters:p=!1,disablePadding:g=!1,divider:m=!1,secondaryAction:v,slotProps:y={},slots:x={},...b}=r,w=D.useContext(If),_=D.useMemo(()=>({dense:h||w.dense||!1,alignItems:i,disableGutters:p}),[i,w.dense,h,p]),S=D.useRef(null),O=D.Children.toArray(o),k=O.length&&n3(O[O.length-1],["ListItemSecondaryAction"]),E={...r,alignItems:i,dense:_.dense,disableGutters:p,disablePadding:g,divider:m,hasSecondaryAction:k},P=Ylt(E),A=dn(S,n),R=x.root||l.Root||Qlt,T=y.root||c.root||{},M={className:Oe(P.root,T.className,s),...b};let I=a||"li";return k?(I=!M.component&&!a?"div":I,u==="li"&&(I==="li"?I="div":M.component==="li"&&(M.component="div")),C.jsx(If.Provider,{value:_,children:C.jsxs(Klt,{as:u,className:Oe(P.container,f),ref:A,ownerState:E,...d,children:[C.jsx(R,{...T,...!eg(R)&&{as:I,ownerState:{...E,...T.ownerState}},...M,children:O}),O.pop()]})})):C.jsx(If.Provider,{value:_,children:C.jsxs(R,{...T,as:I,ref:A,...!eg(R)&&{ownerState:{...E,...T.ownerState}},...M,children:[O,v&&C.jsx(aA,{children:v})]})})});function Zlt(t){return Ye("MuiListItemIcon",t)}const Lde=He("MuiListItemIcon",["root","alignItemsFlexStart"]),Jlt=t=>{const{alignItems:e,classes:n}=t;return qe({root:["root",e==="flex-start"&&"alignItemsFlexStart"]},Zlt,n)},ect=be("div",{name:"MuiListItemIcon",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,n.alignItems==="flex-start"&&e.alignItemsFlexStart]}})(Tt(({theme:t})=>({minWidth:56,color:(t.vars||t).palette.action.active,flexShrink:0,display:"inline-flex",variants:[{props:{alignItems:"flex-start"},style:{marginTop:8}}]}))),yPe=D.forwardRef(function(e,n){const r=wt({props:e,name:"MuiListItemIcon"}),{className:i,...o}=r,s=D.useContext(If),a={...r,alignItems:s.alignItems},l=Jlt(a);return C.jsx(ect,{className:Oe(l.root,i),ownerState:a,ref:n,...o})});function tct(t){return Ye("MuiListItemText",t)}const t_=He("MuiListItemText",["root","multiline","dense","inset","primary","secondary"]),nct=t=>{const{classes:e,inset:n,primary:r,secondary:i,dense:o}=t;return qe({root:["root",n&&"inset",o&&"dense",r&&i&&"multiline"],primary:["primary"],secondary:["secondary"]},tct,e)},rct=be("div",{name:"MuiListItemText",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[{[`& .${t_.primary}`]:e.primary},{[`& .${t_.secondary}`]:e.secondary},e.root,n.inset&&e.inset,n.primary&&n.secondary&&e.multiline,n.dense&&e.dense]}})({flex:"1 1 auto",minWidth:0,marginTop:4,marginBottom:4,[`.${MF.root}:where(& .${t_.primary})`]:{display:"block"},[`.${MF.root}:where(& .${t_.secondary})`]:{display:"block"},variants:[{props:({ownerState:t})=>t.primary&&t.secondary,style:{marginTop:6,marginBottom:6}},{props:({ownerState:t})=>t.inset,style:{paddingLeft:56}}]}),du=D.forwardRef(function(e,n){const r=wt({props:e,name:"MuiListItemText"}),{children:i,className:o,disableTypography:s=!1,inset:a=!1,primary:l,primaryTypographyProps:c,secondary:u,secondaryTypographyProps:f,...d}=r,{dense:h}=D.useContext(If);let p=l??i,g=u;const m={...r,disableTypography:s,inset:a,primary:!!p,secondary:!!g,dense:h},v=nct(m);return p!=null&&p.type!==Jt&&!s&&(p=C.jsx(Jt,{variant:h?"body2":"body1",className:v.primary,component:c!=null&&c.variant?void 0:"span",...c,children:p})),g!=null&&g.type!==Jt&&!s&&(g=C.jsx(Jt,{variant:"body2",className:v.secondary,color:"textSecondary",...f,children:g})),C.jsxs(rct,{className:Oe(v.root,o),ownerState:m,ref:n,...d,children:[p,g]})});function oW(t,e,n){return t===e?t.firstChild:e&&e.nextElementSibling?e.nextElementSibling:n?null:t.firstChild}function $de(t,e,n){return t===e?n?t.firstChild:t.lastChild:e&&e.previousElementSibling?e.previousElementSibling:n?null:t.lastChild}function xPe(t,e){if(e===void 0)return!0;let n=t.innerText;return n===void 0&&(n=t.textContent),n=n.trim().toLowerCase(),n.length===0?!1:e.repeating?n[0]===e.keys[0]:n.startsWith(e.keys.join(""))}function PE(t,e,n,r,i,o){let s=!1,a=i(t,e,e?n:!1);for(;a;){if(a===t.firstChild){if(s)return!1;s=!0}const l=r?!1:a.disabled||a.getAttribute("aria-disabled")==="true";if(!a.hasAttribute("tabindex")||!xPe(a,o)||l)a=i(t,a,n);else return a.focus(),!0}return!1}const y4=D.forwardRef(function(e,n){const{actions:r,autoFocus:i=!1,autoFocusItem:o=!1,children:s,className:a,disabledItemsFocusable:l=!1,disableListWrap:c=!1,onKeyDown:u,variant:f="selectedMenu",...d}=e,h=D.useRef(null),p=D.useRef({keys:[],repeating:!0,previousKeyMatched:!0,lastTime:null});Ti(()=>{i&&h.current.focus()},[i]),D.useImperativeHandle(r,()=>({adjustStyleForScrollbar:(x,{direction:b})=>{const w=!h.current.style.width;if(x.clientHeight{const b=h.current,w=x.key;if(x.ctrlKey||x.metaKey||x.altKey){u&&u(x);return}const S=vi(b).activeElement;if(w==="ArrowDown")x.preventDefault(),PE(b,S,c,l,oW);else if(w==="ArrowUp")x.preventDefault(),PE(b,S,c,l,$de);else if(w==="Home")x.preventDefault(),PE(b,null,c,l,oW);else if(w==="End")x.preventDefault(),PE(b,null,c,l,$de);else if(w.length===1){const O=p.current,k=w.toLowerCase(),E=performance.now();O.keys.length>0&&(E-O.lastTime>500?(O.keys=[],O.repeating=!0,O.previousKeyMatched=!0):O.repeating&&k!==O.keys[0]&&(O.repeating=!1)),O.lastTime=E,O.keys.push(k);const P=S&&!O.repeating&&xPe(S,O);O.previousKeyMatched&&(P||PE(b,S,!1,l,oW,O))?x.preventDefault():O.previousKeyMatched=!1}u&&u(x)},m=dn(h,n);let v=-1;D.Children.forEach(s,(x,b)=>{if(!D.isValidElement(x)){v===b&&(v+=1,v>=s.length&&(v=-1));return}x.props.disabled||(f==="selectedMenu"&&x.props.selected||v===-1)&&(v=b),v===b&&(x.props.disabled||x.props.muiSkipListHighlight||x.type.muiSkipListHighlight)&&(v+=1,v>=s.length&&(v=-1))});const y=D.Children.map(s,(x,b)=>{if(b===v){const w={};return o&&(w.autoFocus=!0),x.props.tabIndex===void 0&&f==="selectedMenu"&&(w.tabIndex=0),D.cloneElement(x,w)}return x});return C.jsx(DM,{role:"menu",ref:m,className:a,onKeyDown:g,tabIndex:i?0:-1,...d,children:y})});function ict(t){return Ye("MuiPopover",t)}He("MuiPopover",["root","paper"]);function Fde(t,e){let n=0;return typeof e=="number"?n=e:e==="center"?n=t.height/2:e==="bottom"&&(n=t.height),n}function Nde(t,e){let n=0;return typeof e=="number"?n=e:e==="center"?n=t.width/2:e==="right"&&(n=t.width),n}function zde(t){return[t.horizontal,t.vertical].map(e=>typeof e=="number"?`${e}px`:e).join(" ")}function sW(t){return typeof t=="function"?t():t}const oct=t=>{const{classes:e}=t;return qe({root:["root"],paper:["paper"]},ict,e)},sct=be(hPe,{name:"MuiPopover",slot:"Root",overridesResolver:(t,e)=>e.root})({}),bPe=be(Tl,{name:"MuiPopover",slot:"Paper",overridesResolver:(t,e)=>e.paper})({position:"absolute",overflowY:"auto",overflowX:"hidden",minWidth:16,minHeight:16,maxWidth:"calc(100% - 32px)",maxHeight:"calc(100% - 32px)",outline:0}),Qb=D.forwardRef(function(e,n){const r=wt({props:e,name:"MuiPopover"}),{action:i,anchorEl:o,anchorOrigin:s={vertical:"top",horizontal:"left"},anchorPosition:a,anchorReference:l="anchorEl",children:c,className:u,container:f,elevation:d=8,marginThreshold:h=16,open:p,PaperProps:g={},slots:m={},slotProps:v={},transformOrigin:y={vertical:"top",horizontal:"left"},TransitionComponent:x=nb,transitionDuration:b="auto",TransitionProps:{onEntering:w,..._}={},disableScrollLock:S=!1,...O}=r,k=(v==null?void 0:v.paper)??g,E=D.useRef(),P={...r,anchorOrigin:s,anchorReference:l,elevation:d,marginThreshold:h,externalPaperSlotProps:k,transformOrigin:y,TransitionComponent:x,transitionDuration:b,TransitionProps:_},A=oct(P),R=D.useCallback(()=>{if(l==="anchorPosition")return a;const re=sW(o),te=(re&&re.nodeType===1?re:vi(E.current).body).getBoundingClientRect();return{top:te.top+Fde(te,s.vertical),left:te.left+Nde(te,s.horizontal)}},[o,s.horizontal,s.vertical,a,l]),T=D.useCallback(re=>({vertical:Fde(re,y.vertical),horizontal:Nde(re,y.horizontal)}),[y.horizontal,y.vertical]),M=D.useCallback(re=>{const ge={width:re.offsetWidth,height:re.offsetHeight},te=T(ge);if(l==="none")return{top:null,left:null,transformOrigin:zde(te)};const ae=R();let U=ae.top-te.vertical,oe=ae.left-te.horizontal;const ne=U+ge.height,V=oe+ge.width,X=xc(sW(o)),Z=X.innerHeight-h,he=X.innerWidth-h;if(h!==null&&UZ){const xe=ne-Z;U-=xe,te.vertical+=xe}if(h!==null&&oehe){const xe=V-he;oe-=xe,te.horizontal+=xe}return{top:`${Math.round(U)}px`,left:`${Math.round(oe)}px`,transformOrigin:zde(te)}},[o,l,R,T,h]),[I,j]=D.useState(p),N=D.useCallback(()=>{const re=E.current;if(!re)return;const ge=M(re);ge.top!==null&&re.style.setProperty("top",ge.top),ge.left!==null&&(re.style.left=ge.left),re.style.transformOrigin=ge.transformOrigin,j(!0)},[M]);D.useEffect(()=>(S&&window.addEventListener("scroll",N),()=>window.removeEventListener("scroll",N)),[o,S,N]);const z=(re,ge)=>{w&&w(re,ge),N()},L=()=>{j(!1)};D.useEffect(()=>{p&&N()}),D.useImperativeHandle(i,()=>p?{updatePosition:()=>{N()}}:null,[p,N]),D.useEffect(()=>{if(!p)return;const re=kM(()=>{N()}),ge=xc(o);return ge.addEventListener("resize",re),()=>{re.clear(),ge.removeEventListener("resize",re)}},[o,p,N]);let B=b;b==="auto"&&!x.muiSupportAuto&&(B=void 0);const F=f||(o?vi(sW(o)).body:void 0),$={slots:m,slotProps:{...v,paper:k}},[q,G]=Zl("paper",{elementType:bPe,externalForwardedProps:$,additionalProps:{elevation:d,className:Oe(A.paper,k==null?void 0:k.className),style:I?k.style:{...k.style,opacity:0}},ownerState:P}),[Y,{slotProps:le,...K}]=Zl("root",{elementType:sct,externalForwardedProps:$,additionalProps:{slotProps:{backdrop:{invisible:!0}},container:F,open:p},ownerState:P,className:Oe(A.root,u)}),ee=dn(E,G.ref);return C.jsx(Y,{...K,...!eg(Y)&&{slotProps:le,disableScrollLock:S},...O,ref:n,children:C.jsx(x,{appear:!0,in:p,onEntering:z,onExited:L,timeout:B,..._,children:C.jsx(q,{...G,ref:ee,children:c})})})});function act(t){return Ye("MuiMenu",t)}He("MuiMenu",["root","paper","list"]);const lct={vertical:"top",horizontal:"right"},cct={vertical:"top",horizontal:"left"},uct=t=>{const{classes:e}=t;return qe({root:["root"],paper:["paper"],list:["list"]},act,e)},fct=be(Qb,{shouldForwardProp:t=>qo(t)||t==="classes",name:"MuiMenu",slot:"Root",overridesResolver:(t,e)=>e.root})({}),dct=be(bPe,{name:"MuiMenu",slot:"Paper",overridesResolver:(t,e)=>e.paper})({maxHeight:"calc(100% - 96px)",WebkitOverflowScrolling:"touch"}),hct=be(y4,{name:"MuiMenu",slot:"List",overridesResolver:(t,e)=>e.list})({outline:0}),$y=D.forwardRef(function(e,n){const r=wt({props:e,name:"MuiMenu"}),{autoFocus:i=!0,children:o,className:s,disableAutoFocusItem:a=!1,MenuListProps:l={},onClose:c,open:u,PaperProps:f={},PopoverClasses:d,transitionDuration:h="auto",TransitionProps:{onEntering:p,...g}={},variant:m="selectedMenu",slots:v={},slotProps:y={},...x}=r,b=Ho(),w={...r,autoFocus:i,disableAutoFocusItem:a,MenuListProps:l,onEntering:p,PaperProps:f,transitionDuration:h,TransitionProps:g,variant:m},_=uct(w),S=i&&!a&&u,O=D.useRef(null),k=(I,j)=>{O.current&&O.current.adjustStyleForScrollbar(I,{direction:b?"rtl":"ltr"}),p&&p(I,j)},E=I=>{I.key==="Tab"&&(I.preventDefault(),c&&c(I,"tabKeyDown"))};let P=-1;D.Children.map(o,(I,j)=>{D.isValidElement(I)&&(I.props.disabled||(m==="selectedMenu"&&I.props.selected||P===-1)&&(P=j))});const A=v.paper??dct,R=y.paper??f,T=Zt({elementType:v.root,externalSlotProps:y.root,ownerState:w,className:[_.root,s]}),M=Zt({elementType:A,externalSlotProps:R,ownerState:w,className:_.paper});return C.jsx(fct,{onClose:c,anchorOrigin:{vertical:"bottom",horizontal:b?"right":"left"},transformOrigin:b?lct:cct,slots:{paper:A,root:v.root},slotProps:{root:T,paper:M},open:u,ref:n,transitionDuration:h,TransitionProps:{onEntering:k,...g},ownerState:w,...x,classes:d,children:C.jsx(hct,{onKeyDown:E,actions:O,autoFocus:i&&(P===-1||a),autoFocusItem:S,variant:m,...l,className:Oe(_.list,l.className),children:o})})});function pct(t){return Ye("MuiMenuItem",t)}const ME=He("MuiMenuItem",["root","focusVisible","dense","disabled","divider","gutters","selected"]),gct=(t,e)=>{const{ownerState:n}=t;return[e.root,n.dense&&e.dense,n.divider&&e.divider,!n.disableGutters&&e.gutters]},mct=t=>{const{disabled:e,dense:n,divider:r,disableGutters:i,selected:o,classes:s}=t,l=qe({root:["root",n&&"dense",e&&"disabled",!i&&"gutters",r&&"divider",o&&"selected"]},pct,s);return{...s,...l}},vct=be(Nf,{shouldForwardProp:t=>qo(t)||t==="classes",name:"MuiMenuItem",slot:"Root",overridesResolver:gct})(Tt(({theme:t})=>({...t.typography.body1,display:"flex",justifyContent:"flex-start",alignItems:"center",position:"relative",textDecoration:"none",minHeight:48,paddingTop:6,paddingBottom:6,boxSizing:"border-box",whiteSpace:"nowrap","&:hover":{textDecoration:"none",backgroundColor:(t.vars||t).palette.action.hover,"@media (hover: none)":{backgroundColor:"transparent"}},[`&.${ME.selected}`]:{backgroundColor:t.vars?`rgba(${t.vars.palette.primary.mainChannel} / ${t.vars.palette.action.selectedOpacity})`:kt(t.palette.primary.main,t.palette.action.selectedOpacity),[`&.${ME.focusVisible}`]:{backgroundColor:t.vars?`rgba(${t.vars.palette.primary.mainChannel} / calc(${t.vars.palette.action.selectedOpacity} + ${t.vars.palette.action.focusOpacity}))`:kt(t.palette.primary.main,t.palette.action.selectedOpacity+t.palette.action.focusOpacity)}},[`&.${ME.selected}:hover`]:{backgroundColor:t.vars?`rgba(${t.vars.palette.primary.mainChannel} / calc(${t.vars.palette.action.selectedOpacity} + ${t.vars.palette.action.hoverOpacity}))`:kt(t.palette.primary.main,t.palette.action.selectedOpacity+t.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:t.vars?`rgba(${t.vars.palette.primary.mainChannel} / ${t.vars.palette.action.selectedOpacity})`:kt(t.palette.primary.main,t.palette.action.selectedOpacity)}},[`&.${ME.focusVisible}`]:{backgroundColor:(t.vars||t).palette.action.focus},[`&.${ME.disabled}`]:{opacity:(t.vars||t).palette.action.disabledOpacity},[`& + .${kde.root}`]:{marginTop:t.spacing(1),marginBottom:t.spacing(1)},[`& + .${kde.inset}`]:{marginLeft:52},[`& .${t_.root}`]:{marginTop:0,marginBottom:0},[`& .${t_.inset}`]:{paddingLeft:36},[`& .${Lde.root}`]:{minWidth:36},variants:[{props:({ownerState:e})=>!e.disableGutters,style:{paddingLeft:16,paddingRight:16}},{props:({ownerState:e})=>e.divider,style:{borderBottom:`1px solid ${(t.vars||t).palette.divider}`,backgroundClip:"padding-box"}},{props:({ownerState:e})=>!e.dense,style:{[t.breakpoints.up("sm")]:{minHeight:"auto"}}},{props:({ownerState:e})=>e.dense,style:{minHeight:32,paddingTop:4,paddingBottom:4,...t.typography.body2,[`& .${Lde.root} svg`]:{fontSize:"1.25rem"}}}]}))),ti=D.forwardRef(function(e,n){const r=wt({props:e,name:"MuiMenuItem"}),{autoFocus:i=!1,component:o="li",dense:s=!1,divider:a=!1,disableGutters:l=!1,focusVisibleClassName:c,role:u="menuitem",tabIndex:f,className:d,...h}=r,p=D.useContext(If),g=D.useMemo(()=>({dense:s||p.dense||!1,disableGutters:l}),[p.dense,s,l]),m=D.useRef(null);Ti(()=>{i&&m.current&&m.current.focus()},[i]);const v={...r,dense:g.dense,divider:a,disableGutters:l},y=mct(r),x=dn(m,n);let b;return r.disabled||(b=f!==void 0?f:-1),C.jsx(If.Provider,{value:g,children:C.jsx(vct,{ref:x,role:u,tabIndex:b,component:o,focusVisibleClassName:Oe(y.focusVisible,c),className:Oe(y.root,d),...h,ownerState:v,classes:y})})});function yct(t){return Ye("MuiNativeSelect",t)}const Wee=He("MuiNativeSelect",["root","select","multiple","filled","outlined","standard","disabled","icon","iconOpen","iconFilled","iconOutlined","iconStandard","nativeInput","error"]),xct=t=>{const{classes:e,variant:n,disabled:r,multiple:i,open:o,error:s}=t,a={select:["select",n,r&&"disabled",i&&"multiple",s&&"error"],icon:["icon",`icon${Re(n)}`,o&&"iconOpen",r&&"disabled"]};return qe(a,yct,e)},wPe=be("select")(({theme:t})=>({MozAppearance:"none",WebkitAppearance:"none",userSelect:"none",borderRadius:0,cursor:"pointer","&:focus":{borderRadius:0},[`&.${Wee.disabled}`]:{cursor:"default"},"&[multiple]":{height:"auto"},"&:not([multiple]) option, &:not([multiple]) optgroup":{backgroundColor:(t.vars||t).palette.background.paper},variants:[{props:({ownerState:e})=>e.variant!=="filled"&&e.variant!=="outlined",style:{"&&&":{paddingRight:24,minWidth:16}}},{props:{variant:"filled"},style:{"&&&":{paddingRight:32}}},{props:{variant:"outlined"},style:{borderRadius:(t.vars||t).shape.borderRadius,"&:focus":{borderRadius:(t.vars||t).shape.borderRadius},"&&&":{paddingRight:32}}}]})),bct=be(wPe,{name:"MuiNativeSelect",slot:"Select",shouldForwardProp:qo,overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.select,e[n.variant],n.error&&e.error,{[`&.${Wee.multiple}`]:e.multiple}]}})({}),_Pe=be("svg")(({theme:t})=>({position:"absolute",right:0,top:"calc(50% - .5em)",pointerEvents:"none",color:(t.vars||t).palette.action.active,[`&.${Wee.disabled}`]:{color:(t.vars||t).palette.action.disabled},variants:[{props:({ownerState:e})=>e.open,style:{transform:"rotate(180deg)"}},{props:{variant:"filled"},style:{right:7}},{props:{variant:"outlined"},style:{right:7}}]})),wct=be(_Pe,{name:"MuiNativeSelect",slot:"Icon",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.icon,n.variant&&e[`icon${Re(n.variant)}`],n.open&&e.iconOpen]}})({}),_ct=D.forwardRef(function(e,n){const{className:r,disabled:i,error:o,IconComponent:s,inputRef:a,variant:l="standard",...c}=e,u={...e,disabled:i,variant:l,error:o},f=xct(u);return C.jsxs(D.Fragment,{children:[C.jsx(bct,{ownerState:u,className:Oe(f.select,r),disabled:i,ref:a||n,...c}),e.multiple?null:C.jsx(wct,{as:s,ownerState:u,className:f.icon})]})});var jde;const Sct=be("fieldset",{shouldForwardProp:qo})({textAlign:"left",position:"absolute",bottom:0,right:0,top:-5,left:0,margin:0,padding:"0 8px",pointerEvents:"none",borderRadius:"inherit",borderStyle:"solid",borderWidth:1,overflow:"hidden",minWidth:"0%"}),Cct=be("legend",{shouldForwardProp:qo})(Tt(({theme:t})=>({float:"unset",width:"auto",overflow:"hidden",variants:[{props:({ownerState:e})=>!e.withLabel,style:{padding:0,lineHeight:"11px",transition:t.transitions.create("width",{duration:150,easing:t.transitions.easing.easeOut})}},{props:({ownerState:e})=>e.withLabel,style:{display:"block",padding:0,height:11,fontSize:"0.75em",visibility:"hidden",maxWidth:.01,transition:t.transitions.create("max-width",{duration:50,easing:t.transitions.easing.easeOut}),whiteSpace:"nowrap","& > span":{paddingLeft:5,paddingRight:5,display:"inline-block",opacity:0,visibility:"visible"}}},{props:({ownerState:e})=>e.withLabel&&e.notched,style:{maxWidth:"100%",transition:t.transitions.create("max-width",{duration:100,easing:t.transitions.easing.easeOut,delay:50})}}]})));function Oct(t){const{children:e,classes:n,className:r,label:i,notched:o,...s}=t,a=i!=null&&i!=="",l={...t,notched:o,withLabel:a};return C.jsx(Sct,{"aria-hidden":!0,className:r,ownerState:l,...s,children:C.jsx(Cct,{ownerState:l,children:a?C.jsx("span",{children:i}):jde||(jde=C.jsx("span",{className:"notranslate",children:"​"}))})})}const Ect=t=>{const{classes:e}=t,r=qe({root:["root"],notchedOutline:["notchedOutline"],input:["input"]},Tot,e);return{...e,...r}},Tct=be(m4,{shouldForwardProp:t=>qo(t)||t==="classes",name:"MuiOutlinedInput",slot:"Root",overridesResolver:p4})(Tt(({theme:t})=>{const e=t.palette.mode==="light"?"rgba(0, 0, 0, 0.23)":"rgba(255, 255, 255, 0.23)";return{position:"relative",borderRadius:(t.vars||t).shape.borderRadius,[`&:hover .${pd.notchedOutline}`]:{borderColor:(t.vars||t).palette.text.primary},"@media (hover: none)":{[`&:hover .${pd.notchedOutline}`]:{borderColor:t.vars?`rgba(${t.vars.palette.common.onBackgroundChannel} / 0.23)`:e}},[`&.${pd.focused} .${pd.notchedOutline}`]:{borderWidth:2},variants:[...Object.entries(t.palette).filter(ii()).map(([n])=>({props:{color:n},style:{[`&.${pd.focused} .${pd.notchedOutline}`]:{borderColor:(t.vars||t).palette[n].main}}})),{props:{},style:{[`&.${pd.error} .${pd.notchedOutline}`]:{borderColor:(t.vars||t).palette.error.main},[`&.${pd.disabled} .${pd.notchedOutline}`]:{borderColor:(t.vars||t).palette.action.disabled}}},{props:({ownerState:n})=>n.startAdornment,style:{paddingLeft:14}},{props:({ownerState:n})=>n.endAdornment,style:{paddingRight:14}},{props:({ownerState:n})=>n.multiline,style:{padding:"16.5px 14px"}},{props:({ownerState:n,size:r})=>n.multiline&&r==="small",style:{padding:"8.5px 14px"}}]}})),kct=be(Oct,{name:"MuiOutlinedInput",slot:"NotchedOutline",overridesResolver:(t,e)=>e.notchedOutline})(Tt(({theme:t})=>{const e=t.palette.mode==="light"?"rgba(0, 0, 0, 0.23)":"rgba(255, 255, 255, 0.23)";return{borderColor:t.vars?`rgba(${t.vars.palette.common.onBackgroundChannel} / 0.23)`:e}})),Act=be(v4,{name:"MuiOutlinedInput",slot:"Input",overridesResolver:g4})(Tt(({theme:t})=>({padding:"16.5px 14px",...!t.vars&&{"&:-webkit-autofill":{WebkitBoxShadow:t.palette.mode==="light"?null:"0 0 0 100px #266798 inset",WebkitTextFillColor:t.palette.mode==="light"?null:"#fff",caretColor:t.palette.mode==="light"?null:"#fff",borderRadius:"inherit"}},...t.vars&&{"&:-webkit-autofill":{borderRadius:"inherit"},[t.getColorSchemeSelector("dark")]:{"&:-webkit-autofill":{WebkitBoxShadow:"0 0 0 100px #266798 inset",WebkitTextFillColor:"#fff",caretColor:"#fff"}}},variants:[{props:{size:"small"},style:{padding:"8.5px 14px"}},{props:({ownerState:e})=>e.multiline,style:{padding:0}},{props:({ownerState:e})=>e.startAdornment,style:{paddingLeft:0}},{props:({ownerState:e})=>e.endAdornment,style:{paddingRight:0}}]}))),FF=D.forwardRef(function(e,n){var r;const i=wt({props:e,name:"MuiOutlinedInput"}),{components:o={},fullWidth:s=!1,inputComponent:a="input",label:l,multiline:c=!1,notched:u,slots:f={},type:d="text",...h}=i,p=Ect(i),g=Fa(),m=Ry({props:i,muiFormControl:g,states:["color","disabled","error","focused","hiddenLabel","size","required"]}),v={...i,color:m.color||"primary",disabled:m.disabled,error:m.error,focused:m.focused,formControl:g,fullWidth:s,hiddenLabel:m.hiddenLabel,multiline:c,size:m.size,type:d},y=f.root??o.Root??Tct,x=f.input??o.Input??Act;return C.jsx(jee,{slots:{root:y,input:x},renderSuffix:b=>C.jsx(kct,{ownerState:v,className:p.notchedOutline,label:l!=null&&l!==""&&m.required?r||(r=C.jsxs(D.Fragment,{children:[l," ","*"]})):l,notched:typeof u<"u"?u:!!(b.startAdornment||b.filled||b.focused)}),fullWidth:s,inputComponent:a,multiline:c,ref:n,type:d,...h,classes:{...p,notchedOutline:null}})});FF&&(FF.muiName="Input");const Pct=ct(C.jsx("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z"}),"RadioButtonUnchecked"),Mct=ct(C.jsx("path",{d:"M8.465 8.465C9.37 7.56 10.62 7 12 7C14.76 7 17 9.24 17 12C17 13.38 16.44 14.63 15.535 15.535C14.63 16.44 13.38 17 12 17C9.24 17 7 14.76 7 12C7 10.62 7.56 9.37 8.465 8.465Z"}),"RadioButtonChecked"),Rct=be("span",{shouldForwardProp:qo})({position:"relative",display:"flex"}),Dct=be(Pct)({transform:"scale(1)"}),Ict=be(Mct)(Tt(({theme:t})=>({left:0,position:"absolute",transform:"scale(0)",transition:t.transitions.create("transform",{easing:t.transitions.easing.easeIn,duration:t.transitions.duration.shortest}),variants:[{props:{checked:!0},style:{transform:"scale(1)",transition:t.transitions.create("transform",{easing:t.transitions.easing.easeOut,duration:t.transitions.duration.shortest})}}]})));function SPe(t){const{checked:e=!1,classes:n={},fontSize:r}=t,i={...t,checked:e};return C.jsxs(Rct,{className:n.root,ownerState:i,children:[C.jsx(Dct,{fontSize:r,className:n.background,ownerState:i}),C.jsx(Ict,{fontSize:r,className:n.dot,ownerState:i})]})}const CPe=D.createContext(void 0);function Lct(){return D.useContext(CPe)}function $ct(t){return Ye("MuiRadio",t)}const Bde=He("MuiRadio",["root","checked","disabled","colorPrimary","colorSecondary","sizeSmall"]),Fct=t=>{const{classes:e,color:n,size:r}=t,i={root:["root",`color${Re(n)}`,r!=="medium"&&`size${Re(r)}`]};return{...e,...qe(i,$ct,e)}},Nct=be(Bee,{shouldForwardProp:t=>qo(t)||t==="classes",name:"MuiRadio",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,n.size!=="medium"&&e[`size${Re(n.size)}`],e[`color${Re(n.color)}`]]}})(Tt(({theme:t})=>({color:(t.vars||t).palette.text.secondary,[`&.${Bde.disabled}`]:{color:(t.vars||t).palette.action.disabled},variants:[{props:{color:"default",disabled:!1,disableRipple:!1},style:{"&:hover":{backgroundColor:t.vars?`rgba(${t.vars.palette.action.activeChannel} / ${t.vars.palette.action.hoverOpacity})`:kt(t.palette.action.active,t.palette.action.hoverOpacity)}}},...Object.entries(t.palette).filter(ii()).map(([e])=>({props:{color:e,disabled:!1,disableRipple:!1},style:{"&:hover":{backgroundColor:t.vars?`rgba(${t.vars.palette[e].mainChannel} / ${t.vars.palette.action.hoverOpacity})`:kt(t.palette[e].main,t.palette.action.hoverOpacity)}}})),...Object.entries(t.palette).filter(ii()).map(([e])=>({props:{color:e,disabled:!1},style:{[`&.${Bde.checked}`]:{color:(t.vars||t).palette[e].main}}})),{props:{disableRipple:!1},style:{"&:hover":{"@media (hover: none)":{backgroundColor:"transparent"}}}}]})));function zct(t,e){return typeof e=="object"&&e!==null?t===e:String(t)===String(e)}const Ude=C.jsx(SPe,{checked:!0}),Wde=C.jsx(SPe,{}),JT=D.forwardRef(function(e,n){const r=wt({props:e,name:"MuiRadio"}),{checked:i,checkedIcon:o=Ude,color:s="primary",icon:a=Wde,name:l,onChange:c,size:u="medium",className:f,disabled:d,disableRipple:h=!1,...p}=r,g=Fa();let m=d;g&&typeof m>"u"&&(m=g.disabled),m??(m=!1);const v={...r,disabled:m,disableRipple:h,color:s,size:u},y=Fct(v),x=Lct();let b=i;const w=KH(c,x&&x.onChange);let _=l;return x&&(typeof b>"u"&&(b=zct(x.value,r.value)),typeof _>"u"&&(_=x.name)),C.jsx(Nct,{type:"radio",icon:D.cloneElement(a,{fontSize:Wde.props.fontSize??u}),checkedIcon:D.cloneElement(o,{fontSize:Ude.props.fontSize??u}),disabled:m,ownerState:v,classes:y,name:_,checked:b,onChange:w,ref:n,className:Oe(y.root,f),...p})});function jct(t){return Ye("MuiRadioGroup",t)}He("MuiRadioGroup",["root","row","error"]);const Bct=t=>{const{classes:e,row:n,error:r}=t;return qe({root:["root",n&&"row",r&&"error"]},jct,e)},Vee=D.forwardRef(function(e,n){const{actions:r,children:i,className:o,defaultValue:s,name:a,onChange:l,value:c,...u}=e,f=D.useRef(null),d=Bct(e),[h,p]=bc({controlled:c,default:s,name:"RadioGroup"});D.useImperativeHandle(r,()=>({focus:()=>{let y=f.current.querySelector("input:not(:disabled):checked");y||(y=f.current.querySelector("input:not(:disabled)")),y&&y.focus()}}),[]);const g=dn(n,f),m=Jf(a),v=D.useMemo(()=>({name:m,onChange(y){p(y.target.value),l&&l(y,y.target.value)},value:h}),[m,l,p,h]);return C.jsx(CPe.Provider,{value:v,children:C.jsx(Qat,{role:"radiogroup",ref:g,className:Oe(d.root,o),...u,children:i})})});function Uct(t){return Ye("MuiSelect",t)}const RE=He("MuiSelect",["root","select","multiple","filled","outlined","standard","disabled","focused","icon","iconOpen","iconFilled","iconOutlined","iconStandard","nativeInput","error"]);var Vde;const Wct=be(wPe,{name:"MuiSelect",slot:"Select",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[{[`&.${RE.select}`]:e.select},{[`&.${RE.select}`]:e[n.variant]},{[`&.${RE.error}`]:e.error},{[`&.${RE.multiple}`]:e.multiple}]}})({[`&.${RE.select}`]:{height:"auto",minHeight:"1.4375em",textOverflow:"ellipsis",whiteSpace:"nowrap",overflow:"hidden"}}),Vct=be(_Pe,{name:"MuiSelect",slot:"Icon",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.icon,n.variant&&e[`icon${Re(n.variant)}`],n.open&&e.iconOpen]}})({}),Gct=be("input",{shouldForwardProp:t=>t4(t)&&t!=="classes",name:"MuiSelect",slot:"NativeInput",overridesResolver:(t,e)=>e.nativeInput})({bottom:0,left:0,position:"absolute",opacity:0,pointerEvents:"none",width:"100%",boxSizing:"border-box"});function Gde(t,e){return typeof e=="object"&&e!==null?t===e:String(t)===String(e)}function Hct(t){return t==null||typeof t=="string"&&!t.trim()}const qct=t=>{const{classes:e,variant:n,disabled:r,multiple:i,open:o,error:s}=t,a={select:["select",n,r&&"disabled",i&&"multiple",s&&"error"],icon:["icon",`icon${Re(n)}`,o&&"iconOpen",r&&"disabled"],nativeInput:["nativeInput"]};return qe(a,Uct,e)},Xct=D.forwardRef(function(e,n){var Pe;const{"aria-describedby":r,"aria-label":i,autoFocus:o,autoWidth:s,children:a,className:l,defaultOpen:c,defaultValue:u,disabled:f,displayEmpty:d,error:h=!1,IconComponent:p,inputRef:g,labelId:m,MenuProps:v={},multiple:y,name:x,onBlur:b,onChange:w,onClose:_,onFocus:S,onOpen:O,open:k,readOnly:E,renderValue:P,SelectDisplayProps:A={},tabIndex:R,type:T,value:M,variant:I="standard",...j}=e,[N,z]=bc({controlled:M,default:u,name:"Select"}),[L,B]=bc({controlled:k,default:c,name:"Select"}),F=D.useRef(null),$=D.useRef(null),[q,G]=D.useState(null),{current:Y}=D.useRef(k!=null),[le,K]=D.useState(),ee=dn(n,g),re=D.useCallback(Me=>{$.current=Me,Me&&G(Me)},[]),ge=q==null?void 0:q.parentNode;D.useImperativeHandle(ee,()=>({focus:()=>{$.current.focus()},node:F.current,value:N}),[N]),D.useEffect(()=>{c&&L&&q&&!Y&&(K(s?null:ge.clientWidth),$.current.focus())},[q,s]),D.useEffect(()=>{o&&$.current.focus()},[o]),D.useEffect(()=>{if(!m)return;const Me=vi($.current).getElementById(m);if(Me){const Te=()=>{getSelection().isCollapsed&&$.current.focus()};return Me.addEventListener("click",Te),()=>{Me.removeEventListener("click",Te)}}},[m]);const te=(Me,Te)=>{Me?O&&O(Te):_&&_(Te),Y||(K(s?null:ge.clientWidth),B(Me))},ae=Me=>{Me.button===0&&(Me.preventDefault(),$.current.focus(),te(!0,Me))},U=Me=>{te(!1,Me)},oe=D.Children.toArray(a),ne=Me=>{const Te=oe.find(Le=>Le.props.value===Me.target.value);Te!==void 0&&(z(Te.props.value),w&&w(Me,Te))},V=Me=>Te=>{let Le;if(Te.currentTarget.hasAttribute("tabindex")){if(y){Le=Array.isArray(N)?N.slice():[];const ue=N.indexOf(Me.props.value);ue===-1?Le.push(Me.props.value):Le.splice(ue,1)}else Le=Me.props.value;if(Me.props.onClick&&Me.props.onClick(Te),N!==Le&&(z(Le),w)){const ue=Te.nativeEvent||Te,$e=new ue.constructor(ue.type,ue);Object.defineProperty($e,"target",{writable:!0,value:{value:Le,name:x}}),w($e,Me)}y||te(!1,Te)}},X=Me=>{E||[" ","ArrowUp","ArrowDown","Enter"].includes(Me.key)&&(Me.preventDefault(),te(!0,Me))},Z=q!==null&&L,he=Me=>{!Z&&b&&(Object.defineProperty(Me,"target",{writable:!0,value:{value:N,name:x}}),b(Me))};delete j["aria-invalid"];let xe,H;const W=[];let J=!1;(DF({value:N})||d)&&(P?xe=P(N):J=!0);const se=oe.map(Me=>{if(!D.isValidElement(Me))return null;let Te;if(y){if(!Array.isArray(N))throw new Error(Og(2));Te=N.some(Le=>Gde(Le,Me.props.value)),Te&&J&&W.push(Me.props.children)}else Te=Gde(N,Me.props.value),Te&&J&&(H=Me.props.children);return D.cloneElement(Me,{"aria-selected":Te?"true":"false",onClick:V(Me),onKeyUp:Le=>{Le.key===" "&&Le.preventDefault(),Me.props.onKeyUp&&Me.props.onKeyUp(Le)},role:"option",selected:Te,value:void 0,"data-value":Me.props.value})});J&&(y?W.length===0?xe=null:xe=W.reduce((Me,Te,Le)=>(Me.push(Te),Le{const{classes:e}=t;return e},Gee={name:"MuiSelect",overridesResolver:(t,e)=>e.root,shouldForwardProp:t=>qo(t)&&t!=="variant",slot:"Root"},Qct=be(Ag,Gee)(""),Kct=be(FF,Gee)(""),Zct=be($F,Gee)(""),Wg=D.forwardRef(function(e,n){const r=kn({name:"MuiSelect",props:e}),{autoWidth:i=!1,children:o,classes:s={},className:a,defaultOpen:l=!1,displayEmpty:c=!1,IconComponent:u=Aot,id:f,input:d,inputProps:h,label:p,labelId:g,MenuProps:m,multiple:v=!1,native:y=!1,onClose:x,onOpen:b,open:w,renderValue:_,SelectDisplayProps:S,variant:O="outlined",...k}=r,E=y?_ct:Xct,P=Fa(),A=Ry({props:r,muiFormControl:P,states:["variant","error"]}),R=A.variant||O,T={...r,variant:R,classes:s},M=Yct(T),{root:I,...j}=M,N=d||{standard:C.jsx(Qct,{ownerState:T}),outlined:C.jsx(Kct,{label:p,ownerState:T}),filled:C.jsx(Zct,{ownerState:T})}[R],z=dn(n,Py(N));return C.jsx(D.Fragment,{children:D.cloneElement(N,{inputComponent:E,inputProps:{children:o,error:A.error,IconComponent:u,variant:R,type:void 0,multiple:v,...y?{id:f}:{autoWidth:i,defaultOpen:l,displayEmpty:c,labelId:g,MenuProps:m,onClose:x,onOpen:b,open:w,renderValue:_,SelectDisplayProps:{id:f,...S}},...h,classes:h?Bo(j,h.classes):j,...d?d.props.inputProps:{}},...(v&&y||c)&&R==="outlined"?{notched:!0}:{},ref:z,className:Oe(N.props.className,a,M.root),...!d&&{variant:R},...k})})});Wg.muiName="Select";function Jct(t,e,n=(r,i)=>r===i){return t.length===e.length&&t.every((r,i)=>n(r,e[i]))}const eut=2;function OPe(t,e){return t-e}function Hde(t,e){const{index:n}=t.reduce((r,i,o)=>{const s=Math.abs(e-i);return r===null||s({left:`${t}%`}),leap:t=>({width:`${t}%`})},"horizontal-reverse":{offset:t=>({right:`${t}%`}),leap:t=>({width:`${t}%`})},vertical:{offset:t=>({bottom:`${t}%`}),leap:t=>({height:`${t}%`})}},out=t=>t;let nI;function Xde(){return nI===void 0&&(typeof CSS<"u"&&typeof CSS.supports=="function"?nI=CSS.supports("touch-action","none"):nI=!0),nI}function sut(t){const{"aria-labelledby":e,defaultValue:n,disabled:r=!1,disableSwap:i=!1,isRtl:o=!1,marks:s=!1,max:a=100,min:l=0,name:c,onChange:u,onChangeCommitted:f,orientation:d="horizontal",rootRef:h,scale:p=out,step:g=1,shiftStep:m=10,tabIndex:v,value:y}=t,x=D.useRef(void 0),[b,w]=D.useState(-1),[_,S]=D.useState(-1),[O,k]=D.useState(!1),E=D.useRef(0),[P,A]=bc({controlled:y,default:n??l,name:"Slider"}),R=u&&((W,J,se)=>{const ye=W.nativeEvent||W,ie=new ye.constructor(ye.type,ye);Object.defineProperty(ie,"target",{writable:!0,value:{value:J,name:c}}),u(ie,J,se)}),T=Array.isArray(P);let M=T?P.slice().sort(OPe):[P];M=M.map(W=>W==null?l:Aw(W,l,a));const I=s===!0&&g!==null?[...Array(Math.floor((a-l)/g)+1)].map((W,J)=>({value:l+g*J})):s||[],j=I.map(W=>W.value),[N,z]=D.useState(-1),L=D.useRef(null),B=dn(h,L),F=W=>J=>{var ye;const se=Number(J.currentTarget.getAttribute("data-index"));Kv(J.target)&&z(se),S(se),(ye=W==null?void 0:W.onFocus)==null||ye.call(W,J)},$=W=>J=>{var se;Kv(J.target)||z(-1),S(-1),(se=W==null?void 0:W.onBlur)==null||se.call(W,J)},q=(W,J)=>{const se=Number(W.currentTarget.getAttribute("data-index")),ye=M[se],ie=j.indexOf(ye);let fe=J;if(I&&g==null){const Q=j[j.length-1];fe>Q?fe=Q:feJ=>{var se;if(g!==null){const ye=Number(J.currentTarget.getAttribute("data-index")),ie=M[ye];let fe=null;(J.key==="ArrowLeft"||J.key==="ArrowDown")&&J.shiftKey||J.key==="PageDown"?fe=Math.max(ie-m,l):((J.key==="ArrowRight"||J.key==="ArrowUp")&&J.shiftKey||J.key==="PageUp")&&(fe=Math.min(ie+m,a)),fe!==null&&(q(J,fe),J.preventDefault())}(se=W==null?void 0:W.onKeyDown)==null||se.call(W,J)};Ti(()=>{var W;r&&L.current.contains(document.activeElement)&&((W=document.activeElement)==null||W.blur())},[r]),r&&b!==-1&&w(-1),r&&N!==-1&&z(-1);const Y=W=>J=>{var se;(se=W.onChange)==null||se.call(W,J),q(J,J.target.valueAsNumber)},le=D.useRef(void 0);let K=d;o&&d==="horizontal"&&(K+="-reverse");const ee=({finger:W,move:J=!1})=>{const{current:se}=L,{width:ye,height:ie,bottom:fe,left:Q}=se.getBoundingClientRect();let _e;K.startsWith("vertical")?_e=(fe-W.y)/ie:_e=(W.x-Q)/ye,K.includes("-reverse")&&(_e=1-_e);let we;if(we=tut(_e,l,a),g)we=rut(we,g,l);else{const Pe=Hde(j,we);we=j[Pe]}we=Aw(we,l,a);let Ie=0;if(T){J?Ie=le.current:Ie=Hde(M,we),i&&(we=Aw(we,M[Ie-1]||-1/0,M[Ie+1]||1/0));const Pe=we;we=qde({values:M,newValue:we,index:Ie}),i&&J||(Ie=we.indexOf(Pe),le.current=Ie)}return{newValue:we,activeIndex:Ie}},re=st(W=>{const J=JD(W,x);if(!J)return;if(E.current+=1,W.type==="mousemove"&&W.buttons===0){ge(W);return}const{newValue:se,activeIndex:ye}=ee({finger:J,move:!0});eI({sliderRef:L,activeIndex:ye,setActive:w}),A(se),!O&&E.current>eut&&k(!0),R&&!tI(se,P)&&R(W,se,ye)}),ge=st(W=>{const J=JD(W,x);if(k(!1),!J)return;const{newValue:se}=ee({finger:J,move:!0});w(-1),W.type==="touchend"&&S(-1),f&&f(W,se),x.current=void 0,ae()}),te=st(W=>{if(r)return;Xde()||W.preventDefault();const J=W.changedTouches[0];J!=null&&(x.current=J.identifier);const se=JD(W,x);if(se!==!1){const{newValue:ie,activeIndex:fe}=ee({finger:se});eI({sliderRef:L,activeIndex:fe,setActive:w}),A(ie),R&&!tI(ie,P)&&R(W,ie,fe)}E.current=0;const ye=vi(L.current);ye.addEventListener("touchmove",re,{passive:!0}),ye.addEventListener("touchend",ge,{passive:!0})}),ae=D.useCallback(()=>{const W=vi(L.current);W.removeEventListener("mousemove",re),W.removeEventListener("mouseup",ge),W.removeEventListener("touchmove",re),W.removeEventListener("touchend",ge)},[ge,re]);D.useEffect(()=>{const{current:W}=L;return W.addEventListener("touchstart",te,{passive:Xde()}),()=>{W.removeEventListener("touchstart",te),ae()}},[ae,te]),D.useEffect(()=>{r&&ae()},[r,ae]);const U=W=>J=>{var ie;if((ie=W.onMouseDown)==null||ie.call(W,J),r||J.defaultPrevented||J.button!==0)return;J.preventDefault();const se=JD(J,x);if(se!==!1){const{newValue:fe,activeIndex:Q}=ee({finger:se});eI({sliderRef:L,activeIndex:Q,setActive:w}),A(fe),R&&!tI(fe,P)&&R(J,fe,Q)}E.current=0;const ye=vi(L.current);ye.addEventListener("mousemove",re,{passive:!0}),ye.addEventListener("mouseup",ge)},oe=NF(T?M[0]:l,l,a),ne=NF(M[M.length-1],l,a)-oe,V=(W={})=>{const J=kx(W),se={onMouseDown:U(J||{})},ye={...J,...se};return{...W,ref:B,...ye}},X=W=>J=>{var ye;(ye=W.onMouseOver)==null||ye.call(W,J);const se=Number(J.currentTarget.getAttribute("data-index"));S(se)},Z=W=>J=>{var se;(se=W.onMouseLeave)==null||se.call(W,J),S(-1)};return{active:b,axis:K,axisProps:iut,dragging:O,focusedThumbIndex:N,getHiddenInputProps:(W={})=>{const J=kx(W),se={onChange:Y(J||{}),onFocus:F(J||{}),onBlur:$(J||{}),onKeyDown:G(J||{})},ye={...J,...se};return{tabIndex:v,"aria-labelledby":e,"aria-orientation":d,"aria-valuemax":p(a),"aria-valuemin":p(l),name:c,type:"range",min:t.min,max:t.max,step:t.step===null&&t.marks?"any":t.step??void 0,disabled:r,...W,...ye,style:{...MAe,direction:o?"rtl":"ltr",width:"100%",height:"100%"}}},getRootProps:V,getThumbProps:(W={})=>{const J=kx(W),se={onMouseOver:X(J||{}),onMouseLeave:Z(J||{})};return{...W,...J,...se}},marks:I,open:_,range:T,rootRef:B,trackLeap:ne,trackOffset:oe,values:M,getThumbStyle:W=>({pointerEvents:b!==-1&&b!==W?"none":void 0})}}const aut=t=>!t||!eg(t);function lut(t){return Ye("MuiSlider",t)}const nu=He("MuiSlider",["root","active","colorPrimary","colorSecondary","colorError","colorInfo","colorSuccess","colorWarning","disabled","dragging","focusVisible","mark","markActive","marked","markLabel","markLabelActive","rail","sizeSmall","thumb","thumbColorPrimary","thumbColorSecondary","thumbColorError","thumbColorSuccess","thumbColorInfo","thumbColorWarning","track","trackInverted","trackFalse","thumbSizeSmall","valueLabel","valueLabelOpen","valueLabelCircle","valueLabelLabel","vertical"]),cut=t=>{const{open:e}=t;return{offset:Oe(e&&nu.valueLabelOpen),circle:nu.valueLabelCircle,label:nu.valueLabelLabel}};function uut(t){const{children:e,className:n,value:r}=t,i=cut(t);return e?D.cloneElement(e,{className:Oe(e.props.className)},C.jsxs(D.Fragment,{children:[e.props.children,C.jsx("span",{className:Oe(i.offset,n),"aria-hidden":!0,children:C.jsx("span",{className:i.circle,children:C.jsx("span",{className:i.label,children:r})})})]})):null}function Yde(t){return t}const fut=be("span",{name:"MuiSlider",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,e[`color${Re(n.color)}`],n.size!=="medium"&&e[`size${Re(n.size)}`],n.marked&&e.marked,n.orientation==="vertical"&&e.vertical,n.track==="inverted"&&e.trackInverted,n.track===!1&&e.trackFalse]}})(Tt(({theme:t})=>({borderRadius:12,boxSizing:"content-box",display:"inline-block",position:"relative",cursor:"pointer",touchAction:"none",WebkitTapHighlightColor:"transparent","@media print":{colorAdjust:"exact"},[`&.${nu.disabled}`]:{pointerEvents:"none",cursor:"default",color:(t.vars||t).palette.grey[400]},[`&.${nu.dragging}`]:{[`& .${nu.thumb}, & .${nu.track}`]:{transition:"none"}},variants:[...Object.entries(t.palette).filter(ii()).map(([e])=>({props:{color:e},style:{color:(t.vars||t).palette[e].main}})),{props:{orientation:"horizontal"},style:{height:4,width:"100%",padding:"13px 0","@media (pointer: coarse)":{padding:"20px 0"}}},{props:{orientation:"horizontal",size:"small"},style:{height:2}},{props:{orientation:"horizontal",marked:!0},style:{marginBottom:20}},{props:{orientation:"vertical"},style:{height:"100%",width:4,padding:"0 13px","@media (pointer: coarse)":{padding:"0 20px"}}},{props:{orientation:"vertical",size:"small"},style:{width:2}},{props:{orientation:"vertical",marked:!0},style:{marginRight:44}}]}))),dut=be("span",{name:"MuiSlider",slot:"Rail",overridesResolver:(t,e)=>e.rail})({display:"block",position:"absolute",borderRadius:"inherit",backgroundColor:"currentColor",opacity:.38,variants:[{props:{orientation:"horizontal"},style:{width:"100%",height:"inherit",top:"50%",transform:"translateY(-50%)"}},{props:{orientation:"vertical"},style:{height:"100%",width:"inherit",left:"50%",transform:"translateX(-50%)"}},{props:{track:"inverted"},style:{opacity:1}}]}),hut=be("span",{name:"MuiSlider",slot:"Track",overridesResolver:(t,e)=>e.track})(Tt(({theme:t})=>({display:"block",position:"absolute",borderRadius:"inherit",border:"1px solid currentColor",backgroundColor:"currentColor",transition:t.transitions.create(["left","width","bottom","height"],{duration:t.transitions.duration.shortest}),variants:[{props:{size:"small"},style:{border:"none"}},{props:{orientation:"horizontal"},style:{height:"inherit",top:"50%",transform:"translateY(-50%)"}},{props:{orientation:"vertical"},style:{width:"inherit",left:"50%",transform:"translateX(-50%)"}},{props:{track:!1},style:{display:"none"}},...Object.entries(t.palette).filter(ii()).map(([e])=>({props:{color:e,track:"inverted"},style:{...t.vars?{backgroundColor:t.vars.palette.Slider[`${e}Track`],borderColor:t.vars.palette.Slider[`${e}Track`]}:{backgroundColor:Tg(t.palette[e].main,.62),borderColor:Tg(t.palette[e].main,.62),...t.applyStyles("dark",{backgroundColor:Eg(t.palette[e].main,.5)}),...t.applyStyles("dark",{borderColor:Eg(t.palette[e].main,.5)})}}}))]}))),put=be("span",{name:"MuiSlider",slot:"Thumb",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.thumb,e[`thumbColor${Re(n.color)}`],n.size!=="medium"&&e[`thumbSize${Re(n.size)}`]]}})(Tt(({theme:t})=>({position:"absolute",width:20,height:20,boxSizing:"border-box",borderRadius:"50%",outline:0,backgroundColor:"currentColor",display:"flex",alignItems:"center",justifyContent:"center",transition:t.transitions.create(["box-shadow","left","bottom"],{duration:t.transitions.duration.shortest}),"&::before":{position:"absolute",content:'""',borderRadius:"inherit",width:"100%",height:"100%",boxShadow:(t.vars||t).shadows[2]},"&::after":{position:"absolute",content:'""',borderRadius:"50%",width:42,height:42,top:"50%",left:"50%",transform:"translate(-50%, -50%)"},[`&.${nu.disabled}`]:{"&:hover":{boxShadow:"none"}},variants:[{props:{size:"small"},style:{width:12,height:12,"&::before":{boxShadow:"none"}}},{props:{orientation:"horizontal"},style:{top:"50%",transform:"translate(-50%, -50%)"}},{props:{orientation:"vertical"},style:{left:"50%",transform:"translate(-50%, 50%)"}},...Object.entries(t.palette).filter(ii()).map(([e])=>({props:{color:e},style:{[`&:hover, &.${nu.focusVisible}`]:{...t.vars?{boxShadow:`0px 0px 0px 8px rgba(${t.vars.palette[e].mainChannel} / 0.16)`}:{boxShadow:`0px 0px 0px 8px ${kt(t.palette[e].main,.16)}`},"@media (hover: none)":{boxShadow:"none"}},[`&.${nu.active}`]:{...t.vars?{boxShadow:`0px 0px 0px 14px rgba(${t.vars.palette[e].mainChannel} / 0.16)`}:{boxShadow:`0px 0px 0px 14px ${kt(t.palette[e].main,.16)}`}}}}))]}))),gut=be(uut,{name:"MuiSlider",slot:"ValueLabel",overridesResolver:(t,e)=>e.valueLabel})(Tt(({theme:t})=>({zIndex:1,whiteSpace:"nowrap",...t.typography.body2,fontWeight:500,transition:t.transitions.create(["transform"],{duration:t.transitions.duration.shortest}),position:"absolute",backgroundColor:(t.vars||t).palette.grey[600],borderRadius:2,color:(t.vars||t).palette.common.white,display:"flex",alignItems:"center",justifyContent:"center",padding:"0.25rem 0.75rem",variants:[{props:{orientation:"horizontal"},style:{transform:"translateY(-100%) scale(0)",top:"-10px",transformOrigin:"bottom center","&::before":{position:"absolute",content:'""',width:8,height:8,transform:"translate(-50%, 50%) rotate(45deg)",backgroundColor:"inherit",bottom:0,left:"50%"},[`&.${nu.valueLabelOpen}`]:{transform:"translateY(-100%) scale(1)"}}},{props:{orientation:"vertical"},style:{transform:"translateY(-50%) scale(0)",right:"30px",top:"50%",transformOrigin:"right center","&::before":{position:"absolute",content:'""',width:8,height:8,transform:"translate(-50%, -50%) rotate(45deg)",backgroundColor:"inherit",right:-8,top:"50%"},[`&.${nu.valueLabelOpen}`]:{transform:"translateY(-50%) scale(1)"}}},{props:{size:"small"},style:{fontSize:t.typography.pxToRem(12),padding:"0.25rem 0.5rem"}},{props:{orientation:"vertical",size:"small"},style:{right:"20px"}}]}))),mut=be("span",{name:"MuiSlider",slot:"Mark",shouldForwardProp:t=>t4(t)&&t!=="markActive",overridesResolver:(t,e)=>{const{markActive:n}=t;return[e.mark,n&&e.markActive]}})(Tt(({theme:t})=>({position:"absolute",width:2,height:2,borderRadius:1,backgroundColor:"currentColor",variants:[{props:{orientation:"horizontal"},style:{top:"50%",transform:"translate(-1px, -50%)"}},{props:{orientation:"vertical"},style:{left:"50%",transform:"translate(-50%, 1px)"}},{props:{markActive:!0},style:{backgroundColor:(t.vars||t).palette.background.paper,opacity:.8}}]}))),vut=be("span",{name:"MuiSlider",slot:"MarkLabel",shouldForwardProp:t=>t4(t)&&t!=="markLabelActive",overridesResolver:(t,e)=>e.markLabel})(Tt(({theme:t})=>({...t.typography.body2,color:(t.vars||t).palette.text.secondary,position:"absolute",whiteSpace:"nowrap",variants:[{props:{orientation:"horizontal"},style:{top:30,transform:"translateX(-50%)","@media (pointer: coarse)":{top:40}}},{props:{orientation:"vertical"},style:{left:36,transform:"translateY(50%)","@media (pointer: coarse)":{left:44}}},{props:{markLabelActive:!0},style:{color:(t.vars||t).palette.text.primary}}]}))),yut=t=>{const{disabled:e,dragging:n,marked:r,orientation:i,track:o,classes:s,color:a,size:l}=t,c={root:["root",e&&"disabled",n&&"dragging",r&&"marked",i==="vertical"&&"vertical",o==="inverted"&&"trackInverted",o===!1&&"trackFalse",a&&`color${Re(a)}`,l&&`size${Re(l)}`],rail:["rail"],track:["track"],mark:["mark"],markActive:["markActive"],markLabel:["markLabel"],markLabelActive:["markLabelActive"],valueLabel:["valueLabel"],thumb:["thumb",e&&"disabled",l&&`thumbSize${Re(l)}`,a&&`thumbColor${Re(a)}`],active:["active"],disabled:["disabled"],focusVisible:["focusVisible"]};return qe(c,lut,s)},xut=({children:t})=>t,YC=D.forwardRef(function(e,n){const r=wt({props:e,name:"MuiSlider"}),i=Ho(),{"aria-label":o,"aria-valuetext":s,"aria-labelledby":a,component:l="span",components:c={},componentsProps:u={},color:f="primary",classes:d,className:h,disableSwap:p=!1,disabled:g=!1,getAriaLabel:m,getAriaValueText:v,marks:y=!1,max:x=100,min:b=0,name:w,onChange:_,onChangeCommitted:S,orientation:O="horizontal",shiftStep:k=10,size:E="medium",step:P=1,scale:A=Yde,slotProps:R,slots:T,tabIndex:M,track:I="normal",value:j,valueLabelDisplay:N="off",valueLabelFormat:z=Yde,...L}=r,B={...r,isRtl:i,max:x,min:b,classes:d,disabled:g,disableSwap:p,orientation:O,marks:y,color:f,size:E,step:P,shiftStep:k,scale:A,track:I,valueLabelDisplay:N,valueLabelFormat:z},{axisProps:F,getRootProps:$,getHiddenInputProps:q,getThumbProps:G,open:Y,active:le,axis:K,focusedThumbIndex:ee,range:re,dragging:ge,marks:te,values:ae,trackOffset:U,trackLeap:oe,getThumbStyle:ne}=sut({...B,rootRef:n});B.marked=te.length>0&&te.some(ut=>ut.label),B.dragging=ge,B.focusedThumbIndex=ee;const V=yut(B),X=(T==null?void 0:T.root)??c.Root??fut,Z=(T==null?void 0:T.rail)??c.Rail??dut,he=(T==null?void 0:T.track)??c.Track??hut,xe=(T==null?void 0:T.thumb)??c.Thumb??put,H=(T==null?void 0:T.valueLabel)??c.ValueLabel??gut,W=(T==null?void 0:T.mark)??c.Mark??mut,J=(T==null?void 0:T.markLabel)??c.MarkLabel??vut,se=(T==null?void 0:T.input)??c.Input??"input",ye=(R==null?void 0:R.root)??u.root,ie=(R==null?void 0:R.rail)??u.rail,fe=(R==null?void 0:R.track)??u.track,Q=(R==null?void 0:R.thumb)??u.thumb,_e=(R==null?void 0:R.valueLabel)??u.valueLabel,we=(R==null?void 0:R.mark)??u.mark,Ie=(R==null?void 0:R.markLabel)??u.markLabel,Pe=(R==null?void 0:R.input)??u.input,Me=Zt({elementType:X,getSlotProps:$,externalSlotProps:ye,externalForwardedProps:L,additionalProps:{...aut(X)&&{as:l}},ownerState:{...B,...ye==null?void 0:ye.ownerState},className:[V.root,h]}),Te=Zt({elementType:Z,externalSlotProps:ie,ownerState:B,className:V.rail}),Le=Zt({elementType:he,externalSlotProps:fe,additionalProps:{style:{...F[K].offset(U),...F[K].leap(oe)}},ownerState:{...B,...fe==null?void 0:fe.ownerState},className:V.track}),ue=Zt({elementType:xe,getSlotProps:G,externalSlotProps:Q,ownerState:{...B,...Q==null?void 0:Q.ownerState},className:V.thumb}),$e=Zt({elementType:H,externalSlotProps:_e,ownerState:{...B,..._e==null?void 0:_e.ownerState},className:V.valueLabel}),Se=Zt({elementType:W,externalSlotProps:we,ownerState:B,className:V.mark}),Xe=Zt({elementType:J,externalSlotProps:Ie,ownerState:B,className:V.markLabel}),tt=Zt({elementType:se,getSlotProps:q,externalSlotProps:Pe,ownerState:B});return C.jsxs(X,{...Me,children:[C.jsx(Z,{...Te}),C.jsx(he,{...Le}),te.filter(ut=>ut.value>=b&&ut.value<=x).map((ut,qt)=>{const Dn=NF(ut.value,b,x),Zi=F[K].offset(Dn);let yn;return I===!1?yn=ae.includes(ut.value):yn=I==="normal"&&(re?ut.value>=ae[0]&&ut.value<=ae[ae.length-1]:ut.value<=ae[0])||I==="inverted"&&(re?ut.value<=ae[0]||ut.value>=ae[ae.length-1]:ut.value>=ae[0]),C.jsxs(D.Fragment,{children:[C.jsx(W,{"data-index":qt,...Se,...!eg(W)&&{markActive:yn},style:{...Zi,...Se.style},className:Oe(Se.className,yn&&V.markActive)}),ut.label!=null?C.jsx(J,{"aria-hidden":!0,"data-index":qt,...Xe,...!eg(J)&&{markLabelActive:yn},style:{...Zi,...Xe.style},className:Oe(V.markLabel,Xe.className,yn&&V.markLabelActive),children:ut.label}):null]},qt)}),ae.map((ut,qt)=>{const Dn=NF(ut,b,x),Zi=F[K].offset(Dn),yn=N==="off"?xut:H;return C.jsx(yn,{...!eg(yn)&&{valueLabelFormat:z,valueLabelDisplay:N,value:typeof z=="function"?z(A(ut),qt):z,index:qt,open:Y===qt||le===qt||N==="on",disabled:g},...$e,children:C.jsx(xe,{"data-index":qt,...ue,className:Oe(V.thumb,ue.className,le===qt&&V.active,ee===qt&&V.focusVisible),style:{...Zi,...ne(qt),...ue.style},children:C.jsx(se,{"data-index":qt,"aria-label":m?m(qt):o,"aria-valuenow":A(ut),"aria-labelledby":a,"aria-valuetext":v?v(A(ut),qt):s,value:ae[qt],...tt})})},qt)})]})});function but(t={}){const{autoHideDuration:e=null,disableWindowBlurListener:n=!1,onClose:r,open:i,resumeHideDuration:o}=t,s=lv();D.useEffect(()=>{if(!i)return;function v(y){y.defaultPrevented||y.key==="Escape"&&(r==null||r(y,"escapeKeyDown"))}return document.addEventListener("keydown",v),()=>{document.removeEventListener("keydown",v)}},[i,r]);const a=st((v,y)=>{r==null||r(v,y)}),l=st(v=>{!r||v==null||s.start(v,()=>{a(null,"timeout")})});D.useEffect(()=>(i&&l(e),s.clear),[i,e,l,s]);const c=v=>{r==null||r(v,"clickaway")},u=s.clear,f=D.useCallback(()=>{e!=null&&l(o??e*.5)},[e,o,l]),d=v=>y=>{const x=v.onBlur;x==null||x(y),f()},h=v=>y=>{const x=v.onFocus;x==null||x(y),u()},p=v=>y=>{const x=v.onMouseEnter;x==null||x(y),u()},g=v=>y=>{const x=v.onMouseLeave;x==null||x(y),f()};return D.useEffect(()=>{if(!n&&i)return window.addEventListener("focus",f),window.addEventListener("blur",u),()=>{window.removeEventListener("focus",f),window.removeEventListener("blur",u)}},[n,i,f,u]),{getRootProps:(v={})=>{const y={...kx(t),...kx(v)};return{role:"presentation",...v,...y,onBlur:d(y),onFocus:h(y),onMouseEnter:p(y),onMouseLeave:g(y)}},onClickAway:c}}function wut(t){return Ye("MuiSnackbarContent",t)}He("MuiSnackbarContent",["root","message","action"]);const _ut=t=>{const{classes:e}=t;return qe({root:["root"],action:["action"],message:["message"]},wut,e)},Sut=be(Tl,{name:"MuiSnackbarContent",slot:"Root",overridesResolver:(t,e)=>e.root})(Tt(({theme:t})=>{const e=t.palette.mode==="light"?.8:.98,n=TAe(t.palette.background.default,e);return{...t.typography.body2,color:t.vars?t.vars.palette.SnackbarContent.color:t.palette.getContrastText(n),backgroundColor:t.vars?t.vars.palette.SnackbarContent.bg:n,display:"flex",alignItems:"center",flexWrap:"wrap",padding:"6px 16px",borderRadius:(t.vars||t).shape.borderRadius,flexGrow:1,[t.breakpoints.up("sm")]:{flexGrow:"initial",minWidth:288}}})),Cut=be("div",{name:"MuiSnackbarContent",slot:"Message",overridesResolver:(t,e)=>e.message})({padding:"8px 0"}),Out=be("div",{name:"MuiSnackbarContent",slot:"Action",overridesResolver:(t,e)=>e.action})({display:"flex",alignItems:"center",marginLeft:"auto",paddingLeft:16,marginRight:-8}),EPe=D.forwardRef(function(e,n){const r=wt({props:e,name:"MuiSnackbarContent"}),{action:i,className:o,message:s,role:a="alert",...l}=r,c=r,u=_ut(c);return C.jsxs(Sut,{role:a,square:!0,elevation:6,className:Oe(u.root,o),ownerState:c,ref:n,...l,children:[C.jsx(Cut,{className:u.message,ownerState:c,children:s}),i?C.jsx(Out,{className:u.action,ownerState:c,children:i}):null]})});function Eut(t){return Ye("MuiSnackbar",t)}He("MuiSnackbar",["root","anchorOriginTopCenter","anchorOriginBottomCenter","anchorOriginTopRight","anchorOriginBottomRight","anchorOriginTopLeft","anchorOriginBottomLeft"]);const Tut=t=>{const{classes:e,anchorOrigin:n}=t,r={root:["root",`anchorOrigin${Re(n.vertical)}${Re(n.horizontal)}`]};return qe(r,Eut,e)},Qde=be("div",{name:"MuiSnackbar",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,e[`anchorOrigin${Re(n.anchorOrigin.vertical)}${Re(n.anchorOrigin.horizontal)}`]]}})(Tt(({theme:t})=>({zIndex:(t.vars||t).zIndex.snackbar,position:"fixed",display:"flex",left:8,right:8,justifyContent:"center",alignItems:"center",variants:[{props:({ownerState:e})=>e.anchorOrigin.vertical==="top",style:{top:8,[t.breakpoints.up("sm")]:{top:24}}},{props:({ownerState:e})=>e.anchorOrigin.vertical!=="top",style:{bottom:8,[t.breakpoints.up("sm")]:{bottom:24}}},{props:({ownerState:e})=>e.anchorOrigin.horizontal==="left",style:{justifyContent:"flex-start",[t.breakpoints.up("sm")]:{left:24,right:"auto"}}},{props:({ownerState:e})=>e.anchorOrigin.horizontal==="right",style:{justifyContent:"flex-end",[t.breakpoints.up("sm")]:{right:24,left:"auto"}}},{props:({ownerState:e})=>e.anchorOrigin.horizontal==="center",style:{[t.breakpoints.up("sm")]:{left:"50%",right:"auto",transform:"translateX(-50%)"}}}]}))),kut=D.forwardRef(function(e,n){const r=wt({props:e,name:"MuiSnackbar"}),i=$a(),o={enter:i.transitions.duration.enteringScreen,exit:i.transitions.duration.leavingScreen},{action:s,anchorOrigin:{vertical:a,horizontal:l}={vertical:"bottom",horizontal:"left"},autoHideDuration:c=null,children:u,className:f,ClickAwayListenerProps:d,ContentProps:h,disableWindowBlurListener:p=!1,message:g,onBlur:m,onClose:v,onFocus:y,onMouseEnter:x,onMouseLeave:b,open:w,resumeHideDuration:_,TransitionComponent:S=nb,transitionDuration:O=o,TransitionProps:{onEnter:k,onExited:E,...P}={},...A}=r,R={...r,anchorOrigin:{vertical:a,horizontal:l},autoHideDuration:c,disableWindowBlurListener:p,TransitionComponent:S,transitionDuration:O},T=Tut(R),{getRootProps:M,onClickAway:I}=but({...R}),[j,N]=D.useState(!0),z=Zt({elementType:Qde,getSlotProps:M,externalForwardedProps:A,ownerState:R,additionalProps:{ref:n},className:[T.root,f]}),L=F=>{N(!0),E&&E(F)},B=(F,$)=>{N(!1),k&&k(F,$)};return!w&&j?null:C.jsx(jst,{onClickAway:I,...d,children:C.jsx(Qde,{...z,children:C.jsx(S,{appear:!0,in:w,timeout:O,direction:a==="top"?"down":"up",onEnter:B,onExited:L,...P,children:u||C.jsx(EPe,{message:g,action:s,...h})})})})});function Aut(t){return Ye("MuiTooltip",t)}const Ri=He("MuiTooltip",["popper","popperInteractive","popperArrow","popperClose","tooltip","tooltipArrow","touch","tooltipPlacementLeft","tooltipPlacementRight","tooltipPlacementTop","tooltipPlacementBottom","arrow"]);function Put(t){return Math.round(t*1e5)/1e5}const Mut=t=>{const{classes:e,disableInteractive:n,arrow:r,touch:i,placement:o}=t,s={popper:["popper",!n&&"popperInteractive",r&&"popperArrow"],tooltip:["tooltip",r&&"tooltipArrow",i&&"touch",`tooltipPlacement${Re(o.split("-")[0])}`],arrow:["arrow"]};return qe(s,Aut,e)},Rut=be(zee,{name:"MuiTooltip",slot:"Popper",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.popper,!n.disableInteractive&&e.popperInteractive,n.arrow&&e.popperArrow,!n.open&&e.popperClose]}})(Tt(({theme:t})=>({zIndex:(t.vars||t).zIndex.tooltip,pointerEvents:"none",variants:[{props:({ownerState:e})=>!e.disableInteractive,style:{pointerEvents:"auto"}},{props:({open:e})=>!e,style:{pointerEvents:"none"}},{props:({ownerState:e})=>e.arrow,style:{[`&[data-popper-placement*="bottom"] .${Ri.arrow}`]:{top:0,marginTop:"-0.71em","&::before":{transformOrigin:"0 100%"}},[`&[data-popper-placement*="top"] .${Ri.arrow}`]:{bottom:0,marginBottom:"-0.71em","&::before":{transformOrigin:"100% 0"}},[`&[data-popper-placement*="right"] .${Ri.arrow}`]:{height:"1em",width:"0.71em","&::before":{transformOrigin:"100% 100%"}},[`&[data-popper-placement*="left"] .${Ri.arrow}`]:{height:"1em",width:"0.71em","&::before":{transformOrigin:"0 0"}}}},{props:({ownerState:e})=>e.arrow&&!e.isRtl,style:{[`&[data-popper-placement*="right"] .${Ri.arrow}`]:{left:0,marginLeft:"-0.71em"}}},{props:({ownerState:e})=>e.arrow&&!!e.isRtl,style:{[`&[data-popper-placement*="right"] .${Ri.arrow}`]:{right:0,marginRight:"-0.71em"}}},{props:({ownerState:e})=>e.arrow&&!e.isRtl,style:{[`&[data-popper-placement*="left"] .${Ri.arrow}`]:{right:0,marginRight:"-0.71em"}}},{props:({ownerState:e})=>e.arrow&&!!e.isRtl,style:{[`&[data-popper-placement*="left"] .${Ri.arrow}`]:{left:0,marginLeft:"-0.71em"}}}]}))),Dut=be("div",{name:"MuiTooltip",slot:"Tooltip",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.tooltip,n.touch&&e.touch,n.arrow&&e.tooltipArrow,e[`tooltipPlacement${Re(n.placement.split("-")[0])}`]]}})(Tt(({theme:t})=>({backgroundColor:t.vars?t.vars.palette.Tooltip.bg:kt(t.palette.grey[700],.92),borderRadius:(t.vars||t).shape.borderRadius,color:(t.vars||t).palette.common.white,fontFamily:t.typography.fontFamily,padding:"4px 8px",fontSize:t.typography.pxToRem(11),maxWidth:300,margin:2,wordWrap:"break-word",fontWeight:t.typography.fontWeightMedium,[`.${Ri.popper}[data-popper-placement*="left"] &`]:{transformOrigin:"right center"},[`.${Ri.popper}[data-popper-placement*="right"] &`]:{transformOrigin:"left center"},[`.${Ri.popper}[data-popper-placement*="top"] &`]:{transformOrigin:"center bottom",marginBottom:"14px"},[`.${Ri.popper}[data-popper-placement*="bottom"] &`]:{transformOrigin:"center top",marginTop:"14px"},variants:[{props:({ownerState:e})=>e.arrow,style:{position:"relative",margin:0}},{props:({ownerState:e})=>e.touch,style:{padding:"8px 16px",fontSize:t.typography.pxToRem(14),lineHeight:`${Put(16/14)}em`,fontWeight:t.typography.fontWeightRegular}},{props:({ownerState:e})=>!e.isRtl,style:{[`.${Ri.popper}[data-popper-placement*="left"] &`]:{marginRight:"14px"},[`.${Ri.popper}[data-popper-placement*="right"] &`]:{marginLeft:"14px"}}},{props:({ownerState:e})=>!e.isRtl&&e.touch,style:{[`.${Ri.popper}[data-popper-placement*="left"] &`]:{marginRight:"24px"},[`.${Ri.popper}[data-popper-placement*="right"] &`]:{marginLeft:"24px"}}},{props:({ownerState:e})=>!!e.isRtl,style:{[`.${Ri.popper}[data-popper-placement*="left"] &`]:{marginLeft:"14px"},[`.${Ri.popper}[data-popper-placement*="right"] &`]:{marginRight:"14px"}}},{props:({ownerState:e})=>!!e.isRtl&&e.touch,style:{[`.${Ri.popper}[data-popper-placement*="left"] &`]:{marginLeft:"24px"},[`.${Ri.popper}[data-popper-placement*="right"] &`]:{marginRight:"24px"}}},{props:({ownerState:e})=>e.touch,style:{[`.${Ri.popper}[data-popper-placement*="top"] &`]:{marginBottom:"24px"}}},{props:({ownerState:e})=>e.touch,style:{[`.${Ri.popper}[data-popper-placement*="bottom"] &`]:{marginTop:"24px"}}}]}))),Iut=be("span",{name:"MuiTooltip",slot:"Arrow",overridesResolver:(t,e)=>e.arrow})(Tt(({theme:t})=>({overflow:"hidden",position:"absolute",width:"1em",height:"0.71em",boxSizing:"border-box",color:t.vars?t.vars.palette.Tooltip.bg:kt(t.palette.grey[700],.9),"&::before":{content:'""',margin:"auto",display:"block",width:"100%",height:"100%",backgroundColor:"currentColor",transform:"rotate(45deg)"}})));let rI=!1;const Kde=new Kj;let DE={x:0,y:0};function iI(t,e){return(n,...r)=>{e&&e(n,...r),t(n,...r)}}const Lt=D.forwardRef(function(e,n){var Dn,Zi,yn;const r=wt({props:e,name:"MuiTooltip"}),{arrow:i=!1,children:o,classes:s,components:a={},componentsProps:l={},describeChild:c=!1,disableFocusListener:u=!1,disableHoverListener:f=!1,disableInteractive:d=!1,disableTouchListener:h=!1,enterDelay:p=100,enterNextDelay:g=0,enterTouchDelay:m=700,followCursor:v=!1,id:y,leaveDelay:x=0,leaveTouchDelay:b=1500,onClose:w,onOpen:_,open:S,placement:O="bottom",PopperComponent:k,PopperProps:E={},slotProps:P={},slots:A={},title:R,TransitionComponent:T=nb,TransitionProps:M,...I}=r,j=D.isValidElement(o)?o:C.jsx("span",{children:o}),N=$a(),z=Ho(),[L,B]=D.useState(),[F,$]=D.useState(null),q=D.useRef(!1),G=d||v,Y=lv(),le=lv(),K=lv(),ee=lv(),[re,ge]=bc({controlled:S,default:!1,name:"Tooltip",state:"open"});let te=re;const ae=Jf(y),U=D.useRef(),oe=st(()=>{U.current!==void 0&&(document.body.style.WebkitUserSelect=U.current,U.current=void 0),ee.clear()});D.useEffect(()=>oe,[oe]);const ne=Gt=>{Kde.clear(),rI=!0,ge(!0),_&&!te&&_(Gt)},V=st(Gt=>{Kde.start(800+x,()=>{rI=!1}),ge(!1),w&&te&&w(Gt),Y.start(N.transitions.duration.shortest,()=>{q.current=!1})}),X=Gt=>{q.current&&Gt.type!=="touchstart"||(L&&L.removeAttribute("title"),le.clear(),K.clear(),p||rI&&g?le.start(rI?g:p,()=>{ne(Gt)}):ne(Gt))},Z=Gt=>{le.clear(),K.start(x,()=>{V(Gt)})},[,he]=D.useState(!1),xe=Gt=>{Kv(Gt.target)||(he(!1),Z(Gt))},H=Gt=>{L||B(Gt.currentTarget),Kv(Gt.target)&&(he(!0),X(Gt))},W=Gt=>{q.current=!0;const fr=j.props;fr.onTouchStart&&fr.onTouchStart(Gt)},J=Gt=>{W(Gt),K.clear(),Y.clear(),oe(),U.current=document.body.style.WebkitUserSelect,document.body.style.WebkitUserSelect="none",ee.start(m,()=>{document.body.style.WebkitUserSelect=U.current,X(Gt)})},se=Gt=>{j.props.onTouchEnd&&j.props.onTouchEnd(Gt),oe(),K.start(b,()=>{V(Gt)})};D.useEffect(()=>{if(!te)return;function Gt(fr){fr.key==="Escape"&&V(fr)}return document.addEventListener("keydown",Gt),()=>{document.removeEventListener("keydown",Gt)}},[V,te]);const ye=dn(Py(j),B,n);!R&&R!==0&&(te=!1);const ie=D.useRef(),fe=Gt=>{const fr=j.props;fr.onMouseMove&&fr.onMouseMove(Gt),DE={x:Gt.clientX,y:Gt.clientY},ie.current&&ie.current.update()},Q={},_e=typeof R=="string";c?(Q.title=!te&&_e&&!f?R:null,Q["aria-describedby"]=te?ae:null):(Q["aria-label"]=_e?R:null,Q["aria-labelledby"]=te&&!_e?ae:null);const we={...Q,...I,...j.props,className:Oe(I.className,j.props.className),onTouchStart:W,ref:ye,...v?{onMouseMove:fe}:{}},Ie={};h||(we.onTouchStart=J,we.onTouchEnd=se),f||(we.onMouseOver=iI(X,we.onMouseOver),we.onMouseLeave=iI(Z,we.onMouseLeave),G||(Ie.onMouseOver=X,Ie.onMouseLeave=Z)),u||(we.onFocus=iI(H,we.onFocus),we.onBlur=iI(xe,we.onBlur),G||(Ie.onFocus=H,Ie.onBlur=xe));const Pe=D.useMemo(()=>{var fr;let Gt=[{name:"arrow",enabled:!!F,options:{element:F,padding:4}}];return(fr=E.popperOptions)!=null&&fr.modifiers&&(Gt=Gt.concat(E.popperOptions.modifiers)),{...E.popperOptions,modifiers:Gt}},[F,E]),Me={...r,isRtl:z,arrow:i,disableInteractive:G,placement:O,PopperComponentProp:k,touch:q.current},Te=Mut(Me),Le=A.popper??a.Popper??Rut,ue=A.transition??a.Transition??T??nb,$e=A.tooltip??a.Tooltip??Dut,Se=A.arrow??a.Arrow??Iut,Xe=e_(Le,{...E,...P.popper??l.popper,className:Oe(Te.popper,E==null?void 0:E.className,(Dn=P.popper??l.popper)==null?void 0:Dn.className)},Me),tt=e_(ue,{...M,...P.transition??l.transition},Me),ut=e_($e,{...P.tooltip??l.tooltip,className:Oe(Te.tooltip,(Zi=P.tooltip??l.tooltip)==null?void 0:Zi.className)},Me),qt=e_(Se,{...P.arrow??l.arrow,className:Oe(Te.arrow,(yn=P.arrow??l.arrow)==null?void 0:yn.className)},Me);return C.jsxs(D.Fragment,{children:[D.cloneElement(j,we),C.jsx(Le,{as:k??zee,placement:O,anchorEl:v?{getBoundingClientRect:()=>({top:DE.y,left:DE.x,right:DE.x,bottom:DE.y,width:0,height:0})}:L,popperRef:ie,open:L?te:!1,id:ae,transition:!0,...Ie,...Xe,popperOptions:Pe,children:({TransitionProps:Gt})=>C.jsx(ue,{timeout:N.transitions.duration.shorter,...Gt,...tt,children:C.jsxs($e,{...ut,children:[R,i?C.jsx(Se,{...qt,ref:$}):null]})})})]})});function Lut(t){return Ye("MuiSwitch",t)}const ua=He("MuiSwitch",["root","edgeStart","edgeEnd","switchBase","colorPrimary","colorSecondary","sizeSmall","sizeMedium","checked","disabled","input","thumb","track"]),$ut=t=>{const{classes:e,edge:n,size:r,color:i,checked:o,disabled:s}=t,a={root:["root",n&&`edge${Re(n)}`,`size${Re(r)}`],switchBase:["switchBase",`color${Re(i)}`,o&&"checked",s&&"disabled"],thumb:["thumb"],track:["track"],input:["input"]},l=qe(a,Lut,e);return{...e,...l}},Fut=be("span",{name:"MuiSwitch",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,n.edge&&e[`edge${Re(n.edge)}`],e[`size${Re(n.size)}`]]}})({display:"inline-flex",width:34+12*2,height:14+12*2,overflow:"hidden",padding:12,boxSizing:"border-box",position:"relative",flexShrink:0,zIndex:0,verticalAlign:"middle","@media print":{colorAdjust:"exact"},variants:[{props:{edge:"start"},style:{marginLeft:-8}},{props:{edge:"end"},style:{marginRight:-8}},{props:{size:"small"},style:{width:40,height:24,padding:7,[`& .${ua.thumb}`]:{width:16,height:16},[`& .${ua.switchBase}`]:{padding:4,[`&.${ua.checked}`]:{transform:"translateX(16px)"}}}}]}),Nut=be(Bee,{name:"MuiSwitch",slot:"SwitchBase",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.switchBase,{[`& .${ua.input}`]:e.input},n.color!=="default"&&e[`color${Re(n.color)}`]]}})(Tt(({theme:t})=>({position:"absolute",top:0,left:0,zIndex:1,color:t.vars?t.vars.palette.Switch.defaultColor:`${t.palette.mode==="light"?t.palette.common.white:t.palette.grey[300]}`,transition:t.transitions.create(["left","transform"],{duration:t.transitions.duration.shortest}),[`&.${ua.checked}`]:{transform:"translateX(20px)"},[`&.${ua.disabled}`]:{color:t.vars?t.vars.palette.Switch.defaultDisabledColor:`${t.palette.mode==="light"?t.palette.grey[100]:t.palette.grey[600]}`},[`&.${ua.checked} + .${ua.track}`]:{opacity:.5},[`&.${ua.disabled} + .${ua.track}`]:{opacity:t.vars?t.vars.opacity.switchTrackDisabled:`${t.palette.mode==="light"?.12:.2}`},[`& .${ua.input}`]:{left:"-100%",width:"300%"}})),Tt(({theme:t})=>({"&:hover":{backgroundColor:t.vars?`rgba(${t.vars.palette.action.activeChannel} / ${t.vars.palette.action.hoverOpacity})`:kt(t.palette.action.active,t.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}},variants:[...Object.entries(t.palette).filter(ii(["light"])).map(([e])=>({props:{color:e},style:{[`&.${ua.checked}`]:{color:(t.vars||t).palette[e].main,"&:hover":{backgroundColor:t.vars?`rgba(${t.vars.palette[e].mainChannel} / ${t.vars.palette.action.hoverOpacity})`:kt(t.palette[e].main,t.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}},[`&.${ua.disabled}`]:{color:t.vars?t.vars.palette.Switch[`${e}DisabledColor`]:`${t.palette.mode==="light"?Tg(t.palette[e].main,.62):Eg(t.palette[e].main,.55)}`}},[`&.${ua.checked} + .${ua.track}`]:{backgroundColor:(t.vars||t).palette[e].main}}}))]}))),zut=be("span",{name:"MuiSwitch",slot:"Track",overridesResolver:(t,e)=>e.track})(Tt(({theme:t})=>({height:"100%",width:"100%",borderRadius:14/2,zIndex:-1,transition:t.transitions.create(["opacity","background-color"],{duration:t.transitions.duration.shortest}),backgroundColor:t.vars?t.vars.palette.common.onBackground:`${t.palette.mode==="light"?t.palette.common.black:t.palette.common.white}`,opacity:t.vars?t.vars.opacity.switchTrack:`${t.palette.mode==="light"?.38:.3}`}))),jut=be("span",{name:"MuiSwitch",slot:"Thumb",overridesResolver:(t,e)=>e.thumb})(Tt(({theme:t})=>({boxShadow:(t.vars||t).shadows[1],backgroundColor:"currentColor",width:20,height:20,borderRadius:"50%"}))),TPe=D.forwardRef(function(e,n){const r=wt({props:e,name:"MuiSwitch"}),{className:i,color:o="primary",edge:s=!1,size:a="medium",sx:l,...c}=r,u={...r,color:o,edge:s,size:a},f=$ut(u),d=C.jsx(jut,{className:f.thumb,ownerState:u});return C.jsxs(Fut,{className:Oe(f.root,i),sx:l,ownerState:u,children:[C.jsx(Nut,{type:"checkbox",icon:d,checkedIcon:d,ref:n,ownerState:u,...c,classes:{...f,root:f.switchBase}}),C.jsx(zut,{className:f.track,ownerState:u})]})});function But(t){return Ye("MuiTab",t)}const Ic=He("MuiTab",["root","labelIcon","textColorInherit","textColorPrimary","textColorSecondary","selected","disabled","fullWidth","wrapped","iconWrapper","icon"]),Uut=t=>{const{classes:e,textColor:n,fullWidth:r,wrapped:i,icon:o,label:s,selected:a,disabled:l}=t,c={root:["root",o&&s&&"labelIcon",`textColor${Re(n)}`,r&&"fullWidth",i&&"wrapped",a&&"selected",l&&"disabled"],icon:["iconWrapper","icon"]};return qe(c,But,e)},Wut=be(Nf,{name:"MuiTab",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,n.label&&n.icon&&e.labelIcon,e[`textColor${Re(n.textColor)}`],n.fullWidth&&e.fullWidth,n.wrapped&&e.wrapped,{[`& .${Ic.iconWrapper}`]:e.iconWrapper},{[`& .${Ic.icon}`]:e.icon}]}})(Tt(({theme:t})=>({...t.typography.button,maxWidth:360,minWidth:90,position:"relative",minHeight:48,flexShrink:0,padding:"12px 16px",overflow:"hidden",whiteSpace:"normal",textAlign:"center",lineHeight:1.25,variants:[{props:({ownerState:e})=>e.label&&(e.iconPosition==="top"||e.iconPosition==="bottom"),style:{flexDirection:"column"}},{props:({ownerState:e})=>e.label&&e.iconPosition!=="top"&&e.iconPosition!=="bottom",style:{flexDirection:"row"}},{props:({ownerState:e})=>e.icon&&e.label,style:{minHeight:72,paddingTop:9,paddingBottom:9}},{props:({ownerState:e,iconPosition:n})=>e.icon&&e.label&&n==="top",style:{[`& > .${Ic.icon}`]:{marginBottom:6}}},{props:({ownerState:e,iconPosition:n})=>e.icon&&e.label&&n==="bottom",style:{[`& > .${Ic.icon}`]:{marginTop:6}}},{props:({ownerState:e,iconPosition:n})=>e.icon&&e.label&&n==="start",style:{[`& > .${Ic.icon}`]:{marginRight:t.spacing(1)}}},{props:({ownerState:e,iconPosition:n})=>e.icon&&e.label&&n==="end",style:{[`& > .${Ic.icon}`]:{marginLeft:t.spacing(1)}}},{props:{textColor:"inherit"},style:{color:"inherit",opacity:.6,[`&.${Ic.selected}`]:{opacity:1},[`&.${Ic.disabled}`]:{opacity:(t.vars||t).palette.action.disabledOpacity}}},{props:{textColor:"primary"},style:{color:(t.vars||t).palette.text.secondary,[`&.${Ic.selected}`]:{color:(t.vars||t).palette.primary.main},[`&.${Ic.disabled}`]:{color:(t.vars||t).palette.text.disabled}}},{props:{textColor:"secondary"},style:{color:(t.vars||t).palette.text.secondary,[`&.${Ic.selected}`]:{color:(t.vars||t).palette.secondary.main},[`&.${Ic.disabled}`]:{color:(t.vars||t).palette.text.disabled}}},{props:({ownerState:e})=>e.fullWidth,style:{flexShrink:1,flexGrow:1,flexBasis:0,maxWidth:"none"}},{props:({ownerState:e})=>e.wrapped,style:{fontSize:t.typography.pxToRem(12)}}]}))),SS=D.forwardRef(function(e,n){const r=wt({props:e,name:"MuiTab"}),{className:i,disabled:o=!1,disableFocusRipple:s=!1,fullWidth:a,icon:l,iconPosition:c="top",indicator:u,label:f,onChange:d,onClick:h,onFocus:p,selected:g,selectionFollowsFocus:m,textColor:v="inherit",value:y,wrapped:x=!1,...b}=r,w={...r,disabled:o,disableFocusRipple:s,selected:g,icon:!!l,iconPosition:c,label:!!f,fullWidth:a,textColor:v,wrapped:x},_=Uut(w),S=l&&f&&D.isValidElement(l)?D.cloneElement(l,{className:Oe(_.icon,l.props.className)}):l,O=E=>{!g&&d&&d(E,y),h&&h(E)},k=E=>{m&&!g&&d&&d(E,y),p&&p(E)};return C.jsxs(Wut,{focusRipple:!s,className:Oe(_.root,i),ref:n,role:"tab","aria-selected":g,disabled:o,onClick:O,onFocus:k,ownerState:w,tabIndex:g?0:-1,...b,children:[c==="top"||c==="start"?C.jsxs(D.Fragment,{children:[S,f]}):C.jsxs(D.Fragment,{children:[f,S]}),u]})}),kPe=D.createContext();function Vut(t){return Ye("MuiTable",t)}He("MuiTable",["root","stickyHeader"]);const Gut=t=>{const{classes:e,stickyHeader:n}=t;return qe({root:["root",n&&"stickyHeader"]},Vut,e)},Hut=be("table",{name:"MuiTable",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,n.stickyHeader&&e.stickyHeader]}})(Tt(({theme:t})=>({display:"table",width:"100%",borderCollapse:"collapse",borderSpacing:0,"& caption":{...t.typography.body2,padding:t.spacing(2),color:(t.vars||t).palette.text.secondary,textAlign:"left",captionSide:"bottom"},variants:[{props:({ownerState:e})=>e.stickyHeader,style:{borderCollapse:"separate"}}]}))),Zde="table",Hee=D.forwardRef(function(e,n){const r=wt({props:e,name:"MuiTable"}),{className:i,component:o=Zde,padding:s="normal",size:a="medium",stickyHeader:l=!1,...c}=r,u={...r,component:o,padding:s,size:a,stickyHeader:l},f=Gut(u),d=D.useMemo(()=>({padding:s,size:a,stickyHeader:l}),[s,a,l]);return C.jsx(kPe.Provider,{value:d,children:C.jsx(Hut,{as:o,role:o===Zde?null:"table",ref:n,className:Oe(f.root,i),ownerState:u,...c})})}),x4=D.createContext();function qut(t){return Ye("MuiTableBody",t)}He("MuiTableBody",["root"]);const Xut=t=>{const{classes:e}=t;return qe({root:["root"]},qut,e)},Yut=be("tbody",{name:"MuiTableBody",slot:"Root",overridesResolver:(t,e)=>e.root})({display:"table-row-group"}),Qut={variant:"body"},Jde="tbody",qee=D.forwardRef(function(e,n){const r=wt({props:e,name:"MuiTableBody"}),{className:i,component:o=Jde,...s}=r,a={...r,component:o},l=Xut(a);return C.jsx(x4.Provider,{value:Qut,children:C.jsx(Yut,{className:Oe(l.root,i),as:o,ref:n,role:o===Jde?null:"rowgroup",ownerState:a,...s})})});function Kut(t){return Ye("MuiTableCell",t)}const Zut=He("MuiTableCell",["root","head","body","footer","sizeSmall","sizeMedium","paddingCheckbox","paddingNone","alignLeft","alignCenter","alignRight","alignJustify","stickyHeader"]),Jut=t=>{const{classes:e,variant:n,align:r,padding:i,size:o,stickyHeader:s}=t,a={root:["root",n,s&&"stickyHeader",r!=="inherit"&&`align${Re(r)}`,i!=="normal"&&`padding${Re(i)}`,`size${Re(o)}`]};return qe(a,Kut,e)},eft=be("td",{name:"MuiTableCell",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,e[n.variant],e[`size${Re(n.size)}`],n.padding!=="normal"&&e[`padding${Re(n.padding)}`],n.align!=="inherit"&&e[`align${Re(n.align)}`],n.stickyHeader&&e.stickyHeader]}})(Tt(({theme:t})=>({...t.typography.body2,display:"table-cell",verticalAlign:"inherit",borderBottom:t.vars?`1px solid ${t.vars.palette.TableCell.border}`:`1px solid + ${t.palette.mode==="light"?Tg(kt(t.palette.divider,1),.88):Eg(kt(t.palette.divider,1),.68)}`,textAlign:"left",padding:16,variants:[{props:{variant:"head"},style:{color:(t.vars||t).palette.text.primary,lineHeight:t.typography.pxToRem(24),fontWeight:t.typography.fontWeightMedium}},{props:{variant:"body"},style:{color:(t.vars||t).palette.text.primary}},{props:{variant:"footer"},style:{color:(t.vars||t).palette.text.secondary,lineHeight:t.typography.pxToRem(21),fontSize:t.typography.pxToRem(12)}},{props:{size:"small"},style:{padding:"6px 16px",[`&.${Zut.paddingCheckbox}`]:{width:24,padding:"0 12px 0 16px","& > *":{padding:0}}}},{props:{padding:"checkbox"},style:{width:48,padding:"0 0 0 4px"}},{props:{padding:"none"},style:{padding:0}},{props:{align:"left"},style:{textAlign:"left"}},{props:{align:"center"},style:{textAlign:"center"}},{props:{align:"right"},style:{textAlign:"right",flexDirection:"row-reverse"}},{props:{align:"justify"},style:{textAlign:"justify"}},{props:({ownerState:e})=>e.stickyHeader,style:{position:"sticky",top:0,zIndex:2,backgroundColor:(t.vars||t).palette.background.default}}]}))),li=D.forwardRef(function(e,n){const r=wt({props:e,name:"MuiTableCell"}),{align:i="inherit",className:o,component:s,padding:a,scope:l,size:c,sortDirection:u,variant:f,...d}=r,h=D.useContext(kPe),p=D.useContext(x4),g=p&&p.variant==="head";let m;s?m=s:m=g?"th":"td";let v=l;m==="td"?v=void 0:!v&&g&&(v="col");const y=f||p&&p.variant,x={...r,align:i,component:m,padding:a||(h&&h.padding?h.padding:"normal"),size:c||(h&&h.size?h.size:"medium"),sortDirection:u,stickyHeader:y==="head"&&h&&h.stickyHeader,variant:y},b=Jut(x);let w=null;return u&&(w=u==="asc"?"ascending":"descending"),C.jsx(eft,{as:m,ref:n,className:Oe(b.root,o),"aria-sort":w,scope:v,ownerState:x,...d})});function tft(t){return Ye("MuiTableContainer",t)}He("MuiTableContainer",["root"]);const nft=t=>{const{classes:e}=t;return qe({root:["root"]},tft,e)},rft=be("div",{name:"MuiTableContainer",slot:"Root",overridesResolver:(t,e)=>e.root})({width:"100%",overflowX:"auto"}),APe=D.forwardRef(function(e,n){const r=wt({props:e,name:"MuiTableContainer"}),{className:i,component:o="div",...s}=r,a={...r,component:o},l=nft(a);return C.jsx(rft,{ref:n,as:o,className:Oe(l.root,i),ownerState:a,...s})});function ift(t){return Ye("MuiTableHead",t)}He("MuiTableHead",["root"]);const oft=t=>{const{classes:e}=t;return qe({root:["root"]},ift,e)},sft=be("thead",{name:"MuiTableHead",slot:"Root",overridesResolver:(t,e)=>e.root})({display:"table-header-group"}),aft={variant:"head"},ehe="thead",lft=D.forwardRef(function(e,n){const r=wt({props:e,name:"MuiTableHead"}),{className:i,component:o=ehe,...s}=r,a={...r,component:o},l=oft(a);return C.jsx(x4.Provider,{value:aft,children:C.jsx(sft,{as:o,className:Oe(l.root,i),ref:n,role:o===ehe?null:"rowgroup",ownerState:a,...s})})});function cft(t){return Ye("MuiToolbar",t)}He("MuiToolbar",["root","gutters","regular","dense"]);const uft=t=>{const{classes:e,disableGutters:n,variant:r}=t;return qe({root:["root",!n&&"gutters",r]},cft,e)},fft=be("div",{name:"MuiToolbar",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,!n.disableGutters&&e.gutters,e[n.variant]]}})(Tt(({theme:t})=>({position:"relative",display:"flex",alignItems:"center",variants:[{props:({ownerState:e})=>!e.disableGutters,style:{paddingLeft:t.spacing(2),paddingRight:t.spacing(2),[t.breakpoints.up("sm")]:{paddingLeft:t.spacing(3),paddingRight:t.spacing(3)}}},{props:{variant:"dense"},style:{minHeight:48}},{props:{variant:"regular"},style:t.mixins.toolbar}]}))),b4=D.forwardRef(function(e,n){const r=wt({props:e,name:"MuiToolbar"}),{className:i,component:o="div",disableGutters:s=!1,variant:a="regular",...l}=r,c={...r,component:o,disableGutters:s,variant:a},u=uft(c);return C.jsx(fft,{as:o,className:Oe(u.root,i),ref:n,ownerState:c,...l})}),dft=ct(C.jsx("path",{d:"M15.41 16.09l-4.58-4.59 4.58-4.59L14 5.5l-6 6 6 6z"}),"KeyboardArrowLeft"),hft=ct(C.jsx("path",{d:"M8.59 16.34l4.58-4.59-4.58-4.59L10 5.75l6 6-6 6z"}),"KeyboardArrowRight");function pft(t){return Ye("MuiTableRow",t)}const the=He("MuiTableRow",["root","selected","hover","head","footer"]),gft=t=>{const{classes:e,selected:n,hover:r,head:i,footer:o}=t;return qe({root:["root",n&&"selected",r&&"hover",i&&"head",o&&"footer"]},pft,e)},mft=be("tr",{name:"MuiTableRow",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,n.head&&e.head,n.footer&&e.footer]}})(Tt(({theme:t})=>({color:"inherit",display:"table-row",verticalAlign:"middle",outline:0,[`&.${the.hover}:hover`]:{backgroundColor:(t.vars||t).palette.action.hover},[`&.${the.selected}`]:{backgroundColor:t.vars?`rgba(${t.vars.palette.primary.mainChannel} / ${t.vars.palette.action.selectedOpacity})`:kt(t.palette.primary.main,t.palette.action.selectedOpacity),"&:hover":{backgroundColor:t.vars?`rgba(${t.vars.palette.primary.mainChannel} / calc(${t.vars.palette.action.selectedOpacity} + ${t.vars.palette.action.hoverOpacity}))`:kt(t.palette.primary.main,t.palette.action.selectedOpacity+t.palette.action.hoverOpacity)}}}))),nhe="tr",Td=D.forwardRef(function(e,n){const r=wt({props:e,name:"MuiTableRow"}),{className:i,component:o=nhe,hover:s=!1,selected:a=!1,...l}=r,c=D.useContext(x4),u={...r,component:o,hover:s,selected:a,head:c&&c.variant==="head",footer:c&&c.variant==="footer"},f=gft(u);return C.jsx(mft,{as:o,ref:n,className:Oe(f.root,i),role:o===nhe?null:"row",ownerState:u,...l})});function vft(t){return(1+Math.sin(Math.PI*t-Math.PI/2))/2}function yft(t,e,n,r={},i=()=>{}){const{ease:o=vft,duration:s=300}=r;let a=null;const l=e[t];let c=!1;const u=()=>{c=!0},f=d=>{if(c){i(new Error("Animation cancelled"));return}a===null&&(a=d);const h=Math.min(1,(d-a)/s);if(e[t]=o(h)*(n-l)+l,h>=1){requestAnimationFrame(()=>{i(null)});return}requestAnimationFrame(f)};return l===n?(i(new Error("Element already at target position")),u):(requestAnimationFrame(f),u)}const xft={width:99,height:99,position:"absolute",top:-9999,overflow:"scroll"};function bft(t){const{onChange:e,...n}=t,r=D.useRef(),i=D.useRef(null),o=()=>{r.current=i.current.offsetHeight-i.current.clientHeight};return Ti(()=>{const s=kM(()=>{const l=r.current;o(),l!==r.current&&e(r.current)}),a=xc(i.current);return a.addEventListener("resize",s),()=>{s.clear(),a.removeEventListener("resize",s)}},[e]),D.useEffect(()=>{o(),e(r.current)},[e]),C.jsx("div",{style:xft,ref:i,...n})}function wft(t){return Ye("MuiTabScrollButton",t)}const _ft=He("MuiTabScrollButton",["root","vertical","horizontal","disabled"]),Sft=t=>{const{classes:e,orientation:n,disabled:r}=t;return qe({root:["root",n,r&&"disabled"]},wft,e)},Cft=be(Nf,{name:"MuiTabScrollButton",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,n.orientation&&e[n.orientation]]}})({width:40,flexShrink:0,opacity:.8,[`&.${_ft.disabled}`]:{opacity:0},variants:[{props:{orientation:"vertical"},style:{width:"100%",height:40,"& svg":{transform:"var(--TabScrollButton-svgRotate)"}}}]}),Oft=D.forwardRef(function(e,n){const r=wt({props:e,name:"MuiTabScrollButton"}),{className:i,slots:o={},slotProps:s={},direction:a,orientation:l,disabled:c,...u}=r,f=Ho(),d={isRtl:f,...r},h=Sft(d),p=o.StartScrollButtonIcon??dft,g=o.EndScrollButtonIcon??hft,m=Zt({elementType:p,externalSlotProps:s.startScrollButtonIcon,additionalProps:{fontSize:"small"},ownerState:d}),v=Zt({elementType:g,externalSlotProps:s.endScrollButtonIcon,additionalProps:{fontSize:"small"},ownerState:d});return C.jsx(Cft,{component:"div",className:Oe(h.root,i),ref:n,role:null,ownerState:d,tabIndex:null,...u,style:{...u.style,...l==="vertical"&&{"--TabScrollButton-svgRotate":`rotate(${f?-90:90}deg)`}},children:a==="left"?C.jsx(p,{...m}):C.jsx(g,{...v})})});function Eft(t){return Ye("MuiTabs",t)}const o3=He("MuiTabs",["root","vertical","flexContainer","flexContainerVertical","centered","scroller","fixed","scrollableX","scrollableY","hideScrollbar","scrollButtons","scrollButtonsHideMobile","indicator"]),rhe=(t,e)=>t===e?t.firstChild:e&&e.nextElementSibling?e.nextElementSibling:t.firstChild,ihe=(t,e)=>t===e?t.lastChild:e&&e.previousElementSibling?e.previousElementSibling:t.lastChild,oI=(t,e,n)=>{let r=!1,i=n(t,e);for(;i;){if(i===t.firstChild){if(r)return;r=!0}const o=i.disabled||i.getAttribute("aria-disabled")==="true";if(!i.hasAttribute("tabindex")||o)i=n(t,i);else{i.focus();return}}},Tft=t=>{const{vertical:e,fixed:n,hideScrollbar:r,scrollableX:i,scrollableY:o,centered:s,scrollButtonsHideMobile:a,classes:l}=t;return qe({root:["root",e&&"vertical"],scroller:["scroller",n&&"fixed",r&&"hideScrollbar",i&&"scrollableX",o&&"scrollableY"],flexContainer:["flexContainer",e&&"flexContainerVertical",s&&"centered"],indicator:["indicator"],scrollButtons:["scrollButtons",a&&"scrollButtonsHideMobile"],scrollableX:[i&&"scrollableX"],hideScrollbar:[r&&"hideScrollbar"]},Eft,l)},kft=be("div",{name:"MuiTabs",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[{[`& .${o3.scrollButtons}`]:e.scrollButtons},{[`& .${o3.scrollButtons}`]:n.scrollButtonsHideMobile&&e.scrollButtonsHideMobile},e.root,n.vertical&&e.vertical]}})(Tt(({theme:t})=>({overflow:"hidden",minHeight:48,WebkitOverflowScrolling:"touch",display:"flex",variants:[{props:({ownerState:e})=>e.vertical,style:{flexDirection:"column"}},{props:({ownerState:e})=>e.scrollButtonsHideMobile,style:{[`& .${o3.scrollButtons}`]:{[t.breakpoints.down("sm")]:{display:"none"}}}}]}))),Aft=be("div",{name:"MuiTabs",slot:"Scroller",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.scroller,n.fixed&&e.fixed,n.hideScrollbar&&e.hideScrollbar,n.scrollableX&&e.scrollableX,n.scrollableY&&e.scrollableY]}})({position:"relative",display:"inline-block",flex:"1 1 auto",whiteSpace:"nowrap",variants:[{props:({ownerState:t})=>t.fixed,style:{overflowX:"hidden",width:"100%"}},{props:({ownerState:t})=>t.hideScrollbar,style:{scrollbarWidth:"none","&::-webkit-scrollbar":{display:"none"}}},{props:({ownerState:t})=>t.scrollableX,style:{overflowX:"auto",overflowY:"hidden"}},{props:({ownerState:t})=>t.scrollableY,style:{overflowY:"auto",overflowX:"hidden"}}]}),Pft=be("div",{name:"MuiTabs",slot:"FlexContainer",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.flexContainer,n.vertical&&e.flexContainerVertical,n.centered&&e.centered]}})({display:"flex",variants:[{props:({ownerState:t})=>t.vertical,style:{flexDirection:"column"}},{props:({ownerState:t})=>t.centered,style:{justifyContent:"center"}}]}),Mft=be("span",{name:"MuiTabs",slot:"Indicator",overridesResolver:(t,e)=>e.indicator})(Tt(({theme:t})=>({position:"absolute",height:2,bottom:0,width:"100%",transition:t.transitions.create(),variants:[{props:{indicatorColor:"primary"},style:{backgroundColor:(t.vars||t).palette.primary.main}},{props:{indicatorColor:"secondary"},style:{backgroundColor:(t.vars||t).palette.secondary.main}},{props:({ownerState:e})=>e.vertical,style:{height:"100%",width:2,right:0}}]}))),Rft=be(bft)({overflowX:"auto",overflowY:"hidden",scrollbarWidth:"none","&::-webkit-scrollbar":{display:"none"}}),ohe={},Xee=D.forwardRef(function(e,n){const r=wt({props:e,name:"MuiTabs"}),i=$a(),o=Ho(),{"aria-label":s,"aria-labelledby":a,action:l,centered:c=!1,children:u,className:f,component:d="div",allowScrollButtonsMobile:h=!1,indicatorColor:p="primary",onChange:g,orientation:m="horizontal",ScrollButtonComponent:v=Oft,scrollButtons:y="auto",selectionFollowsFocus:x,slots:b={},slotProps:w={},TabIndicatorProps:_={},TabScrollButtonProps:S={},textColor:O="primary",value:k,variant:E="standard",visibleScrollbar:P=!1,...A}=r,R=E==="scrollable",T=m==="vertical",M=T?"scrollTop":"scrollLeft",I=T?"top":"left",j=T?"bottom":"right",N=T?"clientHeight":"clientWidth",z=T?"height":"width",L={...r,component:d,allowScrollButtonsMobile:h,indicatorColor:p,orientation:m,vertical:T,scrollButtons:y,textColor:O,variant:E,visibleScrollbar:P,fixed:!R,hideScrollbar:R&&!P,scrollableX:R&&!T,scrollableY:R&&T,centered:c&&!R,scrollButtonsHideMobile:!h},B=Tft(L),F=Zt({elementType:b.StartScrollButtonIcon,externalSlotProps:w.startScrollButtonIcon,ownerState:L}),$=Zt({elementType:b.EndScrollButtonIcon,externalSlotProps:w.endScrollButtonIcon,ownerState:L}),[q,G]=D.useState(!1),[Y,le]=D.useState(ohe),[K,ee]=D.useState(!1),[re,ge]=D.useState(!1),[te,ae]=D.useState(!1),[U,oe]=D.useState({overflow:"hidden",scrollbarWidth:0}),ne=new Map,V=D.useRef(null),X=D.useRef(null),Z=()=>{const Te=V.current;let Le;if(Te){const $e=Te.getBoundingClientRect();Le={clientWidth:Te.clientWidth,scrollLeft:Te.scrollLeft,scrollTop:Te.scrollTop,scrollWidth:Te.scrollWidth,top:$e.top,bottom:$e.bottom,left:$e.left,right:$e.right}}let ue;if(Te&&k!==!1){const $e=X.current.children;if($e.length>0){const Se=$e[ne.get(k)];ue=Se?Se.getBoundingClientRect():null}}return{tabsMeta:Le,tabMeta:ue}},he=st(()=>{const{tabsMeta:Te,tabMeta:Le}=Z();let ue=0,$e;T?($e="top",Le&&Te&&(ue=Le.top-Te.top+Te.scrollTop)):($e=o?"right":"left",Le&&Te&&(ue=(o?-1:1)*(Le[$e]-Te[$e]+Te.scrollLeft)));const Se={[$e]:ue,[z]:Le?Le[z]:0};if(typeof Y[$e]!="number"||typeof Y[z]!="number")le(Se);else{const Xe=Math.abs(Y[$e]-Se[$e]),tt=Math.abs(Y[z]-Se[z]);(Xe>=1||tt>=1)&&le(Se)}}),xe=(Te,{animation:Le=!0}={})=>{Le?yft(M,V.current,Te,{duration:i.transitions.duration.standard}):V.current[M]=Te},H=Te=>{let Le=V.current[M];T?Le+=Te:Le+=Te*(o?-1:1),xe(Le)},W=()=>{const Te=V.current[N];let Le=0;const ue=Array.from(X.current.children);for(let $e=0;$eTe){$e===0&&(Le=Te);break}Le+=Se[N]}return Le},J=()=>{H(-1*W())},se=()=>{H(W())},ye=D.useCallback(Te=>{oe({overflow:null,scrollbarWidth:Te})},[]),ie=()=>{const Te={};Te.scrollbarSizeListener=R?C.jsx(Rft,{onChange:ye,className:Oe(B.scrollableX,B.hideScrollbar)}):null;const ue=R&&(y==="auto"&&(K||re)||y===!0);return Te.scrollButtonStart=ue?C.jsx(v,{slots:{StartScrollButtonIcon:b.StartScrollButtonIcon},slotProps:{startScrollButtonIcon:F},orientation:m,direction:o?"right":"left",onClick:J,disabled:!K,...S,className:Oe(B.scrollButtons,S.className)}):null,Te.scrollButtonEnd=ue?C.jsx(v,{slots:{EndScrollButtonIcon:b.EndScrollButtonIcon},slotProps:{endScrollButtonIcon:$},orientation:m,direction:o?"left":"right",onClick:se,disabled:!re,...S,className:Oe(B.scrollButtons,S.className)}):null,Te},fe=st(Te=>{const{tabsMeta:Le,tabMeta:ue}=Z();if(!(!ue||!Le)){if(ue[I]Le[j]){const $e=Le[M]+(ue[j]-Le[j]);xe($e,{animation:Te})}}}),Q=st(()=>{R&&y!==!1&&ae(!te)});D.useEffect(()=>{const Te=kM(()=>{V.current&&he()});let Le;const ue=Xe=>{Xe.forEach(tt=>{tt.removedNodes.forEach(ut=>{Le==null||Le.unobserve(ut)}),tt.addedNodes.forEach(ut=>{Le==null||Le.observe(ut)})}),Te(),Q()},$e=xc(V.current);$e.addEventListener("resize",Te);let Se;return typeof ResizeObserver<"u"&&(Le=new ResizeObserver(Te),Array.from(X.current.children).forEach(Xe=>{Le.observe(Xe)})),typeof MutationObserver<"u"&&(Se=new MutationObserver(ue),Se.observe(X.current,{childList:!0})),()=>{Te.clear(),$e.removeEventListener("resize",Te),Se==null||Se.disconnect(),Le==null||Le.disconnect()}},[he,Q]),D.useEffect(()=>{const Te=Array.from(X.current.children),Le=Te.length;if(typeof IntersectionObserver<"u"&&Le>0&&R&&y!==!1){const ue=Te[0],$e=Te[Le-1],Se={root:V.current,threshold:.99},Xe=Dn=>{ee(!Dn[0].isIntersecting)},tt=new IntersectionObserver(Xe,Se);tt.observe(ue);const ut=Dn=>{ge(!Dn[0].isIntersecting)},qt=new IntersectionObserver(ut,Se);return qt.observe($e),()=>{tt.disconnect(),qt.disconnect()}}},[R,y,te,u==null?void 0:u.length]),D.useEffect(()=>{G(!0)},[]),D.useEffect(()=>{he()}),D.useEffect(()=>{fe(ohe!==Y)},[fe,Y]),D.useImperativeHandle(l,()=>({updateIndicator:he,updateScrollButtons:Q}),[he,Q]);const _e=C.jsx(Mft,{..._,className:Oe(B.indicator,_.className),ownerState:L,style:{...Y,..._.style}});let we=0;const Ie=D.Children.map(u,Te=>{if(!D.isValidElement(Te))return null;const Le=Te.props.value===void 0?we:Te.props.value;ne.set(Le,we);const ue=Le===k;return we+=1,D.cloneElement(Te,{fullWidth:E==="fullWidth",indicator:ue&&!q&&_e,selected:ue,selectionFollowsFocus:x,onChange:g,textColor:O,value:Le,...we===1&&k===!1&&!Te.props.tabIndex?{tabIndex:0}:{}})}),Pe=Te=>{const Le=X.current,ue=vi(Le).activeElement;if(ue.getAttribute("role")!=="tab")return;let Se=m==="horizontal"?"ArrowLeft":"ArrowUp",Xe=m==="horizontal"?"ArrowRight":"ArrowDown";switch(m==="horizontal"&&o&&(Se="ArrowRight",Xe="ArrowLeft"),Te.key){case Se:Te.preventDefault(),oI(Le,ue,ihe);break;case Xe:Te.preventDefault(),oI(Le,ue,rhe);break;case"Home":Te.preventDefault(),oI(Le,null,rhe);break;case"End":Te.preventDefault(),oI(Le,null,ihe);break}},Me=ie();return C.jsxs(kft,{className:Oe(B.root,f),ownerState:L,ref:n,as:d,...A,children:[Me.scrollButtonStart,Me.scrollbarSizeListener,C.jsxs(Aft,{className:B.scroller,ownerState:L,style:{overflow:U.overflow,[T?`margin${o?"Left":"Right"}`:"marginBottom"]:P?void 0:-U.scrollbarWidth},ref:V,children:[C.jsx(Pft,{"aria-label":s,"aria-labelledby":a,"aria-orientation":m==="vertical"?"vertical":null,className:B.flexContainer,ownerState:L,onKeyDown:Pe,ref:X,role:"tablist",children:Ie}),q&&_e]}),Me.scrollButtonEnd]})});function Dft(t){return Ye("MuiTextField",t)}He("MuiTextField",["root"]);const Ift={standard:Ag,filled:$F,outlined:FF},Lft=t=>{const{classes:e}=t;return qe({root:["root"]},Dft,e)},$ft=be(Ug,{name:"MuiTextField",slot:"Root",overridesResolver:(t,e)=>e.root})({}),di=D.forwardRef(function(e,n){const r=wt({props:e,name:"MuiTextField"}),{autoComplete:i,autoFocus:o=!1,children:s,className:a,color:l="primary",defaultValue:c,disabled:u=!1,error:f=!1,FormHelperTextProps:d,fullWidth:h=!1,helperText:p,id:g,InputLabelProps:m,inputProps:v,InputProps:y,inputRef:x,label:b,maxRows:w,minRows:_,multiline:S=!1,name:O,onBlur:k,onChange:E,onFocus:P,placeholder:A,required:R=!1,rows:T,select:M=!1,SelectProps:I,slots:j={},slotProps:N={},type:z,value:L,variant:B="outlined",...F}=r,$={...r,autoFocus:o,color:l,disabled:u,error:f,fullWidth:h,multiline:S,required:R,select:M,variant:B},q=Lft($),G=Jf(g),Y=p&&G?`${G}-helper-text`:void 0,le=b&&G?`${G}-label`:void 0,K=Ift[B],ee={slots:j,slotProps:{input:y,inputLabel:m,htmlInput:v,formHelperText:d,select:I,...N}},re={},ge=ee.slotProps.inputLabel;B==="outlined"&&(ge&&typeof ge.shrink<"u"&&(re.notched=ge.shrink),re.label=b),M&&((!I||!I.native)&&(re.id=void 0),re["aria-describedby"]=void 0);const[te,ae]=Zl("input",{elementType:K,externalForwardedProps:ee,additionalProps:re,ownerState:$}),[U,oe]=Zl("inputLabel",{elementType:Ly,externalForwardedProps:ee,ownerState:$}),[ne,V]=Zl("htmlInput",{elementType:"input",externalForwardedProps:ee,ownerState:$}),[X,Z]=Zl("formHelperText",{elementType:Uee,externalForwardedProps:ee,ownerState:$}),[he,xe]=Zl("select",{elementType:Wg,externalForwardedProps:ee,ownerState:$}),H=C.jsx(te,{"aria-describedby":Y,autoComplete:i,autoFocus:o,defaultValue:c,fullWidth:h,multiline:S,name:O,rows:T,maxRows:w,minRows:_,type:z,value:L,id:G,inputRef:x,onBlur:k,onChange:E,onFocus:P,placeholder:A,inputProps:V,slots:{input:j.htmlInput?ne:void 0},...ae});return C.jsxs($ft,{className:Oe(q.root,a),disabled:u,error:f,fullWidth:h,ref:n,required:R,color:l,variant:B,ownerState:$,...F,children:[b!=null&&b!==""&&C.jsx(U,{htmlFor:G,id:le,...oe,children:b}),M?C.jsx(he,{"aria-describedby":Y,id:G,labelId:le,value:L,input:H,...xe,children:s}):H,p&&C.jsx(X,{id:Y,...Z,children:p})]})});function Fft(t){return Ye("MuiToggleButton",t)}const cx=He("MuiToggleButton",["root","disabled","selected","standard","primary","secondary","sizeSmall","sizeMedium","sizeLarge","fullWidth"]),PPe=D.createContext({}),MPe=D.createContext(void 0);function Nft(t,e){return e===void 0||t===void 0?!1:Array.isArray(e)?e.includes(t):t===e}const zft=t=>{const{classes:e,fullWidth:n,selected:r,disabled:i,size:o,color:s}=t,a={root:["root",r&&"selected",i&&"disabled",n&&"fullWidth",`size${Re(o)}`,s]};return qe(a,Fft,e)},jft=be(Nf,{name:"MuiToggleButton",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,e[`size${Re(n.size)}`]]}})(Tt(({theme:t})=>({...t.typography.button,borderRadius:(t.vars||t).shape.borderRadius,padding:11,border:`1px solid ${(t.vars||t).palette.divider}`,color:(t.vars||t).palette.action.active,[`&.${cx.disabled}`]:{color:(t.vars||t).palette.action.disabled,border:`1px solid ${(t.vars||t).palette.action.disabledBackground}`},"&:hover":{textDecoration:"none",backgroundColor:t.vars?`rgba(${t.vars.palette.text.primaryChannel} / ${t.vars.palette.action.hoverOpacity})`:kt(t.palette.text.primary,t.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}},variants:[{props:{color:"standard"},style:{[`&.${cx.selected}`]:{color:(t.vars||t).palette.text.primary,backgroundColor:t.vars?`rgba(${t.vars.palette.text.primaryChannel} / ${t.vars.palette.action.selectedOpacity})`:kt(t.palette.text.primary,t.palette.action.selectedOpacity),"&:hover":{backgroundColor:t.vars?`rgba(${t.vars.palette.text.primaryChannel} / calc(${t.vars.palette.action.selectedOpacity} + ${t.vars.palette.action.hoverOpacity}))`:kt(t.palette.text.primary,t.palette.action.selectedOpacity+t.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:t.vars?`rgba(${t.vars.palette.text.primaryChannel} / ${t.vars.palette.action.selectedOpacity})`:kt(t.palette.text.primary,t.palette.action.selectedOpacity)}}}}},...Object.entries(t.palette).filter(ii()).map(([e])=>({props:{color:e},style:{[`&.${cx.selected}`]:{color:(t.vars||t).palette[e].main,backgroundColor:t.vars?`rgba(${t.vars.palette[e].mainChannel} / ${t.vars.palette.action.selectedOpacity})`:kt(t.palette[e].main,t.palette.action.selectedOpacity),"&:hover":{backgroundColor:t.vars?`rgba(${t.vars.palette[e].mainChannel} / calc(${t.vars.palette.action.selectedOpacity} + ${t.vars.palette.action.hoverOpacity}))`:kt(t.palette[e].main,t.palette.action.selectedOpacity+t.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:t.vars?`rgba(${t.vars.palette[e].mainChannel} / ${t.vars.palette.action.selectedOpacity})`:kt(t.palette[e].main,t.palette.action.selectedOpacity)}}}}})),{props:{fullWidth:!0},style:{width:"100%"}},{props:{size:"small"},style:{padding:7,fontSize:t.typography.pxToRem(13)}},{props:{size:"large"},style:{padding:15,fontSize:t.typography.pxToRem(15)}}]}))),yr=D.forwardRef(function(e,n){const{value:r,...i}=D.useContext(PPe),o=D.useContext(MPe),s=vS({...i,selected:Nft(e.value,r)},e),a=wt({props:s,name:"MuiToggleButton"}),{children:l,className:c,color:u="standard",disabled:f=!1,disableFocusRipple:d=!1,fullWidth:h=!1,onChange:p,onClick:g,selected:m,size:v="medium",value:y,...x}=a,b={...a,color:u,disabled:f,disableFocusRipple:d,fullWidth:h,size:v},w=zft(b),_=O=>{g&&(g(O,y),O.defaultPrevented)||p&&p(O,y)},S=o||"";return C.jsx(jft,{className:Oe(i.className,w.root,c,S),disabled:f,focusRipple:!d,ref:n,onClick:_,onChange:p,value:y,ownerState:b,"aria-pressed":m,...x,children:l})});function Bft(t){return Ye("MuiToggleButtonGroup",t)}const Hr=He("MuiToggleButtonGroup",["root","selected","horizontal","vertical","disabled","grouped","groupedHorizontal","groupedVertical","fullWidth","firstButton","lastButton","middleButton"]),Uft=t=>{const{classes:e,orientation:n,fullWidth:r,disabled:i}=t,o={root:["root",n,r&&"fullWidth"],grouped:["grouped",`grouped${Re(n)}`,i&&"disabled"],firstButton:["firstButton"],lastButton:["lastButton"],middleButton:["middleButton"]};return qe(o,Bft,e)},Wft=be("div",{name:"MuiToggleButtonGroup",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[{[`& .${Hr.grouped}`]:e.grouped},{[`& .${Hr.grouped}`]:e[`grouped${Re(n.orientation)}`]},{[`& .${Hr.firstButton}`]:e.firstButton},{[`& .${Hr.lastButton}`]:e.lastButton},{[`& .${Hr.middleButton}`]:e.middleButton},e.root,n.orientation==="vertical"&&e.vertical,n.fullWidth&&e.fullWidth]}})(Tt(({theme:t})=>({display:"inline-flex",borderRadius:(t.vars||t).shape.borderRadius,variants:[{props:{orientation:"vertical"},style:{flexDirection:"column",[`& .${Hr.grouped}`]:{[`&.${Hr.selected} + .${Hr.grouped}.${Hr.selected}`]:{borderTop:0,marginTop:0}},[`& .${Hr.firstButton},& .${Hr.middleButton}`]:{borderBottomLeftRadius:0,borderBottomRightRadius:0},[`& .${Hr.lastButton},& .${Hr.middleButton}`]:{marginTop:-1,borderTop:"1px solid transparent",borderTopLeftRadius:0,borderTopRightRadius:0},[`& .${Hr.lastButton}.${cx.disabled},& .${Hr.middleButton}.${cx.disabled}`]:{borderTop:"1px solid transparent"}}},{props:{fullWidth:!0},style:{width:"100%"}},{props:{orientation:"horizontal"},style:{[`& .${Hr.grouped}`]:{[`&.${Hr.selected} + .${Hr.grouped}.${Hr.selected}`]:{borderLeft:0,marginLeft:0}},[`& .${Hr.firstButton},& .${Hr.middleButton}`]:{borderTopRightRadius:0,borderBottomRightRadius:0},[`& .${Hr.lastButton},& .${Hr.middleButton}`]:{marginLeft:-1,borderLeft:"1px solid transparent",borderTopLeftRadius:0,borderBottomLeftRadius:0},[`& .${Hr.lastButton}.${cx.disabled},& .${Hr.middleButton}.${cx.disabled}`]:{borderLeft:"1px solid transparent"}}}]}))),QC=D.forwardRef(function(e,n){const r=wt({props:e,name:"MuiToggleButtonGroup"}),{children:i,className:o,color:s="standard",disabled:a=!1,exclusive:l=!1,fullWidth:c=!1,onChange:u,orientation:f="horizontal",size:d="medium",value:h,...p}=r,g={...r,disabled:a,fullWidth:c,orientation:f,size:d},m=Uft(g),v=D.useCallback((S,O)=>{if(!u)return;const k=h&&h.indexOf(O);let E;h&&k>=0?(E=h.slice(),E.splice(k,1)):E=h?h.concat(O):[O],u(S,E)},[u,h]),y=D.useCallback((S,O)=>{u&&u(S,h===O?null:O)},[u,h]),x=D.useMemo(()=>({className:m.grouped,onChange:l?y:v,value:h,size:d,fullWidth:c,color:s,disabled:a}),[m.grouped,l,y,v,h,d,c,s,a]),b=int(i),w=b.length,_=S=>{const O=S===0,k=S===w-1;return O&&k?"":O?m.firstButton:k?m.lastButton:m.middleButton};return C.jsx(Wft,{role:"group",className:Oe(m.root,o),ref:n,ownerState:g,...p,children:C.jsx(PPe.Provider,{value:x,children:b.map((S,O)=>C.jsx(MPe.Provider,{value:_(O),children:S},O))})})}),Vft="default",Gft={id:"local",name:"Local Server",url:"http://localhost:8080"},Hft={appBarTitle:"xcube Viewer",windowTitle:"xcube Viewer",windowIcon:null,compact:!1,themeName:"light",primaryColor:"blue",secondaryColor:"pink",organisationUrl:"https://xcube.readthedocs.io/",logoImage:"images/logo.png",logoWidth:32,baseMapUrl:"https://services.arcgisonline.com/arcgis/rest/services/World_Imagery/MapServer/tile/{z}/{y}/{x}",defaultAgg:"mean",polygonFillOpacity:.2,mapProjection:"EPSG:3857",allowDownloads:!0,allowRefresh:!0,allowUserVariables:!0,allow3D:!0},sI={name:Vft,server:Gft,branding:Hft};function qft(){const t=new URL(window.location.href),e=t.pathname.split("/"),n=e.length;return n>0?e[n-1]==="index.html"?new URL(e.slice(0,n-1).join("/"),window.location.origin):new URL(t.pathname,window.location.origin):new URL(window.location.origin)}const w4=qft();console.log("baseUrl = ",w4.href);function RPe(t,...e){let n=t;for(const r of e)r!==""&&(n.endsWith("/")?r.startsWith("/")?n+=r.substring(1):n+=r:r.startsWith("/")?n+=r:n+="/"+r);return n}const Xft={amber:Xke,blue:jm,blueGrey:IJe,brown:Yke,cyan:Vke,deepOrange:Tx,deepPurple:RJe,green:Mp,grey:Qke,indigo:Wke,lightBlue:Bm,lightGreen:DJe,lime:Hke,orange:q0,pink:Uke,purple:zm,red:Nm,teal:Gke,yellow:qke};function she(t,e){const n=t[e];let r=null;if(typeof n=="string"?(r=Xft[n]||null,r===null&&n.startsWith("#")&&(n.length===7||n.length===9)&&(r={main:n})):typeof n=="object"&&n!==null&&"main"in n&&(r=n),r!==null)t[e]=r;else throw new Error(`Value of branding.${e} is invalid: ${n}`)}function Yft(t,e,n){const r=t[e];typeof r=="string"&&(t[e]=RPe(w4.href,n,r))}function Qft(t,e){return t={...t},she(t,"primaryColor"),she(t,"secondaryColor"),Yft(t,"logoImage",e),t}function vr(t){return typeof t=="number"}function Kb(t){return typeof t=="string"}function Kft(t){return typeof t=="function"}function ahe(t){return t!==null&&typeof t=="object"&&t.constructor===Object}const tv=new URLSearchParams(window.location.search),af=class af{constructor(e,n,r,i){gn(this,"name");gn(this,"server");gn(this,"branding");gn(this,"authClient");this.name=e,this.server=n,this.branding=r,this.authClient=i}static async load(){let e=tv.get("configPath")||"config";const n=await this.loadRawConfig(e);n===sI&&(e="");const r=n.name||"default",i=this.getAuthConfig(n),o=this.getServerConfig(n),s=parseInt(tv.get("compact")||"0")!==0;let a=Qft({...sI.branding,...n.branding,compact:s||n.branding.compact},e);return a=che(a,"allowUserVariables"),a=che(a,"allow3D"),af._instance=new af(r,o,a,i),a.windowTitle&&this.changeWindowTitle(a.windowTitle),a.windowIcon&&this.changeWindowIcon(a.windowIcon),af._instance}static getAuthConfig(e){let n=e.authClient&&{...e.authClient};const r=af.getAuthClientFromEnv();if(!n&&r.authority&&r.clientId&&(n={authority:r.authority,client_id:r.clientId}),n){if(r.authority){const i=r.authority;n={...n,authority:i}}if(r.clientId){const i=r.clientId;n={...n,client_id:i}}if(r.audience){const i=r.audience,o=n.extraQueryParams;n={...n,extraQueryParams:{...o,audience:i}}}}return n}static getServerConfig(e){const n={...sI.server,...e.server},r=af.getApiServerFromEnv();return n.id=tv.get("serverId")||r.id||n.id,n.name=tv.get("serverName")||r.name||n.name,n.url=tv.get("serverUrl")||r.url||n.url,n}static async loadRawConfig(e){let n=null,r=null;const i=RPe(w4.href,e,"config.json");try{const o=await fetch(i);if(o.ok)n=await o.json();else{const{status:s,statusText:a}=o;r=`HTTP status ${s}`,a&&(r+=` (${a})`)}}catch(o){n=null,r=`${o}`}return n===null&&(n=sI),n}static get instance(){return af.assertConfigLoaded(),af._instance}static assertConfigLoaded(){if(!af._instance)throw new Error("internal error: configuration not available yet")}static changeWindowTitle(e){document.title=e}static changeWindowIcon(e){let n=document.querySelector('link[rel="icon"]');n!==null?n.href=e:(n=document.createElement("link"),n.rel="icon",n.href=e,document.head.appendChild(n))}static getAuthClientFromEnv(){return{authority:void 0,clientId:void 0,audience:void 0}}static getApiServerFromEnv(){return{id:void 0,name:void 0,url:void 0}}};gn(af,"_instance");let Pn=af;const Yee=[["red",Nm],["yellow",qke],["blue",jm],["pink",Uke],["lightBlue",Bm],["green",Mp],["orange",q0],["lime",Hke],["purple",zm],["indigo",Wke],["cyan",Vke],["brown",Yke],["teal",Gke]],Zft=(()=>{const t={};return Yee.forEach(([e,n])=>{t[e]=n}),t})(),lhe=Yee.map(([t,e])=>t);function Jft(t){return t==="light"?800:400}function rb(t){return lhe[t%lhe.length]}function DPe(t,e){const n=Jft(e);return Zft[t][n]}function Qee(t){return vr(t)||(t=Pn.instance.branding.polygonFillOpacity),vr(t)?t:.25}const edt={Mapbox:{param:"access_token",token:"pk.eyJ1IjoiZm9ybWFuIiwiYSI6ImNrM2JranV0bDBtenczb2szZG84djh6bWUifQ.q0UKwf4CWt5fcQwIDwF8Bg"}};function tdt(t){return edt[t]}function che(t,e){const n=tv.get(e),r=n?!!parseInt(n):!!t[e];return{...t,[e]:r}}function Q2(t){throw new Error('Could not dynamically require "'+t+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var aW={exports:{}};const ndt={},rdt=Object.freeze(Object.defineProperty({__proto__:null,default:ndt},Symbol.toStringTag,{value:"Module"})),idt=l2e(rdt);var uhe;function _4(){return uhe||(uhe=1,function(t,e){(function(n,r){t.exports=r()})(ei,function(){var n=n||function(r,i){var o;if(typeof window<"u"&&window.crypto&&(o=window.crypto),typeof self<"u"&&self.crypto&&(o=self.crypto),typeof globalThis<"u"&&globalThis.crypto&&(o=globalThis.crypto),!o&&typeof window<"u"&&window.msCrypto&&(o=window.msCrypto),!o&&typeof ei<"u"&&ei.crypto&&(o=ei.crypto),!o&&typeof Q2=="function")try{o=idt}catch{}var s=function(){if(o){if(typeof o.getRandomValues=="function")try{return o.getRandomValues(new Uint32Array(1))[0]}catch{}if(typeof o.randomBytes=="function")try{return o.randomBytes(4).readInt32LE()}catch{}}throw new Error("Native crypto module could not be used to get secure random number.")},a=Object.create||function(){function y(){}return function(x){var b;return y.prototype=x,b=new y,y.prototype=null,b}}(),l={},c=l.lib={},u=c.Base=function(){return{extend:function(y){var x=a(this);return y&&x.mixIn(y),(!x.hasOwnProperty("init")||this.init===x.init)&&(x.init=function(){x.$super.init.apply(this,arguments)}),x.init.prototype=x,x.$super=this,x},create:function(){var y=this.extend();return y.init.apply(y,arguments),y},init:function(){},mixIn:function(y){for(var x in y)y.hasOwnProperty(x)&&(this[x]=y[x]);y.hasOwnProperty("toString")&&(this.toString=y.toString)},clone:function(){return this.init.prototype.extend(this)}}}(),f=c.WordArray=u.extend({init:function(y,x){y=this.words=y||[],x!=i?this.sigBytes=x:this.sigBytes=y.length*4},toString:function(y){return(y||h).stringify(this)},concat:function(y){var x=this.words,b=y.words,w=this.sigBytes,_=y.sigBytes;if(this.clamp(),w%4)for(var S=0;S<_;S++){var O=b[S>>>2]>>>24-S%4*8&255;x[w+S>>>2]|=O<<24-(w+S)%4*8}else for(var k=0;k<_;k+=4)x[w+k>>>2]=b[k>>>2];return this.sigBytes+=_,this},clamp:function(){var y=this.words,x=this.sigBytes;y[x>>>2]&=4294967295<<32-x%4*8,y.length=r.ceil(x/4)},clone:function(){var y=u.clone.call(this);return y.words=this.words.slice(0),y},random:function(y){for(var x=[],b=0;b>>2]>>>24-_%4*8&255;w.push((S>>>4).toString(16)),w.push((S&15).toString(16))}return w.join("")},parse:function(y){for(var x=y.length,b=[],w=0;w>>3]|=parseInt(y.substr(w,2),16)<<24-w%8*4;return new f.init(b,x/2)}},p=d.Latin1={stringify:function(y){for(var x=y.words,b=y.sigBytes,w=[],_=0;_>>2]>>>24-_%4*8&255;w.push(String.fromCharCode(S))}return w.join("")},parse:function(y){for(var x=y.length,b=[],w=0;w>>2]|=(y.charCodeAt(w)&255)<<24-w%4*8;return new f.init(b,x)}},g=d.Utf8={stringify:function(y){try{return decodeURIComponent(escape(p.stringify(y)))}catch{throw new Error("Malformed UTF-8 data")}},parse:function(y){return p.parse(unescape(encodeURIComponent(y)))}},m=c.BufferedBlockAlgorithm=u.extend({reset:function(){this._data=new f.init,this._nDataBytes=0},_append:function(y){typeof y=="string"&&(y=g.parse(y)),this._data.concat(y),this._nDataBytes+=y.sigBytes},_process:function(y){var x,b=this._data,w=b.words,_=b.sigBytes,S=this.blockSize,O=S*4,k=_/O;y?k=r.ceil(k):k=r.max((k|0)-this._minBufferSize,0);var E=k*S,P=r.min(E*4,_);if(E){for(var A=0;A>>7)^(k<<14|k>>>18)^k>>>3,P=f[O-2],A=(P<<15|P>>>17)^(P<<13|P>>>19)^P>>>10;f[O]=E+f[O-7]+A+f[O-16]}var R=b&w^~b&_,T=m&v^m&y^v&y,M=(m<<30|m>>>2)^(m<<19|m>>>13)^(m<<10|m>>>22),I=(b<<26|b>>>6)^(b<<21|b>>>11)^(b<<7|b>>>25),j=S+I+R+u[O]+f[O],N=M+T;S=_,_=w,w=b,b=x+j|0,x=y,y=v,v=m,m=j+N|0}g[0]=g[0]+m|0,g[1]=g[1]+v|0,g[2]=g[2]+y|0,g[3]=g[3]+x|0,g[4]=g[4]+b|0,g[5]=g[5]+w|0,g[6]=g[6]+_|0,g[7]=g[7]+S|0},_doFinalize:function(){var h=this._data,p=h.words,g=this._nDataBytes*8,m=h.sigBytes*8;return p[m>>>5]|=128<<24-m%32,p[(m+64>>>9<<4)+14]=r.floor(g/4294967296),p[(m+64>>>9<<4)+15]=g,h.sigBytes=p.length*4,this._process(),this._hash},clone:function(){var h=a.clone.call(this);return h._hash=this._hash.clone(),h}});i.SHA256=a._createHelper(d),i.HmacSHA256=a._createHmacHelper(d)}(Math),n.SHA256})})(IPe);var adt=IPe.exports;const ldt=sn(adt);var LPe={exports:{}};(function(t,e){(function(n,r){t.exports=r(_4())})(ei,function(n){return function(){var r=n,i=r.lib,o=i.WordArray,s=r.enc;s.Base64={stringify:function(l){var c=l.words,u=l.sigBytes,f=this._map;l.clamp();for(var d=[],h=0;h>>2]>>>24-h%4*8&255,g=c[h+1>>>2]>>>24-(h+1)%4*8&255,m=c[h+2>>>2]>>>24-(h+2)%4*8&255,v=p<<16|g<<8|m,y=0;y<4&&h+y*.75>>6*(3-y)&63));var x=f.charAt(64);if(x)for(;d.length%4;)d.push(x);return d.join("")},parse:function(l){var c=l.length,u=this._map,f=this._reverseMap;if(!f){f=this._reverseMap=[];for(var d=0;d>>6-h%4*2,m=p|g;f[d>>>2]|=m<<24-d%4*8,d++}return o.create(f,d)}}(),n.enc.Base64})})(LPe);var cdt=LPe.exports;const fhe=sn(cdt);var $Pe={exports:{}};(function(t,e){(function(n,r){t.exports=r(_4())})(ei,function(n){return n.enc.Utf8})})($Pe);var udt=$Pe.exports;const fdt=sn(udt);function uq(t){this.message=t}uq.prototype=new Error,uq.prototype.name="InvalidCharacterError";var dhe=typeof window<"u"&&window.atob&&window.atob.bind(window)||function(t){var e=String(t).replace(/=+$/,"");if(e.length%4==1)throw new uq("'atob' failed: The string to be decoded is not correctly encoded.");for(var n,r,i=0,o=0,s="";r=e.charAt(o++);~r&&(n=i%4?64*n+r:r,i++%4)?s+=String.fromCharCode(255&n>>(-2*i&6)):0)r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(r);return s};function ddt(t){var e=t.replace(/-/g,"+").replace(/_/g,"/");switch(e.length%4){case 0:break;case 2:e+="==";break;case 3:e+="=";break;default:throw"Illegal base64url string!"}try{return function(n){return decodeURIComponent(dhe(n).replace(/(.)/g,function(r,i){var o=i.charCodeAt(0).toString(16).toUpperCase();return o.length<2&&(o="0"+o),"%"+o}))}(e)}catch{return dhe(e)}}function zF(t){this.message=t}function hdt(t,e){if(typeof t!="string")throw new zF("Invalid token specified");var n=(e=e||{}).header===!0?0:1;try{return JSON.parse(ddt(t.split(".")[n]))}catch(r){throw new zF("Invalid token specified: "+r.message)}}zF.prototype=new Error,zF.prototype.name="InvalidTokenError";var pdt={debug:()=>{},info:()=>{},warn:()=>{},error:()=>{}},Cd,Od,jF=(t=>(t[t.NONE=0]="NONE",t[t.ERROR=1]="ERROR",t[t.WARN=2]="WARN",t[t.INFO=3]="INFO",t[t.DEBUG=4]="DEBUG",t))(jF||{});(t=>{function e(){Cd=3,Od=pdt}t.reset=e;function n(i){if(!(0<=i&&i<=4))throw new Error("Invalid log level");Cd=i}t.setLevel=n;function r(i){Od=i}t.setLogger=r})(jF||(jF={}));var on=class{constructor(t){this._name=t}debug(...t){Cd>=4&&Od.debug(on._format(this._name,this._method),...t)}info(...t){Cd>=3&&Od.info(on._format(this._name,this._method),...t)}warn(...t){Cd>=2&&Od.warn(on._format(this._name,this._method),...t)}error(...t){Cd>=1&&Od.error(on._format(this._name,this._method),...t)}throw(t){throw this.error(t),t}create(t){const e=Object.create(this);return e._method=t,e.debug("begin"),e}static createStatic(t,e){const n=new on(`${t}.${e}`);return n.debug("begin"),n}static _format(t,e){const n=`[${t}]`;return e?`${n} ${e}:`:n}static debug(t,...e){Cd>=4&&Od.debug(on._format(t),...e)}static info(t,...e){Cd>=3&&Od.info(on._format(t),...e)}static warn(t,...e){Cd>=2&&Od.warn(on._format(t),...e)}static error(t,...e){Cd>=1&&Od.error(on._format(t),...e)}};jF.reset();var gdt="10000000-1000-4000-8000-100000000000",qd=class{static _randomWord(){return sdt.lib.WordArray.random(1).words[0]}static generateUUIDv4(){return gdt.replace(/[018]/g,e=>(+e^qd._randomWord()&15>>+e/4).toString(16)).replace(/-/g,"")}static generateCodeVerifier(){return qd.generateUUIDv4()+qd.generateUUIDv4()+qd.generateUUIDv4()}static generateCodeChallenge(t){try{const e=ldt(t);return fhe.stringify(e).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}catch(e){throw on.error("CryptoUtils.generateCodeChallenge",e),e}}static generateBasicAuth(t,e){const n=fdt.parse([t,e].join(":"));return fhe.stringify(n)}},Um=class{constructor(e){this._name=e,this._logger=new on(`Event('${this._name}')`),this._callbacks=[]}addHandler(e){return this._callbacks.push(e),()=>this.removeHandler(e)}removeHandler(e){const n=this._callbacks.lastIndexOf(e);n>=0&&this._callbacks.splice(n,1)}raise(...e){this._logger.debug("raise:",...e);for(const n of this._callbacks)n(...e)}},fq=class{static decode(t){try{return hdt(t)}catch(e){throw on.error("JwtUtils.decode",e),e}}},hhe=class{static center({...t}){var e,n,r;return t.width==null&&(t.width=(e=[800,720,600,480].find(i=>i<=window.outerWidth/1.618))!=null?e:360),(n=t.left)!=null||(t.left=Math.max(0,Math.round(window.screenX+(window.outerWidth-t.width)/2))),t.height!=null&&((r=t.top)!=null||(t.top=Math.max(0,Math.round(window.screenY+(window.outerHeight-t.height)/2)))),t}static serialize(t){return Object.entries(t).filter(([,e])=>e!=null).map(([e,n])=>`${e}=${typeof n!="boolean"?n:n?"yes":"no"}`).join(",")}},hu=class extends Um{constructor(){super(...arguments),this._logger=new on(`Timer('${this._name}')`),this._timerHandle=null,this._expiration=0,this._callback=()=>{const e=this._expiration-hu.getEpochTime();this._logger.debug("timer completes in",e),this._expiration<=hu.getEpochTime()&&(this.cancel(),super.raise())}}static getEpochTime(){return Math.floor(Date.now()/1e3)}init(e){const n=this._logger.create("init");e=Math.max(Math.floor(e),1);const r=hu.getEpochTime()+e;if(this.expiration===r&&this._timerHandle){n.debug("skipping since already initialized for expiration at",this.expiration);return}this.cancel(),n.debug("using duration",e),this._expiration=r;const i=Math.min(e,5);this._timerHandle=setInterval(this._callback,i*1e3)}get expiration(){return this._expiration}cancel(){this._logger.create("cancel"),this._timerHandle&&(clearInterval(this._timerHandle),this._timerHandle=null)}},dq=class{static readParams(t,e="query"){if(!t)throw new TypeError("Invalid URL");const r=new URL(t,"http://127.0.0.1")[e==="fragment"?"hash":"search"];return new URLSearchParams(r.slice(1))}},ib=class extends Error{constructor(t,e){var n,r,i;if(super(t.error_description||t.error||""),this.form=e,this.name="ErrorResponse",!t.error)throw on.error("ErrorResponse","No error passed"),new Error("No error passed");this.error=t.error,this.error_description=(n=t.error_description)!=null?n:null,this.error_uri=(r=t.error_uri)!=null?r:null,this.state=t.userState,this.session_state=(i=t.session_state)!=null?i:null}},Kee=class extends Error{constructor(t){super(t),this.name="ErrorTimeout"}},mdt=class{constructor(t){this._logger=new on("AccessTokenEvents"),this._expiringTimer=new hu("Access token expiring"),this._expiredTimer=new hu("Access token expired"),this._expiringNotificationTimeInSeconds=t.expiringNotificationTimeInSeconds}load(t){const e=this._logger.create("load");if(t.access_token&&t.expires_in!==void 0){const n=t.expires_in;if(e.debug("access token present, remaining duration:",n),n>0){let i=n-this._expiringNotificationTimeInSeconds;i<=0&&(i=1),e.debug("registering expiring timer, raising in",i,"seconds"),this._expiringTimer.init(i)}else e.debug("canceling existing expiring timer because we're past expiration."),this._expiringTimer.cancel();const r=n+1;e.debug("registering expired timer, raising in",r,"seconds"),this._expiredTimer.init(r)}else this._expiringTimer.cancel(),this._expiredTimer.cancel()}unload(){this._logger.debug("unload: canceling existing access token timers"),this._expiringTimer.cancel(),this._expiredTimer.cancel()}addAccessTokenExpiring(t){return this._expiringTimer.addHandler(t)}removeAccessTokenExpiring(t){this._expiringTimer.removeHandler(t)}addAccessTokenExpired(t){return this._expiredTimer.addHandler(t)}removeAccessTokenExpired(t){this._expiredTimer.removeHandler(t)}},vdt=class{constructor(t,e,n,r,i){this._callback=t,this._client_id=e,this._intervalInSeconds=r,this._stopOnError=i,this._logger=new on("CheckSessionIFrame"),this._timer=null,this._session_state=null,this._message=s=>{s.origin===this._frame_origin&&s.source===this._frame.contentWindow&&(s.data==="error"?(this._logger.error("error message from check session op iframe"),this._stopOnError&&this.stop()):s.data==="changed"?(this._logger.debug("changed message from check session op iframe"),this.stop(),this._callback()):this._logger.debug(s.data+" message from check session op iframe"))};const o=new URL(n);this._frame_origin=o.origin,this._frame=window.document.createElement("iframe"),this._frame.style.visibility="hidden",this._frame.style.position="fixed",this._frame.style.left="-1000px",this._frame.style.top="0",this._frame.width="0",this._frame.height="0",this._frame.src=o.href}load(){return new Promise(t=>{this._frame.onload=()=>{t()},window.document.body.appendChild(this._frame),window.addEventListener("message",this._message,!1)})}start(t){if(this._session_state===t)return;this._logger.create("start"),this.stop(),this._session_state=t;const e=()=>{!this._frame.contentWindow||!this._session_state||this._frame.contentWindow.postMessage(this._client_id+" "+this._session_state,this._frame_origin)};e(),this._timer=setInterval(e,this._intervalInSeconds*1e3)}stop(){this._logger.create("stop"),this._session_state=null,this._timer&&(clearInterval(this._timer),this._timer=null)}},FPe=class{constructor(){this._logger=new on("InMemoryWebStorage"),this._data={}}clear(){this._logger.create("clear"),this._data={}}getItem(t){return this._logger.create(`getItem('${t}')`),this._data[t]}setItem(t,e){this._logger.create(`setItem('${t}')`),this._data[t]=e}removeItem(t){this._logger.create(`removeItem('${t}')`),delete this._data[t]}get length(){return Object.getOwnPropertyNames(this._data).length}key(t){return Object.getOwnPropertyNames(this._data)[t]}},Zee=class{constructor(t=[],e=null,n={}){this._jwtHandler=e,this._extraHeaders=n,this._logger=new on("JsonService"),this._contentTypes=[],this._contentTypes.push(...t,"application/json"),e&&this._contentTypes.push("application/jwt")}async fetchWithTimeout(t,e={}){const{timeoutInSeconds:n,...r}=e;if(!n)return await fetch(t,r);const i=new AbortController,o=setTimeout(()=>i.abort(),n*1e3);try{return await fetch(t,{...e,signal:i.signal})}catch(s){throw s instanceof DOMException&&s.name==="AbortError"?new Kee("Network timed out"):s}finally{clearTimeout(o)}}async getJson(t,{token:e,credentials:n}={}){const r=this._logger.create("getJson"),i={Accept:this._contentTypes.join(", ")};e&&(r.debug("token passed, setting Authorization header"),i.Authorization="Bearer "+e),this.appendExtraHeaders(i);let o;try{r.debug("url:",t),o=await this.fetchWithTimeout(t,{method:"GET",headers:i,credentials:n})}catch(l){throw r.error("Network Error"),l}r.debug("HTTP response received, status",o.status);const s=o.headers.get("Content-Type");if(s&&!this._contentTypes.find(l=>s.startsWith(l))&&r.throw(new Error(`Invalid response Content-Type: ${s??"undefined"}, from URL: ${t}`)),o.ok&&this._jwtHandler&&(s!=null&&s.startsWith("application/jwt")))return await this._jwtHandler(await o.text());let a;try{a=await o.json()}catch(l){throw r.error("Error parsing JSON response",l),o.ok?l:new Error(`${o.statusText} (${o.status})`)}if(!o.ok)throw r.error("Error from server:",a),a.error?new ib(a):new Error(`${o.statusText} (${o.status}): ${JSON.stringify(a)}`);return a}async postForm(t,{body:e,basicAuth:n,timeoutInSeconds:r,initCredentials:i}){const o=this._logger.create("postForm"),s={Accept:this._contentTypes.join(", "),"Content-Type":"application/x-www-form-urlencoded"};n!==void 0&&(s.Authorization="Basic "+n),this.appendExtraHeaders(s);let a;try{o.debug("url:",t),a=await this.fetchWithTimeout(t,{method:"POST",headers:s,body:e,timeoutInSeconds:r,credentials:i})}catch(f){throw o.error("Network error"),f}o.debug("HTTP response received, status",a.status);const l=a.headers.get("Content-Type");if(l&&!this._contentTypes.find(f=>l.startsWith(f)))throw new Error(`Invalid response Content-Type: ${l??"undefined"}, from URL: ${t}`);const c=await a.text();let u={};if(c)try{u=JSON.parse(c)}catch(f){throw o.error("Error parsing JSON response",f),a.ok?f:new Error(`${a.statusText} (${a.status})`)}if(!a.ok)throw o.error("Error from server:",u),u.error?new ib(u,e):new Error(`${a.statusText} (${a.status}): ${JSON.stringify(u)}`);return u}appendExtraHeaders(t){const e=this._logger.create("appendExtraHeaders"),n=Object.keys(this._extraHeaders),r=["authorization","accept","content-type"];n.length!==0&&n.forEach(i=>{if(r.includes(i.toLocaleLowerCase())){e.warn("Protected header could not be overridden",i,r);return}const o=typeof this._extraHeaders[i]=="function"?this._extraHeaders[i]():this._extraHeaders[i];o&&o!==""&&(t[i]=o)})}},ydt=class{constructor(t){this._settings=t,this._logger=new on("MetadataService"),this._signingKeys=null,this._metadata=null,this._metadataUrl=this._settings.metadataUrl,this._jsonService=new Zee(["application/jwk-set+json"],null,this._settings.extraHeaders),this._settings.signingKeys&&(this._logger.debug("using signingKeys from settings"),this._signingKeys=this._settings.signingKeys),this._settings.metadata&&(this._logger.debug("using metadata from settings"),this._metadata=this._settings.metadata),this._settings.fetchRequestCredentials&&(this._logger.debug("using fetchRequestCredentials from settings"),this._fetchRequestCredentials=this._settings.fetchRequestCredentials)}resetSigningKeys(){this._signingKeys=null}async getMetadata(){const t=this._logger.create("getMetadata");if(this._metadata)return t.debug("using cached values"),this._metadata;if(!this._metadataUrl)throw t.throw(new Error("No authority or metadataUrl configured on settings")),null;t.debug("getting metadata from",this._metadataUrl);const e=await this._jsonService.getJson(this._metadataUrl,{credentials:this._fetchRequestCredentials});return t.debug("merging remote JSON with seed metadata"),this._metadata=Object.assign({},this._settings.metadataSeed,e),this._metadata}getIssuer(){return this._getMetadataProperty("issuer")}getAuthorizationEndpoint(){return this._getMetadataProperty("authorization_endpoint")}getUserInfoEndpoint(){return this._getMetadataProperty("userinfo_endpoint")}getTokenEndpoint(t=!0){return this._getMetadataProperty("token_endpoint",t)}getCheckSessionIframe(){return this._getMetadataProperty("check_session_iframe",!0)}getEndSessionEndpoint(){return this._getMetadataProperty("end_session_endpoint",!0)}getRevocationEndpoint(t=!0){return this._getMetadataProperty("revocation_endpoint",t)}getKeysEndpoint(t=!0){return this._getMetadataProperty("jwks_uri",t)}async _getMetadataProperty(t,e=!1){const n=this._logger.create(`_getMetadataProperty('${t}')`),r=await this.getMetadata();if(n.debug("resolved"),r[t]===void 0){if(e===!0){n.warn("Metadata does not contain optional property");return}n.throw(new Error("Metadata does not contain property "+t))}return r[t]}async getSigningKeys(){const t=this._logger.create("getSigningKeys");if(this._signingKeys)return t.debug("returning signingKeys from cache"),this._signingKeys;const e=await this.getKeysEndpoint(!1);t.debug("got jwks_uri",e);const n=await this._jsonService.getJson(e);if(t.debug("got key set",n),!Array.isArray(n.keys))throw t.throw(new Error("Missing keys on keyset")),null;return this._signingKeys=n.keys,this._signingKeys}},NPe=class{constructor({prefix:t="oidc.",store:e=localStorage}={}){this._logger=new on("WebStorageStateStore"),this._store=e,this._prefix=t}async set(t,e){this._logger.create(`set('${t}')`),t=this._prefix+t,await this._store.setItem(t,e)}async get(t){return this._logger.create(`get('${t}')`),t=this._prefix+t,await this._store.getItem(t)}async remove(t){this._logger.create(`remove('${t}')`),t=this._prefix+t;const e=await this._store.getItem(t);return await this._store.removeItem(t),e}async getAllKeys(){this._logger.create("getAllKeys");const t=await this._store.length,e=[];for(let n=0;n{const r=this._logger.create("_getClaimsFromJwt");try{const i=fq.decode(n);return r.debug("JWT decoding successful"),i}catch(i){throw r.error("Error parsing JWT response"),i}},this._jsonService=new Zee(void 0,this._getClaimsFromJwt,this._settings.extraHeaders)}async getClaims(t){const e=this._logger.create("getClaims");t||this._logger.throw(new Error("No token passed"));const n=await this._metadataService.getUserInfoEndpoint();e.debug("got userinfo url",n);const r=await this._jsonService.getJson(n,{token:t,credentials:this._settings.fetchRequestCredentials});return e.debug("got claims",r),r}},jPe=class{constructor(t,e){this._settings=t,this._metadataService=e,this._logger=new on("TokenClient"),this._jsonService=new Zee(this._settings.revokeTokenAdditionalContentTypes,null,this._settings.extraHeaders)}async exchangeCode({grant_type:t="authorization_code",redirect_uri:e=this._settings.redirect_uri,client_id:n=this._settings.client_id,client_secret:r=this._settings.client_secret,...i}){const o=this._logger.create("exchangeCode");n||o.throw(new Error("A client_id is required")),e||o.throw(new Error("A redirect_uri is required")),i.code||o.throw(new Error("A code is required"));const s=new URLSearchParams({grant_type:t,redirect_uri:e});for(const[u,f]of Object.entries(i))f!=null&&s.set(u,f);let a;switch(this._settings.client_authentication){case"client_secret_basic":if(!r)throw o.throw(new Error("A client_secret is required")),null;a=qd.generateBasicAuth(n,r);break;case"client_secret_post":s.append("client_id",n),r&&s.append("client_secret",r);break}const l=await this._metadataService.getTokenEndpoint(!1);o.debug("got token endpoint");const c=await this._jsonService.postForm(l,{body:s,basicAuth:a,initCredentials:this._settings.fetchRequestCredentials});return o.debug("got response"),c}async exchangeCredentials({grant_type:t="password",client_id:e=this._settings.client_id,client_secret:n=this._settings.client_secret,scope:r=this._settings.scope,...i}){const o=this._logger.create("exchangeCredentials");e||o.throw(new Error("A client_id is required"));const s=new URLSearchParams({grant_type:t,scope:r});for(const[u,f]of Object.entries(i))f!=null&&s.set(u,f);let a;switch(this._settings.client_authentication){case"client_secret_basic":if(!n)throw o.throw(new Error("A client_secret is required")),null;a=qd.generateBasicAuth(e,n);break;case"client_secret_post":s.append("client_id",e),n&&s.append("client_secret",n);break}const l=await this._metadataService.getTokenEndpoint(!1);o.debug("got token endpoint");const c=await this._jsonService.postForm(l,{body:s,basicAuth:a,initCredentials:this._settings.fetchRequestCredentials});return o.debug("got response"),c}async exchangeRefreshToken({grant_type:t="refresh_token",client_id:e=this._settings.client_id,client_secret:n=this._settings.client_secret,timeoutInSeconds:r,...i}){const o=this._logger.create("exchangeRefreshToken");e||o.throw(new Error("A client_id is required")),i.refresh_token||o.throw(new Error("A refresh_token is required"));const s=new URLSearchParams({grant_type:t});for(const[u,f]of Object.entries(i))f!=null&&s.set(u,f);let a;switch(this._settings.client_authentication){case"client_secret_basic":if(!n)throw o.throw(new Error("A client_secret is required")),null;a=qd.generateBasicAuth(e,n);break;case"client_secret_post":s.append("client_id",e),n&&s.append("client_secret",n);break}const l=await this._metadataService.getTokenEndpoint(!1);o.debug("got token endpoint");const c=await this._jsonService.postForm(l,{body:s,basicAuth:a,timeoutInSeconds:r,initCredentials:this._settings.fetchRequestCredentials});return o.debug("got response"),c}async revoke(t){var e;const n=this._logger.create("revoke");t.token||n.throw(new Error("A token is required"));const r=await this._metadataService.getRevocationEndpoint(!1);n.debug(`got revocation endpoint, revoking ${(e=t.token_type_hint)!=null?e:"default token type"}`);const i=new URLSearchParams;for(const[o,s]of Object.entries(t))s!=null&&i.set(o,s);i.set("client_id",this._settings.client_id),this._settings.client_secret&&i.set("client_secret",this._settings.client_secret),await this._jsonService.postForm(r,{body:i}),n.debug("got response")}},Edt=class{constructor(t,e,n){this._settings=t,this._metadataService=e,this._claimsService=n,this._logger=new on("ResponseValidator"),this._userInfoService=new Odt(this._settings,this._metadataService),this._tokenClient=new jPe(this._settings,this._metadataService)}async validateSigninResponse(t,e){const n=this._logger.create("validateSigninResponse");this._processSigninState(t,e),n.debug("state processed"),await this._processCode(t,e),n.debug("code processed"),t.isOpenId&&this._validateIdTokenAttributes(t),n.debug("tokens validated"),await this._processClaims(t,e==null?void 0:e.skipUserInfo,t.isOpenId),n.debug("claims processed")}async validateCredentialsResponse(t,e){const n=this._logger.create("validateCredentialsResponse");t.isOpenId&&this._validateIdTokenAttributes(t),n.debug("tokens validated"),await this._processClaims(t,e,t.isOpenId),n.debug("claims processed")}async validateRefreshResponse(t,e){var n,r;const i=this._logger.create("validateRefreshResponse");t.userState=e.data,(n=t.session_state)!=null||(t.session_state=e.session_state),(r=t.scope)!=null||(t.scope=e.scope),t.isOpenId&&t.id_token&&(this._validateIdTokenAttributes(t,e.id_token),i.debug("ID Token validated")),t.id_token||(t.id_token=e.id_token,t.profile=e.profile);const o=t.isOpenId&&!!t.id_token;await this._processClaims(t,!1,o),i.debug("claims processed")}validateSignoutResponse(t,e){const n=this._logger.create("validateSignoutResponse");if(e.id!==t.state&&n.throw(new Error("State does not match")),n.debug("state validated"),t.userState=e.data,t.error)throw n.warn("Response was error",t.error),new ib(t)}_processSigninState(t,e){var n;const r=this._logger.create("_processSigninState");if(e.id!==t.state&&r.throw(new Error("State does not match")),e.client_id||r.throw(new Error("No client_id on state")),e.authority||r.throw(new Error("No authority on state")),this._settings.authority!==e.authority&&r.throw(new Error("authority mismatch on settings vs. signin state")),this._settings.client_id&&this._settings.client_id!==e.client_id&&r.throw(new Error("client_id mismatch on settings vs. signin state")),r.debug("state validated"),t.userState=e.data,(n=t.scope)!=null||(t.scope=e.scope),t.error)throw r.warn("Response was error",t.error),new ib(t);e.code_verifier&&!t.code&&r.throw(new Error("Expected code in response"))}async _processClaims(t,e=!1,n=!0){const r=this._logger.create("_processClaims");if(t.profile=this._claimsService.filterProtocolClaims(t.profile),e||!this._settings.loadUserInfo||!t.access_token){r.debug("not loading user info");return}r.debug("loading user info");const i=await this._userInfoService.getClaims(t.access_token);r.debug("user info claims received from user info endpoint"),n&&i.sub!==t.profile.sub&&r.throw(new Error("subject from UserInfo response does not match subject in ID Token")),t.profile=this._claimsService.mergeClaims(t.profile,this._claimsService.filterProtocolClaims(i)),r.debug("user info claims received, updated profile:",t.profile)}async _processCode(t,e){const n=this._logger.create("_processCode");if(t.code){n.debug("Validating code");const r=await this._tokenClient.exchangeCode({client_id:e.client_id,client_secret:e.client_secret,code:t.code,redirect_uri:e.redirect_uri,code_verifier:e.code_verifier,...e.extraTokenParams});Object.assign(t,r)}else n.debug("No code to process")}_validateIdTokenAttributes(t,e){var n;const r=this._logger.create("_validateIdTokenAttributes");r.debug("decoding ID Token JWT");const i=fq.decode((n=t.id_token)!=null?n:"");if(i.sub||r.throw(new Error("ID Token is missing a subject claim")),e){const o=fq.decode(e);i.sub!==o.sub&&r.throw(new Error("sub in id_token does not match current sub")),i.auth_time&&i.auth_time!==o.auth_time&&r.throw(new Error("auth_time in id_token does not match original auth_time")),i.azp&&i.azp!==o.azp&&r.throw(new Error("azp in id_token does not match original azp")),!i.azp&&o.azp&&r.throw(new Error("azp not in id_token, but present in original id_token"))}t.profile=i}},CS=class{constructor(t){this.id=t.id||qd.generateUUIDv4(),this.data=t.data,t.created&&t.created>0?this.created=t.created:this.created=hu.getEpochTime(),this.request_type=t.request_type}toStorageString(){return new on("State").create("toStorageString"),JSON.stringify({id:this.id,data:this.data,created:this.created,request_type:this.request_type})}static fromStorageString(t){return on.createStatic("State","fromStorageString"),new CS(JSON.parse(t))}static async clearStaleState(t,e){const n=on.createStatic("State","clearStaleState"),r=hu.getEpochTime()-e,i=await t.getAllKeys();n.debug("got keys",i);for(let o=0;ov.searchParams.append("resource",x));for(const[y,x]of Object.entries({response_mode:a,...m,...h}))x!=null&&v.searchParams.append(y,x.toString());this.url=v.href}},kdt="openid",lW=class{constructor(t){this.access_token="",this.token_type="",this.profile={},this.state=t.get("state"),this.session_state=t.get("session_state"),this.error=t.get("error"),this.error_description=t.get("error_description"),this.error_uri=t.get("error_uri"),this.code=t.get("code")}get expires_in(){if(this.expires_at!==void 0)return this.expires_at-hu.getEpochTime()}set expires_in(t){typeof t=="string"&&(t=Number(t)),t!==void 0&&t>=0&&(this.expires_at=Math.floor(t)+hu.getEpochTime())}get isOpenId(){var t;return((t=this.scope)==null?void 0:t.split(" ").includes(kdt))||!!this.id_token}},Adt=class{constructor({url:t,state_data:e,id_token_hint:n,post_logout_redirect_uri:r,extraQueryParams:i,request_type:o}){if(this._logger=new on("SignoutRequest"),!t)throw this._logger.error("ctor: No url passed"),new Error("url");const s=new URL(t);n&&s.searchParams.append("id_token_hint",n),r&&(s.searchParams.append("post_logout_redirect_uri",r),e&&(this.state=new CS({data:e,request_type:o}),s.searchParams.append("state",this.state.id)));for(const[a,l]of Object.entries({...i}))l!=null&&s.searchParams.append(a,l.toString());this.url=s.href}},Pdt=class{constructor(t){this.state=t.get("state"),this.error=t.get("error"),this.error_description=t.get("error_description"),this.error_uri=t.get("error_uri")}},Mdt=["nbf","jti","auth_time","nonce","acr","amr","azp","at_hash"],Rdt=["sub","iss","aud","exp","iat"],Ddt=class{constructor(t){this._settings=t,this._logger=new on("ClaimsService")}filterProtocolClaims(t){const e={...t};if(this._settings.filterProtocolClaims){let n;Array.isArray(this._settings.filterProtocolClaims)?n=this._settings.filterProtocolClaims:n=Mdt;for(const r of n)Rdt.includes(r)||delete e[r]}return e}mergeClaims(t,e){const n={...t};for(const[r,i]of Object.entries(e))for(const o of Array.isArray(i)?i:[i]){const s=n[r];s?Array.isArray(s)?s.includes(o)||s.push(o):n[r]!==o&&(typeof o=="object"&&this._settings.mergeClaims?n[r]=this.mergeClaims(s,o):n[r]=[s,o]):n[r]=o}return n}},Idt=class{constructor(t){this._logger=new on("OidcClient"),this.settings=new zPe(t),this.metadataService=new ydt(this.settings),this._claimsService=new Ddt(this.settings),this._validator=new Edt(this.settings,this.metadataService,this._claimsService),this._tokenClient=new jPe(this.settings,this.metadataService)}async createSigninRequest({state:t,request:e,request_uri:n,request_type:r,id_token_hint:i,login_hint:o,skipUserInfo:s,nonce:a,response_type:l=this.settings.response_type,scope:c=this.settings.scope,redirect_uri:u=this.settings.redirect_uri,prompt:f=this.settings.prompt,display:d=this.settings.display,max_age:h=this.settings.max_age,ui_locales:p=this.settings.ui_locales,acr_values:g=this.settings.acr_values,resource:m=this.settings.resource,response_mode:v=this.settings.response_mode,extraQueryParams:y=this.settings.extraQueryParams,extraTokenParams:x=this.settings.extraTokenParams}){const b=this._logger.create("createSigninRequest");if(l!=="code")throw new Error("Only the Authorization Code flow (with PKCE) is supported");const w=await this.metadataService.getAuthorizationEndpoint();b.debug("Received authorization endpoint",w);const _=new Tdt({url:w,authority:this.settings.authority,client_id:this.settings.client_id,redirect_uri:u,response_type:l,scope:c,state_data:t,prompt:f,display:d,max_age:h,ui_locales:p,id_token_hint:i,login_hint:o,acr_values:g,resource:m,request:e,request_uri:n,extraQueryParams:y,extraTokenParams:x,request_type:r,response_mode:v,client_secret:this.settings.client_secret,skipUserInfo:s,nonce:a,disablePKCE:this.settings.disablePKCE});await this.clearStaleState();const S=_.state;return await this.settings.stateStore.set(S.id,S.toStorageString()),_}async readSigninResponseState(t,e=!1){const n=this._logger.create("readSigninResponseState"),r=new lW(dq.readParams(t,this.settings.response_mode));if(!r.state)throw n.throw(new Error("No state in response")),null;const i=await this.settings.stateStore[e?"remove":"get"](r.state);if(!i)throw n.throw(new Error("No matching state found in storage")),null;return{state:Jee.fromStorageString(i),response:r}}async processSigninResponse(t){const e=this._logger.create("processSigninResponse"),{state:n,response:r}=await this.readSigninResponseState(t,!0);return e.debug("received state from storage; validating response"),await this._validator.validateSigninResponse(r,n),r}async processResourceOwnerPasswordCredentials({username:t,password:e,skipUserInfo:n=!1,extraTokenParams:r={}}){const i=await this._tokenClient.exchangeCredentials({username:t,password:e,...r}),o=new lW(new URLSearchParams);return Object.assign(o,i),await this._validator.validateCredentialsResponse(o,n),o}async useRefreshToken({state:t,timeoutInSeconds:e}){var n;const r=this._logger.create("useRefreshToken");let i;if(this.settings.refreshTokenAllowedScope===void 0)i=t.scope;else{const a=this.settings.refreshTokenAllowedScope.split(" ");i=(((n=t.scope)==null?void 0:n.split(" "))||[]).filter(c=>a.includes(c)).join(" ")}const o=await this._tokenClient.exchangeRefreshToken({refresh_token:t.refresh_token,scope:i,timeoutInSeconds:e}),s=new lW(new URLSearchParams);return Object.assign(s,o),r.debug("validating response",s),await this._validator.validateRefreshResponse(s,{...t,scope:i}),s}async createSignoutRequest({state:t,id_token_hint:e,request_type:n,post_logout_redirect_uri:r=this.settings.post_logout_redirect_uri,extraQueryParams:i=this.settings.extraQueryParams}={}){const o=this._logger.create("createSignoutRequest"),s=await this.metadataService.getEndSessionEndpoint();if(!s)throw o.throw(new Error("No end session endpoint")),null;o.debug("Received end session endpoint",s);const a=new Adt({url:s,id_token_hint:e,post_logout_redirect_uri:r,state_data:t,extraQueryParams:i,request_type:n});await this.clearStaleState();const l=a.state;return l&&(o.debug("Signout request has state to persist"),await this.settings.stateStore.set(l.id,l.toStorageString())),a}async readSignoutResponseState(t,e=!1){const n=this._logger.create("readSignoutResponseState"),r=new Pdt(dq.readParams(t,this.settings.response_mode));if(!r.state){if(n.debug("No state in response"),r.error)throw n.warn("Response was error:",r.error),new ib(r);return{state:void 0,response:r}}const i=await this.settings.stateStore[e?"remove":"get"](r.state);if(!i)throw n.throw(new Error("No matching state found in storage")),null;return{state:CS.fromStorageString(i),response:r}}async processSignoutResponse(t){const e=this._logger.create("processSignoutResponse"),{state:n,response:r}=await this.readSignoutResponseState(t,!0);return n?(e.debug("Received state from storage; validating response"),this._validator.validateSignoutResponse(r,n)):e.debug("No state from storage; skipping response validation"),r}clearStaleState(){return this._logger.create("clearStaleState"),CS.clearStaleState(this.settings.stateStore,this.settings.staleStateAgeInSeconds)}async revokeToken(t,e){return this._logger.create("revokeToken"),await this._tokenClient.revoke({token:t,token_type_hint:e})}},Ldt=class{constructor(t){this._userManager=t,this._logger=new on("SessionMonitor"),this._start=async e=>{const n=e.session_state;if(!n)return;const r=this._logger.create("_start");if(e.profile?(this._sub=e.profile.sub,this._sid=e.profile.sid,r.debug("session_state",n,", sub",this._sub)):(this._sub=void 0,this._sid=void 0,r.debug("session_state",n,", anonymous user")),this._checkSessionIFrame){this._checkSessionIFrame.start(n);return}try{const i=await this._userManager.metadataService.getCheckSessionIframe();if(i){r.debug("initializing check session iframe");const o=this._userManager.settings.client_id,s=this._userManager.settings.checkSessionIntervalInSeconds,a=this._userManager.settings.stopCheckSessionOnError,l=new vdt(this._callback,o,i,s,a);await l.load(),this._checkSessionIFrame=l,l.start(n)}else r.warn("no check session iframe found in the metadata")}catch(i){r.error("Error from getCheckSessionIframe:",i instanceof Error?i.message:i)}},this._stop=()=>{const e=this._logger.create("_stop");if(this._sub=void 0,this._sid=void 0,this._checkSessionIFrame&&this._checkSessionIFrame.stop(),this._userManager.settings.monitorAnonymousSession){const n=setInterval(async()=>{clearInterval(n);try{const r=await this._userManager.querySessionStatus();if(r){const i={session_state:r.session_state,profile:r.sub&&r.sid?{sub:r.sub,sid:r.sid}:null};this._start(i)}}catch(r){e.error("error from querySessionStatus",r instanceof Error?r.message:r)}},1e3)}},this._callback=async()=>{const e=this._logger.create("_callback");try{const n=await this._userManager.querySessionStatus();let r=!0;n&&this._checkSessionIFrame?n.sub===this._sub?(r=!1,this._checkSessionIFrame.start(n.session_state),n.sid===this._sid?e.debug("same sub still logged in at OP, restarting check session iframe; session_state",n.session_state):(e.debug("same sub still logged in at OP, session state has changed, restarting check session iframe; session_state",n.session_state),this._userManager.events._raiseUserSessionChanged())):e.debug("different subject signed into OP",n.sub):e.debug("subject no longer signed into OP"),r?this._sub?this._userManager.events._raiseUserSignedOut():this._userManager.events._raiseUserSignedIn():e.debug("no change in session detected, no event to raise")}catch(n){this._sub&&(e.debug("Error calling queryCurrentSigninSession; raising signed out event",n),this._userManager.events._raiseUserSignedOut())}},t||this._logger.throw(new Error("No user manager passed")),this._userManager.events.addUserLoaded(this._start),this._userManager.events.addUserUnloaded(this._stop),this._init().catch(e=>{this._logger.error(e)})}async _init(){this._logger.create("_init");const t=await this._userManager.getUser();if(t)this._start(t);else if(this._userManager.settings.monitorAnonymousSession){const e=await this._userManager.querySessionStatus();if(e){const n={session_state:e.session_state,profile:e.sub&&e.sid?{sub:e.sub,sid:e.sid}:null};this._start(n)}}}},s3=class{constructor(t){var e;this.id_token=t.id_token,this.session_state=(e=t.session_state)!=null?e:null,this.access_token=t.access_token,this.refresh_token=t.refresh_token,this.token_type=t.token_type,this.scope=t.scope,this.profile=t.profile,this.expires_at=t.expires_at,this.state=t.userState}get expires_in(){if(this.expires_at!==void 0)return this.expires_at-hu.getEpochTime()}set expires_in(t){t!==void 0&&(this.expires_at=Math.floor(t)+hu.getEpochTime())}get expired(){const t=this.expires_in;if(t!==void 0)return t<=0}get scopes(){var t,e;return(e=(t=this.scope)==null?void 0:t.split(" "))!=null?e:[]}toStorageString(){return new on("User").create("toStorageString"),JSON.stringify({id_token:this.id_token,session_state:this.session_state,access_token:this.access_token,refresh_token:this.refresh_token,token_type:this.token_type,scope:this.scope,profile:this.profile,expires_at:this.expires_at})}static fromStorageString(t){return on.createStatic("User","fromStorageString"),new s3(JSON.parse(t))}},phe="oidc-client",BPe=class{constructor(){this._abort=new Um("Window navigation aborted"),this._disposeHandlers=new Set,this._window=null}async navigate(t){const e=this._logger.create("navigate");if(!this._window)throw new Error("Attempted to navigate on a disposed window");e.debug("setting URL in window"),this._window.location.replace(t.url);const{url:n,keepOpen:r}=await new Promise((i,o)=>{const s=a=>{var l;const c=a.data,u=(l=t.scriptOrigin)!=null?l:window.location.origin;if(!(a.origin!==u||(c==null?void 0:c.source)!==phe)){try{const f=dq.readParams(c.url,t.response_mode).get("state");if(f||e.warn("no state found in response url"),a.source!==this._window&&f!==t.state)return}catch{this._dispose(),o(new Error("Invalid response from window"))}i(c)}};window.addEventListener("message",s,!1),this._disposeHandlers.add(()=>window.removeEventListener("message",s,!1)),this._disposeHandlers.add(this._abort.addHandler(a=>{this._dispose(),o(a)}))});return e.debug("got response from window"),this._dispose(),r||this.close(),{url:n}}_dispose(){this._logger.create("_dispose");for(const t of this._disposeHandlers)t();this._disposeHandlers.clear()}static _notifyParent(t,e,n=!1,r=window.location.origin){t.postMessage({source:phe,url:e,keepOpen:n},r)}},UPe={location:!1,toolbar:!1,height:640},WPe="_blank",$dt=60,Fdt=2,VPe=10,Ndt=class extends zPe{constructor(t){const{popup_redirect_uri:e=t.redirect_uri,popup_post_logout_redirect_uri:n=t.post_logout_redirect_uri,popupWindowFeatures:r=UPe,popupWindowTarget:i=WPe,redirectMethod:o="assign",redirectTarget:s="self",iframeNotifyParentOrigin:a=t.iframeNotifyParentOrigin,iframeScriptOrigin:l=t.iframeScriptOrigin,silent_redirect_uri:c=t.redirect_uri,silentRequestTimeoutInSeconds:u=VPe,automaticSilentRenew:f=!0,validateSubOnSilentRenew:d=!0,includeIdTokenInSilentRenew:h=!1,monitorSession:p=!1,monitorAnonymousSession:g=!1,checkSessionIntervalInSeconds:m=Fdt,query_status_response_type:v="code",stopCheckSessionOnError:y=!0,revokeTokenTypes:x=["access_token","refresh_token"],revokeTokensOnSignout:b=!1,includeIdTokenInSilentSignout:w=!1,accessTokenExpiringNotificationTimeInSeconds:_=$dt,userStore:S}=t;if(super(t),this.popup_redirect_uri=e,this.popup_post_logout_redirect_uri=n,this.popupWindowFeatures=r,this.popupWindowTarget=i,this.redirectMethod=o,this.redirectTarget=s,this.iframeNotifyParentOrigin=a,this.iframeScriptOrigin=l,this.silent_redirect_uri=c,this.silentRequestTimeoutInSeconds=u,this.automaticSilentRenew=f,this.validateSubOnSilentRenew=d,this.includeIdTokenInSilentRenew=h,this.monitorSession=p,this.monitorAnonymousSession=g,this.checkSessionIntervalInSeconds=m,this.stopCheckSessionOnError=y,this.query_status_response_type=v,this.revokeTokenTypes=x,this.revokeTokensOnSignout=b,this.includeIdTokenInSilentSignout=w,this.accessTokenExpiringNotificationTimeInSeconds=_,S)this.userStore=S;else{const O=typeof window<"u"?window.sessionStorage:new FPe;this.userStore=new NPe({store:O})}}},hq=class extends BPe{constructor({silentRequestTimeoutInSeconds:t=VPe}){super(),this._logger=new on("IFrameWindow"),this._timeoutInSeconds=t,this._frame=hq.createHiddenIframe(),this._window=this._frame.contentWindow}static createHiddenIframe(){const t=window.document.createElement("iframe");return t.style.visibility="hidden",t.style.position="fixed",t.style.left="-1000px",t.style.top="0",t.width="0",t.height="0",t.setAttribute("sandbox","allow-scripts allow-same-origin allow-forms"),window.document.body.appendChild(t),t}async navigate(t){this._logger.debug("navigate: Using timeout of:",this._timeoutInSeconds);const e=setTimeout(()=>this._abort.raise(new Kee("IFrame timed out without a response")),this._timeoutInSeconds*1e3);return this._disposeHandlers.add(()=>clearTimeout(e)),await super.navigate(t)}close(){var t;this._frame&&(this._frame.parentNode&&(this._frame.addEventListener("load",e=>{var n;const r=e.target;(n=r.parentNode)==null||n.removeChild(r),this._abort.raise(new Error("IFrame removed from DOM"))},!0),(t=this._frame.contentWindow)==null||t.location.replace("about:blank")),this._frame=null),this._window=null}static notifyParent(t,e){return super._notifyParent(window.parent,t,!1,e)}},zdt=class{constructor(t){this._settings=t,this._logger=new on("IFrameNavigator")}async prepare({silentRequestTimeoutInSeconds:t=this._settings.silentRequestTimeoutInSeconds}){return new hq({silentRequestTimeoutInSeconds:t})}async callback(t){this._logger.create("callback"),hq.notifyParent(t,this._settings.iframeNotifyParentOrigin)}},jdt=500,ghe=class extends BPe{constructor({popupWindowTarget:t=WPe,popupWindowFeatures:e={}}){super(),this._logger=new on("PopupWindow");const n=hhe.center({...UPe,...e});this._window=window.open(void 0,t,hhe.serialize(n))}async navigate(t){var e;(e=this._window)==null||e.focus();const n=setInterval(()=>{(!this._window||this._window.closed)&&this._abort.raise(new Error("Popup closed by user"))},jdt);return this._disposeHandlers.add(()=>clearInterval(n)),await super.navigate(t)}close(){this._window&&(this._window.closed||(this._window.close(),this._abort.raise(new Error("Popup closed")))),this._window=null}static notifyOpener(t,e){if(!window.opener)throw new Error("No window.opener. Can't complete notification.");return super._notifyParent(window.opener,t,e)}},Bdt=class{constructor(t){this._settings=t,this._logger=new on("PopupNavigator")}async prepare({popupWindowFeatures:t=this._settings.popupWindowFeatures,popupWindowTarget:e=this._settings.popupWindowTarget}){return new ghe({popupWindowFeatures:t,popupWindowTarget:e})}async callback(t,e=!1){this._logger.create("callback"),ghe.notifyOpener(t,e)}},Udt=class{constructor(t){this._settings=t,this._logger=new on("RedirectNavigator")}async prepare({redirectMethod:t=this._settings.redirectMethod,redirectTarget:e=this._settings.redirectTarget}){var n;this._logger.create("prepare");let r=window.self;e==="top"&&(r=(n=window.top)!=null?n:window.self);const i=r.location[t].bind(r.location);let o;return{navigate:async s=>{this._logger.create("navigate");const a=new Promise((l,c)=>{o=c});return i(s.url),await a},close:()=>{this._logger.create("close"),o==null||o(new Error("Redirect aborted")),r.stop()}}}},Wdt=class extends mdt{constructor(t){super({expiringNotificationTimeInSeconds:t.accessTokenExpiringNotificationTimeInSeconds}),this._logger=new on("UserManagerEvents"),this._userLoaded=new Um("User loaded"),this._userUnloaded=new Um("User unloaded"),this._silentRenewError=new Um("Silent renew error"),this._userSignedIn=new Um("User signed in"),this._userSignedOut=new Um("User signed out"),this._userSessionChanged=new Um("User session changed")}load(t,e=!0){super.load(t),e&&this._userLoaded.raise(t)}unload(){super.unload(),this._userUnloaded.raise()}addUserLoaded(t){return this._userLoaded.addHandler(t)}removeUserLoaded(t){return this._userLoaded.removeHandler(t)}addUserUnloaded(t){return this._userUnloaded.addHandler(t)}removeUserUnloaded(t){return this._userUnloaded.removeHandler(t)}addSilentRenewError(t){return this._silentRenewError.addHandler(t)}removeSilentRenewError(t){return this._silentRenewError.removeHandler(t)}_raiseSilentRenewError(t){this._silentRenewError.raise(t)}addUserSignedIn(t){return this._userSignedIn.addHandler(t)}removeUserSignedIn(t){this._userSignedIn.removeHandler(t)}_raiseUserSignedIn(){this._userSignedIn.raise()}addUserSignedOut(t){return this._userSignedOut.addHandler(t)}removeUserSignedOut(t){this._userSignedOut.removeHandler(t)}_raiseUserSignedOut(){this._userSignedOut.raise()}addUserSessionChanged(t){return this._userSessionChanged.addHandler(t)}removeUserSessionChanged(t){this._userSessionChanged.removeHandler(t)}_raiseUserSessionChanged(){this._userSessionChanged.raise()}},Vdt=class{constructor(t){this._userManager=t,this._logger=new on("SilentRenewService"),this._isStarted=!1,this._retryTimer=new hu("Retry Silent Renew"),this._tokenExpiring=async()=>{const e=this._logger.create("_tokenExpiring");try{await this._userManager.signinSilent(),e.debug("silent token renewal successful")}catch(n){if(n instanceof Kee){e.warn("ErrorTimeout from signinSilent:",n,"retry in 5s"),this._retryTimer.init(5);return}e.error("Error from signinSilent:",n),this._userManager.events._raiseSilentRenewError(n)}}}async start(){const t=this._logger.create("start");if(!this._isStarted){this._isStarted=!0,this._userManager.events.addAccessTokenExpiring(this._tokenExpiring),this._retryTimer.addHandler(this._tokenExpiring);try{await this._userManager.getUser()}catch(e){t.error("getUser error",e)}}}stop(){this._isStarted&&(this._retryTimer.cancel(),this._retryTimer.removeHandler(this._tokenExpiring),this._userManager.events.removeAccessTokenExpiring(this._tokenExpiring),this._isStarted=!1)}},Gdt=class{constructor(t){this.refresh_token=t.refresh_token,this.id_token=t.id_token,this.session_state=t.session_state,this.scope=t.scope,this.profile=t.profile,this.data=t.state}},Hdt=class{constructor(t){this._logger=new on("UserManager"),this.settings=new Ndt(t),this._client=new Idt(t),this._redirectNavigator=new Udt(this.settings),this._popupNavigator=new Bdt(this.settings),this._iframeNavigator=new zdt(this.settings),this._events=new Wdt(this.settings),this._silentRenewService=new Vdt(this),this.settings.automaticSilentRenew&&this.startSilentRenew(),this._sessionMonitor=null,this.settings.monitorSession&&(this._sessionMonitor=new Ldt(this))}get events(){return this._events}get metadataService(){return this._client.metadataService}async getUser(){const t=this._logger.create("getUser"),e=await this._loadUser();return e?(t.info("user loaded"),this._events.load(e,!1),e):(t.info("user not found in storage"),null)}async removeUser(){const t=this._logger.create("removeUser");await this.storeUser(null),t.info("user removed from storage"),this._events.unload()}async signinRedirect(t={}){this._logger.create("signinRedirect");const{redirectMethod:e,...n}=t,r=await this._redirectNavigator.prepare({redirectMethod:e});await this._signinStart({request_type:"si:r",...n},r)}async signinRedirectCallback(t=window.location.href){const e=this._logger.create("signinRedirectCallback"),n=await this._signinEnd(t);return n.profile&&n.profile.sub?e.info("success, signed in subject",n.profile.sub):e.info("no subject"),n}async signinResourceOwnerCredentials({username:t,password:e,skipUserInfo:n=!1}){const r=this._logger.create("signinResourceOwnerCredential"),i=await this._client.processResourceOwnerPasswordCredentials({username:t,password:e,skipUserInfo:n,extraTokenParams:this.settings.extraTokenParams});r.debug("got signin response");const o=await this._buildUser(i);return o.profile&&o.profile.sub?r.info("success, signed in subject",o.profile.sub):r.info("no subject"),o}async signinPopup(t={}){const e=this._logger.create("signinPopup"),{popupWindowFeatures:n,popupWindowTarget:r,...i}=t,o=this.settings.popup_redirect_uri;o||e.throw(new Error("No popup_redirect_uri configured"));const s=await this._popupNavigator.prepare({popupWindowFeatures:n,popupWindowTarget:r}),a=await this._signin({request_type:"si:p",redirect_uri:o,display:"popup",...i},s);return a&&(a.profile&&a.profile.sub?e.info("success, signed in subject",a.profile.sub):e.info("no subject")),a}async signinPopupCallback(t=window.location.href,e=!1){const n=this._logger.create("signinPopupCallback");await this._popupNavigator.callback(t,e),n.info("success")}async signinSilent(t={}){var e;const n=this._logger.create("signinSilent"),{silentRequestTimeoutInSeconds:r,...i}=t;let o=await this._loadUser();if(o!=null&&o.refresh_token){n.debug("using refresh token");const c=new Gdt(o);return await this._useRefreshToken(c)}const s=this.settings.silent_redirect_uri;s||n.throw(new Error("No silent_redirect_uri configured"));let a;o&&this.settings.validateSubOnSilentRenew&&(n.debug("subject prior to silent renew:",o.profile.sub),a=o.profile.sub);const l=await this._iframeNavigator.prepare({silentRequestTimeoutInSeconds:r});return o=await this._signin({request_type:"si:s",redirect_uri:s,prompt:"none",id_token_hint:this.settings.includeIdTokenInSilentRenew?o==null?void 0:o.id_token:void 0,...i},l,a),o&&((e=o.profile)!=null&&e.sub?n.info("success, signed in subject",o.profile.sub):n.info("no subject")),o}async _useRefreshToken(t){const e=await this._client.useRefreshToken({state:t,timeoutInSeconds:this.settings.silentRequestTimeoutInSeconds}),n=new s3({...t,...e});return await this.storeUser(n),this._events.load(n),n}async signinSilentCallback(t=window.location.href){const e=this._logger.create("signinSilentCallback");await this._iframeNavigator.callback(t),e.info("success")}async signinCallback(t=window.location.href){const{state:e}=await this._client.readSigninResponseState(t);switch(e.request_type){case"si:r":return await this.signinRedirectCallback(t);case"si:p":return await this.signinPopupCallback(t);case"si:s":return await this.signinSilentCallback(t);default:throw new Error("invalid response_type in state")}}async signoutCallback(t=window.location.href,e=!1){const{state:n}=await this._client.readSignoutResponseState(t);if(n)switch(n.request_type){case"so:r":await this.signoutRedirectCallback(t);break;case"so:p":await this.signoutPopupCallback(t,e);break;case"so:s":await this.signoutSilentCallback(t);break;default:throw new Error("invalid response_type in state")}}async querySessionStatus(t={}){const e=this._logger.create("querySessionStatus"),{silentRequestTimeoutInSeconds:n,...r}=t,i=this.settings.silent_redirect_uri;i||e.throw(new Error("No silent_redirect_uri configured"));const o=await this._loadUser(),s=await this._iframeNavigator.prepare({silentRequestTimeoutInSeconds:n}),a=await this._signinStart({request_type:"si:s",redirect_uri:i,prompt:"none",id_token_hint:this.settings.includeIdTokenInSilentRenew?o==null?void 0:o.id_token:void 0,response_type:this.settings.query_status_response_type,scope:"openid",skipUserInfo:!0,...r},s);try{const l=await this._client.processSigninResponse(a.url);return e.debug("got signin response"),l.session_state&&l.profile.sub?(e.info("success for subject",l.profile.sub),{session_state:l.session_state,sub:l.profile.sub,sid:l.profile.sid}):(e.info("success, user not authenticated"),null)}catch(l){if(this.settings.monitorAnonymousSession&&l instanceof ib)switch(l.error){case"login_required":case"consent_required":case"interaction_required":case"account_selection_required":return e.info("success for anonymous user"),{session_state:l.session_state}}throw l}}async _signin(t,e,n){const r=await this._signinStart(t,e);return await this._signinEnd(r.url,n)}async _signinStart(t,e){const n=this._logger.create("_signinStart");try{const r=await this._client.createSigninRequest(t);return n.debug("got signin request"),await e.navigate({url:r.url,state:r.state.id,response_mode:r.state.response_mode,scriptOrigin:this.settings.iframeScriptOrigin})}catch(r){throw n.debug("error after preparing navigator, closing navigator window"),e.close(),r}}async _signinEnd(t,e){const n=this._logger.create("_signinEnd"),r=await this._client.processSigninResponse(t);return n.debug("got signin response"),await this._buildUser(r,e)}async _buildUser(t,e){const n=this._logger.create("_buildUser"),r=new s3(t);if(e){if(e!==r.profile.sub)throw n.debug("current user does not match user returned from signin. sub from signin:",r.profile.sub),new ib({...t,error:"login_required"});n.debug("current user matches user returned from signin")}return await this.storeUser(r),n.debug("user stored"),this._events.load(r),r}async signoutRedirect(t={}){const e=this._logger.create("signoutRedirect"),{redirectMethod:n,...r}=t,i=await this._redirectNavigator.prepare({redirectMethod:n});await this._signoutStart({request_type:"so:r",post_logout_redirect_uri:this.settings.post_logout_redirect_uri,...r},i),e.info("success")}async signoutRedirectCallback(t=window.location.href){const e=this._logger.create("signoutRedirectCallback"),n=await this._signoutEnd(t);return e.info("success"),n}async signoutPopup(t={}){const e=this._logger.create("signoutPopup"),{popupWindowFeatures:n,popupWindowTarget:r,...i}=t,o=this.settings.popup_post_logout_redirect_uri,s=await this._popupNavigator.prepare({popupWindowFeatures:n,popupWindowTarget:r});await this._signout({request_type:"so:p",post_logout_redirect_uri:o,state:o==null?void 0:{},...i},s),e.info("success")}async signoutPopupCallback(t=window.location.href,e=!1){const n=this._logger.create("signoutPopupCallback");await this._popupNavigator.callback(t,e),n.info("success")}async _signout(t,e){const n=await this._signoutStart(t,e);return await this._signoutEnd(n.url)}async _signoutStart(t={},e){var n;const r=this._logger.create("_signoutStart");try{const i=await this._loadUser();r.debug("loaded current user from storage"),this.settings.revokeTokensOnSignout&&await this._revokeInternal(i);const o=t.id_token_hint||i&&i.id_token;o&&(r.debug("setting id_token_hint in signout request"),t.id_token_hint=o),await this.removeUser(),r.debug("user removed, creating signout request");const s=await this._client.createSignoutRequest(t);return r.debug("got signout request"),await e.navigate({url:s.url,state:(n=s.state)==null?void 0:n.id})}catch(i){throw r.debug("error after preparing navigator, closing navigator window"),e.close(),i}}async _signoutEnd(t){const e=this._logger.create("_signoutEnd"),n=await this._client.processSignoutResponse(t);return e.debug("got signout response"),n}async signoutSilent(t={}){var e;const n=this._logger.create("signoutSilent"),{silentRequestTimeoutInSeconds:r,...i}=t,o=this.settings.includeIdTokenInSilentSignout?(e=await this._loadUser())==null?void 0:e.id_token:void 0,s=this.settings.popup_post_logout_redirect_uri,a=await this._iframeNavigator.prepare({silentRequestTimeoutInSeconds:r});await this._signout({request_type:"so:s",post_logout_redirect_uri:s,id_token_hint:o,...i},a),n.info("success")}async signoutSilentCallback(t=window.location.href){const e=this._logger.create("signoutSilentCallback");await this._iframeNavigator.callback(t),e.info("success")}async revokeTokens(t){const e=await this._loadUser();await this._revokeInternal(e,t)}async _revokeInternal(t,e=this.settings.revokeTokenTypes){const n=this._logger.create("_revokeInternal");if(!t)return;const r=e.filter(i=>typeof t[i]=="string");if(!r.length){n.debug("no need to revoke due to no token(s)");return}for(const i of r)await this._client.revokeToken(t[i],i),n.info(`${i} revoked successfully`),i!=="access_token"&&(t[i]=null);await this.storeUser(t),n.debug("user stored"),this._events.load(t)}startSilentRenew(){this._logger.create("startSilentRenew"),this._silentRenewService.start()}stopSilentRenew(){this._silentRenewService.stop()}get _userStoreKey(){return`user:${this.settings.authority}:${this.settings.client_id}`}async _loadUser(){const t=this._logger.create("_loadUser"),e=await this.settings.userStore.get(this._userStoreKey);return e?(t.debug("user storageString loaded"),s3.fromStorageString(e)):(t.debug("no user storageString"),null)}async storeUser(t){const e=this._logger.create("storeUser");if(t){e.debug("storing user");const n=t.toStorageString();await this.settings.userStore.set(this._userStoreKey,n)}else this._logger.debug("removing user"),await this.settings.userStore.remove(this._userStoreKey)}async clearStaleState(){await this._client.clearStaleState()}},ete=de.createContext(void 0);ete.displayName="AuthContext";var qdt={isLoading:!0,isAuthenticated:!1},Xdt=(t,e)=>{switch(e.type){case"INITIALISED":case"USER_LOADED":return{...t,user:e.user,isLoading:!1,isAuthenticated:e.user?!e.user.expired:!1,error:void 0};case"USER_UNLOADED":return{...t,user:void 0,isAuthenticated:!1};case"NAVIGATOR_INIT":return{...t,isLoading:!0,activeNavigator:e.method};case"NAVIGATOR_CLOSE":return{...t,isLoading:!1,activeNavigator:void 0};case"ERROR":return{...t,isLoading:!1,error:e.error};default:return{...t,isLoading:!1,error:new Error(`unknown type ${e.type}`)}}},Ydt=(t=window.location)=>{let e=new URLSearchParams(t.search);return!!((e.get("code")||e.get("error"))&&e.get("state")||(e=new URLSearchParams(t.hash.replace("#","?")),(e.get("code")||e.get("error"))&&e.get("state")))},Qdt=t=>e=>e instanceof Error?e:new Error(t),Kdt=Qdt("Login failed"),Zdt=["clearStaleState","querySessionStatus","revokeTokens","startSilentRenew","stopSilentRenew"],Jdt=["signinPopup","signinSilent","signinRedirect","signoutPopup","signoutRedirect","signoutSilent"],cW=t=>()=>{throw new Error(`UserManager#${t} was called from an unsupported context. If this is a server-rendered page, defer this call with useEffect() or pass a custom UserManager implementation.`)},eht=typeof window>"u"?null:Hdt,tht=t=>{const{children:e,onSigninCallback:n,skipSigninCallback:r,onRemoveUser:i,onSignoutRedirect:o,onSignoutPopup:s,implementation:a=eht,userManager:l,...c}=t,[u]=D.useState(()=>l??(a?new a(c):{settings:c})),[f,d]=D.useReducer(Xdt,qdt),h=D.useMemo(()=>Object.assign({settings:u.settings,events:u.events},Object.fromEntries(Zdt.map(x=>{var b,w;return[x,(w=(b=u[x])==null?void 0:b.bind(u))!=null?w:cW(x)]})),Object.fromEntries(Jdt.map(x=>[x,u[x]?async(...b)=>{d({type:"NAVIGATOR_INIT",method:x});try{return await u[x](...b)}finally{d({type:"NAVIGATOR_CLOSE"})}}:cW(x)]))),[u]),p=D.useRef(!1);D.useEffect(()=>{!u||p.current||(p.current=!0,(async()=>{let x=null;try{Ydt()&&!r&&(x=await u.signinCallback(),n&&n(x)),x=x||await u.getUser(),d({type:"INITIALISED",user:x})}catch(b){d({type:"ERROR",error:Kdt(b)})}})())},[u,r,n]),D.useEffect(()=>{if(!u)return;const x=_=>{d({type:"USER_LOADED",user:_})};u.events.addUserLoaded(x);const b=()=>{d({type:"USER_UNLOADED"})};u.events.addUserUnloaded(b);const w=_=>{d({type:"ERROR",error:_})};return u.events.addSilentRenewError(w),()=>{u.events.removeUserLoaded(x),u.events.removeUserUnloaded(b),u.events.removeSilentRenewError(w)}},[u]);const g=D.useCallback(u?()=>u.removeUser().then(i):cW("removeUser"),[u,i]),m=D.useCallback(x=>h.signoutRedirect(x).then(o),[h.signoutRedirect,o]),v=D.useCallback(x=>h.signoutPopup(x).then(s),[h.signoutPopup,s]),y=D.useCallback(x=>h.signoutSilent(x),[h.signoutSilent]);return de.createElement(ete.Provider,{value:{...f,...h,removeUser:g,signoutRedirect:m,signoutPopup:v,signoutSilent:y}},e)},nht=()=>{const t=de.useContext(ete);if(!t)throw new Error("AuthProvider context is undefined, please verify you are calling useAuth() as child of a component.");return t};const mhe="color:green;font-weight:bold;",rht="color:blue;font-weight:bold;";class iht{constructor(e){gn(this,"_languages");gn(this,"_content");gn(this,"_locale");const n=Object.getOwnPropertyNames(e.languages);if(n.findIndex(i=>i==="en")<0)throw new Error('Internal error: locale "en" must be included in supported languages');const r={};e.dictionary.forEach((i,o)=>{n.forEach(a=>{if(!i[a])throw new Error(`Internal error: invalid entry at index ${o} in "./resources/lang.json": missing translation for locale: "${a}": ${i}`)});const s=vhe(i.en);r[s]&&console.warn(`Translation already defined for "${i.en}".`),r[s]=i}),this._languages=e.languages,this._content=r,this._locale="en"}get languages(){return this._languages}get locale(){return this._locale}set locale(e){const n=Object.getOwnPropertyNames(this._languages);if(n.findIndex(r=>r===e)<0){const r=e.split("-")[0];if(n.findIndex(i=>i===r)<0){console.error(`No translations found for locale "${e}", staying with "${this._locale}".`);return}else console.warn(`No translations found for locale "${e}", falling back to "${r}".`),e=r}this._locale=e}get(e,n){const r=vhe(e),i=this._content[r];let o;return i?(o=i[this._locale],o||(console.debug(`missing translation of phrase %c${e}`,mhe,` for locale %c${this._locale}`,rht),o=e)):(console.debug(`missing translation for phrase %c${e}`,mhe),o=e),n&&Object.keys(n).forEach(s=>{o=o.replace("${"+s+"}",`${n[s]}`)}),o}}const oht=()=>{let t;return navigator.languages&&navigator.languages.length>0?t=navigator.languages[0]:t=navigator.language||navigator.userLanguage||navigator.browserLanguage||"en",t.split("-")[0]},vhe=t=>t.toLowerCase(),sht={en:"English",de:"Deutsch",se:"Svenska"},aht=[{en:"OK",de:"OK",se:"OK"},{en:"Cancel",de:"Abbrechen",se:"Avbryt"},{en:"Save",de:"Speichern",se:"Spara"},{en:"Select",de:"Auswählen",se:"Välj"},{en:"Add",de:"Hinzufügen",se:"Lägg till"},{en:"Edit",de:"Bearbeiten",se:"Redigera"},{en:"Remove",de:"Entfernen",se:"Ta bort"},{en:"Dataset",de:"Datensatz",se:"Dataset"},{en:"Variable",de:"Variable",se:"Variabel"},{en:"My places",de:"Meine Orte",se:"Mina platser"},{en:"Loading places",de:"Lade Orte",se:"Laddar platser"},{en:"Places",de:"Orte",se:"Platser"},{en:"Place",de:"Ort",se:"Plats"},{en:"Time",de:"Zeit",se:"Tid"},{en:"Missing time axis",de:"Fehlende Zeitachse",se:"Saknar tidsaxel"},{en:"Geometry type",de:"Geometry-Typ",se:"Geometri typ"},{en:"Point",de:"Punkt",se:"Punkt"},{en:"Polygon",de:"Polygon",se:"Polygon"},{en:"Circle",de:"Kreis",se:"Cirkel"},{en:"Multi",de:"Multi",se:"Multi"},{en:"Something went wrong.",de:"Irgendetwas lief schief.",se:"Något gick fel."},{en:"Time-Series",de:"Zeitserie",se:"Tidsserier"},{en:"Quantity",de:"Größe",se:"Kvantitet"},{en:"unknown units",de:"unbekannte Einheiten",se:"okända enheter"},{en:"Values",de:"Werte",se:"Värden"},{en:"Start",de:"Start",se:"Start"},{en:"Stop",de:"Stopp",se:"Stopp"},{en:"Please wait...",de:"Bitte warten...",se:"Vänta ..."},{en:"Loading data",de:"Lade Daten",se:"Laddar data"},{en:"Connecting to server",de:"Verbindung zum Server wird hergestellt",se:"Ansluta till servern"},{en:"Cannot reach server",de:"Kann Server nicht erreichen",se:"Kan inte nå servern"},{en:"Language",de:"Sprache",se:"Språk"},{en:"Settings",de:"Einstellungen",se:"Inställningar"},{en:"General",de:"Allgemein",se:"Allmänhet"},{en:"System Information",de:"Systeminformation",se:"Systeminformation"},{en:"version",de:"Version",se:"Version"},{en:"Server",de:"Server",se:"Server"},{en:"Add Server",de:"Server hinzufügen",se:"Lägg till server"},{en:"Edit Server",de:"Server bearbeiten",se:"Redigera server"},{en:"Select Server",de:"Server auswählen",se:"Välj server"},{en:"On",de:"An",se:"På"},{en:"Off",de:"Aus",se:"Av"},{en:"Time interval of the player",de:"Zeitintervall des Abspielers",se:"Spelarens tidsintervall"},{en:"Show chart after adding a place",de:"Diagram anzeigen, nachdem ein Ort hinzugefügt wurde",se:"Visa diagram efter att du har lagt till en plats"},{en:"Calculate standard deviation",de:"Berechne Standardabweichung",se:"Beräkna standardavvikelsen"},{en:"Calculate median instead of mean (disables standard deviation)",de:"Median statt Mittelwert berechnen (deaktiviert Standardabweichung)",se:"Beräkna median istället för medelvärde (inaktiverar standardavvikelse)"},{en:"Minimal number of data points in a time series update",de:"Minimale Anzahl Datenpunkte in einer Zeitreihen-Aktualisierung",se:"Minimalt antal datapunkter i en tidsserieuppdatering"},{en:"Map",de:"Karte",se:"Karta"},{en:"Projection",de:"Projektion",se:"Projektion"},{en:"Geographic",de:"Geografisch",se:"Geografiskt"},{en:"Mercator",de:"Mercator",se:"Mercator"},{en:"Image smoothing",de:"Bildglättung",se:"Bildutjämning"},{en:"Show dataset boundaries",de:"Datensatzgrenzen anzeigen",se:"Visa datauppsättningsgränser"},{en:"Base map",de:"Basiskarte",se:"Grundkarta"},{en:"Hide small values",de:"Kleine Werte ausblenden",se:"Dölja små värden"},{en:"Reverse",de:"Umkehren",se:"Omvänt"},{en:"Color",de:"Farbe",se:"Färg"},{en:"Opacity",de:"Opazität",se:"Opacitet"},{en:"Value Range",de:"Wertebereich",se:"Värdeintervall"},{en:"Assign min/max from color mapping values",de:"Min./Max. aus Farbzuordnungswerten übertragen",se:"Tilldela min/max från färgmappningsvärden"},{en:"Log-scaled",de:"Log-skaliert",se:"Log-skalad"},{en:"Logarithmic scaling",de:"Logarithmische Skalierung",se:"Logaritmisk skalning"},{en:"Others",de:"Andere",se:"Andra"},{en:"Dataset information",de:"Informationen zum Datensatz",se:"Information om dataset"},{en:"Variable information",de:"Informationen zur Variablen",se:"Information om variabeln"},{en:"Place information",de:"Informationen zum Ort",se:"Platsinformation"},{en:"Dimension names",de:"Namen der Dimensionen",se:"Dimensioner namn"},{en:"Dimension data types",de:"Datentypen der Dimensionen",se:"Dimensionsdatatyper"},{en:"Dimension lengths",de:"Länge der Dimensionen",se:"Måttlängder"},{en:"Time chunk size",de:"Zeitblockgröße",se:"Tidsblockstorlek"},{en:"Geographical extent",de:"Geografische Ausdehnung",se:"Geografisk omfattning"},{en:"Spatial reference system",de:"Räumliches Bezugssystem",se:"Rumsligt referenssystem"},{en:"Name",de:"Name",se:"Namn"},{en:"Title",de:"Titel",se:"Titel"},{en:"Units",de:"Einheiten",se:"Enheter"},{en:"Expression",de:"Ausdruck",se:"Uttryck"},{en:"Data type",de:"Datentyp",se:"Datatyp"},{en:"There is no information available for this location.",de:"Zu diesem Ort sind keine keine Informationen vorhanden.",se:"Det finns ingen information tillgänglig för den här platsen."},{en:"Log out",de:"Abmelden",se:"Logga ut"},{en:"Profile",de:"Profil",se:"Profil"},{en:"User Profile",de:"Nutzerprofil",se:"Användarprofil"},{en:"User name",de:"Nutzername",se:"Användarnamn"},{en:"E-mail",de:"E-mail",se:"E-post"},{en:"Nickname",de:"Spitzname",se:"Smeknamn"},{en:"verified",de:"verifiziert",se:"verified"},{en:"not verified",de:"nicht verifiziert",se:"inte verifierad"},{en:"RGB",de:"RGB",se:"RGB"},{en:"Imprint",de:"Impressum",se:"Avtryck"},{en:"User Manual",de:"Benutzerhandbuch",se:"Användarmanual"},{en:"Show time-series diagram",de:"Zeitserien-Diagramm anzeigen",se:"Visa tidsseriediagram"},{en:"Add Statistics",de:"Statistiken hinzufügen",se:"Lägg till statistik"},{en:"Help",de:"Hilfe",se:"Hjälp"},{en:"Copy snapshot of chart to clipboard",de:"Schnappschuss des Diagramms in die Zwischenablage kopieren",se:"Kopiera ögonblicksbild av diagrammet till urklipp"},{en:"Snapshot copied to clipboard",de:"Schnappschuss wurde in die Zwischenablage kopiert",se:"Ögonblicksbild har kopierats till urklipp"},{en:"Error copying snapshot to clipboard",de:"Fehler beim Kopieren des Schnappschusses in die Zwischenablage",se:"Det gick inte att kopiera ögonblicksbilden till urklipp"},{en:"Export data",de:"Daten exportieren",se:"Exportera data"},{en:"Export Settings",de:"Export-Einstellungen",se:"Exportera Inställningar"},{en:"Include time-series data",de:"Zeitseriendaten einschließen",se:"Inkludera tidsseriedata"},{en:"Include places data",de:"Ortsdaten einschließen",se:"Inkludera platsdata"},{en:"File name",de:"Dateiname",se:"Filnamn"},{en:"Separator for time-series data",de:"Trennzeichen für Zeitreihendaten",se:"Separator för tidsseriedata"},{en:"Combine place data in one file",de:"Ortsdaten in einer Datei zusammenfassen",se:"Kombinera platsdata i en fil"},{en:"As ZIP archive",de:"Als ZIP-Archiv",se:"Som ett ZIP-arkiv"},{en:"Download",de:"Herunterladen",se:"Ladda ner"},{en:"Locate place in map",de:"Lokalisiere Ort in Karte",se:"Leta upp plats på kartan"},{en:"Locate dataset in map",de:"Lokalisiere Datensatz in Karte",se:"Leta upp dataset på kartan"},{en:"Open information panel",de:"Informationsfeld öffnen",se:"Öppet informationsfält"},{en:"Select a place in map",de:"Ort in der Karte auswählen",se:"Välj plats på kartan"},{en:"Add a point location in map",de:"Punkt zur Karte hinzufügen",se:"Lägg till punkt på kartan"},{en:"Draw a polygon area in map",de:"Polygonale Fläche in der Karte zeichnen",se:"Rita en polygonal yta på kartan"},{en:"Draw a circular area in map",de:"Kreisförmige Fläche in der Karte zeichnen",se:"Rita ett cirkulärt område på kartan"},{en:"Rename place",de:"Ort umbenennen",se:"Byt namn på plats"},{en:"Style place",de:"Ort stylen",se:"Styla plats"},{en:"Remove place",de:"Ort entfernen",se:"Ta bort plats"},{en:"Rename place group",de:"Ortsgruppe umbenennen",se:"Byt namn på platsgrupp"},{en:"Remove places",de:"Orte entfernen",se:"Ta bort platser"},{en:"Show RGB layer instead",de:"Stattdessen RGB-Layer anzeigen",se:"Visa RGB-lager istället"},{en:"Auto-step through times in the dataset",de:"Zeiten im Datensatz automatisch durchlaufen",se:"Kör automatiskt genom tider i dataposten"},{en:"First time step",de:"Erster Zeitschritt",se:"Första tidssteg"},{en:"Last time step",de:"Letzter Zeitschritt",se:"Sista tidssteg"},{en:"Previous time step",de:"Vorheriger Zeitschritt",se:"Föregående tidssteg"},{en:"Next time step",de:"Nächster Zeitschritt",se:"Nästa tidssteg"},{en:"Select time in dataset",de:"Datensatz-Zeit auswählen",se:"Välj tid i dataset"},{en:"Refresh",de:"Aktualisieren",se:"Att uppdatera"},{en:"Accept and continue",de:"Akzeptieren und weiter",se:"Acceptera och fortsätt"},{en:"Leave",de:"Verlassen",se:"Lämna"},{en:"Import places",de:"Orte importieren",se:"Importera platser"},{en:"Text/CSV",de:"Text/CSV",se:"Text/CSV"},{en:"GeoJSON",de:"GeoJSON",se:"GeoJSON"},{en:"WKT",de:"WKT",se:"WKT"},{en:"Enter text or drag & drop a text file.",de:"Text eingeben oder Textdatei per Drag & Drop einfügen.",se:"Skriv in text eller dra och släpp en textfil."},{en:"From File",de:"Aus Datei",se:"Från fil"},{en:"Clear",de:"Löschen",se:"Tömma"},{en:"Options",de:"Optionen",se:"Alternativ"},{en:"Time (UTC, ISO-format)",de:"Zeit (UTC, ISO-Format)",se:"Tid (UTC, ISO-format)"},{en:"Group",de:"Gruppe",se:"Grupp"},{en:"Label",de:"Label",se:"Etikett"},{en:"Time property names",de:"Eigenschaftsnamen für Zeit",se:"Gruppegendomsnamn"},{en:"Group property names",de:"Eigenschaftsnamen für Gruppe",se:"Gruppegendomsnamn"},{en:"Label property names",de:"Eigenschaftsnamen für Label",se:"Etikett egendomsnamn"},{en:"Group prefix (used as fallback)",de:"Gruppen-Präfix (als Fallback verwendet)",se:"Gruppprefix (används som reserv)"},{en:"Label prefix (used as fallback)",de:"Label-Präfix (als Fallback verwendet)",se:"Etikettprefix (används som reserv)"},{en:"X/longitude column names",de:"Spaltennamen für y/Längengrad",se:"X/longitud kolumnnamn"},{en:"Y/latitude column names",de:"Spaltennamen für y/Breitengrad",se:"Y/latitud kolumnnamn"},{en:"Geometry column names",de:"Spaltennamen für Geometrie",se:"Geometrikolumnnamn"},{en:"Time column names",de:"Spaltennamen für Zeit",se:"Tidskolumnnamn"},{en:"Group column names",de:"Spaltennamen für Gruppe",se:"Gruppkolumnnamn"},{en:"Label column names",de:"Spaltennamen für Label",se:"Etikettkolumnnamn"},{en:"Separator character",de:"Trennzeichen",se:"Skiljetecken"},{en:"Comment character",de:"Kommentar-Zeichen",se:"Kommentar karaktär"},{en:"Quote character",de:"Zitierzeichen",se:"Citat karaktär"},{en:"Escape character",de:"Escape character",se:"Escape karaktär"},{en:"Not-a-number token",de:"Token für 'keine Zahl'",se:"Not-a-number token"},{en:"True token",de:"Token für 'wahr'",se:"Sann token"},{en:"False token",de:"Token für 'falsch'",se:"Falsk token"},{en:"Revoke consent",de:"Zustimmung widerrufen",se:"Återkalla samtycke "},{en:"Accepted",de:"Akzeptiert",se:"Accepterad"},{en:"Legal Agreement",de:"Rechtliches Übereinkommen",se:"Laglig Överenskommelse"},{en:"Privacy Notice",de:"Datenschutzhinweis",se:"Sekretessmeddelande"},{en:"WMS URL",de:"WMS URL",se:"WMS URL"},{en:"WMS Layer",de:"WMS Layer",se:"WMS Lager"},{en:"Add layer from a Web Map Service",de:"Layer aus einem Web Map Service hinzufügen",se:"Lägg till lager från en Web Map Service"},{en:"Add layer from a Tiled Web Map",de:"Layer aus einer Tiled Web Map hinzufügen",se:"Lägg till lager från en Tiled Web Map"},{en:"Show or hide layers panel",de:"Layer-Bedienfeld ein- oder ausblenden",se:"Visa eller dölj panelen Lager"},{en:"Turn layer split mode on or off",de:"Layer-Split-Modus ein- oder ausschalten",se:"Aktivera eller inaktivera lagerdelningsläget"},{en:"Turn info box on or off",de:"Infobox ein- oder ausschalten",se:"Slå på eller av informationsrutan"},{en:"Show or hide sidebar",de:"Seitenleiste ein- oder ausblenden",se:"Visa eller dölja sidofält"},{en:"Unknown color bar",de:"Unbekannte Farbskala",se:"Färgskala okänd"},{en:"Points",de:"Punkte",se:"Punkter"},{en:"Lines",de:"Linien",se:"Linjer"},{en:"Bars",de:"Balken",se:"Staplar"},{en:"Default chart type",de:"Diagrammtyp (default)",se:"Diagramtyp (default)"},{en:"User Base Maps",de:"Nutzer Basiskarte",se:"Användare Grundkarta"},{en:"Overlay",de:"Overlay (überlagernder Layer)",se:"Overlay (överliggande lager)"},{en:"User Overlays",de:"Nutzer Overlay",se:"Användare Overlay"},{en:"On dataset selection",de:"Bei Auswahl von Datensatz",se:"Vid val av dataset"},{en:"On place selection",de:"Bei Auswahl von Ort",se:"Vid val av plats"},{en:"Do nothing",de:"Nichts tun",se:"Gör ingenting"},{en:"Pan",de:"Verschieben",se:"Panorera"},{en:"Pan and zoom",de:"Verschieben und zoom",se:"Panorera och zooma"},{en:"User Layers",de:"Nutzer Layer",se:"Användare lager"},{en:"XYZ Layer URL",de:"XYZ-Layer URL",se:"XYZ lager URL"},{en:"Layer Title",de:"Layer Titel",se:"Lagertitel "},{en:"Layer Attribution",de:"Layer Attribution",se:"Lagerattribution"},{en:"Info",de:"Info",se:"Info"},{en:"Charts",de:"Diagramme",se:"Diagrammer"},{en:"Statistics",de:"Statistik",se:"Statistik"},{en:"Volume",de:"Volumen",se:"Volym"},{en:"Toggle zoom mode (or press CTRL key)",de:"Zoom-Modus umschalten (oder drücke CTRL-Taste)",se:"Växla zoomläge (eller tryck på CTRL-tangenten)"},{en:"Enter fixed y-range",de:"Festen y-Bereich angeben",se:"Ange fast y-intervall"},{en:"Toggle showing info popup on hover",de:"Anzeige des Info-Popups bei Hover umschalten",se:"Växla visning av popup-info vid hover"},{en:"Show points",de:"Punkte anzeigen",se:"Visa punkter"},{en:"Show lines",de:"Linien anzeigen",se:"Visa linjer"},{en:"Show bars",de:"Balken anzeigen",se:"Visa staplar"},{en:"Show standard deviation (if any)",de:"Standardabweichung anzeigen",se:"Visa standardavvikelsen"},{en:"Add time-series from places",de:"Zeitserien hinzufügen von Orten",se:"Lägg till tidsserier från platser"},{en:"Zoom to full range",de:"Zoom auf gesamten x-Bereich",se:"Zooma till hela x-intervallet"},{en:"Make it 2nd variable for comparison",de:"Festlegen als 2. Variable für Vergleich",se:"Ställ in som 2:a variabel för jämförelse"},{en:"Load Volume Data",de:"Lade Volumendaten",se:"Ladda volymdata"},{en:"Please note that the 3D volume rendering is still an experimental feature.",de:"Bitte beachte, dass das 3D-Volumen-Rendering noch eine experimentelle Funktion ist.",se:"Observera att 3D-volymrendering fortfarande är en experimentell funktion."},{en:"User-defined color bars.",de:"Benutzerdefinierte Farbskalen.",se:"Användardefinierade färgskalor."},{en:"Contin.",de:"Kontin.",se:"Kontin."},{en:"Stepwise",de:"Schrittw.",se:"Stegvis"},{en:"Categ.",de:"Kateg.",se:"Kateg."},{en:"Continuous color assignment, where each value represents a support point of a color gradient",de:"Kontinuierliche Farbzuordnung, bei der jeder Wert eine Stützstelle eines Farbverlaufs darstellt",se:"Kontinuerlig färgtilldelning där varje värde representerar en punkt i en färggradient"},{en:"Stepwise color mapping where values are bounds of value ranges mapped to the same color",de:"Schrittweise Farbzuordnung, bei der die Werte Bereichsgrenzen darstellen, die einer einzelnen Farbe zugeordnet werden",se:"Gradvis färgmappning, där värdena representerar intervallgränser mappade till en enda färg"},{en:"Values represent unique categories or indexes that are mapped to a color",de:"Werte stellen eindeutige Kategorien oder Indizes dar, die einer Farbe zugeordnet sind",se:"Värden representerar unika kategorier eller index som är mappade till en färg"},{en:"User",de:"Nutzer",se:"Användare"},{en:"Add Time-Series",de:"Zeitserien hinzufügen",se:"Lägg till tidsserier"},{en:"No time-series have been obtained yet. Select a variable and a place first.",de:"Es wurden noch keine Zeitreihen abgerufen. Wähle zuerst eine Variable und einen Ort aus.",se:"Inga tidsserier har hämtats ännu. Välj först en variabel och en plats."},{en:"Count",de:"Anzahl",se:"Antal"},{en:"Minimum",de:"Minimum",se:"Minimum"},{en:"Maximum",de:"Maximum",se:"Maximum"},{en:"Mean",de:"Mittelwert",se:"Medelvärde"},{en:"Deviation",de:"Abweichung",se:"Avvikelse"},{en:"Toggle adjustable x-range",de:"Anpassbaren x-Bereich umschalten",se:"Växla justerbart x-intervall"},{en:"pinned",de:"angepinnt",se:"fäst"},{en:"Compare Mode (Drag)",de:"Vergleichsmodus (Ziehen)",se:"Jämförelseläge (Dra)"},{en:"Point Info Mode (Hover)",de:"Punktinformationsmodus (Bewegen)",se:"Punktinformationsläge (Sväva)"},{en:"Dataset RGB",de:"Datensatz RGB",se:"Dataset RGB"},{en:"Dataset RGB 2",de:"Datensatz RGB 2",se:"Dataset RGB 2"},{en:"Dataset Variable",de:"Datensatz Variable",se:"Dataset Variabel"},{en:"Dataset Variable 2",de:"Datensatz Variable 2",se:"Dataset Variabel 2"},{en:"Dataset Boundary",de:"Datensatz Außengrenze",se:"Dataset Yttre Gräns"},{en:"Dataset Places",de:"Datensatz Orte",se:"Dataset Platser"},{en:"User Places",de:"Nutzer Orte",se:"Användare Platser"},{en:"Layers",de:"Layer",se:"Lager"},{en:"User Variables",de:"Nutzer-Variablen",se:"Användarvariabler"},{en:"Create and manage user variables",de:"Nutzer-Variablen erstellen und verwalten",se:"Skapa och hantera användarvariabler"},{en:"Manage user variables",de:"Nutzer-Variablen verwalten",se:"Hantera användarvariabler"},{en:"Add user variable",de:"Nutzer-Variable hinzufügen",se:"Lägg till användarvariabel"},{en:"Duplicate user variable",de:"Nutzer-Variable duplizieren",se:"Duplicera användarvariabel"},{en:"Edit user variable",de:"Nutzer-Variable bearbeiten",se:"Redigera användarvariabel"},{en:"Remove user variable",de:"Nutzer-Variable löschen",se:"Ta bort användarvariabel"},{en:"Use keys CTRL+SPACE to show autocompletions",de:"Tasten STRG+LEER benutzen, um Autovervollständigungen zu zeigen",se:"Använd tangenterna CTRL+MELLANSLAG för att visa autoslutföranden"},{en:"Display further elements to be used in expressions",de:"Weitere Elemente anzeigen, die in Ausdrücken verwendet werden können",se:"Visa fler element som kan användas i uttryck"},{en:"Variables",de:"Variablen",se:"Variabler"},{en:"Constants",de:"Konstanten",se:"Konstanter"},{en:"Array operators",de:"Array-Operatoren",se:"Arrayoperatorer"},{en:"Other operators",de:"Andere Operatoren",se:"Andra Operatorer"},{en:"Array functions",de:"Array-Funktionen",se:"Arrayfunktioner"},{en:"Other functions",de:"Andere Funktionen",se:"Andra funktioner"},{en:"Not a valid identifier",de:"Kein gültiger Bezeichner",se:"Inte en giltig identifierare"},{en:"Must not be empty",de:"Darf nicht leer sein",se:"Får inte vara tom"},{en:"Textual format",de:"Textformat",se:"Textformat"},{en:"Tabular format",de:"Tabellenformat",se:"Tabellformat"},{en:"JSON format",de:"JSON-Format",se:"JSON-format"},{en:"docs/privacy-note.en.md",de:"docs/privacy-note.de.md",se:"docs/privacy-note.se.md"},{en:"docs/add-layer-wms.en.md",de:"docs/add-layer-wms.de.md",se:"docs/add-layer-wms.se.md"},{en:"docs/add-layer-xyz.en.md",de:"docs/add-layer-xyz.de.md",se:"docs/add-layer-xyz.se.md"},{en:"docs/color-mappings.en.md",de:"docs/color-mappings.de.md",se:"docs/color-mappings.se.md"},{en:"docs/user-variables.en.md",de:"docs/user-variables.de.md",se:"docs/user-variables.se.md"},{en:"docs/dev-reference.en.md",de:"docs/dev-reference.en.md",se:"docs/dev-reference.en.md"}],lht={languages:sht,dictionary:aht},me=new iht(lht);me.locale=oht();class GPe extends D.Component{constructor(e){super(e),this.state={error:null}}static getDerivedStateFromError(e){return{error:e}}componentDidCatch(e,n){console.error(e),n.componentStack&&console.error(n.componentStack)}render(){if(!this.props.children)throw new Error("An ErrorBoundary requires at least one child");return this.state.error?C.jsxs("div",{children:[C.jsx("h2",{className:"errorBoundary-header",children:me.get("Something went wrong.")}),C.jsxs("details",{className:"errorBoundary-details",style:{whiteSpace:"pre-wrap"},children:[this.state.error.toString(),C.jsx("br",{})]})]}):this.props.children}}const cht=({children:t})=>{const e=Pn.instance.authClient;if(!e)return C.jsx(C.Fragment,{children:t});const n=o=>{console.info("handleSigninCallback:",o),window.history.replaceState({},document.title,window.location.pathname)},r=()=>{console.info("handleRemoveUser"),window.location.pathname="/"},i=w4.href;return C.jsx(GPe,{children:C.jsx(tht,{...e,loadUserInfo:!0,scope:"openid email profile",automaticSilentRenew:!0,redirect_uri:i,post_logout_redirect_uri:i,popup_post_logout_redirect_uri:i,onSigninCallback:n,onRemoveUser:r,children:t})})},HPe=ct(C.jsx("path",{d:"M11 18h2v-2h-2zm1-16C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8m0-14c-2.21 0-4 1.79-4 4h2c0-1.1.9-2 2-2s2 .9 2 2c0 2-3 1.75-3 5h2c0-2.25 3-2.5 3-5 0-2.21-1.79-4-4-4"}),"HelpOutline"),qPe=ct(C.jsx("path",{d:"M19.14 12.94c.04-.3.06-.61.06-.94 0-.32-.02-.64-.07-.94l2.03-1.58c.18-.14.23-.41.12-.61l-1.92-3.32c-.12-.22-.37-.29-.59-.22l-2.39.96c-.5-.38-1.03-.7-1.62-.94l-.36-2.54c-.04-.24-.24-.41-.48-.41h-3.84c-.24 0-.43.17-.47.41l-.36 2.54c-.59.24-1.13.57-1.62.94l-2.39-.96c-.22-.08-.47 0-.59.22L2.74 8.87c-.12.21-.08.47.12.61l2.03 1.58c-.05.3-.09.63-.09.94s.02.64.07.94l-2.03 1.58c-.18.14-.23.41-.12.61l1.92 3.32c.12.22.37.29.59.22l2.39-.96c.5.38 1.03.7 1.62.94l.36 2.54c.05.24.24.41.48.41h3.84c.24 0 .44-.17.47-.41l.36-2.54c.59-.24 1.13-.56 1.62-.94l2.39.96c.22.08.47 0 .59-.22l1.92-3.32c.12-.22.07-.47-.12-.61zM12 15.6c-1.98 0-3.6-1.62-3.6-3.6s1.62-3.6 3.6-3.6 3.6 1.62 3.6 3.6-1.62 3.6-3.6 3.6"}),"Settings"),XPe=ct(C.jsx("path",{d:"M17.65 6.35C16.2 4.9 14.21 4 12 4c-4.42 0-7.99 3.58-7.99 8s3.57 8 7.99 8c3.73 0 6.84-2.55 7.73-6h-2.08c-.82 2.33-3.04 4-5.65 4-3.31 0-6-2.69-6-6s2.69-6 6-6c1.66 0 3.14.69 4.22 1.78L13 11h7V4z"}),"Refresh"),uht=ct([C.jsx("path",{d:"m21 5-9-4-9 4v6c0 5.55 3.84 10.74 9 12 2.3-.56 4.33-1.9 5.88-3.71l-3.12-3.12c-1.94 1.29-4.58 1.07-6.29-.64-1.95-1.95-1.95-5.12 0-7.07s5.12-1.95 7.07 0c1.71 1.71 1.92 4.35.64 6.29l2.9 2.9C20.29 15.69 21 13.38 21 11z"},"0"),C.jsx("circle",{cx:"12",cy:"12",r:"3"},"1")],"Policy"),YPe=ct(C.jsx("path",{d:"M19.35 10.04C18.67 6.59 15.64 4 12 4 9.11 4 6.6 5.64 5.35 8.04 2.34 8.36 0 10.91 0 14c0 3.31 2.69 6 6 6h13c2.76 0 5-2.24 5-5 0-2.64-2.05-4.78-4.65-4.96M17 13l-5 5-5-5h3V9h4v4z"}),"CloudDownload");var BF="NOT_FOUND";function fht(t){var e;return{get:function(r){return e&&t(e.key,r)?e.value:BF},put:function(r,i){e={key:r,value:i}},getEntries:function(){return e?[e]:[]},clear:function(){e=void 0}}}function dht(t,e){var n=[];function r(a){var l=n.findIndex(function(u){return e(a,u.key)});if(l>-1){var c=n[l];return l>0&&(n.splice(l,1),n.unshift(c)),c.value}return BF}function i(a,l){r(a)===BF&&(n.unshift({key:a,value:l}),n.length>t&&n.pop())}function o(){return n}function s(){n=[]}return{get:r,put:i,getEntries:o,clear:s}}var hht=function(e,n){return e===n};function pht(t){return function(n,r){if(n===null||r===null||n.length!==r.length)return!1;for(var i=n.length,o=0;o1?e-1:0),r=1;r"u"&&(o=t.call(this,r),e.set(i,o)),o}function ZPe(t,e,n){var r=Array.prototype.slice.call(arguments,3),i=n(r),o=e.get(i);return typeof o>"u"&&(o=t.apply(this,r),e.set(i,o)),o}function nte(t,e,n,r,i){return n.bind(e,t,r,i)}function xht(t,e){var n=t.length===1?KPe:ZPe;return nte(t,this,n,e.cache.create(),e.serializer)}function bht(t,e){var n=ZPe;return nte(t,this,n,e.cache.create(),e.serializer)}function wht(t,e){var n=KPe;return nte(t,this,n,e.cache.create(),e.serializer)}function _ht(){return JSON.stringify(arguments)}function S4(){this.cache=Object.create(null)}S4.prototype.has=function(t){return t in this.cache};S4.prototype.get=function(t){return this.cache[t]};S4.prototype.set=function(t,e){this.cache[t]=e};var Sht={create:function(){return new S4}};tte.exports=vht;tte.exports.strategies={variadic:bht,monadic:wht};var Cht=tte.exports;const Oht=sn(Cht);function $t(){return function(){throw new Error("Unimplemented abstract method.")}()}var Eht=0;function or(t){return t.ol_uid||(t.ol_uid=String(++Eht))}var Tht="6.15.1",kht=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),JPe=function(t){kht(e,t);function e(n){var r=this,i="v"+Tht.split("-")[0],o="Assertion failed. See https://openlayers.org/en/"+i+"/doc/errors/#"+n+" for details.";return r=t.call(this,o)||this,r.code=n,r.name="AssertionError",r.message=o,r}return e}(Error),Lh=function(){function t(e){this.propagationStopped,this.defaultPrevented,this.type=e,this.target=null}return t.prototype.preventDefault=function(){this.defaultPrevented=!0},t.prototype.stopPropagation=function(){this.propagationStopped=!0},t}();const OS={PROPERTYCHANGE:"propertychange"};var rte=function(){function t(){this.disposed=!1}return t.prototype.dispose=function(){this.disposed||(this.disposed=!0,this.disposeInternal())},t.prototype.disposeInternal=function(){},t}();function Aht(t,e,n){for(var r,i,o=ob,s=0,a=t.length,l=!1;s>1),i=+o(t[r],e),i<0?s=r+1:(a=r,l=!i);return l?s:~s}function ob(t,e){return t>e?1:t0){for(i=1;i0?i-1:i:t[i-1]-e0||s===0)})}function Mx(){return!0}function IM(){return!1}function sb(){}function Rht(t){var e=!1,n,r,i;return function(){var o=Array.prototype.slice.call(arguments);return(!e||this!==i||!Zb(o,r))&&(e=!0,i=this,r=o,n=t.apply(this,arguments)),n}}var hi=typeof Object.assign=="function"?Object.assign:function(t,e){if(t==null)throw new TypeError("Cannot convert undefined or null to object");for(var n=Object(t),r=1,i=arguments.length;r0:!1},e.prototype.removeEventListener=function(n,r){var i=this.listeners_&&this.listeners_[n];if(i){var o=i.indexOf(r);o!==-1&&(this.pendingRemovals_&&n in this.pendingRemovals_?(i[o]=sb,++this.pendingRemovals_[n]):(i.splice(o,1),i.length===0&&delete this.listeners_[n]))}},e}(rte);const nn={CHANGE:"change",ERROR:"error",BLUR:"blur",CLEAR:"clear",CONTEXTMENU:"contextmenu",CLICK:"click",DBLCLICK:"dblclick",DRAGENTER:"dragenter",DRAGOVER:"dragover",DROP:"drop",FOCUS:"focus",KEYDOWN:"keydown",KEYPRESS:"keypress",LOAD:"load",RESIZE:"resize",TOUCHMOVE:"touchmove",WHEEL:"wheel"};function zn(t,e,n,r,i){if(r&&r!==t&&(n=n.bind(r)),i){var o=n;n=function(){t.removeEventListener(e,n),o.apply(this,arguments)}}var s={target:t,type:e,listener:n};return t.addEventListener(e,n),s}function UF(t,e,n,r){return zn(t,e,n,r,!0)}function oi(t){t&&t.target&&(t.target.removeEventListener(t.type,t.listener),LM(t))}var Iht=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),$M=function(t){Iht(e,t);function e(){var n=t.call(this)||this;return n.on=n.onInternal,n.once=n.onceInternal,n.un=n.unInternal,n.revision_=0,n}return e.prototype.changed=function(){++this.revision_,this.dispatchEvent(nn.CHANGE)},e.prototype.getRevision=function(){return this.revision_},e.prototype.onInternal=function(n,r){if(Array.isArray(n)){for(var i=n.length,o=new Array(i),s=0;s0;)this.pop()},e.prototype.extend=function(n){for(var r=0,i=n.length;r=0||Jv.match(/cpu (os|iphone os) 15_4 like mac os x/));var jht=Jv.indexOf("webkit")!==-1&&Jv.indexOf("edge")==-1,Bht=Jv.indexOf("macintosh")!==-1,rMe=typeof devicePixelRatio<"u"?devicePixelRatio:1,C4=typeof WorkerGlobalScope<"u"&&typeof OffscreenCanvas<"u"&&self instanceof WorkerGlobalScope,Uht=typeof Image<"u"&&Image.prototype.decode,iMe=function(){var t=!1;try{var e=Object.defineProperty({},"passive",{get:function(){t=!0}});window.addEventListener("_",null,e),window.removeEventListener("_",null,e)}catch{}return t}();new Array(6);function ch(){return[1,0,0,1,0,0]}function Wht(t,e,n,r,i,o,s){return t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=o,t[5]=s,t}function Vht(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t}function Bi(t,e){var n=e[0],r=e[1];return e[0]=t[0]*n+t[2]*r+t[4],e[1]=t[1]*n+t[3]*r+t[5],e}function Ght(t,e,n){return Wht(t,e,0,0,n,0,0)}function Pg(t,e,n,r,i,o,s,a){var l=Math.sin(o),c=Math.cos(o);return t[0]=r*c,t[1]=i*l,t[2]=-r*l,t[3]=i*c,t[4]=s*r*c-a*r*l+e,t[5]=s*i*l+a*i*c+n,t}function ote(t,e){var n=Hht(e);bn(n!==0,32);var r=e[0],i=e[1],o=e[2],s=e[3],a=e[4],l=e[5];return t[0]=s/n,t[1]=-i/n,t[2]=-o/n,t[3]=r/n,t[4]=(o*l-s*a)/n,t[5]=-(r*l-i*a)/n,t}function Hht(t){return t[0]*t[3]-t[1]*t[2]}var bhe;function oMe(t){var e="matrix("+t.join(", ")+")";if(C4)return e;var n=bhe||(bhe=document.createElement("div"));return n.style.transform=e,n.style.transform}const Po={UNKNOWN:0,INTERSECTING:1,ABOVE:2,RIGHT:4,BELOW:8,LEFT:16};function whe(t){for(var e=_c(),n=0,r=t.length;ni&&(l=l|Po.RIGHT),ao&&(l=l|Po.ABOVE),l===Po.UNKNOWN&&(l=Po.INTERSECTING),l}function _c(){return[1/0,1/0,-1/0,-1/0]}function Bf(t,e,n,r,i){return i?(i[0]=t,i[1]=e,i[2]=n,i[3]=r,i):[t,e,n,r]}function NM(t){return Bf(1/0,1/0,-1/0,-1/0,t)}function Xht(t,e){var n=t[0],r=t[1];return Bf(n,r,n,r,e)}function aMe(t,e,n,r,i){var o=NM(i);return cMe(o,t,e,n,r)}function cA(t,e){return t[0]==e[0]&&t[2]==e[2]&&t[1]==e[1]&&t[3]==e[3]}function lMe(t,e){return e[0]t[2]&&(t[2]=e[2]),e[1]t[3]&&(t[3]=e[3]),t}function ek(t,e){e[0]t[2]&&(t[2]=e[0]),e[1]t[3]&&(t[3]=e[1])}function cMe(t,e,n,r,i){for(;ne[0]?r[0]=t[0]:r[0]=e[0],t[1]>e[1]?r[1]=t[1]:r[1]=e[1],t[2]=e[0]&&t[1]<=e[3]&&t[3]>=e[1]}function fte(t){return t[2]=s&&g<=l),!r&&o&Po.RIGHT&&!(i&Po.RIGHT)&&(m=h-(d-l)*p,r=m>=a&&m<=c),!r&&o&Po.BELOW&&!(i&Po.BELOW)&&(g=d-(h-a)/p,r=g>=s&&g<=l),!r&&o&Po.LEFT&&!(i&Po.LEFT)&&(m=h-(d-s)*p,r=m>=a&&m<=c)}return r}function Jht(t,e,n,r){var i=[],o;i=[t[0],t[1],t[2],t[1],t[2],t[3],t[0],t[3]],e(i,i,2);for(var s=[],a=[],o=0,l=i.length;o=n[2])){var i=Kr(n),o=Math.floor((r[0]-n[0])/i),s=o*i;t[0]-=s,t[2]-=s}return t}function ept(t,e){if(e.canWrapX()){var n=e.getExtent();if(!isFinite(t[0])||!isFinite(t[2]))return[[n[0],t[1],n[2],t[3]]];uMe(t,e);var r=Kr(n);if(Kr(t)>r)return[[n[0],t[1],n[2],t[3]]];if(t[0]n[2])return[[t[0],t[1],n[2],t[3]],[n[0],t[1],t[2]-r,t[3]]]}return[t]}var fMe=function(){function t(e){this.code_=e.code,this.units_=e.units,this.extent_=e.extent!==void 0?e.extent:null,this.worldExtent_=e.worldExtent!==void 0?e.worldExtent:null,this.axisOrientation_=e.axisOrientation!==void 0?e.axisOrientation:"enu",this.global_=e.global!==void 0?e.global:!1,this.canWrapX_=!!(this.global_&&this.extent_),this.getPointResolutionFunc_=e.getPointResolution,this.defaultTileGrid_=null,this.metersPerUnit_=e.metersPerUnit}return t.prototype.canWrapX=function(){return this.canWrapX_},t.prototype.getCode=function(){return this.code_},t.prototype.getExtent=function(){return this.extent_},t.prototype.getUnits=function(){return this.units_},t.prototype.getMetersPerUnit=function(){return this.metersPerUnit_||jf[this.units_]},t.prototype.getWorldExtent=function(){return this.worldExtent_},t.prototype.getAxisOrientation=function(){return this.axisOrientation_},t.prototype.isGlobal=function(){return this.global_},t.prototype.setGlobal=function(e){this.global_=e,this.canWrapX_=!!(e&&this.extent_)},t.prototype.getDefaultTileGrid=function(){return this.defaultTileGrid_},t.prototype.setDefaultTileGrid=function(e){this.defaultTileGrid_=e},t.prototype.setExtent=function(e){this.extent_=e,this.canWrapX_=!!(this.global_&&e)},t.prototype.setWorldExtent=function(e){this.worldExtent_=e},t.prototype.setGetPointResolution=function(e){this.getPointResolutionFunc_=e},t.prototype.getPointResolutionFunc=function(){return this.getPointResolutionFunc_},t}();function oo(t,e,n){return Math.min(Math.max(t,e),n)}var tpt=function(){var t;return"cosh"in Math?t=Math.cosh:t=function(e){var n=Math.exp(e);return(n+1/n)/2},t}(),npt=function(){var t;return"log2"in Math?t=Math.log2:t=function(e){return Math.log(e)*Math.LOG2E},t}();function rpt(t,e,n,r,i,o){var s=i-n,a=o-r;if(s!==0||a!==0){var l=((t-n)*s+(e-r)*a)/(s*s+a*a);l>1?(n=i,r=o):l>0&&(n+=s*l,r+=a*l)}return Rx(t,e,n,r)}function Rx(t,e,n,r){var i=n-t,o=r-e;return i*i+o*o}function ipt(t){for(var e=t.length,n=0;ni&&(i=s,r=o)}if(i===0)return null;var a=t[r];t[r]=t[n],t[n]=a;for(var l=n+1;l=0;d--){f[d]=t[d][e]/t[d][d];for(var h=d-1;h>=0;h--)t[h][e]-=t[h][d]*f[d]}return f}function a3(t){return t*Math.PI/180}function Lv(t,e){var n=t%e;return n*e<0?n+e:n}function Rp(t,e,n){return t+n*(e-t)}function dMe(t,e){var n=Math.pow(10,e);return Math.round(t*n)/n}function lI(t,e){return Math.floor(dMe(t,e))}function cI(t,e){return Math.ceil(dMe(t,e))}var opt=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),zM=6378137,r_=Math.PI*zM,spt=[-r_,-r_,r_,r_],apt=[-180,-85,180,85],uI=zM*Math.log(Math.tan(Math.PI/2)),z1=function(t){opt(e,t);function e(n){return t.call(this,{code:n,units:Io.METERS,extent:spt,global:!0,worldExtent:apt,getPointResolution:function(r,i){return r/tpt(i[1]/zM)}})||this}return e}(fMe),_he=[new z1("EPSG:3857"),new z1("EPSG:102100"),new z1("EPSG:102113"),new z1("EPSG:900913"),new z1("http://www.opengis.net/def/crs/EPSG/0/3857"),new z1("http://www.opengis.net/gml/srs/epsg.xml#3857")];function lpt(t,e,n){var r=t.length,i=n>1?n:2,o=e;o===void 0&&(i>2?o=t.slice():o=new Array(r));for(var s=0;suI?a=uI:a<-uI&&(a=-uI),o[s+1]=a}return o}function cpt(t,e,n){var r=t.length,i=n>1?n:2,o=e;o===void 0&&(i>2?o=t.slice():o=new Array(r));for(var s=0;ss)return 1;if(s>o)return-1}return 0}function vpt(t,e){return t[0]+=+e[0],t[1]+=+e[1],t}function VF(t,e){for(var n=!0,r=t.length-1;r>=0;--r)if(t[r]!=e[r]){n=!1;break}return n}function dte(t,e){var n=Math.cos(e),r=Math.sin(e),i=t[0]*n-t[1]*r,o=t[1]*n+t[0]*r;return t[0]=i,t[1]=o,t}function ypt(t,e){return t[0]*=e,t[1]*=e,t}function xpt(t,e){var n=t[0]-e[0],r=t[1]-e[1];return n*n+r*r}function hMe(t,e){if(e.canWrapX()){var n=Kr(e.getExtent()),r=bpt(t,e,n);r&&(t[0]-=r*n)}return t}function bpt(t,e,n){var r=e.getExtent(),i=0;if(e.canWrapX()&&(t[0]r[2])){var o=n||Kr(r);i=Math.floor((t[0]-r[0])/o)}return i}var wpt=63710088e-1;function Ohe(t,e,n){var r=wpt,i=a3(t[1]),o=a3(e[1]),s=(o-i)/2,a=a3(e[0]-t[0])/2,l=Math.sin(s)*Math.sin(s)+Math.sin(a)*Math.sin(a)*Math.cos(i)*Math.cos(o);return 2*r*Math.atan2(Math.sqrt(l),Math.sqrt(1-l))}var xq=!0;function _pt(t){var e=!0;xq=!e}function hte(t,e,n){var r;if(e!==void 0){for(var i=0,o=t.length;i=-180&&t[0]<=180&&t[1]>=-90&&t[1]<=90&&(xq=!1,console.warn("Call useGeographic() from ol/proj once to work with [longitude, latitude] coordinates.")),t}function mMe(t,e){return t}function ux(t,e){return t}function kpt(){Ehe(_he),Ehe(Che),Opt(Che,_he,lpt,cpt)}kpt();function Dx(t,e,n,r,i,o){for(var s=o||[],a=0,l=e;l1)f=n;else if(d>0){for(var h=0;hi&&(i=c),o=a,s=l}return i}function yte(t,e,n,r,i){for(var o=0,s=n.length;o0;){for(var f=c.pop(),d=c.pop(),h=0,p=t[d],g=t[d+1],m=t[f],v=t[f+1],y=d+r;yh&&(u=y,h=w)}h>i&&(l[(u-e)/r]=1,d+r0&&g>h)&&(p<0&&m0&&m>p)){c=f,u=d;continue}o[s++]=c,o[s++]=u,a=c,l=u,c=f,u=d}}return o[s++]=c,o[s++]=u,s}function bMe(t,e,n,r,i,o,s,a){for(var l=0,c=n.length;lo&&(c-a)*(o-l)-(i-a)*(u-l)>0&&s++:u<=o&&(c-a)*(o-l)-(i-a)*(u-l)<0&&s--,a=c,l=u}return s!==0}function Ste(t,e,n,r,i,o){if(n.length===0||!fx(t,e,n[0],r,i,o))return!1;for(var s=1,a=n.length;sb&&(c=(u+f)/2,Ste(t,e,n,r,c,p)&&(x=c,b=w)),u=f}return isNaN(x)&&(x=i[o]),s?(s.push(x,p,b),s):[x,p,b]}function Gpt(t,e,n,r,i){for(var o=[],s=0,a=n.length;s=i[0]&&o[2]<=i[2]||o[1]>=i[1]&&o[3]<=i[3]?!0:CMe(t,e,n,r,function(s,a){return Zht(i,s,a)}):!1}function Hpt(t,e,n,r,i){for(var o=0,s=n.length;o0}function kMe(t,e,n,r,i){for(var o=0,s=n.length;o1?s:2,b=o||new Array(x),p=0;p>1;i0&&t[1]>0}function MMe(t,e,n){return n===void 0&&(n=[0,0]),n[0]=t[0]*e+.5|0,n[1]=t[1]*e+.5|0,n}function Jl(t,e){return Array.isArray(t)?t:(e===void 0?e=[t,t]:(e[0]=t,e[1]=t),e)}var RMe=function(){function t(e){this.opacity_=e.opacity,this.rotateWithView_=e.rotateWithView,this.rotation_=e.rotation,this.scale_=e.scale,this.scaleArray_=Jl(e.scale),this.displacement_=e.displacement,this.declutterMode_=e.declutterMode}return t.prototype.clone=function(){var e=this.getScale();return new t({opacity:this.getOpacity(),scale:Array.isArray(e)?e.slice():e,rotation:this.getRotation(),rotateWithView:this.getRotateWithView(),displacement:this.getDisplacement().slice(),declutterMode:this.getDeclutterMode()})},t.prototype.getOpacity=function(){return this.opacity_},t.prototype.getRotateWithView=function(){return this.rotateWithView_},t.prototype.getRotation=function(){return this.rotation_},t.prototype.getScale=function(){return this.scale_},t.prototype.getScaleArray=function(){return this.scaleArray_},t.prototype.getDisplacement=function(){return this.displacement_},t.prototype.getDeclutterMode=function(){return this.declutterMode_},t.prototype.getAnchor=function(){return $t()},t.prototype.getImage=function(e){return $t()},t.prototype.getHitDetectionImage=function(){return $t()},t.prototype.getPixelRatio=function(e){return 1},t.prototype.getImageState=function(){return $t()},t.prototype.getImageSize=function(){return $t()},t.prototype.getOrigin=function(){return $t()},t.prototype.getSize=function(){return $t()},t.prototype.setDisplacement=function(e){this.displacement_=e},t.prototype.setOpacity=function(e){this.opacity_=e},t.prototype.setRotateWithView=function(e){this.rotateWithView_=e},t.prototype.setRotation=function(e){this.rotation_=e},t.prototype.setScale=function(e){this.scale_=e,this.scaleArray_=Jl(e)},t.prototype.listenImageChange=function(e){$t()},t.prototype.load=function(){$t()},t.prototype.unlistenImageChange=function(e){$t()},t}(),tgt=/^#([a-f0-9]{3}|[a-f0-9]{4}(?:[a-f0-9]{2}){0,2})$/i,ngt=/^([a-z]*)$|^hsla?\(.*\)$/i;function DMe(t){return typeof t=="string"?t:IMe(t)}function rgt(t){var e=document.createElement("div");if(e.style.color=t,e.style.color!==""){document.body.appendChild(e);var n=getComputedStyle(e).color;return document.body.removeChild(e),n}else return""}var igt=function(){var t=1024,e={},n=0;return function(r){var i;if(e.hasOwnProperty(r))i=e[r];else{if(n>=t){var o=0;for(var s in e)o++&3||(delete e[s],--n)}i=ogt(r),e[r]=i,++n}return i}}();function qF(t){return Array.isArray(t)?t:igt(t)}function ogt(t){var e,n,r,i,o;if(ngt.exec(t)&&(t=rgt(t)),tgt.exec(t)){var s=t.length-1,a=void 0;s<=4?a=1:a=2;var l=s===4||s===8;e=parseInt(t.substr(1+0*a,a),16),n=parseInt(t.substr(1+1*a,a),16),r=parseInt(t.substr(1+2*a,a),16),l?i=parseInt(t.substr(1+3*a,a),16):i=255,a==1&&(e=(e<<4)+e,n=(n<<4)+n,r=(r<<4)+r,l&&(i=(i<<4)+i)),o=[e,n,r,i/255]}else t.indexOf("rgba(")==0?(o=t.slice(5,-1).split(",").map(Number),Dhe(o)):t.indexOf("rgb(")==0?(o=t.slice(4,-1).split(",").map(Number),o.push(1),Dhe(o)):bn(!1,14);return o}function Dhe(t){return t[0]=oo(t[0]+.5|0,0,255),t[1]=oo(t[1]+.5|0,0,255),t[2]=oo(t[2]+.5|0,0,255),t[3]=oo(t[3],0,1),t}function IMe(t){var e=t[0];e!=(e|0)&&(e=e+.5|0);var n=t[1];n!=(n|0)&&(n=n+.5|0);var r=t[2];r!=(r|0)&&(r=r+.5|0);var i=t[3]===void 0?1:Math.round(t[3]*100)/100;return"rgba("+e+","+n+","+r+","+i+")"}function Xd(t){return Array.isArray(t)?IMe(t):t}function Sc(t,e,n,r){var i;return n&&n.length?i=n.shift():C4?i=new OffscreenCanvas(t||300,e||300):i=document.createElement("canvas"),t&&(i.width=t),e&&(i.height=e),i.getContext("2d",r)}function LMe(t){var e=t.canvas;e.width=1,e.height=1,t.clearRect(0,0,1,1)}function Ihe(t,e){var n=e.parentNode;n&&n.replaceChild(t,e)}function Oq(t){return t&&t.parentNode?t.parentNode.removeChild(t):null}function sgt(t){for(;t.lastChild;)t.removeChild(t.lastChild)}function agt(t,e){for(var n=t.childNodes,r=0;;++r){var i=n[r],o=e[r];if(!i&&!o)break;if(i!==o){if(!i){t.appendChild(o);continue}if(!o){t.removeChild(i),--r;continue}t.insertBefore(o,i)}}}var fI="ol-hidden",jM="ol-unselectable",Cte="ol-control",Lhe="ol-collapsed",lgt=new RegExp(["^\\s*(?=(?:(?:[-a-z]+\\s*){0,2}(italic|oblique))?)","(?=(?:(?:[-a-z]+\\s*){0,2}(small-caps))?)","(?=(?:(?:[-a-z]+\\s*){0,2}(bold(?:er)?|lighter|[1-9]00 ))?)","(?:(?:normal|\\1|\\2|\\3)\\s*){0,3}((?:xx?-)?","(?:small|large)|medium|smaller|larger|[\\.\\d]+(?:\\%|in|[cem]m|ex|p[ctx]))","(?:\\s*\\/\\s*(normal|[\\.\\d]+(?:\\%|in|[cem]m|ex|p[ctx])?))",`?\\s*([-,\\"\\'\\sa-z]+?)\\s*$`].join(""),"i"),$he=["style","variant","weight","size","lineHeight","family"],$Me=function(t){var e=t.match(lgt);if(!e)return null;for(var n={lineHeight:"normal",size:"1.2em",style:"normal",weight:"normal",variant:"normal"},r=0,i=$he.length;r=t.maxResolution)return!1;var r=e.zoom;return r>t.minZoom&&r<=t.maxZoom}function Jgt(t,e,n,r,i){EMe(t,e,n||0,r||t.length-1,i||emt)}function EMe(t,e,n,r,i){for(;r>n;){if(r-n>600){var o=r-n+1,s=e-n+1,a=Math.log(o),l=.5*Math.exp(2*a/3),c=.5*Math.sqrt(a*l*(o-l)/o)*(s-o/2<0?-1:1),u=Math.max(n,Math.floor(e-s*l/o+c)),f=Math.min(r,Math.floor(e+(o-s)*l/o+c));EMe(t,e,u,f,i)}var d=t[e],h=n,p=r;for($E(t,n,e),i(t[r],d)>0&&$E(t,n,r);h0;)p--}i(t[n],d)===0?$E(t,n,p):(p++,$E(t,p,r)),p<=e&&(n=p+1),e<=p&&(r=p-1)}}function $E(t,e,n){var r=t[e];t[e]=t[n],t[n]=r}function emt(t,e){return te?1:0}let TMe=class{constructor(e=9){this._maxEntries=Math.max(4,e),this._minEntries=Math.max(2,Math.ceil(this._maxEntries*.4)),this.clear()}all(){return this._all(this.data,[])}search(e){let n=this.data;const r=[];if(!vI(e,n))return r;const i=this.toBBox,o=[];for(;n;){for(let s=0;s=0&&o[n].children.length>this._maxEntries;)this._split(o,n),n--;this._adjustParentBBoxes(i,o,n)}_split(e,n){const r=e[n],i=r.children.length,o=this._minEntries;this._chooseSplitAxis(r,o,i);const s=this._chooseSplitIndex(r,o,i),a=Iw(r.children.splice(s,r.children.length-s));a.height=r.height,a.leaf=r.leaf,jb(r,this.toBBox),jb(a,this.toBBox),n?e[n-1].children.push(a):this._splitRoot(r,a)}_splitRoot(e,n){this.data=Iw([e,n]),this.data.height=e.height+1,this.data.leaf=!1,jb(this.data,this.toBBox)}_chooseSplitIndex(e,n,r){let i,o=1/0,s=1/0;for(let a=n;a<=r-n;a++){const l=Z2(e,0,a,this.toBBox),c=Z2(e,a,r,this.toBBox),u=omt(l,c),f=dW(l)+dW(c);u=n;c--){const u=e.children[c];J2(a,e.leaf?o(u):u),l+=mI(a)}return l}_adjustParentBBoxes(e,n,r){for(let i=r;i>=0;i--)J2(n[i],e)}_condense(e){for(let n=e.length-1,r;n>=0;n--)e[n].children.length===0?n>0?(r=e[n-1].children,r.splice(r.indexOf(e[n]),1)):this.clear():jb(e[n],this.toBBox)}};function tmt(t,e,n){if(!n)return e.indexOf(t);for(let r=0;r=t.minX&&e.maxY>=t.minY}function Iw(t){return{children:t,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function Che(t,e,n,r,i){const o=[e,n];for(;o.length;){if(n=o.pop(),e=o.pop(),n-e<=r)continue;const s=e+Math.ceil((n-e)/r/2)*r;Jgt(t,s,e,n,i),o.push(e,s,s,n)}}var smt=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),Ohe={RENDER_ORDER:"renderOrder"},amt=function(t){smt(e,t);function e(n){var r=this,i=n||{},o=fi({},i);return delete o.style,delete o.renderBuffer,delete o.updateWhileAnimating,delete o.updateWhileInteracting,r=t.call(this,o)||this,r.declutter_=i.declutter!==void 0?i.declutter:!1,r.renderBuffer_=i.renderBuffer!==void 0?i.renderBuffer:100,r.style_=null,r.styleFunction_=void 0,r.setStyle(i.style),r.updateWhileAnimating_=i.updateWhileAnimating!==void 0?i.updateWhileAnimating:!1,r.updateWhileInteracting_=i.updateWhileInteracting!==void 0?i.updateWhileInteracting:!1,r}return e.prototype.getDeclutter=function(){return this.declutter_},e.prototype.getFeatures=function(n){return t.prototype.getFeatures.call(this,n)},e.prototype.getRenderBuffer=function(){return this.renderBuffer_},e.prototype.getRenderOrder=function(){return this.get(Ohe.RENDER_ORDER)},e.prototype.getStyle=function(){return this.style_},e.prototype.getStyleFunction=function(){return this.styleFunction_},e.prototype.getUpdateWhileAnimating=function(){return this.updateWhileAnimating_},e.prototype.getUpdateWhileInteracting=function(){return this.updateWhileInteracting_},e.prototype.renderDeclutter=function(n){n.declutterTree||(n.declutterTree=new TMe(9)),this.getRenderer().renderDeclutter(n)},e.prototype.setRenderOrder=function(n){this.set(Ohe.RENDER_ORDER,n)},e.prototype.setStyle=function(n){this.style_=n!==void 0?n:Xgt,this.styleFunction_=n===null?void 0:qgt(this.style_),this.changed()},e}(D4),Wt={BEGIN_GEOMETRY:0,BEGIN_PATH:1,CIRCLE:2,CLOSE_PATH:3,CUSTOM:4,DRAW_CHARS:5,DRAW_IMAGE:6,END_GEOMETRY:7,FILL:8,MOVE_TO_LINE_TO:9,SET_FILL_STYLE:10,SET_STROKE_STYLE:11,STROKE:12},yI=[Wt.FILL],fv=[Wt.STROKE],hx=[Wt.BEGIN_PATH],Ehe=[Wt.CLOSE_PATH],kMe=function(){function t(){}return t.prototype.drawCustom=function(e,n,r,i){},t.prototype.drawGeometry=function(e){},t.prototype.setStyle=function(e){},t.prototype.drawCircle=function(e,n){},t.prototype.drawFeature=function(e,n){},t.prototype.drawGeometryCollection=function(e,n){},t.prototype.drawLineString=function(e,n){},t.prototype.drawMultiLineString=function(e,n){},t.prototype.drawMultiPoint=function(e,n){},t.prototype.drawMultiPolygon=function(e,n){},t.prototype.drawPoint=function(e,n){},t.prototype.drawPolygon=function(e,n){},t.prototype.drawText=function(e,n){},t.prototype.setFillStrokeStyle=function(e,n){},t.prototype.setImageStyle=function(e,n){},t.prototype.setTextStyle=function(e,n){},t}(),lmt=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),GM=function(t){lmt(e,t);function e(n,r,i,o){var s=t.call(this)||this;return s.tolerance=n,s.maxExtent=r,s.pixelRatio=o,s.maxLineWidth=0,s.resolution=i,s.beginGeometryInstruction1_=null,s.beginGeometryInstruction2_=null,s.bufferedMaxExtent_=null,s.instructions=[],s.coordinates=[],s.tmpCoordinate_=[],s.hitDetectionInstructions=[],s.state={},s}return e.prototype.applyPixelRatio=function(n){var r=this.pixelRatio;return r==1?n:n.map(function(i){return i*r})},e.prototype.appendFlatPointCoordinates=function(n,r){for(var i=this.getBufferedMaxExtent(),o=this.tmpCoordinate_,s=this.coordinates,a=s.length,l=0,c=n.length;ll&&(this.instructions.push([Wt.CUSTOM,l,u,n,i,uv]),this.hitDetectionInstructions.push([Wt.CUSTOM,l,u,n,o||i,uv]));break;case"Point":c=n.getFlatCoordinates(),this.coordinates.push(c[0],c[1]),u=this.coordinates.length,this.instructions.push([Wt.CUSTOM,l,u,n,i]),this.hitDetectionInstructions.push([Wt.CUSTOM,l,u,n,o||i]);break}this.endGeometry(r)},e.prototype.beginGeometry=function(n,r){this.beginGeometryInstruction1_=[Wt.BEGIN_GEOMETRY,r,0,n],this.instructions.push(this.beginGeometryInstruction1_),this.beginGeometryInstruction2_=[Wt.BEGIN_GEOMETRY,r,0,n],this.hitDetectionInstructions.push(this.beginGeometryInstruction2_)},e.prototype.finish=function(){return{instructions:this.instructions,hitDetectionInstructions:this.hitDetectionInstructions,coordinates:this.coordinates}},e.prototype.reverseHitDetectionInstructions=function(){var n=this.hitDetectionInstructions;n.reverse();var r,i=n.length,o,s,a=-1;for(r=0;rthis.maxLineWidth&&(this.maxLineWidth=i.lineWidth,this.bufferedMaxExtent_=null)}else i.strokeStyle=void 0,i.lineCap=void 0,i.lineDash=null,i.lineDashOffset=void 0,i.lineJoin=void 0,i.lineWidth=void 0,i.miterLimit=void 0},e.prototype.createFill=function(n){var r=n.fillStyle,i=[Wt.SET_FILL_STYLE,r];return typeof r!="string"&&i.push(!0),i},e.prototype.applyStroke=function(n){this.instructions.push(this.createStroke(n))},e.prototype.createStroke=function(n){return[Wt.SET_STROKE_STYLE,n.strokeStyle,n.lineWidth*this.pixelRatio,n.lineCap,n.lineJoin,n.miterLimit,this.applyPixelRatio(n.lineDash),n.lineDashOffset*this.pixelRatio]},e.prototype.updateFillStyle=function(n,r){var i=n.fillStyle;(typeof i!="string"||n.currentFillStyle!=i)&&(i!==void 0&&this.instructions.push(r.call(this,n)),n.currentFillStyle=i)},e.prototype.updateStrokeStyle=function(n,r){var i=n.strokeStyle,o=n.lineCap,s=n.lineDash,a=n.lineDashOffset,l=n.lineJoin,c=n.lineWidth,u=n.miterLimit;(n.currentStrokeStyle!=i||n.currentLineCap!=o||s!=n.currentLineDash&&!eb(n.currentLineDash,s)||n.currentLineDashOffset!=a||n.currentLineJoin!=l||n.currentLineWidth!=c||n.currentMiterLimit!=u)&&(i!==void 0&&r.call(this,n),n.currentStrokeStyle=i,n.currentLineCap=o,n.currentLineDash=s,n.currentLineDashOffset=a,n.currentLineJoin=l,n.currentLineWidth=c,n.currentMiterLimit=u)},e.prototype.endGeometry=function(n){this.beginGeometryInstruction1_[2]=this.instructions.length,this.beginGeometryInstruction1_=null,this.beginGeometryInstruction2_[2]=this.hitDetectionInstructions.length,this.beginGeometryInstruction2_=null;var r=[Wt.END_GEOMETRY,n];this.instructions.push(r),this.hitDetectionInstructions.push(r)},e.prototype.getBufferedMaxExtent=function(){if(!this.bufferedMaxExtent_&&(this.bufferedMaxExtent_=PPe(this.maxExtent),this.maxLineWidth>0)){var n=this.resolution*(this.maxLineWidth+1)/2;lA(this.bufferedMaxExtent_,n,this.bufferedMaxExtent_)}return this.bufferedMaxExtent_},e}(kMe),cmt=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),umt=function(t){cmt(e,t);function e(n,r,i,o){var s=t.call(this,n,r,i,o)||this;return s.hitDetectionImage_=null,s.image_=null,s.imagePixelRatio_=void 0,s.anchorX_=void 0,s.anchorY_=void 0,s.height_=void 0,s.opacity_=void 0,s.originX_=void 0,s.originY_=void 0,s.rotateWithView_=void 0,s.rotation_=void 0,s.scale_=void 0,s.width_=void 0,s.declutterMode_=void 0,s.declutterImageWithText_=void 0,s}return e.prototype.drawPoint=function(n,r){if(this.image_){this.beginGeometry(n,r);var i=n.getFlatCoordinates(),o=n.getStride(),s=this.coordinates.length,a=this.appendFlatPointCoordinates(i,o);this.instructions.push([Wt.DRAW_IMAGE,s,a,this.image_,this.anchorX_*this.imagePixelRatio_,this.anchorY_*this.imagePixelRatio_,Math.ceil(this.height_*this.imagePixelRatio_),this.opacity_,this.originX_*this.imagePixelRatio_,this.originY_*this.imagePixelRatio_,this.rotateWithView_,this.rotation_,[this.scale_[0]*this.pixelRatio/this.imagePixelRatio_,this.scale_[1]*this.pixelRatio/this.imagePixelRatio_],Math.ceil(this.width_*this.imagePixelRatio_),this.declutterMode_,this.declutterImageWithText_]),this.hitDetectionInstructions.push([Wt.DRAW_IMAGE,s,a,this.hitDetectionImage_,this.anchorX_,this.anchorY_,this.height_,this.opacity_,this.originX_,this.originY_,this.rotateWithView_,this.rotation_,this.scale_,this.width_,this.declutterMode_,this.declutterImageWithText_]),this.endGeometry(r)}},e.prototype.drawMultiPoint=function(n,r){if(this.image_){this.beginGeometry(n,r);var i=n.getFlatCoordinates(),o=n.getStride(),s=this.coordinates.length,a=this.appendFlatPointCoordinates(i,o);this.instructions.push([Wt.DRAW_IMAGE,s,a,this.image_,this.anchorX_*this.imagePixelRatio_,this.anchorY_*this.imagePixelRatio_,Math.ceil(this.height_*this.imagePixelRatio_),this.opacity_,this.originX_*this.imagePixelRatio_,this.originY_*this.imagePixelRatio_,this.rotateWithView_,this.rotation_,[this.scale_[0]*this.pixelRatio/this.imagePixelRatio_,this.scale_[1]*this.pixelRatio/this.imagePixelRatio_],Math.ceil(this.width_*this.imagePixelRatio_),this.declutterMode_,this.declutterImageWithText_]),this.hitDetectionInstructions.push([Wt.DRAW_IMAGE,s,a,this.hitDetectionImage_,this.anchorX_,this.anchorY_,this.height_,this.opacity_,this.originX_,this.originY_,this.rotateWithView_,this.rotation_,this.scale_,this.width_,this.declutterMode_,this.declutterImageWithText_]),this.endGeometry(r)}},e.prototype.finish=function(){return this.reverseHitDetectionInstructions(),this.anchorX_=void 0,this.anchorY_=void 0,this.hitDetectionImage_=null,this.image_=null,this.imagePixelRatio_=void 0,this.height_=void 0,this.scale_=void 0,this.opacity_=void 0,this.originX_=void 0,this.originY_=void 0,this.rotateWithView_=void 0,this.rotation_=void 0,this.width_=void 0,t.prototype.finish.call(this)},e.prototype.setImageStyle=function(n,r){var i=n.getAnchor(),o=n.getSize(),s=n.getOrigin();this.imagePixelRatio_=n.getPixelRatio(this.pixelRatio),this.anchorX_=i[0],this.anchorY_=i[1],this.hitDetectionImage_=n.getHitDetectionImage(),this.image_=n.getImage(this.pixelRatio),this.height_=o[1],this.opacity_=n.getOpacity(),this.originX_=s[0],this.originY_=s[1],this.rotateWithView_=n.getRotateWithView(),this.rotation_=n.getRotation(),this.scale_=n.getScaleArray(),this.width_=o[0],this.declutterMode_=n.getDeclutterMode(),this.declutterImageWithText_=r},e}(GM),fmt=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),dmt=function(t){fmt(e,t);function e(n,r,i,o){return t.call(this,n,r,i,o)||this}return e.prototype.drawFlatCoordinates_=function(n,r,i,o){var s=this.coordinates.length,a=this.appendFlatLineCoordinates(n,r,i,o,!1,!1),l=[Wt.MOVE_TO_LINE_TO,s,a];return this.instructions.push(l),this.hitDetectionInstructions.push(l),i},e.prototype.drawLineString=function(n,r){var i=this.state,o=i.strokeStyle,s=i.lineWidth;if(!(o===void 0||s===void 0)){this.updateStrokeStyle(i,this.applyStroke),this.beginGeometry(n,r),this.hitDetectionInstructions.push([Wt.SET_STROKE_STYLE,i.strokeStyle,i.lineWidth,i.lineCap,i.lineJoin,i.miterLimit,hA,pA],hx);var a=n.getFlatCoordinates(),l=n.getStride();this.drawFlatCoordinates_(a,0,a.length,l),this.hitDetectionInstructions.push(fv),this.endGeometry(r)}},e.prototype.drawMultiLineString=function(n,r){var i=this.state,o=i.strokeStyle,s=i.lineWidth;if(!(o===void 0||s===void 0)){this.updateStrokeStyle(i,this.applyStroke),this.beginGeometry(n,r),this.hitDetectionInstructions.push([Wt.SET_STROKE_STYLE,i.strokeStyle,i.lineWidth,i.lineCap,i.lineJoin,i.miterLimit,i.lineDash,i.lineDashOffset],hx);for(var a=n.getEnds(),l=n.getFlatCoordinates(),c=n.getStride(),u=0,f=0,d=a.length;ft&&(l>a&&(a=l,o=c,s=f),l=0,c=f-i)),d=h,m=y,v=x),p=b,g=w}return l+=h,l>a?[c,f]:[o,s]}var gmt=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),rk={left:0,end:0,center:.5,right:1,start:1,top:0,middle:.5,hanging:.2,alphabetic:.8,ideographic:.8,bottom:1},mmt=function(t){gmt(e,t);function e(n,r,i,o){var s=t.call(this,n,r,i,o)||this;return s.labels_=null,s.text_="",s.textOffsetX_=0,s.textOffsetY_=0,s.textRotateWithView_=void 0,s.textRotation_=0,s.textFillState_=null,s.fillStates={},s.textStrokeState_=null,s.strokeStates={},s.textState_={},s.textStates={},s.textKey_="",s.fillKey_="",s.strokeKey_="",s.declutterImageWithText_=void 0,s}return e.prototype.finish=function(){var n=t.prototype.finish.call(this);return n.textStates=this.textStates,n.fillStates=this.fillStates,n.strokeStates=this.strokeStates,n},e.prototype.drawText=function(n,r){var i=this.textFillState_,o=this.textStrokeState_,s=this.textState_;if(!(this.text_===""||!s||!i&&!o)){var a=this.coordinates,l=a.length,c=n.getType(),u=null,f=n.getStride();if(s.placement===Qgt.LINE&&(c=="LineString"||c=="MultiLineString"||c=="Polygon"||c=="MultiPolygon")){if(!va(this.getBufferedMaxExtent(),n.getExtent()))return;var d=void 0;if(u=n.getFlatCoordinates(),c=="LineString")d=[u.length];else if(c=="MultiLineString")d=n.getEnds();else if(c=="Polygon")d=n.getEnds().slice(0,1);else if(c=="MultiPolygon"){var h=n.getEndss();d=[];for(var p=0,g=h.length;pA[2]}else M=b>k;var P=Math.PI,T=[],R=_+r===e;e=_,m=0,v=S,d=t[e],h=t[e+1];var I;if(R){y(),I=Math.atan2(h-g,d-p),M&&(I+=I>0?-P:P);var B=(k+b)/2,$=(E+w)/2;return T[0]=[B,$,(O-o)/2,I,i],T}i=i.replace(/\n/g," ");for(var z=0,L=i.length;z0?-P:P),I!==void 0){var N=j-I;if(N+=N>P?-2*P:N<-P?2*P:0,Math.abs(N)>s)return null}I=j;for(var F=z,H=0;z0&&t.push(` -`,""),t.push(e,""),t}var Emt=function(){function t(e,n,r,i){this.overlaps=r,this.pixelRatio=n,this.resolution=e,this.alignFill_,this.instructions=i.instructions,this.coordinates=i.coordinates,this.coordinateCache_={},this.renderedTransform_=dh(),this.hitDetectionInstructions=i.hitDetectionInstructions,this.pixelCoordinates_=null,this.viewRotation_=0,this.fillStates=i.fillStates||{},this.strokeStates=i.strokeStates||{},this.textStates=i.textStates||{},this.widths_={},this.labels_={}}return t.prototype.createLabel=function(e,n,r,i){var o=e+n+r+i;if(this.labels_[o])return this.labels_[o];var s=i?this.strokeStates[i]:null,a=r?this.fillStates[r]:null,l=this.textStates[n],c=this.pixelRatio,u=[l.scale[0]*c,l.scale[1]*c],f=Array.isArray(e),d=l.justify?rk[l.justify]:Mhe(Array.isArray(e)?e[0]:e,l.textAlign||vA),h=i&&s.lineWidth?s.lineWidth:0,p=f?e:e.split(` -`).reduce(Omt,[]),g=Ugt(l,p),m=g.width,v=g.height,y=g.widths,x=g.heights,b=g.lineWidths,w=m+h,_=[],S=(w+2)*u[0],O=(v+h)*u[1],k={width:S<0?Math.floor(S):Math.ceil(S),height:O<0?Math.floor(O):Math.ceil(O),contextInstructions:_};if((u[0]!=1||u[1]!=1)&&_.push("scale",u),i){_.push("strokeStyle",s.strokeStyle),_.push("lineWidth",h),_.push("lineCap",s.lineCap),_.push("lineJoin",s.lineJoin),_.push("miterLimit",s.miterLimit);var E=E4?OffscreenCanvasRenderingContext2D:CanvasRenderingContext2D;E.prototype.setLineDash&&(_.push("setLineDash",[s.lineDash]),_.push("lineDashOffset",s.lineDashOffset))}r&&_.push("fillStyle",a.fillStyle),_.push("textBaseline","middle"),_.push("textAlign","center");for(var M=.5-d,A=d*w+M*h,P=[],T=[],R=0,I=0,B=0,$=0,z,L=0,j=p.length;Le?e-c:o,b=s+u>n?n-u:s,w=p[3]+x*d[0]+p[1],_=p[0]+b*d[1]+p[2],S=v-p[3],O=y-p[0];(g||f!==0)&&(um[0]=S,fm[0]=S,um[1]=O,ap[1]=O,ap[0]=S+w,lp[0]=ap[0],lp[1]=O+_,fm[1]=lp[1]);var k;return f!==0?(k=Dg(dh(),r,i,1,1,f,-r,-i),Ui(k,um),Ui(k,ap),Ui(k,lp),Ui(k,fm),Bf(Math.min(um[0],ap[0],lp[0],fm[0]),Math.min(um[1],ap[1],lp[1],fm[1]),Math.max(um[0],ap[0],lp[0],fm[0]),Math.max(um[1],ap[1],lp[1],fm[1]),Bb)):Bf(Math.min(S,S+w),Math.min(O,O+_),Math.max(S,S+w),Math.max(O,O+_),Bb),h&&(v=Math.round(v),y=Math.round(y)),{drawImageX:v,drawImageY:y,drawImageW:x,drawImageH:b,originX:c,originY:u,declutterBox:{minX:Bb[0],minY:Bb[1],maxX:Bb[2],maxY:Bb[3],value:m},canvasTransform:k,scale:d}},t.prototype.replayImageOrLabel_=function(e,n,r,i,o,s,a){var l=!!(s||a),c=i.declutterBox,u=e.canvas,f=a?a[2]*i.scale[0]/2:0,d=c.minX-f<=u.width/n&&c.maxX+f>=0&&c.minY-f<=u.height/n&&c.maxY+f>=0;return d&&(l&&this.replayTextBackground_(e,um,ap,lp,fm,s,a),Wgt(e,i.canvasTransform,o,r,i.originX,i.originY,i.drawImageW,i.drawImageH,i.drawImageX,i.drawImageY,i.scale)),!0},t.prototype.fill_=function(e){if(this.alignFill_){var n=Ui(this.renderedTransform_,[0,0]),r=512*this.pixelRatio;e.save(),e.translate(n[0]%r,n[1]%r),e.rotate(this.viewRotation_)}e.fill(),this.alignFill_&&e.restore()},t.prototype.setStrokeStyle_=function(e,n){e.strokeStyle=n[1],e.lineWidth=n[2],e.lineCap=n[3],e.lineJoin=n[4],e.miterLimit=n[5],e.setLineDash&&(e.lineDashOffset=n[7],e.setLineDash(n[6]))},t.prototype.drawLabelWithPointPlacement_=function(e,n,r,i){var o=this.textStates[n],s=this.createLabel(e,n,i,r),a=this.strokeStates[r],l=this.pixelRatio,c=Mhe(Array.isArray(e)?e[0]:e,o.textAlign||vA),u=rk[o.textBaseline||nN],f=a&&a.lineWidth?a.lineWidth:0,d=s.width/l-2*o.scale[0],h=c*d+2*(.5-c)*f,p=u*s.height/l+2*(.5-u)*f;return{label:s,anchorX:h,anchorY:p}},t.prototype.execute_=function(e,n,r,i,o,s,a,l){var c;this.pixelCoordinates_&&eb(r,this.renderedTransform_)?c=this.pixelCoordinates_:(this.pixelCoordinates_||(this.pixelCoordinates_=[]),c=Dx(this.coordinates,0,this.coordinates.length,2,r,this.pixelCoordinates_),Jdt(this.renderedTransform_,r));for(var u=0,f=i.length,d=0,h,p,g,m,v,y,x,b,w,_,S,O,k=0,E=0,M=null,A=null,P=this.coordinateCache_,T=this.viewRotation_,R=Math.round(Math.atan2(-r[1],r[0])*1e12)/1e12,I={context:e,pixelRatio:this.pixelRatio,resolution:this.resolution,rotation:T},B=this.instructions!=i||this.overlaps?0:200,$,z,L,j;uB&&(this.fill_(e),k=0),E>B&&(e.stroke(),E=0),!k&&!E&&(e.beginPath(),m=NaN,v=NaN),++u;break;case Wt.CIRCLE:d=N[1];var H=c[d],q=c[d+1],Y=c[d+2],le=c[d+3],K=Y-H,ee=le-q,re=Math.sqrt(K*K+ee*ee);e.moveTo(H+re,q),e.arc(H,q,re,0,2*Math.PI,!0),++u;break;case Wt.CLOSE_PATH:e.closePath(),++u;break;case Wt.CUSTOM:d=N[1],h=N[2];var me=N[3],te=N[4],ae=N.length==6?N[5]:void 0;I.geometry=me,I.feature=$,u in P||(P[u]=[]);var U=P[u];ae?ae(c,d,h,2,U):(U[0]=c[d],U[1]=c[d+1],U.length=2),te(U,I),++u;break;case Wt.DRAW_IMAGE:d=N[1],h=N[2],b=N[3],p=N[4],g=N[5];var oe=N[6],ne=N[7],V=N[8],X=N[9],Z=N[10],he=N[11],xe=N[12],G=N[13],W=N[14],J=N[15];if(!b&&N.length>=20){w=N[19],_=N[20],S=N[21],O=N[22];var se=this.drawLabelWithPointPlacement_(w,_,S,O);b=se.label,N[3]=b;var ye=N[23];p=(se.anchorX-ye)*this.pixelRatio,N[4]=p;var ie=N[24];g=(se.anchorY-ie)*this.pixelRatio,N[5]=g,oe=b.height,N[6]=oe,G=b.width,N[13]=G}var fe=void 0;N.length>25&&(fe=N[25]);var Q=void 0,_e=void 0,we=void 0;N.length>17?(Q=N[16],_e=N[17],we=N[18]):(Q=dx,_e=!1,we=!1),Z&&R?he+=T:!Z&&!R&&(he-=T);for(var Ie=0;d0){if(!s||h!=="Image"&&h!=="Text"||s.indexOf(_)!==-1){var M=(d[k]-3)/4,A=i-M%a,P=i-(M/a|0),T=o(_,S,A*A+P*P);if(T)return T}u.clearRect(0,0,a,a);break}}var g=Object.keys(this.executorsByZIndex_).map(Number);g.sort(o1);var m,v,y,x,b;for(m=g.length-1;m>=0;--m){var w=g[m].toString();for(y=this.executorsByZIndex_[w],v=pW.length-1;v>=0;--v)if(h=pW[v],x=y[h],x!==void 0&&(b=x.executeHitDetection(u,l,r,p,f),b))return b}},t.prototype.getClipCoords=function(e){var n=this.maxExtent_;if(!n)return null;var r=n[0],i=n[1],o=n[2],s=n[3],a=[r,i,r,s,o,s,o,i];return Dx(a,0,8,2,e,a),a},t.prototype.isEmpty=function(){return ES(this.executorsByZIndex_)},t.prototype.execute=function(e,n,r,i,o,s,a){var l=Object.keys(this.executorsByZIndex_).map(Number);l.sort(o1),this.maxExtent_&&(e.save(),this.clip(e,r));var c=s||pW,u,f,d,h,p,g;for(a&&l.reverse(),u=0,f=l.length;un)break;var a=r[s];a||(a=[],r[s]=a),a.push(((t+i)*e+(t+o))*4+3),i>0&&a.push(((t-i)*e+(t+o))*4+3),o>0&&(a.push(((t+i)*e+(t-o))*4+3),i>0&&a.push(((t-i)*e+(t-o))*4+3))}for(var l=[],i=0,c=r.length;ithis.maxCacheSize_},t.prototype.expire=function(){if(this.canExpireCache()){var e=0;for(var n in this.cache_){var r=this.cache_[n];!(e++&3)&&!r.hasListener()&&(delete this.cache_[n],--this.cacheSize_)}}},t.prototype.get=function(e,n,r){var i=Dhe(e,n,r);return i in this.cache_?this.cache_[i]:null},t.prototype.set=function(e,n,r,i){var o=Dhe(e,n,r);this.cache_[o]=i,++this.cacheSize_},t.prototype.setSize=function(e){this.maxCacheSize_=e,this.expire()},t}();function Dhe(t,e,n){var r=n?xMe(n):"null";return e+":"+t+":"+r}var oN=new Pmt,Mmt=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),Rmt=function(t){Mmt(e,t);function e(n,r,i,o){var s=t.call(this)||this;return s.extent=n,s.pixelRatio_=i,s.resolution=r,s.state=o,s}return e.prototype.changed=function(){this.dispatchEvent(nn.CHANGE)},e.prototype.getExtent=function(){return this.extent},e.prototype.getImage=function(){return $t()},e.prototype.getPixelRatio=function(){return this.pixelRatio_},e.prototype.getResolution=function(){return this.resolution},e.prototype.getState=function(){return this.state},e.prototype.load=function(){$t()},e}(JC),Dmt=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}();(function(t){Dmt(e,t);function e(n,r,i,o,s,a){var l=t.call(this,n,r,i,zr.IDLE)||this;return l.src_=o,l.image_=new Image,s!==null&&(l.image_.crossOrigin=s),l.unlisten_=null,l.state=zr.IDLE,l.imageLoadFunction_=a,l}return e.prototype.getImage=function(){return this.image_},e.prototype.handleImageError_=function(){this.state=zr.ERROR,this.unlistenImage_(),this.changed()},e.prototype.handleImageLoad_=function(){this.resolution===void 0&&(this.resolution=Ou(this.extent)/this.image_.height),this.state=zr.LOADED,this.unlistenImage_(),this.changed()},e.prototype.load=function(){(this.state==zr.IDLE||this.state==zr.ERROR)&&(this.state=zr.LOADING,this.changed(),this.imageLoadFunction_(this,this.src_),this.unlisten_=mte(this.image_,this.handleImageLoad_.bind(this),this.handleImageError_.bind(this)))},e.prototype.setImage=function(n){this.image_=n,this.resolution=Ou(this.extent)/this.image_.height},e.prototype.unlistenImage_=function(){this.unlisten_&&(this.unlisten_(),this.unlisten_=null)},e})(Rmt);function mte(t,e,n){var r=t,i=!0,o=!1,s=!1,a=[GF(r,nn.LOAD,function(){s=!0,o||e()})];return r.src&&Kdt?(o=!0,r.decode().then(function(){i&&e()}).catch(function(l){i&&(s?e():n())})):a.push(GF(r,nn.ERROR,n)),function(){i=!1,a.forEach(ri)}}var Imt=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),FE=null,Lmt=function(t){Imt(e,t);function e(n,r,i,o,s,a){var l=t.call(this)||this;return l.hitDetectionImage_=null,l.image_=n||new Image,o!==null&&(l.image_.crossOrigin=o),l.canvas_={},l.color_=a,l.unlisten_=null,l.imageState_=s,l.size_=i,l.src_=r,l.tainted_,l}return e.prototype.isTainted_=function(){if(this.tainted_===void 0&&this.imageState_===zr.LOADED){FE||(FE=Cc(1,1)),FE.drawImage(this.image_,0,0);try{FE.getImageData(0,0,1,1),this.tainted_=!1}catch{FE=null,this.tainted_=!0}}return this.tainted_===!0},e.prototype.dispatchChangeEvent_=function(){this.dispatchEvent(nn.CHANGE)},e.prototype.handleImageError_=function(){this.imageState_=zr.ERROR,this.unlistenImage_(),this.dispatchChangeEvent_()},e.prototype.handleImageLoad_=function(){this.imageState_=zr.LOADED,this.size_?(this.image_.width=this.size_[0],this.image_.height=this.size_[1]):this.size_=[this.image_.width,this.image_.height],this.unlistenImage_(),this.dispatchChangeEvent_()},e.prototype.getImage=function(n){return this.replaceColor_(n),this.canvas_[n]?this.canvas_[n]:this.image_},e.prototype.getPixelRatio=function(n){return this.replaceColor_(n),this.canvas_[n]?n:1},e.prototype.getImageState=function(){return this.imageState_},e.prototype.getHitDetectionImage=function(){if(!this.hitDetectionImage_)if(this.isTainted_()){var n=this.size_[0],r=this.size_[1],i=Cc(n,r);i.fillRect(0,0,n,r),this.hitDetectionImage_=i.canvas}else this.hitDetectionImage_=this.image_;return this.hitDetectionImage_},e.prototype.getSize=function(){return this.size_},e.prototype.getSrc=function(){return this.src_},e.prototype.load=function(){if(this.imageState_==zr.IDLE){this.imageState_=zr.LOADING;try{this.image_.src=this.src_}catch{this.handleImageError_()}this.unlisten_=mte(this.image_,this.handleImageLoad_.bind(this),this.handleImageError_.bind(this))}},e.prototype.replaceColor_=function(n){if(!(!this.color_||this.canvas_[n]||this.imageState_!==zr.LOADED)){var r=document.createElement("canvas");this.canvas_[n]=r,r.width=Math.ceil(this.image_.width*n),r.height=Math.ceil(this.image_.height*n);var i=r.getContext("2d");if(i.scale(n,n),i.drawImage(this.image_,0,0),i.globalCompositeOperation="multiply",i.globalCompositeOperation==="multiply"||this.isTainted_())i.fillStyle=xMe(this.color_),i.fillRect(0,0,r.width/n,r.height/n),i.globalCompositeOperation="destination-in",i.drawImage(this.image_,0,0);else{for(var o=i.getImageData(0,0,r.width,r.height),s=o.data,a=this.color_[0]/255,l=this.color_[1]/255,c=this.color_[2]/255,u=this.color_[3],f=0,d=s.length;f0,6);var f=i.src!==void 0?zr.IDLE:zr.LOADED;return r.color_=i.color!==void 0?eN(i.color):null,r.iconImage_=$mt(c,u,r.imgSize_!==void 0?r.imgSize_:null,r.crossOrigin_,f,r.color_),r.offset_=i.offset!==void 0?i.offset:[0,0],r.offsetOrigin_=i.offsetOrigin!==void 0?i.offsetOrigin:$c.TOP_LEFT,r.origin_=null,r.size_=i.size!==void 0?i.size:null,r}return e.prototype.clone=function(){var n=this.getScale();return new e({anchor:this.anchor_.slice(),anchorOrigin:this.anchorOrigin_,anchorXUnits:this.anchorXUnits_,anchorYUnits:this.anchorYUnits_,color:this.color_&&this.color_.slice?this.color_.slice():this.color_||void 0,crossOrigin:this.crossOrigin_,imgSize:this.imgSize_,offset:this.offset_.slice(),offsetOrigin:this.offsetOrigin_,opacity:this.getOpacity(),rotateWithView:this.getRotateWithView(),rotation:this.getRotation(),scale:Array.isArray(n)?n.slice():n,size:this.size_!==null?this.size_.slice():void 0,src:this.getSrc(),displacement:this.getDisplacement().slice(),declutterMode:this.getDeclutterMode()})},e.prototype.getAnchor=function(){var n=this.normalizedAnchor_;if(!n){n=this.anchor_;var r=this.getSize();if(this.anchorXUnits_==Gm.FRACTION||this.anchorYUnits_==Gm.FRACTION){if(!r)return null;n=this.anchor_.slice(),this.anchorXUnits_==Gm.FRACTION&&(n[0]*=r[0]),this.anchorYUnits_==Gm.FRACTION&&(n[1]*=r[1])}if(this.anchorOrigin_!=$c.TOP_LEFT){if(!r)return null;n===this.anchor_&&(n=this.anchor_.slice()),(this.anchorOrigin_==$c.TOP_RIGHT||this.anchorOrigin_==$c.BOTTOM_RIGHT)&&(n[0]=-n[0]+r[0]),(this.anchorOrigin_==$c.BOTTOM_LEFT||this.anchorOrigin_==$c.BOTTOM_RIGHT)&&(n[1]=-n[1]+r[1])}this.normalizedAnchor_=n}var i=this.getDisplacement();return[n[0]-i[0],n[1]+i[1]]},e.prototype.setAnchor=function(n){this.anchor_=n,this.normalizedAnchor_=null},e.prototype.getColor=function(){return this.color_},e.prototype.getImage=function(n){return this.iconImage_.getImage(n)},e.prototype.getPixelRatio=function(n){return this.iconImage_.getPixelRatio(n)},e.prototype.getImageSize=function(){return this.iconImage_.getSize()},e.prototype.getImageState=function(){return this.iconImage_.getImageState()},e.prototype.getHitDetectionImage=function(){return this.iconImage_.getHitDetectionImage()},e.prototype.getOrigin=function(){if(this.origin_)return this.origin_;var n=this.offset_;if(this.offsetOrigin_!=$c.TOP_LEFT){var r=this.getSize(),i=this.iconImage_.getSize();if(!r||!i)return null;n=n.slice(),(this.offsetOrigin_==$c.TOP_RIGHT||this.offsetOrigin_==$c.BOTTOM_RIGHT)&&(n[0]=i[0]-r[0]-n[0]),(this.offsetOrigin_==$c.BOTTOM_LEFT||this.offsetOrigin_==$c.BOTTOM_RIGHT)&&(n[1]=i[1]-r[1]-n[1])}return this.origin_=n,this.origin_},e.prototype.getSrc=function(){return this.iconImage_.getSrc()},e.prototype.getSize=function(){return this.size_?this.size_:this.iconImage_.getSize()},e.prototype.listenImageChange=function(n){this.iconImage_.addEventListener(nn.CHANGE,n)},e.prototype.load=function(){this.iconImage_.load()},e.prototype.unlistenImageChange=function(n){this.iconImage_.removeEventListener(nn.CHANGE,n)},e}(yMe),zd=.5;function zmt(t,e,n,r,i,o,s){var a=t[0]*zd,l=t[1]*zd,c=Cc(a,l);c.imageSmoothingEnabled=!1;for(var u=c.canvas,f=new Amt(c,zd,i,null,s),d=n.length,h=Math.floor((256*256*256-1)/d),p={},g=1;g<=d;++g){var m=n[g-1],v=m.getStyleFunction()||r;if(r){var y=v(m,o);if(y){Array.isArray(y)||(y=[y]);for(var x=g*h,b="#"+("000000"+x.toString(16)).slice(-6),w=0,_=y.length;w<_;++w){var S=y[w],O=S.getGeometryFunction()(m);if(!(!O||!va(i,O.getExtent()))){var k=S.clone(),E=k.getFill();E&&E.setColor(b);var M=k.getStroke();M&&(M.setColor(b),M.setLineDash(null)),k.setText(void 0);var A=S.getImage();if(A&&A.getOpacity()!==0){var P=A.getImageSize();if(!P)continue;var T=Cc(P[0],P[1],void 0,{alpha:!1}),R=T.canvas;T.fillStyle=b,T.fillRect(0,0,R.width,R.height),k.setImage(new Nmt({img:R,imgSize:P,anchor:A.getAnchor(),anchorXUnits:Gm.PIXELS,anchorYUnits:Gm.PIXELS,offset:A.getOrigin(),opacity:1,size:A.getSize(),scale:A.getScale(),rotation:A.getRotation(),rotateWithView:A.getRotateWithView()}))}var I=k.getZIndex()||0,B=p[I];B||(B={},p[I]=B,B.Polygon=[],B.Circle=[],B.LineString=[],B.Point=[]),B[O.getType().replace("Multi","")].push(O,k)}}}}}for(var $=Object.keys(p).map(Number).sort(o1),g=0,z=$.length;gg[2];)++y,x=v*y,f.push(this.getRenderTransform(o,s,a,zd,d,h,x).slice()),m-=v}this.hitDetectionImageData_=zmt(i,f,this.renderedFeatures_,u.getStyleFunction(),c,s,a)}r(jmt(n,this.renderedFeatures_,this.hitDetectionImageData_))}).bind(this))},e.prototype.forEachFeatureAtCoordinate=function(n,r,i,o,s){var a=this;if(this.replayGroup_){var l=r.viewState.resolution,c=r.viewState.rotation,u=this.getLayer(),f={},d=function(g,m,v){var y=or(g),x=f[y];if(x){if(x!==!0&&vw[0]&&O[2]>w[2]&&b.push([O[0]-_,O[1],O[2]-_,O[3]])}if(this.ready&&this.renderedResolution_==d&&this.renderedRevision_==p&&this.renderedRenderOrder_==m&&r_(this.wrappedRenderedExtent_,y))return eb(this.renderedExtent_,x)||(this.hitDetectionImageData_=null,this.renderedExtent_=x),this.renderedCenter_=v,this.replayGroupChanged=!1,!0;this.replayGroup_=null;var k=new khe(vq(d,h),y,d,h),E;this.getLayer().getDeclutter()&&(E=new khe(vq(d,h),y,d,h));for(var M,A,P,A=0,P=b.length;A=200&&a.status<300){var c=e.getType(),u=void 0;c=="json"||c=="text"?u=a.responseText:c=="xml"?(u=a.responseXML,u||(u=new DOMParser().parseFromString(a.responseText,"application/xml"))):c=="arraybuffer"&&(u=a.response),u?o(e.readFeatures(u,{extent:n,featureProjection:i}),e.readProjection(u)):s()}else s()},a.onerror=s,a.send()}function Fhe(t,e){return function(n,r,i,o,s){var a=this;ovt(t,e,n,r,i,function(l,c){a.addFeatures(l),o!==void 0&&o(l)},s||s1)}}var IMe=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),dm=function(t){IMe(e,t);function e(n,r,i){var o=t.call(this,n)||this;return o.feature=r,o.features=i,o}return e}(Nh),HM=function(t){IMe(e,t);function e(n){var r=this,i=n||{};r=t.call(this,{attributions:i.attributions,interpolate:!0,projection:void 0,state:"ready",wrapX:i.wrapX!==void 0?i.wrapX:!0})||this,r.on,r.once,r.un,r.loader_=s1,r.format_=i.format,r.overlaps_=i.overlaps===void 0?!0:i.overlaps,r.url_=i.url,i.loader!==void 0?r.loader_=i.loader:r.url_!==void 0&&(bn(r.format_,7),r.loader_=Fhe(r.url_,r.format_)),r.strategy_=i.strategy!==void 0?i.strategy:rvt;var o=i.useSpatialIndex!==void 0?i.useSpatialIndex:!0;r.featuresRtree_=o?new Lhe:null,r.loadedExtentsRtree_=new Lhe,r.loadingExtentsCount_=0,r.nullGeometryFeatures_={},r.idIndex_={},r.uidIndex_={},r.featureChangeKeys_={},r.featuresCollection_=null;var s,a;return Array.isArray(i.features)?a=i.features:i.features&&(s=i.features,a=s.getArray()),!o&&s===void 0&&(s=new ru(a)),a!==void 0&&r.addFeaturesInternal(a),s!==void 0&&r.bindFeaturesCollection_(s),r}return e.prototype.addFeature=function(n){this.addFeatureInternal(n),this.changed()},e.prototype.addFeatureInternal=function(n){var r=or(n);if(!this.addToIndex_(r,n)){this.featuresCollection_&&this.featuresCollection_.remove(n);return}this.setupChangeEvents_(r,n);var i=n.getGeometry();if(i){var o=i.getExtent();this.featuresRtree_&&this.featuresRtree_.insert(o,n)}else this.nullGeometryFeatures_[r]=n;this.dispatchEvent(new dm(qu.ADDFEATURE,n))},e.prototype.setupChangeEvents_=function(n,r){this.featureChangeKeys_[n]=[zn(r,nn.CHANGE,this.handleFeatureChange_,this),zn(r,OS.PROPERTYCHANGE,this.handleFeatureChange_,this)]},e.prototype.addToIndex_=function(n,r){var i=!0,o=r.getId();return o!==void 0&&(o.toString()in this.idIndex_?i=!1:this.idIndex_[o.toString()]=r),i&&(bn(!(n in this.uidIndex_),30),this.uidIndex_[n]=r),i},e.prototype.addFeatures=function(n){this.addFeaturesInternal(n),this.changed()},e.prototype.addFeaturesInternal=function(n){for(var r=[],i=[],o=[],s=0,a=n.length;s0},e.prototype.refresh=function(){this.clear(!0),this.loadedExtentsRtree_.clear(),t.prototype.refresh.call(this)},e.prototype.removeLoadedExtent=function(n){var r=this.loadedExtentsRtree_,i;r.forEachInExtent(n,function(o){if(cA(o.extent,n))return i=o,!0}),i&&r.remove(i)},e.prototype.removeFeature=function(n){if(n){var r=or(n);r in this.nullGeometryFeatures_?delete this.nullGeometryFeatures_[r]:this.featuresRtree_&&this.featuresRtree_.remove(n);var i=this.removeFeatureInternal(n);i&&this.changed()}},e.prototype.removeFeatureInternal=function(n){var r=or(n),i=this.featureChangeKeys_[r];if(i){i.forEach(ri),delete this.featureChangeKeys_[r];var o=n.getId();return o!==void 0&&delete this.idIndex_[o.toString()],delete this.uidIndex_[r],this.dispatchEvent(new dm(qu.REMOVEFEATURE,n)),n}},e.prototype.removeFromIdIndex_=function(n){var r=!1;for(var i in this.idIndex_)if(this.idIndex_[i]===n){delete this.idIndex_[i],r=!0;break}return r},e.prototype.setLoader=function(n){this.loader_=n},e.prototype.setUrl=function(n){bn(this.format_,7),this.url_=n,this.setLoader(Fhe(n,this.format_))},e}(DMe);function hm(t,e){return Ui(t.inversePixelTransform,e.slice(0))}const Xt={IDLE:0,LOADING:1,LOADED:2,ERROR:3,EMPTY:4};function LMe(t){return Math.pow(t,3)}function rO(t){return 1-LMe(1-t)}function svt(t){return 3*t*t-2*t*t*t}function avt(t){return t}var lvt=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),$Me=function(t){lvt(e,t);function e(n,r,i){var o=t.call(this)||this,s=i||{};return o.tileCoord=n,o.state=r,o.interimTile=null,o.key="",o.transition_=s.transition===void 0?250:s.transition,o.transitionStarts_={},o.interpolate=!!s.interpolate,o}return e.prototype.changed=function(){this.dispatchEvent(nn.CHANGE)},e.prototype.release=function(){},e.prototype.getKey=function(){return this.key+"/"+this.tileCoord},e.prototype.getInterimTile=function(){if(!this.interimTile)return this;var n=this.interimTile;do{if(n.getState()==Xt.LOADED)return this.transition_=0,n;n=n.interimTile}while(n);return this},e.prototype.refreshInterimChain=function(){if(this.interimTile){var n=this.interimTile,r=this;do{if(n.getState()==Xt.LOADED){n.interimTile=null;break}else n.getState()==Xt.LOADING?r=n:n.getState()==Xt.IDLE?r.interimTile=n.interimTile:r=n;n=r.interimTile}while(n)}},e.prototype.getTileCoord=function(){return this.tileCoord},e.prototype.getState=function(){return this.state},e.prototype.setState=function(n){if(this.state!==Xt.ERROR&&this.state>n)throw new Error("Tile load sequence violation");this.state=n,this.changed()},e.prototype.load=function(){$t()},e.prototype.getAlpha=function(n,r){if(!this.transition_)return 1;var i=this.transitionStarts_[n];if(!i)i=r,this.transitionStarts_[n]=i;else if(i===-1)return 1;var o=r-i+1e3/60;return o>=this.transition_?1:LMe(o/this.transition_)},e.prototype.inTransition=function(n){return this.transition_?this.transitionStarts_[n]!==-1:!1},e.prototype.endTransition=function(n){this.transition_&&(this.transitionStarts_[n]=-1)},e}(JC),cvt=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),vte=function(t){cvt(e,t);function e(n,r,i,o,s,a){var l=t.call(this,n,r,a)||this;return l.crossOrigin_=o,l.src_=i,l.key=i,l.image_=new Image,o!==null&&(l.image_.crossOrigin=o),l.unlisten_=null,l.tileLoadFunction_=s,l}return e.prototype.getImage=function(){return this.image_},e.prototype.setImage=function(n){this.image_=n,this.state=Xt.LOADED,this.unlistenImage_(),this.changed()},e.prototype.handleImageError_=function(){this.state=Xt.ERROR,this.unlistenImage_(),this.image_=uvt(),this.changed()},e.prototype.handleImageLoad_=function(){var n=this.image_;n.naturalWidth&&n.naturalHeight?this.state=Xt.LOADED:this.state=Xt.EMPTY,this.unlistenImage_(),this.changed()},e.prototype.load=function(){this.state==Xt.ERROR&&(this.state=Xt.IDLE,this.image_=new Image,this.crossOrigin_!==null&&(this.image_.crossOrigin=this.crossOrigin_)),this.state==Xt.IDLE&&(this.state=Xt.LOADING,this.changed(),this.tileLoadFunction_(this,this.src_),this.unlisten_=mte(this.image_,this.handleImageLoad_.bind(this),this.handleImageError_.bind(this)))},e.prototype.unlistenImage_=function(){this.unlisten_&&(this.unlisten_(),this.unlisten_=null)},e}($Me);function uvt(){var t=Cc(1,1);return t.fillStyle="rgba(0,0,0,0)",t.fillRect(0,0,1,1),t.canvas}var fvt=function(){function t(e,n,r){this.decay_=e,this.minVelocity_=n,this.delay_=r,this.points_=[],this.angle_=0,this.initialVelocity_=0}return t.prototype.begin=function(){this.points_.length=0,this.angle_=0,this.initialVelocity_=0},t.prototype.update=function(e,n){this.points_.push(e,n,Date.now())},t.prototype.end=function(){if(this.points_.length<6)return!1;var e=Date.now()-this.delay_,n=this.points_.length-3;if(this.points_[n+2]0&&this.points_[r+2]>e;)r-=3;var i=this.points_[n+2]-this.points_[r+2];if(i<1e3/60)return!1;var o=this.points_[n]-this.points_[r],s=this.points_[n+1]-this.points_[r+1];return this.angle_=Math.atan2(s,o),this.initialVelocity_=Math.sqrt(o*o+s*s)/i,this.initialVelocity_>this.minVelocity_},t.prototype.getDistance=function(){return(this.minVelocity_-this.initialVelocity_)/this.decay_},t.prototype.getAngle=function(){return this.angle_},t}(),dvt=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),hvt=function(t){dvt(e,t);function e(n){var r=t.call(this)||this;return r.map_=n,r}return e.prototype.dispatchRenderEvent=function(n,r){$t()},e.prototype.calculateMatrices2D=function(n){var r=n.viewState,i=n.coordinateToPixelTransform,o=n.pixelToCoordinateTransform;Dg(i,n.size[0]/2,n.size[1]/2,1/r.resolution,-1/r.resolution,-r.rotation,-r.center[0],-r.center[1]),Bee(o,i)},e.prototype.forEachFeatureAtCoordinate=function(n,r,i,o,s,a,l,c){var u,f=r.viewState;function d(R,I,B,$){return s.call(a,I,R?B:null,$)}var h=f.projection,p=FPe(n.slice(),h),g=[[0,0]];if(h.canWrapX()&&o){var m=h.getExtent(),v=Kr(m);g.push([-v,0],[v,0])}for(var y=r.layerStatesArray,x=y.length,b=[],w=[],_=0;_=0;--S){var O=y[S],k=O.layer;if(k.hasRenderer()&&iN(O,f)&&l.call(c,k)){var E=k.getRenderer(),M=k.getSource();if(E&&M){var A=M.getWrapX()?p:n,P=d.bind(null,O.managed);w[0]=A[0]+g[_][0],w[1]=A[1]+g[_][1],u=E.forEachFeatureAtCoordinate(w,r,i,P,b)}if(u)return u}}if(b.length!==0){var T=1/b.length;return b.forEach(function(R,I){return R.distanceSq+=I*T}),b.sort(function(R,I){return R.distanceSq-I.distanceSq}),b.some(function(R){return u=R.callback(R.feature,R.layer,R.geometry)}),u}},e.prototype.forEachLayerAtPixel=function(n,r,i,o,s){return $t()},e.prototype.hasFeatureAtCoordinate=function(n,r,i,o,s,a){var l=this.forEachFeatureAtCoordinate(n,r,i,o,Mx,this,s,a);return l!==void 0},e.prototype.getMap=function(){return this.map_},e.prototype.renderFrame=function(n){$t()},e.prototype.scheduleExpireIconCache=function(n){oN.canExpireCache()&&n.postRenderFunctions.push(pvt)},e}(zee);function pvt(t,e){oN.expire()}var gvt=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),mvt=function(t){gvt(e,t);function e(n){var r=t.call(this,n)||this;r.fontChangeListenerKey_=zn(_p,OS.PROPERTYCHANGE,n.redrawText.bind(n)),r.element_=document.createElement("div");var i=r.element_.style;i.position="absolute",i.width="100%",i.height="100%",i.zIndex="0",r.element_.className=WM+" ol-layers";var o=n.getViewport();return o.insertBefore(r.element_,o.firstChild||null),r.children_=[],r.renderedVisible_=!0,r}return e.prototype.dispatchRenderEvent=function(n,r){var i=this.getMap();if(i.hasListener(n)){var o=new AMe(n,void 0,r);i.dispatchEvent(o)}},e.prototype.disposeInternal=function(){ri(this.fontChangeListenerKey_),this.element_.parentNode.removeChild(this.element_),t.prototype.disposeInternal.call(this)},e.prototype.renderFrame=function(n){if(!n){this.renderedVisible_&&(this.element_.style.display="none",this.renderedVisible_=!1);return}this.calculateMatrices2D(n),this.dispatchRenderEvent(Fv.PRECOMPOSE,n);var r=n.layerStatesArray.sort(function(h,p){return h.zIndex-p.zIndex}),i=n.viewState;this.children_.length=0;for(var o=[],s=null,a=0,l=r.length;a=0;--a)o[a].renderDeclutter(n);Fgt(this.element_,this.children_),this.dispatchRenderEvent(Fv.POSTCOMPOSE,n),this.renderedVisible_||(this.element_.style.display="",this.renderedVisible_=!0),this.scheduleExpireIconCache(n)},e.prototype.forEachLayerAtPixel=function(n,r,i,o,s){for(var a=r.viewState,l=r.layerStatesArray,c=l.length,u=c-1;u>=0;--u){var f=l[u],d=f.layer;if(d.hasRenderer()&&iN(f,a)&&s(d)){var h=d.getRenderer(),p=h.getDataAtPixel(n,r,i);if(p){var g=o(d,p);if(g)return g}}}},e}(hvt),FMe=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),Hm=function(t){FMe(e,t);function e(n,r){var i=t.call(this,n)||this;return i.layer=r,i}return e}(Nh),mW={LAYERS:"layers"},L4=function(t){FMe(e,t);function e(n){var r=this,i=n||{},o=fi({},i);delete o.layers;var s=i.layers;return r=t.call(this,o)||this,r.on,r.once,r.un,r.layersListenerKeys_=[],r.listenerKeys_={},r.addChangeListener(mW.LAYERS,r.handleLayersChanged_),s?Array.isArray(s)?s=new ru(s.slice(),{unique:!0}):bn(typeof s.getArray=="function",43):s=new ru(void 0,{unique:!0}),r.setLayers(s),r}return e.prototype.handleLayerChange_=function(){this.changed()},e.prototype.handleLayersChanged_=function(){this.layersListenerKeys_.forEach(ri),this.layersListenerKeys_.length=0;var n=this.getLayers();this.layersListenerKeys_.push(zn(n,Qa.ADD,this.handleLayersAdd_,this),zn(n,Qa.REMOVE,this.handleLayersRemove_,this));for(var r in this.listenerKeys_)this.listenerKeys_[r].forEach(ri);LM(this.listenerKeys_);for(var i=n.getArray(),o=0,s=i.length;othis.moveTolerance_||Math.abs(n.clientY-this.down_.clientY)>this.moveTolerance_},e.prototype.disposeInternal=function(){this.relayedListenerKey_&&(ri(this.relayedListenerKey_),this.relayedListenerKey_=null),this.element_.removeEventListener(nn.TOUCHMOVE,this.boundHandleTouchMove_),this.pointerdownListenerKey_&&(ri(this.pointerdownListenerKey_),this.pointerdownListenerKey_=null),this.dragListenerKeys_.forEach(ri),this.dragListenerKeys_.length=0,this.element_=null,t.prototype.disposeInternal.call(this)},e}(JC);const Mm={POSTRENDER:"postrender",MOVESTART:"movestart",MOVEEND:"moveend",LOADSTART:"loadstart",LOADEND:"loadend"},$s={LAYERGROUP:"layergroup",SIZE:"size",TARGET:"target",VIEW:"view"};var sN=1/0,wvt=function(){function t(e,n){this.priorityFunction_=e,this.keyFunction_=n,this.elements_=[],this.priorities_=[],this.queuedElements_={}}return t.prototype.clear=function(){this.elements_.length=0,this.priorities_.length=0,LM(this.queuedElements_)},t.prototype.dequeue=function(){var e=this.elements_,n=this.priorities_,r=e[0];e.length==1?(e.length=0,n.length=0):(e[0]=e.pop(),n[0]=n.pop(),this.siftUp_(0));var i=this.keyFunction_(r);return delete this.queuedElements_[i],r},t.prototype.enqueue=function(e){bn(!(this.keyFunction_(e)in this.queuedElements_),31);var n=this.priorityFunction_(e);return n!=sN?(this.elements_.push(e),this.priorities_.push(n),this.queuedElements_[this.keyFunction_(e)]=!0,this.siftDown_(0,this.elements_.length-1),!0):!1},t.prototype.getCount=function(){return this.elements_.length},t.prototype.getLeftChildIndex_=function(e){return e*2+1},t.prototype.getRightChildIndex_=function(e){return e*2+2},t.prototype.getParentIndex_=function(e){return e-1>>1},t.prototype.heapify_=function(){var e;for(e=(this.elements_.length>>1)-1;e>=0;e--)this.siftUp_(e)},t.prototype.isEmpty=function(){return this.elements_.length===0},t.prototype.isKeyQueued=function(e){return e in this.queuedElements_},t.prototype.isQueued=function(e){return this.isKeyQueued(this.keyFunction_(e))},t.prototype.siftUp_=function(e){for(var n=this.elements_,r=this.priorities_,i=n.length,o=n[e],s=r[e],a=e;e>1;){var l=this.getLeftChildIndex_(e),c=this.getRightChildIndex_(e),u=ce;){var a=this.getParentIndex_(n);if(i[a]>s)r[n]=r[a],i[n]=i[a],n=a;else break}r[n]=o,i[n]=s},t.prototype.reprioritize=function(){var e=this.priorityFunction_,n=this.elements_,r=this.priorities_,i=0,o=n.length,s,a,l;for(a=0;a0;)s=this.dequeue()[0],a=s.getKey(),o=s.getState(),o===Xt.IDLE&&!(a in this.tilesLoadingKeys_)&&(this.tilesLoadingKeys_[a]=!0,++this.tilesLoading_,++i,s.load())},e}(wvt);function Cvt(t,e,n,r,i){if(!t||!(n in t.wantedTiles)||!t.wantedTiles[n][e.getKey()])return sN;var o=t.viewState.center,s=r[0]-o[0],a=r[1]-o[1];return 65536*Math.log(i)+Math.sqrt(s*s+a*a)/i}const Xu={CENTER:"center",RESOLUTION:"resolution",ROTATION:"rotation"};var Ovt=42,yte=256;function Nhe(t,e,n){return function(r,i,o,s,a){if(r){if(!i&&!e)return r;var l=e?0:o[0]*i,c=e?0:o[1]*i,u=a?a[0]:0,f=a?a[1]:0,d=t[0]+l/2+u,h=t[2]-l/2+u,p=t[1]+c/2+f,g=t[3]-c/2+f;d>h&&(d=(h+d)/2,h=d),p>g&&(p=(g+p)/2,g=p);var m=so(r[0],d,h),v=so(r[1],p,g);if(s&&n&&i){var y=30*i;m+=-y*Math.log(1+Math.max(0,d-r[0])/y)+y*Math.log(1+Math.max(0,r[0]-h)/y),v+=-y*Math.log(1+Math.max(0,p-r[1])/y)+y*Math.log(1+Math.max(0,r[1]-g)/y)}return[m,v]}}}function Evt(t){return t}function xte(t,e,n,r){var i=Kr(e)/n[0],o=Ou(e)/n[1];return r?Math.min(t,Math.max(i,o)):Math.min(t,Math.min(i,o))}function bte(t,e,n){var r=Math.min(t,e),i=50;return r*=Math.log(1+i*Math.max(0,t/e-1))/i+1,n&&(r=Math.max(r,n),r/=Math.log(1+i*Math.max(0,n/t-1))/i+1),so(r,n/2,e*2)}function Tvt(t,e,n,r){return function(i,o,s,a){if(i!==void 0){var l=t[0],c=t[t.length-1],u=n?xte(l,n,s,r):l;if(a){var f=e!==void 0?e:!0;return f?bte(i,u,c):so(i,c,u)}var d=Math.min(u,i),h=Math.floor(jee(t,d,o));return t[h]>u&&h1&&typeof arguments[r-1]=="function"&&(i=arguments[r-1],--r);for(var o=0;o0},e.prototype.getInteracting=function(){return this.hints_[Bs.INTERACTING]>0},e.prototype.cancelAnimations=function(){this.setHint(Bs.ANIMATING,-this.hints_[Bs.ANIMATING]);for(var n,r=0,i=this.animations_.length;r=0;--i){for(var o=this.animations_[i],s=!0,a=0,l=o.length;a0?u/c.duration:1;f>=1?(c.complete=!0,f=1):s=!1;var d=c.easing(f);if(c.sourceCenter){var h=c.sourceCenter[0],p=c.sourceCenter[1],g=c.targetCenter[0],m=c.targetCenter[1];this.nextCenter_=c.targetCenter;var v=h+d*(g-h),y=p+d*(m-p);this.targetCenter_=[v,y]}if(c.sourceResolution&&c.targetResolution){var x=d===1?c.targetResolution:c.sourceResolution+d*(c.targetResolution-c.sourceResolution);if(c.anchor){var b=this.getViewportSize_(this.getRotation()),w=this.constraints_.resolution(x,0,b,!0);this.targetCenter_=this.calculateCenterZoom(w,c.anchor)}this.nextResolution_=c.targetResolution,this.targetResolution_=x,this.applyTargetState_(!0)}if(c.sourceRotation!==void 0&&c.targetRotation!==void 0){var _=d===1?$v(c.targetRotation+Math.PI,2*Math.PI)-Math.PI:c.sourceRotation+d*(c.targetRotation-c.sourceRotation);if(c.anchor){var S=this.constraints_.rotation(_,!0);this.targetCenter_=this.calculateCenterRotate(S,c.anchor)}this.nextRotation_=c.targetRotation,this.targetRotation_=_}if(this.applyTargetState_(!0),r=!0,!c.complete)break}}if(s){this.animations_[i]=null,this.setHint(Bs.ANIMATING,-1),this.nextCenter_=null,this.nextResolution_=NaN,this.nextRotation_=NaN;var O=o[0].callback;O&&xI(O,!0)}}this.animations_=this.animations_.filter(Boolean),r&&this.updateAnimationKey_===void 0&&(this.updateAnimationKey_=requestAnimationFrame(this.updateAnimations_.bind(this)))}},e.prototype.calculateCenterRotate=function(n,r){var i,o=this.getCenterInternal();return o!==void 0&&(i=[o[0]-r[0],o[1]-r[1]],Xee(i,n-this.getRotation()),Eht(i,r)),i},e.prototype.calculateCenterZoom=function(n,r){var i,o=this.getCenterInternal(),s=this.getResolution();if(o!==void 0&&s!==void 0){var a=r[0]-n*(r[0]-o[0])/s,l=r[1]-n*(r[1]-o[1])/s;i=[a,l]}return i},e.prototype.getViewportSize_=function(n){var r=this.viewportSize_;if(n){var i=r[0],o=r[1];return[Math.abs(i*Math.cos(n))+Math.abs(o*Math.sin(n)),Math.abs(i*Math.sin(n))+Math.abs(o*Math.cos(n))]}else return r},e.prototype.setViewportSize=function(n){this.viewportSize_=Array.isArray(n)?n.slice():[100,100],this.getAnimating()||this.resolveConstraints(0)},e.prototype.getCenter=function(){var n=this.getCenterInternal();return n&&oq(n,this.getProjection())},e.prototype.getCenterInternal=function(){return this.get(Xu.CENTER)},e.prototype.getConstraints=function(){return this.constraints_},e.prototype.getConstrainResolution=function(){return this.get("constrainResolution")},e.prototype.getHints=function(n){return n!==void 0?(n[0]=this.hints_[0],n[1]=this.hints_[1],n):this.hints_.slice()},e.prototype.calculateExtent=function(n){var r=this.calculateExtentInternal(n);return jPe(r,this.getProjection())},e.prototype.calculateExtentInternal=function(n){var r=n||this.getViewportSizeMinusPadding_(),i=this.getCenterInternal();bn(i,1);var o=this.getResolution();bn(o!==void 0,2);var s=this.getRotation();return bn(s!==void 0,3),tq(i,o,s,r)},e.prototype.getMaxResolution=function(){return this.maxResolution_},e.prototype.getMinResolution=function(){return this.minResolution_},e.prototype.getMaxZoom=function(){return this.getZoomForResolution(this.minResolution_)},e.prototype.setMaxZoom=function(n){this.applyOptions_(this.getUpdatedOptions_({maxZoom:n}))},e.prototype.getMinZoom=function(){return this.getZoomForResolution(this.maxResolution_)},e.prototype.setMinZoom=function(n){this.applyOptions_(this.getUpdatedOptions_({minZoom:n}))},e.prototype.setConstrainResolution=function(n){this.applyOptions_(this.getUpdatedOptions_({constrainResolution:n}))},e.prototype.getProjection=function(){return this.projection_},e.prototype.getResolution=function(){return this.get(Xu.RESOLUTION)},e.prototype.getResolutions=function(){return this.resolutions_},e.prototype.getResolutionForExtent=function(n,r){return this.getResolutionForExtentInternal(ux(n,this.getProjection()),r)},e.prototype.getResolutionForExtentInternal=function(n,r){var i=r||this.getViewportSizeMinusPadding_(),o=Kr(n)/i[0],s=Ou(n)/i[1];return Math.max(o,s)},e.prototype.getResolutionForValueFunction=function(n){var r=n||2,i=this.getConstrainedResolution(this.maxResolution_),o=this.minResolution_,s=Math.log(i/o)/Math.log(r);return function(a){var l=i/Math.pow(r,a*s);return l}},e.prototype.getRotation=function(){return this.get(Xu.ROTATION)},e.prototype.getValueForResolutionFunction=function(n){var r=Math.log(n||2),i=this.getConstrainedResolution(this.maxResolution_),o=this.minResolution_,s=Math.log(i/o)/r;return function(a){var l=Math.log(i/a)/r/s;return l}},e.prototype.getViewportSizeMinusPadding_=function(n){var r=this.getViewportSize_(n),i=this.padding_;return i&&(r=[r[0]-i[1]-i[3],r[1]-i[0]-i[2]]),r},e.prototype.getState=function(){var n=this.getProjection(),r=this.getResolution(),i=this.getRotation(),o=this.getCenterInternal(),s=this.padding_;if(s){var a=this.getViewportSizeMinusPadding_();o=yW(o,this.getViewportSize_(),[a[0]/2+s[3],a[1]/2+s[0]],r,i)}return{center:o.slice(0),projection:n!==void 0?n:null,resolution:r,nextCenter:this.nextCenter_,nextResolution:this.nextResolution_,nextRotation:this.nextRotation_,rotation:i,zoom:this.getZoom()}},e.prototype.getZoom=function(){var n,r=this.getResolution();return r!==void 0&&(n=this.getZoomForResolution(r)),n},e.prototype.getZoomForResolution=function(n){var r=this.minZoom_||0,i,o;if(this.resolutions_){var s=jee(this.resolutions_,n,1);r=s,i=this.resolutions_[s],s==this.resolutions_.length-1?o=2:o=i/this.resolutions_[s+1]}else i=this.maxResolution_,o=this.zoomFactor_;return r+Math.log(i/n)/Math.log(o)},e.prototype.getResolutionForZoom=function(n){if(this.resolutions_){if(this.resolutions_.length<=1)return 0;var r=so(Math.floor(n),0,this.resolutions_.length-2),i=this.resolutions_[r]/this.resolutions_[r+1];return this.resolutions_[r]/Math.pow(i,so(n-r,0,1))}else return this.maxResolution_/Math.pow(this.zoomFactor_,n-this.minZoom_)},e.prototype.fit=function(n,r){var i;if(bn(Array.isArray(n)||typeof n.getSimplifiedGeometry=="function",24),Array.isArray(n)){bn(!qee(n),25);var o=ux(n,this.getProjection());i=cq(o)}else if(n.getType()==="Circle"){var o=ux(n.getExtent(),this.getProjection());i=cq(o),i.rotate(this.getRotation(),ty(o))}else{var s=$ht();s?i=n.clone().transform(s,this.getProjection()):i=n}this.fitInternal(i,r)},e.prototype.rotatedExtentForGeometry=function(n){for(var r=this.getRotation(),i=Math.cos(r),o=Math.sin(-r),s=n.getFlatCoordinates(),a=n.getStride(),l=1/0,c=1/0,u=-1/0,f=-1/0,d=0,h=s.length;d=0;c--){var u=l[c];if(!(u.getMap()!==this||!u.getActive()||!this.getTargetElement())){var f=u.handleEvent(n);if(!f||n.propagationStopped)break}}}},e.prototype.handlePostRender=function(){var n=this.frameState_,r=this.tileQueue_;if(!r.isEmpty()){var i=this.maxTilesLoading_,o=i;if(n){var s=n.viewHints;if(s[Bs.ANIMATING]||s[Bs.INTERACTING]){var a=Date.now()-n.time>8;i=a?0:8,o=a?0:2}}r.getTilesLoading()0;if(this.renderedVisible_!=i&&(this.element.style.display=i?"":"none",this.renderedVisible_=i),!eb(r,this.renderedAttributions_)){$gt(this.ulElement_);for(var o=0,s=r.length;o0&&i%(2*Math.PI)!==0?r.animate({rotation:0,duration:this.duration_,easing:rO}):r.setRotation(0))}},e.prototype.render=function(n){var r=n.frameState;if(r){var i=r.viewState.rotation;if(i!=this.rotation_){var o="rotate("+i+"rad)";if(this.autoHide_){var s=this.element.classList.contains(gI);!s&&i===0?this.element.classList.add(gI):s&&i!==0&&this.element.classList.remove(gI)}this.label_.style.transform=o}this.rotation_=i}},e}($4),Vvt=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),Gvt=function(t){Vvt(e,t);function e(n){var r=this,i=n||{};r=t.call(this,{element:document.createElement("div"),target:i.target})||this;var o=i.className!==void 0?i.className:"ol-zoom",s=i.delta!==void 0?i.delta:1,a=i.zoomInClassName!==void 0?i.zoomInClassName:o+"-in",l=i.zoomOutClassName!==void 0?i.zoomOutClassName:o+"-out",c=i.zoomInLabel!==void 0?i.zoomInLabel:"+",u=i.zoomOutLabel!==void 0?i.zoomOutLabel:"–",f=i.zoomInTipLabel!==void 0?i.zoomInTipLabel:"Zoom in",d=i.zoomOutTipLabel!==void 0?i.zoomOutTipLabel:"Zoom out",h=document.createElement("button");h.className=a,h.setAttribute("type","button"),h.title=f,h.appendChild(typeof c=="string"?document.createTextNode(c):c),h.addEventListener(nn.CLICK,r.handleClick_.bind(r,s),!1);var p=document.createElement("button");p.className=l,p.setAttribute("type","button"),p.title=d,p.appendChild(typeof u=="string"?document.createTextNode(u):u),p.addEventListener(nn.CLICK,r.handleClick_.bind(r,-s),!1);var g=o+" "+WM+" "+gte,m=r.element;return m.className=g,m.appendChild(h),m.appendChild(p),r.duration_=i.duration!==void 0?i.duration:250,r}return e.prototype.handleClick_=function(n,r){r.preventDefault(),this.zoomByDelta_(n)},e.prototype.zoomByDelta_=function(n){var r=this.getMap(),i=r.getView();if(i){var o=i.getZoom();if(o!==void 0){var s=i.getConstrainedZoom(o+n);this.duration_>0?(i.getAnimating()&&i.cancelAnimations(),i.animate({zoom:s,duration:this.duration_,easing:rO})):i.setZoom(s)}}},e}($4),Hvt=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),xW="units",h0={DEGREES:"degrees",IMPERIAL:"imperial",NAUTICAL:"nautical",METRIC:"metric",US:"us"},qvt=[1,2,5],NE=25.4/.28,Xvt=function(t){Hvt(e,t);function e(n){var r=this,i=n||{},o=i.className!==void 0?i.className:i.bar?"ol-scale-bar":"ol-scale-line";return r=t.call(this,{element:document.createElement("div"),render:i.render,target:i.target})||this,r.on,r.once,r.un,r.innerElement_=document.createElement("div"),r.innerElement_.className=o+"-inner",r.element.className=o+" "+WM,r.element.appendChild(r.innerElement_),r.viewState_=null,r.minWidth_=i.minWidth!==void 0?i.minWidth:64,r.maxWidth_=i.maxWidth,r.renderedVisible_=!1,r.renderedWidth_=void 0,r.renderedHTML_="",r.addChangeListener(xW,r.handleUnitsChanged_),r.setUnits(i.units||h0.METRIC),r.scaleBar_=i.bar||!1,r.scaleBarSteps_=i.steps||4,r.scaleBarText_=i.text||!1,r.dpi_=i.dpi||void 0,r}return e.prototype.getUnits=function(){return this.get(xW)},e.prototype.handleUnitsChanged_=function(){this.updateElement_()},e.prototype.setUnits=function(n){this.set(xW,n)},e.prototype.setDpi=function(n){this.dpi_=n},e.prototype.updateElement_=function(){var n=this.viewState_;if(!n){this.renderedVisible_&&(this.element.style.display="none",this.renderedVisible_=!1);return}var r=n.center,i=n.projection,o=this.getUnits(),s=o==h0.DEGREES?Io.DEGREES:Io.METERS,a=XF(i,n.resolution,r,s),l=this.minWidth_*(this.dpi_||NE)/NE,c=this.maxWidth_!==void 0?this.maxWidth_*(this.dpi_||NE)/NE:void 0,u=l*a,f="";if(o==h0.DEGREES){var d=jf[Io.DEGREES];u*=d,u=c){p=v,g=y,m=x;break}else if(g>=l)break;v=p,y=g,x=m,++h}var w;this.scaleBar_?w=this.createScaleBar(g,p,f):w=p.toFixed(m<0?-m:0)+" "+f,this.renderedHTML_!=w&&(this.innerElement_.innerHTML=w,this.renderedHTML_=w),this.renderedWidth_!=g&&(this.innerElement_.style.width=g+"px",this.renderedWidth_=g),this.renderedVisible_||(this.element.style.display="",this.renderedVisible_=!0)},e.prototype.createScaleBar=function(n,r,i){for(var o="1 : "+Math.round(this.getScaleForResolution()).toLocaleString(),s=[],a=n/this.scaleBarSteps_,l="ol-scale-singlebar-odd",c=0;c
'+this.createMarker("relative",c)+(c%2===0||this.scaleBarSteps_===2?this.createStepText(c,n,!1,r,i):"")+"
"),c===this.scaleBarSteps_-1&&s.push(this.createStepText(c+1,n,!0,r,i)),l=l==="ol-scale-singlebar-odd"?"ol-scale-singlebar-even":"ol-scale-singlebar-odd";var u;this.scaleBarText_?u='
'+o+"
":u="";var f='
'+u+s.join("")+"
";return f},e.prototype.createMarker=function(n,r){var i=n==="absolute"?3:-10;return'
'},e.prototype.createStepText=function(n,r,i,o,s){var a=n===0?0:Math.round(o/this.scaleBarSteps_*n*100)/100,l=a+(n===0?"":" "+s),c=n===0?-3:r/this.scaleBarSteps_*-1,u=n===0?0:r/this.scaleBarSteps_*2;return'
'+l+"
"},e.prototype.getScaleForResolution=function(){var n=XF(this.viewState_.projection,this.viewState_.resolution,this.viewState_.center,Io.METERS),r=this.dpi_||NE,i=1e3/25.4;return parseFloat(n.toString())*i*r},e.prototype.render=function(n){var r=n.frameState;r?this.viewState_=r.viewState:this.viewState_=null,this.updateElement_()},e}($4);function Yvt(t){var e={},n=new ru,r=e.zoom!==void 0?e.zoom:!0;r&&n.push(new Gvt(e.zoomOptions));var i=e.rotate!==void 0?e.rotate:!0;i&&n.push(new Wvt(e.rotateOptions));var o=e.attribution!==void 0?e.attribution:!0;return o&&n.push(new Bvt(e.attributionOptions)),n}const xq={ACTIVE:"active"};var Qvt=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),qM=function(t){Qvt(e,t);function e(n){var r=t.call(this)||this;return r.on,r.once,r.un,n&&n.handleEvent&&(r.handleEvent=n.handleEvent),r.map_=null,r.setActive(!0),r}return e.prototype.getActive=function(){return this.get(xq.ACTIVE)},e.prototype.getMap=function(){return this.map_},e.prototype.handleEvent=function(n){return!0},e.prototype.setActive=function(n){this.set(xq.ACTIVE,n)},e.prototype.setMap=function(n){this.map_=n},e}(zh);function Kvt(t,e,n){var r=t.getCenterInternal();if(r){var i=[r[0]+e[0],r[1]+e[1]];t.animateInternal({duration:n!==void 0?n:250,easing:avt,center:t.getConstrainedCenter(i)})}}function _te(t,e,n,r){var i=t.getZoom();if(i!==void 0){var o=t.getConstrainedZoom(i+e),s=t.getResolutionForZoom(o);t.getAnimating()&&t.cancelAnimations(),t.animate({resolution:s,anchor:n,duration:r!==void 0?r:250,easing:rO})}}var Zvt=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),Jvt=function(t){Zvt(e,t);function e(n){var r=t.call(this)||this,i=n||{};return r.delta_=i.delta?i.delta:1,r.duration_=i.duration!==void 0?i.duration:250,r}return e.prototype.handleEvent=function(n){var r=!1;if(n.type==hr.DBLCLICK){var i=n.originalEvent,o=n.map,s=n.coordinate,a=i.shiftKey?-this.delta_:this.delta_,l=o.getView();_te(l,a,s,this.duration_),i.preventDefault(),r=!0}return!r},e}(qM),eyt=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),iO=function(t){eyt(e,t);function e(n){var r=this,i=n||{};return r=t.call(this,i)||this,i.handleDownEvent&&(r.handleDownEvent=i.handleDownEvent),i.handleDragEvent&&(r.handleDragEvent=i.handleDragEvent),i.handleMoveEvent&&(r.handleMoveEvent=i.handleMoveEvent),i.handleUpEvent&&(r.handleUpEvent=i.handleUpEvent),i.stopDown&&(r.stopDown=i.stopDown),r.handlingDownUpSequence=!1,r.targetPointers=[],r}return e.prototype.getPointerCount=function(){return this.targetPointers.length},e.prototype.handleDownEvent=function(n){return!1},e.prototype.handleDragEvent=function(n){},e.prototype.handleEvent=function(n){if(!n.originalEvent)return!0;var r=!1;if(this.updateTrackedPointers_(n),this.handlingDownUpSequence){if(n.type==hr.POINTERDRAG)this.handleDragEvent(n),n.originalEvent.preventDefault();else if(n.type==hr.POINTERUP){var i=this.handleUpEvent(n);this.handlingDownUpSequence=i&&this.targetPointers.length>0}}else if(n.type==hr.POINTERDOWN){var o=this.handleDownEvent(n);this.handlingDownUpSequence=o,r=this.stopDown(o)}else n.type==hr.POINTERMOVE&&this.handleMoveEvent(n);return!r},e.prototype.handleMoveEvent=function(n){},e.prototype.handleUpEvent=function(n){return!1},e.prototype.stopDown=function(n){return n},e.prototype.updateTrackedPointers_=function(n){n.activePointers&&(this.targetPointers=n.activePointers)},e}(qM);function Ste(t){for(var e=t.length,n=0,r=0,i=0;i0&&this.condition_(n)){var r=n.map,i=r.getView();return this.lastCentroid=null,i.getAnimating()&&i.cancelAnimations(),this.kinetic_&&this.kinetic_.begin(),this.noKinetic_=this.targetPointers.length>1,!0}else return!1},e}(iO),syt=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),ayt=function(t){syt(e,t);function e(n){var r=this,i=n||{};return r=t.call(this,{stopDown:IM})||this,r.condition_=i.condition?i.condition:tyt,r.lastAngle_=void 0,r.duration_=i.duration!==void 0?i.duration:250,r}return e.prototype.handleDragEvent=function(n){if(bW(n)){var r=n.map,i=r.getView();if(i.getConstraints().rotation!==wte){var o=r.getSize(),s=n.pixel,a=Math.atan2(o[1]/2-s[1],s[0]-o[0]/2);if(this.lastAngle_!==void 0){var l=a-this.lastAngle_;i.adjustRotationInternal(-l)}this.lastAngle_=a}}},e.prototype.handleUpEvent=function(n){if(!bW(n))return!0;var r=n.map,i=r.getView();return i.endInteraction(this.duration_),!1},e.prototype.handleDownEvent=function(n){if(!bW(n))return!1;if(UMe(n)&&this.condition_(n)){var r=n.map;return r.getView().beginInteraction(),this.lastAngle_=void 0,!0}else return!1},e}(iO),lyt=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),cyt=function(t){lyt(e,t);function e(n){var r=t.call(this)||this;return r.geometry_=null,r.element_=document.createElement("div"),r.element_.style.position="absolute",r.element_.style.pointerEvents="auto",r.element_.className="ol-box "+n,r.map_=null,r.startPixel_=null,r.endPixel_=null,r}return e.prototype.disposeInternal=function(){this.setMap(null)},e.prototype.render_=function(){var n=this.startPixel_,r=this.endPixel_,i="px",o=this.element_.style;o.left=Math.min(n[0],r[0])+i,o.top=Math.min(n[1],r[1])+i,o.width=Math.abs(r[0]-n[0])+i,o.height=Math.abs(r[1]-n[1])+i},e.prototype.setMap=function(n){if(this.map_){this.map_.getOverlayContainer().removeChild(this.element_);var r=this.element_.style;r.left="inherit",r.top="inherit",r.width="inherit",r.height="inherit"}this.map_=n,this.map_&&this.map_.getOverlayContainer().appendChild(this.element_)},e.prototype.setPixels=function(n,r){this.startPixel_=n,this.endPixel_=r,this.createOrUpdateGeometry(),this.render_()},e.prototype.createOrUpdateGeometry=function(){var n=this.startPixel_,r=this.endPixel_,i=[n,[n[0],r[1]],r,[r[0],n[1]]],o=i.map(this.map_.getCoordinateFromPixelInternal,this.map_);o[4]=o[0].slice(),this.geometry_?this.geometry_.setCoordinates([o]):this.geometry_=new ny([o])},e.prototype.getGeometry=function(){return this.geometry_},e}(zee),GMe=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),bI={BOXSTART:"boxstart",BOXDRAG:"boxdrag",BOXEND:"boxend",BOXCANCEL:"boxcancel"},wW=function(t){GMe(e,t);function e(n,r,i){var o=t.call(this,n)||this;return o.coordinate=r,o.mapBrowserEvent=i,o}return e}(Nh),uyt=function(t){GMe(e,t);function e(n){var r=t.call(this)||this;r.on,r.once,r.un;var i=n||{};return r.box_=new cyt(i.className||"ol-dragbox"),r.minArea_=i.minArea!==void 0?i.minArea:64,i.onBoxEnd&&(r.onBoxEnd=i.onBoxEnd),r.startPixel_=null,r.condition_=i.condition?i.condition:UMe,r.boxEndCondition_=i.boxEndCondition?i.boxEndCondition:r.defaultBoxEndCondition,r}return e.prototype.defaultBoxEndCondition=function(n,r,i){var o=i[0]-r[0],s=i[1]-r[1];return o*o+s*s>=this.minArea_},e.prototype.getGeometry=function(){return this.box_.getGeometry()},e.prototype.handleDragEvent=function(n){this.box_.setPixels(this.startPixel_,n.pixel),this.dispatchEvent(new wW(bI.BOXDRAG,n.coordinate,n))},e.prototype.handleUpEvent=function(n){this.box_.setMap(null);var r=this.boxEndCondition_(n,this.startPixel_,n.pixel);return r&&this.onBoxEnd(n),this.dispatchEvent(new wW(r?bI.BOXEND:bI.BOXCANCEL,n.coordinate,n)),!1},e.prototype.handleDownEvent=function(n){return this.condition_(n)?(this.startPixel_=n.pixel,this.box_.setMap(n.map),this.box_.setPixels(this.startPixel_,this.startPixel_),this.dispatchEvent(new wW(bI.BOXSTART,n.coordinate,n)),!0):!1},e.prototype.onBoxEnd=function(n){},e}(iO),fyt=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),dyt=function(t){fyt(e,t);function e(n){var r=this,i=n||{},o=i.condition?i.condition:WMe;return r=t.call(this,{condition:o,className:i.className||"ol-dragzoom",minArea:i.minArea})||this,r.duration_=i.duration!==void 0?i.duration:200,r.out_=i.out!==void 0?i.out:!1,r}return e.prototype.onBoxEnd=function(n){var r=this.getMap(),i=r.getView(),o=this.getGeometry();if(this.out_){var s=i.rotatedExtentForGeometry(o),a=i.getResolutionForExtentInternal(s),l=i.getResolution()/a;o=o.clone(),o.scale(l*l)}i.fitInternal(o,{duration:this.duration_,easing:rO})},e}(uyt);const p0={LEFT:37,UP:38,RIGHT:39,DOWN:40};var hyt=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),pyt=function(t){hyt(e,t);function e(n){var r=t.call(this)||this,i=n||{};return r.defaultCondition_=function(o){return Cte(o)&&VMe(o)},r.condition_=i.condition!==void 0?i.condition:r.defaultCondition_,r.duration_=i.duration!==void 0?i.duration:100,r.pixelDelta_=i.pixelDelta!==void 0?i.pixelDelta:128,r}return e.prototype.handleEvent=function(n){var r=!1;if(n.type==nn.KEYDOWN){var i=n.originalEvent,o=i.keyCode;if(this.condition_(n)&&(o==p0.DOWN||o==p0.LEFT||o==p0.RIGHT||o==p0.UP)){var s=n.map,a=s.getView(),l=a.getResolution()*this.pixelDelta_,c=0,u=0;o==p0.DOWN?u=-l:o==p0.LEFT?c=-l:o==p0.RIGHT?c=l:u=l;var f=[c,u];Xee(f,a.getRotation()),Kvt(a,f,this.duration_),i.preventDefault(),r=!0}}return!r},e}(qM),gyt=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),myt=function(t){gyt(e,t);function e(n){var r=t.call(this)||this,i=n||{};return r.condition_=i.condition?i.condition:VMe,r.delta_=i.delta?i.delta:1,r.duration_=i.duration!==void 0?i.duration:100,r}return e.prototype.handleEvent=function(n){var r=!1;if(n.type==nn.KEYDOWN||n.type==nn.KEYPRESS){var i=n.originalEvent,o=i.charCode;if(this.condition_(n)&&(o==43||o==45)){var s=n.map,a=o==43?this.delta_:-this.delta_,l=s.getView();_te(l,a,void 0,this.duration_),i.preventDefault(),r=!0}}return!r},e}(qM),vyt=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),_W={TRACKPAD:"trackpad",WHEEL:"wheel"},yyt=function(t){vyt(e,t);function e(n){var r=this,i=n||{};r=t.call(this,i)||this,r.totalDelta_=0,r.lastDelta_=0,r.maxDelta_=i.maxDelta!==void 0?i.maxDelta:1,r.duration_=i.duration!==void 0?i.duration:250,r.timeout_=i.timeout!==void 0?i.timeout:80,r.useAnchor_=i.useAnchor!==void 0?i.useAnchor:!0,r.constrainResolution_=i.constrainResolution!==void 0?i.constrainResolution:!1;var o=i.condition?i.condition:BMe;return r.condition_=i.onFocusOnly?bq(jMe,o):o,r.lastAnchor_=null,r.startTime_=void 0,r.timeoutId_,r.mode_=void 0,r.trackpadEventGap_=400,r.trackpadTimeoutId_,r.deltaPerZoom_=300,r}return e.prototype.endInteraction_=function(){this.trackpadTimeoutId_=void 0;var n=this.getMap();if(n){var r=n.getView();r.endInteraction(void 0,this.lastDelta_?this.lastDelta_>0?1:-1:0,this.lastAnchor_)}},e.prototype.handleEvent=function(n){if(!this.condition_(n))return!0;var r=n.type;if(r!==nn.WHEEL)return!0;var i=n.map,o=n.originalEvent;o.preventDefault(),this.useAnchor_&&(this.lastAnchor_=n.coordinate);var s;if(n.type==nn.WHEEL&&(s=o.deltaY,qdt&&o.deltaMode===WheelEvent.DOM_DELTA_PIXEL&&(s/=TPe),o.deltaMode===WheelEvent.DOM_DELTA_LINE&&(s*=40)),s===0)return!1;this.lastDelta_=s;var a=Date.now();this.startTime_===void 0&&(this.startTime_=a),(!this.mode_||a-this.startTime_>this.trackpadEventGap_)&&(this.mode_=Math.abs(s)<4?_W.TRACKPAD:_W.WHEEL);var l=i.getView();if(this.mode_===_W.TRACKPAD&&!(l.getConstrainResolution()||this.constrainResolution_))return this.trackpadTimeoutId_?clearTimeout(this.trackpadTimeoutId_):(l.getAnimating()&&l.cancelAnimations(),l.beginInteraction()),this.trackpadTimeoutId_=setTimeout(this.endInteraction_.bind(this),this.timeout_),l.adjustZoom(-s/this.deltaPerZoom_,this.lastAnchor_),this.startTime_=a,!1;this.totalDelta_+=s;var c=Math.max(this.timeout_-(a-this.startTime_),0);return clearTimeout(this.timeoutId_),this.timeoutId_=setTimeout(this.handleWheelZoom_.bind(this,i),c),!1},e.prototype.handleWheelZoom_=function(n){var r=n.getView();r.getAnimating()&&r.cancelAnimations();var i=-so(this.totalDelta_,-this.maxDelta_*this.deltaPerZoom_,this.maxDelta_*this.deltaPerZoom_)/this.deltaPerZoom_;(r.getConstrainResolution()||this.constrainResolution_)&&(i=i?i>0?1:-1:0),_te(r,i,this.lastAnchor_,this.duration_),this.mode_=void 0,this.totalDelta_=0,this.lastAnchor_=null,this.startTime_=void 0,this.timeoutId_=void 0},e.prototype.setMouseAnchor=function(n){this.useAnchor_=n,n||(this.lastAnchor_=null)},e}(qM),xyt=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),byt=function(t){xyt(e,t);function e(n){var r=this,i=n||{},o=i;return o.stopDown||(o.stopDown=IM),r=t.call(this,o)||this,r.anchor_=null,r.lastAngle_=void 0,r.rotating_=!1,r.rotationDelta_=0,r.threshold_=i.threshold!==void 0?i.threshold:.3,r.duration_=i.duration!==void 0?i.duration:250,r}return e.prototype.handleDragEvent=function(n){var r=0,i=this.targetPointers[0],o=this.targetPointers[1],s=Math.atan2(o.clientY-i.clientY,o.clientX-i.clientX);if(this.lastAngle_!==void 0){var a=s-this.lastAngle_;this.rotationDelta_+=a,!this.rotating_&&Math.abs(this.rotationDelta_)>this.threshold_&&(this.rotating_=!0),r=a}this.lastAngle_=s;var l=n.map,c=l.getView();if(c.getConstraints().rotation!==wte){var u=l.getViewport().getBoundingClientRect(),f=Ste(this.targetPointers);f[0]-=u.left,f[1]-=u.top,this.anchor_=l.getCoordinateFromPixelInternal(f),this.rotating_&&(l.render(),c.adjustRotationInternal(r,this.anchor_))}},e.prototype.handleUpEvent=function(n){if(this.targetPointers.length<2){var r=n.map,i=r.getView();return i.endInteraction(this.duration_),!1}else return!0},e.prototype.handleDownEvent=function(n){if(this.targetPointers.length>=2){var r=n.map;return this.anchor_=null,this.lastAngle_=void 0,this.rotating_=!1,this.rotationDelta_=0,this.handlingDownUpSequence||r.getView().beginInteraction(),!0}else return!1},e}(iO),wyt=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),_yt=function(t){wyt(e,t);function e(n){var r=this,i=n||{},o=i;return o.stopDown||(o.stopDown=IM),r=t.call(this,o)||this,r.anchor_=null,r.duration_=i.duration!==void 0?i.duration:400,r.lastDistance_=void 0,r.lastScaleDelta_=1,r}return e.prototype.handleDragEvent=function(n){var r=1,i=this.targetPointers[0],o=this.targetPointers[1],s=i.clientX-o.clientX,a=i.clientY-o.clientY,l=Math.sqrt(s*s+a*a);this.lastDistance_!==void 0&&(r=this.lastDistance_/l),this.lastDistance_=l;var c=n.map,u=c.getView();r!=1&&(this.lastScaleDelta_=r);var f=c.getViewport().getBoundingClientRect(),d=Ste(this.targetPointers);d[0]-=f.left,d[1]-=f.top,this.anchor_=c.getCoordinateFromPixelInternal(d),c.render(),u.adjustResolutionInternal(r,this.anchor_)},e.prototype.handleUpEvent=function(n){if(this.targetPointers.length<2){var r=n.map,i=r.getView(),o=this.lastScaleDelta_>1?1:-1;return i.endInteraction(this.duration_,o),!1}else return!0},e.prototype.handleDownEvent=function(n){if(this.targetPointers.length>=2){var r=n.map;return this.anchor_=null,this.lastDistance_=void 0,this.lastScaleDelta_=1,this.handlingDownUpSequence||r.getView().beginInteraction(),!0}else return!1},e}(iO),Syt=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),Ote=function(t){Syt(e,t);function e(n,r,i){var o=t.call(this)||this;if(i!==void 0&&r===void 0)o.setFlatCoordinates(i,n);else{var s=r||0;o.setCenterAndRadius(n,s,i)}return o}return e.prototype.clone=function(){var n=new e(this.flatCoordinates.slice(),void 0,this.layout);return n.applyProperties(this),n},e.prototype.closestPointXY=function(n,r,i,o){var s=this.flatCoordinates,a=n-s[0],l=r-s[1],c=a*a+l*l;if(c=i[0]||n[1]<=i[1]&&n[3]>=i[1]?!0:Wee(n,this.intersectsCoordinate.bind(this))}return!1},e.prototype.setCenter=function(n){var r=this.stride,i=this.flatCoordinates[r]-this.flatCoordinates[0],o=n.slice();o[r]=o[0]+i;for(var s=1;s=this.dragVertexDelay_?(this.downPx_=n.pixel,this.shouldHandle_=!this.freehand_,r=!0):this.lastDragTime_=void 0,this.shouldHandle_&&this.downTimeout_!==void 0&&(clearTimeout(this.downTimeout_),this.downTimeout_=void 0)}return this.freehand_&&n.type===hr.POINTERDRAG&&this.sketchFeature_!==null?(this.addToDrawing_(n.coordinate),i=!1):this.freehand_&&n.type===hr.POINTERDOWN?i=!1:r&&this.getPointerCount()<2?(i=n.type===hr.POINTERMOVE,i&&this.freehand_?(this.handlePointerMove_(n),this.shouldHandle_&&n.originalEvent.preventDefault()):(n.originalEvent.pointerType==="mouse"||n.type===hr.POINTERDRAG&&this.downTimeout_===void 0)&&this.handlePointerMove_(n)):n.type===hr.DBLCLICK&&(i=!1),t.prototype.handleEvent.call(this,n)&&i},e.prototype.handleDownEvent=function(n){return this.shouldHandle_=!this.freehand_,this.freehand_?(this.downPx_=n.pixel,this.finishCoordinate_||this.startDrawing_(n.coordinate),!0):this.condition_(n)?(this.lastDragTime_=Date.now(),this.downTimeout_=setTimeout((function(){this.handlePointerMove_(new kp(hr.POINTERMOVE,n.map,n.originalEvent,!1,n.frameState))}).bind(this),this.dragVertexDelay_),this.downPx_=n.pixel,!0):(this.lastDragTime_=void 0,!1)},e.prototype.handleUpEvent=function(n){var r=!0;if(this.getPointerCount()===0)if(this.downTimeout_&&(clearTimeout(this.downTimeout_),this.downTimeout_=void 0),this.handlePointerMove_(n),this.shouldHandle_){var i=!this.finishCoordinate_;i&&this.startDrawing_(n.coordinate),!i&&this.freehand_?this.finishDrawing():!this.freehand_&&(!i||this.mode_===Vn.POINT)&&(this.atFinish_(n.pixel)?this.finishCondition_(n)&&this.finishDrawing():this.addToDrawing_(n.coordinate)),r=!1}else this.freehand_&&this.abortDrawing();return!r&&this.stopClick_&&n.preventDefault(),r},e.prototype.handlePointerMove_=function(n){if(this.pointerType_=n.originalEvent.pointerType,this.downPx_&&(!this.freehand_&&this.shouldHandle_||this.freehand_&&!this.shouldHandle_)){var r=this.downPx_,i=n.pixel,o=r[0]-i[0],s=r[1]-i[1],a=o*o+s*s;if(this.shouldHandle_=this.freehand_?a>this.squaredClickTolerance_:a<=this.squaredClickTolerance_,!this.shouldHandle_)return}this.finishCoordinate_?this.modifyDrawing_(n.coordinate):this.createOrUpdateSketchPoint_(n.coordinate.slice())},e.prototype.atFinish_=function(n){var r=!1;if(this.sketchFeature_){var i=!1,o=[this.finishCoordinate_],s=this.mode_;if(s===Vn.POINT)r=!0;else if(s===Vn.CIRCLE)r=this.sketchCoords_.length===2;else if(s===Vn.LINE_STRING)i=this.sketchCoords_.length>this.minPoints_;else if(s===Vn.POLYGON){var a=this.sketchCoords_;i=a[0].length>this.minPoints_,o=[a[0][0],a[0][a[0].length-2]]}if(i)for(var l=this.getMap(),c=0,u=o.length;c=this.maxPoints_&&(this.freehand_?s.pop():o=!0),s.push(n.slice()),this.geometryFunction_(s,r,i)):a===Vn.POLYGON&&(s=this.sketchCoords_[0],s.length>=this.maxPoints_&&(this.freehand_?s.pop():o=!0),s.push(n.slice()),o&&(this.finishCoordinate_=s[0]),this.geometryFunction_(this.sketchCoords_,r,i)),this.createOrUpdateSketchPoint_(n.slice()),this.updateSketchFeatures_(),o&&this.finishDrawing()},e.prototype.removeLastPoint=function(){if(this.sketchFeature_){var n=this.sketchFeature_.getGeometry(),r=this.getMap().getView().getProjection(),i,o=this.mode_;if(o===Vn.LINE_STRING||o===Vn.CIRCLE){if(i=this.sketchCoords_,i.splice(-2,1),i.length>=2){this.finishCoordinate_=i[i.length-2].slice();var s=this.finishCoordinate_.slice();i[i.length-1]=s,this.createOrUpdateSketchPoint_(s)}this.geometryFunction_(i,n,r),n.getType()==="Polygon"&&this.sketchLine_&&this.createOrUpdateCustomSketchLine_(n)}else if(o===Vn.POLYGON){i=this.sketchCoords_[0],i.splice(-2,1);var a=this.sketchLine_.getGeometry();if(i.length>=2){var s=i[i.length-2].slice();i[i.length-1]=s,this.createOrUpdateSketchPoint_(s)}a.setCoordinates(i),this.geometryFunction_(this.sketchCoords_,n,r)}i.length===1&&this.abortDrawing(),this.updateSketchFeatures_()}},e.prototype.finishDrawing=function(){var n=this.abortDrawing_();if(n){var r=this.sketchCoords_,i=n.getGeometry(),o=this.getMap().getView().getProjection();this.mode_===Vn.LINE_STRING?(r.pop(),this.geometryFunction_(r,i,o)):this.mode_===Vn.POLYGON&&(r[0].pop(),this.geometryFunction_(r,i,o),r=i.getCoordinates()),this.type_==="MultiPoint"?n.setGeometry(new P4([r])):this.type_==="MultiLineString"?n.setGeometry(new ste([r])):this.type_==="MultiPolygon"&&n.setGeometry(new ate([r])),this.dispatchEvent(new _I(wI.DRAWEND,n)),this.features_&&this.features_.push(n),this.source_&&this.source_.addFeature(n)}},e.prototype.abortDrawing_=function(){this.finishCoordinate_=null;var n=this.sketchFeature_;return this.sketchFeature_=null,this.sketchPoint_=null,this.sketchLine_=null,this.overlay_.getSource().clear(!0),n},e.prototype.abortDrawing=function(){var n=this.abortDrawing_();n&&this.dispatchEvent(new _I(wI.DRAWABORT,n))},e.prototype.appendCoordinates=function(n){var r=this.mode_,i=!this.sketchFeature_;i&&this.startDrawing_(n[0]);var o;if(r===Vn.LINE_STRING||r===Vn.CIRCLE)o=this.sketchCoords_;else if(r===Vn.POLYGON)o=this.sketchCoords_&&this.sketchCoords_.length?this.sketchCoords_[0]:[];else return;i&&o.shift(),o.pop();for(var s=0;s0&&this.getCount()>this.highWaterMark},t.prototype.expireCache=function(e){for(;this.canExpireCache();)this.pop()},t.prototype.clear=function(){this.count_=0,this.entries_={},this.oldest_=null,this.newest_=null},t.prototype.containsKey=function(e){return this.entries_.hasOwnProperty(e)},t.prototype.forEach=function(e){for(var n=this.oldest_;n;)e(n.value_,n.key_,this),n=n.newer},t.prototype.get=function(e,n){var r=this.entries_[e];return bn(r!==void 0,15),r===this.newest_||(r===this.oldest_?(this.oldest_=this.oldest_.newer,this.oldest_.older=null):(r.newer.older=r.older,r.older.newer=r.newer),r.newer=null,r.older=this.newest_,this.newest_.newer=r,this.newest_=r),r.value_},t.prototype.remove=function(e){var n=this.entries_[e];return bn(n!==void 0,15),n===this.newest_?(this.newest_=n.older,this.newest_&&(this.newest_.newer=null)):n===this.oldest_?(this.oldest_=n.newer,this.oldest_&&(this.oldest_.older=null)):(n.newer.older=n.older,n.older.newer=n.newer),delete this.entries_[e],--this.count_,n.value_},t.prototype.getCount=function(){return this.count_},t.prototype.getKeys=function(){var e=new Array(this.count_),n=0,r;for(r=this.newest_;r;r=r.older)e[n++]=r.key_;return e},t.prototype.getValues=function(){var e=new Array(this.count_),n=0,r;for(r=this.newest_;r;r=r.older)e[n++]=r.value_;return e},t.prototype.peekLast=function(){return this.oldest_.value_},t.prototype.peekLastKey=function(){return this.oldest_.key_},t.prototype.peekFirstKey=function(){return this.newest_.key_},t.prototype.peek=function(e){if(this.containsKey(e))return this.entries_[e].value_},t.prototype.pop=function(){var e=this.oldest_;return delete this.entries_[e.key_],e.newer&&(e.newer.older=null),this.oldest_=e.newer,this.oldest_||(this.newest_=null),--this.count_,e.value_},t.prototype.replace=function(e,n){this.get(e),this.entries_[e].value_=n},t.prototype.set=function(e,n){bn(!(e in this.entries_),16);var r={key_:e,newer:null,older:this.newest_,value_:n};this.newest_?this.newest_.newer=r:this.oldest_=r,this.newest_=r,this.entries_[e]=r,++this.count_},t.prototype.setSize=function(e){this.highWaterMark=e},t}();function Uhe(t,e,n,r){return r!==void 0?(r[0]=t,r[1]=e,r[2]=n,r):[t,e,n]}function F4(t,e,n){return t+"/"+e+"/"+n}function qMe(t){return F4(t[0],t[1],t[2])}function Pyt(t){return t.split("/").map(Number)}function XMe(t){return(t[1]<n||n>e.getMaxZoom())return!1;var o=e.getFullTileRange(n);return o?o.containsXY(r,i):!0}var Ryt=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),YMe=function(t){Ryt(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.expireCache=function(n){for(;this.canExpireCache();){var r=this.peekLast();if(r.getKey()in n)break;this.pop().release()}},e.prototype.pruneExceptNewestZ=function(){if(this.getCount()!==0){var n=this.peekFirstKey(),r=Pyt(n),i=r[0];this.forEach((function(o){o.tileCoord[0]!==i&&(this.remove(qMe(o.tileCoord)),o.release())}).bind(this))}},e}(Ayt),Ete=function(){function t(e,n,r,i){this.minX=e,this.maxX=n,this.minY=r,this.maxY=i}return t.prototype.contains=function(e){return this.containsXY(e[1],e[2])},t.prototype.containsTileRange=function(e){return this.minX<=e.minX&&e.maxX<=this.maxX&&this.minY<=e.minY&&e.maxY<=this.maxY},t.prototype.containsXY=function(e,n){return this.minX<=e&&e<=this.maxX&&this.minY<=n&&n<=this.maxY},t.prototype.equals=function(e){return this.minX==e.minX&&this.minY==e.minY&&this.maxX==e.maxX&&this.maxY==e.maxY},t.prototype.extend=function(e){e.minXthis.maxX&&(this.maxX=e.maxX),e.minYthis.maxY&&(this.maxY=e.maxY)},t.prototype.getHeight=function(){return this.maxY-this.minY+1},t.prototype.getSize=function(){return[this.getWidth(),this.getHeight()]},t.prototype.getWidth=function(){return this.maxX-this.minX+1},t.prototype.intersects=function(e){return this.minX<=e.maxX&&this.maxX>=e.minX&&this.minY<=e.maxY&&this.maxY>=e.minY},t}();function Ub(t,e,n,r,i){return i!==void 0?(i.minX=t,i.maxX=e,i.minY=n,i.maxY=r,i):new Ete(t,e,n,r)}var Dyt=.5,Iyt=10,Whe=.25,Lyt=function(){function t(e,n,r,i,o,s){this.sourceProj_=e,this.targetProj_=n;var a={},l=uA(this.targetProj_,this.sourceProj_);this.transformInv_=function(x){var b=x[0]+"/"+x[1];return a[b]||(a[b]=l(x)),a[b]},this.maxSourceExtent_=i,this.errorThresholdSquared_=o*o,this.triangles_=[],this.wrapsXInSource_=!1,this.canWrapXInSource_=this.sourceProj_.canWrapX()&&!!i&&!!this.sourceProj_.getExtent()&&Kr(i)==Kr(this.sourceProj_.getExtent()),this.sourceWorldWidth_=this.sourceProj_.getExtent()?Kr(this.sourceProj_.getExtent()):null,this.targetWorldWidth_=this.targetProj_.getExtent()?Kr(this.targetProj_.getExtent()):null;var c=nb(r),u=Hee(r),f=Gee(r),d=Vee(r),h=this.transformInv_(c),p=this.transformInv_(u),g=this.transformInv_(f),m=this.transformInv_(d),v=Iyt+(s?Math.max(0,Math.ceil(fht(eq(r)/(s*s*256*256)))):0);if(this.addQuad_(c,u,f,d,h,p,g,m,v),this.wrapsXInSource_){var y=1/0;this.triangles_.forEach(function(x,b,w){y=Math.min(y,x.source[0][0],x.source[1][0],x.source[2][0])}),this.triangles_.forEach((function(x){if(Math.max(x.source[0][0],x.source[1][0],x.source[2][0])-y>this.sourceWorldWidth_/2){var b=[[x.source[0][0],x.source[0][1]],[x.source[1][0],x.source[1][1]],[x.source[2][0],x.source[2][1]]];b[0][0]-y>this.sourceWorldWidth_/2&&(b[0][0]-=this.sourceWorldWidth_),b[1][0]-y>this.sourceWorldWidth_/2&&(b[1][0]-=this.sourceWorldWidth_),b[2][0]-y>this.sourceWorldWidth_/2&&(b[2][0]-=this.sourceWorldWidth_);var w=Math.min(b[0][0],b[1][0],b[2][0]),_=Math.max(b[0][0],b[1][0],b[2][0]);_-w.5&&f<1,p=!1;if(c>0){if(this.targetProj_.isGlobal()&&this.targetWorldWidth_){var g=nhe([e,n,r,i]),m=Kr(g)/this.targetWorldWidth_;p=m>Whe||p}!h&&this.sourceProj_.isGlobal()&&f&&(p=f>Whe||p)}if(!(!p&&this.maxSourceExtent_&&isFinite(u[0])&&isFinite(u[1])&&isFinite(u[2])&&isFinite(u[3])&&!va(u,this.maxSourceExtent_))){var v=0;if(!p&&(!isFinite(o[0])||!isFinite(o[1])||!isFinite(s[0])||!isFinite(s[1])||!isFinite(a[0])||!isFinite(a[1])||!isFinite(l[0])||!isFinite(l[1]))){if(c>0)p=!0;else if(v=(!isFinite(o[0])||!isFinite(o[1])?8:0)+(!isFinite(s[0])||!isFinite(s[1])?4:0)+(!isFinite(a[0])||!isFinite(a[1])?2:0)+(!isFinite(l[0])||!isFinite(l[1])?1:0),v!=1&&v!=2&&v!=4&&v!=8)return}if(c>0){if(!p){var y=[(e[0]+r[0])/2,(e[1]+r[1])/2],x=this.transformInv_(y),b=void 0;if(h){var w=($v(o[0],d)+$v(a[0],d))/2;b=w-$v(x[0],d)}else b=(o[0]+a[0])/2-x[0];var _=(o[1]+a[1])/2-x[1],S=b*b+_*_;p=S>this.errorThresholdSquared_}if(p){if(Math.abs(e[0]-r[0])<=Math.abs(e[1]-r[1])){var O=[(n[0]+r[0])/2,(n[1]+r[1])/2],k=this.transformInv_(O),E=[(i[0]+e[0])/2,(i[1]+e[1])/2],M=this.transformInv_(E);this.addQuad_(e,n,O,E,o,s,k,M,c-1),this.addQuad_(E,O,r,i,M,k,a,l,c-1)}else{var A=[(e[0]+n[0])/2,(e[1]+n[1])/2],P=this.transformInv_(A),T=[(r[0]+i[0])/2,(r[1]+i[1])/2],R=this.transformInv_(T);this.addQuad_(e,A,T,i,o,P,R,l,c-1),this.addQuad_(A,n,r,T,P,s,a,R,c-1)}return}}if(h){if(!this.canWrapXInSource_)return;this.wrapsXInSource_=!0}v&11||this.addTriangle_(e,r,i,o,a,l),v&14||this.addTriangle_(e,r,n,o,a,s),v&&(v&13||this.addTriangle_(n,i,e,s,l,o),v&7||this.addTriangle_(n,i,r,s,l,a))}},t.prototype.calculateSourceExtent=function(){var e=Sc();return this.triangles_.forEach(function(n,r,i){var o=n.source;tk(e,o[0]),tk(e,o[1]),tk(e,o[2])}),e},t.prototype.getTriangles=function(){return this.triangles_},t}(),wq={imageSmoothingEnabled:!1,msImageSmoothingEnabled:!1},$yt={imageSmoothingEnabled:!0,msImageSmoothingEnabled:!0},SW,QMe=[];function Vhe(t,e,n,r,i){t.beginPath(),t.moveTo(0,0),t.lineTo(e,n),t.lineTo(r,i),t.closePath(),t.save(),t.clip(),t.fillRect(0,0,Math.max(e,r)+1,Math.max(n,i)),t.restore()}function CW(t,e){return Math.abs(t[e*4]-210)>2||Math.abs(t[e*4+3]-.75*255)>2}function Fyt(){if(SW===void 0){var t=document.createElement("canvas").getContext("2d");t.globalCompositeOperation="lighter",t.fillStyle="rgba(210, 0, 0, 0.75)",Vhe(t,4,5,4,0),Vhe(t,4,5,0,5);var e=t.getImageData(0,0,3,3).data;SW=CW(e,0)||CW(e,4)||CW(e,8)}return SW}function _q(t,e,n,r){var i=T4(n,e,t),o=XF(e,r,n),s=e.getMetersPerUnit();s!==void 0&&(o*=s);var a=t.getMetersPerUnit();a!==void 0&&(o/=a);var l=t.getExtent();if(!l||FM(l,i)){var c=XF(t,o,i)/o;isFinite(c)&&c>0&&(o/=c)}return o}function Nyt(t,e,n,r){var i=ty(n),o=_q(t,e,i,r);return(!isFinite(o)||o<=0)&&Wee(n,function(s){return o=_q(t,e,s,r),isFinite(o)&&o>0}),o}function zyt(t,e,n,r,i,o,s,a,l,c,u,f){var d=Cc(Math.round(n*t),Math.round(n*e),QMe);if(f||fi(d,wq),l.length===0)return d.canvas;d.scale(n,n);function h(b){return Math.round(b*n)/n}d.globalCompositeOperation="lighter";var p=Sc();l.forEach(function(b,w,_){RPe(p,b.extent)});var g=Kr(p),m=Ou(p),v=Cc(Math.round(n*g/r),Math.round(n*m/r));f||fi(v,wq);var y=n/r;l.forEach(function(b,w,_){var S=b.extent[0]-p[0],O=-(b.extent[3]-p[3]),k=Kr(b.extent),E=Ou(b.extent);b.image.width>0&&b.image.height>0&&v.drawImage(b.image,c,c,b.image.width-2*c,b.image.height-2*c,S*y,O*y,k*y,E*y)});var x=nb(s);return a.getTriangles().forEach(function(b,w,_){var S=b.source,O=b.target,k=S[0][0],E=S[0][1],M=S[1][0],A=S[1][1],P=S[2][0],T=S[2][1],R=h((O[0][0]-x[0])/o),I=h(-(O[0][1]-x[1])/o),B=h((O[1][0]-x[0])/o),$=h(-(O[1][1]-x[1])/o),z=h((O[2][0]-x[0])/o),L=h(-(O[2][1]-x[1])/o),j=k,N=E;k=0,E=0,M-=j,A-=N,P-=j,T-=N;var F=[[M,A,0,0,B-R],[P,T,0,0,z-R],[0,0,M,A,$-I],[0,0,P,T,L-I]],H=hht(F);if(H){if(d.save(),d.beginPath(),Fyt()||!f){d.moveTo(B,$);for(var q=4,Y=R-B,le=I-$,K=0;K=this.minZoom;){if(this.zoomFactor_===2?(s=Math.floor(s/2),a=Math.floor(a/2),o=Ub(s,s,a,a,r)):o=this.getTileRangeForExtentAndZ(l,c,r),n(c,o))return!0;--c}return!1},t.prototype.getExtent=function(){return this.extent_},t.prototype.getMaxZoom=function(){return this.maxZoom},t.prototype.getMinZoom=function(){return this.minZoom},t.prototype.getOrigin=function(e){return this.origin_?this.origin_:this.origins_[e]},t.prototype.getResolution=function(e){return this.resolutions_[e]},t.prototype.getResolutions=function(){return this.resolutions_},t.prototype.getTileCoordChildTileRange=function(e,n,r){if(e[0]this.maxZoom||n0?r:Math.max(s/a[0],o/a[1]),c=i+1,u=new Array(c),f=0;fi.highWaterMark&&(i.highWaterMark=n)},e.prototype.useTile=function(n,r,i,o){},e}(DMe),qyt=function(t){eRe(e,t);function e(n,r){var i=t.call(this,n)||this;return i.tile=r,i}return e}(Nh);function Xyt(t,e){var n=/\{z\}/g,r=/\{x\}/g,i=/\{y\}/g,o=/\{-y\}/g;return function(s,a,l){if(s)return t.replace(n,s[0].toString()).replace(r,s[1].toString()).replace(i,s[2].toString()).replace(o,function(){var c=s[0],u=e.getFullTileRange(c);bn(u,55);var f=u.getHeight()-s[2]-1;return f.toString()})}}function Yyt(t,e){for(var n=t.length,r=new Array(n),i=0;i=0},e.prototype.tileUrlFunction=function(n,r,i){var o=this.getTileGrid();if(o||(o=this.getTileGridForProjection(i)),!(o.getResolutions().length<=n[0])){r!=1&&(!this.hidpi_||this.serverType_===void 0)&&(r=1);var s=o.getResolution(n[0]),a=o.getTileCoordExtent(n,this.tmpExtent_),l=tc(o.getTileSize(n[0]),this.tmpSize),c=this.gutter_;c!==0&&(l=mhe(l,c,this.tmpSize),a=lA(a,s*c,a)),r!=1&&(l=vMe(l,r,this.tmpSize));var u={SERVICE:"WMS",VERSION:SI,REQUEST:"GetMap",FORMAT:"image/png",TRANSPARENT:!0};return fi(u,this.params_),this.getRequestUrl_(n,l,a,r,i,u)}},e}(tRe);function nRe(t){return C.jsx(D.Fragment,{children:t.children})}const CI={PRELOAD:"preload",USE_INTERIM_TILES_ON_ERROR:"useInterimTilesOnError"};var i0t=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),o0t=function(t){i0t(e,t);function e(n){var r=this,i=n||{},o=fi({},i);return delete o.preload,delete o.useInterimTilesOnError,r=t.call(this,o)||this,r.on,r.once,r.un,r.setPreload(i.preload!==void 0?i.preload:0),r.setUseInterimTilesOnError(i.useInterimTilesOnError!==void 0?i.useInterimTilesOnError:!0),r}return e.prototype.getPreload=function(){return this.get(CI.PRELOAD)},e.prototype.setPreload=function(n){this.set(CI.PRELOAD,n)},e.prototype.getUseInterimTilesOnError=function(){return this.get(CI.USE_INTERIM_TILES_ON_ERROR)},e.prototype.setUseInterimTilesOnError=function(n){this.set(CI.USE_INTERIM_TILES_ON_ERROR,n)},e.prototype.getData=function(n){return t.prototype.getData.call(this,n)},e}(D4),s0t=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),a0t=function(t){s0t(e,t);function e(n){var r=t.call(this,n)||this;return r.extentChanged=!0,r.renderedExtent_=null,r.renderedPixelRatio,r.renderedProjection=null,r.renderedRevision,r.renderedTiles=[],r.newTiles_=!1,r.tmpExtent=Sc(),r.tmpTileRange_=new Ete(0,0,0,0),r}return e.prototype.isDrawableTile=function(n){var r=this.getLayer(),i=n.getState(),o=r.getUseInterimTilesOnError();return i==Xt.LOADED||i==Xt.EMPTY||i==Xt.ERROR&&!o},e.prototype.getTile=function(n,r,i,o){var s=o.pixelRatio,a=o.viewState.projection,l=this.getLayer(),c=l.getSource(),u=c.getTile(n,r,i,s,a);return u.getState()==Xt.ERROR&&(l.getUseInterimTilesOnError()?l.getPreload()>0&&(this.newTiles_=!0):u.setState(Xt.LOADED)),this.isDrawableTile(u)||(u=u.getInterimTile()),u},e.prototype.getData=function(n){var r=this.frameState;if(!r)return null;var i=this.getLayer(),o=Ui(r.pixelToCoordinateTransform,n.slice()),s=i.getExtent();if(s&&!FM(s,o))return null;for(var a=r.pixelRatio,l=r.viewState.projection,c=r.viewState,u=i.getRenderSource(),f=u.getTileGridForProjection(c.projection),d=u.getTilePixelRatio(r.pixelRatio),h=f.getZForResolution(c.resolution);h>=f.getMinZoom();--h){var p=f.getTileCoordForCoordAndZ(o,h),g=u.getTile(h,p[1],p[2],a,l);if(!(g instanceof vte||g instanceof KMe))return null;if(g.getState()===Xt.LOADED){var m=f.getOrigin(h),v=tc(f.getTileSize(h)),y=f.getResolution(h),x=Math.floor(d*((o[0]-m[0])/y-p[1]*v[0])),b=Math.floor(d*((m[1]-o[1])/y-p[2]*v[1])),w=Math.round(d*u.getGutterForProjection(c.projection));return this.getImageData(g.getImage(),x+w,b+w)}}return null},e.prototype.loadedTileCallback=function(n,r,i){return this.isDrawableTile(i)?t.prototype.loadedTileCallback.call(this,n,r,i):!1},e.prototype.prepareFrame=function(n){return!!this.getLayer().getSource()},e.prototype.renderFrame=function(n,r){var i=n.layerStatesArray[n.layerIndex],o=n.viewState,s=o.projection,a=o.resolution,l=o.center,c=o.rotation,u=n.pixelRatio,f=this.getLayer(),d=f.getSource(),h=d.getRevision(),p=d.getTileGridForProjection(s),g=p.getZForResolution(a,d.zDirection),m=p.getResolution(g),v=n.extent,y=n.viewState.resolution,x=d.getTilePixelRatio(u),b=Math.round(Kr(v)/y*u),w=Math.round(Ou(v)/y*u),_=i.extent&&ux(i.extent);_&&(v=nk(v,ux(i.extent)));var S=m*b/2/x,O=m*w/2/x,k=[l[0]-S,l[1]-O,l[0]+S,l[1]+O],E=p.getTileRangeForExtentAndZ(v,g),M={};M[g]={};var A=this.createLoadedTileFinder(d,s,M),P=this.tmpExtent,T=this.tmpTileRange_;this.newTiles_=!1;for(var R=c?nq(o.center,y,c,n.size):void 0,I=E.minX;I<=E.maxX;++I)for(var B=E.minY;B<=E.maxY;++B)if(!(c&&!p.tileCoordIntersectsViewport([g,I,B],R))){var $=this.getTile(g,I,B,n);if(this.isDrawableTile($)){var z=or(this);if($.getState()==Xt.LOADED){M[g][$.tileCoord.toString()]=$;var L=$.inTransition(z);L&&i.opacity!==1&&($.endTransition(z),L=!1),!this.newTiles_&&(L||this.renderedTiles.indexOf($)===-1)&&(this.newTiles_=!0)}if($.getAlpha(z,n.time)===1)continue}var j=p.getTileCoordChildTileRange($.tileCoord,T,P),N=!1;j&&(N=A(g+1,j)),N||p.forEachTileCoordParentTileRange($.tileCoord,A,T,P)}var F=m/a*u/x;Dg(this.pixelTransform,n.size[0]/2,n.size[1]/2,1/u,1/u,c,-b/2,-w/2);var H=APe(this.pixelTransform);this.useContainer(r,H,this.getBackground(n));var q=this.context,Y=q.canvas;Bee(this.inversePixelTransform,this.pixelTransform),Dg(this.tempTransform,b/2,w/2,F,F,0,-b/2,-w/2),Y.width!=b||Y.height!=w?(Y.width=b,Y.height=w):this.containerReused||q.clearRect(0,0,b,w),_&&this.clipUnrotated(q,n,_),d.getInterpolate()||fi(q,wq),this.preRender(q,n),this.renderedTiles.length=0;var le=Object.keys(M).map(Number);le.sort(o1);var K,ee,re;i.opacity===1&&(!this.containerReused||d.getOpaque(n.viewState.projection))?le=le.reverse():(K=[],ee=[]);for(var me=le.length-1;me>=0;--me){var te=le[me],ae=d.getTilePixelSize(te,u,s),U=p.getResolution(te),oe=U/m,ne=ae[0]*oe*F,V=ae[1]*oe*F,X=p.getTileCoordForCoordAndZ(nb(k),te),Z=p.getTileCoordExtent(X),he=Ui(this.tempTransform,[x*(Z[0]-k[0])/m,x*(k[3]-Z[3])/m]),xe=x*d.getGutterForProjection(s),G=M[te];for(var W in G){var $=G[W],J=$.tileCoord,se=X[1]-J[1],ye=Math.round(he[0]-(se-1)*ne),ie=X[2]-J[2],fe=Math.round(he[1]-(ie-1)*V),I=Math.round(he[0]-se*ne),B=Math.round(he[1]-ie*V),Q=ye-I,_e=fe-B,we=g===te,L=we&&$.getAlpha(or(this),n.time)!==1,Ie=!1;if(!L)if(K){re=[I,B,I+Q,B,I+Q,B+_e,I,B+_e];for(var Pe=0,Me=K.length;Pe{const r=this.props.onClick;r&&r(n)});gn(this,"handleDrop",n=>{if(this.props.onDropFiles){n.preventDefault();const r=[];if(n.dataTransfer.items)for(let i=0;i{this.props.onDropFiles&&n.preventDefault()});gn(this,"handleRef",n=>{this.contextValue.mapDiv=n});gn(this,"handleResize",()=>{const n=this.contextValue.mapDiv,r=this.contextValue.map;if(n&&r){r.updateSize();const i=r.getView(),o=this.getMinZoom(n);o!==i.getMinZoom()&&i.setMinZoom(o)}});gn(this,"getMinZoom",n=>{const r=n.clientWidth,i=Math.LOG2E*Math.log(r/256);return i>=0?i:0});const{id:r,mapObjects:i}=n;i?this.contextValue={map:i[r]||void 0,mapObjects:i}:this.contextValue={mapObjects:{}}}componentDidMount(){const{id:n}=this.props,r=this.contextValue.mapDiv;let i=null;if(this.props.isStale){const s=this.contextValue.mapObjects[n];s instanceof Bhe&&(i=s,i.setTarget(r),this.clickEventsKey&&i.un("click",this.clickEventsKey.listener))}if(!i){const s=this.getMinZoom(r),a=new jd({projection:iRe,center:[0,0],minZoom:s,zoom:s});i=new Bhe({view:a,...this.getMapOptions(),target:r})}this.contextValue.map=i,this.contextValue.mapObjects[n]=i,this.clickEventsKey=i.on("click",this.handleClick),i.updateSize(),this.forceUpdate(),window.addEventListener("resize",this.handleResize);const o=this.props.onMapRef;o&&o(i)}componentDidUpdate(n){const r=this.contextValue.map,i=this.contextValue.mapDiv,o=this.getMapOptions();r.setProperties({...o}),r.setTarget(i),r.updateSize()}componentWillUnmount(){window.removeEventListener("resize",this.handleResize);const n=this.props.onMapRef;n&&n(null)}render(){let n;return this.contextValue.map&&(n=C.jsx(oRe.Provider,{value:this.contextValue,children:this.props.children})),C.jsx("div",{ref:this.handleRef,style:d0t,onDragOver:this.handleDragOver,onDrop:this.handleDrop,children:n})}getMapOptions(){const n={...this.props};return delete n.children,delete n.onClick,delete n.onDropFiles,n}};class aO extends D.PureComponent{constructor(){super(...arguments);gn(this,"context",{});gn(this,"object",null)}getMapObject(n){return this.context.mapObjects&&this.context.mapObjects[n]||null}getOptions(){const n={...this.props};return delete n.id,n}componentDidMount(){this._updateMapObject(this.addMapObject(this.context.map))}componentDidUpdate(n){this._updateMapObject(this.updateMapObject(this.context.map,this.object,n))}componentWillUnmount(){const n=this.context.map;this.removeMapObject(n,this.object),this.props.id&&delete this.context.mapObjects[this.props.id],this.object=null}_updateMapObject(n){n!=null&&this.props.id&&(n.set("objectId",this.props.id),this.context.mapObjects[this.props.id]=n),this.object=n}render(){return null}}gn(aO,"contextType",oRe);function sRe(t,e,n){Wb(t,e,n,"visible",!0),Wb(t,e,n,"opacity",1),Wb(t,e,n,"zIndex",void 0),Wb(t,e,n,"extent",void 0),Wb(t,e,n,"minResolution",void 0),Wb(t,e,n,"maxResolution",void 0)}function Wb(t,e,n,r,i){const o=Hhe(e[r],i),s=Hhe(n[r],i);o!==s&&t.set(r,s)}function Hhe(t,e){return t===void 0?e:t}let qa;qa=()=>{};class aRe extends aO{addMapObject(e){const n=new rRe(this.props);return n.set("id",this.props.id),e.getLayers().push(n),n}updateMapObject(e,n,r){const i=n.getSource(),o=this.props.source||null;if(i===o)return n;if(o!==null&&i!==o){let s=!0;if(i instanceof Sq&&o instanceof Sq){const c=i,u=o,f=c.getTileGrid(),d=u.getTileGrid();if(p0t(f,d)){qa("--> Equal tile grids!");const h=c.getUrls(),p=u.getUrls();h!==p&&p&&(h===null||h[0]!==p[0])&&(c.setUrls(p),s=!1);const g=c.getTileLoadFunction(),m=u.getTileLoadFunction();g!==m&&(c.setTileLoadFunction(m),s=!1);const v=c.getTileUrlFunction(),y=u.getTileUrlFunction();v!==y&&(c.setTileUrlFunction(y),s=!1)}else qa("--> Tile grids are not equal!")}const a=i==null?void 0:i.getInterpolate(),l=o==null?void 0:o.getInterpolate();a!==l&&(s=!0),s?(n.setSource(o),qa("--> Replaced source (expect flickering!)")):qa("--> Updated source (check, is it still flickering?)")}return sRe(n,r,this.props),n}removeMapObject(e,n){e.getLayers().remove(n)}}new oO({url:"https://a.tiles.mapbox.com/v3/mapbox.natural-earth-2/{z}/{x}/{y}.png",attributions:["© MapBox","© MapBox and contributors"]});new oO({url:"https://gis.ngdc.noaa.gov/arcgis/rest/services/web_mercator/gebco_2014_contours/MapServer/tile/{z}/{y}/{x}",attributions:["© GEBCO","© NOAHH and contributors"]});new f0t;new oO({url:"https://tiles.wmflabs.org/bw-mapnik/{z}/{x}/{y}.png",attributions:["© OpenStreetMap contributors"]});function p0t(t,e){if(t===e)return!0;if(t===null||e===null||(qa("tile grid:",t,e),qa("min zoom:",t.getMinZoom(),e.getMinZoom()),qa("max zoom:",t.getMaxZoom(),e.getMaxZoom()),t.getMinZoom()!==e.getMinZoom()||t.getMaxZoom()!==e.getMaxZoom()))return!1;const n=t.getExtent(),r=e.getExtent();qa("extent:",n,r);for(let a=0;a=t[i])return i;let o=Math.floor(n/2),s;for(let a=0;as)[r,o]=[o,Math.floor((o+i)/2)];else return o;if(r===o||o===i)return Math.abs(t[r]-e)<=Math.abs(t[i]-e)?r:i}return-1}function qn(t){if(t===null||t===!0||t===!1)return NaN;var e=Number(t);return isNaN(e)?e:e<0?Math.ceil(e):Math.floor(e)}function At(t,e){if(e.length1?"s":"")+" required, but only "+e.length+" present")}function Ft(t){At(1,arguments);var e=Object.prototype.toString.call(t);return t instanceof Date||Tg(t)==="object"&&e==="[object Date]"?new Date(t.getTime()):typeof t=="number"||e==="[object Number]"?new Date(t):((typeof t=="string"||e==="[object String]")&&typeof console<"u"&&(console.warn("Starting with v2.0.0-beta.1 date-fns doesn't accept strings as date arguments. Please use `parseISO` to parse strings. See: https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#string-arguments"),console.warn(new Error().stack)),new Date(NaN))}function cRe(t,e){At(2,arguments);var n=Ft(t),r=qn(e);return isNaN(r)?new Date(NaN):(r&&n.setDate(n.getDate()+r),n)}function uRe(t,e){At(2,arguments);var n=Ft(t),r=qn(e);if(isNaN(r))return new Date(NaN);if(!r)return n;var i=n.getDate(),o=new Date(n.getTime());o.setMonth(n.getMonth()+r+1,0);var s=o.getDate();return i>=s?o:(n.setFullYear(o.getFullYear(),o.getMonth(),i),n)}function z4(t,e){At(2,arguments);var n=Ft(t).getTime(),r=qn(e);return new Date(n+r)}var g0t=36e5;function m0t(t,e){At(2,arguments);var n=qn(e);return z4(t,n*g0t)}var v0t={};function jh(){return v0t}function xA(t,e){var n,r,i,o,s,a,l,c;At(1,arguments);var u=jh(),f=qn((n=(r=(i=(o=e==null?void 0:e.weekStartsOn)!==null&&o!==void 0?o:e==null||(s=e.locale)===null||s===void 0||(a=s.options)===null||a===void 0?void 0:a.weekStartsOn)!==null&&i!==void 0?i:u.weekStartsOn)!==null&&r!==void 0?r:(l=u.locale)===null||l===void 0||(c=l.options)===null||c===void 0?void 0:c.weekStartsOn)!==null&&n!==void 0?n:0);if(!(f>=0&&f<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var d=Ft(t),h=d.getDay(),p=(h=0&&f<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var d=Ft(t),h=d.getDay(),p=(h=i.getTime()?n+1:e.getTime()>=s.getTime()?n:n-1}function R0t(t){At(1,arguments);var e=pRe(t),n=new Date(0);n.setUTCFullYear(e,0,4),n.setUTCHours(0,0,0,0);var r=kS(n);return r}var D0t=6048e5;function gRe(t){At(1,arguments);var e=Ft(t),n=kS(e).getTime()-R0t(e).getTime();return Math.round(n/D0t)+1}function l1(t,e){var n,r,i,o,s,a,l,c;At(1,arguments);var u=jh(),f=qn((n=(r=(i=(o=e==null?void 0:e.weekStartsOn)!==null&&o!==void 0?o:e==null||(s=e.locale)===null||s===void 0||(a=s.options)===null||a===void 0?void 0:a.weekStartsOn)!==null&&i!==void 0?i:u.weekStartsOn)!==null&&r!==void 0?r:(l=u.locale)===null||l===void 0||(c=l.options)===null||c===void 0?void 0:c.weekStartsOn)!==null&&n!==void 0?n:0);if(!(f>=0&&f<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var d=Ft(t),h=d.getUTCDay(),p=(h=1&&h<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var p=new Date(0);p.setUTCFullYear(f+1,0,h),p.setUTCHours(0,0,0,0);var g=l1(p,e),m=new Date(0);m.setUTCFullYear(f,0,h),m.setUTCHours(0,0,0,0);var v=l1(m,e);return u.getTime()>=g.getTime()?f+1:u.getTime()>=v.getTime()?f:f-1}function I0t(t,e){var n,r,i,o,s,a,l,c;At(1,arguments);var u=jh(),f=qn((n=(r=(i=(o=e==null?void 0:e.firstWeekContainsDate)!==null&&o!==void 0?o:e==null||(s=e.locale)===null||s===void 0||(a=s.options)===null||a===void 0?void 0:a.firstWeekContainsDate)!==null&&i!==void 0?i:u.firstWeekContainsDate)!==null&&r!==void 0?r:(l=u.locale)===null||l===void 0||(c=l.options)===null||c===void 0?void 0:c.firstWeekContainsDate)!==null&&n!==void 0?n:1),d=Rte(t,e),h=new Date(0);h.setUTCFullYear(d,0,f),h.setUTCHours(0,0,0,0);var p=l1(h,e);return p}var L0t=6048e5;function mRe(t,e){At(1,arguments);var n=Ft(t),r=l1(n,e).getTime()-I0t(n,e).getTime();return Math.round(r/L0t)+1}function mr(t,e){for(var n=t<0?"-":"",r=Math.abs(t).toString();r.length0?r:1-r;return mr(n==="yy"?i%100:i,n.length)},M:function(e,n){var r=e.getUTCMonth();return n==="M"?String(r+1):mr(r+1,2)},d:function(e,n){return mr(e.getUTCDate(),n.length)},a:function(e,n){var r=e.getUTCHours()/12>=1?"pm":"am";switch(n){case"a":case"aa":return r.toUpperCase();case"aaa":return r;case"aaaaa":return r[0];case"aaaa":default:return r==="am"?"a.m.":"p.m."}},h:function(e,n){return mr(e.getUTCHours()%12||12,n.length)},H:function(e,n){return mr(e.getUTCHours(),n.length)},m:function(e,n){return mr(e.getUTCMinutes(),n.length)},s:function(e,n){return mr(e.getUTCSeconds(),n.length)},S:function(e,n){var r=n.length,i=e.getUTCMilliseconds(),o=Math.floor(i*Math.pow(10,r-3));return mr(o,n.length)}},Vb={am:"am",pm:"pm",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},$0t={G:function(e,n,r){var i=e.getUTCFullYear()>0?1:0;switch(n){case"G":case"GG":case"GGG":return r.era(i,{width:"abbreviated"});case"GGGGG":return r.era(i,{width:"narrow"});case"GGGG":default:return r.era(i,{width:"wide"})}},y:function(e,n,r){if(n==="yo"){var i=e.getUTCFullYear(),o=i>0?i:1-i;return r.ordinalNumber(o,{unit:"year"})}return gm.y(e,n)},Y:function(e,n,r,i){var o=Rte(e,i),s=o>0?o:1-o;if(n==="YY"){var a=s%100;return mr(a,2)}return n==="Yo"?r.ordinalNumber(s,{unit:"year"}):mr(s,n.length)},R:function(e,n){var r=pRe(e);return mr(r,n.length)},u:function(e,n){var r=e.getUTCFullYear();return mr(r,n.length)},Q:function(e,n,r){var i=Math.ceil((e.getUTCMonth()+1)/3);switch(n){case"Q":return String(i);case"QQ":return mr(i,2);case"Qo":return r.ordinalNumber(i,{unit:"quarter"});case"QQQ":return r.quarter(i,{width:"abbreviated",context:"formatting"});case"QQQQQ":return r.quarter(i,{width:"narrow",context:"formatting"});case"QQQQ":default:return r.quarter(i,{width:"wide",context:"formatting"})}},q:function(e,n,r){var i=Math.ceil((e.getUTCMonth()+1)/3);switch(n){case"q":return String(i);case"qq":return mr(i,2);case"qo":return r.ordinalNumber(i,{unit:"quarter"});case"qqq":return r.quarter(i,{width:"abbreviated",context:"standalone"});case"qqqqq":return r.quarter(i,{width:"narrow",context:"standalone"});case"qqqq":default:return r.quarter(i,{width:"wide",context:"standalone"})}},M:function(e,n,r){var i=e.getUTCMonth();switch(n){case"M":case"MM":return gm.M(e,n);case"Mo":return r.ordinalNumber(i+1,{unit:"month"});case"MMM":return r.month(i,{width:"abbreviated",context:"formatting"});case"MMMMM":return r.month(i,{width:"narrow",context:"formatting"});case"MMMM":default:return r.month(i,{width:"wide",context:"formatting"})}},L:function(e,n,r){var i=e.getUTCMonth();switch(n){case"L":return String(i+1);case"LL":return mr(i+1,2);case"Lo":return r.ordinalNumber(i+1,{unit:"month"});case"LLL":return r.month(i,{width:"abbreviated",context:"standalone"});case"LLLLL":return r.month(i,{width:"narrow",context:"standalone"});case"LLLL":default:return r.month(i,{width:"wide",context:"standalone"})}},w:function(e,n,r,i){var o=mRe(e,i);return n==="wo"?r.ordinalNumber(o,{unit:"week"}):mr(o,n.length)},I:function(e,n,r){var i=gRe(e);return n==="Io"?r.ordinalNumber(i,{unit:"week"}):mr(i,n.length)},d:function(e,n,r){return n==="do"?r.ordinalNumber(e.getUTCDate(),{unit:"date"}):gm.d(e,n)},D:function(e,n,r){var i=M0t(e);return n==="Do"?r.ordinalNumber(i,{unit:"dayOfYear"}):mr(i,n.length)},E:function(e,n,r){var i=e.getUTCDay();switch(n){case"E":case"EE":case"EEE":return r.day(i,{width:"abbreviated",context:"formatting"});case"EEEEE":return r.day(i,{width:"narrow",context:"formatting"});case"EEEEEE":return r.day(i,{width:"short",context:"formatting"});case"EEEE":default:return r.day(i,{width:"wide",context:"formatting"})}},e:function(e,n,r,i){var o=e.getUTCDay(),s=(o-i.weekStartsOn+8)%7||7;switch(n){case"e":return String(s);case"ee":return mr(s,2);case"eo":return r.ordinalNumber(s,{unit:"day"});case"eee":return r.day(o,{width:"abbreviated",context:"formatting"});case"eeeee":return r.day(o,{width:"narrow",context:"formatting"});case"eeeeee":return r.day(o,{width:"short",context:"formatting"});case"eeee":default:return r.day(o,{width:"wide",context:"formatting"})}},c:function(e,n,r,i){var o=e.getUTCDay(),s=(o-i.weekStartsOn+8)%7||7;switch(n){case"c":return String(s);case"cc":return mr(s,n.length);case"co":return r.ordinalNumber(s,{unit:"day"});case"ccc":return r.day(o,{width:"abbreviated",context:"standalone"});case"ccccc":return r.day(o,{width:"narrow",context:"standalone"});case"cccccc":return r.day(o,{width:"short",context:"standalone"});case"cccc":default:return r.day(o,{width:"wide",context:"standalone"})}},i:function(e,n,r){var i=e.getUTCDay(),o=i===0?7:i;switch(n){case"i":return String(o);case"ii":return mr(o,n.length);case"io":return r.ordinalNumber(o,{unit:"day"});case"iii":return r.day(i,{width:"abbreviated",context:"formatting"});case"iiiii":return r.day(i,{width:"narrow",context:"formatting"});case"iiiiii":return r.day(i,{width:"short",context:"formatting"});case"iiii":default:return r.day(i,{width:"wide",context:"formatting"})}},a:function(e,n,r){var i=e.getUTCHours(),o=i/12>=1?"pm":"am";switch(n){case"a":case"aa":return r.dayPeriod(o,{width:"abbreviated",context:"formatting"});case"aaa":return r.dayPeriod(o,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return r.dayPeriod(o,{width:"narrow",context:"formatting"});case"aaaa":default:return r.dayPeriod(o,{width:"wide",context:"formatting"})}},b:function(e,n,r){var i=e.getUTCHours(),o;switch(i===12?o=Vb.noon:i===0?o=Vb.midnight:o=i/12>=1?"pm":"am",n){case"b":case"bb":return r.dayPeriod(o,{width:"abbreviated",context:"formatting"});case"bbb":return r.dayPeriod(o,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return r.dayPeriod(o,{width:"narrow",context:"formatting"});case"bbbb":default:return r.dayPeriod(o,{width:"wide",context:"formatting"})}},B:function(e,n,r){var i=e.getUTCHours(),o;switch(i>=17?o=Vb.evening:i>=12?o=Vb.afternoon:i>=4?o=Vb.morning:o=Vb.night,n){case"B":case"BB":case"BBB":return r.dayPeriod(o,{width:"abbreviated",context:"formatting"});case"BBBBB":return r.dayPeriod(o,{width:"narrow",context:"formatting"});case"BBBB":default:return r.dayPeriod(o,{width:"wide",context:"formatting"})}},h:function(e,n,r){if(n==="ho"){var i=e.getUTCHours()%12;return i===0&&(i=12),r.ordinalNumber(i,{unit:"hour"})}return gm.h(e,n)},H:function(e,n,r){return n==="Ho"?r.ordinalNumber(e.getUTCHours(),{unit:"hour"}):gm.H(e,n)},K:function(e,n,r){var i=e.getUTCHours()%12;return n==="Ko"?r.ordinalNumber(i,{unit:"hour"}):mr(i,n.length)},k:function(e,n,r){var i=e.getUTCHours();return i===0&&(i=24),n==="ko"?r.ordinalNumber(i,{unit:"hour"}):mr(i,n.length)},m:function(e,n,r){return n==="mo"?r.ordinalNumber(e.getUTCMinutes(),{unit:"minute"}):gm.m(e,n)},s:function(e,n,r){return n==="so"?r.ordinalNumber(e.getUTCSeconds(),{unit:"second"}):gm.s(e,n)},S:function(e,n){return gm.S(e,n)},X:function(e,n,r,i){var o=i._originalDate||e,s=o.getTimezoneOffset();if(s===0)return"Z";switch(n){case"X":return Qhe(s);case"XXXX":case"XX":return z0(s);case"XXXXX":case"XXX":default:return z0(s,":")}},x:function(e,n,r,i){var o=i._originalDate||e,s=o.getTimezoneOffset();switch(n){case"x":return Qhe(s);case"xxxx":case"xx":return z0(s);case"xxxxx":case"xxx":default:return z0(s,":")}},O:function(e,n,r,i){var o=i._originalDate||e,s=o.getTimezoneOffset();switch(n){case"O":case"OO":case"OOO":return"GMT"+Yhe(s,":");case"OOOO":default:return"GMT"+z0(s,":")}},z:function(e,n,r,i){var o=i._originalDate||e,s=o.getTimezoneOffset();switch(n){case"z":case"zz":case"zzz":return"GMT"+Yhe(s,":");case"zzzz":default:return"GMT"+z0(s,":")}},t:function(e,n,r,i){var o=i._originalDate||e,s=Math.floor(o.getTime()/1e3);return mr(s,n.length)},T:function(e,n,r,i){var o=i._originalDate||e,s=o.getTime();return mr(s,n.length)}};function Yhe(t,e){var n=t>0?"-":"+",r=Math.abs(t),i=Math.floor(r/60),o=r%60;if(o===0)return n+String(i);var s=e;return n+String(i)+s+mr(o,2)}function Qhe(t,e){if(t%60===0){var n=t>0?"-":"+";return n+mr(Math.abs(t)/60,2)}return z0(t,e)}function z0(t,e){var n=e||"",r=t>0?"-":"+",i=Math.abs(t),o=mr(Math.floor(i/60),2),s=mr(i%60,2);return r+o+n+s}var Khe=function(e,n){switch(e){case"P":return n.date({width:"short"});case"PP":return n.date({width:"medium"});case"PPP":return n.date({width:"long"});case"PPPP":default:return n.date({width:"full"})}},vRe=function(e,n){switch(e){case"p":return n.time({width:"short"});case"pp":return n.time({width:"medium"});case"ppp":return n.time({width:"long"});case"pppp":default:return n.time({width:"full"})}},F0t=function(e,n){var r=e.match(/(P+)(p+)?/)||[],i=r[1],o=r[2];if(!o)return Khe(e,n);var s;switch(i){case"P":s=n.dateTime({width:"short"});break;case"PP":s=n.dateTime({width:"medium"});break;case"PPP":s=n.dateTime({width:"long"});break;case"PPPP":default:s=n.dateTime({width:"full"});break}return s.replace("{{date}}",Khe(i,n)).replace("{{time}}",vRe(o,n))},Oq={p:vRe,P:F0t},N0t=["D","DD"],z0t=["YY","YYYY"];function yRe(t){return N0t.indexOf(t)!==-1}function xRe(t){return z0t.indexOf(t)!==-1}function aN(t,e,n){if(t==="YYYY")throw new RangeError("Use `yyyy` instead of `YYYY` (in `".concat(e,"`) for formatting years to the input `").concat(n,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if(t==="YY")throw new RangeError("Use `yy` instead of `YY` (in `".concat(e,"`) for formatting years to the input `").concat(n,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if(t==="D")throw new RangeError("Use `d` instead of `D` (in `".concat(e,"`) for formatting days of the month to the input `").concat(n,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if(t==="DD")throw new RangeError("Use `dd` instead of `DD` (in `".concat(e,"`) for formatting days of the month to the input `").concat(n,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"))}var j0t={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},B0t=function(e,n,r){var i,o=j0t[e];return typeof o=="string"?i=o:n===1?i=o.one:i=o.other.replace("{{count}}",n.toString()),r!=null&&r.addSuffix?r.comparison&&r.comparison>0?"in "+i:i+" ago":i};function EW(t){return function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=e.width?String(e.width):t.defaultWidth,r=t.formats[n]||t.formats[t.defaultWidth];return r}}var U0t={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},W0t={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},V0t={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},G0t={date:EW({formats:U0t,defaultWidth:"full"}),time:EW({formats:W0t,defaultWidth:"full"}),dateTime:EW({formats:V0t,defaultWidth:"full"})},H0t={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},q0t=function(e,n,r,i){return H0t[e]};function zE(t){return function(e,n){var r=n!=null&&n.context?String(n.context):"standalone",i;if(r==="formatting"&&t.formattingValues){var o=t.defaultFormattingWidth||t.defaultWidth,s=n!=null&&n.width?String(n.width):o;i=t.formattingValues[s]||t.formattingValues[o]}else{var a=t.defaultWidth,l=n!=null&&n.width?String(n.width):t.defaultWidth;i=t.values[l]||t.values[a]}var c=t.argumentCallback?t.argumentCallback(e):e;return i[c]}}var X0t={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},Y0t={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},Q0t={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},K0t={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},Z0t={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},J0t={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},ext=function(e,n){var r=Number(e),i=r%100;if(i>20||i<10)switch(i%10){case 1:return r+"st";case 2:return r+"nd";case 3:return r+"rd"}return r+"th"},txt={ordinalNumber:ext,era:zE({values:X0t,defaultWidth:"wide"}),quarter:zE({values:Y0t,defaultWidth:"wide",argumentCallback:function(e){return e-1}}),month:zE({values:Q0t,defaultWidth:"wide"}),day:zE({values:K0t,defaultWidth:"wide"}),dayPeriod:zE({values:Z0t,defaultWidth:"wide",formattingValues:J0t,defaultFormattingWidth:"wide"})};function jE(t){return function(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=n.width,i=r&&t.matchPatterns[r]||t.matchPatterns[t.defaultMatchWidth],o=e.match(i);if(!o)return null;var s=o[0],a=r&&t.parsePatterns[r]||t.parsePatterns[t.defaultParseWidth],l=Array.isArray(a)?rxt(a,function(f){return f.test(s)}):nxt(a,function(f){return f.test(s)}),c;c=t.valueCallback?t.valueCallback(l):l,c=n.valueCallback?n.valueCallback(c):c;var u=e.slice(s.length);return{value:c,rest:u}}}function nxt(t,e){for(var n in t)if(t.hasOwnProperty(n)&&e(t[n]))return n}function rxt(t,e){for(var n=0;n1&&arguments[1]!==void 0?arguments[1]:{},r=e.match(t.matchPattern);if(!r)return null;var i=r[0],o=e.match(t.parsePattern);if(!o)return null;var s=t.valueCallback?t.valueCallback(o[0]):o[0];s=n.valueCallback?n.valueCallback(s):s;var a=e.slice(i.length);return{value:s,rest:a}}}var oxt=/^(\d+)(th|st|nd|rd)?/i,sxt=/\d+/i,axt={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},lxt={any:[/^b/i,/^(a|c)/i]},cxt={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},uxt={any:[/1/i,/2/i,/3/i,/4/i]},fxt={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},dxt={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},hxt={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},pxt={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},gxt={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},mxt={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},vxt={ordinalNumber:ixt({matchPattern:oxt,parsePattern:sxt,valueCallback:function(e){return parseInt(e,10)}}),era:jE({matchPatterns:axt,defaultMatchWidth:"wide",parsePatterns:lxt,defaultParseWidth:"any"}),quarter:jE({matchPatterns:cxt,defaultMatchWidth:"wide",parsePatterns:uxt,defaultParseWidth:"any",valueCallback:function(e){return e+1}}),month:jE({matchPatterns:fxt,defaultMatchWidth:"wide",parsePatterns:dxt,defaultParseWidth:"any"}),day:jE({matchPatterns:hxt,defaultMatchWidth:"wide",parsePatterns:pxt,defaultParseWidth:"any"}),dayPeriod:jE({matchPatterns:gxt,defaultMatchWidth:"any",parsePatterns:mxt,defaultParseWidth:"any"})},Dte={code:"en-US",formatDistance:B0t,formatLong:G0t,formatRelative:q0t,localize:txt,match:vxt,options:{weekStartsOn:0,firstWeekContainsDate:1}},yxt=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,xxt=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,bxt=/^'([^]*?)'?$/,wxt=/''/g,_xt=/[a-zA-Z]/;function Sxt(t,e,n){var r,i,o,s,a,l,c,u,f,d,h,p,g,m,v,y,x,b;At(2,arguments);var w=String(e),_=jh(),S=(r=(i=n==null?void 0:n.locale)!==null&&i!==void 0?i:_.locale)!==null&&r!==void 0?r:Dte,O=qn((o=(s=(a=(l=n==null?void 0:n.firstWeekContainsDate)!==null&&l!==void 0?l:n==null||(c=n.locale)===null||c===void 0||(u=c.options)===null||u===void 0?void 0:u.firstWeekContainsDate)!==null&&a!==void 0?a:_.firstWeekContainsDate)!==null&&s!==void 0?s:(f=_.locale)===null||f===void 0||(d=f.options)===null||d===void 0?void 0:d.firstWeekContainsDate)!==null&&o!==void 0?o:1);if(!(O>=1&&O<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var k=qn((h=(p=(g=(m=n==null?void 0:n.weekStartsOn)!==null&&m!==void 0?m:n==null||(v=n.locale)===null||v===void 0||(y=v.options)===null||y===void 0?void 0:y.weekStartsOn)!==null&&g!==void 0?g:_.weekStartsOn)!==null&&p!==void 0?p:(x=_.locale)===null||x===void 0||(b=x.options)===null||b===void 0?void 0:b.weekStartsOn)!==null&&h!==void 0?h:0);if(!(k>=0&&k<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");if(!S.localize)throw new RangeError("locale must contain localize property");if(!S.formatLong)throw new RangeError("locale must contain formatLong property");var E=Ft(t);if(!dRe(E))throw new RangeError("Invalid time value");var M=fRe(E),A=hRe(E,M),P={firstWeekContainsDate:O,weekStartsOn:k,locale:S,_originalDate:E},T=w.match(xxt).map(function(R){var I=R[0];if(I==="p"||I==="P"){var B=Oq[I];return B(R,S.formatLong)}return R}).join("").match(yxt).map(function(R){if(R==="''")return"'";var I=R[0];if(I==="'")return Cxt(R);var B=$0t[I];if(B)return!(n!=null&&n.useAdditionalWeekYearTokens)&&xRe(R)&&aN(R,e,String(t)),!(n!=null&&n.useAdditionalDayOfYearTokens)&&yRe(R)&&aN(R,e,String(t)),B(A,R,S.localize,P);if(I.match(_xt))throw new RangeError("Format string contains an unescaped latin alphabet character `"+I+"`");return R}).join("");return T}function Cxt(t){var e=t.match(bxt);return e?e[1].replace(wxt,"'"):t}function Oxt(t,e){if(t==null)throw new TypeError("assign requires that input parameter not be null or undefined");for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t}function Ext(t){At(1,arguments);var e=Ft(t),n=e.getDate();return n}function bRe(t){At(1,arguments);var e=Ft(t),n=e.getFullYear(),r=e.getMonth(),i=new Date(0);return i.setFullYear(n,r+1,0),i.setHours(0,0,0,0),i.getDate()}function Txt(t){At(1,arguments);var e=Ft(t),n=e.getHours();return n}function kxt(t){At(1,arguments);var e=Ft(t),n=e.getMilliseconds();return n}function Axt(t){At(1,arguments);var e=Ft(t),n=e.getMinutes();return n}function Pxt(t){At(1,arguments);var e=Ft(t),n=e.getMonth();return n}function Mxt(t){At(1,arguments);var e=Ft(t),n=e.getSeconds();return n}function Rxt(t,e){var n,r,i,o,s,a,l,c;At(1,arguments);var u=Ft(t),f=u.getFullYear(),d=jh(),h=qn((n=(r=(i=(o=e==null?void 0:e.firstWeekContainsDate)!==null&&o!==void 0?o:e==null||(s=e.locale)===null||s===void 0||(a=s.options)===null||a===void 0?void 0:a.firstWeekContainsDate)!==null&&i!==void 0?i:d.firstWeekContainsDate)!==null&&r!==void 0?r:(l=d.locale)===null||l===void 0||(c=l.options)===null||c===void 0?void 0:c.firstWeekContainsDate)!==null&&n!==void 0?n:1);if(!(h>=1&&h<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var p=new Date(0);p.setFullYear(f+1,0,h),p.setHours(0,0,0,0);var g=xA(p,e),m=new Date(0);m.setFullYear(f,0,h),m.setHours(0,0,0,0);var v=xA(m,e);return u.getTime()>=g.getTime()?f+1:u.getTime()>=v.getTime()?f:f-1}function Dxt(t,e){var n,r,i,o,s,a,l,c;At(1,arguments);var u=jh(),f=qn((n=(r=(i=(o=e==null?void 0:e.firstWeekContainsDate)!==null&&o!==void 0?o:e==null||(s=e.locale)===null||s===void 0||(a=s.options)===null||a===void 0?void 0:a.firstWeekContainsDate)!==null&&i!==void 0?i:u.firstWeekContainsDate)!==null&&r!==void 0?r:(l=u.locale)===null||l===void 0||(c=l.options)===null||c===void 0?void 0:c.firstWeekContainsDate)!==null&&n!==void 0?n:1),d=Rxt(t,e),h=new Date(0);h.setFullYear(d,0,f),h.setHours(0,0,0,0);var p=xA(h,e);return p}var Ixt=6048e5;function Lxt(t,e){At(1,arguments);var n=Ft(t),r=xA(n,e).getTime()-Dxt(n,e).getTime();return Math.round(r/Ixt)+1}function $xt(t){return At(1,arguments),Ft(t).getFullYear()}function TW(t,e){At(2,arguments);var n=Ft(t),r=Ft(e);return n.getTime()>r.getTime()}function kW(t,e){At(2,arguments);var n=Ft(t),r=Ft(e);return n.getTime()t.length)&&(e=t.length);for(var n=0,r=Array(e);n=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(c){throw c},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var o,s=!0,a=!1;return{s:function(){n=n.call(t)},n:function(){var c=n.next();return s=c.done,c},e:function(c){a=!0,o=c},f:function(){try{s||n.return==null||n.return()}finally{if(a)throw o}}}}function Xn(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&MF(t,e)}function lN(t){return lN=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},lN(t)}function _Re(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(_Re=function(){return!!t})()}function Nxt(t,e){if(e&&(Tg(e)=="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return bt(t)}function Yn(t){var e=_Re();return function(){var n,r=lN(t);if(e){var i=lN(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return Nxt(this,n)}}function Fn(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function zxt(t,e){for(var n=0;n0,r=n?e:1-e,i;if(r<=50)i=t||100;else{var o=r+50,s=Math.floor(o/100)*100,a=t>=o%100;i=t+s-(a?100:0)}return n?i:1-i}function ERe(t){return t%400===0||t%4===0&&t%100!==0}var Vxt=function(t){Xn(n,t);var e=Yn(n);function n(){var r;Fn(this,n);for(var i=arguments.length,o=new Array(i),s=0;s0}},{key:"set",value:function(i,o,s){var a=i.getUTCFullYear();if(s.isTwoDigitYear){var l=ORe(s.year,a);return i.setUTCFullYear(l,0,1),i.setUTCHours(0,0,0,0),i}var c=!("era"in o)||o.era===1?s.year:1-s.year;return i.setUTCFullYear(c,0,1),i.setUTCHours(0,0,0,0),i}}]),n}(ur),Gxt=function(t){Xn(n,t);var e=Yn(n);function n(){var r;Fn(this,n);for(var i=arguments.length,o=new Array(i),s=0;s0}},{key:"set",value:function(i,o,s,a){var l=Rte(i,a);if(s.isTwoDigitYear){var c=ORe(s.year,l);return i.setUTCFullYear(c,0,a.firstWeekContainsDate),i.setUTCHours(0,0,0,0),l1(i,a)}var u=!("era"in o)||o.era===1?s.year:1-s.year;return i.setUTCFullYear(u,0,a.firstWeekContainsDate),i.setUTCHours(0,0,0,0),l1(i,a)}}]),n}(ur),Hxt=function(t){Xn(n,t);var e=Yn(n);function n(){var r;Fn(this,n);for(var i=arguments.length,o=new Array(i),s=0;s=1&&o<=4}},{key:"set",value:function(i,o,s){return i.setUTCMonth((s-1)*3,1),i.setUTCHours(0,0,0,0),i}}]),n}(ur),Yxt=function(t){Xn(n,t);var e=Yn(n);function n(){var r;Fn(this,n);for(var i=arguments.length,o=new Array(i),s=0;s=1&&o<=4}},{key:"set",value:function(i,o,s){return i.setUTCMonth((s-1)*3,1),i.setUTCHours(0,0,0,0),i}}]),n}(ur),Qxt=function(t){Xn(n,t);var e=Yn(n);function n(){var r;Fn(this,n);for(var i=arguments.length,o=new Array(i),s=0;s=0&&o<=11}},{key:"set",value:function(i,o,s){return i.setUTCMonth(s,1),i.setUTCHours(0,0,0,0),i}}]),n}(ur),Kxt=function(t){Xn(n,t);var e=Yn(n);function n(){var r;Fn(this,n);for(var i=arguments.length,o=new Array(i),s=0;s=0&&o<=11}},{key:"set",value:function(i,o,s){return i.setUTCMonth(s,1),i.setUTCHours(0,0,0,0),i}}]),n}(ur);function Zxt(t,e,n){At(2,arguments);var r=Ft(t),i=qn(e),o=mRe(r,n)-i;return r.setUTCDate(r.getUTCDate()-o*7),r}var Jxt=function(t){Xn(n,t);var e=Yn(n);function n(){var r;Fn(this,n);for(var i=arguments.length,o=new Array(i),s=0;s=1&&o<=53}},{key:"set",value:function(i,o,s,a){return l1(Zxt(i,s,a),a)}}]),n}(ur);function e1t(t,e){At(2,arguments);var n=Ft(t),r=qn(e),i=gRe(n)-r;return n.setUTCDate(n.getUTCDate()-i*7),n}var t1t=function(t){Xn(n,t);var e=Yn(n);function n(){var r;Fn(this,n);for(var i=arguments.length,o=new Array(i),s=0;s=1&&o<=53}},{key:"set",value:function(i,o,s){return kS(e1t(i,s))}}]),n}(ur),n1t=[31,28,31,30,31,30,31,31,30,31,30,31],r1t=[31,29,31,30,31,30,31,31,30,31,30,31],i1t=function(t){Xn(n,t);var e=Yn(n);function n(){var r;Fn(this,n);for(var i=arguments.length,o=new Array(i),s=0;s=1&&o<=r1t[l]:o>=1&&o<=n1t[l]}},{key:"set",value:function(i,o,s){return i.setUTCDate(s),i.setUTCHours(0,0,0,0),i}}]),n}(ur),o1t=function(t){Xn(n,t);var e=Yn(n);function n(){var r;Fn(this,n);for(var i=arguments.length,o=new Array(i),s=0;s=1&&o<=366:o>=1&&o<=365}},{key:"set",value:function(i,o,s){return i.setUTCMonth(0,s),i.setUTCHours(0,0,0,0),i}}]),n}(ur);function Lte(t,e,n){var r,i,o,s,a,l,c,u;At(2,arguments);var f=jh(),d=qn((r=(i=(o=(s=n==null?void 0:n.weekStartsOn)!==null&&s!==void 0?s:n==null||(a=n.locale)===null||a===void 0||(l=a.options)===null||l===void 0?void 0:l.weekStartsOn)!==null&&o!==void 0?o:f.weekStartsOn)!==null&&i!==void 0?i:(c=f.locale)===null||c===void 0||(u=c.options)===null||u===void 0?void 0:u.weekStartsOn)!==null&&r!==void 0?r:0);if(!(d>=0&&d<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var h=Ft(t),p=qn(e),g=h.getUTCDay(),m=p%7,v=(m+7)%7,y=(v=0&&o<=6}},{key:"set",value:function(i,o,s,a){return i=Lte(i,s,a),i.setUTCHours(0,0,0,0),i}}]),n}(ur),a1t=function(t){Xn(n,t);var e=Yn(n);function n(){var r;Fn(this,n);for(var i=arguments.length,o=new Array(i),s=0;s=0&&o<=6}},{key:"set",value:function(i,o,s,a){return i=Lte(i,s,a),i.setUTCHours(0,0,0,0),i}}]),n}(ur),l1t=function(t){Xn(n,t);var e=Yn(n);function n(){var r;Fn(this,n);for(var i=arguments.length,o=new Array(i),s=0;s=0&&o<=6}},{key:"set",value:function(i,o,s,a){return i=Lte(i,s,a),i.setUTCHours(0,0,0,0),i}}]),n}(ur);function c1t(t,e){At(2,arguments);var n=qn(e);n%7===0&&(n=n-7);var r=1,i=Ft(t),o=i.getUTCDay(),s=n%7,a=(s+7)%7,l=(a=1&&o<=7}},{key:"set",value:function(i,o,s){return i=c1t(i,s),i.setUTCHours(0,0,0,0),i}}]),n}(ur),f1t=function(t){Xn(n,t);var e=Yn(n);function n(){var r;Fn(this,n);for(var i=arguments.length,o=new Array(i),s=0;s=1&&o<=12}},{key:"set",value:function(i,o,s){var a=i.getUTCHours()>=12;return a&&s<12?i.setUTCHours(s+12,0,0,0):!a&&s===12?i.setUTCHours(0,0,0,0):i.setUTCHours(s,0,0,0),i}}]),n}(ur),g1t=function(t){Xn(n,t);var e=Yn(n);function n(){var r;Fn(this,n);for(var i=arguments.length,o=new Array(i),s=0;s=0&&o<=23}},{key:"set",value:function(i,o,s){return i.setUTCHours(s,0,0,0),i}}]),n}(ur),m1t=function(t){Xn(n,t);var e=Yn(n);function n(){var r;Fn(this,n);for(var i=arguments.length,o=new Array(i),s=0;s=0&&o<=11}},{key:"set",value:function(i,o,s){var a=i.getUTCHours()>=12;return a&&s<12?i.setUTCHours(s+12,0,0,0):i.setUTCHours(s,0,0,0),i}}]),n}(ur),v1t=function(t){Xn(n,t);var e=Yn(n);function n(){var r;Fn(this,n);for(var i=arguments.length,o=new Array(i),s=0;s=1&&o<=24}},{key:"set",value:function(i,o,s){var a=s<=24?s%24:s;return i.setUTCHours(a,0,0,0),i}}]),n}(ur),y1t=function(t){Xn(n,t);var e=Yn(n);function n(){var r;Fn(this,n);for(var i=arguments.length,o=new Array(i),s=0;s=0&&o<=59}},{key:"set",value:function(i,o,s){return i.setUTCMinutes(s,0,0),i}}]),n}(ur),x1t=function(t){Xn(n,t);var e=Yn(n);function n(){var r;Fn(this,n);for(var i=arguments.length,o=new Array(i),s=0;s=0&&o<=59}},{key:"set",value:function(i,o,s){return i.setUTCSeconds(s,0),i}}]),n}(ur),b1t=function(t){Xn(n,t);var e=Yn(n);function n(){var r;Fn(this,n);for(var i=arguments.length,o=new Array(i),s=0;s=1&&E<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var M=qn((p=(g=(m=(v=r==null?void 0:r.weekStartsOn)!==null&&v!==void 0?v:r==null||(y=r.locale)===null||y===void 0||(x=y.options)===null||x===void 0?void 0:x.weekStartsOn)!==null&&m!==void 0?m:O.weekStartsOn)!==null&&g!==void 0?g:(b=O.locale)===null||b===void 0||(w=b.options)===null||w===void 0?void 0:w.weekStartsOn)!==null&&p!==void 0?p:0);if(!(M>=0&&M<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");if(S==="")return _===""?Ft(n):new Date(NaN);var A={firstWeekContainsDate:E,weekStartsOn:M,locale:k},P=[new Uxt],T=S.match(T1t).map(function(K){var ee=K[0];if(ee in Oq){var re=Oq[ee];return re(K,k.formatLong)}return K}).join("").match(E1t),R=[],I=Zhe(T),B;try{var $=function(){var ee=B.value;!(r!=null&&r.useAdditionalWeekYearTokens)&&xRe(ee)&&aN(ee,S,t),!(r!=null&&r.useAdditionalDayOfYearTokens)&&yRe(ee)&&aN(ee,S,t);var re=ee[0],me=O1t[re];if(me){var te=me.incompatibleTokens;if(Array.isArray(te)){var ae=R.find(function(oe){return te.includes(oe.token)||oe.token===re});if(ae)throw new RangeError("The format string mustn't contain `".concat(ae.fullToken,"` and `").concat(ee,"` at the same time"))}else if(me.incompatibleTokens==="*"&&R.length>0)throw new RangeError("The format string mustn't contain `".concat(ee,"` and any other token at the same time"));R.push({token:re,fullToken:ee});var U=me.run(_,ee,k.match,A);if(!U)return{v:new Date(NaN)};P.push(U.setter),_=U.rest}else{if(re.match(M1t))throw new RangeError("Format string contains an unescaped latin alphabet character `"+re+"`");if(ee==="''"?ee="'":re==="'"&&(ee=D1t(ee)),_.indexOf(ee)===0)_=_.slice(ee.length);else return{v:new Date(NaN)}}};for(I.s();!(B=I.n()).done;){var z=$();if(Tg(z)==="object")return z.v}}catch(K){I.e(K)}finally{I.f()}if(_.length>0&&P1t.test(_))return new Date(NaN);var L=P.map(function(K){return K.priority}).sort(function(K,ee){return ee-K}).filter(function(K,ee,re){return re.indexOf(K)===ee}).map(function(K){return P.filter(function(ee){return ee.priority===K}).sort(function(ee,re){return re.subPriority-ee.subPriority})}).map(function(K){return K[0]}),j=Ft(n);if(isNaN(j.getTime()))return new Date(NaN);var N=hRe(j,fRe(j)),F={},H=Zhe(L),q;try{for(H.s();!(q=H.n()).done;){var Y=q.value;if(!Y.validate(N,A))return new Date(NaN);var le=Y.set(N,F,A);Array.isArray(le)?(N=le[0],Oxt(F,le[1])):N=le}}catch(K){H.e(K)}finally{H.f()}return N}function D1t(t){return t.match(k1t)[1].replace(A1t,"'")}function Jhe(t){At(1,arguments);var e=Ft(t);return e.setMinutes(0,0,0),e}function I1t(t,e){At(2,arguments);var n=Jhe(t),r=Jhe(e);return n.getTime()===r.getTime()}function L1t(t,e){At(2,arguments);var n=Ft(t),r=Ft(e);return n.getFullYear()===r.getFullYear()&&n.getMonth()===r.getMonth()}function $1t(t,e){At(2,arguments);var n=Ft(t),r=Ft(e);return n.getFullYear()===r.getFullYear()}function F1t(t,e){At(2,arguments);var n=Ft(t).getTime(),r=Ft(e.start).getTime(),i=Ft(e.end).getTime();if(!(r<=i))throw new RangeError("Invalid interval");return n>=r&&n<=i}function N1t(t,e){var n;At(1,arguments);var r=qn((n=void 0)!==null&&n!==void 0?n:2);if(r!==2&&r!==1&&r!==0)throw new RangeError("additionalDigits must be 0, 1 or 2");if(!(typeof t=="string"||Object.prototype.toString.call(t)==="[object String]"))return new Date(NaN);var i=U1t(t),o;if(i.date){var s=W1t(i.date,r);o=V1t(s.restDateString,s.year)}if(!o||isNaN(o.getTime()))return new Date(NaN);var a=o.getTime(),l=0,c;if(i.time&&(l=G1t(i.time),isNaN(l)))return new Date(NaN);if(i.timezone){if(c=H1t(i.timezone),isNaN(c))return new Date(NaN)}else{var u=new Date(a+l),f=new Date(0);return f.setFullYear(u.getUTCFullYear(),u.getUTCMonth(),u.getUTCDate()),f.setHours(u.getUTCHours(),u.getUTCMinutes(),u.getUTCSeconds(),u.getUTCMilliseconds()),f}return new Date(a+l+c)}var OI={dateTimeDelimiter:/[T ]/,timeZoneDelimiter:/[Z ]/i,timezone:/([Z+-].*)$/},z1t=/^-?(?:(\d{3})|(\d{2})(?:-?(\d{2}))?|W(\d{2})(?:-?(\d{1}))?|)$/,j1t=/^(\d{2}(?:[.,]\d*)?)(?::?(\d{2}(?:[.,]\d*)?))?(?::?(\d{2}(?:[.,]\d*)?))?$/,B1t=/^([+-])(\d{2})(?::?(\d{2}))?$/;function U1t(t){var e={},n=t.split(OI.dateTimeDelimiter),r;if(n.length>2)return e;if(/:/.test(n[0])?r=n[0]:(e.date=n[0],r=n[1],OI.timeZoneDelimiter.test(e.date)&&(e.date=t.split(OI.timeZoneDelimiter)[0],r=t.substr(e.date.length,t.length))),r){var i=OI.timezone.exec(r);i?(e.time=r.replace(i[1],""),e.timezone=i[1]):e.time=r}return e}function W1t(t,e){var n=new RegExp("^(?:(\\d{4}|[+-]\\d{"+(4+e)+"})|(\\d{2}|[+-]\\d{"+(2+e)+"})$)"),r=t.match(n);if(!r)return{year:NaN,restDateString:""};var i=r[1]?parseInt(r[1]):null,o=r[2]?parseInt(r[2]):null;return{year:o===null?i:o*100,restDateString:t.slice((r[1]||r[2]).length)}}function V1t(t,e){if(e===null)return new Date(NaN);var n=t.match(z1t);if(!n)return new Date(NaN);var r=!!n[4],i=BE(n[1]),o=BE(n[2])-1,s=BE(n[3]),a=BE(n[4]),l=BE(n[5])-1;if(r)return K1t(e,a,l)?q1t(e,a,l):new Date(NaN);var c=new Date(0);return!Y1t(e,o,s)||!Q1t(e,i)?new Date(NaN):(c.setUTCFullYear(e,o,Math.max(i,s)),c)}function BE(t){return t?parseInt(t):1}function G1t(t){var e=t.match(j1t);if(!e)return NaN;var n=AW(e[1]),r=AW(e[2]),i=AW(e[3]);return Z1t(n,r,i)?n*Mte+r*Pte+i*1e3:NaN}function AW(t){return t&&parseFloat(t.replace(",","."))||0}function H1t(t){if(t==="Z")return 0;var e=t.match(B1t);if(!e)return 0;var n=e[1]==="+"?-1:1,r=parseInt(e[2]),i=e[3]&&parseInt(e[3])||0;return J1t(r,i)?n*(r*Mte+i*Pte):NaN}function q1t(t,e,n){var r=new Date(0);r.setUTCFullYear(t,0,4);var i=r.getUTCDay()||7,o=(e-1)*7+n+1-i;return r.setUTCDate(r.getUTCDate()+o),r}var X1t=[31,null,31,30,31,30,31,31,30,31,30,31];function TRe(t){return t%400===0||t%4===0&&t%100!==0}function Y1t(t,e,n){return e>=0&&e<=11&&n>=1&&n<=(X1t[e]||(TRe(t)?29:28))}function Q1t(t,e){return e>=1&&e<=(TRe(t)?366:365)}function K1t(t,e,n){return e>=1&&e<=53&&n>=0&&n<=6}function Z1t(t,e,n){return t===24?e===0&&n===0:n>=0&&n<60&&e>=0&&e<60&&t>=0&&t<25}function J1t(t,e){return e>=0&&e<=59}function ebt(t,e){At(2,arguments);var n=Ft(t),r=qn(e),i=n.getFullYear(),o=n.getDate(),s=new Date(0);s.setFullYear(i,r,15),s.setHours(0,0,0,0);var a=bRe(s);return n.setMonth(r,Math.min(o,a)),n}function tbt(t,e){At(2,arguments);var n=Ft(t),r=qn(e);return n.setDate(r),n}function nbt(t,e){At(2,arguments);var n=Ft(t),r=qn(e);return n.setHours(r),n}function rbt(t,e){At(2,arguments);var n=Ft(t),r=qn(e);return n.setMilliseconds(r),n}function ibt(t,e){At(2,arguments);var n=Ft(t),r=qn(e);return n.setMinutes(r),n}function obt(t,e){At(2,arguments);var n=Ft(t),r=qn(e);return n.setSeconds(r),n}function sbt(t,e){At(2,arguments);var n=Ft(t),r=qn(e);return isNaN(n.getTime())?new Date(NaN):(n.setFullYear(r),n)}function kRe(t){return t.getTimezoneOffset()*6e4}function abt(t){return t.getTime()-kRe(t)}function PW(t){const e=new Date(t);return new Date(e.getTime()+kRe(e))}function bA(t){return new Date(t).toISOString().substring(0,10)}function lO(t){return ARe(new Date(t).toISOString())}function ARe(t){return t.substring(0,19).replace("T"," ")}const PRe={seconds:1e3,minutes:1e3*60,hours:1e3*60*60,days:1e3*60*60*24,weeks:1e3*60*60*24*7,years:1e3*60*60*24*365};function lbt(t,e){return t===e?!0:t!==null&&e!=null?t[0]===e[0]&&t[1]===e[1]:!1}function cbt(t,e){const n=new Set,r=new Set,i={};for(const l of t)for(const c of l.timeSeriesArray){const{placeId:u,datasetId:f,variableName:d,valueDataKey:h,errorDataKey:p}=c.source;u!==null&&r.add(u);const g=`${f}.${d}.${h}`;n.add(g);let m=null;p&&(m=`${f}.${d}.${p}`,n.add(m)),c.data.forEach(v=>{const y=lO(v.time),x=`${u!==null?u:f}-${y}`,b=i[x];b?i[x]={...b,[g]:v[h]}:i[x]={placeId:u,time:y,[g]:v[h]},m!==null&&(i[x][m]=v[p])})}const o=["placeId","time"].concat(Array.from(n).sort()),s=[];Object.keys(i).forEach(l=>{const c=i[l],u=new Array(o.length);o.forEach((f,d)=>{u[d]=c[f]}),s.push(u)}),s.sort((l,c)=>{const u=l[1],f=c[1],d=u.localeCompare(f);if(d!==0)return d;const h=l[0],p=c[0];return h.localeCompare(p)});const a={};return r.forEach(l=>{a[l]=dte(e,l)}),{colNames:o,dataRows:s,referencedPlaces:a}}function ubt(t){let e=null;const n=t.features||[];for(const r of n){if(!r.properties)continue;const i=r.properties.time;if(typeof i!="string")continue;const s=N1t(i).getTime();if(!Number.isNaN(s))for(const a of Object.getOwnPropertyNames(r.properties)){let l=r.properties[a];const c=typeof l;if(c==="boolean"?l=l?1:0:c!=="number"&&(l=Number.NaN),Number.isNaN(l))continue;const u={time:s,countTot:1,mean:l};e===null&&(e={});const f=e[a];f?f.data.push(u):e[a]={source:{datasetId:t.id,datasetTitle:t.title,variableName:a,placeId:null,geometry:null,valueDataKey:"mean",errorDataKey:null},data:[u],dataProgress:1}}}return e===null?null:{placeGroup:t,timeSeries:e}}const XM=t=>t.dataState.datasets||[],fbt=t=>t.dataState.colorBars,MRe=t=>t.dataState.timeSeriesGroups,YM=t=>t.dataState.userPlaceGroups,RRe=t=>t.dataState.userServers||[],dbt=t=>t.dataState.expressionCapabilities,hbt=t=>t.dataState.statistics.loading,pbt=t=>t.dataState.statistics.records,DRe=xt(XM,YM,(t,e)=>{const n={},r=[];return t.forEach(i=>{i.placeGroups&&i.placeGroups.forEach(o=>{n[o.id]||(n[o.id]=o,r.push(o))})}),[...r,...e]}),gbt=xt(DRe,t=>{const e=[];return t.forEach(n=>{const r=ubt(n);r!==null&&e.push(r)}),e}),mbt=[{name:"OpenStreetMap",link:"https://openstreetmap.org",datasets:[{name:"OSM Mapnik",endpoint:"https://a.tile.osm.org/{z}/{x}/{y}.png"},{name:"OSM Humanitarian",endpoint:"https://a.tile.openstreetmap.fr/hot/{z}/{x}/{y}.png"},{name:"OSM Landscape",endpoint:"https://a.tile3.opencyclemap.org/landscape/{z}/{x}/{y}.png"}],overlays:[]},{name:"ESRI",link:"https://services.arcgisonline.com/arcgis/rest/services",datasets:[{name:"Dark Gray Base",endpoint:"https://services.arcgisonline.com/arcgis/rest/services/Canvas/World_Dark_Gray_Base/MapServer/tile/{z}/{y}/{x}"},{name:"Light Gray Base",endpoint:"https://services.arcgisonline.com/arcgis/rest/services/Canvas/World_Light_Gray_Base/MapServer/tile/{z}/{y}/{x}"},{name:"World Hillshade",endpoint:"https://services.arcgisonline.com/arcgis/rest/services/Elevation/World_Hillshade/MapServer/tile/{z}/{y}/{x}"},{name:"World Ocean Base",endpoint:"https://services.arcgisonline.com/arcgis/rest/services/Ocean/World_Ocean_Base/MapServer/tile/{z}/{y}/{x}"},{name:"DeLorme World Base Map",endpoint:"https://services.arcgisonline.com/arcgis/rest/services/Specialty/DeLorme_World_Base_Map/MapServer/tile/{z}/{y}/{x}"},{name:"World Street Map",endpoint:"https://services.arcgisonline.com/arcgis/rest/services/World_Street_Map/MapServer/tile/{z}/{y}/{x}"},{name:"World Navigation Charts",endpoint:"https://services.arcgisonline.com/arcgis/rest/services/Specialty/World_Navigation_Charts/MapServer/tile/{z}/{y}/{x}"},{name:"National Geographic",endpoint:"https://services.arcgisonline.com/arcgis/rest/services/NatGeo_World_Map/MapServer/tile/{z}/{y}/{x}"},{name:"World Imagery",endpoint:"https://services.arcgisonline.com/arcgis/rest/services/World_Imagery/MapServer/tile/{z}/{y}/{x}"},{name:"World Physical Map",endpoint:"https://services.arcgisonline.com/arcgis/rest/services/World_Physical_Map/MapServer/tile/{z}/{y}/{x}"},{name:"World Shaded Relief",endpoint:"https://services.arcgisonline.com/arcgis/rest/services/World_Shaded_Relief/MapServer/tile/{z}/{y}/{x}"},{name:"World Terrain",endpoint:"https://services.arcgisonline.com/arcgis/rest/services/World_Terrain_Base/MapServer/tile/{z}/{y}/{x}"},{name:"World Topo Map",endpoint:"https://services.arcgisonline.com/arcgis/rest/services/World_Topo_Map/MapServer/tile/{z}/{y}/{x}"}],overlays:[{name:"Dark Gray Reference",endpoint:"https://services.arcgisonline.com/arcgis/rest/services/Canvas/World_Dark_Gray_Reference/MapServer/tile/{z}/{y}/{x}"},{name:"Light Gray Reference",endpoint:"https://services.arcgisonline.com/arcgis/rest/services/Canvas/World_Light_Gray_Reference/MapServer/tile/{z}/{y}/{x}"},{name:"World Ocean Reference",endpoint:"https://services.arcgisonline.com/arcgis/rest/services/Ocean/World_Ocean_Reference/MapServer/tile/{z}/{y}/{x}"},{name:"World Boundaries & Places",endpoint:"https://services.arcgisonline.com/arcgis/rest/services/Reference/World_Boundaries_and_Places/MapServer/tile/{z}/{y}/{x}"},{name:"World Reference Overlay",endpoint:"https://services.arcgisonline.com/arcgis/rest/services/Reference/World_Reference_Overlay/MapServer/tile/{z}/{y}/{x}"},{name:"World Transportation",endpoint:"https://services.arcgisonline.com/arcgis/rest/services/Reference/World_Transportation/MapServer/tile/{z}/{y}/{x}"}]},{name:"CartoDB",link:"https://cartodb.com/basemaps/",datasets:[{name:"Positron",endpoint:"https://a.basemaps.cartocdn.com/light_all/{z}/{x}/{y}.png"},{name:"Dark Matter",endpoint:"https://a.basemaps.cartocdn.com/dark_all/{z}/{x}/{y}.png"},{name:"Positron (No Labels)",endpoint:"https://a.basemaps.cartocdn.com/light_nolabels/{z}/{x}/{y}.png"},{name:"Dark Matter (No Labels)",endpoint:"https://a.basemaps.cartocdn.com/dark_nolabels/{z}/{x}/{y}.png"}],overlays:[{name:"Positron Labels",endpoint:"https://a.basemaps.cartocdn.com/light_only_labels/{z}/{x}/{y}.png"},{name:"Dark Matter Labels",endpoint:"https://a.basemaps.cartocdn.com/dark_only_labels/{z}/{x}/{y}.png"}]},{name:"Stamen",link:"https://maps.stamen.com",datasets:[{name:"Toner",endpoint:"https://tile.stamen.com/toner/{z}/{x}/{y}.png",attribution:'Map tiles by Stamen Design, under CC BY 3.0. Data by OpenStreetMap, under ODbL.'},{name:"Terrain",endpoint:"https://tile.stamen.com/terrain/{z}/{x}/{y}.png"},{name:"Watercolor",endpoint:"https://tile.stamen.com/watercolor/{z}/{x}/{y}.png"}],overlays:[]},{name:"Mapbox",link:"https://a.tiles.mapbox.com/v3/mapbox/maps.html",datasets:[{name:"Blue Marble (January)",endpoint:"https://a.tiles.mapbox.com/v3/mapbox.blue-marble-topo-bathy-jan/{z}/{x}/{y}.png"},{name:"Blue Marble (July)",endpoint:"https://a.tiles.mapbox.com/v3/mapbox.blue-marble-topo-bathy-jul/{z}/{x}/{y}.png"},{name:"Blue Marble Topo & Bathy B/W (July)",endpoint:"https://a.tiles.mapbox.com/v3/mapbox.blue-marble-topo-bathy-jul-bw/{z}/{x}/{y}.png"},{name:"Control Room",endpoint:"https://a.tiles.mapbox.com/v3/mapbox.control-room/{z}/{x}/{y}.png"},{name:"Geography Class",endpoint:"https://a.tiles.mapbox.com/v3/mapbox.geography-class/{z}/{x}/{y}.png"},{name:"World Dark",endpoint:"https://a.tiles.mapbox.com/v3/mapbox.world-dark/{z}/{x}/{y}.png"},{name:"World Light",endpoint:"https:a.tiles.mapbox.com/v3/mapbox.world-light/{z}/{x}/{y}.png"},{name:"World Glass",endpoint:"https:a.tiles.mapbox.com/v3/mapbox.world-glass/{z}/{x}/{y}.png"},{name:"World Print",endpoint:"https:a.tiles.mapbox.com/v3/mapbox.world-print/{z}/{x}/{y}.png"},{name:"World Blue",endpoint:"https:a.tiles.mapbox.com/v3/mapbox.world-blue/{z}/{x}/{y}.png"}],overlays:[]}],vbt=mbt,$te="User";function uN(t){return t?`${t.group}: ${t.title}`:"-"}function fN(t,e){return t.find(n=>n.id===e)||null}function IRe(t="datasets"){const e=[];return vbt.forEach(n=>{n[t].forEach(r=>{e.push({id:`${n.name}-${r.name}`,group:n.name,attribution:n.link,title:r.name,url:r.endpoint})})}),e}const LRe=IRe("datasets"),ybt=IRe("overlays"),xbt=LRe[0].id;var bbt=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),wbt=function(t){bbt(e,t);function e(){return t.call(this)||this}return e.prototype.getType=function(){return"text"},e.prototype.readFeature=function(n,r){return this.readFeatureFromText(EI(n),this.adaptOptions(r))},e.prototype.readFeatureFromText=function(n,r){return $t()},e.prototype.readFeatures=function(n,r){return this.readFeaturesFromText(EI(n),this.adaptOptions(r))},e.prototype.readFeaturesFromText=function(n,r){return $t()},e.prototype.readGeometry=function(n,r){return this.readGeometryFromText(EI(n),this.adaptOptions(r))},e.prototype.readGeometryFromText=function(n,r){return $t()},e.prototype.readProjection=function(n){return this.readProjectionFromText(EI(n))},e.prototype.readProjectionFromText=function(n){return this.dataProjection},e.prototype.writeFeature=function(n,r){return this.writeFeatureText(n,this.adaptOptions(r))},e.prototype.writeFeatureText=function(n,r){return $t()},e.prototype.writeFeatures=function(n,r){return this.writeFeaturesText(n,this.adaptOptions(r))},e.prototype.writeFeaturesText=function(n,r){return $t()},e.prototype.writeGeometry=function(n,r){return this.writeGeometryText(n,this.adaptOptions(r))},e.prototype.writeGeometryText=function(n,r){return $t()},e}(WPe);function EI(t){return typeof t=="string"?t:""}var _bt=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),Sbt={POINT:hh,LINESTRING:Ix,POLYGON:ny,MULTIPOINT:P4,MULTILINESTRING:ste,MULTIPOLYGON:ate},$Re="EMPTY",FRe="Z",NRe="M",Cbt="ZM",rr={START:0,TEXT:1,LEFT_PAREN:2,RIGHT_PAREN:3,NUMBER:4,COMMA:5,EOF:6},Obt={Point:"POINT",LineString:"LINESTRING",Polygon:"POLYGON",MultiPoint:"MULTIPOINT",MultiLineString:"MULTILINESTRING",MultiPolygon:"MULTIPOLYGON",GeometryCollection:"GEOMETRYCOLLECTION",Circle:"CIRCLE"},Ebt=function(){function t(e){this.wkt=e,this.index_=-1}return t.prototype.isAlpha_=function(e){return e>="a"&&e<="z"||e>="A"&&e<="Z"},t.prototype.isNumeric_=function(e,n){var r=n!==void 0?n:!1;return e>="0"&&e<="9"||e=="."&&!r},t.prototype.isWhiteSpace_=function(e){return e==" "||e==" "||e=="\r"||e==` -`},t.prototype.nextChar_=function(){return this.wkt.charAt(++this.index_)},t.prototype.nextToken=function(){var e=this.nextChar_(),n=this.index_,r=e,i;if(e=="(")i=rr.LEFT_PAREN;else if(e==",")i=rr.COMMA;else if(e==")")i=rr.RIGHT_PAREN;else if(this.isNumeric_(e)||e=="-")i=rr.NUMBER,r=this.readNumber_();else if(this.isAlpha_(e))i=rr.TEXT,r=this.readText_();else{if(this.isWhiteSpace_(e))return this.nextToken();if(e==="")i=rr.EOF;else throw new Error("Unexpected character: "+e)}return{position:n,value:r,type:i}},t.prototype.readNumber_=function(){var e,n=this.index_,r=!1,i=!1;do e=="."?r=!0:(e=="e"||e=="E")&&(i=!0),e=this.nextChar_();while(this.isNumeric_(e,r)||!i&&(e=="e"||e=="E")||i&&(e=="-"||e=="+"));return parseFloat(this.wkt.substring(n,this.index_--))},t.prototype.readText_=function(){var e,n=this.index_;do e=this.nextChar_();while(this.isAlpha_(e));return this.wkt.substring(n,this.index_--).toUpperCase()},t}(),Tbt=function(){function t(e){this.lexer_=e,this.token_={position:0,type:rr.START},this.layout_=Kn.XY}return t.prototype.consume_=function(){this.token_=this.lexer_.nextToken()},t.prototype.isTokenType=function(e){return this.token_.type==e},t.prototype.match=function(e){var n=this.isTokenType(e);return n&&this.consume_(),n},t.prototype.parse=function(){return this.consume_(),this.parseGeometry_()},t.prototype.parseGeometryLayout_=function(){var e=Kn.XY,n=this.token_;if(this.isTokenType(rr.TEXT)){var r=n.value;r===FRe?e=Kn.XYZ:r===NRe?e=Kn.XYM:r===Cbt&&(e=Kn.XYZM),e!==Kn.XY&&this.consume_()}return e},t.prototype.parseGeometryCollectionText_=function(){if(this.match(rr.LEFT_PAREN)){var e=[];do e.push(this.parseGeometry_());while(this.match(rr.COMMA));if(this.match(rr.RIGHT_PAREN))return e}throw new Error(this.formatErrorMessage_())},t.prototype.parsePointText_=function(){if(this.match(rr.LEFT_PAREN)){var e=this.parsePoint_();if(this.match(rr.RIGHT_PAREN))return e}throw new Error(this.formatErrorMessage_())},t.prototype.parseLineStringText_=function(){if(this.match(rr.LEFT_PAREN)){var e=this.parsePointList_();if(this.match(rr.RIGHT_PAREN))return e}throw new Error(this.formatErrorMessage_())},t.prototype.parsePolygonText_=function(){if(this.match(rr.LEFT_PAREN)){var e=this.parseLineStringTextList_();if(this.match(rr.RIGHT_PAREN))return e}throw new Error(this.formatErrorMessage_())},t.prototype.parseMultiPointText_=function(){if(this.match(rr.LEFT_PAREN)){var e=void 0;if(this.token_.type==rr.LEFT_PAREN?e=this.parsePointTextList_():e=this.parsePointList_(),this.match(rr.RIGHT_PAREN))return e}throw new Error(this.formatErrorMessage_())},t.prototype.parseMultiLineStringText_=function(){if(this.match(rr.LEFT_PAREN)){var e=this.parseLineStringTextList_();if(this.match(rr.RIGHT_PAREN))return e}throw new Error(this.formatErrorMessage_())},t.prototype.parseMultiPolygonText_=function(){if(this.match(rr.LEFT_PAREN)){var e=this.parsePolygonTextList_();if(this.match(rr.RIGHT_PAREN))return e}throw new Error(this.formatErrorMessage_())},t.prototype.parsePoint_=function(){for(var e=[],n=this.layout_.length,r=0;r0&&(i+=" "+o)}return r.length===0?i+" "+$Re:i+"("+r+")"}class Ibt extends Error{}const WRe={separator:",",comment:"#",quote:'"',escape:"\\",trim:!0,nanToken:"NaN",trueToken:"true",falseToken:"false"};function VRe(t,e){return new Lbt(e).parse(t)}let Lbt=class{constructor(e){gn(this,"options");this.options={...WRe,...e},this.parseLine=this.parseLine.bind(this)}parse(e){return this.parseText(e).map(this.parseLine)}parseText(e){const{comment:n,trim:r}=this.options;return e.split(` -`).map((i,o)=>(r&&(i=i.trim()),[i,o])).filter(([i,o])=>i.trim()!==""&&!i.startsWith(n))}parseLine([e,n]){const{separator:r,quote:i,escape:o}=this.options;let s=!1;const a=[];let l=0,c=0;for(;ct.toLowerCase());function epe(t){if(t=t.trim(),t==="")return"csv";if(t[0]==="{")return"geojson";const e=t.substring(0,20).toLowerCase();return Nbt.find(r=>e.startsWith(r)&&(e.length===r.length||` - (`.indexOf(e[r.length])>=0))?"wkt":"csv"}function d3(t){return t.split(",").map(e=>e.trim().toLowerCase()).filter(e=>e!=="")}const zbt=t=>{if(t.trim()!=="")try{VRe(t)}catch(e){return console.error(e),`${e}`}return null},GRe={name:"Text/CSV",fileExt:".txt,.csv",checkError:zbt},Tq={...WRe,xNames:"longitude, lon, x",yNames:"latitude, lat, y",forceGeometry:!1,geometryNames:"geometry, geom",timeNames:"time, date, datetime, date-time",groupNames:"group, cruise, station, type",groupPrefix:"Group-",labelNames:"label, name, title, id",labelPrefix:"Place-"};let jbt=0,Bbt=0;function Ubt(t,e){const n=VRe(t,e);if(n.length<2)throw new Error(ge.get("Missing header line in CSV"));for(const _ of n[0])if(typeof _!="string"||_==="")throw new Error(ge.get("Invalid header line in CSV"));const r=n[0].map(_=>_),i=r.map(_=>_.toLowerCase()),o=r.length;for(const _ of n)if(_.length!==o)throw new Error(ge.get("All rows must have same length"));const s=Wbt(i),a=Gb(s,e.groupNames),l=Gb(s,e.labelNames),c=Gb(s,e.timeNames),u=Gb(s,e.xNames),f=Gb(s,e.yNames);let d=Gb(s,e.geometryNames);if(e.forceGeometry||u<0||f<0||u===f){if(d<0)throw new Error(ge.get("No geometry column(s) found"))}else d=-1;let p=e.groupPrefix.trim();p===""&&(p=Tq.groupPrefix);let g=e.labelPrefix.trim();g===""&&(g=Tq.labelPrefix);let m="";if(a===-1){const _=++jbt;m=`${p}${_}`}const v=new zRe,y={};let x=1,b=0,w=r1(0);for(;x=0&&(S=`${_[c]}`),a>=0&&(m=`${_[a]}`);let O=y[m];O||(O=cte(m,[]),y[m]=O,w=r1(b),b++);let k=null;if(d>=0){if(typeof _[d]=="string")try{k=v.readGeometry(t)}catch{}}else{const A=_[u],P=_[f];typeof A=="number"&&Number.isFinite(A)&&typeof P=="number"&&Number.isFinite(P)&&(k=new hh([A,P]))}if(k===null)throw new Error(ge.get(`Invalid geometry in data row ${x}`));const E={};_.forEach((A,P)=>{if(P!==u&&P!==f&&P!==d){const T=r[P];E[T]=A}});let M;if(l>=0)M=`${_[l]}`;else{const A=++Bbt;M=`${g}${A}`}S!==""&&(E.time=S),E.color||(E.color=w),E.label||(E.label=M),E.source||(E.source="CSV"),O.features.push(ute(k,E))}return Object.getOwnPropertyNames(y).map(_=>y[_])}function Wbt(t){const e={};for(let n=0;n{if(t.trim()!=="")try{JSON.parse(t)}catch(e){return console.error(e),`${e}`}return null},HRe={name:"GeoJSON",fileExt:".json,.geojson",checkError:Vbt},kq={groupNames:"group, cruise, station, type",groupPrefix:"Group-",labelNames:"label, name, title, id",labelPrefix:"Place-",timeNames:"time, date, datetime, date-time"};let Gbt=0,Hbt=0;function qbt(t,e){const n=d3(e.groupNames||"");let r=e.groupPrefix.trim();r===""&&(r=kq.groupPrefix);const i=d3(e.labelNames||"");let o=e.labelPrefix.trim();o===""&&(o=kq.labelPrefix);const s=d3(e.timeNames||""),a=new rb;let l;try{l=a.readFeatures(t)}catch{try{const d=a.readGeometry(t);l=[new Bp(d)]}catch{throw new Error(ge.get("Invalid GeoJSON"))}}const c={};let u=0;return l.forEach(f=>{const d=f.getProperties(),h=f.getGeometry();if(h){let p="",g="",m="",v=r1(0);if(d){const b={};Object.getOwnPropertyNames(d).forEach(w=>{b[w.toLowerCase()]=d[w]}),p=MW(b,s,p),m=MW(b,i,m),g=MW(b,n,g)}if(g===""){const b=++Gbt;g=`${r}-${b}`}if(m===""){const b=++Hbt;m=`${o}-${b}`}let y=c[g];y||(y=cte(g,[]),c[g]=y,v=r1(u),u++);const x={...d};p!==""&&(x.time=p),x.color||(x.color=v),x.label||(x.label=m),x.source||(x.source="GeoJSON"),y.features.push(ute(h,x))}}),Object.getOwnPropertyNames(c).map(f=>c[f])}function MW(t,e,n){if(n===""){for(const r of e)if(t[r]==="string")return t[r]}return n}const Xbt=t=>null,qRe={name:"WKT",fileExt:".txt,.wkt",checkError:Xbt},Aq={group:"",groupPrefix:"Group-",label:"",labelPrefix:"Place-",time:lO(new Date().getTime())};let Ybt=0,Qbt=0;function Kbt(t,e){let n=e.groupPrefix.trim();n===""&&(n=Aq.groupPrefix);let r=e.group.trim();if(r===""){const a=++Ybt;r=`${n}${a}`}let i=e.labelPrefix.trim();i===""&&(i=Aq.labelPrefix);let o=e.label.trim();if(o===""){const a=++Qbt;o=`${i}${a}`}const s=e.time.trim();try{const a=new zRe().readGeometry(t);let l={color:r1(Math.floor(1e3*Math.random())),label:o,source:"WKT"};s!==""&&(l={time:s,...l});const c=[ute(a,l)];return[cte(r,c)]}catch{throw new Error(ge.get("Invalid Geometry WKT"))}}function cO(t){return Zbt("localStorage",t)}function Zbt(t,e){try{const n=window[t],r="__storage_test__";return n.setItem(r,r),n.removeItem(r),new Jbt(n,e)}catch{return null}}class Jbt{constructor(e,n){gn(this,"nativeStorage");gn(this,"brandingName");this.nativeStorage=e,this.brandingName=n}getItem(e,n,r,i){const o=this.nativeStorage.getItem(this.makeKey(e));if(o!==null)try{const s=r?r(o):o;return i?i(s):s}catch(s){console.error(`Failed parsing user setting "${e}": ${s}`)}return typeof n>"u"?null:n}getObjectItem(e,n){return this.getItem(e,n,r=>JSON.parse(r))}getBooleanProperty(e,n,r){this.getProperty(e,n,r,i=>i==="true")}getIntProperty(e,n,r){this.getProperty(e,n,r,parseInt)}getStringProperty(e,n,r){this.getProperty(e,n,r,i=>i)}getArrayProperty(e,n,r,i){this.getProperty(e,n,r,o=>{const s=JSON.parse(o);if(Array.isArray(s))return s;const a=r[e];return Array.isArray(a)?a:[]},i)}getObjectProperty(e,n,r){this.getProperty(e,n,r,i=>{const o=JSON.parse(i),s=r[e],a={...s,...o};return Object.getOwnPropertyNames(o).forEach(l=>{const c=s[l],u=o[l];Wde(c)&&Wde(u)&&(a[l]={...c,...u})}),a})}getProperty(e,n,r,i,o){n[e]=this.getItem(e,r[e],i,o)}setItem(e,n,r){if(typeof n>"u"||n===null)this.nativeStorage.removeItem(this.makeKey(e));else{const i=r?r(n):n+"";this.nativeStorage.setItem(this.makeKey(e),i)}}setObjectItem(e,n){this.setItem(e,n,r=>JSON.stringify(r))}setPrimitiveProperty(e,n){this.setItem(e,n[e])}setArrayProperty(e,n){this.setObjectItem(e,n[e])}setObjectProperty(e,n){this.setObjectItem(e,n[e])}makeKey(e){return`xcube.${this.brandingName}.${e}`}}function ewt(t){const e=cO(wn.instance.name);if(e)try{e.setObjectItem("userServers",t)}catch(n){console.warn(`failed to store user servers: ${n}`)}}function twt(){const t=cO(wn.instance.name);if(t)try{return t.getObjectItem("userServers",[])}catch(e){console.warn(`failed to load user servers: ${e}`)}return[]}function nwt(t){const e=cO(wn.instance.name);if(e)try{e.setObjectItem("userVariables",t)}catch(n){console.warn(`failed to store user variables: ${n}`)}}function rwt(){const t=cO(wn.instance.name);if(t)try{return t.getObjectItem("userVariables",{})}catch(e){console.warn(`failed to load user variables: ${e}`)}return{}}function md(t){const e=cO(wn.instance.name);if(e)try{e.setPrimitiveProperty("locale",t),e.setPrimitiveProperty("privacyNoticeAccepted",t),e.setPrimitiveProperty("autoShowTimeSeries",t),e.setPrimitiveProperty("timeSeriesIncludeStdev",t),e.setPrimitiveProperty("timeSeriesChartTypeDefault",t),e.setPrimitiveProperty("timeSeriesUseMedian",t),e.setPrimitiveProperty("timeAnimationInterval",t),e.setPrimitiveProperty("timeChunkSize",t),e.setPrimitiveProperty("sidebarOpen",t),e.setPrimitiveProperty("sidebarPanelId",t),e.setPrimitiveProperty("volumeRenderMode",t),e.setObjectProperty("infoCardElementStates",t),e.setPrimitiveProperty("imageSmoothingEnabled",t),e.setPrimitiveProperty("mapProjection",t),e.setPrimitiveProperty("selectedBaseMapId",t),e.setPrimitiveProperty("selectedOverlayId",t),e.setArrayProperty("userBaseMaps",t),e.setArrayProperty("userOverlays",t),e.setArrayProperty("userColorBars",t),e.setPrimitiveProperty("userDrawnPlaceGroupName",t),e.setPrimitiveProperty("datasetLocateMode",t),e.setPrimitiveProperty("placeLocateMode",t),e.setPrimitiveProperty("exportTimeSeries",t),e.setPrimitiveProperty("exportTimeSeriesSeparator",t),e.setPrimitiveProperty("exportPlaces",t),e.setPrimitiveProperty("exportPlacesAsCollection",t),e.setPrimitiveProperty("exportZipArchive",t),e.setPrimitiveProperty("exportFileName",t),e.setPrimitiveProperty("userPlacesFormatName",t),e.setObjectProperty("userPlacesFormatOptions",t)}catch(n){console.warn(`failed to store user settings: ${n}`)}}function iwt(t){const e=cO(wn.instance.name);if(e){const n={...t};try{e.getStringProperty("locale",n,t),e.getBooleanProperty("privacyNoticeAccepted",n,t),e.getBooleanProperty("autoShowTimeSeries",n,t),e.getBooleanProperty("timeSeriesIncludeStdev",n,t),e.getStringProperty("timeSeriesChartTypeDefault",n,t),e.getBooleanProperty("timeSeriesUseMedian",n,t),e.getIntProperty("timeAnimationInterval",n,t),e.getIntProperty("timeChunkSize",n,t),e.getBooleanProperty("sidebarOpen",n,t),e.getStringProperty("sidebarPanelId",n,t),e.getStringProperty("volumeRenderMode",n,t),e.getObjectProperty("infoCardElementStates",n,t),e.getBooleanProperty("imageSmoothingEnabled",n,t),e.getStringProperty("mapProjection",n,t),e.getStringProperty("selectedBaseMapId",n,t),e.getStringProperty("selectedOverlayId",n,t),e.getArrayProperty("userBaseMaps",n,t),e.getArrayProperty("userOverlays",n,t),e.getArrayProperty("userColorBars",n,t,owt),e.getStringProperty("userDrawnPlaceGroupName",n,t),e.getStringProperty("datasetLocateMode",n,t),e.getStringProperty("placeLocateMode",n,t),e.getBooleanProperty("exportTimeSeries",n,t),e.getStringProperty("exportTimeSeriesSeparator",n,t),e.getBooleanProperty("exportPlaces",n,t),e.getBooleanProperty("exportPlacesAsCollection",n,t),e.getBooleanProperty("exportZipArchive",n,t),e.getStringProperty("exportFileName",n,t),e.getStringProperty("userPlacesFormatName",n,t),e.getObjectProperty("userPlacesFormatOptions",n,t)}catch(r){console.warn(`Failed to load user settings: ${r}`)}return n}else console.warn("User settings not found or access denied");return t}const tpe={node:"continuous",continuous:"continuous",bound:"stepwise",stepwise:"stepwise",key:"categorical",categorical:"categorical"};function owt(t){if(Array.isArray(t))return t.map(e=>({...e,type:swt(e.type)}))}function swt(t){return J1(t)&&t in tpe?tpe[t]:"continuous"}const awt=[250,500,1e3,2500],lwt=["info","timeSeries","stats","volume"];function cwt(){const t=wn.instance.branding,e={selectedDatasetId:null,selectedVariableName:null,selectedDataset2Id:null,selectedVariable2Name:null,selectedPlaceGroupIds:[],selectedPlaceId:null,selectedUserPlaceId:null,selectedServerId:wn.instance.server.id,selectedTime:null,selectedTimeRange:null,timeSeriesUpdateMode:"add",timeAnimationActive:!1,timeAnimationInterval:1e3,timeChunkSize:20,autoShowTimeSeries:!0,timeSeriesChartTypeDefault:"line",timeSeriesIncludeStdev:!0,timeSeriesUseMedian:t.defaultAgg==="median",userDrawnPlaceGroupName:"",userPlacesFormatName:"csv",userPlacesFormatOptions:{csv:{...Tq},geojson:{...kq},wkt:{...Aq}},flyTo:null,activities:{},locale:"en",dialogOpen:{},privacyNoticeAccepted:!1,mapInteraction:"Select",lastMapInteraction:"Select",layerVisibilities:{baseMap:!0,datasetRgb:!1,datasetVariable:!0,datasetVariable2:!0,datasetBoundary:!1,datasetPlaces:!0,userPlaces:!0,overlay:!0},variableCompareMode:!1,mapPointInfoBoxEnabled:!1,datasetLocateMode:"panAndZoom",placeLocateMode:"panAndZoom",layerMenuOpen:!1,sidebarPosition:2*Math.max(window.innerWidth,window.innerHeight)/3,sidebarOpen:!1,sidebarPanelId:"info",volumeRenderMode:"mip",volumeStates:{},infoCardElementStates:{dataset:{visible:!0,viewMode:"text"},variable:{visible:!0,viewMode:"text"},place:{visible:!0,viewMode:"text"}},mapProjection:t.mapProjection||iRe,imageSmoothingEnabled:!1,selectedBaseMapId:xbt,selectedOverlayId:null,userBaseMaps:[],userOverlays:[],userColorBars:[],exportTimeSeries:!0,exportTimeSeriesSeparator:"TAB",exportPlaces:!0,exportPlacesAsCollection:!0,exportZipArchive:!0,exportFileName:"export"};return iwt(e)}const Hs={},uwt="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQBAMAAADt3eJSAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAGUExURcDAwP///ytph7QAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAUSURBVBjTYwABQSCglEENMxgYGAAynwRB8BEAgQAAAABJRU5ErkJggg==",XRe=new Image;XRe.src=uwt;const Pq="_alpha",Mq="_r";function fwt(t){let e=t;const n=e.endsWith(Pq);n&&(e=e.slice(0,e.length-Pq.length));const r=e.endsWith(Mq);return r&&(e=e.slice(0,e.length-Mq.length)),{baseName:e,isAlpha:n,isReversed:r}}function dN(t){let e=t.baseName;return t.isReversed&&(e+=Mq),t.isAlpha&&(e+=Pq),e}function dwt(t,e,n){pwt(t,e).then(r=>{Promise.resolve(createImageBitmap(r)).then(i=>{const o=n.getContext("2d");if(o!==null){const s=o.createPattern(XRe,"repeat");s!==null?o.fillStyle=s:o.fillStyle="#ffffff",o.fillRect(0,0,n.width,n.height),o.drawImage(i,0,0,n.width,n.height)}})})}function hwt(t,e){return new Promise((n,r)=>{const i=new Image,o=t.imageData;if(!o){n(i);return}i.onload=()=>{n(i)},i.onerror=(s,a,l,c,u)=>{r(u)},i.src=`data:image/png;base64,${o}`})}function pwt(t,e){return hwt(t).then(n=>{const r=gwt(t,e,n);if(r!==null)return r;throw new Error("failed to retrieve 2d context")})}function gwt(t,e,n){const r=document.createElement("canvas");r.width=n.width||1,r.height=n.height||1;const i=r.getContext("2d");if(i===null)return null;i.drawImage(n,0,0);let s=i.getImageData(0,0,r.width,r.height).data;if(t.isReversed){const a=new Uint8ClampedArray(s.length);for(let l=0;lt.controlState.selectedDatasetId,uO=t=>t.controlState.selectedVariableName,mwt=t=>t.controlState.selectedDataset2Id,YRe=t=>t.controlState.selectedVariable2Name,Nte=t=>t.controlState.selectedPlaceGroupIds,fO=t=>t.controlState.selectedPlaceId,KM=t=>t.controlState.selectedTime,vwt=t=>t.controlState.selectedServerId,ywt=t=>t.controlState.activities,j4=t=>t.controlState.timeAnimationActive,ZM=t=>t.controlState.imageSmoothingEnabled,xwt=t=>t.controlState.userBaseMaps,bwt=t=>t.controlState.userOverlays,zte=t=>t.controlState.selectedBaseMapId,jte=t=>t.controlState.selectedOverlayId,wwt=t=>!!t.controlState.layerVisibilities.baseMap,_wt=t=>!!t.controlState.layerVisibilities.datasetBoundary,Swt=t=>!!t.controlState.layerVisibilities.datasetVariable,Cwt=t=>!!t.controlState.layerVisibilities.datasetVariable2,Owt=t=>!!t.controlState.layerVisibilities.datasetRgb,Ewt=t=>!!t.controlState.layerVisibilities.datasetRgb2,Twt=t=>!!t.controlState.layerVisibilities.datasetPlaces,QRe=t=>!!t.controlState.layerVisibilities.userPlaces,kwt=t=>!!t.controlState.layerVisibilities.overlay,Awt=t=>t.controlState.layerVisibilities,KRe=t=>t.controlState.infoCardElementStates,zy=t=>t.controlState.mapProjection,Pwt=t=>t.controlState.timeChunkSize,Mwt=t=>t.controlState.userPlacesFormatName,Rwt=t=>t.controlState.userPlacesFormatOptions.csv,Dwt=t=>t.controlState.userPlacesFormatOptions.geojson,Iwt=t=>t.controlState.userPlacesFormatOptions.wkt,ib=t=>t.controlState.userColorBars,Lwt=t=>wn.instance.branding.allowUserVariables,$wt=()=>"variable",Fwt=()=>"variable2",Nwt=()=>"rgb",zwt=()=>"rgb2",jwt=()=>13,Bwt=()=>12,Uwt=()=>11,Wwt=()=>10,ho=xt(XM,QM,dA),jy=xt(XM,mwt,dA),Vwt=xt(ho,t=>t&&t.variables||[]),Gwt=xt(ho,t=>t?lte(t)[1]:[]),ZRe=(t,e)=>!t||!e?null:dq(t,e),ja=xt(ho,uO,ZRe),qg=xt(jy,YRe,ZRe),JRe=t=>t&&(t.title||t.name),Hwt=xt(ja,JRe),qwt=xt(qg,JRe),eDe=t=>t&&t.units||"-",Xwt=xt(ja,eDe),Ywt=xt(qg,eDe),tDe=t=>t&&t.colorBarName||"viridis",B4=xt(ja,tDe),U4=xt(qg,tDe),nDe=t=>t?[t.colorBarMin,t.colorBarMax]:[0,1],rDe=xt(ja,nDe),iDe=xt(qg,nDe),oDe=t=>(t&&t.colorBarNorm)==="log"?"log":"lin",sDe=xt(ja,oDe),aDe=xt(qg,oDe),W4=xt(ib,fbt,(t,e)=>{const n={title:uMe,description:"User-defined color bars.",names:t.map(i=>i.id)},r={};return t.forEach(({id:i,imageData:o})=>{o&&(r[i]=o)}),e?{...e,groups:[n,...e.groups],images:{...e.images,...r}}:{groups:[n],images:r,customColorMaps:{}}}),lDe=(t,e,n)=>{const r=fwt(t),{baseName:i}=r,o=e.images[i],s=n.find(a=>a.id===i);if(s){const a=s.type,l=dMe(s.code);return{...r,imageData:o,type:a,colorRecords:l}}else{const a=e.customColorMaps[i];if(a){const l=a.type,c=a.colorRecords;return{...r,imageData:o,type:l,colorRecords:c}}}return{...r,imageData:o}},Bte=xt(B4,W4,ib,lDe),cDe=xt(U4,W4,ib,lDe),uDe=(t,e,n)=>{const{baseName:r}=t,i=n.find(o=>o.id===r);if(i){const o=dMe(i.code);if(o)return JSON.stringify({name:e,type:i.type,colors:o.map(s=>[s.value,s.color])})}return null},Qwt=xt(Bte,B4,ib,uDe),Kwt=xt(cDe,U4,ib,uDe),fDe=t=>!t||typeof t.opacity!="number"?1:t.opacity,dDe=xt(ja,fDe),hDe=xt(qg,fDe),Zwt=xt(ho,t=>t!==null?aMe(t):null),Jwt=xt(ho,t=>t!==null&&t.rgbSchema||null),e_t=xt(jy,t=>t!==null&&t.rgbSchema||null),pDe=xt(ho,t=>t&&t.placeGroups||[]),V4=xt(pDe,YM,(t,e)=>t.concat(e));function gDe(t,e){const n=[];return e!==null&&e.length>0&&t.forEach(r=>{e.indexOf(r.id)>-1&&n.push(r)}),n}const t_t=xt(YM,Nte,QRe,(t,e)=>{const n={},r=new Set(e||[]);return t.forEach(i=>{n[i.id]=r.has(i.id)}),n}),mDe=xt(pDe,Nte,gDe),dO=xt(V4,Nte,gDe),n_t=xt(dO,t=>t.map(e=>e.title||e.id).join(", ")),JM=xt(dO,t=>{const e=t.map(n=>nO(n)?n.features:[]);return[].concat(...e)}),vDe=xt(JM,fO,(t,e)=>t.find(n=>n.id===e)||null),eR=xt(dO,fO,(t,e)=>t.length===0||e===null?null:mgt(t,e)),r_t=xt(QM,uO,vDe,(t,e,n)=>{if(t&&e){if(!n)return`${t}-${e}-all`;if(n.geometry.type==="Polygon"||n.geometry.type==="MultiPolygon")return`${t}-${e}-${n.id}`}return null}),yDe=xt(MRe,QM,uO,fO,(t,e,n,r)=>{if(!e||!n||!r)return!1;for(const i of t)for(const o of i.timeSeriesArray){const s=o.source;if(s.datasetId===e&&s.variableName===n&&s.placeId===r)return!1}return!0}),i_t=xt(MRe,V4,(t,e)=>{const n={};return fte(e,(r,i)=>{for(const o of t)if(o.timeSeriesArray.find(s=>s.source.placeId===i.id)){n[i.id]=M4(r,i);break}}),n}),xDe=xt(QM,uO,fO,(t,e,n)=>!!(t&&e&&n)),o_t=xt(pbt,V4,(t,e)=>{const n=[];return t.forEach(r=>{const i=r.source.placeInfo.place.id;fte(e,(o,s)=>{if(s.id===i){const a=M4(o,s);n.push({...r,source:{...r.source,placeInfo:a}})}})}),n}),s_t=xt(dO,t=>{const e=[];return fte(t,(n,r)=>{e.push(M4(n,r).label)}),e}),a_t=xt(ja,Pwt,(t,e)=>{if(t&&t.timeChunkSize){const n=t.timeChunkSize;return n*Math.ceil(e/n)}return e}),bDe=t=>t&&sMe(t)||null,hO=xt(ho,bDe),l_t=xt(jy,bDe),wDe=t=>t&&t.attributions||null,Ute=xt(ho,wDe),c_t=xt(jy,wDe),_De=t=>t===null||t.coordinates.length===0?null:t.coordinates,Rq=xt(hO,_De),u_t=xt(hO,_De),SDe=(t,e)=>t===null||e===null?-1:lRe(e,t),CDe=xt(KM,Rq,SDe),f_t=xt(KM,u_t,SDe),ODe=(t,e,n)=>t===null?null:n&&e>-1?n.labels[e]:new Date(t).toISOString(),pO=xt(KM,CDe,hO,ODe),d_t=xt(KM,f_t,l_t,ODe);function h_t(t,e){if(t!==Ate){const n=typeof e=="number"?e+1:20;return new Tte({tileSize:[256,256],origin:[-180,90],extent:[-180,-90,180,90],resolutions:Array.from({length:n},(r,i)=>180/256/Math.pow(2,i))})}}function p_t(t,e,n,r,i,o,s,a,l){return new oO({url:t,projection:e,tileGrid:n,attributions:r||void 0,transition:i?0:250,imageSmoothing:o,tileLoadFunction:s,maxZoom:l})}function g_t(t){if(t)return(e,n)=>{e instanceof vte&&(t.getView().getInteracting()?t.once("moveend",function(){e.getImage().src=n}):e.getImage().src=n)}}const m_t=Pgt(g_t,{serializer:t=>{const e=t[0];if(e){const n=e.getTarget();return typeof n=="string"?n:n&&n.id||"map"}return""}});function v_t(){const t=Hs.map;return m_t(t)}function EDe(t,e,n,r,i,o,s,a,l,c,u,f,d=10){a!==null&&(o=[...o,["time",a]]);const h=Ny(e,o);typeof i=="number"&&(i+=3);const p=h_t(c,i),g=p_t(h,c,p,u,l,f,v_t(),r,i),m=c===sO?n:zPe(n,"EPSG:4326",c);return C.jsx(aRe,{id:t,source:g,extent:m,zIndex:d,opacity:s})}const y_t=xt(ho,zy,_wt,(t,e,n)=>{if(!t||!n)return null;let r=t.geometry;if(!r)if(t.bbox){const[s,a,l,c]=t.bbox;r={type:"Polygon",coordinates:[[[s,a],[l,a],[l,c],[s,c],[s,a]]]}}else return console.warn(`Dataset ${t.id} has no bbox!`),null;const i=new HM({features:new rb({dataProjection:sO,featureProjection:e}).readFeatures({type:"Feature",geometry:r})}),o=new Zd({stroke:new ph({color:"orange",width:3,lineDash:[2,4]})});return C.jsx(N4,{id:`${t.id}.bbox`,source:i,style:o,zIndex:16,opacity:.5})}),ji=xt(RRe,vwt,(t,e)=>{if(t.length===0)throw new Error("internal error: no servers configured");const n=t.find(r=>r.id===e);if(!n)throw new Error(`internal error: server with ID "${e}" not found`);return n}),TDe=(t,e,n,r,i,o,s,a,l,c,u,f,d,h,p,g)=>{if(!e||!i||!u)return null;const m=[["crs",p],["vmin",`${s[0]}`],["vmax",`${s[1]}`],["cmap",l||o]];return a==="log"&&m.push(["norm",a]),EDe(f,ADe(t.url,e,i),e.bbox,i.tileLevelMin,i.tileLevelMax,m,c,n,h,p,r,g,d)},x_t=xt(ji,ho,pO,Ute,ja,B4,rDe,sDe,Qwt,dDe,Swt,$wt,jwt,j4,zy,ZM,TDe),b_t=xt(ji,jy,d_t,c_t,qg,U4,iDe,aDe,Kwt,hDe,Cwt,Fwt,Bwt,j4,zy,ZM,TDe),kDe=(t,e,n,r,i,o,s,a,l,c,u)=>{if(!e||!n||!r)return null;const f=[["crs",l]];return EDe(i,ADe(t.url,e,"rgb"),e.bbox,n.tileLevelMin,n.tileLevelMax,f,1,s,a,l,c,u,o)},w_t=xt(ji,ho,Jwt,Owt,Nwt,Uwt,pO,j4,zy,Ute,ZM,kDe),__t=xt(ji,jy,e_t,Ewt,zwt,Wwt,pO,j4,zy,Ute,ZM,kDe);function ADe(t,e,n){return`${t}/tiles/${eO(e)}/${BM(n)}/{z}/{y}/{x}`}function S_t(){return Iee()}function C_t(){return new VM({fill:MDe(),stroke:PDe(),radius:6})}function PDe(){return new ph({color:[200,0,0,.75],width:1.25})}function MDe(){return new a1({color:[255,0,0,S_t()]})}function O_t(){return new Zd({image:C_t(),stroke:PDe(),fill:MDe()})}const E_t=xt(mDe,zy,Twt,(t,e,n)=>{if(!n||t.length===0)return null;const r=[];return t.forEach((i,o)=>{nO(i)&&r.push(C.jsx(N4,{id:`placeGroup.${i.id}`,style:O_t(),zIndex:100,source:new HM({features:new rb({dataProjection:sO,featureProjection:e}).readFeatures(i)})},o))}),C.jsx(nRe,{children:r})}),T_t=xt(KRe,t=>{const e=[];return Object.getOwnPropertyNames(t).forEach(n=>{t[n].visible&&e.push(n)}),e}),k_t=xt(KRe,t=>{const e={};return Object.getOwnPropertyNames(t).forEach(n=>{e[n]=t[n].viewMode||"text"}),e}),A_t=xt(ywt,t=>Object.keys(t).map(e=>t[e])),Wte=xt(xwt,t=>[...t,...LRe]),Vte=xt(bwt,t=>[...t,...ybt]),RDe=(t,e,n,r)=>{if(!n||!e)return null;const i=fN(t,e);if(!i)return null;let o=i.attribution;o&&(o.startsWith("http://")||o.startsWith("https://"))&&(o=`© ${i.group}`);let s;if(i.wms){const{layerName:a,styleName:l}=i.wms;s=new r0t({url:i.url,params:{...l?{STYLES:l}:{},LAYERS:a},attributions:o,attributionsCollapsible:!0})}else{const a=Oft(i.group);s=new oO({url:i.url+(a?`?${a.param}=${a.token}`:""),attributions:o,attributionsCollapsible:!0})}return C.jsx(aRe,{id:i.id,source:s,zIndex:r})},P_t=xt(Wte,zte,wwt,()=>0,RDe),M_t=xt(Vte,jte,kwt,()=>20,RDe),DDe=(t,e)=>{const n=fN(t,e);return n?uN(n):null},R_t=xt(Wte,zte,DDe),D_t=xt(Vte,jte,DDe),I_t=xt(R_t,D_t,zte,jte,ho,jy,ja,qg,Awt,(t,e,n,r,i,o,s,a,l)=>({baseMap:{title:"Base Map",subTitle:t||void 0,visible:l.baseMap,disabled:!n},overlay:{title:"Overlay",subTitle:e||void 0,visible:l.overlay,disabled:!r},datasetRgb:{title:"Dataset RGB",subTitle:i?i.title:void 0,visible:l.datasetRgb,disabled:!i},datasetRgb2:{title:"Dataset RGB",subTitle:o?o.title:void 0,visible:l.datasetRgb2,disabled:!o,pinned:!0},datasetVariable:{title:"Dataset Variable",subTitle:i&&s?`${i.title} / ${s.title||s.name}`:void 0,visible:l.datasetVariable,disabled:!(i&&s)},datasetVariable2:{title:"Dataset Variable",subTitle:o&&a?`${o.title} / ${a.title||a.name}`:void 0,visible:l.datasetVariable2,disabled:!(o&&a),pinned:!0},datasetBoundary:{title:"Dataset Boundary",subTitle:i?i.title:void 0,visible:l.datasetBoundary,disabled:!i},datasetPlaces:{title:"Dataset Places",visible:l.datasetPlaces},userPlaces:{title:"User Places",visible:l.userPlaces}}));var IDe={exports:{}};/*! +`+p;xp.get(g)===void 0&&(xp.set(g,t,!0),a(u.style,u.weight,p)||(xp.set(g,0,!0),o===void 0&&(o=setInterval(l,32))))}}}(),fgt=function(){var t;return function(e){var n=Tq[e];if(n==null){if(C4){var r=$Me(e),i=NMe(e,"Žg"),o=isNaN(Number(r.lineHeight))?1.2:Number(r.lineHeight);n=o*(i.actualBoundingBoxAscent+i.actualBoundingBoxDescent)}else t||(t=document.createElement("div"),t.innerHTML="M",t.style.minHeight="0",t.style.maxHeight="none",t.style.height="auto",t.style.padding="0",t.style.border="none",t.style.position="absolute",t.style.display="block",t.style.left="-99999px"),t.style.font=e,document.body.appendChild(t),n=t.offsetHeight,document.body.removeChild(t);Tq[e]=n}return n}}();function NMe(t,e){return Rw||(Rw=Sc(1,1)),t!=Eq&&(Rw.font=t,Eq=Rw.font),Rw.measureText(e)}function QF(t,e){return NMe(t,e).width}function Fhe(t,e,n){if(e in n)return n[e];var r=e.split(` +`).reduce(function(i,o){return Math.max(i,QF(t,o))},0);return n[e]=r,r}function dgt(t,e){for(var n=[],r=[],i=[],o=0,s=0,a=0,l=0,c=0,u=e.length;c<=u;c+=2){var f=e[c];if(f===` +`||c===u){o=Math.max(o,s),i.push(s),s=0,a+=l;continue}var d=e[c+1]||t.font,h=QF(d,f);n.push(h),s+=h;var p=fgt(d);r.push(p),l=Math.max(l,p)}return{width:o,height:a,widths:n,heights:r,lineWidths:i}}function hgt(t,e,n,r,i,o,s,a,l,c,u){t.save(),n!==1&&(t.globalAlpha*=n),e&&t.setTransform.apply(t,e),r.contextInstructions?(t.translate(l,c),t.scale(u[0],u[1]),pgt(r,t)):u[0]<0||u[1]<0?(t.translate(l,c),t.scale(u[0],u[1]),t.drawImage(r,i,o,s,a,0,0,s,a)):t.drawImage(r,i,o,s,a,l,c,s*u[0],a*u[1]),t.restore()}function pgt(t,e){for(var n=t.contextInstructions,r=0,i=n.length;r=t.maxResolution)return!1;var r=e.zoom;return r>t.minZoom&&r<=t.maxZoom}function Sgt(t,e,n,r,i){jMe(t,e,n||0,r||t.length-1,i||Cgt)}function jMe(t,e,n,r,i){for(;r>n;){if(r-n>600){var o=r-n+1,s=e-n+1,a=Math.log(o),l=.5*Math.exp(2*a/3),c=.5*Math.sqrt(a*l*(o-l)/o)*(s-o/2<0?-1:1),u=Math.max(n,Math.floor(e-s*l/o+c)),f=Math.min(r,Math.floor(e+(o-s)*l/o+c));jMe(t,e,u,f,i)}var d=t[e],h=n,p=r;for(IE(t,n,e),i(t[r],d)>0&&IE(t,n,r);h0;)p--}i(t[n],d)===0?IE(t,n,p):(p++,IE(t,p,r)),p<=e&&(n=p+1),e<=p&&(r=p-1)}}function IE(t,e,n){var r=t[e];t[e]=t[n],t[n]=r}function Cgt(t,e){return te?1:0}let BMe=class{constructor(e=9){this._maxEntries=Math.max(4,e),this._minEntries=Math.max(2,Math.ceil(this._maxEntries*.4)),this.clear()}all(){return this._all(this.data,[])}search(e){let n=this.data;const r=[];if(!hI(e,n))return r;const i=this.toBBox,o=[];for(;n;){for(let s=0;s=0&&o[n].children.length>this._maxEntries;)this._split(o,n),n--;this._adjustParentBBoxes(i,o,n)}_split(e,n){const r=e[n],i=r.children.length,o=this._minEntries;this._chooseSplitAxis(r,o,i);const s=this._chooseSplitIndex(r,o,i),a=Dw(r.children.splice(s,r.children.length-s));a.height=r.height,a.leaf=r.leaf,j1(r,this.toBBox),j1(a,this.toBBox),n?e[n-1].children.push(a):this._splitRoot(r,a)}_splitRoot(e,n){this.data=Dw([e,n]),this.data.height=e.height+1,this.data.leaf=!1,j1(this.data,this.toBBox)}_chooseSplitIndex(e,n,r){let i,o=1/0,s=1/0;for(let a=n;a<=r-n;a++){const l=K2(e,0,a,this.toBBox),c=K2(e,a,r,this.toBBox),u=Agt(l,c),f=fW(l)+fW(c);u=n;c--){const u=e.children[c];Z2(a,e.leaf?o(u):u),l+=dI(a)}return l}_adjustParentBBoxes(e,n,r){for(let i=r;i>=0;i--)Z2(n[i],e)}_condense(e){for(let n=e.length-1,r;n>=0;n--)e[n].children.length===0?n>0?(r=e[n-1].children,r.splice(r.indexOf(e[n]),1)):this.clear():j1(e[n],this.toBBox)}};function Ogt(t,e,n){if(!n)return e.indexOf(t);for(let r=0;r=t.minX&&e.maxY>=t.minY}function Dw(t){return{children:t,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function zhe(t,e,n,r,i){const o=[e,n];for(;o.length;){if(n=o.pop(),e=o.pop(),n-e<=r)continue;const s=e+Math.ceil((n-e)/r/2)*r;Sgt(t,s,e,n,i),o.push(e,s,s,n)}}var Pgt=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),jhe={RENDER_ORDER:"renderOrder"},Mgt=function(t){Pgt(e,t);function e(n){var r=this,i=n||{},o=hi({},i);return delete o.style,delete o.renderBuffer,delete o.updateWhileAnimating,delete o.updateWhileInteracting,r=t.call(this,o)||this,r.declutter_=i.declutter!==void 0?i.declutter:!1,r.renderBuffer_=i.renderBuffer!==void 0?i.renderBuffer:100,r.style_=null,r.styleFunction_=void 0,r.setStyle(i.style),r.updateWhileAnimating_=i.updateWhileAnimating!==void 0?i.updateWhileAnimating:!1,r.updateWhileInteracting_=i.updateWhileInteracting!==void 0?i.updateWhileInteracting:!1,r}return e.prototype.getDeclutter=function(){return this.declutter_},e.prototype.getFeatures=function(n){return t.prototype.getFeatures.call(this,n)},e.prototype.getRenderBuffer=function(){return this.renderBuffer_},e.prototype.getRenderOrder=function(){return this.get(jhe.RENDER_ORDER)},e.prototype.getStyle=function(){return this.style_},e.prototype.getStyleFunction=function(){return this.styleFunction_},e.prototype.getUpdateWhileAnimating=function(){return this.updateWhileAnimating_},e.prototype.getUpdateWhileInteracting=function(){return this.updateWhileInteracting_},e.prototype.renderDeclutter=function(n){n.declutterTree||(n.declutterTree=new BMe(9)),this.getRenderer().renderDeclutter(n)},e.prototype.setRenderOrder=function(n){this.set(jhe.RENDER_ORDER,n)},e.prototype.setStyle=function(n){this.style_=n!==void 0?n:ygt,this.styleFunction_=n===null?void 0:vgt(this.style_),this.changed()},e}(k4),Wt={BEGIN_GEOMETRY:0,BEGIN_PATH:1,CIRCLE:2,CLOSE_PATH:3,CUSTOM:4,DRAW_CHARS:5,DRAW_IMAGE:6,END_GEOMETRY:7,FILL:8,MOVE_TO_LINE_TO:9,SET_FILL_STYLE:10,SET_STROKE_STYLE:11,STROKE:12},pI=[Wt.FILL],uv=[Wt.STROKE],hx=[Wt.BEGIN_PATH],Bhe=[Wt.CLOSE_PATH],UMe=function(){function t(){}return t.prototype.drawCustom=function(e,n,r,i){},t.prototype.drawGeometry=function(e){},t.prototype.setStyle=function(e){},t.prototype.drawCircle=function(e,n){},t.prototype.drawFeature=function(e,n){},t.prototype.drawGeometryCollection=function(e,n){},t.prototype.drawLineString=function(e,n){},t.prototype.drawMultiLineString=function(e,n){},t.prototype.drawMultiPoint=function(e,n){},t.prototype.drawMultiPolygon=function(e,n){},t.prototype.drawPoint=function(e,n){},t.prototype.drawPolygon=function(e,n){},t.prototype.drawText=function(e,n){},t.prototype.setFillStrokeStyle=function(e,n){},t.prototype.setImageStyle=function(e,n){},t.prototype.setTextStyle=function(e,n){},t}(),Rgt=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),UM=function(t){Rgt(e,t);function e(n,r,i,o){var s=t.call(this)||this;return s.tolerance=n,s.maxExtent=r,s.pixelRatio=o,s.maxLineWidth=0,s.resolution=i,s.beginGeometryInstruction1_=null,s.beginGeometryInstruction2_=null,s.bufferedMaxExtent_=null,s.instructions=[],s.coordinates=[],s.tmpCoordinate_=[],s.hitDetectionInstructions=[],s.state={},s}return e.prototype.applyPixelRatio=function(n){var r=this.pixelRatio;return r==1?n:n.map(function(i){return i*r})},e.prototype.appendFlatPointCoordinates=function(n,r){for(var i=this.getBufferedMaxExtent(),o=this.tmpCoordinate_,s=this.coordinates,a=s.length,l=0,c=n.length;ll&&(this.instructions.push([Wt.CUSTOM,l,u,n,i,cv]),this.hitDetectionInstructions.push([Wt.CUSTOM,l,u,n,o||i,cv]));break;case"Point":c=n.getFlatCoordinates(),this.coordinates.push(c[0],c[1]),u=this.coordinates.length,this.instructions.push([Wt.CUSTOM,l,u,n,i]),this.hitDetectionInstructions.push([Wt.CUSTOM,l,u,n,o||i]);break}this.endGeometry(r)},e.prototype.beginGeometry=function(n,r){this.beginGeometryInstruction1_=[Wt.BEGIN_GEOMETRY,r,0,n],this.instructions.push(this.beginGeometryInstruction1_),this.beginGeometryInstruction2_=[Wt.BEGIN_GEOMETRY,r,0,n],this.hitDetectionInstructions.push(this.beginGeometryInstruction2_)},e.prototype.finish=function(){return{instructions:this.instructions,hitDetectionInstructions:this.hitDetectionInstructions,coordinates:this.coordinates}},e.prototype.reverseHitDetectionInstructions=function(){var n=this.hitDetectionInstructions;n.reverse();var r,i=n.length,o,s,a=-1;for(r=0;rthis.maxLineWidth&&(this.maxLineWidth=i.lineWidth,this.bufferedMaxExtent_=null)}else i.strokeStyle=void 0,i.lineCap=void 0,i.lineDash=null,i.lineDashOffset=void 0,i.lineJoin=void 0,i.lineWidth=void 0,i.miterLimit=void 0},e.prototype.createFill=function(n){var r=n.fillStyle,i=[Wt.SET_FILL_STYLE,r];return typeof r!="string"&&i.push(!0),i},e.prototype.applyStroke=function(n){this.instructions.push(this.createStroke(n))},e.prototype.createStroke=function(n){return[Wt.SET_STROKE_STYLE,n.strokeStyle,n.lineWidth*this.pixelRatio,n.lineCap,n.lineJoin,n.miterLimit,this.applyPixelRatio(n.lineDash),n.lineDashOffset*this.pixelRatio]},e.prototype.updateFillStyle=function(n,r){var i=n.fillStyle;(typeof i!="string"||n.currentFillStyle!=i)&&(i!==void 0&&this.instructions.push(r.call(this,n)),n.currentFillStyle=i)},e.prototype.updateStrokeStyle=function(n,r){var i=n.strokeStyle,o=n.lineCap,s=n.lineDash,a=n.lineDashOffset,l=n.lineJoin,c=n.lineWidth,u=n.miterLimit;(n.currentStrokeStyle!=i||n.currentLineCap!=o||s!=n.currentLineDash&&!Zb(n.currentLineDash,s)||n.currentLineDashOffset!=a||n.currentLineJoin!=l||n.currentLineWidth!=c||n.currentMiterLimit!=u)&&(i!==void 0&&r.call(this,n),n.currentStrokeStyle=i,n.currentLineCap=o,n.currentLineDash=s,n.currentLineDashOffset=a,n.currentLineJoin=l,n.currentLineWidth=c,n.currentMiterLimit=u)},e.prototype.endGeometry=function(n){this.beginGeometryInstruction1_[2]=this.instructions.length,this.beginGeometryInstruction1_=null,this.beginGeometryInstruction2_[2]=this.hitDetectionInstructions.length,this.beginGeometryInstruction2_=null;var r=[Wt.END_GEOMETRY,n];this.instructions.push(r),this.hitDetectionInstructions.push(r)},e.prototype.getBufferedMaxExtent=function(){if(!this.bufferedMaxExtent_&&(this.bufferedMaxExtent_=sMe(this.maxExtent),this.maxLineWidth>0)){var n=this.resolution*(this.maxLineWidth+1)/2;lA(this.bufferedMaxExtent_,n,this.bufferedMaxExtent_)}return this.bufferedMaxExtent_},e}(UMe),Dgt=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),Igt=function(t){Dgt(e,t);function e(n,r,i,o){var s=t.call(this,n,r,i,o)||this;return s.hitDetectionImage_=null,s.image_=null,s.imagePixelRatio_=void 0,s.anchorX_=void 0,s.anchorY_=void 0,s.height_=void 0,s.opacity_=void 0,s.originX_=void 0,s.originY_=void 0,s.rotateWithView_=void 0,s.rotation_=void 0,s.scale_=void 0,s.width_=void 0,s.declutterMode_=void 0,s.declutterImageWithText_=void 0,s}return e.prototype.drawPoint=function(n,r){if(this.image_){this.beginGeometry(n,r);var i=n.getFlatCoordinates(),o=n.getStride(),s=this.coordinates.length,a=this.appendFlatPointCoordinates(i,o);this.instructions.push([Wt.DRAW_IMAGE,s,a,this.image_,this.anchorX_*this.imagePixelRatio_,this.anchorY_*this.imagePixelRatio_,Math.ceil(this.height_*this.imagePixelRatio_),this.opacity_,this.originX_*this.imagePixelRatio_,this.originY_*this.imagePixelRatio_,this.rotateWithView_,this.rotation_,[this.scale_[0]*this.pixelRatio/this.imagePixelRatio_,this.scale_[1]*this.pixelRatio/this.imagePixelRatio_],Math.ceil(this.width_*this.imagePixelRatio_),this.declutterMode_,this.declutterImageWithText_]),this.hitDetectionInstructions.push([Wt.DRAW_IMAGE,s,a,this.hitDetectionImage_,this.anchorX_,this.anchorY_,this.height_,this.opacity_,this.originX_,this.originY_,this.rotateWithView_,this.rotation_,this.scale_,this.width_,this.declutterMode_,this.declutterImageWithText_]),this.endGeometry(r)}},e.prototype.drawMultiPoint=function(n,r){if(this.image_){this.beginGeometry(n,r);var i=n.getFlatCoordinates(),o=n.getStride(),s=this.coordinates.length,a=this.appendFlatPointCoordinates(i,o);this.instructions.push([Wt.DRAW_IMAGE,s,a,this.image_,this.anchorX_*this.imagePixelRatio_,this.anchorY_*this.imagePixelRatio_,Math.ceil(this.height_*this.imagePixelRatio_),this.opacity_,this.originX_*this.imagePixelRatio_,this.originY_*this.imagePixelRatio_,this.rotateWithView_,this.rotation_,[this.scale_[0]*this.pixelRatio/this.imagePixelRatio_,this.scale_[1]*this.pixelRatio/this.imagePixelRatio_],Math.ceil(this.width_*this.imagePixelRatio_),this.declutterMode_,this.declutterImageWithText_]),this.hitDetectionInstructions.push([Wt.DRAW_IMAGE,s,a,this.hitDetectionImage_,this.anchorX_,this.anchorY_,this.height_,this.opacity_,this.originX_,this.originY_,this.rotateWithView_,this.rotation_,this.scale_,this.width_,this.declutterMode_,this.declutterImageWithText_]),this.endGeometry(r)}},e.prototype.finish=function(){return this.reverseHitDetectionInstructions(),this.anchorX_=void 0,this.anchorY_=void 0,this.hitDetectionImage_=null,this.image_=null,this.imagePixelRatio_=void 0,this.height_=void 0,this.scale_=void 0,this.opacity_=void 0,this.originX_=void 0,this.originY_=void 0,this.rotateWithView_=void 0,this.rotation_=void 0,this.width_=void 0,t.prototype.finish.call(this)},e.prototype.setImageStyle=function(n,r){var i=n.getAnchor(),o=n.getSize(),s=n.getOrigin();this.imagePixelRatio_=n.getPixelRatio(this.pixelRatio),this.anchorX_=i[0],this.anchorY_=i[1],this.hitDetectionImage_=n.getHitDetectionImage(),this.image_=n.getImage(this.pixelRatio),this.height_=o[1],this.opacity_=n.getOpacity(),this.originX_=s[0],this.originY_=s[1],this.rotateWithView_=n.getRotateWithView(),this.rotation_=n.getRotation(),this.scale_=n.getScaleArray(),this.width_=o[0],this.declutterMode_=n.getDeclutterMode(),this.declutterImageWithText_=r},e}(UM),Lgt=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),$gt=function(t){Lgt(e,t);function e(n,r,i,o){return t.call(this,n,r,i,o)||this}return e.prototype.drawFlatCoordinates_=function(n,r,i,o){var s=this.coordinates.length,a=this.appendFlatLineCoordinates(n,r,i,o,!1,!1),l=[Wt.MOVE_TO_LINE_TO,s,a];return this.instructions.push(l),this.hitDetectionInstructions.push(l),i},e.prototype.drawLineString=function(n,r){var i=this.state,o=i.strokeStyle,s=i.lineWidth;if(!(o===void 0||s===void 0)){this.updateStrokeStyle(i,this.applyStroke),this.beginGeometry(n,r),this.hitDetectionInstructions.push([Wt.SET_STROKE_STYLE,i.strokeStyle,i.lineWidth,i.lineCap,i.lineJoin,i.miterLimit,dA,hA],hx);var a=n.getFlatCoordinates(),l=n.getStride();this.drawFlatCoordinates_(a,0,a.length,l),this.hitDetectionInstructions.push(uv),this.endGeometry(r)}},e.prototype.drawMultiLineString=function(n,r){var i=this.state,o=i.strokeStyle,s=i.lineWidth;if(!(o===void 0||s===void 0)){this.updateStrokeStyle(i,this.applyStroke),this.beginGeometry(n,r),this.hitDetectionInstructions.push([Wt.SET_STROKE_STYLE,i.strokeStyle,i.lineWidth,i.lineCap,i.lineJoin,i.miterLimit,i.lineDash,i.lineDashOffset],hx);for(var a=n.getEnds(),l=n.getFlatCoordinates(),c=n.getStride(),u=0,f=0,d=a.length;ft&&(l>a&&(a=l,o=c,s=f),l=0,c=f-i)),d=h,m=y,v=x),p=b,g=w}return l+=h,l>a?[c,f]:[o,s]}var zgt=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),nk={left:0,end:0,center:.5,right:1,start:1,top:0,middle:.5,hanging:.2,alphabetic:.8,ideographic:.8,bottom:1},jgt=function(t){zgt(e,t);function e(n,r,i,o){var s=t.call(this,n,r,i,o)||this;return s.labels_=null,s.text_="",s.textOffsetX_=0,s.textOffsetY_=0,s.textRotateWithView_=void 0,s.textRotation_=0,s.textFillState_=null,s.fillStates={},s.textStrokeState_=null,s.strokeStates={},s.textState_={},s.textStates={},s.textKey_="",s.fillKey_="",s.strokeKey_="",s.declutterImageWithText_=void 0,s}return e.prototype.finish=function(){var n=t.prototype.finish.call(this);return n.textStates=this.textStates,n.fillStates=this.fillStates,n.strokeStates=this.strokeStates,n},e.prototype.drawText=function(n,r){var i=this.textFillState_,o=this.textStrokeState_,s=this.textState_;if(!(this.text_===""||!s||!i&&!o)){var a=this.coordinates,l=a.length,c=n.getType(),u=null,f=n.getStride();if(s.placement===bgt.LINE&&(c=="LineString"||c=="MultiLineString"||c=="Polygon"||c=="MultiPolygon")){if(!ga(this.getBufferedMaxExtent(),n.getExtent()))return;var d=void 0;if(u=n.getFlatCoordinates(),c=="LineString")d=[u.length];else if(c=="MultiLineString")d=n.getEnds();else if(c=="Polygon")d=n.getEnds().slice(0,1);else if(c=="MultiPolygon"){var h=n.getEndss();d=[];for(var p=0,g=h.length;pA[2]}else P=b>k;var R=Math.PI,T=[],M=_+r===e;e=_,m=0,v=S,d=t[e],h=t[e+1];var I;if(M){y(),I=Math.atan2(h-g,d-p),P&&(I+=I>0?-R:R);var j=(k+b)/2,N=(E+w)/2;return T[0]=[j,N,(O-o)/2,I,i],T}i=i.replace(/\n/g," ");for(var z=0,L=i.length;z0?-R:R),I!==void 0){var F=B-I;if(F+=F>R?-2*R:F<-R?2*R:0,Math.abs(F)>s)return null}I=B;for(var $=z,q=0;z0&&t.push(` +`,""),t.push(e,""),t}var Qgt=function(){function t(e,n,r,i){this.overlaps=r,this.pixelRatio=n,this.resolution=e,this.alignFill_,this.instructions=i.instructions,this.coordinates=i.coordinates,this.coordinateCache_={},this.renderedTransform_=ch(),this.hitDetectionInstructions=i.hitDetectionInstructions,this.pixelCoordinates_=null,this.viewRotation_=0,this.fillStates=i.fillStates||{},this.strokeStates=i.strokeStates||{},this.textStates=i.textStates||{},this.widths_={},this.labels_={}}return t.prototype.createLabel=function(e,n,r,i){var o=e+n+r+i;if(this.labels_[o])return this.labels_[o];var s=i?this.strokeStates[i]:null,a=r?this.fillStates[r]:null,l=this.textStates[n],c=this.pixelRatio,u=[l.scale[0]*c,l.scale[1]*c],f=Array.isArray(e),d=l.justify?nk[l.justify]:Hhe(Array.isArray(e)?e[0]:e,l.textAlign||mA),h=i&&s.lineWidth?s.lineWidth:0,p=f?e:e.split(` +`).reduce(Ygt,[]),g=dgt(l,p),m=g.width,v=g.height,y=g.widths,x=g.heights,b=g.lineWidths,w=m+h,_=[],S=(w+2)*u[0],O=(v+h)*u[1],k={width:S<0?Math.floor(S):Math.ceil(S),height:O<0?Math.floor(O):Math.ceil(O),contextInstructions:_};if((u[0]!=1||u[1]!=1)&&_.push("scale",u),i){_.push("strokeStyle",s.strokeStyle),_.push("lineWidth",h),_.push("lineCap",s.lineCap),_.push("lineJoin",s.lineJoin),_.push("miterLimit",s.miterLimit);var E=C4?OffscreenCanvasRenderingContext2D:CanvasRenderingContext2D;E.prototype.setLineDash&&(_.push("setLineDash",[s.lineDash]),_.push("lineDashOffset",s.lineDashOffset))}r&&_.push("fillStyle",a.fillStyle),_.push("textBaseline","middle"),_.push("textAlign","center");for(var P=.5-d,A=d*w+P*h,R=[],T=[],M=0,I=0,j=0,N=0,z,L=0,B=p.length;Le?e-c:o,b=s+u>n?n-u:s,w=p[3]+x*d[0]+p[1],_=p[0]+b*d[1]+p[2],S=v-p[3],O=y-p[0];(g||f!==0)&&(cm[0]=S,um[0]=S,cm[1]=O,ip[1]=O,ip[0]=S+w,op[0]=ip[0],op[1]=O+_,um[1]=op[1]);var k;return f!==0?(k=Pg(ch(),r,i,1,1,f,-r,-i),Bi(k,cm),Bi(k,ip),Bi(k,op),Bi(k,um),Bf(Math.min(cm[0],ip[0],op[0],um[0]),Math.min(cm[1],ip[1],op[1],um[1]),Math.max(cm[0],ip[0],op[0],um[0]),Math.max(cm[1],ip[1],op[1],um[1]),B1)):Bf(Math.min(S,S+w),Math.min(O,O+_),Math.max(S,S+w),Math.max(O,O+_),B1),h&&(v=Math.round(v),y=Math.round(y)),{drawImageX:v,drawImageY:y,drawImageW:x,drawImageH:b,originX:c,originY:u,declutterBox:{minX:B1[0],minY:B1[1],maxX:B1[2],maxY:B1[3],value:m},canvasTransform:k,scale:d}},t.prototype.replayImageOrLabel_=function(e,n,r,i,o,s,a){var l=!!(s||a),c=i.declutterBox,u=e.canvas,f=a?a[2]*i.scale[0]/2:0,d=c.minX-f<=u.width/n&&c.maxX+f>=0&&c.minY-f<=u.height/n&&c.maxY+f>=0;return d&&(l&&this.replayTextBackground_(e,cm,ip,op,um,s,a),hgt(e,i.canvasTransform,o,r,i.originX,i.originY,i.drawImageW,i.drawImageH,i.drawImageX,i.drawImageY,i.scale)),!0},t.prototype.fill_=function(e){if(this.alignFill_){var n=Bi(this.renderedTransform_,[0,0]),r=512*this.pixelRatio;e.save(),e.translate(n[0]%r,n[1]%r),e.rotate(this.viewRotation_)}e.fill(),this.alignFill_&&e.restore()},t.prototype.setStrokeStyle_=function(e,n){e.strokeStyle=n[1],e.lineWidth=n[2],e.lineCap=n[3],e.lineJoin=n[4],e.miterLimit=n[5],e.setLineDash&&(e.lineDashOffset=n[7],e.setLineDash(n[6]))},t.prototype.drawLabelWithPointPlacement_=function(e,n,r,i){var o=this.textStates[n],s=this.createLabel(e,n,i,r),a=this.strokeStates[r],l=this.pixelRatio,c=Hhe(Array.isArray(e)?e[0]:e,o.textAlign||mA),u=nk[o.textBaseline||YF],f=a&&a.lineWidth?a.lineWidth:0,d=s.width/l-2*o.scale[0],h=c*d+2*(.5-c)*f,p=u*s.height/l+2*(.5-u)*f;return{label:s,anchorX:h,anchorY:p}},t.prototype.execute_=function(e,n,r,i,o,s,a,l){var c;this.pixelCoordinates_&&Zb(r,this.renderedTransform_)?c=this.pixelCoordinates_:(this.pixelCoordinates_||(this.pixelCoordinates_=[]),c=Dx(this.coordinates,0,this.coordinates.length,2,r,this.pixelCoordinates_),Vht(this.renderedTransform_,r));for(var u=0,f=i.length,d=0,h,p,g,m,v,y,x,b,w,_,S,O,k=0,E=0,P=null,A=null,R=this.coordinateCache_,T=this.viewRotation_,M=Math.round(Math.atan2(-r[1],r[0])*1e12)/1e12,I={context:e,pixelRatio:this.pixelRatio,resolution:this.resolution,rotation:T},j=this.instructions!=i||this.overlaps?0:200,N,z,L,B;uj&&(this.fill_(e),k=0),E>j&&(e.stroke(),E=0),!k&&!E&&(e.beginPath(),m=NaN,v=NaN),++u;break;case Wt.CIRCLE:d=F[1];var q=c[d],G=c[d+1],Y=c[d+2],le=c[d+3],K=Y-q,ee=le-G,re=Math.sqrt(K*K+ee*ee);e.moveTo(q+re,G),e.arc(q,G,re,0,2*Math.PI,!0),++u;break;case Wt.CLOSE_PATH:e.closePath(),++u;break;case Wt.CUSTOM:d=F[1],h=F[2];var ge=F[3],te=F[4],ae=F.length==6?F[5]:void 0;I.geometry=ge,I.feature=N,u in R||(R[u]=[]);var U=R[u];ae?ae(c,d,h,2,U):(U[0]=c[d],U[1]=c[d+1],U.length=2),te(U,I),++u;break;case Wt.DRAW_IMAGE:d=F[1],h=F[2],b=F[3],p=F[4],g=F[5];var oe=F[6],ne=F[7],V=F[8],X=F[9],Z=F[10],he=F[11],xe=F[12],H=F[13],W=F[14],J=F[15];if(!b&&F.length>=20){w=F[19],_=F[20],S=F[21],O=F[22];var se=this.drawLabelWithPointPlacement_(w,_,S,O);b=se.label,F[3]=b;var ye=F[23];p=(se.anchorX-ye)*this.pixelRatio,F[4]=p;var ie=F[24];g=(se.anchorY-ie)*this.pixelRatio,F[5]=g,oe=b.height,F[6]=oe,H=b.width,F[13]=H}var fe=void 0;F.length>25&&(fe=F[25]);var Q=void 0,_e=void 0,we=void 0;F.length>17?(Q=F[16],_e=F[17],we=F[18]):(Q=dx,_e=!1,we=!1),Z&&M?he+=T:!Z&&!M&&(he-=T);for(var Ie=0;d0){if(!s||h!=="Image"&&h!=="Text"||s.indexOf(_)!==-1){var P=(d[k]-3)/4,A=i-P%a,R=i-(P/a|0),T=o(_,S,A*A+R*R);if(T)return T}u.clearRect(0,0,a,a);break}}var g=Object.keys(this.executorsByZIndex_).map(Number);g.sort(ob);var m,v,y,x,b;for(m=g.length-1;m>=0;--m){var w=g[m].toString();for(y=this.executorsByZIndex_[w],v=hW.length-1;v>=0;--v)if(h=hW[v],x=y[h],x!==void 0&&(b=x.executeHitDetection(u,l,r,p,f),b))return b}},t.prototype.getClipCoords=function(e){var n=this.maxExtent_;if(!n)return null;var r=n[0],i=n[1],o=n[2],s=n[3],a=[r,i,r,s,o,s,o,i];return Dx(a,0,8,2,e,a),a},t.prototype.isEmpty=function(){return ES(this.executorsByZIndex_)},t.prototype.execute=function(e,n,r,i,o,s,a){var l=Object.keys(this.executorsByZIndex_).map(Number);l.sort(ob),this.maxExtent_&&(e.save(),this.clip(e,r));var c=s||hW,u,f,d,h,p,g;for(a&&l.reverse(),u=0,f=l.length;un)break;var a=r[s];a||(a=[],r[s]=a),a.push(((t+i)*e+(t+o))*4+3),i>0&&a.push(((t-i)*e+(t+o))*4+3),o>0&&(a.push(((t+i)*e+(t-o))*4+3),i>0&&a.push(((t-i)*e+(t-o))*4+3))}for(var l=[],i=0,c=r.length;ithis.maxCacheSize_},t.prototype.expire=function(){if(this.canExpireCache()){var e=0;for(var n in this.cache_){var r=this.cache_[n];!(e++&3)&&!r.hasListener()&&(delete this.cache_[n],--this.cacheSize_)}}},t.prototype.get=function(e,n,r){var i=Xhe(e,n,r);return i in this.cache_?this.cache_[i]:null},t.prototype.set=function(e,n,r,i){var o=Xhe(e,n,r);this.cache_[o]=i,++this.cacheSize_},t.prototype.setSize=function(e){this.maxCacheSize_=e,this.expire()},t}();function Xhe(t,e,n){var r=n?DMe(n):"null";return e+":"+t+":"+r}var ZF=new emt,tmt=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),nmt=function(t){tmt(e,t);function e(n,r,i,o){var s=t.call(this)||this;return s.extent=n,s.pixelRatio_=i,s.resolution=r,s.state=o,s}return e.prototype.changed=function(){this.dispatchEvent(nn.CHANGE)},e.prototype.getExtent=function(){return this.extent},e.prototype.getImage=function(){return $t()},e.prototype.getPixelRatio=function(){return this.pixelRatio_},e.prototype.getResolution=function(){return this.resolution},e.prototype.getState=function(){return this.state},e.prototype.load=function(){$t()},e}(KC),rmt=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}();(function(t){rmt(e,t);function e(n,r,i,o,s,a){var l=t.call(this,n,r,i,zr.IDLE)||this;return l.src_=o,l.image_=new Image,s!==null&&(l.image_.crossOrigin=s),l.unlisten_=null,l.state=zr.IDLE,l.imageLoadFunction_=a,l}return e.prototype.getImage=function(){return this.image_},e.prototype.handleImageError_=function(){this.state=zr.ERROR,this.unlistenImage_(),this.changed()},e.prototype.handleImageLoad_=function(){this.resolution===void 0&&(this.resolution=Ou(this.extent)/this.image_.height),this.state=zr.LOADED,this.unlistenImage_(),this.changed()},e.prototype.load=function(){(this.state==zr.IDLE||this.state==zr.ERROR)&&(this.state=zr.LOADING,this.changed(),this.imageLoadFunction_(this,this.src_),this.unlisten_=Ote(this.image_,this.handleImageLoad_.bind(this),this.handleImageError_.bind(this)))},e.prototype.setImage=function(n){this.image_=n,this.resolution=Ou(this.extent)/this.image_.height},e.prototype.unlistenImage_=function(){this.unlisten_&&(this.unlisten_(),this.unlisten_=null)},e})(nmt);function Ote(t,e,n){var r=t,i=!0,o=!1,s=!1,a=[UF(r,nn.LOAD,function(){s=!0,o||e()})];return r.src&&Uht?(o=!0,r.decode().then(function(){i&&e()}).catch(function(l){i&&(s?e():n())})):a.push(UF(r,nn.ERROR,n)),function(){i=!1,a.forEach(oi)}}var imt=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),LE=null,omt=function(t){imt(e,t);function e(n,r,i,o,s,a){var l=t.call(this)||this;return l.hitDetectionImage_=null,l.image_=n||new Image,o!==null&&(l.image_.crossOrigin=o),l.canvas_={},l.color_=a,l.unlisten_=null,l.imageState_=s,l.size_=i,l.src_=r,l.tainted_,l}return e.prototype.isTainted_=function(){if(this.tainted_===void 0&&this.imageState_===zr.LOADED){LE||(LE=Sc(1,1)),LE.drawImage(this.image_,0,0);try{LE.getImageData(0,0,1,1),this.tainted_=!1}catch{LE=null,this.tainted_=!0}}return this.tainted_===!0},e.prototype.dispatchChangeEvent_=function(){this.dispatchEvent(nn.CHANGE)},e.prototype.handleImageError_=function(){this.imageState_=zr.ERROR,this.unlistenImage_(),this.dispatchChangeEvent_()},e.prototype.handleImageLoad_=function(){this.imageState_=zr.LOADED,this.size_?(this.image_.width=this.size_[0],this.image_.height=this.size_[1]):this.size_=[this.image_.width,this.image_.height],this.unlistenImage_(),this.dispatchChangeEvent_()},e.prototype.getImage=function(n){return this.replaceColor_(n),this.canvas_[n]?this.canvas_[n]:this.image_},e.prototype.getPixelRatio=function(n){return this.replaceColor_(n),this.canvas_[n]?n:1},e.prototype.getImageState=function(){return this.imageState_},e.prototype.getHitDetectionImage=function(){if(!this.hitDetectionImage_)if(this.isTainted_()){var n=this.size_[0],r=this.size_[1],i=Sc(n,r);i.fillRect(0,0,n,r),this.hitDetectionImage_=i.canvas}else this.hitDetectionImage_=this.image_;return this.hitDetectionImage_},e.prototype.getSize=function(){return this.size_},e.prototype.getSrc=function(){return this.src_},e.prototype.load=function(){if(this.imageState_==zr.IDLE){this.imageState_=zr.LOADING;try{this.image_.src=this.src_}catch{this.handleImageError_()}this.unlisten_=Ote(this.image_,this.handleImageLoad_.bind(this),this.handleImageError_.bind(this))}},e.prototype.replaceColor_=function(n){if(!(!this.color_||this.canvas_[n]||this.imageState_!==zr.LOADED)){var r=document.createElement("canvas");this.canvas_[n]=r,r.width=Math.ceil(this.image_.width*n),r.height=Math.ceil(this.image_.height*n);var i=r.getContext("2d");if(i.scale(n,n),i.drawImage(this.image_,0,0),i.globalCompositeOperation="multiply",i.globalCompositeOperation==="multiply"||this.isTainted_())i.fillStyle=DMe(this.color_),i.fillRect(0,0,r.width/n,r.height/n),i.globalCompositeOperation="destination-in",i.drawImage(this.image_,0,0);else{for(var o=i.getImageData(0,0,r.width,r.height),s=o.data,a=this.color_[0]/255,l=this.color_[1]/255,c=this.color_[2]/255,u=this.color_[3],f=0,d=s.length;f0,6);var f=i.src!==void 0?zr.IDLE:zr.LOADED;return r.color_=i.color!==void 0?qF(i.color):null,r.iconImage_=smt(c,u,r.imgSize_!==void 0?r.imgSize_:null,r.crossOrigin_,f,r.color_),r.offset_=i.offset!==void 0?i.offset:[0,0],r.offsetOrigin_=i.offsetOrigin!==void 0?i.offsetOrigin:Lc.TOP_LEFT,r.origin_=null,r.size_=i.size!==void 0?i.size:null,r}return e.prototype.clone=function(){var n=this.getScale();return new e({anchor:this.anchor_.slice(),anchorOrigin:this.anchorOrigin_,anchorXUnits:this.anchorXUnits_,anchorYUnits:this.anchorYUnits_,color:this.color_&&this.color_.slice?this.color_.slice():this.color_||void 0,crossOrigin:this.crossOrigin_,imgSize:this.imgSize_,offset:this.offset_.slice(),offsetOrigin:this.offsetOrigin_,opacity:this.getOpacity(),rotateWithView:this.getRotateWithView(),rotation:this.getRotation(),scale:Array.isArray(n)?n.slice():n,size:this.size_!==null?this.size_.slice():void 0,src:this.getSrc(),displacement:this.getDisplacement().slice(),declutterMode:this.getDeclutterMode()})},e.prototype.getAnchor=function(){var n=this.normalizedAnchor_;if(!n){n=this.anchor_;var r=this.getSize();if(this.anchorXUnits_==Wm.FRACTION||this.anchorYUnits_==Wm.FRACTION){if(!r)return null;n=this.anchor_.slice(),this.anchorXUnits_==Wm.FRACTION&&(n[0]*=r[0]),this.anchorYUnits_==Wm.FRACTION&&(n[1]*=r[1])}if(this.anchorOrigin_!=Lc.TOP_LEFT){if(!r)return null;n===this.anchor_&&(n=this.anchor_.slice()),(this.anchorOrigin_==Lc.TOP_RIGHT||this.anchorOrigin_==Lc.BOTTOM_RIGHT)&&(n[0]=-n[0]+r[0]),(this.anchorOrigin_==Lc.BOTTOM_LEFT||this.anchorOrigin_==Lc.BOTTOM_RIGHT)&&(n[1]=-n[1]+r[1])}this.normalizedAnchor_=n}var i=this.getDisplacement();return[n[0]-i[0],n[1]+i[1]]},e.prototype.setAnchor=function(n){this.anchor_=n,this.normalizedAnchor_=null},e.prototype.getColor=function(){return this.color_},e.prototype.getImage=function(n){return this.iconImage_.getImage(n)},e.prototype.getPixelRatio=function(n){return this.iconImage_.getPixelRatio(n)},e.prototype.getImageSize=function(){return this.iconImage_.getSize()},e.prototype.getImageState=function(){return this.iconImage_.getImageState()},e.prototype.getHitDetectionImage=function(){return this.iconImage_.getHitDetectionImage()},e.prototype.getOrigin=function(){if(this.origin_)return this.origin_;var n=this.offset_;if(this.offsetOrigin_!=Lc.TOP_LEFT){var r=this.getSize(),i=this.iconImage_.getSize();if(!r||!i)return null;n=n.slice(),(this.offsetOrigin_==Lc.TOP_RIGHT||this.offsetOrigin_==Lc.BOTTOM_RIGHT)&&(n[0]=i[0]-r[0]-n[0]),(this.offsetOrigin_==Lc.BOTTOM_LEFT||this.offsetOrigin_==Lc.BOTTOM_RIGHT)&&(n[1]=i[1]-r[1]-n[1])}return this.origin_=n,this.origin_},e.prototype.getSrc=function(){return this.iconImage_.getSrc()},e.prototype.getSize=function(){return this.size_?this.size_:this.iconImage_.getSize()},e.prototype.listenImageChange=function(n){this.iconImage_.addEventListener(nn.CHANGE,n)},e.prototype.load=function(){this.iconImage_.load()},e.prototype.unlistenImageChange=function(n){this.iconImage_.removeEventListener(nn.CHANGE,n)},e}(RMe),Fd=.5;function cmt(t,e,n,r,i,o,s){var a=t[0]*Fd,l=t[1]*Fd,c=Sc(a,l);c.imageSmoothingEnabled=!1;for(var u=c.canvas,f=new Jgt(c,Fd,i,null,s),d=n.length,h=Math.floor((256*256*256-1)/d),p={},g=1;g<=d;++g){var m=n[g-1],v=m.getStyleFunction()||r;if(r){var y=v(m,o);if(y){Array.isArray(y)||(y=[y]);for(var x=g*h,b="#"+("000000"+x.toString(16)).slice(-6),w=0,_=y.length;w<_;++w){var S=y[w],O=S.getGeometryFunction()(m);if(!(!O||!ga(i,O.getExtent()))){var k=S.clone(),E=k.getFill();E&&E.setColor(b);var P=k.getStroke();P&&(P.setColor(b),P.setLineDash(null)),k.setText(void 0);var A=S.getImage();if(A&&A.getOpacity()!==0){var R=A.getImageSize();if(!R)continue;var T=Sc(R[0],R[1],void 0,{alpha:!1}),M=T.canvas;T.fillStyle=b,T.fillRect(0,0,M.width,M.height),k.setImage(new lmt({img:M,imgSize:R,anchor:A.getAnchor(),anchorXUnits:Wm.PIXELS,anchorYUnits:Wm.PIXELS,offset:A.getOrigin(),opacity:1,size:A.getSize(),scale:A.getScale(),rotation:A.getRotation(),rotateWithView:A.getRotateWithView()}))}var I=k.getZIndex()||0,j=p[I];j||(j={},p[I]=j,j.Polygon=[],j.Circle=[],j.LineString=[],j.Point=[]),j[O.getType().replace("Multi","")].push(O,k)}}}}}for(var N=Object.keys(p).map(Number).sort(ob),g=0,z=N.length;gg[2];)++y,x=v*y,f.push(this.getRenderTransform(o,s,a,Fd,d,h,x).slice()),m-=v}this.hitDetectionImageData_=cmt(i,f,this.renderedFeatures_,u.getStyleFunction(),c,s,a)}r(umt(n,this.renderedFeatures_,this.hitDetectionImageData_))}).bind(this))},e.prototype.forEachFeatureAtCoordinate=function(n,r,i,o,s){var a=this;if(this.replayGroup_){var l=r.viewState.resolution,c=r.viewState.rotation,u=this.getLayer(),f={},d=function(g,m,v){var y=or(g),x=f[y];if(x){if(x!==!0&&vw[0]&&O[2]>w[2]&&b.push([O[0]-_,O[1],O[2]-_,O[3]])}if(this.ready&&this.renderedResolution_==d&&this.renderedRevision_==p&&this.renderedRenderOrder_==m&&n_(this.wrappedRenderedExtent_,y))return Zb(this.renderedExtent_,x)||(this.hitDetectionImageData_=null,this.renderedExtent_=x),this.renderedCenter_=v,this.replayGroupChanged=!1,!0;this.replayGroup_=null;var k=new Whe(Aq(d,h),y,d,h),E;this.getLayer().getDeclutter()&&(E=new Whe(Aq(d,h),y,d,h));for(var P,A,R,A=0,R=b.length;A=200&&a.status<300){var c=e.getType(),u=void 0;c=="json"||c=="text"?u=a.responseText:c=="xml"?(u=a.responseXML,u||(u=new DOMParser().parseFromString(a.responseText,"application/xml"))):c=="arraybuffer"&&(u=a.response),u?o(e.readFeatures(u,{extent:n,featureProjection:i}),e.readProjection(u)):s()}else s()},a.onerror=s,a.send()}function Zhe(t,e){return function(n,r,i,o,s){var a=this;Amt(t,e,n,r,i,function(l,c){a.addFeatures(l),o!==void 0&&o(l)},s||sb)}}var XMe=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),fm=function(t){XMe(e,t);function e(n,r,i){var o=t.call(this,n)||this;return o.feature=r,o.features=i,o}return e}(Lh),WM=function(t){XMe(e,t);function e(n){var r=this,i=n||{};r=t.call(this,{attributions:i.attributions,interpolate:!0,projection:void 0,state:"ready",wrapX:i.wrapX!==void 0?i.wrapX:!0})||this,r.on,r.once,r.un,r.loader_=sb,r.format_=i.format,r.overlaps_=i.overlaps===void 0?!0:i.overlaps,r.url_=i.url,i.loader!==void 0?r.loader_=i.loader:r.url_!==void 0&&(bn(r.format_,7),r.loader_=Zhe(r.url_,r.format_)),r.strategy_=i.strategy!==void 0?i.strategy:Tmt;var o=i.useSpatialIndex!==void 0?i.useSpatialIndex:!0;r.featuresRtree_=o?new Qhe:null,r.loadedExtentsRtree_=new Qhe,r.loadingExtentsCount_=0,r.nullGeometryFeatures_={},r.idIndex_={},r.uidIndex_={},r.featureChangeKeys_={},r.featuresCollection_=null;var s,a;return Array.isArray(i.features)?a=i.features:i.features&&(s=i.features,a=s.getArray()),!o&&s===void 0&&(s=new ru(a)),a!==void 0&&r.addFeaturesInternal(a),s!==void 0&&r.bindFeaturesCollection_(s),r}return e.prototype.addFeature=function(n){this.addFeatureInternal(n),this.changed()},e.prototype.addFeatureInternal=function(n){var r=or(n);if(!this.addToIndex_(r,n)){this.featuresCollection_&&this.featuresCollection_.remove(n);return}this.setupChangeEvents_(r,n);var i=n.getGeometry();if(i){var o=i.getExtent();this.featuresRtree_&&this.featuresRtree_.insert(o,n)}else this.nullGeometryFeatures_[r]=n;this.dispatchEvent(new fm(qu.ADDFEATURE,n))},e.prototype.setupChangeEvents_=function(n,r){this.featureChangeKeys_[n]=[zn(r,nn.CHANGE,this.handleFeatureChange_,this),zn(r,OS.PROPERTYCHANGE,this.handleFeatureChange_,this)]},e.prototype.addToIndex_=function(n,r){var i=!0,o=r.getId();return o!==void 0&&(o.toString()in this.idIndex_?i=!1:this.idIndex_[o.toString()]=r),i&&(bn(!(n in this.uidIndex_),30),this.uidIndex_[n]=r),i},e.prototype.addFeatures=function(n){this.addFeaturesInternal(n),this.changed()},e.prototype.addFeaturesInternal=function(n){for(var r=[],i=[],o=[],s=0,a=n.length;s0},e.prototype.refresh=function(){this.clear(!0),this.loadedExtentsRtree_.clear(),t.prototype.refresh.call(this)},e.prototype.removeLoadedExtent=function(n){var r=this.loadedExtentsRtree_,i;r.forEachInExtent(n,function(o){if(cA(o.extent,n))return i=o,!0}),i&&r.remove(i)},e.prototype.removeFeature=function(n){if(n){var r=or(n);r in this.nullGeometryFeatures_?delete this.nullGeometryFeatures_[r]:this.featuresRtree_&&this.featuresRtree_.remove(n);var i=this.removeFeatureInternal(n);i&&this.changed()}},e.prototype.removeFeatureInternal=function(n){var r=or(n),i=this.featureChangeKeys_[r];if(i){i.forEach(oi),delete this.featureChangeKeys_[r];var o=n.getId();return o!==void 0&&delete this.idIndex_[o.toString()],delete this.uidIndex_[r],this.dispatchEvent(new fm(qu.REMOVEFEATURE,n)),n}},e.prototype.removeFromIdIndex_=function(n){var r=!1;for(var i in this.idIndex_)if(this.idIndex_[i]===n){delete this.idIndex_[i],r=!0;break}return r},e.prototype.setLoader=function(n){this.loader_=n},e.prototype.setUrl=function(n){bn(this.format_,7),this.url_=n,this.setLoader(Zhe(n,this.format_))},e}(qMe);function dm(t,e){return Bi(t.inversePixelTransform,e.slice(0))}const Xt={IDLE:0,LOADING:1,LOADED:2,ERROR:3,EMPTY:4};function YMe(t){return Math.pow(t,3)}function ZC(t){return 1-YMe(1-t)}function Pmt(t){return 3*t*t-2*t*t*t}function Mmt(t){return t}var Rmt=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),QMe=function(t){Rmt(e,t);function e(n,r,i){var o=t.call(this)||this,s=i||{};return o.tileCoord=n,o.state=r,o.interimTile=null,o.key="",o.transition_=s.transition===void 0?250:s.transition,o.transitionStarts_={},o.interpolate=!!s.interpolate,o}return e.prototype.changed=function(){this.dispatchEvent(nn.CHANGE)},e.prototype.release=function(){},e.prototype.getKey=function(){return this.key+"/"+this.tileCoord},e.prototype.getInterimTile=function(){if(!this.interimTile)return this;var n=this.interimTile;do{if(n.getState()==Xt.LOADED)return this.transition_=0,n;n=n.interimTile}while(n);return this},e.prototype.refreshInterimChain=function(){if(this.interimTile){var n=this.interimTile,r=this;do{if(n.getState()==Xt.LOADED){n.interimTile=null;break}else n.getState()==Xt.LOADING?r=n:n.getState()==Xt.IDLE?r.interimTile=n.interimTile:r=n;n=r.interimTile}while(n)}},e.prototype.getTileCoord=function(){return this.tileCoord},e.prototype.getState=function(){return this.state},e.prototype.setState=function(n){if(this.state!==Xt.ERROR&&this.state>n)throw new Error("Tile load sequence violation");this.state=n,this.changed()},e.prototype.load=function(){$t()},e.prototype.getAlpha=function(n,r){if(!this.transition_)return 1;var i=this.transitionStarts_[n];if(!i)i=r,this.transitionStarts_[n]=i;else if(i===-1)return 1;var o=r-i+1e3/60;return o>=this.transition_?1:YMe(o/this.transition_)},e.prototype.inTransition=function(n){return this.transition_?this.transitionStarts_[n]!==-1:!1},e.prototype.endTransition=function(n){this.transition_&&(this.transitionStarts_[n]=-1)},e}(KC),Dmt=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),Ete=function(t){Dmt(e,t);function e(n,r,i,o,s,a){var l=t.call(this,n,r,a)||this;return l.crossOrigin_=o,l.src_=i,l.key=i,l.image_=new Image,o!==null&&(l.image_.crossOrigin=o),l.unlisten_=null,l.tileLoadFunction_=s,l}return e.prototype.getImage=function(){return this.image_},e.prototype.setImage=function(n){this.image_=n,this.state=Xt.LOADED,this.unlistenImage_(),this.changed()},e.prototype.handleImageError_=function(){this.state=Xt.ERROR,this.unlistenImage_(),this.image_=Imt(),this.changed()},e.prototype.handleImageLoad_=function(){var n=this.image_;n.naturalWidth&&n.naturalHeight?this.state=Xt.LOADED:this.state=Xt.EMPTY,this.unlistenImage_(),this.changed()},e.prototype.load=function(){this.state==Xt.ERROR&&(this.state=Xt.IDLE,this.image_=new Image,this.crossOrigin_!==null&&(this.image_.crossOrigin=this.crossOrigin_)),this.state==Xt.IDLE&&(this.state=Xt.LOADING,this.changed(),this.tileLoadFunction_(this,this.src_),this.unlisten_=Ote(this.image_,this.handleImageLoad_.bind(this),this.handleImageError_.bind(this)))},e.prototype.unlistenImage_=function(){this.unlisten_&&(this.unlisten_(),this.unlisten_=null)},e}(QMe);function Imt(){var t=Sc(1,1);return t.fillStyle="rgba(0,0,0,0)",t.fillRect(0,0,1,1),t.canvas}var Lmt=function(){function t(e,n,r){this.decay_=e,this.minVelocity_=n,this.delay_=r,this.points_=[],this.angle_=0,this.initialVelocity_=0}return t.prototype.begin=function(){this.points_.length=0,this.angle_=0,this.initialVelocity_=0},t.prototype.update=function(e,n){this.points_.push(e,n,Date.now())},t.prototype.end=function(){if(this.points_.length<6)return!1;var e=Date.now()-this.delay_,n=this.points_.length-3;if(this.points_[n+2]0&&this.points_[r+2]>e;)r-=3;var i=this.points_[n+2]-this.points_[r+2];if(i<1e3/60)return!1;var o=this.points_[n]-this.points_[r],s=this.points_[n+1]-this.points_[r+1];return this.angle_=Math.atan2(s,o),this.initialVelocity_=Math.sqrt(o*o+s*s)/i,this.initialVelocity_>this.minVelocity_},t.prototype.getDistance=function(){return(this.minVelocity_-this.initialVelocity_)/this.decay_},t.prototype.getAngle=function(){return this.angle_},t}(),$mt=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),Fmt=function(t){$mt(e,t);function e(n){var r=t.call(this)||this;return r.map_=n,r}return e.prototype.dispatchRenderEvent=function(n,r){$t()},e.prototype.calculateMatrices2D=function(n){var r=n.viewState,i=n.coordinateToPixelTransform,o=n.pixelToCoordinateTransform;Pg(i,n.size[0]/2,n.size[1]/2,1/r.resolution,-1/r.resolution,-r.rotation,-r.center[0],-r.center[1]),ote(o,i)},e.prototype.forEachFeatureAtCoordinate=function(n,r,i,o,s,a,l,c){var u,f=r.viewState;function d(M,I,j,N){return s.call(a,I,M?j:null,N)}var h=f.projection,p=hMe(n.slice(),h),g=[[0,0]];if(h.canWrapX()&&o){var m=h.getExtent(),v=Kr(m);g.push([-v,0],[v,0])}for(var y=r.layerStatesArray,x=y.length,b=[],w=[],_=0;_=0;--S){var O=y[S],k=O.layer;if(k.hasRenderer()&&KF(O,f)&&l.call(c,k)){var E=k.getRenderer(),P=k.getSource();if(E&&P){var A=P.getWrapX()?p:n,R=d.bind(null,O.managed);w[0]=A[0]+g[_][0],w[1]=A[1]+g[_][1],u=E.forEachFeatureAtCoordinate(w,r,i,R,b)}if(u)return u}}if(b.length!==0){var T=1/b.length;return b.forEach(function(M,I){return M.distanceSq+=I*T}),b.sort(function(M,I){return M.distanceSq-I.distanceSq}),b.some(function(M){return u=M.callback(M.feature,M.layer,M.geometry)}),u}},e.prototype.forEachLayerAtPixel=function(n,r,i,o,s){return $t()},e.prototype.hasFeatureAtCoordinate=function(n,r,i,o,s,a){var l=this.forEachFeatureAtCoordinate(n,r,i,o,Mx,this,s,a);return l!==void 0},e.prototype.getMap=function(){return this.map_},e.prototype.renderFrame=function(n){$t()},e.prototype.scheduleExpireIconCache=function(n){ZF.canExpireCache()&&n.postRenderFunctions.push(Nmt)},e}(rte);function Nmt(t,e){ZF.expire()}var zmt=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),jmt=function(t){zmt(e,t);function e(n){var r=t.call(this,n)||this;r.fontChangeListenerKey_=zn(xp,OS.PROPERTYCHANGE,n.redrawText.bind(n)),r.element_=document.createElement("div");var i=r.element_.style;i.position="absolute",i.width="100%",i.height="100%",i.zIndex="0",r.element_.className=jM+" ol-layers";var o=n.getViewport();return o.insertBefore(r.element_,o.firstChild||null),r.children_=[],r.renderedVisible_=!0,r}return e.prototype.dispatchRenderEvent=function(n,r){var i=this.getMap();if(i.hasListener(n)){var o=new WMe(n,void 0,r);i.dispatchEvent(o)}},e.prototype.disposeInternal=function(){oi(this.fontChangeListenerKey_),this.element_.parentNode.removeChild(this.element_),t.prototype.disposeInternal.call(this)},e.prototype.renderFrame=function(n){if(!n){this.renderedVisible_&&(this.element_.style.display="none",this.renderedVisible_=!1);return}this.calculateMatrices2D(n),this.dispatchRenderEvent($v.PRECOMPOSE,n);var r=n.layerStatesArray.sort(function(h,p){return h.zIndex-p.zIndex}),i=n.viewState;this.children_.length=0;for(var o=[],s=null,a=0,l=r.length;a=0;--a)o[a].renderDeclutter(n);agt(this.element_,this.children_),this.dispatchRenderEvent($v.POSTCOMPOSE,n),this.renderedVisible_||(this.element_.style.display="",this.renderedVisible_=!0),this.scheduleExpireIconCache(n)},e.prototype.forEachLayerAtPixel=function(n,r,i,o,s){for(var a=r.viewState,l=r.layerStatesArray,c=l.length,u=c-1;u>=0;--u){var f=l[u],d=f.layer;if(d.hasRenderer()&&KF(f,a)&&s(d)){var h=d.getRenderer(),p=h.getDataAtPixel(n,r,i);if(p){var g=o(d,p);if(g)return g}}}},e}(Fmt),KMe=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),Vm=function(t){KMe(e,t);function e(n,r){var i=t.call(this,n)||this;return i.layer=r,i}return e}(Lh),gW={LAYERS:"layers"},P4=function(t){KMe(e,t);function e(n){var r=this,i=n||{},o=hi({},i);delete o.layers;var s=i.layers;return r=t.call(this,o)||this,r.on,r.once,r.un,r.layersListenerKeys_=[],r.listenerKeys_={},r.addChangeListener(gW.LAYERS,r.handleLayersChanged_),s?Array.isArray(s)?s=new ru(s.slice(),{unique:!0}):bn(typeof s.getArray=="function",43):s=new ru(void 0,{unique:!0}),r.setLayers(s),r}return e.prototype.handleLayerChange_=function(){this.changed()},e.prototype.handleLayersChanged_=function(){this.layersListenerKeys_.forEach(oi),this.layersListenerKeys_.length=0;var n=this.getLayers();this.layersListenerKeys_.push(zn(n,Xa.ADD,this.handleLayersAdd_,this),zn(n,Xa.REMOVE,this.handleLayersRemove_,this));for(var r in this.listenerKeys_)this.listenerKeys_[r].forEach(oi);LM(this.listenerKeys_);for(var i=n.getArray(),o=0,s=i.length;othis.moveTolerance_||Math.abs(n.clientY-this.down_.clientY)>this.moveTolerance_},e.prototype.disposeInternal=function(){this.relayedListenerKey_&&(oi(this.relayedListenerKey_),this.relayedListenerKey_=null),this.element_.removeEventListener(nn.TOUCHMOVE,this.boundHandleTouchMove_),this.pointerdownListenerKey_&&(oi(this.pointerdownListenerKey_),this.pointerdownListenerKey_=null),this.dragListenerKeys_.forEach(oi),this.dragListenerKeys_.length=0,this.element_=null,t.prototype.disposeInternal.call(this)},e}(KC);const Am={POSTRENDER:"postrender",MOVESTART:"movestart",MOVEEND:"moveend",LOADSTART:"loadstart",LOADEND:"loadend"},Ls={LAYERGROUP:"layergroup",SIZE:"size",TARGET:"target",VIEW:"view"};var JF=1/0,Gmt=function(){function t(e,n){this.priorityFunction_=e,this.keyFunction_=n,this.elements_=[],this.priorities_=[],this.queuedElements_={}}return t.prototype.clear=function(){this.elements_.length=0,this.priorities_.length=0,LM(this.queuedElements_)},t.prototype.dequeue=function(){var e=this.elements_,n=this.priorities_,r=e[0];e.length==1?(e.length=0,n.length=0):(e[0]=e.pop(),n[0]=n.pop(),this.siftUp_(0));var i=this.keyFunction_(r);return delete this.queuedElements_[i],r},t.prototype.enqueue=function(e){bn(!(this.keyFunction_(e)in this.queuedElements_),31);var n=this.priorityFunction_(e);return n!=JF?(this.elements_.push(e),this.priorities_.push(n),this.queuedElements_[this.keyFunction_(e)]=!0,this.siftDown_(0,this.elements_.length-1),!0):!1},t.prototype.getCount=function(){return this.elements_.length},t.prototype.getLeftChildIndex_=function(e){return e*2+1},t.prototype.getRightChildIndex_=function(e){return e*2+2},t.prototype.getParentIndex_=function(e){return e-1>>1},t.prototype.heapify_=function(){var e;for(e=(this.elements_.length>>1)-1;e>=0;e--)this.siftUp_(e)},t.prototype.isEmpty=function(){return this.elements_.length===0},t.prototype.isKeyQueued=function(e){return e in this.queuedElements_},t.prototype.isQueued=function(e){return this.isKeyQueued(this.keyFunction_(e))},t.prototype.siftUp_=function(e){for(var n=this.elements_,r=this.priorities_,i=n.length,o=n[e],s=r[e],a=e;e>1;){var l=this.getLeftChildIndex_(e),c=this.getRightChildIndex_(e),u=ce;){var a=this.getParentIndex_(n);if(i[a]>s)r[n]=r[a],i[n]=i[a],n=a;else break}r[n]=o,i[n]=s},t.prototype.reprioritize=function(){var e=this.priorityFunction_,n=this.elements_,r=this.priorities_,i=0,o=n.length,s,a,l;for(a=0;a0;)s=this.dequeue()[0],a=s.getKey(),o=s.getState(),o===Xt.IDLE&&!(a in this.tilesLoadingKeys_)&&(this.tilesLoadingKeys_[a]=!0,++this.tilesLoading_,++i,s.load())},e}(Gmt);function Xmt(t,e,n,r,i){if(!t||!(n in t.wantedTiles)||!t.wantedTiles[n][e.getKey()])return JF;var o=t.viewState.center,s=r[0]-o[0],a=r[1]-o[1];return 65536*Math.log(i)+Math.sqrt(s*s+a*a)/i}const Xu={CENTER:"center",RESOLUTION:"resolution",ROTATION:"rotation"};var Ymt=42,Tte=256;function Jhe(t,e,n){return function(r,i,o,s,a){if(r){if(!i&&!e)return r;var l=e?0:o[0]*i,c=e?0:o[1]*i,u=a?a[0]:0,f=a?a[1]:0,d=t[0]+l/2+u,h=t[2]-l/2+u,p=t[1]+c/2+f,g=t[3]-c/2+f;d>h&&(d=(h+d)/2,h=d),p>g&&(p=(g+p)/2,g=p);var m=oo(r[0],d,h),v=oo(r[1],p,g);if(s&&n&&i){var y=30*i;m+=-y*Math.log(1+Math.max(0,d-r[0])/y)+y*Math.log(1+Math.max(0,r[0]-h)/y),v+=-y*Math.log(1+Math.max(0,p-r[1])/y)+y*Math.log(1+Math.max(0,r[1]-g)/y)}return[m,v]}}}function Qmt(t){return t}function kte(t,e,n,r){var i=Kr(e)/n[0],o=Ou(e)/n[1];return r?Math.min(t,Math.max(i,o)):Math.min(t,Math.min(i,o))}function Ate(t,e,n){var r=Math.min(t,e),i=50;return r*=Math.log(1+i*Math.max(0,t/e-1))/i+1,n&&(r=Math.max(r,n),r/=Math.log(1+i*Math.max(0,n/t-1))/i+1),oo(r,n/2,e*2)}function Kmt(t,e,n,r){return function(i,o,s,a){if(i!==void 0){var l=t[0],c=t[t.length-1],u=n?kte(l,n,s,r):l;if(a){var f=e!==void 0?e:!0;return f?Ate(i,u,c):oo(i,c,u)}var d=Math.min(u,i),h=Math.floor(ite(t,d,o));return t[h]>u&&h1&&typeof arguments[r-1]=="function"&&(i=arguments[r-1],--r);for(var o=0;o0},e.prototype.getInteracting=function(){return this.hints_[js.INTERACTING]>0},e.prototype.cancelAnimations=function(){this.setHint(js.ANIMATING,-this.hints_[js.ANIMATING]);for(var n,r=0,i=this.animations_.length;r=0;--i){for(var o=this.animations_[i],s=!0,a=0,l=o.length;a0?u/c.duration:1;f>=1?(c.complete=!0,f=1):s=!1;var d=c.easing(f);if(c.sourceCenter){var h=c.sourceCenter[0],p=c.sourceCenter[1],g=c.targetCenter[0],m=c.targetCenter[1];this.nextCenter_=c.targetCenter;var v=h+d*(g-h),y=p+d*(m-p);this.targetCenter_=[v,y]}if(c.sourceResolution&&c.targetResolution){var x=d===1?c.targetResolution:c.sourceResolution+d*(c.targetResolution-c.sourceResolution);if(c.anchor){var b=this.getViewportSize_(this.getRotation()),w=this.constraints_.resolution(x,0,b,!0);this.targetCenter_=this.calculateCenterZoom(w,c.anchor)}this.nextResolution_=c.targetResolution,this.targetResolution_=x,this.applyTargetState_(!0)}if(c.sourceRotation!==void 0&&c.targetRotation!==void 0){var _=d===1?Lv(c.targetRotation+Math.PI,2*Math.PI)-Math.PI:c.sourceRotation+d*(c.targetRotation-c.sourceRotation);if(c.anchor){var S=this.constraints_.rotation(_,!0);this.targetCenter_=this.calculateCenterRotate(S,c.anchor)}this.nextRotation_=c.targetRotation,this.targetRotation_=_}if(this.applyTargetState_(!0),r=!0,!c.complete)break}}if(s){this.animations_[i]=null,this.setHint(js.ANIMATING,-1),this.nextCenter_=null,this.nextResolution_=NaN,this.nextRotation_=NaN;var O=o[0].callback;O&&gI(O,!0)}}this.animations_=this.animations_.filter(Boolean),r&&this.updateAnimationKey_===void 0&&(this.updateAnimationKey_=requestAnimationFrame(this.updateAnimations_.bind(this)))}},e.prototype.calculateCenterRotate=function(n,r){var i,o=this.getCenterInternal();return o!==void 0&&(i=[o[0]-r[0],o[1]-r[1]],dte(i,n-this.getRotation()),vpt(i,r)),i},e.prototype.calculateCenterZoom=function(n,r){var i,o=this.getCenterInternal(),s=this.getResolution();if(o!==void 0&&s!==void 0){var a=r[0]-n*(r[0]-o[0])/s,l=r[1]-n*(r[1]-o[1])/s;i=[a,l]}return i},e.prototype.getViewportSize_=function(n){var r=this.viewportSize_;if(n){var i=r[0],o=r[1];return[Math.abs(i*Math.cos(n))+Math.abs(o*Math.sin(n)),Math.abs(i*Math.sin(n))+Math.abs(o*Math.cos(n))]}else return r},e.prototype.setViewportSize=function(n){this.viewportSize_=Array.isArray(n)?n.slice():[100,100],this.getAnimating()||this.resolveConstraints(0)},e.prototype.getCenter=function(){var n=this.getCenterInternal();return n&&bq(n,this.getProjection())},e.prototype.getCenterInternal=function(){return this.get(Xu.CENTER)},e.prototype.getConstraints=function(){return this.constraints_},e.prototype.getConstrainResolution=function(){return this.get("constrainResolution")},e.prototype.getHints=function(n){return n!==void 0?(n[0]=this.hints_[0],n[1]=this.hints_[1],n):this.hints_.slice()},e.prototype.calculateExtent=function(n){var r=this.calculateExtentInternal(n);return mMe(r,this.getProjection())},e.prototype.calculateExtentInternal=function(n){var r=n||this.getViewportSizeMinusPadding_(),i=this.getCenterInternal();bn(i,1);var o=this.getResolution();bn(o!==void 0,2);var s=this.getRotation();return bn(s!==void 0,3),mq(i,o,s,r)},e.prototype.getMaxResolution=function(){return this.maxResolution_},e.prototype.getMinResolution=function(){return this.minResolution_},e.prototype.getMaxZoom=function(){return this.getZoomForResolution(this.minResolution_)},e.prototype.setMaxZoom=function(n){this.applyOptions_(this.getUpdatedOptions_({maxZoom:n}))},e.prototype.getMinZoom=function(){return this.getZoomForResolution(this.maxResolution_)},e.prototype.setMinZoom=function(n){this.applyOptions_(this.getUpdatedOptions_({minZoom:n}))},e.prototype.setConstrainResolution=function(n){this.applyOptions_(this.getUpdatedOptions_({constrainResolution:n}))},e.prototype.getProjection=function(){return this.projection_},e.prototype.getResolution=function(){return this.get(Xu.RESOLUTION)},e.prototype.getResolutions=function(){return this.resolutions_},e.prototype.getResolutionForExtent=function(n,r){return this.getResolutionForExtentInternal(ux(n,this.getProjection()),r)},e.prototype.getResolutionForExtentInternal=function(n,r){var i=r||this.getViewportSizeMinusPadding_(),o=Kr(n)/i[0],s=Ou(n)/i[1];return Math.max(o,s)},e.prototype.getResolutionForValueFunction=function(n){var r=n||2,i=this.getConstrainedResolution(this.maxResolution_),o=this.minResolution_,s=Math.log(i/o)/Math.log(r);return function(a){var l=i/Math.pow(r,a*s);return l}},e.prototype.getRotation=function(){return this.get(Xu.ROTATION)},e.prototype.getValueForResolutionFunction=function(n){var r=Math.log(n||2),i=this.getConstrainedResolution(this.maxResolution_),o=this.minResolution_,s=Math.log(i/o)/r;return function(a){var l=Math.log(i/a)/r/s;return l}},e.prototype.getViewportSizeMinusPadding_=function(n){var r=this.getViewportSize_(n),i=this.padding_;return i&&(r=[r[0]-i[1]-i[3],r[1]-i[0]-i[2]]),r},e.prototype.getState=function(){var n=this.getProjection(),r=this.getResolution(),i=this.getRotation(),o=this.getCenterInternal(),s=this.padding_;if(s){var a=this.getViewportSizeMinusPadding_();o=vW(o,this.getViewportSize_(),[a[0]/2+s[3],a[1]/2+s[0]],r,i)}return{center:o.slice(0),projection:n!==void 0?n:null,resolution:r,nextCenter:this.nextCenter_,nextResolution:this.nextResolution_,nextRotation:this.nextRotation_,rotation:i,zoom:this.getZoom()}},e.prototype.getZoom=function(){var n,r=this.getResolution();return r!==void 0&&(n=this.getZoomForResolution(r)),n},e.prototype.getZoomForResolution=function(n){var r=this.minZoom_||0,i,o;if(this.resolutions_){var s=ite(this.resolutions_,n,1);r=s,i=this.resolutions_[s],s==this.resolutions_.length-1?o=2:o=i/this.resolutions_[s+1]}else i=this.maxResolution_,o=this.zoomFactor_;return r+Math.log(i/n)/Math.log(o)},e.prototype.getResolutionForZoom=function(n){if(this.resolutions_){if(this.resolutions_.length<=1)return 0;var r=oo(Math.floor(n),0,this.resolutions_.length-2),i=this.resolutions_[r]/this.resolutions_[r+1];return this.resolutions_[r]/Math.pow(i,oo(n-r,0,1))}else return this.maxResolution_/Math.pow(this.zoomFactor_,n-this.minZoom_)},e.prototype.fit=function(n,r){var i;if(bn(Array.isArray(n)||typeof n.getSimplifiedGeometry=="function",24),Array.isArray(n)){bn(!fte(n),25);var o=ux(n,this.getProjection());i=Sq(o)}else if(n.getType()==="Circle"){var o=ux(n.getExtent(),this.getProjection());i=Sq(o),i.rotate(this.getRotation(),ey(o))}else{var s=Tpt();s?i=n.clone().transform(s,this.getProjection()):i=n}this.fitInternal(i,r)},e.prototype.rotatedExtentForGeometry=function(n){for(var r=this.getRotation(),i=Math.cos(r),o=Math.sin(-r),s=n.getFlatCoordinates(),a=n.getStride(),l=1/0,c=1/0,u=-1/0,f=-1/0,d=0,h=s.length;d=0;c--){var u=l[c];if(!(u.getMap()!==this||!u.getActive()||!this.getTargetElement())){var f=u.handleEvent(n);if(!f||n.propagationStopped)break}}}},e.prototype.handlePostRender=function(){var n=this.frameState_,r=this.tileQueue_;if(!r.isEmpty()){var i=this.maxTilesLoading_,o=i;if(n){var s=n.viewHints;if(s[js.ANIMATING]||s[js.INTERACTING]){var a=Date.now()-n.time>8;i=a?0:8,o=a?0:2}}r.getTilesLoading()0;if(this.renderedVisible_!=i&&(this.element.style.display=i?"":"none",this.renderedVisible_=i),!Zb(r,this.renderedAttributions_)){sgt(this.ulElement_);for(var o=0,s=r.length;o0&&i%(2*Math.PI)!==0?r.animate({rotation:0,duration:this.duration_,easing:ZC}):r.setRotation(0))}},e.prototype.render=function(n){var r=n.frameState;if(r){var i=r.viewState.rotation;if(i!=this.rotation_){var o="rotate("+i+"rad)";if(this.autoHide_){var s=this.element.classList.contains(fI);!s&&i===0?this.element.classList.add(fI):s&&i!==0&&this.element.classList.remove(fI)}this.label_.style.transform=o}this.rotation_=i}},e}(M4),pvt=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),gvt=function(t){pvt(e,t);function e(n){var r=this,i=n||{};r=t.call(this,{element:document.createElement("div"),target:i.target})||this;var o=i.className!==void 0?i.className:"ol-zoom",s=i.delta!==void 0?i.delta:1,a=i.zoomInClassName!==void 0?i.zoomInClassName:o+"-in",l=i.zoomOutClassName!==void 0?i.zoomOutClassName:o+"-out",c=i.zoomInLabel!==void 0?i.zoomInLabel:"+",u=i.zoomOutLabel!==void 0?i.zoomOutLabel:"–",f=i.zoomInTipLabel!==void 0?i.zoomInTipLabel:"Zoom in",d=i.zoomOutTipLabel!==void 0?i.zoomOutTipLabel:"Zoom out",h=document.createElement("button");h.className=a,h.setAttribute("type","button"),h.title=f,h.appendChild(typeof c=="string"?document.createTextNode(c):c),h.addEventListener(nn.CLICK,r.handleClick_.bind(r,s),!1);var p=document.createElement("button");p.className=l,p.setAttribute("type","button"),p.title=d,p.appendChild(typeof u=="string"?document.createTextNode(u):u),p.addEventListener(nn.CLICK,r.handleClick_.bind(r,-s),!1);var g=o+" "+jM+" "+Cte,m=r.element;return m.className=g,m.appendChild(h),m.appendChild(p),r.duration_=i.duration!==void 0?i.duration:250,r}return e.prototype.handleClick_=function(n,r){r.preventDefault(),this.zoomByDelta_(n)},e.prototype.zoomByDelta_=function(n){var r=this.getMap(),i=r.getView();if(i){var o=i.getZoom();if(o!==void 0){var s=i.getConstrainedZoom(o+n);this.duration_>0?(i.getAnimating()&&i.cancelAnimations(),i.animate({zoom:s,duration:this.duration_,easing:ZC})):i.setZoom(s)}}},e}(M4),mvt=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),yW="units",d0={DEGREES:"degrees",IMPERIAL:"imperial",NAUTICAL:"nautical",METRIC:"metric",US:"us"},vvt=[1,2,5],$E=25.4/.28,yvt=function(t){mvt(e,t);function e(n){var r=this,i=n||{},o=i.className!==void 0?i.className:i.bar?"ol-scale-bar":"ol-scale-line";return r=t.call(this,{element:document.createElement("div"),render:i.render,target:i.target})||this,r.on,r.once,r.un,r.innerElement_=document.createElement("div"),r.innerElement_.className=o+"-inner",r.element.className=o+" "+jM,r.element.appendChild(r.innerElement_),r.viewState_=null,r.minWidth_=i.minWidth!==void 0?i.minWidth:64,r.maxWidth_=i.maxWidth,r.renderedVisible_=!1,r.renderedWidth_=void 0,r.renderedHTML_="",r.addChangeListener(yW,r.handleUnitsChanged_),r.setUnits(i.units||d0.METRIC),r.scaleBar_=i.bar||!1,r.scaleBarSteps_=i.steps||4,r.scaleBarText_=i.text||!1,r.dpi_=i.dpi||void 0,r}return e.prototype.getUnits=function(){return this.get(yW)},e.prototype.handleUnitsChanged_=function(){this.updateElement_()},e.prototype.setUnits=function(n){this.set(yW,n)},e.prototype.setDpi=function(n){this.dpi_=n},e.prototype.updateElement_=function(){var n=this.viewState_;if(!n){this.renderedVisible_&&(this.element.style.display="none",this.renderedVisible_=!1);return}var r=n.center,i=n.projection,o=this.getUnits(),s=o==d0.DEGREES?Io.DEGREES:Io.METERS,a=GF(i,n.resolution,r,s),l=this.minWidth_*(this.dpi_||$E)/$E,c=this.maxWidth_!==void 0?this.maxWidth_*(this.dpi_||$E)/$E:void 0,u=l*a,f="";if(o==d0.DEGREES){var d=jf[Io.DEGREES];u*=d,u=c){p=v,g=y,m=x;break}else if(g>=l)break;v=p,y=g,x=m,++h}var w;this.scaleBar_?w=this.createScaleBar(g,p,f):w=p.toFixed(m<0?-m:0)+" "+f,this.renderedHTML_!=w&&(this.innerElement_.innerHTML=w,this.renderedHTML_=w),this.renderedWidth_!=g&&(this.innerElement_.style.width=g+"px",this.renderedWidth_=g),this.renderedVisible_||(this.element.style.display="",this.renderedVisible_=!0)},e.prototype.createScaleBar=function(n,r,i){for(var o="1 : "+Math.round(this.getScaleForResolution()).toLocaleString(),s=[],a=n/this.scaleBarSteps_,l="ol-scale-singlebar-odd",c=0;c
'+this.createMarker("relative",c)+(c%2===0||this.scaleBarSteps_===2?this.createStepText(c,n,!1,r,i):"")+""),c===this.scaleBarSteps_-1&&s.push(this.createStepText(c+1,n,!0,r,i)),l=l==="ol-scale-singlebar-odd"?"ol-scale-singlebar-even":"ol-scale-singlebar-odd";var u;this.scaleBarText_?u='
'+o+"
":u="";var f='
'+u+s.join("")+"
";return f},e.prototype.createMarker=function(n,r){var i=n==="absolute"?3:-10;return'
'},e.prototype.createStepText=function(n,r,i,o,s){var a=n===0?0:Math.round(o/this.scaleBarSteps_*n*100)/100,l=a+(n===0?"":" "+s),c=n===0?-3:r/this.scaleBarSteps_*-1,u=n===0?0:r/this.scaleBarSteps_*2;return'
'+l+"
"},e.prototype.getScaleForResolution=function(){var n=GF(this.viewState_.projection,this.viewState_.resolution,this.viewState_.center,Io.METERS),r=this.dpi_||$E,i=1e3/25.4;return parseFloat(n.toString())*i*r},e.prototype.render=function(n){var r=n.frameState;r?this.viewState_=r.viewState:this.viewState_=null,this.updateElement_()},e}(M4);function xvt(t){var e={},n=new ru,r=e.zoom!==void 0?e.zoom:!0;r&&n.push(new gvt(e.zoomOptions));var i=e.rotate!==void 0?e.rotate:!0;i&&n.push(new hvt(e.rotateOptions));var o=e.attribution!==void 0?e.attribution:!0;return o&&n.push(new fvt(e.attributionOptions)),n}const Mq={ACTIVE:"active"};var bvt=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),VM=function(t){bvt(e,t);function e(n){var r=t.call(this)||this;return r.on,r.once,r.un,n&&n.handleEvent&&(r.handleEvent=n.handleEvent),r.map_=null,r.setActive(!0),r}return e.prototype.getActive=function(){return this.get(Mq.ACTIVE)},e.prototype.getMap=function(){return this.map_},e.prototype.handleEvent=function(n){return!0},e.prototype.setActive=function(n){this.set(Mq.ACTIVE,n)},e.prototype.setMap=function(n){this.map_=n},e}($h);function wvt(t,e,n){var r=t.getCenterInternal();if(r){var i=[r[0]+e[0],r[1]+e[1]];t.animateInternal({duration:n!==void 0?n:250,easing:Mmt,center:t.getConstrainedCenter(i)})}}function Mte(t,e,n,r){var i=t.getZoom();if(i!==void 0){var o=t.getConstrainedZoom(i+e),s=t.getResolutionForZoom(o);t.getAnimating()&&t.cancelAnimations(),t.animate({resolution:s,anchor:n,duration:r!==void 0?r:250,easing:ZC})}}var _vt=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),Svt=function(t){_vt(e,t);function e(n){var r=t.call(this)||this,i=n||{};return r.delta_=i.delta?i.delta:1,r.duration_=i.duration!==void 0?i.duration:250,r}return e.prototype.handleEvent=function(n){var r=!1;if(n.type==hr.DBLCLICK){var i=n.originalEvent,o=n.map,s=n.coordinate,a=i.shiftKey?-this.delta_:this.delta_,l=o.getView();Mte(l,a,s,this.duration_),i.preventDefault(),r=!0}return!r},e}(VM),Cvt=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),JC=function(t){Cvt(e,t);function e(n){var r=this,i=n||{};return r=t.call(this,i)||this,i.handleDownEvent&&(r.handleDownEvent=i.handleDownEvent),i.handleDragEvent&&(r.handleDragEvent=i.handleDragEvent),i.handleMoveEvent&&(r.handleMoveEvent=i.handleMoveEvent),i.handleUpEvent&&(r.handleUpEvent=i.handleUpEvent),i.stopDown&&(r.stopDown=i.stopDown),r.handlingDownUpSequence=!1,r.targetPointers=[],r}return e.prototype.getPointerCount=function(){return this.targetPointers.length},e.prototype.handleDownEvent=function(n){return!1},e.prototype.handleDragEvent=function(n){},e.prototype.handleEvent=function(n){if(!n.originalEvent)return!0;var r=!1;if(this.updateTrackedPointers_(n),this.handlingDownUpSequence){if(n.type==hr.POINTERDRAG)this.handleDragEvent(n),n.originalEvent.preventDefault();else if(n.type==hr.POINTERUP){var i=this.handleUpEvent(n);this.handlingDownUpSequence=i&&this.targetPointers.length>0}}else if(n.type==hr.POINTERDOWN){var o=this.handleDownEvent(n);this.handlingDownUpSequence=o,r=this.stopDown(o)}else n.type==hr.POINTERMOVE&&this.handleMoveEvent(n);return!r},e.prototype.handleMoveEvent=function(n){},e.prototype.handleUpEvent=function(n){return!1},e.prototype.stopDown=function(n){return n},e.prototype.updateTrackedPointers_=function(n){n.activePointers&&(this.targetPointers=n.activePointers)},e}(VM);function Rte(t){for(var e=t.length,n=0,r=0,i=0;i0&&this.condition_(n)){var r=n.map,i=r.getView();return this.lastCentroid=null,i.getAnimating()&&i.cancelAnimations(),this.kinetic_&&this.kinetic_.begin(),this.noKinetic_=this.targetPointers.length>1,!0}else return!1},e}(JC),Pvt=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),Mvt=function(t){Pvt(e,t);function e(n){var r=this,i=n||{};return r=t.call(this,{stopDown:IM})||this,r.condition_=i.condition?i.condition:Ovt,r.lastAngle_=void 0,r.duration_=i.duration!==void 0?i.duration:250,r}return e.prototype.handleDragEvent=function(n){if(xW(n)){var r=n.map,i=r.getView();if(i.getConstraints().rotation!==Pte){var o=r.getSize(),s=n.pixel,a=Math.atan2(o[1]/2-s[1],s[0]-o[0]/2);if(this.lastAngle_!==void 0){var l=a-this.lastAngle_;i.adjustRotationInternal(-l)}this.lastAngle_=a}}},e.prototype.handleUpEvent=function(n){if(!xW(n))return!0;var r=n.map,i=r.getView();return i.endInteraction(this.duration_),!1},e.prototype.handleDownEvent=function(n){if(!xW(n))return!1;if(nRe(n)&&this.condition_(n)){var r=n.map;return r.getView().beginInteraction(),this.lastAngle_=void 0,!0}else return!1},e}(JC),Rvt=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),Dvt=function(t){Rvt(e,t);function e(n){var r=t.call(this)||this;return r.geometry_=null,r.element_=document.createElement("div"),r.element_.style.position="absolute",r.element_.style.pointerEvents="auto",r.element_.className="ol-box "+n,r.map_=null,r.startPixel_=null,r.endPixel_=null,r}return e.prototype.disposeInternal=function(){this.setMap(null)},e.prototype.render_=function(){var n=this.startPixel_,r=this.endPixel_,i="px",o=this.element_.style;o.left=Math.min(n[0],r[0])+i,o.top=Math.min(n[1],r[1])+i,o.width=Math.abs(r[0]-n[0])+i,o.height=Math.abs(r[1]-n[1])+i},e.prototype.setMap=function(n){if(this.map_){this.map_.getOverlayContainer().removeChild(this.element_);var r=this.element_.style;r.left="inherit",r.top="inherit",r.width="inherit",r.height="inherit"}this.map_=n,this.map_&&this.map_.getOverlayContainer().appendChild(this.element_)},e.prototype.setPixels=function(n,r){this.startPixel_=n,this.endPixel_=r,this.createOrUpdateGeometry(),this.render_()},e.prototype.createOrUpdateGeometry=function(){var n=this.startPixel_,r=this.endPixel_,i=[n,[n[0],r[1]],r,[r[0],n[1]]],o=i.map(this.map_.getCoordinateFromPixelInternal,this.map_);o[4]=o[0].slice(),this.geometry_?this.geometry_.setCoordinates([o]):this.geometry_=new ty([o])},e.prototype.getGeometry=function(){return this.geometry_},e}(rte),oRe=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),mI={BOXSTART:"boxstart",BOXDRAG:"boxdrag",BOXEND:"boxend",BOXCANCEL:"boxcancel"},bW=function(t){oRe(e,t);function e(n,r,i){var o=t.call(this,n)||this;return o.coordinate=r,o.mapBrowserEvent=i,o}return e}(Lh),Ivt=function(t){oRe(e,t);function e(n){var r=t.call(this)||this;r.on,r.once,r.un;var i=n||{};return r.box_=new Dvt(i.className||"ol-dragbox"),r.minArea_=i.minArea!==void 0?i.minArea:64,i.onBoxEnd&&(r.onBoxEnd=i.onBoxEnd),r.startPixel_=null,r.condition_=i.condition?i.condition:nRe,r.boxEndCondition_=i.boxEndCondition?i.boxEndCondition:r.defaultBoxEndCondition,r}return e.prototype.defaultBoxEndCondition=function(n,r,i){var o=i[0]-r[0],s=i[1]-r[1];return o*o+s*s>=this.minArea_},e.prototype.getGeometry=function(){return this.box_.getGeometry()},e.prototype.handleDragEvent=function(n){this.box_.setPixels(this.startPixel_,n.pixel),this.dispatchEvent(new bW(mI.BOXDRAG,n.coordinate,n))},e.prototype.handleUpEvent=function(n){this.box_.setMap(null);var r=this.boxEndCondition_(n,this.startPixel_,n.pixel);return r&&this.onBoxEnd(n),this.dispatchEvent(new bW(r?mI.BOXEND:mI.BOXCANCEL,n.coordinate,n)),!1},e.prototype.handleDownEvent=function(n){return this.condition_(n)?(this.startPixel_=n.pixel,this.box_.setMap(n.map),this.box_.setPixels(this.startPixel_,this.startPixel_),this.dispatchEvent(new bW(mI.BOXSTART,n.coordinate,n)),!0):!1},e.prototype.onBoxEnd=function(n){},e}(JC),Lvt=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),$vt=function(t){Lvt(e,t);function e(n){var r=this,i=n||{},o=i.condition?i.condition:rRe;return r=t.call(this,{condition:o,className:i.className||"ol-dragzoom",minArea:i.minArea})||this,r.duration_=i.duration!==void 0?i.duration:200,r.out_=i.out!==void 0?i.out:!1,r}return e.prototype.onBoxEnd=function(n){var r=this.getMap(),i=r.getView(),o=this.getGeometry();if(this.out_){var s=i.rotatedExtentForGeometry(o),a=i.getResolutionForExtentInternal(s),l=i.getResolution()/a;o=o.clone(),o.scale(l*l)}i.fitInternal(o,{duration:this.duration_,easing:ZC})},e}(Ivt);const h0={LEFT:37,UP:38,RIGHT:39,DOWN:40};var Fvt=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),Nvt=function(t){Fvt(e,t);function e(n){var r=t.call(this)||this,i=n||{};return r.defaultCondition_=function(o){return Dte(o)&&iRe(o)},r.condition_=i.condition!==void 0?i.condition:r.defaultCondition_,r.duration_=i.duration!==void 0?i.duration:100,r.pixelDelta_=i.pixelDelta!==void 0?i.pixelDelta:128,r}return e.prototype.handleEvent=function(n){var r=!1;if(n.type==nn.KEYDOWN){var i=n.originalEvent,o=i.keyCode;if(this.condition_(n)&&(o==h0.DOWN||o==h0.LEFT||o==h0.RIGHT||o==h0.UP)){var s=n.map,a=s.getView(),l=a.getResolution()*this.pixelDelta_,c=0,u=0;o==h0.DOWN?u=-l:o==h0.LEFT?c=-l:o==h0.RIGHT?c=l:u=l;var f=[c,u];dte(f,a.getRotation()),wvt(a,f,this.duration_),i.preventDefault(),r=!0}}return!r},e}(VM),zvt=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),jvt=function(t){zvt(e,t);function e(n){var r=t.call(this)||this,i=n||{};return r.condition_=i.condition?i.condition:iRe,r.delta_=i.delta?i.delta:1,r.duration_=i.duration!==void 0?i.duration:100,r}return e.prototype.handleEvent=function(n){var r=!1;if(n.type==nn.KEYDOWN||n.type==nn.KEYPRESS){var i=n.originalEvent,o=i.charCode;if(this.condition_(n)&&(o==43||o==45)){var s=n.map,a=o==43?this.delta_:-this.delta_,l=s.getView();Mte(l,a,void 0,this.duration_),i.preventDefault(),r=!0}}return!r},e}(VM),Bvt=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),wW={TRACKPAD:"trackpad",WHEEL:"wheel"},Uvt=function(t){Bvt(e,t);function e(n){var r=this,i=n||{};r=t.call(this,i)||this,r.totalDelta_=0,r.lastDelta_=0,r.maxDelta_=i.maxDelta!==void 0?i.maxDelta:1,r.duration_=i.duration!==void 0?i.duration:250,r.timeout_=i.timeout!==void 0?i.timeout:80,r.useAnchor_=i.useAnchor!==void 0?i.useAnchor:!0,r.constrainResolution_=i.constrainResolution!==void 0?i.constrainResolution:!1;var o=i.condition?i.condition:tRe;return r.condition_=i.onFocusOnly?Rq(eRe,o):o,r.lastAnchor_=null,r.startTime_=void 0,r.timeoutId_,r.mode_=void 0,r.trackpadEventGap_=400,r.trackpadTimeoutId_,r.deltaPerZoom_=300,r}return e.prototype.endInteraction_=function(){this.trackpadTimeoutId_=void 0;var n=this.getMap();if(n){var r=n.getView();r.endInteraction(void 0,this.lastDelta_?this.lastDelta_>0?1:-1:0,this.lastAnchor_)}},e.prototype.handleEvent=function(n){if(!this.condition_(n))return!0;var r=n.type;if(r!==nn.WHEEL)return!0;var i=n.map,o=n.originalEvent;o.preventDefault(),this.useAnchor_&&(this.lastAnchor_=n.coordinate);var s;if(n.type==nn.WHEEL&&(s=o.deltaY,Nht&&o.deltaMode===WheelEvent.DOM_DELTA_PIXEL&&(s/=rMe),o.deltaMode===WheelEvent.DOM_DELTA_LINE&&(s*=40)),s===0)return!1;this.lastDelta_=s;var a=Date.now();this.startTime_===void 0&&(this.startTime_=a),(!this.mode_||a-this.startTime_>this.trackpadEventGap_)&&(this.mode_=Math.abs(s)<4?wW.TRACKPAD:wW.WHEEL);var l=i.getView();if(this.mode_===wW.TRACKPAD&&!(l.getConstrainResolution()||this.constrainResolution_))return this.trackpadTimeoutId_?clearTimeout(this.trackpadTimeoutId_):(l.getAnimating()&&l.cancelAnimations(),l.beginInteraction()),this.trackpadTimeoutId_=setTimeout(this.endInteraction_.bind(this),this.timeout_),l.adjustZoom(-s/this.deltaPerZoom_,this.lastAnchor_),this.startTime_=a,!1;this.totalDelta_+=s;var c=Math.max(this.timeout_-(a-this.startTime_),0);return clearTimeout(this.timeoutId_),this.timeoutId_=setTimeout(this.handleWheelZoom_.bind(this,i),c),!1},e.prototype.handleWheelZoom_=function(n){var r=n.getView();r.getAnimating()&&r.cancelAnimations();var i=-oo(this.totalDelta_,-this.maxDelta_*this.deltaPerZoom_,this.maxDelta_*this.deltaPerZoom_)/this.deltaPerZoom_;(r.getConstrainResolution()||this.constrainResolution_)&&(i=i?i>0?1:-1:0),Mte(r,i,this.lastAnchor_,this.duration_),this.mode_=void 0,this.totalDelta_=0,this.lastAnchor_=null,this.startTime_=void 0,this.timeoutId_=void 0},e.prototype.setMouseAnchor=function(n){this.useAnchor_=n,n||(this.lastAnchor_=null)},e}(VM),Wvt=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),Vvt=function(t){Wvt(e,t);function e(n){var r=this,i=n||{},o=i;return o.stopDown||(o.stopDown=IM),r=t.call(this,o)||this,r.anchor_=null,r.lastAngle_=void 0,r.rotating_=!1,r.rotationDelta_=0,r.threshold_=i.threshold!==void 0?i.threshold:.3,r.duration_=i.duration!==void 0?i.duration:250,r}return e.prototype.handleDragEvent=function(n){var r=0,i=this.targetPointers[0],o=this.targetPointers[1],s=Math.atan2(o.clientY-i.clientY,o.clientX-i.clientX);if(this.lastAngle_!==void 0){var a=s-this.lastAngle_;this.rotationDelta_+=a,!this.rotating_&&Math.abs(this.rotationDelta_)>this.threshold_&&(this.rotating_=!0),r=a}this.lastAngle_=s;var l=n.map,c=l.getView();if(c.getConstraints().rotation!==Pte){var u=l.getViewport().getBoundingClientRect(),f=Rte(this.targetPointers);f[0]-=u.left,f[1]-=u.top,this.anchor_=l.getCoordinateFromPixelInternal(f),this.rotating_&&(l.render(),c.adjustRotationInternal(r,this.anchor_))}},e.prototype.handleUpEvent=function(n){if(this.targetPointers.length<2){var r=n.map,i=r.getView();return i.endInteraction(this.duration_),!1}else return!0},e.prototype.handleDownEvent=function(n){if(this.targetPointers.length>=2){var r=n.map;return this.anchor_=null,this.lastAngle_=void 0,this.rotating_=!1,this.rotationDelta_=0,this.handlingDownUpSequence||r.getView().beginInteraction(),!0}else return!1},e}(JC),Gvt=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),Hvt=function(t){Gvt(e,t);function e(n){var r=this,i=n||{},o=i;return o.stopDown||(o.stopDown=IM),r=t.call(this,o)||this,r.anchor_=null,r.duration_=i.duration!==void 0?i.duration:400,r.lastDistance_=void 0,r.lastScaleDelta_=1,r}return e.prototype.handleDragEvent=function(n){var r=1,i=this.targetPointers[0],o=this.targetPointers[1],s=i.clientX-o.clientX,a=i.clientY-o.clientY,l=Math.sqrt(s*s+a*a);this.lastDistance_!==void 0&&(r=this.lastDistance_/l),this.lastDistance_=l;var c=n.map,u=c.getView();r!=1&&(this.lastScaleDelta_=r);var f=c.getViewport().getBoundingClientRect(),d=Rte(this.targetPointers);d[0]-=f.left,d[1]-=f.top,this.anchor_=c.getCoordinateFromPixelInternal(d),c.render(),u.adjustResolutionInternal(r,this.anchor_)},e.prototype.handleUpEvent=function(n){if(this.targetPointers.length<2){var r=n.map,i=r.getView(),o=this.lastScaleDelta_>1?1:-1;return i.endInteraction(this.duration_,o),!1}else return!0},e.prototype.handleDownEvent=function(n){if(this.targetPointers.length>=2){var r=n.map;return this.anchor_=null,this.lastDistance_=void 0,this.lastScaleDelta_=1,this.handlingDownUpSequence||r.getView().beginInteraction(),!0}else return!1},e}(JC),qvt=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),Ite=function(t){qvt(e,t);function e(n,r,i){var o=t.call(this)||this;if(i!==void 0&&r===void 0)o.setFlatCoordinates(i,n);else{var s=r||0;o.setCenterAndRadius(n,s,i)}return o}return e.prototype.clone=function(){var n=new e(this.flatCoordinates.slice(),void 0,this.layout);return n.applyProperties(this),n},e.prototype.closestPointXY=function(n,r,i,o){var s=this.flatCoordinates,a=n-s[0],l=r-s[1],c=a*a+l*l;if(c=i[0]||n[1]<=i[1]&&n[3]>=i[1]?!0:ate(n,this.intersectsCoordinate.bind(this))}return!1},e.prototype.setCenter=function(n){var r=this.stride,i=this.flatCoordinates[r]-this.flatCoordinates[0],o=n.slice();o[r]=o[0]+i;for(var s=1;s=this.dragVertexDelay_?(this.downPx_=n.pixel,this.shouldHandle_=!this.freehand_,r=!0):this.lastDragTime_=void 0,this.shouldHandle_&&this.downTimeout_!==void 0&&(clearTimeout(this.downTimeout_),this.downTimeout_=void 0)}return this.freehand_&&n.type===hr.POINTERDRAG&&this.sketchFeature_!==null?(this.addToDrawing_(n.coordinate),i=!1):this.freehand_&&n.type===hr.POINTERDOWN?i=!1:r&&this.getPointerCount()<2?(i=n.type===hr.POINTERMOVE,i&&this.freehand_?(this.handlePointerMove_(n),this.shouldHandle_&&n.originalEvent.preventDefault()):(n.originalEvent.pointerType==="mouse"||n.type===hr.POINTERDRAG&&this.downTimeout_===void 0)&&this.handlePointerMove_(n)):n.type===hr.DBLCLICK&&(i=!1),t.prototype.handleEvent.call(this,n)&&i},e.prototype.handleDownEvent=function(n){return this.shouldHandle_=!this.freehand_,this.freehand_?(this.downPx_=n.pixel,this.finishCoordinate_||this.startDrawing_(n.coordinate),!0):this.condition_(n)?(this.lastDragTime_=Date.now(),this.downTimeout_=setTimeout((function(){this.handlePointerMove_(new Op(hr.POINTERMOVE,n.map,n.originalEvent,!1,n.frameState))}).bind(this),this.dragVertexDelay_),this.downPx_=n.pixel,!0):(this.lastDragTime_=void 0,!1)},e.prototype.handleUpEvent=function(n){var r=!0;if(this.getPointerCount()===0)if(this.downTimeout_&&(clearTimeout(this.downTimeout_),this.downTimeout_=void 0),this.handlePointerMove_(n),this.shouldHandle_){var i=!this.finishCoordinate_;i&&this.startDrawing_(n.coordinate),!i&&this.freehand_?this.finishDrawing():!this.freehand_&&(!i||this.mode_===Vn.POINT)&&(this.atFinish_(n.pixel)?this.finishCondition_(n)&&this.finishDrawing():this.addToDrawing_(n.coordinate)),r=!1}else this.freehand_&&this.abortDrawing();return!r&&this.stopClick_&&n.preventDefault(),r},e.prototype.handlePointerMove_=function(n){if(this.pointerType_=n.originalEvent.pointerType,this.downPx_&&(!this.freehand_&&this.shouldHandle_||this.freehand_&&!this.shouldHandle_)){var r=this.downPx_,i=n.pixel,o=r[0]-i[0],s=r[1]-i[1],a=o*o+s*s;if(this.shouldHandle_=this.freehand_?a>this.squaredClickTolerance_:a<=this.squaredClickTolerance_,!this.shouldHandle_)return}this.finishCoordinate_?this.modifyDrawing_(n.coordinate):this.createOrUpdateSketchPoint_(n.coordinate.slice())},e.prototype.atFinish_=function(n){var r=!1;if(this.sketchFeature_){var i=!1,o=[this.finishCoordinate_],s=this.mode_;if(s===Vn.POINT)r=!0;else if(s===Vn.CIRCLE)r=this.sketchCoords_.length===2;else if(s===Vn.LINE_STRING)i=this.sketchCoords_.length>this.minPoints_;else if(s===Vn.POLYGON){var a=this.sketchCoords_;i=a[0].length>this.minPoints_,o=[a[0][0],a[0][a[0].length-2]]}if(i)for(var l=this.getMap(),c=0,u=o.length;c=this.maxPoints_&&(this.freehand_?s.pop():o=!0),s.push(n.slice()),this.geometryFunction_(s,r,i)):a===Vn.POLYGON&&(s=this.sketchCoords_[0],s.length>=this.maxPoints_&&(this.freehand_?s.pop():o=!0),s.push(n.slice()),o&&(this.finishCoordinate_=s[0]),this.geometryFunction_(this.sketchCoords_,r,i)),this.createOrUpdateSketchPoint_(n.slice()),this.updateSketchFeatures_(),o&&this.finishDrawing()},e.prototype.removeLastPoint=function(){if(this.sketchFeature_){var n=this.sketchFeature_.getGeometry(),r=this.getMap().getView().getProjection(),i,o=this.mode_;if(o===Vn.LINE_STRING||o===Vn.CIRCLE){if(i=this.sketchCoords_,i.splice(-2,1),i.length>=2){this.finishCoordinate_=i[i.length-2].slice();var s=this.finishCoordinate_.slice();i[i.length-1]=s,this.createOrUpdateSketchPoint_(s)}this.geometryFunction_(i,n,r),n.getType()==="Polygon"&&this.sketchLine_&&this.createOrUpdateCustomSketchLine_(n)}else if(o===Vn.POLYGON){i=this.sketchCoords_[0],i.splice(-2,1);var a=this.sketchLine_.getGeometry();if(i.length>=2){var s=i[i.length-2].slice();i[i.length-1]=s,this.createOrUpdateSketchPoint_(s)}a.setCoordinates(i),this.geometryFunction_(this.sketchCoords_,n,r)}i.length===1&&this.abortDrawing(),this.updateSketchFeatures_()}},e.prototype.finishDrawing=function(){var n=this.abortDrawing_();if(n){var r=this.sketchCoords_,i=n.getGeometry(),o=this.getMap().getView().getProjection();this.mode_===Vn.LINE_STRING?(r.pop(),this.geometryFunction_(r,i,o)):this.mode_===Vn.POLYGON&&(r[0].pop(),this.geometryFunction_(r,i,o),r=i.getCoordinates()),this.type_==="MultiPoint"?n.setGeometry(new R4([r])):this.type_==="MultiLineString"?n.setGeometry(new Lte([r])):this.type_==="MultiPolygon"&&n.setGeometry(new $te([r])),this.dispatchEvent(new yI(vI.DRAWEND,n)),this.features_&&this.features_.push(n),this.source_&&this.source_.addFeature(n)}},e.prototype.abortDrawing_=function(){this.finishCoordinate_=null;var n=this.sketchFeature_;return this.sketchFeature_=null,this.sketchPoint_=null,this.sketchLine_=null,this.overlay_.getSource().clear(!0),n},e.prototype.abortDrawing=function(){var n=this.abortDrawing_();n&&this.dispatchEvent(new yI(vI.DRAWABORT,n))},e.prototype.appendCoordinates=function(n){var r=this.mode_,i=!this.sketchFeature_;i&&this.startDrawing_(n[0]);var o;if(r===Vn.LINE_STRING||r===Vn.CIRCLE)o=this.sketchCoords_;else if(r===Vn.POLYGON)o=this.sketchCoords_&&this.sketchCoords_.length?this.sketchCoords_[0]:[];else return;i&&o.shift(),o.pop();for(var s=0;s0&&this.getCount()>this.highWaterMark},t.prototype.expireCache=function(e){for(;this.canExpireCache();)this.pop()},t.prototype.clear=function(){this.count_=0,this.entries_={},this.oldest_=null,this.newest_=null},t.prototype.containsKey=function(e){return this.entries_.hasOwnProperty(e)},t.prototype.forEach=function(e){for(var n=this.oldest_;n;)e(n.value_,n.key_,this),n=n.newer},t.prototype.get=function(e,n){var r=this.entries_[e];return bn(r!==void 0,15),r===this.newest_||(r===this.oldest_?(this.oldest_=this.oldest_.newer,this.oldest_.older=null):(r.newer.older=r.older,r.older.newer=r.newer),r.newer=null,r.older=this.newest_,this.newest_.newer=r,this.newest_=r),r.value_},t.prototype.remove=function(e){var n=this.entries_[e];return bn(n!==void 0,15),n===this.newest_?(this.newest_=n.older,this.newest_&&(this.newest_.newer=null)):n===this.oldest_?(this.oldest_=n.newer,this.oldest_&&(this.oldest_.older=null)):(n.newer.older=n.older,n.older.newer=n.newer),delete this.entries_[e],--this.count_,n.value_},t.prototype.getCount=function(){return this.count_},t.prototype.getKeys=function(){var e=new Array(this.count_),n=0,r;for(r=this.newest_;r;r=r.older)e[n++]=r.key_;return e},t.prototype.getValues=function(){var e=new Array(this.count_),n=0,r;for(r=this.newest_;r;r=r.older)e[n++]=r.value_;return e},t.prototype.peekLast=function(){return this.oldest_.value_},t.prototype.peekLastKey=function(){return this.oldest_.key_},t.prototype.peekFirstKey=function(){return this.newest_.key_},t.prototype.peek=function(e){if(this.containsKey(e))return this.entries_[e].value_},t.prototype.pop=function(){var e=this.oldest_;return delete this.entries_[e.key_],e.newer&&(e.newer.older=null),this.oldest_=e.newer,this.oldest_||(this.newest_=null),--this.count_,e.value_},t.prototype.replace=function(e,n){this.get(e),this.entries_[e].value_=n},t.prototype.set=function(e,n){bn(!(e in this.entries_),16);var r={key_:e,newer:null,older:this.newest_,value_:n};this.newest_?this.newest_.newer=r:this.oldest_=r,this.newest_=r,this.entries_[e]=r,++this.count_},t.prototype.setSize=function(e){this.highWaterMark=e},t}();function rpe(t,e,n,r){return r!==void 0?(r[0]=t,r[1]=e,r[2]=n,r):[t,e,n]}function D4(t,e,n){return t+"/"+e+"/"+n}function aRe(t){return D4(t[0],t[1],t[2])}function iyt(t){return t.split("/").map(Number)}function lRe(t){return(t[1]<n||n>e.getMaxZoom())return!1;var o=e.getFullTileRange(n);return o?o.containsXY(r,i):!0}var syt=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),cRe=function(t){syt(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.expireCache=function(n){for(;this.canExpireCache();){var r=this.peekLast();if(r.getKey()in n)break;this.pop().release()}},e.prototype.pruneExceptNewestZ=function(){if(this.getCount()!==0){var n=this.peekFirstKey(),r=iyt(n),i=r[0];this.forEach((function(o){o.tileCoord[0]!==i&&(this.remove(aRe(o.tileCoord)),o.release())}).bind(this))}},e}(ryt),Fte=function(){function t(e,n,r,i){this.minX=e,this.maxX=n,this.minY=r,this.maxY=i}return t.prototype.contains=function(e){return this.containsXY(e[1],e[2])},t.prototype.containsTileRange=function(e){return this.minX<=e.minX&&e.maxX<=this.maxX&&this.minY<=e.minY&&e.maxY<=this.maxY},t.prototype.containsXY=function(e,n){return this.minX<=e&&e<=this.maxX&&this.minY<=n&&n<=this.maxY},t.prototype.equals=function(e){return this.minX==e.minX&&this.minY==e.minY&&this.maxX==e.maxX&&this.maxY==e.maxY},t.prototype.extend=function(e){e.minXthis.maxX&&(this.maxX=e.maxX),e.minYthis.maxY&&(this.maxY=e.maxY)},t.prototype.getHeight=function(){return this.maxY-this.minY+1},t.prototype.getSize=function(){return[this.getWidth(),this.getHeight()]},t.prototype.getWidth=function(){return this.maxX-this.minX+1},t.prototype.intersects=function(e){return this.minX<=e.maxX&&this.maxX>=e.minX&&this.minY<=e.maxY&&this.maxY>=e.minY},t}();function U1(t,e,n,r,i){return i!==void 0?(i.minX=t,i.maxX=e,i.minY=n,i.maxY=r,i):new Fte(t,e,n,r)}var ayt=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),eN=function(t){ayt(e,t);function e(n){var r=t.call(this)||this;return r.geometries_=n||null,r.changeEventsKeys_=[],r.listenGeometriesChange_(),r}return e.prototype.unlistenGeometriesChange_=function(){this.changeEventsKeys_.forEach(oi),this.changeEventsKeys_.length=0},e.prototype.listenGeometriesChange_=function(){if(this.geometries_)for(var n=0,r=this.geometries_.length;nthis.sourceWorldWidth_/2){var b=[[x.source[0][0],x.source[0][1]],[x.source[1][0],x.source[1][1]],[x.source[2][0],x.source[2][1]]];b[0][0]-y>this.sourceWorldWidth_/2&&(b[0][0]-=this.sourceWorldWidth_),b[1][0]-y>this.sourceWorldWidth_/2&&(b[1][0]-=this.sourceWorldWidth_),b[2][0]-y>this.sourceWorldWidth_/2&&(b[2][0]-=this.sourceWorldWidth_);var w=Math.min(b[0][0],b[1][0],b[2][0]),_=Math.max(b[0][0],b[1][0],b[2][0]);_-w.5&&f<1,p=!1;if(c>0){if(this.targetProj_.isGlobal()&&this.targetWorldWidth_){var g=whe([e,n,r,i]),m=Kr(g)/this.targetWorldWidth_;p=m>ope||p}!h&&this.sourceProj_.isGlobal()&&f&&(p=f>ope||p)}if(!(!p&&this.maxSourceExtent_&&isFinite(u[0])&&isFinite(u[1])&&isFinite(u[2])&&isFinite(u[3])&&!ga(u,this.maxSourceExtent_))){var v=0;if(!p&&(!isFinite(o[0])||!isFinite(o[1])||!isFinite(s[0])||!isFinite(s[1])||!isFinite(a[0])||!isFinite(a[1])||!isFinite(l[0])||!isFinite(l[1]))){if(c>0)p=!0;else if(v=(!isFinite(o[0])||!isFinite(o[1])?8:0)+(!isFinite(s[0])||!isFinite(s[1])?4:0)+(!isFinite(a[0])||!isFinite(a[1])?2:0)+(!isFinite(l[0])||!isFinite(l[1])?1:0),v!=1&&v!=2&&v!=4&&v!=8)return}if(c>0){if(!p){var y=[(e[0]+r[0])/2,(e[1]+r[1])/2],x=this.transformInv_(y),b=void 0;if(h){var w=(Lv(o[0],d)+Lv(a[0],d))/2;b=w-Lv(x[0],d)}else b=(o[0]+a[0])/2-x[0];var _=(o[1]+a[1])/2-x[1],S=b*b+_*_;p=S>this.errorThresholdSquared_}if(p){if(Math.abs(e[0]-r[0])<=Math.abs(e[1]-r[1])){var O=[(n[0]+r[0])/2,(n[1]+r[1])/2],k=this.transformInv_(O),E=[(i[0]+e[0])/2,(i[1]+e[1])/2],P=this.transformInv_(E);this.addQuad_(e,n,O,E,o,s,k,P,c-1),this.addQuad_(E,O,r,i,P,k,a,l,c-1)}else{var A=[(e[0]+n[0])/2,(e[1]+n[1])/2],R=this.transformInv_(A),T=[(r[0]+i[0])/2,(r[1]+i[1])/2],M=this.transformInv_(T);this.addQuad_(e,A,T,i,o,R,M,l,c-1),this.addQuad_(A,n,r,T,R,s,a,M,c-1)}return}}if(h){if(!this.canWrapXInSource_)return;this.wrapsXInSource_=!0}v&11||this.addTriangle_(e,r,i,o,a,l),v&14||this.addTriangle_(e,r,n,o,a,s),v&&(v&13||this.addTriangle_(n,i,e,s,l,o),v&7||this.addTriangle_(n,i,r,s,l,a))}},t.prototype.calculateSourceExtent=function(){var e=_c();return this.triangles_.forEach(function(n,r,i){var o=n.source;ek(e,o[0]),ek(e,o[1]),ek(e,o[2])}),e},t.prototype.getTriangles=function(){return this.triangles_},t}(),Lq={imageSmoothingEnabled:!1,msImageSmoothingEnabled:!1},kyt={imageSmoothingEnabled:!0,msImageSmoothingEnabled:!0},_W,fRe=[];function spe(t,e,n,r,i){t.beginPath(),t.moveTo(0,0),t.lineTo(e,n),t.lineTo(r,i),t.closePath(),t.save(),t.clip(),t.fillRect(0,0,Math.max(e,r)+1,Math.max(n,i)),t.restore()}function SW(t,e){return Math.abs(t[e*4]-210)>2||Math.abs(t[e*4+3]-.75*255)>2}function Ayt(){if(_W===void 0){var t=document.createElement("canvas").getContext("2d");t.globalCompositeOperation="lighter",t.fillStyle="rgba(210, 0, 0, 0.75)",spe(t,4,5,4,0),spe(t,4,5,0,5);var e=t.getImageData(0,0,3,3).data;_W=SW(e,0)||SW(e,4)||SW(e,8)}return _W}function $q(t,e,n,r){var i=O4(n,e,t),o=GF(e,r,n),s=e.getMetersPerUnit();s!==void 0&&(o*=s);var a=t.getMetersPerUnit();a!==void 0&&(o/=a);var l=t.getExtent();if(!l||FM(l,i)){var c=GF(t,o,i)/o;isFinite(c)&&c>0&&(o/=c)}return o}function Pyt(t,e,n,r){var i=ey(n),o=$q(t,e,i,r);return(!isFinite(o)||o<=0)&&ate(n,function(s){return o=$q(t,e,s,r),isFinite(o)&&o>0}),o}function Myt(t,e,n,r,i,o,s,a,l,c,u,f){var d=Sc(Math.round(n*t),Math.round(n*e),fRe);if(f||hi(d,Lq),l.length===0)return d.canvas;d.scale(n,n);function h(b){return Math.round(b*n)/n}d.globalCompositeOperation="lighter";var p=_c();l.forEach(function(b,w,_){lMe(p,b.extent)});var g=Kr(p),m=Ou(p),v=Sc(Math.round(n*g/r),Math.round(n*m/r));f||hi(v,Lq);var y=n/r;l.forEach(function(b,w,_){var S=b.extent[0]-p[0],O=-(b.extent[3]-p[3]),k=Kr(b.extent),E=Ou(b.extent);b.image.width>0&&b.image.height>0&&v.drawImage(b.image,c,c,b.image.width-2*c,b.image.height-2*c,S*y,O*y,k*y,E*y)});var x=e1(s);return a.getTriangles().forEach(function(b,w,_){var S=b.source,O=b.target,k=S[0][0],E=S[0][1],P=S[1][0],A=S[1][1],R=S[2][0],T=S[2][1],M=h((O[0][0]-x[0])/o),I=h(-(O[0][1]-x[1])/o),j=h((O[1][0]-x[0])/o),N=h(-(O[1][1]-x[1])/o),z=h((O[2][0]-x[0])/o),L=h(-(O[2][1]-x[1])/o),B=k,F=E;k=0,E=0,P-=B,A-=F,R-=B,T-=F;var $=[[P,A,0,0,j-M],[R,T,0,0,z-M],[0,0,P,A,N-I],[0,0,R,T,L-I]],q=ipt($);if(q){if(d.save(),d.beginPath(),Ayt()||!f){d.moveTo(j,N);for(var G=4,Y=M-j,le=I-N,K=0;K=this.minZoom;){if(this.zoomFactor_===2?(s=Math.floor(s/2),a=Math.floor(a/2),o=U1(s,s,a,a,r)):o=this.getTileRangeForExtentAndZ(l,c,r),n(c,o))return!0;--c}return!1},t.prototype.getExtent=function(){return this.extent_},t.prototype.getMaxZoom=function(){return this.maxZoom},t.prototype.getMinZoom=function(){return this.minZoom},t.prototype.getOrigin=function(e){return this.origin_?this.origin_:this.origins_[e]},t.prototype.getResolution=function(e){return this.resolutions_[e]},t.prototype.getResolutions=function(){return this.resolutions_},t.prototype.getTileCoordChildTileRange=function(e,n,r){if(e[0]this.maxZoom||n0?r:Math.max(s/a[0],o/a[1]),c=i+1,u=new Array(c),f=0;fi.highWaterMark&&(i.highWaterMark=n)},e.prototype.useTile=function(n,r,i,o){},e}(qMe),zyt=function(t){gRe(e,t);function e(n,r){var i=t.call(this,n)||this;return i.tile=r,i}return e}(Lh);function jyt(t,e){var n=/\{z\}/g,r=/\{x\}/g,i=/\{y\}/g,o=/\{-y\}/g;return function(s,a,l){if(s)return t.replace(n,s[0].toString()).replace(r,s[1].toString()).replace(i,s[2].toString()).replace(o,function(){var c=s[0],u=e.getFullTileRange(c);bn(u,55);var f=u.getHeight()-s[2]-1;return f.toString()})}}function Byt(t,e){for(var n=t.length,r=new Array(n),i=0;i=0},e.prototype.tileUrlFunction=function(n,r,i){var o=this.getTileGrid();if(o||(o=this.getTileGridForProjection(i)),!(o.getResolutions().length<=n[0])){r!=1&&(!this.hidpi_||this.serverType_===void 0)&&(r=1);var s=o.getResolution(n[0]),a=o.getTileCoordExtent(n,this.tmpExtent_),l=Jl(o.getTileSize(n[0]),this.tmpSize),c=this.gutter_;c!==0&&(l=Mhe(l,c,this.tmpSize),a=lA(a,s*c,a)),r!=1&&(l=MMe(l,r,this.tmpSize));var u={SERVICE:"WMS",VERSION:bI,REQUEST:"GetMap",FORMAT:"image/png",TRANSPARENT:!0};return hi(u,this.params_),this.getRequestUrl_(n,l,a,r,i,u)}},e}(mRe);function vRe(t){return C.jsx(D.Fragment,{children:t.children})}const wI={PRELOAD:"preload",USE_INTERIM_TILES_ON_ERROR:"useInterimTilesOnError"};var Qyt=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),Kyt=function(t){Qyt(e,t);function e(n){var r=this,i=n||{},o=hi({},i);return delete o.preload,delete o.useInterimTilesOnError,r=t.call(this,o)||this,r.on,r.once,r.un,r.setPreload(i.preload!==void 0?i.preload:0),r.setUseInterimTilesOnError(i.useInterimTilesOnError!==void 0?i.useInterimTilesOnError:!0),r}return e.prototype.getPreload=function(){return this.get(wI.PRELOAD)},e.prototype.setPreload=function(n){this.set(wI.PRELOAD,n)},e.prototype.getUseInterimTilesOnError=function(){return this.get(wI.USE_INTERIM_TILES_ON_ERROR)},e.prototype.setUseInterimTilesOnError=function(n){this.set(wI.USE_INTERIM_TILES_ON_ERROR,n)},e.prototype.getData=function(n){return t.prototype.getData.call(this,n)},e}(k4),Zyt=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),Jyt=function(t){Zyt(e,t);function e(n){var r=t.call(this,n)||this;return r.extentChanged=!0,r.renderedExtent_=null,r.renderedPixelRatio,r.renderedProjection=null,r.renderedRevision,r.renderedTiles=[],r.newTiles_=!1,r.tmpExtent=_c(),r.tmpTileRange_=new Fte(0,0,0,0),r}return e.prototype.isDrawableTile=function(n){var r=this.getLayer(),i=n.getState(),o=r.getUseInterimTilesOnError();return i==Xt.LOADED||i==Xt.EMPTY||i==Xt.ERROR&&!o},e.prototype.getTile=function(n,r,i,o){var s=o.pixelRatio,a=o.viewState.projection,l=this.getLayer(),c=l.getSource(),u=c.getTile(n,r,i,s,a);return u.getState()==Xt.ERROR&&(l.getUseInterimTilesOnError()?l.getPreload()>0&&(this.newTiles_=!0):u.setState(Xt.LOADED)),this.isDrawableTile(u)||(u=u.getInterimTile()),u},e.prototype.getData=function(n){var r=this.frameState;if(!r)return null;var i=this.getLayer(),o=Bi(r.pixelToCoordinateTransform,n.slice()),s=i.getExtent();if(s&&!FM(s,o))return null;for(var a=r.pixelRatio,l=r.viewState.projection,c=r.viewState,u=i.getRenderSource(),f=u.getTileGridForProjection(c.projection),d=u.getTilePixelRatio(r.pixelRatio),h=f.getZForResolution(c.resolution);h>=f.getMinZoom();--h){var p=f.getTileCoordForCoordAndZ(o,h),g=u.getTile(h,p[1],p[2],a,l);if(!(g instanceof Ete||g instanceof dRe))return null;if(g.getState()===Xt.LOADED){var m=f.getOrigin(h),v=Jl(f.getTileSize(h)),y=f.getResolution(h),x=Math.floor(d*((o[0]-m[0])/y-p[1]*v[0])),b=Math.floor(d*((m[1]-o[1])/y-p[2]*v[1])),w=Math.round(d*u.getGutterForProjection(c.projection));return this.getImageData(g.getImage(),x+w,b+w)}}return null},e.prototype.loadedTileCallback=function(n,r,i){return this.isDrawableTile(i)?t.prototype.loadedTileCallback.call(this,n,r,i):!1},e.prototype.prepareFrame=function(n){return!!this.getLayer().getSource()},e.prototype.renderFrame=function(n,r){var i=n.layerStatesArray[n.layerIndex],o=n.viewState,s=o.projection,a=o.resolution,l=o.center,c=o.rotation,u=n.pixelRatio,f=this.getLayer(),d=f.getSource(),h=d.getRevision(),p=d.getTileGridForProjection(s),g=p.getZForResolution(a,d.zDirection),m=p.getResolution(g),v=n.extent,y=n.viewState.resolution,x=d.getTilePixelRatio(u),b=Math.round(Kr(v)/y*u),w=Math.round(Ou(v)/y*u),_=i.extent&&ux(i.extent);_&&(v=tk(v,ux(i.extent)));var S=m*b/2/x,O=m*w/2/x,k=[l[0]-S,l[1]-O,l[0]+S,l[1]+O],E=p.getTileRangeForExtentAndZ(v,g),P={};P[g]={};var A=this.createLoadedTileFinder(d,s,P),R=this.tmpExtent,T=this.tmpTileRange_;this.newTiles_=!1;for(var M=c?vq(o.center,y,c,n.size):void 0,I=E.minX;I<=E.maxX;++I)for(var j=E.minY;j<=E.maxY;++j)if(!(c&&!p.tileCoordIntersectsViewport([g,I,j],M))){var N=this.getTile(g,I,j,n);if(this.isDrawableTile(N)){var z=or(this);if(N.getState()==Xt.LOADED){P[g][N.tileCoord.toString()]=N;var L=N.inTransition(z);L&&i.opacity!==1&&(N.endTransition(z),L=!1),!this.newTiles_&&(L||this.renderedTiles.indexOf(N)===-1)&&(this.newTiles_=!0)}if(N.getAlpha(z,n.time)===1)continue}var B=p.getTileCoordChildTileRange(N.tileCoord,T,R),F=!1;B&&(F=A(g+1,B)),F||p.forEachTileCoordParentTileRange(N.tileCoord,A,T,R)}var $=m/a*u/x;Pg(this.pixelTransform,n.size[0]/2,n.size[1]/2,1/u,1/u,c,-b/2,-w/2);var q=oMe(this.pixelTransform);this.useContainer(r,q,this.getBackground(n));var G=this.context,Y=G.canvas;ote(this.inversePixelTransform,this.pixelTransform),Pg(this.tempTransform,b/2,w/2,$,$,0,-b/2,-w/2),Y.width!=b||Y.height!=w?(Y.width=b,Y.height=w):this.containerReused||G.clearRect(0,0,b,w),_&&this.clipUnrotated(G,n,_),d.getInterpolate()||hi(G,Lq),this.preRender(G,n),this.renderedTiles.length=0;var le=Object.keys(P).map(Number);le.sort(ob);var K,ee,re;i.opacity===1&&(!this.containerReused||d.getOpaque(n.viewState.projection))?le=le.reverse():(K=[],ee=[]);for(var ge=le.length-1;ge>=0;--ge){var te=le[ge],ae=d.getTilePixelSize(te,u,s),U=p.getResolution(te),oe=U/m,ne=ae[0]*oe*$,V=ae[1]*oe*$,X=p.getTileCoordForCoordAndZ(e1(k),te),Z=p.getTileCoordExtent(X),he=Bi(this.tempTransform,[x*(Z[0]-k[0])/m,x*(k[3]-Z[3])/m]),xe=x*d.getGutterForProjection(s),H=P[te];for(var W in H){var N=H[W],J=N.tileCoord,se=X[1]-J[1],ye=Math.round(he[0]-(se-1)*ne),ie=X[2]-J[2],fe=Math.round(he[1]-(ie-1)*V),I=Math.round(he[0]-se*ne),j=Math.round(he[1]-ie*V),Q=ye-I,_e=fe-j,we=g===te,L=we&&N.getAlpha(or(this),n.time)!==1,Ie=!1;if(!L)if(K){re=[I,j,I+Q,j,I+Q,j+_e,I,j+_e];for(var Pe=0,Me=K.length;Pe{const r=this.props.onClick;r&&r(n)});gn(this,"handleDrop",n=>{if(this.props.onDropFiles){n.preventDefault();const r=[];if(n.dataTransfer.items)for(let i=0;i{this.props.onDropFiles&&n.preventDefault()});gn(this,"handleRef",n=>{this.contextValue.mapDiv=n});gn(this,"handleResize",()=>{const n=this.contextValue.mapDiv,r=this.contextValue.map;if(n&&r){r.updateSize();const i=r.getView(),o=this.getMinZoom(n);o!==i.getMinZoom()&&i.setMinZoom(o)}});gn(this,"getMinZoom",n=>{const r=n.clientWidth,i=Math.LOG2E*Math.log(r/256);return i>=0?i:0});const{id:r,mapObjects:i}=n;i?this.contextValue={map:i[r]||void 0,mapObjects:i}:this.contextValue={mapObjects:{}}}componentDidMount(){const{id:n}=this.props,r=this.contextValue.mapDiv;let i=null;if(this.props.isStale){const s=this.contextValue.mapObjects[n];s instanceof npe&&(i=s,i.setTarget(r),this.clickEventsKey&&i.un("click",this.clickEventsKey.listener))}if(!i){const s=this.getMinZoom(r),a=new Np({projection:xRe,center:[0,0],minZoom:s,zoom:s});i=new npe({view:a,...this.getMapOptions(),target:r})}this.contextValue.map=i,this.contextValue.mapObjects[n]=i,this.clickEventsKey=i.on("click",this.handleClick),i.updateSize(),this.forceUpdate(),window.addEventListener("resize",this.handleResize);const o=this.props.onMapRef;o&&o(i)}componentDidUpdate(n){const r=this.contextValue.map,i=this.contextValue.mapDiv,o=this.getMapOptions();r.setProperties({...o}),r.setTarget(i),r.updateSize()}componentWillUnmount(){window.removeEventListener("resize",this.handleResize);const n=this.props.onMapRef;n&&n(null)}render(){let n;return this.contextValue.map&&(n=C.jsx(bRe.Provider,{value:this.contextValue,children:this.props.children})),C.jsx("div",{ref:this.handleRef,style:i0t,onDragOver:this.handleDragOver,onDrop:this.handleDrop,children:n})}getMapOptions(){const n={...this.props};return delete n.children,delete n.onClick,delete n.onDropFiles,n}};class nO extends D.PureComponent{constructor(){super(...arguments);gn(this,"context",{});gn(this,"object",null)}getMapObject(n){return this.context.mapObjects&&this.context.mapObjects[n]||null}getOptions(){const n={...this.props};return delete n.id,n}componentDidMount(){this._updateMapObject(this.addMapObject(this.context.map))}componentDidUpdate(n){this._updateMapObject(this.updateMapObject(this.context.map,this.object,n))}componentWillUnmount(){const n=this.context.map;this.removeMapObject(n,this.object),this.props.id&&delete this.context.mapObjects[this.props.id],this.object=null}_updateMapObject(n){n!=null&&this.props.id&&(n.set("objectId",this.props.id),this.context.mapObjects[this.props.id]=n),this.object=n}render(){return null}}gn(nO,"contextType",bRe);function wRe(t,e,n){W1(t,e,n,"visible",!0),W1(t,e,n,"opacity",1),W1(t,e,n,"zIndex",void 0),W1(t,e,n,"extent",void 0),W1(t,e,n,"minResolution",void 0),W1(t,e,n,"maxResolution",void 0)}function W1(t,e,n,r,i){const o=lpe(e[r],i),s=lpe(n[r],i);o!==s&&t.set(r,s)}function lpe(t,e){return t===void 0?e:t}let Ga;Ga=()=>{};class _Re extends nO{addMapObject(e){const n=new yRe(this.props);return n.set("id",this.props.id),e.getLayers().push(n),n}updateMapObject(e,n,r){const i=n.getSource(),o=this.props.source||null;if(i===o)return n;if(o!==null&&i!==o){let s=!0;if(i instanceof Fq&&o instanceof Fq){const c=i,u=o,f=c.getTileGrid(),d=u.getTileGrid();if(s0t(f,d)){Ga("--> Equal tile grids!");const h=c.getUrls(),p=u.getUrls();h!==p&&p&&(h===null||h[0]!==p[0])&&(c.setUrls(p),s=!1);const g=c.getTileLoadFunction(),m=u.getTileLoadFunction();g!==m&&(c.setTileLoadFunction(m),s=!1);const v=c.getTileUrlFunction(),y=u.getTileUrlFunction();v!==y&&(c.setTileUrlFunction(y),s=!1)}else Ga("--> Tile grids are not equal!")}const a=i==null?void 0:i.getInterpolate(),l=o==null?void 0:o.getInterpolate();a!==l&&(s=!0),s?(n.setSource(o),Ga("--> Replaced source (expect flickering!)")):Ga("--> Updated source (check, is it still flickering?)")}return wRe(n,r,this.props),n}removeMapObject(e,n){e.getLayers().remove(n)}}new eO({url:"https://a.tiles.mapbox.com/v3/mapbox.natural-earth-2/{z}/{x}/{y}.png",attributions:["© MapBox","© MapBox and contributors"]});new eO({url:"https://gis.ngdc.noaa.gov/arcgis/rest/services/web_mercator/gebco_2014_contours/MapServer/tile/{z}/{y}/{x}",attributions:["© GEBCO","© NOAHH and contributors"]});new r0t;new eO({url:"https://tiles.wmflabs.org/bw-mapnik/{z}/{x}/{y}.png",attributions:["© OpenStreetMap contributors"]});function s0t(t,e){if(t===e)return!0;if(t===null||e===null||(Ga("tile grid:",t,e),Ga("min zoom:",t.getMinZoom(),e.getMinZoom()),Ga("max zoom:",t.getMaxZoom(),e.getMaxZoom()),t.getMinZoom()!==e.getMinZoom()||t.getMaxZoom()!==e.getMaxZoom()))return!1;const n=t.getExtent(),r=e.getExtent();Ga("extent:",n,r);for(let a=0;a"u")throw new nN(`assertion failed: ${e} must not be undefined`)}function c0t(t,e){a0t(t,e),l0t(t,e)}function OW(t,e){if(Array.isArray(t)){if(t.length===0)throw new nN(`assertion failed: ${e} must be a non-empty array`)}else throw new nN(`assertion failed: ${e} must be an array`)}function yA(t,e){return e&&t.find(n=>n.id===e)||null}function Nq(t,e){return e&&t.variables.find(n=>n.name===e)||null}function u0t(t){return t.variables.findIndex(e=>Kb(e.expression))}function Bte(t){const e=u0t(t);return e>=0?[t.variables.slice(0,e),t.variables.slice(e)]:[t.variables,[]]}function SRe(t){c0t(t,"dataset"),OW(t.dimensions,"dataset.dimensions");const e=t.dimensions.find(n=>n.name==="time");return e?(OW(e.coordinates,"timeDimension.coordinates"),OW(e.labels,"timeDimension.labels"),e):null}function CRe(t){const e=SRe(t);if(!e)return null;const n=e.coordinates;return[n[0],n[n.length-1]]}function Uf(t){return(t||"")+Math.random().toString(16).substring(2)}const rO="user-",_f=rO+"drawing";function Ute(t,e){return{type:"FeatureCollection",features:e,id:Uf(rO),title:t}}function Wte(t,e){return{type:"Feature",geometry:new t1().writeGeometryObject(t),properties:e,id:Uf(rO)}}const f0t=GM(["label","title","name","id"]),d0t=GM(["description","desc","abstract","comment"]),h0t=GM(["color"]),p0t=GM(["opacity"]),g0t=GM(["image","img","picture","pic"]);function m0t(t,e){const n={};return FE(n,t,e,"label",e.id+"",f0t),FE(n,t,e,"color",rb(x0t(e)),h0t),FE(n,t,e,"opacity",.2,p0t),FE(n,t,e,"image",null,g0t),FE(n,t,e,"description",null,d0t),{placeGroup:t,place:e,...n}}const L4=QPe(m0t);function FE(t,e,n,r,i,o){let s;const a=e.propertyMapping&&e.propertyMapping[r];if(a){if(a.includes("${")){t[r]=v0t(n,a);return}o.length>0&&o[0]!==a&&(o=[a,...o])}n.properties&&(s=cpe(n.properties,o)),s===void 0&&(s=cpe(n,o)),t[r]=s||i}function v0t(t,e){let n=e;if(t.properties)for(const r of Object.getOwnPropertyNames(t.properties)){if(!n.includes("${"))break;const i="${"+r+"}";n.includes(i)&&(n=n.replace(i,`${t.properties[r]}`))}return n}function cpe(t,e){let n;for(const r of e)if(r in t)return t[r];return n}function GM(t){let e=[];for(const n of t)e=e.concat(n.toLowerCase(),n.toUpperCase(),n[0].toUpperCase()+n.substring(1).toLowerCase());return e}function Vte(t,e){t.forEach(n=>{iO(n)&&n.features.forEach(r=>{e(n,r)})})}function y0t(t,e){const n=Kb(e)?(r,i)=>i.id===e:e;for(const r of t)if(iO(r)){const i=r.features.find(o=>n(r,o));if(i)return L4(r,i)}return null}function x0t(t){const e=t.id+"";let n=0,r,i;if(e.length===0)return n;for(r=0;ri.id===e);if(n)return n;const r=t.placeGroups;if(r)for(const i in r){const o=ORe(r[i],e);if(o)return o}return null}function Gte(t,e){if(e)for(const n of t){const r=ORe(n,e);if(r!==null)return r}return null}function ERe(t,e){const n=t.length;if(n===0)return-1;if(n===1)return 0;let r=0,i=n-1;if(e<=t[r])return r;if(e>=t[i])return i;let o=Math.floor(n/2),s;for(let a=0;as)[r,o]=[o,Math.floor((o+i)/2)];else return o;if(r===o||o===i)return Math.abs(t[r]-e)<=Math.abs(t[i]-e)?r:i}return-1}function qn(t){if(t===null||t===!0||t===!1)return NaN;var e=Number(t);return isNaN(e)?e:e<0?Math.ceil(e):Math.floor(e)}function At(t,e){if(e.length1?"s":"")+" required, but only "+e.length+" present")}function Ft(t){At(1,arguments);var e=Object.prototype.toString.call(t);return t instanceof Date||Cg(t)==="object"&&e==="[object Date]"?new Date(t.getTime()):typeof t=="number"||e==="[object Number]"?new Date(t):((typeof t=="string"||e==="[object String]")&&typeof console<"u"&&(console.warn("Starting with v2.0.0-beta.1 date-fns doesn't accept strings as date arguments. Please use `parseISO` to parse strings. See: https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#string-arguments"),console.warn(new Error().stack)),new Date(NaN))}function TRe(t,e){At(2,arguments);var n=Ft(t),r=qn(e);return isNaN(r)?new Date(NaN):(r&&n.setDate(n.getDate()+r),n)}function kRe(t,e){At(2,arguments);var n=Ft(t),r=qn(e);if(isNaN(r))return new Date(NaN);if(!r)return n;var i=n.getDate(),o=new Date(n.getTime());o.setMonth(n.getMonth()+r+1,0);var s=o.getDate();return i>=s?o:(n.setFullYear(o.getFullYear(),o.getMonth(),i),n)}function $4(t,e){At(2,arguments);var n=Ft(t).getTime(),r=qn(e);return new Date(n+r)}var b0t=36e5;function w0t(t,e){At(2,arguments);var n=qn(e);return $4(t,n*b0t)}var _0t={};function Fh(){return _0t}function xA(t,e){var n,r,i,o,s,a,l,c;At(1,arguments);var u=Fh(),f=qn((n=(r=(i=(o=e==null?void 0:e.weekStartsOn)!==null&&o!==void 0?o:e==null||(s=e.locale)===null||s===void 0||(a=s.options)===null||a===void 0?void 0:a.weekStartsOn)!==null&&i!==void 0?i:u.weekStartsOn)!==null&&r!==void 0?r:(l=u.locale)===null||l===void 0||(c=l.options)===null||c===void 0?void 0:c.weekStartsOn)!==null&&n!==void 0?n:0);if(!(f>=0&&f<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var d=Ft(t),h=d.getDay(),p=(h=0&&f<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var d=Ft(t),h=d.getDay(),p=(h=i.getTime()?n+1:e.getTime()>=s.getTime()?n:n-1}function F0t(t){At(1,arguments);var e=RRe(t),n=new Date(0);n.setUTCFullYear(e,0,4),n.setUTCHours(0,0,0,0);var r=kS(n);return r}var N0t=6048e5;function DRe(t){At(1,arguments);var e=Ft(t),n=kS(e).getTime()-F0t(e).getTime();return Math.round(n/N0t)+1}function lb(t,e){var n,r,i,o,s,a,l,c;At(1,arguments);var u=Fh(),f=qn((n=(r=(i=(o=e==null?void 0:e.weekStartsOn)!==null&&o!==void 0?o:e==null||(s=e.locale)===null||s===void 0||(a=s.options)===null||a===void 0?void 0:a.weekStartsOn)!==null&&i!==void 0?i:u.weekStartsOn)!==null&&r!==void 0?r:(l=u.locale)===null||l===void 0||(c=l.options)===null||c===void 0?void 0:c.weekStartsOn)!==null&&n!==void 0?n:0);if(!(f>=0&&f<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var d=Ft(t),h=d.getUTCDay(),p=(h=1&&h<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var p=new Date(0);p.setUTCFullYear(f+1,0,h),p.setUTCHours(0,0,0,0);var g=lb(p,e),m=new Date(0);m.setUTCFullYear(f,0,h),m.setUTCHours(0,0,0,0);var v=lb(m,e);return u.getTime()>=g.getTime()?f+1:u.getTime()>=v.getTime()?f:f-1}function z0t(t,e){var n,r,i,o,s,a,l,c;At(1,arguments);var u=Fh(),f=qn((n=(r=(i=(o=e==null?void 0:e.firstWeekContainsDate)!==null&&o!==void 0?o:e==null||(s=e.locale)===null||s===void 0||(a=s.options)===null||a===void 0?void 0:a.firstWeekContainsDate)!==null&&i!==void 0?i:u.firstWeekContainsDate)!==null&&r!==void 0?r:(l=u.locale)===null||l===void 0||(c=l.options)===null||c===void 0?void 0:c.firstWeekContainsDate)!==null&&n!==void 0?n:1),d=Xte(t,e),h=new Date(0);h.setUTCFullYear(d,0,f),h.setUTCHours(0,0,0,0);var p=lb(h,e);return p}var j0t=6048e5;function IRe(t,e){At(1,arguments);var n=Ft(t),r=lb(n,e).getTime()-z0t(n,e).getTime();return Math.round(r/j0t)+1}function mr(t,e){for(var n=t<0?"-":"",r=Math.abs(t).toString();r.length0?r:1-r;return mr(n==="yy"?i%100:i,n.length)},M:function(e,n){var r=e.getUTCMonth();return n==="M"?String(r+1):mr(r+1,2)},d:function(e,n){return mr(e.getUTCDate(),n.length)},a:function(e,n){var r=e.getUTCHours()/12>=1?"pm":"am";switch(n){case"a":case"aa":return r.toUpperCase();case"aaa":return r;case"aaaaa":return r[0];case"aaaa":default:return r==="am"?"a.m.":"p.m."}},h:function(e,n){return mr(e.getUTCHours()%12||12,n.length)},H:function(e,n){return mr(e.getUTCHours(),n.length)},m:function(e,n){return mr(e.getUTCMinutes(),n.length)},s:function(e,n){return mr(e.getUTCSeconds(),n.length)},S:function(e,n){var r=n.length,i=e.getUTCMilliseconds(),o=Math.floor(i*Math.pow(10,r-3));return mr(o,n.length)}},V1={am:"am",pm:"pm",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},B0t={G:function(e,n,r){var i=e.getUTCFullYear()>0?1:0;switch(n){case"G":case"GG":case"GGG":return r.era(i,{width:"abbreviated"});case"GGGGG":return r.era(i,{width:"narrow"});case"GGGG":default:return r.era(i,{width:"wide"})}},y:function(e,n,r){if(n==="yo"){var i=e.getUTCFullYear(),o=i>0?i:1-i;return r.ordinalNumber(o,{unit:"year"})}return pm.y(e,n)},Y:function(e,n,r,i){var o=Xte(e,i),s=o>0?o:1-o;if(n==="YY"){var a=s%100;return mr(a,2)}return n==="Yo"?r.ordinalNumber(s,{unit:"year"}):mr(s,n.length)},R:function(e,n){var r=RRe(e);return mr(r,n.length)},u:function(e,n){var r=e.getUTCFullYear();return mr(r,n.length)},Q:function(e,n,r){var i=Math.ceil((e.getUTCMonth()+1)/3);switch(n){case"Q":return String(i);case"QQ":return mr(i,2);case"Qo":return r.ordinalNumber(i,{unit:"quarter"});case"QQQ":return r.quarter(i,{width:"abbreviated",context:"formatting"});case"QQQQQ":return r.quarter(i,{width:"narrow",context:"formatting"});case"QQQQ":default:return r.quarter(i,{width:"wide",context:"formatting"})}},q:function(e,n,r){var i=Math.ceil((e.getUTCMonth()+1)/3);switch(n){case"q":return String(i);case"qq":return mr(i,2);case"qo":return r.ordinalNumber(i,{unit:"quarter"});case"qqq":return r.quarter(i,{width:"abbreviated",context:"standalone"});case"qqqqq":return r.quarter(i,{width:"narrow",context:"standalone"});case"qqqq":default:return r.quarter(i,{width:"wide",context:"standalone"})}},M:function(e,n,r){var i=e.getUTCMonth();switch(n){case"M":case"MM":return pm.M(e,n);case"Mo":return r.ordinalNumber(i+1,{unit:"month"});case"MMM":return r.month(i,{width:"abbreviated",context:"formatting"});case"MMMMM":return r.month(i,{width:"narrow",context:"formatting"});case"MMMM":default:return r.month(i,{width:"wide",context:"formatting"})}},L:function(e,n,r){var i=e.getUTCMonth();switch(n){case"L":return String(i+1);case"LL":return mr(i+1,2);case"Lo":return r.ordinalNumber(i+1,{unit:"month"});case"LLL":return r.month(i,{width:"abbreviated",context:"standalone"});case"LLLLL":return r.month(i,{width:"narrow",context:"standalone"});case"LLLL":default:return r.month(i,{width:"wide",context:"standalone"})}},w:function(e,n,r,i){var o=IRe(e,i);return n==="wo"?r.ordinalNumber(o,{unit:"week"}):mr(o,n.length)},I:function(e,n,r){var i=DRe(e);return n==="Io"?r.ordinalNumber(i,{unit:"week"}):mr(i,n.length)},d:function(e,n,r){return n==="do"?r.ordinalNumber(e.getUTCDate(),{unit:"date"}):pm.d(e,n)},D:function(e,n,r){var i=$0t(e);return n==="Do"?r.ordinalNumber(i,{unit:"dayOfYear"}):mr(i,n.length)},E:function(e,n,r){var i=e.getUTCDay();switch(n){case"E":case"EE":case"EEE":return r.day(i,{width:"abbreviated",context:"formatting"});case"EEEEE":return r.day(i,{width:"narrow",context:"formatting"});case"EEEEEE":return r.day(i,{width:"short",context:"formatting"});case"EEEE":default:return r.day(i,{width:"wide",context:"formatting"})}},e:function(e,n,r,i){var o=e.getUTCDay(),s=(o-i.weekStartsOn+8)%7||7;switch(n){case"e":return String(s);case"ee":return mr(s,2);case"eo":return r.ordinalNumber(s,{unit:"day"});case"eee":return r.day(o,{width:"abbreviated",context:"formatting"});case"eeeee":return r.day(o,{width:"narrow",context:"formatting"});case"eeeeee":return r.day(o,{width:"short",context:"formatting"});case"eeee":default:return r.day(o,{width:"wide",context:"formatting"})}},c:function(e,n,r,i){var o=e.getUTCDay(),s=(o-i.weekStartsOn+8)%7||7;switch(n){case"c":return String(s);case"cc":return mr(s,n.length);case"co":return r.ordinalNumber(s,{unit:"day"});case"ccc":return r.day(o,{width:"abbreviated",context:"standalone"});case"ccccc":return r.day(o,{width:"narrow",context:"standalone"});case"cccccc":return r.day(o,{width:"short",context:"standalone"});case"cccc":default:return r.day(o,{width:"wide",context:"standalone"})}},i:function(e,n,r){var i=e.getUTCDay(),o=i===0?7:i;switch(n){case"i":return String(o);case"ii":return mr(o,n.length);case"io":return r.ordinalNumber(o,{unit:"day"});case"iii":return r.day(i,{width:"abbreviated",context:"formatting"});case"iiiii":return r.day(i,{width:"narrow",context:"formatting"});case"iiiiii":return r.day(i,{width:"short",context:"formatting"});case"iiii":default:return r.day(i,{width:"wide",context:"formatting"})}},a:function(e,n,r){var i=e.getUTCHours(),o=i/12>=1?"pm":"am";switch(n){case"a":case"aa":return r.dayPeriod(o,{width:"abbreviated",context:"formatting"});case"aaa":return r.dayPeriod(o,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return r.dayPeriod(o,{width:"narrow",context:"formatting"});case"aaaa":default:return r.dayPeriod(o,{width:"wide",context:"formatting"})}},b:function(e,n,r){var i=e.getUTCHours(),o;switch(i===12?o=V1.noon:i===0?o=V1.midnight:o=i/12>=1?"pm":"am",n){case"b":case"bb":return r.dayPeriod(o,{width:"abbreviated",context:"formatting"});case"bbb":return r.dayPeriod(o,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return r.dayPeriod(o,{width:"narrow",context:"formatting"});case"bbbb":default:return r.dayPeriod(o,{width:"wide",context:"formatting"})}},B:function(e,n,r){var i=e.getUTCHours(),o;switch(i>=17?o=V1.evening:i>=12?o=V1.afternoon:i>=4?o=V1.morning:o=V1.night,n){case"B":case"BB":case"BBB":return r.dayPeriod(o,{width:"abbreviated",context:"formatting"});case"BBBBB":return r.dayPeriod(o,{width:"narrow",context:"formatting"});case"BBBB":default:return r.dayPeriod(o,{width:"wide",context:"formatting"})}},h:function(e,n,r){if(n==="ho"){var i=e.getUTCHours()%12;return i===0&&(i=12),r.ordinalNumber(i,{unit:"hour"})}return pm.h(e,n)},H:function(e,n,r){return n==="Ho"?r.ordinalNumber(e.getUTCHours(),{unit:"hour"}):pm.H(e,n)},K:function(e,n,r){var i=e.getUTCHours()%12;return n==="Ko"?r.ordinalNumber(i,{unit:"hour"}):mr(i,n.length)},k:function(e,n,r){var i=e.getUTCHours();return i===0&&(i=24),n==="ko"?r.ordinalNumber(i,{unit:"hour"}):mr(i,n.length)},m:function(e,n,r){return n==="mo"?r.ordinalNumber(e.getUTCMinutes(),{unit:"minute"}):pm.m(e,n)},s:function(e,n,r){return n==="so"?r.ordinalNumber(e.getUTCSeconds(),{unit:"second"}):pm.s(e,n)},S:function(e,n){return pm.S(e,n)},X:function(e,n,r,i){var o=i._originalDate||e,s=o.getTimezoneOffset();if(s===0)return"Z";switch(n){case"X":return hpe(s);case"XXXX":case"XX":return z0(s);case"XXXXX":case"XXX":default:return z0(s,":")}},x:function(e,n,r,i){var o=i._originalDate||e,s=o.getTimezoneOffset();switch(n){case"x":return hpe(s);case"xxxx":case"xx":return z0(s);case"xxxxx":case"xxx":default:return z0(s,":")}},O:function(e,n,r,i){var o=i._originalDate||e,s=o.getTimezoneOffset();switch(n){case"O":case"OO":case"OOO":return"GMT"+dpe(s,":");case"OOOO":default:return"GMT"+z0(s,":")}},z:function(e,n,r,i){var o=i._originalDate||e,s=o.getTimezoneOffset();switch(n){case"z":case"zz":case"zzz":return"GMT"+dpe(s,":");case"zzzz":default:return"GMT"+z0(s,":")}},t:function(e,n,r,i){var o=i._originalDate||e,s=Math.floor(o.getTime()/1e3);return mr(s,n.length)},T:function(e,n,r,i){var o=i._originalDate||e,s=o.getTime();return mr(s,n.length)}};function dpe(t,e){var n=t>0?"-":"+",r=Math.abs(t),i=Math.floor(r/60),o=r%60;if(o===0)return n+String(i);var s=e;return n+String(i)+s+mr(o,2)}function hpe(t,e){if(t%60===0){var n=t>0?"-":"+";return n+mr(Math.abs(t)/60,2)}return z0(t,e)}function z0(t,e){var n=e||"",r=t>0?"-":"+",i=Math.abs(t),o=mr(Math.floor(i/60),2),s=mr(i%60,2);return r+o+n+s}var ppe=function(e,n){switch(e){case"P":return n.date({width:"short"});case"PP":return n.date({width:"medium"});case"PPP":return n.date({width:"long"});case"PPPP":default:return n.date({width:"full"})}},LRe=function(e,n){switch(e){case"p":return n.time({width:"short"});case"pp":return n.time({width:"medium"});case"ppp":return n.time({width:"long"});case"pppp":default:return n.time({width:"full"})}},U0t=function(e,n){var r=e.match(/(P+)(p+)?/)||[],i=r[1],o=r[2];if(!o)return ppe(e,n);var s;switch(i){case"P":s=n.dateTime({width:"short"});break;case"PP":s=n.dateTime({width:"medium"});break;case"PPP":s=n.dateTime({width:"long"});break;case"PPPP":default:s=n.dateTime({width:"full"});break}return s.replace("{{date}}",ppe(i,n)).replace("{{time}}",LRe(o,n))},jq={p:LRe,P:U0t},W0t=["D","DD"],V0t=["YY","YYYY"];function $Re(t){return W0t.indexOf(t)!==-1}function FRe(t){return V0t.indexOf(t)!==-1}function rN(t,e,n){if(t==="YYYY")throw new RangeError("Use `yyyy` instead of `YYYY` (in `".concat(e,"`) for formatting years to the input `").concat(n,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if(t==="YY")throw new RangeError("Use `yy` instead of `YY` (in `".concat(e,"`) for formatting years to the input `").concat(n,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if(t==="D")throw new RangeError("Use `d` instead of `D` (in `".concat(e,"`) for formatting days of the month to the input `").concat(n,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if(t==="DD")throw new RangeError("Use `dd` instead of `DD` (in `".concat(e,"`) for formatting days of the month to the input `").concat(n,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"))}var G0t={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},H0t=function(e,n,r){var i,o=G0t[e];return typeof o=="string"?i=o:n===1?i=o.one:i=o.other.replace("{{count}}",n.toString()),r!=null&&r.addSuffix?r.comparison&&r.comparison>0?"in "+i:i+" ago":i};function EW(t){return function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=e.width?String(e.width):t.defaultWidth,r=t.formats[n]||t.formats[t.defaultWidth];return r}}var q0t={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},X0t={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},Y0t={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},Q0t={date:EW({formats:q0t,defaultWidth:"full"}),time:EW({formats:X0t,defaultWidth:"full"}),dateTime:EW({formats:Y0t,defaultWidth:"full"})},K0t={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},Z0t=function(e,n,r,i){return K0t[e]};function NE(t){return function(e,n){var r=n!=null&&n.context?String(n.context):"standalone",i;if(r==="formatting"&&t.formattingValues){var o=t.defaultFormattingWidth||t.defaultWidth,s=n!=null&&n.width?String(n.width):o;i=t.formattingValues[s]||t.formattingValues[o]}else{var a=t.defaultWidth,l=n!=null&&n.width?String(n.width):t.defaultWidth;i=t.values[l]||t.values[a]}var c=t.argumentCallback?t.argumentCallback(e):e;return i[c]}}var J0t={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},ext={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},txt={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},nxt={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},rxt={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},ixt={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},oxt=function(e,n){var r=Number(e),i=r%100;if(i>20||i<10)switch(i%10){case 1:return r+"st";case 2:return r+"nd";case 3:return r+"rd"}return r+"th"},sxt={ordinalNumber:oxt,era:NE({values:J0t,defaultWidth:"wide"}),quarter:NE({values:ext,defaultWidth:"wide",argumentCallback:function(e){return e-1}}),month:NE({values:txt,defaultWidth:"wide"}),day:NE({values:nxt,defaultWidth:"wide"}),dayPeriod:NE({values:rxt,defaultWidth:"wide",formattingValues:ixt,defaultFormattingWidth:"wide"})};function zE(t){return function(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=n.width,i=r&&t.matchPatterns[r]||t.matchPatterns[t.defaultMatchWidth],o=e.match(i);if(!o)return null;var s=o[0],a=r&&t.parsePatterns[r]||t.parsePatterns[t.defaultParseWidth],l=Array.isArray(a)?lxt(a,function(f){return f.test(s)}):axt(a,function(f){return f.test(s)}),c;c=t.valueCallback?t.valueCallback(l):l,c=n.valueCallback?n.valueCallback(c):c;var u=e.slice(s.length);return{value:c,rest:u}}}function axt(t,e){for(var n in t)if(t.hasOwnProperty(n)&&e(t[n]))return n}function lxt(t,e){for(var n=0;n1&&arguments[1]!==void 0?arguments[1]:{},r=e.match(t.matchPattern);if(!r)return null;var i=r[0],o=e.match(t.parsePattern);if(!o)return null;var s=t.valueCallback?t.valueCallback(o[0]):o[0];s=n.valueCallback?n.valueCallback(s):s;var a=e.slice(i.length);return{value:s,rest:a}}}var uxt=/^(\d+)(th|st|nd|rd)?/i,fxt=/\d+/i,dxt={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},hxt={any:[/^b/i,/^(a|c)/i]},pxt={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},gxt={any:[/1/i,/2/i,/3/i,/4/i]},mxt={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},vxt={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},yxt={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},xxt={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},bxt={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},wxt={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},_xt={ordinalNumber:cxt({matchPattern:uxt,parsePattern:fxt,valueCallback:function(e){return parseInt(e,10)}}),era:zE({matchPatterns:dxt,defaultMatchWidth:"wide",parsePatterns:hxt,defaultParseWidth:"any"}),quarter:zE({matchPatterns:pxt,defaultMatchWidth:"wide",parsePatterns:gxt,defaultParseWidth:"any",valueCallback:function(e){return e+1}}),month:zE({matchPatterns:mxt,defaultMatchWidth:"wide",parsePatterns:vxt,defaultParseWidth:"any"}),day:zE({matchPatterns:yxt,defaultMatchWidth:"wide",parsePatterns:xxt,defaultParseWidth:"any"}),dayPeriod:zE({matchPatterns:bxt,defaultMatchWidth:"any",parsePatterns:wxt,defaultParseWidth:"any"})},Yte={code:"en-US",formatDistance:H0t,formatLong:Q0t,formatRelative:Z0t,localize:sxt,match:_xt,options:{weekStartsOn:0,firstWeekContainsDate:1}},Sxt=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,Cxt=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,Oxt=/^'([^]*?)'?$/,Ext=/''/g,Txt=/[a-zA-Z]/;function kxt(t,e,n){var r,i,o,s,a,l,c,u,f,d,h,p,g,m,v,y,x,b;At(2,arguments);var w=String(e),_=Fh(),S=(r=(i=n==null?void 0:n.locale)!==null&&i!==void 0?i:_.locale)!==null&&r!==void 0?r:Yte,O=qn((o=(s=(a=(l=n==null?void 0:n.firstWeekContainsDate)!==null&&l!==void 0?l:n==null||(c=n.locale)===null||c===void 0||(u=c.options)===null||u===void 0?void 0:u.firstWeekContainsDate)!==null&&a!==void 0?a:_.firstWeekContainsDate)!==null&&s!==void 0?s:(f=_.locale)===null||f===void 0||(d=f.options)===null||d===void 0?void 0:d.firstWeekContainsDate)!==null&&o!==void 0?o:1);if(!(O>=1&&O<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var k=qn((h=(p=(g=(m=n==null?void 0:n.weekStartsOn)!==null&&m!==void 0?m:n==null||(v=n.locale)===null||v===void 0||(y=v.options)===null||y===void 0?void 0:y.weekStartsOn)!==null&&g!==void 0?g:_.weekStartsOn)!==null&&p!==void 0?p:(x=_.locale)===null||x===void 0||(b=x.options)===null||b===void 0?void 0:b.weekStartsOn)!==null&&h!==void 0?h:0);if(!(k>=0&&k<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");if(!S.localize)throw new RangeError("locale must contain localize property");if(!S.formatLong)throw new RangeError("locale must contain formatLong property");var E=Ft(t);if(!PRe(E))throw new RangeError("Invalid time value");var P=ARe(E),A=MRe(E,P),R={firstWeekContainsDate:O,weekStartsOn:k,locale:S,_originalDate:E},T=w.match(Cxt).map(function(M){var I=M[0];if(I==="p"||I==="P"){var j=jq[I];return j(M,S.formatLong)}return M}).join("").match(Sxt).map(function(M){if(M==="''")return"'";var I=M[0];if(I==="'")return Axt(M);var j=B0t[I];if(j)return!(n!=null&&n.useAdditionalWeekYearTokens)&&FRe(M)&&rN(M,e,String(t)),!(n!=null&&n.useAdditionalDayOfYearTokens)&&$Re(M)&&rN(M,e,String(t)),j(A,M,S.localize,R);if(I.match(Txt))throw new RangeError("Format string contains an unescaped latin alphabet character `"+I+"`");return M}).join("");return T}function Axt(t){var e=t.match(Oxt);return e?e[1].replace(Ext,"'"):t}function Pxt(t,e){if(t==null)throw new TypeError("assign requires that input parameter not be null or undefined");for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t}function Mxt(t){At(1,arguments);var e=Ft(t),n=e.getDate();return n}function NRe(t){At(1,arguments);var e=Ft(t),n=e.getFullYear(),r=e.getMonth(),i=new Date(0);return i.setFullYear(n,r+1,0),i.setHours(0,0,0,0),i.getDate()}function Rxt(t){At(1,arguments);var e=Ft(t),n=e.getHours();return n}function Dxt(t){At(1,arguments);var e=Ft(t),n=e.getMilliseconds();return n}function Ixt(t){At(1,arguments);var e=Ft(t),n=e.getMinutes();return n}function Lxt(t){At(1,arguments);var e=Ft(t),n=e.getMonth();return n}function $xt(t){At(1,arguments);var e=Ft(t),n=e.getSeconds();return n}function Fxt(t,e){var n,r,i,o,s,a,l,c;At(1,arguments);var u=Ft(t),f=u.getFullYear(),d=Fh(),h=qn((n=(r=(i=(o=e==null?void 0:e.firstWeekContainsDate)!==null&&o!==void 0?o:e==null||(s=e.locale)===null||s===void 0||(a=s.options)===null||a===void 0?void 0:a.firstWeekContainsDate)!==null&&i!==void 0?i:d.firstWeekContainsDate)!==null&&r!==void 0?r:(l=d.locale)===null||l===void 0||(c=l.options)===null||c===void 0?void 0:c.firstWeekContainsDate)!==null&&n!==void 0?n:1);if(!(h>=1&&h<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var p=new Date(0);p.setFullYear(f+1,0,h),p.setHours(0,0,0,0);var g=xA(p,e),m=new Date(0);m.setFullYear(f,0,h),m.setHours(0,0,0,0);var v=xA(m,e);return u.getTime()>=g.getTime()?f+1:u.getTime()>=v.getTime()?f:f-1}function Nxt(t,e){var n,r,i,o,s,a,l,c;At(1,arguments);var u=Fh(),f=qn((n=(r=(i=(o=e==null?void 0:e.firstWeekContainsDate)!==null&&o!==void 0?o:e==null||(s=e.locale)===null||s===void 0||(a=s.options)===null||a===void 0?void 0:a.firstWeekContainsDate)!==null&&i!==void 0?i:u.firstWeekContainsDate)!==null&&r!==void 0?r:(l=u.locale)===null||l===void 0||(c=l.options)===null||c===void 0?void 0:c.firstWeekContainsDate)!==null&&n!==void 0?n:1),d=Fxt(t,e),h=new Date(0);h.setFullYear(d,0,f),h.setHours(0,0,0,0);var p=xA(h,e);return p}var zxt=6048e5;function jxt(t,e){At(1,arguments);var n=Ft(t),r=xA(n,e).getTime()-Nxt(n,e).getTime();return Math.round(r/zxt)+1}function Bxt(t){return At(1,arguments),Ft(t).getFullYear()}function TW(t,e){At(2,arguments);var n=Ft(t),r=Ft(e);return n.getTime()>r.getTime()}function kW(t,e){At(2,arguments);var n=Ft(t),r=Ft(e);return n.getTime()t.length)&&(e=t.length);for(var n=0,r=Array(e);n=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(c){throw c},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var o,s=!0,a=!1;return{s:function(){n=n.call(t)},n:function(){var c=n.next();return s=c.done,c},e:function(c){a=!0,o=c},f:function(){try{s||n.return==null||n.return()}finally{if(a)throw o}}}}function Xn(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&TF(t,e)}function iN(t){return iN=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},iN(t)}function jRe(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(jRe=function(){return!!t})()}function Wxt(t,e){if(e&&(Cg(e)=="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return bt(t)}function Yn(t){var e=jRe();return function(){var n,r=iN(t);if(e){var i=iN(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return Wxt(this,n)}}function Fn(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Vxt(t,e){for(var n=0;n0,r=n?e:1-e,i;if(r<=50)i=t||100;else{var o=r+50,s=Math.floor(o/100)*100,a=t>=o%100;i=t+s-(a?100:0)}return n?i:1-i}function VRe(t){return t%400===0||t%4===0&&t%100!==0}var Yxt=function(t){Xn(n,t);var e=Yn(n);function n(){var r;Fn(this,n);for(var i=arguments.length,o=new Array(i),s=0;s0}},{key:"set",value:function(i,o,s){var a=i.getUTCFullYear();if(s.isTwoDigitYear){var l=WRe(s.year,a);return i.setUTCFullYear(l,0,1),i.setUTCHours(0,0,0,0),i}var c=!("era"in o)||o.era===1?s.year:1-s.year;return i.setUTCFullYear(c,0,1),i.setUTCHours(0,0,0,0),i}}]),n}(ur),Qxt=function(t){Xn(n,t);var e=Yn(n);function n(){var r;Fn(this,n);for(var i=arguments.length,o=new Array(i),s=0;s0}},{key:"set",value:function(i,o,s,a){var l=Xte(i,a);if(s.isTwoDigitYear){var c=WRe(s.year,l);return i.setUTCFullYear(c,0,a.firstWeekContainsDate),i.setUTCHours(0,0,0,0),lb(i,a)}var u=!("era"in o)||o.era===1?s.year:1-s.year;return i.setUTCFullYear(u,0,a.firstWeekContainsDate),i.setUTCHours(0,0,0,0),lb(i,a)}}]),n}(ur),Kxt=function(t){Xn(n,t);var e=Yn(n);function n(){var r;Fn(this,n);for(var i=arguments.length,o=new Array(i),s=0;s=1&&o<=4}},{key:"set",value:function(i,o,s){return i.setUTCMonth((s-1)*3,1),i.setUTCHours(0,0,0,0),i}}]),n}(ur),ebt=function(t){Xn(n,t);var e=Yn(n);function n(){var r;Fn(this,n);for(var i=arguments.length,o=new Array(i),s=0;s=1&&o<=4}},{key:"set",value:function(i,o,s){return i.setUTCMonth((s-1)*3,1),i.setUTCHours(0,0,0,0),i}}]),n}(ur),tbt=function(t){Xn(n,t);var e=Yn(n);function n(){var r;Fn(this,n);for(var i=arguments.length,o=new Array(i),s=0;s=0&&o<=11}},{key:"set",value:function(i,o,s){return i.setUTCMonth(s,1),i.setUTCHours(0,0,0,0),i}}]),n}(ur),nbt=function(t){Xn(n,t);var e=Yn(n);function n(){var r;Fn(this,n);for(var i=arguments.length,o=new Array(i),s=0;s=0&&o<=11}},{key:"set",value:function(i,o,s){return i.setUTCMonth(s,1),i.setUTCHours(0,0,0,0),i}}]),n}(ur);function rbt(t,e,n){At(2,arguments);var r=Ft(t),i=qn(e),o=IRe(r,n)-i;return r.setUTCDate(r.getUTCDate()-o*7),r}var ibt=function(t){Xn(n,t);var e=Yn(n);function n(){var r;Fn(this,n);for(var i=arguments.length,o=new Array(i),s=0;s=1&&o<=53}},{key:"set",value:function(i,o,s,a){return lb(rbt(i,s,a),a)}}]),n}(ur);function obt(t,e){At(2,arguments);var n=Ft(t),r=qn(e),i=DRe(n)-r;return n.setUTCDate(n.getUTCDate()-i*7),n}var sbt=function(t){Xn(n,t);var e=Yn(n);function n(){var r;Fn(this,n);for(var i=arguments.length,o=new Array(i),s=0;s=1&&o<=53}},{key:"set",value:function(i,o,s){return kS(obt(i,s))}}]),n}(ur),abt=[31,28,31,30,31,30,31,31,30,31,30,31],lbt=[31,29,31,30,31,30,31,31,30,31,30,31],cbt=function(t){Xn(n,t);var e=Yn(n);function n(){var r;Fn(this,n);for(var i=arguments.length,o=new Array(i),s=0;s=1&&o<=lbt[l]:o>=1&&o<=abt[l]}},{key:"set",value:function(i,o,s){return i.setUTCDate(s),i.setUTCHours(0,0,0,0),i}}]),n}(ur),ubt=function(t){Xn(n,t);var e=Yn(n);function n(){var r;Fn(this,n);for(var i=arguments.length,o=new Array(i),s=0;s=1&&o<=366:o>=1&&o<=365}},{key:"set",value:function(i,o,s){return i.setUTCMonth(0,s),i.setUTCHours(0,0,0,0),i}}]),n}(ur);function Kte(t,e,n){var r,i,o,s,a,l,c,u;At(2,arguments);var f=Fh(),d=qn((r=(i=(o=(s=n==null?void 0:n.weekStartsOn)!==null&&s!==void 0?s:n==null||(a=n.locale)===null||a===void 0||(l=a.options)===null||l===void 0?void 0:l.weekStartsOn)!==null&&o!==void 0?o:f.weekStartsOn)!==null&&i!==void 0?i:(c=f.locale)===null||c===void 0||(u=c.options)===null||u===void 0?void 0:u.weekStartsOn)!==null&&r!==void 0?r:0);if(!(d>=0&&d<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var h=Ft(t),p=qn(e),g=h.getUTCDay(),m=p%7,v=(m+7)%7,y=(v=0&&o<=6}},{key:"set",value:function(i,o,s,a){return i=Kte(i,s,a),i.setUTCHours(0,0,0,0),i}}]),n}(ur),dbt=function(t){Xn(n,t);var e=Yn(n);function n(){var r;Fn(this,n);for(var i=arguments.length,o=new Array(i),s=0;s=0&&o<=6}},{key:"set",value:function(i,o,s,a){return i=Kte(i,s,a),i.setUTCHours(0,0,0,0),i}}]),n}(ur),hbt=function(t){Xn(n,t);var e=Yn(n);function n(){var r;Fn(this,n);for(var i=arguments.length,o=new Array(i),s=0;s=0&&o<=6}},{key:"set",value:function(i,o,s,a){return i=Kte(i,s,a),i.setUTCHours(0,0,0,0),i}}]),n}(ur);function pbt(t,e){At(2,arguments);var n=qn(e);n%7===0&&(n=n-7);var r=1,i=Ft(t),o=i.getUTCDay(),s=n%7,a=(s+7)%7,l=(a=1&&o<=7}},{key:"set",value:function(i,o,s){return i=pbt(i,s),i.setUTCHours(0,0,0,0),i}}]),n}(ur),mbt=function(t){Xn(n,t);var e=Yn(n);function n(){var r;Fn(this,n);for(var i=arguments.length,o=new Array(i),s=0;s=1&&o<=12}},{key:"set",value:function(i,o,s){var a=i.getUTCHours()>=12;return a&&s<12?i.setUTCHours(s+12,0,0,0):!a&&s===12?i.setUTCHours(0,0,0,0):i.setUTCHours(s,0,0,0),i}}]),n}(ur),bbt=function(t){Xn(n,t);var e=Yn(n);function n(){var r;Fn(this,n);for(var i=arguments.length,o=new Array(i),s=0;s=0&&o<=23}},{key:"set",value:function(i,o,s){return i.setUTCHours(s,0,0,0),i}}]),n}(ur),wbt=function(t){Xn(n,t);var e=Yn(n);function n(){var r;Fn(this,n);for(var i=arguments.length,o=new Array(i),s=0;s=0&&o<=11}},{key:"set",value:function(i,o,s){var a=i.getUTCHours()>=12;return a&&s<12?i.setUTCHours(s+12,0,0,0):i.setUTCHours(s,0,0,0),i}}]),n}(ur),_bt=function(t){Xn(n,t);var e=Yn(n);function n(){var r;Fn(this,n);for(var i=arguments.length,o=new Array(i),s=0;s=1&&o<=24}},{key:"set",value:function(i,o,s){var a=s<=24?s%24:s;return i.setUTCHours(a,0,0,0),i}}]),n}(ur),Sbt=function(t){Xn(n,t);var e=Yn(n);function n(){var r;Fn(this,n);for(var i=arguments.length,o=new Array(i),s=0;s=0&&o<=59}},{key:"set",value:function(i,o,s){return i.setUTCMinutes(s,0,0),i}}]),n}(ur),Cbt=function(t){Xn(n,t);var e=Yn(n);function n(){var r;Fn(this,n);for(var i=arguments.length,o=new Array(i),s=0;s=0&&o<=59}},{key:"set",value:function(i,o,s){return i.setUTCSeconds(s,0),i}}]),n}(ur),Obt=function(t){Xn(n,t);var e=Yn(n);function n(){var r;Fn(this,n);for(var i=arguments.length,o=new Array(i),s=0;s=1&&E<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var P=qn((p=(g=(m=(v=r==null?void 0:r.weekStartsOn)!==null&&v!==void 0?v:r==null||(y=r.locale)===null||y===void 0||(x=y.options)===null||x===void 0?void 0:x.weekStartsOn)!==null&&m!==void 0?m:O.weekStartsOn)!==null&&g!==void 0?g:(b=O.locale)===null||b===void 0||(w=b.options)===null||w===void 0?void 0:w.weekStartsOn)!==null&&p!==void 0?p:0);if(!(P>=0&&P<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");if(S==="")return _===""?Ft(n):new Date(NaN);var A={firstWeekContainsDate:E,weekStartsOn:P,locale:k},R=[new qxt],T=S.match(Rbt).map(function(K){var ee=K[0];if(ee in jq){var re=jq[ee];return re(K,k.formatLong)}return K}).join("").match(Mbt),M=[],I=gpe(T),j;try{var N=function(){var ee=j.value;!(r!=null&&r.useAdditionalWeekYearTokens)&&FRe(ee)&&rN(ee,S,t),!(r!=null&&r.useAdditionalDayOfYearTokens)&&$Re(ee)&&rN(ee,S,t);var re=ee[0],ge=Pbt[re];if(ge){var te=ge.incompatibleTokens;if(Array.isArray(te)){var ae=M.find(function(oe){return te.includes(oe.token)||oe.token===re});if(ae)throw new RangeError("The format string mustn't contain `".concat(ae.fullToken,"` and `").concat(ee,"` at the same time"))}else if(ge.incompatibleTokens==="*"&&M.length>0)throw new RangeError("The format string mustn't contain `".concat(ee,"` and any other token at the same time"));M.push({token:re,fullToken:ee});var U=ge.run(_,ee,k.match,A);if(!U)return{v:new Date(NaN)};R.push(U.setter),_=U.rest}else{if(re.match($bt))throw new RangeError("Format string contains an unescaped latin alphabet character `"+re+"`");if(ee==="''"?ee="'":re==="'"&&(ee=Nbt(ee)),_.indexOf(ee)===0)_=_.slice(ee.length);else return{v:new Date(NaN)}}};for(I.s();!(j=I.n()).done;){var z=N();if(Cg(z)==="object")return z.v}}catch(K){I.e(K)}finally{I.f()}if(_.length>0&&Lbt.test(_))return new Date(NaN);var L=R.map(function(K){return K.priority}).sort(function(K,ee){return ee-K}).filter(function(K,ee,re){return re.indexOf(K)===ee}).map(function(K){return R.filter(function(ee){return ee.priority===K}).sort(function(ee,re){return re.subPriority-ee.subPriority})}).map(function(K){return K[0]}),B=Ft(n);if(isNaN(B.getTime()))return new Date(NaN);var F=MRe(B,ARe(B)),$={},q=gpe(L),G;try{for(q.s();!(G=q.n()).done;){var Y=G.value;if(!Y.validate(F,A))return new Date(NaN);var le=Y.set(F,$,A);Array.isArray(le)?(F=le[0],Pxt($,le[1])):F=le}}catch(K){q.e(K)}finally{q.f()}return F}function Nbt(t){return t.match(Dbt)[1].replace(Ibt,"'")}function mpe(t){At(1,arguments);var e=Ft(t);return e.setMinutes(0,0,0),e}function zbt(t,e){At(2,arguments);var n=mpe(t),r=mpe(e);return n.getTime()===r.getTime()}function jbt(t,e){At(2,arguments);var n=Ft(t),r=Ft(e);return n.getFullYear()===r.getFullYear()&&n.getMonth()===r.getMonth()}function Bbt(t,e){At(2,arguments);var n=Ft(t),r=Ft(e);return n.getFullYear()===r.getFullYear()}function Ubt(t,e){At(2,arguments);var n=Ft(t).getTime(),r=Ft(e.start).getTime(),i=Ft(e.end).getTime();if(!(r<=i))throw new RangeError("Invalid interval");return n>=r&&n<=i}function Wbt(t,e){var n;At(1,arguments);var r=qn((n=void 0)!==null&&n!==void 0?n:2);if(r!==2&&r!==1&&r!==0)throw new RangeError("additionalDigits must be 0, 1 or 2");if(!(typeof t=="string"||Object.prototype.toString.call(t)==="[object String]"))return new Date(NaN);var i=qbt(t),o;if(i.date){var s=Xbt(i.date,r);o=Ybt(s.restDateString,s.year)}if(!o||isNaN(o.getTime()))return new Date(NaN);var a=o.getTime(),l=0,c;if(i.time&&(l=Qbt(i.time),isNaN(l)))return new Date(NaN);if(i.timezone){if(c=Kbt(i.timezone),isNaN(c))return new Date(NaN)}else{var u=new Date(a+l),f=new Date(0);return f.setFullYear(u.getUTCFullYear(),u.getUTCMonth(),u.getUTCDate()),f.setHours(u.getUTCHours(),u.getUTCMinutes(),u.getUTCSeconds(),u.getUTCMilliseconds()),f}return new Date(a+l+c)}var _I={dateTimeDelimiter:/[T ]/,timeZoneDelimiter:/[Z ]/i,timezone:/([Z+-].*)$/},Vbt=/^-?(?:(\d{3})|(\d{2})(?:-?(\d{2}))?|W(\d{2})(?:-?(\d{1}))?|)$/,Gbt=/^(\d{2}(?:[.,]\d*)?)(?::?(\d{2}(?:[.,]\d*)?))?(?::?(\d{2}(?:[.,]\d*)?))?$/,Hbt=/^([+-])(\d{2})(?::?(\d{2}))?$/;function qbt(t){var e={},n=t.split(_I.dateTimeDelimiter),r;if(n.length>2)return e;if(/:/.test(n[0])?r=n[0]:(e.date=n[0],r=n[1],_I.timeZoneDelimiter.test(e.date)&&(e.date=t.split(_I.timeZoneDelimiter)[0],r=t.substr(e.date.length,t.length))),r){var i=_I.timezone.exec(r);i?(e.time=r.replace(i[1],""),e.timezone=i[1]):e.time=r}return e}function Xbt(t,e){var n=new RegExp("^(?:(\\d{4}|[+-]\\d{"+(4+e)+"})|(\\d{2}|[+-]\\d{"+(2+e)+"})$)"),r=t.match(n);if(!r)return{year:NaN,restDateString:""};var i=r[1]?parseInt(r[1]):null,o=r[2]?parseInt(r[2]):null;return{year:o===null?i:o*100,restDateString:t.slice((r[1]||r[2]).length)}}function Ybt(t,e){if(e===null)return new Date(NaN);var n=t.match(Vbt);if(!n)return new Date(NaN);var r=!!n[4],i=jE(n[1]),o=jE(n[2])-1,s=jE(n[3]),a=jE(n[4]),l=jE(n[5])-1;if(r)return n1t(e,a,l)?Zbt(e,a,l):new Date(NaN);var c=new Date(0);return!e1t(e,o,s)||!t1t(e,i)?new Date(NaN):(c.setUTCFullYear(e,o,Math.max(i,s)),c)}function jE(t){return t?parseInt(t):1}function Qbt(t){var e=t.match(Gbt);if(!e)return NaN;var n=AW(e[1]),r=AW(e[2]),i=AW(e[3]);return r1t(n,r,i)?n*qte+r*Hte+i*1e3:NaN}function AW(t){return t&&parseFloat(t.replace(",","."))||0}function Kbt(t){if(t==="Z")return 0;var e=t.match(Hbt);if(!e)return 0;var n=e[1]==="+"?-1:1,r=parseInt(e[2]),i=e[3]&&parseInt(e[3])||0;return i1t(r,i)?n*(r*qte+i*Hte):NaN}function Zbt(t,e,n){var r=new Date(0);r.setUTCFullYear(t,0,4);var i=r.getUTCDay()||7,o=(e-1)*7+n+1-i;return r.setUTCDate(r.getUTCDate()+o),r}var Jbt=[31,null,31,30,31,30,31,31,30,31,30,31];function GRe(t){return t%400===0||t%4===0&&t%100!==0}function e1t(t,e,n){return e>=0&&e<=11&&n>=1&&n<=(Jbt[e]||(GRe(t)?29:28))}function t1t(t,e){return e>=1&&e<=(GRe(t)?366:365)}function n1t(t,e,n){return e>=1&&e<=53&&n>=0&&n<=6}function r1t(t,e,n){return t===24?e===0&&n===0:n>=0&&n<60&&e>=0&&e<60&&t>=0&&t<25}function i1t(t,e){return e>=0&&e<=59}function o1t(t,e){At(2,arguments);var n=Ft(t),r=qn(e),i=n.getFullYear(),o=n.getDate(),s=new Date(0);s.setFullYear(i,r,15),s.setHours(0,0,0,0);var a=NRe(s);return n.setMonth(r,Math.min(o,a)),n}function s1t(t,e){At(2,arguments);var n=Ft(t),r=qn(e);return n.setDate(r),n}function a1t(t,e){At(2,arguments);var n=Ft(t),r=qn(e);return n.setHours(r),n}function l1t(t,e){At(2,arguments);var n=Ft(t),r=qn(e);return n.setMilliseconds(r),n}function c1t(t,e){At(2,arguments);var n=Ft(t),r=qn(e);return n.setMinutes(r),n}function u1t(t,e){At(2,arguments);var n=Ft(t),r=qn(e);return n.setSeconds(r),n}function f1t(t,e){At(2,arguments);var n=Ft(t),r=qn(e);return isNaN(n.getTime())?new Date(NaN):(n.setFullYear(r),n)}function HRe(t){return t.getTimezoneOffset()*6e4}function d1t(t){return t.getTime()-HRe(t)}function PW(t){const e=new Date(t);return new Date(e.getTime()+HRe(e))}function bA(t){return new Date(t).toISOString().substring(0,10)}function oO(t){return qRe(new Date(t).toISOString())}function qRe(t){return t.substring(0,19).replace("T"," ")}const XRe={seconds:1e3,minutes:1e3*60,hours:1e3*60*60,days:1e3*60*60*24,weeks:1e3*60*60*24*7,years:1e3*60*60*24*365};function h1t(t,e){return t===e?!0:t!==null&&e!=null?t[0]===e[0]&&t[1]===e[1]:!1}function p1t(t,e){const n=new Set,r=new Set,i={};for(const l of t)for(const c of l.timeSeriesArray){const{placeId:u,datasetId:f,variableName:d,valueDataKey:h,errorDataKey:p}=c.source;u!==null&&r.add(u);const g=`${f}.${d}.${h}`;n.add(g);let m=null;p&&(m=`${f}.${d}.${p}`,n.add(m)),c.data.forEach(v=>{const y=oO(v.time),x=`${u!==null?u:f}-${y}`,b=i[x];b?i[x]={...b,[g]:v[h]}:i[x]={placeId:u,time:y,[g]:v[h]},m!==null&&(i[x][m]=v[p])})}const o=["placeId","time"].concat(Array.from(n).sort()),s=[];Object.keys(i).forEach(l=>{const c=i[l],u=new Array(o.length);o.forEach((f,d)=>{u[d]=c[f]}),s.push(u)}),s.sort((l,c)=>{const u=l[1],f=c[1],d=u.localeCompare(f);if(d!==0)return d;const h=l[0],p=c[0];return h.localeCompare(p)});const a={};return r.forEach(l=>{a[l]=Gte(e,l)}),{colNames:o,dataRows:s,referencedPlaces:a}}function g1t(t){let e=null;const n=t.features||[];for(const r of n){if(!r.properties)continue;const i=r.properties.time;if(typeof i!="string")continue;const s=Wbt(i).getTime();if(!Number.isNaN(s))for(const a of Object.getOwnPropertyNames(r.properties)){let l=r.properties[a];const c=typeof l;if(c==="boolean"?l=l?1:0:c!=="number"&&(l=Number.NaN),Number.isNaN(l))continue;const u={time:s,countTot:1,mean:l};e===null&&(e={});const f=e[a];f?f.data.push(u):e[a]={source:{datasetId:t.id,datasetTitle:t.title,variableName:a,placeId:null,geometry:null,valueDataKey:"mean",errorDataKey:null},data:[u],dataProgress:1}}}return e===null?null:{placeGroup:t,timeSeries:e}}const HM=t=>t.dataState.datasets||[],m1t=t=>t.dataState.colorBars,YRe=t=>t.dataState.timeSeriesGroups,qM=t=>t.dataState.userPlaceGroups,QRe=t=>t.dataState.userServers||[],v1t=t=>t.dataState.expressionCapabilities,y1t=t=>t.dataState.statistics.loading,x1t=t=>t.dataState.statistics.records,KRe=xt(HM,qM,(t,e)=>{const n={},r=[];return t.forEach(i=>{i.placeGroups&&i.placeGroups.forEach(o=>{n[o.id]||(n[o.id]=o,r.push(o))})}),[...r,...e]}),b1t=xt(KRe,t=>{const e=[];return t.forEach(n=>{const r=g1t(n);r!==null&&e.push(r)}),e});class ZRe extends Error{constructor(n,r){super(r);gn(this,"statusCode");this.statusCode=n}}function sO(t){return t?{headers:[["Authorization",`Bearer ${t}`]]}:{}}function aO(t,e){if(e.length>0){const n=e.map(r=>r.map(encodeURIComponent).join("=")).join("&");return t.includes("?")?t.endsWith("&")?t+n:t+"&"+n:t+"?"+n}return t}async function JRe(t,e){let n;try{if(n=await fetch(t,e),n.ok)return n}catch(i){throw i instanceof TypeError?(console.error(`Server did not respond for ${t}. May be caused by timeout, refused connection, network error, etc.`,i),new Error(me.get("Cannot reach server"))):(console.error(i),i)}let r=n.statusText;try{const i=await n.json();if(i&&i.error){const o=i.error;console.error(o),o.message&&(r+=`: ${o.message}`)}}catch{}throw console.error(n),new ZRe(n.status,r)}async function Vg(t,e,n){let r;Kft(e)?n=e:r=e;const o=await(await JRe(t,r)).json();return n?n(o):o}const w1t=[{name:"OpenStreetMap",link:"https://openstreetmap.org",datasets:[{name:"OSM Mapnik",endpoint:"https://a.tile.osm.org/{z}/{x}/{y}.png"},{name:"OSM Humanitarian",endpoint:"https://a.tile.openstreetmap.fr/hot/{z}/{x}/{y}.png"},{name:"OSM Landscape",endpoint:"https://a.tile3.opencyclemap.org/landscape/{z}/{x}/{y}.png"}],overlays:[]},{name:"ESRI",link:"https://services.arcgisonline.com/arcgis/rest/services",datasets:[{name:"Dark Gray Base",endpoint:"https://services.arcgisonline.com/arcgis/rest/services/Canvas/World_Dark_Gray_Base/MapServer/tile/{z}/{y}/{x}"},{name:"Light Gray Base",endpoint:"https://services.arcgisonline.com/arcgis/rest/services/Canvas/World_Light_Gray_Base/MapServer/tile/{z}/{y}/{x}"},{name:"World Hillshade",endpoint:"https://services.arcgisonline.com/arcgis/rest/services/Elevation/World_Hillshade/MapServer/tile/{z}/{y}/{x}"},{name:"World Ocean Base",endpoint:"https://services.arcgisonline.com/arcgis/rest/services/Ocean/World_Ocean_Base/MapServer/tile/{z}/{y}/{x}"},{name:"DeLorme World Base Map",endpoint:"https://services.arcgisonline.com/arcgis/rest/services/Specialty/DeLorme_World_Base_Map/MapServer/tile/{z}/{y}/{x}"},{name:"World Street Map",endpoint:"https://services.arcgisonline.com/arcgis/rest/services/World_Street_Map/MapServer/tile/{z}/{y}/{x}"},{name:"World Navigation Charts",endpoint:"https://services.arcgisonline.com/arcgis/rest/services/Specialty/World_Navigation_Charts/MapServer/tile/{z}/{y}/{x}"},{name:"National Geographic",endpoint:"https://services.arcgisonline.com/arcgis/rest/services/NatGeo_World_Map/MapServer/tile/{z}/{y}/{x}"},{name:"World Imagery",endpoint:"https://services.arcgisonline.com/arcgis/rest/services/World_Imagery/MapServer/tile/{z}/{y}/{x}"},{name:"World Physical Map",endpoint:"https://services.arcgisonline.com/arcgis/rest/services/World_Physical_Map/MapServer/tile/{z}/{y}/{x}"},{name:"World Shaded Relief",endpoint:"https://services.arcgisonline.com/arcgis/rest/services/World_Shaded_Relief/MapServer/tile/{z}/{y}/{x}"},{name:"World Terrain",endpoint:"https://services.arcgisonline.com/arcgis/rest/services/World_Terrain_Base/MapServer/tile/{z}/{y}/{x}"},{name:"World Topo Map",endpoint:"https://services.arcgisonline.com/arcgis/rest/services/World_Topo_Map/MapServer/tile/{z}/{y}/{x}"}],overlays:[{name:"Dark Gray Reference",endpoint:"https://services.arcgisonline.com/arcgis/rest/services/Canvas/World_Dark_Gray_Reference/MapServer/tile/{z}/{y}/{x}"},{name:"Light Gray Reference",endpoint:"https://services.arcgisonline.com/arcgis/rest/services/Canvas/World_Light_Gray_Reference/MapServer/tile/{z}/{y}/{x}"},{name:"World Ocean Reference",endpoint:"https://services.arcgisonline.com/arcgis/rest/services/Ocean/World_Ocean_Reference/MapServer/tile/{z}/{y}/{x}"},{name:"World Boundaries & Places",endpoint:"https://services.arcgisonline.com/arcgis/rest/services/Reference/World_Boundaries_and_Places/MapServer/tile/{z}/{y}/{x}"},{name:"World Reference Overlay",endpoint:"https://services.arcgisonline.com/arcgis/rest/services/Reference/World_Reference_Overlay/MapServer/tile/{z}/{y}/{x}"},{name:"World Transportation",endpoint:"https://services.arcgisonline.com/arcgis/rest/services/Reference/World_Transportation/MapServer/tile/{z}/{y}/{x}"}]},{name:"CartoDB",link:"https://cartodb.com/basemaps/",datasets:[{name:"Positron",endpoint:"https://a.basemaps.cartocdn.com/light_all/{z}/{x}/{y}.png"},{name:"Dark Matter",endpoint:"https://a.basemaps.cartocdn.com/dark_all/{z}/{x}/{y}.png"},{name:"Positron (No Labels)",endpoint:"https://a.basemaps.cartocdn.com/light_nolabels/{z}/{x}/{y}.png"},{name:"Dark Matter (No Labels)",endpoint:"https://a.basemaps.cartocdn.com/dark_nolabels/{z}/{x}/{y}.png"}],overlays:[{name:"Positron Labels",endpoint:"https://a.basemaps.cartocdn.com/light_only_labels/{z}/{x}/{y}.png"},{name:"Dark Matter Labels",endpoint:"https://a.basemaps.cartocdn.com/dark_only_labels/{z}/{x}/{y}.png"}]},{name:"Stamen",link:"https://maps.stamen.com",datasets:[{name:"Toner",endpoint:"https://tile.stamen.com/toner/{z}/{x}/{y}.png",attribution:'Map tiles by Stamen Design, under CC BY 3.0. Data by OpenStreetMap, under ODbL.'},{name:"Terrain",endpoint:"https://tile.stamen.com/terrain/{z}/{x}/{y}.png"},{name:"Watercolor",endpoint:"https://tile.stamen.com/watercolor/{z}/{x}/{y}.png"}],overlays:[]},{name:"Mapbox",link:"https://a.tiles.mapbox.com/v3/mapbox/maps.html",datasets:[{name:"Blue Marble (January)",endpoint:"https://a.tiles.mapbox.com/v3/mapbox.blue-marble-topo-bathy-jan/{z}/{x}/{y}.png"},{name:"Blue Marble (July)",endpoint:"https://a.tiles.mapbox.com/v3/mapbox.blue-marble-topo-bathy-jul/{z}/{x}/{y}.png"},{name:"Blue Marble Topo & Bathy B/W (July)",endpoint:"https://a.tiles.mapbox.com/v3/mapbox.blue-marble-topo-bathy-jul-bw/{z}/{x}/{y}.png"},{name:"Control Room",endpoint:"https://a.tiles.mapbox.com/v3/mapbox.control-room/{z}/{x}/{y}.png"},{name:"Geography Class",endpoint:"https://a.tiles.mapbox.com/v3/mapbox.geography-class/{z}/{x}/{y}.png"},{name:"World Dark",endpoint:"https://a.tiles.mapbox.com/v3/mapbox.world-dark/{z}/{x}/{y}.png"},{name:"World Light",endpoint:"https:a.tiles.mapbox.com/v3/mapbox.world-light/{z}/{x}/{y}.png"},{name:"World Glass",endpoint:"https:a.tiles.mapbox.com/v3/mapbox.world-glass/{z}/{x}/{y}.png"},{name:"World Print",endpoint:"https:a.tiles.mapbox.com/v3/mapbox.world-print/{z}/{x}/{y}.png"},{name:"World Blue",endpoint:"https:a.tiles.mapbox.com/v3/mapbox.world-blue/{z}/{x}/{y}.png"}],overlays:[]}],_1t=w1t,Zte="User";function sN(t){return t?`${t.group}: ${t.title}`:"-"}function aN(t,e){return t.find(n=>n.id===e)||null}function eDe(t="datasets"){const e=[];return _1t.forEach(n=>{n[t].forEach(r=>{e.push({id:`${n.name}-${r.name}`,group:n.name,attribution:n.link,title:r.name,url:r.endpoint})})}),e}const tDe=eDe("datasets"),S1t=eDe("overlays"),C1t=tDe[0].id;var O1t=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),E1t=function(t){O1t(e,t);function e(){return t.call(this)||this}return e.prototype.getType=function(){return"text"},e.prototype.readFeature=function(n,r){return this.readFeatureFromText(SI(n),this.adaptOptions(r))},e.prototype.readFeatureFromText=function(n,r){return $t()},e.prototype.readFeatures=function(n,r){return this.readFeaturesFromText(SI(n),this.adaptOptions(r))},e.prototype.readFeaturesFromText=function(n,r){return $t()},e.prototype.readGeometry=function(n,r){return this.readGeometryFromText(SI(n),this.adaptOptions(r))},e.prototype.readGeometryFromText=function(n,r){return $t()},e.prototype.readProjection=function(n){return this.readProjectionFromText(SI(n))},e.prototype.readProjectionFromText=function(n){return this.dataProjection},e.prototype.writeFeature=function(n,r){return this.writeFeatureText(n,this.adaptOptions(r))},e.prototype.writeFeatureText=function(n,r){return $t()},e.prototype.writeFeatures=function(n,r){return this.writeFeaturesText(n,this.adaptOptions(r))},e.prototype.writeFeaturesText=function(n,r){return $t()},e.prototype.writeGeometry=function(n,r){return this.writeGeometryText(n,this.adaptOptions(r))},e.prototype.writeGeometryText=function(n,r){return $t()},e}(uRe);function SI(t){return typeof t=="string"?t:""}var T1t=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),k1t={POINT:uh,LINESTRING:Ix,POLYGON:ty,MULTIPOINT:R4,MULTILINESTRING:Lte,MULTIPOLYGON:$te},nDe="EMPTY",rDe="Z",iDe="M",A1t="ZM",rr={START:0,TEXT:1,LEFT_PAREN:2,RIGHT_PAREN:3,NUMBER:4,COMMA:5,EOF:6},P1t={Point:"POINT",LineString:"LINESTRING",Polygon:"POLYGON",MultiPoint:"MULTIPOINT",MultiLineString:"MULTILINESTRING",MultiPolygon:"MULTIPOLYGON",GeometryCollection:"GEOMETRYCOLLECTION",Circle:"CIRCLE"},M1t=function(){function t(e){this.wkt=e,this.index_=-1}return t.prototype.isAlpha_=function(e){return e>="a"&&e<="z"||e>="A"&&e<="Z"},t.prototype.isNumeric_=function(e,n){var r=n!==void 0?n:!1;return e>="0"&&e<="9"||e=="."&&!r},t.prototype.isWhiteSpace_=function(e){return e==" "||e==" "||e=="\r"||e==` +`},t.prototype.nextChar_=function(){return this.wkt.charAt(++this.index_)},t.prototype.nextToken=function(){var e=this.nextChar_(),n=this.index_,r=e,i;if(e=="(")i=rr.LEFT_PAREN;else if(e==",")i=rr.COMMA;else if(e==")")i=rr.RIGHT_PAREN;else if(this.isNumeric_(e)||e=="-")i=rr.NUMBER,r=this.readNumber_();else if(this.isAlpha_(e))i=rr.TEXT,r=this.readText_();else{if(this.isWhiteSpace_(e))return this.nextToken();if(e==="")i=rr.EOF;else throw new Error("Unexpected character: "+e)}return{position:n,value:r,type:i}},t.prototype.readNumber_=function(){var e,n=this.index_,r=!1,i=!1;do e=="."?r=!0:(e=="e"||e=="E")&&(i=!0),e=this.nextChar_();while(this.isNumeric_(e,r)||!i&&(e=="e"||e=="E")||i&&(e=="-"||e=="+"));return parseFloat(this.wkt.substring(n,this.index_--))},t.prototype.readText_=function(){var e,n=this.index_;do e=this.nextChar_();while(this.isAlpha_(e));return this.wkt.substring(n,this.index_--).toUpperCase()},t}(),R1t=function(){function t(e){this.lexer_=e,this.token_={position:0,type:rr.START},this.layout_=Kn.XY}return t.prototype.consume_=function(){this.token_=this.lexer_.nextToken()},t.prototype.isTokenType=function(e){return this.token_.type==e},t.prototype.match=function(e){var n=this.isTokenType(e);return n&&this.consume_(),n},t.prototype.parse=function(){return this.consume_(),this.parseGeometry_()},t.prototype.parseGeometryLayout_=function(){var e=Kn.XY,n=this.token_;if(this.isTokenType(rr.TEXT)){var r=n.value;r===rDe?e=Kn.XYZ:r===iDe?e=Kn.XYM:r===A1t&&(e=Kn.XYZM),e!==Kn.XY&&this.consume_()}return e},t.prototype.parseGeometryCollectionText_=function(){if(this.match(rr.LEFT_PAREN)){var e=[];do e.push(this.parseGeometry_());while(this.match(rr.COMMA));if(this.match(rr.RIGHT_PAREN))return e}throw new Error(this.formatErrorMessage_())},t.prototype.parsePointText_=function(){if(this.match(rr.LEFT_PAREN)){var e=this.parsePoint_();if(this.match(rr.RIGHT_PAREN))return e}throw new Error(this.formatErrorMessage_())},t.prototype.parseLineStringText_=function(){if(this.match(rr.LEFT_PAREN)){var e=this.parsePointList_();if(this.match(rr.RIGHT_PAREN))return e}throw new Error(this.formatErrorMessage_())},t.prototype.parsePolygonText_=function(){if(this.match(rr.LEFT_PAREN)){var e=this.parseLineStringTextList_();if(this.match(rr.RIGHT_PAREN))return e}throw new Error(this.formatErrorMessage_())},t.prototype.parseMultiPointText_=function(){if(this.match(rr.LEFT_PAREN)){var e=void 0;if(this.token_.type==rr.LEFT_PAREN?e=this.parsePointTextList_():e=this.parsePointList_(),this.match(rr.RIGHT_PAREN))return e}throw new Error(this.formatErrorMessage_())},t.prototype.parseMultiLineStringText_=function(){if(this.match(rr.LEFT_PAREN)){var e=this.parseLineStringTextList_();if(this.match(rr.RIGHT_PAREN))return e}throw new Error(this.formatErrorMessage_())},t.prototype.parseMultiPolygonText_=function(){if(this.match(rr.LEFT_PAREN)){var e=this.parsePolygonTextList_();if(this.match(rr.RIGHT_PAREN))return e}throw new Error(this.formatErrorMessage_())},t.prototype.parsePoint_=function(){for(var e=[],n=this.layout_.length,r=0;r0&&(i+=" "+o)}return r.length===0?i+" "+nDe:i+"("+r+")"}class z1t extends Error{}const cDe={separator:",",comment:"#",quote:'"',escape:"\\",trim:!0,nanToken:"NaN",trueToken:"true",falseToken:"false"};function uDe(t,e){return new j1t(e).parse(t)}let j1t=class{constructor(e){gn(this,"options");this.options={...cDe,...e},this.parseLine=this.parseLine.bind(this)}parse(e){return this.parseText(e).map(this.parseLine)}parseText(e){const{comment:n,trim:r}=this.options;return e.split(` +`).map((i,o)=>(r&&(i=i.trim()),[i,o])).filter(([i,o])=>i.trim()!==""&&!i.startsWith(n))}parseLine([e,n]){const{separator:r,quote:i,escape:o}=this.options;let s=!1;const a=[];let l=0,c=0;for(;ct.toLowerCase());function vpe(t){if(t=t.trim(),t==="")return"csv";if(t[0]==="{")return"geojson";const e=t.substring(0,20).toLowerCase();return W1t.find(r=>e.startsWith(r)&&(e.length===r.length||` + (`.indexOf(e[r.length])>=0))?"wkt":"csv"}function l3(t){return t.split(",").map(e=>e.trim().toLowerCase()).filter(e=>e!=="")}const V1t=t=>{if(t.trim()!=="")try{uDe(t)}catch(e){return console.error(e),`${e}`}return null},fDe={name:"Text/CSV",fileExt:".txt,.csv",checkError:V1t},Uq={...cDe,xNames:"longitude, lon, x",yNames:"latitude, lat, y",forceGeometry:!1,geometryNames:"geometry, geom",timeNames:"time, date, datetime, date-time",groupNames:"group, cruise, station, type",groupPrefix:"Group-",labelNames:"label, name, title, id",labelPrefix:"Place-"};let G1t=0,H1t=0;function q1t(t,e){const n=uDe(t,e);if(n.length<2)throw new Error(me.get("Missing header line in CSV"));for(const _ of n[0])if(typeof _!="string"||_==="")throw new Error(me.get("Invalid header line in CSV"));const r=n[0].map(_=>_),i=r.map(_=>_.toLowerCase()),o=r.length;for(const _ of n)if(_.length!==o)throw new Error(me.get("All rows must have same length"));const s=X1t(i),a=G1(s,e.groupNames),l=G1(s,e.labelNames),c=G1(s,e.timeNames),u=G1(s,e.xNames),f=G1(s,e.yNames);let d=G1(s,e.geometryNames);if(e.forceGeometry||u<0||f<0||u===f){if(d<0)throw new Error(me.get("No geometry column(s) found"))}else d=-1;let p=e.groupPrefix.trim();p===""&&(p=Uq.groupPrefix);let g=e.labelPrefix.trim();g===""&&(g=Uq.labelPrefix);let m="";if(a===-1){const _=++G1t;m=`${p}${_}`}const v=new oDe,y={};let x=1,b=0,w=rb(0);for(;x=0&&(S=`${_[c]}`),a>=0&&(m=`${_[a]}`);let O=y[m];O||(O=Ute(m,[]),y[m]=O,w=rb(b),b++);let k=null;if(d>=0){if(typeof _[d]=="string")try{k=v.readGeometry(t)}catch{}}else{const A=_[u],R=_[f];typeof A=="number"&&Number.isFinite(A)&&typeof R=="number"&&Number.isFinite(R)&&(k=new uh([A,R]))}if(k===null)throw new Error(me.get(`Invalid geometry in data row ${x}`));const E={};_.forEach((A,R)=>{if(R!==u&&R!==f&&R!==d){const T=r[R];E[T]=A}});let P;if(l>=0)P=`${_[l]}`;else{const A=++H1t;P=`${g}${A}`}S!==""&&(E.time=S),E.color||(E.color=w),E.label||(E.label=P),E.source||(E.source="CSV"),O.features.push(Wte(k,E))}return Object.getOwnPropertyNames(y).map(_=>y[_])}function X1t(t){const e={};for(let n=0;n{if(t.trim()!=="")try{JSON.parse(t)}catch(e){return console.error(e),`${e}`}return null},dDe={name:"GeoJSON",fileExt:".json,.geojson",checkError:Y1t},Wq={groupNames:"group, cruise, station, type",groupPrefix:"Group-",labelNames:"label, name, title, id",labelPrefix:"Place-",timeNames:"time, date, datetime, date-time"};let Q1t=0,K1t=0;function Z1t(t,e){const n=l3(e.groupNames||"");let r=e.groupPrefix.trim();r===""&&(r=Wq.groupPrefix);const i=l3(e.labelNames||"");let o=e.labelPrefix.trim();o===""&&(o=Wq.labelPrefix);const s=l3(e.timeNames||""),a=new t1;let l;try{l=a.readFeatures(t)}catch{try{const d=a.readGeometry(t);l=[new Fp(d)]}catch{throw new Error(me.get("Invalid GeoJSON"))}}const c={};let u=0;return l.forEach(f=>{const d=f.getProperties(),h=f.getGeometry();if(h){let p="",g="",m="",v=rb(0);if(d){const b={};Object.getOwnPropertyNames(d).forEach(w=>{b[w.toLowerCase()]=d[w]}),p=MW(b,s,p),m=MW(b,i,m),g=MW(b,n,g)}if(g===""){const b=++Q1t;g=`${r}-${b}`}if(m===""){const b=++K1t;m=`${o}-${b}`}let y=c[g];y||(y=Ute(g,[]),c[g]=y,v=rb(u),u++);const x={...d};p!==""&&(x.time=p),x.color||(x.color=v),x.label||(x.label=m),x.source||(x.source="GeoJSON"),y.features.push(Wte(h,x))}}),Object.getOwnPropertyNames(c).map(f=>c[f])}function MW(t,e,n){if(n===""){for(const r of e)if(t[r]==="string")return t[r]}return n}const J1t=t=>null,hDe={name:"WKT",fileExt:".txt,.wkt",checkError:J1t},Vq={group:"",groupPrefix:"Group-",label:"",labelPrefix:"Place-",time:oO(new Date().getTime())};let ewt=0,twt=0;function nwt(t,e){let n=e.groupPrefix.trim();n===""&&(n=Vq.groupPrefix);let r=e.group.trim();if(r===""){const a=++ewt;r=`${n}${a}`}let i=e.labelPrefix.trim();i===""&&(i=Vq.labelPrefix);let o=e.label.trim();if(o===""){const a=++twt;o=`${i}${a}`}const s=e.time.trim();try{const a=new oDe().readGeometry(t);let l={color:rb(Math.floor(1e3*Math.random())),label:o,source:"WKT"};s!==""&&(l={time:s,...l});const c=[Wte(a,l)];return[Ute(r,c)]}catch{throw new Error(me.get("Invalid Geometry WKT"))}}function lO(t){return rwt("localStorage",t)}function rwt(t,e){try{const n=window[t],r="__storage_test__";return n.setItem(r,r),n.removeItem(r),new iwt(n,e)}catch{return null}}class iwt{constructor(e,n){gn(this,"nativeStorage");gn(this,"brandingName");this.nativeStorage=e,this.brandingName=n}getItem(e,n,r,i){const o=this.nativeStorage.getItem(this.makeKey(e));if(o!==null)try{const s=r?r(o):o;return i?i(s):s}catch(s){console.error(`Failed parsing user setting "${e}": ${s}`)}return typeof n>"u"?null:n}getObjectItem(e,n){return this.getItem(e,n,r=>JSON.parse(r))}getBooleanProperty(e,n,r){this.getProperty(e,n,r,i=>i==="true")}getIntProperty(e,n,r){this.getProperty(e,n,r,parseInt)}getStringProperty(e,n,r){this.getProperty(e,n,r,i=>i)}getArrayProperty(e,n,r,i){this.getProperty(e,n,r,o=>{const s=JSON.parse(o);if(Array.isArray(s))return s;const a=r[e];return Array.isArray(a)?a:[]},i)}getObjectProperty(e,n,r){this.getProperty(e,n,r,i=>{const o=JSON.parse(i),s=r[e],a={...s,...o};return Object.getOwnPropertyNames(o).forEach(l=>{const c=s[l],u=o[l];ahe(c)&&ahe(u)&&(a[l]={...c,...u})}),a})}getProperty(e,n,r,i,o){n[e]=this.getItem(e,r[e],i,o)}setItem(e,n,r){if(typeof n>"u"||n===null)this.nativeStorage.removeItem(this.makeKey(e));else{const i=r?r(n):n+"";this.nativeStorage.setItem(this.makeKey(e),i)}}setObjectItem(e,n){this.setItem(e,n,r=>JSON.stringify(r))}setPrimitiveProperty(e,n){this.setItem(e,n[e])}setArrayProperty(e,n){this.setObjectItem(e,n[e])}setObjectProperty(e,n){this.setObjectItem(e,n[e])}makeKey(e){return`xcube.${this.brandingName}.${e}`}}function owt(t){const e=lO(Pn.instance.name);if(e)try{e.setObjectItem("userServers",t)}catch(n){console.warn(`failed to store user servers: ${n}`)}}function swt(){const t=lO(Pn.instance.name);if(t)try{return t.getObjectItem("userServers",[])}catch(e){console.warn(`failed to load user servers: ${e}`)}return[]}function awt(t){const e=lO(Pn.instance.name);if(e)try{e.setObjectItem("userVariables",t)}catch(n){console.warn(`failed to store user variables: ${n}`)}}function lwt(){const t=lO(Pn.instance.name);if(t)try{return t.getObjectItem("userVariables",{})}catch(e){console.warn(`failed to load user variables: ${e}`)}return{}}function gd(t){const e=lO(Pn.instance.name);if(e)try{e.setPrimitiveProperty("locale",t),e.setPrimitiveProperty("privacyNoticeAccepted",t),e.setPrimitiveProperty("autoShowTimeSeries",t),e.setPrimitiveProperty("timeSeriesIncludeStdev",t),e.setPrimitiveProperty("timeSeriesChartTypeDefault",t),e.setPrimitiveProperty("timeSeriesUseMedian",t),e.setPrimitiveProperty("timeAnimationInterval",t),e.setPrimitiveProperty("timeChunkSize",t),e.setPrimitiveProperty("sidebarOpen",t),e.setPrimitiveProperty("sidebarPanelId",t),e.setPrimitiveProperty("volumeRenderMode",t),e.setObjectProperty("infoCardElementStates",t),e.setPrimitiveProperty("imageSmoothingEnabled",t),e.setPrimitiveProperty("mapProjection",t),e.setPrimitiveProperty("selectedBaseMapId",t),e.setPrimitiveProperty("selectedOverlayId",t),e.setArrayProperty("userBaseMaps",t),e.setArrayProperty("userOverlays",t),e.setArrayProperty("userColorBars",t),e.setPrimitiveProperty("userDrawnPlaceGroupName",t),e.setPrimitiveProperty("datasetLocateMode",t),e.setPrimitiveProperty("placeLocateMode",t),e.setPrimitiveProperty("exportTimeSeries",t),e.setPrimitiveProperty("exportTimeSeriesSeparator",t),e.setPrimitiveProperty("exportPlaces",t),e.setPrimitiveProperty("exportPlacesAsCollection",t),e.setPrimitiveProperty("exportZipArchive",t),e.setPrimitiveProperty("exportFileName",t),e.setPrimitiveProperty("userPlacesFormatName",t),e.setObjectProperty("userPlacesFormatOptions",t)}catch(n){console.warn(`failed to store user settings: ${n}`)}}function cwt(t){const e=lO(Pn.instance.name);if(e){const n={...t};try{e.getStringProperty("locale",n,t),e.getBooleanProperty("privacyNoticeAccepted",n,t),e.getBooleanProperty("autoShowTimeSeries",n,t),e.getBooleanProperty("timeSeriesIncludeStdev",n,t),e.getStringProperty("timeSeriesChartTypeDefault",n,t),e.getBooleanProperty("timeSeriesUseMedian",n,t),e.getIntProperty("timeAnimationInterval",n,t),e.getIntProperty("timeChunkSize",n,t),e.getBooleanProperty("sidebarOpen",n,t),e.getStringProperty("sidebarPanelId",n,t),e.getStringProperty("volumeRenderMode",n,t),e.getObjectProperty("infoCardElementStates",n,t),e.getBooleanProperty("imageSmoothingEnabled",n,t),e.getStringProperty("mapProjection",n,t),e.getStringProperty("selectedBaseMapId",n,t),e.getStringProperty("selectedOverlayId",n,t),e.getArrayProperty("userBaseMaps",n,t),e.getArrayProperty("userOverlays",n,t),e.getArrayProperty("userColorBars",n,t,uwt),e.getStringProperty("userDrawnPlaceGroupName",n,t),e.getStringProperty("datasetLocateMode",n,t),e.getStringProperty("placeLocateMode",n,t),e.getBooleanProperty("exportTimeSeries",n,t),e.getStringProperty("exportTimeSeriesSeparator",n,t),e.getBooleanProperty("exportPlaces",n,t),e.getBooleanProperty("exportPlacesAsCollection",n,t),e.getBooleanProperty("exportZipArchive",n,t),e.getStringProperty("exportFileName",n,t),e.getStringProperty("userPlacesFormatName",n,t),e.getObjectProperty("userPlacesFormatOptions",n,t)}catch(r){console.warn(`Failed to load user settings: ${r}`)}return n}else console.warn("User settings not found or access denied");return t}const ype={node:"continuous",continuous:"continuous",bound:"stepwise",stepwise:"stepwise",key:"categorical",categorical:"categorical"};function uwt(t){if(Array.isArray(t))return t.map(e=>({...e,type:fwt(e.type)}))}function fwt(t){return Kb(t)&&t in ype?ype[t]:"continuous"}const dwt=[250,500,1e3,2500],hwt=["info","timeSeries","stats","volume"];function pwt(){const t=Pn.instance.branding,e={selectedDatasetId:null,selectedVariableName:null,selectedDataset2Id:null,selectedVariable2Name:null,selectedPlaceGroupIds:[],selectedPlaceId:null,selectedUserPlaceId:null,selectedServerId:Pn.instance.server.id,selectedTime:null,selectedTimeRange:null,timeSeriesUpdateMode:"add",timeAnimationActive:!1,timeAnimationInterval:1e3,timeChunkSize:20,autoShowTimeSeries:!0,timeSeriesChartTypeDefault:"line",timeSeriesIncludeStdev:!0,timeSeriesUseMedian:t.defaultAgg==="median",userDrawnPlaceGroupName:"",userPlacesFormatName:"csv",userPlacesFormatOptions:{csv:{...Uq},geojson:{...Wq},wkt:{...Vq}},flyTo:null,activities:{},locale:"en",dialogOpen:{},privacyNoticeAccepted:!1,mapInteraction:"Select",lastMapInteraction:"Select",layerVisibilities:{baseMap:!0,datasetRgb:!1,datasetVariable:!0,datasetVariable2:!0,datasetBoundary:!1,datasetPlaces:!0,userPlaces:!0,overlay:!0},variableCompareMode:!1,mapPointInfoBoxEnabled:!1,datasetLocateMode:"panAndZoom",placeLocateMode:"panAndZoom",layerMenuOpen:!1,sidebarPosition:2*Math.max(window.innerWidth,window.innerHeight)/3,sidebarOpen:!1,sidebarPanelId:"info",volumeRenderMode:"mip",volumeStates:{},infoCardElementStates:{dataset:{visible:!0,viewMode:"text"},variable:{visible:!0,viewMode:"text"},place:{visible:!0,viewMode:"text"}},mapProjection:t.mapProjection||xRe,imageSmoothingEnabled:!1,selectedBaseMapId:C1t,selectedOverlayId:null,userBaseMaps:[],userOverlays:[],userColorBars:[],exportTimeSeries:!0,exportTimeSeriesSeparator:"TAB",exportPlaces:!0,exportPlacesAsCollection:!0,exportZipArchive:!0,exportFileName:"export"};return cwt(e)}const Kc={},gwt="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQBAMAAADt3eJSAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAGUExURcDAwP///ytph7QAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAUSURBVBjTYwABQSCglEENMxgYGAAynwRB8BEAgQAAAABJRU5ErkJggg==",pDe=new Image;pDe.src=gwt;const Gq="_alpha",Hq="_r";function mwt(t){let e=t;const n=e.endsWith(Gq);n&&(e=e.slice(0,e.length-Gq.length));const r=e.endsWith(Hq);return r&&(e=e.slice(0,e.length-Hq.length)),{baseName:e,isAlpha:n,isReversed:r}}function lN(t){let e=t.baseName;return t.isReversed&&(e+=Hq),t.isAlpha&&(e+=Gq),e}function vwt(t,e,n){xwt(t,e).then(r=>{Promise.resolve(createImageBitmap(r)).then(i=>{const o=n.getContext("2d");if(o!==null){const s=o.createPattern(pDe,"repeat");s!==null?o.fillStyle=s:o.fillStyle="#ffffff",o.fillRect(0,0,n.width,n.height),o.drawImage(i,0,0,n.width,n.height)}})})}function ywt(t,e){return new Promise((n,r)=>{const i=new Image,o=t.imageData;if(!o){n(i);return}i.onload=()=>{n(i)},i.onerror=(s,a,l,c,u)=>{r(u)},i.src=`data:image/png;base64,${o}`})}function xwt(t,e){return ywt(t).then(n=>{const r=bwt(t,e,n);if(r!==null)return r;throw new Error("failed to retrieve 2d context")})}function bwt(t,e,n){const r=document.createElement("canvas");r.width=n.width||1,r.height=n.height||1;const i=r.getContext("2d");if(i===null)return null;i.drawImage(n,0,0);let s=i.getImageData(0,0,r.width,r.height).data;if(t.isReversed){const a=new Uint8ClampedArray(s.length);for(let l=0;l{let e;if(t.includes(",")){const r=t.split(",");if(r.length===3||r.length===4){const i=[0,0,0,255];for(let o=0;o<3;o++){const s=Number.parseInt(r[o]);if(s<0||s>255)return;i[o]=s}if(r.length===4){if(e=xpe(r[3]),e===void 0)return;i[3]=e}return i}if(r.length!==2||(t=r[0],e=xpe(r[1]),e===void 0))return}const n=(t.startsWith("#")?mDe:Cwt)(t);if(n){if(n.length===3)return[...n,e===void 0?255:e];if(n.length===4&&e===void 0)return n}};function gDe(t){return"#"+t.map(e=>{const n=e.toString(16);return n.length===1?"0"+n:n}).join("")}function mDe(t){if(wwt.test(t)){if(t.length===4)return[parseInt(t[1]+t[1],16),parseInt(t[2]+t[2],16),parseInt(t[3]+t[3],16)];if(t.length===7)return[parseInt(t.substring(1,3),16),parseInt(t.substring(3,5),16),parseInt(t.substring(5,7),16)];if(t.length===9)return[parseInt(t.substring(1,3),16),parseInt(t.substring(3,5),16),parseInt(t.substring(5,7),16),parseInt(t.substring(7,9),16)]}}const xpe=t=>{const e=Number.parseFloat(t);if(e===0)return 0;if(e===1)return 255;if(e>0&&e<1)return Math.round(256*e)},Swt=t=>Owt[t.toLowerCase()],Cwt=t=>{const e=Swt(t);if(e)return mDe(e)},Owt={aliceblue:"#F0F8FF",antiquewhite:"#FAEBD7",aqua:"#00FFFF",aquamarine:"#7FFFD4",azure:"#F0FFFF",beige:"#F5F5DC",bisque:"#FFE4C4",black:"#000000",blanchedalmond:"#FFEBCD",blue:"#0000FF",blueviolet:"#8A2BE2",brown:"#A52A2A",burlywood:"#DEB887",cadetblue:"#5F9EA0",chartreuse:"#7FFF00",chocolate:"#D2691E",coral:"#FF7F50",cornflowerblue:"#6495ED",cornsilk:"#FFF8DC",crimson:"#DC143C",cyan:"#00FFFF",darkblue:"#00008B",darkcyan:"#008B8B",darkgoldenrod:"#B8860B",darkgray:"#A9A9A9",darkgrey:"#A9A9A9",darkgreen:"#006400",darkkhaki:"#BDB76B",darkmagenta:"#8B008B",darkolivegreen:"#556B2F",darkorange:"#FF8C00",darkorchid:"#9932CC",darkred:"#8B0000",darksalmon:"#E9967A",darkseagreen:"#8FBC8F",darkslateblue:"#483D8B",darkslategray:"#2F4F4F",darkslategrey:"#2F4F4F",darkturquoise:"#00CED1",darkviolet:"#9400D3",deeppink:"#FF1493",deepskyblue:"#00BFFF",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1E90FF",firebrick:"#B22222",floralwhite:"#FFFAF0",forestgreen:"#228B22",fuchsia:"#FF00FF",gainsboro:"#DCDCDC",ghostwhite:"#F8F8FF",gold:"#FFD700",goldenrod:"#DAA520",gray:"#808080",grey:"#808080",green:"#008000",greenyellow:"#ADFF2F",honeydew:"#F0FFF0",hotpink:"#FF69B4",indianred:"#CD5C5C",indigo:"#4B0082",ivory:"#FFFFF0",khaki:"#F0E68C",lavender:"#E6E6FA",lavenderblush:"#FFF0F5",lawngreen:"#7CFC00",lemonchiffon:"#FFFACD",lightblue:"#ADD8E6",lightcoral:"#F08080",lightcyan:"#E0FFFF",lightgoldenrodyellow:"#FAFAD2",lightgray:"#D3D3D3",lightgrey:"#D3D3D3",lightgreen:"#90EE90",lightpink:"#FFB6C1",lightsalmon:"#FFA07A",lightseagreen:"#20B2AA",lightskyblue:"#87CEFA",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#B0C4DE",lightyellow:"#FFFFE0",lime:"#00FF00",limegreen:"#32CD32",linen:"#FAF0E6",magenta:"#FF00FF",maroon:"#800000",mediumaquamarine:"#66CDAA",mediumblue:"#0000CD",mediumorchid:"#BA55D3",mediumpurple:"#9370DB",mediumseagreen:"#3CB371",mediumslateblue:"#7B68EE",mediumspringgreen:"#00FA9A",mediumturquoise:"#48D1CC",mediumvioletred:"#C71585",midnightblue:"#191970",mintcream:"#F5FFFA",mistyrose:"#FFE4E1",moccasin:"#FFE4B5",navajowhite:"#FFDEAD",navy:"#000080",oldlace:"#FDF5E6",olive:"#808000",olivedrab:"#6B8E23",orange:"#FFA500",orangered:"#FF4500",orchid:"#DA70D6",palegoldenrod:"#EEE8AA",palegreen:"#98FB98",paleturquoise:"#AFEEEE",palevioletred:"#DB7093",papayawhip:"#FFEFD5",peachpuff:"#FFDAB9",peru:"#CD853F",pink:"#FFC0CB",plum:"#DDA0DD",powderblue:"#B0E0E6",purple:"#800080",rebeccapurple:"#663399",red:"#FF0000",rosybrown:"#BC8F8F",royalblue:"#4169E1",saddlebrown:"#8B4513",salmon:"#FA8072",sandybrown:"#F4A460",seagreen:"#2E8B57",seashell:"#FFF5EE",sienna:"#A0522D",silver:"#C0C0C0",skyblue:"#87CEEB",slateblue:"#6A5ACD",slategray:"#708090",slategrey:"#708090",snow:"#FFFAFA",springgreen:"#00FF7F",steelblue:"#4682B4",tan:"#D2B48C",teal:"#008080",thistle:"#D8BFD8",tomato:"#FF6347",turquoise:"#40E0D0",violet:"#EE82EE",wheat:"#F5DEB3",white:"#FFFFFF",whitesmoke:"#F5F5F5",yellow:"#FFFF00",yellowgreen:"#9ACD32"},vDe="User",yDe=`0.0: #23FF52 +0.5: red +1.0: 120,30,255`;function Ewt(t,e,n){const r=new Uint8ClampedArray(4*n),i=t.length;if(e==="categorical"||e==="stepwise"){const o=e==="categorical"?i:i-1;for(let s=0,a=0;s(f.value-o)/(s-o));let l=0,c=a[0],u=a[1];for(let f=0,d=0;fu&&(l++,c=a[l],u=a[l+1]);const p=(h-c)/(u-c),[g,m,v,y]=t[l].color,[x,b,w,_]=t[l+1].color;r[d]=g+p*(x-g),r[d+1]=m+p*(b-m),r[d+2]=v+p*(w-v),r[d+3]=y+p*(_-y)}}return r}function Twt(t,e,n){const r=Ewt(t,e,n.width),i=new ImageData(r,r.length/4,1);return createImageBitmap(i).then(o=>{const s=n.getContext("2d");s&&s.drawImage(o,0,0,n.width,n.height)})}function kwt(t){const{colorRecords:e,errorMessage:n}=bDe(t.code);if(!e)return Promise.resolve({errorMessage:n});const r=document.createElement("canvas");return r.width=256,r.height=1,Twt(e,t.type,r).then(()=>({imageData:r.toDataURL("image/png").split(",")[1]}))}function xDe(t){const{colorRecords:e}=bDe(t);if(e)return e.map(n=>({...n,color:gDe(n.color)}))}function bDe(t){try{return{colorRecords:Awt(t)}}catch(e){if(e instanceof SyntaxError)return{errorMessage:`${e.message}`};throw e}}function Awt(t){const e=[];t.split(` +`).map(o=>o.trim().split(":").map(s=>s.trim())).forEach((o,s)=>{if(o.length==2||o.length==3){const[a,l]=o,c=parseFloat(a),u=_wt(l);if(!Number.isFinite(c))throw new SyntaxError(`Line ${s+1}: invalid value: ${a}`);if(!u)throw new SyntaxError(`Line ${s+1}: invalid color: ${l}`);o.length==3?e.push({value:c,color:u,label:o[2]}):e.push({value:c,color:u})}else if(o.length===1&&o[0]!=="")throw new SyntaxError(`Line ${s+1}: invalid color record: ${o[0]}`)});const n=e.length;if(n<2)throw new SyntaxError("At least two color records must be given");e.sort((o,s)=>o.value-s.value);const r=e[0].value,i=e[n-1].value;if(r===i)throw new SyntaxError("Values must form a range");return e}function XM(t){return Kb(t.expression)}function cO(t){return encodeURIComponent(Kb(t)?t:t.id)}function YM(t){return encodeURIComponent(Kb(t)?t:XM(t)?`${t.name}=${t.expression}`:t.name)}const uO=t=>t.controlState.selectedDatasetId,n1=t=>t.controlState.selectedVariableName,wDe=t=>t.controlState.selectedDataset2Id,ene=t=>t.controlState.selectedVariable2Name,tne=t=>t.controlState.selectedPlaceGroupIds,fO=t=>t.controlState.selectedPlaceId,QM=t=>t.controlState.selectedTime,Pwt=t=>t.controlState.selectedServerId,Mwt=t=>t.controlState.activities,F4=t=>t.controlState.timeAnimationActive,KM=t=>t.controlState.imageSmoothingEnabled,Rwt=t=>t.controlState.userBaseMaps,Dwt=t=>t.controlState.userOverlays,nne=t=>t.controlState.selectedBaseMapId,rne=t=>t.controlState.selectedOverlayId,Iwt=t=>!!t.controlState.layerVisibilities.baseMap,Lwt=t=>!!t.controlState.layerVisibilities.datasetBoundary,$wt=t=>!!t.controlState.layerVisibilities.datasetVariable,Fwt=t=>!!t.controlState.layerVisibilities.datasetVariable2,Nwt=t=>!!t.controlState.layerVisibilities.datasetRgb,zwt=t=>!!t.controlState.layerVisibilities.datasetRgb2,jwt=t=>!!t.controlState.layerVisibilities.datasetPlaces,_De=t=>!!t.controlState.layerVisibilities.userPlaces,Bwt=t=>!!t.controlState.layerVisibilities.overlay,Uwt=t=>t.controlState.layerVisibilities,SDe=t=>t.controlState.infoCardElementStates,Ny=t=>t.controlState.mapProjection,Wwt=t=>t.controlState.timeChunkSize,Vwt=t=>t.controlState.userPlacesFormatName,Gwt=t=>t.controlState.userPlacesFormatOptions.csv,Hwt=t=>t.controlState.userPlacesFormatOptions.geojson,qwt=t=>t.controlState.userPlacesFormatOptions.wkt,r1=t=>t.controlState.userColorBars,Xwt=t=>Pn.instance.branding.allowUserVariables,Ywt=()=>"variable",Qwt=()=>"variable2",Kwt=()=>"rgb",Zwt=()=>"rgb2",Jwt=()=>13,e_t=()=>12,t_t=()=>11,n_t=()=>10,fo=xt(HM,uO,yA),zy=xt(HM,wDe,yA),r_t=xt(fo,t=>t&&t.variables||[]),i_t=xt(fo,t=>t?Bte(t)[1]:[]),CDe=(t,e)=>!t||!e?null:Nq(t,e),Na=xt(fo,n1,CDe),Gg=xt(zy,ene,CDe),ODe=t=>t&&(t.title||t.name),o_t=xt(Na,ODe),s_t=xt(Gg,ODe),EDe=t=>t&&t.units||"-",a_t=xt(Na,EDe),l_t=xt(Gg,EDe),TDe=t=>t&&t.colorBarName||"viridis",N4=xt(Na,TDe),z4=xt(Gg,TDe),kDe=t=>t?[t.colorBarMin,t.colorBarMax]:[0,1],ADe=xt(Na,kDe),PDe=xt(Gg,kDe),MDe=t=>(t&&t.colorBarNorm)==="log"?"log":"lin",RDe=xt(Na,MDe),DDe=xt(Gg,MDe),j4=xt(r1,m1t,(t,e)=>{const n={title:vDe,description:"User-defined color bars.",names:t.map(i=>i.id)},r={};return t.forEach(({id:i,imageData:o})=>{o&&(r[i]=o)}),e?{...e,groups:[n,...e.groups],images:{...e.images,...r}}:{groups:[n],images:r,customColorMaps:{}}}),IDe=(t,e,n)=>{const r=mwt(t),{baseName:i}=r,o=e.images[i],s=n.find(a=>a.id===i);if(s){const a=s.type,l=xDe(s.code);return{...r,imageData:o,type:a,colorRecords:l}}else{const a=e.customColorMaps[i];if(a){const l=a.type,c=a.colorRecords;return{...r,imageData:o,type:l,colorRecords:c}}}return{...r,imageData:o}},ine=xt(N4,j4,r1,IDe),LDe=xt(z4,j4,r1,IDe),$De=(t,e,n)=>{const{baseName:r}=t,i=n.find(o=>o.id===r);if(i){const o=xDe(i.code);if(o)return JSON.stringify({name:e,type:i.type,colors:o.map(s=>[s.value,s.color])})}return null},c_t=xt(ine,N4,r1,$De),u_t=xt(LDe,z4,r1,$De),FDe=t=>!t||typeof t.opacity!="number"?1:t.opacity,NDe=xt(Na,FDe),zDe=xt(Gg,FDe),f_t=xt(fo,t=>t!==null?CRe(t):null),d_t=xt(fo,t=>t!==null&&t.rgbSchema||null),h_t=xt(zy,t=>t!==null&&t.rgbSchema||null),jDe=xt(fo,t=>t&&t.placeGroups||[]),B4=xt(jDe,qM,(t,e)=>t.concat(e));function BDe(t,e){const n=[];return e!==null&&e.length>0&&t.forEach(r=>{e.indexOf(r.id)>-1&&n.push(r)}),n}const p_t=xt(qM,tne,_De,(t,e)=>{const n={},r=new Set(e||[]);return t.forEach(i=>{n[i.id]=r.has(i.id)}),n}),UDe=xt(jDe,tne,BDe),dO=xt(B4,tne,BDe),g_t=xt(dO,t=>t.map(e=>e.title||e.id).join(", ")),ZM=xt(dO,t=>{const e=t.map(n=>iO(n)?n.features:[]);return[].concat(...e)}),one=xt(ZM,fO,(t,e)=>t.find(n=>n.id===e)||null),m_t=xt(one,t=>(t==null?void 0:t.geometry)||null),JM=xt(dO,fO,(t,e)=>t.length===0||e===null?null:y0t(t,e)),v_t=xt(uO,n1,one,(t,e,n)=>{if(t&&e){if(!n)return`${t}-${e}-all`;if(n.geometry.type==="Polygon"||n.geometry.type==="MultiPolygon")return`${t}-${e}-${n.id}`}return null}),WDe=xt(YRe,uO,n1,fO,(t,e,n,r)=>{if(!e||!n||!r)return!1;for(const i of t)for(const o of i.timeSeriesArray){const s=o.source;if(s.datasetId===e&&s.variableName===n&&s.placeId===r)return!1}return!0}),y_t=xt(YRe,B4,(t,e)=>{const n={};return Vte(e,(r,i)=>{for(const o of t)if(o.timeSeriesArray.find(s=>s.source.placeId===i.id)){n[i.id]=L4(r,i);break}}),n}),VDe=xt(uO,n1,fO,(t,e,n)=>!!(t&&e&&n)),x_t=xt(x1t,B4,(t,e)=>{const n=[];return t.forEach(r=>{const i=r.source.placeInfo.place.id;Vte(e,(o,s)=>{if(s.id===i){const a=L4(o,s);n.push({...r,source:{...r.source,placeInfo:a}})}})}),n}),b_t=xt(dO,t=>{const e=[];return Vte(t,(n,r)=>{e.push(L4(n,r).label)}),e}),w_t=xt(Na,Wwt,(t,e)=>{if(t&&t.timeChunkSize){const n=t.timeChunkSize;return n*Math.ceil(e/n)}return e}),GDe=t=>t&&SRe(t)||null,hO=xt(fo,GDe),__t=xt(zy,GDe),HDe=t=>t&&t.attributions||null,sne=xt(fo,HDe),S_t=xt(zy,HDe),qDe=t=>t===null||t.coordinates.length===0?null:t.coordinates,qq=xt(hO,qDe),C_t=xt(hO,qDe),XDe=(t,e)=>t===null||e===null?-1:ERe(e,t),YDe=xt(QM,qq,XDe),O_t=xt(QM,C_t,XDe),QDe=(t,e,n)=>t===null?null:n&&e>-1?n.labels[e]:new Date(t).toISOString(),i1=xt(QM,YDe,hO,QDe),E_t=xt(QM,O_t,__t,QDe);function T_t(t,e){if(t!==jte){const n=typeof e=="number"?e+1:20;return new Nte({tileSize:[256,256],origin:[-180,90],extent:[-180,-90,180,90],resolutions:Array.from({length:n},(r,i)=>180/256/Math.pow(2,i))})}}function k_t(t,e,n,r,i,o,s,a,l){return new eO({url:t,projection:e,tileGrid:n,attributions:r||void 0,transition:i?0:250,imageSmoothing:o,tileLoadFunction:s,maxZoom:l})}function A_t(t){if(t)return(e,n)=>{e instanceof Ete&&(t.getView().getInteracting()?t.once("moveend",function(){e.getImage().src=n}):e.getImage().src=n)}}const P_t=Oht(A_t,{serializer:t=>{const e=t[0];if(e){const n=e.getTarget();return typeof n=="string"?n:n&&n.id||"map"}return""}});function M_t(){const t=Kc.map;return P_t(t)}function KDe(t,e,n,r,i,o,s,a,l,c,u,f,d=10){a!==null&&(o=[...o,["time",a]]);const h=aO(e,o);typeof i=="number"&&(i+=3);const p=T_t(c,i),g=k_t(h,c,p,u,l,f,M_t(),r,i),m=c===tO?n:gMe(n,"EPSG:4326",c);return C.jsx(_Re,{id:t,source:g,extent:m,zIndex:d,opacity:s})}const R_t=xt(fo,Ny,Lwt,(t,e,n)=>{if(!t||!n)return null;let r=t.geometry;if(!r)if(t.bbox){const[s,a,l,c]=t.bbox;r={type:"Polygon",coordinates:[[[s,a],[l,a],[l,c],[s,c],[s,a]]]}}else return console.warn(`Dataset ${t.id} has no bbox!`),null;const i=new WM({features:new t1({dataProjection:tO,featureProjection:e}).readFeatures({type:"Feature",geometry:r})}),o=new Yd({stroke:new fh({color:"orange",width:3,lineDash:[2,4]})});return C.jsx(I4,{id:`${t.id}.bbox`,source:i,style:o,zIndex:16,opacity:.5})}),Oo=xt(QRe,Pwt,(t,e)=>{if(t.length===0)throw new Error("internal error: no servers configured");const n=t.find(r=>r.id===e);if(!n)throw new Error(`internal error: server with ID "${e}" not found`);return n}),ZDe=(t,e,n,r,i,o,s,a,l,c,u,f,d,h,p,g)=>{if(!e||!i||!u)return null;const m=[["crs",p],["vmin",`${s[0]}`],["vmax",`${s[1]}`],["cmap",l||o]];return a==="log"&&m.push(["norm",a]),KDe(f,eIe(t.url,e,i),e.bbox,i.tileLevelMin,i.tileLevelMax,m,c,n,h,p,r,g,d)},D_t=xt(Oo,fo,i1,sne,Na,N4,ADe,RDe,c_t,NDe,$wt,Ywt,Jwt,F4,Ny,KM,ZDe),I_t=xt(Oo,zy,E_t,S_t,Gg,z4,PDe,DDe,u_t,zDe,Fwt,Qwt,e_t,F4,Ny,KM,ZDe),JDe=(t,e,n,r,i,o,s,a,l,c,u)=>{if(!e||!n||!r)return null;const f=[["crs",l]];return KDe(i,eIe(t.url,e,"rgb"),e.bbox,n.tileLevelMin,n.tileLevelMax,f,1,s,a,l,c,u,o)},L_t=xt(Oo,fo,d_t,Nwt,Kwt,t_t,i1,F4,Ny,sne,KM,JDe),$_t=xt(Oo,zy,h_t,zwt,Zwt,n_t,i1,F4,Ny,sne,KM,JDe);function eIe(t,e,n){return`${t}/tiles/${cO(e)}/${YM(n)}/{z}/{y}/{x}`}function F_t(){return Qee()}function N_t(){return new BM({fill:nIe(),stroke:tIe(),radius:6})}function tIe(){return new fh({color:[200,0,0,.75],width:1.25})}function nIe(){return new ab({color:[255,0,0,F_t()]})}function z_t(){return new Yd({image:N_t(),stroke:tIe(),fill:nIe()})}const j_t=xt(UDe,Ny,jwt,(t,e,n)=>{if(!n||t.length===0)return null;const r=[];return t.forEach((i,o)=>{iO(i)&&r.push(C.jsx(I4,{id:`placeGroup.${i.id}`,style:z_t(),zIndex:100,source:new WM({features:new t1({dataProjection:tO,featureProjection:e}).readFeatures(i)})},o))}),C.jsx(vRe,{children:r})}),B_t=xt(SDe,t=>{const e=[];return Object.getOwnPropertyNames(t).forEach(n=>{t[n].visible&&e.push(n)}),e}),U_t=xt(SDe,t=>{const e={};return Object.getOwnPropertyNames(t).forEach(n=>{e[n]=t[n].viewMode||"text"}),e}),W_t=xt(Mwt,t=>Object.keys(t).map(e=>t[e])),ane=xt(Rwt,t=>[...t,...tDe]),lne=xt(Dwt,t=>[...t,...S1t]),rIe=(t,e,n,r)=>{if(!n||!e)return null;const i=aN(t,e);if(!i)return null;let o=i.attribution;o&&(o.startsWith("http://")||o.startsWith("https://"))&&(o=`© ${i.group}`);let s;if(i.wms){const{layerName:a,styleName:l}=i.wms;s=new Yyt({url:i.url,params:{...l?{STYLES:l}:{},LAYERS:a},attributions:o,attributionsCollapsible:!0})}else{const a=tdt(i.group);s=new eO({url:i.url+(a?`?${a.param}=${a.token}`:""),attributions:o,attributionsCollapsible:!0})}return C.jsx(_Re,{id:i.id,source:s,zIndex:r})},V_t=xt(ane,nne,Iwt,()=>0,rIe),G_t=xt(lne,rne,Bwt,()=>20,rIe),iIe=(t,e)=>{const n=aN(t,e);return n?sN(n):null},H_t=xt(ane,nne,iIe),q_t=xt(lne,rne,iIe),X_t=xt(H_t,q_t,nne,rne,fo,zy,Na,Gg,Uwt,(t,e,n,r,i,o,s,a,l)=>({baseMap:{title:"Base Map",subTitle:t||void 0,visible:l.baseMap,disabled:!n},overlay:{title:"Overlay",subTitle:e||void 0,visible:l.overlay,disabled:!r},datasetRgb:{title:"Dataset RGB",subTitle:i?i.title:void 0,visible:l.datasetRgb,disabled:!i},datasetRgb2:{title:"Dataset RGB",subTitle:o?o.title:void 0,visible:l.datasetRgb2,disabled:!o,pinned:!0},datasetVariable:{title:"Dataset Variable",subTitle:i&&s?`${i.title} / ${s.title||s.name}`:void 0,visible:l.datasetVariable,disabled:!(i&&s)},datasetVariable2:{title:"Dataset Variable",subTitle:o&&a?`${o.title} / ${a.title||a.name}`:void 0,visible:l.datasetVariable2,disabled:!(o&&a),pinned:!0},datasetBoundary:{title:"Dataset Boundary",subTitle:i?i.title:void 0,visible:l.datasetBoundary,disabled:!i},datasetPlaces:{title:"Dataset Places",visible:l.datasetPlaces},userPlaces:{title:"User Places",visible:l.userPlaces}})),Xq={selectedDatasetId:{type:"str | None",description:"The identifier of the currently selected dataset.",selector:uO},selectedVariableName:{type:"str | None",description:"The name of the currently selected variable within the selected dataset.",selector:n1},selectedDataset2Id:{type:"str | None",description:"The identifier of the dataset that contains the pinned variable.",selector:wDe},selectedVariable2Name:{type:"str | None",description:"The name of the pinned variable.",selector:ene},selectedPlaceGeometry:{type:"dict[str, Any] | None",description:"The geometry of the currently selected place in GeoJSON format.",selector:m_t},selectedTimeLabel:{type:"str | None",description:"The currently selected UTC time using ISO format.",selector:i1}};function Y_t(t){return{subscribe(e){return t.subscribe(e)},get(e){const n=Xq[e];if(n)return n.selector(t.getState())}}}function Q_t(){const t=[];return Object.getOwnPropertyNames(Xq).forEach(e=>{const n=Xq[e];t.push(`- \`${e}\`: **${n.type}** ${n.description}`)}),t.join(` + +`)}function K_t(t){return Vg(`${t}/colorbars`,Z_t)}function Z_t(t){const e=[],n={},r={};return t.forEach(i=>{const[o,s,a]=i,l=[];a.forEach(c=>{if(c.length===3){const[u,f,d]=c;l.push(u),n[u]=f,r[u]={name:d.name,type:d.type,colorRecords:d.colors.map(J_t)}}else if(c.length===2){const[u,f]=c;l.push(u),n[u]=f}}),e.push({title:o,description:s,names:l})}),{groups:e,images:n,customColorMaps:r}}function J_t(t){const e=eSt(t[1]),n=t[0];if(t.length===3){const r=t[2];return{value:n,color:e,label:r}}else return{value:n,color:e}}function eSt(t){return t?Kb(t)?t:gDe(t):"#000000"}function tSt(t,e){const n=aO(`${t}/datasets`,[["details","1"]]),r=sO(e);return Vg(n,r,nSt)}function nSt(t){return(t.datasets||[]).map(rSt)}function rSt(t){if(t.dimensions&&t.dimensions.length){let e=t.dimensions;const n=e.findIndex(r=>r.name==="time");if(n>-1){const r=e[n],i=r.coordinates;if(i&&i.length&&typeof i[0]=="string"){const o=i,s=o.map(a=>new Date(a).getTime());return e=[...e],e[n]={...r,coordinates:s,labels:o},{...t,dimensions:e}}}}return t}function iSt(t,e,n,r){const i=sO(r),o=encodeURIComponent(e),s=encodeURIComponent(n);return Vg(`${t}/datasets/${o}/places/${s}`,i)}function oSt(t){return Vg(`${t}/expressions/capabilities`)}function sSt(t){return Vg(`${t}/`)}function aSt(t,e,n,r,i,o,s,a,l,c){let u,f=null;const d=[];a?(d.push(["aggMethods","median"]),u="median"):l?(d.push(["aggMethods","mean,std"]),u="mean",f="std"):(d.push(["aggMethods","mean"]),u="mean"),o&&d.push(["startDate",o]),s&&d.push(["endDate",s]);const h=aO(`${t}/timeseries/${cO(e)}/${YM(n)}`,d),p={...sO(c),method:"post",body:JSON.stringify(i)};return Vg(h,p,m=>{const v=m.result;if(!v||v.length===0)return null;const y=v.map(b=>({...b,time:new Date(b.time).getTime()}));return{source:{datasetId:e.id,datasetTitle:e.title,variableName:n.name,variableUnits:n.units||void 0,placeId:r,geometry:i,valueDataKey:u,errorDataKey:f},data:y}})}function lSt(t,e,n,r,i,o){const s=i!==null?[["time",i]]:[],a=aO(`${t}/statistics/${cO(e)}/${YM(n)}`,s),l={...sO(o),method:"post",body:JSON.stringify(r.place.geometry)},c={dataset:e,variable:n,placeInfo:r,time:i};return Vg(a,l,u=>({source:c,statistics:u.result}))}function cSt(t,e,n,r,i,o,s){const a=[["lon",r.toString()],["lat",i.toString()]];o&&a.push(["time",o]);const l=aO(`${t}/statistics/${cO(e)}/${YM(n)}`,a);return Vg(l,sO(s),c=>c.result?c.result:{})}function uSt(t,e){const n=aO(`${t}/maintenance/update`,[]),r=sO(e);try{return Vg(n,r).then(()=>!0).catch(i=>(console.error(i),!1))}catch(i){return console.error(i),Promise.resolve(!1)}}var oIe={exports:{}};/*! JSZip v3.10.1 - A JavaScript class for generating and reading zip files @@ -251,31 +253,22 @@ Dual licenced under the MIT license or GPLv3. See https://raw.github.com/Stuk/js JSZip uses the library pako released under the MIT license : https://github.com/nodeca/pako/blob/main/LICENSE -*/(function(t,e){(function(n){t.exports=n()})(function(){return function n(r,i,o){function s(c,u){if(!i[c]){if(!r[c]){var f=typeof K2=="function"&&K2;if(!u&&f)return f(c,!0);if(a)return a(c,!0);var d=new Error("Cannot find module '"+c+"'");throw d.code="MODULE_NOT_FOUND",d}var h=i[c]={exports:{}};r[c][0].call(h.exports,function(p){var g=r[c][1][p];return s(g||p)},h,h.exports,n,r,i,o)}return i[c].exports}for(var a=typeof K2=="function"&&K2,l=0;l>2,h=(3&c)<<4|u>>4,p=1>6:64,g=2>4,u=(15&d)<<4|(h=a.indexOf(l.charAt(g++)))>>2,f=(3&h)<<6|(p=a.indexOf(l.charAt(g++))),y[m++]=c,h!==64&&(y[m++]=u),p!==64&&(y[m++]=f);return y}},{"./support":30,"./utils":32}],2:[function(n,r,i){var o=n("./external"),s=n("./stream/DataWorker"),a=n("./stream/Crc32Probe"),l=n("./stream/DataLengthProbe");function c(u,f,d,h,p){this.compressedSize=u,this.uncompressedSize=f,this.crc32=d,this.compression=h,this.compressedContent=p}c.prototype={getContentWorker:function(){var u=new s(o.Promise.resolve(this.compressedContent)).pipe(this.compression.uncompressWorker()).pipe(new l("data_length")),f=this;return u.on("end",function(){if(this.streamInfo.data_length!==f.uncompressedSize)throw new Error("Bug : uncompressed data size mismatch")}),u},getCompressedWorker:function(){return new s(o.Promise.resolve(this.compressedContent)).withStreamInfo("compressedSize",this.compressedSize).withStreamInfo("uncompressedSize",this.uncompressedSize).withStreamInfo("crc32",this.crc32).withStreamInfo("compression",this.compression)}},c.createWorkerFrom=function(u,f,d){return u.pipe(new a).pipe(new l("uncompressedSize")).pipe(f.compressWorker(d)).pipe(new l("compressedSize")).withStreamInfo("compression",f)},r.exports=c},{"./external":6,"./stream/Crc32Probe":25,"./stream/DataLengthProbe":26,"./stream/DataWorker":27}],3:[function(n,r,i){var o=n("./stream/GenericWorker");i.STORE={magic:"\0\0",compressWorker:function(){return new o("STORE compression")},uncompressWorker:function(){return new o("STORE decompression")}},i.DEFLATE=n("./flate")},{"./flate":7,"./stream/GenericWorker":28}],4:[function(n,r,i){var o=n("./utils"),s=function(){for(var a,l=[],c=0;c<256;c++){a=c;for(var u=0;u<8;u++)a=1&a?3988292384^a>>>1:a>>>1;l[c]=a}return l}();r.exports=function(a,l){return a!==void 0&&a.length?o.getTypeOf(a)!=="string"?function(c,u,f,d){var h=s,p=d+f;c^=-1;for(var g=d;g>>8^h[255&(c^u[g])];return-1^c}(0|l,a,a.length,0):function(c,u,f,d){var h=s,p=d+f;c^=-1;for(var g=d;g>>8^h[255&(c^u.charCodeAt(g))];return-1^c}(0|l,a,a.length,0):0}},{"./utils":32}],5:[function(n,r,i){i.base64=!1,i.binary=!1,i.dir=!1,i.createFolders=!0,i.date=null,i.compression=null,i.compressionOptions=null,i.comment=null,i.unixPermissions=null,i.dosPermissions=null},{}],6:[function(n,r,i){var o=null;o=typeof Promise<"u"?Promise:n("lie"),r.exports={Promise:o}},{lie:37}],7:[function(n,r,i){var o=typeof Uint8Array<"u"&&typeof Uint16Array<"u"&&typeof Uint32Array<"u",s=n("pako"),a=n("./utils"),l=n("./stream/GenericWorker"),c=o?"uint8array":"array";function u(f,d){l.call(this,"FlateWorker/"+f),this._pako=null,this._pakoAction=f,this._pakoOptions=d,this.meta={}}i.magic="\b\0",a.inherits(u,l),u.prototype.processChunk=function(f){this.meta=f.meta,this._pako===null&&this._createPako(),this._pako.push(a.transformTo(c,f.data),!1)},u.prototype.flush=function(){l.prototype.flush.call(this),this._pako===null&&this._createPako(),this._pako.push([],!0)},u.prototype.cleanUp=function(){l.prototype.cleanUp.call(this),this._pako=null},u.prototype._createPako=function(){this._pako=new s[this._pakoAction]({raw:!0,level:this._pakoOptions.level||-1});var f=this;this._pako.onData=function(d){f.push({data:d,meta:f.meta})}},i.compressWorker=function(f){return new u("Deflate",f)},i.uncompressWorker=function(){return new u("Inflate",{})}},{"./stream/GenericWorker":28,"./utils":32,pako:38}],8:[function(n,r,i){function o(h,p){var g,m="";for(g=0;g>>=8;return m}function s(h,p,g,m,v,y){var x,b,w=h.file,_=h.compression,S=y!==c.utf8encode,O=a.transformTo("string",y(w.name)),k=a.transformTo("string",c.utf8encode(w.name)),E=w.comment,M=a.transformTo("string",y(E)),A=a.transformTo("string",c.utf8encode(E)),P=k.length!==w.name.length,T=A.length!==E.length,R="",I="",B="",$=w.dir,z=w.date,L={crc32:0,compressedSize:0,uncompressedSize:0};p&&!g||(L.crc32=h.crc32,L.compressedSize=h.compressedSize,L.uncompressedSize=h.uncompressedSize);var j=0;p&&(j|=8),S||!P&&!T||(j|=2048);var N=0,F=0;$&&(N|=16),v==="UNIX"?(F=798,N|=function(q,Y){var le=q;return q||(le=Y?16893:33204),(65535&le)<<16}(w.unixPermissions,$)):(F=20,N|=function(q){return 63&(q||0)}(w.dosPermissions)),x=z.getUTCHours(),x<<=6,x|=z.getUTCMinutes(),x<<=5,x|=z.getUTCSeconds()/2,b=z.getUTCFullYear()-1980,b<<=4,b|=z.getUTCMonth()+1,b<<=5,b|=z.getUTCDate(),P&&(I=o(1,1)+o(u(O),4)+k,R+="up"+o(I.length,2)+I),T&&(B=o(1,1)+o(u(M),4)+A,R+="uc"+o(B.length,2)+B);var H="";return H+=` -\0`,H+=o(j,2),H+=_.magic,H+=o(x,2),H+=o(b,2),H+=o(L.crc32,4),H+=o(L.compressedSize,4),H+=o(L.uncompressedSize,4),H+=o(O.length,2),H+=o(R.length,2),{fileRecord:f.LOCAL_FILE_HEADER+H+O+R,dirRecord:f.CENTRAL_FILE_HEADER+o(F,2)+H+o(M.length,2)+"\0\0\0\0"+o(N,4)+o(m,4)+O+R+M}}var a=n("../utils"),l=n("../stream/GenericWorker"),c=n("../utf8"),u=n("../crc32"),f=n("../signature");function d(h,p,g,m){l.call(this,"ZipFileWorker"),this.bytesWritten=0,this.zipComment=p,this.zipPlatform=g,this.encodeFileName=m,this.streamFiles=h,this.accumulate=!1,this.contentBuffer=[],this.dirRecords=[],this.currentSourceOffset=0,this.entriesCount=0,this.currentFile=null,this._sources=[]}a.inherits(d,l),d.prototype.push=function(h){var p=h.meta.percent||0,g=this.entriesCount,m=this._sources.length;this.accumulate?this.contentBuffer.push(h):(this.bytesWritten+=h.data.length,l.prototype.push.call(this,{data:h.data,meta:{currentFile:this.currentFile,percent:g?(p+100*(g-m-1))/g:100}}))},d.prototype.openedSource=function(h){this.currentSourceOffset=this.bytesWritten,this.currentFile=h.file.name;var p=this.streamFiles&&!h.file.dir;if(p){var g=s(h,p,!1,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);this.push({data:g.fileRecord,meta:{percent:0}})}else this.accumulate=!0},d.prototype.closedSource=function(h){this.accumulate=!1;var p=this.streamFiles&&!h.file.dir,g=s(h,p,!0,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);if(this.dirRecords.push(g.dirRecord),p)this.push({data:function(m){return f.DATA_DESCRIPTOR+o(m.crc32,4)+o(m.compressedSize,4)+o(m.uncompressedSize,4)}(h),meta:{percent:100}});else for(this.push({data:g.fileRecord,meta:{percent:0}});this.contentBuffer.length;)this.push(this.contentBuffer.shift());this.currentFile=null},d.prototype.flush=function(){for(var h=this.bytesWritten,p=0;p=this.index;l--)c=(c<<8)+this.byteAt(l);return this.index+=a,c},readString:function(a){return o.transformTo("string",this.readData(a))},readData:function(){},lastIndexOfSignature:function(){},readAndCheckSignature:function(){},readDate:function(){var a=this.readInt(4);return new Date(Date.UTC(1980+(a>>25&127),(a>>21&15)-1,a>>16&31,a>>11&31,a>>5&63,(31&a)<<1))}},r.exports=s},{"../utils":32}],19:[function(n,r,i){var o=n("./Uint8ArrayReader");function s(a){o.call(this,a)}n("../utils").inherits(s,o),s.prototype.readData=function(a){this.checkOffset(a);var l=this.data.slice(this.zero+this.index,this.zero+this.index+a);return this.index+=a,l},r.exports=s},{"../utils":32,"./Uint8ArrayReader":21}],20:[function(n,r,i){var o=n("./DataReader");function s(a){o.call(this,a)}n("../utils").inherits(s,o),s.prototype.byteAt=function(a){return this.data.charCodeAt(this.zero+a)},s.prototype.lastIndexOfSignature=function(a){return this.data.lastIndexOf(a)-this.zero},s.prototype.readAndCheckSignature=function(a){return a===this.readData(4)},s.prototype.readData=function(a){this.checkOffset(a);var l=this.data.slice(this.zero+this.index,this.zero+this.index+a);return this.index+=a,l},r.exports=s},{"../utils":32,"./DataReader":18}],21:[function(n,r,i){var o=n("./ArrayReader");function s(a){o.call(this,a)}n("../utils").inherits(s,o),s.prototype.readData=function(a){if(this.checkOffset(a),a===0)return new Uint8Array(0);var l=this.data.subarray(this.zero+this.index,this.zero+this.index+a);return this.index+=a,l},r.exports=s},{"../utils":32,"./ArrayReader":17}],22:[function(n,r,i){var o=n("../utils"),s=n("../support"),a=n("./ArrayReader"),l=n("./StringReader"),c=n("./NodeBufferReader"),u=n("./Uint8ArrayReader");r.exports=function(f){var d=o.getTypeOf(f);return o.checkSupport(d),d!=="string"||s.uint8array?d==="nodebuffer"?new c(f):s.uint8array?new u(o.transformTo("uint8array",f)):new a(o.transformTo("array",f)):new l(f)}},{"../support":30,"../utils":32,"./ArrayReader":17,"./NodeBufferReader":19,"./StringReader":20,"./Uint8ArrayReader":21}],23:[function(n,r,i){i.LOCAL_FILE_HEADER="PK",i.CENTRAL_FILE_HEADER="PK",i.CENTRAL_DIRECTORY_END="PK",i.ZIP64_CENTRAL_DIRECTORY_LOCATOR="PK\x07",i.ZIP64_CENTRAL_DIRECTORY_END="PK",i.DATA_DESCRIPTOR="PK\x07\b"},{}],24:[function(n,r,i){var o=n("./GenericWorker"),s=n("../utils");function a(l){o.call(this,"ConvertWorker to "+l),this.destType=l}s.inherits(a,o),a.prototype.processChunk=function(l){this.push({data:s.transformTo(this.destType,l.data),meta:l.meta})},r.exports=a},{"../utils":32,"./GenericWorker":28}],25:[function(n,r,i){var o=n("./GenericWorker"),s=n("../crc32");function a(){o.call(this,"Crc32Probe"),this.withStreamInfo("crc32",0)}n("../utils").inherits(a,o),a.prototype.processChunk=function(l){this.streamInfo.crc32=s(l.data,this.streamInfo.crc32||0),this.push(l)},r.exports=a},{"../crc32":4,"../utils":32,"./GenericWorker":28}],26:[function(n,r,i){var o=n("../utils"),s=n("./GenericWorker");function a(l){s.call(this,"DataLengthProbe for "+l),this.propName=l,this.withStreamInfo(l,0)}o.inherits(a,s),a.prototype.processChunk=function(l){if(l){var c=this.streamInfo[this.propName]||0;this.streamInfo[this.propName]=c+l.data.length}s.prototype.processChunk.call(this,l)},r.exports=a},{"../utils":32,"./GenericWorker":28}],27:[function(n,r,i){var o=n("../utils"),s=n("./GenericWorker");function a(l){s.call(this,"DataWorker");var c=this;this.dataIsReady=!1,this.index=0,this.max=0,this.data=null,this.type="",this._tickScheduled=!1,l.then(function(u){c.dataIsReady=!0,c.data=u,c.max=u&&u.length||0,c.type=o.getTypeOf(u),c.isPaused||c._tickAndRepeat()},function(u){c.error(u)})}o.inherits(a,s),a.prototype.cleanUp=function(){s.prototype.cleanUp.call(this),this.data=null},a.prototype.resume=function(){return!!s.prototype.resume.call(this)&&(!this._tickScheduled&&this.dataIsReady&&(this._tickScheduled=!0,o.delay(this._tickAndRepeat,[],this)),!0)},a.prototype._tickAndRepeat=function(){this._tickScheduled=!1,this.isPaused||this.isFinished||(this._tick(),this.isFinished||(o.delay(this._tickAndRepeat,[],this),this._tickScheduled=!0))},a.prototype._tick=function(){if(this.isPaused||this.isFinished)return!1;var l=null,c=Math.min(this.max,this.index+16384);if(this.index>=this.max)return this.end();switch(this.type){case"string":l=this.data.substring(this.index,c);break;case"uint8array":l=this.data.subarray(this.index,c);break;case"array":case"nodebuffer":l=this.data.slice(this.index,c)}return this.index=c,this.push({data:l,meta:{percent:this.max?this.index/this.max*100:0}})},r.exports=a},{"../utils":32,"./GenericWorker":28}],28:[function(n,r,i){function o(s){this.name=s||"default",this.streamInfo={},this.generatedError=null,this.extraStreamInfo={},this.isPaused=!0,this.isFinished=!1,this.isLocked=!1,this._listeners={data:[],end:[],error:[]},this.previous=null}o.prototype={push:function(s){this.emit("data",s)},end:function(){if(this.isFinished)return!1;this.flush();try{this.emit("end"),this.cleanUp(),this.isFinished=!0}catch(s){this.emit("error",s)}return!0},error:function(s){return!this.isFinished&&(this.isPaused?this.generatedError=s:(this.isFinished=!0,this.emit("error",s),this.previous&&this.previous.error(s),this.cleanUp()),!0)},on:function(s,a){return this._listeners[s].push(a),this},cleanUp:function(){this.streamInfo=this.generatedError=this.extraStreamInfo=null,this._listeners=[]},emit:function(s,a){if(this._listeners[s])for(var l=0;l "+s:s}},r.exports=o},{}],29:[function(n,r,i){var o=n("../utils"),s=n("./ConvertWorker"),a=n("./GenericWorker"),l=n("../base64"),c=n("../support"),u=n("../external"),f=null;if(c.nodestream)try{f=n("../nodejs/NodejsStreamOutputAdapter")}catch{}function d(p,g){return new u.Promise(function(m,v){var y=[],x=p._internalType,b=p._outputType,w=p._mimeType;p.on("data",function(_,S){y.push(_),g&&g(S)}).on("error",function(_){y=[],v(_)}).on("end",function(){try{var _=function(S,O,k){switch(S){case"blob":return o.newBlob(o.transformTo("arraybuffer",O),k);case"base64":return l.encode(O);default:return o.transformTo(S,O)}}(b,function(S,O){var k,E=0,M=null,A=0;for(k=0;k"u")i.blob=!1;else{var o=new ArrayBuffer(0);try{i.blob=new Blob([o],{type:"application/zip"}).size===0}catch{try{var s=new(self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder);s.append(o),i.blob=s.getBlob("application/zip").size===0}catch{i.blob=!1}}}try{i.nodestream=!!n("readable-stream").Readable}catch{i.nodestream=!1}},{"readable-stream":16}],31:[function(n,r,i){for(var o=n("./utils"),s=n("./support"),a=n("./nodejsUtils"),l=n("./stream/GenericWorker"),c=new Array(256),u=0;u<256;u++)c[u]=252<=u?6:248<=u?5:240<=u?4:224<=u?3:192<=u?2:1;c[254]=c[254]=1;function f(){l.call(this,"utf-8 decode"),this.leftOver=null}function d(){l.call(this,"utf-8 encode")}i.utf8encode=function(h){return s.nodebuffer?a.newBufferFrom(h,"utf-8"):function(p){var g,m,v,y,x,b=p.length,w=0;for(y=0;y>>6:(m<65536?g[x++]=224|m>>>12:(g[x++]=240|m>>>18,g[x++]=128|m>>>12&63),g[x++]=128|m>>>6&63),g[x++]=128|63&m);return g}(h)},i.utf8decode=function(h){return s.nodebuffer?o.transformTo("nodebuffer",h).toString("utf-8"):function(p){var g,m,v,y,x=p.length,b=new Array(2*x);for(g=m=0;g>10&1023,b[m++]=56320|1023&v)}return b.length!==m&&(b.subarray?b=b.subarray(0,m):b.length=m),o.applyFromCharCode(b)}(h=o.transformTo(s.uint8array?"uint8array":"array",h))},o.inherits(f,l),f.prototype.processChunk=function(h){var p=o.transformTo(s.uint8array?"uint8array":"array",h.data);if(this.leftOver&&this.leftOver.length){if(s.uint8array){var g=p;(p=new Uint8Array(g.length+this.leftOver.length)).set(this.leftOver,0),p.set(g,this.leftOver.length)}else p=this.leftOver.concat(p);this.leftOver=null}var m=function(y,x){var b;for((x=x||y.length)>y.length&&(x=y.length),b=x-1;0<=b&&(192&y[b])==128;)b--;return b<0||b===0?x:b+c[y[b]]>x?b:x}(p),v=p;m!==p.length&&(s.uint8array?(v=p.subarray(0,m),this.leftOver=p.subarray(m,p.length)):(v=p.slice(0,m),this.leftOver=p.slice(m,p.length))),this.push({data:i.utf8decode(v),meta:h.meta})},f.prototype.flush=function(){this.leftOver&&this.leftOver.length&&(this.push({data:i.utf8decode(this.leftOver),meta:{}}),this.leftOver=null)},i.Utf8DecodeWorker=f,o.inherits(d,l),d.prototype.processChunk=function(h){this.push({data:i.utf8encode(h.data),meta:h.meta})},i.Utf8EncodeWorker=d},{"./nodejsUtils":14,"./stream/GenericWorker":28,"./support":30,"./utils":32}],32:[function(n,r,i){var o=n("./support"),s=n("./base64"),a=n("./nodejsUtils"),l=n("./external");function c(g){return g}function u(g,m){for(var v=0;v>8;this.dir=!!(16&this.externalFileAttributes),h==0&&(this.dosPermissions=63&this.externalFileAttributes),h==3&&(this.unixPermissions=this.externalFileAttributes>>16&65535),this.dir||this.fileNameStr.slice(-1)!=="/"||(this.dir=!0)},parseZIP64ExtraField:function(){if(this.extraFields[1]){var h=o(this.extraFields[1].value);this.uncompressedSize===s.MAX_VALUE_32BITS&&(this.uncompressedSize=h.readInt(8)),this.compressedSize===s.MAX_VALUE_32BITS&&(this.compressedSize=h.readInt(8)),this.localHeaderOffset===s.MAX_VALUE_32BITS&&(this.localHeaderOffset=h.readInt(8)),this.diskNumberStart===s.MAX_VALUE_32BITS&&(this.diskNumberStart=h.readInt(4))}},readExtraFields:function(h){var p,g,m,v=h.index+this.extraFieldsLength;for(this.extraFields||(this.extraFields={});h.index+4>>6:(h<65536?d[m++]=224|h>>>12:(d[m++]=240|h>>>18,d[m++]=128|h>>>12&63),d[m++]=128|h>>>6&63),d[m++]=128|63&h);return d},i.buf2binstring=function(f){return u(f,f.length)},i.binstring2buf=function(f){for(var d=new o.Buf8(f.length),h=0,p=d.length;h>10&1023,y[p++]=56320|1023&g)}return u(y,p)},i.utf8border=function(f,d){var h;for((d=d||f.length)>f.length&&(d=f.length),h=d-1;0<=h&&(192&f[h])==128;)h--;return h<0||h===0?d:h+l[f[h]]>d?h:d}},{"./common":41}],43:[function(n,r,i){r.exports=function(o,s,a,l){for(var c=65535&o|0,u=o>>>16&65535|0,f=0;a!==0;){for(a-=f=2e3>>1:s>>>1;a[l]=s}return a}();r.exports=function(s,a,l,c){var u=o,f=c+l;s^=-1;for(var d=c;d>>8^u[255&(s^a[d])];return-1^s}},{}],46:[function(n,r,i){var o,s=n("../utils/common"),a=n("./trees"),l=n("./adler32"),c=n("./crc32"),u=n("./messages"),f=0,d=4,h=0,p=-2,g=-1,m=4,v=2,y=8,x=9,b=286,w=30,_=19,S=2*b+1,O=15,k=3,E=258,M=E+k+1,A=42,P=113,T=1,R=2,I=3,B=4;function $(U,oe){return U.msg=u[oe],oe}function z(U){return(U<<1)-(4U.avail_out&&(ne=U.avail_out),ne!==0&&(s.arraySet(U.output,oe.pending_buf,oe.pending_out,ne,U.next_out),U.next_out+=ne,oe.pending_out+=ne,U.total_out+=ne,U.avail_out-=ne,oe.pending-=ne,oe.pending===0&&(oe.pending_out=0))}function N(U,oe){a._tr_flush_block(U,0<=U.block_start?U.block_start:-1,U.strstart-U.block_start,oe),U.block_start=U.strstart,j(U.strm)}function F(U,oe){U.pending_buf[U.pending++]=oe}function H(U,oe){U.pending_buf[U.pending++]=oe>>>8&255,U.pending_buf[U.pending++]=255&oe}function q(U,oe){var ne,V,X=U.max_chain_length,Z=U.strstart,he=U.prev_length,xe=U.nice_match,G=U.strstart>U.w_size-M?U.strstart-(U.w_size-M):0,W=U.window,J=U.w_mask,se=U.prev,ye=U.strstart+E,ie=W[Z+he-1],fe=W[Z+he];U.prev_length>=U.good_match&&(X>>=2),xe>U.lookahead&&(xe=U.lookahead);do if(W[(ne=oe)+he]===fe&&W[ne+he-1]===ie&&W[ne]===W[Z]&&W[++ne]===W[Z+1]){Z+=2,ne++;do;while(W[++Z]===W[++ne]&&W[++Z]===W[++ne]&&W[++Z]===W[++ne]&&W[++Z]===W[++ne]&&W[++Z]===W[++ne]&&W[++Z]===W[++ne]&&W[++Z]===W[++ne]&&W[++Z]===W[++ne]&&ZG&&--X!=0);return he<=U.lookahead?he:U.lookahead}function Y(U){var oe,ne,V,X,Z,he,xe,G,W,J,se=U.w_size;do{if(X=U.window_size-U.lookahead-U.strstart,U.strstart>=se+(se-M)){for(s.arraySet(U.window,U.window,se,se,0),U.match_start-=se,U.strstart-=se,U.block_start-=se,oe=ne=U.hash_size;V=U.head[--oe],U.head[oe]=se<=V?V-se:0,--ne;);for(oe=ne=se;V=U.prev[--oe],U.prev[oe]=se<=V?V-se:0,--ne;);X+=se}if(U.strm.avail_in===0)break;if(he=U.strm,xe=U.window,G=U.strstart+U.lookahead,W=X,J=void 0,J=he.avail_in,W=k)for(Z=U.strstart-U.insert,U.ins_h=U.window[Z],U.ins_h=(U.ins_h<=k&&(U.ins_h=(U.ins_h<=k)if(V=a._tr_tally(U,U.strstart-U.match_start,U.match_length-k),U.lookahead-=U.match_length,U.match_length<=U.max_lazy_match&&U.lookahead>=k){for(U.match_length--;U.strstart++,U.ins_h=(U.ins_h<=k&&(U.ins_h=(U.ins_h<=k&&U.match_length<=U.prev_length){for(X=U.strstart+U.lookahead-k,V=a._tr_tally(U,U.strstart-1-U.prev_match,U.prev_length-k),U.lookahead-=U.prev_length-1,U.prev_length-=2;++U.strstart<=X&&(U.ins_h=(U.ins_h<U.pending_buf_size-5&&(ne=U.pending_buf_size-5);;){if(U.lookahead<=1){if(Y(U),U.lookahead===0&&oe===f)return T;if(U.lookahead===0)break}U.strstart+=U.lookahead,U.lookahead=0;var V=U.block_start+ne;if((U.strstart===0||U.strstart>=V)&&(U.lookahead=U.strstart-V,U.strstart=V,N(U,!1),U.strm.avail_out===0)||U.strstart-U.block_start>=U.w_size-M&&(N(U,!1),U.strm.avail_out===0))return T}return U.insert=0,oe===d?(N(U,!0),U.strm.avail_out===0?I:B):(U.strstart>U.block_start&&(N(U,!1),U.strm.avail_out),T)}),new ee(4,4,8,4,le),new ee(4,5,16,8,le),new ee(4,6,32,32,le),new ee(4,4,16,16,K),new ee(8,16,32,32,K),new ee(8,16,128,128,K),new ee(8,32,128,256,K),new ee(32,128,258,1024,K),new ee(32,258,258,4096,K)],i.deflateInit=function(U,oe){return ae(U,oe,y,15,8,0)},i.deflateInit2=ae,i.deflateReset=te,i.deflateResetKeep=me,i.deflateSetHeader=function(U,oe){return U&&U.state?U.state.wrap!==2?p:(U.state.gzhead=oe,h):p},i.deflate=function(U,oe){var ne,V,X,Z;if(!U||!U.state||5>8&255),F(V,V.gzhead.time>>16&255),F(V,V.gzhead.time>>24&255),F(V,V.level===9?2:2<=V.strategy||V.level<2?4:0),F(V,255&V.gzhead.os),V.gzhead.extra&&V.gzhead.extra.length&&(F(V,255&V.gzhead.extra.length),F(V,V.gzhead.extra.length>>8&255)),V.gzhead.hcrc&&(U.adler=c(U.adler,V.pending_buf,V.pending,0)),V.gzindex=0,V.status=69):(F(V,0),F(V,0),F(V,0),F(V,0),F(V,0),F(V,V.level===9?2:2<=V.strategy||V.level<2?4:0),F(V,3),V.status=P);else{var he=y+(V.w_bits-8<<4)<<8;he|=(2<=V.strategy||V.level<2?0:V.level<6?1:V.level===6?2:3)<<6,V.strstart!==0&&(he|=32),he+=31-he%31,V.status=P,H(V,he),V.strstart!==0&&(H(V,U.adler>>>16),H(V,65535&U.adler)),U.adler=1}if(V.status===69)if(V.gzhead.extra){for(X=V.pending;V.gzindex<(65535&V.gzhead.extra.length)&&(V.pending!==V.pending_buf_size||(V.gzhead.hcrc&&V.pending>X&&(U.adler=c(U.adler,V.pending_buf,V.pending-X,X)),j(U),X=V.pending,V.pending!==V.pending_buf_size));)F(V,255&V.gzhead.extra[V.gzindex]),V.gzindex++;V.gzhead.hcrc&&V.pending>X&&(U.adler=c(U.adler,V.pending_buf,V.pending-X,X)),V.gzindex===V.gzhead.extra.length&&(V.gzindex=0,V.status=73)}else V.status=73;if(V.status===73)if(V.gzhead.name){X=V.pending;do{if(V.pending===V.pending_buf_size&&(V.gzhead.hcrc&&V.pending>X&&(U.adler=c(U.adler,V.pending_buf,V.pending-X,X)),j(U),X=V.pending,V.pending===V.pending_buf_size)){Z=1;break}Z=V.gzindexX&&(U.adler=c(U.adler,V.pending_buf,V.pending-X,X)),Z===0&&(V.gzindex=0,V.status=91)}else V.status=91;if(V.status===91)if(V.gzhead.comment){X=V.pending;do{if(V.pending===V.pending_buf_size&&(V.gzhead.hcrc&&V.pending>X&&(U.adler=c(U.adler,V.pending_buf,V.pending-X,X)),j(U),X=V.pending,V.pending===V.pending_buf_size)){Z=1;break}Z=V.gzindexX&&(U.adler=c(U.adler,V.pending_buf,V.pending-X,X)),Z===0&&(V.status=103)}else V.status=103;if(V.status===103&&(V.gzhead.hcrc?(V.pending+2>V.pending_buf_size&&j(U),V.pending+2<=V.pending_buf_size&&(F(V,255&U.adler),F(V,U.adler>>8&255),U.adler=0,V.status=P)):V.status=P),V.pending!==0){if(j(U),U.avail_out===0)return V.last_flush=-1,h}else if(U.avail_in===0&&z(oe)<=z(ne)&&oe!==d)return $(U,-5);if(V.status===666&&U.avail_in!==0)return $(U,-5);if(U.avail_in!==0||V.lookahead!==0||oe!==f&&V.status!==666){var xe=V.strategy===2?function(G,W){for(var J;;){if(G.lookahead===0&&(Y(G),G.lookahead===0)){if(W===f)return T;break}if(G.match_length=0,J=a._tr_tally(G,0,G.window[G.strstart]),G.lookahead--,G.strstart++,J&&(N(G,!1),G.strm.avail_out===0))return T}return G.insert=0,W===d?(N(G,!0),G.strm.avail_out===0?I:B):G.last_lit&&(N(G,!1),G.strm.avail_out===0)?T:R}(V,oe):V.strategy===3?function(G,W){for(var J,se,ye,ie,fe=G.window;;){if(G.lookahead<=E){if(Y(G),G.lookahead<=E&&W===f)return T;if(G.lookahead===0)break}if(G.match_length=0,G.lookahead>=k&&0G.lookahead&&(G.match_length=G.lookahead)}if(G.match_length>=k?(J=a._tr_tally(G,1,G.match_length-k),G.lookahead-=G.match_length,G.strstart+=G.match_length,G.match_length=0):(J=a._tr_tally(G,0,G.window[G.strstart]),G.lookahead--,G.strstart++),J&&(N(G,!1),G.strm.avail_out===0))return T}return G.insert=0,W===d?(N(G,!0),G.strm.avail_out===0?I:B):G.last_lit&&(N(G,!1),G.strm.avail_out===0)?T:R}(V,oe):o[V.level].func(V,oe);if(xe!==I&&xe!==B||(V.status=666),xe===T||xe===I)return U.avail_out===0&&(V.last_flush=-1),h;if(xe===R&&(oe===1?a._tr_align(V):oe!==5&&(a._tr_stored_block(V,0,0,!1),oe===3&&(L(V.head),V.lookahead===0&&(V.strstart=0,V.block_start=0,V.insert=0))),j(U),U.avail_out===0))return V.last_flush=-1,h}return oe!==d?h:V.wrap<=0?1:(V.wrap===2?(F(V,255&U.adler),F(V,U.adler>>8&255),F(V,U.adler>>16&255),F(V,U.adler>>24&255),F(V,255&U.total_in),F(V,U.total_in>>8&255),F(V,U.total_in>>16&255),F(V,U.total_in>>24&255)):(H(V,U.adler>>>16),H(V,65535&U.adler)),j(U),0=ne.w_size&&(Z===0&&(L(ne.head),ne.strstart=0,ne.block_start=0,ne.insert=0),W=new s.Buf8(ne.w_size),s.arraySet(W,oe,J-ne.w_size,ne.w_size,0),oe=W,J=ne.w_size),he=U.avail_in,xe=U.next_in,G=U.input,U.avail_in=J,U.next_in=0,U.input=oe,Y(ne);ne.lookahead>=k;){for(V=ne.strstart,X=ne.lookahead-(k-1);ne.ins_h=(ne.ins_h<>>=k=O>>>24,x-=k,(k=O>>>16&255)===0)R[u++]=65535&O;else{if(!(16&k)){if(!(64&k)){O=b[(65535&O)+(y&(1<>>=k,x-=k),x<15&&(y+=T[l++]<>>=k=O>>>24,x-=k,!(16&(k=O>>>16&255))){if(!(64&k)){O=w[(65535&O)+(y&(1<>>=k,x-=k,(k=u-f)>3,y&=(1<<(x-=E<<3))-1,o.next_in=l,o.next_out=u,o.avail_in=l>>24&255)+(A>>>8&65280)+((65280&A)<<8)+((255&A)<<24)}function y(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new o.Buf16(320),this.work=new o.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function x(A){var P;return A&&A.state?(P=A.state,A.total_in=A.total_out=P.total=0,A.msg="",P.wrap&&(A.adler=1&P.wrap),P.mode=p,P.last=0,P.havedict=0,P.dmax=32768,P.head=null,P.hold=0,P.bits=0,P.lencode=P.lendyn=new o.Buf32(g),P.distcode=P.distdyn=new o.Buf32(m),P.sane=1,P.back=-1,d):h}function b(A){var P;return A&&A.state?((P=A.state).wsize=0,P.whave=0,P.wnext=0,x(A)):h}function w(A,P){var T,R;return A&&A.state?(R=A.state,P<0?(T=0,P=-P):(T=1+(P>>4),P<48&&(P&=15)),P&&(P<8||15=B.wsize?(o.arraySet(B.window,P,T-B.wsize,B.wsize,0),B.wnext=0,B.whave=B.wsize):(R<(I=B.wsize-B.wnext)&&(I=R),o.arraySet(B.window,P,T-R,I,B.wnext),(R-=I)?(o.arraySet(B.window,P,T-R,R,0),B.wnext=R,B.whave=B.wsize):(B.wnext+=I,B.wnext===B.wsize&&(B.wnext=0),B.whave>>8&255,T.check=a(T.check,Z,2,0),N=j=0,T.mode=2;break}if(T.flags=0,T.head&&(T.head.done=!1),!(1&T.wrap)||(((255&j)<<8)+(j>>8))%31){A.msg="incorrect header check",T.mode=30;break}if((15&j)!=8){A.msg="unknown compression method",T.mode=30;break}if(N-=4,U=8+(15&(j>>>=4)),T.wbits===0)T.wbits=U;else if(U>T.wbits){A.msg="invalid window size",T.mode=30;break}T.dmax=1<>8&1),512&T.flags&&(Z[0]=255&j,Z[1]=j>>>8&255,T.check=a(T.check,Z,2,0)),N=j=0,T.mode=3;case 3:for(;N<32;){if(z===0)break e;z--,j+=R[B++]<>>8&255,Z[2]=j>>>16&255,Z[3]=j>>>24&255,T.check=a(T.check,Z,4,0)),N=j=0,T.mode=4;case 4:for(;N<16;){if(z===0)break e;z--,j+=R[B++]<>8),512&T.flags&&(Z[0]=255&j,Z[1]=j>>>8&255,T.check=a(T.check,Z,2,0)),N=j=0,T.mode=5;case 5:if(1024&T.flags){for(;N<16;){if(z===0)break e;z--,j+=R[B++]<>>8&255,T.check=a(T.check,Z,2,0)),N=j=0}else T.head&&(T.head.extra=null);T.mode=6;case 6:if(1024&T.flags&&(z<(q=T.length)&&(q=z),q&&(T.head&&(U=T.head.extra_len-T.length,T.head.extra||(T.head.extra=new Array(T.head.extra_len)),o.arraySet(T.head.extra,R,B,q,U)),512&T.flags&&(T.check=a(T.check,R,q,B)),z-=q,B+=q,T.length-=q),T.length))break e;T.length=0,T.mode=7;case 7:if(2048&T.flags){if(z===0)break e;for(q=0;U=R[B+q++],T.head&&U&&T.length<65536&&(T.head.name+=String.fromCharCode(U)),U&&q>9&1,T.head.done=!0),A.adler=T.check=0,T.mode=12;break;case 10:for(;N<32;){if(z===0)break e;z--,j+=R[B++]<>>=7&N,N-=7&N,T.mode=27;break}for(;N<3;){if(z===0)break e;z--,j+=R[B++]<>>=1)){case 0:T.mode=14;break;case 1:if(E(T),T.mode=20,P!==6)break;j>>>=2,N-=2;break e;case 2:T.mode=17;break;case 3:A.msg="invalid block type",T.mode=30}j>>>=2,N-=2;break;case 14:for(j>>>=7&N,N-=7&N;N<32;){if(z===0)break e;z--,j+=R[B++]<>>16^65535)){A.msg="invalid stored block lengths",T.mode=30;break}if(T.length=65535&j,N=j=0,T.mode=15,P===6)break e;case 15:T.mode=16;case 16:if(q=T.length){if(z>>=5,N-=5,T.ndist=1+(31&j),j>>>=5,N-=5,T.ncode=4+(15&j),j>>>=4,N-=4,286>>=3,N-=3}for(;T.have<19;)T.lens[he[T.have++]]=0;if(T.lencode=T.lendyn,T.lenbits=7,ne={bits:T.lenbits},oe=c(0,T.lens,0,19,T.lencode,0,T.work,ne),T.lenbits=ne.bits,oe){A.msg="invalid code lengths set",T.mode=30;break}T.have=0,T.mode=19;case 19:for(;T.have>>16&255,re=65535&X,!((K=X>>>24)<=N);){if(z===0)break e;z--,j+=R[B++]<>>=K,N-=K,T.lens[T.have++]=re;else{if(re===16){for(V=K+2;N>>=K,N-=K,T.have===0){A.msg="invalid bit length repeat",T.mode=30;break}U=T.lens[T.have-1],q=3+(3&j),j>>>=2,N-=2}else if(re===17){for(V=K+3;N>>=K)),j>>>=3,N-=3}else{for(V=K+7;N>>=K)),j>>>=7,N-=7}if(T.have+q>T.nlen+T.ndist){A.msg="invalid bit length repeat",T.mode=30;break}for(;q--;)T.lens[T.have++]=U}}if(T.mode===30)break;if(T.lens[256]===0){A.msg="invalid code -- missing end-of-block",T.mode=30;break}if(T.lenbits=9,ne={bits:T.lenbits},oe=c(u,T.lens,0,T.nlen,T.lencode,0,T.work,ne),T.lenbits=ne.bits,oe){A.msg="invalid literal/lengths set",T.mode=30;break}if(T.distbits=6,T.distcode=T.distdyn,ne={bits:T.distbits},oe=c(f,T.lens,T.nlen,T.ndist,T.distcode,0,T.work,ne),T.distbits=ne.bits,oe){A.msg="invalid distances set",T.mode=30;break}if(T.mode=20,P===6)break e;case 20:T.mode=21;case 21:if(6<=z&&258<=L){A.next_out=$,A.avail_out=L,A.next_in=B,A.avail_in=z,T.hold=j,T.bits=N,l(A,H),$=A.next_out,I=A.output,L=A.avail_out,B=A.next_in,R=A.input,z=A.avail_in,j=T.hold,N=T.bits,T.mode===12&&(T.back=-1);break}for(T.back=0;ee=(X=T.lencode[j&(1<>>16&255,re=65535&X,!((K=X>>>24)<=N);){if(z===0)break e;z--,j+=R[B++]<>me)])>>>16&255,re=65535&X,!(me+(K=X>>>24)<=N);){if(z===0)break e;z--,j+=R[B++]<>>=me,N-=me,T.back+=me}if(j>>>=K,N-=K,T.back+=K,T.length=re,ee===0){T.mode=26;break}if(32&ee){T.back=-1,T.mode=12;break}if(64&ee){A.msg="invalid literal/length code",T.mode=30;break}T.extra=15&ee,T.mode=22;case 22:if(T.extra){for(V=T.extra;N>>=T.extra,N-=T.extra,T.back+=T.extra}T.was=T.length,T.mode=23;case 23:for(;ee=(X=T.distcode[j&(1<>>16&255,re=65535&X,!((K=X>>>24)<=N);){if(z===0)break e;z--,j+=R[B++]<>me)])>>>16&255,re=65535&X,!(me+(K=X>>>24)<=N);){if(z===0)break e;z--,j+=R[B++]<>>=me,N-=me,T.back+=me}if(j>>>=K,N-=K,T.back+=K,64&ee){A.msg="invalid distance code",T.mode=30;break}T.offset=re,T.extra=15&ee,T.mode=24;case 24:if(T.extra){for(V=T.extra;N>>=T.extra,N-=T.extra,T.back+=T.extra}if(T.offset>T.dmax){A.msg="invalid distance too far back",T.mode=30;break}T.mode=25;case 25:if(L===0)break e;if(q=H-L,T.offset>q){if((q=T.offset-q)>T.whave&&T.sane){A.msg="invalid distance too far back",T.mode=30;break}Y=q>T.wnext?(q-=T.wnext,T.wsize-q):T.wnext-q,q>T.length&&(q=T.length),le=T.window}else le=I,Y=$-T.offset,q=T.length;for(LS?(k=Y[le+m[P]],N[F+m[P]]):(k=96,0),y=1<>$)+(x-=y)]=O<<24|k<<16|E|0,x!==0;);for(y=1<>=1;if(y!==0?(j&=y-1,j+=y):j=0,P++,--H[A]==0){if(A===R)break;A=f[d+m[P]]}if(I>>7)]}function F(X,Z){X.pending_buf[X.pending++]=255&Z,X.pending_buf[X.pending++]=Z>>>8&255}function H(X,Z,he){X.bi_valid>v-he?(X.bi_buf|=Z<>v-X.bi_valid,X.bi_valid+=he-v):(X.bi_buf|=Z<>>=1,he<<=1,0<--Z;);return he>>>1}function le(X,Z,he){var xe,G,W=new Array(m+1),J=0;for(xe=1;xe<=m;xe++)W[xe]=J=J+he[xe-1]<<1;for(G=0;G<=Z;G++){var se=X[2*G+1];se!==0&&(X[2*G]=Y(W[se]++,se))}}function K(X){var Z;for(Z=0;Z>1;1<=he;he--)me(X,W,he);for(G=ye;he=X.heap[1],X.heap[1]=X.heap[X.heap_len--],me(X,W,1),xe=X.heap[1],X.heap[--X.heap_max]=he,X.heap[--X.heap_max]=xe,W[2*G]=W[2*he]+W[2*xe],X.depth[G]=(X.depth[he]>=X.depth[xe]?X.depth[he]:X.depth[xe])+1,W[2*he+1]=W[2*xe+1]=G,X.heap[1]=G++,me(X,W,1),2<=X.heap_len;);X.heap[--X.heap_max]=X.heap[1],function(fe,Q){var _e,we,Ie,Pe,Me,Te,Le=Q.dyn_tree,ue=Q.max_code,$e=Q.stat_desc.static_tree,Se=Q.stat_desc.has_stree,He=Q.stat_desc.extra_bits,tt=Q.stat_desc.extra_base,ut=Q.stat_desc.max_length,qt=0;for(Pe=0;Pe<=m;Pe++)fe.bl_count[Pe]=0;for(Le[2*fe.heap[fe.heap_max]+1]=0,_e=fe.heap_max+1;_e>=7;G>>=1)if(1&ie&&se.dyn_ltree[2*ye]!==0)return s;if(se.dyn_ltree[18]!==0||se.dyn_ltree[20]!==0||se.dyn_ltree[26]!==0)return a;for(ye=32;ye>>3,(W=X.static_len+3+7>>>3)<=G&&(G=W)):G=W=he+5,he+4<=G&&Z!==-1?V(X,Z,he,xe):X.strategy===4||W===G?(H(X,2+(xe?1:0),3),te(X,M,A)):(H(X,4+(xe?1:0),3),function(se,ye,ie,fe){var Q;for(H(se,ye-257,5),H(se,ie-1,5),H(se,fe-4,4),Q=0;Q>>8&255,X.pending_buf[X.d_buf+2*X.last_lit+1]=255&Z,X.pending_buf[X.l_buf+X.last_lit]=255&he,X.last_lit++,Z===0?X.dyn_ltree[2*he]++:(X.matches++,Z--,X.dyn_ltree[2*(T[he]+f+1)]++,X.dyn_dtree[2*N(Z)]++),X.last_lit===X.lit_bufsize-1},i._tr_align=function(X){H(X,2,3),q(X,x,M),function(Z){Z.bi_valid===16?(F(Z,Z.bi_buf),Z.bi_buf=0,Z.bi_valid=0):8<=Z.bi_valid&&(Z.pending_buf[Z.pending++]=255&Z.bi_buf,Z.bi_buf>>=8,Z.bi_valid-=8)}(X)}},{"../utils/common":41}],53:[function(n,r,i){r.exports=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}},{}],54:[function(n,r,i){(function(o){(function(s,a){if(!s.setImmediate){var l,c,u,f,d=1,h={},p=!1,g=s.document,m=Object.getPrototypeOf&&Object.getPrototypeOf(s);m=m&&m.setTimeout?m:s,l={}.toString.call(s.process)==="[object process]"?function(b){process.nextTick(function(){y(b)})}:function(){if(s.postMessage&&!s.importScripts){var b=!0,w=s.onmessage;return s.onmessage=function(){b=!1},s.postMessage("","*"),s.onmessage=w,b}}()?(f="setImmediate$"+Math.random()+"$",s.addEventListener?s.addEventListener("message",x,!1):s.attachEvent("onmessage",x),function(b){s.postMessage(f+b,"*")}):s.MessageChannel?((u=new MessageChannel).port1.onmessage=function(b){y(b.data)},function(b){u.port2.postMessage(b)}):g&&"onreadystatechange"in g.createElement("script")?(c=g.documentElement,function(b){var w=g.createElement("script");w.onreadystatechange=function(){y(b),w.onreadystatechange=null,c.removeChild(w),w=null},c.appendChild(w)}):function(b){setTimeout(y,0,b)},m.setImmediate=function(b){typeof b!="function"&&(b=new Function(""+b));for(var w=new Array(arguments.length-1),_=0;_"u"?o===void 0?this:o:self)}).call(this,typeof ei<"u"?ei:typeof self<"u"?self:typeof window<"u"?window:{})},{}]},{},[10])(10)})})(IDe);var L_t=IDe.exports;const $_t=on(L_t);var LDe={exports:{}};(function(t,e){(function(n,r){r()})(ei,function(){function n(c,u){return typeof u>"u"?u={autoBom:!1}:typeof u!="object"&&(console.warn("Deprecated: Expected third argument to be a object"),u={autoBom:!u}),u.autoBom&&/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(c.type)?new Blob(["\uFEFF",c],{type:c.type}):c}function r(c,u,f){var d=new XMLHttpRequest;d.open("GET",c),d.responseType="blob",d.onload=function(){l(d.response,u,f)},d.onerror=function(){console.error("could not download file")},d.send()}function i(c){var u=new XMLHttpRequest;u.open("HEAD",c,!1);try{u.send()}catch{}return 200<=u.status&&299>=u.status}function o(c){try{c.dispatchEvent(new MouseEvent("click"))}catch{var u=document.createEvent("MouseEvents");u.initMouseEvent("click",!0,!0,window,0,0,0,80,20,!1,!1,!1,!1,0,null),c.dispatchEvent(u)}}var s=typeof window=="object"&&window.window===window?window:typeof self=="object"&&self.self===self?self:typeof ei=="object"&&ei.global===ei?ei:void 0,a=s.navigator&&/Macintosh/.test(navigator.userAgent)&&/AppleWebKit/.test(navigator.userAgent)&&!/Safari/.test(navigator.userAgent),l=s.saveAs||(typeof window!="object"||window!==s?function(){}:"download"in HTMLAnchorElement.prototype&&!a?function(c,u,f){var d=s.URL||s.webkitURL,h=document.createElement("a");u=u||c.name||"download",h.download=u,h.rel="noopener",typeof c=="string"?(h.href=c,h.origin===location.origin?o(h):i(h.href)?r(c,u,f):o(h,h.target="_blank")):(h.href=d.createObjectURL(c),setTimeout(function(){d.revokeObjectURL(h.href)},4e4),setTimeout(function(){o(h)},0))}:"msSaveOrOpenBlob"in navigator?function(c,u,f){if(u=u||c.name||"download",typeof c!="string")navigator.msSaveOrOpenBlob(n(c,f),u);else if(i(c))r(c,u,f);else{var d=document.createElement("a");d.href=c,d.target="_blank",setTimeout(function(){o(d)})}}:function(c,u,f,d){if(d=d||open("","_blank"),d&&(d.document.title=d.document.body.innerText="downloading..."),typeof c=="string")return r(c,u,f);var h=c.type==="application/octet-stream",p=/constructor/i.test(s.HTMLElement)||s.safari,g=/CriOS\/[\d]+/.test(navigator.userAgent);if((g||h&&p||a)&&typeof FileReader<"u"){var m=new FileReader;m.onloadend=function(){var x=m.result;x=g?x:x.replace(/^data:[^;]*;/,"data:attachment/file;"),d?d.location.href=x:location=x,d=null},m.readAsDataURL(c)}else{var v=s.URL||s.webkitURL,y=v.createObjectURL(c);d?d.location=y:location.href=y,d=null,setTimeout(function(){v.revokeObjectURL(y)},4e4)}});s.saveAs=l.saveAs=l,t.exports=l})})(LDe);var $De=LDe.exports;const npe=t=>{let e;const n=new Set,r=(c,u)=>{const f=typeof c=="function"?c(e):c;if(!Object.is(f,e)){const d=e;e=u??(typeof f!="object"||f===null)?f:Object.assign({},e,f),n.forEach(h=>h(e,d))}},i=()=>e,a={setState:r,getState:i,getInitialState:()=>l,subscribe:c=>(n.add(c),()=>n.delete(c))},l=e=t(r,i,a);return a},F_t=t=>t?npe(t):npe,N_t=t=>t;function z_t(t,e=N_t){const n=de.useSyncExternalStore(t.subscribe,()=>e(t.getState()),()=>e(t.getInitialState()));return de.useDebugValue(n),n}const rpe=t=>{const e=F_t(t),n=r=>z_t(e,r);return Object.assign(n,e),n},j_t=t=>t?rpe(t):rpe,B_t={Date:!0,RegExp:!0,String:!0,Number:!0};function FDe(t,e,n={cyclesFix:!0},r=[]){var a,l;let i=[];const o=Array.isArray(t);for(const c in t){const u=t[c],f=o?+c:c;if(!(c in e)){i.push({type:"REMOVE",path:[f],oldValue:t[c]});continue}const d=e[c],h=typeof u=="object"&&typeof d=="object"&&Array.isArray(u)===Array.isArray(d);if(u&&d&&h&&!B_t[(l=(a=Object.getPrototypeOf(u))==null?void 0:a.constructor)==null?void 0:l.name]&&(!n.cyclesFix||!r.includes(u))){const p=FDe(u,d,n,n.cyclesFix?r.concat([u]):[]);i.push.apply(i,p.map(g=>(g.path.unshift(f),g)))}else u!==d&&!(Number.isNaN(u)&&Number.isNaN(d))&&!(h&&(isNaN(u)?u+""==d+"":+u==+d))&&i.push({path:[f],type:"CHANGE",value:d,oldValue:u})}const s=Array.isArray(e);for(const c in e)c in t||i.push({type:"CREATE",path:[s?+c:c],value:e[c]});return i}const ipe={};function Dq(t,e){t===void 0&&(t=ipe),e===void 0&&(e=ipe);const n=Object.keys(t),r=Object.keys(e);return t===e||n.length===r.length&&n.every(i=>t[i]===e[i])}/*! - * https://github.com/Starcounter-Jack/JSON-Patch - * (c) 2017-2022 Joachim Wester - * MIT licensed - */var U_t=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)i.hasOwnProperty(o)&&(r[o]=i[o])},t(e,n)};return function(e,n){t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),W_t=Object.prototype.hasOwnProperty;function Iq(t,e){return W_t.call(t,e)}function Lq(t){if(Array.isArray(t)){for(var e=new Array(t.length),n=0;n=48&&r<=57){e++;continue}return!1}return!0}function j0(t){return t.indexOf("/")===-1&&t.indexOf("~")===-1?t:t.replace(/~/g,"~0").replace(/\//g,"~1")}function NDe(t){return t.replace(/~1/g,"/").replace(/~0/g,"~")}function Fq(t){if(t===void 0)return!0;if(t){if(Array.isArray(t)){for(var e=0,n=t.length;e0&&l[u-1]=="constructor"))throw new TypeError("JSON-Patch: modifying `__proto__` or `constructor/prototype` prop is banned for security reasons, if this was on purpose, please set `banPrototypeModifications` flag false and pass it to this function. More info in fast-json-patch README");if(n&&d===void 0&&(c[h]===void 0?d=l.slice(0,u).join("/"):u==f-1&&(d=e.path),d!==void 0&&p(e,0,t,d)),u++,Array.isArray(c)){if(h==="-")h=c.length;else{if(n&&!$q(h))throw new Di("Expected an unsigned base-10 integer value, making the new referenced value the array element with the zero-based index","OPERATION_PATH_ILLEGAL_ARRAY_INDEX",o,e,t);$q(h)&&(h=~~h)}if(u>=f){if(n&&e.op==="add"&&h>c.length)throw new Di("The specified index MUST NOT be greater than the number of elements in the array","OPERATION_VALUE_OUT_OF_BOUNDS",o,e,t);var s=G_t[e.op].call(e,c,h,t);if(s.test===!1)throw new Di("Test operation failed","TEST_OPERATION_FAILED",o,e,t);return s}}else if(u>=f){var s=o_[e.op].call(e,c,h,t);if(s.test===!1)throw new Di("Test operation failed","TEST_OPERATION_FAILED",o,e,t);return s}if(c=c[h],n&&u0)throw new Di('Operation `path` property must start with "/"',"OPERATION_PATH_INVALID",e,t,n);if((t.op==="move"||t.op==="copy")&&typeof t.from!="string")throw new Di("Operation `from` property is not present (applicable in `move` and `copy` operations)","OPERATION_FROM_REQUIRED",e,t,n);if((t.op==="add"||t.op==="replace"||t.op==="test")&&t.value===void 0)throw new Di("Operation `value` property is not present (applicable in `add`, `replace` and `test` operations)","OPERATION_VALUE_REQUIRED",e,t,n);if((t.op==="add"||t.op==="replace"||t.op==="test")&&Fq(t.value))throw new Di("Operation `value` property is not present (applicable in `add`, `replace` and `test` operations)","OPERATION_VALUE_CANNOT_CONTAIN_UNDEFINED",e,t,n);if(n){if(t.op=="add"){var i=t.path.split("/").length,o=r.split("/").length;if(i!==o+1&&i!==o)throw new Di("Cannot perform an `add` operation at the desired path","OPERATION_PATH_CANNOT_ADD",e,t,n)}else if(t.op==="replace"||t.op==="remove"||t.op==="_get"){if(t.path!==r)throw new Di("Cannot perform the operation at a path that does not exist","OPERATION_PATH_UNRESOLVABLE",e,t,n)}else if(t.op==="move"||t.op==="copy"){var s={op:"_get",path:t.from,value:void 0},a=jDe([s],n);if(a&&a.name==="OPERATION_PATH_UNRESOLVABLE")throw new Di("Cannot perform the operation from a path that does not exist","OPERATION_FROM_UNRESOLVABLE",e,t,n)}}}else throw new Di("Operation `op` property is not one of operations defined in RFC-6902","OPERATION_OP_INVALID",e,t,n)}function jDe(t,e,n){try{if(!Array.isArray(t))throw new Di("Patch sequence must be an array","SEQUENCE_NOT_AN_ARRAY");if(e)G4(ac(e),ac(t),n||!0);else{n=n||pN;for(var r=0;r0&&(t.patches=[],t.callback&&t.callback(r)),r}function Hte(t,e,n,r,i){if(e!==t){typeof e.toJSON=="function"&&(e=e.toJSON());for(var o=Lq(e),s=Lq(t),a=!1,l=s.length-1;l>=0;l--){var c=s[l],u=t[c];if(Iq(e,c)&&!(e[c]===void 0&&u!==void 0&&Array.isArray(e)===!1)){var f=e[c];typeof u=="object"&&u!=null&&typeof f=="object"&&f!=null&&Array.isArray(u)===Array.isArray(f)?Hte(u,f,n,r+"/"+j0(c),i):u!==f&&(i&&n.push({op:"test",path:r+"/"+j0(c),value:ac(u)}),n.push({op:"replace",path:r+"/"+j0(c),value:ac(f)}))}else Array.isArray(t)===Array.isArray(e)?(i&&n.push({op:"test",path:r+"/"+j0(c),value:ac(u)}),n.push({op:"remove",path:r+"/"+j0(c)}),a=!0):(i&&n.push({op:"test",path:r,value:t}),n.push({op:"replace",path:r,value:e}))}if(!(!a&&o.length==s.length))for(var l=0;l0)return[x,r+d.join(`, -`+v),u].join(` -`+l)}return b}(e,"",0)};const RW=on(iSt);function Pl(t,e,n){return t.fields=e||[],t.fname=n,t}function Ni(t){return t==null?null:t.fname}function Ks(t){return t==null?null:t.fields}function BDe(t){return t.length===1?oSt(t[0]):sSt(t)}const oSt=t=>function(e){return e[t]},sSt=t=>{const e=t.length;return function(n){for(let r=0;rs?c():s=a+1:l==="["?(a>s&&c(),i=s=a+1):l==="]"&&(i||je("Access path missing open bracket: "+t),i>0&&c(),i=0,s=a+1)}return i&&je("Access path missing closing bracket: "+t),r&&je("Access path missing closing quote: "+t),a>s&&(a++,c()),e}function Eu(t,e,n){const r=Bh(t);return t=r.length===1?r[0]:t,Pl((n&&n.get||BDe)(r),[t],e||t)}const tR=Eu("id"),na=Pl(t=>t,[],"identity"),rv=Pl(()=>0,[],"zero"),gO=Pl(()=>1,[],"one"),Tu=Pl(()=>!0,[],"true"),Rm=Pl(()=>!1,[],"false");function aSt(t,e,n){const r=[e].concat([].slice.call(n));console[t].apply(console,r)}const UDe=0,qte=1,Xte=2,WDe=3,VDe=4;function Yte(t,e){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:aSt,r=t||UDe;return{level(i){return arguments.length?(r=+i,this):r},error(){return r>=qte&&n(e||"error","ERROR",arguments),this},warn(){return r>=Xte&&n(e||"warn","WARN",arguments),this},info(){return r>=WDe&&n(e||"log","INFO",arguments),this},debug(){return r>=VDe&&n(e||"log","DEBUG",arguments),this}}}var We=Array.isArray;function ht(t){return t===Object(t)}const spe=t=>t!=="__proto__";function mO(){for(var t=arguments.length,e=new Array(t),n=0;n{for(const o in i)if(o==="signals")r.signals=lSt(r.signals,i.signals);else{const s=o==="legend"?{layout:1}:o==="style"?!0:null;vO(r,o,i[o],s)}return r},{})}function vO(t,e,n,r){if(!spe(e))return;let i,o;if(ht(n)&&!We(n)){o=ht(t[e])?t[e]:t[e]={};for(i in n)r&&(r===!0||r[i])?vO(o,i,n[i]):spe(i)&&(o[i]=n[i])}else t[e]=n}function lSt(t,e){if(t==null)return e;const n={},r=[];function i(o){n[o.name]||(n[o.name]=1,r.push(o))}return e.forEach(i),t.forEach(i),r}function $n(t){return t[t.length-1]}function Ys(t){return t==null||t===""?null:+t}const GDe=t=>e=>t*Math.exp(e),HDe=t=>e=>Math.log(t*e),qDe=t=>e=>Math.sign(e)*Math.log1p(Math.abs(e/t)),XDe=t=>e=>Math.sign(e)*Math.expm1(Math.abs(e))*t,gN=t=>e=>e<0?-Math.pow(-e,t):Math.pow(e,t);function H4(t,e,n,r){const i=n(t[0]),o=n($n(t)),s=(o-i)*e;return[r(i-s),r(o-s)]}function YDe(t,e){return H4(t,e,Ys,na)}function QDe(t,e){var n=Math.sign(t[0]);return H4(t,e,HDe(n),GDe(n))}function KDe(t,e,n){return H4(t,e,gN(n),gN(1/n))}function ZDe(t,e,n){return H4(t,e,qDe(n),XDe(n))}function q4(t,e,n,r,i){const o=r(t[0]),s=r($n(t)),a=e!=null?r(e):(o+s)/2;return[i(a+(o-a)*n),i(a+(s-a)*n)]}function Qte(t,e,n){return q4(t,e,n,Ys,na)}function Kte(t,e,n){const r=Math.sign(t[0]);return q4(t,e,n,HDe(r),GDe(r))}function mN(t,e,n,r){return q4(t,e,n,gN(r),gN(1/r))}function Zte(t,e,n,r){return q4(t,e,n,qDe(r),XDe(r))}function JDe(t){return 1+~~(new Date(t).getMonth()/3)}function eIe(t){return 1+~~(new Date(t).getUTCMonth()/3)}function pt(t){return t!=null?We(t)?t:[t]:[]}function tIe(t,e,n){let r=t[0],i=t[1],o;return i=n-e?[e,n]:[r=Math.min(Math.max(r,e),n-o),r+o]}function fn(t){return typeof t=="function"}const cSt="descending";function Jte(t,e,n){n=n||{},e=pt(e)||[];const r=[],i=[],o={},s=n.comparator||uSt;return pt(t).forEach((a,l)=>{a!=null&&(r.push(e[l]===cSt?-1:1),i.push(a=fn(a)?a:Eu(a,null,n)),(Ks(a)||[]).forEach(c=>o[c]=1))}),i.length===0?null:Pl(s(i,r),Object.keys(o))}const X4=(t,e)=>(te||e==null)&&t!=null?1:(e=e instanceof Date?+e:e,(t=t instanceof Date?+t:t)!==t&&e===e?-1:e!==e&&t===t?1:0),uSt=(t,e)=>t.length===1?fSt(t[0],e[0]):dSt(t,e,t.length),fSt=(t,e)=>function(n,r){return X4(t(n),t(r))*e},dSt=(t,e,n)=>(e.push(0),function(r,i){let o,s=0,a=-1;for(;s===0&&++at}function ene(t,e){let n;return r=>{n&&clearTimeout(n),n=setTimeout(()=>(e(r),n=null),t)}}function cn(t){for(let e,n,r=1,i=arguments.length;rs&&(s=i))}else{for(i=e(t[n]);ns&&(s=i))}return[o,s]}function nIe(t,e){const n=t.length;let r=-1,i,o,s,a,l;if(e==null){for(;++r=o){i=s=o;break}if(r===n)return[-1,-1];for(a=l=r;++ro&&(i=o,a=r),s=o){i=s=o;break}if(r===n)return[-1,-1];for(a=l=r;++ro&&(i=o,a=r),s{i.set(o,t[o])}),i}function rIe(t,e,n,r,i,o){if(!n&&n!==0)return o;const s=+n;let a=t[0],l=$n(t),c;lo&&(s=i,i=o,o=s),n=n===void 0||n,r=r===void 0||r,(n?i<=t:ia.replace(/\\(.)/g,"$1")):pt(t));const r=t&&t.length,i=n&&n.get||BDe,o=a=>i(e?[a]:Bh(a));let s;if(!r)s=function(){return""};else if(r===1){const a=o(t[0]);s=function(l){return""+a(l)}}else{const a=t.map(o);s=function(l){let c=""+a[0](l),u=0;for(;++u{e={},n={},r=0},o=(s,a)=>(++r>t&&(n=e,e={},r=1),e[s]=a);return i(),{clear:i,has:s=>vt(e,s)||vt(n,s),get:s=>vt(e,s)?e[s]:vt(n,s)?o(s,n[s]):void 0,set:(s,a)=>vt(e,s)?e[s]=a:o(s,a)}}function lIe(t,e,n,r){const i=e.length,o=n.length;if(!o)return e;if(!i)return n;const s=r||new e.constructor(i+o);let a=0,l=0,c=0;for(;a0?n[l++]:e[a++];for(;a=0;)n+=t;return n}function cIe(t,e,n,r){const i=n||" ",o=t+"",s=e-o.length;return s<=0?o:r==="left"?eT(i,s)+o:r==="center"?eT(i,~~(s/2))+o+eT(i,Math.ceil(s/2)):o+eT(i,s)}function nR(t){return t&&$n(t)-t[0]||0}function rt(t){return We(t)?"["+t.map(rt)+"]":ht(t)||gt(t)?JSON.stringify(t).replace("\u2028","\\u2028").replace("\u2029","\\u2029"):t}function nne(t){return t==null||t===""?null:!t||t==="false"||t==="0"?!1:!!t}const gSt=t=>Jn(t)||Nv(t)?t:Date.parse(t);function rne(t,e){return e=e||gSt,t==null||t===""?null:e(t)}function ine(t){return t==null||t===""?null:t+""}function Wf(t){const e={},n=t.length;for(let r=0;r9999?"+"+Ga(t,6):Ga(t,4)}function ySt(t){var e=t.getUTCHours(),n=t.getUTCMinutes(),r=t.getUTCSeconds(),i=t.getUTCMilliseconds();return isNaN(t)?"Invalid Date":vSt(t.getUTCFullYear())+"-"+Ga(t.getUTCMonth()+1,2)+"-"+Ga(t.getUTCDate(),2)+(i?"T"+Ga(e,2)+":"+Ga(n,2)+":"+Ga(r,2)+"."+Ga(i,3)+"Z":r?"T"+Ga(e,2)+":"+Ga(n,2)+":"+Ga(r,2)+"Z":n||e?"T"+Ga(e,2)+":"+Ga(n,2)+"Z":"")}function xSt(t){var e=new RegExp('["'+t+` -\r]`),n=t.charCodeAt(0);function r(f,d){var h,p,g=i(f,function(m,v){if(h)return h(m,v-1);p=m,h=d?mSt(m,d):fIe(m)});return g.columns=p||[],g}function i(f,d){var h=[],p=f.length,g=0,m=0,v,y=p<=0,x=!1;f.charCodeAt(p-1)===UE&&--p,f.charCodeAt(p-1)===LW&&--p;function b(){if(y)return DW;if(x)return x=!1,ape;var _,S=g,O;if(f.charCodeAt(S)===IW){for(;g++=p?y=!0:(O=f.charCodeAt(g++))===UE?x=!0:O===LW&&(x=!0,f.charCodeAt(g)===UE&&++g),f.slice(S+1,_-1).replace(/""/g,'"')}for(;g>2,h=(3&c)<<4|u>>4,p=1>6:64,g=2>4,u=(15&d)<<4|(h=a.indexOf(l.charAt(g++)))>>2,f=(3&h)<<6|(p=a.indexOf(l.charAt(g++))),y[m++]=c,h!==64&&(y[m++]=u),p!==64&&(y[m++]=f);return y}},{"./support":30,"./utils":32}],2:[function(n,r,i){var o=n("./external"),s=n("./stream/DataWorker"),a=n("./stream/Crc32Probe"),l=n("./stream/DataLengthProbe");function c(u,f,d,h,p){this.compressedSize=u,this.uncompressedSize=f,this.crc32=d,this.compression=h,this.compressedContent=p}c.prototype={getContentWorker:function(){var u=new s(o.Promise.resolve(this.compressedContent)).pipe(this.compression.uncompressWorker()).pipe(new l("data_length")),f=this;return u.on("end",function(){if(this.streamInfo.data_length!==f.uncompressedSize)throw new Error("Bug : uncompressed data size mismatch")}),u},getCompressedWorker:function(){return new s(o.Promise.resolve(this.compressedContent)).withStreamInfo("compressedSize",this.compressedSize).withStreamInfo("uncompressedSize",this.uncompressedSize).withStreamInfo("crc32",this.crc32).withStreamInfo("compression",this.compression)}},c.createWorkerFrom=function(u,f,d){return u.pipe(new a).pipe(new l("uncompressedSize")).pipe(f.compressWorker(d)).pipe(new l("compressedSize")).withStreamInfo("compression",f)},r.exports=c},{"./external":6,"./stream/Crc32Probe":25,"./stream/DataLengthProbe":26,"./stream/DataWorker":27}],3:[function(n,r,i){var o=n("./stream/GenericWorker");i.STORE={magic:"\0\0",compressWorker:function(){return new o("STORE compression")},uncompressWorker:function(){return new o("STORE decompression")}},i.DEFLATE=n("./flate")},{"./flate":7,"./stream/GenericWorker":28}],4:[function(n,r,i){var o=n("./utils"),s=function(){for(var a,l=[],c=0;c<256;c++){a=c;for(var u=0;u<8;u++)a=1&a?3988292384^a>>>1:a>>>1;l[c]=a}return l}();r.exports=function(a,l){return a!==void 0&&a.length?o.getTypeOf(a)!=="string"?function(c,u,f,d){var h=s,p=d+f;c^=-1;for(var g=d;g>>8^h[255&(c^u[g])];return-1^c}(0|l,a,a.length,0):function(c,u,f,d){var h=s,p=d+f;c^=-1;for(var g=d;g>>8^h[255&(c^u.charCodeAt(g))];return-1^c}(0|l,a,a.length,0):0}},{"./utils":32}],5:[function(n,r,i){i.base64=!1,i.binary=!1,i.dir=!1,i.createFolders=!0,i.date=null,i.compression=null,i.compressionOptions=null,i.comment=null,i.unixPermissions=null,i.dosPermissions=null},{}],6:[function(n,r,i){var o=null;o=typeof Promise<"u"?Promise:n("lie"),r.exports={Promise:o}},{lie:37}],7:[function(n,r,i){var o=typeof Uint8Array<"u"&&typeof Uint16Array<"u"&&typeof Uint32Array<"u",s=n("pako"),a=n("./utils"),l=n("./stream/GenericWorker"),c=o?"uint8array":"array";function u(f,d){l.call(this,"FlateWorker/"+f),this._pako=null,this._pakoAction=f,this._pakoOptions=d,this.meta={}}i.magic="\b\0",a.inherits(u,l),u.prototype.processChunk=function(f){this.meta=f.meta,this._pako===null&&this._createPako(),this._pako.push(a.transformTo(c,f.data),!1)},u.prototype.flush=function(){l.prototype.flush.call(this),this._pako===null&&this._createPako(),this._pako.push([],!0)},u.prototype.cleanUp=function(){l.prototype.cleanUp.call(this),this._pako=null},u.prototype._createPako=function(){this._pako=new s[this._pakoAction]({raw:!0,level:this._pakoOptions.level||-1});var f=this;this._pako.onData=function(d){f.push({data:d,meta:f.meta})}},i.compressWorker=function(f){return new u("Deflate",f)},i.uncompressWorker=function(){return new u("Inflate",{})}},{"./stream/GenericWorker":28,"./utils":32,pako:38}],8:[function(n,r,i){function o(h,p){var g,m="";for(g=0;g>>=8;return m}function s(h,p,g,m,v,y){var x,b,w=h.file,_=h.compression,S=y!==c.utf8encode,O=a.transformTo("string",y(w.name)),k=a.transformTo("string",c.utf8encode(w.name)),E=w.comment,P=a.transformTo("string",y(E)),A=a.transformTo("string",c.utf8encode(E)),R=k.length!==w.name.length,T=A.length!==E.length,M="",I="",j="",N=w.dir,z=w.date,L={crc32:0,compressedSize:0,uncompressedSize:0};p&&!g||(L.crc32=h.crc32,L.compressedSize=h.compressedSize,L.uncompressedSize=h.uncompressedSize);var B=0;p&&(B|=8),S||!R&&!T||(B|=2048);var F=0,$=0;N&&(F|=16),v==="UNIX"?($=798,F|=function(G,Y){var le=G;return G||(le=Y?16893:33204),(65535&le)<<16}(w.unixPermissions,N)):($=20,F|=function(G){return 63&(G||0)}(w.dosPermissions)),x=z.getUTCHours(),x<<=6,x|=z.getUTCMinutes(),x<<=5,x|=z.getUTCSeconds()/2,b=z.getUTCFullYear()-1980,b<<=4,b|=z.getUTCMonth()+1,b<<=5,b|=z.getUTCDate(),R&&(I=o(1,1)+o(u(O),4)+k,M+="up"+o(I.length,2)+I),T&&(j=o(1,1)+o(u(P),4)+A,M+="uc"+o(j.length,2)+j);var q="";return q+=` +\0`,q+=o(B,2),q+=_.magic,q+=o(x,2),q+=o(b,2),q+=o(L.crc32,4),q+=o(L.compressedSize,4),q+=o(L.uncompressedSize,4),q+=o(O.length,2),q+=o(M.length,2),{fileRecord:f.LOCAL_FILE_HEADER+q+O+M,dirRecord:f.CENTRAL_FILE_HEADER+o($,2)+q+o(P.length,2)+"\0\0\0\0"+o(F,4)+o(m,4)+O+M+P}}var a=n("../utils"),l=n("../stream/GenericWorker"),c=n("../utf8"),u=n("../crc32"),f=n("../signature");function d(h,p,g,m){l.call(this,"ZipFileWorker"),this.bytesWritten=0,this.zipComment=p,this.zipPlatform=g,this.encodeFileName=m,this.streamFiles=h,this.accumulate=!1,this.contentBuffer=[],this.dirRecords=[],this.currentSourceOffset=0,this.entriesCount=0,this.currentFile=null,this._sources=[]}a.inherits(d,l),d.prototype.push=function(h){var p=h.meta.percent||0,g=this.entriesCount,m=this._sources.length;this.accumulate?this.contentBuffer.push(h):(this.bytesWritten+=h.data.length,l.prototype.push.call(this,{data:h.data,meta:{currentFile:this.currentFile,percent:g?(p+100*(g-m-1))/g:100}}))},d.prototype.openedSource=function(h){this.currentSourceOffset=this.bytesWritten,this.currentFile=h.file.name;var p=this.streamFiles&&!h.file.dir;if(p){var g=s(h,p,!1,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);this.push({data:g.fileRecord,meta:{percent:0}})}else this.accumulate=!0},d.prototype.closedSource=function(h){this.accumulate=!1;var p=this.streamFiles&&!h.file.dir,g=s(h,p,!0,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);if(this.dirRecords.push(g.dirRecord),p)this.push({data:function(m){return f.DATA_DESCRIPTOR+o(m.crc32,4)+o(m.compressedSize,4)+o(m.uncompressedSize,4)}(h),meta:{percent:100}});else for(this.push({data:g.fileRecord,meta:{percent:0}});this.contentBuffer.length;)this.push(this.contentBuffer.shift());this.currentFile=null},d.prototype.flush=function(){for(var h=this.bytesWritten,p=0;p=this.index;l--)c=(c<<8)+this.byteAt(l);return this.index+=a,c},readString:function(a){return o.transformTo("string",this.readData(a))},readData:function(){},lastIndexOfSignature:function(){},readAndCheckSignature:function(){},readDate:function(){var a=this.readInt(4);return new Date(Date.UTC(1980+(a>>25&127),(a>>21&15)-1,a>>16&31,a>>11&31,a>>5&63,(31&a)<<1))}},r.exports=s},{"../utils":32}],19:[function(n,r,i){var o=n("./Uint8ArrayReader");function s(a){o.call(this,a)}n("../utils").inherits(s,o),s.prototype.readData=function(a){this.checkOffset(a);var l=this.data.slice(this.zero+this.index,this.zero+this.index+a);return this.index+=a,l},r.exports=s},{"../utils":32,"./Uint8ArrayReader":21}],20:[function(n,r,i){var o=n("./DataReader");function s(a){o.call(this,a)}n("../utils").inherits(s,o),s.prototype.byteAt=function(a){return this.data.charCodeAt(this.zero+a)},s.prototype.lastIndexOfSignature=function(a){return this.data.lastIndexOf(a)-this.zero},s.prototype.readAndCheckSignature=function(a){return a===this.readData(4)},s.prototype.readData=function(a){this.checkOffset(a);var l=this.data.slice(this.zero+this.index,this.zero+this.index+a);return this.index+=a,l},r.exports=s},{"../utils":32,"./DataReader":18}],21:[function(n,r,i){var o=n("./ArrayReader");function s(a){o.call(this,a)}n("../utils").inherits(s,o),s.prototype.readData=function(a){if(this.checkOffset(a),a===0)return new Uint8Array(0);var l=this.data.subarray(this.zero+this.index,this.zero+this.index+a);return this.index+=a,l},r.exports=s},{"../utils":32,"./ArrayReader":17}],22:[function(n,r,i){var o=n("../utils"),s=n("../support"),a=n("./ArrayReader"),l=n("./StringReader"),c=n("./NodeBufferReader"),u=n("./Uint8ArrayReader");r.exports=function(f){var d=o.getTypeOf(f);return o.checkSupport(d),d!=="string"||s.uint8array?d==="nodebuffer"?new c(f):s.uint8array?new u(o.transformTo("uint8array",f)):new a(o.transformTo("array",f)):new l(f)}},{"../support":30,"../utils":32,"./ArrayReader":17,"./NodeBufferReader":19,"./StringReader":20,"./Uint8ArrayReader":21}],23:[function(n,r,i){i.LOCAL_FILE_HEADER="PK",i.CENTRAL_FILE_HEADER="PK",i.CENTRAL_DIRECTORY_END="PK",i.ZIP64_CENTRAL_DIRECTORY_LOCATOR="PK\x07",i.ZIP64_CENTRAL_DIRECTORY_END="PK",i.DATA_DESCRIPTOR="PK\x07\b"},{}],24:[function(n,r,i){var o=n("./GenericWorker"),s=n("../utils");function a(l){o.call(this,"ConvertWorker to "+l),this.destType=l}s.inherits(a,o),a.prototype.processChunk=function(l){this.push({data:s.transformTo(this.destType,l.data),meta:l.meta})},r.exports=a},{"../utils":32,"./GenericWorker":28}],25:[function(n,r,i){var o=n("./GenericWorker"),s=n("../crc32");function a(){o.call(this,"Crc32Probe"),this.withStreamInfo("crc32",0)}n("../utils").inherits(a,o),a.prototype.processChunk=function(l){this.streamInfo.crc32=s(l.data,this.streamInfo.crc32||0),this.push(l)},r.exports=a},{"../crc32":4,"../utils":32,"./GenericWorker":28}],26:[function(n,r,i){var o=n("../utils"),s=n("./GenericWorker");function a(l){s.call(this,"DataLengthProbe for "+l),this.propName=l,this.withStreamInfo(l,0)}o.inherits(a,s),a.prototype.processChunk=function(l){if(l){var c=this.streamInfo[this.propName]||0;this.streamInfo[this.propName]=c+l.data.length}s.prototype.processChunk.call(this,l)},r.exports=a},{"../utils":32,"./GenericWorker":28}],27:[function(n,r,i){var o=n("../utils"),s=n("./GenericWorker");function a(l){s.call(this,"DataWorker");var c=this;this.dataIsReady=!1,this.index=0,this.max=0,this.data=null,this.type="",this._tickScheduled=!1,l.then(function(u){c.dataIsReady=!0,c.data=u,c.max=u&&u.length||0,c.type=o.getTypeOf(u),c.isPaused||c._tickAndRepeat()},function(u){c.error(u)})}o.inherits(a,s),a.prototype.cleanUp=function(){s.prototype.cleanUp.call(this),this.data=null},a.prototype.resume=function(){return!!s.prototype.resume.call(this)&&(!this._tickScheduled&&this.dataIsReady&&(this._tickScheduled=!0,o.delay(this._tickAndRepeat,[],this)),!0)},a.prototype._tickAndRepeat=function(){this._tickScheduled=!1,this.isPaused||this.isFinished||(this._tick(),this.isFinished||(o.delay(this._tickAndRepeat,[],this),this._tickScheduled=!0))},a.prototype._tick=function(){if(this.isPaused||this.isFinished)return!1;var l=null,c=Math.min(this.max,this.index+16384);if(this.index>=this.max)return this.end();switch(this.type){case"string":l=this.data.substring(this.index,c);break;case"uint8array":l=this.data.subarray(this.index,c);break;case"array":case"nodebuffer":l=this.data.slice(this.index,c)}return this.index=c,this.push({data:l,meta:{percent:this.max?this.index/this.max*100:0}})},r.exports=a},{"../utils":32,"./GenericWorker":28}],28:[function(n,r,i){function o(s){this.name=s||"default",this.streamInfo={},this.generatedError=null,this.extraStreamInfo={},this.isPaused=!0,this.isFinished=!1,this.isLocked=!1,this._listeners={data:[],end:[],error:[]},this.previous=null}o.prototype={push:function(s){this.emit("data",s)},end:function(){if(this.isFinished)return!1;this.flush();try{this.emit("end"),this.cleanUp(),this.isFinished=!0}catch(s){this.emit("error",s)}return!0},error:function(s){return!this.isFinished&&(this.isPaused?this.generatedError=s:(this.isFinished=!0,this.emit("error",s),this.previous&&this.previous.error(s),this.cleanUp()),!0)},on:function(s,a){return this._listeners[s].push(a),this},cleanUp:function(){this.streamInfo=this.generatedError=this.extraStreamInfo=null,this._listeners=[]},emit:function(s,a){if(this._listeners[s])for(var l=0;l "+s:s}},r.exports=o},{}],29:[function(n,r,i){var o=n("../utils"),s=n("./ConvertWorker"),a=n("./GenericWorker"),l=n("../base64"),c=n("../support"),u=n("../external"),f=null;if(c.nodestream)try{f=n("../nodejs/NodejsStreamOutputAdapter")}catch{}function d(p,g){return new u.Promise(function(m,v){var y=[],x=p._internalType,b=p._outputType,w=p._mimeType;p.on("data",function(_,S){y.push(_),g&&g(S)}).on("error",function(_){y=[],v(_)}).on("end",function(){try{var _=function(S,O,k){switch(S){case"blob":return o.newBlob(o.transformTo("arraybuffer",O),k);case"base64":return l.encode(O);default:return o.transformTo(S,O)}}(b,function(S,O){var k,E=0,P=null,A=0;for(k=0;k"u")i.blob=!1;else{var o=new ArrayBuffer(0);try{i.blob=new Blob([o],{type:"application/zip"}).size===0}catch{try{var s=new(self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder);s.append(o),i.blob=s.getBlob("application/zip").size===0}catch{i.blob=!1}}}try{i.nodestream=!!n("readable-stream").Readable}catch{i.nodestream=!1}},{"readable-stream":16}],31:[function(n,r,i){for(var o=n("./utils"),s=n("./support"),a=n("./nodejsUtils"),l=n("./stream/GenericWorker"),c=new Array(256),u=0;u<256;u++)c[u]=252<=u?6:248<=u?5:240<=u?4:224<=u?3:192<=u?2:1;c[254]=c[254]=1;function f(){l.call(this,"utf-8 decode"),this.leftOver=null}function d(){l.call(this,"utf-8 encode")}i.utf8encode=function(h){return s.nodebuffer?a.newBufferFrom(h,"utf-8"):function(p){var g,m,v,y,x,b=p.length,w=0;for(y=0;y>>6:(m<65536?g[x++]=224|m>>>12:(g[x++]=240|m>>>18,g[x++]=128|m>>>12&63),g[x++]=128|m>>>6&63),g[x++]=128|63&m);return g}(h)},i.utf8decode=function(h){return s.nodebuffer?o.transformTo("nodebuffer",h).toString("utf-8"):function(p){var g,m,v,y,x=p.length,b=new Array(2*x);for(g=m=0;g>10&1023,b[m++]=56320|1023&v)}return b.length!==m&&(b.subarray?b=b.subarray(0,m):b.length=m),o.applyFromCharCode(b)}(h=o.transformTo(s.uint8array?"uint8array":"array",h))},o.inherits(f,l),f.prototype.processChunk=function(h){var p=o.transformTo(s.uint8array?"uint8array":"array",h.data);if(this.leftOver&&this.leftOver.length){if(s.uint8array){var g=p;(p=new Uint8Array(g.length+this.leftOver.length)).set(this.leftOver,0),p.set(g,this.leftOver.length)}else p=this.leftOver.concat(p);this.leftOver=null}var m=function(y,x){var b;for((x=x||y.length)>y.length&&(x=y.length),b=x-1;0<=b&&(192&y[b])==128;)b--;return b<0||b===0?x:b+c[y[b]]>x?b:x}(p),v=p;m!==p.length&&(s.uint8array?(v=p.subarray(0,m),this.leftOver=p.subarray(m,p.length)):(v=p.slice(0,m),this.leftOver=p.slice(m,p.length))),this.push({data:i.utf8decode(v),meta:h.meta})},f.prototype.flush=function(){this.leftOver&&this.leftOver.length&&(this.push({data:i.utf8decode(this.leftOver),meta:{}}),this.leftOver=null)},i.Utf8DecodeWorker=f,o.inherits(d,l),d.prototype.processChunk=function(h){this.push({data:i.utf8encode(h.data),meta:h.meta})},i.Utf8EncodeWorker=d},{"./nodejsUtils":14,"./stream/GenericWorker":28,"./support":30,"./utils":32}],32:[function(n,r,i){var o=n("./support"),s=n("./base64"),a=n("./nodejsUtils"),l=n("./external");function c(g){return g}function u(g,m){for(var v=0;v>8;this.dir=!!(16&this.externalFileAttributes),h==0&&(this.dosPermissions=63&this.externalFileAttributes),h==3&&(this.unixPermissions=this.externalFileAttributes>>16&65535),this.dir||this.fileNameStr.slice(-1)!=="/"||(this.dir=!0)},parseZIP64ExtraField:function(){if(this.extraFields[1]){var h=o(this.extraFields[1].value);this.uncompressedSize===s.MAX_VALUE_32BITS&&(this.uncompressedSize=h.readInt(8)),this.compressedSize===s.MAX_VALUE_32BITS&&(this.compressedSize=h.readInt(8)),this.localHeaderOffset===s.MAX_VALUE_32BITS&&(this.localHeaderOffset=h.readInt(8)),this.diskNumberStart===s.MAX_VALUE_32BITS&&(this.diskNumberStart=h.readInt(4))}},readExtraFields:function(h){var p,g,m,v=h.index+this.extraFieldsLength;for(this.extraFields||(this.extraFields={});h.index+4>>6:(h<65536?d[m++]=224|h>>>12:(d[m++]=240|h>>>18,d[m++]=128|h>>>12&63),d[m++]=128|h>>>6&63),d[m++]=128|63&h);return d},i.buf2binstring=function(f){return u(f,f.length)},i.binstring2buf=function(f){for(var d=new o.Buf8(f.length),h=0,p=d.length;h>10&1023,y[p++]=56320|1023&g)}return u(y,p)},i.utf8border=function(f,d){var h;for((d=d||f.length)>f.length&&(d=f.length),h=d-1;0<=h&&(192&f[h])==128;)h--;return h<0||h===0?d:h+l[f[h]]>d?h:d}},{"./common":41}],43:[function(n,r,i){r.exports=function(o,s,a,l){for(var c=65535&o|0,u=o>>>16&65535|0,f=0;a!==0;){for(a-=f=2e3>>1:s>>>1;a[l]=s}return a}();r.exports=function(s,a,l,c){var u=o,f=c+l;s^=-1;for(var d=c;d>>8^u[255&(s^a[d])];return-1^s}},{}],46:[function(n,r,i){var o,s=n("../utils/common"),a=n("./trees"),l=n("./adler32"),c=n("./crc32"),u=n("./messages"),f=0,d=4,h=0,p=-2,g=-1,m=4,v=2,y=8,x=9,b=286,w=30,_=19,S=2*b+1,O=15,k=3,E=258,P=E+k+1,A=42,R=113,T=1,M=2,I=3,j=4;function N(U,oe){return U.msg=u[oe],oe}function z(U){return(U<<1)-(4U.avail_out&&(ne=U.avail_out),ne!==0&&(s.arraySet(U.output,oe.pending_buf,oe.pending_out,ne,U.next_out),U.next_out+=ne,oe.pending_out+=ne,U.total_out+=ne,U.avail_out-=ne,oe.pending-=ne,oe.pending===0&&(oe.pending_out=0))}function F(U,oe){a._tr_flush_block(U,0<=U.block_start?U.block_start:-1,U.strstart-U.block_start,oe),U.block_start=U.strstart,B(U.strm)}function $(U,oe){U.pending_buf[U.pending++]=oe}function q(U,oe){U.pending_buf[U.pending++]=oe>>>8&255,U.pending_buf[U.pending++]=255&oe}function G(U,oe){var ne,V,X=U.max_chain_length,Z=U.strstart,he=U.prev_length,xe=U.nice_match,H=U.strstart>U.w_size-P?U.strstart-(U.w_size-P):0,W=U.window,J=U.w_mask,se=U.prev,ye=U.strstart+E,ie=W[Z+he-1],fe=W[Z+he];U.prev_length>=U.good_match&&(X>>=2),xe>U.lookahead&&(xe=U.lookahead);do if(W[(ne=oe)+he]===fe&&W[ne+he-1]===ie&&W[ne]===W[Z]&&W[++ne]===W[Z+1]){Z+=2,ne++;do;while(W[++Z]===W[++ne]&&W[++Z]===W[++ne]&&W[++Z]===W[++ne]&&W[++Z]===W[++ne]&&W[++Z]===W[++ne]&&W[++Z]===W[++ne]&&W[++Z]===W[++ne]&&W[++Z]===W[++ne]&&ZH&&--X!=0);return he<=U.lookahead?he:U.lookahead}function Y(U){var oe,ne,V,X,Z,he,xe,H,W,J,se=U.w_size;do{if(X=U.window_size-U.lookahead-U.strstart,U.strstart>=se+(se-P)){for(s.arraySet(U.window,U.window,se,se,0),U.match_start-=se,U.strstart-=se,U.block_start-=se,oe=ne=U.hash_size;V=U.head[--oe],U.head[oe]=se<=V?V-se:0,--ne;);for(oe=ne=se;V=U.prev[--oe],U.prev[oe]=se<=V?V-se:0,--ne;);X+=se}if(U.strm.avail_in===0)break;if(he=U.strm,xe=U.window,H=U.strstart+U.lookahead,W=X,J=void 0,J=he.avail_in,W=k)for(Z=U.strstart-U.insert,U.ins_h=U.window[Z],U.ins_h=(U.ins_h<=k&&(U.ins_h=(U.ins_h<=k)if(V=a._tr_tally(U,U.strstart-U.match_start,U.match_length-k),U.lookahead-=U.match_length,U.match_length<=U.max_lazy_match&&U.lookahead>=k){for(U.match_length--;U.strstart++,U.ins_h=(U.ins_h<=k&&(U.ins_h=(U.ins_h<=k&&U.match_length<=U.prev_length){for(X=U.strstart+U.lookahead-k,V=a._tr_tally(U,U.strstart-1-U.prev_match,U.prev_length-k),U.lookahead-=U.prev_length-1,U.prev_length-=2;++U.strstart<=X&&(U.ins_h=(U.ins_h<U.pending_buf_size-5&&(ne=U.pending_buf_size-5);;){if(U.lookahead<=1){if(Y(U),U.lookahead===0&&oe===f)return T;if(U.lookahead===0)break}U.strstart+=U.lookahead,U.lookahead=0;var V=U.block_start+ne;if((U.strstart===0||U.strstart>=V)&&(U.lookahead=U.strstart-V,U.strstart=V,F(U,!1),U.strm.avail_out===0)||U.strstart-U.block_start>=U.w_size-P&&(F(U,!1),U.strm.avail_out===0))return T}return U.insert=0,oe===d?(F(U,!0),U.strm.avail_out===0?I:j):(U.strstart>U.block_start&&(F(U,!1),U.strm.avail_out),T)}),new ee(4,4,8,4,le),new ee(4,5,16,8,le),new ee(4,6,32,32,le),new ee(4,4,16,16,K),new ee(8,16,32,32,K),new ee(8,16,128,128,K),new ee(8,32,128,256,K),new ee(32,128,258,1024,K),new ee(32,258,258,4096,K)],i.deflateInit=function(U,oe){return ae(U,oe,y,15,8,0)},i.deflateInit2=ae,i.deflateReset=te,i.deflateResetKeep=ge,i.deflateSetHeader=function(U,oe){return U&&U.state?U.state.wrap!==2?p:(U.state.gzhead=oe,h):p},i.deflate=function(U,oe){var ne,V,X,Z;if(!U||!U.state||5>8&255),$(V,V.gzhead.time>>16&255),$(V,V.gzhead.time>>24&255),$(V,V.level===9?2:2<=V.strategy||V.level<2?4:0),$(V,255&V.gzhead.os),V.gzhead.extra&&V.gzhead.extra.length&&($(V,255&V.gzhead.extra.length),$(V,V.gzhead.extra.length>>8&255)),V.gzhead.hcrc&&(U.adler=c(U.adler,V.pending_buf,V.pending,0)),V.gzindex=0,V.status=69):($(V,0),$(V,0),$(V,0),$(V,0),$(V,0),$(V,V.level===9?2:2<=V.strategy||V.level<2?4:0),$(V,3),V.status=R);else{var he=y+(V.w_bits-8<<4)<<8;he|=(2<=V.strategy||V.level<2?0:V.level<6?1:V.level===6?2:3)<<6,V.strstart!==0&&(he|=32),he+=31-he%31,V.status=R,q(V,he),V.strstart!==0&&(q(V,U.adler>>>16),q(V,65535&U.adler)),U.adler=1}if(V.status===69)if(V.gzhead.extra){for(X=V.pending;V.gzindex<(65535&V.gzhead.extra.length)&&(V.pending!==V.pending_buf_size||(V.gzhead.hcrc&&V.pending>X&&(U.adler=c(U.adler,V.pending_buf,V.pending-X,X)),B(U),X=V.pending,V.pending!==V.pending_buf_size));)$(V,255&V.gzhead.extra[V.gzindex]),V.gzindex++;V.gzhead.hcrc&&V.pending>X&&(U.adler=c(U.adler,V.pending_buf,V.pending-X,X)),V.gzindex===V.gzhead.extra.length&&(V.gzindex=0,V.status=73)}else V.status=73;if(V.status===73)if(V.gzhead.name){X=V.pending;do{if(V.pending===V.pending_buf_size&&(V.gzhead.hcrc&&V.pending>X&&(U.adler=c(U.adler,V.pending_buf,V.pending-X,X)),B(U),X=V.pending,V.pending===V.pending_buf_size)){Z=1;break}Z=V.gzindexX&&(U.adler=c(U.adler,V.pending_buf,V.pending-X,X)),Z===0&&(V.gzindex=0,V.status=91)}else V.status=91;if(V.status===91)if(V.gzhead.comment){X=V.pending;do{if(V.pending===V.pending_buf_size&&(V.gzhead.hcrc&&V.pending>X&&(U.adler=c(U.adler,V.pending_buf,V.pending-X,X)),B(U),X=V.pending,V.pending===V.pending_buf_size)){Z=1;break}Z=V.gzindexX&&(U.adler=c(U.adler,V.pending_buf,V.pending-X,X)),Z===0&&(V.status=103)}else V.status=103;if(V.status===103&&(V.gzhead.hcrc?(V.pending+2>V.pending_buf_size&&B(U),V.pending+2<=V.pending_buf_size&&($(V,255&U.adler),$(V,U.adler>>8&255),U.adler=0,V.status=R)):V.status=R),V.pending!==0){if(B(U),U.avail_out===0)return V.last_flush=-1,h}else if(U.avail_in===0&&z(oe)<=z(ne)&&oe!==d)return N(U,-5);if(V.status===666&&U.avail_in!==0)return N(U,-5);if(U.avail_in!==0||V.lookahead!==0||oe!==f&&V.status!==666){var xe=V.strategy===2?function(H,W){for(var J;;){if(H.lookahead===0&&(Y(H),H.lookahead===0)){if(W===f)return T;break}if(H.match_length=0,J=a._tr_tally(H,0,H.window[H.strstart]),H.lookahead--,H.strstart++,J&&(F(H,!1),H.strm.avail_out===0))return T}return H.insert=0,W===d?(F(H,!0),H.strm.avail_out===0?I:j):H.last_lit&&(F(H,!1),H.strm.avail_out===0)?T:M}(V,oe):V.strategy===3?function(H,W){for(var J,se,ye,ie,fe=H.window;;){if(H.lookahead<=E){if(Y(H),H.lookahead<=E&&W===f)return T;if(H.lookahead===0)break}if(H.match_length=0,H.lookahead>=k&&0H.lookahead&&(H.match_length=H.lookahead)}if(H.match_length>=k?(J=a._tr_tally(H,1,H.match_length-k),H.lookahead-=H.match_length,H.strstart+=H.match_length,H.match_length=0):(J=a._tr_tally(H,0,H.window[H.strstart]),H.lookahead--,H.strstart++),J&&(F(H,!1),H.strm.avail_out===0))return T}return H.insert=0,W===d?(F(H,!0),H.strm.avail_out===0?I:j):H.last_lit&&(F(H,!1),H.strm.avail_out===0)?T:M}(V,oe):o[V.level].func(V,oe);if(xe!==I&&xe!==j||(V.status=666),xe===T||xe===I)return U.avail_out===0&&(V.last_flush=-1),h;if(xe===M&&(oe===1?a._tr_align(V):oe!==5&&(a._tr_stored_block(V,0,0,!1),oe===3&&(L(V.head),V.lookahead===0&&(V.strstart=0,V.block_start=0,V.insert=0))),B(U),U.avail_out===0))return V.last_flush=-1,h}return oe!==d?h:V.wrap<=0?1:(V.wrap===2?($(V,255&U.adler),$(V,U.adler>>8&255),$(V,U.adler>>16&255),$(V,U.adler>>24&255),$(V,255&U.total_in),$(V,U.total_in>>8&255),$(V,U.total_in>>16&255),$(V,U.total_in>>24&255)):(q(V,U.adler>>>16),q(V,65535&U.adler)),B(U),0=ne.w_size&&(Z===0&&(L(ne.head),ne.strstart=0,ne.block_start=0,ne.insert=0),W=new s.Buf8(ne.w_size),s.arraySet(W,oe,J-ne.w_size,ne.w_size,0),oe=W,J=ne.w_size),he=U.avail_in,xe=U.next_in,H=U.input,U.avail_in=J,U.next_in=0,U.input=oe,Y(ne);ne.lookahead>=k;){for(V=ne.strstart,X=ne.lookahead-(k-1);ne.ins_h=(ne.ins_h<>>=k=O>>>24,x-=k,(k=O>>>16&255)===0)M[u++]=65535&O;else{if(!(16&k)){if(!(64&k)){O=b[(65535&O)+(y&(1<>>=k,x-=k),x<15&&(y+=T[l++]<>>=k=O>>>24,x-=k,!(16&(k=O>>>16&255))){if(!(64&k)){O=w[(65535&O)+(y&(1<>>=k,x-=k,(k=u-f)>3,y&=(1<<(x-=E<<3))-1,o.next_in=l,o.next_out=u,o.avail_in=l>>24&255)+(A>>>8&65280)+((65280&A)<<8)+((255&A)<<24)}function y(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new o.Buf16(320),this.work=new o.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function x(A){var R;return A&&A.state?(R=A.state,A.total_in=A.total_out=R.total=0,A.msg="",R.wrap&&(A.adler=1&R.wrap),R.mode=p,R.last=0,R.havedict=0,R.dmax=32768,R.head=null,R.hold=0,R.bits=0,R.lencode=R.lendyn=new o.Buf32(g),R.distcode=R.distdyn=new o.Buf32(m),R.sane=1,R.back=-1,d):h}function b(A){var R;return A&&A.state?((R=A.state).wsize=0,R.whave=0,R.wnext=0,x(A)):h}function w(A,R){var T,M;return A&&A.state?(M=A.state,R<0?(T=0,R=-R):(T=1+(R>>4),R<48&&(R&=15)),R&&(R<8||15=j.wsize?(o.arraySet(j.window,R,T-j.wsize,j.wsize,0),j.wnext=0,j.whave=j.wsize):(M<(I=j.wsize-j.wnext)&&(I=M),o.arraySet(j.window,R,T-M,I,j.wnext),(M-=I)?(o.arraySet(j.window,R,T-M,M,0),j.wnext=M,j.whave=j.wsize):(j.wnext+=I,j.wnext===j.wsize&&(j.wnext=0),j.whave>>8&255,T.check=a(T.check,Z,2,0),F=B=0,T.mode=2;break}if(T.flags=0,T.head&&(T.head.done=!1),!(1&T.wrap)||(((255&B)<<8)+(B>>8))%31){A.msg="incorrect header check",T.mode=30;break}if((15&B)!=8){A.msg="unknown compression method",T.mode=30;break}if(F-=4,U=8+(15&(B>>>=4)),T.wbits===0)T.wbits=U;else if(U>T.wbits){A.msg="invalid window size",T.mode=30;break}T.dmax=1<>8&1),512&T.flags&&(Z[0]=255&B,Z[1]=B>>>8&255,T.check=a(T.check,Z,2,0)),F=B=0,T.mode=3;case 3:for(;F<32;){if(z===0)break e;z--,B+=M[j++]<>>8&255,Z[2]=B>>>16&255,Z[3]=B>>>24&255,T.check=a(T.check,Z,4,0)),F=B=0,T.mode=4;case 4:for(;F<16;){if(z===0)break e;z--,B+=M[j++]<>8),512&T.flags&&(Z[0]=255&B,Z[1]=B>>>8&255,T.check=a(T.check,Z,2,0)),F=B=0,T.mode=5;case 5:if(1024&T.flags){for(;F<16;){if(z===0)break e;z--,B+=M[j++]<>>8&255,T.check=a(T.check,Z,2,0)),F=B=0}else T.head&&(T.head.extra=null);T.mode=6;case 6:if(1024&T.flags&&(z<(G=T.length)&&(G=z),G&&(T.head&&(U=T.head.extra_len-T.length,T.head.extra||(T.head.extra=new Array(T.head.extra_len)),o.arraySet(T.head.extra,M,j,G,U)),512&T.flags&&(T.check=a(T.check,M,G,j)),z-=G,j+=G,T.length-=G),T.length))break e;T.length=0,T.mode=7;case 7:if(2048&T.flags){if(z===0)break e;for(G=0;U=M[j+G++],T.head&&U&&T.length<65536&&(T.head.name+=String.fromCharCode(U)),U&&G>9&1,T.head.done=!0),A.adler=T.check=0,T.mode=12;break;case 10:for(;F<32;){if(z===0)break e;z--,B+=M[j++]<>>=7&F,F-=7&F,T.mode=27;break}for(;F<3;){if(z===0)break e;z--,B+=M[j++]<>>=1)){case 0:T.mode=14;break;case 1:if(E(T),T.mode=20,R!==6)break;B>>>=2,F-=2;break e;case 2:T.mode=17;break;case 3:A.msg="invalid block type",T.mode=30}B>>>=2,F-=2;break;case 14:for(B>>>=7&F,F-=7&F;F<32;){if(z===0)break e;z--,B+=M[j++]<>>16^65535)){A.msg="invalid stored block lengths",T.mode=30;break}if(T.length=65535&B,F=B=0,T.mode=15,R===6)break e;case 15:T.mode=16;case 16:if(G=T.length){if(z>>=5,F-=5,T.ndist=1+(31&B),B>>>=5,F-=5,T.ncode=4+(15&B),B>>>=4,F-=4,286>>=3,F-=3}for(;T.have<19;)T.lens[he[T.have++]]=0;if(T.lencode=T.lendyn,T.lenbits=7,ne={bits:T.lenbits},oe=c(0,T.lens,0,19,T.lencode,0,T.work,ne),T.lenbits=ne.bits,oe){A.msg="invalid code lengths set",T.mode=30;break}T.have=0,T.mode=19;case 19:for(;T.have>>16&255,re=65535&X,!((K=X>>>24)<=F);){if(z===0)break e;z--,B+=M[j++]<>>=K,F-=K,T.lens[T.have++]=re;else{if(re===16){for(V=K+2;F>>=K,F-=K,T.have===0){A.msg="invalid bit length repeat",T.mode=30;break}U=T.lens[T.have-1],G=3+(3&B),B>>>=2,F-=2}else if(re===17){for(V=K+3;F>>=K)),B>>>=3,F-=3}else{for(V=K+7;F>>=K)),B>>>=7,F-=7}if(T.have+G>T.nlen+T.ndist){A.msg="invalid bit length repeat",T.mode=30;break}for(;G--;)T.lens[T.have++]=U}}if(T.mode===30)break;if(T.lens[256]===0){A.msg="invalid code -- missing end-of-block",T.mode=30;break}if(T.lenbits=9,ne={bits:T.lenbits},oe=c(u,T.lens,0,T.nlen,T.lencode,0,T.work,ne),T.lenbits=ne.bits,oe){A.msg="invalid literal/lengths set",T.mode=30;break}if(T.distbits=6,T.distcode=T.distdyn,ne={bits:T.distbits},oe=c(f,T.lens,T.nlen,T.ndist,T.distcode,0,T.work,ne),T.distbits=ne.bits,oe){A.msg="invalid distances set",T.mode=30;break}if(T.mode=20,R===6)break e;case 20:T.mode=21;case 21:if(6<=z&&258<=L){A.next_out=N,A.avail_out=L,A.next_in=j,A.avail_in=z,T.hold=B,T.bits=F,l(A,q),N=A.next_out,I=A.output,L=A.avail_out,j=A.next_in,M=A.input,z=A.avail_in,B=T.hold,F=T.bits,T.mode===12&&(T.back=-1);break}for(T.back=0;ee=(X=T.lencode[B&(1<>>16&255,re=65535&X,!((K=X>>>24)<=F);){if(z===0)break e;z--,B+=M[j++]<>ge)])>>>16&255,re=65535&X,!(ge+(K=X>>>24)<=F);){if(z===0)break e;z--,B+=M[j++]<>>=ge,F-=ge,T.back+=ge}if(B>>>=K,F-=K,T.back+=K,T.length=re,ee===0){T.mode=26;break}if(32&ee){T.back=-1,T.mode=12;break}if(64&ee){A.msg="invalid literal/length code",T.mode=30;break}T.extra=15&ee,T.mode=22;case 22:if(T.extra){for(V=T.extra;F>>=T.extra,F-=T.extra,T.back+=T.extra}T.was=T.length,T.mode=23;case 23:for(;ee=(X=T.distcode[B&(1<>>16&255,re=65535&X,!((K=X>>>24)<=F);){if(z===0)break e;z--,B+=M[j++]<>ge)])>>>16&255,re=65535&X,!(ge+(K=X>>>24)<=F);){if(z===0)break e;z--,B+=M[j++]<>>=ge,F-=ge,T.back+=ge}if(B>>>=K,F-=K,T.back+=K,64&ee){A.msg="invalid distance code",T.mode=30;break}T.offset=re,T.extra=15&ee,T.mode=24;case 24:if(T.extra){for(V=T.extra;F>>=T.extra,F-=T.extra,T.back+=T.extra}if(T.offset>T.dmax){A.msg="invalid distance too far back",T.mode=30;break}T.mode=25;case 25:if(L===0)break e;if(G=q-L,T.offset>G){if((G=T.offset-G)>T.whave&&T.sane){A.msg="invalid distance too far back",T.mode=30;break}Y=G>T.wnext?(G-=T.wnext,T.wsize-G):T.wnext-G,G>T.length&&(G=T.length),le=T.window}else le=I,Y=N-T.offset,G=T.length;for(LS?(k=Y[le+m[R]],F[$+m[R]]):(k=96,0),y=1<>N)+(x-=y)]=O<<24|k<<16|E|0,x!==0;);for(y=1<>=1;if(y!==0?(B&=y-1,B+=y):B=0,R++,--q[A]==0){if(A===M)break;A=f[d+m[R]]}if(I>>7)]}function $(X,Z){X.pending_buf[X.pending++]=255&Z,X.pending_buf[X.pending++]=Z>>>8&255}function q(X,Z,he){X.bi_valid>v-he?(X.bi_buf|=Z<>v-X.bi_valid,X.bi_valid+=he-v):(X.bi_buf|=Z<>>=1,he<<=1,0<--Z;);return he>>>1}function le(X,Z,he){var xe,H,W=new Array(m+1),J=0;for(xe=1;xe<=m;xe++)W[xe]=J=J+he[xe-1]<<1;for(H=0;H<=Z;H++){var se=X[2*H+1];se!==0&&(X[2*H]=Y(W[se]++,se))}}function K(X){var Z;for(Z=0;Z>1;1<=he;he--)ge(X,W,he);for(H=ye;he=X.heap[1],X.heap[1]=X.heap[X.heap_len--],ge(X,W,1),xe=X.heap[1],X.heap[--X.heap_max]=he,X.heap[--X.heap_max]=xe,W[2*H]=W[2*he]+W[2*xe],X.depth[H]=(X.depth[he]>=X.depth[xe]?X.depth[he]:X.depth[xe])+1,W[2*he+1]=W[2*xe+1]=H,X.heap[1]=H++,ge(X,W,1),2<=X.heap_len;);X.heap[--X.heap_max]=X.heap[1],function(fe,Q){var _e,we,Ie,Pe,Me,Te,Le=Q.dyn_tree,ue=Q.max_code,$e=Q.stat_desc.static_tree,Se=Q.stat_desc.has_stree,Xe=Q.stat_desc.extra_bits,tt=Q.stat_desc.extra_base,ut=Q.stat_desc.max_length,qt=0;for(Pe=0;Pe<=m;Pe++)fe.bl_count[Pe]=0;for(Le[2*fe.heap[fe.heap_max]+1]=0,_e=fe.heap_max+1;_e>=7;H>>=1)if(1&ie&&se.dyn_ltree[2*ye]!==0)return s;if(se.dyn_ltree[18]!==0||se.dyn_ltree[20]!==0||se.dyn_ltree[26]!==0)return a;for(ye=32;ye>>3,(W=X.static_len+3+7>>>3)<=H&&(H=W)):H=W=he+5,he+4<=H&&Z!==-1?V(X,Z,he,xe):X.strategy===4||W===H?(q(X,2+(xe?1:0),3),te(X,P,A)):(q(X,4+(xe?1:0),3),function(se,ye,ie,fe){var Q;for(q(se,ye-257,5),q(se,ie-1,5),q(se,fe-4,4),Q=0;Q>>8&255,X.pending_buf[X.d_buf+2*X.last_lit+1]=255&Z,X.pending_buf[X.l_buf+X.last_lit]=255&he,X.last_lit++,Z===0?X.dyn_ltree[2*he]++:(X.matches++,Z--,X.dyn_ltree[2*(T[he]+f+1)]++,X.dyn_dtree[2*F(Z)]++),X.last_lit===X.lit_bufsize-1},i._tr_align=function(X){q(X,2,3),G(X,x,P),function(Z){Z.bi_valid===16?($(Z,Z.bi_buf),Z.bi_buf=0,Z.bi_valid=0):8<=Z.bi_valid&&(Z.pending_buf[Z.pending++]=255&Z.bi_buf,Z.bi_buf>>=8,Z.bi_valid-=8)}(X)}},{"../utils/common":41}],53:[function(n,r,i){r.exports=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}},{}],54:[function(n,r,i){(function(o){(function(s,a){if(!s.setImmediate){var l,c,u,f,d=1,h={},p=!1,g=s.document,m=Object.getPrototypeOf&&Object.getPrototypeOf(s);m=m&&m.setTimeout?m:s,l={}.toString.call(s.process)==="[object process]"?function(b){process.nextTick(function(){y(b)})}:function(){if(s.postMessage&&!s.importScripts){var b=!0,w=s.onmessage;return s.onmessage=function(){b=!1},s.postMessage("","*"),s.onmessage=w,b}}()?(f="setImmediate$"+Math.random()+"$",s.addEventListener?s.addEventListener("message",x,!1):s.attachEvent("onmessage",x),function(b){s.postMessage(f+b,"*")}):s.MessageChannel?((u=new MessageChannel).port1.onmessage=function(b){y(b.data)},function(b){u.port2.postMessage(b)}):g&&"onreadystatechange"in g.createElement("script")?(c=g.documentElement,function(b){var w=g.createElement("script");w.onreadystatechange=function(){y(b),w.onreadystatechange=null,c.removeChild(w),w=null},c.appendChild(w)}):function(b){setTimeout(y,0,b)},m.setImmediate=function(b){typeof b!="function"&&(b=new Function(""+b));for(var w=new Array(arguments.length-1),_=0;_"u"?o===void 0?this:o:self)}).call(this,typeof ei<"u"?ei:typeof self<"u"?self:typeof window<"u"?window:{})},{}]},{},[10])(10)})})(oIe);var fSt=oIe.exports;const dSt=sn(fSt);var sIe={exports:{}};(function(t,e){(function(n,r){r()})(ei,function(){function n(c,u){return typeof u>"u"?u={autoBom:!1}:typeof u!="object"&&(console.warn("Deprecated: Expected third argument to be a object"),u={autoBom:!u}),u.autoBom&&/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(c.type)?new Blob(["\uFEFF",c],{type:c.type}):c}function r(c,u,f){var d=new XMLHttpRequest;d.open("GET",c),d.responseType="blob",d.onload=function(){l(d.response,u,f)},d.onerror=function(){console.error("could not download file")},d.send()}function i(c){var u=new XMLHttpRequest;u.open("HEAD",c,!1);try{u.send()}catch{}return 200<=u.status&&299>=u.status}function o(c){try{c.dispatchEvent(new MouseEvent("click"))}catch{var u=document.createEvent("MouseEvents");u.initMouseEvent("click",!0,!0,window,0,0,0,80,20,!1,!1,!1,!1,0,null),c.dispatchEvent(u)}}var s=typeof window=="object"&&window.window===window?window:typeof self=="object"&&self.self===self?self:typeof ei=="object"&&ei.global===ei?ei:void 0,a=s.navigator&&/Macintosh/.test(navigator.userAgent)&&/AppleWebKit/.test(navigator.userAgent)&&!/Safari/.test(navigator.userAgent),l=s.saveAs||(typeof window!="object"||window!==s?function(){}:"download"in HTMLAnchorElement.prototype&&!a?function(c,u,f){var d=s.URL||s.webkitURL,h=document.createElement("a");u=u||c.name||"download",h.download=u,h.rel="noopener",typeof c=="string"?(h.href=c,h.origin===location.origin?o(h):i(h.href)?r(c,u,f):o(h,h.target="_blank")):(h.href=d.createObjectURL(c),setTimeout(function(){d.revokeObjectURL(h.href)},4e4),setTimeout(function(){o(h)},0))}:"msSaveOrOpenBlob"in navigator?function(c,u,f){if(u=u||c.name||"download",typeof c!="string")navigator.msSaveOrOpenBlob(n(c,f),u);else if(i(c))r(c,u,f);else{var d=document.createElement("a");d.href=c,d.target="_blank",setTimeout(function(){o(d)})}}:function(c,u,f,d){if(d=d||open("","_blank"),d&&(d.document.title=d.document.body.innerText="downloading..."),typeof c=="string")return r(c,u,f);var h=c.type==="application/octet-stream",p=/constructor/i.test(s.HTMLElement)||s.safari,g=/CriOS\/[\d]+/.test(navigator.userAgent);if((g||h&&p||a)&&typeof FileReader<"u"){var m=new FileReader;m.onloadend=function(){var x=m.result;x=g?x:x.replace(/^data:[^;]*;/,"data:attachment/file;"),d?d.location.href=x:location=x,d=null},m.readAsDataURL(c)}else{var v=s.URL||s.webkitURL,y=v.createObjectURL(c);d?d.location=y:location.href=y,d=null,setTimeout(function(){v.revokeObjectURL(y)},4e4)}});s.saveAs=l.saveAs=l,t.exports=l})})(sIe);var aIe=sIe.exports;const bpe=t=>{let e;const n=new Set,r=(c,u)=>{const f=typeof c=="function"?c(e):c;if(!Object.is(f,e)){const d=e;e=u??(typeof f!="object"||f===null)?f:Object.assign({},e,f),n.forEach(h=>h(e,d))}},i=()=>e,a={setState:r,getState:i,getInitialState:()=>l,subscribe:c=>(n.add(c),()=>n.delete(c))},l=e=t(r,i,a);return a},hSt=t=>t?bpe(t):bpe,pSt=t=>t;function gSt(t,e=pSt){const n=de.useSyncExternalStore(t.subscribe,()=>e(t.getState()),()=>e(t.getInitialState()));return de.useDebugValue(n),n}const wpe=t=>{const e=hSt(t),n=r=>gSt(e,r);return Object.assign(n,e),n},mSt=t=>t?wpe(t):wpe,vSt={Date:!0,RegExp:!0,String:!0,Number:!0};function lIe(t,e,n={cyclesFix:!0},r=[]){var a,l;let i=[];const o=Array.isArray(t);for(const c in t){const u=t[c],f=o?+c:c;if(!(c in e)){i.push({type:"REMOVE",path:[f],oldValue:t[c]});continue}const d=e[c],h=typeof u=="object"&&typeof d=="object"&&Array.isArray(u)===Array.isArray(d);if(u&&d&&h&&!vSt[(l=(a=Object.getPrototypeOf(u))==null?void 0:a.constructor)==null?void 0:l.name]&&(!n.cyclesFix||!r.includes(u))){const p=lIe(u,d,n,n.cyclesFix?r.concat([u]):[]);i.push.apply(i,p.map(g=>(g.path.unshift(f),g)))}else u!==d&&!(Number.isNaN(u)&&Number.isNaN(d))&&!(h&&(isNaN(u)?u+""==d+"":+u==+d))&&i.push({path:[f],type:"CHANGE",value:d,oldValue:u})}const s=Array.isArray(e);for(const c in e)c in t||i.push({type:"CREATE",path:[s?+c:c],value:e[c]});return i}const _pe={};function Yq(t,e){t===void 0&&(t=_pe),e===void 0&&(e=_pe);const n=Object.keys(t),r=Object.keys(e);return t===e||n.length===r.length&&n.every(i=>t[i]===e[i])}const ySt=/("(?:[^\\"]|\\.)*")|[:,]/g;function RW(t,e={}){const n=JSON.stringify([1],void 0,e.indent===void 0?2:e.indent).slice(2,-3),r=n===""?1/0:e.maxLength===void 0?80:e.maxLength;let{replacer:i}=e;return function o(s,a,l){s&&typeof s.toJSON=="function"&&(s=s.toJSON());const c=JSON.stringify(s,i);if(c===void 0)return c;const u=r-a.length-l;if(c.length<=u){const f=c.replace(ySt,(d,h)=>h||`${d} `);if(f.length<=u)return f}if(i!=null&&(s=JSON.parse(c),i=void 0),typeof s=="object"&&s!==null){const f=a+n,d=[];let h=0,p,g;if(Array.isArray(s)){p="[",g="]";const{length:m}=s;for(;h0)return[p,n+d.join(`, +${f}`),g].join(` +${a}`)}return c}(t,"",0)}function kl(t,e,n){return t.fields=e||[],t.fname=n,t}function Ni(t){return t==null?null:t.fname}function Ys(t){return t==null?null:t.fields}function cIe(t){return t.length===1?xSt(t[0]):bSt(t)}const xSt=t=>function(e){return e[t]},bSt=t=>{const e=t.length;return function(n){for(let r=0;rs?c():s=a+1:l==="["?(a>s&&c(),i=s=a+1):l==="]"&&(i||je("Access path missing open bracket: "+t),i>0&&c(),i=0,s=a+1)}return i&&je("Access path missing closing bracket: "+t),r&&je("Access path missing closing quote: "+t),a>s&&(a++,c()),e}function Eu(t,e,n){const r=Nh(t);return t=r.length===1?r[0]:t,kl((n&&n.get||cIe)(r),[t],e||t)}const eR=Eu("id"),ea=kl(t=>t,[],"identity"),nv=kl(()=>0,[],"zero"),pO=kl(()=>1,[],"one"),Tu=kl(()=>!0,[],"true"),Pm=kl(()=>!1,[],"false");function wSt(t,e,n){const r=[e].concat([].slice.call(n));console[t].apply(console,r)}const uIe=0,cne=1,une=2,fIe=3,dIe=4;function fne(t,e){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:wSt,r=t||uIe;return{level(i){return arguments.length?(r=+i,this):r},error(){return r>=cne&&n(e||"error","ERROR",arguments),this},warn(){return r>=une&&n(e||"warn","WARN",arguments),this},info(){return r>=fIe&&n(e||"log","INFO",arguments),this},debug(){return r>=dIe&&n(e||"log","DEBUG",arguments),this}}}var We=Array.isArray;function ht(t){return t===Object(t)}const Spe=t=>t!=="__proto__";function gO(){for(var t=arguments.length,e=new Array(t),n=0;n{for(const o in i)if(o==="signals")r.signals=_St(r.signals,i.signals);else{const s=o==="legend"?{layout:1}:o==="style"?!0:null;mO(r,o,i[o],s)}return r},{})}function mO(t,e,n,r){if(!Spe(e))return;let i,o;if(ht(n)&&!We(n)){o=ht(t[e])?t[e]:t[e]={};for(i in n)r&&(r===!0||r[i])?mO(o,i,n[i]):Spe(i)&&(o[i]=n[i])}else t[e]=n}function _St(t,e){if(t==null)return e;const n={},r=[];function i(o){n[o.name]||(n[o.name]=1,r.push(o))}return e.forEach(i),t.forEach(i),r}function $n(t){return t[t.length-1]}function qs(t){return t==null||t===""?null:+t}const hIe=t=>e=>t*Math.exp(e),pIe=t=>e=>Math.log(t*e),gIe=t=>e=>Math.sign(e)*Math.log1p(Math.abs(e/t)),mIe=t=>e=>Math.sign(e)*Math.expm1(Math.abs(e))*t,cN=t=>e=>e<0?-Math.pow(-e,t):Math.pow(e,t);function U4(t,e,n,r){const i=n(t[0]),o=n($n(t)),s=(o-i)*e;return[r(i-s),r(o-s)]}function vIe(t,e){return U4(t,e,qs,ea)}function yIe(t,e){var n=Math.sign(t[0]);return U4(t,e,pIe(n),hIe(n))}function xIe(t,e,n){return U4(t,e,cN(n),cN(1/n))}function bIe(t,e,n){return U4(t,e,gIe(n),mIe(n))}function W4(t,e,n,r,i){const o=r(t[0]),s=r($n(t)),a=e!=null?r(e):(o+s)/2;return[i(a+(o-a)*n),i(a+(s-a)*n)]}function dne(t,e,n){return W4(t,e,n,qs,ea)}function hne(t,e,n){const r=Math.sign(t[0]);return W4(t,e,n,pIe(r),hIe(r))}function uN(t,e,n,r){return W4(t,e,n,cN(r),cN(1/r))}function pne(t,e,n,r){return W4(t,e,n,gIe(r),mIe(r))}function wIe(t){return 1+~~(new Date(t).getMonth()/3)}function _Ie(t){return 1+~~(new Date(t).getUTCMonth()/3)}function pt(t){return t!=null?We(t)?t:[t]:[]}function SIe(t,e,n){let r=t[0],i=t[1],o;return i=n-e?[e,n]:[r=Math.min(Math.max(r,e),n-o),r+o]}function fn(t){return typeof t=="function"}const SSt="descending";function gne(t,e,n){n=n||{},e=pt(e)||[];const r=[],i=[],o={},s=n.comparator||CSt;return pt(t).forEach((a,l)=>{a!=null&&(r.push(e[l]===SSt?-1:1),i.push(a=fn(a)?a:Eu(a,null,n)),(Ys(a)||[]).forEach(c=>o[c]=1))}),i.length===0?null:kl(s(i,r),Object.keys(o))}const V4=(t,e)=>(te||e==null)&&t!=null?1:(e=e instanceof Date?+e:e,(t=t instanceof Date?+t:t)!==t&&e===e?-1:e!==e&&t===t?1:0),CSt=(t,e)=>t.length===1?OSt(t[0],e[0]):ESt(t,e,t.length),OSt=(t,e)=>function(n,r){return V4(t(n),t(r))*e},ESt=(t,e,n)=>(e.push(0),function(r,i){let o,s=0,a=-1;for(;s===0&&++at}function mne(t,e){let n;return r=>{n&&clearTimeout(n),n=setTimeout(()=>(e(r),n=null),t)}}function cn(t){for(let e,n,r=1,i=arguments.length;rs&&(s=i))}else{for(i=e(t[n]);ns&&(s=i))}return[o,s]}function CIe(t,e){const n=t.length;let r=-1,i,o,s,a,l;if(e==null){for(;++r=o){i=s=o;break}if(r===n)return[-1,-1];for(a=l=r;++ro&&(i=o,a=r),s=o){i=s=o;break}if(r===n)return[-1,-1];for(a=l=r;++ro&&(i=o,a=r),s{i.set(o,t[o])}),i}function OIe(t,e,n,r,i,o){if(!n&&n!==0)return o;const s=+n;let a=t[0],l=$n(t),c;lo&&(s=i,i=o,o=s),n=n===void 0||n,r=r===void 0||r,(n?i<=t:ia.replace(/\\(.)/g,"$1")):pt(t));const r=t&&t.length,i=n&&n.get||cIe,o=a=>i(e?[a]:Nh(a));let s;if(!r)s=function(){return""};else if(r===1){const a=o(t[0]);s=function(l){return""+a(l)}}else{const a=t.map(o);s=function(l){let c=""+a[0](l),u=0;for(;++u{e={},n={},r=0},o=(s,a)=>(++r>t&&(n=e,e={},r=1),e[s]=a);return i(),{clear:i,has:s=>vt(e,s)||vt(n,s),get:s=>vt(e,s)?e[s]:vt(n,s)?o(s,n[s]):void 0,set:(s,a)=>vt(e,s)?e[s]=a:o(s,a)}}function PIe(t,e,n,r){const i=e.length,o=n.length;if(!o)return e;if(!i)return n;const s=r||new e.constructor(i+o);let a=0,l=0,c=0;for(;a0?n[l++]:e[a++];for(;a=0;)n+=t;return n}function MIe(t,e,n,r){const i=n||" ",o=t+"",s=e-o.length;return s<=0?o:r==="left"?J2(i,s)+o:r==="center"?J2(i,~~(s/2))+o+J2(i,Math.ceil(s/2)):o+J2(i,s)}function tR(t){return t&&$n(t)-t[0]||0}function rt(t){return We(t)?"["+t.map(rt)+"]":ht(t)||gt(t)?JSON.stringify(t).replace("\u2028","\\u2028").replace("\u2029","\\u2029"):t}function yne(t){return t==null||t===""?null:!t||t==="false"||t==="0"?!1:!!t}const ASt=t=>Jn(t)||Fv(t)?t:Date.parse(t);function xne(t,e){return e=e||ASt,t==null||t===""?null:e(t)}function bne(t){return t==null||t===""?null:t+""}function Wf(t){const e={},n=t.length;for(let r=0;r9999?"+"+Wa(t,6):Wa(t,4)}function RSt(t){var e=t.getUTCHours(),n=t.getUTCMinutes(),r=t.getUTCSeconds(),i=t.getUTCMilliseconds();return isNaN(t)?"Invalid Date":MSt(t.getUTCFullYear())+"-"+Wa(t.getUTCMonth()+1,2)+"-"+Wa(t.getUTCDate(),2)+(i?"T"+Wa(e,2)+":"+Wa(n,2)+":"+Wa(r,2)+"."+Wa(i,3)+"Z":r?"T"+Wa(e,2)+":"+Wa(n,2)+":"+Wa(r,2)+"Z":n||e?"T"+Wa(e,2)+":"+Wa(n,2)+"Z":"")}function DSt(t){var e=new RegExp('["'+t+` +\r]`),n=t.charCodeAt(0);function r(f,d){var h,p,g=i(f,function(m,v){if(h)return h(m,v-1);p=m,h=d?PSt(m,d):DIe(m)});return g.columns=p||[],g}function i(f,d){var h=[],p=f.length,g=0,m=0,v,y=p<=0,x=!1;f.charCodeAt(p-1)===BE&&--p,f.charCodeAt(p-1)===LW&&--p;function b(){if(y)return DW;if(x)return x=!1,Cpe;var _,S=g,O;if(f.charCodeAt(S)===IW){for(;g++=p?y=!0:(O=f.charCodeAt(g++))===BE?x=!0:O===LW&&(x=!0,f.charCodeAt(g)===BE&&++g),f.slice(S+1,_-1).replace(/""/g,'"')}for(;g1)r=TSt(t,e,n);else for(i=0,r=new Array(o=t.arcs.length);ie?1:t>=e?0:NaN}function kSt(t,e){return t==null||e==null?NaN:et?1:e>=t?0:NaN}function xO(t){let e,n,r;t.length!==2?(e=gh,n=(a,l)=>gh(t(a),l),r=(a,l)=>t(a)-l):(e=t===gh||t===kSt?t:ASt,n=t,r=t);function i(a,l,c=0,u=a.length){if(c>>1;n(a[f],l)<0?c=f+1:u=f}while(c>>1;n(a[f],l)<=0?c=f+1:u=f}while(cc&&r(a[f-1],l)>-r(a[f],l)?f-1:f}return{left:i,center:s,right:o}}function ASt(){return 0}function hIe(t){return t===null?NaN:+t}function*PSt(t,e){if(e===void 0)for(let n of t)n!=null&&(n=+n)>=n&&(yield n);else{let n=-1;for(let r of t)(r=e(r,++n,t))!=null&&(r=+r)>=r&&(yield r)}}const pIe=xO(gh),Ig=pIe.right,MSt=pIe.left;xO(hIe).center;function RSt(t,e){let n=0,r,i=0,o=0;if(e===void 0)for(let s of t)s!=null&&(s=+s)>=s&&(r=s-i,i+=r/++n,o+=r*(s-i));else{let s=-1;for(let a of t)(a=e(a,++s,t))!=null&&(a=+a)>=a&&(r=a-i,i+=r/++n,o+=r*(a-i))}if(n>1)return o/(n-1)}function DSt(t,e){const n=RSt(t,e);return n&&Math.sqrt(n)}class Ea{constructor(){this._partials=new Float64Array(32),this._n=0}add(e){const n=this._partials;let r=0;for(let i=0;i0){for(s=e[--n];n>0&&(r=s,i=e[--n],s=r+i,o=i-(s-r),!o););n>0&&(o<0&&e[n-1]<0||o>0&&e[n-1]>0)&&(i=o*2,r=s+i,i==r-s&&(s=r))}return s}}class upe extends Map{constructor(e,n=vIe){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:n}}),e!=null)for(const[r,i]of e)this.set(r,i)}get(e){return super.get(zq(this,e))}has(e){return super.has(zq(this,e))}set(e,n){return super.set(gIe(this,e),n)}delete(e){return super.delete(mIe(this,e))}}class vN extends Set{constructor(e,n=vIe){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:n}}),e!=null)for(const r of e)this.add(r)}has(e){return super.has(zq(this,e))}add(e){return super.add(gIe(this,e))}delete(e){return super.delete(mIe(this,e))}}function zq({_intern:t,_key:e},n){const r=e(n);return t.has(r)?t.get(r):n}function gIe({_intern:t,_key:e},n){const r=e(n);return t.has(r)?t.get(r):(t.set(r,n),n)}function mIe({_intern:t,_key:e},n){const r=e(n);return t.has(r)&&(n=t.get(r),t.delete(r)),n}function vIe(t){return t!==null&&typeof t=="object"?t.valueOf():t}function ISt(t,e){return Array.from(e,n=>t[n])}function LSt(t=gh){if(t===gh)return yIe;if(typeof t!="function")throw new TypeError("compare is not a function");return(e,n)=>{const r=t(e,n);return r||r===0?r:(t(n,n)===0)-(t(e,e)===0)}}function yIe(t,e){return(t==null||!(t>=t))-(e==null||!(e>=e))||(te?1:0)}const $St=Math.sqrt(50),FSt=Math.sqrt(10),NSt=Math.sqrt(2);function yN(t,e,n){const r=(e-t)/Math.max(0,n),i=Math.floor(Math.log10(r)),o=r/Math.pow(10,i),s=o>=$St?10:o>=FSt?5:o>=NSt?2:1;let a,l,c;return i<0?(c=Math.pow(10,-i)/s,a=Math.round(t*c),l=Math.round(e*c),a/ce&&--l,c=-c):(c=Math.pow(10,i)*s,a=Math.round(t/c),l=Math.round(e/c),a*ce&&--l),l0))return[];if(t===e)return[t];const r=e=i))return[];const a=o-i+1,l=new Array(a);if(r)if(s<0)for(let c=0;c=r)&&(n=r);else{let r=-1;for(let i of t)(i=e(i,++r,t))!=null&&(n=i)&&(n=i)}return n}function Uq(t,e){let n;if(e===void 0)for(const r of t)r!=null&&(n>r||n===void 0&&r>=r)&&(n=r);else{let r=-1;for(let i of t)(i=e(i,++r,t))!=null&&(n>i||n===void 0&&i>=i)&&(n=i)}return n}function xIe(t,e,n=0,r=1/0,i){if(e=Math.floor(e),n=Math.floor(Math.max(0,n)),r=Math.floor(Math.min(t.length-1,r)),!(n<=e&&e<=r))return t;for(i=i===void 0?yIe:LSt(i);r>n;){if(r-n>600){const l=r-n+1,c=e-n+1,u=Math.log(l),f=.5*Math.exp(2*u/3),d=.5*Math.sqrt(u*f*(l-f)/l)*(c-l/2<0?-1:1),h=Math.max(n,Math.floor(e-c*f/l+d)),p=Math.min(r,Math.floor(e+(l-c)*f/l+d));xIe(t,e,h,p,i)}const o=t[e];let s=n,a=r;for(WE(t,n,e),i(t[r],o)>0&&WE(t,n,r);s0;)--a}i(t[n],o)===0?WE(t,n,a):(++a,WE(t,a,r)),a<=e&&(n=a+1),e<=a&&(r=a-1)}return t}function WE(t,e,n){const r=t[e];t[e]=t[n],t[n]=r}function xN(t,e,n){if(t=Float64Array.from(PSt(t,n)),!(!(r=t.length)||isNaN(e=+e))){if(e<=0||r<2)return Uq(t);if(e>=1)return $x(t);var r,i=(r-1)*e,o=Math.floor(i),s=$x(xIe(t,o).subarray(0,o+1)),a=Uq(t.subarray(o+1));return s+(a-s)*(i-o)}}function bIe(t,e,n=hIe){if(!(!(r=t.length)||isNaN(e=+e))){if(e<=0||r<2)return+n(t[0],0,t);if(e>=1)return+n(t[r-1],r-1,t);var r,i=(r-1)*e,o=Math.floor(i),s=+n(t[o],o,t),a=+n(t[o+1],o+1,t);return s+(a-s)*(i-o)}}function zSt(t,e){let n=0,r=0;if(e===void 0)for(let i of t)i!=null&&(i=+i)>=i&&(++n,r+=i);else{let i=-1;for(let o of t)(o=e(o,++i,t))!=null&&(o=+o)>=o&&(++n,r+=o)}if(n)return r/n}function wIe(t,e){return xN(t,.5,e)}function*jSt(t){for(const e of t)yield*e}function _Ie(t){return Array.from(jSt(t))}function al(t,e,n){t=+t,e=+e,n=(i=arguments.length)<2?(e=t,t=0,1):i<3?1:+n;for(var r=-1,i=Math.max(0,Math.ceil((e-t)/n))|0,o=new Array(i);++r=1e21?t.toLocaleString("en").replace(/,/g,""):t.toString(10)}function bN(t,e){if((n=(t=e?t.toExponential(e-1):t.toExponential()).indexOf("e"))<0)return null;var n,r=t.slice(0,n);return[r.length>1?r[0]+r.slice(2):r,+t.slice(n+1)]}function AS(t){return t=bN(Math.abs(t)),t?t[1]:NaN}function GSt(t,e){return function(n,r){for(var i=n.length,o=[],s=0,a=t[0],l=0;i>0&&a>0&&(l+a+1>r&&(a=Math.max(1,r-l)),o.push(n.substring(i-=a,i+a)),!((l+=a+1)>r));)a=t[s=(s+1)%t.length];return o.reverse().join(e)}}function HSt(t){return function(e){return e.replace(/[0-9]/g,function(n){return t[+n]})}}var qSt=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function c1(t){if(!(e=qSt.exec(t)))throw new Error("invalid format: "+t);var e;return new one({fill:e[1],align:e[2],sign:e[3],symbol:e[4],zero:e[5],width:e[6],comma:e[7],precision:e[8]&&e[8].slice(1),trim:e[9],type:e[10]})}c1.prototype=one.prototype;function one(t){this.fill=t.fill===void 0?" ":t.fill+"",this.align=t.align===void 0?">":t.align+"",this.sign=t.sign===void 0?"-":t.sign+"",this.symbol=t.symbol===void 0?"":t.symbol+"",this.zero=!!t.zero,this.width=t.width===void 0?void 0:+t.width,this.comma=!!t.comma,this.precision=t.precision===void 0?void 0:+t.precision,this.trim=!!t.trim,this.type=t.type===void 0?"":t.type+""}one.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(this.width===void 0?"":Math.max(1,this.width|0))+(this.comma?",":"")+(this.precision===void 0?"":"."+Math.max(0,this.precision|0))+(this.trim?"~":"")+this.type};function XSt(t){e:for(var e=t.length,n=1,r=-1,i;n0&&(r=0);break}return r>0?t.slice(0,r)+t.slice(i+1):t}var CIe;function YSt(t,e){var n=bN(t,e);if(!n)return t+"";var r=n[0],i=n[1],o=i-(CIe=Math.max(-8,Math.min(8,Math.floor(i/3)))*3)+1,s=r.length;return o===s?r:o>s?r+new Array(o-s+1).join("0"):o>0?r.slice(0,o)+"."+r.slice(o):"0."+new Array(1-o).join("0")+bN(t,Math.max(0,e+o-1))[0]}function fpe(t,e){var n=bN(t,e);if(!n)return t+"";var r=n[0],i=n[1];return i<0?"0."+new Array(-i).join("0")+r:r.length>i+1?r.slice(0,i+1)+"."+r.slice(i+1):r+new Array(i-r.length+2).join("0")}const dpe={"%":(t,e)=>(t*100).toFixed(e),b:t=>Math.round(t).toString(2),c:t=>t+"",d:VSt,e:(t,e)=>t.toExponential(e),f:(t,e)=>t.toFixed(e),g:(t,e)=>t.toPrecision(e),o:t=>Math.round(t).toString(8),p:(t,e)=>fpe(t*100,e),r:fpe,s:YSt,X:t=>Math.round(t).toString(16).toUpperCase(),x:t=>Math.round(t).toString(16)};function hpe(t){return t}var ppe=Array.prototype.map,gpe=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function OIe(t){var e=t.grouping===void 0||t.thousands===void 0?hpe:GSt(ppe.call(t.grouping,Number),t.thousands+""),n=t.currency===void 0?"":t.currency[0]+"",r=t.currency===void 0?"":t.currency[1]+"",i=t.decimal===void 0?".":t.decimal+"",o=t.numerals===void 0?hpe:HSt(ppe.call(t.numerals,String)),s=t.percent===void 0?"%":t.percent+"",a=t.minus===void 0?"−":t.minus+"",l=t.nan===void 0?"NaN":t.nan+"";function c(f){f=c1(f);var d=f.fill,h=f.align,p=f.sign,g=f.symbol,m=f.zero,v=f.width,y=f.comma,x=f.precision,b=f.trim,w=f.type;w==="n"?(y=!0,w="g"):dpe[w]||(x===void 0&&(x=12),b=!0,w="g"),(m||d==="0"&&h==="=")&&(m=!0,d="0",h="=");var _=g==="$"?n:g==="#"&&/[boxX]/.test(w)?"0"+w.toLowerCase():"",S=g==="$"?r:/[%p]/.test(w)?s:"",O=dpe[w],k=/[defgprs%]/.test(w);x=x===void 0?6:/[gprs]/.test(w)?Math.max(1,Math.min(21,x)):Math.max(0,Math.min(20,x));function E(M){var A=_,P=S,T,R,I;if(w==="c")P=O(M)+P,M="";else{M=+M;var B=M<0||1/M<0;if(M=isNaN(M)?l:O(Math.abs(M),x),b&&(M=XSt(M)),B&&+M==0&&p!=="+"&&(B=!1),A=(B?p==="("?p:a:p==="-"||p==="("?"":p)+A,P=(w==="s"?gpe[8+CIe/3]:"")+P+(B&&p==="("?")":""),k){for(T=-1,R=M.length;++TI||I>57){P=(I===46?i+M.slice(T+1):M.slice(T))+P,M=M.slice(0,T);break}}}y&&!m&&(M=e(M,1/0));var $=A.length+M.length+P.length,z=$>1)+A+M+P+z.slice($);break;default:M=z+A+M+P;break}return o(M)}return E.toString=function(){return f+""},E}function u(f,d){var h=c((f=c1(f),f.type="f",f)),p=Math.max(-8,Math.min(8,Math.floor(AS(d)/3)))*3,g=Math.pow(10,-p),m=gpe[8+p/3];return function(v){return h(g*v)+m}}return{format:c,formatPrefix:u}}var kI,Y4,sne;QSt({thousands:",",grouping:[3],currency:["$",""]});function QSt(t){return kI=OIe(t),Y4=kI.format,sne=kI.formatPrefix,kI}function EIe(t){return Math.max(0,-AS(Math.abs(t)))}function TIe(t,e){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(AS(e)/3)))*3-AS(Math.abs(t)))}function kIe(t,e){return t=Math.abs(t),e=Math.abs(e)-t,Math.max(0,AS(e)-AS(t))+1}const $W=new Date,FW=new Date;function Eo(t,e,n,r){function i(o){return t(o=arguments.length===0?new Date:new Date(+o)),o}return i.floor=o=>(t(o=new Date(+o)),o),i.ceil=o=>(t(o=new Date(o-1)),e(o,1),t(o),o),i.round=o=>{const s=i(o),a=i.ceil(o);return o-s(e(o=new Date(+o),s==null?1:Math.floor(s)),o),i.range=(o,s,a)=>{const l=[];if(o=i.ceil(o),a=a==null?1:Math.floor(a),!(o0))return l;let c;do l.push(c=new Date(+o)),e(o,a),t(o);while(cEo(s=>{if(s>=s)for(;t(s),!o(s);)s.setTime(s-1)},(s,a)=>{if(s>=s)if(a<0)for(;++a<=0;)for(;e(s,-1),!o(s););else for(;--a>=0;)for(;e(s,1),!o(s););}),n&&(i.count=(o,s)=>($W.setTime(+o),FW.setTime(+s),t($W),t(FW),Math.floor(n($W,FW))),i.every=o=>(o=Math.floor(o),!isFinite(o)||!(o>0)?null:o>1?i.filter(r?s=>r(s)%o===0:s=>i.count(0,s)%o===0):i)),i}const PS=Eo(()=>{},(t,e)=>{t.setTime(+t+e)},(t,e)=>e-t);PS.every=t=>(t=Math.floor(t),!isFinite(t)||!(t>0)?null:t>1?Eo(e=>{e.setTime(Math.floor(e/t)*t)},(e,n)=>{e.setTime(+e+n*t)},(e,n)=>(n-e)/t):PS);PS.range;const qp=1e3,iu=qp*60,Xp=iu*60,Lg=Xp*24,ane=Lg*7,mpe=Lg*30,NW=Lg*365,Yp=Eo(t=>{t.setTime(t-t.getMilliseconds())},(t,e)=>{t.setTime(+t+e*qp)},(t,e)=>(e-t)/qp,t=>t.getUTCSeconds());Yp.range;const Q4=Eo(t=>{t.setTime(t-t.getMilliseconds()-t.getSeconds()*qp)},(t,e)=>{t.setTime(+t+e*iu)},(t,e)=>(e-t)/iu,t=>t.getMinutes());Q4.range;const K4=Eo(t=>{t.setUTCSeconds(0,0)},(t,e)=>{t.setTime(+t+e*iu)},(t,e)=>(e-t)/iu,t=>t.getUTCMinutes());K4.range;const Z4=Eo(t=>{t.setTime(t-t.getMilliseconds()-t.getSeconds()*qp-t.getMinutes()*iu)},(t,e)=>{t.setTime(+t+e*Xp)},(t,e)=>(e-t)/Xp,t=>t.getHours());Z4.range;const J4=Eo(t=>{t.setUTCMinutes(0,0,0)},(t,e)=>{t.setTime(+t+e*Xp)},(t,e)=>(e-t)/Xp,t=>t.getUTCHours());J4.range;const sg=Eo(t=>t.setHours(0,0,0,0),(t,e)=>t.setDate(t.getDate()+e),(t,e)=>(e-t-(e.getTimezoneOffset()-t.getTimezoneOffset())*iu)/Lg,t=>t.getDate()-1);sg.range;const zv=Eo(t=>{t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCDate(t.getUTCDate()+e)},(t,e)=>(e-t)/Lg,t=>t.getUTCDate()-1);zv.range;const AIe=Eo(t=>{t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCDate(t.getUTCDate()+e)},(t,e)=>(e-t)/Lg,t=>Math.floor(t/Lg));AIe.range;function ob(t){return Eo(e=>{e.setDate(e.getDate()-(e.getDay()+7-t)%7),e.setHours(0,0,0,0)},(e,n)=>{e.setDate(e.getDate()+n*7)},(e,n)=>(n-e-(n.getTimezoneOffset()-e.getTimezoneOffset())*iu)/ane)}const bO=ob(0),wN=ob(1),KSt=ob(2),ZSt=ob(3),MS=ob(4),JSt=ob(5),eCt=ob(6);bO.range;wN.range;KSt.range;ZSt.range;MS.range;JSt.range;eCt.range;function sb(t){return Eo(e=>{e.setUTCDate(e.getUTCDate()-(e.getUTCDay()+7-t)%7),e.setUTCHours(0,0,0,0)},(e,n)=>{e.setUTCDate(e.getUTCDate()+n*7)},(e,n)=>(n-e)/ane)}const wO=sb(0),_N=sb(1),tCt=sb(2),nCt=sb(3),RS=sb(4),rCt=sb(5),iCt=sb(6);wO.range;_N.range;tCt.range;nCt.range;RS.range;rCt.range;iCt.range;const _A=Eo(t=>{t.setDate(1),t.setHours(0,0,0,0)},(t,e)=>{t.setMonth(t.getMonth()+e)},(t,e)=>e.getMonth()-t.getMonth()+(e.getFullYear()-t.getFullYear())*12,t=>t.getMonth());_A.range;const SA=Eo(t=>{t.setUTCDate(1),t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCMonth(t.getUTCMonth()+e)},(t,e)=>e.getUTCMonth()-t.getUTCMonth()+(e.getUTCFullYear()-t.getUTCFullYear())*12,t=>t.getUTCMonth());SA.range;const Th=Eo(t=>{t.setMonth(0,1),t.setHours(0,0,0,0)},(t,e)=>{t.setFullYear(t.getFullYear()+e)},(t,e)=>e.getFullYear()-t.getFullYear(),t=>t.getFullYear());Th.every=t=>!isFinite(t=Math.floor(t))||!(t>0)?null:Eo(e=>{e.setFullYear(Math.floor(e.getFullYear()/t)*t),e.setMonth(0,1),e.setHours(0,0,0,0)},(e,n)=>{e.setFullYear(e.getFullYear()+n*t)});Th.range;const kh=Eo(t=>{t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCFullYear(t.getUTCFullYear()+e)},(t,e)=>e.getUTCFullYear()-t.getUTCFullYear(),t=>t.getUTCFullYear());kh.every=t=>!isFinite(t=Math.floor(t))||!(t>0)?null:Eo(e=>{e.setUTCFullYear(Math.floor(e.getUTCFullYear()/t)*t),e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},(e,n)=>{e.setUTCFullYear(e.getUTCFullYear()+n*t)});kh.range;function PIe(t,e,n,r,i,o){const s=[[Yp,1,qp],[Yp,5,5*qp],[Yp,15,15*qp],[Yp,30,30*qp],[o,1,iu],[o,5,5*iu],[o,15,15*iu],[o,30,30*iu],[i,1,Xp],[i,3,3*Xp],[i,6,6*Xp],[i,12,12*Xp],[r,1,Lg],[r,2,2*Lg],[n,1,ane],[e,1,mpe],[e,3,3*mpe],[t,1,NW]];function a(c,u,f){const d=um).right(s,d);if(h===s.length)return t.every(ry(c/NW,u/NW,f));if(h===0)return PS.every(Math.max(ry(c,u,f),1));const[p,g]=s[d/s[h-1][2](t[e]=1+n,t),{});function cne(t){const e=pt(t).slice(),n={};return e.length||je("Missing time unit."),e.forEach(i=>{vt(zW,i)?n[i]=1:je(`Invalid time unit: ${i}.`)}),(n[_o]||n[qs]?1:0)+(n[_l]||n[Zs]||n[Sl]?1:0)+(n[Ah]?1:0)>1&&je(`Incompatible time units: ${t}`),e.sort((i,o)=>zW[i]-zW[o]),e}const cCt={[xs]:"%Y ",[_l]:"Q%q ",[Zs]:"%b ",[Sl]:"%d ",[_o]:"W%U ",[qs]:"%a ",[Ah]:"%j ",[Oc]:"%H:00",[Ec]:"00:%M",[ku]:":%S",[Vf]:".%L",[`${xs}-${Zs}`]:"%Y-%m ",[`${xs}-${Zs}-${Sl}`]:"%Y-%m-%d ",[`${Oc}-${Ec}`]:"%H:%M"};function MIe(t,e){const n=cn({},cCt,e),r=cne(t),i=r.length;let o="",s=0,a,l;for(s=0;ss;--a)if(l=r.slice(s,a).join("-"),n[l]!=null){o+=n[l],s=a;break}return o.trim()}const Y0=new Date;function une(t){return Y0.setFullYear(t),Y0.setMonth(0),Y0.setDate(1),Y0.setHours(0,0,0,0),Y0}function RIe(t){return IIe(new Date(t))}function DIe(t){return Wq(new Date(t))}function IIe(t){return sg.count(une(t.getFullYear())-1,t)}function Wq(t){return bO.count(une(t.getFullYear())-1,t)}function Vq(t){return une(t).getDay()}function uCt(t,e,n,r,i,o,s){if(0<=t&&t<100){const a=new Date(-1,e,n,r,i,o,s);return a.setFullYear(t),a}return new Date(t,e,n,r,i,o,s)}function LIe(t){return FIe(new Date(t))}function $Ie(t){return Gq(new Date(t))}function FIe(t){const e=Date.UTC(t.getUTCFullYear(),0,1);return zv.count(e-1,t)}function Gq(t){const e=Date.UTC(t.getUTCFullYear(),0,1);return wO.count(e-1,t)}function Hq(t){return Y0.setTime(Date.UTC(t,0,1)),Y0.getUTCDay()}function fCt(t,e,n,r,i,o,s){if(0<=t&&t<100){const a=new Date(Date.UTC(-1,e,n,r,i,o,s));return a.setUTCFullYear(n.y),a}return new Date(Date.UTC(t,e,n,r,i,o,s))}function NIe(t,e,n,r,i){const o=e||1,s=$n(t),a=(v,y,x)=>(x=x||v,dCt(n[x],r[x],v===s&&o,y)),l=new Date,c=Wf(t),u=c[xs]?a(xs):ra(2012),f=c[Zs]?a(Zs):c[_l]?a(_l):rv,d=c[_o]&&c[qs]?a(qs,1,_o+qs):c[_o]?a(_o,1):c[qs]?a(qs,1):c[Sl]?a(Sl,1):c[Ah]?a(Ah,1):gO,h=c[Oc]?a(Oc):rv,p=c[Ec]?a(Ec):rv,g=c[ku]?a(ku):rv,m=c[Vf]?a(Vf):rv;return function(v){l.setTime(+v);const y=u(l);return i(y,f(l),d(l,y),h(l),p(l),g(l),m(l))}}function dCt(t,e,n,r){const i=n<=1?t:r?(o,s)=>r+n*Math.floor((t(o,s)-r)/n):(o,s)=>n*Math.floor(t(o,s)/n);return e?(o,s)=>e(i(o,s),s):i}function DS(t,e,n){return e+t*7-(n+6)%7}const hCt={[xs]:t=>t.getFullYear(),[_l]:t=>Math.floor(t.getMonth()/3),[Zs]:t=>t.getMonth(),[Sl]:t=>t.getDate(),[Oc]:t=>t.getHours(),[Ec]:t=>t.getMinutes(),[ku]:t=>t.getSeconds(),[Vf]:t=>t.getMilliseconds(),[Ah]:t=>IIe(t),[_o]:t=>Wq(t),[_o+qs]:(t,e)=>DS(Wq(t),t.getDay(),Vq(e)),[qs]:(t,e)=>DS(1,t.getDay(),Vq(e))},pCt={[_l]:t=>3*t,[_o]:(t,e)=>DS(t,0,Vq(e))};function zIe(t,e){return NIe(t,e||1,hCt,pCt,uCt)}const gCt={[xs]:t=>t.getUTCFullYear(),[_l]:t=>Math.floor(t.getUTCMonth()/3),[Zs]:t=>t.getUTCMonth(),[Sl]:t=>t.getUTCDate(),[Oc]:t=>t.getUTCHours(),[Ec]:t=>t.getUTCMinutes(),[ku]:t=>t.getUTCSeconds(),[Vf]:t=>t.getUTCMilliseconds(),[Ah]:t=>FIe(t),[_o]:t=>Gq(t),[qs]:(t,e)=>DS(1,t.getUTCDay(),Hq(e)),[_o+qs]:(t,e)=>DS(Gq(t),t.getUTCDay(),Hq(e))},mCt={[_l]:t=>3*t,[_o]:(t,e)=>DS(t,0,Hq(e))};function jIe(t,e){return NIe(t,e||1,gCt,mCt,fCt)}const vCt={[xs]:Th,[_l]:_A.every(3),[Zs]:_A,[_o]:bO,[Sl]:sg,[qs]:sg,[Ah]:sg,[Oc]:Z4,[Ec]:Q4,[ku]:Yp,[Vf]:PS},yCt={[xs]:kh,[_l]:SA.every(3),[Zs]:SA,[_o]:wO,[Sl]:zv,[qs]:zv,[Ah]:zv,[Oc]:J4,[Ec]:K4,[ku]:Yp,[Vf]:PS};function _O(t){return vCt[t]}function SO(t){return yCt[t]}function BIe(t,e,n){return t?t.offset(e,n):void 0}function UIe(t,e,n){return BIe(_O(t),e,n)}function WIe(t,e,n){return BIe(SO(t),e,n)}function VIe(t,e,n,r){return t?t.range(e,n,r):void 0}function GIe(t,e,n,r){return VIe(_O(t),e,n,r)}function HIe(t,e,n,r){return VIe(SO(t),e,n,r)}const tT=1e3,nT=tT*60,rT=nT*60,eB=rT*24,xCt=eB*7,vpe=eB*30,qq=eB*365,qIe=[xs,Zs,Sl,Oc,Ec,ku,Vf],iT=qIe.slice(0,-1),oT=iT.slice(0,-1),sT=oT.slice(0,-1),bCt=sT.slice(0,-1),wCt=[xs,_o],ype=[xs,Zs],XIe=[xs],VE=[[iT,1,tT],[iT,5,5*tT],[iT,15,15*tT],[iT,30,30*tT],[oT,1,nT],[oT,5,5*nT],[oT,15,15*nT],[oT,30,30*nT],[sT,1,rT],[sT,3,3*rT],[sT,6,6*rT],[sT,12,12*rT],[bCt,1,eB],[wCt,1,xCt],[ype,1,vpe],[ype,3,3*vpe],[XIe,1,qq]];function YIe(t){const e=t.extent,n=t.maxbins||40,r=Math.abs(nR(e))/n;let i=xO(a=>a[2]).right(VE,r),o,s;return i===VE.length?(o=XIe,s=ry(e[0]/qq,e[1]/qq,n)):i?(i=VE[r/VE[i-1][2]53)return null;"w"in te||(te.w=1),"Z"in te?(U=BW(GE(te.y,0,1)),oe=U.getUTCDay(),U=oe>4||oe===0?_N.ceil(U):_N(U),U=zv.offset(U,(te.V-1)*7),te.y=U.getUTCFullYear(),te.m=U.getUTCMonth(),te.d=U.getUTCDate()+(te.w+6)%7):(U=jW(GE(te.y,0,1)),oe=U.getDay(),U=oe>4||oe===0?wN.ceil(U):wN(U),U=sg.offset(U,(te.V-1)*7),te.y=U.getFullYear(),te.m=U.getMonth(),te.d=U.getDate()+(te.w+6)%7)}else("W"in te||"U"in te)&&("w"in te||(te.w="u"in te?te.u%7:"W"in te?1:0),oe="Z"in te?BW(GE(te.y,0,1)).getUTCDay():jW(GE(te.y,0,1)).getDay(),te.m=0,te.d="W"in te?(te.w+6)%7+te.W*7-(oe+5)%7:te.w+te.U*7-(oe+6)%7);return"Z"in te?(te.H+=te.Z/100|0,te.M+=te.Z%100,BW(te)):jW(te)}}function O(ee,re,me,te){for(var ae=0,U=re.length,oe=me.length,ne,V;ae=oe)return-1;if(ne=re.charCodeAt(ae++),ne===37){if(ne=re.charAt(ae++),V=w[ne in xpe?re.charAt(ae++):ne],!V||(te=V(ee,me,te))<0)return-1}else if(ne!=me.charCodeAt(te++))return-1}return te}function k(ee,re,me){var te=c.exec(re.slice(me));return te?(ee.p=u.get(te[0].toLowerCase()),me+te[0].length):-1}function E(ee,re,me){var te=h.exec(re.slice(me));return te?(ee.w=p.get(te[0].toLowerCase()),me+te[0].length):-1}function M(ee,re,me){var te=f.exec(re.slice(me));return te?(ee.w=d.get(te[0].toLowerCase()),me+te[0].length):-1}function A(ee,re,me){var te=v.exec(re.slice(me));return te?(ee.m=y.get(te[0].toLowerCase()),me+te[0].length):-1}function P(ee,re,me){var te=g.exec(re.slice(me));return te?(ee.m=m.get(te[0].toLowerCase()),me+te[0].length):-1}function T(ee,re,me){return O(ee,e,re,me)}function R(ee,re,me){return O(ee,n,re,me)}function I(ee,re,me){return O(ee,r,re,me)}function B(ee){return s[ee.getDay()]}function $(ee){return o[ee.getDay()]}function z(ee){return l[ee.getMonth()]}function L(ee){return a[ee.getMonth()]}function j(ee){return i[+(ee.getHours()>=12)]}function N(ee){return 1+~~(ee.getMonth()/3)}function F(ee){return s[ee.getUTCDay()]}function H(ee){return o[ee.getUTCDay()]}function q(ee){return l[ee.getUTCMonth()]}function Y(ee){return a[ee.getUTCMonth()]}function le(ee){return i[+(ee.getUTCHours()>=12)]}function K(ee){return 1+~~(ee.getUTCMonth()/3)}return{format:function(ee){var re=_(ee+="",x);return re.toString=function(){return ee},re},parse:function(ee){var re=S(ee+="",!1);return re.toString=function(){return ee},re},utcFormat:function(ee){var re=_(ee+="",b);return re.toString=function(){return ee},re},utcParse:function(ee){var re=S(ee+="",!0);return re.toString=function(){return ee},re}}}var xpe={"-":"",_:" ",0:"0"},Xo=/^\s*\d+/,_Ct=/^%/,SCt=/[\\^$*+?|[\]().{}]/g;function er(t,e,n){var r=t<0?"-":"",i=(r?-t:t)+"",o=i.length;return r+(o[e.toLowerCase(),n]))}function OCt(t,e,n){var r=Xo.exec(e.slice(n,n+1));return r?(t.w=+r[0],n+r[0].length):-1}function ECt(t,e,n){var r=Xo.exec(e.slice(n,n+1));return r?(t.u=+r[0],n+r[0].length):-1}function TCt(t,e,n){var r=Xo.exec(e.slice(n,n+2));return r?(t.U=+r[0],n+r[0].length):-1}function kCt(t,e,n){var r=Xo.exec(e.slice(n,n+2));return r?(t.V=+r[0],n+r[0].length):-1}function ACt(t,e,n){var r=Xo.exec(e.slice(n,n+2));return r?(t.W=+r[0],n+r[0].length):-1}function bpe(t,e,n){var r=Xo.exec(e.slice(n,n+4));return r?(t.y=+r[0],n+r[0].length):-1}function wpe(t,e,n){var r=Xo.exec(e.slice(n,n+2));return r?(t.y=+r[0]+(+r[0]>68?1900:2e3),n+r[0].length):-1}function PCt(t,e,n){var r=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(e.slice(n,n+6));return r?(t.Z=r[1]?0:-(r[2]+(r[3]||"00")),n+r[0].length):-1}function MCt(t,e,n){var r=Xo.exec(e.slice(n,n+1));return r?(t.q=r[0]*3-3,n+r[0].length):-1}function RCt(t,e,n){var r=Xo.exec(e.slice(n,n+2));return r?(t.m=r[0]-1,n+r[0].length):-1}function _pe(t,e,n){var r=Xo.exec(e.slice(n,n+2));return r?(t.d=+r[0],n+r[0].length):-1}function DCt(t,e,n){var r=Xo.exec(e.slice(n,n+3));return r?(t.m=0,t.d=+r[0],n+r[0].length):-1}function Spe(t,e,n){var r=Xo.exec(e.slice(n,n+2));return r?(t.H=+r[0],n+r[0].length):-1}function ICt(t,e,n){var r=Xo.exec(e.slice(n,n+2));return r?(t.M=+r[0],n+r[0].length):-1}function LCt(t,e,n){var r=Xo.exec(e.slice(n,n+2));return r?(t.S=+r[0],n+r[0].length):-1}function $Ct(t,e,n){var r=Xo.exec(e.slice(n,n+3));return r?(t.L=+r[0],n+r[0].length):-1}function FCt(t,e,n){var r=Xo.exec(e.slice(n,n+6));return r?(t.L=Math.floor(r[0]/1e3),n+r[0].length):-1}function NCt(t,e,n){var r=_Ct.exec(e.slice(n,n+1));return r?n+r[0].length:-1}function zCt(t,e,n){var r=Xo.exec(e.slice(n));return r?(t.Q=+r[0],n+r[0].length):-1}function jCt(t,e,n){var r=Xo.exec(e.slice(n));return r?(t.s=+r[0],n+r[0].length):-1}function Cpe(t,e){return er(t.getDate(),e,2)}function BCt(t,e){return er(t.getHours(),e,2)}function UCt(t,e){return er(t.getHours()%12||12,e,2)}function WCt(t,e){return er(1+sg.count(Th(t),t),e,3)}function KIe(t,e){return er(t.getMilliseconds(),e,3)}function VCt(t,e){return KIe(t,e)+"000"}function GCt(t,e){return er(t.getMonth()+1,e,2)}function HCt(t,e){return er(t.getMinutes(),e,2)}function qCt(t,e){return er(t.getSeconds(),e,2)}function XCt(t){var e=t.getDay();return e===0?7:e}function YCt(t,e){return er(bO.count(Th(t)-1,t),e,2)}function ZIe(t){var e=t.getDay();return e>=4||e===0?MS(t):MS.ceil(t)}function QCt(t,e){return t=ZIe(t),er(MS.count(Th(t),t)+(Th(t).getDay()===4),e,2)}function KCt(t){return t.getDay()}function ZCt(t,e){return er(wN.count(Th(t)-1,t),e,2)}function JCt(t,e){return er(t.getFullYear()%100,e,2)}function eOt(t,e){return t=ZIe(t),er(t.getFullYear()%100,e,2)}function tOt(t,e){return er(t.getFullYear()%1e4,e,4)}function nOt(t,e){var n=t.getDay();return t=n>=4||n===0?MS(t):MS.ceil(t),er(t.getFullYear()%1e4,e,4)}function rOt(t){var e=t.getTimezoneOffset();return(e>0?"-":(e*=-1,"+"))+er(e/60|0,"0",2)+er(e%60,"0",2)}function Ope(t,e){return er(t.getUTCDate(),e,2)}function iOt(t,e){return er(t.getUTCHours(),e,2)}function oOt(t,e){return er(t.getUTCHours()%12||12,e,2)}function sOt(t,e){return er(1+zv.count(kh(t),t),e,3)}function JIe(t,e){return er(t.getUTCMilliseconds(),e,3)}function aOt(t,e){return JIe(t,e)+"000"}function lOt(t,e){return er(t.getUTCMonth()+1,e,2)}function cOt(t,e){return er(t.getUTCMinutes(),e,2)}function uOt(t,e){return er(t.getUTCSeconds(),e,2)}function fOt(t){var e=t.getUTCDay();return e===0?7:e}function dOt(t,e){return er(wO.count(kh(t)-1,t),e,2)}function eLe(t){var e=t.getUTCDay();return e>=4||e===0?RS(t):RS.ceil(t)}function hOt(t,e){return t=eLe(t),er(RS.count(kh(t),t)+(kh(t).getUTCDay()===4),e,2)}function pOt(t){return t.getUTCDay()}function gOt(t,e){return er(_N.count(kh(t)-1,t),e,2)}function mOt(t,e){return er(t.getUTCFullYear()%100,e,2)}function vOt(t,e){return t=eLe(t),er(t.getUTCFullYear()%100,e,2)}function yOt(t,e){return er(t.getUTCFullYear()%1e4,e,4)}function xOt(t,e){var n=t.getUTCDay();return t=n>=4||n===0?RS(t):RS.ceil(t),er(t.getUTCFullYear()%1e4,e,4)}function bOt(){return"+0000"}function Epe(){return"%"}function Tpe(t){return+t}function kpe(t){return Math.floor(+t/1e3)}var Hb,fne,tLe,dne,nLe;wOt({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});function wOt(t){return Hb=QIe(t),fne=Hb.format,tLe=Hb.parse,dne=Hb.utcFormat,nLe=Hb.utcParse,Hb}function aT(t){const e={};return n=>e[n]||(e[n]=t(n))}function _Ot(t,e){return n=>{const r=t(n),i=r.indexOf(e);if(i<0)return r;let o=SOt(r,i);const s=oi;)if(r[o]!=="0"){++o;break}return r.slice(0,o)+s}}function SOt(t,e){let n=t.lastIndexOf("e"),r;if(n>0)return n;for(n=t.length;--n>e;)if(r=t.charCodeAt(n),r>=48&&r<=57)return n+1}function rLe(t){const e=aT(t.format),n=t.formatPrefix;return{format:e,formatPrefix:n,formatFloat(r){const i=c1(r||",");if(i.precision==null){switch(i.precision=12,i.type){case"%":i.precision-=2;break;case"e":i.precision-=1;break}return _Ot(e(i),e(".1f")(1)[1])}else return e(i)},formatSpan(r,i,o,s){s=c1(s??",f");const a=ry(r,i,o),l=Math.max(Math.abs(r),Math.abs(i));let c;if(s.precision==null)switch(s.type){case"s":return isNaN(c=TIe(a,l))||(s.precision=c),n(s,l);case"":case"e":case"g":case"p":case"r":{isNaN(c=kIe(a,l))||(s.precision=c-(s.type==="e"));break}case"f":case"%":{isNaN(c=EIe(a))||(s.precision=c-(s.type==="%")*2);break}}return e(s)}}}let Xq;iLe();function iLe(){return Xq=rLe({format:Y4,formatPrefix:sne})}function oLe(t){return rLe(OIe(t))}function SN(t){return arguments.length?Xq=oLe(t):Xq}function Ape(t,e,n){n=n||{},ht(n)||je(`Invalid time multi-format specifier: ${n}`);const r=e(ku),i=e(Ec),o=e(Oc),s=e(Sl),a=e(_o),l=e(Zs),c=e(_l),u=e(xs),f=t(n[Vf]||".%L"),d=t(n[ku]||":%S"),h=t(n[Ec]||"%I:%M"),p=t(n[Oc]||"%I %p"),g=t(n[Sl]||n[qs]||"%a %d"),m=t(n[_o]||"%b %d"),v=t(n[Zs]||"%B"),y=t(n[_l]||"%B"),x=t(n[xs]||"%Y");return b=>(r(b)gt(r)?e(r):Ape(e,_O,r),utcFormat:r=>gt(r)?n(r):Ape(n,SO,r),timeParse:aT(t.parse),utcParse:aT(t.utcParse)}}let Yq;aLe();function aLe(){return Yq=sLe({format:fne,parse:tLe,utcFormat:dne,utcParse:nLe})}function lLe(t){return sLe(QIe(t))}function CA(t){return arguments.length?Yq=lLe(t):Yq}const Qq=(t,e)=>cn({},t,e);function cLe(t,e){const n=t?oLe(t):SN(),r=e?lLe(e):CA();return Qq(n,r)}function hne(t,e){const n=arguments.length;return n&&n!==2&&je("defaultLocale expects either zero or two arguments."),n?Qq(SN(t),CA(e)):Qq(SN(),CA())}function COt(){return iLe(),aLe(),hne()}const OOt=/^(data:|([A-Za-z]+:)?\/\/)/,EOt=/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|cid|xmpp|file|data):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i,TOt=/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205f\u3000]/g,Ppe="file://";function kOt(t,e){return n=>({options:n||{},sanitize:POt,load:AOt,fileAccess:!!e,file:MOt(e),http:DOt(t)})}async function AOt(t,e){const n=await this.sanitize(t,e),r=n.href;return n.localFile?this.file(r):this.http(r,e)}async function POt(t,e){e=cn({},this.options,e);const n=this.fileAccess,r={href:null};let i,o,s;const a=EOt.test(t.replace(TOt,""));(t==null||typeof t!="string"||!a)&&je("Sanitize failure, invalid URI: "+rt(t));const l=OOt.test(t);return(s=e.baseURL)&&!l&&(!t.startsWith("/")&&!s.endsWith("/")&&(t="/"+t),t=s+t),o=(i=t.startsWith(Ppe))||e.mode==="file"||e.mode!=="http"&&!l&&n,i?t=t.slice(Ppe.length):t.startsWith("//")&&(e.defaultProtocol==="file"?(t=t.slice(2),o=!0):t=(e.defaultProtocol||"http")+":"+t),Object.defineProperty(r,"localFile",{value:!!o}),r.href=t,e.target&&(r.target=e.target+""),e.rel&&(r.rel=e.rel+""),e.context==="image"&&e.crossOrigin&&(r.crossOrigin=e.crossOrigin+""),r}function MOt(t){return t?e=>new Promise((n,r)=>{t.readFile(e,(i,o)=>{i?r(i):n(o)})}):ROt}async function ROt(){je("No file system access.")}function DOt(t){return t?async function(e,n){const r=cn({},this.options.http,n),i=n&&n.response,o=await t(e,r);return o.ok?fn(o[i])?o[i]():o.text():je(o.status+""+o.statusText)}:IOt}async function IOt(){je("No HTTP fetch method available.")}const LOt=t=>t!=null&&t===t,$Ot=t=>t==="true"||t==="false"||t===!0||t===!1,FOt=t=>!Number.isNaN(Date.parse(t)),uLe=t=>!Number.isNaN(+t)&&!(t instanceof Date),NOt=t=>uLe(t)&&Number.isInteger(+t),Kq={boolean:nne,integer:Ys,number:Ys,date:rne,string:ine,unknown:na},AI=[$Ot,NOt,uLe,FOt],zOt=["boolean","integer","number","date"];function fLe(t,e){if(!t||!t.length)return"unknown";const n=t.length,r=AI.length,i=AI.map((o,s)=>s+1);for(let o=0,s=0,a,l;oo===0?s:o,0)-1]}function dLe(t,e){return e.reduce((n,r)=>(n[r]=fLe(t,r),n),{})}function Mpe(t){const e=function(n,r){const i={delimiter:t};return pne(n,r?cn(r,i):i)};return e.responseType="text",e}function pne(t,e){return e.header&&(t=e.header.map(rt).join(e.delimiter)+` -`+t),xSt(e.delimiter).parse(t+"")}pne.responseType="text";function jOt(t){return typeof Buffer=="function"&&fn(Buffer.isBuffer)?Buffer.isBuffer(t):!1}function gne(t,e){const n=e&&e.property?Eu(e.property):na;return ht(t)&&!jOt(t)?BOt(n(t),e):n(JSON.parse(t))}gne.responseType="json";function BOt(t,e){return!We(t)&&iIe(t)&&(t=[...t]),e&&e.copy?JSON.parse(JSON.stringify(t)):t}const UOt={interior:(t,e)=>t!==e,exterior:(t,e)=>t===e};function hLe(t,e){let n,r,i,o;return t=gne(t,e),e&&e.feature?(n=SSt,i=e.feature):e&&e.mesh?(n=OSt,i=e.mesh,o=UOt[e.filter]):je("Missing TopoJSON feature or mesh parameter."),r=(r=t.objects[i])?n(t,r,o):je("Invalid TopoJSON object: "+i),r&&r.features||[r]}hLe.responseType="json";const h3={dsv:pne,csv:Mpe(","),tsv:Mpe(" "),json:gne,topojson:hLe};function mne(t,e){return arguments.length>1?(h3[t]=e,this):vt(h3,t)?h3[t]:null}function pLe(t){const e=mne(t);return e&&e.responseType||"text"}function gLe(t,e,n,r){e=e||{};const i=mne(e.type||"json");return i||je("Unknown data format type: "+e.type),t=i(t,e),e.parse&&WOt(t,e.parse,n,r),vt(t,"columns")&&delete t.columns,t}function WOt(t,e,n,r){if(!t.length)return;const i=CA();n=n||i.timeParse,r=r||i.utcParse;let o=t.columns||Object.keys(t[0]),s,a,l,c,u,f;e==="auto"&&(e=dLe(t,o)),o=Object.keys(e);const d=o.map(h=>{const p=e[h];let g,m;if(p&&(p.startsWith("date:")||p.startsWith("utc:")))return g=p.split(/:(.+)?/,2),m=g[1],(m[0]==="'"&&m[m.length-1]==="'"||m[0]==='"'&&m[m.length-1]==='"')&&(m=m.slice(1,-1)),(g[0]==="utc"?r:n)(m);if(!Kq[p])throw Error("Illegal format pattern: "+h+":"+p);return Kq[p]});for(l=0,u=t.length,f=o.length;l{const o=e(i);return r[o]||(r[o]=1,n.push(i)),n},n.remove=i=>{const o=e(i);if(r[o]){r[o]=0;const s=n.indexOf(i);s>=0&&n.splice(s,1)}return n},n}async function p3(t,e){try{await e(t)}catch(n){t.error(n)}}const mLe=Symbol("vega_id");let VOt=1;function rB(t){return!!(t&&jt(t))}function jt(t){return t[mLe]}function vLe(t,e){return t[mLe]=e,t}function cr(t){const e=t===Object(t)?t:{data:t};return jt(e)?e:vLe(e,VOt++)}function vne(t){return iB(t,cr({}))}function iB(t,e){for(const n in t)e[n]=t[n];return e}function yLe(t,e){return vLe(e,jt(t))}function ab(t,e){return t?e?(n,r)=>t(n,r)||jt(e(n))-jt(e(r)):(n,r)=>t(n,r)||jt(n)-jt(r):null}function xLe(t){return t&&t.constructor===lb}function lb(){const t=[],e=[],n=[],r=[],i=[];let o=null,s=!1;return{constructor:lb,insert(a){const l=pt(a),c=l.length;for(let u=0;u{p(y)&&(c[jt(y)]=-1)});for(f=0,d=t.length;f0&&(v(g,p,h.value),a.modifies(p));for(f=0,d=i.length;f{p(y)&&c[jt(y)]>0&&v(y,h.field,h.value)}),a.modifies(h.field);if(s)a.mod=e.length||r.length?l.filter(y=>c[jt(y)]>0):l.slice();else for(m in u)a.mod.push(u[m]);return(o||o==null&&(e.length||r.length))&&a.clean(!0),a}}}const g3="_:mod:_";function oB(){Object.defineProperty(this,g3,{writable:!0,value:{}})}oB.prototype={set(t,e,n,r){const i=this,o=i[t],s=i[g3];return e!=null&&e>=0?(o[e]!==n||r)&&(o[e]=n,s[e+":"+t]=-1,s[t]=-1):(o!==n||r)&&(i[t]=n,s[t]=We(n)?1+n.length:-1),i},modified(t,e){const n=this[g3];if(arguments.length){if(We(t)){for(let r=0;r=0?e+1{h instanceof Ir?(h!==this&&(e&&h.targets().add(this),o.push(h)),i.push({op:h,name:f,index:d})):r.set(f,d,h)};for(s in t)if(a=t[s],s===HOt)pt(a).forEach(f=>{f instanceof Ir?f!==this&&(f.targets().add(this),o.push(f)):je("Pulse parameters must be operator instances.")}),this.source=a;else if(We(a))for(r.set(s,-1,Array(l=a.length)),c=0;c{const n=Date.now();return n-e>t?(e=n,1):0})},debounce(t){const e=Dm();return this.targets().add(Dm(null,null,ene(t,n=>{const r=n.dataflow;e.receive(n),r&&r.run&&r.run()}))),e},between(t,e){let n=!1;return t.targets().add(Dm(null,null,()=>n=!0)),e.targets().add(Dm(null,null,()=>n=!1)),this.filter(()=>n)},detach(){this._filter=Tu,this._targets=null}};function JOt(t,e,n,r){const i=this,o=Dm(n,r),s=function(c){c.dataflow=i;try{o.receive(c)}catch(u){i.error(u)}finally{i.run()}};let a;typeof t=="string"&&typeof document<"u"?a=document.querySelectorAll(t):a=pt(t);const l=a.length;for(let c=0;ce=r);return n.requests=0,n.done=()=>{--n.requests===0&&(t._pending=null,e(t))},t._pending=n}const oEt={skip:!0};function sEt(t,e,n,r,i){return(t instanceof Ir?lEt:aEt)(this,t,e,n,r,i),this}function aEt(t,e,n,r,i,o){const s=cn({},o,oEt);let a,l;fn(n)||(n=ra(n)),r===void 0?a=c=>t.touch(n(c)):fn(r)?(l=new Ir(null,r,i,!1),a=c=>{l.evaluate(c);const u=n(c),f=l.value;xLe(f)?t.pulse(u,f,o):t.update(u,f,s)}):a=c=>t.update(n(c),r,s),e.apply(a)}function lEt(t,e,n,r,i,o){if(r===void 0)e.targets().add(n);else{const s=o||{},a=new Ir(null,cEt(n,r),i,!1);a.modified(s.force),a.rank=e.rank,e.targets().add(a),n&&(a.skip(!0),a.value=n.value,a.targets().add(n),t.connect(n,[a]))}}function cEt(t,e){return e=fn(e)?e:ra(e),t?function(n,r){const i=e(n,r);return t.skip()||(t.skip(i!==this.value).value=i),i}:e}function uEt(t){t.rank=++this._rank}function fEt(t){const e=[t];let n,r,i;for(;e.length;)if(this.rank(n=e.pop()),r=n._targets)for(i=r.length;--i>=0;)e.push(n=r[i]),n===t&&je("Cycle detected in dataflow graph.")}const CN={},Pd=1,Xm=2,Ap=4,dEt=Pd|Xm,Dpe=Pd|Ap,qb=Pd|Xm|Ap,Ipe=8,XE=16,Lpe=32,$pe=64;function jv(t,e,n){this.dataflow=t,this.stamp=e??-1,this.add=[],this.rem=[],this.mod=[],this.fields=null,this.encode=n||null}function UW(t,e){const n=[];return qm(t,e,r=>n.push(r)),n}function Fpe(t,e){const n={};return t.visit(e,r=>{n[jt(r)]=1}),r=>n[jt(r)]?null:r}function PI(t,e){return t?(n,r)=>t(n,r)&&e(n,r):e}jv.prototype={StopPropagation:CN,ADD:Pd,REM:Xm,MOD:Ap,ADD_REM:dEt,ADD_MOD:Dpe,ALL:qb,REFLOW:Ipe,SOURCE:XE,NO_SOURCE:Lpe,NO_FIELDS:$pe,fork(t){return new jv(this.dataflow).init(this,t)},clone(){const t=this.fork(qb);return t.add=t.add.slice(),t.rem=t.rem.slice(),t.mod=t.mod.slice(),t.source&&(t.source=t.source.slice()),t.materialize(qb|XE)},addAll(){let t=this;return!t.source||t.add===t.rem||!t.rem.length&&t.source.length===t.add.length||(t=new jv(this.dataflow).init(this),t.add=t.source,t.rem=[]),t},init(t,e){const n=this;return n.stamp=t.stamp,n.encode=t.encode,t.fields&&!(e&$pe)&&(n.fields=t.fields),e&Pd?(n.addF=t.addF,n.add=t.add):(n.addF=null,n.add=[]),e&Xm?(n.remF=t.remF,n.rem=t.rem):(n.remF=null,n.rem=[]),e&Ap?(n.modF=t.modF,n.mod=t.mod):(n.modF=null,n.mod=[]),e&Lpe?(n.srcF=null,n.source=null):(n.srcF=t.srcF,n.source=t.source,t.cleans&&(n.cleans=t.cleans)),n},runAfter(t){this.dataflow.runAfter(t)},changed(t){const e=t||qb;return e&Pd&&this.add.length||e&Xm&&this.rem.length||e&Ap&&this.mod.length},reflow(t){if(t)return this.fork(qb).reflow();const e=this.add.length,n=this.source&&this.source.length;return n&&n!==e&&(this.mod=this.source,e&&this.filter(Ap,Fpe(this,Pd))),this},clean(t){return arguments.length?(this.cleans=!!t,this):this.cleans},modifies(t){const e=this.fields||(this.fields={});return We(t)?t.forEach(n=>e[n]=!0):e[t]=!0,this},modified(t,e){const n=this.fields;return(e||this.mod.length)&&n?arguments.length?We(t)?t.some(r=>n[r]):n[t]:!!n:!1},filter(t,e){const n=this;return t&Pd&&(n.addF=PI(n.addF,e)),t&Xm&&(n.remF=PI(n.remF,e)),t&Ap&&(n.modF=PI(n.modF,e)),t&XE&&(n.srcF=PI(n.srcF,e)),n},materialize(t){t=t||qb;const e=this;return t&Pd&&e.addF&&(e.add=UW(e.add,e.addF),e.addF=null),t&Xm&&e.remF&&(e.rem=UW(e.rem,e.remF),e.remF=null),t&Ap&&e.modF&&(e.mod=UW(e.mod,e.modF),e.modF=null),t&XE&&e.srcF&&(e.source=e.source.filter(e.srcF),e.srcF=null),e},visit(t,e){const n=this,r=e;if(t&XE)return qm(n.source,n.srcF,r),n;t&Pd&&qm(n.add,n.addF,r),t&Xm&&qm(n.rem,n.remF,r),t&Ap&&qm(n.mod,n.modF,r);const i=n.source;if(t&Ipe&&i){const o=n.add.length+n.mod.length;o===i.length||(o?qm(i,Fpe(n,Dpe),r):qm(i,n.srcF,r))}return n}};function yne(t,e,n,r){const i=this;let o=0;this.dataflow=t,this.stamp=e,this.fields=null,this.encode=r||null,this.pulses=n;for(const s of n)if(s.stamp===e){if(s.fields){const a=i.fields||(i.fields={});for(const l in s.fields)a[l]=1}s.changed(i.ADD)&&(o|=i.ADD),s.changed(i.REM)&&(o|=i.REM),s.changed(i.MOD)&&(o|=i.MOD)}this.changes=o}it(yne,jv,{fork(t){const e=new jv(this.dataflow).init(this,t&this.NO_FIELDS);return t!==void 0&&(t&e.ADD&&this.visit(e.ADD,n=>e.add.push(n)),t&e.REM&&this.visit(e.REM,n=>e.rem.push(n)),t&e.MOD&&this.visit(e.MOD,n=>e.mod.push(n))),e},changed(t){return this.changes&t},modified(t){const e=this,n=e.fields;return n&&e.changes&e.MOD?We(t)?t.some(r=>n[r]):n[t]:0},filter(){je("MultiPulse does not support filtering.")},materialize(){je("MultiPulse does not support materialization.")},visit(t,e){const n=this,r=n.pulses,i=r.length;let o=0;if(t&n.SOURCE)for(;or._enqueue(u,!0)),r._touched=nB(tR);let s=0,a,l,c;try{for(;r._heap.size()>0;){if(a=r._heap.pop(),a.rank!==a.qrank){r._enqueue(a,!0);continue}l=a.run(r._getPulse(a,t)),l.then?l=await l:l.async&&(i.push(l.async),l=CN),l!==CN&&a._targets&&a._targets.forEach(u=>r._enqueue(u)),++s}}catch(u){r._heap.clear(),c=u}if(r._input={},r._pulse=null,r.debug(`Pulse ${o}: ${s} operators`),c&&(r._postrun=[],r.error(c)),r._postrun.length){const u=r._postrun.sort((f,d)=>d.priority-f.priority);r._postrun=[];for(let f=0;fr.runAsync(null,()=>{u.forEach(f=>{try{f(r)}catch(d){r.error(d)}})})),r}async function pEt(t,e,n){for(;this._running;)await this._running;const r=()=>this._running=null;return(this._running=this.evaluate(t,e,n)).then(r,r),this._running}function gEt(t,e,n){return this._pulse?bLe(this):(this.evaluate(t,e,n),this)}function mEt(t,e,n){if(this._pulse||e)this._postrun.push({priority:n||0,callback:t});else try{t(this)}catch(r){this.error(r)}}function bLe(t){return t.error("Dataflow already running. Use runAsync() to chain invocations."),t}function vEt(t,e){const n=t.stampi.pulse),e):this._input[t.id]||xEt(this._pulse,n&&n.pulse)}function xEt(t,e){return e&&e.stamp===t.stamp?e:(t=t.fork(),e&&e!==CN&&(t.source=e.source),t)}const xne={skip:!1,force:!1};function bEt(t,e){const n=e||xne;return this._pulse?this._enqueue(t):this._touched.add(t),n.skip&&t.skip(!0),this}function wEt(t,e,n){const r=n||xne;return(t.set(e)||r.force)&&this.touch(t,r),this}function _Et(t,e,n){this.touch(t,n||xne);const r=new jv(this,this._clock+(this._pulse?0:1)),i=t.pulse&&t.pulse.source||[];return r.target=t,this._input[t.id]=e.pulse(r,i),this}function SEt(t){let e=[];return{clear:()=>e=[],size:()=>e.length,peek:()=>e[0],push:n=>(e.push(n),wLe(e,0,e.length-1,t)),pop:()=>{const n=e.pop();let r;return e.length?(r=e[0],e[0]=n,CEt(e,0,t)):r=n,r}}}function wLe(t,e,n,r){let i,o;const s=t[n];for(;n>e;){if(o=n-1>>1,i=t[o],r(s,i)<0){t[n]=i,n=o;continue}break}return t[n]=s}function CEt(t,e,n){const r=e,i=t.length,o=t[e];let s=(e<<1)+1,a;for(;s=0&&(s=a),t[e]=t[s],e=s,s=(e<<1)+1;return t[e]=o,wLe(t,r,e,n)}function D_(){this.logger(Yte()),this.logLevel(qte),this._clock=0,this._rank=0,this._locale=hne();try{this._loader=tB()}catch{}this._touched=nB(tR),this._input={},this._pulse=null,this._heap=SEt((t,e)=>t.qrank-e.qrank),this._postrun=[]}function YE(t){return function(){return this._log[t].apply(this,arguments)}}D_.prototype={stamp(){return this._clock},loader(t){return arguments.length?(this._loader=t,this):this._loader},locale(t){return arguments.length?(this._locale=t,this):this._locale},logger(t){return arguments.length?(this._log=t,this):this._log},error:YE("error"),warn:YE("warn"),info:YE("info"),debug:YE("debug"),logLevel:YE("level"),cleanThreshold:1e4,add:QOt,connect:KOt,rank:uEt,rerank:fEt,pulse:_Et,touch:bEt,update:wEt,changeset:lb,ingest:tEt,parse:eEt,preload:rEt,request:nEt,events:JOt,on:sEt,evaluate:hEt,run:gEt,runAsync:pEt,runAfter:mEt,_enqueue:vEt,_getPulse:yEt};function Re(t,e){Ir.call(this,t,null,e)}it(Re,Ir,{run(t){if(t.stampthis.pulse=n):e!==t.StopPropagation&&(this.pulse=e),e},evaluate(t){const e=this.marshall(t.stamp),n=this.transform(e,t);return e.clear(),n},transform(){}});const IS={};function _Le(t){const e=SLe(t);return e&&e.Definition||null}function SLe(t){return t=t&&t.toLowerCase(),vt(IS,t)?IS[t]:null}function*CLe(t,e){if(e==null)for(let n of t)n!=null&&n!==""&&(n=+n)>=n&&(yield n);else{let n=-1;for(let r of t)r=e(r,++n,t),r!=null&&r!==""&&(r=+r)>=r&&(yield r)}}function bne(t,e,n){const r=Float64Array.from(CLe(t,n));return r.sort(gh),e.map(i=>bIe(r,i))}function wne(t,e){return bne(t,[.25,.5,.75],e)}function _ne(t,e){const n=t.length,r=DSt(t,e),i=wne(t,e),o=(i[2]-i[0])/1.34;return 1.06*(Math.min(r,o)||r||Math.abs(i[0])||1)*Math.pow(n,-.2)}function OLe(t){const e=t.maxbins||20,n=t.base||10,r=Math.log(n),i=t.divide||[5,2];let o=t.extent[0],s=t.extent[1],a,l,c,u,f,d;const h=t.span||s-o||Math.abs(o)||1;if(t.step)a=t.step;else if(t.steps){for(u=h/e,f=0,d=t.steps.length;fe;)a*=n;for(f=0,d=i.length;f=c&&h/u<=e&&(a=u)}u=Math.log(a);const p=u>=0?0:~~(-u/r)+1,g=Math.pow(n,-p-1);return(t.nice||t.nice===void 0)&&(u=Math.floor(o/a+g)*a,o=od);const i=t.length,o=new Float64Array(i);let s=0,a=1,l=r(t[0]),c=l,u=l+e,f;for(;a=u){for(c=(l+c)/2;s>1);si;)t[s--]=t[r]}r=i,i=o}return t}function TEt(t){return function(){return t=(1103515245*t+12345)%2147483647,t/2147483647}}function kEt(t,e){e==null&&(e=t,t=0);let n,r,i;const o={min(s){return arguments.length?(n=s||0,i=r-n,o):n},max(s){return arguments.length?(r=s||0,i=r-n,o):r},sample(){return n+Math.floor(i*Au())},pdf(s){return s===Math.floor(s)&&s>=n&&s=r?1:(a-n+1)/i},icdf(s){return s>=0&&s<=1?n-1+Math.floor(s*i):NaN}};return o.min(t).max(e)}const kLe=Math.sqrt(2*Math.PI),AEt=Math.SQRT2;let QE=NaN;function aB(t,e){t=t||0,e=e??1;let n=0,r=0,i,o;if(QE===QE)n=QE,QE=NaN;else{do n=Au()*2-1,r=Au()*2-1,i=n*n+r*r;while(i===0||i>1);o=Math.sqrt(-2*Math.log(i)/i),n*=o,QE=r*o}return t+n*e}function Sne(t,e,n){n=n??1;const r=(t-(e||0))/n;return Math.exp(-.5*r*r)/(n*kLe)}function lB(t,e,n){e=e||0,n=n??1;const r=(t-e)/n,i=Math.abs(r);let o;if(i>37)o=0;else{const s=Math.exp(-i*i/2);let a;i<7.07106781186547?(a=.0352624965998911*i+.700383064443688,a=a*i+6.37396220353165,a=a*i+33.912866078383,a=a*i+112.079291497871,a=a*i+221.213596169931,a=a*i+220.206867912376,o=s*a,a=.0883883476483184*i+1.75566716318264,a=a*i+16.064177579207,a=a*i+86.7807322029461,a=a*i+296.564248779674,a=a*i+637.333633378831,a=a*i+793.826512519948,a=a*i+440.413735824752,o=o/a):(a=i+.65,a=i+4/a,a=i+3/a,a=i+2/a,a=i+1/a,o=s/a/2.506628274631)}return r>0?1-o:o}function cB(t,e,n){return t<0||t>1?NaN:(e||0)+(n??1)*AEt*PEt(2*t-1)}function PEt(t){let e=-Math.log((1-t)*(1+t)),n;return e<6.25?(e-=3.125,n=-364441206401782e-35,n=-16850591381820166e-35+n*e,n=128584807152564e-32+n*e,n=11157877678025181e-33+n*e,n=-1333171662854621e-31+n*e,n=20972767875968562e-33+n*e,n=6637638134358324e-30+n*e,n=-4054566272975207e-29+n*e,n=-8151934197605472e-29+n*e,n=26335093153082323e-28+n*e,n=-12975133253453532e-27+n*e,n=-5415412054294628e-26+n*e,n=10512122733215323e-25+n*e,n=-4112633980346984e-24+n*e,n=-29070369957882005e-24+n*e,n=42347877827932404e-23+n*e,n=-13654692000834679e-22+n*e,n=-13882523362786469e-21+n*e,n=.00018673420803405714+n*e,n=-.000740702534166267+n*e,n=-.006033670871430149+n*e,n=.24015818242558962+n*e,n=1.6536545626831027+n*e):e<16?(e=Math.sqrt(e)-3.25,n=22137376921775787e-25,n=9075656193888539e-23+n*e,n=-27517406297064545e-23+n*e,n=18239629214389228e-24+n*e,n=15027403968909828e-22+n*e,n=-4013867526981546e-21+n*e,n=29234449089955446e-22+n*e,n=12475304481671779e-21+n*e,n=-47318229009055734e-21+n*e,n=6828485145957318e-20+n*e,n=24031110387097894e-21+n*e,n=-.0003550375203628475+n*e,n=.0009532893797373805+n*e,n=-.0016882755560235047+n*e,n=.002491442096107851+n*e,n=-.003751208507569241+n*e,n=.005370914553590064+n*e,n=1.0052589676941592+n*e,n=3.0838856104922208+n*e):Number.isFinite(e)?(e=Math.sqrt(e)-5,n=-27109920616438573e-27,n=-2555641816996525e-25+n*e,n=15076572693500548e-25+n*e,n=-3789465440126737e-24+n*e,n=761570120807834e-23+n*e,n=-1496002662714924e-23+n*e,n=2914795345090108e-23+n*e,n=-6771199775845234e-23+n*e,n=22900482228026655e-23+n*e,n=-99298272942317e-20+n*e,n=4526062597223154e-21+n*e,n=-1968177810553167e-20+n*e,n=7599527703001776e-20+n*e,n=-.00021503011930044477+n*e,n=-.00013871931833623122+n*e,n=1.0103004648645344+n*e,n=4.849906401408584+n*e):n=1/0,n*t}function Cne(t,e){let n,r;const i={mean(o){return arguments.length?(n=o||0,i):n},stdev(o){return arguments.length?(r=o??1,i):r},sample:()=>aB(n,r),pdf:o=>Sne(o,n,r),cdf:o=>lB(o,n,r),icdf:o=>cB(o,n,r)};return i.mean(t).stdev(e)}function One(t,e){const n=Cne();let r=0;const i={data(o){return arguments.length?(t=o,r=o?o.length:0,i.bandwidth(e)):t},bandwidth(o){return arguments.length?(e=o,!e&&t&&(e=_ne(t)),i):e},sample(){return t[~~(Au()*r)]+e*n.sample()},pdf(o){let s=0,a=0;for(;aEne(n,r),pdf:o=>Tne(o,n,r),cdf:o=>kne(o,n,r),icdf:o=>Ane(o,n,r)};return i.mean(t).stdev(e)}function PLe(t,e){let n=0,r;function i(s){const a=[];let l=0,c;for(c=0;c=e&&t<=n?1/(n-e):0}function Rne(t,e,n){return n==null&&(n=e??1,e=0),tn?1:(t-e)/(n-e)}function Dne(t,e,n){return n==null&&(n=e??1,e=0),t>=0&&t<=1?e+t*(n-e):NaN}function MLe(t,e){let n,r;const i={min(o){return arguments.length?(n=o||0,i):n},max(o){return arguments.length?(r=o??1,i):r},sample:()=>Pne(n,r),pdf:o=>Mne(o,n,r),cdf:o=>Rne(o,n,r),icdf:o=>Dne(o,n,r)};return e==null&&(e=t??1,t=0),i.min(t).max(e)}function Ine(t,e,n){let r=0,i=0;for(const o of t){const s=n(o);e(o)==null||s==null||isNaN(s)||(r+=(s-r)/++i)}return{coef:[r],predict:()=>r,rSquared:0}}function rR(t,e,n,r){const i=r-t*t,o=Math.abs(i)<1e-24?0:(n-t*e)/i;return[e-o*t,o]}function uB(t,e,n,r){t=t.filter(h=>{let p=e(h),g=n(h);return p!=null&&(p=+p)>=p&&g!=null&&(g=+g)>=g}),r&&t.sort((h,p)=>e(h)-e(p));const i=t.length,o=new Float64Array(i),s=new Float64Array(i);let a=0,l=0,c=0,u,f,d;for(d of t)o[a]=u=+e(d),s[a]=f=+n(d),++a,l+=(u-l)/a,c+=(f-c)/a;for(a=0;a=o&&s!=null&&(s=+s)>=s&&r(o,s,++i)}function CO(t,e,n,r,i){let o=0,s=0;return iR(t,e,n,(a,l)=>{const c=l-i(a),u=l-r;o+=c*c,s+=u*u}),1-o/s}function Lne(t,e,n){let r=0,i=0,o=0,s=0,a=0;iR(t,e,n,(u,f)=>{++a,r+=(u-r)/a,i+=(f-i)/a,o+=(u*f-o)/a,s+=(u*u-s)/a});const l=rR(r,i,o,s),c=u=>l[0]+l[1]*u;return{coef:l,predict:c,rSquared:CO(t,e,n,i,c)}}function RLe(t,e,n){let r=0,i=0,o=0,s=0,a=0;iR(t,e,n,(u,f)=>{++a,u=Math.log(u),r+=(u-r)/a,i+=(f-i)/a,o+=(u*f-o)/a,s+=(u*u-s)/a});const l=rR(r,i,o,s),c=u=>l[0]+l[1]*Math.log(u);return{coef:l,predict:c,rSquared:CO(t,e,n,i,c)}}function DLe(t,e,n){const[r,i,o,s]=uB(t,e,n);let a=0,l=0,c=0,u=0,f=0,d,h,p;iR(t,e,n,(y,x)=>{d=r[f++],h=Math.log(x),p=d*x,a+=(x*h-a)/f,l+=(p-l)/f,c+=(p*h-c)/f,u+=(d*p-u)/f});const[g,m]=rR(l/s,a/s,c/s,u/s),v=y=>Math.exp(g+m*(y-o));return{coef:[Math.exp(g-m*o),m],predict:v,rSquared:CO(t,e,n,s,v)}}function ILe(t,e,n){let r=0,i=0,o=0,s=0,a=0,l=0;iR(t,e,n,(f,d)=>{const h=Math.log(f),p=Math.log(d);++l,r+=(h-r)/l,i+=(p-i)/l,o+=(h*p-o)/l,s+=(h*h-s)/l,a+=(d-a)/l});const c=rR(r,i,o,s),u=f=>c[0]*Math.pow(f,c[1]);return c[0]=Math.exp(c[0]),{coef:c,predict:u,rSquared:CO(t,e,n,a,u)}}function $ne(t,e,n){const[r,i,o,s]=uB(t,e,n),a=r.length;let l=0,c=0,u=0,f=0,d=0,h,p,g,m;for(h=0;h(S=S-o,x*S*S+b*S+w+s);return{coef:[w-b*o+x*o*o+s,b-2*x*o,x],predict:_,rSquared:CO(t,e,n,s,_)}}function LLe(t,e,n,r){if(r===0)return Ine(t,e,n);if(r===1)return Lne(t,e,n);if(r===2)return $ne(t,e,n);const[i,o,s,a]=uB(t,e,n),l=i.length,c=[],u=[],f=r+1;let d,h,p,g,m;for(d=0;d{x-=s;let b=a+v[0]+v[1]*x+v[2]*x*x;for(d=3;d=0;--o)for(a=e[o],l=1,i[o]+=a,s=1;s<=o;++s)l*=(o+1-s)/s,i[o-s]+=a*Math.pow(n,s)*l;return i[0]+=r,i}function REt(t){const e=t.length-1,n=[];let r,i,o,s,a;for(r=0;rMath.abs(t[r][s])&&(s=i);for(o=r;o=r;o--)t[o][i]-=t[o][r]*t[r][i]/t[r][r]}for(i=e-1;i>=0;--i){for(a=0,o=i+1;oi[x]-v?y:x;let w=0,_=0,S=0,O=0,k=0;const E=1/Math.abs(i[b]-v||1);for(let P=y;P<=x;++P){const T=i[P],R=o[P],I=DEt(Math.abs(v-T)*E)*d[P],B=T*I;w+=I,_+=B,S+=R*I,O+=R*B,k+=T*B}const[M,A]=rR(_/w,S/w,O/w,k/w);u[m]=M+A*v,f[m]=Math.abs(o[m]-u[m]),IEt(i,m+1,p)}if(h===Npe)break;const g=wIe(f);if(Math.abs(g)=1?zpe:(y=1-v*v)*y}return LEt(i,u,s,a)}function DEt(t){return(t=1-t*t*t)*t*t}function IEt(t,e,n){const r=t[e];let i=n[0],o=n[1]+1;if(!(o>=t.length))for(;e>i&&t[o]-r<=r-t[i];)n[0]=++i,n[1]=o,++o}function LEt(t,e,n,r){const i=t.length,o=[];let s=0,a=0,l=[],c;for(;s[g,t(g)],o=e[0],s=e[1],a=s-o,l=a/r,c=[i(o)],u=[];if(n===r){for(let g=1;g0;)u.push(i(o+g/n*a))}let f=c[0],d=u[u.length-1];const h=1/a,p=FEt(f[1],u);for(;d;){const g=i((f[0]+d[0])/2);g[0]-f[0]>=l&&NEt(f,g,d,h,p)>$Et?u.push(g):(f=d,c.push(d),u.pop()),d=u[u.length-1]}return c}function FEt(t,e){let n=t,r=t;const i=e.length;for(let o=0;or&&(r=s)}return 1/(r-n)}function NEt(t,e,n,r,i){const o=Math.atan2(i*(n[1]-t[1]),r*(n[0]-t[0])),s=Math.atan2(i*(e[1]-t[1]),r*(e[0]-t[0]));return Math.abs(o-s)}function zEt(t){return e=>{const n=t.length;let r=1,i=String(t[0](e));for(;r{},jEt={init:WW,add:WW,rem:WW,idx:0},OA={values:{init:t=>t.cell.store=!0,value:t=>t.cell.data.values(),idx:-1},count:{value:t=>t.cell.num},__count__:{value:t=>t.missing+t.valid},missing:{value:t=>t.missing},valid:{value:t=>t.valid},sum:{init:t=>t.sum=0,value:t=>t.valid?t.sum:void 0,add:(t,e)=>t.sum+=+e,rem:(t,e)=>t.sum-=e},product:{init:t=>t.product=1,value:t=>t.valid?t.product:void 0,add:(t,e)=>t.product*=e,rem:(t,e)=>t.product/=e},mean:{init:t=>t.mean=0,value:t=>t.valid?t.mean:void 0,add:(t,e)=>(t.mean_d=e-t.mean,t.mean+=t.mean_d/t.valid),rem:(t,e)=>(t.mean_d=e-t.mean,t.mean-=t.valid?t.mean_d/t.valid:t.mean)},average:{value:t=>t.valid?t.mean:void 0,req:["mean"],idx:1},variance:{init:t=>t.dev=0,value:t=>t.valid>1?t.dev/(t.valid-1):void 0,add:(t,e)=>t.dev+=t.mean_d*(e-t.mean),rem:(t,e)=>t.dev-=t.mean_d*(e-t.mean),req:["mean"],idx:1},variancep:{value:t=>t.valid>1?t.dev/t.valid:void 0,req:["variance"],idx:2},stdev:{value:t=>t.valid>1?Math.sqrt(t.dev/(t.valid-1)):void 0,req:["variance"],idx:2},stdevp:{value:t=>t.valid>1?Math.sqrt(t.dev/t.valid):void 0,req:["variance"],idx:2},stderr:{value:t=>t.valid>1?Math.sqrt(t.dev/(t.valid*(t.valid-1))):void 0,req:["variance"],idx:2},distinct:{value:t=>t.cell.data.distinct(t.get),req:["values"],idx:3},ci0:{value:t=>t.cell.data.ci0(t.get),req:["values"],idx:3},ci1:{value:t=>t.cell.data.ci1(t.get),req:["values"],idx:3},median:{value:t=>t.cell.data.q2(t.get),req:["values"],idx:3},q1:{value:t=>t.cell.data.q1(t.get),req:["values"],idx:3},q3:{value:t=>t.cell.data.q3(t.get),req:["values"],idx:3},min:{init:t=>t.min=void 0,value:t=>t.min=Number.isNaN(t.min)?t.cell.data.min(t.get):t.min,add:(t,e)=>{(e{e<=t.min&&(t.min=NaN)},req:["values"],idx:4},max:{init:t=>t.max=void 0,value:t=>t.max=Number.isNaN(t.max)?t.cell.data.max(t.get):t.max,add:(t,e)=>{(e>t.max||t.max===void 0)&&(t.max=e)},rem:(t,e)=>{e>=t.max&&(t.max=NaN)},req:["values"],idx:4},argmin:{init:t=>t.argmin=void 0,value:t=>t.argmin||t.cell.data.argmin(t.get),add:(t,e,n)=>{e{e<=t.min&&(t.argmin=void 0)},req:["min","values"],idx:3},argmax:{init:t=>t.argmax=void 0,value:t=>t.argmax||t.cell.data.argmax(t.get),add:(t,e,n)=>{e>t.max&&(t.argmax=n)},rem:(t,e)=>{e>=t.max&&(t.argmax=void 0)},req:["max","values"],idx:3},exponential:{init:(t,e)=>{t.exp=0,t.exp_r=e},value:t=>t.valid?t.exp*(1-t.exp_r)/(1-t.exp_r**t.valid):void 0,add:(t,e)=>t.exp=t.exp_r*t.exp+e,rem:(t,e)=>t.exp=(t.exp-e/t.exp_r**(t.valid-1))/t.exp_r},exponentialb:{value:t=>t.valid?t.exp*(1-t.exp_r):void 0,req:["exponential"],idx:1}},oR=Object.keys(OA).filter(t=>t!=="__count__");function BEt(t,e){return(n,r)=>cn({name:t,aggregate_param:r,out:n||t},jEt,e)}[...oR,"__count__"].forEach(t=>{OA[t]=BEt(t,OA[t])});function NLe(t,e,n){return OA[t](n,e)}function zLe(t,e){return t.idx-e.idx}function UEt(t){const e={};t.forEach(r=>e[r.name]=r);const n=r=>{r.req&&r.req.forEach(i=>{e[i]||n(e[i]=OA[i]())})};return t.forEach(n),Object.values(e).sort(zLe)}function WEt(){this.valid=0,this.missing=0,this._ops.forEach(t=>t.aggregate_param==null?t.init(this):t.init(this,t.aggregate_param))}function VEt(t,e){if(t==null||t===""){++this.missing;return}t===t&&(++this.valid,this._ops.forEach(n=>n.add(this,t,e)))}function GEt(t,e){if(t==null||t===""){--this.missing;return}t===t&&(--this.valid,this._ops.forEach(n=>n.rem(this,t,e)))}function HEt(t){return this._out.forEach(e=>t[e.out]=e.value(this)),t}function jLe(t,e){const n=e||na,r=UEt(t),i=t.slice().sort(zLe);function o(s){this._ops=r,this._out=i,this.cell=s,this.init()}return o.prototype.init=WEt,o.prototype.add=VEt,o.prototype.rem=GEt,o.prototype.set=HEt,o.prototype.get=n,o.fields=t.map(s=>s.out),o}function Fne(t){this._key=t?Eu(t):jt,this.reset()}const Os=Fne.prototype;Os.reset=function(){this._add=[],this._rem=[],this._ext=null,this._get=null,this._q=null};Os.add=function(t){this._add.push(t)};Os.rem=function(t){this._rem.push(t)};Os.values=function(){if(this._get=null,this._rem.length===0)return this._add;const t=this._add,e=this._rem,n=this._key,r=t.length,i=e.length,o=Array(r-i),s={};let a,l,c;for(a=0;a=0;)o=t(e[r])+"",vt(n,o)||(n[o]=1,++i);return i};Os.extent=function(t){if(this._get!==t||!this._ext){const e=this.values(),n=nIe(e,t);this._ext=[e[n[0]],e[n[1]]],this._get=t}return this._ext};Os.argmin=function(t){return this.extent(t)[0]||{}};Os.argmax=function(t){return this.extent(t)[1]||{}};Os.min=function(t){const e=this.extent(t)[0];return e!=null?t(e):void 0};Os.max=function(t){const e=this.extent(t)[1];return e!=null?t(e):void 0};Os.quartile=function(t){return(this._get!==t||!this._q)&&(this._q=wne(this.values(),t),this._get=t),this._q};Os.q1=function(t){return this.quartile(t)[0]};Os.q2=function(t){return this.quartile(t)[1]};Os.q3=function(t){return this.quartile(t)[2]};Os.ci=function(t){return(this._get!==t||!this._ci)&&(this._ci=ELe(this.values(),1e3,.05,t),this._get=t),this._ci};Os.ci0=function(t){return this.ci(t)[0]};Os.ci1=function(t){return this.ci(t)[1]};function iy(t){Re.call(this,null,t),this._adds=[],this._mods=[],this._alen=0,this._mlen=0,this._drop=!0,this._cross=!1,this._dims=[],this._dnames=[],this._measures=[],this._countOnly=!1,this._counts=null,this._prev=null,this._inputs=null,this._outputs=null}iy.Definition={type:"Aggregate",metadata:{generates:!0,changes:!0},params:[{name:"groupby",type:"field",array:!0},{name:"ops",type:"enum",array:!0,values:oR},{name:"aggregate_params",type:"number",null:!0,array:!0},{name:"fields",type:"field",null:!0,array:!0},{name:"as",type:"string",null:!0,array:!0},{name:"drop",type:"boolean",default:!0},{name:"cross",type:"boolean",default:!1},{name:"key",type:"field"}]};it(iy,Re,{transform(t,e){const n=this,r=e.fork(e.NO_SOURCE|e.NO_FIELDS),i=t.modified();return n.stamp=r.stamp,n.value&&(i||e.modified(n._inputs,!0))?(n._prev=n.value,n.value=i?n.init(t):Object.create(null),e.visit(e.SOURCE,o=>n.add(o))):(n.value=n.value||n.init(t),e.visit(e.REM,o=>n.rem(o)),e.visit(e.ADD,o=>n.add(o))),r.modifies(n._outputs),n._drop=t.drop!==!1,t.cross&&n._dims.length>1&&(n._drop=!1,n.cross()),e.clean()&&n._drop&&r.clean(!0).runAfter(()=>this.clean()),n.changes(r)},cross(){const t=this,e=t.value,n=t._dnames,r=n.map(()=>({})),i=n.length;function o(a){let l,c,u,f;for(l in a)for(u=a[l].tuple,c=0;c{const x=Ni(y);return i(y),n.push(x),x}),this.cellkey=t.key?t.key:Zq(this._dims),this._countOnly=!0,this._counts=[],this._measures=[];const o=t.fields||[null],s=t.ops||["count"],a=t.aggregate_params||[null],l=t.as||[],c=o.length,u={};let f,d,h,p,g,m,v;for(c!==s.length&&je("Unmatched number of fields and aggregate ops."),v=0;vjLe(y,y.field)),Object.create(null)},cellkey:Zq(),cell(t,e){let n=this.value[t];return n?n.num===0&&this._drop&&n.stamp{const f=r(u);u[a]=f,u[l]=f==null?null:i+o*(1+(f-i)/o)}:u=>u[a]=r(u)),e.modifies(n?s:a)},_bins(t){if(this.value&&!t.modified())return this.value;const e=t.field,n=OLe(t),r=n.step;let i=n.start,o=i+Math.ceil((n.stop-i)/r)*r,s,a;(s=t.anchor)!=null&&(a=s-(i+r*Math.floor((s-i)/r)),i+=a,o+=a);const l=function(c){let u=Ys(e(c));return u==null?null:uo?1/0:(u=Math.max(i,Math.min(u,o-r)),i+r*Math.floor(qEt+(u-i)/r))};return l.start=i,l.stop=n.stop,l.step=r,this.value=Pl(l,Ks(e),t.name||"bin_"+Ni(e))}});function BLe(t,e,n){const r=t;let i=e||[],o=n||[],s={},a=0;return{add:l=>o.push(l),remove:l=>s[r(l)]=++a,size:()=>i.length,data:(l,c)=>(a&&(i=i.filter(u=>!s[r(u)]),s={},a=0),c&&l&&i.sort(l),o.length&&(i=l?lIe(l,i,o.sort(l)):i.concat(o),o=[]),i)}}function zne(t){Re.call(this,[],t)}zne.Definition={type:"Collect",metadata:{source:!0},params:[{name:"sort",type:"compare"}]};it(zne,Re,{transform(t,e){const n=e.fork(e.ALL),r=BLe(jt,this.value,n.materialize(n.ADD).add),i=t.sort,o=e.changed()||i&&(t.modified("sort")||e.modified(i.fields));return n.visit(n.REM,r.remove),this.modified(o),this.value=n.source=r.data(ab(i),o),e.source&&e.source.root&&(this.value.root=e.source.root),n}});function ULe(t){Ir.call(this,null,XEt,t)}it(ULe,Ir);function XEt(t){return this.value&&!t.modified()?this.value:Jte(t.fields,t.orders)}function jne(t){Re.call(this,null,t)}jne.Definition={type:"CountPattern",metadata:{generates:!0,changes:!0},params:[{name:"field",type:"field",required:!0},{name:"case",type:"enum",values:["upper","lower","mixed"],default:"mixed"},{name:"pattern",type:"string",default:'[\\w"]+'},{name:"stopwords",type:"string",default:""},{name:"as",type:"string",array:!0,length:2,default:["text","count"]}]};function YEt(t,e,n){switch(e){case"upper":t=t.toUpperCase();break;case"lower":t=t.toLowerCase();break}return t.match(n)}it(jne,Re,{transform(t,e){const n=f=>d=>{for(var h=YEt(a(d),t.case,o)||[],p,g=0,m=h.length;gi[f]=1+(i[f]||0)),u=n(f=>i[f]-=1);return r?e.visit(e.SOURCE,c):(e.visit(e.ADD,c),e.visit(e.REM,u)),this._finish(e,l)},_parameterCheck(t,e){let n=!1;return(t.modified("stopwords")||!this._stop)&&(this._stop=new RegExp("^"+(t.stopwords||"")+"$","i"),n=!0),(t.modified("pattern")||!this._match)&&(this._match=new RegExp(t.pattern||"[\\w']+","g"),n=!0),(t.modified("field")||e.modified(t.field.fields))&&(n=!0),n&&(this._counts={}),n},_finish(t,e){const n=this._counts,r=this._tuples||(this._tuples={}),i=e[0],o=e[1],s=t.fork(t.NO_SOURCE|t.NO_FIELDS);let a,l,c;for(a in n)l=r[a],c=n[a]||0,!l&&c?(r[a]=l=cr({}),l[i]=a,l[o]=c,s.add.push(l)):c===0?(l&&s.rem.push(l),n[a]=null,r[a]=null):l[o]!==c&&(l[o]=c,s.mod.push(l));return s.modifies(e)}});function Bne(t){Re.call(this,null,t)}Bne.Definition={type:"Cross",metadata:{generates:!0},params:[{name:"filter",type:"expr"},{name:"as",type:"string",array:!0,length:2,default:["a","b"]}]};it(Bne,Re,{transform(t,e){const n=e.fork(e.NO_SOURCE),r=t.as||["a","b"],i=r[0],o=r[1],s=!this.value||e.changed(e.ADD_REM)||t.modified("as")||t.modified("filter");let a=this.value;return s?(a&&(n.rem=a),a=e.materialize(e.SOURCE).source,n.add=this.value=QEt(a,i,o,t.filter||Tu)):n.mod=a,n.source=this.value,n.modifies(r)}});function QEt(t,e,n,r){for(var i=[],o={},s=t.length,a=0,l,c;aWLe(o,e))):typeof r[i]===Bpe&&r[i](t[i]);return r}function Une(t){Re.call(this,null,t)}const VLe=[{key:{function:"normal"},params:[{name:"mean",type:"number",default:0},{name:"stdev",type:"number",default:1}]},{key:{function:"lognormal"},params:[{name:"mean",type:"number",default:0},{name:"stdev",type:"number",default:1}]},{key:{function:"uniform"},params:[{name:"min",type:"number",default:0},{name:"max",type:"number",default:1}]},{key:{function:"kde"},params:[{name:"field",type:"field",required:!0},{name:"from",type:"data"},{name:"bandwidth",type:"number",default:0}]}],JEt={key:{function:"mixture"},params:[{name:"distributions",type:"param",array:!0,params:VLe},{name:"weights",type:"number",array:!0}]};Une.Definition={type:"Density",metadata:{generates:!0},params:[{name:"extent",type:"number",array:!0,length:2},{name:"steps",type:"number"},{name:"minsteps",type:"number",default:25},{name:"maxsteps",type:"number",default:200},{name:"method",type:"string",default:"pdf",values:["pdf","cdf"]},{name:"distribution",type:"param",params:VLe.concat(JEt)},{name:"as",type:"string",array:!0,default:["value","density"]}]};it(Une,Re,{transform(t,e){const n=e.fork(e.NO_SOURCE|e.NO_FIELDS);if(!this.value||e.changed()||t.modified()){const r=WLe(t.distribution,e2t(e)),i=t.steps||t.minsteps||25,o=t.steps||t.maxsteps||200;let s=t.method||"pdf";s!=="pdf"&&s!=="cdf"&&je("Invalid density method: "+s),!t.extent&&!r.data&&je("Missing density extent parameter."),s=r[s];const a=t.as||["value","density"],l=t.extent||Eh(r.data()),c=fB(s,l,i,o).map(u=>{const f={};return f[a[0]]=u[0],f[a[1]]=u[1],cr(f)});this.value&&(n.rem=this.value),this.value=n.add=n.source=c}return n}});function e2t(t){return()=>t.materialize(t.SOURCE).source}function GLe(t,e){return t?t.map((n,r)=>e[r]||Ni(n)):null}function Wne(t,e,n){const r=[],i=f=>f(l);let o,s,a,l,c,u;if(e==null)r.push(t.map(n));else for(o={},s=0,a=t.length;snR(Eh(t,e))/30;it(Vne,Re,{transform(t,e){if(this.value&&!(t.modified()||e.changed()))return e;const n=e.materialize(e.SOURCE).source,r=Wne(e.source,t.groupby,na),i=t.smooth||!1,o=t.field,s=t.step||t2t(n,o),a=ab((p,g)=>o(p)-o(g)),l=t.as||HLe,c=r.length;let u=1/0,f=-1/0,d=0,h;for(;df&&(f=g),p[++h][l]=g}return this.value={start:u,stop:f,step:s},e.reflow(!0).modifies(l)}});function qLe(t){Ir.call(this,null,n2t,t),this.modified(!0)}it(qLe,Ir);function n2t(t){const e=t.expr;return this.value&&!t.modified("expr")?this.value:Pl(n=>e(n,t),Ks(e),Ni(e))}function Gne(t){Re.call(this,[void 0,void 0],t)}Gne.Definition={type:"Extent",metadata:{},params:[{name:"field",type:"field",required:!0}]};it(Gne,Re,{transform(t,e){const n=this.value,r=t.field,i=e.changed()||e.modified(r.fields)||t.modified("field");let o=n[0],s=n[1];if((i||o==null)&&(o=1/0,s=-1/0),e.visit(i?e.SOURCE:e.ADD,a=>{const l=Ys(r(a));l!=null&&(ls&&(s=l))}),!Number.isFinite(o)||!Number.isFinite(s)){let a=Ni(r);a&&(a=` for field "${a}"`),e.dataflow.warn(`Infinite extent${a}: [${o}, ${s}]`),o=s=void 0}this.value=[o,s]}});function Hne(t,e){Ir.call(this,t),this.parent=e,this.count=0}it(Hne,Ir,{connect(t){return this.detachSubflow=t.detachSubflow,this.targets().add(t),t.source=this},add(t){this.count+=1,this.value.add.push(t)},rem(t){this.count-=1,this.value.rem.push(t)},mod(t){this.value.mod.push(t)},init(t){this.value.init(t,t.NO_SOURCE)},evaluate(){return this.value}});function dB(t){Re.call(this,{},t),this._keys=yO();const e=this._targets=[];e.active=0,e.forEach=n=>{for(let r=0,i=e.active;rr&&r.count>0);this.initTargets(n)}},initTargets(t){const e=this._targets,n=e.length,r=t?t.length:0;let i=0;for(;ithis.subflow(l,i,e);return this._group=t.group||{},this.initTargets(),e.visit(e.REM,l=>{const c=jt(l),u=o.get(c);u!==void 0&&(o.delete(c),a(u).rem(l))}),e.visit(e.ADD,l=>{const c=r(l);o.set(jt(l),c),a(c).add(l)}),s||e.modified(r.fields)?e.visit(e.MOD,l=>{const c=jt(l),u=o.get(c),f=r(l);u===f?a(f).mod(l):(o.set(c,f),a(u).rem(l),a(f).add(l))}):e.changed(e.MOD)&&e.visit(e.MOD,l=>{a(o.get(jt(l))).mod(l)}),s&&e.visit(e.REFLOW,l=>{const c=jt(l),u=o.get(c),f=r(l);u!==f&&(o.set(c,f),a(u).rem(l),a(f).add(l))}),e.clean()?n.runAfter(()=>{this.clean(),o.clean()}):o.empty>n.cleanThreshold&&n.runAfter(o.clean),e}});function XLe(t){Ir.call(this,null,r2t,t)}it(XLe,Ir);function r2t(t){return this.value&&!t.modified()?this.value:We(t.name)?pt(t.name).map(e=>Eu(e)):Eu(t.name,t.as)}function qne(t){Re.call(this,yO(),t)}qne.Definition={type:"Filter",metadata:{changes:!0},params:[{name:"expr",type:"expr",required:!0}]};it(qne,Re,{transform(t,e){const n=e.dataflow,r=this.value,i=e.fork(),o=i.add,s=i.rem,a=i.mod,l=t.expr;let c=!0;e.visit(e.REM,f=>{const d=jt(f);r.has(d)?r.delete(d):s.push(f)}),e.visit(e.ADD,f=>{l(f,t)?o.push(f):r.set(jt(f),1)});function u(f){const d=jt(f),h=l(f,t),p=r.get(d);h&&p?(r.delete(d),o.push(f)):!h&&!p?(r.set(d,1),s.push(f)):c&&h&&!p&&a.push(f)}return e.visit(e.MOD,u),t.modified()&&(c=!1,e.visit(e.REFLOW,u)),r.empty>n.cleanThreshold&&n.runAfter(r.clean),i}});function Xne(t){Re.call(this,[],t)}Xne.Definition={type:"Flatten",metadata:{generates:!0},params:[{name:"fields",type:"field",array:!0,required:!0},{name:"index",type:"string"},{name:"as",type:"string",array:!0}]};it(Xne,Re,{transform(t,e){const n=e.fork(e.NO_SOURCE),r=t.fields,i=GLe(r,t.as||[]),o=t.index||null,s=i.length;return n.rem=this.value,e.visit(e.SOURCE,a=>{const l=r.map(p=>p(a)),c=l.reduce((p,g)=>Math.max(p,g.length),0);let u=0,f,d,h;for(;u{for(let u=0,f;us[r]=n(s,t))}});function YLe(t){Re.call(this,[],t)}it(YLe,Re,{transform(t,e){const n=e.fork(e.ALL),r=t.generator;let i=this.value,o=t.size-i.length,s,a,l;if(o>0){for(s=[];--o>=0;)s.push(l=cr(r(t))),i.push(l);n.add=n.add.length?n.materialize(n.ADD).add.concat(s):s}else a=i.slice(0,-o),n.rem=n.rem.length?n.materialize(n.REM).rem.concat(a):a,i=i.slice(-o);return n.source=this.value=i,n}});const MI={value:"value",median:wIe,mean:zSt,min:Uq,max:$x},i2t=[];function Kne(t){Re.call(this,[],t)}Kne.Definition={type:"Impute",metadata:{changes:!0},params:[{name:"field",type:"field",required:!0},{name:"key",type:"field",required:!0},{name:"keyvals",array:!0},{name:"groupby",type:"field",array:!0},{name:"method",type:"enum",default:"value",values:["value","mean","median","max","min"]},{name:"value",default:0}]};function o2t(t){var e=t.method||MI.value,n;if(MI[e]==null)je("Unrecognized imputation method: "+e);else return e===MI.value?(n=t.value!==void 0?t.value:0,()=>n):MI[e]}function s2t(t){const e=t.field;return n=>n?e(n):NaN}it(Kne,Re,{transform(t,e){var n=e.fork(e.ALL),r=o2t(t),i=s2t(t),o=Ni(t.field),s=Ni(t.key),a=(t.groupby||[]).map(Ni),l=a2t(e.source,t.groupby,t.key,t.keyvals),c=[],u=this.value,f=l.domain.length,d,h,p,g,m,v,y,x,b,w;for(m=0,x=l.length;mv(m),o=[],s=r?r.slice():[],a={},l={},c,u,f,d,h,p,g,m;for(s.forEach((v,y)=>a[v]=y+1),d=0,g=t.length;dn.add(o))):(i=n.value=n.value||this.init(t),e.visit(e.REM,o=>n.rem(o)),e.visit(e.ADD,o=>n.add(o))),n.changes(),e.visit(e.SOURCE,o=>{cn(o,i[n.cellkey(o)].tuple)}),e.reflow(r).modifies(this._outputs)},changes(){const t=this._adds,e=this._mods;let n,r;for(n=0,r=this._alen;n{const p=One(h,s)[a],g=t.counts?h.length:1,m=u||Eh(h);fB(p,m,f,d).forEach(v=>{const y={};for(let x=0;x(this._pending=pt(i.data),o=>o.touch(this)))}:n.request(t.url,t.format).then(r=>VW(this,e,pt(r.data)))}});function c2t(t){return t.modified("async")&&!(t.modified("values")||t.modified("url")||t.modified("format"))}function VW(t,e,n){n.forEach(cr);const r=e.fork(e.NO_FIELDS&e.NO_SOURCE);return r.rem=t.value,t.value=r.source=r.add=n,t._pending=null,r.rem.length&&r.clean(!0),r}function ere(t){Re.call(this,{},t)}ere.Definition={type:"Lookup",metadata:{modifies:!0},params:[{name:"index",type:"index",params:[{name:"from",type:"data",required:!0},{name:"key",type:"field",required:!0}]},{name:"values",type:"field",array:!0},{name:"fields",type:"field",array:!0,required:!0},{name:"as",type:"string",array:!0},{name:"default",default:null}]};it(ere,Re,{transform(t,e){const n=t.fields,r=t.index,i=t.values,o=t.default==null?null:t.default,s=t.modified(),a=n.length;let l=s?e.SOURCE:e.ADD,c=e,u=t.as,f,d,h;return i?(d=i.length,a>1&&!u&&je('Multi-field lookup requires explicit "as" parameter.'),u&&u.length!==a*d&&je('The "as" parameter has too few output field names.'),u=u||i.map(Ni),f=function(p){for(var g=0,m=0,v,y;ge.modified(p.fields)),l|=h?e.MOD:0),e.visit(l,f),c.modifies(u)}});function ZLe(t){Ir.call(this,null,u2t,t)}it(ZLe,Ir);function u2t(t){if(this.value&&!t.modified())return this.value;const e=t.extents,n=e.length;let r=1/0,i=-1/0,o,s;for(o=0;oi&&(i=s[1]);return[r,i]}function JLe(t){Ir.call(this,null,f2t,t)}it(JLe,Ir);function f2t(t){return this.value&&!t.modified()?this.value:t.values.reduce((e,n)=>e.concat(n),[])}function e$e(t){Re.call(this,null,t)}it(e$e,Re,{transform(t,e){return this.modified(t.modified()),this.value=t,e.fork(e.NO_SOURCE|e.NO_FIELDS)}});function tre(t){iy.call(this,t)}tre.Definition={type:"Pivot",metadata:{generates:!0,changes:!0},params:[{name:"groupby",type:"field",array:!0},{name:"field",type:"field",required:!0},{name:"value",type:"field",required:!0},{name:"op",type:"enum",values:oR,default:"sum"},{name:"limit",type:"number",default:0},{name:"key",type:"field"}]};it(tre,iy,{_transform:iy.prototype.transform,transform(t,e){return this._transform(d2t(t,e),e)}});function d2t(t,e){const n=t.field,r=t.value,i=(t.op==="count"?"__count__":t.op)||"sum",o=Ks(n).concat(Ks(r)),s=p2t(n,t.limit||0,e);return e.changed()&&t.set("__pivot__",null,null,!0),{key:t.key,groupby:t.groupby,ops:s.map(()=>i),fields:s.map(a=>h2t(a,n,r,o)),as:s.map(a=>a+""),modified:t.modified.bind(t)}}function h2t(t,e,n,r){return Pl(i=>e(i)===t?n(i):NaN,r,t+"")}function p2t(t,e,n){const r={},i=[];return n.visit(n.SOURCE,o=>{const s=t(o);r[s]||(r[s]=1,i.push(s))}),i.sort(X4),e?i.slice(0,e):i}function t$e(t){dB.call(this,t)}it(t$e,dB,{transform(t,e){const n=t.subflow,r=t.field,i=o=>this.subflow(jt(o),n,e,o);return(t.modified("field")||r&&e.modified(Ks(r)))&&je("PreFacet does not support field modification."),this.initTargets(),r?(e.visit(e.MOD,o=>{const s=i(o);r(o).forEach(a=>s.mod(a))}),e.visit(e.ADD,o=>{const s=i(o);r(o).forEach(a=>s.add(cr(a)))}),e.visit(e.REM,o=>{const s=i(o);r(o).forEach(a=>s.rem(a))})):(e.visit(e.MOD,o=>i(o).mod(o)),e.visit(e.ADD,o=>i(o).add(o)),e.visit(e.REM,o=>i(o).rem(o))),e.clean()&&e.runAfter(()=>this.clean()),e}});function nre(t){Re.call(this,null,t)}nre.Definition={type:"Project",metadata:{generates:!0,changes:!0},params:[{name:"fields",type:"field",array:!0},{name:"as",type:"string",null:!0,array:!0}]};it(nre,Re,{transform(t,e){const n=e.fork(e.NO_SOURCE),r=t.fields,i=GLe(t.fields,t.as||[]),o=r?(a,l)=>g2t(a,l,r,i):iB;let s;return this.value?s=this.value:(e=e.addAll(),s=this.value={}),e.visit(e.REM,a=>{const l=jt(a);n.rem.push(s[l]),s[l]=null}),e.visit(e.ADD,a=>{const l=o(a,cr({}));s[jt(a)]=l,n.add.push(l)}),e.visit(e.MOD,a=>{n.mod.push(o(a,s[jt(a)]))}),n}});function g2t(t,e,n,r){for(let i=0,o=n.length;i{const d=bne(f,c);for(let h=0;h{const o=jt(i);n.rem.push(r[o]),r[o]=null}),e.visit(e.ADD,i=>{const o=vne(i);r[jt(i)]=o,n.add.push(o)}),e.visit(e.MOD,i=>{const o=r[jt(i)];for(const s in i)o[s]=i[s],n.modifies(s);n.mod.push(o)})),n}});function ire(t){Re.call(this,[],t),this.count=0}ire.Definition={type:"Sample",metadata:{},params:[{name:"size",type:"number",default:1e3}]};it(ire,Re,{transform(t,e){const n=e.fork(e.NO_SOURCE),r=t.modified("size"),i=t.size,o=this.value.reduce((u,f)=>(u[jt(f)]=1,u),{});let s=this.value,a=this.count,l=0;function c(u){let f,d;s.length=l&&(f=s[d],o[jt(f)]&&n.rem.push(f),s[d]=u)),++a}if(e.rem.length&&(e.visit(e.REM,u=>{const f=jt(u);o[f]&&(o[f]=-1,n.rem.push(u)),--a}),s=s.filter(u=>o[jt(u)]!==-1)),(e.rem.length||r)&&s.length{o[jt(u)]||c(u)}),l=-1),r&&s.length>i){const u=s.length-i;for(let f=0;f{o[jt(u)]&&n.mod.push(u)}),e.add.length&&e.visit(e.ADD,c),(e.add.length||l<0)&&(n.add=s.filter(u=>!o[jt(u)])),this.count=a,this.value=n.source=s,n}});function ore(t){Re.call(this,null,t)}ore.Definition={type:"Sequence",metadata:{generates:!0,changes:!0},params:[{name:"start",type:"number",required:!0},{name:"stop",type:"number",required:!0},{name:"step",type:"number",default:1},{name:"as",type:"string",default:"data"}]};it(ore,Re,{transform(t,e){if(this.value&&!t.modified())return;const n=e.materialize().fork(e.MOD),r=t.as||"data";return n.rem=this.value?e.rem.concat(this.value):e.rem,this.value=al(t.start,t.stop,t.step||1).map(i=>{const o={};return o[r]=i,cr(o)}),n.add=e.add.concat(this.value),n}});function i$e(t){Re.call(this,null,t),this.modified(!0)}it(i$e,Re,{transform(t,e){return this.value=e.source,e.changed()?e.fork(e.NO_SOURCE|e.NO_FIELDS):e.StopPropagation}});function sre(t){Re.call(this,null,t)}const o$e=["unit0","unit1"];sre.Definition={type:"TimeUnit",metadata:{modifies:!0},params:[{name:"field",type:"field",required:!0},{name:"interval",type:"boolean",default:!0},{name:"units",type:"enum",values:lne,array:!0},{name:"step",type:"number",default:1},{name:"maxbins",type:"number",default:40},{name:"extent",type:"date",array:!0},{name:"timezone",type:"enum",default:"local",values:["local","utc"]},{name:"as",type:"string",array:!0,length:2,default:o$e}]};it(sre,Re,{transform(t,e){const n=t.field,r=t.interval!==!1,i=t.timezone==="utc",o=this._floor(t,e),s=(i?SO:_O)(o.unit).offset,a=t.as||o$e,l=a[0],c=a[1],u=o.step;let f=o.start||1/0,d=o.stop||-1/0,h=e.ADD;return(t.modified()||e.changed(e.REM)||e.modified(Ks(n)))&&(e=e.reflow(!0),h=e.SOURCE,f=1/0,d=-1/0),e.visit(h,p=>{const g=n(p);let m,v;g==null?(p[l]=null,r&&(p[c]=null)):(p[l]=m=v=o(g),r&&(p[c]=v=s(m,u)),md&&(d=v))}),o.start=f,o.stop=d,e.modifies(r?a:l)},_floor(t,e){const n=t.timezone==="utc",{units:r,step:i}=t.units?{units:t.units,step:t.step||1}:YIe({extent:t.extent||Eh(e.materialize(e.SOURCE).source,t.field),maxbins:t.maxbins}),o=cne(r),s=this.value||{},a=(n?jIe:zIe)(o,i);return a.unit=$n(o),a.units=o,a.step=i,a.start=s.start,a.stop=s.stop,this.value=a}});function s$e(t){Re.call(this,yO(),t)}it(s$e,Re,{transform(t,e){const n=e.dataflow,r=t.field,i=this.value,o=a=>i.set(r(a),a);let s=!0;return t.modified("field")||e.modified(r.fields)?(i.clear(),e.visit(e.SOURCE,o)):e.changed()?(e.visit(e.REM,a=>i.delete(r(a))),e.visit(e.ADD,o)):s=!1,this.modified(s),i.empty>n.cleanThreshold&&n.runAfter(i.clean),e.fork()}});function a$e(t){Re.call(this,null,t)}it(a$e,Re,{transform(t,e){(!this.value||t.modified("field")||t.modified("sort")||e.changed()||t.sort&&e.modified(t.sort.fields))&&(this.value=(t.sort?e.source.slice().sort(ab(t.sort)):e.source).map(t.field))}});function v2t(t,e,n,r){const i=EA[t](e,n);return{init:i.init||rv,update:function(o,s){s[r]=i.next(o)}}}const EA={row_number:function(){return{next:t=>t.index+1}},rank:function(){let t;return{init:()=>t=1,next:e=>{const n=e.index,r=e.data;return n&&e.compare(r[n-1],r[n])?t=n+1:t}}},dense_rank:function(){let t;return{init:()=>t=1,next:e=>{const n=e.index,r=e.data;return n&&e.compare(r[n-1],r[n])?++t:t}}},percent_rank:function(){const t=EA.rank(),e=t.next;return{init:t.init,next:n=>(e(n)-1)/(n.data.length-1)}},cume_dist:function(){let t;return{init:()=>t=0,next:e=>{const n=e.data,r=e.compare;let i=e.index;if(t0||je("ntile num must be greater than zero.");const n=EA.cume_dist(),r=n.next;return{init:n.init,next:i=>Math.ceil(e*r(i))}},lag:function(t,e){return e=+e||1,{next:n=>{const r=n.index-e;return r>=0?t(n.data[r]):null}}},lead:function(t,e){return e=+e||1,{next:n=>{const r=n.index+e,i=n.data;return rt(e.data[e.i0])}},last_value:function(t){return{next:e=>t(e.data[e.i1-1])}},nth_value:function(t,e){return e=+e,e>0||je("nth_value nth must be greater than zero."),{next:n=>{const r=n.i0+(e-1);return re=null,next:n=>{const r=t(n.data[n.index]);return r!=null?e=r:e}}},next_value:function(t){let e,n;return{init:()=>(e=null,n=-1),next:r=>{const i=r.data;return r.index<=n?e:(n=y2t(t,i,r.index))<0?(n=i.length,e=null):e=t(i[n])}}}};function y2t(t,e,n){for(let r=e.length;nl[g]=1)}h(t.sort),e.forEach((p,g)=>{const m=n[g],v=r[g],y=i[g]||null,x=Ni(m),b=FLe(p,x,o[g]);if(h(m),s.push(b),vt(EA,p))a.push(v2t(p,m,v,b));else{if(m==null&&p!=="count"&&je("Null aggregate field specified."),p==="count"){u.push(b);return}d=!1;let w=c[x];w||(w=c[x]=[],w.field=m,f.push(w)),w.push(NLe(p,y,b))}}),(u.length||f.length)&&(this.cell=b2t(f,u,d)),this.inputs=Object.keys(l)}const c$e=l$e.prototype;c$e.init=function(){this.windows.forEach(t=>t.init()),this.cell&&this.cell.init()};c$e.update=function(t,e){const n=this.cell,r=this.windows,i=t.data,o=r&&r.length;let s;if(n){for(s=t.p0;sjLe(l,l.field));const r={num:0,agg:null,store:!1,count:e};if(!n)for(var i=t.length,o=r.agg=Array(i),s=0;sthis.group(i(a));let s=this.state;(!s||n)&&(s=this.state=new l$e(t)),n||e.modified(s.inputs)?(this.value={},e.visit(e.SOURCE,a=>o(a).add(a))):(e.visit(e.REM,a=>o(a).remove(a)),e.visit(e.ADD,a=>o(a).add(a)));for(let a=0,l=this._mlen;a0&&!i(o[n],o[n-1])&&(t.i0=e.left(o,o[n])),r1?0:t<-1?oy:Math.acos(t)}function Wpe(t){return t>=1?ON:t<=-1?-ON:Math.asin(t)}const Jq=Math.PI,eX=2*Jq,B0=1e-6,T2t=eX-B0;function u$e(t){this._+=t[0];for(let e=1,n=t.length;e=0))throw new Error(`invalid digits: ${t}`);if(e>15)return u$e;const n=10**e;return function(r){this._+=r[0];for(let i=1,o=r.length;iB0)if(!(Math.abs(f*l-c*u)>B0)||!o)this._append`L${this._x1=e},${this._y1=n}`;else{let h=r-s,p=i-a,g=l*l+c*c,m=h*h+p*p,v=Math.sqrt(g),y=Math.sqrt(d),x=o*Math.tan((Jq-Math.acos((g+d-m)/(2*v*y)))/2),b=x/y,w=x/v;Math.abs(b-1)>B0&&this._append`L${e+b*u},${n+b*f}`,this._append`A${o},${o},0,0,${+(f*h>u*p)},${this._x1=e+w*l},${this._y1=n+w*c}`}}arc(e,n,r,i,o,s){if(e=+e,n=+n,r=+r,s=!!s,r<0)throw new Error(`negative radius: ${r}`);let a=r*Math.cos(i),l=r*Math.sin(i),c=e+a,u=n+l,f=1^s,d=s?i-o:o-i;this._x1===null?this._append`M${c},${u}`:(Math.abs(this._x1-c)>B0||Math.abs(this._y1-u)>B0)&&this._append`L${c},${u}`,r&&(d<0&&(d=d%eX+eX),d>T2t?this._append`A${r},${r},0,1,${f},${e-a},${n-l}A${r},${r},0,1,${f},${this._x1=c},${this._y1=u}`:d>B0&&this._append`A${r},${r},0,${+(d>=Jq)},${f},${this._x1=e+r*Math.cos(o)},${this._y1=n+r*Math.sin(o)}`)}rect(e,n,r,i){this._append`M${this._x0=this._x1=+e},${this._y0=this._y1=+n}h${r=+r}v${+i}h${-r}Z`}toString(){return this._}};function hB(){return new lre}hB.prototype=lre.prototype;function pB(t){let e=3;return t.digits=function(n){if(!arguments.length)return e;if(n==null)e=null;else{const r=Math.floor(n);if(!(r>=0))throw new RangeError(`invalid digits: ${n}`);e=r}return t},()=>new lre(e)}function A2t(t){return t.innerRadius}function P2t(t){return t.outerRadius}function M2t(t){return t.startAngle}function R2t(t){return t.endAngle}function D2t(t){return t&&t.padAngle}function I2t(t,e,n,r,i,o,s,a){var l=n-t,c=r-e,u=s-i,f=a-o,d=f*l-u*c;if(!(d*dT*T+R*R&&(O=E,k=M),{cx:O,cy:k,x01:-u,y01:-f,x11:O*(i/w-1),y11:k*(i/w-1)}}function L2t(){var t=A2t,e=P2t,n=Nn(0),r=null,i=M2t,o=R2t,s=D2t,a=null,l=pB(c);function c(){var u,f,d=+t.apply(this,arguments),h=+e.apply(this,arguments),p=i.apply(this,arguments)-ON,g=o.apply(this,arguments)-ON,m=Upe(g-p),v=g>p;if(a||(a=u=l()),hFs))a.moveTo(0,0);else if(m>sR-Fs)a.moveTo(h*Pp(p),h*Ha(p)),a.arc(0,0,h,p,g,!v),d>Fs&&(a.moveTo(d*Pp(g),d*Ha(g)),a.arc(0,0,d,g,p,v));else{var y=p,x=g,b=p,w=g,_=m,S=m,O=s.apply(this,arguments)/2,k=O>Fs&&(r?+r.apply(this,arguments):ds(d*d+h*h)),E=GW(Upe(h-d)/2,+n.apply(this,arguments)),M=E,A=E,P,T;if(k>Fs){var R=Wpe(k/d*Ha(O)),I=Wpe(k/h*Ha(O));(_-=R*2)>Fs?(R*=v?1:-1,b+=R,w-=R):(_=0,b=w=(p+g)/2),(S-=I*2)>Fs?(I*=v?1:-1,y+=I,x-=I):(S=0,y=x=(p+g)/2)}var B=h*Pp(y),$=h*Ha(y),z=d*Pp(w),L=d*Ha(w);if(E>Fs){var j=h*Pp(x),N=h*Ha(x),F=d*Pp(b),H=d*Ha(b),q;if(mFs?A>Fs?(P=RI(F,H,B,$,h,A,v),T=RI(j,N,z,L,h,A,v),a.moveTo(P.cx+P.x01,P.cy+P.y01),AFs)||!(_>Fs)?a.lineTo(z,L):M>Fs?(P=RI(z,L,j,N,d,-M,v),T=RI(B,$,F,H,d,-M,v),a.lineTo(P.cx+P.x01,P.cy+P.y01),M=h;--p)a.point(x[p],b[p]);a.lineEnd(),a.areaEnd()}v&&(x[d]=+t(m,d,f),b[d]=+e(m,d,f),a.point(r?+r(m,d,f):x[d],n?+n(m,d,f):b[d]))}if(y)return a=null,y+""||null}function u(){return ure().defined(i).curve(s).context(o)}return c.x=function(f){return arguments.length?(t=typeof f=="function"?f:Nn(+f),r=null,c):t},c.x0=function(f){return arguments.length?(t=typeof f=="function"?f:Nn(+f),c):t},c.x1=function(f){return arguments.length?(r=f==null?null:typeof f=="function"?f:Nn(+f),c):r},c.y=function(f){return arguments.length?(e=typeof f=="function"?f:Nn(+f),n=null,c):e},c.y0=function(f){return arguments.length?(e=typeof f=="function"?f:Nn(+f),c):e},c.y1=function(f){return arguments.length?(n=f==null?null:typeof f=="function"?f:Nn(+f),c):n},c.lineX0=c.lineY0=function(){return u().x(t).y(e)},c.lineY1=function(){return u().x(t).y(n)},c.lineX1=function(){return u().x(r).y(e)},c.defined=function(f){return arguments.length?(i=typeof f=="function"?f:Nn(!!f),c):i},c.curve=function(f){return arguments.length?(s=f,o!=null&&(a=s(o)),c):s},c.context=function(f){return arguments.length?(f==null?o=a=null:a=s(o=f),c):o},c}class p$e{constructor(e,n){this._context=e,this._x=n}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line}point(e,n){switch(e=+e,n=+n,this._point){case 0:{this._point=1,this._line?this._context.lineTo(e,n):this._context.moveTo(e,n);break}case 1:this._point=2;default:{this._x?this._context.bezierCurveTo(this._x0=(this._x0+e)/2,this._y0,this._x0,n,e,n):this._context.bezierCurveTo(this._x0,this._y0=(this._y0+n)/2,e,this._y0,e,n);break}}this._x0=e,this._y0=n}}function $2t(t){return new p$e(t,!0)}function F2t(t){return new p$e(t,!1)}const fre={draw(t,e){const n=ds(e/oy);t.moveTo(n,0),t.arc(0,0,n,0,sR)}},N2t={draw(t,e){const n=ds(e/5)/2;t.moveTo(-3*n,-n),t.lineTo(-n,-n),t.lineTo(-n,-3*n),t.lineTo(n,-3*n),t.lineTo(n,-n),t.lineTo(3*n,-n),t.lineTo(3*n,n),t.lineTo(n,n),t.lineTo(n,3*n),t.lineTo(-n,3*n),t.lineTo(-n,n),t.lineTo(-3*n,n),t.closePath()}},g$e=ds(1/3),z2t=g$e*2,j2t={draw(t,e){const n=ds(e/z2t),r=n*g$e;t.moveTo(0,-n),t.lineTo(r,0),t.lineTo(0,n),t.lineTo(-r,0),t.closePath()}},B2t={draw(t,e){const n=ds(e),r=-n/2;t.rect(r,r,n,n)}},U2t=.8908130915292852,m$e=Ha(oy/10)/Ha(7*oy/10),W2t=Ha(sR/10)*m$e,V2t=-Pp(sR/10)*m$e,G2t={draw(t,e){const n=ds(e*U2t),r=W2t*n,i=V2t*n;t.moveTo(0,-n),t.lineTo(r,i);for(let o=1;o<5;++o){const s=sR*o/5,a=Pp(s),l=Ha(s);t.lineTo(l*n,-a*n),t.lineTo(a*r-l*i,l*r+a*i)}t.closePath()}},HW=ds(3),H2t={draw(t,e){const n=-ds(e/(HW*3));t.moveTo(0,n*2),t.lineTo(-HW*n,-n),t.lineTo(HW*n,-n),t.closePath()}},Fc=-.5,Nc=ds(3)/2,tX=1/ds(12),q2t=(tX/2+1)*3,X2t={draw(t,e){const n=ds(e/q2t),r=n/2,i=n*tX,o=r,s=n*tX+n,a=-o,l=s;t.moveTo(r,i),t.lineTo(o,s),t.lineTo(a,l),t.lineTo(Fc*r-Nc*i,Nc*r+Fc*i),t.lineTo(Fc*o-Nc*s,Nc*o+Fc*s),t.lineTo(Fc*a-Nc*l,Nc*a+Fc*l),t.lineTo(Fc*r+Nc*i,Fc*i-Nc*r),t.lineTo(Fc*o+Nc*s,Fc*s-Nc*o),t.lineTo(Fc*a+Nc*l,Fc*l-Nc*a),t.closePath()}};function v$e(t,e){let n=null,r=pB(i);t=typeof t=="function"?t:Nn(t||fre),e=typeof e=="function"?e:Nn(e===void 0?64:+e);function i(){let o;if(n||(n=o=r()),t.apply(this,arguments).draw(n,+e.apply(this,arguments)),o)return n=null,o+""||null}return i.type=function(o){return arguments.length?(t=typeof o=="function"?o:Nn(o),i):t},i.size=function(o){return arguments.length?(e=typeof o=="function"?o:Nn(+o),i):e},i.context=function(o){return arguments.length?(n=o??null,i):n},i}function sy(){}function EN(t,e,n){t._context.bezierCurveTo((2*t._x0+t._x1)/3,(2*t._y0+t._y1)/3,(t._x0+2*t._x1)/3,(t._y0+2*t._y1)/3,(t._x0+4*t._x1+e)/6,(t._y0+4*t._y1+n)/6)}function gB(t){this._context=t}gB.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:EN(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:EN(this,t,e);break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}};function y$e(t){return new gB(t)}function x$e(t){this._context=t}x$e.prototype={areaStart:sy,areaEnd:sy,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._y0=this._y1=this._y2=this._y3=this._y4=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x2,this._y2),this._context.closePath();break}case 2:{this._context.moveTo((this._x2+2*this._x3)/3,(this._y2+2*this._y3)/3),this._context.lineTo((this._x3+2*this._x2)/3,(this._y3+2*this._y2)/3),this._context.closePath();break}case 3:{this.point(this._x2,this._y2),this.point(this._x3,this._y3),this.point(this._x4,this._y4);break}}},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._x2=t,this._y2=e;break;case 1:this._point=2,this._x3=t,this._y3=e;break;case 2:this._point=3,this._x4=t,this._y4=e,this._context.moveTo((this._x0+4*this._x1+t)/6,(this._y0+4*this._y1+e)/6);break;default:EN(this,t,e);break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}};function b$e(t){return new x$e(t)}function w$e(t){this._context=t}w$e.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var n=(this._x0+4*this._x1+t)/6,r=(this._y0+4*this._y1+e)/6;this._line?this._context.lineTo(n,r):this._context.moveTo(n,r);break;case 3:this._point=4;default:EN(this,t,e);break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}};function _$e(t){return new w$e(t)}function S$e(t,e){this._basis=new gB(t),this._beta=e}S$e.prototype={lineStart:function(){this._x=[],this._y=[],this._basis.lineStart()},lineEnd:function(){var t=this._x,e=this._y,n=t.length-1;if(n>0)for(var r=t[0],i=e[0],o=t[n]-r,s=e[n]-i,a=-1,l;++a<=n;)l=a/n,this._basis.point(this._beta*t[a]+(1-this._beta)*(r+l*o),this._beta*e[a]+(1-this._beta)*(i+l*s));this._x=this._y=null,this._basis.lineEnd()},point:function(t,e){this._x.push(+t),this._y.push(+e)}};const Y2t=function t(e){function n(r){return e===1?new gB(r):new S$e(r,e)}return n.beta=function(r){return t(+r)},n}(.85);function TN(t,e,n){t._context.bezierCurveTo(t._x1+t._k*(t._x2-t._x0),t._y1+t._k*(t._y2-t._y0),t._x2+t._k*(t._x1-e),t._y2+t._k*(t._y1-n),t._x2,t._y2)}function dre(t,e){this._context=t,this._k=(1-e)/6}dre.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:TN(this,this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2,this._x1=t,this._y1=e;break;case 2:this._point=3;default:TN(this,t,e);break}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};const Q2t=function t(e){function n(r){return new dre(r,e)}return n.tension=function(r){return t(+r)},n}(0);function hre(t,e){this._context=t,this._k=(1-e)/6}hre.prototype={areaStart:sy,areaEnd:sy,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x3,this._y3),this._context.closePath();break}case 2:{this._context.lineTo(this._x3,this._y3),this._context.closePath();break}case 3:{this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5);break}}},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._x3=t,this._y3=e;break;case 1:this._point=2,this._context.moveTo(this._x4=t,this._y4=e);break;case 2:this._point=3,this._x5=t,this._y5=e;break;default:TN(this,t,e);break}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};const K2t=function t(e){function n(r){return new hre(r,e)}return n.tension=function(r){return t(+r)},n}(0);function pre(t,e){this._context=t,this._k=(1-e)/6}pre.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:TN(this,t,e);break}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};const Z2t=function t(e){function n(r){return new pre(r,e)}return n.tension=function(r){return t(+r)},n}(0);function gre(t,e,n){var r=t._x1,i=t._y1,o=t._x2,s=t._y2;if(t._l01_a>Fs){var a=2*t._l01_2a+3*t._l01_a*t._l12_a+t._l12_2a,l=3*t._l01_a*(t._l01_a+t._l12_a);r=(r*a-t._x0*t._l12_2a+t._x2*t._l01_2a)/l,i=(i*a-t._y0*t._l12_2a+t._y2*t._l01_2a)/l}if(t._l23_a>Fs){var c=2*t._l23_2a+3*t._l23_a*t._l12_a+t._l12_2a,u=3*t._l23_a*(t._l23_a+t._l12_a);o=(o*c+t._x1*t._l23_2a-e*t._l12_2a)/u,s=(s*c+t._y1*t._l23_2a-n*t._l12_2a)/u}t._context.bezierCurveTo(r,i,o,s,t._x2,t._y2)}function C$e(t,e){this._context=t,this._alpha=e}C$e.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:this.point(this._x2,this._y2);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){if(t=+t,e=+e,this._point){var n=this._x2-t,r=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+r*r,this._alpha))}switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3;default:gre(this,t,e);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};const J2t=function t(e){function n(r){return e?new C$e(r,e):new dre(r,0)}return n.alpha=function(r){return t(+r)},n}(.5);function O$e(t,e){this._context=t,this._alpha=e}O$e.prototype={areaStart:sy,areaEnd:sy,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x3,this._y3),this._context.closePath();break}case 2:{this._context.lineTo(this._x3,this._y3),this._context.closePath();break}case 3:{this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5);break}}},point:function(t,e){if(t=+t,e=+e,this._point){var n=this._x2-t,r=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+r*r,this._alpha))}switch(this._point){case 0:this._point=1,this._x3=t,this._y3=e;break;case 1:this._point=2,this._context.moveTo(this._x4=t,this._y4=e);break;case 2:this._point=3,this._x5=t,this._y5=e;break;default:gre(this,t,e);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};const eTt=function t(e){function n(r){return e?new O$e(r,e):new hre(r,0)}return n.alpha=function(r){return t(+r)},n}(.5);function E$e(t,e){this._context=t,this._alpha=e}E$e.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){if(t=+t,e=+e,this._point){var n=this._x2-t,r=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+r*r,this._alpha))}switch(this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:gre(this,t,e);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};const tTt=function t(e){function n(r){return e?new E$e(r,e):new pre(r,0)}return n.alpha=function(r){return t(+r)},n}(.5);function T$e(t){this._context=t}T$e.prototype={areaStart:sy,areaEnd:sy,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(t,e){t=+t,e=+e,this._point?this._context.lineTo(t,e):(this._point=1,this._context.moveTo(t,e))}};function k$e(t){return new T$e(t)}function Vpe(t){return t<0?-1:1}function Gpe(t,e,n){var r=t._x1-t._x0,i=e-t._x1,o=(t._y1-t._y0)/(r||i<0&&-0),s=(n-t._y1)/(i||r<0&&-0),a=(o*i+s*r)/(r+i);return(Vpe(o)+Vpe(s))*Math.min(Math.abs(o),Math.abs(s),.5*Math.abs(a))||0}function Hpe(t,e){var n=t._x1-t._x0;return n?(3*(t._y1-t._y0)/n-e)/2:e}function qW(t,e,n){var r=t._x0,i=t._y0,o=t._x1,s=t._y1,a=(o-r)/3;t._context.bezierCurveTo(r+a,i+a*e,o-a,s-a*n,o,s)}function kN(t){this._context=t}kN.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:qW(this,this._t0,Hpe(this,this._t0));break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){var n=NaN;if(t=+t,e=+e,!(t===this._x1&&e===this._y1)){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3,qW(this,Hpe(this,n=Gpe(this,t,e)),n);break;default:qW(this,this._t0,n=Gpe(this,t,e));break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e,this._t0=n}}};function A$e(t){this._context=new P$e(t)}(A$e.prototype=Object.create(kN.prototype)).point=function(t,e){kN.prototype.point.call(this,e,t)};function P$e(t){this._context=t}P$e.prototype={moveTo:function(t,e){this._context.moveTo(e,t)},closePath:function(){this._context.closePath()},lineTo:function(t,e){this._context.lineTo(e,t)},bezierCurveTo:function(t,e,n,r,i,o){this._context.bezierCurveTo(e,t,r,n,o,i)}};function M$e(t){return new kN(t)}function R$e(t){return new A$e(t)}function D$e(t){this._context=t}D$e.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var t=this._x,e=this._y,n=t.length;if(n)if(this._line?this._context.lineTo(t[0],e[0]):this._context.moveTo(t[0],e[0]),n===2)this._context.lineTo(t[1],e[1]);else for(var r=qpe(t),i=qpe(e),o=0,s=1;s=0;--e)i[e]=(s[e]-i[e+1])/o[e];for(o[n-1]=(t[n]+i[n-1])/2,e=0;e=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;default:{if(this._t<=0)this._context.lineTo(this._x,e),this._context.lineTo(t,e);else{var n=this._x*(1-this._t)+t*this._t;this._context.lineTo(n,this._y),this._context.lineTo(n,e)}break}}this._x=t,this._y=e}};function L$e(t){return new mB(t,.5)}function $$e(t){return new mB(t,0)}function F$e(t){return new mB(t,1)}function LS(t,e){if((s=t.length)>1)for(var n=1,r,i,o=t[e[0]],s,a=o.length;n=0;)n[e]=e;return n}function nTt(t,e){return t[e]}function rTt(t){const e=[];return e.key=t,e}function iTt(){var t=Nn([]),e=nX,n=LS,r=nTt;function i(o){var s=Array.from(t.apply(this,arguments),rTt),a,l=s.length,c=-1,u;for(const f of o)for(a=0,++c;a0){for(var n,r,i=0,o=t[0].length,s;i0){for(var n=0,r=t[e[0]],i,o=r.length;n0)||!((o=(i=t[e[0]]).length)>0))){for(var n=0,r=1,i,o,s;rtypeof Image<"u"?Image:null;function Nu(t,e){switch(arguments.length){case 0:break;case 1:this.range(t);break;default:this.range(e).domain(t);break}return this}function Xg(t,e){switch(arguments.length){case 0:break;case 1:{typeof t=="function"?this.interpolator(t):this.range(t);break}default:{this.domain(t),typeof e=="function"?this.interpolator(e):this.range(e);break}}return this}const AN=Symbol("implicit");function lR(){var t=new upe,e=[],n=[],r=AN;function i(o){let s=t.get(o);if(s===void 0){if(r!==AN)return r;t.set(o,s=e.push(o)-1)}return n[s%n.length]}return i.domain=function(o){if(!arguments.length)return e.slice();e=[],t=new upe;for(const s of o)t.has(s)||t.set(s,e.push(s)-1);return i},i.range=function(o){return arguments.length?(n=Array.from(o),i):n.slice()},i.unknown=function(o){return arguments.length?(r=o,i):r},i.copy=function(){return lR(e,n).unknown(r)},Nu.apply(i,arguments),i}function TA(){var t=lR().unknown(void 0),e=t.domain,n=t.range,r=0,i=1,o,s,a=!1,l=0,c=0,u=.5;delete t.unknown;function f(){var d=e().length,h=i>8&15|e>>4&240,e>>4&15|e&240,(e&15)<<4|e&15,1):n===8?DI(e>>24&255,e>>16&255,e>>8&255,(e&255)/255):n===4?DI(e>>12&15|e>>8&240,e>>8&15|e>>4&240,e>>4&15|e&240,((e&15)<<4|e&15)/255):null):(e=uTt.exec(t))?new Lo(e[1],e[2],e[3],1):(e=fTt.exec(t))?new Lo(e[1]*255/100,e[2]*255/100,e[3]*255/100,1):(e=dTt.exec(t))?DI(e[1],e[2],e[3],e[4]):(e=hTt.exec(t))?DI(e[1]*255/100,e[2]*255/100,e[3]*255/100,e[4]):(e=pTt.exec(t))?ege(e[1],e[2]/100,e[3]/100,1):(e=gTt.exec(t))?ege(e[1],e[2]/100,e[3]/100,e[4]):Xpe.hasOwnProperty(t)?Kpe(Xpe[t]):t==="transparent"?new Lo(NaN,NaN,NaN,0):null}function Kpe(t){return new Lo(t>>16&255,t>>8&255,t&255,1)}function DI(t,e,n,r){return r<=0&&(t=e=n=NaN),new Lo(t,e,n,r)}function mre(t){return t instanceof Uy||(t=AA(t)),t?(t=t.rgb(),new Lo(t.r,t.g,t.b,t.opacity)):new Lo}function ay(t,e,n,r){return arguments.length===1?mre(t):new Lo(t,e,n,r??1)}function Lo(t,e,n,r){this.r=+t,this.g=+e,this.b=+n,this.opacity=+r}OO(Lo,ay,cR(Uy,{brighter(t){return t=t==null?$S:Math.pow($S,t),new Lo(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=t==null?u1:Math.pow(u1,t),new Lo(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new Lo(Fx(this.r),Fx(this.g),Fx(this.b),PN(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:Zpe,formatHex:Zpe,formatHex8:yTt,formatRgb:Jpe,toString:Jpe}));function Zpe(){return`#${px(this.r)}${px(this.g)}${px(this.b)}`}function yTt(){return`#${px(this.r)}${px(this.g)}${px(this.b)}${px((isNaN(this.opacity)?1:this.opacity)*255)}`}function Jpe(){const t=PN(this.opacity);return`${t===1?"rgb(":"rgba("}${Fx(this.r)}, ${Fx(this.g)}, ${Fx(this.b)}${t===1?")":`, ${t})`}`}function PN(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function Fx(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function px(t){return t=Fx(t),(t<16?"0":"")+t.toString(16)}function ege(t,e,n,r){return r<=0?t=e=n=NaN:n<=0||n>=1?t=e=NaN:e<=0&&(t=NaN),new Sf(t,e,n,r)}function z$e(t){if(t instanceof Sf)return new Sf(t.h,t.s,t.l,t.opacity);if(t instanceof Uy||(t=AA(t)),!t)return new Sf;if(t instanceof Sf)return t;t=t.rgb();var e=t.r/255,n=t.g/255,r=t.b/255,i=Math.min(e,n,r),o=Math.max(e,n,r),s=NaN,a=o-i,l=(o+i)/2;return a?(e===o?s=(n-r)/a+(n0&&l<1?0:s,new Sf(s,a,l,t.opacity)}function MN(t,e,n,r){return arguments.length===1?z$e(t):new Sf(t,e,n,r??1)}function Sf(t,e,n,r){this.h=+t,this.s=+e,this.l=+n,this.opacity=+r}OO(Sf,MN,cR(Uy,{brighter(t){return t=t==null?$S:Math.pow($S,t),new Sf(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=t==null?u1:Math.pow(u1,t),new Sf(this.h,this.s,this.l*t,this.opacity)},rgb(){var t=this.h%360+(this.h<0)*360,e=isNaN(t)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*e,i=2*n-r;return new Lo(XW(t>=240?t-240:t+120,i,r),XW(t,i,r),XW(t<120?t+240:t-120,i,r),this.opacity)},clamp(){return new Sf(tge(this.h),II(this.s),II(this.l),PN(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const t=PN(this.opacity);return`${t===1?"hsl(":"hsla("}${tge(this.h)}, ${II(this.s)*100}%, ${II(this.l)*100}%${t===1?")":`, ${t})`}`}}));function tge(t){return t=(t||0)%360,t<0?t+360:t}function II(t){return Math.max(0,Math.min(1,t||0))}function XW(t,e,n){return(t<60?e+(n-e)*t/60:t<180?n:t<240?e+(n-e)*(240-t)/60:e)*255}const j$e=Math.PI/180,B$e=180/Math.PI,RN=18,U$e=.96422,W$e=1,V$e=.82521,G$e=4/29,L_=6/29,H$e=3*L_*L_,xTt=L_*L_*L_;function q$e(t){if(t instanceof vh)return new vh(t.l,t.a,t.b,t.opacity);if(t instanceof Qp)return X$e(t);t instanceof Lo||(t=mre(t));var e=ZW(t.r),n=ZW(t.g),r=ZW(t.b),i=YW((.2225045*e+.7168786*n+.0606169*r)/W$e),o,s;return e===n&&n===r?o=s=i:(o=YW((.4360747*e+.3850649*n+.1430804*r)/U$e),s=YW((.0139322*e+.0971045*n+.7141733*r)/V$e)),new vh(116*i-16,500*(o-i),200*(i-s),t.opacity)}function DN(t,e,n,r){return arguments.length===1?q$e(t):new vh(t,e,n,r??1)}function vh(t,e,n,r){this.l=+t,this.a=+e,this.b=+n,this.opacity=+r}OO(vh,DN,cR(Uy,{brighter(t){return new vh(this.l+RN*(t??1),this.a,this.b,this.opacity)},darker(t){return new vh(this.l-RN*(t??1),this.a,this.b,this.opacity)},rgb(){var t=(this.l+16)/116,e=isNaN(this.a)?t:t+this.a/500,n=isNaN(this.b)?t:t-this.b/200;return e=U$e*QW(e),t=W$e*QW(t),n=V$e*QW(n),new Lo(KW(3.1338561*e-1.6168667*t-.4906146*n),KW(-.9787684*e+1.9161415*t+.033454*n),KW(.0719453*e-.2289914*t+1.4052427*n),this.opacity)}}));function YW(t){return t>xTt?Math.pow(t,1/3):t/H$e+G$e}function QW(t){return t>L_?t*t*t:H$e*(t-G$e)}function KW(t){return 255*(t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055)}function ZW(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function bTt(t){if(t instanceof Qp)return new Qp(t.h,t.c,t.l,t.opacity);if(t instanceof vh||(t=q$e(t)),t.a===0&&t.b===0)return new Qp(NaN,0=1?(n=1,e-1):Math.floor(n*e),i=t[r],o=t[r+1],s=r>0?t[r-1]:2*i-o,a=r()=>t;function J$e(t,e){return function(n){return t+n*e}}function _Tt(t,e,n){return t=Math.pow(t,n),e=Math.pow(e,n)-t,n=1/n,function(r){return Math.pow(t+r*e,n)}}function xB(t,e){var n=e-t;return n?J$e(t,n>180||n<-180?n-360*Math.round(n/360):n):yB(isNaN(t)?e:t)}function STt(t){return(t=+t)==1?$o:function(e,n){return n-e?_Tt(e,n,t):yB(isNaN(e)?n:e)}}function $o(t,e){var n=e-t;return n?J$e(t,n):yB(isNaN(t)?e:t)}const iX=function t(e){var n=STt(e);function r(i,o){var s=n((i=ay(i)).r,(o=ay(o)).r),a=n(i.g,o.g),l=n(i.b,o.b),c=$o(i.opacity,o.opacity);return function(u){return i.r=s(u),i.g=a(u),i.b=l(u),i.opacity=c(u),i+""}}return r.gamma=t,r}(1);function e3e(t){return function(e){var n=e.length,r=new Array(n),i=new Array(n),o=new Array(n),s,a;for(s=0;sn&&(o=e.slice(n,o),a[s]?a[s]+=o:a[++s]=o),(r=r[0])===(i=i[0])?a[s]?a[s]+=i:a[++s]=i:(a[++s]=null,l.push({i:s,x:yf(r,i)})),n=JW.lastIndex;return n180?u+=360:u-c>180&&(c+=360),d.push({i:f.push(i(f)+"rotate(",null,r)-2,x:yf(c,u)})):u&&f.push(i(f)+"rotate("+u+r)}function a(c,u,f,d){c!==u?d.push({i:f.push(i(f)+"skewX(",null,r)-2,x:yf(c,u)}):u&&f.push(i(f)+"skewX("+u+r)}function l(c,u,f,d,h,p){if(c!==f||u!==d){var g=h.push(i(h)+"scale(",null,",",null,")");p.push({i:g-4,x:yf(c,f)},{i:g-2,x:yf(u,d)})}else(f!==1||d!==1)&&h.push(i(h)+"scale("+f+","+d+")")}return function(c,u){var f=[],d=[];return c=t(c),u=t(u),o(c.translateX,c.translateY,u.translateX,u.translateY,f,d),s(c.rotate,u.rotate,f,d),a(c.skewX,u.skewX,f,d),l(c.scaleX,c.scaleY,u.scaleX,u.scaleY,f,d),c=u=null,function(h){for(var p=-1,g=d.length,m;++pe&&(n=t,t=e,e=n),function(r){return Math.max(t,Math.min(e,r))}}function QTt(t,e,n){var r=t[0],i=t[1],o=e[0],s=e[1];return i2?KTt:QTt,l=c=null,f}function f(d){return d==null||isNaN(d=+d)?o:(l||(l=a(t.map(r),e,n)))(r(s(d)))}return f.invert=function(d){return s(i((c||(c=a(e,t.map(r),yf)))(d)))},f.domain=function(d){return arguments.length?(t=Array.from(d,LN),u()):t.slice()},f.range=function(d){return arguments.length?(e=Array.from(d),u()):e.slice()},f.rangeRound=function(d){return e=Array.from(d),n=uR,u()},f.clamp=function(d){return arguments.length?(s=d?!0:_a,u()):s!==_a},f.interpolate=function(d){return arguments.length?(n=d,u()):n},f.unknown=function(d){return arguments.length?(o=d,f):o},function(d,h){return r=d,i=h,u()}}function wre(){return bB()(_a,_a)}function _re(t,e,n,r){var i=ry(t,e,n),o;switch(r=c1(r??",f"),r.type){case"s":{var s=Math.max(Math.abs(t),Math.abs(e));return r.precision==null&&!isNaN(o=TIe(i,s))&&(r.precision=o),sne(r,s)}case"":case"e":case"g":case"p":case"r":{r.precision==null&&!isNaN(o=kIe(i,Math.max(Math.abs(t),Math.abs(e))))&&(r.precision=o-(r.type==="e"));break}case"f":case"%":{r.precision==null&&!isNaN(o=EIe(i))&&(r.precision=o-(r.type==="%")*2);break}}return Y4(r)}function Vy(t){var e=t.domain;return t.ticks=function(n){var r=e();return jq(r[0],r[r.length-1],n??10)},t.tickFormat=function(n,r){var i=e();return _re(i[0],i[i.length-1],n??10,r)},t.nice=function(n){n==null&&(n=10);var r=e(),i=0,o=r.length-1,s=r[i],a=r[o],l,c,u=10;for(a0;){if(c=Bq(s,a,n),c===l)return r[i]=s,r[o]=a,e(r);if(c>0)s=Math.floor(s/c)*c,a=Math.ceil(a/c)*c;else if(c<0)s=Math.ceil(s*c)/c,a=Math.floor(a*c)/c;else break;l=c}return t},t}function MA(){var t=wre();return t.copy=function(){return fR(t,MA())},Nu.apply(t,arguments),Vy(t)}function Sre(t){var e;function n(r){return r==null||isNaN(r=+r)?e:r}return n.invert=n,n.domain=n.range=function(r){return arguments.length?(t=Array.from(r,LN),n):t.slice()},n.unknown=function(r){return arguments.length?(e=r,n):e},n.copy=function(){return Sre(t).unknown(e)},t=arguments.length?Array.from(t,LN):[0,1],Vy(n)}function f3e(t,e){t=t.slice();var n=0,r=t.length-1,i=t[n],o=t[r],s;return oMath.pow(t,e)}function nkt(t){return t===Math.E?Math.log:t===10&&Math.log10||t===2&&Math.log2||(t=Math.log(t),e=>Math.log(e)/t)}function uge(t){return(e,n)=>-t(-e,n)}function Cre(t){const e=t(lge,cge),n=e.domain;let r=10,i,o;function s(){return i=nkt(r),o=tkt(r),n()[0]<0?(i=uge(i),o=uge(o),t(ZTt,JTt)):t(lge,cge),e}return e.base=function(a){return arguments.length?(r=+a,s()):r},e.domain=function(a){return arguments.length?(n(a),s()):n()},e.ticks=a=>{const l=n();let c=l[0],u=l[l.length-1];const f=u0){for(;d<=h;++d)for(p=1;pu)break;v.push(g)}}else for(;d<=h;++d)for(p=r-1;p>=1;--p)if(g=d>0?p/o(-d):p*o(d),!(gu)break;v.push(g)}v.length*2{if(a==null&&(a=10),l==null&&(l=r===10?"s":","),typeof l!="function"&&(!(r%1)&&(l=c1(l)).precision==null&&(l.trim=!0),l=Y4(l)),a===1/0)return l;const c=Math.max(1,r*a/e.ticks().length);return u=>{let f=u/o(Math.round(i(u)));return f*rn(f3e(n(),{floor:a=>o(Math.floor(i(a))),ceil:a=>o(Math.ceil(i(a)))})),e}function Ore(){const t=Cre(bB()).domain([1,10]);return t.copy=()=>fR(t,Ore()).base(t.base()),Nu.apply(t,arguments),t}function fge(t){return function(e){return Math.sign(e)*Math.log1p(Math.abs(e/t))}}function dge(t){return function(e){return Math.sign(e)*Math.expm1(Math.abs(e))*t}}function Ere(t){var e=1,n=t(fge(e),dge(e));return n.constant=function(r){return arguments.length?t(fge(e=+r),dge(e)):e},Vy(n)}function Tre(){var t=Ere(bB());return t.copy=function(){return fR(t,Tre()).constant(t.constant())},Nu.apply(t,arguments)}function hge(t){return function(e){return e<0?-Math.pow(-e,t):Math.pow(e,t)}}function rkt(t){return t<0?-Math.sqrt(-t):Math.sqrt(t)}function ikt(t){return t<0?-t*t:t*t}function kre(t){var e=t(_a,_a),n=1;function r(){return n===1?t(_a,_a):n===.5?t(rkt,ikt):t(hge(n),hge(1/n))}return e.exponent=function(i){return arguments.length?(n=+i,r()):n},Vy(e)}function wB(){var t=kre(bB());return t.copy=function(){return fR(t,wB()).exponent(t.exponent())},Nu.apply(t,arguments),t}function d3e(){return wB.apply(null,arguments).exponent(.5)}function pge(t){return Math.sign(t)*t*t}function okt(t){return Math.sign(t)*Math.sqrt(Math.abs(t))}function h3e(){var t=wre(),e=[0,1],n=!1,r;function i(o){var s=okt(t(o));return isNaN(s)?r:n?Math.round(s):s}return i.invert=function(o){return t.invert(pge(o))},i.domain=function(o){return arguments.length?(t.domain(o),i):t.domain()},i.range=function(o){return arguments.length?(t.range((e=Array.from(o,LN)).map(pge)),i):e.slice()},i.rangeRound=function(o){return i.range(o).round(!0)},i.round=function(o){return arguments.length?(n=!!o,i):n},i.clamp=function(o){return arguments.length?(t.clamp(o),i):t.clamp()},i.unknown=function(o){return arguments.length?(r=o,i):r},i.copy=function(){return h3e(t.domain(),e).round(n).clamp(t.clamp()).unknown(r)},Nu.apply(i,arguments),Vy(i)}function Are(){var t=[],e=[],n=[],r;function i(){var s=0,a=Math.max(1,e.length);for(n=new Array(a-1);++s0?n[a-1]:t[0],a=n?[r[n-1],e]:[r[c-1],r[c]]},s.unknown=function(l){return arguments.length&&(o=l),s},s.thresholds=function(){return r.slice()},s.copy=function(){return Pre().domain([t,e]).range(i).unknown(o)},Nu.apply(Vy(s),arguments)}function Mre(){var t=[.5],e=[0,1],n,r=1;function i(o){return o!=null&&o<=o?e[Ig(t,o,0,r)]:n}return i.domain=function(o){return arguments.length?(t=Array.from(o),r=Math.min(t.length,e.length-1),i):t.slice()},i.range=function(o){return arguments.length?(e=Array.from(o),r=Math.min(t.length,e.length-1),i):e.slice()},i.invertExtent=function(o){var s=e.indexOf(o);return[t[s-1],t[s]]},i.unknown=function(o){return arguments.length?(n=o,i):n},i.copy=function(){return Mre().domain(t).range(e).unknown(n)},Nu.apply(i,arguments)}function skt(t){return new Date(t)}function akt(t){return t instanceof Date?+t:+new Date(+t)}function Rre(t,e,n,r,i,o,s,a,l,c){var u=wre(),f=u.invert,d=u.domain,h=c(".%L"),p=c(":%S"),g=c("%I:%M"),m=c("%I %p"),v=c("%a %d"),y=c("%b %d"),x=c("%B"),b=c("%Y");function w(_){return(l(_)<_?h:a(_)<_?p:s(_)<_?g:o(_)<_?m:r(_)<_?i(_)<_?v:y:n(_)<_?x:b)(_)}return u.invert=function(_){return new Date(f(_))},u.domain=function(_){return arguments.length?d(Array.from(_,akt)):d().map(skt)},u.ticks=function(_){var S=d();return t(S[0],S[S.length-1],_??10)},u.tickFormat=function(_,S){return S==null?w:c(S)},u.nice=function(_){var S=d();return(!_||typeof _.range!="function")&&(_=e(S[0],S[S.length-1],_??10)),_?d(f3e(S,_)):u},u.copy=function(){return fR(u,Rre(t,e,n,r,i,o,s,a,l,c))},u}function p3e(){return Nu.apply(Rre(aCt,lCt,Th,_A,bO,sg,Z4,Q4,Yp,fne).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)}function g3e(){return Nu.apply(Rre(oCt,sCt,kh,SA,wO,zv,J4,K4,Yp,dne).domain([Date.UTC(2e3,0,1),Date.UTC(2e3,0,2)]),arguments)}function _B(){var t=0,e=1,n,r,i,o,s=_a,a=!1,l;function c(f){return f==null||isNaN(f=+f)?l:s(i===0?.5:(f=(o(f)-n)*i,a?Math.max(0,Math.min(1,f)):f))}c.domain=function(f){return arguments.length?([t,e]=f,n=o(t=+t),r=o(e=+e),i=n===r?0:1/(r-n),c):[t,e]},c.clamp=function(f){return arguments.length?(a=!!f,c):a},c.interpolator=function(f){return arguments.length?(s=f,c):s};function u(f){return function(d){var h,p;return arguments.length?([h,p]=d,s=f(h,p),c):[s(0),s(1)]}}return c.range=u(Wy),c.rangeRound=u(uR),c.unknown=function(f){return arguments.length?(l=f,c):l},function(f){return o=f,n=f(t),r=f(e),i=n===r?0:1/(r-n),c}}function Gy(t,e){return e.domain(t.domain()).interpolator(t.interpolator()).clamp(t.clamp()).unknown(t.unknown())}function SB(){var t=Vy(_B()(_a));return t.copy=function(){return Gy(t,SB())},Xg.apply(t,arguments)}function Dre(){var t=Cre(_B()).domain([1,10]);return t.copy=function(){return Gy(t,Dre()).base(t.base())},Xg.apply(t,arguments)}function Ire(){var t=Ere(_B());return t.copy=function(){return Gy(t,Ire()).constant(t.constant())},Xg.apply(t,arguments)}function CB(){var t=kre(_B());return t.copy=function(){return Gy(t,CB()).exponent(t.exponent())},Xg.apply(t,arguments)}function m3e(){return CB.apply(null,arguments).exponent(.5)}function v3e(){var t=[],e=_a;function n(r){if(r!=null&&!isNaN(r=+r))return e((Ig(t,r,1)-1)/(t.length-1))}return n.domain=function(r){if(!arguments.length)return t.slice();t=[];for(let i of r)i!=null&&!isNaN(i=+i)&&t.push(i);return t.sort(gh),n},n.interpolator=function(r){return arguments.length?(e=r,n):e},n.range=function(){return t.map((r,i)=>e(i/(t.length-1)))},n.quantiles=function(r){return Array.from({length:r+1},(i,o)=>xN(t,o/r))},n.copy=function(){return v3e(e).domain(t)},Xg.apply(n,arguments)}function OB(){var t=0,e=.5,n=1,r=1,i,o,s,a,l,c=_a,u,f=!1,d;function h(g){return isNaN(g=+g)?d:(g=.5+((g=+u(g))-o)*(r*g0?r:1:0}const ykt="identity",FS="linear",$g="log",dR="pow",hR="sqrt",TB="symlog",f1="time",d1="utc",yh="sequential",EO="diverging",NS="quantile",kB="quantize",AB="threshold",zre="ordinal",lX="point",x3e="band",jre="bin-ordinal",To="continuous",pR="discrete",gR="discretizing",zu="interpolating",Bre="temporal";function xkt(t){return function(e){let n=e[0],r=e[1],i;return r=r&&n[l]<=i&&(o<0&&(o=l),s=l);if(!(o<0))return r=t.invertExtent(n[o]),i=t.invertExtent(n[s]),[r[0]===void 0?r[1]:r[0],i[1]===void 0?i[0]:i[1]]}}function Ure(){const t=lR().unknown(void 0),e=t.domain,n=t.range;let r=[0,1],i,o,s=!1,a=0,l=0,c=.5;delete t.unknown;function u(){const f=e().length,d=r[1]g+i*v);return n(d?m.reverse():m)}return t.domain=function(f){return arguments.length?(e(f),u()):e()},t.range=function(f){return arguments.length?(r=[+f[0],+f[1]],u()):r.slice()},t.rangeRound=function(f){return r=[+f[0],+f[1]],s=!0,u()},t.bandwidth=function(){return o},t.step=function(){return i},t.round=function(f){return arguments.length?(s=!!f,u()):s},t.padding=function(f){return arguments.length?(l=Math.max(0,Math.min(1,f)),a=l,u()):a},t.paddingInner=function(f){return arguments.length?(a=Math.max(0,Math.min(1,f)),u()):a},t.paddingOuter=function(f){return arguments.length?(l=Math.max(0,Math.min(1,f)),u()):l},t.align=function(f){return arguments.length?(c=Math.max(0,Math.min(1,f)),u()):c},t.invertRange=function(f){if(f[0]==null||f[1]==null)return;const d=r[1]r[1-d])))return v=Math.max(0,Ig(h,g)-1),y=g===m?v:Ig(h,m)-1,g-h[v]>o+1e-10&&++v,d&&(x=v,v=p-y,y=p-x),v>y?void 0:e().slice(v,y+1)},t.invert=function(f){const d=t.invertRange([f,f]);return d&&d[0]},t.copy=function(){return Ure().domain(e()).range(r).round(s).paddingInner(a).paddingOuter(l).align(c)},u()}function b3e(t){const e=t.copy;return t.padding=t.paddingOuter,delete t.paddingInner,t.copy=function(){return b3e(e())},t}function wkt(){return b3e(Ure().paddingInner(1))}var _kt=Array.prototype.map;function Skt(t){return _kt.call(t,Ys)}const Ckt=Array.prototype.slice;function w3e(){let t=[],e=[];function n(r){return r==null||r!==r?void 0:e[(Ig(t,r)-1)%e.length]}return n.domain=function(r){return arguments.length?(t=Skt(r),n):t.slice()},n.range=function(r){return arguments.length?(e=Ckt.call(r),n):e.slice()},n.tickFormat=function(r,i){return _re(t[0],$n(t),r??10,i)},n.copy=function(){return w3e().domain(n.domain()).range(n.range())},n}const $N=new Map,_3e=Symbol("vega_scale");function S3e(t){return t[_3e]=!0,t}function Okt(t){return t&&t[_3e]===!0}function Ekt(t,e,n){const r=function(){const o=e();return o.invertRange||(o.invertRange=o.invert?xkt(o):o.invertExtent?bkt(o):void 0),o.type=t,S3e(o)};return r.metadata=Wf(pt(n)),r}function tr(t,e,n){return arguments.length>1?($N.set(t,Ekt(t,e,n)),this):C3e(t)?$N.get(t):void 0}tr(ykt,Sre);tr(FS,MA,To);tr($g,Ore,[To,$g]);tr(dR,wB,To);tr(hR,d3e,To);tr(TB,Tre,To);tr(f1,p3e,[To,Bre]);tr(d1,g3e,[To,Bre]);tr(yh,SB,[To,zu]);tr(`${yh}-${FS}`,SB,[To,zu]);tr(`${yh}-${$g}`,Dre,[To,zu,$g]);tr(`${yh}-${dR}`,CB,[To,zu]);tr(`${yh}-${hR}`,m3e,[To,zu]);tr(`${yh}-${TB}`,Ire,[To,zu]);tr(`${EO}-${FS}`,Lre,[To,zu]);tr(`${EO}-${$g}`,$re,[To,zu,$g]);tr(`${EO}-${dR}`,EB,[To,zu]);tr(`${EO}-${hR}`,y3e,[To,zu]);tr(`${EO}-${TB}`,Fre,[To,zu]);tr(NS,Are,[gR,NS]);tr(kB,Pre,gR);tr(AB,Mre,gR);tr(jre,w3e,[pR,gR]);tr(zre,lR,pR);tr(x3e,Ure,pR);tr(lX,wkt,pR);function C3e(t){return $N.has(t)}function cb(t,e){const n=$N.get(t);return n&&n.metadata[e]}function Wre(t){return cb(t,To)}function zS(t){return cb(t,pR)}function cX(t){return cb(t,gR)}function O3e(t){return cb(t,$g)}function Tkt(t){return cb(t,Bre)}function E3e(t){return cb(t,zu)}function T3e(t){return cb(t,NS)}const kkt=["clamp","base","constant","exponent"];function k3e(t,e){const n=e[0],r=$n(e)-n;return function(i){return t(n+i*r)}}function PB(t,e,n){return bre(Vre(e||"rgb",n),t)}function A3e(t,e){const n=new Array(e),r=e+1;for(let i=0;it[a]?s[a](t[a]()):0),s)}function Vre(t,e){const n=qTt[Akt(t)];return e!=null&&n&&n.gamma?n.gamma(e):n}function Akt(t){return"interpolate"+t.toLowerCase().split("-").map(e=>e[0].toUpperCase()+e.slice(1)).join("")}const Pkt={blues:"cfe1f2bed8eca8cee58fc1de74b2d75ba3cf4592c63181bd206fb2125ca40a4a90",greens:"d3eecdc0e6baabdda594d3917bc77d60ba6c46ab5e329a512089430e7735036429",greys:"e2e2e2d4d4d4c4c4c4b1b1b19d9d9d8888887575756262624d4d4d3535351e1e1e",oranges:"fdd8b3fdc998fdb87bfda55efc9244f87f2cf06b18e4580bd14904b93d029f3303",purples:"e2e1efd4d4e8c4c5e0b4b3d6a3a0cc928ec3827cb97566ae684ea25c3696501f8c",reds:"fdc9b4fcb49afc9e80fc8767fa7051f6573fec3f2fdc2a25c81b1db21218970b13",blueGreen:"d5efedc1e8e0a7ddd18bd2be70c6a958ba9144ad77319c5d2089460e7736036429",bluePurple:"ccddecbad0e4a8c2dd9ab0d4919cc98d85be8b6db28a55a6873c99822287730f71",greenBlue:"d3eecec5e8c3b1e1bb9bd8bb82cec269c2ca51b2cd3c9fc7288abd1675b10b60a1",orangeRed:"fddcaffdcf9bfdc18afdad77fb9562f67d53ee6545e24932d32d1ebf130da70403",purpleBlue:"dbdaebc8cee4b1c3de97b7d87bacd15b9fc93a90c01e7fb70b70ab056199045281",purpleBlueGreen:"dbd8eac8cee4b0c3de93b7d872acd1549fc83892bb1c88a3097f8702736b016353",purpleRed:"dcc9e2d3b3d7ce9eccd186c0da6bb2e14da0e23189d91e6fc61159ab07498f023a",redPurple:"fccfccfcbec0faa9b8f98faff571a5ec539ddb3695c41b8aa908808d0179700174",yellowGreen:"e4f4acd1eca0b9e2949ed68880c97c62bb6e47aa5e3297502083440e723b036034",yellowOrangeBrown:"feeaa1fedd84fecc63feb746fca031f68921eb7215db5e0bc54c05ab3d038f3204",yellowOrangeRed:"fee087fed16ffebd59fea849fd903efc7335f9522bee3423de1b20ca0b22af0225",blueOrange:"134b852f78b35da2cb9dcae1d2e5eff2f0ebfce0bafbbf74e8932fc5690d994a07",brownBlueGreen:"704108a0651ac79548e3c78af3e6c6eef1eac9e9e48ed1c74da79e187a72025147",purpleGreen:"5b1667834792a67fb6c9aed3e6d6e8eff0efd9efd5aedda971bb75368e490e5e29",purpleOrange:"4114696647968f83b7b9b4d6dadbebf3eeeafce0bafbbf74e8932fc5690d994a07",redBlue:"8c0d25bf363adf745ef4ae91fbdbc9f2efeed2e5ef9dcae15da2cb2f78b3134b85",redGrey:"8c0d25bf363adf745ef4ae91fcdccbfaf4f1e2e2e2c0c0c0969696646464343434",yellowGreenBlue:"eff9bddbf1b4bde5b594d5b969c5be45b4c22c9ec02182b82163aa23479c1c3185",redYellowBlue:"a50026d4322cf16e43fcac64fedd90faf8c1dcf1ecabd6e875abd04a74b4313695",redYellowGreen:"a50026d4322cf16e43fcac63fedd8df9f7aed7ee8ea4d86e64bc6122964f006837",pinkYellowGreen:"8e0152c0267edd72adf0b3d6faddedf5f3efe1f2cab6de8780bb474f9125276419",spectral:"9e0142d13c4bf0704afcac63fedd8dfbf8b0e0f3a1a9dda269bda94288b55e4fa2",viridis:"440154470e61481a6c482575472f7d443a834144873d4e8a39568c35608d31688e2d708e2a788e27818e23888e21918d1f988b1fa08822a8842ab07f35b77943bf7154c56866cc5d7ad1518fd744a5db36bcdf27d2e21be9e51afde725",magma:"0000040404130b0924150e3720114b2c11603b0f704a107957157e651a80721f817f24828c29819a2e80a8327db6377ac43c75d1426fde4968e95462f1605df76f5cfa7f5efc8f65fe9f6dfeaf78febf84fece91fddea0fcedaffcfdbf",inferno:"0000040403130c0826170c3b240c4f330a5f420a68500d6c5d126e6b176e781c6d86216b932667a12b62ae305cbb3755c73e4cd24644dd513ae65c30ed6925f3771af8850ffb9506fca50afcb519fac62df6d645f2e661f3f484fcffa4",plasma:"0d088723069033059742039d5002a25d01a66a00a87801a88405a7900da49c179ea72198b12a90ba3488c33d80cb4779d35171da5a69e16462e76e5bed7953f2834cf68f44fa9a3dfca636fdb32ffec029fcce25f9dc24f5ea27f0f921",cividis:"00205100235800265d002961012b65042e670831690d346b11366c16396d1c3c6e213f6e26426e2c456e31476e374a6e3c4d6e42506e47536d4c566d51586e555b6e5a5e6e5e616e62646f66676f6a6a706e6d717270717573727976737c79747f7c75827f758682768985778c8877908b78938e789691789a94789e9778a19b78a59e77a9a177aea575b2a874b6ab73bbaf71c0b26fc5b66dc9b96acebd68d3c065d8c462ddc85fe2cb5ce7cf58ebd355f0d652f3da4ff7de4cfae249fce647",rainbow:"6e40aa883eb1a43db3bf3cafd83fa4ee4395fe4b83ff576eff6659ff7847ff8c38f3a130e2b72fcfcc36bee044aff05b8ff4576ff65b52f6673af27828ea8d1ddfa319d0b81cbecb23abd82f96e03d82e14c6edb5a5dd0664dbf6e40aa",sinebow:"ff4040fc582af47218e78d0bd5a703bfbf00a7d5038de70b72f41858fc2a40ff402afc5818f4720be78d03d5a700bfbf03a7d50b8de71872f42a58fc4040ff582afc7218f48d0be7a703d5bf00bfd503a7e70b8df41872fc2a58ff4040",turbo:"23171b32204a3e2a71453493493eae4b49c54a53d7485ee44569ee4074f53c7ff8378af93295f72e9ff42ba9ef28b3e926bce125c5d925cdcf27d5c629dcbc2de3b232e9a738ee9d3ff39347f68950f9805afc7765fd6e70fe667cfd5e88fc5795fb51a1f84badf545b9f140c5ec3cd0e637dae034e4d931ecd12ef4c92bfac029ffb626ffad24ffa223ff9821ff8d1fff821dff771cfd6c1af76118f05616e84b14df4111d5380fcb2f0dc0260ab61f07ac1805a313029b0f00950c00910b00",browns:"eedbbdecca96e9b97ae4a865dc9856d18954c7784cc0673fb85536ad44339f3632",tealBlues:"bce4d89dd3d181c3cb65b3c245a2b9368fae347da0306a932c5985",teals:"bbdfdfa2d4d58ac9c975bcbb61b0af4da5a43799982b8b8c1e7f7f127273006667",warmGreys:"dcd4d0cec5c1c0b8b4b3aaa7a59c9998908c8b827f7e7673726866665c5a59504e",goldGreen:"f4d166d5ca60b6c35c98bb597cb25760a6564b9c533f8f4f33834a257740146c36",goldOrange:"f4d166f8be5cf8aa4cf5983bf3852aef701be2621fd65322c54923b142239e3a26",goldRed:"f4d166f6be59f9aa51fc964ef6834bee734ae56249db5247cf4244c43141b71d3e",lightGreyRed:"efe9e6e1dad7d5cbc8c8bdb9bbaea9cd967ddc7b43e15f19df4011dc000b",lightGreyTeal:"e4eaead6dcddc8ced2b7c2c7a6b4bc64b0bf22a6c32295c11f85be1876bc",lightMulti:"e0f1f2c4e9d0b0de9fd0e181f6e072f6c053f3993ef77440ef4a3c",lightOrange:"f2e7daf7d5baf9c499fab184fa9c73f68967ef7860e8645bde515bd43d5b",lightTealBlue:"e3e9e0c0dccf9aceca7abfc859afc0389fb9328dad2f7ca0276b95255988",darkBlue:"3232322d46681a5c930074af008cbf05a7ce25c0dd38daed50f3faffffff",darkGold:"3c3c3c584b37725e348c7631ae8b2bcfa424ecc31ef9de30fff184ffffff",darkGreen:"3a3a3a215748006f4d048942489e4276b340a6c63dd2d836ffeb2cffffaa",darkMulti:"3737371f5287197d8c29a86995ce3fffe800ffffff",darkRed:"3434347036339e3c38cc4037e75d1eec8620eeab29f0ce32ffeb2c"},Mkt={accent:ckt,category10:lkt,category20:"1f77b4aec7e8ff7f0effbb782ca02c98df8ad62728ff98969467bdc5b0d58c564bc49c94e377c2f7b6d27f7f7fc7c7c7bcbd22dbdb8d17becf9edae5",category20b:"393b795254a36b6ecf9c9ede6379398ca252b5cf6bcedb9c8c6d31bd9e39e7ba52e7cb94843c39ad494ad6616be7969c7b4173a55194ce6dbdde9ed6",category20c:"3182bd6baed69ecae1c6dbefe6550dfd8d3cfdae6bfdd0a231a35474c476a1d99bc7e9c0756bb19e9ac8bcbddcdadaeb636363969696bdbdbdd9d9d9",dark2:ukt,observable10:fkt,paired:dkt,pastel1:hkt,pastel2:pkt,set1:gkt,set2:mkt,set3:vkt,tableau10:"4c78a8f58518e4575672b7b254a24beeca3bb279a2ff9da69d755dbab0ac",tableau20:"4c78a89ecae9f58518ffbf7954a24b88d27ab79a20f2cf5b43989483bcb6e45756ff9d9879706ebab0acd67195fcbfd2b279a2d6a5c99e765fd8b5a5"};function M3e(t){if(We(t))return t;const e=t.length/6|0,n=new Array(e);for(let r=0;rPB(M3e(t)));function Gre(t,e){return t=t&&t.toLowerCase(),arguments.length>1?(gge[t]=e,this):gge[t]}const m3="symbol",Rkt="discrete",Dkt="gradient",Ikt=t=>We(t)?t.map(e=>String(e)):String(t),Lkt=(t,e)=>t[1]-e[1],$kt=(t,e)=>e[1]-t[1];function Hre(t,e,n){let r;return Jn(e)&&(t.bins&&(e=Math.max(e,t.bins.length)),n!=null&&(e=Math.min(e,Math.floor(nR(t.domain())/n||1)+1))),ht(e)&&(r=e.step,e=e.interval),gt(e)&&(e=t.type===f1?_O(e):t.type==d1?SO(e):je("Only time and utc scales accept interval strings."),r&&(e=e.every(r))),e}function D3e(t,e,n){let r=t.range(),i=r[0],o=$n(r),s=Lkt;if(i>o&&(r=o,o=i,i=r,s=$kt),i=Math.floor(i),o=Math.ceil(o),e=e.map(a=>[a,t(a)]).filter(a=>i<=a[1]&&a[1]<=o).sort(s).map(a=>a[0]),n>0&&e.length>1){const a=[e[0],$n(e)];for(;e.length>n&&e.length>=3;)e=e.filter((l,c)=>!(c%2));e.length<3&&(e=a)}return e}function qre(t,e){return t.bins?D3e(t,t.bins,e):t.ticks?t.ticks(e):t.domain()}function I3e(t,e,n,r,i,o){const s=e.type;let a=Ikt;if(s===f1||i===f1)a=t.timeFormat(r);else if(s===d1||i===d1)a=t.utcFormat(r);else if(O3e(s)){const l=t.formatFloat(r);if(o||e.bins)a=l;else{const c=L3e(e,n,!1);a=u=>c(u)?l(u):""}}else if(e.tickFormat){const l=e.domain();a=t.formatSpan(l[0],l[l.length-1],n,r)}else r&&(a=t.format(r));return a}function L3e(t,e,n){const r=qre(t,e),i=t.base(),o=Math.log(i),s=Math.max(1,i*e/r.length),a=l=>{let c=l/Math.pow(i,Math.round(Math.log(l)/o));return c*i1?r[1]-r[0]:r[0],s;for(s=1;suX[t.type]||t.bins;function N3e(t,e,n,r,i,o,s){const a=$3e[e.type]&&o!==f1&&o!==d1?Fkt(t,e,i):I3e(t,e,n,i,o,s);return r===m3&&jkt(e)?Bkt(a):r===Rkt?Ukt(a):Wkt(a)}const Bkt=t=>(e,n,r)=>{const i=mge(r[n+1],mge(r.max,1/0)),o=vge(e,t),s=vge(i,t);return o&&s?o+" – "+s:s?"< "+s:"≥ "+o},mge=(t,e)=>t??e,Ukt=t=>(e,n)=>n?t(e):null,Wkt=t=>e=>t(e),vge=(t,e)=>Number.isFinite(t)?e(t):null;function Vkt(t){const e=t.domain(),n=e.length-1;let r=+e[0],i=+$n(e),o=i-r;if(t.type===AB){const s=n?o/n:.1;r-=s,i+=s,o=i-r}return s=>(s-r)/o}function Gkt(t,e,n,r){const i=r||e.type;return gt(n)&&Tkt(i)&&(n=n.replace(/%a/g,"%A").replace(/%b/g,"%B")),!n&&i===f1?t.timeFormat("%A, %d %B %Y, %X"):!n&&i===d1?t.utcFormat("%A, %d %B %Y, %X UTC"):N3e(t,e,5,null,n,r,!0)}function z3e(t,e,n){n=n||{};const r=Math.max(3,n.maxlen||7),i=Gkt(t,e,n.format,n.formatType);if(cX(e.type)){const o=F3e(e).slice(1).map(i),s=o.length;return`${s} boundar${s===1?"y":"ies"}: ${o.join(", ")}`}else if(zS(e.type)){const o=e.domain(),s=o.length,a=s>r?o.slice(0,r-2).map(i).join(", ")+", ending with "+o.slice(-1).map(i):o.map(i).join(", ");return`${s} value${s===1?"":"s"}: ${a}`}else{const o=e.domain();return`values from ${i(o[0])} to ${i($n(o))}`}}let j3e=0;function Hkt(){j3e=0}const FN="p_";function Xre(t){return t&&t.gradient}function B3e(t,e,n){const r=t.gradient;let i=t.id,o=r==="radial"?FN:"";return i||(i=t.id="gradient_"+j3e++,r==="radial"?(t.x1=vd(t.x1,.5),t.y1=vd(t.y1,.5),t.r1=vd(t.r1,0),t.x2=vd(t.x2,.5),t.y2=vd(t.y2,.5),t.r2=vd(t.r2,.5),o=FN):(t.x1=vd(t.x1,0),t.y1=vd(t.y1,0),t.x2=vd(t.x2,1),t.y2=vd(t.y2,0))),e[i]=t,"url("+(n||"")+"#"+o+i+")"}function vd(t,e){return t??e}function U3e(t,e){var n=[],r;return r={gradient:"linear",x1:t?t[0]:0,y1:t?t[1]:0,x2:e?e[0]:1,y2:e?e[1]:0,stops:n,stop:function(i,o){return n.push({offset:i,color:o}),r}}}const yge={basis:{curve:y$e},"basis-closed":{curve:b$e},"basis-open":{curve:_$e},bundle:{curve:Y2t,tension:"beta",value:.85},cardinal:{curve:Q2t,tension:"tension",value:0},"cardinal-open":{curve:Z2t,tension:"tension",value:0},"cardinal-closed":{curve:K2t,tension:"tension",value:0},"catmull-rom":{curve:J2t,tension:"alpha",value:.5},"catmull-rom-closed":{curve:eTt,tension:"alpha",value:.5},"catmull-rom-open":{curve:tTt,tension:"alpha",value:.5},linear:{curve:aR},"linear-closed":{curve:k$e},monotone:{horizontal:R$e,vertical:M$e},natural:{curve:I$e},step:{curve:L$e},"step-after":{curve:F$e},"step-before":{curve:$$e}};function Yre(t,e,n){var r=vt(yge,t)&&yge[t],i=null;return r&&(i=r.curve||r[e||"vertical"],r.tension&&n!=null&&(i=i[r.tension](n))),i}const qkt={m:2,l:2,h:1,v:1,z:0,c:6,s:4,q:4,t:2,a:7},Xkt=/[mlhvzcsqta]([^mlhvzcsqta]+|$)/gi,Ykt=/^[+-]?(([0-9]*\.[0-9]+)|([0-9]+\.)|([0-9]+))([eE][+-]?[0-9]+)?/,Qkt=/^((\s+,?\s*)|(,\s*))/,Kkt=/^[01]/;function jS(t){const e=[];return(t.match(Xkt)||[]).forEach(r=>{let i=r[0];const o=i.toLowerCase(),s=qkt[o],a=Zkt(o,s,r.slice(1).trim()),l=a.length;if(l1&&(g=Math.sqrt(g),n*=g,r*=g);const m=d/n,v=f/n,y=-f/r,x=d/r,b=m*a+v*l,w=y*a+x*l,_=m*t+v*e,S=y*t+x*e;let k=1/((_-b)*(_-b)+(S-w)*(S-w))-.25;k<0&&(k=0);let E=Math.sqrt(k);o==i&&(E=-E);const M=.5*(b+_)-E*(S-w),A=.5*(w+S)+E*(_-b),P=Math.atan2(w-A,b-M);let R=Math.atan2(S-A,_-M)-P;R<0&&o===1?R+=Wd:R>0&&o===0&&(R-=Wd);const I=Math.ceil(Math.abs(R/(Q0+.001))),B=[];for(let $=0;$+t}function $I(t,e,n){return Math.max(e,Math.min(t,n))}function G3e(){var t=iAt,e=oAt,n=sAt,r=aAt,i=cp(0),o=i,s=i,a=i,l=null;function c(u,f,d){var h,p=f??+t.call(this,u),g=d??+e.call(this,u),m=+n.call(this,u),v=+r.call(this,u),y=Math.min(m,v)/2,x=$I(+i.call(this,u),0,y),b=$I(+o.call(this,u),0,y),w=$I(+s.call(this,u),0,y),_=$I(+a.call(this,u),0,y);if(l||(l=h=hB()),x<=0&&b<=0&&w<=0&&_<=0)l.rect(p,g,m,v);else{var S=p+m,O=g+v;l.moveTo(p+x,g),l.lineTo(S-b,g),l.bezierCurveTo(S-mm*b,g,S,g+mm*b,S,g+b),l.lineTo(S,O-_),l.bezierCurveTo(S,O-mm*_,S-mm*_,O,S-_,O),l.lineTo(p+w,O),l.bezierCurveTo(p+mm*w,O,p,O-mm*w,p,O-w),l.lineTo(p,g+x),l.bezierCurveTo(p,g+mm*x,p+mm*x,g,p+x,g),l.closePath()}if(h)return l=null,h+""||null}return c.x=function(u){return arguments.length?(t=cp(u),c):t},c.y=function(u){return arguments.length?(e=cp(u),c):e},c.width=function(u){return arguments.length?(n=cp(u),c):n},c.height=function(u){return arguments.length?(r=cp(u),c):r},c.cornerRadius=function(u,f,d,h){return arguments.length?(i=cp(u),o=f!=null?cp(f):i,a=d!=null?cp(d):i,s=h!=null?cp(h):o,c):i},c.context=function(u){return arguments.length?(l=u??null,c):l},c}function H3e(){var t,e,n,r,i=null,o,s,a,l;function c(f,d,h){const p=h/2;if(o){var g=a-d,m=f-s;if(g||m){var v=Math.hypot(g,m),y=(g/=v)*l,x=(m/=v)*l,b=Math.atan2(m,g);i.moveTo(s-y,a-x),i.lineTo(f-g*p,d-m*p),i.arc(f,d,p,b-Math.PI,b),i.lineTo(s+y,a+x),i.arc(s,a,l,b,b+Math.PI)}else i.arc(f,d,p,0,Wd);i.closePath()}else o=1;s=f,a=d,l=p}function u(f){var d,h=f.length,p,g=!1,m;for(i==null&&(i=m=hB()),d=0;d<=h;++d)!(dt.x||0,yR=t=>t.y||0,lAt=t=>t.width||0,cAt=t=>t.height||0,uAt=t=>(t.x||0)+(t.width||0),fAt=t=>(t.y||0)+(t.height||0),dAt=t=>t.startAngle||0,hAt=t=>t.endAngle||0,pAt=t=>t.padAngle||0,gAt=t=>t.innerRadius||0,mAt=t=>t.outerRadius||0,vAt=t=>t.cornerRadius||0,yAt=t=>mR(t.cornerRadiusTopLeft,t.cornerRadius)||0,xAt=t=>mR(t.cornerRadiusTopRight,t.cornerRadius)||0,bAt=t=>mR(t.cornerRadiusBottomRight,t.cornerRadius)||0,wAt=t=>mR(t.cornerRadiusBottomLeft,t.cornerRadius)||0,_At=t=>mR(t.size,64),SAt=t=>t.size||1,MB=t=>t.defined!==!1,CAt=t=>V3e(t.shape||"circle"),OAt=L2t().startAngle(dAt).endAngle(hAt).padAngle(pAt).innerRadius(gAt).outerRadius(mAt).cornerRadius(vAt),EAt=a_().x(vR).y1(yR).y0(fAt).defined(MB),TAt=a_().y(yR).x1(vR).x0(uAt).defined(MB),kAt=ure().x(vR).y(yR).defined(MB),AAt=G3e().x(vR).y(yR).width(lAt).height(cAt).cornerRadius(yAt,xAt,bAt,wAt),PAt=v$e().type(CAt).size(_At),MAt=H3e().x(vR).y(yR).defined(MB).size(SAt);function Qre(t){return t.cornerRadius||t.cornerRadiusTopLeft||t.cornerRadiusTopRight||t.cornerRadiusBottomRight||t.cornerRadiusBottomLeft}function RAt(t,e){return OAt.context(t)(e)}function DAt(t,e){const n=e[0],r=n.interpolate||"linear";return(n.orient==="horizontal"?TAt:EAt).curve(Yre(r,n.orient,n.tension)).context(t)(e)}function IAt(t,e){const n=e[0],r=n.interpolate||"linear";return kAt.curve(Yre(r,n.orient,n.tension)).context(t)(e)}function TO(t,e,n,r){return AAt.context(t)(e,n,r)}function LAt(t,e){return(e.mark.shape||e.shape).context(t)(e)}function $At(t,e){return PAt.context(t)(e)}function FAt(t,e){return MAt.context(t)(e)}var q3e=1;function X3e(){q3e=1}function Kre(t,e,n){var r=e.clip,i=t._defs,o=e.clip_id||(e.clip_id="clip"+q3e++),s=i.clipping[o]||(i.clipping[o]={id:o});return fn(r)?s.path=r(null):Qre(n)?s.path=TO(null,n,0,0):(s.width=n.width||0,s.height=n.height||0),"url(#"+o+")"}function fo(t){this.clear(),t&&this.union(t)}fo.prototype={clone(){return new fo(this)},clear(){return this.x1=+Number.MAX_VALUE,this.y1=+Number.MAX_VALUE,this.x2=-Number.MAX_VALUE,this.y2=-Number.MAX_VALUE,this},empty(){return this.x1===+Number.MAX_VALUE&&this.y1===+Number.MAX_VALUE&&this.x2===-Number.MAX_VALUE&&this.y2===-Number.MAX_VALUE},equals(t){return this.x1===t.x1&&this.y1===t.y1&&this.x2===t.x2&&this.y2===t.y2},set(t,e,n,r){return nthis.x2&&(this.x2=t),e>this.y2&&(this.y2=e),this},expand(t){return this.x1-=t,this.y1-=t,this.x2+=t,this.y2+=t,this},round(){return this.x1=Math.floor(this.x1),this.y1=Math.floor(this.y1),this.x2=Math.ceil(this.x2),this.y2=Math.ceil(this.y2),this},scale(t){return this.x1*=t,this.y1*=t,this.x2*=t,this.y2*=t,this},translate(t,e){return this.x1+=t,this.x2+=t,this.y1+=e,this.y2+=e,this},rotate(t,e,n){const r=this.rotatedPoints(t,e,n);return this.clear().add(r[0],r[1]).add(r[2],r[3]).add(r[4],r[5]).add(r[6],r[7])},rotatedPoints(t,e,n){var{x1:r,y1:i,x2:o,y2:s}=this,a=Math.cos(t),l=Math.sin(t),c=e-e*a+n*l,u=n-e*l-n*a;return[a*r-l*i+c,l*r+a*i+u,a*r-l*s+c,l*r+a*s+u,a*o-l*i+c,l*o+a*i+u,a*o-l*s+c,l*o+a*s+u]},union(t){return t.x1this.x2&&(this.x2=t.x2),t.y2>this.y2&&(this.y2=t.y2),this},intersect(t){return t.x1>this.x1&&(this.x1=t.x1),t.y1>this.y1&&(this.y1=t.y1),t.x2=t.x2&&this.y1<=t.y1&&this.y2>=t.y2},alignsWith(t){return t&&(this.x1==t.x1||this.x2==t.x2||this.y1==t.y1||this.y2==t.y2)},intersects(t){return t&&!(this.x2t.x2||this.y2t.y2)},contains(t,e){return!(tthis.x2||ethis.y2)},width(){return this.x2-this.x1},height(){return this.y2-this.y1}};function RB(t){this.mark=t,this.bounds=this.bounds||new fo}function DB(t){RB.call(this,t),this.items=this.items||[]}it(DB,RB);class Y3e{constructor(e){this._pending=0,this._loader=e||tB()}pending(){return this._pending}sanitizeURL(e){const n=this;return _ge(n),n._loader.sanitize(e,{context:"href"}).then(r=>(KE(n),r)).catch(()=>(KE(n),null))}loadImage(e){const n=this,r=lTt();return _ge(n),n._loader.sanitize(e,{context:"image"}).then(i=>{const o=i.href;if(!o||!r)throw{url:o};const s=new r,a=vt(i,"crossOrigin")?i.crossOrigin:"anonymous";return a!=null&&(s.crossOrigin=a),s.onload=()=>KE(n),s.onerror=()=>KE(n),s.src=o,s}).catch(i=>(KE(n),{complete:!1,width:0,height:0,src:i&&i.url||""}))}ready(){const e=this;return new Promise(n=>{function r(i){e.pending()?setTimeout(()=>{r(!0)},10):n(i)}r(!1)})}}function _ge(t){t._pending+=1}function KE(t){t._pending-=1}function Yg(t,e,n){if(e.stroke&&e.opacity!==0&&e.strokeOpacity!==0){const r=e.strokeWidth!=null?+e.strokeWidth:1;t.expand(r+(n?NAt(e,r):0))}return t}function NAt(t,e){return t.strokeJoin&&t.strokeJoin!=="miter"?0:e}const zAt=Wd-1e-8;let IB,v3,y3,gx,fX,x3,dX,hX;const dv=(t,e)=>IB.add(t,e),b3=(t,e)=>dv(v3=t,y3=e),Sge=t=>dv(t,IB.y1),Cge=t=>dv(IB.x1,t),K0=(t,e)=>fX*t+dX*e,Z0=(t,e)=>x3*t+hX*e,rV=(t,e)=>dv(K0(t,e),Z0(t,e)),iV=(t,e)=>b3(K0(t,e),Z0(t,e));function xR(t,e){return IB=t,e?(gx=e*ly,fX=hX=Math.cos(gx),x3=Math.sin(gx),dX=-x3):(fX=hX=1,gx=x3=dX=0),jAt}const jAt={beginPath(){},closePath(){},moveTo:iV,lineTo:iV,rect(t,e,n,r){gx?(rV(t+n,e),rV(t+n,e+r),rV(t,e+r),iV(t,e)):(dv(t+n,e+r),b3(t,e))},quadraticCurveTo(t,e,n,r){const i=K0(t,e),o=Z0(t,e),s=K0(n,r),a=Z0(n,r);Oge(v3,i,s,Sge),Oge(y3,o,a,Cge),b3(s,a)},bezierCurveTo(t,e,n,r,i,o){const s=K0(t,e),a=Z0(t,e),l=K0(n,r),c=Z0(n,r),u=K0(i,o),f=Z0(i,o);Ege(v3,s,l,u,Sge),Ege(y3,a,c,f,Cge),b3(u,f)},arc(t,e,n,r,i,o){if(r+=gx,i+=gx,v3=n*Math.cos(i)+t,y3=n*Math.sin(i)+e,Math.abs(i-r)>zAt)dv(t-n,e-n),dv(t+n,e+n);else{const s=c=>dv(n*Math.cos(c)+t,n*Math.sin(c)+e);let a,l;if(s(r),s(i),i!==r)if(r=r%Wd,r<0&&(r+=Wd),i=i%Wd,i<0&&(i+=Wd),ii;++l,a-=Q0)s(a);else for(a=r-r%Q0+Q0,l=0;l<4&&aJkt?(u=s*s+a*o,u>=0&&(u=Math.sqrt(u),l=(-s+u)/o,c=(-s-u)/o)):l=.5*a/s,0d)return!1;g>f&&(f=g)}else if(h>0){if(g0?(t.globalAlpha=n,t.fillStyle=Z3e(t,e,e.fill),!0):!1}var UAt=[];function US(t,e,n){var r=(r=e.strokeWidth)!=null?r:1;return r<=0?!1:(n*=e.strokeOpacity==null?1:e.strokeOpacity,n>0?(t.globalAlpha=n,t.strokeStyle=Z3e(t,e,e.stroke),t.lineWidth=r,t.lineCap=e.strokeCap||"butt",t.lineJoin=e.strokeJoin||"miter",t.miterLimit=e.strokeMiterLimit||10,t.setLineDash&&(t.setLineDash(e.strokeDash||UAt),t.lineDashOffset=e.strokeDashOffset||0),!0):!1)}function WAt(t,e){return t.zindex-e.zindex||t.index-e.index}function eie(t){if(!t.zdirty)return t.zitems;var e=t.items,n=[],r,i,o;for(i=0,o=e.length;i=0;)if(r=e(n[i]))return r;if(n===o){for(n=t.items,i=n.length;--i>=0;)if(!n[i].zindex&&(r=e(n[i])))return r}return null}function tie(t){return function(e,n,r){Gf(n,i=>{(!r||r.intersects(i.bounds))&&J3e(t,e,i,i)})}}function VAt(t){return function(e,n,r){n.items.length&&(!r||r.intersects(n.bounds))&&J3e(t,e,n.items[0],n.items)}}function J3e(t,e,n,r){var i=n.opacity==null?1:n.opacity;i!==0&&(t(e,r)||(BS(e,n),n.fill&&NN(e,n,i)&&e.fill(),n.stroke&&US(e,n,i)&&e.stroke()))}function LB(t){return t=t||Tu,function(e,n,r,i,o,s){return r*=e.pixelRatio,i*=e.pixelRatio,zN(n,a=>{const l=a.bounds;if(!(l&&!l.contains(o,s)||!l)&&t(e,a,r,i,o,s))return a})}}function bR(t,e){return function(n,r,i,o){var s=Array.isArray(r)?r[0]:r,a=e??s.fill,l=s.stroke&&n.isPointInStroke,c,u;return l&&(c=s.strokeWidth,u=s.strokeCap,n.lineWidth=c??1,n.lineCap=u??"butt"),t(n,r)?!1:a&&n.isPointInPath(i,o)||l&&n.isPointInStroke(i,o)}}function nie(t){return LB(bR(t))}function zx(t,e){return"translate("+t+","+e+")"}function rie(t){return"rotate("+t+")"}function GAt(t,e){return"scale("+t+","+e+")"}function eFe(t){return zx(t.x||0,t.y||0)}function HAt(t){return zx(t.x||0,t.y||0)+(t.angle?" "+rie(t.angle):"")}function qAt(t){return zx(t.x||0,t.y||0)+(t.angle?" "+rie(t.angle):"")+(t.scaleX||t.scaleY?" "+GAt(t.scaleX||1,t.scaleY||1):"")}function iie(t,e,n){function r(s,a){s("transform",HAt(a)),s("d",e(null,a))}function i(s,a){return e(xR(s,a.angle),a),Yg(s,a).translate(a.x||0,a.y||0)}function o(s,a){var l=a.x||0,c=a.y||0,u=a.angle||0;s.translate(l,c),u&&s.rotate(u*=ly),s.beginPath(),e(s,a),u&&s.rotate(-u),s.translate(-l,-c)}return{type:t,tag:"path",nested:!1,attr:r,bound:i,draw:tie(o),pick:nie(o),isect:n||Zre(o)}}var XAt=iie("arc",RAt);function YAt(t,e){for(var n=t[0].orient==="horizontal"?e[1]:e[0],r=t[0].orient==="horizontal"?"y":"x",i=t.length,o=1/0,s,a;--i>=0;)t[i].defined!==!1&&(a=Math.abs(t[i][r]-n),a=0;)if(t[r].defined!==!1&&(i=t[r].x-e[0],o=t[r].y-e[1],s=i*i+o*o,s=0;)if(t[n].defined!==!1&&(r=t[n].x-e[0],i=t[n].y-e[1],o=r*r+i*i,r=t[n].size||1,o.5&&e<1.5?.5-Math.abs(e-1):0}function ePt(t,e){t("transform",eFe(e))}function rFe(t,e){const n=nFe(e);t("d",TO(null,e,n,n))}function tPt(t,e){t("class","background"),t("aria-hidden",!0),rFe(t,e)}function nPt(t,e){t("class","foreground"),t("aria-hidden",!0),e.strokeForeground?rFe(t,e):t("d","")}function rPt(t,e,n){const r=e.clip?Kre(n,e,e):null;t("clip-path",r)}function iPt(t,e){if(!e.clip&&e.items){const n=e.items,r=n.length;for(let i=0;i{const o=i.x||0,s=i.y||0,a=i.strokeForeground,l=i.opacity==null?1:i.opacity;(i.stroke||i.fill)&&l&&(DA(t,i,o,s),BS(t,i),i.fill&&NN(t,i,l)&&t.fill(),i.stroke&&!a&&US(t,i,l)&&t.stroke()),t.save(),t.translate(o,s),i.clip&&tFe(t,i),n&&n.translate(-o,-s),Gf(i,c=>{(c.marktype==="group"||r==null||r.includes(c.marktype))&&this.draw(t,c,n,r)}),n&&n.translate(o,s),t.restore(),a&&i.stroke&&l&&(DA(t,i,o,s),BS(t,i),US(t,i,l)&&t.stroke())})}function cPt(t,e,n,r,i,o){if(e.bounds&&!e.bounds.contains(i,o)||!e.items)return null;const s=n*t.pixelRatio,a=r*t.pixelRatio;return zN(e,l=>{let c,u,f;const d=l.bounds;if(d&&!d.contains(i,o))return;u=l.x||0,f=l.y||0;const h=u+(l.width||0),p=f+(l.height||0),g=l.clip;if(g&&(ih||op))return;if(t.save(),t.translate(u,f),u=i-u,f=o-f,g&&Qre(l)&&!aPt(t,l,s,a))return t.restore(),null;const m=l.strokeForeground,v=e.interactive!==!1;return v&&m&&l.stroke&&sPt(t,l,s,a)?(t.restore(),l):(c=zN(l,y=>uPt(y,u,f)?this.pick(y,n,r,u,f):null),!c&&v&&(l.fill||!m&&l.stroke)&&oPt(t,l,s,a)&&(c=l),t.restore(),c||null)})}function uPt(t,e,n){return(t.interactive!==!1||t.marktype==="group")&&t.bounds&&t.bounds.contains(e,n)}var fPt={type:"group",tag:"g",nested:!1,attr:ePt,bound:iPt,draw:lPt,pick:cPt,isect:Q3e,content:rPt,background:tPt,foreground:nPt},IA={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",version:"1.1"};function sie(t,e){var n=t.image;return(!n||t.url&&t.url!==n.url)&&(n={complete:!1,width:0,height:0},e.loadImage(t.url).then(r=>{t.image=r,t.image.url=t.url})),n}function aie(t,e){return t.width!=null?t.width:!e||!e.width?0:t.aspect!==!1&&t.height?t.height*e.width/e.height:e.width}function lie(t,e){return t.height!=null?t.height:!e||!e.height?0:t.aspect!==!1&&t.width?t.width*e.height/e.width:e.height}function $B(t,e){return t==="center"?e/2:t==="right"?e:0}function FB(t,e){return t==="middle"?e/2:t==="bottom"?e:0}function dPt(t,e,n){const r=sie(e,n),i=aie(e,r),o=lie(e,r),s=(e.x||0)-$B(e.align,i),a=(e.y||0)-FB(e.baseline,o),l=!r.src&&r.toDataURL?r.toDataURL():r.src||"";t("href",l,IA["xmlns:xlink"],"xlink:href"),t("transform",zx(s,a)),t("width",i),t("height",o),t("preserveAspectRatio",e.aspect===!1?"none":"xMidYMid")}function hPt(t,e){const n=e.image,r=aie(e,n),i=lie(e,n),o=(e.x||0)-$B(e.align,r),s=(e.y||0)-FB(e.baseline,i);return t.set(o,s,o+r,s+i)}function pPt(t,e,n){Gf(e,r=>{if(n&&!n.intersects(r.bounds))return;const i=sie(r,this);let o=aie(r,i),s=lie(r,i);if(o===0||s===0)return;let a=(r.x||0)-$B(r.align,o),l=(r.y||0)-FB(r.baseline,s),c,u,f,d;r.aspect!==!1&&(u=i.width/i.height,f=r.width/r.height,u===u&&f===f&&u!==f&&(f{if(!(n&&!n.intersects(r.bounds))){var i=r.opacity==null?1:r.opacity;i&&iFe(t,r,i)&&(BS(t,r),t.stroke())}})}function EPt(t,e,n,r){return t.isPointInStroke?iFe(t,e,1)&&t.isPointInStroke(n,r):!1}var TPt={type:"rule",tag:"line",nested:!1,attr:SPt,bound:CPt,draw:OPt,pick:LB(EPt),isect:K3e},kPt=iie("shape",LAt),APt=iie("symbol",$At,Jre);const Pge=aIe();var pc={height:Wh,measureWidth:cie,estimateWidth:jN,width:jN,canvas:oFe};oFe(!0);function oFe(t){pc.width=t&&Uv?cie:jN}function jN(t,e){return sFe(uy(t,e),Wh(t))}function sFe(t,e){return~~(.8*t.length*e)}function cie(t,e){return Wh(t)<=0||!(e=uy(t,e))?0:aFe(e,NB(t))}function aFe(t,e){const n=`(${e}) ${t}`;let r=Pge.get(n);return r===void 0&&(Uv.font=e,r=Uv.measureText(t).width,Pge.set(n,r)),r}function Wh(t){return t.fontSize!=null?+t.fontSize||0:11}function cy(t){return t.lineHeight!=null?t.lineHeight:Wh(t)+2}function PPt(t){return We(t)?t.length>1?t:t[0]:t}function wR(t){return PPt(t.lineBreak&&t.text&&!We(t.text)?t.text.split(t.lineBreak):t.text)}function uie(t){const e=wR(t);return(We(e)?e.length-1:0)*cy(t)}function uy(t,e){const n=e==null?"":(e+"").trim();return t.limit>0&&n.length?RPt(t,n):n}function MPt(t){if(pc.width===cie){const e=NB(t);return n=>aFe(n,e)}else if(pc.width===jN){const e=Wh(t);return n=>sFe(n,e)}else return e=>pc.width(t,e)}function RPt(t,e){var n=+t.limit,r=MPt(t);if(r(e)>>1,r(e.slice(l))>n?s=l+1:a=l;return i+e.slice(s)}else{for(;s>>1),r(e.slice(0,l))Math.max(d,pc.width(e,h)),0)):f=pc.width(e,u),i==="center"?l-=f/2:i==="right"&&(l-=f),t.set(l+=s,c+=a,l+f,c+r),e.angle&&!n)t.rotate(e.angle*ly,s,a);else if(n===2)return t.rotatedPoints(e.angle*ly,s,a);return t}function LPt(t,e,n){Gf(e,r=>{var i=r.opacity==null?1:r.opacity,o,s,a,l,c,u,f;if(!(n&&!n.intersects(r.bounds)||i===0||r.fontSize<=0||r.text==null||r.text.length===0)){if(t.font=NB(r),t.textAlign=r.align||"left",o=zB(r),s=o.x1,a=o.y1,r.angle&&(t.save(),t.translate(s,a),t.rotate(r.angle*ly),s=a=0),s+=r.dx||0,a+=(r.dy||0)+fie(r),u=wR(r),BS(t,r),We(u))for(c=cy(r),l=0;le;)t.removeChild(n[--r]);return t}function hFe(t){return"mark-"+t.marktype+(t.role?" role-"+t.role:"")+(t.name?" "+t.name:"")}function jB(t,e){const n=e.getBoundingClientRect();return[t.clientX-n.left-(e.clientLeft||0),t.clientY-n.top-(e.clientTop||0)]}function BPt(t,e,n,r){var i=t&&t.mark,o,s;if(i&&(o=Tc[i.marktype]).tip){for(s=jB(e,n),s[0]-=r[0],s[1]-=r[1];t=t.mark.group;)s[0]-=t.x||0,s[1]-=t.y||0;t=o.tip(i.items,s)}return t}let pie=class{constructor(e,n){this._active=null,this._handlers={},this._loader=e||tB(),this._tooltip=n||UPt}initialize(e,n,r){return this._el=e,this._obj=r||null,this.origin(n)}element(){return this._el}canvas(){return this._el&&this._el.firstChild}origin(e){return arguments.length?(this._origin=e||[0,0],this):this._origin.slice()}scene(e){return arguments.length?(this._scene=e,this):this._scene}on(){}off(){}_handlerIndex(e,n,r){for(let i=e?e.length:0;--i>=0;)if(e[i].type===n&&(!r||e[i].handler===r))return i;return-1}handlers(e){const n=this._handlers,r=[];if(e)r.push(...n[this.eventName(e)]);else for(const i in n)r.push(...n[i]);return r}eventName(e){const n=e.indexOf(".");return n<0?e:e.slice(0,n)}handleHref(e,n,r){this._loader.sanitize(r,{context:"href"}).then(i=>{const o=new MouseEvent(e.type,e),s=hv(null,"a");for(const a in i)s.setAttribute(a,i[a]);s.dispatchEvent(o)}).catch(()=>{})}handleTooltip(e,n,r){if(n&&n.tooltip!=null){n=BPt(n,e,this.canvas(),this._origin);const i=r&&n&&n.tooltip||null;this._tooltip.call(this._obj,this,e,n,i)}}getItemBoundingClientRect(e){const n=this.canvas();if(!n)return;const r=n.getBoundingClientRect(),i=this._origin,o=e.bounds,s=o.width(),a=o.height();let l=o.x1+i[0]+r.left,c=o.y1+i[1]+r.top;for(;e.mark&&(e=e.mark.group);)l+=e.x||0,c+=e.y||0;return{x:l,y:c,width:s,height:a,left:l,top:c,right:l+s,bottom:c+a}}};function UPt(t,e,n,r){t.element().setAttribute("title",r||"")}class SR{constructor(e){this._el=null,this._bgcolor=null,this._loader=new Y3e(e)}initialize(e,n,r,i,o){return this._el=e,this.resize(n,r,i,o)}element(){return this._el}canvas(){return this._el&&this._el.firstChild}background(e){return arguments.length===0?this._bgcolor:(this._bgcolor=e,this)}resize(e,n,r,i){return this._width=e,this._height=n,this._origin=r||[0,0],this._scale=i||1,this}dirty(){}render(e,n){const r=this;return r._call=function(){r._render(e,n)},r._call(),r._call=null,r}_render(){}renderAsync(e,n){const r=this.render(e,n);return this._ready?this._ready.then(()=>r):Promise.resolve(r)}_load(e,n){var r=this,i=r._loader[e](n);if(!r._ready){const o=r._call;r._ready=r._loader.ready().then(s=>{s&&o(),r._ready=null})}return i}sanitizeURL(e){return this._load("sanitizeURL",e)}loadImage(e){return this._load("loadImage",e)}}const WPt="keydown",VPt="keypress",GPt="keyup",pFe="dragenter",_3="dragleave",gFe="dragover",mX="pointerdown",HPt="pointerup",BN="pointermove",S3="pointerout",mFe="pointerover",vX="mousedown",qPt="mouseup",vFe="mousemove",UN="mouseout",yFe="mouseover",WN="click",XPt="dblclick",YPt="wheel",xFe="mousewheel",VN="touchstart",GN="touchmove",HN="touchend",QPt=[WPt,VPt,GPt,pFe,_3,gFe,mX,HPt,BN,S3,mFe,vX,qPt,vFe,UN,yFe,WN,XPt,YPt,xFe,VN,GN,HN],yX=BN,sk=UN,xX=WN;class CR extends pie{constructor(e,n){super(e,n),this._down=null,this._touch=null,this._first=!0,this._events={},this.events=QPt,this.pointermove=Ige([BN,vFe],[mFe,yFe],[S3,UN]),this.dragover=Ige([gFe],[pFe],[_3]),this.pointerout=Lge([S3,UN]),this.dragleave=Lge([_3])}initialize(e,n,r){return this._canvas=e&&hie(e,"canvas"),[WN,vX,mX,BN,S3,_3].forEach(i=>Dge(this,i)),super.initialize(e,n,r)}canvas(){return this._canvas}context(){return this._canvas.getContext("2d")}DOMMouseScroll(e){this.fire(xFe,e)}pointerdown(e){this._down=this._active,this.fire(mX,e)}mousedown(e){this._down=this._active,this.fire(vX,e)}click(e){this._down===this._active&&(this.fire(WN,e),this._down=null)}touchstart(e){this._touch=this.pickEvent(e.changedTouches[0]),this._first&&(this._active=this._touch,this._first=!1),this.fire(VN,e,!0)}touchmove(e){this.fire(GN,e,!0)}touchend(e){this.fire(HN,e,!0),this._touch=null}fire(e,n,r){const i=r?this._touch:this._active,o=this._handlers[e];if(n.vegaType=e,e===xX&&i&&i.href?this.handleHref(n,i,i.href):(e===yX||e===sk)&&this.handleTooltip(n,i,e!==sk),o)for(let s=0,a=o.length;s=0&&i.splice(o,1),this}pickEvent(e){const n=jB(e,this._canvas),r=this._origin;return this.pick(this._scene,n[0],n[1],n[0]-r[0],n[1]-r[1])}pick(e,n,r,i,o){const s=this.context();return Tc[e.marktype].pick.call(this,s,e,n,r,i,o)}}const KPt=t=>t===VN||t===GN||t===HN?[VN,GN,HN]:[t];function Dge(t,e){KPt(e).forEach(n=>ZPt(t,n))}function ZPt(t,e){const n=t.canvas();n&&!t._events[e]&&(t._events[e]=1,n.addEventListener(e,t[e]?r=>t[e](r):r=>t.fire(e,r)))}function lT(t,e,n){e.forEach(r=>t.fire(r,n))}function Ige(t,e,n){return function(r){const i=this._active,o=this.pickEvent(r);o===i?lT(this,t,r):((!i||!i.exit)&&lT(this,n,r),this._active=o,lT(this,e,r),lT(this,t,r))}}function Lge(t){return function(e){lT(this,t,e),this._active=null}}function JPt(){return typeof window<"u"&&window.devicePixelRatio||1}function eMt(t,e,n,r,i,o){const s=typeof HTMLElement<"u"&&t instanceof HTMLElement&&t.parentNode!=null,a=t.getContext("2d"),l=s?JPt():i;t.width=e*l,t.height=n*l;for(const c in o)a[c]=o[c];return s&&l!==1&&(t.style.width=e+"px",t.style.height=n+"px"),a.pixelRatio=l,a.setTransform(l,0,0,l,l*r[0],l*r[1]),t}class qN extends SR{constructor(e){super(e),this._options={},this._redraw=!1,this._dirty=new fo,this._tempb=new fo}initialize(e,n,r,i,o,s){return this._options=s||{},this._canvas=this._options.externalContext?null:Bv(1,1,this._options.type),e&&this._canvas&&(Xc(e,0).appendChild(this._canvas),this._canvas.setAttribute("class","marks")),super.initialize(e,n,r,i,o)}resize(e,n,r,i){if(super.resize(e,n,r,i),this._canvas)eMt(this._canvas,this._width,this._height,this._origin,this._scale,this._options.context);else{const o=this._options.externalContext;o||je("CanvasRenderer is missing a valid canvas or context"),o.scale(this._scale,this._scale),o.translate(this._origin[0],this._origin[1])}return this._redraw=!0,this}canvas(){return this._canvas}context(){return this._options.externalContext||(this._canvas?this._canvas.getContext("2d"):null)}dirty(e){const n=this._tempb.clear().union(e.bounds);let r=e.mark.group;for(;r;)n.translate(r.x||0,r.y||0),r=r.mark.group;this._dirty.union(n)}_render(e,n){const r=this.context(),i=this._origin,o=this._width,s=this._height,a=this._dirty,l=tMt(i,o,s);r.save();const c=this._redraw||a.empty()?(this._redraw=!1,l.expand(1)):nMt(r,l.intersect(a),i);return this.clear(-i[0],-i[1],o,s),this.draw(r,e,c,n),r.restore(),a.clear(),this}draw(e,n,r,i){if(n.marktype!=="group"&&i!=null&&!i.includes(n.marktype))return;const o=Tc[n.marktype];n.clip&&JAt(e,n),o.draw.call(this,e,n,r,i),n.clip&&e.restore()}clear(e,n,r,i){const o=this._options,s=this.context();o.type!=="pdf"&&!o.externalContext&&s.clearRect(e,n,r,i),this._bgcolor!=null&&(s.fillStyle=this._bgcolor,s.fillRect(e,n,r,i))}}const tMt=(t,e,n)=>new fo().set(0,0,e,n).translate(-t[0],-t[1]);function nMt(t,e,n){return e.expand(1).round(),t.pixelRatio%1&&e.scale(t.pixelRatio).round().scale(1/t.pixelRatio),e.translate(-(n[0]%1),-(n[1]%1)),t.beginPath(),t.rect(e.x1,e.y1,e.width(),e.height()),t.clip(),e}class bFe extends pie{constructor(e,n){super(e,n);const r=this;r._hrefHandler=oV(r,(i,o)=>{o&&o.href&&r.handleHref(i,o,o.href)}),r._tooltipHandler=oV(r,(i,o)=>{r.handleTooltip(i,o,i.type!==sk)})}initialize(e,n,r){let i=this._svg;return i&&(i.removeEventListener(xX,this._hrefHandler),i.removeEventListener(yX,this._tooltipHandler),i.removeEventListener(sk,this._tooltipHandler)),this._svg=i=e&&hie(e,"svg"),i&&(i.addEventListener(xX,this._hrefHandler),i.addEventListener(yX,this._tooltipHandler),i.addEventListener(sk,this._tooltipHandler)),super.initialize(e,n,r)}canvas(){return this._svg}on(e,n){const r=this.eventName(e),i=this._handlers;if(this._handlerIndex(i[r],e,n)<0){const s={type:e,handler:n,listener:oV(this,n)};(i[r]||(i[r]=[])).push(s),this._svg&&this._svg.addEventListener(r,s.listener)}return this}off(e,n){const r=this.eventName(e),i=this._handlers[r],o=this._handlerIndex(i,e,n);return o>=0&&(this._svg&&this._svg.removeEventListener(r,i[o].listener),i.splice(o,1)),this}}const oV=(t,e)=>n=>{let r=n.target.__data__;r=Array.isArray(r)?r[0]:r,n.vegaType=n.type,e.call(t._obj,n,r)},wFe="aria-hidden",gie="aria-label",mie="role",vie="aria-roledescription",_Fe="graphics-object",yie="graphics-symbol",SFe=(t,e,n)=>({[mie]:t,[vie]:e,[gie]:n||void 0}),rMt=Wf(["axis-domain","axis-grid","axis-label","axis-tick","axis-title","legend-band","legend-entry","legend-gradient","legend-label","legend-title","legend-symbol","title"]),$ge={axis:{desc:"axis",caption:sMt},legend:{desc:"legend",caption:aMt},"title-text":{desc:"title",caption:t=>`Title text '${Nge(t)}'`},"title-subtitle":{desc:"subtitle",caption:t=>`Subtitle text '${Nge(t)}'`}},Fge={ariaRole:mie,ariaRoleDescription:vie,description:gie};function CFe(t,e){const n=e.aria===!1;if(t(wFe,n||void 0),n||e.description==null)for(const r in Fge)t(Fge[r],void 0);else{const r=e.mark.marktype;t(gie,e.description),t(mie,e.ariaRole||(r==="group"?_Fe:yie)),t(vie,e.ariaRoleDescription||`${r} mark`)}}function OFe(t){return t.aria===!1?{[wFe]:!0}:rMt[t.role]?null:$ge[t.role]?oMt(t,$ge[t.role]):iMt(t)}function iMt(t){const e=t.marktype,n=e==="group"||e==="text"||t.items.some(r=>r.description!=null&&r.aria!==!1);return SFe(n?_Fe:yie,`${e} mark container`,t.description)}function oMt(t,e){try{const n=t.items[0],r=e.caption||(()=>"");return SFe(e.role||yie,e.desc,n.description||r(n))}catch{return null}}function Nge(t){return pt(t.text).join(" ")}function sMt(t){const e=t.datum,n=t.orient,r=e.title?EFe(t):null,i=t.context,o=i.scales[e.scale].value,s=i.dataflow.locale(),a=o.type;return`${n==="left"||n==="right"?"Y":"X"}-axis`+(r?` titled '${r}'`:"")+` for a ${zS(a)?"discrete":a} scale with ${z3e(s,o,t)}`}function aMt(t){const e=t.datum,n=e.title?EFe(t):null,r=`${e.type||""} legend`.trim(),i=e.scales,o=Object.keys(i),s=t.context,a=s.scales[i[o[0]]].value,l=s.dataflow.locale();return cMt(r)+(n?` titled '${n}'`:"")+` for ${lMt(o)} with ${z3e(l,a,t)}`}function EFe(t){try{return pt($n(t.items).items[0].text).join(" ")}catch{return null}}function lMt(t){return t=t.map(e=>e+(e==="fill"||e==="stroke"?" color":"")),t.length<2?t[0]:t.slice(0,-1).join(", ")+" and "+$n(t)}function cMt(t){return t.length?t[0].toUpperCase()+t.slice(1):t}const TFe=t=>(t+"").replace(/&/g,"&").replace(//g,">"),uMt=t=>TFe(t).replace(/"/g,""").replace(/\t/g," ").replace(/\n/g," ").replace(/\r/g," ");function xie(){let t="",e="",n="";const r=[],i=()=>e=n="",o=l=>{e&&(t+=`${e}>${n}`,i()),r.push(l)},s=(l,c)=>(c!=null&&(e+=` ${l}="${uMt(c)}"`),a),a={open(l){o(l),e="<"+l;for(var c=arguments.length,u=new Array(c>1?c-1:0),f=1;f${n}`:"/>"):t+=``,i(),a},attr:s,text:l=>(n+=TFe(l),a),toString:()=>t};return a}const kFe=t=>AFe(xie(),t)+"";function AFe(t,e){if(t.open(e.tagName),e.hasAttributes()){const n=e.attributes,r=n.length;for(let i=0;i{u.dirty=n})),!i.zdirty){if(r.exit){s.nested&&i.items.length?(c=i.items[0],c._svg&&this._update(s,c._svg,c)):r._svg&&(c=r._svg.parentNode,c&&c.removeChild(r._svg)),r._svg=null;continue}r=s.nested?i.items[0]:r,r._update!==n&&(!r._svg||!r._svg.ownerSVGElement?(this._dirtyAll=!1,jge(r,n)):this._update(s,r._svg,r),r._update=n)}return!this._dirtyAll}mark(e,n,r,i){if(!this.isDirty(n))return n._svg;const o=this._svg,s=n.marktype,a=Tc[s],l=n.interactive===!1?"none":null,c=a.tag==="g",u=Bge(n,e,r,"g",o);if(s!=="group"&&i!=null&&!i.includes(s))return Xc(u,0),n._svg;u.setAttribute("class",hFe(n));const f=OFe(n);for(const g in f)pa(u,g,f[g]);c||pa(u,"pointer-events",l),pa(u,"clip-path",n.clip?Kre(this,n,n.group):null);let d=null,h=0;const p=g=>{const m=this.isDirty(g),v=Bge(g,u,d,a.tag,o);m&&(this._update(a,v,g),c&&hMt(this,v,g,i)),d=v,++h};return a.nested?n.items.length&&p(n.items[0]):Gf(n,p),Xc(u,h),u}_update(e,n,r){Kp=n,js=n.__values__,CFe(ak,r),e.attr(ak,r,this);const i=gMt[e.type];i&&i.call(this,e,n,r),Kp&&this.style(Kp,r)}style(e,n){if(n!=null){for(const r in XN){let i=r==="font"?_R(n):n[r];if(i===js[r])continue;const o=XN[r];i==null?e.removeAttribute(o):(Xre(i)&&(i=B3e(i,this._defs.gradient,MFe())),e.setAttribute(o,i+"")),js[r]=i}for(const r in YN)C3(e,YN[r],n[r])}}defs(){const e=this._svg,n=this._defs;let r=n.el,i=0;for(const o in n.gradient)r||(n.el=r=bo(e,ZE+1,"defs",yo)),i=fMt(r,n.gradient[o],i);for(const o in n.clipping)r||(n.el=r=bo(e,ZE+1,"defs",yo)),i=dMt(r,n.clipping[o],i);r&&(i===0?(e.removeChild(r),n.el=null):Xc(r,i))}_clearDefs(){const e=this._defs;e.gradient={},e.clipping={}}}function jge(t,e){for(;t&&t.dirty!==e;t=t.mark.group)if(t.dirty=e,t.mark&&t.mark.dirty!==e)t.mark.dirty=e;else return}function fMt(t,e,n){let r,i,o;if(e.gradient==="radial"){let s=bo(t,n++,"pattern",yo);pv(s,{id:FN+e.id,viewBox:"0,0,1,1",width:"100%",height:"100%",preserveAspectRatio:"xMidYMid slice"}),s=bo(s,0,"rect",yo),pv(s,{width:1,height:1,fill:`url(${MFe()}#${e.id})`}),t=bo(t,n++,"radialGradient",yo),pv(t,{id:e.id,fx:e.x1,fy:e.y1,fr:e.r1,cx:e.x2,cy:e.y2,r:e.r2})}else t=bo(t,n++,"linearGradient",yo),pv(t,{id:e.id,x1:e.x1,x2:e.x2,y1:e.y1,y2:e.y2});for(r=0,i=e.stops.length;r{i=t.mark(e,s,i,r),++o}),Xc(e,1+o)}function Bge(t,e,n,r,i){let o=t._svg,s;if(!o&&(s=e.ownerDocument,o=hv(s,r,yo),t._svg=o,t.mark&&(o.__data__=t,o.__values__={fill:"default"},r==="g"))){const a=hv(s,"path",yo);o.appendChild(a),a.__data__=t;const l=hv(s,"g",yo);o.appendChild(l),l.__data__=t;const c=hv(s,"path",yo);o.appendChild(c),c.__data__=t,c.__values__={fill:"default"}}return(o.ownerSVGElement!==i||pMt(o,n))&&e.insertBefore(o,n?n.nextSibling:e.firstChild),o}function pMt(t,e){return t.parentNode&&t.parentNode.childNodes.length>1&&t.previousSibling!=e}let Kp=null,js=null;const gMt={group(t,e,n){const r=Kp=e.childNodes[2];js=r.__values__,t.foreground(ak,n,this),js=e.__values__,Kp=e.childNodes[1],t.content(ak,n,this);const i=Kp=e.childNodes[0];t.background(ak,n,this);const o=n.mark.interactive===!1?"none":null;if(o!==js.events&&(pa(r,"pointer-events",o),pa(i,"pointer-events",o),js.events=o),n.strokeForeground&&n.stroke){const s=n.fill;pa(r,"display",null),this.style(i,n),pa(i,"stroke",null),s&&(n.fill=null),js=r.__values__,this.style(r,n),s&&(n.fill=s),Kp=null}else pa(r,"display","none")},image(t,e,n){n.smooth===!1?(C3(e,"image-rendering","optimizeSpeed"),C3(e,"image-rendering","pixelated")):C3(e,"image-rendering",null)},text(t,e,n){const r=wR(n);let i,o,s,a;We(r)?(o=r.map(l=>uy(n,l)),i=o.join(` -`),i!==js.text&&(Xc(e,0),s=e.ownerDocument,a=cy(n),o.forEach((l,c)=>{const u=hv(s,"tspan",yo);u.__data__=n,u.textContent=l,c&&(u.setAttribute("x",0),u.setAttribute("dy",a)),e.appendChild(u)}),js.text=i)):(o=uy(n,r),o!==js.text&&(e.textContent=o,js.text=o)),pa(e,"font-family",_R(n)),pa(e,"font-size",Wh(n)+"px"),pa(e,"font-style",n.fontStyle),pa(e,"font-variant",n.fontVariant),pa(e,"font-weight",n.fontWeight)}};function ak(t,e,n){e!==js[t]&&(n?mMt(Kp,t,e,n):pa(Kp,t,e),js[t]=e)}function C3(t,e,n){n!==js[e]&&(n==null?t.style.removeProperty(e):t.style.setProperty(e,n+""),js[e]=n)}function pv(t,e){for(const n in e)pa(t,n,e[n])}function pa(t,e,n){n!=null?t.setAttribute(e,n):t.removeAttribute(e)}function mMt(t,e,n,r){n!=null?t.setAttributeNS(r,e,n):t.removeAttributeNS(r,e)}function MFe(){let t;return typeof window>"u"?"":(t=window.location).hash?t.href.slice(0,-t.hash.length):t.href}class RFe extends SR{constructor(e){super(e),this._text=null,this._defs={gradient:{},clipping:{}}}svg(){return this._text}_render(e){const n=xie();n.open("svg",cn({},IA,{class:"marks",width:this._width*this._scale,height:this._height*this._scale,viewBox:`0 0 ${this._width} ${this._height}`}));const r=this._bgcolor;return r&&r!=="transparent"&&r!=="none"&&n.open("rect",{width:this._width,height:this._height,fill:r}).close(),n.open("g",PFe,{transform:"translate("+this._origin+")"}),this.mark(n,e),n.close(),this.defs(n),this._text=n.close()+"",this}mark(e,n){const r=Tc[n.marktype],i=r.tag,o=[CFe,r.attr];e.open("g",{class:hFe(n),"clip-path":n.clip?Kre(this,n,n.group):null},OFe(n),{"pointer-events":i!=="g"&&n.interactive===!1?"none":null});const s=a=>{const l=this.href(a);if(l&&e.open("a",l),e.open(i,this.attr(n,a,o,i!=="g"?i:null)),i==="text"){const c=wR(a);if(We(c)){const u={x:0,dy:cy(a)};for(let f=0;fthis.mark(e,d)),e.close(),c&&f?(u&&(a.fill=null),a.stroke=f,e.open("path",this.attr(n,a,r.foreground,"bgrect")).close(),u&&(a.fill=u)):e.open("path",this.attr(n,a,r.foreground,"bgfore")).close()}e.close(),l&&e.close()};return r.nested?n.items&&n.items.length&&s(n.items[0]):Gf(n,s),e.close()}href(e){const n=e.href;let r;if(n){if(r=this._hrefs&&this._hrefs[n])return r;this.sanitizeURL(n).then(i=>{i["xlink:href"]=i.href,i.href=null,(this._hrefs||(this._hrefs={}))[n]=i})}return null}attr(e,n,r,i){const o={},s=(a,l,c,u)=>{o[u||a]=l};return Array.isArray(r)?r.forEach(a=>a(s,n,this)):r(s,n,this),i&&vMt(o,n,e,i,this._defs),o}defs(e){const n=this._defs.gradient,r=this._defs.clipping;if(Object.keys(n).length+Object.keys(r).length!==0){e.open("defs");for(const o in n){const s=n[o],a=s.stops;s.gradient==="radial"?(e.open("pattern",{id:FN+o,viewBox:"0,0,1,1",width:"100%",height:"100%",preserveAspectRatio:"xMidYMid slice"}),e.open("rect",{width:"1",height:"1",fill:"url(#"+o+")"}).close(),e.close(),e.open("radialGradient",{id:o,fx:s.x1,fy:s.y1,fr:s.r1,cx:s.x2,cy:s.y2,r:s.r2})):e.open("linearGradient",{id:o,x1:s.x1,x2:s.x2,y1:s.y1,y2:s.y2});for(let l=0;l!df.svgMarkTypes.includes(o));this._svgRenderer.render(e,df.svgMarkTypes),this._canvasRenderer.render(e,i)}resize(e,n,r,i){return super.resize(e,n,r,i),this._svgRenderer.resize(e,n,r,i),this._canvasRenderer.resize(e,n,r,i),this}background(e){return df.svgOnTop?this._canvasRenderer.background(e):this._svgRenderer.background(e),this}}class DFe extends CR{constructor(e,n){super(e,n)}initialize(e,n,r){const i=bo(bo(e,0,"div"),df.svgOnTop?0:1,"div");return super.initialize(i,n,r)}}const IFe="canvas",LFe="hybrid",$Fe="png",FFe="svg",NFe="none",gv={Canvas:IFe,PNG:$Fe,SVG:FFe,Hybrid:LFe,None:NFe},h1={};h1[IFe]=h1[$Fe]={renderer:qN,headless:qN,handler:CR};h1[FFe]={renderer:bie,headless:RFe,handler:bFe};h1[LFe]={renderer:bX,headless:bX,handler:DFe};h1[NFe]={};function BB(t,e){return t=String(t||"").toLowerCase(),arguments.length>1?(h1[t]=e,this):h1[t]}function zFe(t,e,n){const r=[],i=new fo().union(e),o=t.marktype;return o?jFe(t,i,n,r):o==="group"?BFe(t,i,n,r):je("Intersect scene must be mark node or group item.")}function jFe(t,e,n,r){if(xMt(t,e,n)){const i=t.items,o=t.marktype,s=i.length;let a=0;if(o==="group")for(;a=0;o--)if(n[o]!=r[o])return!1;for(o=n.length-1;o>=0;o--)if(i=n[o],!wie(t[i],e[i],i))return!1;return typeof t==typeof e}function _Mt(){X3e(),Hkt()}const WS="top",Cf="left",Of="right",fy="bottom",SMt="top-left",CMt="top-right",OMt="bottom-left",EMt="bottom-right",_ie="start",wX="middle",ma="end",TMt="x",kMt="y",UB="group",Sie="axis",Cie="title",AMt="frame",PMt="scope",Oie="legend",GFe="row-header",HFe="row-footer",qFe="row-title",XFe="column-header",YFe="column-footer",QFe="column-title",MMt="padding",RMt="symbol",KFe="fit",ZFe="fit-x",JFe="fit-y",DMt="pad",Eie="none",FI="all",_X="each",Tie="flush",mv="column",vv="row";function eNe(t){Re.call(this,null,t)}it(eNe,Re,{transform(t,e){const n=e.dataflow,r=t.mark,i=r.marktype,o=Tc[i],s=o.bound;let a=r.bounds,l;if(o.nested)r.items.length&&n.dirty(r.items[0]),a=NI(r,s),r.items.forEach(c=>{c.bounds.clear().union(a)});else if(i===UB||t.modified())switch(e.visit(e.MOD,c=>n.dirty(c)),a.clear(),r.items.forEach(c=>a.union(NI(c,s))),r.role){case Sie:case Oie:case Cie:e.reflow()}else l=e.changed(e.REM),e.visit(e.ADD,c=>{a.union(NI(c,s))}),e.visit(e.MOD,c=>{l=l||a.alignsWith(c.bounds),n.dirty(c),a.union(NI(c,s))}),l&&(a.clear(),r.items.forEach(c=>a.union(c.bounds)));return WFe(r),e.modifies("bounds")}});function NI(t,e,n){return e(t.bounds.clear(),t,n)}const Uge=":vega_identifier:";function kie(t){Re.call(this,0,t)}kie.Definition={type:"Identifier",metadata:{modifies:!0},params:[{name:"as",type:"string",required:!0}]};it(kie,Re,{transform(t,e){const n=IMt(e.dataflow),r=t.as;let i=n.value;return e.visit(e.ADD,o=>o[r]=o[r]||++i),n.set(this.value=i),e}});function IMt(t){return t._signals[Uge]||(t._signals[Uge]=t.add(0))}function tNe(t){Re.call(this,null,t)}it(tNe,Re,{transform(t,e){let n=this.value;n||(n=e.dataflow.scenegraph().mark(t.markdef,LMt(t),t.index),n.group.context=t.context,t.context.group||(t.context.group=n.group),n.source=this.source,n.clip=t.clip,n.interactive=t.interactive,this.value=n);const r=n.marktype===UB?DB:RB;return e.visit(e.ADD,i=>r.call(i,n)),(t.modified("clip")||t.modified("interactive"))&&(n.clip=t.clip,n.interactive=!!t.interactive,n.zdirty=!0,e.reflow()),n.items=e.source,e}});function LMt(t){const e=t.groups,n=t.parent;return e&&e.size===1?e.get(Object.keys(e.object)[0]):e&&n?e.lookup(n):null}function nNe(t){Re.call(this,null,t)}const Wge={parity:t=>t.filter((e,n)=>n%2?e.opacity=0:1),greedy:(t,e)=>{let n;return t.filter((r,i)=>!i||!rNe(n.bounds,r.bounds,e)?(n=r,1):r.opacity=0)}},rNe=(t,e,n)=>n>Math.max(e.x1-t.x2,t.x1-e.x2,e.y1-t.y2,t.y1-e.y2),Vge=(t,e)=>{for(var n=1,r=t.length,i=t[0].bounds,o;n{const e=t.bounds;return e.width()>1&&e.height()>1},FMt=(t,e,n)=>{var r=t.range(),i=new fo;return e===WS||e===fy?i.set(r[0],-1/0,r[1],1/0):i.set(-1/0,r[0],1/0,r[1]),i.expand(n||1),o=>i.encloses(o.bounds)},Gge=t=>(t.forEach(e=>e.opacity=1),t),Hge=(t,e)=>t.reflow(e.modified()).modifies("opacity");it(nNe,Re,{transform(t,e){const n=Wge[t.method]||Wge.parity,r=t.separation||0;let i=e.materialize(e.SOURCE).source,o,s;if(!i||!i.length)return;if(!t.method)return t.modified("method")&&(Gge(i),e=Hge(e,t)),e;if(i=i.filter($Mt),!i.length)return;if(t.sort&&(i=i.slice().sort(t.sort)),o=Gge(i),e=Hge(e,t),o.length>=3&&Vge(o,r)){do o=n(o,r);while(o.length>=3&&Vge(o,r));o.length<3&&!$n(i).opacity&&(o.length>1&&($n(o).opacity=0),$n(i).opacity=1)}t.boundScale&&t.boundTolerance>=0&&(s=FMt(t.boundScale,t.boundOrient,+t.boundTolerance),i.forEach(l=>{s(l)||(l.opacity=0)}));const a=o[0].mark.bounds.clear();return i.forEach(l=>{l.opacity&&a.union(l.bounds)}),e}});function iNe(t){Re.call(this,null,t)}it(iNe,Re,{transform(t,e){const n=e.dataflow;if(e.visit(e.ALL,r=>n.dirty(r)),e.fields&&e.fields.zindex){const r=e.source&&e.source[0];r&&(r.mark.zdirty=!0)}}});const Ns=new fo;function c_(t,e,n){return t[e]===n?0:(t[e]=n,1)}function NMt(t){var e=t.items[0].orient;return e===Cf||e===Of}function zMt(t){let e=+t.grid;return[t.ticks?e++:-1,t.labels?e++:-1,e+ +t.domain]}function jMt(t,e,n,r){var i=e.items[0],o=i.datum,s=i.translate!=null?i.translate:.5,a=i.orient,l=zMt(o),c=i.range,u=i.offset,f=i.position,d=i.minExtent,h=i.maxExtent,p=o.title&&i.items[l[2]].items[0],g=i.titlePadding,m=i.bounds,v=p&&uie(p),y=0,x=0,b,w;switch(Ns.clear().union(m),m.clear(),(b=l[0])>-1&&m.union(i.items[b].bounds),(b=l[1])>-1&&m.union(i.items[b].bounds),a){case WS:y=f||0,x=-u,w=Math.max(d,Math.min(h,-m.y1)),m.add(0,-w).add(c,0),p&&zI(t,p,w,g,v,0,-1,m);break;case Cf:y=-u,x=f||0,w=Math.max(d,Math.min(h,-m.x1)),m.add(-w,0).add(0,c),p&&zI(t,p,w,g,v,1,-1,m);break;case Of:y=n+u,x=f||0,w=Math.max(d,Math.min(h,m.x2)),m.add(0,0).add(w,c),p&&zI(t,p,w,g,v,1,1,m);break;case fy:y=f||0,x=r+u,w=Math.max(d,Math.min(h,m.y2)),m.add(0,0).add(c,w),p&&zI(t,p,w,g,0,0,1,m);break;default:y=i.x,x=i.y}return Yg(m.translate(y,x),i),c_(i,"x",y+s)|c_(i,"y",x+s)&&(i.bounds=Ns,t.dirty(i),i.bounds=m,t.dirty(i)),i.mark.bounds.clear().union(m)}function zI(t,e,n,r,i,o,s,a){const l=e.bounds;if(e.auto){const c=s*(n+i+r);let u=0,f=0;t.dirty(e),o?u=(e.x||0)-(e.x=c):f=(e.y||0)-(e.y=c),e.mark.bounds.clear().union(l.translate(-u,-f)),t.dirty(e)}a.union(l)}const qge=(t,e)=>Math.floor(Math.min(t,e)),Xge=(t,e)=>Math.ceil(Math.max(t,e));function BMt(t){var e=t.items,n=e.length,r=0,i,o;const s={marks:[],rowheaders:[],rowfooters:[],colheaders:[],colfooters:[],rowtitle:null,coltitle:null};for(;r1)for(S=0;S0&&(x[S]+=T/2);if(a&&ai(n.center,vv)&&u!==1)for(S=0;S0&&(b[S]+=R/2);for(S=0;Si&&(t.warn("Grid headers exceed limit: "+i),e=e.slice(0,i)),g+=o,y=0,b=e.length;y=0&&(S=n[x])==null;x-=d);a?(O=h==null?S.x:Math.round(S.bounds.x1+h*S.bounds.width()),k=g):(O=g,k=h==null?S.y:Math.round(S.bounds.y1+h*S.bounds.height())),w.union(_.bounds.translate(O-(_.x||0),k-(_.y||0))),_.x=O,_.y=k,t.dirty(_),m=s(m,w[c])}return m}function Qge(t,e,n,r,i,o){if(e){t.dirty(e);var s=n,a=n;r?s=Math.round(i.x1+o*i.width()):a=Math.round(i.y1+o*i.height()),e.bounds.translate(s-(e.x||0),a-(e.y||0)),e.mark.bounds.clear().union(e.bounds),e.x=s,e.y=a,t.dirty(e)}}function qMt(t,e){const n=t[e]||{};return(r,i)=>n[r]!=null?n[r]:t[r]!=null?t[r]:i}function XMt(t,e){let n=-1/0;return t.forEach(r=>{r.offset!=null&&(n=Math.max(n,r.offset))}),n>-1/0?n:e}function YMt(t,e,n,r,i,o,s){const a=qMt(n,e),l=XMt(t,a("offset",0)),c=a("anchor",_ie),u=c===ma?1:c===wX?.5:0,f={align:_X,bounds:a("bounds",Tie),columns:a("direction")==="vertical"?1:t.length,padding:a("margin",8),center:a("center"),nodirty:!0};switch(e){case Cf:f.anchor={x:Math.floor(r.x1)-l,column:ma,y:u*(s||r.height()+2*r.y1),row:c};break;case Of:f.anchor={x:Math.ceil(r.x2)+l,y:u*(s||r.height()+2*r.y1),row:c};break;case WS:f.anchor={y:Math.floor(i.y1)-l,row:ma,x:u*(o||i.width()+2*i.x1),column:c};break;case fy:f.anchor={y:Math.ceil(i.y2)+l,x:u*(o||i.width()+2*i.x1),column:c};break;case SMt:f.anchor={x:l,y:l};break;case CMt:f.anchor={x:o-l,y:l,column:ma};break;case OMt:f.anchor={x:l,y:s-l,row:ma};break;case EMt:f.anchor={x:o-l,y:s-l,column:ma,row:ma};break}return f}function QMt(t,e){var n=e.items[0],r=n.datum,i=n.orient,o=n.bounds,s=n.x,a=n.y,l,c;return n._bounds?n._bounds.clear().union(o):n._bounds=o.clone(),o.clear(),ZMt(t,n,n.items[0].items[0]),o=KMt(n,o),l=2*n.padding,c=2*n.padding,o.empty()||(l=Math.ceil(o.width()+l),c=Math.ceil(o.height()+c)),r.type===RMt&&JMt(n.items[0].items[0].items[0].items),i!==Eie&&(n.x=s=0,n.y=a=0),n.width=l,n.height=c,Yg(o.set(s,a,s+l,a+c),n),n.mark.bounds.clear().union(o),n}function KMt(t,e){return t.items.forEach(n=>e.union(n.bounds)),e.x1=t.padding,e.y1=t.padding,e}function ZMt(t,e,n){var r=e.padding,i=r-n.x,o=r-n.y;if(!e.datum.title)(i||o)&&JE(t,n,i,o);else{var s=e.items[1].items[0],a=s.anchor,l=e.titlePadding||0,c=r-s.x,u=r-s.y;switch(s.orient){case Cf:i+=Math.ceil(s.bounds.width())+l;break;case Of:case fy:break;default:o+=s.bounds.height()+l}switch((i||o)&&JE(t,n,i,o),s.orient){case Cf:u+=Yb(e,n,s,a,1,1);break;case Of:c+=Yb(e,n,s,ma,0,0)+l,u+=Yb(e,n,s,a,1,1);break;case fy:c+=Yb(e,n,s,a,0,0),u+=Yb(e,n,s,ma,-1,0,1)+l;break;default:c+=Yb(e,n,s,a,0,0)}(c||u)&&JE(t,s,c,u),(c=Math.round(s.bounds.x1-r))<0&&(JE(t,n,-c,0),JE(t,s,-c,0))}}function Yb(t,e,n,r,i,o,s){const a=t.datum.type!=="symbol",l=n.datum.vgrad,c=a&&(o||!l)&&!s?e.items[0]:e,u=c.bounds[i?"y2":"x2"]-t.padding,f=l&&o?u:0,d=l&&o?0:u,h=i<=0?0:uie(n);return Math.round(r===_ie?f:r===ma?d-h:.5*(u-h))}function JE(t,e,n,r){e.x+=n,e.y+=r,e.bounds.translate(n,r),e.mark.bounds.translate(n,r),t.dirty(e)}function JMt(t){const e=t.reduce((n,r)=>(n[r.column]=Math.max(r.bounds.x2-r.x,n[r.column]||0),n),{});t.forEach(n=>{n.width=e[n.column],n.height=n.bounds.y2-n.y})}function eRt(t,e,n,r,i){var o=e.items[0],s=o.frame,a=o.orient,l=o.anchor,c=o.offset,u=o.padding,f=o.items[0].items[0],d=o.items[1]&&o.items[1].items[0],h=a===Cf||a===Of?r:n,p=0,g=0,m=0,v=0,y=0,x;if(s!==UB?a===Cf?(p=i.y2,h=i.y1):a===Of?(p=i.y1,h=i.y2):(p=i.x1,h=i.x2):a===Cf&&(p=r,h=0),x=l===_ie?p:l===ma?h:(p+h)/2,d&&d.text){switch(a){case WS:case fy:y=f.bounds.height()+u;break;case Cf:v=f.bounds.width()+u;break;case Of:v=-f.bounds.width()-u;break}Ns.clear().union(d.bounds),Ns.translate(v-(d.x||0),y-(d.y||0)),c_(d,"x",v)|c_(d,"y",y)&&(t.dirty(d),d.bounds.clear().union(Ns),d.mark.bounds.clear().union(Ns),t.dirty(d)),Ns.clear().union(d.bounds)}else Ns.clear();switch(Ns.union(f.bounds),a){case WS:g=x,m=i.y1-Ns.height()-c;break;case Cf:g=i.x1-Ns.width()-c,m=x;break;case Of:g=i.x2+Ns.width()+c,m=x;break;case fy:g=x,m=i.y2+c;break;default:g=o.x,m=o.y}return c_(o,"x",g)|c_(o,"y",m)&&(Ns.translate(g,m),t.dirty(o),o.bounds.clear().union(Ns),e.bounds.clear().union(Ns),t.dirty(o)),o.bounds}function sNe(t){Re.call(this,null,t)}it(sNe,Re,{transform(t,e){const n=e.dataflow;return t.mark.items.forEach(r=>{t.layout&&VMt(n,r,t.layout),nRt(n,r,t)}),tRt(t.mark.group)?e.reflow():e}});function tRt(t){return t&&t.mark.role!=="legend-entry"}function nRt(t,e,n){var r=e.items,i=Math.max(0,e.width||0),o=Math.max(0,e.height||0),s=new fo().set(0,0,i,o),a=s.clone(),l=s.clone(),c=[],u,f,d,h,p,g;for(p=0,g=r.length;p{d=v.orient||Of,d!==Eie&&(m[d]||(m[d]=[])).push(v)});for(const v in m){const y=m[v];oNe(t,y,YMt(y,v,n.legends,a,l,i,o))}c.forEach(v=>{const y=v.bounds;if(y.equals(v._bounds)||(v.bounds=v._bounds,t.dirty(v),v.bounds=y,t.dirty(v)),n.autosize&&(n.autosize.type===KFe||n.autosize.type===ZFe||n.autosize.type===JFe))switch(v.orient){case Cf:case Of:s.add(y.x1,0).add(y.x2,0);break;case WS:case fy:s.add(0,y.y1).add(0,y.y2)}else s.union(y)})}s.union(a).union(l),u&&s.union(eRt(t,u,i,o,s)),e.clip&&s.set(0,0,e.width||0,e.height||0),rRt(t,e,s,n)}function rRt(t,e,n,r){const i=r.autosize||{},o=i.type;if(t._autosize<1||!o)return;let s=t._width,a=t._height,l=Math.max(0,e.width||0),c=Math.max(0,Math.ceil(-n.x1)),u=Math.max(0,e.height||0),f=Math.max(0,Math.ceil(-n.y1));const d=Math.max(0,Math.ceil(n.x2-l)),h=Math.max(0,Math.ceil(n.y2-u));if(i.contains===MMt){const p=t.padding();s-=p.left+p.right,a-=p.top+p.bottom}o===Eie?(c=0,f=0,l=s,u=a):o===KFe?(l=Math.max(0,s-c-d),u=Math.max(0,a-f-h)):o===ZFe?(l=Math.max(0,s-c-d),a=u+f+h):o===JFe?(s=l+c+d,u=Math.max(0,a-f-h)):o===DMt&&(s=l+c+d,a=u+f+h),t._resizeView(s,a,l,u,[c,f],i.resize)}const iRt=Object.freeze(Object.defineProperty({__proto__:null,bound:eNe,identifier:kie,mark:tNe,overlap:nNe,render:iNe,viewlayout:sNe},Symbol.toStringTag,{value:"Module"}));function aNe(t){Re.call(this,null,t)}it(aNe,Re,{transform(t,e){if(this.value&&!t.modified())return e.StopPropagation;var n=e.dataflow.locale(),r=e.fork(e.NO_SOURCE|e.NO_FIELDS),i=this.value,o=t.scale,s=t.count==null?t.values?t.values.length:10:t.count,a=Hre(o,s,t.minstep),l=t.format||I3e(n,o,a,t.formatSpecifier,t.formatType,!!t.values),c=t.values?D3e(o,t.values,a):qre(o,a);return i&&(r.rem=i),i=c.map((u,f)=>cr({index:f/(c.length-1||1),value:u,label:l(u)})),t.extra&&i.length&&i.push(cr({index:-1,extra:{value:i[0].value},label:""})),r.source=i,r.add=i,this.value=i,r}});function lNe(t){Re.call(this,null,t)}function oRt(){return cr({})}function sRt(t){const e=yO().test(n=>n.exit);return e.lookup=n=>e.get(t(n)),e}it(lNe,Re,{transform(t,e){var n=e.dataflow,r=e.fork(e.NO_SOURCE|e.NO_FIELDS),i=t.item||oRt,o=t.key||jt,s=this.value;return We(r.encode)&&(r.encode=null),s&&(t.modified("key")||e.modified(o))&&je("DataJoin does not support modified key function or fields."),s||(e=e.addAll(),this.value=s=sRt(o)),e.visit(e.ADD,a=>{const l=o(a);let c=s.get(l);c?c.exit?(s.empty--,r.add.push(c)):r.mod.push(c):(c=i(a),s.set(l,c),r.add.push(c)),c.datum=a,c.exit=!1}),e.visit(e.MOD,a=>{const l=o(a),c=s.get(l);c&&(c.datum=a,r.mod.push(c))}),e.visit(e.REM,a=>{const l=o(a),c=s.get(l);a===c.datum&&!c.exit&&(r.rem.push(c),c.exit=!0,++s.empty)}),e.changed(e.ADD_MOD)&&r.modifies("datum"),(e.clean()||t.clean&&s.empty>n.cleanThreshold)&&n.runAfter(s.clean),r}});function cNe(t){Re.call(this,null,t)}it(cNe,Re,{transform(t,e){var n=e.fork(e.ADD_REM),r=t.mod||!1,i=t.encoders,o=e.encode;if(We(o))if(n.changed()||o.every(f=>i[f]))o=o[0],n.encode=null;else return e.StopPropagation;var s=o==="enter",a=i.update||Rm,l=i.enter||Rm,c=i.exit||Rm,u=(o&&!s?i[o]:a)||Rm;if(e.changed(e.ADD)&&(e.visit(e.ADD,f=>{l(f,t),a(f,t)}),n.modifies(l.output),n.modifies(a.output),u!==Rm&&u!==a&&(e.visit(e.ADD,f=>{u(f,t)}),n.modifies(u.output))),e.changed(e.REM)&&c!==Rm&&(e.visit(e.REM,f=>{c(f,t)}),n.modifies(c.output)),s||u!==Rm){const f=e.MOD|(t.modified()?e.REFLOW:0);s?(e.visit(f,d=>{const h=l(d,t)||r;(u(d,t)||h)&&n.mod.push(d)}),n.mod.length&&n.modifies(l.output)):e.visit(f,d=>{(u(d,t)||r)&&n.mod.push(d)}),n.mod.length&&n.modifies(u.output)}return n.changed()?n:e.StopPropagation}});function uNe(t){Re.call(this,[],t)}it(uNe,Re,{transform(t,e){if(this.value!=null&&!t.modified())return e.StopPropagation;var n=e.dataflow.locale(),r=e.fork(e.NO_SOURCE|e.NO_FIELDS),i=this.value,o=t.type||m3,s=t.scale,a=+t.limit,l=Hre(s,t.count==null?5:t.count,t.minstep),c=!!t.values||o===m3,u=t.format||N3e(n,s,l,o,t.formatSpecifier,t.formatType,c),f=t.values||F3e(s,l),d,h,p,g,m;return i&&(r.rem=i),o===m3?(a&&f.length>a?(e.dataflow.warn("Symbol legend count exceeds limit, filtering items."),i=f.slice(0,a-1),m=!0):i=f,fn(p=t.size)?(!t.values&&s(i[0])===0&&(i=i.slice(1)),g=i.reduce((v,y)=>Math.max(v,p(y,t)),0)):p=ra(g=p||8),i=i.map((v,y)=>cr({index:y,label:u(v,y,i),value:v,offset:g,size:p(v,t)})),m&&(m=f[i.length],i.push(cr({index:i.length,label:`…${f.length-i.length} entries`,value:m,offset:g,size:p(m,t)})))):o===Dkt?(d=s.domain(),h=P3e(s,d[0],$n(d)),f.length<3&&!t.values&&d[0]!==$n(d)&&(f=[d[0],$n(d)]),i=f.map((v,y)=>cr({index:y,label:u(v,y,f),value:v,perc:h(v)}))):(p=f.length-1,h=Vkt(s),i=f.map((v,y)=>cr({index:y,label:u(v,y,f),value:v,perc:y?h(v):0,perc2:y===p?1:h(f[y+1])}))),r.source=i,r.add=i,this.value=i,r}});const aRt=t=>t.source.x,lRt=t=>t.source.y,cRt=t=>t.target.x,uRt=t=>t.target.y;function Aie(t){Re.call(this,{},t)}Aie.Definition={type:"LinkPath",metadata:{modifies:!0},params:[{name:"sourceX",type:"field",default:"source.x"},{name:"sourceY",type:"field",default:"source.y"},{name:"targetX",type:"field",default:"target.x"},{name:"targetY",type:"field",default:"target.y"},{name:"orient",type:"enum",default:"vertical",values:["horizontal","vertical","radial"]},{name:"shape",type:"enum",default:"line",values:["line","arc","curve","diagonal","orthogonal"]},{name:"require",type:"signal"},{name:"as",type:"string",default:"path"}]};it(Aie,Re,{transform(t,e){var n=t.sourceX||aRt,r=t.sourceY||lRt,i=t.targetX||cRt,o=t.targetY||uRt,s=t.as||"path",a=t.orient||"vertical",l=t.shape||"line",c=Kge.get(l+"-"+a)||Kge.get(l);return c||je("LinkPath unsupported type: "+t.shape+(t.orient?"-"+t.orient:"")),e.visit(e.SOURCE,u=>{u[s]=c(n(u),r(u),i(u),o(u))}),e.reflow(t.modified()).modifies(s)}});const fNe=(t,e,n,r)=>"M"+t+","+e+"L"+n+","+r,fRt=(t,e,n,r)=>fNe(e*Math.cos(t),e*Math.sin(t),r*Math.cos(n),r*Math.sin(n)),dNe=(t,e,n,r)=>{var i=n-t,o=r-e,s=Math.hypot(i,o)/2,a=180*Math.atan2(o,i)/Math.PI;return"M"+t+","+e+"A"+s+","+s+" "+a+" 0 1 "+n+","+r},dRt=(t,e,n,r)=>dNe(e*Math.cos(t),e*Math.sin(t),r*Math.cos(n),r*Math.sin(n)),hNe=(t,e,n,r)=>{const i=n-t,o=r-e,s=.2*(i+o),a=.2*(o-i);return"M"+t+","+e+"C"+(t+s)+","+(e+a)+" "+(n+a)+","+(r-s)+" "+n+","+r},hRt=(t,e,n,r)=>hNe(e*Math.cos(t),e*Math.sin(t),r*Math.cos(n),r*Math.sin(n)),pRt=(t,e,n,r)=>"M"+t+","+e+"V"+r+"H"+n,gRt=(t,e,n,r)=>"M"+t+","+e+"H"+n+"V"+r,mRt=(t,e,n,r)=>{const i=Math.cos(t),o=Math.sin(t),s=Math.cos(n),a=Math.sin(n),l=Math.abs(n-t)>Math.PI?n<=t:n>t;return"M"+e*i+","+e*o+"A"+e+","+e+" 0 0,"+(l?1:0)+" "+e*s+","+e*a+"L"+r*s+","+r*a},vRt=(t,e,n,r)=>{const i=(t+n)/2;return"M"+t+","+e+"C"+i+","+e+" "+i+","+r+" "+n+","+r},yRt=(t,e,n,r)=>{const i=(e+r)/2;return"M"+t+","+e+"C"+t+","+i+" "+n+","+i+" "+n+","+r},xRt=(t,e,n,r)=>{const i=Math.cos(t),o=Math.sin(t),s=Math.cos(n),a=Math.sin(n),l=(e+r)/2;return"M"+e*i+","+e*o+"C"+l*i+","+l*o+" "+l*s+","+l*a+" "+r*s+","+r*a},Kge=yO({line:fNe,"line-radial":fRt,arc:dNe,"arc-radial":dRt,curve:hNe,"curve-radial":hRt,"orthogonal-horizontal":pRt,"orthogonal-vertical":gRt,"orthogonal-radial":mRt,"diagonal-horizontal":vRt,"diagonal-vertical":yRt,"diagonal-radial":xRt});function Pie(t){Re.call(this,null,t)}Pie.Definition={type:"Pie",metadata:{modifies:!0},params:[{name:"field",type:"field"},{name:"startAngle",type:"number",default:0},{name:"endAngle",type:"number",default:6.283185307179586},{name:"sort",type:"boolean",default:!1},{name:"as",type:"string",array:!0,length:2,default:["startAngle","endAngle"]}]};it(Pie,Re,{transform(t,e){var n=t.as||["startAngle","endAngle"],r=n[0],i=n[1],o=t.field||gO,s=t.startAngle||0,a=t.endAngle!=null?t.endAngle:2*Math.PI,l=e.source,c=l.map(o),u=c.length,f=s,d=(a-s)/SIe(c),h=al(u),p,g,m;for(t.sort&&h.sort((v,y)=>c[v]-c[y]),p=0;p-1)return r;var i=e.domain,o=t.type,s=e.zero||e.zero===void 0&&wRt(t),a,l;if(!i)return 0;if((s||e.domainMin!=null||e.domainMax!=null||e.domainMid!=null)&&(a=(i=i.slice()).length-1||1,s&&(i[0]>0&&(i[0]=0),i[a]<0&&(i[a]=0)),e.domainMin!=null&&(i[0]=e.domainMin),e.domainMax!=null&&(i[a]=e.domainMax),e.domainMid!=null)){l=e.domainMid;const c=l>i[a]?a+1:li+(o<0?-1:o>0?1:0),0));r!==e.length&&n.warn("Log scale domain includes zero: "+rt(e))}return e}function kRt(t,e,n){let r=e.bins;if(r&&!We(r)){const i=t.domain(),o=i[0],s=$n(i),a=r.step;let l=r.start==null?o:r.start,c=r.stop==null?s:r.stop;a||je("Scale bins parameter missing step property."),ls&&(c=a*Math.floor(s/a)),r=al(l,c+a/2,a)}return r?t.bins=r:t.bins&&delete t.bins,t.type===jre&&(r?!e.domain&&!e.domainRaw&&(t.domain(r),n=r.length):t.bins=t.domain()),n}function ARt(t,e,n){var r=t.type,i=e.round||!1,o=e.range;if(e.rangeStep!=null)o=PRt(r,e,n);else if(e.scheme&&(o=MRt(r,e,n),fn(o))){if(t.interpolator)return t.interpolator(o);je(`Scale type ${r} does not support interpolating color schemes.`)}if(o&&E3e(r))return t.interpolator(PB(SX(o,e.reverse),e.interpolate,e.interpolateGamma));o&&e.interpolate&&t.interpolate?t.interpolate(Vre(e.interpolate,e.interpolateGamma)):fn(t.round)?t.round(i):fn(t.rangeRound)&&t.interpolate(i?uR:Wy),o&&t.range(SX(o,e.reverse))}function PRt(t,e,n){t!==x3e&&t!==lX&&je("Only band and point scales support rangeStep.");var r=(e.paddingOuter!=null?e.paddingOuter:e.padding)||0,i=t===lX?1:(e.paddingInner!=null?e.paddingInner:e.padding)||0;return[0,e.rangeStep*Nre(n,i,r)]}function MRt(t,e,n){var r=e.schemeExtent,i,o;return We(e.scheme)?o=PB(e.scheme,e.interpolate,e.interpolateGamma):(i=e.scheme.toLowerCase(),o=Gre(i),o||je(`Unrecognized scheme name: ${e.scheme}`)),n=t===AB?n+1:t===jre?n-1:t===NS||t===kB?+e.schemeCount||bRt:n,E3e(t)?Zge(o,r,e.reverse):fn(o)?A3e(Zge(o,r),n):t===zre?o:o.slice(0,n)}function Zge(t,e,n){return fn(t)&&(e||n)?k3e(t,SX(e||[0,1],n)):t}function SX(t,e){return e?t.slice().reverse():t}function vNe(t){Re.call(this,null,t)}it(vNe,Re,{transform(t,e){const n=t.modified("sort")||e.changed(e.ADD)||e.modified(t.sort.fields)||e.modified("datum");return n&&e.source.sort(ab(t.sort)),this.modified(n),e}});const Jge="zero",yNe="center",xNe="normalize",bNe=["y0","y1"];function Mie(t){Re.call(this,null,t)}Mie.Definition={type:"Stack",metadata:{modifies:!0},params:[{name:"field",type:"field"},{name:"groupby",type:"field",array:!0},{name:"sort",type:"compare"},{name:"offset",type:"enum",default:Jge,values:[Jge,yNe,xNe]},{name:"as",type:"string",array:!0,length:2,default:bNe}]};it(Mie,Re,{transform(t,e){var n=t.as||bNe,r=n[0],i=n[1],o=ab(t.sort),s=t.field||gO,a=t.offset===yNe?RRt:t.offset===xNe?DRt:IRt,l,c,u,f;for(l=LRt(e.source,t.groupby,o,s),c=0,u=l.length,f=l.max;cg(u),s,a,l,c,u,f,d,h,p;if(e==null)i.push(t.slice());else for(s={},a=0,l=t.length;ap&&(p=h),n&&d.sort(n)}return i.max=p,i}const $Rt=Object.freeze(Object.defineProperty({__proto__:null,axisticks:aNe,datajoin:lNe,encode:cNe,legendentries:uNe,linkpath:Aie,pie:Pie,scale:gNe,sortitems:vNe,stack:Mie},Symbol.toStringTag,{value:"Module"}));var Ut=1e-6,QN=1e-12,xn=Math.PI,$i=xn/2,KN=xn/4,Pa=xn*2,Wi=180/xn,vn=xn/180,Ln=Math.abs,kO=Math.atan,Pu=Math.atan2,Vt=Math.cos,BI=Math.ceil,wNe=Math.exp,CX=Math.hypot,ZN=Math.log,aV=Math.pow,Bt=Math.sin,ou=Math.sign||function(t){return t>0?1:t<0?-1:0},Ma=Math.sqrt,Rie=Math.tan;function _Ne(t){return t>1?0:t<-1?xn:Math.acos(t)}function Cl(t){return t>1?$i:t<-1?-$i:Math.asin(t)}function hs(){}function JN(t,e){t&&tme.hasOwnProperty(t.type)&&tme[t.type](t,e)}var eme={Feature:function(t,e){JN(t.geometry,e)},FeatureCollection:function(t,e){for(var n=t.features,r=-1,i=n.length;++r=0?1:-1,i=r*n,o=Vt(e),s=Bt(e),a=kX*s,l=TX*o+a*Vt(i),c=a*r*Bt(i);e5.add(Pu(c,l)),EX=t,TX=o,kX=s}function jRt(t){return t5=new Ea,Up(t,Ph),t5*2}function n5(t){return[Pu(t[1],t[0]),Cl(t[2])]}function p1(t){var e=t[0],n=t[1],r=Vt(n);return[r*Vt(e),r*Bt(e),Bt(n)]}function UI(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function VS(t,e){return[t[1]*e[2]-t[2]*e[1],t[2]*e[0]-t[0]*e[2],t[0]*e[1]-t[1]*e[0]]}function lV(t,e){t[0]+=e[0],t[1]+=e[1],t[2]+=e[2]}function WI(t,e){return[t[0]*e,t[1]*e,t[2]*e]}function r5(t){var e=Ma(t[0]*t[0]+t[1]*t[1]+t[2]*t[2]);t[0]/=e,t[1]/=e,t[2]/=e}var xi,Ka,Ri,Zl,U0,ENe,TNe,$_,lk,Ym,Fg,$p={point:AX,lineStart:rme,lineEnd:ime,polygonStart:function(){$p.point=ANe,$p.lineStart=BRt,$p.lineEnd=URt,lk=new Ea,Ph.polygonStart()},polygonEnd:function(){Ph.polygonEnd(),$p.point=AX,$p.lineStart=rme,$p.lineEnd=ime,e5<0?(xi=-(Ri=180),Ka=-(Zl=90)):lk>Ut?Zl=90:lk<-Ut&&(Ka=-90),Fg[0]=xi,Fg[1]=Ri},sphere:function(){xi=-(Ri=180),Ka=-(Zl=90)}};function AX(t,e){Ym.push(Fg=[xi=t,Ri=t]),eZl&&(Zl=e)}function kNe(t,e){var n=p1([t*vn,e*vn]);if($_){var r=VS($_,n),i=[r[1],-r[0],0],o=VS(i,r);r5(o),o=n5(o);var s=t-U0,a=s>0?1:-1,l=o[0]*Wi*a,c,u=Ln(s)>180;u^(a*U0Zl&&(Zl=c)):(l=(l+360)%360-180,u^(a*U0Zl&&(Zl=e))),u?tYl(xi,Ri)&&(Ri=t):Yl(t,Ri)>Yl(xi,Ri)&&(xi=t):Ri>=xi?(tRi&&(Ri=t)):t>U0?Yl(xi,t)>Yl(xi,Ri)&&(Ri=t):Yl(t,Ri)>Yl(xi,Ri)&&(xi=t)}else Ym.push(Fg=[xi=t,Ri=t]);eZl&&(Zl=e),$_=n,U0=t}function rme(){$p.point=kNe}function ime(){Fg[0]=xi,Fg[1]=Ri,$p.point=AX,$_=null}function ANe(t,e){if($_){var n=t-U0;lk.add(Ln(n)>180?n+(n>0?360:-360):n)}else ENe=t,TNe=e;Ph.point(t,e),kNe(t,e)}function BRt(){Ph.lineStart()}function URt(){ANe(ENe,TNe),Ph.lineEnd(),Ln(lk)>Ut&&(xi=-(Ri=180)),Fg[0]=xi,Fg[1]=Ri,$_=null}function Yl(t,e){return(e-=t)<0?e+360:e}function WRt(t,e){return t[0]-e[0]}function ome(t,e){return t[0]<=t[1]?t[0]<=e&&e<=t[1]:eYl(r[0],r[1])&&(r[1]=i[1]),Yl(i[0],r[1])>Yl(r[0],r[1])&&(r[0]=i[0])):o.push(r=i);for(s=-1/0,n=o.length-1,e=0,r=o[n];e<=n;r=i,++e)i=o[e],(a=Yl(r[1],i[0]))>s&&(s=a,xi=i[0],Ri=r[1])}return Ym=Fg=null,xi===1/0||Ka===1/0?[[NaN,NaN],[NaN,NaN]]:[[xi,Ka],[Ri,Zl]]}var cT,i5,o5,s5,a5,l5,c5,u5,PX,MX,RX,PNe,MNe,ya,xa,ba,Ef={sphere:hs,point:Die,lineStart:sme,lineEnd:ame,polygonStart:function(){Ef.lineStart=qRt,Ef.lineEnd=XRt},polygonEnd:function(){Ef.lineStart=sme,Ef.lineEnd=ame}};function Die(t,e){t*=vn,e*=vn;var n=Vt(e);OR(n*Vt(t),n*Bt(t),Bt(e))}function OR(t,e,n){++cT,o5+=(t-o5)/cT,s5+=(e-s5)/cT,a5+=(n-a5)/cT}function sme(){Ef.point=GRt}function GRt(t,e){t*=vn,e*=vn;var n=Vt(e);ya=n*Vt(t),xa=n*Bt(t),ba=Bt(e),Ef.point=HRt,OR(ya,xa,ba)}function HRt(t,e){t*=vn,e*=vn;var n=Vt(e),r=n*Vt(t),i=n*Bt(t),o=Bt(e),s=Pu(Ma((s=xa*o-ba*i)*s+(s=ba*r-ya*o)*s+(s=ya*i-xa*r)*s),ya*r+xa*i+ba*o);i5+=s,l5+=s*(ya+(ya=r)),c5+=s*(xa+(xa=i)),u5+=s*(ba+(ba=o)),OR(ya,xa,ba)}function ame(){Ef.point=Die}function qRt(){Ef.point=YRt}function XRt(){RNe(PNe,MNe),Ef.point=Die}function YRt(t,e){PNe=t,MNe=e,t*=vn,e*=vn,Ef.point=RNe;var n=Vt(e);ya=n*Vt(t),xa=n*Bt(t),ba=Bt(e),OR(ya,xa,ba)}function RNe(t,e){t*=vn,e*=vn;var n=Vt(e),r=n*Vt(t),i=n*Bt(t),o=Bt(e),s=xa*o-ba*i,a=ba*r-ya*o,l=ya*i-xa*r,c=CX(s,a,l),u=Cl(c),f=c&&-u/c;PX.add(f*s),MX.add(f*a),RX.add(f*l),i5+=u,l5+=u*(ya+(ya=r)),c5+=u*(xa+(xa=i)),u5+=u*(ba+(ba=o)),OR(ya,xa,ba)}function QRt(t){cT=i5=o5=s5=a5=l5=c5=u5=0,PX=new Ea,MX=new Ea,RX=new Ea,Up(t,Ef);var e=+PX,n=+MX,r=+RX,i=CX(e,n,r);return ixn&&(t-=Math.round(t/Pa)*Pa),[t,e]}IX.invert=IX;function DNe(t,e,n){return(t%=Pa)?e||n?DX(cme(t),ume(e,n)):cme(t):e||n?ume(e,n):IX}function lme(t){return function(e,n){return e+=t,Ln(e)>xn&&(e-=Math.round(e/Pa)*Pa),[e,n]}}function cme(t){var e=lme(t);return e.invert=lme(-t),e}function ume(t,e){var n=Vt(t),r=Bt(t),i=Vt(e),o=Bt(e);function s(a,l){var c=Vt(l),u=Vt(a)*c,f=Bt(a)*c,d=Bt(l),h=d*n+u*r;return[Pu(f*i-h*o,u*n-d*r),Cl(h*i+f*o)]}return s.invert=function(a,l){var c=Vt(l),u=Vt(a)*c,f=Bt(a)*c,d=Bt(l),h=d*i-f*o;return[Pu(f*i+d*o,u*n+h*r),Cl(h*n-u*r)]},s}function KRt(t){t=DNe(t[0]*vn,t[1]*vn,t.length>2?t[2]*vn:0);function e(n){return n=t(n[0]*vn,n[1]*vn),n[0]*=Wi,n[1]*=Wi,n}return e.invert=function(n){return n=t.invert(n[0]*vn,n[1]*vn),n[0]*=Wi,n[1]*=Wi,n},e}function ZRt(t,e,n,r,i,o){if(n){var s=Vt(e),a=Bt(e),l=r*n;i==null?(i=e+r*Pa,o=e-l/2):(i=fme(s,i),o=fme(s,o),(r>0?io)&&(i+=r*Pa));for(var c,u=i;r>0?u>o:u1&&t.push(t.pop().concat(t.shift()))},result:function(){var n=t;return t=[],e=null,n}}}function O3(t,e){return Ln(t[0]-e[0])=0;--a)i.point((f=u[a])[0],f[1]);else r(d.x,d.p.x,-1,i);d=d.p}d=d.o,u=d.z,h=!h}while(!d.v);i.lineEnd()}}}function dme(t){if(e=t.length){for(var e,n=0,r=t[0],i;++n=0?1:-1,E=k*O,M=E>xn,A=m*_;if(l.add(Pu(A*k*Bt(E),v*S+A*Vt(E))),s+=M?O+k*Pa:O,M^p>=n^b>=n){var P=VS(p1(h),p1(x));r5(P);var T=VS(o,P);r5(T);var R=(M^O>=0?-1:1)*Cl(T[2]);(r>R||r===R&&(P[0]||P[1]))&&(a+=M^O>=0?1:-1)}}return(s<-Ut||s0){for(l||(i.polygonStart(),l=!0),i.lineStart(),_=0;_1&&b&2&&w.push(w.pop().concat(w.shift())),u.push(w.filter(eDt))}}return d}}function eDt(t){return t.length>1}function tDt(t,e){return((t=t.x)[0]<0?t[1]-$i-Ut:$i-t[1])-((e=e.x)[0]<0?e[1]-$i-Ut:$i-e[1])}const hme=$Ne(function(){return!0},nDt,iDt,[-xn,-$i]);function nDt(t){var e=NaN,n=NaN,r=NaN,i;return{lineStart:function(){t.lineStart(),i=1},point:function(o,s){var a=o>0?xn:-xn,l=Ln(o-e);Ln(l-xn)0?$i:-$i),t.point(r,n),t.lineEnd(),t.lineStart(),t.point(a,n),t.point(o,n),i=0):r!==a&&l>=xn&&(Ln(e-r)Ut?kO((Bt(e)*(o=Vt(r))*Bt(n)-Bt(r)*(i=Vt(e))*Bt(t))/(i*o*s)):(e+r)/2}function iDt(t,e,n,r){var i;if(t==null)i=n*$i,r.point(-xn,i),r.point(0,i),r.point(xn,i),r.point(xn,0),r.point(xn,-i),r.point(0,-i),r.point(-xn,-i),r.point(-xn,0),r.point(-xn,i);else if(Ln(t[0]-e[0])>Ut){var o=t[0]0,i=Ln(e)>Ut;function o(u,f,d,h){ZRt(h,t,n,d,u,f)}function s(u,f){return Vt(u)*Vt(f)>e}function a(u){var f,d,h,p,g;return{lineStart:function(){p=h=!1,g=1},point:function(m,v){var y=[m,v],x,b=s(m,v),w=r?b?0:c(m,v):b?c(m+(m<0?xn:-xn),v):0;if(!f&&(p=h=b)&&u.lineStart(),b!==h&&(x=l(f,y),(!x||O3(f,x)||O3(y,x))&&(y[2]=1)),b!==h)g=0,b?(u.lineStart(),x=l(y,f),u.point(x[0],x[1])):(x=l(f,y),u.point(x[0],x[1],2),u.lineEnd()),f=x;else if(i&&f&&r^b){var _;!(w&d)&&(_=l(y,f,!0))&&(g=0,r?(u.lineStart(),u.point(_[0][0],_[0][1]),u.point(_[1][0],_[1][1]),u.lineEnd()):(u.point(_[1][0],_[1][1]),u.lineEnd(),u.lineStart(),u.point(_[0][0],_[0][1],3)))}b&&(!f||!O3(f,y))&&u.point(y[0],y[1]),f=y,h=b,d=w},lineEnd:function(){h&&u.lineEnd(),f=null},clean:function(){return g|(p&&h)<<1}}}function l(u,f,d){var h=p1(u),p=p1(f),g=[1,0,0],m=VS(h,p),v=UI(m,m),y=m[0],x=v-y*y;if(!x)return!d&&u;var b=e*v/x,w=-e*y/x,_=VS(g,m),S=WI(g,b),O=WI(m,w);lV(S,O);var k=_,E=UI(S,k),M=UI(k,k),A=E*E-M*(UI(S,S)-1);if(!(A<0)){var P=Ma(A),T=WI(k,(-E-P)/M);if(lV(T,S),T=n5(T),!d)return T;var R=u[0],I=f[0],B=u[1],$=f[1],z;I0^T[1]<(Ln(T[0]-R)xn^(R<=T[0]&&T[0]<=I)){var F=WI(k,(-E+P)/M);return lV(F,S),[T,n5(F)]}}}function c(u,f){var d=r?t:xn-t,h=0;return u<-d?h|=1:u>d&&(h|=2),f<-d?h|=4:f>d&&(h|=8),h}return $Ne(s,a,o,r?[0,-t]:[-xn,t-xn])}function sDt(t,e,n,r,i,o){var s=t[0],a=t[1],l=e[0],c=e[1],u=0,f=1,d=l-s,h=c-a,p;if(p=n-s,!(!d&&p>0)){if(p/=d,d<0){if(p0){if(p>f)return;p>u&&(u=p)}if(p=i-s,!(!d&&p<0)){if(p/=d,d<0){if(p>f)return;p>u&&(u=p)}else if(d>0){if(p0)){if(p/=h,h<0){if(p0){if(p>f)return;p>u&&(u=p)}if(p=o-a,!(!h&&p<0)){if(p/=h,h<0){if(p>f)return;p>u&&(u=p)}else if(h>0){if(p0&&(t[0]=s+u*d,t[1]=a+u*h),f<1&&(e[0]=s+f*d,e[1]=a+f*h),!0}}}}}var uT=1e9,GI=-uT;function FNe(t,e,n,r){function i(c,u){return t<=c&&c<=n&&e<=u&&u<=r}function o(c,u,f,d){var h=0,p=0;if(c==null||(h=s(c,f))!==(p=s(u,f))||l(c,u)<0^f>0)do d.point(h===0||h===3?t:n,h>1?r:e);while((h=(h+f+4)%4)!==p);else d.point(u[0],u[1])}function s(c,u){return Ln(c[0]-t)0?0:3:Ln(c[0]-n)0?2:1:Ln(c[1]-e)0?1:0:u>0?3:2}function a(c,u){return l(c.x,u.x)}function l(c,u){var f=s(c,1),d=s(u,1);return f!==d?f-d:f===0?u[1]-c[1]:f===1?c[0]-u[0]:f===2?c[1]-u[1]:u[0]-c[0]}return function(c){var u=c,f=INe(),d,h,p,g,m,v,y,x,b,w,_,S={point:O,lineStart:A,lineEnd:P,polygonStart:E,polygonEnd:M};function O(R,I){i(R,I)&&u.point(R,I)}function k(){for(var R=0,I=0,B=h.length;Ir&&(H-N)*(r-F)>(q-F)*(t-N)&&++R:q<=r&&(H-N)*(r-F)<(q-F)*(t-N)&&--R;return R}function E(){u=f,d=[],h=[],_=!0}function M(){var R=k(),I=_&&R,B=(d=_Ie(d)).length;(I||B)&&(c.polygonStart(),I&&(c.lineStart(),o(null,null,1,c),c.lineEnd()),B&&LNe(d,a,R,o,c),c.polygonEnd()),u=c,d=h=p=null}function A(){S.point=T,h&&h.push(p=[]),w=!0,b=!1,y=x=NaN}function P(){d&&(T(g,m),v&&b&&f.rejoin(),d.push(f.result())),S.point=O,b&&u.lineEnd()}function T(R,I){var B=i(R,I);if(h&&p.push([R,I]),w)g=R,m=I,v=B,w=!1,B&&(u.lineStart(),u.point(R,I));else if(B&&b)u.point(R,I);else{var $=[y=Math.max(GI,Math.min(uT,y)),x=Math.max(GI,Math.min(uT,x))],z=[R=Math.max(GI,Math.min(uT,R)),I=Math.max(GI,Math.min(uT,I))];sDt($,z,t,e,n,r)?(b||(u.lineStart(),u.point($[0],$[1])),u.point(z[0],z[1]),B||u.lineEnd(),_=!1):B&&(u.lineStart(),u.point(R,I),_=!1)}y=R,x=I,b=B}return S}}function pme(t,e,n){var r=al(t,e-Ut,n).concat(e);return function(i){return r.map(function(o){return[i,o]})}}function gme(t,e,n){var r=al(t,e-Ut,n).concat(e);return function(i){return r.map(function(o){return[o,i]})}}function aDt(){var t,e,n,r,i,o,s,a,l=10,c=l,u=90,f=360,d,h,p,g,m=2.5;function v(){return{type:"MultiLineString",coordinates:y()}}function y(){return al(BI(r/u)*u,n,u).map(p).concat(al(BI(a/f)*f,s,f).map(g)).concat(al(BI(e/l)*l,t,l).filter(function(x){return Ln(x%u)>Ut}).map(d)).concat(al(BI(o/c)*c,i,c).filter(function(x){return Ln(x%f)>Ut}).map(h))}return v.lines=function(){return y().map(function(x){return{type:"LineString",coordinates:x}})},v.outline=function(){return{type:"Polygon",coordinates:[p(r).concat(g(s).slice(1),p(n).reverse().slice(1),g(a).reverse().slice(1))]}},v.extent=function(x){return arguments.length?v.extentMajor(x).extentMinor(x):v.extentMinor()},v.extentMajor=function(x){return arguments.length?(r=+x[0][0],n=+x[1][0],a=+x[0][1],s=+x[1][1],r>n&&(x=r,r=n,n=x),a>s&&(x=a,a=s,s=x),v.precision(m)):[[r,a],[n,s]]},v.extentMinor=function(x){return arguments.length?(e=+x[0][0],t=+x[1][0],o=+x[0][1],i=+x[1][1],e>t&&(x=e,e=t,t=x),o>i&&(x=o,o=i,i=x),v.precision(m)):[[e,o],[t,i]]},v.step=function(x){return arguments.length?v.stepMajor(x).stepMinor(x):v.stepMinor()},v.stepMajor=function(x){return arguments.length?(u=+x[0],f=+x[1],v):[u,f]},v.stepMinor=function(x){return arguments.length?(l=+x[0],c=+x[1],v):[l,c]},v.precision=function(x){return arguments.length?(m=+x,d=pme(o,i,90),h=gme(e,t,m),p=pme(a,s,90),g=gme(r,n,m),v):m},v.extentMajor([[-180,-90+Ut],[180,90-Ut]]).extentMinor([[-180,-80-Ut],[180,80+Ut]])}const LA=t=>t;var uV=new Ea,LX=new Ea,NNe,zNe,$X,FX,Wp={point:hs,lineStart:hs,lineEnd:hs,polygonStart:function(){Wp.lineStart=lDt,Wp.lineEnd=uDt},polygonEnd:function(){Wp.lineStart=Wp.lineEnd=Wp.point=hs,uV.add(Ln(LX)),LX=new Ea},result:function(){var t=uV/2;return uV=new Ea,t}};function lDt(){Wp.point=cDt}function cDt(t,e){Wp.point=jNe,NNe=$X=t,zNe=FX=e}function jNe(t,e){LX.add(FX*t-$X*e),$X=t,FX=e}function uDt(){jNe(NNe,zNe)}var GS=1/0,f5=GS,$A=-GS,d5=$A,h5={point:fDt,lineStart:hs,lineEnd:hs,polygonStart:hs,polygonEnd:hs,result:function(){var t=[[GS,f5],[$A,d5]];return $A=d5=-(f5=GS=1/0),t}};function fDt(t,e){t$A&&($A=t),ed5&&(d5=e)}var NX=0,zX=0,fT=0,p5=0,g5=0,u_=0,jX=0,BX=0,dT=0,BNe,UNe,Vd,Gd,Zc={point:g1,lineStart:mme,lineEnd:vme,polygonStart:function(){Zc.lineStart=pDt,Zc.lineEnd=gDt},polygonEnd:function(){Zc.point=g1,Zc.lineStart=mme,Zc.lineEnd=vme},result:function(){var t=dT?[jX/dT,BX/dT]:u_?[p5/u_,g5/u_]:fT?[NX/fT,zX/fT]:[NaN,NaN];return NX=zX=fT=p5=g5=u_=jX=BX=dT=0,t}};function g1(t,e){NX+=t,zX+=e,++fT}function mme(){Zc.point=dDt}function dDt(t,e){Zc.point=hDt,g1(Vd=t,Gd=e)}function hDt(t,e){var n=t-Vd,r=e-Gd,i=Ma(n*n+r*r);p5+=i*(Vd+t)/2,g5+=i*(Gd+e)/2,u_+=i,g1(Vd=t,Gd=e)}function vme(){Zc.point=g1}function pDt(){Zc.point=mDt}function gDt(){WNe(BNe,UNe)}function mDt(t,e){Zc.point=WNe,g1(BNe=Vd=t,UNe=Gd=e)}function WNe(t,e){var n=t-Vd,r=e-Gd,i=Ma(n*n+r*r);p5+=i*(Vd+t)/2,g5+=i*(Gd+e)/2,u_+=i,i=Gd*t-Vd*e,jX+=i*(Vd+t),BX+=i*(Gd+e),dT+=i*3,g1(Vd=t,Gd=e)}function VNe(t){this._context=t}VNe.prototype={_radius:4.5,pointRadius:function(t){return this._radius=t,this},polygonStart:function(){this._line=0},polygonEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){this._line===0&&this._context.closePath(),this._point=NaN},point:function(t,e){switch(this._point){case 0:{this._context.moveTo(t,e),this._point=1;break}case 1:{this._context.lineTo(t,e);break}default:{this._context.moveTo(t+this._radius,e),this._context.arc(t,e,this._radius,0,Pa);break}}},result:hs};var UX=new Ea,fV,GNe,HNe,hT,pT,FA={point:hs,lineStart:function(){FA.point=vDt},lineEnd:function(){fV&&qNe(GNe,HNe),FA.point=hs},polygonStart:function(){fV=!0},polygonEnd:function(){fV=null},result:function(){var t=+UX;return UX=new Ea,t}};function vDt(t,e){FA.point=qNe,GNe=hT=t,HNe=pT=e}function qNe(t,e){hT-=t,pT-=e,UX.add(Ma(hT*hT+pT*pT)),hT=t,pT=e}let yme,m5,xme,bme;class wme{constructor(e){this._append=e==null?XNe:yDt(e),this._radius=4.5,this._=""}pointRadius(e){return this._radius=+e,this}polygonStart(){this._line=0}polygonEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){this._line===0&&(this._+="Z"),this._point=NaN}point(e,n){switch(this._point){case 0:{this._append`M${e},${n}`,this._point=1;break}case 1:{this._append`L${e},${n}`;break}default:{if(this._append`M${e},${n}`,this._radius!==xme||this._append!==m5){const r=this._radius,i=this._;this._="",this._append`m0,${r}a${r},${r} 0 1,1 0,${-2*r}a${r},${r} 0 1,1 0,${2*r}z`,xme=r,m5=this._append,bme=this._,this._=i}this._+=bme;break}}}result(){const e=this._;return this._="",e.length?e:null}}function XNe(t){let e=1;this._+=t[0];for(const n=t.length;e=0))throw new RangeError(`invalid digits: ${t}`);if(e>15)return XNe;if(e!==yme){const n=10**e;yme=e,m5=function(i){let o=1;this._+=i[0];for(const s=i.length;o=0))throw new RangeError(`invalid digits: ${a}`);n=l}return e===null&&(o=new wme(n)),s},s.projection(t).digits(n).context(e)}function WB(t){return function(e){var n=new WX;for(var r in t)n[r]=t[r];return n.stream=e,n}}function WX(){}WX.prototype={constructor:WX,point:function(t,e){this.stream.point(t,e)},sphere:function(){this.stream.sphere()},lineStart:function(){this.stream.lineStart()},lineEnd:function(){this.stream.lineEnd()},polygonStart:function(){this.stream.polygonStart()},polygonEnd:function(){this.stream.polygonEnd()}};function Iie(t,e,n){var r=t.clipExtent&&t.clipExtent();return t.scale(150).translate([0,0]),r!=null&&t.clipExtent(null),Up(n,t.stream(h5)),e(h5.result()),r!=null&&t.clipExtent(r),t}function VB(t,e,n){return Iie(t,function(r){var i=e[1][0]-e[0][0],o=e[1][1]-e[0][1],s=Math.min(i/(r[1][0]-r[0][0]),o/(r[1][1]-r[0][1])),a=+e[0][0]+(i-s*(r[1][0]+r[0][0]))/2,l=+e[0][1]+(o-s*(r[1][1]+r[0][1]))/2;t.scale(150*s).translate([a,l])},n)}function Lie(t,e,n){return VB(t,[[0,0],e],n)}function $ie(t,e,n){return Iie(t,function(r){var i=+e,o=i/(r[1][0]-r[0][0]),s=(i-o*(r[1][0]+r[0][0]))/2,a=-o*r[0][1];t.scale(150*o).translate([s,a])},n)}function Fie(t,e,n){return Iie(t,function(r){var i=+e,o=i/(r[1][1]-r[0][1]),s=-o*r[0][0],a=(i-o*(r[1][1]+r[0][1]))/2;t.scale(150*o).translate([s,a])},n)}var _me=16,xDt=Vt(30*vn);function Sme(t,e){return+e?wDt(t,e):bDt(t)}function bDt(t){return WB({point:function(e,n){e=t(e,n),this.stream.point(e[0],e[1])}})}function wDt(t,e){function n(r,i,o,s,a,l,c,u,f,d,h,p,g,m){var v=c-r,y=u-i,x=v*v+y*y;if(x>4*e&&g--){var b=s+d,w=a+h,_=l+p,S=Ma(b*b+w*w+_*_),O=Cl(_/=S),k=Ln(Ln(_)-1)e||Ln((v*P+y*T)/x-.5)>.3||s*d+a*h+l*p2?R[2]%360*vn:0,P()):[a*Wi,l*Wi,c*Wi]},M.angle=function(R){return arguments.length?(f=R%360*vn,P()):f*Wi},M.reflectX=function(R){return arguments.length?(d=R?-1:1,P()):d<0},M.reflectY=function(R){return arguments.length?(h=R?-1:1,P()):h<0},M.precision=function(R){return arguments.length?(_=Sme(S,w=R*R),T()):Ma(w)},M.fitExtent=function(R,I){return VB(M,R,I)},M.fitSize=function(R,I){return Lie(M,R,I)},M.fitWidth=function(R,I){return $ie(M,R,I)},M.fitHeight=function(R,I){return Fie(M,R,I)};function P(){var R=Cme(n,0,0,d,h,f).apply(null,e(o,s)),I=Cme(n,r-R[0],i-R[1],d,h,f);return u=DNe(a,l,c),S=DX(e,I),O=DX(u,S),_=Sme(S,w),T()}function T(){return k=E=null,M}return function(){return e=t.apply(this,arguments),M.invert=e.invert&&A,P()}}function Nie(t){var e=0,n=xn/3,r=QNe(t),i=r(e,n);return i.parallels=function(o){return arguments.length?r(e=o[0]*vn,n=o[1]*vn):[e*Wi,n*Wi]},i}function ODt(t){var e=Vt(t);function n(r,i){return[r*e,Bt(i)/e]}return n.invert=function(r,i){return[r/e,Cl(i*e)]},n}function EDt(t,e){var n=Bt(t),r=(n+Bt(e))/2;if(Ln(r)=.12&&m<.234&&g>=-.425&&g<-.214?i:m>=.166&&m<.234&&g>=-.214&&g<-.115?s:n).invert(d)},u.stream=function(d){return t&&e===d?t:t=TDt([n.stream(e=d),i.stream(d),s.stream(d)])},u.precision=function(d){return arguments.length?(n.precision(d),i.precision(d),s.precision(d),f()):n.precision()},u.scale=function(d){return arguments.length?(n.scale(d),i.scale(d*.35),s.scale(d),u.translate(n.translate())):n.scale()},u.translate=function(d){if(!arguments.length)return n.translate();var h=n.scale(),p=+d[0],g=+d[1];return r=n.translate(d).clipExtent([[p-.455*h,g-.238*h],[p+.455*h,g+.238*h]]).stream(c),o=i.translate([p-.307*h,g+.201*h]).clipExtent([[p-.425*h+Ut,g+.12*h+Ut],[p-.214*h-Ut,g+.234*h-Ut]]).stream(c),a=s.translate([p-.205*h,g+.212*h]).clipExtent([[p-.214*h+Ut,g+.166*h+Ut],[p-.115*h-Ut,g+.234*h-Ut]]).stream(c),f()},u.fitExtent=function(d,h){return VB(u,d,h)},u.fitSize=function(d,h){return Lie(u,d,h)},u.fitWidth=function(d,h){return $ie(u,d,h)},u.fitHeight=function(d,h){return Fie(u,d,h)};function f(){return t=e=null,u}return u.scale(1070)}function ZNe(t){return function(e,n){var r=Vt(e),i=Vt(n),o=t(r*i);return o===1/0?[2,0]:[o*i*Bt(e),o*Bt(n)]}}function ER(t){return function(e,n){var r=Ma(e*e+n*n),i=t(r),o=Bt(i),s=Vt(i);return[Pu(e*o,r*s),Cl(r&&n*o/r)]}}var JNe=ZNe(function(t){return Ma(2/(1+t))});JNe.invert=ER(function(t){return 2*Cl(t/2)});function ADt(){return Vh(JNe).scale(124.75).clipAngle(180-.001)}var e5e=ZNe(function(t){return(t=_Ne(t))&&t/Bt(t)});e5e.invert=ER(function(t){return t});function PDt(){return Vh(e5e).scale(79.4188).clipAngle(180-.001)}function GB(t,e){return[t,ZN(Rie(($i+e)/2))]}GB.invert=function(t,e){return[t,2*kO(wNe(e))-$i]};function MDt(){return t5e(GB).scale(961/Pa)}function t5e(t){var e=Vh(t),n=e.center,r=e.scale,i=e.translate,o=e.clipExtent,s=null,a,l,c;e.scale=function(f){return arguments.length?(r(f),u()):r()},e.translate=function(f){return arguments.length?(i(f),u()):i()},e.center=function(f){return arguments.length?(n(f),u()):n()},e.clipExtent=function(f){return arguments.length?(f==null?s=a=l=c=null:(s=+f[0][0],a=+f[0][1],l=+f[1][0],c=+f[1][1]),u()):s==null?null:[[s,a],[l,c]]};function u(){var f=xn*r(),d=e(KRt(e.rotate()).invert([0,0]));return o(s==null?[[d[0]-f,d[1]-f],[d[0]+f,d[1]+f]]:t===GB?[[Math.max(d[0]-f,s),a],[Math.min(d[0]+f,l),c]]:[[s,Math.max(d[1]-f,a)],[l,Math.min(d[1]+f,c)]])}return u()}function HI(t){return Rie(($i+t)/2)}function RDt(t,e){var n=Vt(t),r=t===e?Bt(t):ZN(n/Vt(e))/ZN(HI(e)/HI(t)),i=n*aV(HI(t),r)/r;if(!r)return GB;function o(s,a){i>0?a<-$i+Ut&&(a=-$i+Ut):a>$i-Ut&&(a=$i-Ut);var l=i/aV(HI(a),r);return[l*Bt(r*s),i-l*Vt(r*s)]}return o.invert=function(s,a){var l=i-a,c=ou(r)*Ma(s*s+l*l),u=Pu(s,Ln(l))*ou(l);return l*r<0&&(u-=xn*ou(s)*ou(l)),[u/r,2*kO(aV(i/c,1/r))-$i]},o}function DDt(){return Nie(RDt).scale(109.5).parallels([30,30])}function y5(t,e){return[t,e]}y5.invert=y5;function IDt(){return Vh(y5).scale(152.63)}function LDt(t,e){var n=Vt(t),r=t===e?Bt(t):(n-Vt(e))/(e-t),i=n/r+t;if(Ln(r)Ut&&--r>0);return[t/(.8707+(o=n*n)*(-.131979+o*(-.013791+o*o*o*(.003971-.001529*o)))),n]};function BDt(){return Vh(i5e).scale(175.295)}function o5e(t,e){return[Vt(e)*Bt(t),Bt(e)]}o5e.invert=ER(Cl);function UDt(){return Vh(o5e).scale(249.5).clipAngle(90+Ut)}function s5e(t,e){var n=Vt(e),r=1+Vt(t)*n;return[n*Bt(t)/r,Bt(e)/r]}s5e.invert=ER(function(t){return 2*kO(t)});function WDt(){return Vh(s5e).scale(250).clipAngle(142)}function a5e(t,e){return[ZN(Rie(($i+e)/2)),-t]}a5e.invert=function(t,e){return[-e,2*kO(wNe(t))-$i]};function VDt(){var t=t5e(a5e),e=t.center,n=t.rotate;return t.center=function(r){return arguments.length?e([-r[1],r[0]]):(r=e(),[r[1],-r[0]])},t.rotate=function(r){return arguments.length?n([r[0],r[1],r.length>2?r[2]+90:90]):(r=n(),[r[0],r[1],r[2]-90])},n([0,0,90]).scale(159.155)}var GDt=Math.abs,VX=Math.cos,b5=Math.sin,HDt=1e-6,l5e=Math.PI,GX=l5e/2,Ome=qDt(2);function Eme(t){return t>1?GX:t<-1?-GX:Math.asin(t)}function qDt(t){return t>0?Math.sqrt(t):0}function XDt(t,e){var n=t*b5(e),r=30,i;do e-=i=(e+b5(e)-n)/(1+VX(e));while(GDt(i)>HDt&&--r>0);return e/2}function YDt(t,e,n){function r(i,o){return[t*i*VX(o=XDt(n,o)),e*b5(o)]}return r.invert=function(i,o){return o=Eme(o/e),[i/(t*VX(o)),Eme((2*o+b5(2*o))/n)]},r}var QDt=YDt(Ome/GX,Ome,l5e);function KDt(){return Vh(QDt).scale(169.529)}const ZDt=YNe(),HX=["clipAngle","clipExtent","scale","translate","center","rotate","parallels","precision","reflectX","reflectY","coefficient","distance","fraction","lobes","parallel","radius","ratio","spacing","tilt"];function JDt(t,e){return function n(){const r=e();return r.type=t,r.path=YNe().projection(r),r.copy=r.copy||function(){const i=n();return HX.forEach(o=>{r[o]&&i[o](r[o]())}),i.path.pointRadius(r.path.pointRadius()),i},S3e(r)}}function zie(t,e){if(!t||typeof t!="string")throw new Error("Projection type must be a name string.");return t=t.toLowerCase(),arguments.length>1?(w5[t]=JDt(t,e),this):w5[t]||null}function c5e(t){return t&&t.path||ZDt}const w5={albers:KNe,albersusa:kDt,azimuthalequalarea:ADt,azimuthalequidistant:PDt,conicconformal:DDt,conicequalarea:v5,conicequidistant:$Dt,equalEarth:NDt,equirectangular:IDt,gnomonic:zDt,identity:jDt,mercator:MDt,mollweide:KDt,naturalEarth1:BDt,orthographic:UDt,stereographic:WDt,transversemercator:VDt};for(const t in w5)zie(t,w5[t]);function eIt(){}const up=[[],[[[1,1.5],[.5,1]]],[[[1.5,1],[1,1.5]]],[[[1.5,1],[.5,1]]],[[[1,.5],[1.5,1]]],[[[1,1.5],[.5,1]],[[1,.5],[1.5,1]]],[[[1,.5],[1,1.5]]],[[[1,.5],[.5,1]]],[[[.5,1],[1,.5]]],[[[1,1.5],[1,.5]]],[[[.5,1],[1,.5]],[[1.5,1],[1,1.5]]],[[[1.5,1],[1,.5]]],[[[.5,1],[1.5,1]]],[[[1,1.5],[1.5,1]]],[[[.5,1],[1,1.5]]],[]];function u5e(){var t=1,e=1,n=a;function r(l,c){return c.map(u=>i(l,u))}function i(l,c){var u=[],f=[];return o(l,c,d=>{n(d,l,c),tIt(d)>0?u.push([d]):f.push(d)}),f.forEach(d=>{for(var h=0,p=u.length,g;h=c,up[m<<1].forEach(x);++h=c,up[g|m<<1].forEach(x);for(up[m<<0].forEach(x);++p=c,v=l[p*t]>=c,up[m<<1|v<<2].forEach(x);++h=c,y=v,v=l[p*t+h+1]>=c,up[g|m<<1|v<<2|y<<3].forEach(x);up[m|v<<3].forEach(x)}for(h=-1,v=l[p*t]>=c,up[v<<2].forEach(x);++h=c,up[v<<2|y<<3].forEach(x);up[v<<3].forEach(x);function x(b){var w=[b[0][0]+h,b[0][1]+p],_=[b[1][0]+h,b[1][1]+p],S=s(w),O=s(_),k,E;(k=d[S])?(E=f[O])?(delete d[k.end],delete f[E.start],k===E?(k.ring.push(_),u(k.ring)):f[k.start]=d[E.end]={start:k.start,end:E.end,ring:k.ring.concat(E.ring)}):(delete d[k.end],k.ring.push(_),d[k.end=O]=k):(k=f[O])?(E=d[S])?(delete f[k.start],delete d[E.end],k===E?(k.ring.push(_),u(k.ring)):f[E.start]=d[k.end]={start:E.start,end:k.end,ring:E.ring.concat(k.ring)}):(delete f[k.start],k.ring.unshift(w),f[k.start=S]=k):f[S]=d[O]={start:S,end:O,ring:[w,_]}}}function s(l){return l[0]*2+l[1]*(t+1)*4}function a(l,c,u){l.forEach(f=>{var d=f[0],h=f[1],p=d|0,g=h|0,m,v=c[g*t+p];d>0&&d0&&h=0&&u>=0||je("invalid size"),t=c,e=u,r},r.smooth=function(l){return arguments.length?(n=l?a:eIt,r):n===a},r}function tIt(t){for(var e=0,n=t.length,r=t[n-1][1]*t[0][0]-t[n-1][0]*t[0][1];++er!=h>r&&n<(d-c)*(r-u)/(h-u)+c&&(i=-i)}return i}function iIt(t,e,n){var r;return oIt(t,e,n)&&sIt(t[r=+(t[0]===e[0])],n[r],e[r])}function oIt(t,e,n){return(e[0]-t[0])*(n[1]-t[1])===(n[0]-t[0])*(e[1]-t[1])}function sIt(t,e,n){return t<=e&&e<=n||n<=e&&e<=t}function f5e(t,e,n){return function(r){var i=Eh(r),o=n?Math.min(i[0],0):i[0],s=i[1],a=s-o,l=e?ry(o,s,t):a/(t+1);return al(o+l,s,l)}}function jie(t){Re.call(this,null,t)}jie.Definition={type:"Isocontour",metadata:{generates:!0},params:[{name:"field",type:"field"},{name:"thresholds",type:"number",array:!0},{name:"levels",type:"number"},{name:"nice",type:"boolean",default:!1},{name:"resolve",type:"enum",values:["shared","independent"],default:"independent"},{name:"zero",type:"boolean",default:!0},{name:"smooth",type:"boolean",default:!0},{name:"scale",type:"number",expr:!0},{name:"translate",type:"number",array:!0,expr:!0},{name:"as",type:"string",null:!0,default:"contour"}]};it(jie,Re,{transform(t,e){if(this.value&&!e.changed()&&!t.modified())return e.StopPropagation;var n=e.fork(e.NO_SOURCE|e.NO_FIELDS),r=e.materialize(e.SOURCE).source,i=t.field||na,o=u5e().smooth(t.smooth!==!1),s=t.thresholds||aIt(r,i,t),a=t.as===null?null:t.as||"contour",l=[];return r.forEach(c=>{const u=i(c),f=o.size([u.width,u.height])(u.values,We(s)?s:s(u.values));lIt(f,u,c,t),f.forEach(d=>{l.push(iB(c,cr(a!=null?{[a]:d}:d)))})}),this.value&&(n.rem=this.value),this.value=n.source=n.add=l,n}});function aIt(t,e,n){const r=f5e(n.levels||10,n.nice,n.zero!==!1);return n.resolve!=="shared"?r:r(t.map(i=>$x(e(i).values)))}function lIt(t,e,n,r){let i=r.scale||e.scale,o=r.translate||e.translate;if(fn(i)&&(i=i(n,r)),fn(o)&&(o=o(n,r)),(i===1||i==null)&&!o)return;const s=(Jn(i)?i:i[0])||1,a=(Jn(i)?i:i[1])||1,l=o&&o[0]||0,c=o&&o[1]||0;t.forEach(d5e(e,s,a,l,c))}function d5e(t,e,n,r,i){const o=t.x1||0,s=t.y1||0,a=e*n<0;function l(f){f.forEach(c)}function c(f){a&&f.reverse(),f.forEach(u)}function u(f){f[0]=(f[0]-o)*e+r,f[1]=(f[1]-s)*n+i}return function(f){return f.coordinates.forEach(l),f}}function Tme(t,e,n){const r=t>=0?t:_ne(e,n);return Math.round((Math.sqrt(4*r*r+1)-1)/2)}function dV(t){return fn(t)?t:ra(+t)}function h5e(){var t=l=>l[0],e=l=>l[1],n=gO,r=[-1,-1],i=960,o=500,s=2;function a(l,c){const u=Tme(r[0],l,t)>>s,f=Tme(r[1],l,e)>>s,d=u?u+2:0,h=f?f+2:0,p=2*d+(i>>s),g=2*h+(o>>s),m=new Float32Array(p*g),v=new Float32Array(p*g);let y=m;l.forEach(b=>{const w=d+(+t(b)>>s),_=h+(+e(b)>>s);w>=0&&w=0&&_0&&f>0?(Qb(p,g,m,v,u),Kb(p,g,v,m,f),Qb(p,g,m,v,u),Kb(p,g,v,m,f),Qb(p,g,m,v,u),Kb(p,g,v,m,f)):u>0?(Qb(p,g,m,v,u),Qb(p,g,v,m,u),Qb(p,g,m,v,u),y=v):f>0&&(Kb(p,g,m,v,f),Kb(p,g,v,m,f),Kb(p,g,m,v,f),y=v);const x=c?Math.pow(2,-2*s):1/SIe(y);for(let b=0,w=p*g;b>s),y2:h+(o>>s)}}return a.x=function(l){return arguments.length?(t=dV(l),a):t},a.y=function(l){return arguments.length?(e=dV(l),a):e},a.weight=function(l){return arguments.length?(n=dV(l),a):n},a.size=function(l){if(!arguments.length)return[i,o];var c=+l[0],u=+l[1];return c>=0&&u>=0||je("invalid size"),i=c,o=u,a},a.cellSize=function(l){return arguments.length?((l=+l)>=1||je("invalid cell size"),s=Math.floor(Math.log(l)/Math.LN2),a):1<=i&&(a>=o&&(l-=n[a-o+s*t]),r[a-i+s*t]=l/Math.min(a+1,t-1+o-a,o))}function Kb(t,e,n,r,i){const o=(i<<1)+1;for(let s=0;s=i&&(a>=o&&(l-=n[s+(a-o)*t]),r[s+(a-i)*t]=l/Math.min(a+1,e-1+o-a,o))}function Bie(t){Re.call(this,null,t)}Bie.Definition={type:"KDE2D",metadata:{generates:!0},params:[{name:"size",type:"number",array:!0,length:2,required:!0},{name:"x",type:"field",required:!0},{name:"y",type:"field",required:!0},{name:"weight",type:"field"},{name:"groupby",type:"field",array:!0},{name:"cellSize",type:"number"},{name:"bandwidth",type:"number",array:!0,length:2},{name:"counts",type:"boolean",default:!1},{name:"as",type:"string",default:"grid"}]};const cIt=["x","y","weight","size","cellSize","bandwidth"];function p5e(t,e){return cIt.forEach(n=>e[n]!=null?t[n](e[n]):0),t}it(Bie,Re,{transform(t,e){if(this.value&&!e.changed()&&!t.modified())return e.StopPropagation;var n=e.fork(e.NO_SOURCE|e.NO_FIELDS),r=e.materialize(e.SOURCE).source,i=uIt(r,t.groupby),o=(t.groupby||[]).map(Ni),s=p5e(h5e(),t),a=t.as||"grid",l=[];function c(u,f){for(let d=0;dcr(c({[a]:s(u,t.counts)},u.dims))),this.value&&(n.rem=this.value),this.value=n.source=n.add=l,n}});function uIt(t,e){var n=[],r=u=>u(a),i,o,s,a,l,c;if(e==null)n.push(t);else for(i={},o=0,s=t.length;on.push(a(u))),o&&s&&(e.visit(l,u=>{var f=o(u),d=s(u);f!=null&&d!=null&&(f=+f)===f&&(d=+d)===d&&r.push([f,d])}),n=n.concat({type:qX,geometry:{type:fIt,coordinates:r}})),this.value={type:Wie,features:n}}});function Gie(t){Re.call(this,null,t)}Gie.Definition={type:"GeoPath",metadata:{modifies:!0},params:[{name:"projection",type:"projection"},{name:"field",type:"field"},{name:"pointRadius",type:"number",expr:!0},{name:"as",type:"string",default:"path"}]};it(Gie,Re,{transform(t,e){var n=e.fork(e.ALL),r=this.value,i=t.field||na,o=t.as||"path",s=n.SOURCE;!r||t.modified()?(this.value=r=c5e(t.projection),n.materialize().reflow()):s=i===na||e.modified(i.fields)?n.ADD_MOD:n.ADD;const a=dIt(r,t.pointRadius);return n.visit(s,l=>l[o]=r(i(l))),r.pointRadius(a),n.modifies(o)}});function dIt(t,e){const n=t.pointRadius();return t.context(null),e!=null&&t.pointRadius(e),n}function Hie(t){Re.call(this,null,t)}Hie.Definition={type:"GeoPoint",metadata:{modifies:!0},params:[{name:"projection",type:"projection",required:!0},{name:"fields",type:"field",array:!0,required:!0,length:2},{name:"as",type:"string",array:!0,length:2,default:["x","y"]}]};it(Hie,Re,{transform(t,e){var n=t.projection,r=t.fields[0],i=t.fields[1],o=t.as||["x","y"],s=o[0],a=o[1],l;function c(u){const f=n([r(u),i(u)]);f?(u[s]=f[0],u[a]=f[1]):(u[s]=void 0,u[a]=void 0)}return t.modified()?e=e.materialize().reflow(!0).visit(e.SOURCE,c):(l=e.modified(r.fields)||e.modified(i.fields),e.visit(l?e.ADD_MOD:e.ADD,c)),e.modifies(o)}});function qie(t){Re.call(this,null,t)}qie.Definition={type:"GeoShape",metadata:{modifies:!0,nomod:!0},params:[{name:"projection",type:"projection"},{name:"field",type:"field",default:"datum"},{name:"pointRadius",type:"number",expr:!0},{name:"as",type:"string",default:"shape"}]};it(qie,Re,{transform(t,e){var n=e.fork(e.ALL),r=this.value,i=t.as||"shape",o=n.ADD;return(!r||t.modified())&&(this.value=r=hIt(c5e(t.projection),t.field||Eu("datum"),t.pointRadius),n.materialize().reflow(),o=n.SOURCE),n.visit(o,s=>s[i]=r),n.modifies(i)}});function hIt(t,e,n){const r=n==null?i=>t(e(i)):i=>{var o=t.pointRadius(),s=t.pointRadius(n)(e(i));return t.pointRadius(o),s};return r.context=i=>(t.context(i),r),r}function Xie(t){Re.call(this,[],t),this.generator=aDt()}Xie.Definition={type:"Graticule",metadata:{changes:!0,generates:!0},params:[{name:"extent",type:"array",array:!0,length:2,content:{type:"number",array:!0,length:2}},{name:"extentMajor",type:"array",array:!0,length:2,content:{type:"number",array:!0,length:2}},{name:"extentMinor",type:"array",array:!0,length:2,content:{type:"number",array:!0,length:2}},{name:"step",type:"number",array:!0,length:2},{name:"stepMajor",type:"number",array:!0,length:2,default:[90,360]},{name:"stepMinor",type:"number",array:!0,length:2,default:[10,10]},{name:"precision",type:"number",default:2.5}]};it(Xie,Re,{transform(t,e){var n=this.value,r=this.generator,i;if(!n.length||t.modified())for(const o in t)fn(r[o])&&r[o](t[o]);return i=r(),n.length?e.mod.push(yLe(n[0],i)):e.add.push(cr(i)),n[0]=i,e}});function Yie(t){Re.call(this,null,t)}Yie.Definition={type:"heatmap",metadata:{modifies:!0},params:[{name:"field",type:"field"},{name:"color",type:"string",expr:!0},{name:"opacity",type:"number",expr:!0},{name:"resolve",type:"enum",values:["shared","independent"],default:"independent"},{name:"as",type:"string",default:"image"}]};it(Yie,Re,{transform(t,e){if(!e.changed()&&!t.modified())return e.StopPropagation;var n=e.materialize(e.SOURCE).source,r=t.resolve==="shared",i=t.field||na,o=gIt(t.opacity,t),s=pIt(t.color,t),a=t.as||"image",l={$x:0,$y:0,$value:0,$max:r?$x(n.map(c=>$x(i(c).values))):0};return n.forEach(c=>{const u=i(c),f=cn({},c,l);r||(f.$max=$x(u.values||[])),c[a]=mIt(u,f,s.dep?s:ra(s(f)),o.dep?o:ra(o(f)))}),e.reflow(!0).modifies(a)}});function pIt(t,e){let n;return fn(t)?(n=r=>ay(t(r,e)),n.dep=g5e(t)):n=ra(ay(t||"#888")),n}function gIt(t,e){let n;return fn(t)?(n=r=>t(r,e),n.dep=g5e(t)):t?n=ra(t):(n=r=>r.$value/r.$max||0,n.dep=!0),n}function g5e(t){if(!fn(t))return!1;const e=Wf(Ks(t));return e.$x||e.$y||e.$value||e.$max}function mIt(t,e,n,r){const i=t.width,o=t.height,s=t.x1||0,a=t.y1||0,l=t.x2||i,c=t.y2||o,u=t.values,f=u?m=>u[m]:rv,d=Bv(l-s,c-a),h=d.getContext("2d"),p=h.getImageData(0,0,l-s,c-a),g=p.data;for(let m=a,v=0;m{t[r]!=null&&kme(n,r,t[r])})):HX.forEach(r=>{t.modified(r)&&kme(n,r,t[r])}),t.pointRadius!=null&&n.path.pointRadius(t.pointRadius),t.fit&&vIt(n,t),e.fork(e.NO_SOURCE|e.NO_FIELDS)}});function vIt(t,e){const n=xIt(e.fit);e.extent?t.fitExtent(e.extent,n):e.size&&t.fitSize(e.size,n)}function yIt(t){const e=zie((t||"mercator").toLowerCase());return e||je("Unrecognized projection type: "+t),e()}function kme(t,e,n){fn(t[e])&&t[e](n)}function xIt(t){return t=pt(t),t.length===1?t[0]:{type:Wie,features:t.reduce((e,n)=>e.concat(bIt(n)),[])}}function bIt(t){return t.type===Wie?t.features:pt(t).filter(e=>e!=null).map(e=>e.type===qX?e:{type:qX,geometry:e})}const wIt=Object.freeze(Object.defineProperty({__proto__:null,contour:Uie,geojson:Vie,geopath:Gie,geopoint:Hie,geoshape:qie,graticule:Xie,heatmap:Yie,isocontour:jie,kde2d:Bie,projection:m5e},Symbol.toStringTag,{value:"Module"}));function _It(t,e){var n,r=1;t==null&&(t=0),e==null&&(e=0);function i(){var o,s=n.length,a,l=0,c=0;for(o=0;o=(f=(a+c)/2))?a=f:c=f,(m=n>=(d=(l+u)/2))?l=d:u=d,i=o,!(o=o[v=m<<1|g]))return i[v]=s,t;if(h=+t._x.call(null,o.data),p=+t._y.call(null,o.data),e===h&&n===p)return s.next=o,i?i[v]=s:t._root=s,t;do i=i?i[v]=new Array(4):t._root=new Array(4),(g=e>=(f=(a+c)/2))?a=f:c=f,(m=n>=(d=(l+u)/2))?l=d:u=d;while((v=m<<1|g)===(y=(p>=d)<<1|h>=f));return i[y]=o,i[v]=s,t}function CIt(t){var e,n,r=t.length,i,o,s=new Array(r),a=new Array(r),l=1/0,c=1/0,u=-1/0,f=-1/0;for(n=0;nu&&(u=i),of&&(f=o));if(l>u||c>f)return this;for(this.cover(l,c).cover(u,f),n=0;nt||t>=i||r>e||e>=o;)switch(c=(eu||(a=p.y0)>f||(l=p.x1)=v)<<1|t>=m)&&(p=d[d.length-1],d[d.length-1]=d[d.length-1-g],d[d.length-1-g]=p)}else{var y=t-+this._x.call(null,h.data),x=e-+this._y.call(null,h.data),b=y*y+x*x;if(b=(d=(s+l)/2))?s=d:l=d,(g=f>=(h=(a+c)/2))?a=h:c=h,e=n,!(n=n[m=g<<1|p]))return this;if(!n.length)break;(e[m+1&3]||e[m+2&3]||e[m+3&3])&&(r=e,v=m)}for(;n.data!==t;)if(i=n,!(n=n.next))return this;return(o=n.next)&&delete n.next,i?(o?i.next=o:delete i.next,this):e?(o?e[m]=o:delete e[m],(n=e[0]||e[1]||e[2]||e[3])&&n===(e[3]||e[2]||e[1]||e[0])&&!n.length&&(r?r[v]=n:this._root=n),this):(this._root=o,this)}function PIt(t){for(var e=0,n=t.length;ed.index){var M=h-O.x-O.vx,A=p-O.y-O.vy,P=M*M+A*A;Ph+E||_p+E||Sc.r&&(c.r=c[u].r)}function l(){if(e){var c,u=e.length,f;for(n=new Array(u),c=0;c[e(w,_,s),w])),b;for(m=0,a=new Array(v);m{}};function y5e(){for(var t=0,e=arguments.length,n={},r;t=0&&(r=n.slice(i+1),n=n.slice(0,i)),n&&!e.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:r}})}E3.prototype=y5e.prototype={constructor:E3,on:function(t,e){var n=this._,r=GIt(t+"",n),i,o=-1,s=r.length;if(arguments.length<2){for(;++o0)for(var n=new Array(i),r=0,i,o;r=0&&t._call.call(void 0,e),t=t._next;--HS}function Rme(){m1=(S5=NA.now())+HB,HS=gT=0;try{XIt()}finally{HS=0,QIt(),m1=0}}function YIt(){var t=NA.now(),e=t-S5;e>x5e&&(HB-=e,S5=t)}function QIt(){for(var t,e=_5,n,r=1/0;e;)e._call?(r>e._time&&(r=e._time),t=e,e=e._next):(n=e._next,e._next=null,e=t?t._next=n:_5=n);mT=t,XX(r)}function XX(t){if(!HS){gT&&(gT=clearTimeout(gT));var e=t-m1;e>24?(t<1/0&&(gT=setTimeout(Rme,t-NA.now()-HB)),e2&&(e2=clearInterval(e2))):(e2||(S5=NA.now(),e2=setInterval(YIt,x5e)),HS=1,b5e(Rme))}}function KIt(t,e,n){var r=new C5,i=e;return e==null?(r.restart(t,e,n),r):(r._restart=r.restart,r.restart=function(o,s,a){s=+s,a=a==null?Zie():+a,r._restart(function l(c){c+=i,r._restart(l,i+=s,a),o(c)},s,a)},r.restart(t,e,n),r)}const ZIt=1664525,JIt=1013904223,Dme=4294967296;function eLt(){let t=1;return()=>(t=(ZIt*t+JIt)%Dme)/Dme}function tLt(t){return t.x}function nLt(t){return t.y}var rLt=10,iLt=Math.PI*(3-Math.sqrt(5));function oLt(t){var e,n=1,r=.001,i=1-Math.pow(r,1/300),o=0,s=.6,a=new Map,l=w5e(f),c=y5e("tick","end"),u=eLt();t==null&&(t=[]);function f(){d(),c.call("tick",e),n1?(m==null?a.delete(g):a.set(g,p(m)),e):a.get(g)},find:function(g,m,v){var y=0,x=t.length,b,w,_,S,O;for(v==null?v=1/0:v*=v,y=0;y1?(c.on(g,m),e):c.on(g)}}}function sLt(){var t,e,n,r,i=Sa(-30),o,s=1,a=1/0,l=.81;function c(h){var p,g=t.length,m=Qie(t,tLt,nLt).visitAfter(f);for(r=h,p=0;p=a)return;(h.data!==e||h.next)&&(v===0&&(v=yv(n),b+=v*v),y===0&&(y=yv(n),b+=y*y),b=0;)n.tick();else if(n.stopped()&&n.restart(),!r)return e.StopPropagation}return this.finish(t,e)},finish(t,e){const n=e.dataflow;for(let a=this._argops,l=0,c=a.length,u;lt.touch(e).run()}function fLt(t,e){const n=oLt(t),r=n.stop,i=n.restart;let o=!1;return n.stopped=()=>o,n.restart=()=>(o=!1,i()),n.stop=()=>(o=!0,r()),S5e(n,e,!0).on("end",()=>o=!0)}function S5e(t,e,n,r){var i=pt(e.forces),o,s,a,l;for(o=0,s=YX.length;oe(r,n):e)}const gLt=Object.freeze(Object.defineProperty({__proto__:null,force:Jie},Symbol.toStringTag,{value:"Module"}));function mLt(t,e){return t.parent===e.parent?1:2}function vLt(t){return t.reduce(yLt,0)/t.length}function yLt(t,e){return t+e.x}function xLt(t){return 1+t.reduce(bLt,0)}function bLt(t,e){return Math.max(t,e.y)}function wLt(t){for(var e;e=t.children;)t=e[0];return t}function _Lt(t){for(var e;e=t.children;)t=e[e.length-1];return t}function SLt(){var t=mLt,e=1,n=1,r=!1;function i(o){var s,a=0;o.eachAfter(function(d){var h=d.children;h?(d.x=vLt(h),d.y=xLt(h)):(d.x=s?a+=t(d,s):0,d.y=0,s=d)});var l=wLt(o),c=_Lt(o),u=l.x-t(l,c)/2,f=c.x+t(c,l)/2;return o.eachAfter(r?function(d){d.x=(d.x-o.x)*e,d.y=(o.y-d.y)*n}:function(d){d.x=(d.x-u)/(f-u)*e,d.y=(1-(o.y?d.y/o.y:1))*n})}return i.separation=function(o){return arguments.length?(t=o,i):t},i.size=function(o){return arguments.length?(r=!1,e=+o[0],n=+o[1],i):r?null:[e,n]},i.nodeSize=function(o){return arguments.length?(r=!0,e=+o[0],n=+o[1],i):r?[e,n]:null},i}function CLt(t){var e=0,n=t.children,r=n&&n.length;if(!r)e=1;else for(;--r>=0;)e+=n[r].value;t.value=e}function OLt(){return this.eachAfter(CLt)}function ELt(t,e){let n=-1;for(const r of this)t.call(e,r,++n,this);return this}function TLt(t,e){for(var n=this,r=[n],i,o,s=-1;n=r.pop();)if(t.call(e,n,++s,this),i=n.children)for(o=i.length-1;o>=0;--o)r.push(i[o]);return this}function kLt(t,e){for(var n=this,r=[n],i=[],o,s,a,l=-1;n=r.pop();)if(i.push(n),o=n.children)for(s=0,a=o.length;s=0;)n+=r[i].value;e.value=n})}function MLt(t){return this.eachBefore(function(e){e.children&&e.children.sort(t)})}function RLt(t){for(var e=this,n=DLt(e,t),r=[e];e!==n;)e=e.parent,r.push(e);for(var i=r.length;t!==n;)r.splice(i,0,t),t=t.parent;return r}function DLt(t,e){if(t===e)return t;var n=t.ancestors(),r=e.ancestors(),i=null;for(t=n.pop(),e=r.pop();t===e;)i=t,t=n.pop(),e=r.pop();return i}function ILt(){for(var t=this,e=[t];t=t.parent;)e.push(t);return e}function LLt(){return Array.from(this)}function $Lt(){var t=[];return this.eachBefore(function(e){e.children||t.push(e)}),t}function FLt(){var t=this,e=[];return t.each(function(n){n!==t&&e.push({source:n.parent,target:n})}),e}function*NLt(){var t=this,e,n=[t],r,i,o;do for(e=n.reverse(),n=[];t=e.pop();)if(yield t,r=t.children)for(i=0,o=r.length;i=0;--a)i.push(o=s[a]=new qS(s[a])),o.parent=r,o.depth=r.depth+1;return n.eachBefore(C5e)}function zLt(){return eoe(this).eachBefore(ULt)}function jLt(t){return t.children}function BLt(t){return Array.isArray(t)?t[1]:null}function ULt(t){t.data.value!==void 0&&(t.value=t.data.value),t.data=t.data.data}function C5e(t){var e=0;do t.height=e;while((t=t.parent)&&t.height<++e)}function qS(t){this.data=t,this.depth=this.height=0,this.parent=null}qS.prototype=eoe.prototype={constructor:qS,count:OLt,each:ELt,eachAfter:kLt,eachBefore:TLt,find:ALt,sum:PLt,sort:MLt,path:RLt,ancestors:ILt,descendants:LLt,leaves:$Lt,links:FLt,copy:zLt,[Symbol.iterator]:NLt};function T3(t){return t==null?null:O5e(t)}function O5e(t){if(typeof t!="function")throw new Error;return t}function J0(){return 0}function Fw(t){return function(){return t}}const WLt=1664525,VLt=1013904223,Lme=4294967296;function GLt(){let t=1;return()=>(t=(WLt*t+VLt)%Lme)/Lme}function HLt(t){return typeof t=="object"&&"length"in t?t:Array.from(t)}function qLt(t,e){let n=t.length,r,i;for(;n;)i=e()*n--|0,r=t[n],t[n]=t[i],t[i]=r;return t}function XLt(t,e){for(var n=0,r=(t=qLt(Array.from(t),e)).length,i=[],o,s;n0&&n*n>r*r+i*i}function hV(t,e){for(var n=0;n1e-6?(M+Math.sqrt(M*M-4*E*A))/(2*E):A/M);return{x:r+_+S*P,y:i+O+k*P,r:P}}function $me(t,e,n){var r=t.x-e.x,i,o,s=t.y-e.y,a,l,c=r*r+s*s;c?(o=e.r+n.r,o*=o,l=t.r+n.r,l*=l,o>l?(i=(c+l-o)/(2*c),a=Math.sqrt(Math.max(0,l/c-i*i)),n.x=t.x-i*r-a*s,n.y=t.y-i*s+a*r):(i=(c+o-l)/(2*c),a=Math.sqrt(Math.max(0,o/c-i*i)),n.x=e.x+i*r-a*s,n.y=e.y+i*s+a*r)):(n.x=e.x+n.r,n.y=e.y)}function Fme(t,e){var n=t.r+e.r-1e-6,r=e.x-t.x,i=e.y-t.y;return n>0&&n*n>r*r+i*i}function Nme(t){var e=t._,n=t.next._,r=e.r+n.r,i=(e.x*n.r+n.x*e.r)/r,o=(e.y*n.r+n.y*e.r)/r;return i*i+o*o}function XI(t){this._=t,this.next=null,this.previous=null}function ZLt(t,e){if(!(o=(t=HLt(t)).length))return 0;var n,r,i,o,s,a,l,c,u,f,d;if(n=t[0],n.x=0,n.y=0,!(o>1))return n.r;if(r=t[1],n.x=-r.r,r.x=n.r,r.y=0,!(o>2))return n.r+r.r;$me(r,n,i=t[2]),n=new XI(n),r=new XI(r),i=new XI(i),n.next=i.previous=r,r.next=n.previous=i,i.next=r.previous=n;e:for(l=3;lo$t(n(b,w,i))),y=v.map(Wme),x=new Set(v).add("");for(const b of y)x.has(b)||(x.add(b),v.push(b),y.push(Wme(b)),o.push(gV));s=(b,w)=>v[w],a=(b,w)=>y[w]}for(u=0,l=o.length;u=0&&(h=o[v],h.data===gV);--v)h.data=null}if(f.parent=n$t,f.eachBefore(function(v){v.depth=v.parent.depth+1,--l}).eachBefore(C5e),f.parent=null,l>0)throw new Error("cycle");return f}return r.id=function(i){return arguments.length?(t=T3(i),r):t},r.parentId=function(i){return arguments.length?(e=T3(i),r):e},r.path=function(i){return arguments.length?(n=T3(i),r):n},r}function o$t(t){t=`${t}`;let e=t.length;return QX(t,e-1)&&!QX(t,e-2)&&(t=t.slice(0,-1)),t[0]==="/"?t:`/${t}`}function Wme(t){let e=t.length;if(e<2)return"";for(;--e>1&&!QX(t,e););return t.slice(0,e)}function QX(t,e){if(t[e]==="/"){let n=0;for(;e>0&&t[--e]==="\\";)++n;if(!(n&1))return!0}return!1}function s$t(t,e){return t.parent===e.parent?1:2}function mV(t){var e=t.children;return e?e[0]:t.t}function vV(t){var e=t.children;return e?e[e.length-1]:t.t}function a$t(t,e,n){var r=n/(e.i-t.i);e.c-=r,e.s+=n,t.c+=r,e.z+=n,e.m+=n}function l$t(t){for(var e=0,n=0,r=t.children,i=r.length,o;--i>=0;)o=r[i],o.z+=e,o.m+=e,e+=o.s+(n+=o.c)}function c$t(t,e,n){return t.a.parent===e.parent?t.a:n}function k3(t,e){this._=t,this.parent=null,this.children=null,this.A=null,this.a=this,this.z=0,this.m=0,this.c=0,this.s=0,this.t=null,this.i=e}k3.prototype=Object.create(qS.prototype);function u$t(t){for(var e=new k3(t,0),n,r=[e],i,o,s,a;n=r.pop();)if(o=n._.children)for(n.children=new Array(a=o.length),s=a-1;s>=0;--s)r.push(i=n.children[s]=new k3(o[s],s)),i.parent=n;return(e.parent=new k3(null,0)).children=[e],e}function f$t(){var t=s$t,e=1,n=1,r=null;function i(c){var u=u$t(c);if(u.eachAfter(o),u.parent.m=-u.z,u.eachBefore(s),r)c.eachBefore(l);else{var f=c,d=c,h=c;c.eachBefore(function(y){y.xd.x&&(d=y),y.depth>h.depth&&(h=y)});var p=f===d?1:t(f,d)/2,g=p-f.x,m=e/(d.x+p+g),v=n/(h.depth||1);c.eachBefore(function(y){y.x=(y.x+g)*m,y.y=y.depth*v})}return c}function o(c){var u=c.children,f=c.parent.children,d=c.i?f[c.i-1]:null;if(u){l$t(c);var h=(u[0].z+u[u.length-1].z)/2;d?(c.z=d.z+t(c._,d._),c.m=c.z-h):c.z=h}else d&&(c.z=d.z+t(c._,d._));c.parent.A=a(c,d,c.parent.A||f[0])}function s(c){c._.x=c.z+c.parent.m,c.m+=c.parent.m}function a(c,u,f){if(u){for(var d=c,h=c,p=u,g=d.parent.children[0],m=d.m,v=h.m,y=p.m,x=g.m,b;p=vV(p),d=mV(d),p&&d;)g=mV(g),h=vV(h),h.a=c,b=p.z+y-d.z-m+t(p._,d._),b>0&&(a$t(c$t(p,c,f),c,b),m+=b,v+=b),y+=p.m,m+=d.m,x+=g.m,v+=h.m;p&&!vV(h)&&(h.t=p,h.m+=y-v),d&&!mV(g)&&(g.t=d,g.m+=m-x,f=c)}return f}function l(c){c.x*=e,c.y=c.depth*n}return i.separation=function(c){return arguments.length?(t=c,i):t},i.size=function(c){return arguments.length?(r=!1,e=+c[0],n=+c[1],i):r?null:[e,n]},i.nodeSize=function(c){return arguments.length?(r=!0,e=+c[0],n=+c[1],i):r?[e,n]:null},i}function qB(t,e,n,r,i){for(var o=t.children,s,a=-1,l=o.length,c=t.value&&(i-n)/t.value;++ay&&(y=c),_=m*m*w,x=Math.max(y/_,_/v),x>b){m-=c;break}b=x}s.push(l={value:m,dice:h1?r:1)},n}(A5e);function d$t(){var t=M5e,e=!1,n=1,r=1,i=[0],o=J0,s=J0,a=J0,l=J0,c=J0;function u(d){return d.x0=d.y0=0,d.x1=n,d.y1=r,d.eachBefore(f),i=[0],e&&d.eachBefore(k5e),d}function f(d){var h=i[d.depth],p=d.x0+h,g=d.y0+h,m=d.x1-h,v=d.y1-h;m=d-1){var y=o[f];y.x0=p,y.y0=g,y.x1=m,y.y1=v;return}for(var x=c[f],b=h/2+x,w=f+1,_=d-1;w<_;){var S=w+_>>>1;c[S]v-g){var E=h?(p*k+m*O)/h:m;u(f,w,O,p,g,E,v),u(w,d,k,E,g,m,v)}else{var M=h?(g*k+v*O)/h:v;u(f,w,O,p,g,m,M),u(w,d,k,p,M,m,v)}}}function p$t(t,e,n,r,i){(t.depth&1?qB:TR)(t,e,n,r,i)}const g$t=function t(e){function n(r,i,o,s,a){if((l=r._squarify)&&l.ratio===e)for(var l,c,u,f,d=-1,h,p=l.length,g=r.value;++d1?r:1)},n}(A5e);function KX(t,e,n){const r={};return t.each(i=>{const o=i.data;n(o)&&(r[e(o)]=i)}),t.lookup=r,t}function toe(t){Re.call(this,null,t)}toe.Definition={type:"Nest",metadata:{treesource:!0,changes:!0},params:[{name:"keys",type:"field",array:!0},{name:"generate",type:"boolean"}]};const m$t=t=>t.values;it(toe,Re,{transform(t,e){e.source||je("Nest transform requires an upstream data source.");var n=t.generate,r=t.modified(),i=e.clone(),o=this.value;return(!o||r||e.changed())&&(o&&o.each(s=>{s.children&&rB(s.data)&&i.rem.push(s.data)}),this.value=o=eoe({values:pt(t.keys).reduce((s,a)=>(s.key(a),s),v$t()).entries(i.source)},m$t),n&&o.each(s=>{s.children&&(s=cr(s.data),i.add.push(s),i.source.push(s))}),KX(o,jt,jt)),i.source.root=o,i}});function v$t(){const t=[],e={entries:i=>r(n(i,0),0),key:i=>(t.push(i),e)};function n(i,o){if(o>=t.length)return i;const s=i.length,a=t[o++],l={},c={};let u=-1,f,d,h;for(;++ut.length)return i;const s=[];for(const a in i)s.push({key:a,values:r(i[a],o)});return s}return e}function Qg(t){Re.call(this,null,t)}const y$t=(t,e)=>t.parent===e.parent?1:2;it(Qg,Re,{transform(t,e){(!e.source||!e.source.root)&&je(this.constructor.name+" transform requires a backing tree data source.");const n=this.layout(t.method),r=this.fields,i=e.source.root,o=t.as||r;t.field?i.sum(t.field):i.count(),t.sort&&i.sort(ab(t.sort,s=>s.data)),x$t(n,this.params,t),n.separation&&n.separation(t.separation!==!1?y$t:gO);try{this.value=n(i)}catch(s){je(s)}return i.each(s=>b$t(s,r,o)),e.reflow(t.modified()).modifies(o).modifies("leaf")}});function x$t(t,e,n){for(let r,i=0,o=e.length;io[jt(s)]=1),r.each(s=>{const a=s.data,l=s.parent&&s.parent.data;l&&o[jt(a)]&&o[jt(l)]&&i.add.push(cr({source:l,target:a}))}),this.value=i.add):e.changed(e.MOD)&&(e.visit(e.MOD,s=>o[jt(s)]=1),n.forEach(s=>{(o[jt(s.source)]||o[jt(s.target)])&&i.mod.push(s)})),i}});const Gme={binary:h$t,dice:TR,slice:qB,slicedice:p$t,squarify:M5e,resquarify:g$t},tY=["x0","y0","x1","y1","depth","children"];function aoe(t){Qg.call(this,t)}aoe.Definition={type:"Treemap",metadata:{tree:!0,modifies:!0},params:[{name:"field",type:"field"},{name:"sort",type:"compare"},{name:"method",type:"enum",default:"squarify",values:["squarify","resquarify","binary","dice","slice","slicedice"]},{name:"padding",type:"number",default:0},{name:"paddingInner",type:"number",default:0},{name:"paddingOuter",type:"number",default:0},{name:"paddingTop",type:"number",default:0},{name:"paddingRight",type:"number",default:0},{name:"paddingBottom",type:"number",default:0},{name:"paddingLeft",type:"number",default:0},{name:"ratio",type:"number",default:1.618033988749895},{name:"round",type:"boolean",default:!1},{name:"size",type:"number",array:!0,length:2},{name:"as",type:"string",array:!0,length:tY.length,default:tY}]};it(aoe,Qg,{layout(){const t=d$t();return t.ratio=e=>{const n=t.tile();n.ratio&&t.tile(n.ratio(e))},t.method=e=>{vt(Gme,e)?t.tile(Gme[e]):je("Unrecognized Treemap layout method: "+e)},t},params:["method","ratio","size","round","padding","paddingInner","paddingOuter","paddingTop","paddingRight","paddingBottom","paddingLeft"],fields:tY});const w$t=Object.freeze(Object.defineProperty({__proto__:null,nest:toe,pack:noe,partition:roe,stratify:ioe,tree:ooe,treelinks:soe,treemap:aoe},Symbol.toStringTag,{value:"Module"})),yV=4278190080;function _$t(t,e){const n=t.bitmap();return(e||[]).forEach(r=>n.set(t(r.boundary[0]),t(r.boundary[3]))),[n,void 0]}function S$t(t,e,n,r,i){const o=t.width,s=t.height,a=r||i,l=Bv(o,s).getContext("2d"),c=Bv(o,s).getContext("2d"),u=a&&Bv(o,s).getContext("2d");n.forEach(O=>A3(l,O,!1)),A3(c,e,!1),a&&A3(u,e,!0);const f=xV(l,o,s),d=xV(c,o,s),h=a&&xV(u,o,s),p=t.bitmap(),g=a&&t.bitmap();let m,v,y,x,b,w,_,S;for(v=0;v{i.items.forEach(o=>A3(t,o.items,n))}):Tc[r].draw(t,{items:n?e.map(C$t):e})}function C$t(t){const e=iB(t,{});return e.stroke&&e.strokeOpacity!==0||e.fill&&e.fillOpacity!==0?{...e,strokeOpacity:1,stroke:"#000",fillOpacity:0}:e}const fp=5,la=31,zA=32,Qm=new Uint32Array(zA+1),xf=new Uint32Array(zA+1);xf[0]=0;Qm[0]=~xf[0];for(let t=1;t<=zA;++t)xf[t]=xf[t-1]<<1|1,Qm[t]=~xf[t];function O$t(t,e){const n=new Uint32Array(~~((t*e+zA)/zA));function r(o,s){n[o]|=s}function i(o,s){n[o]&=s}return{array:n,get:(o,s)=>{const a=s*t+o;return n[a>>>fp]&1<<(a&la)},set:(o,s)=>{const a=s*t+o;r(a>>>fp,1<<(a&la))},clear:(o,s)=>{const a=s*t+o;i(a>>>fp,~(1<<(a&la)))},getRange:(o,s,a,l)=>{let c=l,u,f,d,h;for(;c>=s;--c)if(u=c*t+o,f=c*t+a,d=u>>>fp,h=f>>>fp,d===h){if(n[d]&Qm[u&la]&xf[(f&la)+1])return!0}else{if(n[d]&Qm[u&la]||n[h]&xf[(f&la)+1])return!0;for(let p=d+1;p{let c,u,f,d,h;for(;s<=l;++s)if(c=s*t+o,u=s*t+a,f=c>>>fp,d=u>>>fp,f===d)r(f,Qm[c&la]&xf[(u&la)+1]);else for(r(f,Qm[c&la]),r(d,xf[(u&la)+1]),h=f+1;h{let c,u,f,d,h;for(;s<=l;++s)if(c=s*t+o,u=s*t+a,f=c>>>fp,d=u>>>fp,f===d)i(f,xf[c&la]|Qm[(u&la)+1]);else for(i(f,xf[c&la]),i(d,Qm[(u&la)+1]),h=f+1;ho<0||s<0||l>=e||a>=t}}function E$t(t,e,n){const r=Math.max(1,Math.sqrt(t*e/1e6)),i=~~((t+2*n+r)/r),o=~~((e+2*n+r)/r),s=a=>~~((a+n)/r);return s.invert=a=>a*r-n,s.bitmap=()=>O$t(i,o),s.ratio=r,s.padding=n,s.width=t,s.height=e,s}function T$t(t,e,n,r){const i=t.width,o=t.height;return function(s){const a=s.datum.datum.items[r].items,l=a.length,c=s.datum.fontSize,u=pc.width(s.datum,s.datum.text);let f=0,d,h,p,g,m,v,y;for(let x=0;x=f&&(f=y,s.x=m,s.y=v);return m=u/2,v=c/2,d=s.x-m,h=s.x+m,p=s.y-v,g=s.y+v,s.align="center",d<0&&h<=i?s.align="left":0<=d&&ii||e-(s=r/2)<0||e+s>o}function xv(t,e,n,r,i,o,s,a){const l=i*o/(r*2),c=t(e-l),u=t(e+l),f=t(n-(o=o/2)),d=t(n+o);return s.outOfBounds(c,f,u,d)||s.getRange(c,f,u,d)||a&&a.getRange(c,f,u,d)}function k$t(t,e,n,r){const i=t.width,o=t.height,s=e[0],a=e[1];function l(c,u,f,d,h){const p=t.invert(c),g=t.invert(u);let m=f,v=o,y;if(!O5(p,g,d,h,i,o)&&!xv(t,p,g,h,d,m,s,a)&&!xv(t,p,g,h,d,h,s,null)){for(;v-m>=1;)y=(m+v)/2,xv(t,p,g,h,d,y,s,a)?v=y:m=y;if(m>f)return[p,g,m,!0]}}return function(c){const u=c.datum.datum.items[r].items,f=u.length,d=c.datum.fontSize,h=pc.width(c.datum,c.datum.text);let p=n?d:0,g=!1,m=!1,v=0,y,x,b,w,_,S,O,k,E,M,A,P,T,R,I,B,$;for(let z=0;zx&&($=y,y=x,x=$),b>w&&($=b,b=w,w=$),E=t(y),A=t(x),M=~~((E+A)/2),P=t(b),R=t(w),T=~~((P+R)/2),O=M;O>=E;--O)for(k=T;k>=P;--k)B=l(O,k,p,h,d),B&&([c.x,c.y,p,g]=B);for(O=M;O<=A;++O)for(k=T;k<=R;++k)B=l(O,k,p,h,d),B&&([c.x,c.y,p,g]=B);!g&&!n&&(I=Math.abs(x-y+w-b),_=(y+x)/2,S=(b+w)/2,I>=v&&!O5(_,S,h,d,i,o)&&!xv(t,_,S,d,h,d,s,null)&&(v=I,c.x=_,c.y=S,m=!0))}return g||m?(_=h/2,S=d/2,s.setRange(t(c.x-_),t(c.y-S),t(c.x+_),t(c.y+S)),c.align="center",c.baseline="middle",!0):!1}}const A$t=[-1,-1,1,1],P$t=[-1,1,-1,1];function M$t(t,e,n,r){const i=t.width,o=t.height,s=e[0],a=e[1],l=t.bitmap();return function(c){const u=c.datum.datum.items[r].items,f=u.length,d=c.datum.fontSize,h=pc.width(c.datum,c.datum.text),p=[];let g=n?d:0,m=!1,v=!1,y=0,x,b,w,_,S,O,k,E,M,A,P,T;for(let R=0;R=1;)P=(M+A)/2,xv(t,S,O,d,h,P,s,a)?A=P:M=P;M>g&&(c.x=S,c.y=O,g=M,m=!0)}}!m&&!n&&(T=Math.abs(b-x+_-w),S=(x+b)/2,O=(w+_)/2,T>=y&&!O5(S,O,h,d,i,o)&&!xv(t,S,O,d,h,d,s,null)&&(y=T,c.x=S,c.y=O,v=!0))}return m||v?(S=h/2,O=d/2,s.setRange(t(c.x-S),t(c.y-O),t(c.x+S),t(c.y+O)),c.align="center",c.baseline="middle",!0):!1}}const R$t=["right","center","left"],D$t=["bottom","middle","top"];function I$t(t,e,n,r){const i=t.width,o=t.height,s=e[0],a=e[1],l=r.length;return function(c){const u=c.boundary,f=c.datum.fontSize;if(u[2]<0||u[5]<0||u[0]>i||u[3]>o)return!1;let d=c.textWidth??0,h,p,g,m,v,y,x,b,w,_,S,O,k,E,M;for(let A=0;A>>2&3)-1,g=h===0&&p===0||r[A]<0,m=h&&p?Math.SQRT1_2:1,v=r[A]<0?-1:1,y=u[1+h]+r[A]*h*m,S=u[4+p]+v*f*p/2+r[A]*p*m,b=S-f/2,w=S+f/2,O=t(y),E=t(b),M=t(w),!d)if(Hme(O,O,E,M,s,a,y,y,b,w,u,g))d=pc.width(c.datum,c.datum.text);else continue;if(_=y+v*d*h/2,y=_-d/2,x=_+d/2,O=t(y),k=t(x),Hme(O,k,E,M,s,a,y,x,b,w,u,g))return c.x=h?h*v<0?x:y:_,c.y=p?p*v<0?w:b:S,c.align=R$t[h*v+1],c.baseline=D$t[p*v+1],s.setRange(O,E,k,M),!0}return!1}}function Hme(t,e,n,r,i,o,s,a,l,c,u,f){return!(i.outOfBounds(t,n,e,r)||(f&&o||i).getRange(t,n,e,r))}const bV=0,wV=4,_V=8,SV=0,CV=1,OV=2,L$t={"top-left":bV+SV,top:bV+CV,"top-right":bV+OV,left:wV+SV,middle:wV+CV,right:wV+OV,"bottom-left":_V+SV,bottom:_V+CV,"bottom-right":_V+OV},$$t={naive:T$t,"reduced-search":k$t,floodfill:M$t};function F$t(t,e,n,r,i,o,s,a,l,c,u){if(!t.length)return t;const f=Math.max(r.length,i.length),d=N$t(r,f),h=z$t(i,f),p=j$t(t[0].datum),g=p==="group"&&t[0].datum.items[l].marktype,m=g==="area",v=B$t(p,g,a,l),y=c===null||c===1/0,x=m&&u==="naive";let b=-1,w=-1;const _=t.map(E=>{const M=y?pc.width(E,E.text):void 0;return b=Math.max(b,M),w=Math.max(w,E.fontSize),{datum:E,opacity:0,x:void 0,y:void 0,align:void 0,baseline:void 0,boundary:v(E),textWidth:M}});c=c===null||c===1/0?Math.max(b,w)+Math.max(...r):c;const S=E$t(e[0],e[1],c);let O;if(!x){n&&_.sort((A,P)=>n(A.datum,P.datum));let E=!1;for(let A=0;AA.datum);O=o.length||M?S$t(S,M||[],o,E,m):_$t(S,s&&_)}const k=m?$$t[u](S,O,s,l):I$t(S,O,h,d);return _.forEach(E=>E.opacity=+k(E)),_}function N$t(t,e){const n=new Float64Array(e),r=t.length;for(let i=0;i[o.x,o.x,o.x,o.y,o.y,o.y];return t?t==="line"||t==="area"?o=>i(o.datum):e==="line"?o=>{const s=o.datum.items[r].items;return i(s.length?s[n==="start"?0:s.length-1]:{x:NaN,y:NaN})}:o=>{const s=o.datum.bounds;return[s.x1,(s.x1+s.x2)/2,s.x2,s.y1,(s.y1+s.y2)/2,s.y2]}:i}const nY=["x","y","opacity","align","baseline"],R5e=["top-left","left","bottom-left","top","bottom","top-right","right","bottom-right"];function loe(t){Re.call(this,null,t)}loe.Definition={type:"Label",metadata:{modifies:!0},params:[{name:"size",type:"number",array:!0,length:2,required:!0},{name:"sort",type:"compare"},{name:"anchor",type:"string",array:!0,default:R5e},{name:"offset",type:"number",array:!0,default:[1]},{name:"padding",type:"number",default:0,null:!0},{name:"lineAnchor",type:"string",values:["start","end"],default:"end"},{name:"markIndex",type:"number",default:0},{name:"avoidBaseMark",type:"boolean",default:!0},{name:"avoidMarks",type:"data",array:!0},{name:"method",type:"string",default:"naive"},{name:"as",type:"string",array:!0,length:nY.length,default:nY}]};it(loe,Re,{transform(t,e){function n(o){const s=t[o];return fn(s)&&e.modified(s.fields)}const r=t.modified();if(!(r||e.changed(e.ADD_REM)||n("sort")))return;(!t.size||t.size.length!==2)&&je("Size parameter should be specified as a [width, height] array.");const i=t.as||nY;return F$t(e.materialize(e.SOURCE).source||[],t.size,t.sort,pt(t.offset==null?1:t.offset),pt(t.anchor||R5e),t.avoidMarks||[],t.avoidBaseMark!==!1,t.lineAnchor||"end",t.markIndex||0,t.padding===void 0?0:t.padding,t.method||"naive").forEach(o=>{const s=o.datum;s[i[0]]=o.x,s[i[1]]=o.y,s[i[2]]=o.opacity,s[i[3]]=o.align,s[i[4]]=o.baseline}),e.reflow(r).modifies(i)}});const U$t=Object.freeze(Object.defineProperty({__proto__:null,label:loe},Symbol.toStringTag,{value:"Module"}));function D5e(t,e){var n=[],r=function(u){return u(a)},i,o,s,a,l,c;if(e==null)n.push(t);else for(i={},o=0,s=t.length;o{$Le(c,t.x,t.y,t.bandwidth||.3).forEach(u=>{const f={};for(let d=0;dt==="poly"?e:t==="quad"?2:1;function uoe(t){Re.call(this,null,t)}uoe.Definition={type:"Regression",metadata:{generates:!0},params:[{name:"x",type:"field",required:!0},{name:"y",type:"field",required:!0},{name:"groupby",type:"field",array:!0},{name:"method",type:"string",default:"linear",values:Object.keys(rY)},{name:"order",type:"number",default:3},{name:"extent",type:"number",array:!0,length:2},{name:"params",type:"boolean",default:!1},{name:"as",type:"string",array:!0}]};it(uoe,Re,{transform(t,e){const n=e.fork(e.NO_SOURCE|e.NO_FIELDS);if(!this.value||e.changed()||t.modified()){const r=e.materialize(e.SOURCE).source,i=D5e(r,t.groupby),o=(t.groupby||[]).map(Ni),s=t.method||"linear",a=t.order==null?3:t.order,l=W$t(s,a),c=t.as||[Ni(t.x),Ni(t.y)],u=rY[s],f=[];let d=t.extent;vt(rY,s)||je("Invalid regression method: "+s),d!=null&&s==="log"&&d[0]<=0&&(e.dataflow.warn("Ignoring extent with values <= 0 for log regression."),d=null),i.forEach(h=>{if(h.length<=l){e.dataflow.warn("Skipping regression with more parameters than data points.");return}const g=u(h,t.x,t.y,a);if(t.params){f.push(cr({keys:h.dims,coef:g.coef,rSquared:g.rSquared}));return}const m=d||Eh(h,t.x),v=y=>{const x={};for(let b=0;bv([y,g.predict(y)])):fB(g.predict,m,25,200).forEach(v)}),this.value&&(n.rem=this.value),this.value=n.add=n.source=f}return n}});const V$t=Object.freeze(Object.defineProperty({__proto__:null,loess:coe,regression:uoe},Symbol.toStringTag,{value:"Module"})),ag=11102230246251565e-32,Ms=134217729,G$t=(3+8*ag)*ag;function EV(t,e,n,r,i){let o,s,a,l,c=e[0],u=r[0],f=0,d=0;u>c==u>-c?(o=c,c=e[++f]):(o=u,u=r[++d]);let h=0;if(fc==u>-c?(s=c+o,a=o-(s-c),c=e[++f]):(s=u+o,a=o-(s-u),u=r[++d]),o=s,a!==0&&(i[h++]=a);fc==u>-c?(s=o+c,l=s-o,a=o-(s-l)+(c-l),c=e[++f]):(s=o+u,l=s-o,a=o-(s-l)+(u-l),u=r[++d]),o=s,a!==0&&(i[h++]=a);for(;f=T||-P>=T||(f=t-k,a=t-(k+f)+(f-i),f=n-E,c=n-(E+f)+(f-i),f=e-M,l=e-(M+f)+(f-o),f=r-A,u=r-(A+f)+(f-o),a===0&&l===0&&c===0&&u===0)||(T=Y$t*s+G$t*Math.abs(P),P+=k*u+A*a-(M*c+E*l),P>=T||-P>=T))return P;b=a*A,d=Ms*a,h=d-(d-a),p=a-h,d=Ms*A,g=d-(d-A),m=A-g,w=p*m-(b-h*g-p*g-h*m),_=l*E,d=Ms*l,h=d-(d-l),p=l-h,d=Ms*E,g=d-(d-E),m=E-g,S=p*m-(_-h*g-p*g-h*m),v=w-S,f=w-v,ca[0]=w-(v+f)+(f-S),y=b+v,f=y-b,x=b-(y-f)+(v-f),v=x-_,f=x-v,ca[1]=x-(v+f)+(f-_),O=y+v,f=O-y,ca[2]=y-(O-f)+(v-f),ca[3]=O;const R=EV(4,Zb,4,ca,qme);b=k*u,d=Ms*k,h=d-(d-k),p=k-h,d=Ms*u,g=d-(d-u),m=u-g,w=p*m-(b-h*g-p*g-h*m),_=M*c,d=Ms*M,h=d-(d-M),p=M-h,d=Ms*c,g=d-(d-c),m=c-g,S=p*m-(_-h*g-p*g-h*m),v=w-S,f=w-v,ca[0]=w-(v+f)+(f-S),y=b+v,f=y-b,x=b-(y-f)+(v-f),v=x-_,f=x-v,ca[1]=x-(v+f)+(f-_),O=y+v,f=O-y,ca[2]=y-(O-f)+(v-f),ca[3]=O;const I=EV(R,qme,4,ca,Xme);b=a*u,d=Ms*a,h=d-(d-a),p=a-h,d=Ms*u,g=d-(d-u),m=u-g,w=p*m-(b-h*g-p*g-h*m),_=l*c,d=Ms*l,h=d-(d-l),p=l-h,d=Ms*c,g=d-(d-c),m=c-g,S=p*m-(_-h*g-p*g-h*m),v=w-S,f=w-v,ca[0]=w-(v+f)+(f-S),y=b+v,f=y-b,x=b-(y-f)+(v-f),v=x-_,f=x-v,ca[1]=x-(v+f)+(f-_),O=y+v,f=O-y,ca[2]=y-(O-f)+(v-f),ca[3]=O;const B=EV(I,Xme,4,ca,Yme);return Yme[B-1]}function YI(t,e,n,r,i,o){const s=(e-o)*(n-i),a=(t-i)*(r-o),l=s-a,c=Math.abs(s+a);return Math.abs(l)>=q$t*c?l:-Q$t(t,e,n,r,i,o,c)}const Qme=Math.pow(2,-52),QI=new Uint32Array(512);class E5{static from(e,n=t3t,r=n3t){const i=e.length,o=new Float64Array(i*2);for(let s=0;s>1;if(n>0&&typeof e[0]!="number")throw new Error("Expected coords to contain numbers.");this.coords=e;const r=Math.max(2*n-5,0);this._triangles=new Uint32Array(r*3),this._halfedges=new Int32Array(r*3),this._hashSize=Math.ceil(Math.sqrt(n)),this._hullPrev=new Uint32Array(n),this._hullNext=new Uint32Array(n),this._hullTri=new Uint32Array(n),this._hullHash=new Int32Array(this._hashSize),this._ids=new Uint32Array(n),this._dists=new Float64Array(n),this.update()}update(){const{coords:e,_hullPrev:n,_hullNext:r,_hullTri:i,_hullHash:o}=this,s=e.length>>1;let a=1/0,l=1/0,c=-1/0,u=-1/0;for(let k=0;kc&&(c=E),M>u&&(u=M),this._ids[k]=k}const f=(a+c)/2,d=(l+u)/2;let h,p,g;for(let k=0,E=1/0;k0&&(p=k,E=M)}let y=e[2*p],x=e[2*p+1],b=1/0;for(let k=0;kA&&(k[E++]=P,A=T)}this.hull=k.subarray(0,E),this.triangles=new Uint32Array(0),this.halfedges=new Uint32Array(0);return}if(YI(m,v,y,x,w,_)<0){const k=p,E=y,M=x;p=g,y=w,x=_,g=k,w=E,_=M}const S=e3t(m,v,y,x,w,_);this._cx=S.x,this._cy=S.y;for(let k=0;k0&&Math.abs(P-E)<=Qme&&Math.abs(T-M)<=Qme||(E=P,M=T,A===h||A===p||A===g))continue;let R=0;for(let L=0,j=this._hashKey(P,T);L=0;)if(I=B,I===R){I=-1;break}if(I===-1)continue;let $=this._addTriangle(I,A,r[I],-1,-1,i[I]);i[A]=this._legalize($+2),i[I]=$,O++;let z=r[I];for(;B=r[z],YI(P,T,e[2*z],e[2*z+1],e[2*B],e[2*B+1])<0;)$=this._addTriangle(z,A,B,i[A],-1,i[z]),i[A]=this._legalize($+2),r[z]=z,O--,z=B;if(I===R)for(;B=n[I],YI(P,T,e[2*B],e[2*B+1],e[2*I],e[2*I+1])<0;)$=this._addTriangle(B,A,I,-1,i[I],i[B]),this._legalize($+2),i[B]=$,r[I]=I,O--,I=B;this._hullStart=n[A]=I,r[I]=n[z]=A,r[A]=z,o[this._hashKey(P,T)]=A,o[this._hashKey(e[2*I],e[2*I+1])]=I}this.hull=new Uint32Array(O);for(let k=0,E=this._hullStart;k0?3-n:1+n)/4}function TV(t,e,n,r){const i=t-n,o=e-r;return i*i+o*o}function Z$t(t,e,n,r,i,o,s,a){const l=t-s,c=e-a,u=n-s,f=r-a,d=i-s,h=o-a,p=l*l+c*c,g=u*u+f*f,m=d*d+h*h;return l*(f*m-g*h)-c*(u*m-g*d)+p*(u*h-f*d)<0}function J$t(t,e,n,r,i,o){const s=n-t,a=r-e,l=i-t,c=o-e,u=s*s+a*a,f=l*l+c*c,d=.5/(s*c-a*l),h=(c*u-a*f)*d,p=(s*f-l*u)*d;return h*h+p*p}function e3t(t,e,n,r,i,o){const s=n-t,a=r-e,l=i-t,c=o-e,u=s*s+a*a,f=l*l+c*c,d=.5/(s*c-a*l),h=t+(c*u-a*f)*d,p=e+(s*f-l*u)*d;return{x:h,y:p}}function f_(t,e,n,r){if(r-n<=20)for(let i=n+1;i<=r;i++){const o=t[i],s=e[o];let a=i-1;for(;a>=n&&e[t[a]]>s;)t[a+1]=t[a--];t[a+1]=o}else{const i=n+r>>1;let o=n+1,s=r;t2(t,i,o),e[t[n]]>e[t[r]]&&t2(t,n,r),e[t[o]]>e[t[r]]&&t2(t,o,r),e[t[n]]>e[t[o]]&&t2(t,n,o);const a=t[o],l=e[a];for(;;){do o++;while(e[t[o]]l);if(s=s-n?(f_(t,e,o,r),f_(t,e,n,s-1)):(f_(t,e,n,s-1),f_(t,e,o,r))}}function t2(t,e,n){const r=t[e];t[e]=t[n],t[n]=r}function t3t(t){return t[0]}function n3t(t){return t[1]}const Kme=1e-6;class mx{constructor(){this._x0=this._y0=this._x1=this._y1=null,this._=""}moveTo(e,n){this._+=`M${this._x0=this._x1=+e},${this._y0=this._y1=+n}`}closePath(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._+="Z")}lineTo(e,n){this._+=`L${this._x1=+e},${this._y1=+n}`}arc(e,n,r){e=+e,n=+n,r=+r;const i=e+r,o=n;if(r<0)throw new Error("negative radius");this._x1===null?this._+=`M${i},${o}`:(Math.abs(this._x1-i)>Kme||Math.abs(this._y1-o)>Kme)&&(this._+="L"+i+","+o),r&&(this._+=`A${r},${r},0,1,1,${e-r},${n}A${r},${r},0,1,1,${this._x1=i},${this._y1=o}`)}rect(e,n,r,i){this._+=`M${this._x0=this._x1=+e},${this._y0=this._y1=+n}h${+r}v${+i}h${-r}Z`}value(){return this._||null}}class iY{constructor(){this._=[]}moveTo(e,n){this._.push([e,n])}closePath(){this._.push(this._[0].slice())}lineTo(e,n){this._.push([e,n])}value(){return this._.length?this._:null}}let r3t=class{constructor(e,[n,r,i,o]=[0,0,960,500]){if(!((i=+i)>=(n=+n))||!((o=+o)>=(r=+r)))throw new Error("invalid bounds");this.delaunay=e,this._circumcenters=new Float64Array(e.points.length*2),this.vectors=new Float64Array(e.points.length*2),this.xmax=i,this.xmin=n,this.ymax=o,this.ymin=r,this._init()}update(){return this.delaunay.update(),this._init(),this}_init(){const{delaunay:{points:e,hull:n,triangles:r},vectors:i}=this;let o,s;const a=this.circumcenters=this._circumcenters.subarray(0,r.length/3*2);for(let g=0,m=0,v=r.length,y,x;g1;)o-=2;for(let s=2;s0){if(n>=this.ymax)return null;(s=(this.ymax-n)/i)0){if(e>=this.xmax)return null;(s=(this.xmax-e)/r)this.xmax?2:0)|(nthis.ymax?8:0)}_simplify(e){if(e&&e.length>4){for(let n=0;n1e-10)return!1}return!0}function l3t(t,e,n){return[t+Math.sin(t+e)*n,e+Math.cos(t-e)*n]}class foe{static from(e,n=o3t,r=s3t,i){return new foe("length"in e?c3t(e,n,r,i):Float64Array.from(u3t(e,n,r,i)))}constructor(e){this._delaunator=new E5(e),this.inedges=new Int32Array(e.length/2),this._hullIndex=new Int32Array(e.length/2),this.points=this._delaunator.coords,this._init()}update(){return this._delaunator.update(),this._init(),this}_init(){const e=this._delaunator,n=this.points;if(e.hull&&e.hull.length>2&&a3t(e)){this.collinear=Int32Array.from({length:n.length/2},(d,h)=>h).sort((d,h)=>n[2*d]-n[2*h]||n[2*d+1]-n[2*h+1]);const l=this.collinear[0],c=this.collinear[this.collinear.length-1],u=[n[2*l],n[2*l+1],n[2*c],n[2*c+1]],f=1e-8*Math.hypot(u[3]-u[1],u[2]-u[0]);for(let d=0,h=n.length/2;d0&&(this.triangles=new Int32Array(3).fill(-1),this.halfedges=new Int32Array(3).fill(-1),this.triangles[0]=i[0],s[i[0]]=1,i.length===2&&(s[i[1]]=0,this.triangles[1]=i[1],this.triangles[2]=i[1]))}voronoi(e){return new r3t(this,e)}*neighbors(e){const{inedges:n,hull:r,_hullIndex:i,halfedges:o,triangles:s,collinear:a}=this;if(a){const f=a.indexOf(e);f>0&&(yield a[f-1]),f=0&&o!==r&&o!==i;)r=o;return o}_step(e,n,r){const{inedges:i,hull:o,_hullIndex:s,halfedges:a,triangles:l,points:c}=this;if(i[e]===-1||!c.length)return(e+1)%(c.length>>1);let u=e,f=Jb(n-c[e*2],2)+Jb(r-c[e*2+1],2);const d=i[e];let h=d;do{let p=l[h];const g=Jb(n-c[p*2],2)+Jb(r-c[p*2+1],2);if(g>5)*t[1]),m=null,v=c.length,y=-1,x=[],b=c.map(_=>({text:e(_),font:n(_),style:i(_),weight:o(_),rotate:s(_),size:~~(r(_)+1e-14),padding:a(_),xoff:0,yoff:0,x1:0,y1:0,x0:0,y0:0,hasText:!1,sprite:null,datum:_})).sort((_,S)=>S.size-_.size);++y>1,w.y=t[1]*(u()+.5)>>1,m3t(p,w,b,y),w.hasText&&h(g,w,m)&&(x.push(w),m?y3t(m,w):m=[{x:w.x+w.x0,y:w.y+w.y0},{x:w.x+w.x1,y:w.y+w.y1}],w.x-=t[0]>>1,w.y-=t[1]>>1)}return x};function d(p){p.width=p.height=1;var g=Math.sqrt(p.getContext("2d").getImageData(0,0,1,1).data.length>>2);p.width=(xT<<5)/g,p.height=P3/g;var m=p.getContext("2d");return m.fillStyle=m.strokeStyle="red",m.textAlign="center",{context:m,ratio:g}}function h(p,g,m){for(var v=g.x,y=g.y,x=Math.hypot(t[0],t[1]),b=l(t),w=u()<.5?1:-1,_=-w,S,O,k;(S=b(_+=w))&&(O=~~S[0],k=~~S[1],!(Math.min(Math.abs(O),Math.abs(k))>=x));)if(g.x=v+O,g.y=y+k,!(g.x+g.x0<0||g.y+g.y0<0||g.x+g.x1>t[0]||g.y+g.y1>t[1])&&(!m||!v3t(g,p,t[0]))&&(!m||x3t(g,m))){for(var E=g.sprite,M=g.width>>5,A=t[0]>>5,P=g.x-(M<<4),T=P&127,R=32-T,I=g.y1-g.y0,B=(g.y+g.y0)*A+(P>>5),$,z=0;z>>T:0);B+=A}return g.sprite=null,!0}return!1}return f.words=function(p){return arguments.length?(c=p,f):c},f.size=function(p){return arguments.length?(t=[+p[0],+p[1]],f):t},f.font=function(p){return arguments.length?(n=g0(p),f):n},f.fontStyle=function(p){return arguments.length?(i=g0(p),f):i},f.fontWeight=function(p){return arguments.length?(o=g0(p),f):o},f.rotate=function(p){return arguments.length?(s=g0(p),f):s},f.text=function(p){return arguments.length?(e=g0(p),f):e},f.spiral=function(p){return arguments.length?(l=_3t[p]||p,f):l},f.fontSize=function(p){return arguments.length?(r=g0(p),f):r},f.padding=function(p){return arguments.length?(a=g0(p),f):a},f.random=function(p){return arguments.length?(u=p,f):u},f}function m3t(t,e,n,r){if(!e.sprite){var i=t.context,o=t.ratio;i.clearRect(0,0,(xT<<5)/o,P3/o);var s=0,a=0,l=0,c=n.length,u,f,d,h,p;for(--r;++r>5<<5,d=~~Math.max(Math.abs(y+x),Math.abs(y-x))}else u=u+31>>5<<5;if(d>l&&(l=d),s+u>=xT<<5&&(s=0,a+=l,l=0),a+d>=P3)break;i.translate((s+(u>>1))/o,(a+(d>>1))/o),e.rotate&&i.rotate(e.rotate*kV),i.fillText(e.text,0,0),e.padding&&(i.lineWidth=2*e.padding,i.strokeText(e.text,0,0)),i.restore(),e.width=u,e.height=d,e.xoff=s,e.yoff=a,e.x1=u>>1,e.y1=d>>1,e.x0=-e.x1,e.y0=-e.y1,e.hasText=!0,s+=u}for(var w=i.getImageData(0,0,(xT<<5)/o,P3/o).data,_=[];--r>=0;)if(e=n[r],!!e.hasText){for(u=e.width,f=u>>5,d=e.y1-e.y0,h=0;h>5),E=w[(a+p)*(xT<<5)+(s+h)<<2]?1<<31-h%32:0;_[k]|=E,S|=E}S?O=p:(e.y0++,d--,p--,a++)}e.y1=e.y0+O,e.sprite=_.slice(0,(e.y1-e.y0)*f)}}}function v3t(t,e,n){n>>=5;for(var r=t.sprite,i=t.width>>5,o=t.x-(i<<4),s=o&127,a=32-s,l=t.y1-t.y0,c=(t.y+t.y0)*n+(o>>5),u,f=0;f>>s:0))&e[c+d])return!0;c+=n}return!1}function y3t(t,e){var n=t[0],r=t[1];e.x+e.x0r.x&&(r.x=e.x+e.x1),e.y+e.y1>r.y&&(r.y=e.y+e.y1)}function x3t(t,e){return t.x+t.x1>e[0].x&&t.x+t.x0e[0].y&&t.y+t.y0g(p(m))}i.forEach(p=>{p[s[0]]=NaN,p[s[1]]=NaN,p[s[3]]=0});const c=o.words(i).text(t.text).size(t.size||[500,500]).padding(t.padding||1).spiral(t.spiral||"archimedean").rotate(t.rotate||0).font(t.font||"sans-serif").fontStyle(t.fontStyle||"normal").fontWeight(t.fontWeight||"normal").fontSize(a).random(Au).layout(),u=o.size(),f=u[0]>>1,d=u[1]>>1,h=c.length;for(let p=0,g,m;pnew Uint8Array(t),E3t=t=>new Uint16Array(t),hk=t=>new Uint32Array(t);function T3t(){let t=8,e=[],n=hk(0),r=KI(0,t),i=KI(0,t);return{data:()=>e,seen:()=>n=k3t(n,e.length),add(o){for(let s=0,a=e.length,l=o.length,c;se.length,curr:()=>r,prev:()=>i,reset:o=>i[o]=r[o],all:()=>t<257?255:t<65537?65535:4294967295,set(o,s){r[o]|=s},clear(o,s){r[o]&=~s},resize(o,s){const a=r.length;(o>a||s>t)&&(t=Math.max(s,t),r=KI(o,t,r),i=KI(o,t))}}}function k3t(t,e,n){return t.length>=e?t:(n=n||new t.constructor(e),n.set(t),n)}function KI(t,e,n){const r=(e<257?O3t:e<65537?E3t:hk)(t);return n&&r.set(n),r}function Zme(t,e,n){const r=1<0)for(m=0;mt,size:()=>n}}function A3t(t,e){return t.sort.call(e,(n,r)=>{const i=t[n],o=t[r];return io?1:0}),ISt(t,e)}function P3t(t,e,n,r,i,o,s,a,l){let c=0,u=0,f;for(f=0;ce.modified(r.fields));return n?this.reinit(t,e):this.eval(t,e)}else return this.init(t,e)},init(t,e){const n=t.fields,r=t.query,i=this._indices={},o=this._dims=[],s=r.length;let a=0,l,c;for(;a{const o=i.remove(e,n);for(const s in r)r[s].reindex(o)})},update(t,e,n){const r=this._dims,i=t.query,o=e.stamp,s=r.length;let a=0,l,c;for(n.filters=0,c=0;ch)for(m=h,v=Math.min(f,p);mp)for(m=Math.max(f,p),v=d;mf)for(p=f,g=Math.min(c,d);pd)for(p=Math.max(c,d),g=u;pa[u]&n?null:s[u];return o.filter(o.MOD,c),i&i-1?(o.filter(o.ADD,u=>{const f=a[u]&n;return!f&&f^l[u]&n?s[u]:null}),o.filter(o.REM,u=>{const f=a[u]&n;return f&&!(f^(f^l[u]&n))?s[u]:null})):(o.filter(o.ADD,c),o.filter(o.REM,u=>(a[u]&n)===i?s[u]:null)),o.filter(o.SOURCE,u=>c(u._index))}});const M3t=Object.freeze(Object.defineProperty({__proto__:null,crossfilter:poe,resolvefilter:goe},Symbol.toStringTag,{value:"Module"})),R3t="RawCode",v1="Literal",D3t="Property",I3t="Identifier",L3t="ArrayExpression",$3t="BinaryExpression",$5e="CallExpression",F3t="ConditionalExpression",N3t="LogicalExpression",z3t="MemberExpression",j3t="ObjectExpression",B3t="UnaryExpression";function nd(t){this.type=t}nd.prototype.visit=function(t){let e,n,r;if(t(this))return 1;for(e=U3t(this),n=0,r=e.length;n";Gh[y1]="Identifier";Gh[Hy]="Keyword";Gh[YB]="Null";Gh[ub]="Numeric";Gh[Xa]="Punctuator";Gh[PR]="String";Gh[W3t]="RegularExpression";var V3t="ArrayExpression",G3t="BinaryExpression",H3t="CallExpression",q3t="ConditionalExpression",F5e="Identifier",X3t="Literal",Y3t="LogicalExpression",Q3t="MemberExpression",K3t="ObjectExpression",Z3t="Property",J3t="UnaryExpression",Fo="Unexpected token %0",eFt="Unexpected number",tFt="Unexpected string",nFt="Unexpected identifier",rFt="Unexpected reserved word",iFt="Unexpected end of input",oY="Invalid regular expression",AV="Invalid regular expression: missing /",N5e="Octal literals are not allowed in strict mode.",oFt="Duplicate data property in object literal not allowed in strict mode",ps="ILLEGAL",jA="Disabled.",sFt=new RegExp("[\\xAA\\xB5\\xBA\\xC0-\\xD6\\xD8-\\xF6\\xF8-\\u02C1\\u02C6-\\u02D1\\u02E0-\\u02E4\\u02EC\\u02EE\\u0370-\\u0374\\u0376\\u0377\\u037A-\\u037D\\u037F\\u0386\\u0388-\\u038A\\u038C\\u038E-\\u03A1\\u03A3-\\u03F5\\u03F7-\\u0481\\u048A-\\u052F\\u0531-\\u0556\\u0559\\u0561-\\u0587\\u05D0-\\u05EA\\u05F0-\\u05F2\\u0620-\\u064A\\u066E\\u066F\\u0671-\\u06D3\\u06D5\\u06E5\\u06E6\\u06EE\\u06EF\\u06FA-\\u06FC\\u06FF\\u0710\\u0712-\\u072F\\u074D-\\u07A5\\u07B1\\u07CA-\\u07EA\\u07F4\\u07F5\\u07FA\\u0800-\\u0815\\u081A\\u0824\\u0828\\u0840-\\u0858\\u08A0-\\u08B2\\u0904-\\u0939\\u093D\\u0950\\u0958-\\u0961\\u0971-\\u0980\\u0985-\\u098C\\u098F\\u0990\\u0993-\\u09A8\\u09AA-\\u09B0\\u09B2\\u09B6-\\u09B9\\u09BD\\u09CE\\u09DC\\u09DD\\u09DF-\\u09E1\\u09F0\\u09F1\\u0A05-\\u0A0A\\u0A0F\\u0A10\\u0A13-\\u0A28\\u0A2A-\\u0A30\\u0A32\\u0A33\\u0A35\\u0A36\\u0A38\\u0A39\\u0A59-\\u0A5C\\u0A5E\\u0A72-\\u0A74\\u0A85-\\u0A8D\\u0A8F-\\u0A91\\u0A93-\\u0AA8\\u0AAA-\\u0AB0\\u0AB2\\u0AB3\\u0AB5-\\u0AB9\\u0ABD\\u0AD0\\u0AE0\\u0AE1\\u0B05-\\u0B0C\\u0B0F\\u0B10\\u0B13-\\u0B28\\u0B2A-\\u0B30\\u0B32\\u0B33\\u0B35-\\u0B39\\u0B3D\\u0B5C\\u0B5D\\u0B5F-\\u0B61\\u0B71\\u0B83\\u0B85-\\u0B8A\\u0B8E-\\u0B90\\u0B92-\\u0B95\\u0B99\\u0B9A\\u0B9C\\u0B9E\\u0B9F\\u0BA3\\u0BA4\\u0BA8-\\u0BAA\\u0BAE-\\u0BB9\\u0BD0\\u0C05-\\u0C0C\\u0C0E-\\u0C10\\u0C12-\\u0C28\\u0C2A-\\u0C39\\u0C3D\\u0C58\\u0C59\\u0C60\\u0C61\\u0C85-\\u0C8C\\u0C8E-\\u0C90\\u0C92-\\u0CA8\\u0CAA-\\u0CB3\\u0CB5-\\u0CB9\\u0CBD\\u0CDE\\u0CE0\\u0CE1\\u0CF1\\u0CF2\\u0D05-\\u0D0C\\u0D0E-\\u0D10\\u0D12-\\u0D3A\\u0D3D\\u0D4E\\u0D60\\u0D61\\u0D7A-\\u0D7F\\u0D85-\\u0D96\\u0D9A-\\u0DB1\\u0DB3-\\u0DBB\\u0DBD\\u0DC0-\\u0DC6\\u0E01-\\u0E30\\u0E32\\u0E33\\u0E40-\\u0E46\\u0E81\\u0E82\\u0E84\\u0E87\\u0E88\\u0E8A\\u0E8D\\u0E94-\\u0E97\\u0E99-\\u0E9F\\u0EA1-\\u0EA3\\u0EA5\\u0EA7\\u0EAA\\u0EAB\\u0EAD-\\u0EB0\\u0EB2\\u0EB3\\u0EBD\\u0EC0-\\u0EC4\\u0EC6\\u0EDC-\\u0EDF\\u0F00\\u0F40-\\u0F47\\u0F49-\\u0F6C\\u0F88-\\u0F8C\\u1000-\\u102A\\u103F\\u1050-\\u1055\\u105A-\\u105D\\u1061\\u1065\\u1066\\u106E-\\u1070\\u1075-\\u1081\\u108E\\u10A0-\\u10C5\\u10C7\\u10CD\\u10D0-\\u10FA\\u10FC-\\u1248\\u124A-\\u124D\\u1250-\\u1256\\u1258\\u125A-\\u125D\\u1260-\\u1288\\u128A-\\u128D\\u1290-\\u12B0\\u12B2-\\u12B5\\u12B8-\\u12BE\\u12C0\\u12C2-\\u12C5\\u12C8-\\u12D6\\u12D8-\\u1310\\u1312-\\u1315\\u1318-\\u135A\\u1380-\\u138F\\u13A0-\\u13F4\\u1401-\\u166C\\u166F-\\u167F\\u1681-\\u169A\\u16A0-\\u16EA\\u16EE-\\u16F8\\u1700-\\u170C\\u170E-\\u1711\\u1720-\\u1731\\u1740-\\u1751\\u1760-\\u176C\\u176E-\\u1770\\u1780-\\u17B3\\u17D7\\u17DC\\u1820-\\u1877\\u1880-\\u18A8\\u18AA\\u18B0-\\u18F5\\u1900-\\u191E\\u1950-\\u196D\\u1970-\\u1974\\u1980-\\u19AB\\u19C1-\\u19C7\\u1A00-\\u1A16\\u1A20-\\u1A54\\u1AA7\\u1B05-\\u1B33\\u1B45-\\u1B4B\\u1B83-\\u1BA0\\u1BAE\\u1BAF\\u1BBA-\\u1BE5\\u1C00-\\u1C23\\u1C4D-\\u1C4F\\u1C5A-\\u1C7D\\u1CE9-\\u1CEC\\u1CEE-\\u1CF1\\u1CF5\\u1CF6\\u1D00-\\u1DBF\\u1E00-\\u1F15\\u1F18-\\u1F1D\\u1F20-\\u1F45\\u1F48-\\u1F4D\\u1F50-\\u1F57\\u1F59\\u1F5B\\u1F5D\\u1F5F-\\u1F7D\\u1F80-\\u1FB4\\u1FB6-\\u1FBC\\u1FBE\\u1FC2-\\u1FC4\\u1FC6-\\u1FCC\\u1FD0-\\u1FD3\\u1FD6-\\u1FDB\\u1FE0-\\u1FEC\\u1FF2-\\u1FF4\\u1FF6-\\u1FFC\\u2071\\u207F\\u2090-\\u209C\\u2102\\u2107\\u210A-\\u2113\\u2115\\u2119-\\u211D\\u2124\\u2126\\u2128\\u212A-\\u212D\\u212F-\\u2139\\u213C-\\u213F\\u2145-\\u2149\\u214E\\u2160-\\u2188\\u2C00-\\u2C2E\\u2C30-\\u2C5E\\u2C60-\\u2CE4\\u2CEB-\\u2CEE\\u2CF2\\u2CF3\\u2D00-\\u2D25\\u2D27\\u2D2D\\u2D30-\\u2D67\\u2D6F\\u2D80-\\u2D96\\u2DA0-\\u2DA6\\u2DA8-\\u2DAE\\u2DB0-\\u2DB6\\u2DB8-\\u2DBE\\u2DC0-\\u2DC6\\u2DC8-\\u2DCE\\u2DD0-\\u2DD6\\u2DD8-\\u2DDE\\u2E2F\\u3005-\\u3007\\u3021-\\u3029\\u3031-\\u3035\\u3038-\\u303C\\u3041-\\u3096\\u309D-\\u309F\\u30A1-\\u30FA\\u30FC-\\u30FF\\u3105-\\u312D\\u3131-\\u318E\\u31A0-\\u31BA\\u31F0-\\u31FF\\u3400-\\u4DB5\\u4E00-\\u9FCC\\uA000-\\uA48C\\uA4D0-\\uA4FD\\uA500-\\uA60C\\uA610-\\uA61F\\uA62A\\uA62B\\uA640-\\uA66E\\uA67F-\\uA69D\\uA6A0-\\uA6EF\\uA717-\\uA71F\\uA722-\\uA788\\uA78B-\\uA78E\\uA790-\\uA7AD\\uA7B0\\uA7B1\\uA7F7-\\uA801\\uA803-\\uA805\\uA807-\\uA80A\\uA80C-\\uA822\\uA840-\\uA873\\uA882-\\uA8B3\\uA8F2-\\uA8F7\\uA8FB\\uA90A-\\uA925\\uA930-\\uA946\\uA960-\\uA97C\\uA984-\\uA9B2\\uA9CF\\uA9E0-\\uA9E4\\uA9E6-\\uA9EF\\uA9FA-\\uA9FE\\uAA00-\\uAA28\\uAA40-\\uAA42\\uAA44-\\uAA4B\\uAA60-\\uAA76\\uAA7A\\uAA7E-\\uAAAF\\uAAB1\\uAAB5\\uAAB6\\uAAB9-\\uAABD\\uAAC0\\uAAC2\\uAADB-\\uAADD\\uAAE0-\\uAAEA\\uAAF2-\\uAAF4\\uAB01-\\uAB06\\uAB09-\\uAB0E\\uAB11-\\uAB16\\uAB20-\\uAB26\\uAB28-\\uAB2E\\uAB30-\\uAB5A\\uAB5C-\\uAB5F\\uAB64\\uAB65\\uABC0-\\uABE2\\uAC00-\\uD7A3\\uD7B0-\\uD7C6\\uD7CB-\\uD7FB\\uF900-\\uFA6D\\uFA70-\\uFAD9\\uFB00-\\uFB06\\uFB13-\\uFB17\\uFB1D\\uFB1F-\\uFB28\\uFB2A-\\uFB36\\uFB38-\\uFB3C\\uFB3E\\uFB40\\uFB41\\uFB43\\uFB44\\uFB46-\\uFBB1\\uFBD3-\\uFD3D\\uFD50-\\uFD8F\\uFD92-\\uFDC7\\uFDF0-\\uFDFB\\uFE70-\\uFE74\\uFE76-\\uFEFC\\uFF21-\\uFF3A\\uFF41-\\uFF5A\\uFF66-\\uFFBE\\uFFC2-\\uFFC7\\uFFCA-\\uFFCF\\uFFD2-\\uFFD7\\uFFDA-\\uFFDC]"),aFt=new RegExp("[\\xAA\\xB5\\xBA\\xC0-\\xD6\\xD8-\\xF6\\xF8-\\u02C1\\u02C6-\\u02D1\\u02E0-\\u02E4\\u02EC\\u02EE\\u0300-\\u0374\\u0376\\u0377\\u037A-\\u037D\\u037F\\u0386\\u0388-\\u038A\\u038C\\u038E-\\u03A1\\u03A3-\\u03F5\\u03F7-\\u0481\\u0483-\\u0487\\u048A-\\u052F\\u0531-\\u0556\\u0559\\u0561-\\u0587\\u0591-\\u05BD\\u05BF\\u05C1\\u05C2\\u05C4\\u05C5\\u05C7\\u05D0-\\u05EA\\u05F0-\\u05F2\\u0610-\\u061A\\u0620-\\u0669\\u066E-\\u06D3\\u06D5-\\u06DC\\u06DF-\\u06E8\\u06EA-\\u06FC\\u06FF\\u0710-\\u074A\\u074D-\\u07B1\\u07C0-\\u07F5\\u07FA\\u0800-\\u082D\\u0840-\\u085B\\u08A0-\\u08B2\\u08E4-\\u0963\\u0966-\\u096F\\u0971-\\u0983\\u0985-\\u098C\\u098F\\u0990\\u0993-\\u09A8\\u09AA-\\u09B0\\u09B2\\u09B6-\\u09B9\\u09BC-\\u09C4\\u09C7\\u09C8\\u09CB-\\u09CE\\u09D7\\u09DC\\u09DD\\u09DF-\\u09E3\\u09E6-\\u09F1\\u0A01-\\u0A03\\u0A05-\\u0A0A\\u0A0F\\u0A10\\u0A13-\\u0A28\\u0A2A-\\u0A30\\u0A32\\u0A33\\u0A35\\u0A36\\u0A38\\u0A39\\u0A3C\\u0A3E-\\u0A42\\u0A47\\u0A48\\u0A4B-\\u0A4D\\u0A51\\u0A59-\\u0A5C\\u0A5E\\u0A66-\\u0A75\\u0A81-\\u0A83\\u0A85-\\u0A8D\\u0A8F-\\u0A91\\u0A93-\\u0AA8\\u0AAA-\\u0AB0\\u0AB2\\u0AB3\\u0AB5-\\u0AB9\\u0ABC-\\u0AC5\\u0AC7-\\u0AC9\\u0ACB-\\u0ACD\\u0AD0\\u0AE0-\\u0AE3\\u0AE6-\\u0AEF\\u0B01-\\u0B03\\u0B05-\\u0B0C\\u0B0F\\u0B10\\u0B13-\\u0B28\\u0B2A-\\u0B30\\u0B32\\u0B33\\u0B35-\\u0B39\\u0B3C-\\u0B44\\u0B47\\u0B48\\u0B4B-\\u0B4D\\u0B56\\u0B57\\u0B5C\\u0B5D\\u0B5F-\\u0B63\\u0B66-\\u0B6F\\u0B71\\u0B82\\u0B83\\u0B85-\\u0B8A\\u0B8E-\\u0B90\\u0B92-\\u0B95\\u0B99\\u0B9A\\u0B9C\\u0B9E\\u0B9F\\u0BA3\\u0BA4\\u0BA8-\\u0BAA\\u0BAE-\\u0BB9\\u0BBE-\\u0BC2\\u0BC6-\\u0BC8\\u0BCA-\\u0BCD\\u0BD0\\u0BD7\\u0BE6-\\u0BEF\\u0C00-\\u0C03\\u0C05-\\u0C0C\\u0C0E-\\u0C10\\u0C12-\\u0C28\\u0C2A-\\u0C39\\u0C3D-\\u0C44\\u0C46-\\u0C48\\u0C4A-\\u0C4D\\u0C55\\u0C56\\u0C58\\u0C59\\u0C60-\\u0C63\\u0C66-\\u0C6F\\u0C81-\\u0C83\\u0C85-\\u0C8C\\u0C8E-\\u0C90\\u0C92-\\u0CA8\\u0CAA-\\u0CB3\\u0CB5-\\u0CB9\\u0CBC-\\u0CC4\\u0CC6-\\u0CC8\\u0CCA-\\u0CCD\\u0CD5\\u0CD6\\u0CDE\\u0CE0-\\u0CE3\\u0CE6-\\u0CEF\\u0CF1\\u0CF2\\u0D01-\\u0D03\\u0D05-\\u0D0C\\u0D0E-\\u0D10\\u0D12-\\u0D3A\\u0D3D-\\u0D44\\u0D46-\\u0D48\\u0D4A-\\u0D4E\\u0D57\\u0D60-\\u0D63\\u0D66-\\u0D6F\\u0D7A-\\u0D7F\\u0D82\\u0D83\\u0D85-\\u0D96\\u0D9A-\\u0DB1\\u0DB3-\\u0DBB\\u0DBD\\u0DC0-\\u0DC6\\u0DCA\\u0DCF-\\u0DD4\\u0DD6\\u0DD8-\\u0DDF\\u0DE6-\\u0DEF\\u0DF2\\u0DF3\\u0E01-\\u0E3A\\u0E40-\\u0E4E\\u0E50-\\u0E59\\u0E81\\u0E82\\u0E84\\u0E87\\u0E88\\u0E8A\\u0E8D\\u0E94-\\u0E97\\u0E99-\\u0E9F\\u0EA1-\\u0EA3\\u0EA5\\u0EA7\\u0EAA\\u0EAB\\u0EAD-\\u0EB9\\u0EBB-\\u0EBD\\u0EC0-\\u0EC4\\u0EC6\\u0EC8-\\u0ECD\\u0ED0-\\u0ED9\\u0EDC-\\u0EDF\\u0F00\\u0F18\\u0F19\\u0F20-\\u0F29\\u0F35\\u0F37\\u0F39\\u0F3E-\\u0F47\\u0F49-\\u0F6C\\u0F71-\\u0F84\\u0F86-\\u0F97\\u0F99-\\u0FBC\\u0FC6\\u1000-\\u1049\\u1050-\\u109D\\u10A0-\\u10C5\\u10C7\\u10CD\\u10D0-\\u10FA\\u10FC-\\u1248\\u124A-\\u124D\\u1250-\\u1256\\u1258\\u125A-\\u125D\\u1260-\\u1288\\u128A-\\u128D\\u1290-\\u12B0\\u12B2-\\u12B5\\u12B8-\\u12BE\\u12C0\\u12C2-\\u12C5\\u12C8-\\u12D6\\u12D8-\\u1310\\u1312-\\u1315\\u1318-\\u135A\\u135D-\\u135F\\u1380-\\u138F\\u13A0-\\u13F4\\u1401-\\u166C\\u166F-\\u167F\\u1681-\\u169A\\u16A0-\\u16EA\\u16EE-\\u16F8\\u1700-\\u170C\\u170E-\\u1714\\u1720-\\u1734\\u1740-\\u1753\\u1760-\\u176C\\u176E-\\u1770\\u1772\\u1773\\u1780-\\u17D3\\u17D7\\u17DC\\u17DD\\u17E0-\\u17E9\\u180B-\\u180D\\u1810-\\u1819\\u1820-\\u1877\\u1880-\\u18AA\\u18B0-\\u18F5\\u1900-\\u191E\\u1920-\\u192B\\u1930-\\u193B\\u1946-\\u196D\\u1970-\\u1974\\u1980-\\u19AB\\u19B0-\\u19C9\\u19D0-\\u19D9\\u1A00-\\u1A1B\\u1A20-\\u1A5E\\u1A60-\\u1A7C\\u1A7F-\\u1A89\\u1A90-\\u1A99\\u1AA7\\u1AB0-\\u1ABD\\u1B00-\\u1B4B\\u1B50-\\u1B59\\u1B6B-\\u1B73\\u1B80-\\u1BF3\\u1C00-\\u1C37\\u1C40-\\u1C49\\u1C4D-\\u1C7D\\u1CD0-\\u1CD2\\u1CD4-\\u1CF6\\u1CF8\\u1CF9\\u1D00-\\u1DF5\\u1DFC-\\u1F15\\u1F18-\\u1F1D\\u1F20-\\u1F45\\u1F48-\\u1F4D\\u1F50-\\u1F57\\u1F59\\u1F5B\\u1F5D\\u1F5F-\\u1F7D\\u1F80-\\u1FB4\\u1FB6-\\u1FBC\\u1FBE\\u1FC2-\\u1FC4\\u1FC6-\\u1FCC\\u1FD0-\\u1FD3\\u1FD6-\\u1FDB\\u1FE0-\\u1FEC\\u1FF2-\\u1FF4\\u1FF6-\\u1FFC\\u200C\\u200D\\u203F\\u2040\\u2054\\u2071\\u207F\\u2090-\\u209C\\u20D0-\\u20DC\\u20E1\\u20E5-\\u20F0\\u2102\\u2107\\u210A-\\u2113\\u2115\\u2119-\\u211D\\u2124\\u2126\\u2128\\u212A-\\u212D\\u212F-\\u2139\\u213C-\\u213F\\u2145-\\u2149\\u214E\\u2160-\\u2188\\u2C00-\\u2C2E\\u2C30-\\u2C5E\\u2C60-\\u2CE4\\u2CEB-\\u2CF3\\u2D00-\\u2D25\\u2D27\\u2D2D\\u2D30-\\u2D67\\u2D6F\\u2D7F-\\u2D96\\u2DA0-\\u2DA6\\u2DA8-\\u2DAE\\u2DB0-\\u2DB6\\u2DB8-\\u2DBE\\u2DC0-\\u2DC6\\u2DC8-\\u2DCE\\u2DD0-\\u2DD6\\u2DD8-\\u2DDE\\u2DE0-\\u2DFF\\u2E2F\\u3005-\\u3007\\u3021-\\u302F\\u3031-\\u3035\\u3038-\\u303C\\u3041-\\u3096\\u3099\\u309A\\u309D-\\u309F\\u30A1-\\u30FA\\u30FC-\\u30FF\\u3105-\\u312D\\u3131-\\u318E\\u31A0-\\u31BA\\u31F0-\\u31FF\\u3400-\\u4DB5\\u4E00-\\u9FCC\\uA000-\\uA48C\\uA4D0-\\uA4FD\\uA500-\\uA60C\\uA610-\\uA62B\\uA640-\\uA66F\\uA674-\\uA67D\\uA67F-\\uA69D\\uA69F-\\uA6F1\\uA717-\\uA71F\\uA722-\\uA788\\uA78B-\\uA78E\\uA790-\\uA7AD\\uA7B0\\uA7B1\\uA7F7-\\uA827\\uA840-\\uA873\\uA880-\\uA8C4\\uA8D0-\\uA8D9\\uA8E0-\\uA8F7\\uA8FB\\uA900-\\uA92D\\uA930-\\uA953\\uA960-\\uA97C\\uA980-\\uA9C0\\uA9CF-\\uA9D9\\uA9E0-\\uA9FE\\uAA00-\\uAA36\\uAA40-\\uAA4D\\uAA50-\\uAA59\\uAA60-\\uAA76\\uAA7A-\\uAAC2\\uAADB-\\uAADD\\uAAE0-\\uAAEF\\uAAF2-\\uAAF6\\uAB01-\\uAB06\\uAB09-\\uAB0E\\uAB11-\\uAB16\\uAB20-\\uAB26\\uAB28-\\uAB2E\\uAB30-\\uAB5A\\uAB5C-\\uAB5F\\uAB64\\uAB65\\uABC0-\\uABEA\\uABEC\\uABED\\uABF0-\\uABF9\\uAC00-\\uD7A3\\uD7B0-\\uD7C6\\uD7CB-\\uD7FB\\uF900-\\uFA6D\\uFA70-\\uFAD9\\uFB00-\\uFB06\\uFB13-\\uFB17\\uFB1D-\\uFB28\\uFB2A-\\uFB36\\uFB38-\\uFB3C\\uFB3E\\uFB40\\uFB41\\uFB43\\uFB44\\uFB46-\\uFBB1\\uFBD3-\\uFD3D\\uFD50-\\uFD8F\\uFD92-\\uFDC7\\uFDF0-\\uFDFB\\uFE00-\\uFE0F\\uFE20-\\uFE2D\\uFE33\\uFE34\\uFE4D-\\uFE4F\\uFE70-\\uFE74\\uFE76-\\uFEFC\\uFF10-\\uFF19\\uFF21-\\uFF3A\\uFF3F\\uFF41-\\uFF5A\\uFF66-\\uFFBE\\uFFC2-\\uFFC7\\uFFCA-\\uFFCF\\uFFD2-\\uFFD7\\uFFDA-\\uFFDC]");function QB(t,e){if(!t)throw new Error("ASSERT: "+e)}function Fp(t){return t>=48&&t<=57}function moe(t){return"0123456789abcdefABCDEF".includes(t)}function pk(t){return"01234567".includes(t)}function lFt(t){return t===32||t===9||t===11||t===12||t===160||t>=5760&&[5760,6158,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8239,8287,12288,65279].includes(t)}function BA(t){return t===10||t===13||t===8232||t===8233}function MR(t){return t===36||t===95||t>=65&&t<=90||t>=97&&t<=122||t===92||t>=128&&sFt.test(String.fromCharCode(t))}function T5(t){return t===36||t===95||t>=65&&t<=90||t>=97&&t<=122||t>=48&&t<=57||t===92||t>=128&&aFt.test(String.fromCharCode(t))}const cFt={if:1,in:1,do:1,var:1,for:1,new:1,try:1,let:1,this:1,else:1,case:1,void:1,with:1,enum:1,while:1,break:1,catch:1,throw:1,const:1,yield:1,class:1,super:1,return:1,typeof:1,delete:1,switch:1,export:1,import:1,public:1,static:1,default:1,finally:1,extends:1,package:1,private:1,function:1,continue:1,debugger:1,interface:1,protected:1,instanceof:1,implements:1};function z5e(){for(;ze1114111||t!=="}")&&Zn({},Fo,ps),e<=65535?String.fromCharCode(e):(n=(e-65536>>10)+55296,r=(e-65536&1023)+56320,String.fromCharCode(n,r))}function j5e(){var t,e;for(t=Pt.charCodeAt(ze++),e=String.fromCharCode(t),t===92&&(Pt.charCodeAt(ze)!==117&&Zn({},Fo,ps),++ze,t=sY("u"),(!t||t==="\\"||!MR(t.charCodeAt(0)))&&Zn({},Fo,ps),e=t);ze>>=")return ze+=4,{type:Xa,value:s,start:t,end:ze};if(o=s.substr(0,3),o===">>>"||o==="<<="||o===">>=")return ze+=3,{type:Xa,value:o,start:t,end:ze};if(i=o.substr(0,2),r===i[1]&&"+-<>&|".includes(r)||i==="=>")return ze+=2,{type:Xa,value:i,start:t,end:ze};if(i==="//"&&Zn({},Fo,ps),"<>=!+-*%&|^/".includes(r))return++ze,{type:Xa,value:r,start:t,end:ze};Zn({},Fo,ps)}function hFt(t){let e="";for(;ze{if(parseInt(i,16)<=1114111)return"x";Zn({},oY)}).replace(/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,"x"));try{new RegExp(n)}catch{Zn({},oY)}try{return new RegExp(t,e)}catch{return null}}function vFt(){var t,e,n,r,i;for(t=Pt[ze],QB(t==="/","Regular expression literal must start with a slash"),e=Pt[ze++],n=!1,r=!1;ze=0&&Zn({},oY,n),{value:n,literal:e}}function xFt(){var t,e,n,r;return xr=null,z5e(),t=ze,e=vFt(),n=yFt(),r=mFt(e.value,n.value),{literal:e.literal+n.literal,value:r,regex:{pattern:e.value,flags:n.value},start:t,end:ze}}function bFt(t){return t.type===y1||t.type===Hy||t.type===XB||t.type===YB}function B5e(){if(z5e(),ze>=Js)return{type:AR,start:ze,end:ze};const t=Pt.charCodeAt(ze);return MR(t)?dFt():t===40||t===41||t===59?PV():t===39||t===34?gFt():t===46?Fp(Pt.charCodeAt(ze+1))?eve():PV():Fp(t)?eve():PV()}function il(){const t=xr;return ze=t.end,xr=B5e(),ze=t.end,t}function U5e(){const t=ze;xr=B5e(),ze=t}function wFt(t){const e=new nd(V3t);return e.elements=t,e}function tve(t,e,n){const r=new nd(t==="||"||t==="&&"?Y3t:G3t);return r.operator=t,r.left=e,r.right=n,r}function _Ft(t,e){const n=new nd(H3t);return n.callee=t,n.arguments=e,n}function SFt(t,e,n){const r=new nd(q3t);return r.test=t,r.consequent=e,r.alternate=n,r}function voe(t){const e=new nd(F5e);return e.name=t,e}function bT(t){const e=new nd(X3t);return e.value=t.value,e.raw=Pt.slice(t.start,t.end),t.regex&&(e.raw==="//"&&(e.raw="/(?:)/"),e.regex=t.regex),e}function nve(t,e,n){const r=new nd(Q3t);return r.computed=t==="[",r.object=e,r.property=n,r.computed||(n.member=!0),r}function CFt(t){const e=new nd(K3t);return e.properties=t,e}function rve(t,e,n){const r=new nd(Z3t);return r.key=e,r.value=n,r.kind=t,r}function OFt(t,e){const n=new nd(J3t);return n.operator=t,n.argument=e,n.prefix=!0,n}function Zn(t,e){var n,r=Array.prototype.slice.call(arguments,2),i=e.replace(/%(\d)/g,(o,s)=>(QB(s":case"<=":case">=":case"instanceof":case"in":e=7;break;case"<<":case">>":case">>>":e=8;break;case"+":case"-":e=9;break;case"*":case"/":case"%":e=11;break}return e}function FFt(){var t,e,n,r,i,o,s,a,l,c;if(t=xr,l=M3(),r=xr,i=sve(r),i===0)return l;for(r.prec=i,il(),e=[t,xr],s=M3(),o=[l,r,s];(i=sve(xr))>0;){for(;o.length>2&&i<=o[o.length-2].prec;)s=o.pop(),a=o.pop().value,l=o.pop(),e.pop(),n=tve(a,l,s),o.push(n);r=il(),r.prec=i,o.push(r),e.push(xr),n=M3(),o.push(n)}for(c=o.length-1,n=o[c],e.pop();c>1;)e.pop(),n=tve(o[c-1].value,o[c-2],n),c-=2;return n}function x1(){var t,e,n;return t=FFt(),Zr("?")&&(il(),e=x1(),ea(":"),n=x1(),t=SFt(t,e,n)),t}function yoe(){const t=x1();if(Zr(","))throw new Error(jA);return t}function xoe(t){Pt=t,ze=0,Js=Pt.length,xr=null,U5e();const e=yoe();if(xr.type!==AR)throw new Error("Unexpect token after expression.");return e}var W5e={NaN:"NaN",E:"Math.E",LN2:"Math.LN2",LN10:"Math.LN10",LOG2E:"Math.LOG2E",LOG10E:"Math.LOG10E",PI:"Math.PI",SQRT1_2:"Math.SQRT1_2",SQRT2:"Math.SQRT2",MIN_VALUE:"Number.MIN_VALUE",MAX_VALUE:"Number.MAX_VALUE"};function V5e(t){function e(s,a,l,c){let u=t(a[0]);return l&&(u=l+"("+u+")",l.lastIndexOf("new ",0)===0&&(u="("+u+")")),u+"."+s+(c<0?"":c===0?"()":"("+a.slice(1).map(t).join(",")+")")}function n(s,a,l){return c=>e(s,c,a,l)}const r="new Date",i="String",o="RegExp";return{isNaN:"Number.isNaN",isFinite:"Number.isFinite",abs:"Math.abs",acos:"Math.acos",asin:"Math.asin",atan:"Math.atan",atan2:"Math.atan2",ceil:"Math.ceil",cos:"Math.cos",exp:"Math.exp",floor:"Math.floor",hypot:"Math.hypot",log:"Math.log",max:"Math.max",min:"Math.min",pow:"Math.pow",random:"Math.random",round:"Math.round",sin:"Math.sin",sqrt:"Math.sqrt",tan:"Math.tan",clamp:function(s){s.length<3&&je("Missing arguments to clamp function."),s.length>3&&je("Too many arguments to clamp function.");const a=s.map(t);return"Math.max("+a[1]+", Math.min("+a[2]+","+a[0]+"))"},now:"Date.now",utc:"Date.UTC",datetime:r,date:n("getDate",r,0),day:n("getDay",r,0),year:n("getFullYear",r,0),month:n("getMonth",r,0),hours:n("getHours",r,0),minutes:n("getMinutes",r,0),seconds:n("getSeconds",r,0),milliseconds:n("getMilliseconds",r,0),time:n("getTime",r,0),timezoneoffset:n("getTimezoneOffset",r,0),utcdate:n("getUTCDate",r,0),utcday:n("getUTCDay",r,0),utcyear:n("getUTCFullYear",r,0),utcmonth:n("getUTCMonth",r,0),utchours:n("getUTCHours",r,0),utcminutes:n("getUTCMinutes",r,0),utcseconds:n("getUTCSeconds",r,0),utcmilliseconds:n("getUTCMilliseconds",r,0),length:n("length",null,-1),parseFloat:"parseFloat",parseInt:"parseInt",upper:n("toUpperCase",i,0),lower:n("toLowerCase",i,0),substring:n("substring",i),split:n("split",i),trim:n("trim",i,0),regexp:o,test:n("test",o),if:function(s){s.length<3&&je("Missing arguments to if function."),s.length>3&&je("Too many arguments to if function.");const a=s.map(t);return"("+a[0]+"?"+a[1]+":"+a[2]+")"}}}function NFt(t){const e=t&&t.length-1;return e&&(t[0]==='"'&&t[e]==='"'||t[0]==="'"&&t[e]==="'")?t.slice(1,-1):t}function G5e(t){t=t||{};const e=t.allowed?Wf(t.allowed):{},n=t.forbidden?Wf(t.forbidden):{},r=t.constants||W5e,i=(t.functions||V5e)(f),o=t.globalvar,s=t.fieldvar,a=fn(o)?o:p=>`${o}["${p}"]`;let l={},c={},u=0;function f(p){if(gt(p))return p;const g=d[p.type];return g==null&&je("Unsupported type: "+p.type),g(p)}const d={Literal:p=>p.raw,Identifier:p=>{const g=p.name;return u>0?g:vt(n,g)?je("Illegal identifier: "+g):vt(r,g)?r[g]:vt(e,g)?g:(l[g]=1,a(g))},MemberExpression:p=>{const g=!p.computed,m=f(p.object);g&&(u+=1);const v=f(p.property);return m===s&&(c[NFt(v)]=1),g&&(u-=1),m+(g?"."+v:"["+v+"]")},CallExpression:p=>{p.callee.type!=="Identifier"&&je("Illegal callee type: "+p.callee.type);const g=p.callee.name,m=p.arguments,v=vt(i,g)&&i[g];return v||je("Unrecognized function: "+g),fn(v)?v(m):v+"("+m.map(f).join(",")+")"},ArrayExpression:p=>"["+p.elements.map(f).join(",")+"]",BinaryExpression:p=>"("+f(p.left)+" "+p.operator+" "+f(p.right)+")",UnaryExpression:p=>"("+p.operator+f(p.argument)+")",ConditionalExpression:p=>"("+f(p.test)+"?"+f(p.consequent)+":"+f(p.alternate)+")",LogicalExpression:p=>"("+f(p.left)+p.operator+f(p.right)+")",ObjectExpression:p=>"{"+p.properties.map(f).join(",")+"}",Property:p=>{u+=1;const g=f(p.key);return u-=1,g+":"+f(p.value)}};function h(p){const g={code:f(p),globals:Object.keys(l),fields:Object.keys(c)};return l={},c={},g}return h.functions=i,h.constants=r,h}const ave=Symbol("vega_selection_getter");function H5e(t){return(!t.getter||!t.getter[ave])&&(t.getter=Eu(t.field),t.getter[ave]=!0),t.getter}const boe="intersect",lve="union",zFt="vlMulti",jFt="vlPoint",cve="or",BFt="and",Ld="_vgsid_",UA=Eu(Ld),UFt="E",WFt="R",VFt="R-E",GFt="R-LE",HFt="R-RE",k5="index:unit";function uve(t,e){for(var n=e.fields,r=e.values,i=n.length,o=0,s,a;ocn(e.fields?{values:e.fields.map(r=>H5e(r)(n.datum))}:{[Ld]:UA(n.datum)},e))}function ZFt(t,e,n,r){for(var i=this.context.data[t],o=i?i.values.value:[],s={},a={},l={},c,u,f,d,h,p,g,m,v,y,x=o.length,b=0,w,_;b(S[u[k].field]=O,S),{})))}else h=Ld,p=UA(c),g=s[h]||(s[h]={}),m=g[d]||(g[d]=[]),m.push(p),n&&(m=a[d]||(a[d]=[]),m.push({[Ld]:p}));if(e=e||lve,s[Ld]?s[Ld]=RV[`${Ld}_${e}`](...Object.values(s[Ld])):Object.keys(s).forEach(S=>{s[S]=Object.keys(s[S]).map(O=>s[S][O]).reduce((O,k)=>O===void 0?k:RV[`${l[S]}_${e}`](O,k))}),o=Object.keys(a),n&&o.length){const S=r?jFt:zFt;s[S]=e===lve?{[cve]:o.reduce((O,k)=>(O.push(...a[k]),O),[])}:{[BFt]:o.map(O=>({[cve]:a[O]}))}}return s}var RV={[`${Ld}_union`]:WSt,[`${Ld}_intersect`]:BSt,E_union:function(t,e){if(!t.length)return e;for(var n=0,r=e.length;ne.indexOf(n)>=0):e},R_union:function(t,e){var n=Ys(e[0]),r=Ys(e[1]);return n>r&&(n=e[1],r=e[0]),t.length?(t[0]>n&&(t[0]=n),t[1]r&&(n=e[1],r=e[0]),t.length?rr&&(t[1]=r),t):[n,r]}};const JFt=":",eNt="@";function woe(t,e,n,r){e[0].type!==v1&&je("First argument to selection functions must be a string literal.");const i=e[0].value,o=e.length>=2&&$n(e).value,s="unit",a=eNt+s,l=JFt+i;o===boe&&!vt(r,a)&&(r[a]=n.getData(i).indataRef(n,s)),vt(r,l)||(r[l]=n.getData(i).tuplesRef())}function X5e(t){const e=this.context.data[t];return e?e.values.value:[]}function tNt(t,e,n){const r=this.context.data[t]["index:"+e],i=r?r.value.get(n):void 0;return i&&i.count}function nNt(t,e){const n=this.context.dataflow,r=this.context.data[t],i=r.input;return n.pulse(i,n.changeset().remove(Tu).insert(e)),1}function rNt(t,e,n){if(t){const r=this.context.dataflow,i=t.mark.source;r.pulse(i,r.changeset().encode(t,e))}return n!==void 0?n:t}const RR=t=>function(e,n){const r=this.context.dataflow.locale();return e===null?"null":r[t](n)(e)},iNt=RR("format"),Y5e=RR("timeFormat"),oNt=RR("utcFormat"),sNt=RR("timeParse"),aNt=RR("utcParse"),ZI=new Date(2e3,0,1);function ZB(t,e,n){return!Number.isInteger(t)||!Number.isInteger(e)?"":(ZI.setYear(2e3),ZI.setMonth(t),ZI.setDate(e),Y5e.call(this,ZI,n))}function lNt(t){return ZB.call(this,t,1,"%B")}function cNt(t){return ZB.call(this,t,1,"%b")}function uNt(t){return ZB.call(this,0,2+t,"%A")}function fNt(t){return ZB.call(this,0,2+t,"%a")}const dNt=":",hNt="@",aY="%",Q5e="$";function _oe(t,e,n,r){e[0].type!==v1&&je("First argument to data functions must be a string literal.");const i=e[0].value,o=dNt+i;if(!vt(o,r))try{r[o]=n.getData(i).tuplesRef()}catch{}}function pNt(t,e,n,r){e[0].type!==v1&&je("First argument to indata must be a string literal."),e[1].type!==v1&&je("Second argument to indata must be a string literal.");const i=e[0].value,o=e[1].value,s=hNt+o;vt(s,r)||(r[s]=n.getData(i).indataRef(n,o))}function Ta(t,e,n,r){if(e[0].type===v1)fve(n,r,e[0].value);else for(t in n.scales)fve(n,r,t)}function fve(t,e,n){const r=aY+n;if(!vt(e,r))try{e[r]=t.scaleRef(n)}catch{}}function Hh(t,e){if(fn(t))return t;if(gt(t)){const n=e.scales[t];return n&&Okt(n.value)?n.value:void 0}}function gNt(t,e,n){e.__bandwidth=i=>i&&i.bandwidth?i.bandwidth():0,n._bandwidth=Ta,n._range=Ta,n._scale=Ta;const r=i=>"_["+(i.type===v1?rt(aY+i.value):rt(aY)+"+"+t(i))+"]";return{_bandwidth:i=>`this.__bandwidth(${r(i[0])})`,_range:i=>`${r(i[0])}.range()`,_scale:i=>`${r(i[0])}(${t(i[1])})`}}function Soe(t,e){return function(n,r,i){if(n){const o=Hh(n,(i||this).context);return o&&o.path[t](r)}else return e(r)}}const mNt=Soe("area",jRt),vNt=Soe("bounds",VRt),yNt=Soe("centroid",QRt);function xNt(t,e){const n=Hh(t,(e||this).context);return n&&n.scale()}function bNt(t){const e=this.context.group;let n=!1;if(e)for(;t;){if(t===e){n=!0;break}t=t.mark.group}return n}function Coe(t,e,n){try{t[e].apply(t,["EXPRESSION"].concat([].slice.call(n)))}catch(r){t.warn(r)}return n[n.length-1]}function wNt(){return Coe(this.context.dataflow,"warn",arguments)}function _Nt(){return Coe(this.context.dataflow,"info",arguments)}function SNt(){return Coe(this.context.dataflow,"debug",arguments)}function DV(t){const e=t/255;return e<=.03928?e/12.92:Math.pow((e+.055)/1.055,2.4)}function lY(t){const e=ay(t),n=DV(e.r),r=DV(e.g),i=DV(e.b);return .2126*n+.7152*r+.0722*i}function CNt(t,e){const n=lY(t),r=lY(e),i=Math.max(n,r),o=Math.min(n,r);return(i+.05)/(o+.05)}function ONt(){const t=[].slice.call(arguments);return t.unshift({}),cn(...t)}function K5e(t,e){return t===e||t!==t&&e!==e?!0:We(t)?We(e)&&t.length===e.length?ENt(t,e):!1:ht(t)&&ht(e)?Z5e(t,e):!1}function ENt(t,e){for(let n=0,r=t.length;nZ5e(t,e)}function TNt(t,e,n,r,i,o){const s=this.context.dataflow,a=this.context.data[t],l=a.input,c=s.stamp();let u=a.changes,f,d;if(s._trigger===!1||!(l.value.length||e||r))return 0;if((!u||u.stamp{a.modified=!0,s.pulse(l,u).run()},!0,1)),n&&(f=n===!0?Tu:We(n)||rB(n)?n:dve(n),u.remove(f)),e&&u.insert(e),r&&(f=dve(r),l.value.some(f)?u.remove(f):u.insert(r)),i)for(d in o)u.modify(i,d,o[d]);return 1}function kNt(t){const e=t.touches,n=e[0].clientX-e[1].clientX,r=e[0].clientY-e[1].clientY;return Math.hypot(n,r)}function ANt(t){const e=t.touches;return Math.atan2(e[0].clientY-e[1].clientY,e[0].clientX-e[1].clientX)}const hve={};function PNt(t,e){const n=hve[e]||(hve[e]=Eu(e));return We(t)?t.map(n):n(t)}function Ooe(t){return We(t)||ArrayBuffer.isView(t)?t:null}function Eoe(t){return Ooe(t)||(gt(t)?t:null)}function MNt(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r1?e-1:0),r=1;r1?e-1:0),r=1;r1?e-1:0),r=1;ro.stop(c(u),t(u))),o}function GNt(t,e,n){const r=Hh(t,(n||this).context);return function(i){return r?r.path.context(i)(e):""}}function HNt(t){let e=null;return function(n){return n?RA(n,e=e||jS(t)):t}}const J5e=t=>t.data;function eze(t,e){const n=X5e.call(e,t);return n.root&&n.root.lookup||{}}function qNt(t,e,n){const r=eze(t,this),i=r[e],o=r[n];return i&&o?i.path(o).map(J5e):void 0}function XNt(t,e){const n=eze(t,this)[e];return n?n.ancestors().map(J5e):void 0}const tze=()=>typeof window<"u"&&window||null;function YNt(){const t=tze();return t?t.screen:{}}function QNt(){const t=tze();return t?[t.innerWidth,t.innerHeight]:[void 0,void 0]}function KNt(){const t=this.context.dataflow,e=t.container&&t.container();return e?[e.clientWidth,e.clientHeight]:[void 0,void 0]}function nze(t,e,n){if(!t)return[];const[r,i]=t,o=new fo().set(r[0],r[1],i[0],i[1]),s=n||this.context.dataflow.scenegraph().root;return zFe(s,o,ZNt(e))}function ZNt(t){let e=null;if(t){const n=pt(t.marktype),r=pt(t.markname);e=i=>(!n.length||n.some(o=>i.marktype===o))&&(!r.length||r.some(o=>i.name===o))}return e}function JNt(t,e,n){let r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:5;t=pt(t);const i=t[t.length-1];return i===void 0||Math.hypot(i[0]-e,i[1]-n)>r?[...t,[e,n]]:t}function e5t(t){return pt(t).reduce((e,n,r)=>{let[i,o]=n;return e+=r==0?`M ${i},${o} `:r===t.length-1?" Z":`L ${i},${o} `},"")}function t5t(t,e,n){const{x:r,y:i,mark:o}=n,s=new fo().set(Number.MAX_SAFE_INTEGER,Number.MAX_SAFE_INTEGER,Number.MIN_SAFE_INTEGER,Number.MIN_SAFE_INTEGER);for(const[l,c]of e)ls.x2&&(s.x2=l),cs.y2&&(s.y2=c);return s.translate(r,i),nze([[s.x1,s.y1],[s.x2,s.y2]],t,o).filter(l=>n5t(l.x,l.y,e))}function n5t(t,e,n){let r=0;for(let i=0,o=n.length-1;ie!=a>e&&t<(s-l)*(e-c)/(a-c)+l&&r++}return r&1}const WA={random(){return Au()},cumulativeNormal:lB,cumulativeLogNormal:kne,cumulativeUniform:Rne,densityNormal:Sne,densityLogNormal:Tne,densityUniform:Mne,quantileNormal:cB,quantileLogNormal:Ane,quantileUniform:Dne,sampleNormal:aB,sampleLogNormal:Ene,sampleUniform:Pne,isArray:We,isBoolean:By,isDate:Nv,isDefined(t){return t!==void 0},isNumber:Jn,isObject:ht,isRegExp:oIe,isString:gt,isTuple:rB,isValid(t){return t!=null&&t===t},toBoolean:nne,toDate(t){return rne(t)},toNumber:Ys,toString:ine,indexof:RNt,join:MNt,lastindexof:DNt,replace:LNt,reverse:$Nt,slice:INt,flush:rIe,lerp:sIe,merge:ONt,pad:cIe,peek:$n,pluck:PNt,span:nR,inrange:s_,truncate:uIe,rgb:ay,lab:DN,hcl:IN,hsl:MN,luminance:lY,contrast:CNt,sequence:al,format:iNt,utcFormat:oNt,utcParse:aNt,utcOffset:WIe,utcSequence:HIe,timeFormat:Y5e,timeParse:sNt,timeOffset:UIe,timeSequence:GIe,timeUnitSpecifier:MIe,monthFormat:lNt,monthAbbrevFormat:cNt,dayFormat:uNt,dayAbbrevFormat:fNt,quarter:JDe,utcquarter:eIe,week:DIe,utcweek:$Ie,dayofyear:RIe,utcdayofyear:LIe,warn:wNt,info:_Nt,debug:SNt,extent(t){return Eh(t)},inScope:bNt,intersect:nze,clampRange:tIe,pinchDistance:kNt,pinchAngle:ANt,screen:YNt,containerSize:KNt,windowSize:QNt,bandspace:FNt,setdata:nNt,pathShape:HNt,panLinear:YDe,panLog:QDe,panPow:KDe,panSymlog:ZDe,zoomLinear:Qte,zoomLog:Kte,zoomPow:mN,zoomSymlog:Zte,encode:rNt,modify:TNt,lassoAppend:JNt,lassoPath:e5t,intersectLasso:t5t},r5t=["view","item","group","xy","x","y"],i5t="event.vega.",rze="this.",Toe={},ize={forbidden:["_"],allowed:["datum","event","item"],fieldvar:"datum",globalvar:t=>`_[${rt(Q5e+t)}]`,functions:o5t,constants:W5e,visitors:Toe},cY=G5e(ize);function o5t(t){const e=V5e(t);r5t.forEach(n=>e[n]=i5t+n);for(const n in WA)e[n]=rze+n;return cn(e,gNt(t,WA,Toe)),e}function Zi(t,e,n){return arguments.length===1?WA[t]:(WA[t]=e,n&&(Toe[t]=n),cY&&(cY.functions[t]=rze+t),this)}Zi("bandwidth",NNt,Ta);Zi("copy",zNt,Ta);Zi("domain",jNt,Ta);Zi("range",UNt,Ta);Zi("invert",BNt,Ta);Zi("scale",WNt,Ta);Zi("gradient",VNt,Ta);Zi("geoArea",mNt,Ta);Zi("geoBounds",vNt,Ta);Zi("geoCentroid",yNt,Ta);Zi("geoShape",GNt,Ta);Zi("geoScale",xNt,Ta);Zi("indata",tNt,pNt);Zi("data",X5e,_oe);Zi("treePath",qNt,_oe);Zi("treeAncestors",XNt,_oe);Zi("vlSelectionTest",qFt,woe);Zi("vlSelectionIdTest",QFt,woe);Zi("vlSelectionResolve",ZFt,woe);Zi("vlSelectionTuples",KFt);function Mh(t,e){const n={};let r;try{t=gt(t)?t:rt(t)+"",r=xoe(t)}catch{je("Expression parse error: "+t)}r.visit(o=>{if(o.type!==$5e)return;const s=o.callee.name,a=ize.visitors[s];a&&a(s,o.arguments,e,n)});const i=cY(r);return i.globals.forEach(o=>{const s=Q5e+o;!vt(n,s)&&e.getSignal(o)&&(n[s]=e.signalRef(o))}),{$expr:cn({code:i.code},e.options.ast?{ast:r}:null),$fields:i.fields,$params:n}}function s5t(t){const e=this,n=t.operators||[];return t.background&&(e.background=t.background),t.eventConfig&&(e.eventConfig=t.eventConfig),t.locale&&(e.locale=t.locale),n.forEach(r=>e.parseOperator(r)),n.forEach(r=>e.parseOperatorParameters(r)),(t.streams||[]).forEach(r=>e.parseStream(r)),(t.updates||[]).forEach(r=>e.parseUpdate(r)),e.resolve()}const a5t=Wf(["rule"]),pve=Wf(["group","image","rect"]);function l5t(t,e){let n="";return a5t[e]||(t.x2&&(t.x?(pve[e]&&(n+="if(o.x>o.x2)$=o.x,o.x=o.x2,o.x2=$;"),n+="o.width=o.x2-o.x;"):n+="o.x=o.x2-(o.width||0);"),t.xc&&(n+="o.x=o.xc-(o.width||0)/2;"),t.y2&&(t.y?(pve[e]&&(n+="if(o.y>o.y2)$=o.y,o.y=o.y2,o.y2=$;"),n+="o.height=o.y2-o.y;"):n+="o.y=o.y2-(o.height||0);"),t.yc&&(n+="o.y=o.yc-(o.height||0)/2;")),n}function koe(t){return(t+"").toLowerCase()}function c5t(t){return koe(t)==="operator"}function u5t(t){return koe(t)==="collect"}function n2(t,e,n){n.endsWith(";")||(n="return("+n+");");const r=Function(...e.concat(n));return t&&t.functions?r.bind(t.functions):r}function f5t(t,e,n,r){return`((u = ${t}) < (v = ${e}) || u == null) && v != null ? ${n} +`)}function c(f){return f.map(u).join(t)}function u(f){return f==null?"":f instanceof Date?RSt(f):e.test(f+="")?'"'+f.replace(/"/g,'""')+'"':f}return{parse:r,parseRows:i,format:s,formatBody:a,formatRows:l,formatRow:c,formatValue:u}}function ISt(t){return t}function LSt(t){if(t==null)return ISt;var e,n,r=t.scale[0],i=t.scale[1],o=t.translate[0],s=t.translate[1];return function(a,l){l||(e=n=0);var c=2,u=a.length,f=new Array(u);for(f[0]=(e+=a[0])*r+o,f[1]=(n+=a[1])*i+s;c1)r=BSt(t,e,n);else for(i=0,r=new Array(o=t.arcs.length);ie?1:t>=e?0:NaN}function USt(t,e){return t==null||e==null?NaN:et?1:e>=t?0:NaN}function yO(t){let e,n,r;t.length!==2?(e=dh,n=(a,l)=>dh(t(a),l),r=(a,l)=>t(a)-l):(e=t===dh||t===USt?t:WSt,n=t,r=t);function i(a,l,c=0,u=a.length){if(c>>1;n(a[f],l)<0?c=f+1:u=f}while(c>>1;n(a[f],l)<=0?c=f+1:u=f}while(cc&&r(a[f-1],l)>-r(a[f],l)?f-1:f}return{left:i,center:s,right:o}}function WSt(){return 0}function LIe(t){return t===null?NaN:+t}function*VSt(t,e){if(e===void 0)for(let n of t)n!=null&&(n=+n)>=n&&(yield n);else{let n=-1;for(let r of t)(r=e(r,++n,t))!=null&&(r=+r)>=r&&(yield r)}}const $Ie=yO(dh),Mg=$Ie.right,GSt=$Ie.left;yO(LIe).center;function HSt(t,e){let n=0,r,i=0,o=0;if(e===void 0)for(let s of t)s!=null&&(s=+s)>=s&&(r=s-i,i+=r/++n,o+=r*(s-i));else{let s=-1;for(let a of t)(a=e(a,++s,t))!=null&&(a=+a)>=a&&(r=a-i,i+=r/++n,o+=r*(a-i))}if(n>1)return o/(n-1)}function qSt(t,e){const n=HSt(t,e);return n&&Math.sqrt(n)}class Ca{constructor(){this._partials=new Float64Array(32),this._n=0}add(e){const n=this._partials;let r=0;for(let i=0;i0){for(s=e[--n];n>0&&(r=s,i=e[--n],s=r+i,o=i-(s-r),!o););n>0&&(o<0&&e[n-1]<0||o>0&&e[n-1]>0)&&(i=o*2,r=s+i,i==r-s&&(s=r))}return s}}class Tpe extends Map{constructor(e,n=zIe){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:n}}),e!=null)for(const[r,i]of e)this.set(r,i)}get(e){return super.get(Qq(this,e))}has(e){return super.has(Qq(this,e))}set(e,n){return super.set(FIe(this,e),n)}delete(e){return super.delete(NIe(this,e))}}class fN extends Set{constructor(e,n=zIe){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:n}}),e!=null)for(const r of e)this.add(r)}has(e){return super.has(Qq(this,e))}add(e){return super.add(FIe(this,e))}delete(e){return super.delete(NIe(this,e))}}function Qq({_intern:t,_key:e},n){const r=e(n);return t.has(r)?t.get(r):n}function FIe({_intern:t,_key:e},n){const r=e(n);return t.has(r)?t.get(r):(t.set(r,n),n)}function NIe({_intern:t,_key:e},n){const r=e(n);return t.has(r)&&(n=t.get(r),t.delete(r)),n}function zIe(t){return t!==null&&typeof t=="object"?t.valueOf():t}function XSt(t,e){return Array.from(e,n=>t[n])}function YSt(t=dh){if(t===dh)return jIe;if(typeof t!="function")throw new TypeError("compare is not a function");return(e,n)=>{const r=t(e,n);return r||r===0?r:(t(n,n)===0)-(t(e,e)===0)}}function jIe(t,e){return(t==null||!(t>=t))-(e==null||!(e>=e))||(te?1:0)}const QSt=Math.sqrt(50),KSt=Math.sqrt(10),ZSt=Math.sqrt(2);function dN(t,e,n){const r=(e-t)/Math.max(0,n),i=Math.floor(Math.log10(r)),o=r/Math.pow(10,i),s=o>=QSt?10:o>=KSt?5:o>=ZSt?2:1;let a,l,c;return i<0?(c=Math.pow(10,-i)/s,a=Math.round(t*c),l=Math.round(e*c),a/ce&&--l,c=-c):(c=Math.pow(10,i)*s,a=Math.round(t/c),l=Math.round(e/c),a*ce&&--l),l0))return[];if(t===e)return[t];const r=e=i))return[];const a=o-i+1,l=new Array(a);if(r)if(s<0)for(let c=0;c=r)&&(n=r);else{let r=-1;for(let i of t)(i=e(i,++r,t))!=null&&(n=i)&&(n=i)}return n}function Jq(t,e){let n;if(e===void 0)for(const r of t)r!=null&&(n>r||n===void 0&&r>=r)&&(n=r);else{let r=-1;for(let i of t)(i=e(i,++r,t))!=null&&(n>i||n===void 0&&i>=i)&&(n=i)}return n}function BIe(t,e,n=0,r=1/0,i){if(e=Math.floor(e),n=Math.floor(Math.max(0,n)),r=Math.floor(Math.min(t.length-1,r)),!(n<=e&&e<=r))return t;for(i=i===void 0?jIe:YSt(i);r>n;){if(r-n>600){const l=r-n+1,c=e-n+1,u=Math.log(l),f=.5*Math.exp(2*u/3),d=.5*Math.sqrt(u*f*(l-f)/l)*(c-l/2<0?-1:1),h=Math.max(n,Math.floor(e-c*f/l+d)),p=Math.min(r,Math.floor(e+(l-c)*f/l+d));BIe(t,e,h,p,i)}const o=t[e];let s=n,a=r;for(UE(t,n,e),i(t[r],o)>0&&UE(t,n,r);s0;)--a}i(t[n],o)===0?UE(t,n,a):(++a,UE(t,a,r)),a<=e&&(n=a+1),e<=a&&(r=a-1)}return t}function UE(t,e,n){const r=t[e];t[e]=t[n],t[n]=r}function hN(t,e,n){if(t=Float64Array.from(VSt(t,n)),!(!(r=t.length)||isNaN(e=+e))){if(e<=0||r<2)return Jq(t);if(e>=1)return Lx(t);var r,i=(r-1)*e,o=Math.floor(i),s=Lx(BIe(t,o).subarray(0,o+1)),a=Jq(t.subarray(o+1));return s+(a-s)*(i-o)}}function UIe(t,e,n=LIe){if(!(!(r=t.length)||isNaN(e=+e))){if(e<=0||r<2)return+n(t[0],0,t);if(e>=1)return+n(t[r-1],r-1,t);var r,i=(r-1)*e,o=Math.floor(i),s=+n(t[o],o,t),a=+n(t[o+1],o+1,t);return s+(a-s)*(i-o)}}function JSt(t,e){let n=0,r=0;if(e===void 0)for(let i of t)i!=null&&(i=+i)>=i&&(++n,r+=i);else{let i=-1;for(let o of t)(o=e(o,++i,t))!=null&&(o=+o)>=o&&(++n,r+=o)}if(n)return r/n}function WIe(t,e){return hN(t,.5,e)}function*eCt(t){for(const e of t)yield*e}function VIe(t){return Array.from(eCt(t))}function ol(t,e,n){t=+t,e=+e,n=(i=arguments.length)<2?(e=t,t=0,1):i<3?1:+n;for(var r=-1,i=Math.max(0,Math.ceil((e-t)/n))|0,o=new Array(i);++r=1e21?t.toLocaleString("en").replace(/,/g,""):t.toString(10)}function pN(t,e){if((n=(t=e?t.toExponential(e-1):t.toExponential()).indexOf("e"))<0)return null;var n,r=t.slice(0,n);return[r.length>1?r[0]+r.slice(2):r,+t.slice(n+1)]}function AS(t){return t=pN(Math.abs(t)),t?t[1]:NaN}function oCt(t,e){return function(n,r){for(var i=n.length,o=[],s=0,a=t[0],l=0;i>0&&a>0&&(l+a+1>r&&(a=Math.max(1,r-l)),o.push(n.substring(i-=a,i+a)),!((l+=a+1)>r));)a=t[s=(s+1)%t.length];return o.reverse().join(e)}}function sCt(t){return function(e){return e.replace(/[0-9]/g,function(n){return t[+n]})}}var aCt=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function cb(t){if(!(e=aCt.exec(t)))throw new Error("invalid format: "+t);var e;return new wne({fill:e[1],align:e[2],sign:e[3],symbol:e[4],zero:e[5],width:e[6],comma:e[7],precision:e[8]&&e[8].slice(1),trim:e[9],type:e[10]})}cb.prototype=wne.prototype;function wne(t){this.fill=t.fill===void 0?" ":t.fill+"",this.align=t.align===void 0?">":t.align+"",this.sign=t.sign===void 0?"-":t.sign+"",this.symbol=t.symbol===void 0?"":t.symbol+"",this.zero=!!t.zero,this.width=t.width===void 0?void 0:+t.width,this.comma=!!t.comma,this.precision=t.precision===void 0?void 0:+t.precision,this.trim=!!t.trim,this.type=t.type===void 0?"":t.type+""}wne.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(this.width===void 0?"":Math.max(1,this.width|0))+(this.comma?",":"")+(this.precision===void 0?"":"."+Math.max(0,this.precision|0))+(this.trim?"~":"")+this.type};function lCt(t){e:for(var e=t.length,n=1,r=-1,i;n0&&(r=0);break}return r>0?t.slice(0,r)+t.slice(i+1):t}var HIe;function cCt(t,e){var n=pN(t,e);if(!n)return t+"";var r=n[0],i=n[1],o=i-(HIe=Math.max(-8,Math.min(8,Math.floor(i/3)))*3)+1,s=r.length;return o===s?r:o>s?r+new Array(o-s+1).join("0"):o>0?r.slice(0,o)+"."+r.slice(o):"0."+new Array(1-o).join("0")+pN(t,Math.max(0,e+o-1))[0]}function kpe(t,e){var n=pN(t,e);if(!n)return t+"";var r=n[0],i=n[1];return i<0?"0."+new Array(-i).join("0")+r:r.length>i+1?r.slice(0,i+1)+"."+r.slice(i+1):r+new Array(i-r.length+2).join("0")}const Ape={"%":(t,e)=>(t*100).toFixed(e),b:t=>Math.round(t).toString(2),c:t=>t+"",d:iCt,e:(t,e)=>t.toExponential(e),f:(t,e)=>t.toFixed(e),g:(t,e)=>t.toPrecision(e),o:t=>Math.round(t).toString(8),p:(t,e)=>kpe(t*100,e),r:kpe,s:cCt,X:t=>Math.round(t).toString(16).toUpperCase(),x:t=>Math.round(t).toString(16)};function Ppe(t){return t}var Mpe=Array.prototype.map,Rpe=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function qIe(t){var e=t.grouping===void 0||t.thousands===void 0?Ppe:oCt(Mpe.call(t.grouping,Number),t.thousands+""),n=t.currency===void 0?"":t.currency[0]+"",r=t.currency===void 0?"":t.currency[1]+"",i=t.decimal===void 0?".":t.decimal+"",o=t.numerals===void 0?Ppe:sCt(Mpe.call(t.numerals,String)),s=t.percent===void 0?"%":t.percent+"",a=t.minus===void 0?"−":t.minus+"",l=t.nan===void 0?"NaN":t.nan+"";function c(f){f=cb(f);var d=f.fill,h=f.align,p=f.sign,g=f.symbol,m=f.zero,v=f.width,y=f.comma,x=f.precision,b=f.trim,w=f.type;w==="n"?(y=!0,w="g"):Ape[w]||(x===void 0&&(x=12),b=!0,w="g"),(m||d==="0"&&h==="=")&&(m=!0,d="0",h="=");var _=g==="$"?n:g==="#"&&/[boxX]/.test(w)?"0"+w.toLowerCase():"",S=g==="$"?r:/[%p]/.test(w)?s:"",O=Ape[w],k=/[defgprs%]/.test(w);x=x===void 0?6:/[gprs]/.test(w)?Math.max(1,Math.min(21,x)):Math.max(0,Math.min(20,x));function E(P){var A=_,R=S,T,M,I;if(w==="c")R=O(P)+R,P="";else{P=+P;var j=P<0||1/P<0;if(P=isNaN(P)?l:O(Math.abs(P),x),b&&(P=lCt(P)),j&&+P==0&&p!=="+"&&(j=!1),A=(j?p==="("?p:a:p==="-"||p==="("?"":p)+A,R=(w==="s"?Rpe[8+HIe/3]:"")+R+(j&&p==="("?")":""),k){for(T=-1,M=P.length;++TI||I>57){R=(I===46?i+P.slice(T+1):P.slice(T))+R,P=P.slice(0,T);break}}}y&&!m&&(P=e(P,1/0));var N=A.length+P.length+R.length,z=N>1)+A+P+R+z.slice(N);break;default:P=z+A+P+R;break}return o(P)}return E.toString=function(){return f+""},E}function u(f,d){var h=c((f=cb(f),f.type="f",f)),p=Math.max(-8,Math.min(8,Math.floor(AS(d)/3)))*3,g=Math.pow(10,-p),m=Rpe[8+p/3];return function(v){return h(g*v)+m}}return{format:c,formatPrefix:u}}var OI,G4,_ne;uCt({thousands:",",grouping:[3],currency:["$",""]});function uCt(t){return OI=qIe(t),G4=OI.format,_ne=OI.formatPrefix,OI}function XIe(t){return Math.max(0,-AS(Math.abs(t)))}function YIe(t,e){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(AS(e)/3)))*3-AS(Math.abs(t)))}function QIe(t,e){return t=Math.abs(t),e=Math.abs(e)-t,Math.max(0,AS(e)-AS(t))+1}const $W=new Date,FW=new Date;function Eo(t,e,n,r){function i(o){return t(o=arguments.length===0?new Date:new Date(+o)),o}return i.floor=o=>(t(o=new Date(+o)),o),i.ceil=o=>(t(o=new Date(o-1)),e(o,1),t(o),o),i.round=o=>{const s=i(o),a=i.ceil(o);return o-s(e(o=new Date(+o),s==null?1:Math.floor(s)),o),i.range=(o,s,a)=>{const l=[];if(o=i.ceil(o),a=a==null?1:Math.floor(a),!(o0))return l;let c;do l.push(c=new Date(+o)),e(o,a),t(o);while(cEo(s=>{if(s>=s)for(;t(s),!o(s);)s.setTime(s-1)},(s,a)=>{if(s>=s)if(a<0)for(;++a<=0;)for(;e(s,-1),!o(s););else for(;--a>=0;)for(;e(s,1),!o(s););}),n&&(i.count=(o,s)=>($W.setTime(+o),FW.setTime(+s),t($W),t(FW),Math.floor(n($W,FW))),i.every=o=>(o=Math.floor(o),!isFinite(o)||!(o>0)?null:o>1?i.filter(r?s=>r(s)%o===0:s=>i.count(0,s)%o===0):i)),i}const PS=Eo(()=>{},(t,e)=>{t.setTime(+t+e)},(t,e)=>e-t);PS.every=t=>(t=Math.floor(t),!isFinite(t)||!(t>0)?null:t>1?Eo(e=>{e.setTime(Math.floor(e/t)*t)},(e,n)=>{e.setTime(+e+n*t)},(e,n)=>(n-e)/t):PS);PS.range;const Vp=1e3,iu=Vp*60,Gp=iu*60,Rg=Gp*24,Sne=Rg*7,Dpe=Rg*30,NW=Rg*365,Hp=Eo(t=>{t.setTime(t-t.getMilliseconds())},(t,e)=>{t.setTime(+t+e*Vp)},(t,e)=>(e-t)/Vp,t=>t.getUTCSeconds());Hp.range;const H4=Eo(t=>{t.setTime(t-t.getMilliseconds()-t.getSeconds()*Vp)},(t,e)=>{t.setTime(+t+e*iu)},(t,e)=>(e-t)/iu,t=>t.getMinutes());H4.range;const q4=Eo(t=>{t.setUTCSeconds(0,0)},(t,e)=>{t.setTime(+t+e*iu)},(t,e)=>(e-t)/iu,t=>t.getUTCMinutes());q4.range;const X4=Eo(t=>{t.setTime(t-t.getMilliseconds()-t.getSeconds()*Vp-t.getMinutes()*iu)},(t,e)=>{t.setTime(+t+e*Gp)},(t,e)=>(e-t)/Gp,t=>t.getHours());X4.range;const Y4=Eo(t=>{t.setUTCMinutes(0,0,0)},(t,e)=>{t.setTime(+t+e*Gp)},(t,e)=>(e-t)/Gp,t=>t.getUTCHours());Y4.range;const rg=Eo(t=>t.setHours(0,0,0,0),(t,e)=>t.setDate(t.getDate()+e),(t,e)=>(e-t-(e.getTimezoneOffset()-t.getTimezoneOffset())*iu)/Rg,t=>t.getDate()-1);rg.range;const Nv=Eo(t=>{t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCDate(t.getUTCDate()+e)},(t,e)=>(e-t)/Rg,t=>t.getUTCDate()-1);Nv.range;const KIe=Eo(t=>{t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCDate(t.getUTCDate()+e)},(t,e)=>(e-t)/Rg,t=>Math.floor(t/Rg));KIe.range;function o1(t){return Eo(e=>{e.setDate(e.getDate()-(e.getDay()+7-t)%7),e.setHours(0,0,0,0)},(e,n)=>{e.setDate(e.getDate()+n*7)},(e,n)=>(n-e-(n.getTimezoneOffset()-e.getTimezoneOffset())*iu)/Sne)}const xO=o1(0),gN=o1(1),fCt=o1(2),dCt=o1(3),MS=o1(4),hCt=o1(5),pCt=o1(6);xO.range;gN.range;fCt.range;dCt.range;MS.range;hCt.range;pCt.range;function s1(t){return Eo(e=>{e.setUTCDate(e.getUTCDate()-(e.getUTCDay()+7-t)%7),e.setUTCHours(0,0,0,0)},(e,n)=>{e.setUTCDate(e.getUTCDate()+n*7)},(e,n)=>(n-e)/Sne)}const bO=s1(0),mN=s1(1),gCt=s1(2),mCt=s1(3),RS=s1(4),vCt=s1(5),yCt=s1(6);bO.range;mN.range;gCt.range;mCt.range;RS.range;vCt.range;yCt.range;const wA=Eo(t=>{t.setDate(1),t.setHours(0,0,0,0)},(t,e)=>{t.setMonth(t.getMonth()+e)},(t,e)=>e.getMonth()-t.getMonth()+(e.getFullYear()-t.getFullYear())*12,t=>t.getMonth());wA.range;const _A=Eo(t=>{t.setUTCDate(1),t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCMonth(t.getUTCMonth()+e)},(t,e)=>e.getUTCMonth()-t.getUTCMonth()+(e.getUTCFullYear()-t.getUTCFullYear())*12,t=>t.getUTCMonth());_A.range;const Ch=Eo(t=>{t.setMonth(0,1),t.setHours(0,0,0,0)},(t,e)=>{t.setFullYear(t.getFullYear()+e)},(t,e)=>e.getFullYear()-t.getFullYear(),t=>t.getFullYear());Ch.every=t=>!isFinite(t=Math.floor(t))||!(t>0)?null:Eo(e=>{e.setFullYear(Math.floor(e.getFullYear()/t)*t),e.setMonth(0,1),e.setHours(0,0,0,0)},(e,n)=>{e.setFullYear(e.getFullYear()+n*t)});Ch.range;const Oh=Eo(t=>{t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCFullYear(t.getUTCFullYear()+e)},(t,e)=>e.getUTCFullYear()-t.getUTCFullYear(),t=>t.getUTCFullYear());Oh.every=t=>!isFinite(t=Math.floor(t))||!(t>0)?null:Eo(e=>{e.setUTCFullYear(Math.floor(e.getUTCFullYear()/t)*t),e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},(e,n)=>{e.setUTCFullYear(e.getUTCFullYear()+n*t)});Oh.range;function ZIe(t,e,n,r,i,o){const s=[[Hp,1,Vp],[Hp,5,5*Vp],[Hp,15,15*Vp],[Hp,30,30*Vp],[o,1,iu],[o,5,5*iu],[o,15,15*iu],[o,30,30*iu],[i,1,Gp],[i,3,3*Gp],[i,6,6*Gp],[i,12,12*Gp],[r,1,Rg],[r,2,2*Rg],[n,1,Sne],[e,1,Dpe],[e,3,3*Dpe],[t,1,NW]];function a(c,u,f){const d=um).right(s,d);if(h===s.length)return t.every(ny(c/NW,u/NW,f));if(h===0)return PS.every(Math.max(ny(c,u,f),1));const[p,g]=s[d/s[h-1][2](t[e]=1+n,t),{});function One(t){const e=pt(t).slice(),n={};return e.length||je("Missing time unit."),e.forEach(i=>{vt(zW,i)?n[i]=1:je(`Invalid time unit: ${i}.`)}),(n[wo]||n[Gs]?1:0)+(n[bl]||n[Qs]||n[wl]?1:0)+(n[Eh]?1:0)>1&&je(`Incompatible time units: ${t}`),e.sort((i,o)=>zW[i]-zW[o]),e}const SCt={[xs]:"%Y ",[bl]:"Q%q ",[Qs]:"%b ",[wl]:"%d ",[wo]:"W%U ",[Gs]:"%a ",[Eh]:"%j ",[Cc]:"%H:00",[Oc]:"00:%M",[ku]:":%S",[Vf]:".%L",[`${xs}-${Qs}`]:"%Y-%m ",[`${xs}-${Qs}-${wl}`]:"%Y-%m-%d ",[`${Cc}-${Oc}`]:"%H:%M"};function JIe(t,e){const n=cn({},SCt,e),r=One(t),i=r.length;let o="",s=0,a,l;for(s=0;ss;--a)if(l=r.slice(s,a).join("-"),n[l]!=null){o+=n[l],s=a;break}return o.trim()}const Y0=new Date;function Ene(t){return Y0.setFullYear(t),Y0.setMonth(0),Y0.setDate(1),Y0.setHours(0,0,0,0),Y0}function eLe(t){return nLe(new Date(t))}function tLe(t){return eX(new Date(t))}function nLe(t){return rg.count(Ene(t.getFullYear())-1,t)}function eX(t){return xO.count(Ene(t.getFullYear())-1,t)}function tX(t){return Ene(t).getDay()}function CCt(t,e,n,r,i,o,s){if(0<=t&&t<100){const a=new Date(-1,e,n,r,i,o,s);return a.setFullYear(t),a}return new Date(t,e,n,r,i,o,s)}function rLe(t){return oLe(new Date(t))}function iLe(t){return nX(new Date(t))}function oLe(t){const e=Date.UTC(t.getUTCFullYear(),0,1);return Nv.count(e-1,t)}function nX(t){const e=Date.UTC(t.getUTCFullYear(),0,1);return bO.count(e-1,t)}function rX(t){return Y0.setTime(Date.UTC(t,0,1)),Y0.getUTCDay()}function OCt(t,e,n,r,i,o,s){if(0<=t&&t<100){const a=new Date(Date.UTC(-1,e,n,r,i,o,s));return a.setUTCFullYear(n.y),a}return new Date(Date.UTC(t,e,n,r,i,o,s))}function sLe(t,e,n,r,i){const o=e||1,s=$n(t),a=(v,y,x)=>(x=x||v,ECt(n[x],r[x],v===s&&o,y)),l=new Date,c=Wf(t),u=c[xs]?a(xs):ta(2012),f=c[Qs]?a(Qs):c[bl]?a(bl):nv,d=c[wo]&&c[Gs]?a(Gs,1,wo+Gs):c[wo]?a(wo,1):c[Gs]?a(Gs,1):c[wl]?a(wl,1):c[Eh]?a(Eh,1):pO,h=c[Cc]?a(Cc):nv,p=c[Oc]?a(Oc):nv,g=c[ku]?a(ku):nv,m=c[Vf]?a(Vf):nv;return function(v){l.setTime(+v);const y=u(l);return i(y,f(l),d(l,y),h(l),p(l),g(l),m(l))}}function ECt(t,e,n,r){const i=n<=1?t:r?(o,s)=>r+n*Math.floor((t(o,s)-r)/n):(o,s)=>n*Math.floor(t(o,s)/n);return e?(o,s)=>e(i(o,s),s):i}function DS(t,e,n){return e+t*7-(n+6)%7}const TCt={[xs]:t=>t.getFullYear(),[bl]:t=>Math.floor(t.getMonth()/3),[Qs]:t=>t.getMonth(),[wl]:t=>t.getDate(),[Cc]:t=>t.getHours(),[Oc]:t=>t.getMinutes(),[ku]:t=>t.getSeconds(),[Vf]:t=>t.getMilliseconds(),[Eh]:t=>nLe(t),[wo]:t=>eX(t),[wo+Gs]:(t,e)=>DS(eX(t),t.getDay(),tX(e)),[Gs]:(t,e)=>DS(1,t.getDay(),tX(e))},kCt={[bl]:t=>3*t,[wo]:(t,e)=>DS(t,0,tX(e))};function aLe(t,e){return sLe(t,e||1,TCt,kCt,CCt)}const ACt={[xs]:t=>t.getUTCFullYear(),[bl]:t=>Math.floor(t.getUTCMonth()/3),[Qs]:t=>t.getUTCMonth(),[wl]:t=>t.getUTCDate(),[Cc]:t=>t.getUTCHours(),[Oc]:t=>t.getUTCMinutes(),[ku]:t=>t.getUTCSeconds(),[Vf]:t=>t.getUTCMilliseconds(),[Eh]:t=>oLe(t),[wo]:t=>nX(t),[Gs]:(t,e)=>DS(1,t.getUTCDay(),rX(e)),[wo+Gs]:(t,e)=>DS(nX(t),t.getUTCDay(),rX(e))},PCt={[bl]:t=>3*t,[wo]:(t,e)=>DS(t,0,rX(e))};function lLe(t,e){return sLe(t,e||1,ACt,PCt,OCt)}const MCt={[xs]:Ch,[bl]:wA.every(3),[Qs]:wA,[wo]:xO,[wl]:rg,[Gs]:rg,[Eh]:rg,[Cc]:X4,[Oc]:H4,[ku]:Hp,[Vf]:PS},RCt={[xs]:Oh,[bl]:_A.every(3),[Qs]:_A,[wo]:bO,[wl]:Nv,[Gs]:Nv,[Eh]:Nv,[Cc]:Y4,[Oc]:q4,[ku]:Hp,[Vf]:PS};function wO(t){return MCt[t]}function _O(t){return RCt[t]}function cLe(t,e,n){return t?t.offset(e,n):void 0}function uLe(t,e,n){return cLe(wO(t),e,n)}function fLe(t,e,n){return cLe(_O(t),e,n)}function dLe(t,e,n,r){return t?t.range(e,n,r):void 0}function hLe(t,e,n,r){return dLe(wO(t),e,n,r)}function pLe(t,e,n,r){return dLe(_O(t),e,n,r)}const eT=1e3,tT=eT*60,nT=tT*60,Q4=nT*24,DCt=Q4*7,Ipe=Q4*30,iX=Q4*365,gLe=[xs,Qs,wl,Cc,Oc,ku,Vf],rT=gLe.slice(0,-1),iT=rT.slice(0,-1),oT=iT.slice(0,-1),ICt=oT.slice(0,-1),LCt=[xs,wo],Lpe=[xs,Qs],mLe=[xs],WE=[[rT,1,eT],[rT,5,5*eT],[rT,15,15*eT],[rT,30,30*eT],[iT,1,tT],[iT,5,5*tT],[iT,15,15*tT],[iT,30,30*tT],[oT,1,nT],[oT,3,3*nT],[oT,6,6*nT],[oT,12,12*nT],[ICt,1,Q4],[LCt,1,DCt],[Lpe,1,Ipe],[Lpe,3,3*Ipe],[mLe,1,iX]];function vLe(t){const e=t.extent,n=t.maxbins||40,r=Math.abs(tR(e))/n;let i=yO(a=>a[2]).right(WE,r),o,s;return i===WE.length?(o=mLe,s=ny(e[0]/iX,e[1]/iX,n)):i?(i=WE[r/WE[i-1][2]53)return null;"w"in te||(te.w=1),"Z"in te?(U=BW(VE(te.y,0,1)),oe=U.getUTCDay(),U=oe>4||oe===0?mN.ceil(U):mN(U),U=Nv.offset(U,(te.V-1)*7),te.y=U.getUTCFullYear(),te.m=U.getUTCMonth(),te.d=U.getUTCDate()+(te.w+6)%7):(U=jW(VE(te.y,0,1)),oe=U.getDay(),U=oe>4||oe===0?gN.ceil(U):gN(U),U=rg.offset(U,(te.V-1)*7),te.y=U.getFullYear(),te.m=U.getMonth(),te.d=U.getDate()+(te.w+6)%7)}else("W"in te||"U"in te)&&("w"in te||(te.w="u"in te?te.u%7:"W"in te?1:0),oe="Z"in te?BW(VE(te.y,0,1)).getUTCDay():jW(VE(te.y,0,1)).getDay(),te.m=0,te.d="W"in te?(te.w+6)%7+te.W*7-(oe+5)%7:te.w+te.U*7-(oe+6)%7);return"Z"in te?(te.H+=te.Z/100|0,te.M+=te.Z%100,BW(te)):jW(te)}}function O(ee,re,ge,te){for(var ae=0,U=re.length,oe=ge.length,ne,V;ae=oe)return-1;if(ne=re.charCodeAt(ae++),ne===37){if(ne=re.charAt(ae++),V=w[ne in $pe?re.charAt(ae++):ne],!V||(te=V(ee,ge,te))<0)return-1}else if(ne!=ge.charCodeAt(te++))return-1}return te}function k(ee,re,ge){var te=c.exec(re.slice(ge));return te?(ee.p=u.get(te[0].toLowerCase()),ge+te[0].length):-1}function E(ee,re,ge){var te=h.exec(re.slice(ge));return te?(ee.w=p.get(te[0].toLowerCase()),ge+te[0].length):-1}function P(ee,re,ge){var te=f.exec(re.slice(ge));return te?(ee.w=d.get(te[0].toLowerCase()),ge+te[0].length):-1}function A(ee,re,ge){var te=v.exec(re.slice(ge));return te?(ee.m=y.get(te[0].toLowerCase()),ge+te[0].length):-1}function R(ee,re,ge){var te=g.exec(re.slice(ge));return te?(ee.m=m.get(te[0].toLowerCase()),ge+te[0].length):-1}function T(ee,re,ge){return O(ee,e,re,ge)}function M(ee,re,ge){return O(ee,n,re,ge)}function I(ee,re,ge){return O(ee,r,re,ge)}function j(ee){return s[ee.getDay()]}function N(ee){return o[ee.getDay()]}function z(ee){return l[ee.getMonth()]}function L(ee){return a[ee.getMonth()]}function B(ee){return i[+(ee.getHours()>=12)]}function F(ee){return 1+~~(ee.getMonth()/3)}function $(ee){return s[ee.getUTCDay()]}function q(ee){return o[ee.getUTCDay()]}function G(ee){return l[ee.getUTCMonth()]}function Y(ee){return a[ee.getUTCMonth()]}function le(ee){return i[+(ee.getUTCHours()>=12)]}function K(ee){return 1+~~(ee.getUTCMonth()/3)}return{format:function(ee){var re=_(ee+="",x);return re.toString=function(){return ee},re},parse:function(ee){var re=S(ee+="",!1);return re.toString=function(){return ee},re},utcFormat:function(ee){var re=_(ee+="",b);return re.toString=function(){return ee},re},utcParse:function(ee){var re=S(ee+="",!0);return re.toString=function(){return ee},re}}}var $pe={"-":"",_:" ",0:"0"},Xo=/^\s*\d+/,$Ct=/^%/,FCt=/[\\^$*+?|[\]().{}]/g;function er(t,e,n){var r=t<0?"-":"",i=(r?-t:t)+"",o=i.length;return r+(o[e.toLowerCase(),n]))}function zCt(t,e,n){var r=Xo.exec(e.slice(n,n+1));return r?(t.w=+r[0],n+r[0].length):-1}function jCt(t,e,n){var r=Xo.exec(e.slice(n,n+1));return r?(t.u=+r[0],n+r[0].length):-1}function BCt(t,e,n){var r=Xo.exec(e.slice(n,n+2));return r?(t.U=+r[0],n+r[0].length):-1}function UCt(t,e,n){var r=Xo.exec(e.slice(n,n+2));return r?(t.V=+r[0],n+r[0].length):-1}function WCt(t,e,n){var r=Xo.exec(e.slice(n,n+2));return r?(t.W=+r[0],n+r[0].length):-1}function Fpe(t,e,n){var r=Xo.exec(e.slice(n,n+4));return r?(t.y=+r[0],n+r[0].length):-1}function Npe(t,e,n){var r=Xo.exec(e.slice(n,n+2));return r?(t.y=+r[0]+(+r[0]>68?1900:2e3),n+r[0].length):-1}function VCt(t,e,n){var r=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(e.slice(n,n+6));return r?(t.Z=r[1]?0:-(r[2]+(r[3]||"00")),n+r[0].length):-1}function GCt(t,e,n){var r=Xo.exec(e.slice(n,n+1));return r?(t.q=r[0]*3-3,n+r[0].length):-1}function HCt(t,e,n){var r=Xo.exec(e.slice(n,n+2));return r?(t.m=r[0]-1,n+r[0].length):-1}function zpe(t,e,n){var r=Xo.exec(e.slice(n,n+2));return r?(t.d=+r[0],n+r[0].length):-1}function qCt(t,e,n){var r=Xo.exec(e.slice(n,n+3));return r?(t.m=0,t.d=+r[0],n+r[0].length):-1}function jpe(t,e,n){var r=Xo.exec(e.slice(n,n+2));return r?(t.H=+r[0],n+r[0].length):-1}function XCt(t,e,n){var r=Xo.exec(e.slice(n,n+2));return r?(t.M=+r[0],n+r[0].length):-1}function YCt(t,e,n){var r=Xo.exec(e.slice(n,n+2));return r?(t.S=+r[0],n+r[0].length):-1}function QCt(t,e,n){var r=Xo.exec(e.slice(n,n+3));return r?(t.L=+r[0],n+r[0].length):-1}function KCt(t,e,n){var r=Xo.exec(e.slice(n,n+6));return r?(t.L=Math.floor(r[0]/1e3),n+r[0].length):-1}function ZCt(t,e,n){var r=$Ct.exec(e.slice(n,n+1));return r?n+r[0].length:-1}function JCt(t,e,n){var r=Xo.exec(e.slice(n));return r?(t.Q=+r[0],n+r[0].length):-1}function eOt(t,e,n){var r=Xo.exec(e.slice(n));return r?(t.s=+r[0],n+r[0].length):-1}function Bpe(t,e){return er(t.getDate(),e,2)}function tOt(t,e){return er(t.getHours(),e,2)}function nOt(t,e){return er(t.getHours()%12||12,e,2)}function rOt(t,e){return er(1+rg.count(Ch(t),t),e,3)}function xLe(t,e){return er(t.getMilliseconds(),e,3)}function iOt(t,e){return xLe(t,e)+"000"}function oOt(t,e){return er(t.getMonth()+1,e,2)}function sOt(t,e){return er(t.getMinutes(),e,2)}function aOt(t,e){return er(t.getSeconds(),e,2)}function lOt(t){var e=t.getDay();return e===0?7:e}function cOt(t,e){return er(xO.count(Ch(t)-1,t),e,2)}function bLe(t){var e=t.getDay();return e>=4||e===0?MS(t):MS.ceil(t)}function uOt(t,e){return t=bLe(t),er(MS.count(Ch(t),t)+(Ch(t).getDay()===4),e,2)}function fOt(t){return t.getDay()}function dOt(t,e){return er(gN.count(Ch(t)-1,t),e,2)}function hOt(t,e){return er(t.getFullYear()%100,e,2)}function pOt(t,e){return t=bLe(t),er(t.getFullYear()%100,e,2)}function gOt(t,e){return er(t.getFullYear()%1e4,e,4)}function mOt(t,e){var n=t.getDay();return t=n>=4||n===0?MS(t):MS.ceil(t),er(t.getFullYear()%1e4,e,4)}function vOt(t){var e=t.getTimezoneOffset();return(e>0?"-":(e*=-1,"+"))+er(e/60|0,"0",2)+er(e%60,"0",2)}function Upe(t,e){return er(t.getUTCDate(),e,2)}function yOt(t,e){return er(t.getUTCHours(),e,2)}function xOt(t,e){return er(t.getUTCHours()%12||12,e,2)}function bOt(t,e){return er(1+Nv.count(Oh(t),t),e,3)}function wLe(t,e){return er(t.getUTCMilliseconds(),e,3)}function wOt(t,e){return wLe(t,e)+"000"}function _Ot(t,e){return er(t.getUTCMonth()+1,e,2)}function SOt(t,e){return er(t.getUTCMinutes(),e,2)}function COt(t,e){return er(t.getUTCSeconds(),e,2)}function OOt(t){var e=t.getUTCDay();return e===0?7:e}function EOt(t,e){return er(bO.count(Oh(t)-1,t),e,2)}function _Le(t){var e=t.getUTCDay();return e>=4||e===0?RS(t):RS.ceil(t)}function TOt(t,e){return t=_Le(t),er(RS.count(Oh(t),t)+(Oh(t).getUTCDay()===4),e,2)}function kOt(t){return t.getUTCDay()}function AOt(t,e){return er(mN.count(Oh(t)-1,t),e,2)}function POt(t,e){return er(t.getUTCFullYear()%100,e,2)}function MOt(t,e){return t=_Le(t),er(t.getUTCFullYear()%100,e,2)}function ROt(t,e){return er(t.getUTCFullYear()%1e4,e,4)}function DOt(t,e){var n=t.getUTCDay();return t=n>=4||n===0?RS(t):RS.ceil(t),er(t.getUTCFullYear()%1e4,e,4)}function IOt(){return"+0000"}function Wpe(){return"%"}function Vpe(t){return+t}function Gpe(t){return Math.floor(+t/1e3)}var H1,Tne,SLe,kne,CLe;LOt({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});function LOt(t){return H1=yLe(t),Tne=H1.format,SLe=H1.parse,kne=H1.utcFormat,CLe=H1.utcParse,H1}function sT(t){const e={};return n=>e[n]||(e[n]=t(n))}function $Ot(t,e){return n=>{const r=t(n),i=r.indexOf(e);if(i<0)return r;let o=FOt(r,i);const s=oi;)if(r[o]!=="0"){++o;break}return r.slice(0,o)+s}}function FOt(t,e){let n=t.lastIndexOf("e"),r;if(n>0)return n;for(n=t.length;--n>e;)if(r=t.charCodeAt(n),r>=48&&r<=57)return n+1}function OLe(t){const e=sT(t.format),n=t.formatPrefix;return{format:e,formatPrefix:n,formatFloat(r){const i=cb(r||",");if(i.precision==null){switch(i.precision=12,i.type){case"%":i.precision-=2;break;case"e":i.precision-=1;break}return $Ot(e(i),e(".1f")(1)[1])}else return e(i)},formatSpan(r,i,o,s){s=cb(s??",f");const a=ny(r,i,o),l=Math.max(Math.abs(r),Math.abs(i));let c;if(s.precision==null)switch(s.type){case"s":return isNaN(c=YIe(a,l))||(s.precision=c),n(s,l);case"":case"e":case"g":case"p":case"r":{isNaN(c=QIe(a,l))||(s.precision=c-(s.type==="e"));break}case"f":case"%":{isNaN(c=XIe(a))||(s.precision=c-(s.type==="%")*2);break}}return e(s)}}}let oX;ELe();function ELe(){return oX=OLe({format:G4,formatPrefix:_ne})}function TLe(t){return OLe(qIe(t))}function vN(t){return arguments.length?oX=TLe(t):oX}function Hpe(t,e,n){n=n||{},ht(n)||je(`Invalid time multi-format specifier: ${n}`);const r=e(ku),i=e(Oc),o=e(Cc),s=e(wl),a=e(wo),l=e(Qs),c=e(bl),u=e(xs),f=t(n[Vf]||".%L"),d=t(n[ku]||":%S"),h=t(n[Oc]||"%I:%M"),p=t(n[Cc]||"%I %p"),g=t(n[wl]||n[Gs]||"%a %d"),m=t(n[wo]||"%b %d"),v=t(n[Qs]||"%B"),y=t(n[bl]||"%B"),x=t(n[xs]||"%Y");return b=>(r(b)gt(r)?e(r):Hpe(e,wO,r),utcFormat:r=>gt(r)?n(r):Hpe(n,_O,r),timeParse:sT(t.parse),utcParse:sT(t.utcParse)}}let sX;ALe();function ALe(){return sX=kLe({format:Tne,parse:SLe,utcFormat:kne,utcParse:CLe})}function PLe(t){return kLe(yLe(t))}function SA(t){return arguments.length?sX=PLe(t):sX}const aX=(t,e)=>cn({},t,e);function MLe(t,e){const n=t?TLe(t):vN(),r=e?PLe(e):SA();return aX(n,r)}function Ane(t,e){const n=arguments.length;return n&&n!==2&&je("defaultLocale expects either zero or two arguments."),n?aX(vN(t),SA(e)):aX(vN(),SA())}function NOt(){return ELe(),ALe(),Ane()}const zOt=/^(data:|([A-Za-z]+:)?\/\/)/,jOt=/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|cid|xmpp|file|data):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i,BOt=/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205f\u3000]/g,qpe="file://";function UOt(t,e){return n=>({options:n||{},sanitize:VOt,load:WOt,fileAccess:!!e,file:GOt(e),http:qOt(t)})}async function WOt(t,e){const n=await this.sanitize(t,e),r=n.href;return n.localFile?this.file(r):this.http(r,e)}async function VOt(t,e){e=cn({},this.options,e);const n=this.fileAccess,r={href:null};let i,o,s;const a=jOt.test(t.replace(BOt,""));(t==null||typeof t!="string"||!a)&&je("Sanitize failure, invalid URI: "+rt(t));const l=zOt.test(t);return(s=e.baseURL)&&!l&&(!t.startsWith("/")&&!s.endsWith("/")&&(t="/"+t),t=s+t),o=(i=t.startsWith(qpe))||e.mode==="file"||e.mode!=="http"&&!l&&n,i?t=t.slice(qpe.length):t.startsWith("//")&&(e.defaultProtocol==="file"?(t=t.slice(2),o=!0):t=(e.defaultProtocol||"http")+":"+t),Object.defineProperty(r,"localFile",{value:!!o}),r.href=t,e.target&&(r.target=e.target+""),e.rel&&(r.rel=e.rel+""),e.context==="image"&&e.crossOrigin&&(r.crossOrigin=e.crossOrigin+""),r}function GOt(t){return t?e=>new Promise((n,r)=>{t.readFile(e,(i,o)=>{i?r(i):n(o)})}):HOt}async function HOt(){je("No file system access.")}function qOt(t){return t?async function(e,n){const r=cn({},this.options.http,n),i=n&&n.response,o=await t(e,r);return o.ok?fn(o[i])?o[i]():o.text():je(o.status+""+o.statusText)}:XOt}async function XOt(){je("No HTTP fetch method available.")}const YOt=t=>t!=null&&t===t,QOt=t=>t==="true"||t==="false"||t===!0||t===!1,KOt=t=>!Number.isNaN(Date.parse(t)),RLe=t=>!Number.isNaN(+t)&&!(t instanceof Date),ZOt=t=>RLe(t)&&Number.isInteger(+t),lX={boolean:yne,integer:qs,number:qs,date:xne,string:bne,unknown:ea},EI=[QOt,ZOt,RLe,KOt],JOt=["boolean","integer","number","date"];function DLe(t,e){if(!t||!t.length)return"unknown";const n=t.length,r=EI.length,i=EI.map((o,s)=>s+1);for(let o=0,s=0,a,l;oo===0?s:o,0)-1]}function ILe(t,e){return e.reduce((n,r)=>(n[r]=DLe(t,r),n),{})}function Xpe(t){const e=function(n,r){const i={delimiter:t};return Pne(n,r?cn(r,i):i)};return e.responseType="text",e}function Pne(t,e){return e.header&&(t=e.header.map(rt).join(e.delimiter)+` +`+t),DSt(e.delimiter).parse(t+"")}Pne.responseType="text";function eEt(t){return typeof Buffer=="function"&&fn(Buffer.isBuffer)?Buffer.isBuffer(t):!1}function Mne(t,e){const n=e&&e.property?Eu(e.property):ea;return ht(t)&&!eEt(t)?tEt(n(t),e):n(JSON.parse(t))}Mne.responseType="json";function tEt(t,e){return!We(t)&&EIe(t)&&(t=[...t]),e&&e.copy?JSON.parse(JSON.stringify(t)):t}const nEt={interior:(t,e)=>t!==e,exterior:(t,e)=>t===e};function LLe(t,e){let n,r,i,o;return t=Mne(t,e),e&&e.feature?(n=FSt,i=e.feature):e&&e.mesh?(n=zSt,i=e.mesh,o=nEt[e.filter]):je("Missing TopoJSON feature or mesh parameter."),r=(r=t.objects[i])?n(t,r,o):je("Invalid TopoJSON object: "+i),r&&r.features||[r]}LLe.responseType="json";const c3={dsv:Pne,csv:Xpe(","),tsv:Xpe(" "),json:Mne,topojson:LLe};function Rne(t,e){return arguments.length>1?(c3[t]=e,this):vt(c3,t)?c3[t]:null}function $Le(t){const e=Rne(t);return e&&e.responseType||"text"}function FLe(t,e,n,r){e=e||{};const i=Rne(e.type||"json");return i||je("Unknown data format type: "+e.type),t=i(t,e),e.parse&&rEt(t,e.parse,n,r),vt(t,"columns")&&delete t.columns,t}function rEt(t,e,n,r){if(!t.length)return;const i=SA();n=n||i.timeParse,r=r||i.utcParse;let o=t.columns||Object.keys(t[0]),s,a,l,c,u,f;e==="auto"&&(e=ILe(t,o)),o=Object.keys(e);const d=o.map(h=>{const p=e[h];let g,m;if(p&&(p.startsWith("date:")||p.startsWith("utc:")))return g=p.split(/:(.+)?/,2),m=g[1],(m[0]==="'"&&m[m.length-1]==="'"||m[0]==='"'&&m[m.length-1]==='"')&&(m=m.slice(1,-1)),(g[0]==="utc"?r:n)(m);if(!lX[p])throw Error("Illegal format pattern: "+h+":"+p);return lX[p]});for(l=0,u=t.length,f=o.length;l{const o=e(i);return r[o]||(r[o]=1,n.push(i)),n},n.remove=i=>{const o=e(i);if(r[o]){r[o]=0;const s=n.indexOf(i);s>=0&&n.splice(s,1)}return n},n}async function u3(t,e){try{await e(t)}catch(n){t.error(n)}}const NLe=Symbol("vega_id");let iEt=1;function J4(t){return!!(t&&jt(t))}function jt(t){return t[NLe]}function zLe(t,e){return t[NLe]=e,t}function cr(t){const e=t===Object(t)?t:{data:t};return jt(e)?e:zLe(e,iEt++)}function Dne(t){return eB(t,cr({}))}function eB(t,e){for(const n in t)e[n]=t[n];return e}function jLe(t,e){return zLe(e,jt(t))}function a1(t,e){return t?e?(n,r)=>t(n,r)||jt(e(n))-jt(e(r)):(n,r)=>t(n,r)||jt(n)-jt(r):null}function BLe(t){return t&&t.constructor===l1}function l1(){const t=[],e=[],n=[],r=[],i=[];let o=null,s=!1;return{constructor:l1,insert(a){const l=pt(a),c=l.length;for(let u=0;u{p(y)&&(c[jt(y)]=-1)});for(f=0,d=t.length;f0&&(v(g,p,h.value),a.modifies(p));for(f=0,d=i.length;f{p(y)&&c[jt(y)]>0&&v(y,h.field,h.value)}),a.modifies(h.field);if(s)a.mod=e.length||r.length?l.filter(y=>c[jt(y)]>0):l.slice();else for(m in u)a.mod.push(u[m]);return(o||o==null&&(e.length||r.length))&&a.clean(!0),a}}}const f3="_:mod:_";function tB(){Object.defineProperty(this,f3,{writable:!0,value:{}})}tB.prototype={set(t,e,n,r){const i=this,o=i[t],s=i[f3];return e!=null&&e>=0?(o[e]!==n||r)&&(o[e]=n,s[e+":"+t]=-1,s[t]=-1):(o!==n||r)&&(i[t]=n,s[t]=We(n)?1+n.length:-1),i},modified(t,e){const n=this[f3];if(arguments.length){if(We(t)){for(let r=0;r=0?e+1{h instanceof Ir?(h!==this&&(e&&h.targets().add(this),o.push(h)),i.push({op:h,name:f,index:d})):r.set(f,d,h)};for(s in t)if(a=t[s],s===sEt)pt(a).forEach(f=>{f instanceof Ir?f!==this&&(f.targets().add(this),o.push(f)):je("Pulse parameters must be operator instances.")}),this.source=a;else if(We(a))for(r.set(s,-1,Array(l=a.length)),c=0;c{const n=Date.now();return n-e>t?(e=n,1):0})},debounce(t){const e=Mm();return this.targets().add(Mm(null,null,mne(t,n=>{const r=n.dataflow;e.receive(n),r&&r.run&&r.run()}))),e},between(t,e){let n=!1;return t.targets().add(Mm(null,null,()=>n=!0)),e.targets().add(Mm(null,null,()=>n=!1)),this.filter(()=>n)},detach(){this._filter=Tu,this._targets=null}};function hEt(t,e,n,r){const i=this,o=Mm(n,r),s=function(c){c.dataflow=i;try{o.receive(c)}catch(u){i.error(u)}finally{i.run()}};let a;typeof t=="string"&&typeof document<"u"?a=document.querySelectorAll(t):a=pt(t);const l=a.length;for(let c=0;ce=r);return n.requests=0,n.done=()=>{--n.requests===0&&(t._pending=null,e(t))},t._pending=n}const xEt={skip:!0};function bEt(t,e,n,r,i){return(t instanceof Ir?_Et:wEt)(this,t,e,n,r,i),this}function wEt(t,e,n,r,i,o){const s=cn({},o,xEt);let a,l;fn(n)||(n=ta(n)),r===void 0?a=c=>t.touch(n(c)):fn(r)?(l=new Ir(null,r,i,!1),a=c=>{l.evaluate(c);const u=n(c),f=l.value;BLe(f)?t.pulse(u,f,o):t.update(u,f,s)}):a=c=>t.update(n(c),r,s),e.apply(a)}function _Et(t,e,n,r,i,o){if(r===void 0)e.targets().add(n);else{const s=o||{},a=new Ir(null,SEt(n,r),i,!1);a.modified(s.force),a.rank=e.rank,e.targets().add(a),n&&(a.skip(!0),a.value=n.value,a.targets().add(n),t.connect(n,[a]))}}function SEt(t,e){return e=fn(e)?e:ta(e),t?function(n,r){const i=e(n,r);return t.skip()||(t.skip(i!==this.value).value=i),i}:e}function CEt(t){t.rank=++this._rank}function OEt(t){const e=[t];let n,r,i;for(;e.length;)if(this.rank(n=e.pop()),r=n._targets)for(i=r.length;--i>=0;)e.push(n=r[i]),n===t&&je("Cycle detected in dataflow graph.")}const yN={},kd=1,Hm=2,Ep=4,EEt=kd|Hm,Qpe=kd|Ep,q1=kd|Hm|Ep,Kpe=8,qE=16,Zpe=32,Jpe=64;function zv(t,e,n){this.dataflow=t,this.stamp=e??-1,this.add=[],this.rem=[],this.mod=[],this.fields=null,this.encode=n||null}function UW(t,e){const n=[];return Gm(t,e,r=>n.push(r)),n}function ege(t,e){const n={};return t.visit(e,r=>{n[jt(r)]=1}),r=>n[jt(r)]?null:r}function TI(t,e){return t?(n,r)=>t(n,r)&&e(n,r):e}zv.prototype={StopPropagation:yN,ADD:kd,REM:Hm,MOD:Ep,ADD_REM:EEt,ADD_MOD:Qpe,ALL:q1,REFLOW:Kpe,SOURCE:qE,NO_SOURCE:Zpe,NO_FIELDS:Jpe,fork(t){return new zv(this.dataflow).init(this,t)},clone(){const t=this.fork(q1);return t.add=t.add.slice(),t.rem=t.rem.slice(),t.mod=t.mod.slice(),t.source&&(t.source=t.source.slice()),t.materialize(q1|qE)},addAll(){let t=this;return!t.source||t.add===t.rem||!t.rem.length&&t.source.length===t.add.length||(t=new zv(this.dataflow).init(this),t.add=t.source,t.rem=[]),t},init(t,e){const n=this;return n.stamp=t.stamp,n.encode=t.encode,t.fields&&!(e&Jpe)&&(n.fields=t.fields),e&kd?(n.addF=t.addF,n.add=t.add):(n.addF=null,n.add=[]),e&Hm?(n.remF=t.remF,n.rem=t.rem):(n.remF=null,n.rem=[]),e&Ep?(n.modF=t.modF,n.mod=t.mod):(n.modF=null,n.mod=[]),e&Zpe?(n.srcF=null,n.source=null):(n.srcF=t.srcF,n.source=t.source,t.cleans&&(n.cleans=t.cleans)),n},runAfter(t){this.dataflow.runAfter(t)},changed(t){const e=t||q1;return e&kd&&this.add.length||e&Hm&&this.rem.length||e&Ep&&this.mod.length},reflow(t){if(t)return this.fork(q1).reflow();const e=this.add.length,n=this.source&&this.source.length;return n&&n!==e&&(this.mod=this.source,e&&this.filter(Ep,ege(this,kd))),this},clean(t){return arguments.length?(this.cleans=!!t,this):this.cleans},modifies(t){const e=this.fields||(this.fields={});return We(t)?t.forEach(n=>e[n]=!0):e[t]=!0,this},modified(t,e){const n=this.fields;return(e||this.mod.length)&&n?arguments.length?We(t)?t.some(r=>n[r]):n[t]:!!n:!1},filter(t,e){const n=this;return t&kd&&(n.addF=TI(n.addF,e)),t&Hm&&(n.remF=TI(n.remF,e)),t&Ep&&(n.modF=TI(n.modF,e)),t&qE&&(n.srcF=TI(n.srcF,e)),n},materialize(t){t=t||q1;const e=this;return t&kd&&e.addF&&(e.add=UW(e.add,e.addF),e.addF=null),t&Hm&&e.remF&&(e.rem=UW(e.rem,e.remF),e.remF=null),t&Ep&&e.modF&&(e.mod=UW(e.mod,e.modF),e.modF=null),t&qE&&e.srcF&&(e.source=e.source.filter(e.srcF),e.srcF=null),e},visit(t,e){const n=this,r=e;if(t&qE)return Gm(n.source,n.srcF,r),n;t&kd&&Gm(n.add,n.addF,r),t&Hm&&Gm(n.rem,n.remF,r),t&Ep&&Gm(n.mod,n.modF,r);const i=n.source;if(t&Kpe&&i){const o=n.add.length+n.mod.length;o===i.length||(o?Gm(i,ege(n,Qpe),r):Gm(i,n.srcF,r))}return n}};function Ine(t,e,n,r){const i=this;let o=0;this.dataflow=t,this.stamp=e,this.fields=null,this.encode=r||null,this.pulses=n;for(const s of n)if(s.stamp===e){if(s.fields){const a=i.fields||(i.fields={});for(const l in s.fields)a[l]=1}s.changed(i.ADD)&&(o|=i.ADD),s.changed(i.REM)&&(o|=i.REM),s.changed(i.MOD)&&(o|=i.MOD)}this.changes=o}it(Ine,zv,{fork(t){const e=new zv(this.dataflow).init(this,t&this.NO_FIELDS);return t!==void 0&&(t&e.ADD&&this.visit(e.ADD,n=>e.add.push(n)),t&e.REM&&this.visit(e.REM,n=>e.rem.push(n)),t&e.MOD&&this.visit(e.MOD,n=>e.mod.push(n))),e},changed(t){return this.changes&t},modified(t){const e=this,n=e.fields;return n&&e.changes&e.MOD?We(t)?t.some(r=>n[r]):n[t]:0},filter(){je("MultiPulse does not support filtering.")},materialize(){je("MultiPulse does not support materialization.")},visit(t,e){const n=this,r=n.pulses,i=r.length;let o=0;if(t&n.SOURCE)for(;or._enqueue(u,!0)),r._touched=Z4(eR);let s=0,a,l,c;try{for(;r._heap.size()>0;){if(a=r._heap.pop(),a.rank!==a.qrank){r._enqueue(a,!0);continue}l=a.run(r._getPulse(a,t)),l.then?l=await l:l.async&&(i.push(l.async),l=yN),l!==yN&&a._targets&&a._targets.forEach(u=>r._enqueue(u)),++s}}catch(u){r._heap.clear(),c=u}if(r._input={},r._pulse=null,r.debug(`Pulse ${o}: ${s} operators`),c&&(r._postrun=[],r.error(c)),r._postrun.length){const u=r._postrun.sort((f,d)=>d.priority-f.priority);r._postrun=[];for(let f=0;fr.runAsync(null,()=>{u.forEach(f=>{try{f(r)}catch(d){r.error(d)}})})),r}async function kEt(t,e,n){for(;this._running;)await this._running;const r=()=>this._running=null;return(this._running=this.evaluate(t,e,n)).then(r,r),this._running}function AEt(t,e,n){return this._pulse?ULe(this):(this.evaluate(t,e,n),this)}function PEt(t,e,n){if(this._pulse||e)this._postrun.push({priority:n||0,callback:t});else try{t(this)}catch(r){this.error(r)}}function ULe(t){return t.error("Dataflow already running. Use runAsync() to chain invocations."),t}function MEt(t,e){const n=t.stampi.pulse),e):this._input[t.id]||DEt(this._pulse,n&&n.pulse)}function DEt(t,e){return e&&e.stamp===t.stamp?e:(t=t.fork(),e&&e!==yN&&(t.source=e.source),t)}const Lne={skip:!1,force:!1};function IEt(t,e){const n=e||Lne;return this._pulse?this._enqueue(t):this._touched.add(t),n.skip&&t.skip(!0),this}function LEt(t,e,n){const r=n||Lne;return(t.set(e)||r.force)&&this.touch(t,r),this}function $Et(t,e,n){this.touch(t,n||Lne);const r=new zv(this,this._clock+(this._pulse?0:1)),i=t.pulse&&t.pulse.source||[];return r.target=t,this._input[t.id]=e.pulse(r,i),this}function FEt(t){let e=[];return{clear:()=>e=[],size:()=>e.length,peek:()=>e[0],push:n=>(e.push(n),WLe(e,0,e.length-1,t)),pop:()=>{const n=e.pop();let r;return e.length?(r=e[0],e[0]=n,NEt(e,0,t)):r=n,r}}}function WLe(t,e,n,r){let i,o;const s=t[n];for(;n>e;){if(o=n-1>>1,i=t[o],r(s,i)<0){t[n]=i,n=o;continue}break}return t[n]=s}function NEt(t,e,n){const r=e,i=t.length,o=t[e];let s=(e<<1)+1,a;for(;s=0&&(s=a),t[e]=t[s],e=s,s=(e<<1)+1;return t[e]=o,WLe(t,r,e,n)}function R_(){this.logger(fne()),this.logLevel(cne),this._clock=0,this._rank=0,this._locale=Ane();try{this._loader=K4()}catch{}this._touched=Z4(eR),this._input={},this._pulse=null,this._heap=FEt((t,e)=>t.qrank-e.qrank),this._postrun=[]}function XE(t){return function(){return this._log[t].apply(this,arguments)}}R_.prototype={stamp(){return this._clock},loader(t){return arguments.length?(this._loader=t,this):this._loader},locale(t){return arguments.length?(this._locale=t,this):this._locale},logger(t){return arguments.length?(this._log=t,this):this._log},error:XE("error"),warn:XE("warn"),info:XE("info"),debug:XE("debug"),logLevel:XE("level"),cleanThreshold:1e4,add:uEt,connect:fEt,rank:CEt,rerank:OEt,pulse:$Et,touch:IEt,update:LEt,changeset:l1,ingest:gEt,parse:pEt,preload:vEt,request:mEt,events:hEt,on:bEt,evaluate:TEt,run:AEt,runAsync:kEt,runAfter:PEt,_enqueue:MEt,_getPulse:REt};function De(t,e){Ir.call(this,t,null,e)}it(De,Ir,{run(t){if(t.stampthis.pulse=n):e!==t.StopPropagation&&(this.pulse=e),e},evaluate(t){const e=this.marshall(t.stamp),n=this.transform(e,t);return e.clear(),n},transform(){}});const IS={};function VLe(t){const e=GLe(t);return e&&e.Definition||null}function GLe(t){return t=t&&t.toLowerCase(),vt(IS,t)?IS[t]:null}function*HLe(t,e){if(e==null)for(let n of t)n!=null&&n!==""&&(n=+n)>=n&&(yield n);else{let n=-1;for(let r of t)r=e(r,++n,t),r!=null&&r!==""&&(r=+r)>=r&&(yield r)}}function $ne(t,e,n){const r=Float64Array.from(HLe(t,n));return r.sort(dh),e.map(i=>UIe(r,i))}function Fne(t,e){return $ne(t,[.25,.5,.75],e)}function Nne(t,e){const n=t.length,r=qSt(t,e),i=Fne(t,e),o=(i[2]-i[0])/1.34;return 1.06*(Math.min(r,o)||r||Math.abs(i[0])||1)*Math.pow(n,-.2)}function qLe(t){const e=t.maxbins||20,n=t.base||10,r=Math.log(n),i=t.divide||[5,2];let o=t.extent[0],s=t.extent[1],a,l,c,u,f,d;const h=t.span||s-o||Math.abs(o)||1;if(t.step)a=t.step;else if(t.steps){for(u=h/e,f=0,d=t.steps.length;fe;)a*=n;for(f=0,d=i.length;f=c&&h/u<=e&&(a=u)}u=Math.log(a);const p=u>=0?0:~~(-u/r)+1,g=Math.pow(n,-p-1);return(t.nice||t.nice===void 0)&&(u=Math.floor(o/a+g)*a,o=od);const i=t.length,o=new Float64Array(i);let s=0,a=1,l=r(t[0]),c=l,u=l+e,f;for(;a=u){for(c=(l+c)/2;s>1);si;)t[s--]=t[r]}r=i,i=o}return t}function BEt(t){return function(){return t=(1103515245*t+12345)%2147483647,t/2147483647}}function UEt(t,e){e==null&&(e=t,t=0);let n,r,i;const o={min(s){return arguments.length?(n=s||0,i=r-n,o):n},max(s){return arguments.length?(r=s||0,i=r-n,o):r},sample(){return n+Math.floor(i*Au())},pdf(s){return s===Math.floor(s)&&s>=n&&s=r?1:(a-n+1)/i},icdf(s){return s>=0&&s<=1?n-1+Math.floor(s*i):NaN}};return o.min(t).max(e)}const QLe=Math.sqrt(2*Math.PI),WEt=Math.SQRT2;let YE=NaN;function rB(t,e){t=t||0,e=e??1;let n=0,r=0,i,o;if(YE===YE)n=YE,YE=NaN;else{do n=Au()*2-1,r=Au()*2-1,i=n*n+r*r;while(i===0||i>1);o=Math.sqrt(-2*Math.log(i)/i),n*=o,YE=r*o}return t+n*e}function zne(t,e,n){n=n??1;const r=(t-(e||0))/n;return Math.exp(-.5*r*r)/(n*QLe)}function iB(t,e,n){e=e||0,n=n??1;const r=(t-e)/n,i=Math.abs(r);let o;if(i>37)o=0;else{const s=Math.exp(-i*i/2);let a;i<7.07106781186547?(a=.0352624965998911*i+.700383064443688,a=a*i+6.37396220353165,a=a*i+33.912866078383,a=a*i+112.079291497871,a=a*i+221.213596169931,a=a*i+220.206867912376,o=s*a,a=.0883883476483184*i+1.75566716318264,a=a*i+16.064177579207,a=a*i+86.7807322029461,a=a*i+296.564248779674,a=a*i+637.333633378831,a=a*i+793.826512519948,a=a*i+440.413735824752,o=o/a):(a=i+.65,a=i+4/a,a=i+3/a,a=i+2/a,a=i+1/a,o=s/a/2.506628274631)}return r>0?1-o:o}function oB(t,e,n){return t<0||t>1?NaN:(e||0)+(n??1)*WEt*VEt(2*t-1)}function VEt(t){let e=-Math.log((1-t)*(1+t)),n;return e<6.25?(e-=3.125,n=-364441206401782e-35,n=-16850591381820166e-35+n*e,n=128584807152564e-32+n*e,n=11157877678025181e-33+n*e,n=-1333171662854621e-31+n*e,n=20972767875968562e-33+n*e,n=6637638134358324e-30+n*e,n=-4054566272975207e-29+n*e,n=-8151934197605472e-29+n*e,n=26335093153082323e-28+n*e,n=-12975133253453532e-27+n*e,n=-5415412054294628e-26+n*e,n=10512122733215323e-25+n*e,n=-4112633980346984e-24+n*e,n=-29070369957882005e-24+n*e,n=42347877827932404e-23+n*e,n=-13654692000834679e-22+n*e,n=-13882523362786469e-21+n*e,n=.00018673420803405714+n*e,n=-.000740702534166267+n*e,n=-.006033670871430149+n*e,n=.24015818242558962+n*e,n=1.6536545626831027+n*e):e<16?(e=Math.sqrt(e)-3.25,n=22137376921775787e-25,n=9075656193888539e-23+n*e,n=-27517406297064545e-23+n*e,n=18239629214389228e-24+n*e,n=15027403968909828e-22+n*e,n=-4013867526981546e-21+n*e,n=29234449089955446e-22+n*e,n=12475304481671779e-21+n*e,n=-47318229009055734e-21+n*e,n=6828485145957318e-20+n*e,n=24031110387097894e-21+n*e,n=-.0003550375203628475+n*e,n=.0009532893797373805+n*e,n=-.0016882755560235047+n*e,n=.002491442096107851+n*e,n=-.003751208507569241+n*e,n=.005370914553590064+n*e,n=1.0052589676941592+n*e,n=3.0838856104922208+n*e):Number.isFinite(e)?(e=Math.sqrt(e)-5,n=-27109920616438573e-27,n=-2555641816996525e-25+n*e,n=15076572693500548e-25+n*e,n=-3789465440126737e-24+n*e,n=761570120807834e-23+n*e,n=-1496002662714924e-23+n*e,n=2914795345090108e-23+n*e,n=-6771199775845234e-23+n*e,n=22900482228026655e-23+n*e,n=-99298272942317e-20+n*e,n=4526062597223154e-21+n*e,n=-1968177810553167e-20+n*e,n=7599527703001776e-20+n*e,n=-.00021503011930044477+n*e,n=-.00013871931833623122+n*e,n=1.0103004648645344+n*e,n=4.849906401408584+n*e):n=1/0,n*t}function jne(t,e){let n,r;const i={mean(o){return arguments.length?(n=o||0,i):n},stdev(o){return arguments.length?(r=o??1,i):r},sample:()=>rB(n,r),pdf:o=>zne(o,n,r),cdf:o=>iB(o,n,r),icdf:o=>oB(o,n,r)};return i.mean(t).stdev(e)}function Bne(t,e){const n=jne();let r=0;const i={data(o){return arguments.length?(t=o,r=o?o.length:0,i.bandwidth(e)):t},bandwidth(o){return arguments.length?(e=o,!e&&t&&(e=Nne(t)),i):e},sample(){return t[~~(Au()*r)]+e*n.sample()},pdf(o){let s=0,a=0;for(;aUne(n,r),pdf:o=>Wne(o,n,r),cdf:o=>Vne(o,n,r),icdf:o=>Gne(o,n,r)};return i.mean(t).stdev(e)}function ZLe(t,e){let n=0,r;function i(s){const a=[];let l=0,c;for(c=0;c=e&&t<=n?1/(n-e):0}function Xne(t,e,n){return n==null&&(n=e??1,e=0),tn?1:(t-e)/(n-e)}function Yne(t,e,n){return n==null&&(n=e??1,e=0),t>=0&&t<=1?e+t*(n-e):NaN}function JLe(t,e){let n,r;const i={min(o){return arguments.length?(n=o||0,i):n},max(o){return arguments.length?(r=o??1,i):r},sample:()=>Hne(n,r),pdf:o=>qne(o,n,r),cdf:o=>Xne(o,n,r),icdf:o=>Yne(o,n,r)};return e==null&&(e=t??1,t=0),i.min(t).max(e)}function Qne(t,e,n){let r=0,i=0;for(const o of t){const s=n(o);e(o)==null||s==null||isNaN(s)||(r+=(s-r)/++i)}return{coef:[r],predict:()=>r,rSquared:0}}function nR(t,e,n,r){const i=r-t*t,o=Math.abs(i)<1e-24?0:(n-t*e)/i;return[e-o*t,o]}function sB(t,e,n,r){t=t.filter(h=>{let p=e(h),g=n(h);return p!=null&&(p=+p)>=p&&g!=null&&(g=+g)>=g}),r&&t.sort((h,p)=>e(h)-e(p));const i=t.length,o=new Float64Array(i),s=new Float64Array(i);let a=0,l=0,c=0,u,f,d;for(d of t)o[a]=u=+e(d),s[a]=f=+n(d),++a,l+=(u-l)/a,c+=(f-c)/a;for(a=0;a=o&&s!=null&&(s=+s)>=s&&r(o,s,++i)}function SO(t,e,n,r,i){let o=0,s=0;return rR(t,e,n,(a,l)=>{const c=l-i(a),u=l-r;o+=c*c,s+=u*u}),1-o/s}function Kne(t,e,n){let r=0,i=0,o=0,s=0,a=0;rR(t,e,n,(u,f)=>{++a,r+=(u-r)/a,i+=(f-i)/a,o+=(u*f-o)/a,s+=(u*u-s)/a});const l=nR(r,i,o,s),c=u=>l[0]+l[1]*u;return{coef:l,predict:c,rSquared:SO(t,e,n,i,c)}}function e$e(t,e,n){let r=0,i=0,o=0,s=0,a=0;rR(t,e,n,(u,f)=>{++a,u=Math.log(u),r+=(u-r)/a,i+=(f-i)/a,o+=(u*f-o)/a,s+=(u*u-s)/a});const l=nR(r,i,o,s),c=u=>l[0]+l[1]*Math.log(u);return{coef:l,predict:c,rSquared:SO(t,e,n,i,c)}}function t$e(t,e,n){const[r,i,o,s]=sB(t,e,n);let a=0,l=0,c=0,u=0,f=0,d,h,p;rR(t,e,n,(y,x)=>{d=r[f++],h=Math.log(x),p=d*x,a+=(x*h-a)/f,l+=(p-l)/f,c+=(p*h-c)/f,u+=(d*p-u)/f});const[g,m]=nR(l/s,a/s,c/s,u/s),v=y=>Math.exp(g+m*(y-o));return{coef:[Math.exp(g-m*o),m],predict:v,rSquared:SO(t,e,n,s,v)}}function n$e(t,e,n){let r=0,i=0,o=0,s=0,a=0,l=0;rR(t,e,n,(f,d)=>{const h=Math.log(f),p=Math.log(d);++l,r+=(h-r)/l,i+=(p-i)/l,o+=(h*p-o)/l,s+=(h*h-s)/l,a+=(d-a)/l});const c=nR(r,i,o,s),u=f=>c[0]*Math.pow(f,c[1]);return c[0]=Math.exp(c[0]),{coef:c,predict:u,rSquared:SO(t,e,n,a,u)}}function Zne(t,e,n){const[r,i,o,s]=sB(t,e,n),a=r.length;let l=0,c=0,u=0,f=0,d=0,h,p,g,m;for(h=0;h(S=S-o,x*S*S+b*S+w+s);return{coef:[w-b*o+x*o*o+s,b-2*x*o,x],predict:_,rSquared:SO(t,e,n,s,_)}}function r$e(t,e,n,r){if(r===0)return Qne(t,e,n);if(r===1)return Kne(t,e,n);if(r===2)return Zne(t,e,n);const[i,o,s,a]=sB(t,e,n),l=i.length,c=[],u=[],f=r+1;let d,h,p,g,m;for(d=0;d{x-=s;let b=a+v[0]+v[1]*x+v[2]*x*x;for(d=3;d=0;--o)for(a=e[o],l=1,i[o]+=a,s=1;s<=o;++s)l*=(o+1-s)/s,i[o-s]+=a*Math.pow(n,s)*l;return i[0]+=r,i}function HEt(t){const e=t.length-1,n=[];let r,i,o,s,a;for(r=0;rMath.abs(t[r][s])&&(s=i);for(o=r;o=r;o--)t[o][i]-=t[o][r]*t[r][i]/t[r][r]}for(i=e-1;i>=0;--i){for(a=0,o=i+1;oi[x]-v?y:x;let w=0,_=0,S=0,O=0,k=0;const E=1/Math.abs(i[b]-v||1);for(let R=y;R<=x;++R){const T=i[R],M=o[R],I=qEt(Math.abs(v-T)*E)*d[R],j=T*I;w+=I,_+=j,S+=M*I,O+=M*j,k+=T*j}const[P,A]=nR(_/w,S/w,O/w,k/w);u[m]=P+A*v,f[m]=Math.abs(o[m]-u[m]),XEt(i,m+1,p)}if(h===tge)break;const g=WIe(f);if(Math.abs(g)=1?nge:(y=1-v*v)*y}return YEt(i,u,s,a)}function qEt(t){return(t=1-t*t*t)*t*t}function XEt(t,e,n){const r=t[e];let i=n[0],o=n[1]+1;if(!(o>=t.length))for(;e>i&&t[o]-r<=r-t[i];)n[0]=++i,n[1]=o,++o}function YEt(t,e,n,r){const i=t.length,o=[];let s=0,a=0,l=[],c;for(;s[g,t(g)],o=e[0],s=e[1],a=s-o,l=a/r,c=[i(o)],u=[];if(n===r){for(let g=1;g0;)u.push(i(o+g/n*a))}let f=c[0],d=u[u.length-1];const h=1/a,p=KEt(f[1],u);for(;d;){const g=i((f[0]+d[0])/2);g[0]-f[0]>=l&&ZEt(f,g,d,h,p)>QEt?u.push(g):(f=d,c.push(d),u.pop()),d=u[u.length-1]}return c}function KEt(t,e){let n=t,r=t;const i=e.length;for(let o=0;or&&(r=s)}return 1/(r-n)}function ZEt(t,e,n,r,i){const o=Math.atan2(i*(n[1]-t[1]),r*(n[0]-t[0])),s=Math.atan2(i*(e[1]-t[1]),r*(e[0]-t[0]));return Math.abs(o-s)}function JEt(t){return e=>{const n=t.length;let r=1,i=String(t[0](e));for(;r{},e2t={init:WW,add:WW,rem:WW,idx:0},CA={values:{init:t=>t.cell.store=!0,value:t=>t.cell.data.values(),idx:-1},count:{value:t=>t.cell.num},__count__:{value:t=>t.missing+t.valid},missing:{value:t=>t.missing},valid:{value:t=>t.valid},sum:{init:t=>t.sum=0,value:t=>t.valid?t.sum:void 0,add:(t,e)=>t.sum+=+e,rem:(t,e)=>t.sum-=e},product:{init:t=>t.product=1,value:t=>t.valid?t.product:void 0,add:(t,e)=>t.product*=e,rem:(t,e)=>t.product/=e},mean:{init:t=>t.mean=0,value:t=>t.valid?t.mean:void 0,add:(t,e)=>(t.mean_d=e-t.mean,t.mean+=t.mean_d/t.valid),rem:(t,e)=>(t.mean_d=e-t.mean,t.mean-=t.valid?t.mean_d/t.valid:t.mean)},average:{value:t=>t.valid?t.mean:void 0,req:["mean"],idx:1},variance:{init:t=>t.dev=0,value:t=>t.valid>1?t.dev/(t.valid-1):void 0,add:(t,e)=>t.dev+=t.mean_d*(e-t.mean),rem:(t,e)=>t.dev-=t.mean_d*(e-t.mean),req:["mean"],idx:1},variancep:{value:t=>t.valid>1?t.dev/t.valid:void 0,req:["variance"],idx:2},stdev:{value:t=>t.valid>1?Math.sqrt(t.dev/(t.valid-1)):void 0,req:["variance"],idx:2},stdevp:{value:t=>t.valid>1?Math.sqrt(t.dev/t.valid):void 0,req:["variance"],idx:2},stderr:{value:t=>t.valid>1?Math.sqrt(t.dev/(t.valid*(t.valid-1))):void 0,req:["variance"],idx:2},distinct:{value:t=>t.cell.data.distinct(t.get),req:["values"],idx:3},ci0:{value:t=>t.cell.data.ci0(t.get),req:["values"],idx:3},ci1:{value:t=>t.cell.data.ci1(t.get),req:["values"],idx:3},median:{value:t=>t.cell.data.q2(t.get),req:["values"],idx:3},q1:{value:t=>t.cell.data.q1(t.get),req:["values"],idx:3},q3:{value:t=>t.cell.data.q3(t.get),req:["values"],idx:3},min:{init:t=>t.min=void 0,value:t=>t.min=Number.isNaN(t.min)?t.cell.data.min(t.get):t.min,add:(t,e)=>{(e{e<=t.min&&(t.min=NaN)},req:["values"],idx:4},max:{init:t=>t.max=void 0,value:t=>t.max=Number.isNaN(t.max)?t.cell.data.max(t.get):t.max,add:(t,e)=>{(e>t.max||t.max===void 0)&&(t.max=e)},rem:(t,e)=>{e>=t.max&&(t.max=NaN)},req:["values"],idx:4},argmin:{init:t=>t.argmin=void 0,value:t=>t.argmin||t.cell.data.argmin(t.get),add:(t,e,n)=>{e{e<=t.min&&(t.argmin=void 0)},req:["min","values"],idx:3},argmax:{init:t=>t.argmax=void 0,value:t=>t.argmax||t.cell.data.argmax(t.get),add:(t,e,n)=>{e>t.max&&(t.argmax=n)},rem:(t,e)=>{e>=t.max&&(t.argmax=void 0)},req:["max","values"],idx:3},exponential:{init:(t,e)=>{t.exp=0,t.exp_r=e},value:t=>t.valid?t.exp*(1-t.exp_r)/(1-t.exp_r**t.valid):void 0,add:(t,e)=>t.exp=t.exp_r*t.exp+e,rem:(t,e)=>t.exp=(t.exp-e/t.exp_r**(t.valid-1))/t.exp_r},exponentialb:{value:t=>t.valid?t.exp*(1-t.exp_r):void 0,req:["exponential"],idx:1}},iR=Object.keys(CA).filter(t=>t!=="__count__");function t2t(t,e){return(n,r)=>cn({name:t,aggregate_param:r,out:n||t},e2t,e)}[...iR,"__count__"].forEach(t=>{CA[t]=t2t(t,CA[t])});function s$e(t,e,n){return CA[t](n,e)}function a$e(t,e){return t.idx-e.idx}function n2t(t){const e={};t.forEach(r=>e[r.name]=r);const n=r=>{r.req&&r.req.forEach(i=>{e[i]||n(e[i]=CA[i]())})};return t.forEach(n),Object.values(e).sort(a$e)}function r2t(){this.valid=0,this.missing=0,this._ops.forEach(t=>t.aggregate_param==null?t.init(this):t.init(this,t.aggregate_param))}function i2t(t,e){if(t==null||t===""){++this.missing;return}t===t&&(++this.valid,this._ops.forEach(n=>n.add(this,t,e)))}function o2t(t,e){if(t==null||t===""){--this.missing;return}t===t&&(--this.valid,this._ops.forEach(n=>n.rem(this,t,e)))}function s2t(t){return this._out.forEach(e=>t[e.out]=e.value(this)),t}function l$e(t,e){const n=e||ea,r=n2t(t),i=t.slice().sort(a$e);function o(s){this._ops=r,this._out=i,this.cell=s,this.init()}return o.prototype.init=r2t,o.prototype.add=i2t,o.prototype.rem=o2t,o.prototype.set=s2t,o.prototype.get=n,o.fields=t.map(s=>s.out),o}function Jne(t){this._key=t?Eu(t):jt,this.reset()}const Cs=Jne.prototype;Cs.reset=function(){this._add=[],this._rem=[],this._ext=null,this._get=null,this._q=null};Cs.add=function(t){this._add.push(t)};Cs.rem=function(t){this._rem.push(t)};Cs.values=function(){if(this._get=null,this._rem.length===0)return this._add;const t=this._add,e=this._rem,n=this._key,r=t.length,i=e.length,o=Array(r-i),s={};let a,l,c;for(a=0;a=0;)o=t(e[r])+"",vt(n,o)||(n[o]=1,++i);return i};Cs.extent=function(t){if(this._get!==t||!this._ext){const e=this.values(),n=CIe(e,t);this._ext=[e[n[0]],e[n[1]]],this._get=t}return this._ext};Cs.argmin=function(t){return this.extent(t)[0]||{}};Cs.argmax=function(t){return this.extent(t)[1]||{}};Cs.min=function(t){const e=this.extent(t)[0];return e!=null?t(e):void 0};Cs.max=function(t){const e=this.extent(t)[1];return e!=null?t(e):void 0};Cs.quartile=function(t){return(this._get!==t||!this._q)&&(this._q=Fne(this.values(),t),this._get=t),this._q};Cs.q1=function(t){return this.quartile(t)[0]};Cs.q2=function(t){return this.quartile(t)[1]};Cs.q3=function(t){return this.quartile(t)[2]};Cs.ci=function(t){return(this._get!==t||!this._ci)&&(this._ci=XLe(this.values(),1e3,.05,t),this._get=t),this._ci};Cs.ci0=function(t){return this.ci(t)[0]};Cs.ci1=function(t){return this.ci(t)[1]};function ry(t){De.call(this,null,t),this._adds=[],this._mods=[],this._alen=0,this._mlen=0,this._drop=!0,this._cross=!1,this._dims=[],this._dnames=[],this._measures=[],this._countOnly=!1,this._counts=null,this._prev=null,this._inputs=null,this._outputs=null}ry.Definition={type:"Aggregate",metadata:{generates:!0,changes:!0},params:[{name:"groupby",type:"field",array:!0},{name:"ops",type:"enum",array:!0,values:iR},{name:"aggregate_params",type:"number",null:!0,array:!0},{name:"fields",type:"field",null:!0,array:!0},{name:"as",type:"string",null:!0,array:!0},{name:"drop",type:"boolean",default:!0},{name:"cross",type:"boolean",default:!1},{name:"key",type:"field"}]};it(ry,De,{transform(t,e){const n=this,r=e.fork(e.NO_SOURCE|e.NO_FIELDS),i=t.modified();return n.stamp=r.stamp,n.value&&(i||e.modified(n._inputs,!0))?(n._prev=n.value,n.value=i?n.init(t):Object.create(null),e.visit(e.SOURCE,o=>n.add(o))):(n.value=n.value||n.init(t),e.visit(e.REM,o=>n.rem(o)),e.visit(e.ADD,o=>n.add(o))),r.modifies(n._outputs),n._drop=t.drop!==!1,t.cross&&n._dims.length>1&&(n._drop=!1,n.cross()),e.clean()&&n._drop&&r.clean(!0).runAfter(()=>this.clean()),n.changes(r)},cross(){const t=this,e=t.value,n=t._dnames,r=n.map(()=>({})),i=n.length;function o(a){let l,c,u,f;for(l in a)for(u=a[l].tuple,c=0;c{const x=Ni(y);return i(y),n.push(x),x}),this.cellkey=t.key?t.key:cX(this._dims),this._countOnly=!0,this._counts=[],this._measures=[];const o=t.fields||[null],s=t.ops||["count"],a=t.aggregate_params||[null],l=t.as||[],c=o.length,u={};let f,d,h,p,g,m,v;for(c!==s.length&&je("Unmatched number of fields and aggregate ops."),v=0;vl$e(y,y.field)),Object.create(null)},cellkey:cX(),cell(t,e){let n=this.value[t];return n?n.num===0&&this._drop&&n.stamp{const f=r(u);u[a]=f,u[l]=f==null?null:i+o*(1+(f-i)/o)}:u=>u[a]=r(u)),e.modifies(n?s:a)},_bins(t){if(this.value&&!t.modified())return this.value;const e=t.field,n=qLe(t),r=n.step;let i=n.start,o=i+Math.ceil((n.stop-i)/r)*r,s,a;(s=t.anchor)!=null&&(a=s-(i+r*Math.floor((s-i)/r)),i+=a,o+=a);const l=function(c){let u=qs(e(c));return u==null?null:uo?1/0:(u=Math.max(i,Math.min(u,o-r)),i+r*Math.floor(a2t+(u-i)/r))};return l.start=i,l.stop=n.stop,l.step=r,this.value=kl(l,Ys(e),t.name||"bin_"+Ni(e))}});function c$e(t,e,n){const r=t;let i=e||[],o=n||[],s={},a=0;return{add:l=>o.push(l),remove:l=>s[r(l)]=++a,size:()=>i.length,data:(l,c)=>(a&&(i=i.filter(u=>!s[r(u)]),s={},a=0),c&&l&&i.sort(l),o.length&&(i=l?PIe(l,i,o.sort(l)):i.concat(o),o=[]),i)}}function tre(t){De.call(this,[],t)}tre.Definition={type:"Collect",metadata:{source:!0},params:[{name:"sort",type:"compare"}]};it(tre,De,{transform(t,e){const n=e.fork(e.ALL),r=c$e(jt,this.value,n.materialize(n.ADD).add),i=t.sort,o=e.changed()||i&&(t.modified("sort")||e.modified(i.fields));return n.visit(n.REM,r.remove),this.modified(o),this.value=n.source=r.data(a1(i),o),e.source&&e.source.root&&(this.value.root=e.source.root),n}});function u$e(t){Ir.call(this,null,l2t,t)}it(u$e,Ir);function l2t(t){return this.value&&!t.modified()?this.value:gne(t.fields,t.orders)}function nre(t){De.call(this,null,t)}nre.Definition={type:"CountPattern",metadata:{generates:!0,changes:!0},params:[{name:"field",type:"field",required:!0},{name:"case",type:"enum",values:["upper","lower","mixed"],default:"mixed"},{name:"pattern",type:"string",default:'[\\w"]+'},{name:"stopwords",type:"string",default:""},{name:"as",type:"string",array:!0,length:2,default:["text","count"]}]};function c2t(t,e,n){switch(e){case"upper":t=t.toUpperCase();break;case"lower":t=t.toLowerCase();break}return t.match(n)}it(nre,De,{transform(t,e){const n=f=>d=>{for(var h=c2t(a(d),t.case,o)||[],p,g=0,m=h.length;gi[f]=1+(i[f]||0)),u=n(f=>i[f]-=1);return r?e.visit(e.SOURCE,c):(e.visit(e.ADD,c),e.visit(e.REM,u)),this._finish(e,l)},_parameterCheck(t,e){let n=!1;return(t.modified("stopwords")||!this._stop)&&(this._stop=new RegExp("^"+(t.stopwords||"")+"$","i"),n=!0),(t.modified("pattern")||!this._match)&&(this._match=new RegExp(t.pattern||"[\\w']+","g"),n=!0),(t.modified("field")||e.modified(t.field.fields))&&(n=!0),n&&(this._counts={}),n},_finish(t,e){const n=this._counts,r=this._tuples||(this._tuples={}),i=e[0],o=e[1],s=t.fork(t.NO_SOURCE|t.NO_FIELDS);let a,l,c;for(a in n)l=r[a],c=n[a]||0,!l&&c?(r[a]=l=cr({}),l[i]=a,l[o]=c,s.add.push(l)):c===0?(l&&s.rem.push(l),n[a]=null,r[a]=null):l[o]!==c&&(l[o]=c,s.mod.push(l));return s.modifies(e)}});function rre(t){De.call(this,null,t)}rre.Definition={type:"Cross",metadata:{generates:!0},params:[{name:"filter",type:"expr"},{name:"as",type:"string",array:!0,length:2,default:["a","b"]}]};it(rre,De,{transform(t,e){const n=e.fork(e.NO_SOURCE),r=t.as||["a","b"],i=r[0],o=r[1],s=!this.value||e.changed(e.ADD_REM)||t.modified("as")||t.modified("filter");let a=this.value;return s?(a&&(n.rem=a),a=e.materialize(e.SOURCE).source,n.add=this.value=u2t(a,i,o,t.filter||Tu)):n.mod=a,n.source=this.value,n.modifies(r)}});function u2t(t,e,n,r){for(var i=[],o={},s=t.length,a=0,l,c;af$e(o,e))):typeof r[i]===ige&&r[i](t[i]);return r}function ire(t){De.call(this,null,t)}const d$e=[{key:{function:"normal"},params:[{name:"mean",type:"number",default:0},{name:"stdev",type:"number",default:1}]},{key:{function:"lognormal"},params:[{name:"mean",type:"number",default:0},{name:"stdev",type:"number",default:1}]},{key:{function:"uniform"},params:[{name:"min",type:"number",default:0},{name:"max",type:"number",default:1}]},{key:{function:"kde"},params:[{name:"field",type:"field",required:!0},{name:"from",type:"data"},{name:"bandwidth",type:"number",default:0}]}],h2t={key:{function:"mixture"},params:[{name:"distributions",type:"param",array:!0,params:d$e},{name:"weights",type:"number",array:!0}]};ire.Definition={type:"Density",metadata:{generates:!0},params:[{name:"extent",type:"number",array:!0,length:2},{name:"steps",type:"number"},{name:"minsteps",type:"number",default:25},{name:"maxsteps",type:"number",default:200},{name:"method",type:"string",default:"pdf",values:["pdf","cdf"]},{name:"distribution",type:"param",params:d$e.concat(h2t)},{name:"as",type:"string",array:!0,default:["value","density"]}]};it(ire,De,{transform(t,e){const n=e.fork(e.NO_SOURCE|e.NO_FIELDS);if(!this.value||e.changed()||t.modified()){const r=f$e(t.distribution,p2t(e)),i=t.steps||t.minsteps||25,o=t.steps||t.maxsteps||200;let s=t.method||"pdf";s!=="pdf"&&s!=="cdf"&&je("Invalid density method: "+s),!t.extent&&!r.data&&je("Missing density extent parameter."),s=r[s];const a=t.as||["value","density"],l=t.extent||Sh(r.data()),c=aB(s,l,i,o).map(u=>{const f={};return f[a[0]]=u[0],f[a[1]]=u[1],cr(f)});this.value&&(n.rem=this.value),this.value=n.add=n.source=c}return n}});function p2t(t){return()=>t.materialize(t.SOURCE).source}function h$e(t,e){return t?t.map((n,r)=>e[r]||Ni(n)):null}function ore(t,e,n){const r=[],i=f=>f(l);let o,s,a,l,c,u;if(e==null)r.push(t.map(n));else for(o={},s=0,a=t.length;stR(Sh(t,e))/30;it(sre,De,{transform(t,e){if(this.value&&!(t.modified()||e.changed()))return e;const n=e.materialize(e.SOURCE).source,r=ore(e.source,t.groupby,ea),i=t.smooth||!1,o=t.field,s=t.step||g2t(n,o),a=a1((p,g)=>o(p)-o(g)),l=t.as||p$e,c=r.length;let u=1/0,f=-1/0,d=0,h;for(;df&&(f=g),p[++h][l]=g}return this.value={start:u,stop:f,step:s},e.reflow(!0).modifies(l)}});function g$e(t){Ir.call(this,null,m2t,t),this.modified(!0)}it(g$e,Ir);function m2t(t){const e=t.expr;return this.value&&!t.modified("expr")?this.value:kl(n=>e(n,t),Ys(e),Ni(e))}function are(t){De.call(this,[void 0,void 0],t)}are.Definition={type:"Extent",metadata:{},params:[{name:"field",type:"field",required:!0}]};it(are,De,{transform(t,e){const n=this.value,r=t.field,i=e.changed()||e.modified(r.fields)||t.modified("field");let o=n[0],s=n[1];if((i||o==null)&&(o=1/0,s=-1/0),e.visit(i?e.SOURCE:e.ADD,a=>{const l=qs(r(a));l!=null&&(ls&&(s=l))}),!Number.isFinite(o)||!Number.isFinite(s)){let a=Ni(r);a&&(a=` for field "${a}"`),e.dataflow.warn(`Infinite extent${a}: [${o}, ${s}]`),o=s=void 0}this.value=[o,s]}});function lre(t,e){Ir.call(this,t),this.parent=e,this.count=0}it(lre,Ir,{connect(t){return this.detachSubflow=t.detachSubflow,this.targets().add(t),t.source=this},add(t){this.count+=1,this.value.add.push(t)},rem(t){this.count-=1,this.value.rem.push(t)},mod(t){this.value.mod.push(t)},init(t){this.value.init(t,t.NO_SOURCE)},evaluate(){return this.value}});function lB(t){De.call(this,{},t),this._keys=vO();const e=this._targets=[];e.active=0,e.forEach=n=>{for(let r=0,i=e.active;rr&&r.count>0);this.initTargets(n)}},initTargets(t){const e=this._targets,n=e.length,r=t?t.length:0;let i=0;for(;ithis.subflow(l,i,e);return this._group=t.group||{},this.initTargets(),e.visit(e.REM,l=>{const c=jt(l),u=o.get(c);u!==void 0&&(o.delete(c),a(u).rem(l))}),e.visit(e.ADD,l=>{const c=r(l);o.set(jt(l),c),a(c).add(l)}),s||e.modified(r.fields)?e.visit(e.MOD,l=>{const c=jt(l),u=o.get(c),f=r(l);u===f?a(f).mod(l):(o.set(c,f),a(u).rem(l),a(f).add(l))}):e.changed(e.MOD)&&e.visit(e.MOD,l=>{a(o.get(jt(l))).mod(l)}),s&&e.visit(e.REFLOW,l=>{const c=jt(l),u=o.get(c),f=r(l);u!==f&&(o.set(c,f),a(u).rem(l),a(f).add(l))}),e.clean()?n.runAfter(()=>{this.clean(),o.clean()}):o.empty>n.cleanThreshold&&n.runAfter(o.clean),e}});function m$e(t){Ir.call(this,null,v2t,t)}it(m$e,Ir);function v2t(t){return this.value&&!t.modified()?this.value:We(t.name)?pt(t.name).map(e=>Eu(e)):Eu(t.name,t.as)}function cre(t){De.call(this,vO(),t)}cre.Definition={type:"Filter",metadata:{changes:!0},params:[{name:"expr",type:"expr",required:!0}]};it(cre,De,{transform(t,e){const n=e.dataflow,r=this.value,i=e.fork(),o=i.add,s=i.rem,a=i.mod,l=t.expr;let c=!0;e.visit(e.REM,f=>{const d=jt(f);r.has(d)?r.delete(d):s.push(f)}),e.visit(e.ADD,f=>{l(f,t)?o.push(f):r.set(jt(f),1)});function u(f){const d=jt(f),h=l(f,t),p=r.get(d);h&&p?(r.delete(d),o.push(f)):!h&&!p?(r.set(d,1),s.push(f)):c&&h&&!p&&a.push(f)}return e.visit(e.MOD,u),t.modified()&&(c=!1,e.visit(e.REFLOW,u)),r.empty>n.cleanThreshold&&n.runAfter(r.clean),i}});function ure(t){De.call(this,[],t)}ure.Definition={type:"Flatten",metadata:{generates:!0},params:[{name:"fields",type:"field",array:!0,required:!0},{name:"index",type:"string"},{name:"as",type:"string",array:!0}]};it(ure,De,{transform(t,e){const n=e.fork(e.NO_SOURCE),r=t.fields,i=h$e(r,t.as||[]),o=t.index||null,s=i.length;return n.rem=this.value,e.visit(e.SOURCE,a=>{const l=r.map(p=>p(a)),c=l.reduce((p,g)=>Math.max(p,g.length),0);let u=0,f,d,h;for(;u{for(let u=0,f;us[r]=n(s,t))}});function v$e(t){De.call(this,[],t)}it(v$e,De,{transform(t,e){const n=e.fork(e.ALL),r=t.generator;let i=this.value,o=t.size-i.length,s,a,l;if(o>0){for(s=[];--o>=0;)s.push(l=cr(r(t))),i.push(l);n.add=n.add.length?n.materialize(n.ADD).add.concat(s):s}else a=i.slice(0,-o),n.rem=n.rem.length?n.materialize(n.REM).rem.concat(a):a,i=i.slice(-o);return n.source=this.value=i,n}});const kI={value:"value",median:WIe,mean:JSt,min:Jq,max:Lx},y2t=[];function hre(t){De.call(this,[],t)}hre.Definition={type:"Impute",metadata:{changes:!0},params:[{name:"field",type:"field",required:!0},{name:"key",type:"field",required:!0},{name:"keyvals",array:!0},{name:"groupby",type:"field",array:!0},{name:"method",type:"enum",default:"value",values:["value","mean","median","max","min"]},{name:"value",default:0}]};function x2t(t){var e=t.method||kI.value,n;if(kI[e]==null)je("Unrecognized imputation method: "+e);else return e===kI.value?(n=t.value!==void 0?t.value:0,()=>n):kI[e]}function b2t(t){const e=t.field;return n=>n?e(n):NaN}it(hre,De,{transform(t,e){var n=e.fork(e.ALL),r=x2t(t),i=b2t(t),o=Ni(t.field),s=Ni(t.key),a=(t.groupby||[]).map(Ni),l=w2t(e.source,t.groupby,t.key,t.keyvals),c=[],u=this.value,f=l.domain.length,d,h,p,g,m,v,y,x,b,w;for(m=0,x=l.length;mv(m),o=[],s=r?r.slice():[],a={},l={},c,u,f,d,h,p,g,m;for(s.forEach((v,y)=>a[v]=y+1),d=0,g=t.length;dn.add(o))):(i=n.value=n.value||this.init(t),e.visit(e.REM,o=>n.rem(o)),e.visit(e.ADD,o=>n.add(o))),n.changes(),e.visit(e.SOURCE,o=>{cn(o,i[n.cellkey(o)].tuple)}),e.reflow(r).modifies(this._outputs)},changes(){const t=this._adds,e=this._mods;let n,r;for(n=0,r=this._alen;n{const p=Bne(h,s)[a],g=t.counts?h.length:1,m=u||Sh(h);aB(p,m,f,d).forEach(v=>{const y={};for(let x=0;x(this._pending=pt(i.data),o=>o.touch(this)))}:n.request(t.url,t.format).then(r=>VW(this,e,pt(r.data)))}});function S2t(t){return t.modified("async")&&!(t.modified("values")||t.modified("url")||t.modified("format"))}function VW(t,e,n){n.forEach(cr);const r=e.fork(e.NO_FIELDS&e.NO_SOURCE);return r.rem=t.value,t.value=r.source=r.add=n,t._pending=null,r.rem.length&&r.clean(!0),r}function mre(t){De.call(this,{},t)}mre.Definition={type:"Lookup",metadata:{modifies:!0},params:[{name:"index",type:"index",params:[{name:"from",type:"data",required:!0},{name:"key",type:"field",required:!0}]},{name:"values",type:"field",array:!0},{name:"fields",type:"field",array:!0,required:!0},{name:"as",type:"string",array:!0},{name:"default",default:null}]};it(mre,De,{transform(t,e){const n=t.fields,r=t.index,i=t.values,o=t.default==null?null:t.default,s=t.modified(),a=n.length;let l=s?e.SOURCE:e.ADD,c=e,u=t.as,f,d,h;return i?(d=i.length,a>1&&!u&&je('Multi-field lookup requires explicit "as" parameter.'),u&&u.length!==a*d&&je('The "as" parameter has too few output field names.'),u=u||i.map(Ni),f=function(p){for(var g=0,m=0,v,y;ge.modified(p.fields)),l|=h?e.MOD:0),e.visit(l,f),c.modifies(u)}});function b$e(t){Ir.call(this,null,C2t,t)}it(b$e,Ir);function C2t(t){if(this.value&&!t.modified())return this.value;const e=t.extents,n=e.length;let r=1/0,i=-1/0,o,s;for(o=0;oi&&(i=s[1]);return[r,i]}function w$e(t){Ir.call(this,null,O2t,t)}it(w$e,Ir);function O2t(t){return this.value&&!t.modified()?this.value:t.values.reduce((e,n)=>e.concat(n),[])}function _$e(t){De.call(this,null,t)}it(_$e,De,{transform(t,e){return this.modified(t.modified()),this.value=t,e.fork(e.NO_SOURCE|e.NO_FIELDS)}});function vre(t){ry.call(this,t)}vre.Definition={type:"Pivot",metadata:{generates:!0,changes:!0},params:[{name:"groupby",type:"field",array:!0},{name:"field",type:"field",required:!0},{name:"value",type:"field",required:!0},{name:"op",type:"enum",values:iR,default:"sum"},{name:"limit",type:"number",default:0},{name:"key",type:"field"}]};it(vre,ry,{_transform:ry.prototype.transform,transform(t,e){return this._transform(E2t(t,e),e)}});function E2t(t,e){const n=t.field,r=t.value,i=(t.op==="count"?"__count__":t.op)||"sum",o=Ys(n).concat(Ys(r)),s=k2t(n,t.limit||0,e);return e.changed()&&t.set("__pivot__",null,null,!0),{key:t.key,groupby:t.groupby,ops:s.map(()=>i),fields:s.map(a=>T2t(a,n,r,o)),as:s.map(a=>a+""),modified:t.modified.bind(t)}}function T2t(t,e,n,r){return kl(i=>e(i)===t?n(i):NaN,r,t+"")}function k2t(t,e,n){const r={},i=[];return n.visit(n.SOURCE,o=>{const s=t(o);r[s]||(r[s]=1,i.push(s))}),i.sort(V4),e?i.slice(0,e):i}function S$e(t){lB.call(this,t)}it(S$e,lB,{transform(t,e){const n=t.subflow,r=t.field,i=o=>this.subflow(jt(o),n,e,o);return(t.modified("field")||r&&e.modified(Ys(r)))&&je("PreFacet does not support field modification."),this.initTargets(),r?(e.visit(e.MOD,o=>{const s=i(o);r(o).forEach(a=>s.mod(a))}),e.visit(e.ADD,o=>{const s=i(o);r(o).forEach(a=>s.add(cr(a)))}),e.visit(e.REM,o=>{const s=i(o);r(o).forEach(a=>s.rem(a))})):(e.visit(e.MOD,o=>i(o).mod(o)),e.visit(e.ADD,o=>i(o).add(o)),e.visit(e.REM,o=>i(o).rem(o))),e.clean()&&e.runAfter(()=>this.clean()),e}});function yre(t){De.call(this,null,t)}yre.Definition={type:"Project",metadata:{generates:!0,changes:!0},params:[{name:"fields",type:"field",array:!0},{name:"as",type:"string",null:!0,array:!0}]};it(yre,De,{transform(t,e){const n=e.fork(e.NO_SOURCE),r=t.fields,i=h$e(t.fields,t.as||[]),o=r?(a,l)=>A2t(a,l,r,i):eB;let s;return this.value?s=this.value:(e=e.addAll(),s=this.value={}),e.visit(e.REM,a=>{const l=jt(a);n.rem.push(s[l]),s[l]=null}),e.visit(e.ADD,a=>{const l=o(a,cr({}));s[jt(a)]=l,n.add.push(l)}),e.visit(e.MOD,a=>{n.mod.push(o(a,s[jt(a)]))}),n}});function A2t(t,e,n,r){for(let i=0,o=n.length;i{const d=$ne(f,c);for(let h=0;h{const o=jt(i);n.rem.push(r[o]),r[o]=null}),e.visit(e.ADD,i=>{const o=Dne(i);r[jt(i)]=o,n.add.push(o)}),e.visit(e.MOD,i=>{const o=r[jt(i)];for(const s in i)o[s]=i[s],n.modifies(s);n.mod.push(o)})),n}});function bre(t){De.call(this,[],t),this.count=0}bre.Definition={type:"Sample",metadata:{},params:[{name:"size",type:"number",default:1e3}]};it(bre,De,{transform(t,e){const n=e.fork(e.NO_SOURCE),r=t.modified("size"),i=t.size,o=this.value.reduce((u,f)=>(u[jt(f)]=1,u),{});let s=this.value,a=this.count,l=0;function c(u){let f,d;s.length=l&&(f=s[d],o[jt(f)]&&n.rem.push(f),s[d]=u)),++a}if(e.rem.length&&(e.visit(e.REM,u=>{const f=jt(u);o[f]&&(o[f]=-1,n.rem.push(u)),--a}),s=s.filter(u=>o[jt(u)]!==-1)),(e.rem.length||r)&&s.length{o[jt(u)]||c(u)}),l=-1),r&&s.length>i){const u=s.length-i;for(let f=0;f{o[jt(u)]&&n.mod.push(u)}),e.add.length&&e.visit(e.ADD,c),(e.add.length||l<0)&&(n.add=s.filter(u=>!o[jt(u)])),this.count=a,this.value=n.source=s,n}});function wre(t){De.call(this,null,t)}wre.Definition={type:"Sequence",metadata:{generates:!0,changes:!0},params:[{name:"start",type:"number",required:!0},{name:"stop",type:"number",required:!0},{name:"step",type:"number",default:1},{name:"as",type:"string",default:"data"}]};it(wre,De,{transform(t,e){if(this.value&&!t.modified())return;const n=e.materialize().fork(e.MOD),r=t.as||"data";return n.rem=this.value?e.rem.concat(this.value):e.rem,this.value=ol(t.start,t.stop,t.step||1).map(i=>{const o={};return o[r]=i,cr(o)}),n.add=e.add.concat(this.value),n}});function E$e(t){De.call(this,null,t),this.modified(!0)}it(E$e,De,{transform(t,e){return this.value=e.source,e.changed()?e.fork(e.NO_SOURCE|e.NO_FIELDS):e.StopPropagation}});function _re(t){De.call(this,null,t)}const T$e=["unit0","unit1"];_re.Definition={type:"TimeUnit",metadata:{modifies:!0},params:[{name:"field",type:"field",required:!0},{name:"interval",type:"boolean",default:!0},{name:"units",type:"enum",values:Cne,array:!0},{name:"step",type:"number",default:1},{name:"maxbins",type:"number",default:40},{name:"extent",type:"date",array:!0},{name:"timezone",type:"enum",default:"local",values:["local","utc"]},{name:"as",type:"string",array:!0,length:2,default:T$e}]};it(_re,De,{transform(t,e){const n=t.field,r=t.interval!==!1,i=t.timezone==="utc",o=this._floor(t,e),s=(i?_O:wO)(o.unit).offset,a=t.as||T$e,l=a[0],c=a[1],u=o.step;let f=o.start||1/0,d=o.stop||-1/0,h=e.ADD;return(t.modified()||e.changed(e.REM)||e.modified(Ys(n)))&&(e=e.reflow(!0),h=e.SOURCE,f=1/0,d=-1/0),e.visit(h,p=>{const g=n(p);let m,v;g==null?(p[l]=null,r&&(p[c]=null)):(p[l]=m=v=o(g),r&&(p[c]=v=s(m,u)),md&&(d=v))}),o.start=f,o.stop=d,e.modifies(r?a:l)},_floor(t,e){const n=t.timezone==="utc",{units:r,step:i}=t.units?{units:t.units,step:t.step||1}:vLe({extent:t.extent||Sh(e.materialize(e.SOURCE).source,t.field),maxbins:t.maxbins}),o=One(r),s=this.value||{},a=(n?lLe:aLe)(o,i);return a.unit=$n(o),a.units=o,a.step=i,a.start=s.start,a.stop=s.stop,this.value=a}});function k$e(t){De.call(this,vO(),t)}it(k$e,De,{transform(t,e){const n=e.dataflow,r=t.field,i=this.value,o=a=>i.set(r(a),a);let s=!0;return t.modified("field")||e.modified(r.fields)?(i.clear(),e.visit(e.SOURCE,o)):e.changed()?(e.visit(e.REM,a=>i.delete(r(a))),e.visit(e.ADD,o)):s=!1,this.modified(s),i.empty>n.cleanThreshold&&n.runAfter(i.clean),e.fork()}});function A$e(t){De.call(this,null,t)}it(A$e,De,{transform(t,e){(!this.value||t.modified("field")||t.modified("sort")||e.changed()||t.sort&&e.modified(t.sort.fields))&&(this.value=(t.sort?e.source.slice().sort(a1(t.sort)):e.source).map(t.field))}});function M2t(t,e,n,r){const i=OA[t](e,n);return{init:i.init||nv,update:function(o,s){s[r]=i.next(o)}}}const OA={row_number:function(){return{next:t=>t.index+1}},rank:function(){let t;return{init:()=>t=1,next:e=>{const n=e.index,r=e.data;return n&&e.compare(r[n-1],r[n])?t=n+1:t}}},dense_rank:function(){let t;return{init:()=>t=1,next:e=>{const n=e.index,r=e.data;return n&&e.compare(r[n-1],r[n])?++t:t}}},percent_rank:function(){const t=OA.rank(),e=t.next;return{init:t.init,next:n=>(e(n)-1)/(n.data.length-1)}},cume_dist:function(){let t;return{init:()=>t=0,next:e=>{const n=e.data,r=e.compare;let i=e.index;if(t0||je("ntile num must be greater than zero.");const n=OA.cume_dist(),r=n.next;return{init:n.init,next:i=>Math.ceil(e*r(i))}},lag:function(t,e){return e=+e||1,{next:n=>{const r=n.index-e;return r>=0?t(n.data[r]):null}}},lead:function(t,e){return e=+e||1,{next:n=>{const r=n.index+e,i=n.data;return rt(e.data[e.i0])}},last_value:function(t){return{next:e=>t(e.data[e.i1-1])}},nth_value:function(t,e){return e=+e,e>0||je("nth_value nth must be greater than zero."),{next:n=>{const r=n.i0+(e-1);return re=null,next:n=>{const r=t(n.data[n.index]);return r!=null?e=r:e}}},next_value:function(t){let e,n;return{init:()=>(e=null,n=-1),next:r=>{const i=r.data;return r.index<=n?e:(n=R2t(t,i,r.index))<0?(n=i.length,e=null):e=t(i[n])}}}};function R2t(t,e,n){for(let r=e.length;nl[g]=1)}h(t.sort),e.forEach((p,g)=>{const m=n[g],v=r[g],y=i[g]||null,x=Ni(m),b=o$e(p,x,o[g]);if(h(m),s.push(b),vt(OA,p))a.push(M2t(p,m,v,b));else{if(m==null&&p!=="count"&&je("Null aggregate field specified."),p==="count"){u.push(b);return}d=!1;let w=c[x];w||(w=c[x]=[],w.field=m,f.push(w)),w.push(s$e(p,y,b))}}),(u.length||f.length)&&(this.cell=I2t(f,u,d)),this.inputs=Object.keys(l)}const M$e=P$e.prototype;M$e.init=function(){this.windows.forEach(t=>t.init()),this.cell&&this.cell.init()};M$e.update=function(t,e){const n=this.cell,r=this.windows,i=t.data,o=r&&r.length;let s;if(n){for(s=t.p0;sl$e(l,l.field));const r={num:0,agg:null,store:!1,count:e};if(!n)for(var i=t.length,o=r.agg=Array(i),s=0;sthis.group(i(a));let s=this.state;(!s||n)&&(s=this.state=new P$e(t)),n||e.modified(s.inputs)?(this.value={},e.visit(e.SOURCE,a=>o(a).add(a))):(e.visit(e.REM,a=>o(a).remove(a)),e.visit(e.ADD,a=>o(a).add(a)));for(let a=0,l=this._mlen;a0&&!i(o[n],o[n-1])&&(t.i0=e.left(o,o[n])),r1?0:t<-1?iy:Math.acos(t)}function sge(t){return t>=1?xN:t<=-1?-xN:Math.asin(t)}const uX=Math.PI,fX=2*uX,j0=1e-6,B2t=fX-j0;function R$e(t){this._+=t[0];for(let e=1,n=t.length;e=0))throw new Error(`invalid digits: ${t}`);if(e>15)return R$e;const n=10**e;return function(r){this._+=r[0];for(let i=1,o=r.length;ij0)if(!(Math.abs(f*l-c*u)>j0)||!o)this._append`L${this._x1=e},${this._y1=n}`;else{let h=r-s,p=i-a,g=l*l+c*c,m=h*h+p*p,v=Math.sqrt(g),y=Math.sqrt(d),x=o*Math.tan((uX-Math.acos((g+d-m)/(2*v*y)))/2),b=x/y,w=x/v;Math.abs(b-1)>j0&&this._append`L${e+b*u},${n+b*f}`,this._append`A${o},${o},0,0,${+(f*h>u*p)},${this._x1=e+w*l},${this._y1=n+w*c}`}}arc(e,n,r,i,o,s){if(e=+e,n=+n,r=+r,s=!!s,r<0)throw new Error(`negative radius: ${r}`);let a=r*Math.cos(i),l=r*Math.sin(i),c=e+a,u=n+l,f=1^s,d=s?i-o:o-i;this._x1===null?this._append`M${c},${u}`:(Math.abs(this._x1-c)>j0||Math.abs(this._y1-u)>j0)&&this._append`L${c},${u}`,r&&(d<0&&(d=d%fX+fX),d>B2t?this._append`A${r},${r},0,1,${f},${e-a},${n-l}A${r},${r},0,1,${f},${this._x1=c},${this._y1=u}`:d>j0&&this._append`A${r},${r},0,${+(d>=uX)},${f},${this._x1=e+r*Math.cos(o)},${this._y1=n+r*Math.sin(o)}`)}rect(e,n,r,i){this._append`M${this._x0=this._x1=+e},${this._y0=this._y1=+n}h${r=+r}v${+i}h${-r}Z`}toString(){return this._}};function cB(){return new Cre}cB.prototype=Cre.prototype;function uB(t){let e=3;return t.digits=function(n){if(!arguments.length)return e;if(n==null)e=null;else{const r=Math.floor(n);if(!(r>=0))throw new RangeError(`invalid digits: ${n}`);e=r}return t},()=>new Cre(e)}function W2t(t){return t.innerRadius}function V2t(t){return t.outerRadius}function G2t(t){return t.startAngle}function H2t(t){return t.endAngle}function q2t(t){return t&&t.padAngle}function X2t(t,e,n,r,i,o,s,a){var l=n-t,c=r-e,u=s-i,f=a-o,d=f*l-u*c;if(!(d*d<$s))return d=(u*(e-o)-f*(t-i))/d,[t+d*l,e+d*c]}function AI(t,e,n,r,i,o,s){var a=t-n,l=e-r,c=(s?o:-o)/ds(a*a+l*l),u=c*l,f=-c*a,d=t+u,h=e+f,p=n+u,g=r+f,m=(d+p)/2,v=(h+g)/2,y=p-d,x=g-h,b=y*y+x*x,w=i-o,_=d*g-p*h,S=(x<0?-1:1)*ds(z2t(0,w*w*b-_*_)),O=(_*x-y*S)/b,k=(-_*y-x*S)/b,E=(_*x+y*S)/b,P=(-_*y+x*S)/b,A=O-m,R=k-v,T=E-m,M=P-v;return A*A+R*R>T*T+M*M&&(O=E,k=P),{cx:O,cy:k,x01:-u,y01:-f,x11:O*(i/w-1),y11:k*(i/w-1)}}function Y2t(){var t=W2t,e=V2t,n=Nn(0),r=null,i=G2t,o=H2t,s=q2t,a=null,l=uB(c);function c(){var u,f,d=+t.apply(this,arguments),h=+e.apply(this,arguments),p=i.apply(this,arguments)-xN,g=o.apply(this,arguments)-xN,m=oge(g-p),v=g>p;if(a||(a=u=l()),h$s))a.moveTo(0,0);else if(m>oR-$s)a.moveTo(h*Tp(p),h*Va(p)),a.arc(0,0,h,p,g,!v),d>$s&&(a.moveTo(d*Tp(g),d*Va(g)),a.arc(0,0,d,g,p,v));else{var y=p,x=g,b=p,w=g,_=m,S=m,O=s.apply(this,arguments)/2,k=O>$s&&(r?+r.apply(this,arguments):ds(d*d+h*h)),E=GW(oge(h-d)/2,+n.apply(this,arguments)),P=E,A=E,R,T;if(k>$s){var M=sge(k/d*Va(O)),I=sge(k/h*Va(O));(_-=M*2)>$s?(M*=v?1:-1,b+=M,w-=M):(_=0,b=w=(p+g)/2),(S-=I*2)>$s?(I*=v?1:-1,y+=I,x-=I):(S=0,y=x=(p+g)/2)}var j=h*Tp(y),N=h*Va(y),z=d*Tp(w),L=d*Va(w);if(E>$s){var B=h*Tp(x),F=h*Va(x),$=d*Tp(b),q=d*Va(b),G;if(m$s?A>$s?(R=AI($,q,j,N,h,A,v),T=AI(B,F,z,L,h,A,v),a.moveTo(R.cx+R.x01,R.cy+R.y01),A$s)||!(_>$s)?a.lineTo(z,L):P>$s?(R=AI(z,L,B,F,d,-P,v),T=AI(j,N,$,q,d,-P,v),a.lineTo(R.cx+R.x01,R.cy+R.y01),P=h;--p)a.point(x[p],b[p]);a.lineEnd(),a.areaEnd()}v&&(x[d]=+t(m,d,f),b[d]=+e(m,d,f),a.point(r?+r(m,d,f):x[d],n?+n(m,d,f):b[d]))}if(y)return a=null,y+""||null}function u(){return Ere().defined(i).curve(s).context(o)}return c.x=function(f){return arguments.length?(t=typeof f=="function"?f:Nn(+f),r=null,c):t},c.x0=function(f){return arguments.length?(t=typeof f=="function"?f:Nn(+f),c):t},c.x1=function(f){return arguments.length?(r=f==null?null:typeof f=="function"?f:Nn(+f),c):r},c.y=function(f){return arguments.length?(e=typeof f=="function"?f:Nn(+f),n=null,c):e},c.y0=function(f){return arguments.length?(e=typeof f=="function"?f:Nn(+f),c):e},c.y1=function(f){return arguments.length?(n=f==null?null:typeof f=="function"?f:Nn(+f),c):n},c.lineX0=c.lineY0=function(){return u().x(t).y(e)},c.lineY1=function(){return u().x(t).y(n)},c.lineX1=function(){return u().x(r).y(e)},c.defined=function(f){return arguments.length?(i=typeof f=="function"?f:Nn(!!f),c):i},c.curve=function(f){return arguments.length?(s=f,o!=null&&(a=s(o)),c):s},c.context=function(f){return arguments.length?(f==null?o=a=null:a=s(o=f),c):o},c}class $$e{constructor(e,n){this._context=e,this._x=n}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line}point(e,n){switch(e=+e,n=+n,this._point){case 0:{this._point=1,this._line?this._context.lineTo(e,n):this._context.moveTo(e,n);break}case 1:this._point=2;default:{this._x?this._context.bezierCurveTo(this._x0=(this._x0+e)/2,this._y0,this._x0,n,e,n):this._context.bezierCurveTo(this._x0,this._y0=(this._y0+n)/2,e,this._y0,e,n);break}}this._x0=e,this._y0=n}}function Q2t(t){return new $$e(t,!0)}function K2t(t){return new $$e(t,!1)}const Tre={draw(t,e){const n=ds(e/iy);t.moveTo(n,0),t.arc(0,0,n,0,oR)}},Z2t={draw(t,e){const n=ds(e/5)/2;t.moveTo(-3*n,-n),t.lineTo(-n,-n),t.lineTo(-n,-3*n),t.lineTo(n,-3*n),t.lineTo(n,-n),t.lineTo(3*n,-n),t.lineTo(3*n,n),t.lineTo(n,n),t.lineTo(n,3*n),t.lineTo(-n,3*n),t.lineTo(-n,n),t.lineTo(-3*n,n),t.closePath()}},F$e=ds(1/3),J2t=F$e*2,eTt={draw(t,e){const n=ds(e/J2t),r=n*F$e;t.moveTo(0,-n),t.lineTo(r,0),t.lineTo(0,n),t.lineTo(-r,0),t.closePath()}},tTt={draw(t,e){const n=ds(e),r=-n/2;t.rect(r,r,n,n)}},nTt=.8908130915292852,N$e=Va(iy/10)/Va(7*iy/10),rTt=Va(oR/10)*N$e,iTt=-Tp(oR/10)*N$e,oTt={draw(t,e){const n=ds(e*nTt),r=rTt*n,i=iTt*n;t.moveTo(0,-n),t.lineTo(r,i);for(let o=1;o<5;++o){const s=oR*o/5,a=Tp(s),l=Va(s);t.lineTo(l*n,-a*n),t.lineTo(a*r-l*i,l*r+a*i)}t.closePath()}},HW=ds(3),sTt={draw(t,e){const n=-ds(e/(HW*3));t.moveTo(0,n*2),t.lineTo(-HW*n,-n),t.lineTo(HW*n,-n),t.closePath()}},$c=-.5,Fc=ds(3)/2,dX=1/ds(12),aTt=(dX/2+1)*3,lTt={draw(t,e){const n=ds(e/aTt),r=n/2,i=n*dX,o=r,s=n*dX+n,a=-o,l=s;t.moveTo(r,i),t.lineTo(o,s),t.lineTo(a,l),t.lineTo($c*r-Fc*i,Fc*r+$c*i),t.lineTo($c*o-Fc*s,Fc*o+$c*s),t.lineTo($c*a-Fc*l,Fc*a+$c*l),t.lineTo($c*r+Fc*i,$c*i-Fc*r),t.lineTo($c*o+Fc*s,$c*s-Fc*o),t.lineTo($c*a+Fc*l,$c*l-Fc*a),t.closePath()}};function z$e(t,e){let n=null,r=uB(i);t=typeof t=="function"?t:Nn(t||Tre),e=typeof e=="function"?e:Nn(e===void 0?64:+e);function i(){let o;if(n||(n=o=r()),t.apply(this,arguments).draw(n,+e.apply(this,arguments)),o)return n=null,o+""||null}return i.type=function(o){return arguments.length?(t=typeof o=="function"?o:Nn(o),i):t},i.size=function(o){return arguments.length?(e=typeof o=="function"?o:Nn(+o),i):e},i.context=function(o){return arguments.length?(n=o??null,i):n},i}function oy(){}function bN(t,e,n){t._context.bezierCurveTo((2*t._x0+t._x1)/3,(2*t._y0+t._y1)/3,(t._x0+2*t._x1)/3,(t._y0+2*t._y1)/3,(t._x0+4*t._x1+e)/6,(t._y0+4*t._y1+n)/6)}function fB(t){this._context=t}fB.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:bN(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:bN(this,t,e);break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}};function j$e(t){return new fB(t)}function B$e(t){this._context=t}B$e.prototype={areaStart:oy,areaEnd:oy,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._y0=this._y1=this._y2=this._y3=this._y4=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x2,this._y2),this._context.closePath();break}case 2:{this._context.moveTo((this._x2+2*this._x3)/3,(this._y2+2*this._y3)/3),this._context.lineTo((this._x3+2*this._x2)/3,(this._y3+2*this._y2)/3),this._context.closePath();break}case 3:{this.point(this._x2,this._y2),this.point(this._x3,this._y3),this.point(this._x4,this._y4);break}}},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._x2=t,this._y2=e;break;case 1:this._point=2,this._x3=t,this._y3=e;break;case 2:this._point=3,this._x4=t,this._y4=e,this._context.moveTo((this._x0+4*this._x1+t)/6,(this._y0+4*this._y1+e)/6);break;default:bN(this,t,e);break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}};function U$e(t){return new B$e(t)}function W$e(t){this._context=t}W$e.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var n=(this._x0+4*this._x1+t)/6,r=(this._y0+4*this._y1+e)/6;this._line?this._context.lineTo(n,r):this._context.moveTo(n,r);break;case 3:this._point=4;default:bN(this,t,e);break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}};function V$e(t){return new W$e(t)}function G$e(t,e){this._basis=new fB(t),this._beta=e}G$e.prototype={lineStart:function(){this._x=[],this._y=[],this._basis.lineStart()},lineEnd:function(){var t=this._x,e=this._y,n=t.length-1;if(n>0)for(var r=t[0],i=e[0],o=t[n]-r,s=e[n]-i,a=-1,l;++a<=n;)l=a/n,this._basis.point(this._beta*t[a]+(1-this._beta)*(r+l*o),this._beta*e[a]+(1-this._beta)*(i+l*s));this._x=this._y=null,this._basis.lineEnd()},point:function(t,e){this._x.push(+t),this._y.push(+e)}};const cTt=function t(e){function n(r){return e===1?new fB(r):new G$e(r,e)}return n.beta=function(r){return t(+r)},n}(.85);function wN(t,e,n){t._context.bezierCurveTo(t._x1+t._k*(t._x2-t._x0),t._y1+t._k*(t._y2-t._y0),t._x2+t._k*(t._x1-e),t._y2+t._k*(t._y1-n),t._x2,t._y2)}function kre(t,e){this._context=t,this._k=(1-e)/6}kre.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:wN(this,this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2,this._x1=t,this._y1=e;break;case 2:this._point=3;default:wN(this,t,e);break}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};const uTt=function t(e){function n(r){return new kre(r,e)}return n.tension=function(r){return t(+r)},n}(0);function Are(t,e){this._context=t,this._k=(1-e)/6}Are.prototype={areaStart:oy,areaEnd:oy,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x3,this._y3),this._context.closePath();break}case 2:{this._context.lineTo(this._x3,this._y3),this._context.closePath();break}case 3:{this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5);break}}},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._x3=t,this._y3=e;break;case 1:this._point=2,this._context.moveTo(this._x4=t,this._y4=e);break;case 2:this._point=3,this._x5=t,this._y5=e;break;default:wN(this,t,e);break}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};const fTt=function t(e){function n(r){return new Are(r,e)}return n.tension=function(r){return t(+r)},n}(0);function Pre(t,e){this._context=t,this._k=(1-e)/6}Pre.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:wN(this,t,e);break}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};const dTt=function t(e){function n(r){return new Pre(r,e)}return n.tension=function(r){return t(+r)},n}(0);function Mre(t,e,n){var r=t._x1,i=t._y1,o=t._x2,s=t._y2;if(t._l01_a>$s){var a=2*t._l01_2a+3*t._l01_a*t._l12_a+t._l12_2a,l=3*t._l01_a*(t._l01_a+t._l12_a);r=(r*a-t._x0*t._l12_2a+t._x2*t._l01_2a)/l,i=(i*a-t._y0*t._l12_2a+t._y2*t._l01_2a)/l}if(t._l23_a>$s){var c=2*t._l23_2a+3*t._l23_a*t._l12_a+t._l12_2a,u=3*t._l23_a*(t._l23_a+t._l12_a);o=(o*c+t._x1*t._l23_2a-e*t._l12_2a)/u,s=(s*c+t._y1*t._l23_2a-n*t._l12_2a)/u}t._context.bezierCurveTo(r,i,o,s,t._x2,t._y2)}function H$e(t,e){this._context=t,this._alpha=e}H$e.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:this.point(this._x2,this._y2);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){if(t=+t,e=+e,this._point){var n=this._x2-t,r=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+r*r,this._alpha))}switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3;default:Mre(this,t,e);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};const hTt=function t(e){function n(r){return e?new H$e(r,e):new kre(r,0)}return n.alpha=function(r){return t(+r)},n}(.5);function q$e(t,e){this._context=t,this._alpha=e}q$e.prototype={areaStart:oy,areaEnd:oy,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x3,this._y3),this._context.closePath();break}case 2:{this._context.lineTo(this._x3,this._y3),this._context.closePath();break}case 3:{this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5);break}}},point:function(t,e){if(t=+t,e=+e,this._point){var n=this._x2-t,r=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+r*r,this._alpha))}switch(this._point){case 0:this._point=1,this._x3=t,this._y3=e;break;case 1:this._point=2,this._context.moveTo(this._x4=t,this._y4=e);break;case 2:this._point=3,this._x5=t,this._y5=e;break;default:Mre(this,t,e);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};const pTt=function t(e){function n(r){return e?new q$e(r,e):new Are(r,0)}return n.alpha=function(r){return t(+r)},n}(.5);function X$e(t,e){this._context=t,this._alpha=e}X$e.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){if(t=+t,e=+e,this._point){var n=this._x2-t,r=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+r*r,this._alpha))}switch(this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:Mre(this,t,e);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};const gTt=function t(e){function n(r){return e?new X$e(r,e):new Pre(r,0)}return n.alpha=function(r){return t(+r)},n}(.5);function Y$e(t){this._context=t}Y$e.prototype={areaStart:oy,areaEnd:oy,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(t,e){t=+t,e=+e,this._point?this._context.lineTo(t,e):(this._point=1,this._context.moveTo(t,e))}};function Q$e(t){return new Y$e(t)}function age(t){return t<0?-1:1}function lge(t,e,n){var r=t._x1-t._x0,i=e-t._x1,o=(t._y1-t._y0)/(r||i<0&&-0),s=(n-t._y1)/(i||r<0&&-0),a=(o*i+s*r)/(r+i);return(age(o)+age(s))*Math.min(Math.abs(o),Math.abs(s),.5*Math.abs(a))||0}function cge(t,e){var n=t._x1-t._x0;return n?(3*(t._y1-t._y0)/n-e)/2:e}function qW(t,e,n){var r=t._x0,i=t._y0,o=t._x1,s=t._y1,a=(o-r)/3;t._context.bezierCurveTo(r+a,i+a*e,o-a,s-a*n,o,s)}function _N(t){this._context=t}_N.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:qW(this,this._t0,cge(this,this._t0));break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){var n=NaN;if(t=+t,e=+e,!(t===this._x1&&e===this._y1)){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3,qW(this,cge(this,n=lge(this,t,e)),n);break;default:qW(this,this._t0,n=lge(this,t,e));break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e,this._t0=n}}};function K$e(t){this._context=new Z$e(t)}(K$e.prototype=Object.create(_N.prototype)).point=function(t,e){_N.prototype.point.call(this,e,t)};function Z$e(t){this._context=t}Z$e.prototype={moveTo:function(t,e){this._context.moveTo(e,t)},closePath:function(){this._context.closePath()},lineTo:function(t,e){this._context.lineTo(e,t)},bezierCurveTo:function(t,e,n,r,i,o){this._context.bezierCurveTo(e,t,r,n,o,i)}};function J$e(t){return new _N(t)}function e3e(t){return new K$e(t)}function t3e(t){this._context=t}t3e.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var t=this._x,e=this._y,n=t.length;if(n)if(this._line?this._context.lineTo(t[0],e[0]):this._context.moveTo(t[0],e[0]),n===2)this._context.lineTo(t[1],e[1]);else for(var r=uge(t),i=uge(e),o=0,s=1;s=0;--e)i[e]=(s[e]-i[e+1])/o[e];for(o[n-1]=(t[n]+i[n-1])/2,e=0;e=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;default:{if(this._t<=0)this._context.lineTo(this._x,e),this._context.lineTo(t,e);else{var n=this._x*(1-this._t)+t*this._t;this._context.lineTo(n,this._y),this._context.lineTo(n,e)}break}}this._x=t,this._y=e}};function r3e(t){return new dB(t,.5)}function i3e(t){return new dB(t,0)}function o3e(t){return new dB(t,1)}function LS(t,e){if((s=t.length)>1)for(var n=1,r,i,o=t[e[0]],s,a=o.length;n=0;)n[e]=e;return n}function mTt(t,e){return t[e]}function vTt(t){const e=[];return e.key=t,e}function yTt(){var t=Nn([]),e=hX,n=LS,r=mTt;function i(o){var s=Array.from(t.apply(this,arguments),vTt),a,l=s.length,c=-1,u;for(const f of o)for(a=0,++c;a0){for(var n,r,i=0,o=t[0].length,s;i0){for(var n=0,r=t[e[0]],i,o=r.length;n0)||!((o=(i=t[e[0]]).length)>0))){for(var n=0,r=1,i,o,s;rtypeof Image<"u"?Image:null;function Nu(t,e){switch(arguments.length){case 0:break;case 1:this.range(t);break;default:this.range(e).domain(t);break}return this}function Hg(t,e){switch(arguments.length){case 0:break;case 1:{typeof t=="function"?this.interpolator(t):this.range(t);break}default:{this.domain(t),typeof e=="function"?this.interpolator(e):this.range(e);break}}return this}const SN=Symbol("implicit");function aR(){var t=new Tpe,e=[],n=[],r=SN;function i(o){let s=t.get(o);if(s===void 0){if(r!==SN)return r;t.set(o,s=e.push(o)-1)}return n[s%n.length]}return i.domain=function(o){if(!arguments.length)return e.slice();e=[],t=new Tpe;for(const s of o)t.has(s)||t.set(s,e.push(s)-1);return i},i.range=function(o){return arguments.length?(n=Array.from(o),i):n.slice()},i.unknown=function(o){return arguments.length?(r=o,i):r},i.copy=function(){return aR(e,n).unknown(r)},Nu.apply(i,arguments),i}function EA(){var t=aR().unknown(void 0),e=t.domain,n=t.range,r=0,i=1,o,s,a=!1,l=0,c=0,u=.5;delete t.unknown;function f(){var d=e().length,h=i>8&15|e>>4&240,e>>4&15|e&240,(e&15)<<4|e&15,1):n===8?PI(e>>24&255,e>>16&255,e>>8&255,(e&255)/255):n===4?PI(e>>12&15|e>>8&240,e>>8&15|e>>4&240,e>>4&15|e&240,((e&15)<<4|e&15)/255):null):(e=CTt.exec(t))?new Lo(e[1],e[2],e[3],1):(e=OTt.exec(t))?new Lo(e[1]*255/100,e[2]*255/100,e[3]*255/100,1):(e=ETt.exec(t))?PI(e[1],e[2],e[3],e[4]):(e=TTt.exec(t))?PI(e[1]*255/100,e[2]*255/100,e[3]*255/100,e[4]):(e=kTt.exec(t))?vge(e[1],e[2]/100,e[3]/100,1):(e=ATt.exec(t))?vge(e[1],e[2]/100,e[3]/100,e[4]):fge.hasOwnProperty(t)?pge(fge[t]):t==="transparent"?new Lo(NaN,NaN,NaN,0):null}function pge(t){return new Lo(t>>16&255,t>>8&255,t&255,1)}function PI(t,e,n,r){return r<=0&&(t=e=n=NaN),new Lo(t,e,n,r)}function Rre(t){return t instanceof By||(t=kA(t)),t?(t=t.rgb(),new Lo(t.r,t.g,t.b,t.opacity)):new Lo}function sy(t,e,n,r){return arguments.length===1?Rre(t):new Lo(t,e,n,r??1)}function Lo(t,e,n,r){this.r=+t,this.g=+e,this.b=+n,this.opacity=+r}CO(Lo,sy,lR(By,{brighter(t){return t=t==null?$S:Math.pow($S,t),new Lo(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=t==null?ub:Math.pow(ub,t),new Lo(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new Lo($x(this.r),$x(this.g),$x(this.b),CN(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:gge,formatHex:gge,formatHex8:RTt,formatRgb:mge,toString:mge}));function gge(){return`#${px(this.r)}${px(this.g)}${px(this.b)}`}function RTt(){return`#${px(this.r)}${px(this.g)}${px(this.b)}${px((isNaN(this.opacity)?1:this.opacity)*255)}`}function mge(){const t=CN(this.opacity);return`${t===1?"rgb(":"rgba("}${$x(this.r)}, ${$x(this.g)}, ${$x(this.b)}${t===1?")":`, ${t})`}`}function CN(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function $x(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function px(t){return t=$x(t),(t<16?"0":"")+t.toString(16)}function vge(t,e,n,r){return r<=0?t=e=n=NaN:n<=0||n>=1?t=e=NaN:e<=0&&(t=NaN),new Sf(t,e,n,r)}function a3e(t){if(t instanceof Sf)return new Sf(t.h,t.s,t.l,t.opacity);if(t instanceof By||(t=kA(t)),!t)return new Sf;if(t instanceof Sf)return t;t=t.rgb();var e=t.r/255,n=t.g/255,r=t.b/255,i=Math.min(e,n,r),o=Math.max(e,n,r),s=NaN,a=o-i,l=(o+i)/2;return a?(e===o?s=(n-r)/a+(n0&&l<1?0:s,new Sf(s,a,l,t.opacity)}function ON(t,e,n,r){return arguments.length===1?a3e(t):new Sf(t,e,n,r??1)}function Sf(t,e,n,r){this.h=+t,this.s=+e,this.l=+n,this.opacity=+r}CO(Sf,ON,lR(By,{brighter(t){return t=t==null?$S:Math.pow($S,t),new Sf(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=t==null?ub:Math.pow(ub,t),new Sf(this.h,this.s,this.l*t,this.opacity)},rgb(){var t=this.h%360+(this.h<0)*360,e=isNaN(t)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*e,i=2*n-r;return new Lo(XW(t>=240?t-240:t+120,i,r),XW(t,i,r),XW(t<120?t+240:t-120,i,r),this.opacity)},clamp(){return new Sf(yge(this.h),MI(this.s),MI(this.l),CN(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const t=CN(this.opacity);return`${t===1?"hsl(":"hsla("}${yge(this.h)}, ${MI(this.s)*100}%, ${MI(this.l)*100}%${t===1?")":`, ${t})`}`}}));function yge(t){return t=(t||0)%360,t<0?t+360:t}function MI(t){return Math.max(0,Math.min(1,t||0))}function XW(t,e,n){return(t<60?e+(n-e)*t/60:t<180?n:t<240?e+(n-e)*(240-t)/60:e)*255}const l3e=Math.PI/180,c3e=180/Math.PI,EN=18,u3e=.96422,f3e=1,d3e=.82521,h3e=4/29,I_=6/29,p3e=3*I_*I_,DTt=I_*I_*I_;function g3e(t){if(t instanceof ph)return new ph(t.l,t.a,t.b,t.opacity);if(t instanceof qp)return m3e(t);t instanceof Lo||(t=Rre(t));var e=ZW(t.r),n=ZW(t.g),r=ZW(t.b),i=YW((.2225045*e+.7168786*n+.0606169*r)/f3e),o,s;return e===n&&n===r?o=s=i:(o=YW((.4360747*e+.3850649*n+.1430804*r)/u3e),s=YW((.0139322*e+.0971045*n+.7141733*r)/d3e)),new ph(116*i-16,500*(o-i),200*(i-s),t.opacity)}function TN(t,e,n,r){return arguments.length===1?g3e(t):new ph(t,e,n,r??1)}function ph(t,e,n,r){this.l=+t,this.a=+e,this.b=+n,this.opacity=+r}CO(ph,TN,lR(By,{brighter(t){return new ph(this.l+EN*(t??1),this.a,this.b,this.opacity)},darker(t){return new ph(this.l-EN*(t??1),this.a,this.b,this.opacity)},rgb(){var t=(this.l+16)/116,e=isNaN(this.a)?t:t+this.a/500,n=isNaN(this.b)?t:t-this.b/200;return e=u3e*QW(e),t=f3e*QW(t),n=d3e*QW(n),new Lo(KW(3.1338561*e-1.6168667*t-.4906146*n),KW(-.9787684*e+1.9161415*t+.033454*n),KW(.0719453*e-.2289914*t+1.4052427*n),this.opacity)}}));function YW(t){return t>DTt?Math.pow(t,1/3):t/p3e+h3e}function QW(t){return t>I_?t*t*t:p3e*(t-h3e)}function KW(t){return 255*(t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055)}function ZW(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function ITt(t){if(t instanceof qp)return new qp(t.h,t.c,t.l,t.opacity);if(t instanceof ph||(t=g3e(t)),t.a===0&&t.b===0)return new qp(NaN,0=1?(n=1,e-1):Math.floor(n*e),i=t[r],o=t[r+1],s=r>0?t[r-1]:2*i-o,a=r()=>t;function w3e(t,e){return function(n){return t+n*e}}function $Tt(t,e,n){return t=Math.pow(t,n),e=Math.pow(e,n)-t,n=1/n,function(r){return Math.pow(t+r*e,n)}}function gB(t,e){var n=e-t;return n?w3e(t,n>180||n<-180?n-360*Math.round(n/360):n):pB(isNaN(t)?e:t)}function FTt(t){return(t=+t)==1?$o:function(e,n){return n-e?$Tt(e,n,t):pB(isNaN(e)?n:e)}}function $o(t,e){var n=e-t;return n?w3e(t,n):pB(isNaN(t)?e:t)}const gX=function t(e){var n=FTt(e);function r(i,o){var s=n((i=sy(i)).r,(o=sy(o)).r),a=n(i.g,o.g),l=n(i.b,o.b),c=$o(i.opacity,o.opacity);return function(u){return i.r=s(u),i.g=a(u),i.b=l(u),i.opacity=c(u),i+""}}return r.gamma=t,r}(1);function _3e(t){return function(e){var n=e.length,r=new Array(n),i=new Array(n),o=new Array(n),s,a;for(s=0;sn&&(o=e.slice(n,o),a[s]?a[s]+=o:a[++s]=o),(r=r[0])===(i=i[0])?a[s]?a[s]+=i:a[++s]=i:(a[++s]=null,l.push({i:s,x:yf(r,i)})),n=JW.lastIndex;return n180?u+=360:u-c>180&&(c+=360),d.push({i:f.push(i(f)+"rotate(",null,r)-2,x:yf(c,u)})):u&&f.push(i(f)+"rotate("+u+r)}function a(c,u,f,d){c!==u?d.push({i:f.push(i(f)+"skewX(",null,r)-2,x:yf(c,u)}):u&&f.push(i(f)+"skewX("+u+r)}function l(c,u,f,d,h,p){if(c!==f||u!==d){var g=h.push(i(h)+"scale(",null,",",null,")");p.push({i:g-4,x:yf(c,f)},{i:g-2,x:yf(u,d)})}else(f!==1||d!==1)&&h.push(i(h)+"scale("+f+","+d+")")}return function(c,u){var f=[],d=[];return c=t(c),u=t(u),o(c.translateX,c.translateY,u.translateX,u.translateY,f,d),s(c.rotate,u.rotate,f,d),a(c.skewX,u.skewX,f,d),l(c.scaleX,c.scaleY,u.scaleX,u.scaleY,f,d),c=u=null,function(h){for(var p=-1,g=d.length,m;++pe&&(n=t,t=e,e=n),function(r){return Math.max(t,Math.min(e,r))}}function ukt(t,e,n){var r=t[0],i=t[1],o=e[0],s=e[1];return i2?fkt:ukt,l=c=null,f}function f(d){return d==null||isNaN(d=+d)?o:(l||(l=a(t.map(r),e,n)))(r(s(d)))}return f.invert=function(d){return s(i((c||(c=a(e,t.map(r),yf)))(d)))},f.domain=function(d){return arguments.length?(t=Array.from(d,AN),u()):t.slice()},f.range=function(d){return arguments.length?(e=Array.from(d),u()):e.slice()},f.rangeRound=function(d){return e=Array.from(d),n=cR,u()},f.clamp=function(d){return arguments.length?(s=d?!0:ba,u()):s!==ba},f.interpolate=function(d){return arguments.length?(n=d,u()):n},f.unknown=function(d){return arguments.length?(o=d,f):o},function(d,h){return r=d,i=h,u()}}function Fre(){return mB()(ba,ba)}function Nre(t,e,n,r){var i=ny(t,e,n),o;switch(r=cb(r??",f"),r.type){case"s":{var s=Math.max(Math.abs(t),Math.abs(e));return r.precision==null&&!isNaN(o=YIe(i,s))&&(r.precision=o),_ne(r,s)}case"":case"e":case"g":case"p":case"r":{r.precision==null&&!isNaN(o=QIe(i,Math.max(Math.abs(t),Math.abs(e))))&&(r.precision=o-(r.type==="e"));break}case"f":case"%":{r.precision==null&&!isNaN(o=XIe(i))&&(r.precision=o-(r.type==="%")*2);break}}return G4(r)}function Wy(t){var e=t.domain;return t.ticks=function(n){var r=e();return Kq(r[0],r[r.length-1],n??10)},t.tickFormat=function(n,r){var i=e();return Nre(i[0],i[i.length-1],n??10,r)},t.nice=function(n){n==null&&(n=10);var r=e(),i=0,o=r.length-1,s=r[i],a=r[o],l,c,u=10;for(a0;){if(c=Zq(s,a,n),c===l)return r[i]=s,r[o]=a,e(r);if(c>0)s=Math.floor(s/c)*c,a=Math.ceil(a/c)*c;else if(c<0)s=Math.ceil(s*c)/c,a=Math.floor(a*c)/c;else break;l=c}return t},t}function PA(){var t=Fre();return t.copy=function(){return uR(t,PA())},Nu.apply(t,arguments),Wy(t)}function zre(t){var e;function n(r){return r==null||isNaN(r=+r)?e:r}return n.invert=n,n.domain=n.range=function(r){return arguments.length?(t=Array.from(r,AN),n):t.slice()},n.unknown=function(r){return arguments.length?(e=r,n):e},n.copy=function(){return zre(t).unknown(e)},t=arguments.length?Array.from(t,AN):[0,1],Wy(n)}function D3e(t,e){t=t.slice();var n=0,r=t.length-1,i=t[n],o=t[r],s;return oMath.pow(t,e)}function mkt(t){return t===Math.E?Math.log:t===10&&Math.log10||t===2&&Math.log2||(t=Math.log(t),e=>Math.log(e)/t)}function Tge(t){return(e,n)=>-t(-e,n)}function jre(t){const e=t(Oge,Ege),n=e.domain;let r=10,i,o;function s(){return i=mkt(r),o=gkt(r),n()[0]<0?(i=Tge(i),o=Tge(o),t(dkt,hkt)):t(Oge,Ege),e}return e.base=function(a){return arguments.length?(r=+a,s()):r},e.domain=function(a){return arguments.length?(n(a),s()):n()},e.ticks=a=>{const l=n();let c=l[0],u=l[l.length-1];const f=u0){for(;d<=h;++d)for(p=1;pu)break;v.push(g)}}else for(;d<=h;++d)for(p=r-1;p>=1;--p)if(g=d>0?p/o(-d):p*o(d),!(gu)break;v.push(g)}v.length*2{if(a==null&&(a=10),l==null&&(l=r===10?"s":","),typeof l!="function"&&(!(r%1)&&(l=cb(l)).precision==null&&(l.trim=!0),l=G4(l)),a===1/0)return l;const c=Math.max(1,r*a/e.ticks().length);return u=>{let f=u/o(Math.round(i(u)));return f*rn(D3e(n(),{floor:a=>o(Math.floor(i(a))),ceil:a=>o(Math.ceil(i(a)))})),e}function Bre(){const t=jre(mB()).domain([1,10]);return t.copy=()=>uR(t,Bre()).base(t.base()),Nu.apply(t,arguments),t}function kge(t){return function(e){return Math.sign(e)*Math.log1p(Math.abs(e/t))}}function Age(t){return function(e){return Math.sign(e)*Math.expm1(Math.abs(e))*t}}function Ure(t){var e=1,n=t(kge(e),Age(e));return n.constant=function(r){return arguments.length?t(kge(e=+r),Age(e)):e},Wy(n)}function Wre(){var t=Ure(mB());return t.copy=function(){return uR(t,Wre()).constant(t.constant())},Nu.apply(t,arguments)}function Pge(t){return function(e){return e<0?-Math.pow(-e,t):Math.pow(e,t)}}function vkt(t){return t<0?-Math.sqrt(-t):Math.sqrt(t)}function ykt(t){return t<0?-t*t:t*t}function Vre(t){var e=t(ba,ba),n=1;function r(){return n===1?t(ba,ba):n===.5?t(vkt,ykt):t(Pge(n),Pge(1/n))}return e.exponent=function(i){return arguments.length?(n=+i,r()):n},Wy(e)}function vB(){var t=Vre(mB());return t.copy=function(){return uR(t,vB()).exponent(t.exponent())},Nu.apply(t,arguments),t}function I3e(){return vB.apply(null,arguments).exponent(.5)}function Mge(t){return Math.sign(t)*t*t}function xkt(t){return Math.sign(t)*Math.sqrt(Math.abs(t))}function L3e(){var t=Fre(),e=[0,1],n=!1,r;function i(o){var s=xkt(t(o));return isNaN(s)?r:n?Math.round(s):s}return i.invert=function(o){return t.invert(Mge(o))},i.domain=function(o){return arguments.length?(t.domain(o),i):t.domain()},i.range=function(o){return arguments.length?(t.range((e=Array.from(o,AN)).map(Mge)),i):e.slice()},i.rangeRound=function(o){return i.range(o).round(!0)},i.round=function(o){return arguments.length?(n=!!o,i):n},i.clamp=function(o){return arguments.length?(t.clamp(o),i):t.clamp()},i.unknown=function(o){return arguments.length?(r=o,i):r},i.copy=function(){return L3e(t.domain(),e).round(n).clamp(t.clamp()).unknown(r)},Nu.apply(i,arguments),Wy(i)}function Gre(){var t=[],e=[],n=[],r;function i(){var s=0,a=Math.max(1,e.length);for(n=new Array(a-1);++s0?n[a-1]:t[0],a=n?[r[n-1],e]:[r[c-1],r[c]]},s.unknown=function(l){return arguments.length&&(o=l),s},s.thresholds=function(){return r.slice()},s.copy=function(){return Hre().domain([t,e]).range(i).unknown(o)},Nu.apply(Wy(s),arguments)}function qre(){var t=[.5],e=[0,1],n,r=1;function i(o){return o!=null&&o<=o?e[Mg(t,o,0,r)]:n}return i.domain=function(o){return arguments.length?(t=Array.from(o),r=Math.min(t.length,e.length-1),i):t.slice()},i.range=function(o){return arguments.length?(e=Array.from(o),r=Math.min(t.length,e.length-1),i):e.slice()},i.invertExtent=function(o){var s=e.indexOf(o);return[t[s-1],t[s]]},i.unknown=function(o){return arguments.length?(n=o,i):n},i.copy=function(){return qre().domain(t).range(e).unknown(n)},Nu.apply(i,arguments)}function bkt(t){return new Date(t)}function wkt(t){return t instanceof Date?+t:+new Date(+t)}function Xre(t,e,n,r,i,o,s,a,l,c){var u=Fre(),f=u.invert,d=u.domain,h=c(".%L"),p=c(":%S"),g=c("%I:%M"),m=c("%I %p"),v=c("%a %d"),y=c("%b %d"),x=c("%B"),b=c("%Y");function w(_){return(l(_)<_?h:a(_)<_?p:s(_)<_?g:o(_)<_?m:r(_)<_?i(_)<_?v:y:n(_)<_?x:b)(_)}return u.invert=function(_){return new Date(f(_))},u.domain=function(_){return arguments.length?d(Array.from(_,wkt)):d().map(bkt)},u.ticks=function(_){var S=d();return t(S[0],S[S.length-1],_??10)},u.tickFormat=function(_,S){return S==null?w:c(S)},u.nice=function(_){var S=d();return(!_||typeof _.range!="function")&&(_=e(S[0],S[S.length-1],_??10)),_?d(D3e(S,_)):u},u.copy=function(){return uR(u,Xre(t,e,n,r,i,o,s,a,l,c))},u}function $3e(){return Nu.apply(Xre(wCt,_Ct,Ch,wA,xO,rg,X4,H4,Hp,Tne).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)}function F3e(){return Nu.apply(Xre(xCt,bCt,Oh,_A,bO,Nv,Y4,q4,Hp,kne).domain([Date.UTC(2e3,0,1),Date.UTC(2e3,0,2)]),arguments)}function yB(){var t=0,e=1,n,r,i,o,s=ba,a=!1,l;function c(f){return f==null||isNaN(f=+f)?l:s(i===0?.5:(f=(o(f)-n)*i,a?Math.max(0,Math.min(1,f)):f))}c.domain=function(f){return arguments.length?([t,e]=f,n=o(t=+t),r=o(e=+e),i=n===r?0:1/(r-n),c):[t,e]},c.clamp=function(f){return arguments.length?(a=!!f,c):a},c.interpolator=function(f){return arguments.length?(s=f,c):s};function u(f){return function(d){var h,p;return arguments.length?([h,p]=d,s=f(h,p),c):[s(0),s(1)]}}return c.range=u(Uy),c.rangeRound=u(cR),c.unknown=function(f){return arguments.length?(l=f,c):l},function(f){return o=f,n=f(t),r=f(e),i=n===r?0:1/(r-n),c}}function Vy(t,e){return e.domain(t.domain()).interpolator(t.interpolator()).clamp(t.clamp()).unknown(t.unknown())}function xB(){var t=Wy(yB()(ba));return t.copy=function(){return Vy(t,xB())},Hg.apply(t,arguments)}function Yre(){var t=jre(yB()).domain([1,10]);return t.copy=function(){return Vy(t,Yre()).base(t.base())},Hg.apply(t,arguments)}function Qre(){var t=Ure(yB());return t.copy=function(){return Vy(t,Qre()).constant(t.constant())},Hg.apply(t,arguments)}function bB(){var t=Vre(yB());return t.copy=function(){return Vy(t,bB()).exponent(t.exponent())},Hg.apply(t,arguments)}function N3e(){return bB.apply(null,arguments).exponent(.5)}function z3e(){var t=[],e=ba;function n(r){if(r!=null&&!isNaN(r=+r))return e((Mg(t,r,1)-1)/(t.length-1))}return n.domain=function(r){if(!arguments.length)return t.slice();t=[];for(let i of r)i!=null&&!isNaN(i=+i)&&t.push(i);return t.sort(dh),n},n.interpolator=function(r){return arguments.length?(e=r,n):e},n.range=function(){return t.map((r,i)=>e(i/(t.length-1)))},n.quantiles=function(r){return Array.from({length:r+1},(i,o)=>hN(t,o/r))},n.copy=function(){return z3e(e).domain(t)},Hg.apply(n,arguments)}function wB(){var t=0,e=.5,n=1,r=1,i,o,s,a,l,c=ba,u,f=!1,d;function h(g){return isNaN(g=+g)?d:(g=.5+((g=+u(g))-o)*(r*g0?r:1:0}const Rkt="identity",FS="linear",Dg="log",fR="pow",dR="sqrt",SB="symlog",fb="time",db="utc",gh="sequential",OO="diverging",NS="quantile",CB="quantize",OB="threshold",tie="ordinal",xX="point",B3e="band",nie="bin-ordinal",To="continuous",hR="discrete",pR="discretizing",zu="interpolating",rie="temporal";function Dkt(t){return function(e){let n=e[0],r=e[1],i;return r=r&&n[l]<=i&&(o<0&&(o=l),s=l);if(!(o<0))return r=t.invertExtent(n[o]),i=t.invertExtent(n[s]),[r[0]===void 0?r[1]:r[0],i[1]===void 0?i[0]:i[1]]}}function iie(){const t=aR().unknown(void 0),e=t.domain,n=t.range;let r=[0,1],i,o,s=!1,a=0,l=0,c=.5;delete t.unknown;function u(){const f=e().length,d=r[1]g+i*v);return n(d?m.reverse():m)}return t.domain=function(f){return arguments.length?(e(f),u()):e()},t.range=function(f){return arguments.length?(r=[+f[0],+f[1]],u()):r.slice()},t.rangeRound=function(f){return r=[+f[0],+f[1]],s=!0,u()},t.bandwidth=function(){return o},t.step=function(){return i},t.round=function(f){return arguments.length?(s=!!f,u()):s},t.padding=function(f){return arguments.length?(l=Math.max(0,Math.min(1,f)),a=l,u()):a},t.paddingInner=function(f){return arguments.length?(a=Math.max(0,Math.min(1,f)),u()):a},t.paddingOuter=function(f){return arguments.length?(l=Math.max(0,Math.min(1,f)),u()):l},t.align=function(f){return arguments.length?(c=Math.max(0,Math.min(1,f)),u()):c},t.invertRange=function(f){if(f[0]==null||f[1]==null)return;const d=r[1]r[1-d])))return v=Math.max(0,Mg(h,g)-1),y=g===m?v:Mg(h,m)-1,g-h[v]>o+1e-10&&++v,d&&(x=v,v=p-y,y=p-x),v>y?void 0:e().slice(v,y+1)},t.invert=function(f){const d=t.invertRange([f,f]);return d&&d[0]},t.copy=function(){return iie().domain(e()).range(r).round(s).paddingInner(a).paddingOuter(l).align(c)},u()}function U3e(t){const e=t.copy;return t.padding=t.paddingOuter,delete t.paddingInner,t.copy=function(){return U3e(e())},t}function Lkt(){return U3e(iie().paddingInner(1))}var $kt=Array.prototype.map;function Fkt(t){return $kt.call(t,qs)}const Nkt=Array.prototype.slice;function W3e(){let t=[],e=[];function n(r){return r==null||r!==r?void 0:e[(Mg(t,r)-1)%e.length]}return n.domain=function(r){return arguments.length?(t=Fkt(r),n):t.slice()},n.range=function(r){return arguments.length?(e=Nkt.call(r),n):e.slice()},n.tickFormat=function(r,i){return Nre(t[0],$n(t),r??10,i)},n.copy=function(){return W3e().domain(n.domain()).range(n.range())},n}const PN=new Map,V3e=Symbol("vega_scale");function G3e(t){return t[V3e]=!0,t}function zkt(t){return t&&t[V3e]===!0}function jkt(t,e,n){const r=function(){const o=e();return o.invertRange||(o.invertRange=o.invert?Dkt(o):o.invertExtent?Ikt(o):void 0),o.type=t,G3e(o)};return r.metadata=Wf(pt(n)),r}function tr(t,e,n){return arguments.length>1?(PN.set(t,jkt(t,e,n)),this):H3e(t)?PN.get(t):void 0}tr(Rkt,zre);tr(FS,PA,To);tr(Dg,Bre,[To,Dg]);tr(fR,vB,To);tr(dR,I3e,To);tr(SB,Wre,To);tr(fb,$3e,[To,rie]);tr(db,F3e,[To,rie]);tr(gh,xB,[To,zu]);tr(`${gh}-${FS}`,xB,[To,zu]);tr(`${gh}-${Dg}`,Yre,[To,zu,Dg]);tr(`${gh}-${fR}`,bB,[To,zu]);tr(`${gh}-${dR}`,N3e,[To,zu]);tr(`${gh}-${SB}`,Qre,[To,zu]);tr(`${OO}-${FS}`,Kre,[To,zu]);tr(`${OO}-${Dg}`,Zre,[To,zu,Dg]);tr(`${OO}-${fR}`,_B,[To,zu]);tr(`${OO}-${dR}`,j3e,[To,zu]);tr(`${OO}-${SB}`,Jre,[To,zu]);tr(NS,Gre,[pR,NS]);tr(CB,Hre,pR);tr(OB,qre,pR);tr(nie,W3e,[hR,pR]);tr(tie,aR,hR);tr(B3e,iie,hR);tr(xX,Lkt,hR);function H3e(t){return PN.has(t)}function c1(t,e){const n=PN.get(t);return n&&n.metadata[e]}function oie(t){return c1(t,To)}function zS(t){return c1(t,hR)}function bX(t){return c1(t,pR)}function q3e(t){return c1(t,Dg)}function Bkt(t){return c1(t,rie)}function X3e(t){return c1(t,zu)}function Y3e(t){return c1(t,NS)}const Ukt=["clamp","base","constant","exponent"];function Q3e(t,e){const n=e[0],r=$n(e)-n;return function(i){return t(n+i*r)}}function EB(t,e,n){return $re(sie(e||"rgb",n),t)}function K3e(t,e){const n=new Array(e),r=e+1;for(let i=0;it[a]?s[a](t[a]()):0),s)}function sie(t,e){const n=akt[Wkt(t)];return e!=null&&n&&n.gamma?n.gamma(e):n}function Wkt(t){return"interpolate"+t.toLowerCase().split("-").map(e=>e[0].toUpperCase()+e.slice(1)).join("")}const Vkt={blues:"cfe1f2bed8eca8cee58fc1de74b2d75ba3cf4592c63181bd206fb2125ca40a4a90",greens:"d3eecdc0e6baabdda594d3917bc77d60ba6c46ab5e329a512089430e7735036429",greys:"e2e2e2d4d4d4c4c4c4b1b1b19d9d9d8888887575756262624d4d4d3535351e1e1e",oranges:"fdd8b3fdc998fdb87bfda55efc9244f87f2cf06b18e4580bd14904b93d029f3303",purples:"e2e1efd4d4e8c4c5e0b4b3d6a3a0cc928ec3827cb97566ae684ea25c3696501f8c",reds:"fdc9b4fcb49afc9e80fc8767fa7051f6573fec3f2fdc2a25c81b1db21218970b13",blueGreen:"d5efedc1e8e0a7ddd18bd2be70c6a958ba9144ad77319c5d2089460e7736036429",bluePurple:"ccddecbad0e4a8c2dd9ab0d4919cc98d85be8b6db28a55a6873c99822287730f71",greenBlue:"d3eecec5e8c3b1e1bb9bd8bb82cec269c2ca51b2cd3c9fc7288abd1675b10b60a1",orangeRed:"fddcaffdcf9bfdc18afdad77fb9562f67d53ee6545e24932d32d1ebf130da70403",purpleBlue:"dbdaebc8cee4b1c3de97b7d87bacd15b9fc93a90c01e7fb70b70ab056199045281",purpleBlueGreen:"dbd8eac8cee4b0c3de93b7d872acd1549fc83892bb1c88a3097f8702736b016353",purpleRed:"dcc9e2d3b3d7ce9eccd186c0da6bb2e14da0e23189d91e6fc61159ab07498f023a",redPurple:"fccfccfcbec0faa9b8f98faff571a5ec539ddb3695c41b8aa908808d0179700174",yellowGreen:"e4f4acd1eca0b9e2949ed68880c97c62bb6e47aa5e3297502083440e723b036034",yellowOrangeBrown:"feeaa1fedd84fecc63feb746fca031f68921eb7215db5e0bc54c05ab3d038f3204",yellowOrangeRed:"fee087fed16ffebd59fea849fd903efc7335f9522bee3423de1b20ca0b22af0225",blueOrange:"134b852f78b35da2cb9dcae1d2e5eff2f0ebfce0bafbbf74e8932fc5690d994a07",brownBlueGreen:"704108a0651ac79548e3c78af3e6c6eef1eac9e9e48ed1c74da79e187a72025147",purpleGreen:"5b1667834792a67fb6c9aed3e6d6e8eff0efd9efd5aedda971bb75368e490e5e29",purpleOrange:"4114696647968f83b7b9b4d6dadbebf3eeeafce0bafbbf74e8932fc5690d994a07",redBlue:"8c0d25bf363adf745ef4ae91fbdbc9f2efeed2e5ef9dcae15da2cb2f78b3134b85",redGrey:"8c0d25bf363adf745ef4ae91fcdccbfaf4f1e2e2e2c0c0c0969696646464343434",yellowGreenBlue:"eff9bddbf1b4bde5b594d5b969c5be45b4c22c9ec02182b82163aa23479c1c3185",redYellowBlue:"a50026d4322cf16e43fcac64fedd90faf8c1dcf1ecabd6e875abd04a74b4313695",redYellowGreen:"a50026d4322cf16e43fcac63fedd8df9f7aed7ee8ea4d86e64bc6122964f006837",pinkYellowGreen:"8e0152c0267edd72adf0b3d6faddedf5f3efe1f2cab6de8780bb474f9125276419",spectral:"9e0142d13c4bf0704afcac63fedd8dfbf8b0e0f3a1a9dda269bda94288b55e4fa2",viridis:"440154470e61481a6c482575472f7d443a834144873d4e8a39568c35608d31688e2d708e2a788e27818e23888e21918d1f988b1fa08822a8842ab07f35b77943bf7154c56866cc5d7ad1518fd744a5db36bcdf27d2e21be9e51afde725",magma:"0000040404130b0924150e3720114b2c11603b0f704a107957157e651a80721f817f24828c29819a2e80a8327db6377ac43c75d1426fde4968e95462f1605df76f5cfa7f5efc8f65fe9f6dfeaf78febf84fece91fddea0fcedaffcfdbf",inferno:"0000040403130c0826170c3b240c4f330a5f420a68500d6c5d126e6b176e781c6d86216b932667a12b62ae305cbb3755c73e4cd24644dd513ae65c30ed6925f3771af8850ffb9506fca50afcb519fac62df6d645f2e661f3f484fcffa4",plasma:"0d088723069033059742039d5002a25d01a66a00a87801a88405a7900da49c179ea72198b12a90ba3488c33d80cb4779d35171da5a69e16462e76e5bed7953f2834cf68f44fa9a3dfca636fdb32ffec029fcce25f9dc24f5ea27f0f921",cividis:"00205100235800265d002961012b65042e670831690d346b11366c16396d1c3c6e213f6e26426e2c456e31476e374a6e3c4d6e42506e47536d4c566d51586e555b6e5a5e6e5e616e62646f66676f6a6a706e6d717270717573727976737c79747f7c75827f758682768985778c8877908b78938e789691789a94789e9778a19b78a59e77a9a177aea575b2a874b6ab73bbaf71c0b26fc5b66dc9b96acebd68d3c065d8c462ddc85fe2cb5ce7cf58ebd355f0d652f3da4ff7de4cfae249fce647",rainbow:"6e40aa883eb1a43db3bf3cafd83fa4ee4395fe4b83ff576eff6659ff7847ff8c38f3a130e2b72fcfcc36bee044aff05b8ff4576ff65b52f6673af27828ea8d1ddfa319d0b81cbecb23abd82f96e03d82e14c6edb5a5dd0664dbf6e40aa",sinebow:"ff4040fc582af47218e78d0bd5a703bfbf00a7d5038de70b72f41858fc2a40ff402afc5818f4720be78d03d5a700bfbf03a7d50b8de71872f42a58fc4040ff582afc7218f48d0be7a703d5bf00bfd503a7e70b8df41872fc2a58ff4040",turbo:"23171b32204a3e2a71453493493eae4b49c54a53d7485ee44569ee4074f53c7ff8378af93295f72e9ff42ba9ef28b3e926bce125c5d925cdcf27d5c629dcbc2de3b232e9a738ee9d3ff39347f68950f9805afc7765fd6e70fe667cfd5e88fc5795fb51a1f84badf545b9f140c5ec3cd0e637dae034e4d931ecd12ef4c92bfac029ffb626ffad24ffa223ff9821ff8d1fff821dff771cfd6c1af76118f05616e84b14df4111d5380fcb2f0dc0260ab61f07ac1805a313029b0f00950c00910b00",browns:"eedbbdecca96e9b97ae4a865dc9856d18954c7784cc0673fb85536ad44339f3632",tealBlues:"bce4d89dd3d181c3cb65b3c245a2b9368fae347da0306a932c5985",teals:"bbdfdfa2d4d58ac9c975bcbb61b0af4da5a43799982b8b8c1e7f7f127273006667",warmGreys:"dcd4d0cec5c1c0b8b4b3aaa7a59c9998908c8b827f7e7673726866665c5a59504e",goldGreen:"f4d166d5ca60b6c35c98bb597cb25760a6564b9c533f8f4f33834a257740146c36",goldOrange:"f4d166f8be5cf8aa4cf5983bf3852aef701be2621fd65322c54923b142239e3a26",goldRed:"f4d166f6be59f9aa51fc964ef6834bee734ae56249db5247cf4244c43141b71d3e",lightGreyRed:"efe9e6e1dad7d5cbc8c8bdb9bbaea9cd967ddc7b43e15f19df4011dc000b",lightGreyTeal:"e4eaead6dcddc8ced2b7c2c7a6b4bc64b0bf22a6c32295c11f85be1876bc",lightMulti:"e0f1f2c4e9d0b0de9fd0e181f6e072f6c053f3993ef77440ef4a3c",lightOrange:"f2e7daf7d5baf9c499fab184fa9c73f68967ef7860e8645bde515bd43d5b",lightTealBlue:"e3e9e0c0dccf9aceca7abfc859afc0389fb9328dad2f7ca0276b95255988",darkBlue:"3232322d46681a5c930074af008cbf05a7ce25c0dd38daed50f3faffffff",darkGold:"3c3c3c584b37725e348c7631ae8b2bcfa424ecc31ef9de30fff184ffffff",darkGreen:"3a3a3a215748006f4d048942489e4276b340a6c63dd2d836ffeb2cffffaa",darkMulti:"3737371f5287197d8c29a86995ce3fffe800ffffff",darkRed:"3434347036339e3c38cc4037e75d1eec8620eeab29f0ce32ffeb2c"},Gkt={accent:Skt,category10:_kt,category20:"1f77b4aec7e8ff7f0effbb782ca02c98df8ad62728ff98969467bdc5b0d58c564bc49c94e377c2f7b6d27f7f7fc7c7c7bcbd22dbdb8d17becf9edae5",category20b:"393b795254a36b6ecf9c9ede6379398ca252b5cf6bcedb9c8c6d31bd9e39e7ba52e7cb94843c39ad494ad6616be7969c7b4173a55194ce6dbdde9ed6",category20c:"3182bd6baed69ecae1c6dbefe6550dfd8d3cfdae6bfdd0a231a35474c476a1d99bc7e9c0756bb19e9ac8bcbddcdadaeb636363969696bdbdbdd9d9d9",dark2:Ckt,observable10:Okt,paired:Ekt,pastel1:Tkt,pastel2:kkt,set1:Akt,set2:Pkt,set3:Mkt,tableau10:"4c78a8f58518e4575672b7b254a24beeca3bb279a2ff9da69d755dbab0ac",tableau20:"4c78a89ecae9f58518ffbf7954a24b88d27ab79a20f2cf5b43989483bcb6e45756ff9d9879706ebab0acd67195fcbfd2b279a2d6a5c99e765fd8b5a5"};function J3e(t){if(We(t))return t;const e=t.length/6|0,n=new Array(e);for(let r=0;rEB(J3e(t)));function aie(t,e){return t=t&&t.toLowerCase(),arguments.length>1?(Rge[t]=e,this):Rge[t]}const d3="symbol",Hkt="discrete",qkt="gradient",Xkt=t=>We(t)?t.map(e=>String(e)):String(t),Ykt=(t,e)=>t[1]-e[1],Qkt=(t,e)=>e[1]-t[1];function lie(t,e,n){let r;return Jn(e)&&(t.bins&&(e=Math.max(e,t.bins.length)),n!=null&&(e=Math.min(e,Math.floor(tR(t.domain())/n||1)+1))),ht(e)&&(r=e.step,e=e.interval),gt(e)&&(e=t.type===fb?wO(e):t.type==db?_O(e):je("Only time and utc scales accept interval strings."),r&&(e=e.every(r))),e}function tFe(t,e,n){let r=t.range(),i=r[0],o=$n(r),s=Ykt;if(i>o&&(r=o,o=i,i=r,s=Qkt),i=Math.floor(i),o=Math.ceil(o),e=e.map(a=>[a,t(a)]).filter(a=>i<=a[1]&&a[1]<=o).sort(s).map(a=>a[0]),n>0&&e.length>1){const a=[e[0],$n(e)];for(;e.length>n&&e.length>=3;)e=e.filter((l,c)=>!(c%2));e.length<3&&(e=a)}return e}function cie(t,e){return t.bins?tFe(t,t.bins,e):t.ticks?t.ticks(e):t.domain()}function nFe(t,e,n,r,i,o){const s=e.type;let a=Xkt;if(s===fb||i===fb)a=t.timeFormat(r);else if(s===db||i===db)a=t.utcFormat(r);else if(q3e(s)){const l=t.formatFloat(r);if(o||e.bins)a=l;else{const c=rFe(e,n,!1);a=u=>c(u)?l(u):""}}else if(e.tickFormat){const l=e.domain();a=t.formatSpan(l[0],l[l.length-1],n,r)}else r&&(a=t.format(r));return a}function rFe(t,e,n){const r=cie(t,e),i=t.base(),o=Math.log(i),s=Math.max(1,i*e/r.length),a=l=>{let c=l/Math.pow(i,Math.round(Math.log(l)/o));return c*i1?r[1]-r[0]:r[0],s;for(s=1;swX[t.type]||t.bins;function sFe(t,e,n,r,i,o,s){const a=iFe[e.type]&&o!==fb&&o!==db?Kkt(t,e,i):nFe(t,e,n,i,o,s);return r===d3&&eAt(e)?tAt(a):r===Hkt?nAt(a):rAt(a)}const tAt=t=>(e,n,r)=>{const i=Dge(r[n+1],Dge(r.max,1/0)),o=Ige(e,t),s=Ige(i,t);return o&&s?o+" – "+s:s?"< "+s:"≥ "+o},Dge=(t,e)=>t??e,nAt=t=>(e,n)=>n?t(e):null,rAt=t=>e=>t(e),Ige=(t,e)=>Number.isFinite(t)?e(t):null;function iAt(t){const e=t.domain(),n=e.length-1;let r=+e[0],i=+$n(e),o=i-r;if(t.type===OB){const s=n?o/n:.1;r-=s,i+=s,o=i-r}return s=>(s-r)/o}function oAt(t,e,n,r){const i=r||e.type;return gt(n)&&Bkt(i)&&(n=n.replace(/%a/g,"%A").replace(/%b/g,"%B")),!n&&i===fb?t.timeFormat("%A, %d %B %Y, %X"):!n&&i===db?t.utcFormat("%A, %d %B %Y, %X UTC"):sFe(t,e,5,null,n,r,!0)}function aFe(t,e,n){n=n||{};const r=Math.max(3,n.maxlen||7),i=oAt(t,e,n.format,n.formatType);if(bX(e.type)){const o=oFe(e).slice(1).map(i),s=o.length;return`${s} boundar${s===1?"y":"ies"}: ${o.join(", ")}`}else if(zS(e.type)){const o=e.domain(),s=o.length,a=s>r?o.slice(0,r-2).map(i).join(", ")+", ending with "+o.slice(-1).map(i):o.map(i).join(", ");return`${s} value${s===1?"":"s"}: ${a}`}else{const o=e.domain();return`values from ${i(o[0])} to ${i($n(o))}`}}let lFe=0;function sAt(){lFe=0}const MN="p_";function uie(t){return t&&t.gradient}function cFe(t,e,n){const r=t.gradient;let i=t.id,o=r==="radial"?MN:"";return i||(i=t.id="gradient_"+lFe++,r==="radial"?(t.x1=md(t.x1,.5),t.y1=md(t.y1,.5),t.r1=md(t.r1,0),t.x2=md(t.x2,.5),t.y2=md(t.y2,.5),t.r2=md(t.r2,.5),o=MN):(t.x1=md(t.x1,0),t.y1=md(t.y1,0),t.x2=md(t.x2,1),t.y2=md(t.y2,0))),e[i]=t,"url("+(n||"")+"#"+o+i+")"}function md(t,e){return t??e}function uFe(t,e){var n=[],r;return r={gradient:"linear",x1:t?t[0]:0,y1:t?t[1]:0,x2:e?e[0]:1,y2:e?e[1]:0,stops:n,stop:function(i,o){return n.push({offset:i,color:o}),r}}}const Lge={basis:{curve:j$e},"basis-closed":{curve:U$e},"basis-open":{curve:V$e},bundle:{curve:cTt,tension:"beta",value:.85},cardinal:{curve:uTt,tension:"tension",value:0},"cardinal-open":{curve:dTt,tension:"tension",value:0},"cardinal-closed":{curve:fTt,tension:"tension",value:0},"catmull-rom":{curve:hTt,tension:"alpha",value:.5},"catmull-rom-closed":{curve:pTt,tension:"alpha",value:.5},"catmull-rom-open":{curve:gTt,tension:"alpha",value:.5},linear:{curve:sR},"linear-closed":{curve:Q$e},monotone:{horizontal:e3e,vertical:J$e},natural:{curve:n3e},step:{curve:r3e},"step-after":{curve:o3e},"step-before":{curve:i3e}};function fie(t,e,n){var r=vt(Lge,t)&&Lge[t],i=null;return r&&(i=r.curve||r[e||"vertical"],r.tension&&n!=null&&(i=i[r.tension](n))),i}const aAt={m:2,l:2,h:1,v:1,z:0,c:6,s:4,q:4,t:2,a:7},lAt=/[mlhvzcsqta]([^mlhvzcsqta]+|$)/gi,cAt=/^[+-]?(([0-9]*\.[0-9]+)|([0-9]+\.)|([0-9]+))([eE][+-]?[0-9]+)?/,uAt=/^((\s+,?\s*)|(,\s*))/,fAt=/^[01]/;function jS(t){const e=[];return(t.match(lAt)||[]).forEach(r=>{let i=r[0];const o=i.toLowerCase(),s=aAt[o],a=dAt(o,s,r.slice(1).trim()),l=a.length;if(l1&&(g=Math.sqrt(g),n*=g,r*=g);const m=d/n,v=f/n,y=-f/r,x=d/r,b=m*a+v*l,w=y*a+x*l,_=m*t+v*e,S=y*t+x*e;let k=1/((_-b)*(_-b)+(S-w)*(S-w))-.25;k<0&&(k=0);let E=Math.sqrt(k);o==i&&(E=-E);const P=.5*(b+_)-E*(S-w),A=.5*(w+S)+E*(_-b),R=Math.atan2(w-A,b-P);let M=Math.atan2(S-A,_-P)-R;M<0&&o===1?M+=jd:M>0&&o===0&&(M-=jd);const I=Math.ceil(Math.abs(M/(Q0+.001))),j=[];for(let N=0;N+t}function DI(t,e,n){return Math.max(e,Math.min(t,n))}function hFe(){var t=yAt,e=xAt,n=bAt,r=wAt,i=sp(0),o=i,s=i,a=i,l=null;function c(u,f,d){var h,p=f??+t.call(this,u),g=d??+e.call(this,u),m=+n.call(this,u),v=+r.call(this,u),y=Math.min(m,v)/2,x=DI(+i.call(this,u),0,y),b=DI(+o.call(this,u),0,y),w=DI(+s.call(this,u),0,y),_=DI(+a.call(this,u),0,y);if(l||(l=h=cB()),x<=0&&b<=0&&w<=0&&_<=0)l.rect(p,g,m,v);else{var S=p+m,O=g+v;l.moveTo(p+x,g),l.lineTo(S-b,g),l.bezierCurveTo(S-gm*b,g,S,g+gm*b,S,g+b),l.lineTo(S,O-_),l.bezierCurveTo(S,O-gm*_,S-gm*_,O,S-_,O),l.lineTo(p+w,O),l.bezierCurveTo(p+gm*w,O,p,O-gm*w,p,O-w),l.lineTo(p,g+x),l.bezierCurveTo(p,g+gm*x,p+gm*x,g,p+x,g),l.closePath()}if(h)return l=null,h+""||null}return c.x=function(u){return arguments.length?(t=sp(u),c):t},c.y=function(u){return arguments.length?(e=sp(u),c):e},c.width=function(u){return arguments.length?(n=sp(u),c):n},c.height=function(u){return arguments.length?(r=sp(u),c):r},c.cornerRadius=function(u,f,d,h){return arguments.length?(i=sp(u),o=f!=null?sp(f):i,a=d!=null?sp(d):i,s=h!=null?sp(h):o,c):i},c.context=function(u){return arguments.length?(l=u??null,c):l},c}function pFe(){var t,e,n,r,i=null,o,s,a,l;function c(f,d,h){const p=h/2;if(o){var g=a-d,m=f-s;if(g||m){var v=Math.hypot(g,m),y=(g/=v)*l,x=(m/=v)*l,b=Math.atan2(m,g);i.moveTo(s-y,a-x),i.lineTo(f-g*p,d-m*p),i.arc(f,d,p,b-Math.PI,b),i.lineTo(s+y,a+x),i.arc(s,a,l,b,b+Math.PI)}else i.arc(f,d,p,0,jd);i.closePath()}else o=1;s=f,a=d,l=p}function u(f){var d,h=f.length,p,g=!1,m;for(i==null&&(i=m=cB()),d=0;d<=h;++d)!(dt.x||0,vR=t=>t.y||0,_At=t=>t.width||0,SAt=t=>t.height||0,CAt=t=>(t.x||0)+(t.width||0),OAt=t=>(t.y||0)+(t.height||0),EAt=t=>t.startAngle||0,TAt=t=>t.endAngle||0,kAt=t=>t.padAngle||0,AAt=t=>t.innerRadius||0,PAt=t=>t.outerRadius||0,MAt=t=>t.cornerRadius||0,RAt=t=>gR(t.cornerRadiusTopLeft,t.cornerRadius)||0,DAt=t=>gR(t.cornerRadiusTopRight,t.cornerRadius)||0,IAt=t=>gR(t.cornerRadiusBottomRight,t.cornerRadius)||0,LAt=t=>gR(t.cornerRadiusBottomLeft,t.cornerRadius)||0,$At=t=>gR(t.size,64),FAt=t=>t.size||1,TB=t=>t.defined!==!1,NAt=t=>dFe(t.shape||"circle"),zAt=Y2t().startAngle(EAt).endAngle(TAt).padAngle(kAt).innerRadius(AAt).outerRadius(PAt).cornerRadius(MAt),jAt=o_().x(mR).y1(vR).y0(OAt).defined(TB),BAt=o_().y(vR).x1(mR).x0(CAt).defined(TB),UAt=Ere().x(mR).y(vR).defined(TB),WAt=hFe().x(mR).y(vR).width(_At).height(SAt).cornerRadius(RAt,DAt,IAt,LAt),VAt=z$e().type(NAt).size($At),GAt=pFe().x(mR).y(vR).defined(TB).size(FAt);function die(t){return t.cornerRadius||t.cornerRadiusTopLeft||t.cornerRadiusTopRight||t.cornerRadiusBottomRight||t.cornerRadiusBottomLeft}function HAt(t,e){return zAt.context(t)(e)}function qAt(t,e){const n=e[0],r=n.interpolate||"linear";return(n.orient==="horizontal"?BAt:jAt).curve(fie(r,n.orient,n.tension)).context(t)(e)}function XAt(t,e){const n=e[0],r=n.interpolate||"linear";return UAt.curve(fie(r,n.orient,n.tension)).context(t)(e)}function EO(t,e,n,r){return WAt.context(t)(e,n,r)}function YAt(t,e){return(e.mark.shape||e.shape).context(t)(e)}function QAt(t,e){return VAt.context(t)(e)}function KAt(t,e){return GAt.context(t)(e)}var gFe=1;function mFe(){gFe=1}function hie(t,e,n){var r=e.clip,i=t._defs,o=e.clip_id||(e.clip_id="clip"+gFe++),s=i.clipping[o]||(i.clipping[o]={id:o});return fn(r)?s.path=r(null):die(n)?s.path=EO(null,n,0,0):(s.width=n.width||0,s.height=n.height||0),"url(#"+o+")"}function uo(t){this.clear(),t&&this.union(t)}uo.prototype={clone(){return new uo(this)},clear(){return this.x1=+Number.MAX_VALUE,this.y1=+Number.MAX_VALUE,this.x2=-Number.MAX_VALUE,this.y2=-Number.MAX_VALUE,this},empty(){return this.x1===+Number.MAX_VALUE&&this.y1===+Number.MAX_VALUE&&this.x2===-Number.MAX_VALUE&&this.y2===-Number.MAX_VALUE},equals(t){return this.x1===t.x1&&this.y1===t.y1&&this.x2===t.x2&&this.y2===t.y2},set(t,e,n,r){return nthis.x2&&(this.x2=t),e>this.y2&&(this.y2=e),this},expand(t){return this.x1-=t,this.y1-=t,this.x2+=t,this.y2+=t,this},round(){return this.x1=Math.floor(this.x1),this.y1=Math.floor(this.y1),this.x2=Math.ceil(this.x2),this.y2=Math.ceil(this.y2),this},scale(t){return this.x1*=t,this.y1*=t,this.x2*=t,this.y2*=t,this},translate(t,e){return this.x1+=t,this.x2+=t,this.y1+=e,this.y2+=e,this},rotate(t,e,n){const r=this.rotatedPoints(t,e,n);return this.clear().add(r[0],r[1]).add(r[2],r[3]).add(r[4],r[5]).add(r[6],r[7])},rotatedPoints(t,e,n){var{x1:r,y1:i,x2:o,y2:s}=this,a=Math.cos(t),l=Math.sin(t),c=e-e*a+n*l,u=n-e*l-n*a;return[a*r-l*i+c,l*r+a*i+u,a*r-l*s+c,l*r+a*s+u,a*o-l*i+c,l*o+a*i+u,a*o-l*s+c,l*o+a*s+u]},union(t){return t.x1this.x2&&(this.x2=t.x2),t.y2>this.y2&&(this.y2=t.y2),this},intersect(t){return t.x1>this.x1&&(this.x1=t.x1),t.y1>this.y1&&(this.y1=t.y1),t.x2=t.x2&&this.y1<=t.y1&&this.y2>=t.y2},alignsWith(t){return t&&(this.x1==t.x1||this.x2==t.x2||this.y1==t.y1||this.y2==t.y2)},intersects(t){return t&&!(this.x2t.x2||this.y2t.y2)},contains(t,e){return!(tthis.x2||ethis.y2)},width(){return this.x2-this.x1},height(){return this.y2-this.y1}};function kB(t){this.mark=t,this.bounds=this.bounds||new uo}function AB(t){kB.call(this,t),this.items=this.items||[]}it(AB,kB);class vFe{constructor(e){this._pending=0,this._loader=e||K4()}pending(){return this._pending}sanitizeURL(e){const n=this;return zge(n),n._loader.sanitize(e,{context:"href"}).then(r=>(QE(n),r)).catch(()=>(QE(n),null))}loadImage(e){const n=this,r=_Tt();return zge(n),n._loader.sanitize(e,{context:"image"}).then(i=>{const o=i.href;if(!o||!r)throw{url:o};const s=new r,a=vt(i,"crossOrigin")?i.crossOrigin:"anonymous";return a!=null&&(s.crossOrigin=a),s.onload=()=>QE(n),s.onerror=()=>QE(n),s.src=o,s}).catch(i=>(QE(n),{complete:!1,width:0,height:0,src:i&&i.url||""}))}ready(){const e=this;return new Promise(n=>{function r(i){e.pending()?setTimeout(()=>{r(!0)},10):n(i)}r(!1)})}}function zge(t){t._pending+=1}function QE(t){t._pending-=1}function qg(t,e,n){if(e.stroke&&e.opacity!==0&&e.strokeOpacity!==0){const r=e.strokeWidth!=null?+e.strokeWidth:1;t.expand(r+(n?ZAt(e,r):0))}return t}function ZAt(t,e){return t.strokeJoin&&t.strokeJoin!=="miter"?0:e}const JAt=jd-1e-8;let PB,h3,p3,gx,_X,g3,SX,CX;const fv=(t,e)=>PB.add(t,e),m3=(t,e)=>fv(h3=t,p3=e),jge=t=>fv(t,PB.y1),Bge=t=>fv(PB.x1,t),K0=(t,e)=>_X*t+SX*e,Z0=(t,e)=>g3*t+CX*e,rV=(t,e)=>fv(K0(t,e),Z0(t,e)),iV=(t,e)=>m3(K0(t,e),Z0(t,e));function yR(t,e){return PB=t,e?(gx=e*ay,_X=CX=Math.cos(gx),g3=Math.sin(gx),SX=-g3):(_X=CX=1,gx=g3=SX=0),ePt}const ePt={beginPath(){},closePath(){},moveTo:iV,lineTo:iV,rect(t,e,n,r){gx?(rV(t+n,e),rV(t+n,e+r),rV(t,e+r),iV(t,e)):(fv(t+n,e+r),m3(t,e))},quadraticCurveTo(t,e,n,r){const i=K0(t,e),o=Z0(t,e),s=K0(n,r),a=Z0(n,r);Uge(h3,i,s,jge),Uge(p3,o,a,Bge),m3(s,a)},bezierCurveTo(t,e,n,r,i,o){const s=K0(t,e),a=Z0(t,e),l=K0(n,r),c=Z0(n,r),u=K0(i,o),f=Z0(i,o);Wge(h3,s,l,u,jge),Wge(p3,a,c,f,Bge),m3(u,f)},arc(t,e,n,r,i,o){if(r+=gx,i+=gx,h3=n*Math.cos(i)+t,p3=n*Math.sin(i)+e,Math.abs(i-r)>JAt)fv(t-n,e-n),fv(t+n,e+n);else{const s=c=>fv(n*Math.cos(c)+t,n*Math.sin(c)+e);let a,l;if(s(r),s(i),i!==r)if(r=r%jd,r<0&&(r+=jd),i=i%jd,i<0&&(i+=jd),ii;++l,a-=Q0)s(a);else for(a=r-r%Q0+Q0,l=0;l<4&&ahAt?(u=s*s+a*o,u>=0&&(u=Math.sqrt(u),l=(-s+u)/o,c=(-s-u)/o)):l=.5*a/s,0d)return!1;g>f&&(f=g)}else if(h>0){if(g0?(t.globalAlpha=n,t.fillStyle=bFe(t,e,e.fill),!0):!1}var nPt=[];function US(t,e,n){var r=(r=e.strokeWidth)!=null?r:1;return r<=0?!1:(n*=e.strokeOpacity==null?1:e.strokeOpacity,n>0?(t.globalAlpha=n,t.strokeStyle=bFe(t,e,e.stroke),t.lineWidth=r,t.lineCap=e.strokeCap||"butt",t.lineJoin=e.strokeJoin||"miter",t.miterLimit=e.strokeMiterLimit||10,t.setLineDash&&(t.setLineDash(e.strokeDash||nPt),t.lineDashOffset=e.strokeDashOffset||0),!0):!1)}function rPt(t,e){return t.zindex-e.zindex||t.index-e.index}function mie(t){if(!t.zdirty)return t.zitems;var e=t.items,n=[],r,i,o;for(i=0,o=e.length;i=0;)if(r=e(n[i]))return r;if(n===o){for(n=t.items,i=n.length;--i>=0;)if(!n[i].zindex&&(r=e(n[i])))return r}return null}function vie(t){return function(e,n,r){Gf(n,i=>{(!r||r.intersects(i.bounds))&&wFe(t,e,i,i)})}}function iPt(t){return function(e,n,r){n.items.length&&(!r||r.intersects(n.bounds))&&wFe(t,e,n.items[0],n.items)}}function wFe(t,e,n,r){var i=n.opacity==null?1:n.opacity;i!==0&&(t(e,r)||(BS(e,n),n.fill&&RN(e,n,i)&&e.fill(),n.stroke&&US(e,n,i)&&e.stroke()))}function MB(t){return t=t||Tu,function(e,n,r,i,o,s){return r*=e.pixelRatio,i*=e.pixelRatio,DN(n,a=>{const l=a.bounds;if(!(l&&!l.contains(o,s)||!l)&&t(e,a,r,i,o,s))return a})}}function xR(t,e){return function(n,r,i,o){var s=Array.isArray(r)?r[0]:r,a=e??s.fill,l=s.stroke&&n.isPointInStroke,c,u;return l&&(c=s.strokeWidth,u=s.strokeCap,n.lineWidth=c??1,n.lineCap=u??"butt"),t(n,r)?!1:a&&n.isPointInPath(i,o)||l&&n.isPointInStroke(i,o)}}function yie(t){return MB(xR(t))}function Nx(t,e){return"translate("+t+","+e+")"}function xie(t){return"rotate("+t+")"}function oPt(t,e){return"scale("+t+","+e+")"}function _Fe(t){return Nx(t.x||0,t.y||0)}function sPt(t){return Nx(t.x||0,t.y||0)+(t.angle?" "+xie(t.angle):"")}function aPt(t){return Nx(t.x||0,t.y||0)+(t.angle?" "+xie(t.angle):"")+(t.scaleX||t.scaleY?" "+oPt(t.scaleX||1,t.scaleY||1):"")}function bie(t,e,n){function r(s,a){s("transform",sPt(a)),s("d",e(null,a))}function i(s,a){return e(yR(s,a.angle),a),qg(s,a).translate(a.x||0,a.y||0)}function o(s,a){var l=a.x||0,c=a.y||0,u=a.angle||0;s.translate(l,c),u&&s.rotate(u*=ay),s.beginPath(),e(s,a),u&&s.rotate(-u),s.translate(-l,-c)}return{type:t,tag:"path",nested:!1,attr:r,bound:i,draw:vie(o),pick:yie(o),isect:n||pie(o)}}var lPt=bie("arc",HAt);function cPt(t,e){for(var n=t[0].orient==="horizontal"?e[1]:e[0],r=t[0].orient==="horizontal"?"y":"x",i=t.length,o=1/0,s,a;--i>=0;)t[i].defined!==!1&&(a=Math.abs(t[i][r]-n),a=0;)if(t[r].defined!==!1&&(i=t[r].x-e[0],o=t[r].y-e[1],s=i*i+o*o,s=0;)if(t[n].defined!==!1&&(r=t[n].x-e[0],i=t[n].y-e[1],o=r*r+i*i,r=t[n].size||1,o.5&&e<1.5?.5-Math.abs(e-1):0}function pPt(t,e){t("transform",_Fe(e))}function OFe(t,e){const n=CFe(e);t("d",EO(null,e,n,n))}function gPt(t,e){t("class","background"),t("aria-hidden",!0),OFe(t,e)}function mPt(t,e){t("class","foreground"),t("aria-hidden",!0),e.strokeForeground?OFe(t,e):t("d","")}function vPt(t,e,n){const r=e.clip?hie(n,e,e):null;t("clip-path",r)}function yPt(t,e){if(!e.clip&&e.items){const n=e.items,r=n.length;for(let i=0;i{const o=i.x||0,s=i.y||0,a=i.strokeForeground,l=i.opacity==null?1:i.opacity;(i.stroke||i.fill)&&l&&(RA(t,i,o,s),BS(t,i),i.fill&&RN(t,i,l)&&t.fill(),i.stroke&&!a&&US(t,i,l)&&t.stroke()),t.save(),t.translate(o,s),i.clip&&SFe(t,i),n&&n.translate(-o,-s),Gf(i,c=>{(c.marktype==="group"||r==null||r.includes(c.marktype))&&this.draw(t,c,n,r)}),n&&n.translate(o,s),t.restore(),a&&i.stroke&&l&&(RA(t,i,o,s),BS(t,i),US(t,i,l)&&t.stroke())})}function SPt(t,e,n,r,i,o){if(e.bounds&&!e.bounds.contains(i,o)||!e.items)return null;const s=n*t.pixelRatio,a=r*t.pixelRatio;return DN(e,l=>{let c,u,f;const d=l.bounds;if(d&&!d.contains(i,o))return;u=l.x||0,f=l.y||0;const h=u+(l.width||0),p=f+(l.height||0),g=l.clip;if(g&&(ih||op))return;if(t.save(),t.translate(u,f),u=i-u,f=o-f,g&&die(l)&&!wPt(t,l,s,a))return t.restore(),null;const m=l.strokeForeground,v=e.interactive!==!1;return v&&m&&l.stroke&&bPt(t,l,s,a)?(t.restore(),l):(c=DN(l,y=>CPt(y,u,f)?this.pick(y,n,r,u,f):null),!c&&v&&(l.fill||!m&&l.stroke)&&xPt(t,l,s,a)&&(c=l),t.restore(),c||null)})}function CPt(t,e,n){return(t.interactive!==!1||t.marktype==="group")&&t.bounds&&t.bounds.contains(e,n)}var OPt={type:"group",tag:"g",nested:!1,attr:pPt,bound:yPt,draw:_Pt,pick:SPt,isect:yFe,content:vPt,background:gPt,foreground:mPt},DA={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",version:"1.1"};function _ie(t,e){var n=t.image;return(!n||t.url&&t.url!==n.url)&&(n={complete:!1,width:0,height:0},e.loadImage(t.url).then(r=>{t.image=r,t.image.url=t.url})),n}function Sie(t,e){return t.width!=null?t.width:!e||!e.width?0:t.aspect!==!1&&t.height?t.height*e.width/e.height:e.width}function Cie(t,e){return t.height!=null?t.height:!e||!e.height?0:t.aspect!==!1&&t.width?t.width*e.height/e.width:e.height}function RB(t,e){return t==="center"?e/2:t==="right"?e:0}function DB(t,e){return t==="middle"?e/2:t==="bottom"?e:0}function EPt(t,e,n){const r=_ie(e,n),i=Sie(e,r),o=Cie(e,r),s=(e.x||0)-RB(e.align,i),a=(e.y||0)-DB(e.baseline,o),l=!r.src&&r.toDataURL?r.toDataURL():r.src||"";t("href",l,DA["xmlns:xlink"],"xlink:href"),t("transform",Nx(s,a)),t("width",i),t("height",o),t("preserveAspectRatio",e.aspect===!1?"none":"xMidYMid")}function TPt(t,e){const n=e.image,r=Sie(e,n),i=Cie(e,n),o=(e.x||0)-RB(e.align,r),s=(e.y||0)-DB(e.baseline,i);return t.set(o,s,o+r,s+i)}function kPt(t,e,n){Gf(e,r=>{if(n&&!n.intersects(r.bounds))return;const i=_ie(r,this);let o=Sie(r,i),s=Cie(r,i);if(o===0||s===0)return;let a=(r.x||0)-RB(r.align,o),l=(r.y||0)-DB(r.baseline,s),c,u,f,d;r.aspect!==!1&&(u=i.width/i.height,f=r.width/r.height,u===u&&f===f&&u!==f&&(f{if(!(n&&!n.intersects(r.bounds))){var i=r.opacity==null?1:r.opacity;i&&EFe(t,r,i)&&(BS(t,r),t.stroke())}})}function jPt(t,e,n,r){return t.isPointInStroke?EFe(t,e,1)&&t.isPointInStroke(n,r):!1}var BPt={type:"rule",tag:"line",nested:!1,attr:FPt,bound:NPt,draw:zPt,pick:MB(jPt),isect:xFe},UPt=bie("shape",YAt),WPt=bie("symbol",QAt,gie);const qge=AIe();var dc={height:jh,measureWidth:Oie,estimateWidth:IN,width:IN,canvas:TFe};TFe(!0);function TFe(t){dc.width=t&&Bv?Oie:IN}function IN(t,e){return kFe(cy(t,e),jh(t))}function kFe(t,e){return~~(.8*t.length*e)}function Oie(t,e){return jh(t)<=0||!(e=cy(t,e))?0:AFe(e,IB(t))}function AFe(t,e){const n=`(${e}) ${t}`;let r=qge.get(n);return r===void 0&&(Bv.font=e,r=Bv.measureText(t).width,qge.set(n,r)),r}function jh(t){return t.fontSize!=null?+t.fontSize||0:11}function ly(t){return t.lineHeight!=null?t.lineHeight:jh(t)+2}function VPt(t){return We(t)?t.length>1?t:t[0]:t}function bR(t){return VPt(t.lineBreak&&t.text&&!We(t.text)?t.text.split(t.lineBreak):t.text)}function Eie(t){const e=bR(t);return(We(e)?e.length-1:0)*ly(t)}function cy(t,e){const n=e==null?"":(e+"").trim();return t.limit>0&&n.length?HPt(t,n):n}function GPt(t){if(dc.width===Oie){const e=IB(t);return n=>AFe(n,e)}else if(dc.width===IN){const e=jh(t);return n=>kFe(n,e)}else return e=>dc.width(t,e)}function HPt(t,e){var n=+t.limit,r=GPt(t);if(r(e)>>1,r(e.slice(l))>n?s=l+1:a=l;return i+e.slice(s)}else{for(;s>>1),r(e.slice(0,l))Math.max(d,dc.width(e,h)),0)):f=dc.width(e,u),i==="center"?l-=f/2:i==="right"&&(l-=f),t.set(l+=s,c+=a,l+f,c+r),e.angle&&!n)t.rotate(e.angle*ay,s,a);else if(n===2)return t.rotatedPoints(e.angle*ay,s,a);return t}function YPt(t,e,n){Gf(e,r=>{var i=r.opacity==null?1:r.opacity,o,s,a,l,c,u,f;if(!(n&&!n.intersects(r.bounds)||i===0||r.fontSize<=0||r.text==null||r.text.length===0)){if(t.font=IB(r),t.textAlign=r.align||"left",o=LB(r),s=o.x1,a=o.y1,r.angle&&(t.save(),t.translate(s,a),t.rotate(r.angle*ay),s=a=0),s+=r.dx||0,a+=(r.dy||0)+Tie(r),u=bR(r),BS(t,r),We(u))for(c=ly(r),l=0;le;)t.removeChild(n[--r]);return t}function LFe(t){return"mark-"+t.marktype+(t.role?" role-"+t.role:"")+(t.name?" "+t.name:"")}function $B(t,e){const n=e.getBoundingClientRect();return[t.clientX-n.left-(e.clientLeft||0),t.clientY-n.top-(e.clientTop||0)]}function tMt(t,e,n,r){var i=t&&t.mark,o,s;if(i&&(o=Ec[i.marktype]).tip){for(s=$B(e,n),s[0]-=r[0],s[1]-=r[1];t=t.mark.group;)s[0]-=t.x||0,s[1]-=t.y||0;t=o.tip(i.items,s)}return t}let Pie=class{constructor(e,n){this._active=null,this._handlers={},this._loader=e||K4(),this._tooltip=n||nMt}initialize(e,n,r){return this._el=e,this._obj=r||null,this.origin(n)}element(){return this._el}canvas(){return this._el&&this._el.firstChild}origin(e){return arguments.length?(this._origin=e||[0,0],this):this._origin.slice()}scene(e){return arguments.length?(this._scene=e,this):this._scene}on(){}off(){}_handlerIndex(e,n,r){for(let i=e?e.length:0;--i>=0;)if(e[i].type===n&&(!r||e[i].handler===r))return i;return-1}handlers(e){const n=this._handlers,r=[];if(e)r.push(...n[this.eventName(e)]);else for(const i in n)r.push(...n[i]);return r}eventName(e){const n=e.indexOf(".");return n<0?e:e.slice(0,n)}handleHref(e,n,r){this._loader.sanitize(r,{context:"href"}).then(i=>{const o=new MouseEvent(e.type,e),s=dv(null,"a");for(const a in i)s.setAttribute(a,i[a]);s.dispatchEvent(o)}).catch(()=>{})}handleTooltip(e,n,r){if(n&&n.tooltip!=null){n=tMt(n,e,this.canvas(),this._origin);const i=r&&n&&n.tooltip||null;this._tooltip.call(this._obj,this,e,n,i)}}getItemBoundingClientRect(e){const n=this.canvas();if(!n)return;const r=n.getBoundingClientRect(),i=this._origin,o=e.bounds,s=o.width(),a=o.height();let l=o.x1+i[0]+r.left,c=o.y1+i[1]+r.top;for(;e.mark&&(e=e.mark.group);)l+=e.x||0,c+=e.y||0;return{x:l,y:c,width:s,height:a,left:l,top:c,right:l+s,bottom:c+a}}};function nMt(t,e,n,r){t.element().setAttribute("title",r||"")}class _R{constructor(e){this._el=null,this._bgcolor=null,this._loader=new vFe(e)}initialize(e,n,r,i,o){return this._el=e,this.resize(n,r,i,o)}element(){return this._el}canvas(){return this._el&&this._el.firstChild}background(e){return arguments.length===0?this._bgcolor:(this._bgcolor=e,this)}resize(e,n,r,i){return this._width=e,this._height=n,this._origin=r||[0,0],this._scale=i||1,this}dirty(){}render(e,n){const r=this;return r._call=function(){r._render(e,n)},r._call(),r._call=null,r}_render(){}renderAsync(e,n){const r=this.render(e,n);return this._ready?this._ready.then(()=>r):Promise.resolve(r)}_load(e,n){var r=this,i=r._loader[e](n);if(!r._ready){const o=r._call;r._ready=r._loader.ready().then(s=>{s&&o(),r._ready=null})}return i}sanitizeURL(e){return this._load("sanitizeURL",e)}loadImage(e){return this._load("loadImage",e)}}const rMt="keydown",iMt="keypress",oMt="keyup",$Fe="dragenter",y3="dragleave",FFe="dragover",TX="pointerdown",sMt="pointerup",LN="pointermove",x3="pointerout",NFe="pointerover",kX="mousedown",aMt="mouseup",zFe="mousemove",$N="mouseout",jFe="mouseover",FN="click",lMt="dblclick",cMt="wheel",BFe="mousewheel",NN="touchstart",zN="touchmove",jN="touchend",uMt=[rMt,iMt,oMt,$Fe,y3,FFe,TX,sMt,LN,x3,NFe,kX,aMt,zFe,$N,jFe,FN,lMt,cMt,BFe,NN,zN,jN],AX=LN,ok=$N,PX=FN;class SR extends Pie{constructor(e,n){super(e,n),this._down=null,this._touch=null,this._first=!0,this._events={},this.events=uMt,this.pointermove=Kge([LN,zFe],[NFe,jFe],[x3,$N]),this.dragover=Kge([FFe],[$Fe],[y3]),this.pointerout=Zge([x3,$N]),this.dragleave=Zge([y3])}initialize(e,n,r){return this._canvas=e&&Aie(e,"canvas"),[FN,kX,TX,LN,x3,y3].forEach(i=>Qge(this,i)),super.initialize(e,n,r)}canvas(){return this._canvas}context(){return this._canvas.getContext("2d")}DOMMouseScroll(e){this.fire(BFe,e)}pointerdown(e){this._down=this._active,this.fire(TX,e)}mousedown(e){this._down=this._active,this.fire(kX,e)}click(e){this._down===this._active&&(this.fire(FN,e),this._down=null)}touchstart(e){this._touch=this.pickEvent(e.changedTouches[0]),this._first&&(this._active=this._touch,this._first=!1),this.fire(NN,e,!0)}touchmove(e){this.fire(zN,e,!0)}touchend(e){this.fire(jN,e,!0),this._touch=null}fire(e,n,r){const i=r?this._touch:this._active,o=this._handlers[e];if(n.vegaType=e,e===PX&&i&&i.href?this.handleHref(n,i,i.href):(e===AX||e===ok)&&this.handleTooltip(n,i,e!==ok),o)for(let s=0,a=o.length;s=0&&i.splice(o,1),this}pickEvent(e){const n=$B(e,this._canvas),r=this._origin;return this.pick(this._scene,n[0],n[1],n[0]-r[0],n[1]-r[1])}pick(e,n,r,i,o){const s=this.context();return Ec[e.marktype].pick.call(this,s,e,n,r,i,o)}}const fMt=t=>t===NN||t===zN||t===jN?[NN,zN,jN]:[t];function Qge(t,e){fMt(e).forEach(n=>dMt(t,n))}function dMt(t,e){const n=t.canvas();n&&!t._events[e]&&(t._events[e]=1,n.addEventListener(e,t[e]?r=>t[e](r):r=>t.fire(e,r)))}function aT(t,e,n){e.forEach(r=>t.fire(r,n))}function Kge(t,e,n){return function(r){const i=this._active,o=this.pickEvent(r);o===i?aT(this,t,r):((!i||!i.exit)&&aT(this,n,r),this._active=o,aT(this,e,r),aT(this,t,r))}}function Zge(t){return function(e){aT(this,t,e),this._active=null}}function hMt(){return typeof window<"u"&&window.devicePixelRatio||1}function pMt(t,e,n,r,i,o){const s=typeof HTMLElement<"u"&&t instanceof HTMLElement&&t.parentNode!=null,a=t.getContext("2d"),l=s?hMt():i;t.width=e*l,t.height=n*l;for(const c in o)a[c]=o[c];return s&&l!==1&&(t.style.width=e+"px",t.style.height=n+"px"),a.pixelRatio=l,a.setTransform(l,0,0,l,l*r[0],l*r[1]),t}class BN extends _R{constructor(e){super(e),this._options={},this._redraw=!1,this._dirty=new uo,this._tempb=new uo}initialize(e,n,r,i,o,s){return this._options=s||{},this._canvas=this._options.externalContext?null:jv(1,1,this._options.type),e&&this._canvas&&(qc(e,0).appendChild(this._canvas),this._canvas.setAttribute("class","marks")),super.initialize(e,n,r,i,o)}resize(e,n,r,i){if(super.resize(e,n,r,i),this._canvas)pMt(this._canvas,this._width,this._height,this._origin,this._scale,this._options.context);else{const o=this._options.externalContext;o||je("CanvasRenderer is missing a valid canvas or context"),o.scale(this._scale,this._scale),o.translate(this._origin[0],this._origin[1])}return this._redraw=!0,this}canvas(){return this._canvas}context(){return this._options.externalContext||(this._canvas?this._canvas.getContext("2d"):null)}dirty(e){const n=this._tempb.clear().union(e.bounds);let r=e.mark.group;for(;r;)n.translate(r.x||0,r.y||0),r=r.mark.group;this._dirty.union(n)}_render(e,n){const r=this.context(),i=this._origin,o=this._width,s=this._height,a=this._dirty,l=gMt(i,o,s);r.save();const c=this._redraw||a.empty()?(this._redraw=!1,l.expand(1)):mMt(r,l.intersect(a),i);return this.clear(-i[0],-i[1],o,s),this.draw(r,e,c,n),r.restore(),a.clear(),this}draw(e,n,r,i){if(n.marktype!=="group"&&i!=null&&!i.includes(n.marktype))return;const o=Ec[n.marktype];n.clip&&hPt(e,n),o.draw.call(this,e,n,r,i),n.clip&&e.restore()}clear(e,n,r,i){const o=this._options,s=this.context();o.type!=="pdf"&&!o.externalContext&&s.clearRect(e,n,r,i),this._bgcolor!=null&&(s.fillStyle=this._bgcolor,s.fillRect(e,n,r,i))}}const gMt=(t,e,n)=>new uo().set(0,0,e,n).translate(-t[0],-t[1]);function mMt(t,e,n){return e.expand(1).round(),t.pixelRatio%1&&e.scale(t.pixelRatio).round().scale(1/t.pixelRatio),e.translate(-(n[0]%1),-(n[1]%1)),t.beginPath(),t.rect(e.x1,e.y1,e.width(),e.height()),t.clip(),e}class UFe extends Pie{constructor(e,n){super(e,n);const r=this;r._hrefHandler=oV(r,(i,o)=>{o&&o.href&&r.handleHref(i,o,o.href)}),r._tooltipHandler=oV(r,(i,o)=>{r.handleTooltip(i,o,i.type!==ok)})}initialize(e,n,r){let i=this._svg;return i&&(i.removeEventListener(PX,this._hrefHandler),i.removeEventListener(AX,this._tooltipHandler),i.removeEventListener(ok,this._tooltipHandler)),this._svg=i=e&&Aie(e,"svg"),i&&(i.addEventListener(PX,this._hrefHandler),i.addEventListener(AX,this._tooltipHandler),i.addEventListener(ok,this._tooltipHandler)),super.initialize(e,n,r)}canvas(){return this._svg}on(e,n){const r=this.eventName(e),i=this._handlers;if(this._handlerIndex(i[r],e,n)<0){const s={type:e,handler:n,listener:oV(this,n)};(i[r]||(i[r]=[])).push(s),this._svg&&this._svg.addEventListener(r,s.listener)}return this}off(e,n){const r=this.eventName(e),i=this._handlers[r],o=this._handlerIndex(i,e,n);return o>=0&&(this._svg&&this._svg.removeEventListener(r,i[o].listener),i.splice(o,1)),this}}const oV=(t,e)=>n=>{let r=n.target.__data__;r=Array.isArray(r)?r[0]:r,n.vegaType=n.type,e.call(t._obj,n,r)},WFe="aria-hidden",Mie="aria-label",Rie="role",Die="aria-roledescription",VFe="graphics-object",Iie="graphics-symbol",GFe=(t,e,n)=>({[Rie]:t,[Die]:e,[Mie]:n||void 0}),vMt=Wf(["axis-domain","axis-grid","axis-label","axis-tick","axis-title","legend-band","legend-entry","legend-gradient","legend-label","legend-title","legend-symbol","title"]),Jge={axis:{desc:"axis",caption:bMt},legend:{desc:"legend",caption:wMt},"title-text":{desc:"title",caption:t=>`Title text '${tme(t)}'`},"title-subtitle":{desc:"subtitle",caption:t=>`Subtitle text '${tme(t)}'`}},eme={ariaRole:Rie,ariaRoleDescription:Die,description:Mie};function HFe(t,e){const n=e.aria===!1;if(t(WFe,n||void 0),n||e.description==null)for(const r in eme)t(eme[r],void 0);else{const r=e.mark.marktype;t(Mie,e.description),t(Rie,e.ariaRole||(r==="group"?VFe:Iie)),t(Die,e.ariaRoleDescription||`${r} mark`)}}function qFe(t){return t.aria===!1?{[WFe]:!0}:vMt[t.role]?null:Jge[t.role]?xMt(t,Jge[t.role]):yMt(t)}function yMt(t){const e=t.marktype,n=e==="group"||e==="text"||t.items.some(r=>r.description!=null&&r.aria!==!1);return GFe(n?VFe:Iie,`${e} mark container`,t.description)}function xMt(t,e){try{const n=t.items[0],r=e.caption||(()=>"");return GFe(e.role||Iie,e.desc,n.description||r(n))}catch{return null}}function tme(t){return pt(t.text).join(" ")}function bMt(t){const e=t.datum,n=t.orient,r=e.title?XFe(t):null,i=t.context,o=i.scales[e.scale].value,s=i.dataflow.locale(),a=o.type;return`${n==="left"||n==="right"?"Y":"X"}-axis`+(r?` titled '${r}'`:"")+` for a ${zS(a)?"discrete":a} scale with ${aFe(s,o,t)}`}function wMt(t){const e=t.datum,n=e.title?XFe(t):null,r=`${e.type||""} legend`.trim(),i=e.scales,o=Object.keys(i),s=t.context,a=s.scales[i[o[0]]].value,l=s.dataflow.locale();return SMt(r)+(n?` titled '${n}'`:"")+` for ${_Mt(o)} with ${aFe(l,a,t)}`}function XFe(t){try{return pt($n(t.items).items[0].text).join(" ")}catch{return null}}function _Mt(t){return t=t.map(e=>e+(e==="fill"||e==="stroke"?" color":"")),t.length<2?t[0]:t.slice(0,-1).join(", ")+" and "+$n(t)}function SMt(t){return t.length?t[0].toUpperCase()+t.slice(1):t}const YFe=t=>(t+"").replace(/&/g,"&").replace(//g,">"),CMt=t=>YFe(t).replace(/"/g,""").replace(/\t/g," ").replace(/\n/g," ").replace(/\r/g," ");function Lie(){let t="",e="",n="";const r=[],i=()=>e=n="",o=l=>{e&&(t+=`${e}>${n}`,i()),r.push(l)},s=(l,c)=>(c!=null&&(e+=` ${l}="${CMt(c)}"`),a),a={open(l){o(l),e="<"+l;for(var c=arguments.length,u=new Array(c>1?c-1:0),f=1;f${n}`:"/>"):t+=``,i(),a},attr:s,text:l=>(n+=YFe(l),a),toString:()=>t};return a}const QFe=t=>KFe(Lie(),t)+"";function KFe(t,e){if(t.open(e.tagName),e.hasAttributes()){const n=e.attributes,r=n.length;for(let i=0;i{u.dirty=n})),!i.zdirty){if(r.exit){s.nested&&i.items.length?(c=i.items[0],c._svg&&this._update(s,c._svg,c)):r._svg&&(c=r._svg.parentNode,c&&c.removeChild(r._svg)),r._svg=null;continue}r=s.nested?i.items[0]:r,r._update!==n&&(!r._svg||!r._svg.ownerSVGElement?(this._dirtyAll=!1,rme(r,n)):this._update(s,r._svg,r),r._update=n)}return!this._dirtyAll}mark(e,n,r,i){if(!this.isDirty(n))return n._svg;const o=this._svg,s=n.marktype,a=Ec[s],l=n.interactive===!1?"none":null,c=a.tag==="g",u=ime(n,e,r,"g",o);if(s!=="group"&&i!=null&&!i.includes(s))return qc(u,0),n._svg;u.setAttribute("class",LFe(n));const f=qFe(n);for(const g in f)da(u,g,f[g]);c||da(u,"pointer-events",l),da(u,"clip-path",n.clip?hie(this,n,n.group):null);let d=null,h=0;const p=g=>{const m=this.isDirty(g),v=ime(g,u,d,a.tag,o);m&&(this._update(a,v,g),c&&TMt(this,v,g,i)),d=v,++h};return a.nested?n.items.length&&p(n.items[0]):Gf(n,p),qc(u,h),u}_update(e,n,r){Xp=n,zs=n.__values__,HFe(sk,r),e.attr(sk,r,this);const i=AMt[e.type];i&&i.call(this,e,n,r),Xp&&this.style(Xp,r)}style(e,n){if(n!=null){for(const r in UN){let i=r==="font"?wR(n):n[r];if(i===zs[r])continue;const o=UN[r];i==null?e.removeAttribute(o):(uie(i)&&(i=cFe(i,this._defs.gradient,JFe())),e.setAttribute(o,i+"")),zs[r]=i}for(const r in WN)b3(e,WN[r],n[r])}}defs(){const e=this._svg,n=this._defs;let r=n.el,i=0;for(const o in n.gradient)r||(n.el=r=xo(e,KE+1,"defs",vo)),i=OMt(r,n.gradient[o],i);for(const o in n.clipping)r||(n.el=r=xo(e,KE+1,"defs",vo)),i=EMt(r,n.clipping[o],i);r&&(i===0?(e.removeChild(r),n.el=null):qc(r,i))}_clearDefs(){const e=this._defs;e.gradient={},e.clipping={}}}function rme(t,e){for(;t&&t.dirty!==e;t=t.mark.group)if(t.dirty=e,t.mark&&t.mark.dirty!==e)t.mark.dirty=e;else return}function OMt(t,e,n){let r,i,o;if(e.gradient==="radial"){let s=xo(t,n++,"pattern",vo);hv(s,{id:MN+e.id,viewBox:"0,0,1,1",width:"100%",height:"100%",preserveAspectRatio:"xMidYMid slice"}),s=xo(s,0,"rect",vo),hv(s,{width:1,height:1,fill:`url(${JFe()}#${e.id})`}),t=xo(t,n++,"radialGradient",vo),hv(t,{id:e.id,fx:e.x1,fy:e.y1,fr:e.r1,cx:e.x2,cy:e.y2,r:e.r2})}else t=xo(t,n++,"linearGradient",vo),hv(t,{id:e.id,x1:e.x1,x2:e.x2,y1:e.y1,y2:e.y2});for(r=0,i=e.stops.length;r{i=t.mark(e,s,i,r),++o}),qc(e,1+o)}function ime(t,e,n,r,i){let o=t._svg,s;if(!o&&(s=e.ownerDocument,o=dv(s,r,vo),t._svg=o,t.mark&&(o.__data__=t,o.__values__={fill:"default"},r==="g"))){const a=dv(s,"path",vo);o.appendChild(a),a.__data__=t;const l=dv(s,"g",vo);o.appendChild(l),l.__data__=t;const c=dv(s,"path",vo);o.appendChild(c),c.__data__=t,c.__values__={fill:"default"}}return(o.ownerSVGElement!==i||kMt(o,n))&&e.insertBefore(o,n?n.nextSibling:e.firstChild),o}function kMt(t,e){return t.parentNode&&t.parentNode.childNodes.length>1&&t.previousSibling!=e}let Xp=null,zs=null;const AMt={group(t,e,n){const r=Xp=e.childNodes[2];zs=r.__values__,t.foreground(sk,n,this),zs=e.__values__,Xp=e.childNodes[1],t.content(sk,n,this);const i=Xp=e.childNodes[0];t.background(sk,n,this);const o=n.mark.interactive===!1?"none":null;if(o!==zs.events&&(da(r,"pointer-events",o),da(i,"pointer-events",o),zs.events=o),n.strokeForeground&&n.stroke){const s=n.fill;da(r,"display",null),this.style(i,n),da(i,"stroke",null),s&&(n.fill=null),zs=r.__values__,this.style(r,n),s&&(n.fill=s),Xp=null}else da(r,"display","none")},image(t,e,n){n.smooth===!1?(b3(e,"image-rendering","optimizeSpeed"),b3(e,"image-rendering","pixelated")):b3(e,"image-rendering",null)},text(t,e,n){const r=bR(n);let i,o,s,a;We(r)?(o=r.map(l=>cy(n,l)),i=o.join(` +`),i!==zs.text&&(qc(e,0),s=e.ownerDocument,a=ly(n),o.forEach((l,c)=>{const u=dv(s,"tspan",vo);u.__data__=n,u.textContent=l,c&&(u.setAttribute("x",0),u.setAttribute("dy",a)),e.appendChild(u)}),zs.text=i)):(o=cy(n,r),o!==zs.text&&(e.textContent=o,zs.text=o)),da(e,"font-family",wR(n)),da(e,"font-size",jh(n)+"px"),da(e,"font-style",n.fontStyle),da(e,"font-variant",n.fontVariant),da(e,"font-weight",n.fontWeight)}};function sk(t,e,n){e!==zs[t]&&(n?PMt(Xp,t,e,n):da(Xp,t,e),zs[t]=e)}function b3(t,e,n){n!==zs[e]&&(n==null?t.style.removeProperty(e):t.style.setProperty(e,n+""),zs[e]=n)}function hv(t,e){for(const n in e)da(t,n,e[n])}function da(t,e,n){n!=null?t.setAttribute(e,n):t.removeAttribute(e)}function PMt(t,e,n,r){n!=null?t.setAttributeNS(r,e,n):t.removeAttributeNS(r,e)}function JFe(){let t;return typeof window>"u"?"":(t=window.location).hash?t.href.slice(0,-t.hash.length):t.href}class eNe extends _R{constructor(e){super(e),this._text=null,this._defs={gradient:{},clipping:{}}}svg(){return this._text}_render(e){const n=Lie();n.open("svg",cn({},DA,{class:"marks",width:this._width*this._scale,height:this._height*this._scale,viewBox:`0 0 ${this._width} ${this._height}`}));const r=this._bgcolor;return r&&r!=="transparent"&&r!=="none"&&n.open("rect",{width:this._width,height:this._height,fill:r}).close(),n.open("g",ZFe,{transform:"translate("+this._origin+")"}),this.mark(n,e),n.close(),this.defs(n),this._text=n.close()+"",this}mark(e,n){const r=Ec[n.marktype],i=r.tag,o=[HFe,r.attr];e.open("g",{class:LFe(n),"clip-path":n.clip?hie(this,n,n.group):null},qFe(n),{"pointer-events":i!=="g"&&n.interactive===!1?"none":null});const s=a=>{const l=this.href(a);if(l&&e.open("a",l),e.open(i,this.attr(n,a,o,i!=="g"?i:null)),i==="text"){const c=bR(a);if(We(c)){const u={x:0,dy:ly(a)};for(let f=0;fthis.mark(e,d)),e.close(),c&&f?(u&&(a.fill=null),a.stroke=f,e.open("path",this.attr(n,a,r.foreground,"bgrect")).close(),u&&(a.fill=u)):e.open("path",this.attr(n,a,r.foreground,"bgfore")).close()}e.close(),l&&e.close()};return r.nested?n.items&&n.items.length&&s(n.items[0]):Gf(n,s),e.close()}href(e){const n=e.href;let r;if(n){if(r=this._hrefs&&this._hrefs[n])return r;this.sanitizeURL(n).then(i=>{i["xlink:href"]=i.href,i.href=null,(this._hrefs||(this._hrefs={}))[n]=i})}return null}attr(e,n,r,i){const o={},s=(a,l,c,u)=>{o[u||a]=l};return Array.isArray(r)?r.forEach(a=>a(s,n,this)):r(s,n,this),i&&MMt(o,n,e,i,this._defs),o}defs(e){const n=this._defs.gradient,r=this._defs.clipping;if(Object.keys(n).length+Object.keys(r).length!==0){e.open("defs");for(const o in n){const s=n[o],a=s.stops;s.gradient==="radial"?(e.open("pattern",{id:MN+o,viewBox:"0,0,1,1",width:"100%",height:"100%",preserveAspectRatio:"xMidYMid slice"}),e.open("rect",{width:"1",height:"1",fill:"url(#"+o+")"}).close(),e.close(),e.open("radialGradient",{id:o,fx:s.x1,fy:s.y1,fr:s.r1,cx:s.x2,cy:s.y2,r:s.r2})):e.open("linearGradient",{id:o,x1:s.x1,x2:s.x2,y1:s.y1,y2:s.y2});for(let l=0;l!df.svgMarkTypes.includes(o));this._svgRenderer.render(e,df.svgMarkTypes),this._canvasRenderer.render(e,i)}resize(e,n,r,i){return super.resize(e,n,r,i),this._svgRenderer.resize(e,n,r,i),this._canvasRenderer.resize(e,n,r,i),this}background(e){return df.svgOnTop?this._canvasRenderer.background(e):this._svgRenderer.background(e),this}}class tNe extends SR{constructor(e,n){super(e,n)}initialize(e,n,r){const i=xo(xo(e,0,"div"),df.svgOnTop?0:1,"div");return super.initialize(i,n,r)}}const nNe="canvas",rNe="hybrid",iNe="png",oNe="svg",sNe="none",pv={Canvas:nNe,PNG:iNe,SVG:oNe,Hybrid:rNe,None:sNe},hb={};hb[nNe]=hb[iNe]={renderer:BN,headless:BN,handler:SR};hb[oNe]={renderer:$ie,headless:eNe,handler:UFe};hb[rNe]={renderer:MX,headless:MX,handler:tNe};hb[sNe]={};function FB(t,e){return t=String(t||"").toLowerCase(),arguments.length>1?(hb[t]=e,this):hb[t]}function aNe(t,e,n){const r=[],i=new uo().union(e),o=t.marktype;return o?lNe(t,i,n,r):o==="group"?cNe(t,i,n,r):je("Intersect scene must be mark node or group item.")}function lNe(t,e,n,r){if(DMt(t,e,n)){const i=t.items,o=t.marktype,s=i.length;let a=0;if(o==="group")for(;a=0;o--)if(n[o]!=r[o])return!1;for(o=n.length-1;o>=0;o--)if(i=n[o],!Fie(t[i],e[i],i))return!1;return typeof t==typeof e}function $Mt(){mFe(),sAt()}const WS="top",Cf="left",Of="right",uy="bottom",FMt="top-left",NMt="top-right",zMt="bottom-left",jMt="bottom-right",Nie="start",RX="middle",pa="end",BMt="x",UMt="y",NB="group",zie="axis",jie="title",WMt="frame",VMt="scope",Bie="legend",hNe="row-header",pNe="row-footer",gNe="row-title",mNe="column-header",vNe="column-footer",yNe="column-title",GMt="padding",HMt="symbol",xNe="fit",bNe="fit-x",wNe="fit-y",qMt="pad",Uie="none",II="all",DX="each",Wie="flush",gv="column",mv="row";function _Ne(t){De.call(this,null,t)}it(_Ne,De,{transform(t,e){const n=e.dataflow,r=t.mark,i=r.marktype,o=Ec[i],s=o.bound;let a=r.bounds,l;if(o.nested)r.items.length&&n.dirty(r.items[0]),a=LI(r,s),r.items.forEach(c=>{c.bounds.clear().union(a)});else if(i===NB||t.modified())switch(e.visit(e.MOD,c=>n.dirty(c)),a.clear(),r.items.forEach(c=>a.union(LI(c,s))),r.role){case zie:case Bie:case jie:e.reflow()}else l=e.changed(e.REM),e.visit(e.ADD,c=>{a.union(LI(c,s))}),e.visit(e.MOD,c=>{l=l||a.alignsWith(c.bounds),n.dirty(c),a.union(LI(c,s))}),l&&(a.clear(),r.items.forEach(c=>a.union(c.bounds)));return fNe(r),e.modifies("bounds")}});function LI(t,e,n){return e(t.bounds.clear(),t,n)}const ome=":vega_identifier:";function Vie(t){De.call(this,0,t)}Vie.Definition={type:"Identifier",metadata:{modifies:!0},params:[{name:"as",type:"string",required:!0}]};it(Vie,De,{transform(t,e){const n=XMt(e.dataflow),r=t.as;let i=n.value;return e.visit(e.ADD,o=>o[r]=o[r]||++i),n.set(this.value=i),e}});function XMt(t){return t._signals[ome]||(t._signals[ome]=t.add(0))}function SNe(t){De.call(this,null,t)}it(SNe,De,{transform(t,e){let n=this.value;n||(n=e.dataflow.scenegraph().mark(t.markdef,YMt(t),t.index),n.group.context=t.context,t.context.group||(t.context.group=n.group),n.source=this.source,n.clip=t.clip,n.interactive=t.interactive,this.value=n);const r=n.marktype===NB?AB:kB;return e.visit(e.ADD,i=>r.call(i,n)),(t.modified("clip")||t.modified("interactive"))&&(n.clip=t.clip,n.interactive=!!t.interactive,n.zdirty=!0,e.reflow()),n.items=e.source,e}});function YMt(t){const e=t.groups,n=t.parent;return e&&e.size===1?e.get(Object.keys(e.object)[0]):e&&n?e.lookup(n):null}function CNe(t){De.call(this,null,t)}const sme={parity:t=>t.filter((e,n)=>n%2?e.opacity=0:1),greedy:(t,e)=>{let n;return t.filter((r,i)=>!i||!ONe(n.bounds,r.bounds,e)?(n=r,1):r.opacity=0)}},ONe=(t,e,n)=>n>Math.max(e.x1-t.x2,t.x1-e.x2,e.y1-t.y2,t.y1-e.y2),ame=(t,e)=>{for(var n=1,r=t.length,i=t[0].bounds,o;n{const e=t.bounds;return e.width()>1&&e.height()>1},KMt=(t,e,n)=>{var r=t.range(),i=new uo;return e===WS||e===uy?i.set(r[0],-1/0,r[1],1/0):i.set(-1/0,r[0],1/0,r[1]),i.expand(n||1),o=>i.encloses(o.bounds)},lme=t=>(t.forEach(e=>e.opacity=1),t),cme=(t,e)=>t.reflow(e.modified()).modifies("opacity");it(CNe,De,{transform(t,e){const n=sme[t.method]||sme.parity,r=t.separation||0;let i=e.materialize(e.SOURCE).source,o,s;if(!i||!i.length)return;if(!t.method)return t.modified("method")&&(lme(i),e=cme(e,t)),e;if(i=i.filter(QMt),!i.length)return;if(t.sort&&(i=i.slice().sort(t.sort)),o=lme(i),e=cme(e,t),o.length>=3&&ame(o,r)){do o=n(o,r);while(o.length>=3&&ame(o,r));o.length<3&&!$n(i).opacity&&(o.length>1&&($n(o).opacity=0),$n(i).opacity=1)}t.boundScale&&t.boundTolerance>=0&&(s=KMt(t.boundScale,t.boundOrient,+t.boundTolerance),i.forEach(l=>{s(l)||(l.opacity=0)}));const a=o[0].mark.bounds.clear();return i.forEach(l=>{l.opacity&&a.union(l.bounds)}),e}});function ENe(t){De.call(this,null,t)}it(ENe,De,{transform(t,e){const n=e.dataflow;if(e.visit(e.ALL,r=>n.dirty(r)),e.fields&&e.fields.zindex){const r=e.source&&e.source[0];r&&(r.mark.zdirty=!0)}}});const Fs=new uo;function a_(t,e,n){return t[e]===n?0:(t[e]=n,1)}function ZMt(t){var e=t.items[0].orient;return e===Cf||e===Of}function JMt(t){let e=+t.grid;return[t.ticks?e++:-1,t.labels?e++:-1,e+ +t.domain]}function eRt(t,e,n,r){var i=e.items[0],o=i.datum,s=i.translate!=null?i.translate:.5,a=i.orient,l=JMt(o),c=i.range,u=i.offset,f=i.position,d=i.minExtent,h=i.maxExtent,p=o.title&&i.items[l[2]].items[0],g=i.titlePadding,m=i.bounds,v=p&&Eie(p),y=0,x=0,b,w;switch(Fs.clear().union(m),m.clear(),(b=l[0])>-1&&m.union(i.items[b].bounds),(b=l[1])>-1&&m.union(i.items[b].bounds),a){case WS:y=f||0,x=-u,w=Math.max(d,Math.min(h,-m.y1)),m.add(0,-w).add(c,0),p&&$I(t,p,w,g,v,0,-1,m);break;case Cf:y=-u,x=f||0,w=Math.max(d,Math.min(h,-m.x1)),m.add(-w,0).add(0,c),p&&$I(t,p,w,g,v,1,-1,m);break;case Of:y=n+u,x=f||0,w=Math.max(d,Math.min(h,m.x2)),m.add(0,0).add(w,c),p&&$I(t,p,w,g,v,1,1,m);break;case uy:y=f||0,x=r+u,w=Math.max(d,Math.min(h,m.y2)),m.add(0,0).add(c,w),p&&$I(t,p,w,g,0,0,1,m);break;default:y=i.x,x=i.y}return qg(m.translate(y,x),i),a_(i,"x",y+s)|a_(i,"y",x+s)&&(i.bounds=Fs,t.dirty(i),i.bounds=m,t.dirty(i)),i.mark.bounds.clear().union(m)}function $I(t,e,n,r,i,o,s,a){const l=e.bounds;if(e.auto){const c=s*(n+i+r);let u=0,f=0;t.dirty(e),o?u=(e.x||0)-(e.x=c):f=(e.y||0)-(e.y=c),e.mark.bounds.clear().union(l.translate(-u,-f)),t.dirty(e)}a.union(l)}const ume=(t,e)=>Math.floor(Math.min(t,e)),fme=(t,e)=>Math.ceil(Math.max(t,e));function tRt(t){var e=t.items,n=e.length,r=0,i,o;const s={marks:[],rowheaders:[],rowfooters:[],colheaders:[],colfooters:[],rowtitle:null,coltitle:null};for(;r1)for(S=0;S0&&(x[S]+=T/2);if(a&&ci(n.center,mv)&&u!==1)for(S=0;S0&&(b[S]+=M/2);for(S=0;Si&&(t.warn("Grid headers exceed limit: "+i),e=e.slice(0,i)),g+=o,y=0,b=e.length;y=0&&(S=n[x])==null;x-=d);a?(O=h==null?S.x:Math.round(S.bounds.x1+h*S.bounds.width()),k=g):(O=g,k=h==null?S.y:Math.round(S.bounds.y1+h*S.bounds.height())),w.union(_.bounds.translate(O-(_.x||0),k-(_.y||0))),_.x=O,_.y=k,t.dirty(_),m=s(m,w[c])}return m}function hme(t,e,n,r,i,o){if(e){t.dirty(e);var s=n,a=n;r?s=Math.round(i.x1+o*i.width()):a=Math.round(i.y1+o*i.height()),e.bounds.translate(s-(e.x||0),a-(e.y||0)),e.mark.bounds.clear().union(e.bounds),e.x=s,e.y=a,t.dirty(e)}}function aRt(t,e){const n=t[e]||{};return(r,i)=>n[r]!=null?n[r]:t[r]!=null?t[r]:i}function lRt(t,e){let n=-1/0;return t.forEach(r=>{r.offset!=null&&(n=Math.max(n,r.offset))}),n>-1/0?n:e}function cRt(t,e,n,r,i,o,s){const a=aRt(n,e),l=lRt(t,a("offset",0)),c=a("anchor",Nie),u=c===pa?1:c===RX?.5:0,f={align:DX,bounds:a("bounds",Wie),columns:a("direction")==="vertical"?1:t.length,padding:a("margin",8),center:a("center"),nodirty:!0};switch(e){case Cf:f.anchor={x:Math.floor(r.x1)-l,column:pa,y:u*(s||r.height()+2*r.y1),row:c};break;case Of:f.anchor={x:Math.ceil(r.x2)+l,y:u*(s||r.height()+2*r.y1),row:c};break;case WS:f.anchor={y:Math.floor(i.y1)-l,row:pa,x:u*(o||i.width()+2*i.x1),column:c};break;case uy:f.anchor={y:Math.ceil(i.y2)+l,x:u*(o||i.width()+2*i.x1),column:c};break;case FMt:f.anchor={x:l,y:l};break;case NMt:f.anchor={x:o-l,y:l,column:pa};break;case zMt:f.anchor={x:l,y:s-l,row:pa};break;case jMt:f.anchor={x:o-l,y:s-l,column:pa,row:pa};break}return f}function uRt(t,e){var n=e.items[0],r=n.datum,i=n.orient,o=n.bounds,s=n.x,a=n.y,l,c;return n._bounds?n._bounds.clear().union(o):n._bounds=o.clone(),o.clear(),dRt(t,n,n.items[0].items[0]),o=fRt(n,o),l=2*n.padding,c=2*n.padding,o.empty()||(l=Math.ceil(o.width()+l),c=Math.ceil(o.height()+c)),r.type===HMt&&hRt(n.items[0].items[0].items[0].items),i!==Uie&&(n.x=s=0,n.y=a=0),n.width=l,n.height=c,qg(o.set(s,a,s+l,a+c),n),n.mark.bounds.clear().union(o),n}function fRt(t,e){return t.items.forEach(n=>e.union(n.bounds)),e.x1=t.padding,e.y1=t.padding,e}function dRt(t,e,n){var r=e.padding,i=r-n.x,o=r-n.y;if(!e.datum.title)(i||o)&&ZE(t,n,i,o);else{var s=e.items[1].items[0],a=s.anchor,l=e.titlePadding||0,c=r-s.x,u=r-s.y;switch(s.orient){case Cf:i+=Math.ceil(s.bounds.width())+l;break;case Of:case uy:break;default:o+=s.bounds.height()+l}switch((i||o)&&ZE(t,n,i,o),s.orient){case Cf:u+=Y1(e,n,s,a,1,1);break;case Of:c+=Y1(e,n,s,pa,0,0)+l,u+=Y1(e,n,s,a,1,1);break;case uy:c+=Y1(e,n,s,a,0,0),u+=Y1(e,n,s,pa,-1,0,1)+l;break;default:c+=Y1(e,n,s,a,0,0)}(c||u)&&ZE(t,s,c,u),(c=Math.round(s.bounds.x1-r))<0&&(ZE(t,n,-c,0),ZE(t,s,-c,0))}}function Y1(t,e,n,r,i,o,s){const a=t.datum.type!=="symbol",l=n.datum.vgrad,c=a&&(o||!l)&&!s?e.items[0]:e,u=c.bounds[i?"y2":"x2"]-t.padding,f=l&&o?u:0,d=l&&o?0:u,h=i<=0?0:Eie(n);return Math.round(r===Nie?f:r===pa?d-h:.5*(u-h))}function ZE(t,e,n,r){e.x+=n,e.y+=r,e.bounds.translate(n,r),e.mark.bounds.translate(n,r),t.dirty(e)}function hRt(t){const e=t.reduce((n,r)=>(n[r.column]=Math.max(r.bounds.x2-r.x,n[r.column]||0),n),{});t.forEach(n=>{n.width=e[n.column],n.height=n.bounds.y2-n.y})}function pRt(t,e,n,r,i){var o=e.items[0],s=o.frame,a=o.orient,l=o.anchor,c=o.offset,u=o.padding,f=o.items[0].items[0],d=o.items[1]&&o.items[1].items[0],h=a===Cf||a===Of?r:n,p=0,g=0,m=0,v=0,y=0,x;if(s!==NB?a===Cf?(p=i.y2,h=i.y1):a===Of?(p=i.y1,h=i.y2):(p=i.x1,h=i.x2):a===Cf&&(p=r,h=0),x=l===Nie?p:l===pa?h:(p+h)/2,d&&d.text){switch(a){case WS:case uy:y=f.bounds.height()+u;break;case Cf:v=f.bounds.width()+u;break;case Of:v=-f.bounds.width()-u;break}Fs.clear().union(d.bounds),Fs.translate(v-(d.x||0),y-(d.y||0)),a_(d,"x",v)|a_(d,"y",y)&&(t.dirty(d),d.bounds.clear().union(Fs),d.mark.bounds.clear().union(Fs),t.dirty(d)),Fs.clear().union(d.bounds)}else Fs.clear();switch(Fs.union(f.bounds),a){case WS:g=x,m=i.y1-Fs.height()-c;break;case Cf:g=i.x1-Fs.width()-c,m=x;break;case Of:g=i.x2+Fs.width()+c,m=x;break;case uy:g=x,m=i.y2+c;break;default:g=o.x,m=o.y}return a_(o,"x",g)|a_(o,"y",m)&&(Fs.translate(g,m),t.dirty(o),o.bounds.clear().union(Fs),e.bounds.clear().union(Fs),t.dirty(o)),o.bounds}function kNe(t){De.call(this,null,t)}it(kNe,De,{transform(t,e){const n=e.dataflow;return t.mark.items.forEach(r=>{t.layout&&iRt(n,r,t.layout),mRt(n,r,t)}),gRt(t.mark.group)?e.reflow():e}});function gRt(t){return t&&t.mark.role!=="legend-entry"}function mRt(t,e,n){var r=e.items,i=Math.max(0,e.width||0),o=Math.max(0,e.height||0),s=new uo().set(0,0,i,o),a=s.clone(),l=s.clone(),c=[],u,f,d,h,p,g;for(p=0,g=r.length;p{d=v.orient||Of,d!==Uie&&(m[d]||(m[d]=[])).push(v)});for(const v in m){const y=m[v];TNe(t,y,cRt(y,v,n.legends,a,l,i,o))}c.forEach(v=>{const y=v.bounds;if(y.equals(v._bounds)||(v.bounds=v._bounds,t.dirty(v),v.bounds=y,t.dirty(v)),n.autosize&&(n.autosize.type===xNe||n.autosize.type===bNe||n.autosize.type===wNe))switch(v.orient){case Cf:case Of:s.add(y.x1,0).add(y.x2,0);break;case WS:case uy:s.add(0,y.y1).add(0,y.y2)}else s.union(y)})}s.union(a).union(l),u&&s.union(pRt(t,u,i,o,s)),e.clip&&s.set(0,0,e.width||0,e.height||0),vRt(t,e,s,n)}function vRt(t,e,n,r){const i=r.autosize||{},o=i.type;if(t._autosize<1||!o)return;let s=t._width,a=t._height,l=Math.max(0,e.width||0),c=Math.max(0,Math.ceil(-n.x1)),u=Math.max(0,e.height||0),f=Math.max(0,Math.ceil(-n.y1));const d=Math.max(0,Math.ceil(n.x2-l)),h=Math.max(0,Math.ceil(n.y2-u));if(i.contains===GMt){const p=t.padding();s-=p.left+p.right,a-=p.top+p.bottom}o===Uie?(c=0,f=0,l=s,u=a):o===xNe?(l=Math.max(0,s-c-d),u=Math.max(0,a-f-h)):o===bNe?(l=Math.max(0,s-c-d),a=u+f+h):o===wNe?(s=l+c+d,u=Math.max(0,a-f-h)):o===qMt&&(s=l+c+d,a=u+f+h),t._resizeView(s,a,l,u,[c,f],i.resize)}const yRt=Object.freeze(Object.defineProperty({__proto__:null,bound:_Ne,identifier:Vie,mark:SNe,overlap:CNe,render:ENe,viewlayout:kNe},Symbol.toStringTag,{value:"Module"}));function ANe(t){De.call(this,null,t)}it(ANe,De,{transform(t,e){if(this.value&&!t.modified())return e.StopPropagation;var n=e.dataflow.locale(),r=e.fork(e.NO_SOURCE|e.NO_FIELDS),i=this.value,o=t.scale,s=t.count==null?t.values?t.values.length:10:t.count,a=lie(o,s,t.minstep),l=t.format||nFe(n,o,a,t.formatSpecifier,t.formatType,!!t.values),c=t.values?tFe(o,t.values,a):cie(o,a);return i&&(r.rem=i),i=c.map((u,f)=>cr({index:f/(c.length-1||1),value:u,label:l(u)})),t.extra&&i.length&&i.push(cr({index:-1,extra:{value:i[0].value},label:""})),r.source=i,r.add=i,this.value=i,r}});function PNe(t){De.call(this,null,t)}function xRt(){return cr({})}function bRt(t){const e=vO().test(n=>n.exit);return e.lookup=n=>e.get(t(n)),e}it(PNe,De,{transform(t,e){var n=e.dataflow,r=e.fork(e.NO_SOURCE|e.NO_FIELDS),i=t.item||xRt,o=t.key||jt,s=this.value;return We(r.encode)&&(r.encode=null),s&&(t.modified("key")||e.modified(o))&&je("DataJoin does not support modified key function or fields."),s||(e=e.addAll(),this.value=s=bRt(o)),e.visit(e.ADD,a=>{const l=o(a);let c=s.get(l);c?c.exit?(s.empty--,r.add.push(c)):r.mod.push(c):(c=i(a),s.set(l,c),r.add.push(c)),c.datum=a,c.exit=!1}),e.visit(e.MOD,a=>{const l=o(a),c=s.get(l);c&&(c.datum=a,r.mod.push(c))}),e.visit(e.REM,a=>{const l=o(a),c=s.get(l);a===c.datum&&!c.exit&&(r.rem.push(c),c.exit=!0,++s.empty)}),e.changed(e.ADD_MOD)&&r.modifies("datum"),(e.clean()||t.clean&&s.empty>n.cleanThreshold)&&n.runAfter(s.clean),r}});function MNe(t){De.call(this,null,t)}it(MNe,De,{transform(t,e){var n=e.fork(e.ADD_REM),r=t.mod||!1,i=t.encoders,o=e.encode;if(We(o))if(n.changed()||o.every(f=>i[f]))o=o[0],n.encode=null;else return e.StopPropagation;var s=o==="enter",a=i.update||Pm,l=i.enter||Pm,c=i.exit||Pm,u=(o&&!s?i[o]:a)||Pm;if(e.changed(e.ADD)&&(e.visit(e.ADD,f=>{l(f,t),a(f,t)}),n.modifies(l.output),n.modifies(a.output),u!==Pm&&u!==a&&(e.visit(e.ADD,f=>{u(f,t)}),n.modifies(u.output))),e.changed(e.REM)&&c!==Pm&&(e.visit(e.REM,f=>{c(f,t)}),n.modifies(c.output)),s||u!==Pm){const f=e.MOD|(t.modified()?e.REFLOW:0);s?(e.visit(f,d=>{const h=l(d,t)||r;(u(d,t)||h)&&n.mod.push(d)}),n.mod.length&&n.modifies(l.output)):e.visit(f,d=>{(u(d,t)||r)&&n.mod.push(d)}),n.mod.length&&n.modifies(u.output)}return n.changed()?n:e.StopPropagation}});function RNe(t){De.call(this,[],t)}it(RNe,De,{transform(t,e){if(this.value!=null&&!t.modified())return e.StopPropagation;var n=e.dataflow.locale(),r=e.fork(e.NO_SOURCE|e.NO_FIELDS),i=this.value,o=t.type||d3,s=t.scale,a=+t.limit,l=lie(s,t.count==null?5:t.count,t.minstep),c=!!t.values||o===d3,u=t.format||sFe(n,s,l,o,t.formatSpecifier,t.formatType,c),f=t.values||oFe(s,l),d,h,p,g,m;return i&&(r.rem=i),o===d3?(a&&f.length>a?(e.dataflow.warn("Symbol legend count exceeds limit, filtering items."),i=f.slice(0,a-1),m=!0):i=f,fn(p=t.size)?(!t.values&&s(i[0])===0&&(i=i.slice(1)),g=i.reduce((v,y)=>Math.max(v,p(y,t)),0)):p=ta(g=p||8),i=i.map((v,y)=>cr({index:y,label:u(v,y,i),value:v,offset:g,size:p(v,t)})),m&&(m=f[i.length],i.push(cr({index:i.length,label:`…${f.length-i.length} entries`,value:m,offset:g,size:p(m,t)})))):o===qkt?(d=s.domain(),h=Z3e(s,d[0],$n(d)),f.length<3&&!t.values&&d[0]!==$n(d)&&(f=[d[0],$n(d)]),i=f.map((v,y)=>cr({index:y,label:u(v,y,f),value:v,perc:h(v)}))):(p=f.length-1,h=iAt(s),i=f.map((v,y)=>cr({index:y,label:u(v,y,f),value:v,perc:y?h(v):0,perc2:y===p?1:h(f[y+1])}))),r.source=i,r.add=i,this.value=i,r}});const wRt=t=>t.source.x,_Rt=t=>t.source.y,SRt=t=>t.target.x,CRt=t=>t.target.y;function Gie(t){De.call(this,{},t)}Gie.Definition={type:"LinkPath",metadata:{modifies:!0},params:[{name:"sourceX",type:"field",default:"source.x"},{name:"sourceY",type:"field",default:"source.y"},{name:"targetX",type:"field",default:"target.x"},{name:"targetY",type:"field",default:"target.y"},{name:"orient",type:"enum",default:"vertical",values:["horizontal","vertical","radial"]},{name:"shape",type:"enum",default:"line",values:["line","arc","curve","diagonal","orthogonal"]},{name:"require",type:"signal"},{name:"as",type:"string",default:"path"}]};it(Gie,De,{transform(t,e){var n=t.sourceX||wRt,r=t.sourceY||_Rt,i=t.targetX||SRt,o=t.targetY||CRt,s=t.as||"path",a=t.orient||"vertical",l=t.shape||"line",c=pme.get(l+"-"+a)||pme.get(l);return c||je("LinkPath unsupported type: "+t.shape+(t.orient?"-"+t.orient:"")),e.visit(e.SOURCE,u=>{u[s]=c(n(u),r(u),i(u),o(u))}),e.reflow(t.modified()).modifies(s)}});const DNe=(t,e,n,r)=>"M"+t+","+e+"L"+n+","+r,ORt=(t,e,n,r)=>DNe(e*Math.cos(t),e*Math.sin(t),r*Math.cos(n),r*Math.sin(n)),INe=(t,e,n,r)=>{var i=n-t,o=r-e,s=Math.hypot(i,o)/2,a=180*Math.atan2(o,i)/Math.PI;return"M"+t+","+e+"A"+s+","+s+" "+a+" 0 1 "+n+","+r},ERt=(t,e,n,r)=>INe(e*Math.cos(t),e*Math.sin(t),r*Math.cos(n),r*Math.sin(n)),LNe=(t,e,n,r)=>{const i=n-t,o=r-e,s=.2*(i+o),a=.2*(o-i);return"M"+t+","+e+"C"+(t+s)+","+(e+a)+" "+(n+a)+","+(r-s)+" "+n+","+r},TRt=(t,e,n,r)=>LNe(e*Math.cos(t),e*Math.sin(t),r*Math.cos(n),r*Math.sin(n)),kRt=(t,e,n,r)=>"M"+t+","+e+"V"+r+"H"+n,ARt=(t,e,n,r)=>"M"+t+","+e+"H"+n+"V"+r,PRt=(t,e,n,r)=>{const i=Math.cos(t),o=Math.sin(t),s=Math.cos(n),a=Math.sin(n),l=Math.abs(n-t)>Math.PI?n<=t:n>t;return"M"+e*i+","+e*o+"A"+e+","+e+" 0 0,"+(l?1:0)+" "+e*s+","+e*a+"L"+r*s+","+r*a},MRt=(t,e,n,r)=>{const i=(t+n)/2;return"M"+t+","+e+"C"+i+","+e+" "+i+","+r+" "+n+","+r},RRt=(t,e,n,r)=>{const i=(e+r)/2;return"M"+t+","+e+"C"+t+","+i+" "+n+","+i+" "+n+","+r},DRt=(t,e,n,r)=>{const i=Math.cos(t),o=Math.sin(t),s=Math.cos(n),a=Math.sin(n),l=(e+r)/2;return"M"+e*i+","+e*o+"C"+l*i+","+l*o+" "+l*s+","+l*a+" "+r*s+","+r*a},pme=vO({line:DNe,"line-radial":ORt,arc:INe,"arc-radial":ERt,curve:LNe,"curve-radial":TRt,"orthogonal-horizontal":kRt,"orthogonal-vertical":ARt,"orthogonal-radial":PRt,"diagonal-horizontal":MRt,"diagonal-vertical":RRt,"diagonal-radial":DRt});function Hie(t){De.call(this,null,t)}Hie.Definition={type:"Pie",metadata:{modifies:!0},params:[{name:"field",type:"field"},{name:"startAngle",type:"number",default:0},{name:"endAngle",type:"number",default:6.283185307179586},{name:"sort",type:"boolean",default:!1},{name:"as",type:"string",array:!0,length:2,default:["startAngle","endAngle"]}]};it(Hie,De,{transform(t,e){var n=t.as||["startAngle","endAngle"],r=n[0],i=n[1],o=t.field||pO,s=t.startAngle||0,a=t.endAngle!=null?t.endAngle:2*Math.PI,l=e.source,c=l.map(o),u=c.length,f=s,d=(a-s)/GIe(c),h=ol(u),p,g,m;for(t.sort&&h.sort((v,y)=>c[v]-c[y]),p=0;p-1)return r;var i=e.domain,o=t.type,s=e.zero||e.zero===void 0&&LRt(t),a,l;if(!i)return 0;if((s||e.domainMin!=null||e.domainMax!=null||e.domainMid!=null)&&(a=(i=i.slice()).length-1||1,s&&(i[0]>0&&(i[0]=0),i[a]<0&&(i[a]=0)),e.domainMin!=null&&(i[0]=e.domainMin),e.domainMax!=null&&(i[a]=e.domainMax),e.domainMid!=null)){l=e.domainMid;const c=l>i[a]?a+1:li+(o<0?-1:o>0?1:0),0));r!==e.length&&n.warn("Log scale domain includes zero: "+rt(e))}return e}function URt(t,e,n){let r=e.bins;if(r&&!We(r)){const i=t.domain(),o=i[0],s=$n(i),a=r.step;let l=r.start==null?o:r.start,c=r.stop==null?s:r.stop;a||je("Scale bins parameter missing step property."),ls&&(c=a*Math.floor(s/a)),r=ol(l,c+a/2,a)}return r?t.bins=r:t.bins&&delete t.bins,t.type===nie&&(r?!e.domain&&!e.domainRaw&&(t.domain(r),n=r.length):t.bins=t.domain()),n}function WRt(t,e,n){var r=t.type,i=e.round||!1,o=e.range;if(e.rangeStep!=null)o=VRt(r,e,n);else if(e.scheme&&(o=GRt(r,e,n),fn(o))){if(t.interpolator)return t.interpolator(o);je(`Scale type ${r} does not support interpolating color schemes.`)}if(o&&X3e(r))return t.interpolator(EB(IX(o,e.reverse),e.interpolate,e.interpolateGamma));o&&e.interpolate&&t.interpolate?t.interpolate(sie(e.interpolate,e.interpolateGamma)):fn(t.round)?t.round(i):fn(t.rangeRound)&&t.interpolate(i?cR:Uy),o&&t.range(IX(o,e.reverse))}function VRt(t,e,n){t!==B3e&&t!==xX&&je("Only band and point scales support rangeStep.");var r=(e.paddingOuter!=null?e.paddingOuter:e.padding)||0,i=t===xX?1:(e.paddingInner!=null?e.paddingInner:e.padding)||0;return[0,e.rangeStep*eie(n,i,r)]}function GRt(t,e,n){var r=e.schemeExtent,i,o;return We(e.scheme)?o=EB(e.scheme,e.interpolate,e.interpolateGamma):(i=e.scheme.toLowerCase(),o=aie(i),o||je(`Unrecognized scheme name: ${e.scheme}`)),n=t===OB?n+1:t===nie?n-1:t===NS||t===CB?+e.schemeCount||IRt:n,X3e(t)?gme(o,r,e.reverse):fn(o)?K3e(gme(o,r),n):t===tie?o:o.slice(0,n)}function gme(t,e,n){return fn(t)&&(e||n)?Q3e(t,IX(e||[0,1],n)):t}function IX(t,e){return e?t.slice().reverse():t}function zNe(t){De.call(this,null,t)}it(zNe,De,{transform(t,e){const n=t.modified("sort")||e.changed(e.ADD)||e.modified(t.sort.fields)||e.modified("datum");return n&&e.source.sort(a1(t.sort)),this.modified(n),e}});const mme="zero",jNe="center",BNe="normalize",UNe=["y0","y1"];function qie(t){De.call(this,null,t)}qie.Definition={type:"Stack",metadata:{modifies:!0},params:[{name:"field",type:"field"},{name:"groupby",type:"field",array:!0},{name:"sort",type:"compare"},{name:"offset",type:"enum",default:mme,values:[mme,jNe,BNe]},{name:"as",type:"string",array:!0,length:2,default:UNe}]};it(qie,De,{transform(t,e){var n=t.as||UNe,r=n[0],i=n[1],o=a1(t.sort),s=t.field||pO,a=t.offset===jNe?HRt:t.offset===BNe?qRt:XRt,l,c,u,f;for(l=YRt(e.source,t.groupby,o,s),c=0,u=l.length,f=l.max;cg(u),s,a,l,c,u,f,d,h,p;if(e==null)i.push(t.slice());else for(s={},a=0,l=t.length;ap&&(p=h),n&&d.sort(n)}return i.max=p,i}const QRt=Object.freeze(Object.defineProperty({__proto__:null,axisticks:ANe,datajoin:PNe,encode:MNe,legendentries:RNe,linkpath:Gie,pie:Hie,scale:FNe,sortitems:zNe,stack:qie},Symbol.toStringTag,{value:"Module"}));var Ut=1e-6,VN=1e-12,xn=Math.PI,$i=xn/2,GN=xn/4,ka=xn*2,Ui=180/xn,vn=xn/180,Ln=Math.abs,TO=Math.atan,Pu=Math.atan2,Vt=Math.cos,NI=Math.ceil,WNe=Math.exp,LX=Math.hypot,HN=Math.log,aV=Math.pow,Bt=Math.sin,ou=Math.sign||function(t){return t>0?1:t<0?-1:0},Aa=Math.sqrt,Xie=Math.tan;function VNe(t){return t>1?0:t<-1?xn:Math.acos(t)}function _l(t){return t>1?$i:t<-1?-$i:Math.asin(t)}function hs(){}function qN(t,e){t&&yme.hasOwnProperty(t.type)&&yme[t.type](t,e)}var vme={Feature:function(t,e){qN(t.geometry,e)},FeatureCollection:function(t,e){for(var n=t.features,r=-1,i=n.length;++r=0?1:-1,i=r*n,o=Vt(e),s=Bt(e),a=zX*s,l=NX*o+a*Vt(i),c=a*r*Bt(i);XN.add(Pu(c,l)),FX=t,NX=o,zX=s}function eDt(t){return YN=new Ca,zp(t,Th),YN*2}function QN(t){return[Pu(t[1],t[0]),_l(t[2])]}function pb(t){var e=t[0],n=t[1],r=Vt(n);return[r*Vt(e),r*Bt(e),Bt(n)]}function zI(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function VS(t,e){return[t[1]*e[2]-t[2]*e[1],t[2]*e[0]-t[0]*e[2],t[0]*e[1]-t[1]*e[0]]}function lV(t,e){t[0]+=e[0],t[1]+=e[1],t[2]+=e[2]}function jI(t,e){return[t[0]*e,t[1]*e,t[2]*e]}function KN(t){var e=Aa(t[0]*t[0]+t[1]*t[1]+t[2]*t[2]);t[0]/=e,t[1]/=e,t[2]/=e}var bi,Ya,Di,Ql,B0,XNe,YNe,L_,ak,qm,Ig,Dp={point:jX,lineStart:bme,lineEnd:wme,polygonStart:function(){Dp.point=KNe,Dp.lineStart=tDt,Dp.lineEnd=nDt,ak=new Ca,Th.polygonStart()},polygonEnd:function(){Th.polygonEnd(),Dp.point=jX,Dp.lineStart=bme,Dp.lineEnd=wme,XN<0?(bi=-(Di=180),Ya=-(Ql=90)):ak>Ut?Ql=90:ak<-Ut&&(Ya=-90),Ig[0]=bi,Ig[1]=Di},sphere:function(){bi=-(Di=180),Ya=-(Ql=90)}};function jX(t,e){qm.push(Ig=[bi=t,Di=t]),eQl&&(Ql=e)}function QNe(t,e){var n=pb([t*vn,e*vn]);if(L_){var r=VS(L_,n),i=[r[1],-r[0],0],o=VS(i,r);KN(o),o=QN(o);var s=t-B0,a=s>0?1:-1,l=o[0]*Ui*a,c,u=Ln(s)>180;u^(a*B0Ql&&(Ql=c)):(l=(l+360)%360-180,u^(a*B0Ql&&(Ql=e))),u?tql(bi,Di)&&(Di=t):ql(t,Di)>ql(bi,Di)&&(bi=t):Di>=bi?(tDi&&(Di=t)):t>B0?ql(bi,t)>ql(bi,Di)&&(Di=t):ql(t,Di)>ql(bi,Di)&&(bi=t)}else qm.push(Ig=[bi=t,Di=t]);eQl&&(Ql=e),L_=n,B0=t}function bme(){Dp.point=QNe}function wme(){Ig[0]=bi,Ig[1]=Di,Dp.point=jX,L_=null}function KNe(t,e){if(L_){var n=t-B0;ak.add(Ln(n)>180?n+(n>0?360:-360):n)}else XNe=t,YNe=e;Th.point(t,e),QNe(t,e)}function tDt(){Th.lineStart()}function nDt(){KNe(XNe,YNe),Th.lineEnd(),Ln(ak)>Ut&&(bi=-(Di=180)),Ig[0]=bi,Ig[1]=Di,L_=null}function ql(t,e){return(e-=t)<0?e+360:e}function rDt(t,e){return t[0]-e[0]}function _me(t,e){return t[0]<=t[1]?t[0]<=e&&e<=t[1]:eql(r[0],r[1])&&(r[1]=i[1]),ql(i[0],r[1])>ql(r[0],r[1])&&(r[0]=i[0])):o.push(r=i);for(s=-1/0,n=o.length-1,e=0,r=o[n];e<=n;r=i,++e)i=o[e],(a=ql(r[1],i[0]))>s&&(s=a,bi=i[0],Di=r[1])}return qm=Ig=null,bi===1/0||Ya===1/0?[[NaN,NaN],[NaN,NaN]]:[[bi,Ya],[Di,Ql]]}var lT,ZN,JN,e5,t5,n5,r5,i5,BX,UX,WX,ZNe,JNe,ma,va,ya,Ef={sphere:hs,point:Yie,lineStart:Sme,lineEnd:Cme,polygonStart:function(){Ef.lineStart=aDt,Ef.lineEnd=lDt},polygonEnd:function(){Ef.lineStart=Sme,Ef.lineEnd=Cme}};function Yie(t,e){t*=vn,e*=vn;var n=Vt(e);CR(n*Vt(t),n*Bt(t),Bt(e))}function CR(t,e,n){++lT,JN+=(t-JN)/lT,e5+=(e-e5)/lT,t5+=(n-t5)/lT}function Sme(){Ef.point=oDt}function oDt(t,e){t*=vn,e*=vn;var n=Vt(e);ma=n*Vt(t),va=n*Bt(t),ya=Bt(e),Ef.point=sDt,CR(ma,va,ya)}function sDt(t,e){t*=vn,e*=vn;var n=Vt(e),r=n*Vt(t),i=n*Bt(t),o=Bt(e),s=Pu(Aa((s=va*o-ya*i)*s+(s=ya*r-ma*o)*s+(s=ma*i-va*r)*s),ma*r+va*i+ya*o);ZN+=s,n5+=s*(ma+(ma=r)),r5+=s*(va+(va=i)),i5+=s*(ya+(ya=o)),CR(ma,va,ya)}function Cme(){Ef.point=Yie}function aDt(){Ef.point=cDt}function lDt(){e5e(ZNe,JNe),Ef.point=Yie}function cDt(t,e){ZNe=t,JNe=e,t*=vn,e*=vn,Ef.point=e5e;var n=Vt(e);ma=n*Vt(t),va=n*Bt(t),ya=Bt(e),CR(ma,va,ya)}function e5e(t,e){t*=vn,e*=vn;var n=Vt(e),r=n*Vt(t),i=n*Bt(t),o=Bt(e),s=va*o-ya*i,a=ya*r-ma*o,l=ma*i-va*r,c=LX(s,a,l),u=_l(c),f=c&&-u/c;BX.add(f*s),UX.add(f*a),WX.add(f*l),ZN+=u,n5+=u*(ma+(ma=r)),r5+=u*(va+(va=i)),i5+=u*(ya+(ya=o)),CR(ma,va,ya)}function uDt(t){lT=ZN=JN=e5=t5=n5=r5=i5=0,BX=new Ca,UX=new Ca,WX=new Ca,zp(t,Ef);var e=+BX,n=+UX,r=+WX,i=LX(e,n,r);return ixn&&(t-=Math.round(t/ka)*ka),[t,e]}GX.invert=GX;function t5e(t,e,n){return(t%=ka)?e||n?VX(Eme(t),Tme(e,n)):Eme(t):e||n?Tme(e,n):GX}function Ome(t){return function(e,n){return e+=t,Ln(e)>xn&&(e-=Math.round(e/ka)*ka),[e,n]}}function Eme(t){var e=Ome(t);return e.invert=Ome(-t),e}function Tme(t,e){var n=Vt(t),r=Bt(t),i=Vt(e),o=Bt(e);function s(a,l){var c=Vt(l),u=Vt(a)*c,f=Bt(a)*c,d=Bt(l),h=d*n+u*r;return[Pu(f*i-h*o,u*n-d*r),_l(h*i+f*o)]}return s.invert=function(a,l){var c=Vt(l),u=Vt(a)*c,f=Bt(a)*c,d=Bt(l),h=d*i-f*o;return[Pu(f*i+d*o,u*n+h*r),_l(h*n-u*r)]},s}function fDt(t){t=t5e(t[0]*vn,t[1]*vn,t.length>2?t[2]*vn:0);function e(n){return n=t(n[0]*vn,n[1]*vn),n[0]*=Ui,n[1]*=Ui,n}return e.invert=function(n){return n=t.invert(n[0]*vn,n[1]*vn),n[0]*=Ui,n[1]*=Ui,n},e}function dDt(t,e,n,r,i,o){if(n){var s=Vt(e),a=Bt(e),l=r*n;i==null?(i=e+r*ka,o=e-l/2):(i=kme(s,i),o=kme(s,o),(r>0?io)&&(i+=r*ka));for(var c,u=i;r>0?u>o:u1&&t.push(t.pop().concat(t.shift()))},result:function(){var n=t;return t=[],e=null,n}}}function w3(t,e){return Ln(t[0]-e[0])=0;--a)i.point((f=u[a])[0],f[1]);else r(d.x,d.p.x,-1,i);d=d.p}d=d.o,u=d.z,h=!h}while(!d.v);i.lineEnd()}}}function Ame(t){if(e=t.length){for(var e,n=0,r=t[0],i;++n=0?1:-1,E=k*O,P=E>xn,A=m*_;if(l.add(Pu(A*k*Bt(E),v*S+A*Vt(E))),s+=P?O+k*ka:O,P^p>=n^b>=n){var R=VS(pb(h),pb(x));KN(R);var T=VS(o,R);KN(T);var M=(P^O>=0?-1:1)*_l(T[2]);(r>M||r===M&&(R[0]||R[1]))&&(a+=P^O>=0?1:-1)}}return(s<-Ut||s0){for(l||(i.polygonStart(),l=!0),i.lineStart(),_=0;_1&&b&2&&w.push(w.pop().concat(w.shift())),u.push(w.filter(pDt))}}return d}}function pDt(t){return t.length>1}function gDt(t,e){return((t=t.x)[0]<0?t[1]-$i-Ut:$i-t[1])-((e=e.x)[0]<0?e[1]-$i-Ut:$i-e[1])}const Pme=i5e(function(){return!0},mDt,yDt,[-xn,-$i]);function mDt(t){var e=NaN,n=NaN,r=NaN,i;return{lineStart:function(){t.lineStart(),i=1},point:function(o,s){var a=o>0?xn:-xn,l=Ln(o-e);Ln(l-xn)0?$i:-$i),t.point(r,n),t.lineEnd(),t.lineStart(),t.point(a,n),t.point(o,n),i=0):r!==a&&l>=xn&&(Ln(e-r)Ut?TO((Bt(e)*(o=Vt(r))*Bt(n)-Bt(r)*(i=Vt(e))*Bt(t))/(i*o*s)):(e+r)/2}function yDt(t,e,n,r){var i;if(t==null)i=n*$i,r.point(-xn,i),r.point(0,i),r.point(xn,i),r.point(xn,0),r.point(xn,-i),r.point(0,-i),r.point(-xn,-i),r.point(-xn,0),r.point(-xn,i);else if(Ln(t[0]-e[0])>Ut){var o=t[0]0,i=Ln(e)>Ut;function o(u,f,d,h){dDt(h,t,n,d,u,f)}function s(u,f){return Vt(u)*Vt(f)>e}function a(u){var f,d,h,p,g;return{lineStart:function(){p=h=!1,g=1},point:function(m,v){var y=[m,v],x,b=s(m,v),w=r?b?0:c(m,v):b?c(m+(m<0?xn:-xn),v):0;if(!f&&(p=h=b)&&u.lineStart(),b!==h&&(x=l(f,y),(!x||w3(f,x)||w3(y,x))&&(y[2]=1)),b!==h)g=0,b?(u.lineStart(),x=l(y,f),u.point(x[0],x[1])):(x=l(f,y),u.point(x[0],x[1],2),u.lineEnd()),f=x;else if(i&&f&&r^b){var _;!(w&d)&&(_=l(y,f,!0))&&(g=0,r?(u.lineStart(),u.point(_[0][0],_[0][1]),u.point(_[1][0],_[1][1]),u.lineEnd()):(u.point(_[1][0],_[1][1]),u.lineEnd(),u.lineStart(),u.point(_[0][0],_[0][1],3)))}b&&(!f||!w3(f,y))&&u.point(y[0],y[1]),f=y,h=b,d=w},lineEnd:function(){h&&u.lineEnd(),f=null},clean:function(){return g|(p&&h)<<1}}}function l(u,f,d){var h=pb(u),p=pb(f),g=[1,0,0],m=VS(h,p),v=zI(m,m),y=m[0],x=v-y*y;if(!x)return!d&&u;var b=e*v/x,w=-e*y/x,_=VS(g,m),S=jI(g,b),O=jI(m,w);lV(S,O);var k=_,E=zI(S,k),P=zI(k,k),A=E*E-P*(zI(S,S)-1);if(!(A<0)){var R=Aa(A),T=jI(k,(-E-R)/P);if(lV(T,S),T=QN(T),!d)return T;var M=u[0],I=f[0],j=u[1],N=f[1],z;I0^T[1]<(Ln(T[0]-M)xn^(M<=T[0]&&T[0]<=I)){var $=jI(k,(-E+R)/P);return lV($,S),[T,QN($)]}}}function c(u,f){var d=r?t:xn-t,h=0;return u<-d?h|=1:u>d&&(h|=2),f<-d?h|=4:f>d&&(h|=8),h}return i5e(s,a,o,r?[0,-t]:[-xn,t-xn])}function bDt(t,e,n,r,i,o){var s=t[0],a=t[1],l=e[0],c=e[1],u=0,f=1,d=l-s,h=c-a,p;if(p=n-s,!(!d&&p>0)){if(p/=d,d<0){if(p0){if(p>f)return;p>u&&(u=p)}if(p=i-s,!(!d&&p<0)){if(p/=d,d<0){if(p>f)return;p>u&&(u=p)}else if(d>0){if(p0)){if(p/=h,h<0){if(p0){if(p>f)return;p>u&&(u=p)}if(p=o-a,!(!h&&p<0)){if(p/=h,h<0){if(p>f)return;p>u&&(u=p)}else if(h>0){if(p0&&(t[0]=s+u*d,t[1]=a+u*h),f<1&&(e[0]=s+f*d,e[1]=a+f*h),!0}}}}}var cT=1e9,UI=-cT;function o5e(t,e,n,r){function i(c,u){return t<=c&&c<=n&&e<=u&&u<=r}function o(c,u,f,d){var h=0,p=0;if(c==null||(h=s(c,f))!==(p=s(u,f))||l(c,u)<0^f>0)do d.point(h===0||h===3?t:n,h>1?r:e);while((h=(h+f+4)%4)!==p);else d.point(u[0],u[1])}function s(c,u){return Ln(c[0]-t)0?0:3:Ln(c[0]-n)0?2:1:Ln(c[1]-e)0?1:0:u>0?3:2}function a(c,u){return l(c.x,u.x)}function l(c,u){var f=s(c,1),d=s(u,1);return f!==d?f-d:f===0?u[1]-c[1]:f===1?c[0]-u[0]:f===2?c[1]-u[1]:u[0]-c[0]}return function(c){var u=c,f=n5e(),d,h,p,g,m,v,y,x,b,w,_,S={point:O,lineStart:A,lineEnd:R,polygonStart:E,polygonEnd:P};function O(M,I){i(M,I)&&u.point(M,I)}function k(){for(var M=0,I=0,j=h.length;Ir&&(q-F)*(r-$)>(G-$)*(t-F)&&++M:G<=r&&(q-F)*(r-$)<(G-$)*(t-F)&&--M;return M}function E(){u=f,d=[],h=[],_=!0}function P(){var M=k(),I=_&&M,j=(d=VIe(d)).length;(I||j)&&(c.polygonStart(),I&&(c.lineStart(),o(null,null,1,c),c.lineEnd()),j&&r5e(d,a,M,o,c),c.polygonEnd()),u=c,d=h=p=null}function A(){S.point=T,h&&h.push(p=[]),w=!0,b=!1,y=x=NaN}function R(){d&&(T(g,m),v&&b&&f.rejoin(),d.push(f.result())),S.point=O,b&&u.lineEnd()}function T(M,I){var j=i(M,I);if(h&&p.push([M,I]),w)g=M,m=I,v=j,w=!1,j&&(u.lineStart(),u.point(M,I));else if(j&&b)u.point(M,I);else{var N=[y=Math.max(UI,Math.min(cT,y)),x=Math.max(UI,Math.min(cT,x))],z=[M=Math.max(UI,Math.min(cT,M)),I=Math.max(UI,Math.min(cT,I))];bDt(N,z,t,e,n,r)?(b||(u.lineStart(),u.point(N[0],N[1])),u.point(z[0],z[1]),j||u.lineEnd(),_=!1):j&&(u.lineStart(),u.point(M,I),_=!1)}y=M,x=I,b=j}return S}}function Mme(t,e,n){var r=ol(t,e-Ut,n).concat(e);return function(i){return r.map(function(o){return[i,o]})}}function Rme(t,e,n){var r=ol(t,e-Ut,n).concat(e);return function(i){return r.map(function(o){return[o,i]})}}function wDt(){var t,e,n,r,i,o,s,a,l=10,c=l,u=90,f=360,d,h,p,g,m=2.5;function v(){return{type:"MultiLineString",coordinates:y()}}function y(){return ol(NI(r/u)*u,n,u).map(p).concat(ol(NI(a/f)*f,s,f).map(g)).concat(ol(NI(e/l)*l,t,l).filter(function(x){return Ln(x%u)>Ut}).map(d)).concat(ol(NI(o/c)*c,i,c).filter(function(x){return Ln(x%f)>Ut}).map(h))}return v.lines=function(){return y().map(function(x){return{type:"LineString",coordinates:x}})},v.outline=function(){return{type:"Polygon",coordinates:[p(r).concat(g(s).slice(1),p(n).reverse().slice(1),g(a).reverse().slice(1))]}},v.extent=function(x){return arguments.length?v.extentMajor(x).extentMinor(x):v.extentMinor()},v.extentMajor=function(x){return arguments.length?(r=+x[0][0],n=+x[1][0],a=+x[0][1],s=+x[1][1],r>n&&(x=r,r=n,n=x),a>s&&(x=a,a=s,s=x),v.precision(m)):[[r,a],[n,s]]},v.extentMinor=function(x){return arguments.length?(e=+x[0][0],t=+x[1][0],o=+x[0][1],i=+x[1][1],e>t&&(x=e,e=t,t=x),o>i&&(x=o,o=i,i=x),v.precision(m)):[[e,o],[t,i]]},v.step=function(x){return arguments.length?v.stepMajor(x).stepMinor(x):v.stepMinor()},v.stepMajor=function(x){return arguments.length?(u=+x[0],f=+x[1],v):[u,f]},v.stepMinor=function(x){return arguments.length?(l=+x[0],c=+x[1],v):[l,c]},v.precision=function(x){return arguments.length?(m=+x,d=Mme(o,i,90),h=Rme(e,t,m),p=Mme(a,s,90),g=Rme(r,n,m),v):m},v.extentMajor([[-180,-90+Ut],[180,90-Ut]]).extentMinor([[-180,-80-Ut],[180,80+Ut]])}const IA=t=>t;var uV=new Ca,HX=new Ca,s5e,a5e,qX,XX,jp={point:hs,lineStart:hs,lineEnd:hs,polygonStart:function(){jp.lineStart=_Dt,jp.lineEnd=CDt},polygonEnd:function(){jp.lineStart=jp.lineEnd=jp.point=hs,uV.add(Ln(HX)),HX=new Ca},result:function(){var t=uV/2;return uV=new Ca,t}};function _Dt(){jp.point=SDt}function SDt(t,e){jp.point=l5e,s5e=qX=t,a5e=XX=e}function l5e(t,e){HX.add(XX*t-qX*e),qX=t,XX=e}function CDt(){l5e(s5e,a5e)}var GS=1/0,o5=GS,LA=-GS,s5=LA,a5={point:ODt,lineStart:hs,lineEnd:hs,polygonStart:hs,polygonEnd:hs,result:function(){var t=[[GS,o5],[LA,s5]];return LA=s5=-(o5=GS=1/0),t}};function ODt(t,e){tLA&&(LA=t),es5&&(s5=e)}var YX=0,QX=0,uT=0,l5=0,c5=0,l_=0,KX=0,ZX=0,fT=0,c5e,u5e,Bd,Ud,Zc={point:gb,lineStart:Dme,lineEnd:Ime,polygonStart:function(){Zc.lineStart=kDt,Zc.lineEnd=ADt},polygonEnd:function(){Zc.point=gb,Zc.lineStart=Dme,Zc.lineEnd=Ime},result:function(){var t=fT?[KX/fT,ZX/fT]:l_?[l5/l_,c5/l_]:uT?[YX/uT,QX/uT]:[NaN,NaN];return YX=QX=uT=l5=c5=l_=KX=ZX=fT=0,t}};function gb(t,e){YX+=t,QX+=e,++uT}function Dme(){Zc.point=EDt}function EDt(t,e){Zc.point=TDt,gb(Bd=t,Ud=e)}function TDt(t,e){var n=t-Bd,r=e-Ud,i=Aa(n*n+r*r);l5+=i*(Bd+t)/2,c5+=i*(Ud+e)/2,l_+=i,gb(Bd=t,Ud=e)}function Ime(){Zc.point=gb}function kDt(){Zc.point=PDt}function ADt(){f5e(c5e,u5e)}function PDt(t,e){Zc.point=f5e,gb(c5e=Bd=t,u5e=Ud=e)}function f5e(t,e){var n=t-Bd,r=e-Ud,i=Aa(n*n+r*r);l5+=i*(Bd+t)/2,c5+=i*(Ud+e)/2,l_+=i,i=Ud*t-Bd*e,KX+=i*(Bd+t),ZX+=i*(Ud+e),fT+=i*3,gb(Bd=t,Ud=e)}function d5e(t){this._context=t}d5e.prototype={_radius:4.5,pointRadius:function(t){return this._radius=t,this},polygonStart:function(){this._line=0},polygonEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){this._line===0&&this._context.closePath(),this._point=NaN},point:function(t,e){switch(this._point){case 0:{this._context.moveTo(t,e),this._point=1;break}case 1:{this._context.lineTo(t,e);break}default:{this._context.moveTo(t+this._radius,e),this._context.arc(t,e,this._radius,0,ka);break}}},result:hs};var JX=new Ca,fV,h5e,p5e,dT,hT,$A={point:hs,lineStart:function(){$A.point=MDt},lineEnd:function(){fV&&g5e(h5e,p5e),$A.point=hs},polygonStart:function(){fV=!0},polygonEnd:function(){fV=null},result:function(){var t=+JX;return JX=new Ca,t}};function MDt(t,e){$A.point=g5e,h5e=dT=t,p5e=hT=e}function g5e(t,e){dT-=t,hT-=e,JX.add(Aa(dT*dT+hT*hT)),dT=t,hT=e}let Lme,u5,$me,Fme;class Nme{constructor(e){this._append=e==null?m5e:RDt(e),this._radius=4.5,this._=""}pointRadius(e){return this._radius=+e,this}polygonStart(){this._line=0}polygonEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){this._line===0&&(this._+="Z"),this._point=NaN}point(e,n){switch(this._point){case 0:{this._append`M${e},${n}`,this._point=1;break}case 1:{this._append`L${e},${n}`;break}default:{if(this._append`M${e},${n}`,this._radius!==$me||this._append!==u5){const r=this._radius,i=this._;this._="",this._append`m0,${r}a${r},${r} 0 1,1 0,${-2*r}a${r},${r} 0 1,1 0,${2*r}z`,$me=r,u5=this._append,Fme=this._,this._=i}this._+=Fme;break}}}result(){const e=this._;return this._="",e.length?e:null}}function m5e(t){let e=1;this._+=t[0];for(const n=t.length;e=0))throw new RangeError(`invalid digits: ${t}`);if(e>15)return m5e;if(e!==Lme){const n=10**e;Lme=e,u5=function(i){let o=1;this._+=i[0];for(const s=i.length;o=0))throw new RangeError(`invalid digits: ${a}`);n=l}return e===null&&(o=new Nme(n)),s},s.projection(t).digits(n).context(e)}function zB(t){return function(e){var n=new eY;for(var r in t)n[r]=t[r];return n.stream=e,n}}function eY(){}eY.prototype={constructor:eY,point:function(t,e){this.stream.point(t,e)},sphere:function(){this.stream.sphere()},lineStart:function(){this.stream.lineStart()},lineEnd:function(){this.stream.lineEnd()},polygonStart:function(){this.stream.polygonStart()},polygonEnd:function(){this.stream.polygonEnd()}};function Qie(t,e,n){var r=t.clipExtent&&t.clipExtent();return t.scale(150).translate([0,0]),r!=null&&t.clipExtent(null),zp(n,t.stream(a5)),e(a5.result()),r!=null&&t.clipExtent(r),t}function jB(t,e,n){return Qie(t,function(r){var i=e[1][0]-e[0][0],o=e[1][1]-e[0][1],s=Math.min(i/(r[1][0]-r[0][0]),o/(r[1][1]-r[0][1])),a=+e[0][0]+(i-s*(r[1][0]+r[0][0]))/2,l=+e[0][1]+(o-s*(r[1][1]+r[0][1]))/2;t.scale(150*s).translate([a,l])},n)}function Kie(t,e,n){return jB(t,[[0,0],e],n)}function Zie(t,e,n){return Qie(t,function(r){var i=+e,o=i/(r[1][0]-r[0][0]),s=(i-o*(r[1][0]+r[0][0]))/2,a=-o*r[0][1];t.scale(150*o).translate([s,a])},n)}function Jie(t,e,n){return Qie(t,function(r){var i=+e,o=i/(r[1][1]-r[0][1]),s=-o*r[0][0],a=(i-o*(r[1][1]+r[0][1]))/2;t.scale(150*o).translate([s,a])},n)}var zme=16,DDt=Vt(30*vn);function jme(t,e){return+e?LDt(t,e):IDt(t)}function IDt(t){return zB({point:function(e,n){e=t(e,n),this.stream.point(e[0],e[1])}})}function LDt(t,e){function n(r,i,o,s,a,l,c,u,f,d,h,p,g,m){var v=c-r,y=u-i,x=v*v+y*y;if(x>4*e&&g--){var b=s+d,w=a+h,_=l+p,S=Aa(b*b+w*w+_*_),O=_l(_/=S),k=Ln(Ln(_)-1)e||Ln((v*R+y*T)/x-.5)>.3||s*d+a*h+l*p2?M[2]%360*vn:0,R()):[a*Ui,l*Ui,c*Ui]},P.angle=function(M){return arguments.length?(f=M%360*vn,R()):f*Ui},P.reflectX=function(M){return arguments.length?(d=M?-1:1,R()):d<0},P.reflectY=function(M){return arguments.length?(h=M?-1:1,R()):h<0},P.precision=function(M){return arguments.length?(_=jme(S,w=M*M),T()):Aa(w)},P.fitExtent=function(M,I){return jB(P,M,I)},P.fitSize=function(M,I){return Kie(P,M,I)},P.fitWidth=function(M,I){return Zie(P,M,I)},P.fitHeight=function(M,I){return Jie(P,M,I)};function R(){var M=Bme(n,0,0,d,h,f).apply(null,e(o,s)),I=Bme(n,r-M[0],i-M[1],d,h,f);return u=t5e(a,l,c),S=VX(e,I),O=VX(u,S),_=jme(S,w),T()}function T(){return k=E=null,P}return function(){return e=t.apply(this,arguments),P.invert=e.invert&&A,R()}}function eoe(t){var e=0,n=xn/3,r=y5e(t),i=r(e,n);return i.parallels=function(o){return arguments.length?r(e=o[0]*vn,n=o[1]*vn):[e*Ui,n*Ui]},i}function zDt(t){var e=Vt(t);function n(r,i){return[r*e,Bt(i)/e]}return n.invert=function(r,i){return[r/e,_l(i*e)]},n}function jDt(t,e){var n=Bt(t),r=(n+Bt(e))/2;if(Ln(r)=.12&&m<.234&&g>=-.425&&g<-.214?i:m>=.166&&m<.234&&g>=-.214&&g<-.115?s:n).invert(d)},u.stream=function(d){return t&&e===d?t:t=BDt([n.stream(e=d),i.stream(d),s.stream(d)])},u.precision=function(d){return arguments.length?(n.precision(d),i.precision(d),s.precision(d),f()):n.precision()},u.scale=function(d){return arguments.length?(n.scale(d),i.scale(d*.35),s.scale(d),u.translate(n.translate())):n.scale()},u.translate=function(d){if(!arguments.length)return n.translate();var h=n.scale(),p=+d[0],g=+d[1];return r=n.translate(d).clipExtent([[p-.455*h,g-.238*h],[p+.455*h,g+.238*h]]).stream(c),o=i.translate([p-.307*h,g+.201*h]).clipExtent([[p-.425*h+Ut,g+.12*h+Ut],[p-.214*h-Ut,g+.234*h-Ut]]).stream(c),a=s.translate([p-.205*h,g+.212*h]).clipExtent([[p-.214*h+Ut,g+.166*h+Ut],[p-.115*h-Ut,g+.234*h-Ut]]).stream(c),f()},u.fitExtent=function(d,h){return jB(u,d,h)},u.fitSize=function(d,h){return Kie(u,d,h)},u.fitWidth=function(d,h){return Zie(u,d,h)},u.fitHeight=function(d,h){return Jie(u,d,h)};function f(){return t=e=null,u}return u.scale(1070)}function b5e(t){return function(e,n){var r=Vt(e),i=Vt(n),o=t(r*i);return o===1/0?[2,0]:[o*i*Bt(e),o*Bt(n)]}}function OR(t){return function(e,n){var r=Aa(e*e+n*n),i=t(r),o=Bt(i),s=Vt(i);return[Pu(e*o,r*s),_l(r&&n*o/r)]}}var w5e=b5e(function(t){return Aa(2/(1+t))});w5e.invert=OR(function(t){return 2*_l(t/2)});function WDt(){return Bh(w5e).scale(124.75).clipAngle(180-.001)}var _5e=b5e(function(t){return(t=VNe(t))&&t/Bt(t)});_5e.invert=OR(function(t){return t});function VDt(){return Bh(_5e).scale(79.4188).clipAngle(180-.001)}function BB(t,e){return[t,HN(Xie(($i+e)/2))]}BB.invert=function(t,e){return[t,2*TO(WNe(e))-$i]};function GDt(){return S5e(BB).scale(961/ka)}function S5e(t){var e=Bh(t),n=e.center,r=e.scale,i=e.translate,o=e.clipExtent,s=null,a,l,c;e.scale=function(f){return arguments.length?(r(f),u()):r()},e.translate=function(f){return arguments.length?(i(f),u()):i()},e.center=function(f){return arguments.length?(n(f),u()):n()},e.clipExtent=function(f){return arguments.length?(f==null?s=a=l=c=null:(s=+f[0][0],a=+f[0][1],l=+f[1][0],c=+f[1][1]),u()):s==null?null:[[s,a],[l,c]]};function u(){var f=xn*r(),d=e(fDt(e.rotate()).invert([0,0]));return o(s==null?[[d[0]-f,d[1]-f],[d[0]+f,d[1]+f]]:t===BB?[[Math.max(d[0]-f,s),a],[Math.min(d[0]+f,l),c]]:[[s,Math.max(d[1]-f,a)],[l,Math.min(d[1]+f,c)]])}return u()}function WI(t){return Xie(($i+t)/2)}function HDt(t,e){var n=Vt(t),r=t===e?Bt(t):HN(n/Vt(e))/HN(WI(e)/WI(t)),i=n*aV(WI(t),r)/r;if(!r)return BB;function o(s,a){i>0?a<-$i+Ut&&(a=-$i+Ut):a>$i-Ut&&(a=$i-Ut);var l=i/aV(WI(a),r);return[l*Bt(r*s),i-l*Vt(r*s)]}return o.invert=function(s,a){var l=i-a,c=ou(r)*Aa(s*s+l*l),u=Pu(s,Ln(l))*ou(l);return l*r<0&&(u-=xn*ou(s)*ou(l)),[u/r,2*TO(aV(i/c,1/r))-$i]},o}function qDt(){return eoe(HDt).scale(109.5).parallels([30,30])}function d5(t,e){return[t,e]}d5.invert=d5;function XDt(){return Bh(d5).scale(152.63)}function YDt(t,e){var n=Vt(t),r=t===e?Bt(t):(n-Vt(e))/(e-t),i=n/r+t;if(Ln(r)Ut&&--r>0);return[t/(.8707+(o=n*n)*(-.131979+o*(-.013791+o*o*o*(.003971-.001529*o)))),n]};function tIt(){return Bh(E5e).scale(175.295)}function T5e(t,e){return[Vt(e)*Bt(t),Bt(e)]}T5e.invert=OR(_l);function nIt(){return Bh(T5e).scale(249.5).clipAngle(90+Ut)}function k5e(t,e){var n=Vt(e),r=1+Vt(t)*n;return[n*Bt(t)/r,Bt(e)/r]}k5e.invert=OR(function(t){return 2*TO(t)});function rIt(){return Bh(k5e).scale(250).clipAngle(142)}function A5e(t,e){return[HN(Xie(($i+e)/2)),-t]}A5e.invert=function(t,e){return[-e,2*TO(WNe(t))-$i]};function iIt(){var t=S5e(A5e),e=t.center,n=t.rotate;return t.center=function(r){return arguments.length?e([-r[1],r[0]]):(r=e(),[r[1],-r[0]])},t.rotate=function(r){return arguments.length?n([r[0],r[1],r.length>2?r[2]+90:90]):(r=n(),[r[0],r[1],r[2]-90])},n([0,0,90]).scale(159.155)}var oIt=Math.abs,tY=Math.cos,p5=Math.sin,sIt=1e-6,P5e=Math.PI,nY=P5e/2,Ume=aIt(2);function Wme(t){return t>1?nY:t<-1?-nY:Math.asin(t)}function aIt(t){return t>0?Math.sqrt(t):0}function lIt(t,e){var n=t*p5(e),r=30,i;do e-=i=(e+p5(e)-n)/(1+tY(e));while(oIt(i)>sIt&&--r>0);return e/2}function cIt(t,e,n){function r(i,o){return[t*i*tY(o=lIt(n,o)),e*p5(o)]}return r.invert=function(i,o){return o=Wme(o/e),[i/(t*tY(o)),Wme((2*o+p5(2*o))/n)]},r}var uIt=cIt(Ume/nY,Ume,P5e);function fIt(){return Bh(uIt).scale(169.529)}const dIt=v5e(),rY=["clipAngle","clipExtent","scale","translate","center","rotate","parallels","precision","reflectX","reflectY","coefficient","distance","fraction","lobes","parallel","radius","ratio","spacing","tilt"];function hIt(t,e){return function n(){const r=e();return r.type=t,r.path=v5e().projection(r),r.copy=r.copy||function(){const i=n();return rY.forEach(o=>{r[o]&&i[o](r[o]())}),i.path.pointRadius(r.path.pointRadius()),i},G3e(r)}}function toe(t,e){if(!t||typeof t!="string")throw new Error("Projection type must be a name string.");return t=t.toLowerCase(),arguments.length>1?(g5[t]=hIt(t,e),this):g5[t]||null}function M5e(t){return t&&t.path||dIt}const g5={albers:x5e,albersusa:UDt,azimuthalequalarea:WDt,azimuthalequidistant:VDt,conicconformal:qDt,conicequalarea:f5,conicequidistant:QDt,equalEarth:ZDt,equirectangular:XDt,gnomonic:JDt,identity:eIt,mercator:GDt,mollweide:fIt,naturalEarth1:tIt,orthographic:nIt,stereographic:rIt,transversemercator:iIt};for(const t in g5)toe(t,g5[t]);function pIt(){}const ap=[[],[[[1,1.5],[.5,1]]],[[[1.5,1],[1,1.5]]],[[[1.5,1],[.5,1]]],[[[1,.5],[1.5,1]]],[[[1,1.5],[.5,1]],[[1,.5],[1.5,1]]],[[[1,.5],[1,1.5]]],[[[1,.5],[.5,1]]],[[[.5,1],[1,.5]]],[[[1,1.5],[1,.5]]],[[[.5,1],[1,.5]],[[1.5,1],[1,1.5]]],[[[1.5,1],[1,.5]]],[[[.5,1],[1.5,1]]],[[[1,1.5],[1.5,1]]],[[[.5,1],[1,1.5]]],[]];function R5e(){var t=1,e=1,n=a;function r(l,c){return c.map(u=>i(l,u))}function i(l,c){var u=[],f=[];return o(l,c,d=>{n(d,l,c),gIt(d)>0?u.push([d]):f.push(d)}),f.forEach(d=>{for(var h=0,p=u.length,g;h=c,ap[m<<1].forEach(x);++h=c,ap[g|m<<1].forEach(x);for(ap[m<<0].forEach(x);++p=c,v=l[p*t]>=c,ap[m<<1|v<<2].forEach(x);++h=c,y=v,v=l[p*t+h+1]>=c,ap[g|m<<1|v<<2|y<<3].forEach(x);ap[m|v<<3].forEach(x)}for(h=-1,v=l[p*t]>=c,ap[v<<2].forEach(x);++h=c,ap[v<<2|y<<3].forEach(x);ap[v<<3].forEach(x);function x(b){var w=[b[0][0]+h,b[0][1]+p],_=[b[1][0]+h,b[1][1]+p],S=s(w),O=s(_),k,E;(k=d[S])?(E=f[O])?(delete d[k.end],delete f[E.start],k===E?(k.ring.push(_),u(k.ring)):f[k.start]=d[E.end]={start:k.start,end:E.end,ring:k.ring.concat(E.ring)}):(delete d[k.end],k.ring.push(_),d[k.end=O]=k):(k=f[O])?(E=d[S])?(delete f[k.start],delete d[E.end],k===E?(k.ring.push(_),u(k.ring)):f[E.start]=d[k.end]={start:E.start,end:k.end,ring:E.ring.concat(k.ring)}):(delete f[k.start],k.ring.unshift(w),f[k.start=S]=k):f[S]=d[O]={start:S,end:O,ring:[w,_]}}}function s(l){return l[0]*2+l[1]*(t+1)*4}function a(l,c,u){l.forEach(f=>{var d=f[0],h=f[1],p=d|0,g=h|0,m,v=c[g*t+p];d>0&&d0&&h=0&&u>=0||je("invalid size"),t=c,e=u,r},r.smooth=function(l){return arguments.length?(n=l?a:pIt,r):n===a},r}function gIt(t){for(var e=0,n=t.length,r=t[n-1][1]*t[0][0]-t[n-1][0]*t[0][1];++er!=h>r&&n<(d-c)*(r-u)/(h-u)+c&&(i=-i)}return i}function yIt(t,e,n){var r;return xIt(t,e,n)&&bIt(t[r=+(t[0]===e[0])],n[r],e[r])}function xIt(t,e,n){return(e[0]-t[0])*(n[1]-t[1])===(n[0]-t[0])*(e[1]-t[1])}function bIt(t,e,n){return t<=e&&e<=n||n<=e&&e<=t}function D5e(t,e,n){return function(r){var i=Sh(r),o=n?Math.min(i[0],0):i[0],s=i[1],a=s-o,l=e?ny(o,s,t):a/(t+1);return ol(o+l,s,l)}}function noe(t){De.call(this,null,t)}noe.Definition={type:"Isocontour",metadata:{generates:!0},params:[{name:"field",type:"field"},{name:"thresholds",type:"number",array:!0},{name:"levels",type:"number"},{name:"nice",type:"boolean",default:!1},{name:"resolve",type:"enum",values:["shared","independent"],default:"independent"},{name:"zero",type:"boolean",default:!0},{name:"smooth",type:"boolean",default:!0},{name:"scale",type:"number",expr:!0},{name:"translate",type:"number",array:!0,expr:!0},{name:"as",type:"string",null:!0,default:"contour"}]};it(noe,De,{transform(t,e){if(this.value&&!e.changed()&&!t.modified())return e.StopPropagation;var n=e.fork(e.NO_SOURCE|e.NO_FIELDS),r=e.materialize(e.SOURCE).source,i=t.field||ea,o=R5e().smooth(t.smooth!==!1),s=t.thresholds||wIt(r,i,t),a=t.as===null?null:t.as||"contour",l=[];return r.forEach(c=>{const u=i(c),f=o.size([u.width,u.height])(u.values,We(s)?s:s(u.values));_It(f,u,c,t),f.forEach(d=>{l.push(eB(c,cr(a!=null?{[a]:d}:d)))})}),this.value&&(n.rem=this.value),this.value=n.source=n.add=l,n}});function wIt(t,e,n){const r=D5e(n.levels||10,n.nice,n.zero!==!1);return n.resolve!=="shared"?r:r(t.map(i=>Lx(e(i).values)))}function _It(t,e,n,r){let i=r.scale||e.scale,o=r.translate||e.translate;if(fn(i)&&(i=i(n,r)),fn(o)&&(o=o(n,r)),(i===1||i==null)&&!o)return;const s=(Jn(i)?i:i[0])||1,a=(Jn(i)?i:i[1])||1,l=o&&o[0]||0,c=o&&o[1]||0;t.forEach(I5e(e,s,a,l,c))}function I5e(t,e,n,r,i){const o=t.x1||0,s=t.y1||0,a=e*n<0;function l(f){f.forEach(c)}function c(f){a&&f.reverse(),f.forEach(u)}function u(f){f[0]=(f[0]-o)*e+r,f[1]=(f[1]-s)*n+i}return function(f){return f.coordinates.forEach(l),f}}function Vme(t,e,n){const r=t>=0?t:Nne(e,n);return Math.round((Math.sqrt(4*r*r+1)-1)/2)}function dV(t){return fn(t)?t:ta(+t)}function L5e(){var t=l=>l[0],e=l=>l[1],n=pO,r=[-1,-1],i=960,o=500,s=2;function a(l,c){const u=Vme(r[0],l,t)>>s,f=Vme(r[1],l,e)>>s,d=u?u+2:0,h=f?f+2:0,p=2*d+(i>>s),g=2*h+(o>>s),m=new Float32Array(p*g),v=new Float32Array(p*g);let y=m;l.forEach(b=>{const w=d+(+t(b)>>s),_=h+(+e(b)>>s);w>=0&&w=0&&_0&&f>0?(Q1(p,g,m,v,u),K1(p,g,v,m,f),Q1(p,g,m,v,u),K1(p,g,v,m,f),Q1(p,g,m,v,u),K1(p,g,v,m,f)):u>0?(Q1(p,g,m,v,u),Q1(p,g,v,m,u),Q1(p,g,m,v,u),y=v):f>0&&(K1(p,g,m,v,f),K1(p,g,v,m,f),K1(p,g,m,v,f),y=v);const x=c?Math.pow(2,-2*s):1/GIe(y);for(let b=0,w=p*g;b>s),y2:h+(o>>s)}}return a.x=function(l){return arguments.length?(t=dV(l),a):t},a.y=function(l){return arguments.length?(e=dV(l),a):e},a.weight=function(l){return arguments.length?(n=dV(l),a):n},a.size=function(l){if(!arguments.length)return[i,o];var c=+l[0],u=+l[1];return c>=0&&u>=0||je("invalid size"),i=c,o=u,a},a.cellSize=function(l){return arguments.length?((l=+l)>=1||je("invalid cell size"),s=Math.floor(Math.log(l)/Math.LN2),a):1<=i&&(a>=o&&(l-=n[a-o+s*t]),r[a-i+s*t]=l/Math.min(a+1,t-1+o-a,o))}function K1(t,e,n,r,i){const o=(i<<1)+1;for(let s=0;s=i&&(a>=o&&(l-=n[s+(a-o)*t]),r[s+(a-i)*t]=l/Math.min(a+1,e-1+o-a,o))}function roe(t){De.call(this,null,t)}roe.Definition={type:"KDE2D",metadata:{generates:!0},params:[{name:"size",type:"number",array:!0,length:2,required:!0},{name:"x",type:"field",required:!0},{name:"y",type:"field",required:!0},{name:"weight",type:"field"},{name:"groupby",type:"field",array:!0},{name:"cellSize",type:"number"},{name:"bandwidth",type:"number",array:!0,length:2},{name:"counts",type:"boolean",default:!1},{name:"as",type:"string",default:"grid"}]};const SIt=["x","y","weight","size","cellSize","bandwidth"];function $5e(t,e){return SIt.forEach(n=>e[n]!=null?t[n](e[n]):0),t}it(roe,De,{transform(t,e){if(this.value&&!e.changed()&&!t.modified())return e.StopPropagation;var n=e.fork(e.NO_SOURCE|e.NO_FIELDS),r=e.materialize(e.SOURCE).source,i=CIt(r,t.groupby),o=(t.groupby||[]).map(Ni),s=$5e(L5e(),t),a=t.as||"grid",l=[];function c(u,f){for(let d=0;dcr(c({[a]:s(u,t.counts)},u.dims))),this.value&&(n.rem=this.value),this.value=n.source=n.add=l,n}});function CIt(t,e){var n=[],r=u=>u(a),i,o,s,a,l,c;if(e==null)n.push(t);else for(i={},o=0,s=t.length;on.push(a(u))),o&&s&&(e.visit(l,u=>{var f=o(u),d=s(u);f!=null&&d!=null&&(f=+f)===f&&(d=+d)===d&&r.push([f,d])}),n=n.concat({type:iY,geometry:{type:OIt,coordinates:r}})),this.value={type:ooe,features:n}}});function aoe(t){De.call(this,null,t)}aoe.Definition={type:"GeoPath",metadata:{modifies:!0},params:[{name:"projection",type:"projection"},{name:"field",type:"field"},{name:"pointRadius",type:"number",expr:!0},{name:"as",type:"string",default:"path"}]};it(aoe,De,{transform(t,e){var n=e.fork(e.ALL),r=this.value,i=t.field||ea,o=t.as||"path",s=n.SOURCE;!r||t.modified()?(this.value=r=M5e(t.projection),n.materialize().reflow()):s=i===ea||e.modified(i.fields)?n.ADD_MOD:n.ADD;const a=EIt(r,t.pointRadius);return n.visit(s,l=>l[o]=r(i(l))),r.pointRadius(a),n.modifies(o)}});function EIt(t,e){const n=t.pointRadius();return t.context(null),e!=null&&t.pointRadius(e),n}function loe(t){De.call(this,null,t)}loe.Definition={type:"GeoPoint",metadata:{modifies:!0},params:[{name:"projection",type:"projection",required:!0},{name:"fields",type:"field",array:!0,required:!0,length:2},{name:"as",type:"string",array:!0,length:2,default:["x","y"]}]};it(loe,De,{transform(t,e){var n=t.projection,r=t.fields[0],i=t.fields[1],o=t.as||["x","y"],s=o[0],a=o[1],l;function c(u){const f=n([r(u),i(u)]);f?(u[s]=f[0],u[a]=f[1]):(u[s]=void 0,u[a]=void 0)}return t.modified()?e=e.materialize().reflow(!0).visit(e.SOURCE,c):(l=e.modified(r.fields)||e.modified(i.fields),e.visit(l?e.ADD_MOD:e.ADD,c)),e.modifies(o)}});function coe(t){De.call(this,null,t)}coe.Definition={type:"GeoShape",metadata:{modifies:!0,nomod:!0},params:[{name:"projection",type:"projection"},{name:"field",type:"field",default:"datum"},{name:"pointRadius",type:"number",expr:!0},{name:"as",type:"string",default:"shape"}]};it(coe,De,{transform(t,e){var n=e.fork(e.ALL),r=this.value,i=t.as||"shape",o=n.ADD;return(!r||t.modified())&&(this.value=r=TIt(M5e(t.projection),t.field||Eu("datum"),t.pointRadius),n.materialize().reflow(),o=n.SOURCE),n.visit(o,s=>s[i]=r),n.modifies(i)}});function TIt(t,e,n){const r=n==null?i=>t(e(i)):i=>{var o=t.pointRadius(),s=t.pointRadius(n)(e(i));return t.pointRadius(o),s};return r.context=i=>(t.context(i),r),r}function uoe(t){De.call(this,[],t),this.generator=wDt()}uoe.Definition={type:"Graticule",metadata:{changes:!0,generates:!0},params:[{name:"extent",type:"array",array:!0,length:2,content:{type:"number",array:!0,length:2}},{name:"extentMajor",type:"array",array:!0,length:2,content:{type:"number",array:!0,length:2}},{name:"extentMinor",type:"array",array:!0,length:2,content:{type:"number",array:!0,length:2}},{name:"step",type:"number",array:!0,length:2},{name:"stepMajor",type:"number",array:!0,length:2,default:[90,360]},{name:"stepMinor",type:"number",array:!0,length:2,default:[10,10]},{name:"precision",type:"number",default:2.5}]};it(uoe,De,{transform(t,e){var n=this.value,r=this.generator,i;if(!n.length||t.modified())for(const o in t)fn(r[o])&&r[o](t[o]);return i=r(),n.length?e.mod.push(jLe(n[0],i)):e.add.push(cr(i)),n[0]=i,e}});function foe(t){De.call(this,null,t)}foe.Definition={type:"heatmap",metadata:{modifies:!0},params:[{name:"field",type:"field"},{name:"color",type:"string",expr:!0},{name:"opacity",type:"number",expr:!0},{name:"resolve",type:"enum",values:["shared","independent"],default:"independent"},{name:"as",type:"string",default:"image"}]};it(foe,De,{transform(t,e){if(!e.changed()&&!t.modified())return e.StopPropagation;var n=e.materialize(e.SOURCE).source,r=t.resolve==="shared",i=t.field||ea,o=AIt(t.opacity,t),s=kIt(t.color,t),a=t.as||"image",l={$x:0,$y:0,$value:0,$max:r?Lx(n.map(c=>Lx(i(c).values))):0};return n.forEach(c=>{const u=i(c),f=cn({},c,l);r||(f.$max=Lx(u.values||[])),c[a]=PIt(u,f,s.dep?s:ta(s(f)),o.dep?o:ta(o(f)))}),e.reflow(!0).modifies(a)}});function kIt(t,e){let n;return fn(t)?(n=r=>sy(t(r,e)),n.dep=F5e(t)):n=ta(sy(t||"#888")),n}function AIt(t,e){let n;return fn(t)?(n=r=>t(r,e),n.dep=F5e(t)):t?n=ta(t):(n=r=>r.$value/r.$max||0,n.dep=!0),n}function F5e(t){if(!fn(t))return!1;const e=Wf(Ys(t));return e.$x||e.$y||e.$value||e.$max}function PIt(t,e,n,r){const i=t.width,o=t.height,s=t.x1||0,a=t.y1||0,l=t.x2||i,c=t.y2||o,u=t.values,f=u?m=>u[m]:nv,d=jv(l-s,c-a),h=d.getContext("2d"),p=h.getImageData(0,0,l-s,c-a),g=p.data;for(let m=a,v=0;m{t[r]!=null&&Gme(n,r,t[r])})):rY.forEach(r=>{t.modified(r)&&Gme(n,r,t[r])}),t.pointRadius!=null&&n.path.pointRadius(t.pointRadius),t.fit&&MIt(n,t),e.fork(e.NO_SOURCE|e.NO_FIELDS)}});function MIt(t,e){const n=DIt(e.fit);e.extent?t.fitExtent(e.extent,n):e.size&&t.fitSize(e.size,n)}function RIt(t){const e=toe((t||"mercator").toLowerCase());return e||je("Unrecognized projection type: "+t),e()}function Gme(t,e,n){fn(t[e])&&t[e](n)}function DIt(t){return t=pt(t),t.length===1?t[0]:{type:ooe,features:t.reduce((e,n)=>e.concat(IIt(n)),[])}}function IIt(t){return t.type===ooe?t.features:pt(t).filter(e=>e!=null).map(e=>e.type===iY?e:{type:iY,geometry:e})}const LIt=Object.freeze(Object.defineProperty({__proto__:null,contour:ioe,geojson:soe,geopath:aoe,geopoint:loe,geoshape:coe,graticule:uoe,heatmap:foe,isocontour:noe,kde2d:roe,projection:N5e},Symbol.toStringTag,{value:"Module"}));function $It(t,e){var n,r=1;t==null&&(t=0),e==null&&(e=0);function i(){var o,s=n.length,a,l=0,c=0;for(o=0;o=(f=(a+c)/2))?a=f:c=f,(m=n>=(d=(l+u)/2))?l=d:u=d,i=o,!(o=o[v=m<<1|g]))return i[v]=s,t;if(h=+t._x.call(null,o.data),p=+t._y.call(null,o.data),e===h&&n===p)return s.next=o,i?i[v]=s:t._root=s,t;do i=i?i[v]=new Array(4):t._root=new Array(4),(g=e>=(f=(a+c)/2))?a=f:c=f,(m=n>=(d=(l+u)/2))?l=d:u=d;while((v=m<<1|g)===(y=(p>=d)<<1|h>=f));return i[y]=o,i[v]=s,t}function NIt(t){var e,n,r=t.length,i,o,s=new Array(r),a=new Array(r),l=1/0,c=1/0,u=-1/0,f=-1/0;for(n=0;nu&&(u=i),of&&(f=o));if(l>u||c>f)return this;for(this.cover(l,c).cover(u,f),n=0;nt||t>=i||r>e||e>=o;)switch(c=(eu||(a=p.y0)>f||(l=p.x1)=v)<<1|t>=m)&&(p=d[d.length-1],d[d.length-1]=d[d.length-1-g],d[d.length-1-g]=p)}else{var y=t-+this._x.call(null,h.data),x=e-+this._y.call(null,h.data),b=y*y+x*x;if(b=(d=(s+l)/2))?s=d:l=d,(g=f>=(h=(a+c)/2))?a=h:c=h,e=n,!(n=n[m=g<<1|p]))return this;if(!n.length)break;(e[m+1&3]||e[m+2&3]||e[m+3&3])&&(r=e,v=m)}for(;n.data!==t;)if(i=n,!(n=n.next))return this;return(o=n.next)&&delete n.next,i?(o?i.next=o:delete i.next,this):e?(o?e[m]=o:delete e[m],(n=e[0]||e[1]||e[2]||e[3])&&n===(e[3]||e[2]||e[1]||e[0])&&!n.length&&(r?r[v]=n:this._root=n),this):(this._root=o,this)}function VIt(t){for(var e=0,n=t.length;ed.index){var P=h-O.x-O.vx,A=p-O.y-O.vy,R=P*P+A*A;Rh+E||_p+E||Sc.r&&(c.r=c[u].r)}function l(){if(e){var c,u=e.length,f;for(n=new Array(u),c=0;c[e(w,_,s),w])),b;for(m=0,a=new Array(v);m{}};function j5e(){for(var t=0,e=arguments.length,n={},r;t=0&&(r=n.slice(i+1),n=n.slice(0,i)),n&&!e.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:r}})}_3.prototype=j5e.prototype={constructor:_3,on:function(t,e){var n=this._,r=oLt(t+"",n),i,o=-1,s=r.length;if(arguments.length<2){for(;++o0)for(var n=new Array(i),r=0,i,o;r=0&&t._call.call(void 0,e),t=t._next;--HS}function Yme(){mb=(v5=FA.now())+UB,HS=pT=0;try{lLt()}finally{HS=0,uLt(),mb=0}}function cLt(){var t=FA.now(),e=t-v5;e>B5e&&(UB-=e,v5=t)}function uLt(){for(var t,e=m5,n,r=1/0;e;)e._call?(r>e._time&&(r=e._time),t=e,e=e._next):(n=e._next,e._next=null,e=t?t._next=n:m5=n);gT=t,oY(r)}function oY(t){if(!HS){pT&&(pT=clearTimeout(pT));var e=t-mb;e>24?(t<1/0&&(pT=setTimeout(Yme,t-FA.now()-UB)),JE&&(JE=clearInterval(JE))):(JE||(v5=FA.now(),JE=setInterval(cLt,B5e)),HS=1,U5e(Yme))}}function fLt(t,e,n){var r=new y5,i=e;return e==null?(r.restart(t,e,n),r):(r._restart=r.restart,r.restart=function(o,s,a){s=+s,a=a==null?poe():+a,r._restart(function l(c){c+=i,r._restart(l,i+=s,a),o(c)},s,a)},r.restart(t,e,n),r)}const dLt=1664525,hLt=1013904223,Qme=4294967296;function pLt(){let t=1;return()=>(t=(dLt*t+hLt)%Qme)/Qme}function gLt(t){return t.x}function mLt(t){return t.y}var vLt=10,yLt=Math.PI*(3-Math.sqrt(5));function xLt(t){var e,n=1,r=.001,i=1-Math.pow(r,1/300),o=0,s=.6,a=new Map,l=W5e(f),c=j5e("tick","end"),u=pLt();t==null&&(t=[]);function f(){d(),c.call("tick",e),n1?(m==null?a.delete(g):a.set(g,p(m)),e):a.get(g)},find:function(g,m,v){var y=0,x=t.length,b,w,_,S,O;for(v==null?v=1/0:v*=v,y=0;y1?(c.on(g,m),e):c.on(g)}}}function bLt(){var t,e,n,r,i=wa(-30),o,s=1,a=1/0,l=.81;function c(h){var p,g=t.length,m=doe(t,gLt,mLt).visitAfter(f);for(r=h,p=0;p=a)return;(h.data!==e||h.next)&&(v===0&&(v=vv(n),b+=v*v),y===0&&(y=vv(n),b+=y*y),b=0;)n.tick();else if(n.stopped()&&n.restart(),!r)return e.StopPropagation}return this.finish(t,e)},finish(t,e){const n=e.dataflow;for(let a=this._argops,l=0,c=a.length,u;lt.touch(e).run()}function OLt(t,e){const n=xLt(t),r=n.stop,i=n.restart;let o=!1;return n.stopped=()=>o,n.restart=()=>(o=!1,i()),n.stop=()=>(o=!0,r()),G5e(n,e,!0).on("end",()=>o=!0)}function G5e(t,e,n,r){var i=pt(e.forces),o,s,a,l;for(o=0,s=sY.length;oe(r,n):e)}const ALt=Object.freeze(Object.defineProperty({__proto__:null,force:goe},Symbol.toStringTag,{value:"Module"}));function PLt(t,e){return t.parent===e.parent?1:2}function MLt(t){return t.reduce(RLt,0)/t.length}function RLt(t,e){return t+e.x}function DLt(t){return 1+t.reduce(ILt,0)}function ILt(t,e){return Math.max(t,e.y)}function LLt(t){for(var e;e=t.children;)t=e[0];return t}function $Lt(t){for(var e;e=t.children;)t=e[e.length-1];return t}function FLt(){var t=PLt,e=1,n=1,r=!1;function i(o){var s,a=0;o.eachAfter(function(d){var h=d.children;h?(d.x=MLt(h),d.y=DLt(h)):(d.x=s?a+=t(d,s):0,d.y=0,s=d)});var l=LLt(o),c=$Lt(o),u=l.x-t(l,c)/2,f=c.x+t(c,l)/2;return o.eachAfter(r?function(d){d.x=(d.x-o.x)*e,d.y=(o.y-d.y)*n}:function(d){d.x=(d.x-u)/(f-u)*e,d.y=(1-(o.y?d.y/o.y:1))*n})}return i.separation=function(o){return arguments.length?(t=o,i):t},i.size=function(o){return arguments.length?(r=!1,e=+o[0],n=+o[1],i):r?null:[e,n]},i.nodeSize=function(o){return arguments.length?(r=!0,e=+o[0],n=+o[1],i):r?[e,n]:null},i}function NLt(t){var e=0,n=t.children,r=n&&n.length;if(!r)e=1;else for(;--r>=0;)e+=n[r].value;t.value=e}function zLt(){return this.eachAfter(NLt)}function jLt(t,e){let n=-1;for(const r of this)t.call(e,r,++n,this);return this}function BLt(t,e){for(var n=this,r=[n],i,o,s=-1;n=r.pop();)if(t.call(e,n,++s,this),i=n.children)for(o=i.length-1;o>=0;--o)r.push(i[o]);return this}function ULt(t,e){for(var n=this,r=[n],i=[],o,s,a,l=-1;n=r.pop();)if(i.push(n),o=n.children)for(s=0,a=o.length;s=0;)n+=r[i].value;e.value=n})}function GLt(t){return this.eachBefore(function(e){e.children&&e.children.sort(t)})}function HLt(t){for(var e=this,n=qLt(e,t),r=[e];e!==n;)e=e.parent,r.push(e);for(var i=r.length;t!==n;)r.splice(i,0,t),t=t.parent;return r}function qLt(t,e){if(t===e)return t;var n=t.ancestors(),r=e.ancestors(),i=null;for(t=n.pop(),e=r.pop();t===e;)i=t,t=n.pop(),e=r.pop();return i}function XLt(){for(var t=this,e=[t];t=t.parent;)e.push(t);return e}function YLt(){return Array.from(this)}function QLt(){var t=[];return this.eachBefore(function(e){e.children||t.push(e)}),t}function KLt(){var t=this,e=[];return t.each(function(n){n!==t&&e.push({source:n.parent,target:n})}),e}function*ZLt(){var t=this,e,n=[t],r,i,o;do for(e=n.reverse(),n=[];t=e.pop();)if(yield t,r=t.children)for(i=0,o=r.length;i=0;--a)i.push(o=s[a]=new qS(s[a])),o.parent=r,o.depth=r.depth+1;return n.eachBefore(H5e)}function JLt(){return moe(this).eachBefore(n$t)}function e$t(t){return t.children}function t$t(t){return Array.isArray(t)?t[1]:null}function n$t(t){t.data.value!==void 0&&(t.value=t.data.value),t.data=t.data.data}function H5e(t){var e=0;do t.height=e;while((t=t.parent)&&t.height<++e)}function qS(t){this.data=t,this.depth=this.height=0,this.parent=null}qS.prototype=moe.prototype={constructor:qS,count:zLt,each:jLt,eachAfter:ULt,eachBefore:BLt,find:WLt,sum:VLt,sort:GLt,path:HLt,ancestors:XLt,descendants:YLt,leaves:QLt,links:KLt,copy:JLt,[Symbol.iterator]:ZLt};function S3(t){return t==null?null:q5e(t)}function q5e(t){if(typeof t!="function")throw new Error;return t}function J0(){return 0}function $w(t){return function(){return t}}const r$t=1664525,i$t=1013904223,Zme=4294967296;function o$t(){let t=1;return()=>(t=(r$t*t+i$t)%Zme)/Zme}function s$t(t){return typeof t=="object"&&"length"in t?t:Array.from(t)}function a$t(t,e){let n=t.length,r,i;for(;n;)i=e()*n--|0,r=t[n],t[n]=t[i],t[i]=r;return t}function l$t(t,e){for(var n=0,r=(t=a$t(Array.from(t),e)).length,i=[],o,s;n0&&n*n>r*r+i*i}function hV(t,e){for(var n=0;n1e-6?(P+Math.sqrt(P*P-4*E*A))/(2*E):A/P);return{x:r+_+S*R,y:i+O+k*R,r:R}}function Jme(t,e,n){var r=t.x-e.x,i,o,s=t.y-e.y,a,l,c=r*r+s*s;c?(o=e.r+n.r,o*=o,l=t.r+n.r,l*=l,o>l?(i=(c+l-o)/(2*c),a=Math.sqrt(Math.max(0,l/c-i*i)),n.x=t.x-i*r-a*s,n.y=t.y-i*s+a*r):(i=(c+o-l)/(2*c),a=Math.sqrt(Math.max(0,o/c-i*i)),n.x=e.x+i*r-a*s,n.y=e.y+i*s+a*r)):(n.x=e.x+n.r,n.y=e.y)}function eve(t,e){var n=t.r+e.r-1e-6,r=e.x-t.x,i=e.y-t.y;return n>0&&n*n>r*r+i*i}function tve(t){var e=t._,n=t.next._,r=e.r+n.r,i=(e.x*n.r+n.x*e.r)/r,o=(e.y*n.r+n.y*e.r)/r;return i*i+o*o}function GI(t){this._=t,this.next=null,this.previous=null}function d$t(t,e){if(!(o=(t=s$t(t)).length))return 0;var n,r,i,o,s,a,l,c,u,f,d;if(n=t[0],n.x=0,n.y=0,!(o>1))return n.r;if(r=t[1],n.x=-r.r,r.x=n.r,r.y=0,!(o>2))return n.r+r.r;Jme(r,n,i=t[2]),n=new GI(n),r=new GI(r),i=new GI(i),n.next=i.previous=r,r.next=n.previous=i,i.next=r.previous=n;e:for(l=3;lx$t(n(b,w,i))),y=v.map(sve),x=new Set(v).add("");for(const b of y)x.has(b)||(x.add(b),v.push(b),y.push(sve(b)),o.push(gV));s=(b,w)=>v[w],a=(b,w)=>y[w]}for(u=0,l=o.length;u=0&&(h=o[v],h.data===gV);--v)h.data=null}if(f.parent=m$t,f.eachBefore(function(v){v.depth=v.parent.depth+1,--l}).eachBefore(H5e),f.parent=null,l>0)throw new Error("cycle");return f}return r.id=function(i){return arguments.length?(t=S3(i),r):t},r.parentId=function(i){return arguments.length?(e=S3(i),r):e},r.path=function(i){return arguments.length?(n=S3(i),r):n},r}function x$t(t){t=`${t}`;let e=t.length;return aY(t,e-1)&&!aY(t,e-2)&&(t=t.slice(0,-1)),t[0]==="/"?t:`/${t}`}function sve(t){let e=t.length;if(e<2)return"";for(;--e>1&&!aY(t,e););return t.slice(0,e)}function aY(t,e){if(t[e]==="/"){let n=0;for(;e>0&&t[--e]==="\\";)++n;if(!(n&1))return!0}return!1}function b$t(t,e){return t.parent===e.parent?1:2}function mV(t){var e=t.children;return e?e[0]:t.t}function vV(t){var e=t.children;return e?e[e.length-1]:t.t}function w$t(t,e,n){var r=n/(e.i-t.i);e.c-=r,e.s+=n,t.c+=r,e.z+=n,e.m+=n}function _$t(t){for(var e=0,n=0,r=t.children,i=r.length,o;--i>=0;)o=r[i],o.z+=e,o.m+=e,e+=o.s+(n+=o.c)}function S$t(t,e,n){return t.a.parent===e.parent?t.a:n}function C3(t,e){this._=t,this.parent=null,this.children=null,this.A=null,this.a=this,this.z=0,this.m=0,this.c=0,this.s=0,this.t=null,this.i=e}C3.prototype=Object.create(qS.prototype);function C$t(t){for(var e=new C3(t,0),n,r=[e],i,o,s,a;n=r.pop();)if(o=n._.children)for(n.children=new Array(a=o.length),s=a-1;s>=0;--s)r.push(i=n.children[s]=new C3(o[s],s)),i.parent=n;return(e.parent=new C3(null,0)).children=[e],e}function O$t(){var t=b$t,e=1,n=1,r=null;function i(c){var u=C$t(c);if(u.eachAfter(o),u.parent.m=-u.z,u.eachBefore(s),r)c.eachBefore(l);else{var f=c,d=c,h=c;c.eachBefore(function(y){y.xd.x&&(d=y),y.depth>h.depth&&(h=y)});var p=f===d?1:t(f,d)/2,g=p-f.x,m=e/(d.x+p+g),v=n/(h.depth||1);c.eachBefore(function(y){y.x=(y.x+g)*m,y.y=y.depth*v})}return c}function o(c){var u=c.children,f=c.parent.children,d=c.i?f[c.i-1]:null;if(u){_$t(c);var h=(u[0].z+u[u.length-1].z)/2;d?(c.z=d.z+t(c._,d._),c.m=c.z-h):c.z=h}else d&&(c.z=d.z+t(c._,d._));c.parent.A=a(c,d,c.parent.A||f[0])}function s(c){c._.x=c.z+c.parent.m,c.m+=c.parent.m}function a(c,u,f){if(u){for(var d=c,h=c,p=u,g=d.parent.children[0],m=d.m,v=h.m,y=p.m,x=g.m,b;p=vV(p),d=mV(d),p&&d;)g=mV(g),h=vV(h),h.a=c,b=p.z+y-d.z-m+t(p._,d._),b>0&&(w$t(S$t(p,c,f),c,b),m+=b,v+=b),y+=p.m,m+=d.m,x+=g.m,v+=h.m;p&&!vV(h)&&(h.t=p,h.m+=y-v),d&&!mV(g)&&(g.t=d,g.m+=m-x,f=c)}return f}function l(c){c.x*=e,c.y=c.depth*n}return i.separation=function(c){return arguments.length?(t=c,i):t},i.size=function(c){return arguments.length?(r=!1,e=+c[0],n=+c[1],i):r?null:[e,n]},i.nodeSize=function(c){return arguments.length?(r=!0,e=+c[0],n=+c[1],i):r?[e,n]:null},i}function WB(t,e,n,r,i){for(var o=t.children,s,a=-1,l=o.length,c=t.value&&(i-n)/t.value;++ay&&(y=c),_=m*m*w,x=Math.max(y/_,_/v),x>b){m-=c;break}b=x}s.push(l={value:m,dice:h1?r:1)},n}(K5e);function E$t(){var t=J5e,e=!1,n=1,r=1,i=[0],o=J0,s=J0,a=J0,l=J0,c=J0;function u(d){return d.x0=d.y0=0,d.x1=n,d.y1=r,d.eachBefore(f),i=[0],e&&d.eachBefore(Q5e),d}function f(d){var h=i[d.depth],p=d.x0+h,g=d.y0+h,m=d.x1-h,v=d.y1-h;m=d-1){var y=o[f];y.x0=p,y.y0=g,y.x1=m,y.y1=v;return}for(var x=c[f],b=h/2+x,w=f+1,_=d-1;w<_;){var S=w+_>>>1;c[S]v-g){var E=h?(p*k+m*O)/h:m;u(f,w,O,p,g,E,v),u(w,d,k,E,g,m,v)}else{var P=h?(g*k+v*O)/h:v;u(f,w,O,p,g,m,P),u(w,d,k,p,P,m,v)}}}function k$t(t,e,n,r,i){(t.depth&1?WB:ER)(t,e,n,r,i)}const A$t=function t(e){function n(r,i,o,s,a){if((l=r._squarify)&&l.ratio===e)for(var l,c,u,f,d=-1,h,p=l.length,g=r.value;++d1?r:1)},n}(K5e);function lY(t,e,n){const r={};return t.each(i=>{const o=i.data;n(o)&&(r[e(o)]=i)}),t.lookup=r,t}function voe(t){De.call(this,null,t)}voe.Definition={type:"Nest",metadata:{treesource:!0,changes:!0},params:[{name:"keys",type:"field",array:!0},{name:"generate",type:"boolean"}]};const P$t=t=>t.values;it(voe,De,{transform(t,e){e.source||je("Nest transform requires an upstream data source.");var n=t.generate,r=t.modified(),i=e.clone(),o=this.value;return(!o||r||e.changed())&&(o&&o.each(s=>{s.children&&J4(s.data)&&i.rem.push(s.data)}),this.value=o=moe({values:pt(t.keys).reduce((s,a)=>(s.key(a),s),M$t()).entries(i.source)},P$t),n&&o.each(s=>{s.children&&(s=cr(s.data),i.add.push(s),i.source.push(s))}),lY(o,jt,jt)),i.source.root=o,i}});function M$t(){const t=[],e={entries:i=>r(n(i,0),0),key:i=>(t.push(i),e)};function n(i,o){if(o>=t.length)return i;const s=i.length,a=t[o++],l={},c={};let u=-1,f,d,h;for(;++ut.length)return i;const s=[];for(const a in i)s.push({key:a,values:r(i[a],o)});return s}return e}function Xg(t){De.call(this,null,t)}const R$t=(t,e)=>t.parent===e.parent?1:2;it(Xg,De,{transform(t,e){(!e.source||!e.source.root)&&je(this.constructor.name+" transform requires a backing tree data source.");const n=this.layout(t.method),r=this.fields,i=e.source.root,o=t.as||r;t.field?i.sum(t.field):i.count(),t.sort&&i.sort(a1(t.sort,s=>s.data)),D$t(n,this.params,t),n.separation&&n.separation(t.separation!==!1?R$t:pO);try{this.value=n(i)}catch(s){je(s)}return i.each(s=>I$t(s,r,o)),e.reflow(t.modified()).modifies(o).modifies("leaf")}});function D$t(t,e,n){for(let r,i=0,o=e.length;io[jt(s)]=1),r.each(s=>{const a=s.data,l=s.parent&&s.parent.data;l&&o[jt(a)]&&o[jt(l)]&&i.add.push(cr({source:l,target:a}))}),this.value=i.add):e.changed(e.MOD)&&(e.visit(e.MOD,s=>o[jt(s)]=1),n.forEach(s=>{(o[jt(s.source)]||o[jt(s.target)])&&i.mod.push(s)})),i}});const lve={binary:T$t,dice:ER,slice:WB,slicedice:k$t,squarify:J5e,resquarify:A$t},dY=["x0","y0","x1","y1","depth","children"];function Soe(t){Xg.call(this,t)}Soe.Definition={type:"Treemap",metadata:{tree:!0,modifies:!0},params:[{name:"field",type:"field"},{name:"sort",type:"compare"},{name:"method",type:"enum",default:"squarify",values:["squarify","resquarify","binary","dice","slice","slicedice"]},{name:"padding",type:"number",default:0},{name:"paddingInner",type:"number",default:0},{name:"paddingOuter",type:"number",default:0},{name:"paddingTop",type:"number",default:0},{name:"paddingRight",type:"number",default:0},{name:"paddingBottom",type:"number",default:0},{name:"paddingLeft",type:"number",default:0},{name:"ratio",type:"number",default:1.618033988749895},{name:"round",type:"boolean",default:!1},{name:"size",type:"number",array:!0,length:2},{name:"as",type:"string",array:!0,length:dY.length,default:dY}]};it(Soe,Xg,{layout(){const t=E$t();return t.ratio=e=>{const n=t.tile();n.ratio&&t.tile(n.ratio(e))},t.method=e=>{vt(lve,e)?t.tile(lve[e]):je("Unrecognized Treemap layout method: "+e)},t},params:["method","ratio","size","round","padding","paddingInner","paddingOuter","paddingTop","paddingRight","paddingBottom","paddingLeft"],fields:dY});const L$t=Object.freeze(Object.defineProperty({__proto__:null,nest:voe,pack:yoe,partition:xoe,stratify:boe,tree:woe,treelinks:_oe,treemap:Soe},Symbol.toStringTag,{value:"Module"})),yV=4278190080;function $$t(t,e){const n=t.bitmap();return(e||[]).forEach(r=>n.set(t(r.boundary[0]),t(r.boundary[3]))),[n,void 0]}function F$t(t,e,n,r,i){const o=t.width,s=t.height,a=r||i,l=jv(o,s).getContext("2d"),c=jv(o,s).getContext("2d"),u=a&&jv(o,s).getContext("2d");n.forEach(O=>O3(l,O,!1)),O3(c,e,!1),a&&O3(u,e,!0);const f=xV(l,o,s),d=xV(c,o,s),h=a&&xV(u,o,s),p=t.bitmap(),g=a&&t.bitmap();let m,v,y,x,b,w,_,S;for(v=0;v{i.items.forEach(o=>O3(t,o.items,n))}):Ec[r].draw(t,{items:n?e.map(N$t):e})}function N$t(t){const e=eB(t,{});return e.stroke&&e.strokeOpacity!==0||e.fill&&e.fillOpacity!==0?{...e,strokeOpacity:1,stroke:"#000",fillOpacity:0}:e}const lp=5,sa=31,NA=32,Xm=new Uint32Array(NA+1),xf=new Uint32Array(NA+1);xf[0]=0;Xm[0]=~xf[0];for(let t=1;t<=NA;++t)xf[t]=xf[t-1]<<1|1,Xm[t]=~xf[t];function z$t(t,e){const n=new Uint32Array(~~((t*e+NA)/NA));function r(o,s){n[o]|=s}function i(o,s){n[o]&=s}return{array:n,get:(o,s)=>{const a=s*t+o;return n[a>>>lp]&1<<(a&sa)},set:(o,s)=>{const a=s*t+o;r(a>>>lp,1<<(a&sa))},clear:(o,s)=>{const a=s*t+o;i(a>>>lp,~(1<<(a&sa)))},getRange:(o,s,a,l)=>{let c=l,u,f,d,h;for(;c>=s;--c)if(u=c*t+o,f=c*t+a,d=u>>>lp,h=f>>>lp,d===h){if(n[d]&Xm[u&sa]&xf[(f&sa)+1])return!0}else{if(n[d]&Xm[u&sa]||n[h]&xf[(f&sa)+1])return!0;for(let p=d+1;p{let c,u,f,d,h;for(;s<=l;++s)if(c=s*t+o,u=s*t+a,f=c>>>lp,d=u>>>lp,f===d)r(f,Xm[c&sa]&xf[(u&sa)+1]);else for(r(f,Xm[c&sa]),r(d,xf[(u&sa)+1]),h=f+1;h{let c,u,f,d,h;for(;s<=l;++s)if(c=s*t+o,u=s*t+a,f=c>>>lp,d=u>>>lp,f===d)i(f,xf[c&sa]|Xm[(u&sa)+1]);else for(i(f,xf[c&sa]),i(d,Xm[(u&sa)+1]),h=f+1;ho<0||s<0||l>=e||a>=t}}function j$t(t,e,n){const r=Math.max(1,Math.sqrt(t*e/1e6)),i=~~((t+2*n+r)/r),o=~~((e+2*n+r)/r),s=a=>~~((a+n)/r);return s.invert=a=>a*r-n,s.bitmap=()=>z$t(i,o),s.ratio=r,s.padding=n,s.width=t,s.height=e,s}function B$t(t,e,n,r){const i=t.width,o=t.height;return function(s){const a=s.datum.datum.items[r].items,l=a.length,c=s.datum.fontSize,u=dc.width(s.datum,s.datum.text);let f=0,d,h,p,g,m,v,y;for(let x=0;x=f&&(f=y,s.x=m,s.y=v);return m=u/2,v=c/2,d=s.x-m,h=s.x+m,p=s.y-v,g=s.y+v,s.align="center",d<0&&h<=i?s.align="left":0<=d&&ii||e-(s=r/2)<0||e+s>o}function yv(t,e,n,r,i,o,s,a){const l=i*o/(r*2),c=t(e-l),u=t(e+l),f=t(n-(o=o/2)),d=t(n+o);return s.outOfBounds(c,f,u,d)||s.getRange(c,f,u,d)||a&&a.getRange(c,f,u,d)}function U$t(t,e,n,r){const i=t.width,o=t.height,s=e[0],a=e[1];function l(c,u,f,d,h){const p=t.invert(c),g=t.invert(u);let m=f,v=o,y;if(!x5(p,g,d,h,i,o)&&!yv(t,p,g,h,d,m,s,a)&&!yv(t,p,g,h,d,h,s,null)){for(;v-m>=1;)y=(m+v)/2,yv(t,p,g,h,d,y,s,a)?v=y:m=y;if(m>f)return[p,g,m,!0]}}return function(c){const u=c.datum.datum.items[r].items,f=u.length,d=c.datum.fontSize,h=dc.width(c.datum,c.datum.text);let p=n?d:0,g=!1,m=!1,v=0,y,x,b,w,_,S,O,k,E,P,A,R,T,M,I,j,N;for(let z=0;zx&&(N=y,y=x,x=N),b>w&&(N=b,b=w,w=N),E=t(y),A=t(x),P=~~((E+A)/2),R=t(b),M=t(w),T=~~((R+M)/2),O=P;O>=E;--O)for(k=T;k>=R;--k)j=l(O,k,p,h,d),j&&([c.x,c.y,p,g]=j);for(O=P;O<=A;++O)for(k=T;k<=M;++k)j=l(O,k,p,h,d),j&&([c.x,c.y,p,g]=j);!g&&!n&&(I=Math.abs(x-y+w-b),_=(y+x)/2,S=(b+w)/2,I>=v&&!x5(_,S,h,d,i,o)&&!yv(t,_,S,d,h,d,s,null)&&(v=I,c.x=_,c.y=S,m=!0))}return g||m?(_=h/2,S=d/2,s.setRange(t(c.x-_),t(c.y-S),t(c.x+_),t(c.y+S)),c.align="center",c.baseline="middle",!0):!1}}const W$t=[-1,-1,1,1],V$t=[-1,1,-1,1];function G$t(t,e,n,r){const i=t.width,o=t.height,s=e[0],a=e[1],l=t.bitmap();return function(c){const u=c.datum.datum.items[r].items,f=u.length,d=c.datum.fontSize,h=dc.width(c.datum,c.datum.text),p=[];let g=n?d:0,m=!1,v=!1,y=0,x,b,w,_,S,O,k,E,P,A,R,T;for(let M=0;M=1;)R=(P+A)/2,yv(t,S,O,d,h,R,s,a)?A=R:P=R;P>g&&(c.x=S,c.y=O,g=P,m=!0)}}!m&&!n&&(T=Math.abs(b-x+_-w),S=(x+b)/2,O=(w+_)/2,T>=y&&!x5(S,O,h,d,i,o)&&!yv(t,S,O,d,h,d,s,null)&&(y=T,c.x=S,c.y=O,v=!0))}return m||v?(S=h/2,O=d/2,s.setRange(t(c.x-S),t(c.y-O),t(c.x+S),t(c.y+O)),c.align="center",c.baseline="middle",!0):!1}}const H$t=["right","center","left"],q$t=["bottom","middle","top"];function X$t(t,e,n,r){const i=t.width,o=t.height,s=e[0],a=e[1],l=r.length;return function(c){const u=c.boundary,f=c.datum.fontSize;if(u[2]<0||u[5]<0||u[0]>i||u[3]>o)return!1;let d=c.textWidth??0,h,p,g,m,v,y,x,b,w,_,S,O,k,E,P;for(let A=0;A>>2&3)-1,g=h===0&&p===0||r[A]<0,m=h&&p?Math.SQRT1_2:1,v=r[A]<0?-1:1,y=u[1+h]+r[A]*h*m,S=u[4+p]+v*f*p/2+r[A]*p*m,b=S-f/2,w=S+f/2,O=t(y),E=t(b),P=t(w),!d)if(cve(O,O,E,P,s,a,y,y,b,w,u,g))d=dc.width(c.datum,c.datum.text);else continue;if(_=y+v*d*h/2,y=_-d/2,x=_+d/2,O=t(y),k=t(x),cve(O,k,E,P,s,a,y,x,b,w,u,g))return c.x=h?h*v<0?x:y:_,c.y=p?p*v<0?w:b:S,c.align=H$t[h*v+1],c.baseline=q$t[p*v+1],s.setRange(O,E,k,P),!0}return!1}}function cve(t,e,n,r,i,o,s,a,l,c,u,f){return!(i.outOfBounds(t,n,e,r)||(f&&o||i).getRange(t,n,e,r))}const bV=0,wV=4,_V=8,SV=0,CV=1,OV=2,Y$t={"top-left":bV+SV,top:bV+CV,"top-right":bV+OV,left:wV+SV,middle:wV+CV,right:wV+OV,"bottom-left":_V+SV,bottom:_V+CV,"bottom-right":_V+OV},Q$t={naive:B$t,"reduced-search":U$t,floodfill:G$t};function K$t(t,e,n,r,i,o,s,a,l,c,u){if(!t.length)return t;const f=Math.max(r.length,i.length),d=Z$t(r,f),h=J$t(i,f),p=e3t(t[0].datum),g=p==="group"&&t[0].datum.items[l].marktype,m=g==="area",v=t3t(p,g,a,l),y=c===null||c===1/0,x=m&&u==="naive";let b=-1,w=-1;const _=t.map(E=>{const P=y?dc.width(E,E.text):void 0;return b=Math.max(b,P),w=Math.max(w,E.fontSize),{datum:E,opacity:0,x:void 0,y:void 0,align:void 0,baseline:void 0,boundary:v(E),textWidth:P}});c=c===null||c===1/0?Math.max(b,w)+Math.max(...r):c;const S=j$t(e[0],e[1],c);let O;if(!x){n&&_.sort((A,R)=>n(A.datum,R.datum));let E=!1;for(let A=0;AA.datum);O=o.length||P?F$t(S,P||[],o,E,m):$$t(S,s&&_)}const k=m?Q$t[u](S,O,s,l):X$t(S,O,h,d);return _.forEach(E=>E.opacity=+k(E)),_}function Z$t(t,e){const n=new Float64Array(e),r=t.length;for(let i=0;i[o.x,o.x,o.x,o.y,o.y,o.y];return t?t==="line"||t==="area"?o=>i(o.datum):e==="line"?o=>{const s=o.datum.items[r].items;return i(s.length?s[n==="start"?0:s.length-1]:{x:NaN,y:NaN})}:o=>{const s=o.datum.bounds;return[s.x1,(s.x1+s.x2)/2,s.x2,s.y1,(s.y1+s.y2)/2,s.y2]}:i}const hY=["x","y","opacity","align","baseline"],eze=["top-left","left","bottom-left","top","bottom","top-right","right","bottom-right"];function Coe(t){De.call(this,null,t)}Coe.Definition={type:"Label",metadata:{modifies:!0},params:[{name:"size",type:"number",array:!0,length:2,required:!0},{name:"sort",type:"compare"},{name:"anchor",type:"string",array:!0,default:eze},{name:"offset",type:"number",array:!0,default:[1]},{name:"padding",type:"number",default:0,null:!0},{name:"lineAnchor",type:"string",values:["start","end"],default:"end"},{name:"markIndex",type:"number",default:0},{name:"avoidBaseMark",type:"boolean",default:!0},{name:"avoidMarks",type:"data",array:!0},{name:"method",type:"string",default:"naive"},{name:"as",type:"string",array:!0,length:hY.length,default:hY}]};it(Coe,De,{transform(t,e){function n(o){const s=t[o];return fn(s)&&e.modified(s.fields)}const r=t.modified();if(!(r||e.changed(e.ADD_REM)||n("sort")))return;(!t.size||t.size.length!==2)&&je("Size parameter should be specified as a [width, height] array.");const i=t.as||hY;return K$t(e.materialize(e.SOURCE).source||[],t.size,t.sort,pt(t.offset==null?1:t.offset),pt(t.anchor||eze),t.avoidMarks||[],t.avoidBaseMark!==!1,t.lineAnchor||"end",t.markIndex||0,t.padding===void 0?0:t.padding,t.method||"naive").forEach(o=>{const s=o.datum;s[i[0]]=o.x,s[i[1]]=o.y,s[i[2]]=o.opacity,s[i[3]]=o.align,s[i[4]]=o.baseline}),e.reflow(r).modifies(i)}});const n3t=Object.freeze(Object.defineProperty({__proto__:null,label:Coe},Symbol.toStringTag,{value:"Module"}));function tze(t,e){var n=[],r=function(u){return u(a)},i,o,s,a,l,c;if(e==null)n.push(t);else for(i={},o=0,s=t.length;o{i$e(c,t.x,t.y,t.bandwidth||.3).forEach(u=>{const f={};for(let d=0;dt==="poly"?e:t==="quad"?2:1;function Eoe(t){De.call(this,null,t)}Eoe.Definition={type:"Regression",metadata:{generates:!0},params:[{name:"x",type:"field",required:!0},{name:"y",type:"field",required:!0},{name:"groupby",type:"field",array:!0},{name:"method",type:"string",default:"linear",values:Object.keys(pY)},{name:"order",type:"number",default:3},{name:"extent",type:"number",array:!0,length:2},{name:"params",type:"boolean",default:!1},{name:"as",type:"string",array:!0}]};it(Eoe,De,{transform(t,e){const n=e.fork(e.NO_SOURCE|e.NO_FIELDS);if(!this.value||e.changed()||t.modified()){const r=e.materialize(e.SOURCE).source,i=tze(r,t.groupby),o=(t.groupby||[]).map(Ni),s=t.method||"linear",a=t.order==null?3:t.order,l=r3t(s,a),c=t.as||[Ni(t.x),Ni(t.y)],u=pY[s],f=[];let d=t.extent;vt(pY,s)||je("Invalid regression method: "+s),d!=null&&s==="log"&&d[0]<=0&&(e.dataflow.warn("Ignoring extent with values <= 0 for log regression."),d=null),i.forEach(h=>{if(h.length<=l){e.dataflow.warn("Skipping regression with more parameters than data points.");return}const g=u(h,t.x,t.y,a);if(t.params){f.push(cr({keys:h.dims,coef:g.coef,rSquared:g.rSquared}));return}const m=d||Sh(h,t.x),v=y=>{const x={};for(let b=0;bv([y,g.predict(y)])):aB(g.predict,m,25,200).forEach(v)}),this.value&&(n.rem=this.value),this.value=n.add=n.source=f}return n}});const i3t=Object.freeze(Object.defineProperty({__proto__:null,loess:Ooe,regression:Eoe},Symbol.toStringTag,{value:"Module"})),ig=11102230246251565e-32,Ps=134217729,o3t=(3+8*ig)*ig;function EV(t,e,n,r,i){let o,s,a,l,c=e[0],u=r[0],f=0,d=0;u>c==u>-c?(o=c,c=e[++f]):(o=u,u=r[++d]);let h=0;if(fc==u>-c?(s=c+o,a=o-(s-c),c=e[++f]):(s=u+o,a=o-(s-u),u=r[++d]),o=s,a!==0&&(i[h++]=a);fc==u>-c?(s=o+c,l=s-o,a=o-(s-l)+(c-l),c=e[++f]):(s=o+u,l=s-o,a=o-(s-l)+(u-l),u=r[++d]),o=s,a!==0&&(i[h++]=a);for(;f=T||-R>=T||(f=t-k,a=t-(k+f)+(f-i),f=n-E,c=n-(E+f)+(f-i),f=e-P,l=e-(P+f)+(f-o),f=r-A,u=r-(A+f)+(f-o),a===0&&l===0&&c===0&&u===0)||(T=c3t*s+o3t*Math.abs(R),R+=k*u+A*a-(P*c+E*l),R>=T||-R>=T))return R;b=a*A,d=Ps*a,h=d-(d-a),p=a-h,d=Ps*A,g=d-(d-A),m=A-g,w=p*m-(b-h*g-p*g-h*m),_=l*E,d=Ps*l,h=d-(d-l),p=l-h,d=Ps*E,g=d-(d-E),m=E-g,S=p*m-(_-h*g-p*g-h*m),v=w-S,f=w-v,aa[0]=w-(v+f)+(f-S),y=b+v,f=y-b,x=b-(y-f)+(v-f),v=x-_,f=x-v,aa[1]=x-(v+f)+(f-_),O=y+v,f=O-y,aa[2]=y-(O-f)+(v-f),aa[3]=O;const M=EV(4,Z1,4,aa,uve);b=k*u,d=Ps*k,h=d-(d-k),p=k-h,d=Ps*u,g=d-(d-u),m=u-g,w=p*m-(b-h*g-p*g-h*m),_=P*c,d=Ps*P,h=d-(d-P),p=P-h,d=Ps*c,g=d-(d-c),m=c-g,S=p*m-(_-h*g-p*g-h*m),v=w-S,f=w-v,aa[0]=w-(v+f)+(f-S),y=b+v,f=y-b,x=b-(y-f)+(v-f),v=x-_,f=x-v,aa[1]=x-(v+f)+(f-_),O=y+v,f=O-y,aa[2]=y-(O-f)+(v-f),aa[3]=O;const I=EV(M,uve,4,aa,fve);b=a*u,d=Ps*a,h=d-(d-a),p=a-h,d=Ps*u,g=d-(d-u),m=u-g,w=p*m-(b-h*g-p*g-h*m),_=l*c,d=Ps*l,h=d-(d-l),p=l-h,d=Ps*c,g=d-(d-c),m=c-g,S=p*m-(_-h*g-p*g-h*m),v=w-S,f=w-v,aa[0]=w-(v+f)+(f-S),y=b+v,f=y-b,x=b-(y-f)+(v-f),v=x-_,f=x-v,aa[1]=x-(v+f)+(f-_),O=y+v,f=O-y,aa[2]=y-(O-f)+(v-f),aa[3]=O;const j=EV(I,fve,4,aa,dve);return dve[j-1]}function HI(t,e,n,r,i,o){const s=(e-o)*(n-i),a=(t-i)*(r-o),l=s-a,c=Math.abs(s+a);return Math.abs(l)>=a3t*c?l:-u3t(t,e,n,r,i,o,c)}const hve=Math.pow(2,-52),qI=new Uint32Array(512);class b5{static from(e,n=g3t,r=m3t){const i=e.length,o=new Float64Array(i*2);for(let s=0;s>1;if(n>0&&typeof e[0]!="number")throw new Error("Expected coords to contain numbers.");this.coords=e;const r=Math.max(2*n-5,0);this._triangles=new Uint32Array(r*3),this._halfedges=new Int32Array(r*3),this._hashSize=Math.ceil(Math.sqrt(n)),this._hullPrev=new Uint32Array(n),this._hullNext=new Uint32Array(n),this._hullTri=new Uint32Array(n),this._hullHash=new Int32Array(this._hashSize),this._ids=new Uint32Array(n),this._dists=new Float64Array(n),this.update()}update(){const{coords:e,_hullPrev:n,_hullNext:r,_hullTri:i,_hullHash:o}=this,s=e.length>>1;let a=1/0,l=1/0,c=-1/0,u=-1/0;for(let k=0;kc&&(c=E),P>u&&(u=P),this._ids[k]=k}const f=(a+c)/2,d=(l+u)/2;let h,p,g;for(let k=0,E=1/0;k0&&(p=k,E=P)}let y=e[2*p],x=e[2*p+1],b=1/0;for(let k=0;kA&&(k[E++]=R,A=T)}this.hull=k.subarray(0,E),this.triangles=new Uint32Array(0),this.halfedges=new Uint32Array(0);return}if(HI(m,v,y,x,w,_)<0){const k=p,E=y,P=x;p=g,y=w,x=_,g=k,w=E,_=P}const S=p3t(m,v,y,x,w,_);this._cx=S.x,this._cy=S.y;for(let k=0;k0&&Math.abs(R-E)<=hve&&Math.abs(T-P)<=hve||(E=R,P=T,A===h||A===p||A===g))continue;let M=0;for(let L=0,B=this._hashKey(R,T);L=0;)if(I=j,I===M){I=-1;break}if(I===-1)continue;let N=this._addTriangle(I,A,r[I],-1,-1,i[I]);i[A]=this._legalize(N+2),i[I]=N,O++;let z=r[I];for(;j=r[z],HI(R,T,e[2*z],e[2*z+1],e[2*j],e[2*j+1])<0;)N=this._addTriangle(z,A,j,i[A],-1,i[z]),i[A]=this._legalize(N+2),r[z]=z,O--,z=j;if(I===M)for(;j=n[I],HI(R,T,e[2*j],e[2*j+1],e[2*I],e[2*I+1])<0;)N=this._addTriangle(j,A,I,-1,i[I],i[j]),this._legalize(N+2),i[j]=N,r[I]=I,O--,I=j;this._hullStart=n[A]=I,r[I]=n[z]=A,r[A]=z,o[this._hashKey(R,T)]=A,o[this._hashKey(e[2*I],e[2*I+1])]=I}this.hull=new Uint32Array(O);for(let k=0,E=this._hullStart;k0?3-n:1+n)/4}function TV(t,e,n,r){const i=t-n,o=e-r;return i*i+o*o}function d3t(t,e,n,r,i,o,s,a){const l=t-s,c=e-a,u=n-s,f=r-a,d=i-s,h=o-a,p=l*l+c*c,g=u*u+f*f,m=d*d+h*h;return l*(f*m-g*h)-c*(u*m-g*d)+p*(u*h-f*d)<0}function h3t(t,e,n,r,i,o){const s=n-t,a=r-e,l=i-t,c=o-e,u=s*s+a*a,f=l*l+c*c,d=.5/(s*c-a*l),h=(c*u-a*f)*d,p=(s*f-l*u)*d;return h*h+p*p}function p3t(t,e,n,r,i,o){const s=n-t,a=r-e,l=i-t,c=o-e,u=s*s+a*a,f=l*l+c*c,d=.5/(s*c-a*l),h=t+(c*u-a*f)*d,p=e+(s*f-l*u)*d;return{x:h,y:p}}function c_(t,e,n,r){if(r-n<=20)for(let i=n+1;i<=r;i++){const o=t[i],s=e[o];let a=i-1;for(;a>=n&&e[t[a]]>s;)t[a+1]=t[a--];t[a+1]=o}else{const i=n+r>>1;let o=n+1,s=r;e2(t,i,o),e[t[n]]>e[t[r]]&&e2(t,n,r),e[t[o]]>e[t[r]]&&e2(t,o,r),e[t[n]]>e[t[o]]&&e2(t,n,o);const a=t[o],l=e[a];for(;;){do o++;while(e[t[o]]l);if(s=s-n?(c_(t,e,o,r),c_(t,e,n,s-1)):(c_(t,e,n,s-1),c_(t,e,o,r))}}function e2(t,e,n){const r=t[e];t[e]=t[n],t[n]=r}function g3t(t){return t[0]}function m3t(t){return t[1]}const pve=1e-6;class mx{constructor(){this._x0=this._y0=this._x1=this._y1=null,this._=""}moveTo(e,n){this._+=`M${this._x0=this._x1=+e},${this._y0=this._y1=+n}`}closePath(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._+="Z")}lineTo(e,n){this._+=`L${this._x1=+e},${this._y1=+n}`}arc(e,n,r){e=+e,n=+n,r=+r;const i=e+r,o=n;if(r<0)throw new Error("negative radius");this._x1===null?this._+=`M${i},${o}`:(Math.abs(this._x1-i)>pve||Math.abs(this._y1-o)>pve)&&(this._+="L"+i+","+o),r&&(this._+=`A${r},${r},0,1,1,${e-r},${n}A${r},${r},0,1,1,${this._x1=i},${this._y1=o}`)}rect(e,n,r,i){this._+=`M${this._x0=this._x1=+e},${this._y0=this._y1=+n}h${+r}v${+i}h${-r}Z`}value(){return this._||null}}class gY{constructor(){this._=[]}moveTo(e,n){this._.push([e,n])}closePath(){this._.push(this._[0].slice())}lineTo(e,n){this._.push([e,n])}value(){return this._.length?this._:null}}let v3t=class{constructor(e,[n,r,i,o]=[0,0,960,500]){if(!((i=+i)>=(n=+n))||!((o=+o)>=(r=+r)))throw new Error("invalid bounds");this.delaunay=e,this._circumcenters=new Float64Array(e.points.length*2),this.vectors=new Float64Array(e.points.length*2),this.xmax=i,this.xmin=n,this.ymax=o,this.ymin=r,this._init()}update(){return this.delaunay.update(),this._init(),this}_init(){const{delaunay:{points:e,hull:n,triangles:r},vectors:i}=this;let o,s;const a=this.circumcenters=this._circumcenters.subarray(0,r.length/3*2);for(let g=0,m=0,v=r.length,y,x;g1;)o-=2;for(let s=2;s0){if(n>=this.ymax)return null;(s=(this.ymax-n)/i)0){if(e>=this.xmax)return null;(s=(this.xmax-e)/r)this.xmax?2:0)|(nthis.ymax?8:0)}_simplify(e){if(e&&e.length>4){for(let n=0;n1e-10)return!1}return!0}function _3t(t,e,n){return[t+Math.sin(t+e)*n,e+Math.cos(t-e)*n]}class Toe{static from(e,n=x3t,r=b3t,i){return new Toe("length"in e?S3t(e,n,r,i):Float64Array.from(C3t(e,n,r,i)))}constructor(e){this._delaunator=new b5(e),this.inedges=new Int32Array(e.length/2),this._hullIndex=new Int32Array(e.length/2),this.points=this._delaunator.coords,this._init()}update(){return this._delaunator.update(),this._init(),this}_init(){const e=this._delaunator,n=this.points;if(e.hull&&e.hull.length>2&&w3t(e)){this.collinear=Int32Array.from({length:n.length/2},(d,h)=>h).sort((d,h)=>n[2*d]-n[2*h]||n[2*d+1]-n[2*h+1]);const l=this.collinear[0],c=this.collinear[this.collinear.length-1],u=[n[2*l],n[2*l+1],n[2*c],n[2*c+1]],f=1e-8*Math.hypot(u[3]-u[1],u[2]-u[0]);for(let d=0,h=n.length/2;d0&&(this.triangles=new Int32Array(3).fill(-1),this.halfedges=new Int32Array(3).fill(-1),this.triangles[0]=i[0],s[i[0]]=1,i.length===2&&(s[i[1]]=0,this.triangles[1]=i[1],this.triangles[2]=i[1]))}voronoi(e){return new v3t(this,e)}*neighbors(e){const{inedges:n,hull:r,_hullIndex:i,halfedges:o,triangles:s,collinear:a}=this;if(a){const f=a.indexOf(e);f>0&&(yield a[f-1]),f=0&&o!==r&&o!==i;)r=o;return o}_step(e,n,r){const{inedges:i,hull:o,_hullIndex:s,halfedges:a,triangles:l,points:c}=this;if(i[e]===-1||!c.length)return(e+1)%(c.length>>1);let u=e,f=J1(n-c[e*2],2)+J1(r-c[e*2+1],2);const d=i[e];let h=d;do{let p=l[h];const g=J1(n-c[p*2],2)+J1(r-c[p*2+1],2);if(g>5)*t[1]),m=null,v=c.length,y=-1,x=[],b=c.map(_=>({text:e(_),font:n(_),style:i(_),weight:o(_),rotate:s(_),size:~~(r(_)+1e-14),padding:a(_),xoff:0,yoff:0,x1:0,y1:0,x0:0,y0:0,hasText:!1,sprite:null,datum:_})).sort((_,S)=>S.size-_.size);++y>1,w.y=t[1]*(u()+.5)>>1,P3t(p,w,b,y),w.hasText&&h(g,w,m)&&(x.push(w),m?R3t(m,w):m=[{x:w.x+w.x0,y:w.y+w.y0},{x:w.x+w.x1,y:w.y+w.y1}],w.x-=t[0]>>1,w.y-=t[1]>>1)}return x};function d(p){p.width=p.height=1;var g=Math.sqrt(p.getContext("2d").getImageData(0,0,1,1).data.length>>2);p.width=(yT<<5)/g,p.height=E3/g;var m=p.getContext("2d");return m.fillStyle=m.strokeStyle="red",m.textAlign="center",{context:m,ratio:g}}function h(p,g,m){for(var v=g.x,y=g.y,x=Math.hypot(t[0],t[1]),b=l(t),w=u()<.5?1:-1,_=-w,S,O,k;(S=b(_+=w))&&(O=~~S[0],k=~~S[1],!(Math.min(Math.abs(O),Math.abs(k))>=x));)if(g.x=v+O,g.y=y+k,!(g.x+g.x0<0||g.y+g.y0<0||g.x+g.x1>t[0]||g.y+g.y1>t[1])&&(!m||!M3t(g,p,t[0]))&&(!m||D3t(g,m))){for(var E=g.sprite,P=g.width>>5,A=t[0]>>5,R=g.x-(P<<4),T=R&127,M=32-T,I=g.y1-g.y0,j=(g.y+g.y0)*A+(R>>5),N,z=0;z>>T:0);j+=A}return g.sprite=null,!0}return!1}return f.words=function(p){return arguments.length?(c=p,f):c},f.size=function(p){return arguments.length?(t=[+p[0],+p[1]],f):t},f.font=function(p){return arguments.length?(n=p0(p),f):n},f.fontStyle=function(p){return arguments.length?(i=p0(p),f):i},f.fontWeight=function(p){return arguments.length?(o=p0(p),f):o},f.rotate=function(p){return arguments.length?(s=p0(p),f):s},f.text=function(p){return arguments.length?(e=p0(p),f):e},f.spiral=function(p){return arguments.length?(l=$3t[p]||p,f):l},f.fontSize=function(p){return arguments.length?(r=p0(p),f):r},f.padding=function(p){return arguments.length?(a=p0(p),f):a},f.random=function(p){return arguments.length?(u=p,f):u},f}function P3t(t,e,n,r){if(!e.sprite){var i=t.context,o=t.ratio;i.clearRect(0,0,(yT<<5)/o,E3/o);var s=0,a=0,l=0,c=n.length,u,f,d,h,p;for(--r;++r>5<<5,d=~~Math.max(Math.abs(y+x),Math.abs(y-x))}else u=u+31>>5<<5;if(d>l&&(l=d),s+u>=yT<<5&&(s=0,a+=l,l=0),a+d>=E3)break;i.translate((s+(u>>1))/o,(a+(d>>1))/o),e.rotate&&i.rotate(e.rotate*kV),i.fillText(e.text,0,0),e.padding&&(i.lineWidth=2*e.padding,i.strokeText(e.text,0,0)),i.restore(),e.width=u,e.height=d,e.xoff=s,e.yoff=a,e.x1=u>>1,e.y1=d>>1,e.x0=-e.x1,e.y0=-e.y1,e.hasText=!0,s+=u}for(var w=i.getImageData(0,0,(yT<<5)/o,E3/o).data,_=[];--r>=0;)if(e=n[r],!!e.hasText){for(u=e.width,f=u>>5,d=e.y1-e.y0,h=0;h>5),E=w[(a+p)*(yT<<5)+(s+h)<<2]?1<<31-h%32:0;_[k]|=E,S|=E}S?O=p:(e.y0++,d--,p--,a++)}e.y1=e.y0+O,e.sprite=_.slice(0,(e.y1-e.y0)*f)}}}function M3t(t,e,n){n>>=5;for(var r=t.sprite,i=t.width>>5,o=t.x-(i<<4),s=o&127,a=32-s,l=t.y1-t.y0,c=(t.y+t.y0)*n+(o>>5),u,f=0;f>>s:0))&e[c+d])return!0;c+=n}return!1}function R3t(t,e){var n=t[0],r=t[1];e.x+e.x0r.x&&(r.x=e.x+e.x1),e.y+e.y1>r.y&&(r.y=e.y+e.y1)}function D3t(t,e){return t.x+t.x1>e[0].x&&t.x+t.x0e[0].y&&t.y+t.y0g(p(m))}i.forEach(p=>{p[s[0]]=NaN,p[s[1]]=NaN,p[s[3]]=0});const c=o.words(i).text(t.text).size(t.size||[500,500]).padding(t.padding||1).spiral(t.spiral||"archimedean").rotate(t.rotate||0).font(t.font||"sans-serif").fontStyle(t.fontStyle||"normal").fontWeight(t.fontWeight||"normal").fontSize(a).random(Au).layout(),u=o.size(),f=u[0]>>1,d=u[1]>>1,h=c.length;for(let p=0,g,m;pnew Uint8Array(t),j3t=t=>new Uint16Array(t),dk=t=>new Uint32Array(t);function B3t(){let t=8,e=[],n=dk(0),r=XI(0,t),i=XI(0,t);return{data:()=>e,seen:()=>n=U3t(n,e.length),add(o){for(let s=0,a=e.length,l=o.length,c;se.length,curr:()=>r,prev:()=>i,reset:o=>i[o]=r[o],all:()=>t<257?255:t<65537?65535:4294967295,set(o,s){r[o]|=s},clear(o,s){r[o]&=~s},resize(o,s){const a=r.length;(o>a||s>t)&&(t=Math.max(s,t),r=XI(o,t,r),i=XI(o,t))}}}function U3t(t,e,n){return t.length>=e?t:(n=n||new t.constructor(e),n.set(t),n)}function XI(t,e,n){const r=(e<257?z3t:e<65537?j3t:dk)(t);return n&&r.set(n),r}function gve(t,e,n){const r=1<0)for(m=0;mt,size:()=>n}}function W3t(t,e){return t.sort.call(e,(n,r)=>{const i=t[n],o=t[r];return io?1:0}),XSt(t,e)}function V3t(t,e,n,r,i,o,s,a,l){let c=0,u=0,f;for(f=0;ce.modified(r.fields));return n?this.reinit(t,e):this.eval(t,e)}else return this.init(t,e)},init(t,e){const n=t.fields,r=t.query,i=this._indices={},o=this._dims=[],s=r.length;let a=0,l,c;for(;a{const o=i.remove(e,n);for(const s in r)r[s].reindex(o)})},update(t,e,n){const r=this._dims,i=t.query,o=e.stamp,s=r.length;let a=0,l,c;for(n.filters=0,c=0;ch)for(m=h,v=Math.min(f,p);mp)for(m=Math.max(f,p),v=d;mf)for(p=f,g=Math.min(c,d);pd)for(p=Math.max(c,d),g=u;pa[u]&n?null:s[u];return o.filter(o.MOD,c),i&i-1?(o.filter(o.ADD,u=>{const f=a[u]&n;return!f&&f^l[u]&n?s[u]:null}),o.filter(o.REM,u=>{const f=a[u]&n;return f&&!(f^(f^l[u]&n))?s[u]:null})):(o.filter(o.ADD,c),o.filter(o.REM,u=>(a[u]&n)===i?s[u]:null)),o.filter(o.SOURCE,u=>c(u._index))}});const G3t=Object.freeze(Object.defineProperty({__proto__:null,crossfilter:Poe,resolvefilter:Moe},Symbol.toStringTag,{value:"Module"})),H3t="RawCode",vb="Literal",q3t="Property",X3t="Identifier",Y3t="ArrayExpression",Q3t="BinaryExpression",ize="CallExpression",K3t="ConditionalExpression",Z3t="LogicalExpression",J3t="MemberExpression",eFt="ObjectExpression",tFt="UnaryExpression";function td(t){this.type=t}td.prototype.visit=function(t){let e,n,r;if(t(this))return 1;for(e=nFt(this),n=0,r=e.length;n";Uh[yb]="Identifier";Uh[Gy]="Keyword";Uh[GB]="Null";Uh[u1]="Numeric";Uh[Ha]="Punctuator";Uh[AR]="String";Uh[rFt]="RegularExpression";var iFt="ArrayExpression",oFt="BinaryExpression",sFt="CallExpression",aFt="ConditionalExpression",oze="Identifier",lFt="Literal",cFt="LogicalExpression",uFt="MemberExpression",fFt="ObjectExpression",dFt="Property",hFt="UnaryExpression",Fo="Unexpected token %0",pFt="Unexpected number",gFt="Unexpected string",mFt="Unexpected identifier",vFt="Unexpected reserved word",yFt="Unexpected end of input",mY="Invalid regular expression",AV="Invalid regular expression: missing /",sze="Octal literals are not allowed in strict mode.",xFt="Duplicate data property in object literal not allowed in strict mode",ps="ILLEGAL",zA="Disabled.",bFt=new RegExp("[\\xAA\\xB5\\xBA\\xC0-\\xD6\\xD8-\\xF6\\xF8-\\u02C1\\u02C6-\\u02D1\\u02E0-\\u02E4\\u02EC\\u02EE\\u0370-\\u0374\\u0376\\u0377\\u037A-\\u037D\\u037F\\u0386\\u0388-\\u038A\\u038C\\u038E-\\u03A1\\u03A3-\\u03F5\\u03F7-\\u0481\\u048A-\\u052F\\u0531-\\u0556\\u0559\\u0561-\\u0587\\u05D0-\\u05EA\\u05F0-\\u05F2\\u0620-\\u064A\\u066E\\u066F\\u0671-\\u06D3\\u06D5\\u06E5\\u06E6\\u06EE\\u06EF\\u06FA-\\u06FC\\u06FF\\u0710\\u0712-\\u072F\\u074D-\\u07A5\\u07B1\\u07CA-\\u07EA\\u07F4\\u07F5\\u07FA\\u0800-\\u0815\\u081A\\u0824\\u0828\\u0840-\\u0858\\u08A0-\\u08B2\\u0904-\\u0939\\u093D\\u0950\\u0958-\\u0961\\u0971-\\u0980\\u0985-\\u098C\\u098F\\u0990\\u0993-\\u09A8\\u09AA-\\u09B0\\u09B2\\u09B6-\\u09B9\\u09BD\\u09CE\\u09DC\\u09DD\\u09DF-\\u09E1\\u09F0\\u09F1\\u0A05-\\u0A0A\\u0A0F\\u0A10\\u0A13-\\u0A28\\u0A2A-\\u0A30\\u0A32\\u0A33\\u0A35\\u0A36\\u0A38\\u0A39\\u0A59-\\u0A5C\\u0A5E\\u0A72-\\u0A74\\u0A85-\\u0A8D\\u0A8F-\\u0A91\\u0A93-\\u0AA8\\u0AAA-\\u0AB0\\u0AB2\\u0AB3\\u0AB5-\\u0AB9\\u0ABD\\u0AD0\\u0AE0\\u0AE1\\u0B05-\\u0B0C\\u0B0F\\u0B10\\u0B13-\\u0B28\\u0B2A-\\u0B30\\u0B32\\u0B33\\u0B35-\\u0B39\\u0B3D\\u0B5C\\u0B5D\\u0B5F-\\u0B61\\u0B71\\u0B83\\u0B85-\\u0B8A\\u0B8E-\\u0B90\\u0B92-\\u0B95\\u0B99\\u0B9A\\u0B9C\\u0B9E\\u0B9F\\u0BA3\\u0BA4\\u0BA8-\\u0BAA\\u0BAE-\\u0BB9\\u0BD0\\u0C05-\\u0C0C\\u0C0E-\\u0C10\\u0C12-\\u0C28\\u0C2A-\\u0C39\\u0C3D\\u0C58\\u0C59\\u0C60\\u0C61\\u0C85-\\u0C8C\\u0C8E-\\u0C90\\u0C92-\\u0CA8\\u0CAA-\\u0CB3\\u0CB5-\\u0CB9\\u0CBD\\u0CDE\\u0CE0\\u0CE1\\u0CF1\\u0CF2\\u0D05-\\u0D0C\\u0D0E-\\u0D10\\u0D12-\\u0D3A\\u0D3D\\u0D4E\\u0D60\\u0D61\\u0D7A-\\u0D7F\\u0D85-\\u0D96\\u0D9A-\\u0DB1\\u0DB3-\\u0DBB\\u0DBD\\u0DC0-\\u0DC6\\u0E01-\\u0E30\\u0E32\\u0E33\\u0E40-\\u0E46\\u0E81\\u0E82\\u0E84\\u0E87\\u0E88\\u0E8A\\u0E8D\\u0E94-\\u0E97\\u0E99-\\u0E9F\\u0EA1-\\u0EA3\\u0EA5\\u0EA7\\u0EAA\\u0EAB\\u0EAD-\\u0EB0\\u0EB2\\u0EB3\\u0EBD\\u0EC0-\\u0EC4\\u0EC6\\u0EDC-\\u0EDF\\u0F00\\u0F40-\\u0F47\\u0F49-\\u0F6C\\u0F88-\\u0F8C\\u1000-\\u102A\\u103F\\u1050-\\u1055\\u105A-\\u105D\\u1061\\u1065\\u1066\\u106E-\\u1070\\u1075-\\u1081\\u108E\\u10A0-\\u10C5\\u10C7\\u10CD\\u10D0-\\u10FA\\u10FC-\\u1248\\u124A-\\u124D\\u1250-\\u1256\\u1258\\u125A-\\u125D\\u1260-\\u1288\\u128A-\\u128D\\u1290-\\u12B0\\u12B2-\\u12B5\\u12B8-\\u12BE\\u12C0\\u12C2-\\u12C5\\u12C8-\\u12D6\\u12D8-\\u1310\\u1312-\\u1315\\u1318-\\u135A\\u1380-\\u138F\\u13A0-\\u13F4\\u1401-\\u166C\\u166F-\\u167F\\u1681-\\u169A\\u16A0-\\u16EA\\u16EE-\\u16F8\\u1700-\\u170C\\u170E-\\u1711\\u1720-\\u1731\\u1740-\\u1751\\u1760-\\u176C\\u176E-\\u1770\\u1780-\\u17B3\\u17D7\\u17DC\\u1820-\\u1877\\u1880-\\u18A8\\u18AA\\u18B0-\\u18F5\\u1900-\\u191E\\u1950-\\u196D\\u1970-\\u1974\\u1980-\\u19AB\\u19C1-\\u19C7\\u1A00-\\u1A16\\u1A20-\\u1A54\\u1AA7\\u1B05-\\u1B33\\u1B45-\\u1B4B\\u1B83-\\u1BA0\\u1BAE\\u1BAF\\u1BBA-\\u1BE5\\u1C00-\\u1C23\\u1C4D-\\u1C4F\\u1C5A-\\u1C7D\\u1CE9-\\u1CEC\\u1CEE-\\u1CF1\\u1CF5\\u1CF6\\u1D00-\\u1DBF\\u1E00-\\u1F15\\u1F18-\\u1F1D\\u1F20-\\u1F45\\u1F48-\\u1F4D\\u1F50-\\u1F57\\u1F59\\u1F5B\\u1F5D\\u1F5F-\\u1F7D\\u1F80-\\u1FB4\\u1FB6-\\u1FBC\\u1FBE\\u1FC2-\\u1FC4\\u1FC6-\\u1FCC\\u1FD0-\\u1FD3\\u1FD6-\\u1FDB\\u1FE0-\\u1FEC\\u1FF2-\\u1FF4\\u1FF6-\\u1FFC\\u2071\\u207F\\u2090-\\u209C\\u2102\\u2107\\u210A-\\u2113\\u2115\\u2119-\\u211D\\u2124\\u2126\\u2128\\u212A-\\u212D\\u212F-\\u2139\\u213C-\\u213F\\u2145-\\u2149\\u214E\\u2160-\\u2188\\u2C00-\\u2C2E\\u2C30-\\u2C5E\\u2C60-\\u2CE4\\u2CEB-\\u2CEE\\u2CF2\\u2CF3\\u2D00-\\u2D25\\u2D27\\u2D2D\\u2D30-\\u2D67\\u2D6F\\u2D80-\\u2D96\\u2DA0-\\u2DA6\\u2DA8-\\u2DAE\\u2DB0-\\u2DB6\\u2DB8-\\u2DBE\\u2DC0-\\u2DC6\\u2DC8-\\u2DCE\\u2DD0-\\u2DD6\\u2DD8-\\u2DDE\\u2E2F\\u3005-\\u3007\\u3021-\\u3029\\u3031-\\u3035\\u3038-\\u303C\\u3041-\\u3096\\u309D-\\u309F\\u30A1-\\u30FA\\u30FC-\\u30FF\\u3105-\\u312D\\u3131-\\u318E\\u31A0-\\u31BA\\u31F0-\\u31FF\\u3400-\\u4DB5\\u4E00-\\u9FCC\\uA000-\\uA48C\\uA4D0-\\uA4FD\\uA500-\\uA60C\\uA610-\\uA61F\\uA62A\\uA62B\\uA640-\\uA66E\\uA67F-\\uA69D\\uA6A0-\\uA6EF\\uA717-\\uA71F\\uA722-\\uA788\\uA78B-\\uA78E\\uA790-\\uA7AD\\uA7B0\\uA7B1\\uA7F7-\\uA801\\uA803-\\uA805\\uA807-\\uA80A\\uA80C-\\uA822\\uA840-\\uA873\\uA882-\\uA8B3\\uA8F2-\\uA8F7\\uA8FB\\uA90A-\\uA925\\uA930-\\uA946\\uA960-\\uA97C\\uA984-\\uA9B2\\uA9CF\\uA9E0-\\uA9E4\\uA9E6-\\uA9EF\\uA9FA-\\uA9FE\\uAA00-\\uAA28\\uAA40-\\uAA42\\uAA44-\\uAA4B\\uAA60-\\uAA76\\uAA7A\\uAA7E-\\uAAAF\\uAAB1\\uAAB5\\uAAB6\\uAAB9-\\uAABD\\uAAC0\\uAAC2\\uAADB-\\uAADD\\uAAE0-\\uAAEA\\uAAF2-\\uAAF4\\uAB01-\\uAB06\\uAB09-\\uAB0E\\uAB11-\\uAB16\\uAB20-\\uAB26\\uAB28-\\uAB2E\\uAB30-\\uAB5A\\uAB5C-\\uAB5F\\uAB64\\uAB65\\uABC0-\\uABE2\\uAC00-\\uD7A3\\uD7B0-\\uD7C6\\uD7CB-\\uD7FB\\uF900-\\uFA6D\\uFA70-\\uFAD9\\uFB00-\\uFB06\\uFB13-\\uFB17\\uFB1D\\uFB1F-\\uFB28\\uFB2A-\\uFB36\\uFB38-\\uFB3C\\uFB3E\\uFB40\\uFB41\\uFB43\\uFB44\\uFB46-\\uFBB1\\uFBD3-\\uFD3D\\uFD50-\\uFD8F\\uFD92-\\uFDC7\\uFDF0-\\uFDFB\\uFE70-\\uFE74\\uFE76-\\uFEFC\\uFF21-\\uFF3A\\uFF41-\\uFF5A\\uFF66-\\uFFBE\\uFFC2-\\uFFC7\\uFFCA-\\uFFCF\\uFFD2-\\uFFD7\\uFFDA-\\uFFDC]"),wFt=new RegExp("[\\xAA\\xB5\\xBA\\xC0-\\xD6\\xD8-\\xF6\\xF8-\\u02C1\\u02C6-\\u02D1\\u02E0-\\u02E4\\u02EC\\u02EE\\u0300-\\u0374\\u0376\\u0377\\u037A-\\u037D\\u037F\\u0386\\u0388-\\u038A\\u038C\\u038E-\\u03A1\\u03A3-\\u03F5\\u03F7-\\u0481\\u0483-\\u0487\\u048A-\\u052F\\u0531-\\u0556\\u0559\\u0561-\\u0587\\u0591-\\u05BD\\u05BF\\u05C1\\u05C2\\u05C4\\u05C5\\u05C7\\u05D0-\\u05EA\\u05F0-\\u05F2\\u0610-\\u061A\\u0620-\\u0669\\u066E-\\u06D3\\u06D5-\\u06DC\\u06DF-\\u06E8\\u06EA-\\u06FC\\u06FF\\u0710-\\u074A\\u074D-\\u07B1\\u07C0-\\u07F5\\u07FA\\u0800-\\u082D\\u0840-\\u085B\\u08A0-\\u08B2\\u08E4-\\u0963\\u0966-\\u096F\\u0971-\\u0983\\u0985-\\u098C\\u098F\\u0990\\u0993-\\u09A8\\u09AA-\\u09B0\\u09B2\\u09B6-\\u09B9\\u09BC-\\u09C4\\u09C7\\u09C8\\u09CB-\\u09CE\\u09D7\\u09DC\\u09DD\\u09DF-\\u09E3\\u09E6-\\u09F1\\u0A01-\\u0A03\\u0A05-\\u0A0A\\u0A0F\\u0A10\\u0A13-\\u0A28\\u0A2A-\\u0A30\\u0A32\\u0A33\\u0A35\\u0A36\\u0A38\\u0A39\\u0A3C\\u0A3E-\\u0A42\\u0A47\\u0A48\\u0A4B-\\u0A4D\\u0A51\\u0A59-\\u0A5C\\u0A5E\\u0A66-\\u0A75\\u0A81-\\u0A83\\u0A85-\\u0A8D\\u0A8F-\\u0A91\\u0A93-\\u0AA8\\u0AAA-\\u0AB0\\u0AB2\\u0AB3\\u0AB5-\\u0AB9\\u0ABC-\\u0AC5\\u0AC7-\\u0AC9\\u0ACB-\\u0ACD\\u0AD0\\u0AE0-\\u0AE3\\u0AE6-\\u0AEF\\u0B01-\\u0B03\\u0B05-\\u0B0C\\u0B0F\\u0B10\\u0B13-\\u0B28\\u0B2A-\\u0B30\\u0B32\\u0B33\\u0B35-\\u0B39\\u0B3C-\\u0B44\\u0B47\\u0B48\\u0B4B-\\u0B4D\\u0B56\\u0B57\\u0B5C\\u0B5D\\u0B5F-\\u0B63\\u0B66-\\u0B6F\\u0B71\\u0B82\\u0B83\\u0B85-\\u0B8A\\u0B8E-\\u0B90\\u0B92-\\u0B95\\u0B99\\u0B9A\\u0B9C\\u0B9E\\u0B9F\\u0BA3\\u0BA4\\u0BA8-\\u0BAA\\u0BAE-\\u0BB9\\u0BBE-\\u0BC2\\u0BC6-\\u0BC8\\u0BCA-\\u0BCD\\u0BD0\\u0BD7\\u0BE6-\\u0BEF\\u0C00-\\u0C03\\u0C05-\\u0C0C\\u0C0E-\\u0C10\\u0C12-\\u0C28\\u0C2A-\\u0C39\\u0C3D-\\u0C44\\u0C46-\\u0C48\\u0C4A-\\u0C4D\\u0C55\\u0C56\\u0C58\\u0C59\\u0C60-\\u0C63\\u0C66-\\u0C6F\\u0C81-\\u0C83\\u0C85-\\u0C8C\\u0C8E-\\u0C90\\u0C92-\\u0CA8\\u0CAA-\\u0CB3\\u0CB5-\\u0CB9\\u0CBC-\\u0CC4\\u0CC6-\\u0CC8\\u0CCA-\\u0CCD\\u0CD5\\u0CD6\\u0CDE\\u0CE0-\\u0CE3\\u0CE6-\\u0CEF\\u0CF1\\u0CF2\\u0D01-\\u0D03\\u0D05-\\u0D0C\\u0D0E-\\u0D10\\u0D12-\\u0D3A\\u0D3D-\\u0D44\\u0D46-\\u0D48\\u0D4A-\\u0D4E\\u0D57\\u0D60-\\u0D63\\u0D66-\\u0D6F\\u0D7A-\\u0D7F\\u0D82\\u0D83\\u0D85-\\u0D96\\u0D9A-\\u0DB1\\u0DB3-\\u0DBB\\u0DBD\\u0DC0-\\u0DC6\\u0DCA\\u0DCF-\\u0DD4\\u0DD6\\u0DD8-\\u0DDF\\u0DE6-\\u0DEF\\u0DF2\\u0DF3\\u0E01-\\u0E3A\\u0E40-\\u0E4E\\u0E50-\\u0E59\\u0E81\\u0E82\\u0E84\\u0E87\\u0E88\\u0E8A\\u0E8D\\u0E94-\\u0E97\\u0E99-\\u0E9F\\u0EA1-\\u0EA3\\u0EA5\\u0EA7\\u0EAA\\u0EAB\\u0EAD-\\u0EB9\\u0EBB-\\u0EBD\\u0EC0-\\u0EC4\\u0EC6\\u0EC8-\\u0ECD\\u0ED0-\\u0ED9\\u0EDC-\\u0EDF\\u0F00\\u0F18\\u0F19\\u0F20-\\u0F29\\u0F35\\u0F37\\u0F39\\u0F3E-\\u0F47\\u0F49-\\u0F6C\\u0F71-\\u0F84\\u0F86-\\u0F97\\u0F99-\\u0FBC\\u0FC6\\u1000-\\u1049\\u1050-\\u109D\\u10A0-\\u10C5\\u10C7\\u10CD\\u10D0-\\u10FA\\u10FC-\\u1248\\u124A-\\u124D\\u1250-\\u1256\\u1258\\u125A-\\u125D\\u1260-\\u1288\\u128A-\\u128D\\u1290-\\u12B0\\u12B2-\\u12B5\\u12B8-\\u12BE\\u12C0\\u12C2-\\u12C5\\u12C8-\\u12D6\\u12D8-\\u1310\\u1312-\\u1315\\u1318-\\u135A\\u135D-\\u135F\\u1380-\\u138F\\u13A0-\\u13F4\\u1401-\\u166C\\u166F-\\u167F\\u1681-\\u169A\\u16A0-\\u16EA\\u16EE-\\u16F8\\u1700-\\u170C\\u170E-\\u1714\\u1720-\\u1734\\u1740-\\u1753\\u1760-\\u176C\\u176E-\\u1770\\u1772\\u1773\\u1780-\\u17D3\\u17D7\\u17DC\\u17DD\\u17E0-\\u17E9\\u180B-\\u180D\\u1810-\\u1819\\u1820-\\u1877\\u1880-\\u18AA\\u18B0-\\u18F5\\u1900-\\u191E\\u1920-\\u192B\\u1930-\\u193B\\u1946-\\u196D\\u1970-\\u1974\\u1980-\\u19AB\\u19B0-\\u19C9\\u19D0-\\u19D9\\u1A00-\\u1A1B\\u1A20-\\u1A5E\\u1A60-\\u1A7C\\u1A7F-\\u1A89\\u1A90-\\u1A99\\u1AA7\\u1AB0-\\u1ABD\\u1B00-\\u1B4B\\u1B50-\\u1B59\\u1B6B-\\u1B73\\u1B80-\\u1BF3\\u1C00-\\u1C37\\u1C40-\\u1C49\\u1C4D-\\u1C7D\\u1CD0-\\u1CD2\\u1CD4-\\u1CF6\\u1CF8\\u1CF9\\u1D00-\\u1DF5\\u1DFC-\\u1F15\\u1F18-\\u1F1D\\u1F20-\\u1F45\\u1F48-\\u1F4D\\u1F50-\\u1F57\\u1F59\\u1F5B\\u1F5D\\u1F5F-\\u1F7D\\u1F80-\\u1FB4\\u1FB6-\\u1FBC\\u1FBE\\u1FC2-\\u1FC4\\u1FC6-\\u1FCC\\u1FD0-\\u1FD3\\u1FD6-\\u1FDB\\u1FE0-\\u1FEC\\u1FF2-\\u1FF4\\u1FF6-\\u1FFC\\u200C\\u200D\\u203F\\u2040\\u2054\\u2071\\u207F\\u2090-\\u209C\\u20D0-\\u20DC\\u20E1\\u20E5-\\u20F0\\u2102\\u2107\\u210A-\\u2113\\u2115\\u2119-\\u211D\\u2124\\u2126\\u2128\\u212A-\\u212D\\u212F-\\u2139\\u213C-\\u213F\\u2145-\\u2149\\u214E\\u2160-\\u2188\\u2C00-\\u2C2E\\u2C30-\\u2C5E\\u2C60-\\u2CE4\\u2CEB-\\u2CF3\\u2D00-\\u2D25\\u2D27\\u2D2D\\u2D30-\\u2D67\\u2D6F\\u2D7F-\\u2D96\\u2DA0-\\u2DA6\\u2DA8-\\u2DAE\\u2DB0-\\u2DB6\\u2DB8-\\u2DBE\\u2DC0-\\u2DC6\\u2DC8-\\u2DCE\\u2DD0-\\u2DD6\\u2DD8-\\u2DDE\\u2DE0-\\u2DFF\\u2E2F\\u3005-\\u3007\\u3021-\\u302F\\u3031-\\u3035\\u3038-\\u303C\\u3041-\\u3096\\u3099\\u309A\\u309D-\\u309F\\u30A1-\\u30FA\\u30FC-\\u30FF\\u3105-\\u312D\\u3131-\\u318E\\u31A0-\\u31BA\\u31F0-\\u31FF\\u3400-\\u4DB5\\u4E00-\\u9FCC\\uA000-\\uA48C\\uA4D0-\\uA4FD\\uA500-\\uA60C\\uA610-\\uA62B\\uA640-\\uA66F\\uA674-\\uA67D\\uA67F-\\uA69D\\uA69F-\\uA6F1\\uA717-\\uA71F\\uA722-\\uA788\\uA78B-\\uA78E\\uA790-\\uA7AD\\uA7B0\\uA7B1\\uA7F7-\\uA827\\uA840-\\uA873\\uA880-\\uA8C4\\uA8D0-\\uA8D9\\uA8E0-\\uA8F7\\uA8FB\\uA900-\\uA92D\\uA930-\\uA953\\uA960-\\uA97C\\uA980-\\uA9C0\\uA9CF-\\uA9D9\\uA9E0-\\uA9FE\\uAA00-\\uAA36\\uAA40-\\uAA4D\\uAA50-\\uAA59\\uAA60-\\uAA76\\uAA7A-\\uAAC2\\uAADB-\\uAADD\\uAAE0-\\uAAEF\\uAAF2-\\uAAF6\\uAB01-\\uAB06\\uAB09-\\uAB0E\\uAB11-\\uAB16\\uAB20-\\uAB26\\uAB28-\\uAB2E\\uAB30-\\uAB5A\\uAB5C-\\uAB5F\\uAB64\\uAB65\\uABC0-\\uABEA\\uABEC\\uABED\\uABF0-\\uABF9\\uAC00-\\uD7A3\\uD7B0-\\uD7C6\\uD7CB-\\uD7FB\\uF900-\\uFA6D\\uFA70-\\uFAD9\\uFB00-\\uFB06\\uFB13-\\uFB17\\uFB1D-\\uFB28\\uFB2A-\\uFB36\\uFB38-\\uFB3C\\uFB3E\\uFB40\\uFB41\\uFB43\\uFB44\\uFB46-\\uFBB1\\uFBD3-\\uFD3D\\uFD50-\\uFD8F\\uFD92-\\uFDC7\\uFDF0-\\uFDFB\\uFE00-\\uFE0F\\uFE20-\\uFE2D\\uFE33\\uFE34\\uFE4D-\\uFE4F\\uFE70-\\uFE74\\uFE76-\\uFEFC\\uFF10-\\uFF19\\uFF21-\\uFF3A\\uFF3F\\uFF41-\\uFF5A\\uFF66-\\uFFBE\\uFFC2-\\uFFC7\\uFFCA-\\uFFCF\\uFFD2-\\uFFD7\\uFFDA-\\uFFDC]");function HB(t,e){if(!t)throw new Error("ASSERT: "+e)}function Ip(t){return t>=48&&t<=57}function Roe(t){return"0123456789abcdefABCDEF".includes(t)}function hk(t){return"01234567".includes(t)}function _Ft(t){return t===32||t===9||t===11||t===12||t===160||t>=5760&&[5760,6158,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8239,8287,12288,65279].includes(t)}function jA(t){return t===10||t===13||t===8232||t===8233}function PR(t){return t===36||t===95||t>=65&&t<=90||t>=97&&t<=122||t===92||t>=128&&bFt.test(String.fromCharCode(t))}function w5(t){return t===36||t===95||t>=65&&t<=90||t>=97&&t<=122||t>=48&&t<=57||t===92||t>=128&&wFt.test(String.fromCharCode(t))}const SFt={if:1,in:1,do:1,var:1,for:1,new:1,try:1,let:1,this:1,else:1,case:1,void:1,with:1,enum:1,while:1,break:1,catch:1,throw:1,const:1,yield:1,class:1,super:1,return:1,typeof:1,delete:1,switch:1,export:1,import:1,public:1,static:1,default:1,finally:1,extends:1,package:1,private:1,function:1,continue:1,debugger:1,interface:1,protected:1,instanceof:1,implements:1};function aze(){for(;ze1114111||t!=="}")&&Zn({},Fo,ps),e<=65535?String.fromCharCode(e):(n=(e-65536>>10)+55296,r=(e-65536&1023)+56320,String.fromCharCode(n,r))}function lze(){var t,e;for(t=Pt.charCodeAt(ze++),e=String.fromCharCode(t),t===92&&(Pt.charCodeAt(ze)!==117&&Zn({},Fo,ps),++ze,t=vY("u"),(!t||t==="\\"||!PR(t.charCodeAt(0)))&&Zn({},Fo,ps),e=t);ze>>=")return ze+=4,{type:Ha,value:s,start:t,end:ze};if(o=s.substr(0,3),o===">>>"||o==="<<="||o===">>=")return ze+=3,{type:Ha,value:o,start:t,end:ze};if(i=o.substr(0,2),r===i[1]&&"+-<>&|".includes(r)||i==="=>")return ze+=2,{type:Ha,value:i,start:t,end:ze};if(i==="//"&&Zn({},Fo,ps),"<>=!+-*%&|^/".includes(r))return++ze,{type:Ha,value:r,start:t,end:ze};Zn({},Fo,ps)}function TFt(t){let e="";for(;ze{if(parseInt(i,16)<=1114111)return"x";Zn({},mY)}).replace(/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,"x"));try{new RegExp(n)}catch{Zn({},mY)}try{return new RegExp(t,e)}catch{return null}}function MFt(){var t,e,n,r,i;for(t=Pt[ze],HB(t==="/","Regular expression literal must start with a slash"),e=Pt[ze++],n=!1,r=!1;ze=0&&Zn({},mY,n),{value:n,literal:e}}function DFt(){var t,e,n,r;return xr=null,aze(),t=ze,e=MFt(),n=RFt(),r=PFt(e.value,n.value),{literal:e.literal+n.literal,value:r,regex:{pattern:e.value,flags:n.value},start:t,end:ze}}function IFt(t){return t.type===yb||t.type===Gy||t.type===VB||t.type===GB}function cze(){if(aze(),ze>=Ks)return{type:kR,start:ze,end:ze};const t=Pt.charCodeAt(ze);return PR(t)?EFt():t===40||t===41||t===59?PV():t===39||t===34?AFt():t===46?Ip(Pt.charCodeAt(ze+1))?vve():PV():Ip(t)?vve():PV()}function nl(){const t=xr;return ze=t.end,xr=cze(),ze=t.end,t}function uze(){const t=ze;xr=cze(),ze=t}function LFt(t){const e=new td(iFt);return e.elements=t,e}function yve(t,e,n){const r=new td(t==="||"||t==="&&"?cFt:oFt);return r.operator=t,r.left=e,r.right=n,r}function $Ft(t,e){const n=new td(sFt);return n.callee=t,n.arguments=e,n}function FFt(t,e,n){const r=new td(aFt);return r.test=t,r.consequent=e,r.alternate=n,r}function Doe(t){const e=new td(oze);return e.name=t,e}function xT(t){const e=new td(lFt);return e.value=t.value,e.raw=Pt.slice(t.start,t.end),t.regex&&(e.raw==="//"&&(e.raw="/(?:)/"),e.regex=t.regex),e}function xve(t,e,n){const r=new td(uFt);return r.computed=t==="[",r.object=e,r.property=n,r.computed||(n.member=!0),r}function NFt(t){const e=new td(fFt);return e.properties=t,e}function bve(t,e,n){const r=new td(dFt);return r.key=e,r.value=n,r.kind=t,r}function zFt(t,e){const n=new td(hFt);return n.operator=t,n.argument=e,n.prefix=!0,n}function Zn(t,e){var n,r=Array.prototype.slice.call(arguments,2),i=e.replace(/%(\d)/g,(o,s)=>(HB(s":case"<=":case">=":case"instanceof":case"in":e=7;break;case"<<":case">>":case">>>":e=8;break;case"+":case"-":e=9;break;case"*":case"/":case"%":e=11;break}return e}function KFt(){var t,e,n,r,i,o,s,a,l,c;if(t=xr,l=T3(),r=xr,i=Sve(r),i===0)return l;for(r.prec=i,nl(),e=[t,xr],s=T3(),o=[l,r,s];(i=Sve(xr))>0;){for(;o.length>2&&i<=o[o.length-2].prec;)s=o.pop(),a=o.pop().value,l=o.pop(),e.pop(),n=yve(a,l,s),o.push(n);r=nl(),r.prec=i,o.push(r),e.push(xr),n=T3(),o.push(n)}for(c=o.length-1,n=o[c],e.pop();c>1;)e.pop(),n=yve(o[c-1].value,o[c-2],n),c-=2;return n}function xb(){var t,e,n;return t=KFt(),Zr("?")&&(nl(),e=xb(),Zs(":"),n=xb(),t=FFt(t,e,n)),t}function Ioe(){const t=xb();if(Zr(","))throw new Error(zA);return t}function Loe(t){Pt=t,ze=0,Ks=Pt.length,xr=null,uze();const e=Ioe();if(xr.type!==kR)throw new Error("Unexpect token after expression.");return e}var fze={NaN:"NaN",E:"Math.E",LN2:"Math.LN2",LN10:"Math.LN10",LOG2E:"Math.LOG2E",LOG10E:"Math.LOG10E",PI:"Math.PI",SQRT1_2:"Math.SQRT1_2",SQRT2:"Math.SQRT2",MIN_VALUE:"Number.MIN_VALUE",MAX_VALUE:"Number.MAX_VALUE"};function dze(t){function e(s,a,l,c){let u=t(a[0]);return l&&(u=l+"("+u+")",l.lastIndexOf("new ",0)===0&&(u="("+u+")")),u+"."+s+(c<0?"":c===0?"()":"("+a.slice(1).map(t).join(",")+")")}function n(s,a,l){return c=>e(s,c,a,l)}const r="new Date",i="String",o="RegExp";return{isNaN:"Number.isNaN",isFinite:"Number.isFinite",abs:"Math.abs",acos:"Math.acos",asin:"Math.asin",atan:"Math.atan",atan2:"Math.atan2",ceil:"Math.ceil",cos:"Math.cos",exp:"Math.exp",floor:"Math.floor",hypot:"Math.hypot",log:"Math.log",max:"Math.max",min:"Math.min",pow:"Math.pow",random:"Math.random",round:"Math.round",sin:"Math.sin",sqrt:"Math.sqrt",tan:"Math.tan",clamp:function(s){s.length<3&&je("Missing arguments to clamp function."),s.length>3&&je("Too many arguments to clamp function.");const a=s.map(t);return"Math.max("+a[1]+", Math.min("+a[2]+","+a[0]+"))"},now:"Date.now",utc:"Date.UTC",datetime:r,date:n("getDate",r,0),day:n("getDay",r,0),year:n("getFullYear",r,0),month:n("getMonth",r,0),hours:n("getHours",r,0),minutes:n("getMinutes",r,0),seconds:n("getSeconds",r,0),milliseconds:n("getMilliseconds",r,0),time:n("getTime",r,0),timezoneoffset:n("getTimezoneOffset",r,0),utcdate:n("getUTCDate",r,0),utcday:n("getUTCDay",r,0),utcyear:n("getUTCFullYear",r,0),utcmonth:n("getUTCMonth",r,0),utchours:n("getUTCHours",r,0),utcminutes:n("getUTCMinutes",r,0),utcseconds:n("getUTCSeconds",r,0),utcmilliseconds:n("getUTCMilliseconds",r,0),length:n("length",null,-1),parseFloat:"parseFloat",parseInt:"parseInt",upper:n("toUpperCase",i,0),lower:n("toLowerCase",i,0),substring:n("substring",i),split:n("split",i),trim:n("trim",i,0),regexp:o,test:n("test",o),if:function(s){s.length<3&&je("Missing arguments to if function."),s.length>3&&je("Too many arguments to if function.");const a=s.map(t);return"("+a[0]+"?"+a[1]+":"+a[2]+")"}}}function ZFt(t){const e=t&&t.length-1;return e&&(t[0]==='"'&&t[e]==='"'||t[0]==="'"&&t[e]==="'")?t.slice(1,-1):t}function hze(t){t=t||{};const e=t.allowed?Wf(t.allowed):{},n=t.forbidden?Wf(t.forbidden):{},r=t.constants||fze,i=(t.functions||dze)(f),o=t.globalvar,s=t.fieldvar,a=fn(o)?o:p=>`${o}["${p}"]`;let l={},c={},u=0;function f(p){if(gt(p))return p;const g=d[p.type];return g==null&&je("Unsupported type: "+p.type),g(p)}const d={Literal:p=>p.raw,Identifier:p=>{const g=p.name;return u>0?g:vt(n,g)?je("Illegal identifier: "+g):vt(r,g)?r[g]:vt(e,g)?g:(l[g]=1,a(g))},MemberExpression:p=>{const g=!p.computed,m=f(p.object);g&&(u+=1);const v=f(p.property);return m===s&&(c[ZFt(v)]=1),g&&(u-=1),m+(g?"."+v:"["+v+"]")},CallExpression:p=>{p.callee.type!=="Identifier"&&je("Illegal callee type: "+p.callee.type);const g=p.callee.name,m=p.arguments,v=vt(i,g)&&i[g];return v||je("Unrecognized function: "+g),fn(v)?v(m):v+"("+m.map(f).join(",")+")"},ArrayExpression:p=>"["+p.elements.map(f).join(",")+"]",BinaryExpression:p=>"("+f(p.left)+" "+p.operator+" "+f(p.right)+")",UnaryExpression:p=>"("+p.operator+f(p.argument)+")",ConditionalExpression:p=>"("+f(p.test)+"?"+f(p.consequent)+":"+f(p.alternate)+")",LogicalExpression:p=>"("+f(p.left)+p.operator+f(p.right)+")",ObjectExpression:p=>"{"+p.properties.map(f).join(",")+"}",Property:p=>{u+=1;const g=f(p.key);return u-=1,g+":"+f(p.value)}};function h(p){const g={code:f(p),globals:Object.keys(l),fields:Object.keys(c)};return l={},c={},g}return h.functions=i,h.constants=r,h}const Cve=Symbol("vega_selection_getter");function pze(t){return(!t.getter||!t.getter[Cve])&&(t.getter=Eu(t.field),t.getter[Cve]=!0),t.getter}const $oe="intersect",Ove="union",JFt="vlMulti",eNt="vlPoint",Eve="or",tNt="and",Dd="_vgsid_",BA=Eu(Dd),nNt="E",rNt="R",iNt="R-E",oNt="R-LE",sNt="R-RE",_5="index:unit";function Tve(t,e){for(var n=e.fields,r=e.values,i=n.length,o=0,s,a;ocn(e.fields?{values:e.fields.map(r=>pze(r)(n.datum))}:{[Dd]:BA(n.datum)},e))}function dNt(t,e,n,r){for(var i=this.context.data[t],o=i?i.values.value:[],s={},a={},l={},c,u,f,d,h,p,g,m,v,y,x=o.length,b=0,w,_;b(S[u[k].field]=O,S),{})))}else h=Dd,p=BA(c),g=s[h]||(s[h]={}),m=g[d]||(g[d]=[]),m.push(p),n&&(m=a[d]||(a[d]=[]),m.push({[Dd]:p}));if(e=e||Ove,s[Dd]?s[Dd]=RV[`${Dd}_${e}`](...Object.values(s[Dd])):Object.keys(s).forEach(S=>{s[S]=Object.keys(s[S]).map(O=>s[S][O]).reduce((O,k)=>O===void 0?k:RV[`${l[S]}_${e}`](O,k))}),o=Object.keys(a),n&&o.length){const S=r?eNt:JFt;s[S]=e===Ove?{[Eve]:o.reduce((O,k)=>(O.push(...a[k]),O),[])}:{[tNt]:o.map(O=>({[Eve]:a[O]}))}}return s}var RV={[`${Dd}_union`]:rCt,[`${Dd}_intersect`]:tCt,E_union:function(t,e){if(!t.length)return e;for(var n=0,r=e.length;ne.indexOf(n)>=0):e},R_union:function(t,e){var n=qs(e[0]),r=qs(e[1]);return n>r&&(n=e[1],r=e[0]),t.length?(t[0]>n&&(t[0]=n),t[1]r&&(n=e[1],r=e[0]),t.length?rr&&(t[1]=r),t):[n,r]}};const hNt=":",pNt="@";function Foe(t,e,n,r){e[0].type!==vb&&je("First argument to selection functions must be a string literal.");const i=e[0].value,o=e.length>=2&&$n(e).value,s="unit",a=pNt+s,l=hNt+i;o===$oe&&!vt(r,a)&&(r[a]=n.getData(i).indataRef(n,s)),vt(r,l)||(r[l]=n.getData(i).tuplesRef())}function mze(t){const e=this.context.data[t];return e?e.values.value:[]}function gNt(t,e,n){const r=this.context.data[t]["index:"+e],i=r?r.value.get(n):void 0;return i&&i.count}function mNt(t,e){const n=this.context.dataflow,r=this.context.data[t],i=r.input;return n.pulse(i,n.changeset().remove(Tu).insert(e)),1}function vNt(t,e,n){if(t){const r=this.context.dataflow,i=t.mark.source;r.pulse(i,r.changeset().encode(t,e))}return n!==void 0?n:t}const MR=t=>function(e,n){const r=this.context.dataflow.locale();return e===null?"null":r[t](n)(e)},yNt=MR("format"),vze=MR("timeFormat"),xNt=MR("utcFormat"),bNt=MR("timeParse"),wNt=MR("utcParse"),YI=new Date(2e3,0,1);function XB(t,e,n){return!Number.isInteger(t)||!Number.isInteger(e)?"":(YI.setYear(2e3),YI.setMonth(t),YI.setDate(e),vze.call(this,YI,n))}function _Nt(t){return XB.call(this,t,1,"%B")}function SNt(t){return XB.call(this,t,1,"%b")}function CNt(t){return XB.call(this,0,2+t,"%A")}function ONt(t){return XB.call(this,0,2+t,"%a")}const ENt=":",TNt="@",yY="%",yze="$";function Noe(t,e,n,r){e[0].type!==vb&&je("First argument to data functions must be a string literal.");const i=e[0].value,o=ENt+i;if(!vt(o,r))try{r[o]=n.getData(i).tuplesRef()}catch{}}function kNt(t,e,n,r){e[0].type!==vb&&je("First argument to indata must be a string literal."),e[1].type!==vb&&je("Second argument to indata must be a string literal.");const i=e[0].value,o=e[1].value,s=TNt+o;vt(s,r)||(r[s]=n.getData(i).indataRef(n,o))}function Oa(t,e,n,r){if(e[0].type===vb)kve(n,r,e[0].value);else for(t in n.scales)kve(n,r,t)}function kve(t,e,n){const r=yY+n;if(!vt(e,r))try{e[r]=t.scaleRef(n)}catch{}}function Wh(t,e){if(fn(t))return t;if(gt(t)){const n=e.scales[t];return n&&zkt(n.value)?n.value:void 0}}function ANt(t,e,n){e.__bandwidth=i=>i&&i.bandwidth?i.bandwidth():0,n._bandwidth=Oa,n._range=Oa,n._scale=Oa;const r=i=>"_["+(i.type===vb?rt(yY+i.value):rt(yY)+"+"+t(i))+"]";return{_bandwidth:i=>`this.__bandwidth(${r(i[0])})`,_range:i=>`${r(i[0])}.range()`,_scale:i=>`${r(i[0])}(${t(i[1])})`}}function zoe(t,e){return function(n,r,i){if(n){const o=Wh(n,(i||this).context);return o&&o.path[t](r)}else return e(r)}}const PNt=zoe("area",eDt),MNt=zoe("bounds",iDt),RNt=zoe("centroid",uDt);function DNt(t,e){const n=Wh(t,(e||this).context);return n&&n.scale()}function INt(t){const e=this.context.group;let n=!1;if(e)for(;t;){if(t===e){n=!0;break}t=t.mark.group}return n}function joe(t,e,n){try{t[e].apply(t,["EXPRESSION"].concat([].slice.call(n)))}catch(r){t.warn(r)}return n[n.length-1]}function LNt(){return joe(this.context.dataflow,"warn",arguments)}function $Nt(){return joe(this.context.dataflow,"info",arguments)}function FNt(){return joe(this.context.dataflow,"debug",arguments)}function DV(t){const e=t/255;return e<=.03928?e/12.92:Math.pow((e+.055)/1.055,2.4)}function xY(t){const e=sy(t),n=DV(e.r),r=DV(e.g),i=DV(e.b);return .2126*n+.7152*r+.0722*i}function NNt(t,e){const n=xY(t),r=xY(e),i=Math.max(n,r),o=Math.min(n,r);return(i+.05)/(o+.05)}function zNt(){const t=[].slice.call(arguments);return t.unshift({}),cn(...t)}function xze(t,e){return t===e||t!==t&&e!==e?!0:We(t)?We(e)&&t.length===e.length?jNt(t,e):!1:ht(t)&&ht(e)?bze(t,e):!1}function jNt(t,e){for(let n=0,r=t.length;nbze(t,e)}function BNt(t,e,n,r,i,o){const s=this.context.dataflow,a=this.context.data[t],l=a.input,c=s.stamp();let u=a.changes,f,d;if(s._trigger===!1||!(l.value.length||e||r))return 0;if((!u||u.stamp{a.modified=!0,s.pulse(l,u).run()},!0,1)),n&&(f=n===!0?Tu:We(n)||J4(n)?n:Ave(n),u.remove(f)),e&&u.insert(e),r&&(f=Ave(r),l.value.some(f)?u.remove(f):u.insert(r)),i)for(d in o)u.modify(i,d,o[d]);return 1}function UNt(t){const e=t.touches,n=e[0].clientX-e[1].clientX,r=e[0].clientY-e[1].clientY;return Math.hypot(n,r)}function WNt(t){const e=t.touches;return Math.atan2(e[0].clientY-e[1].clientY,e[0].clientX-e[1].clientX)}const Pve={};function VNt(t,e){const n=Pve[e]||(Pve[e]=Eu(e));return We(t)?t.map(n):n(t)}function Boe(t){return We(t)||ArrayBuffer.isView(t)?t:null}function Uoe(t){return Boe(t)||(gt(t)?t:null)}function GNt(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r1?e-1:0),r=1;r1?e-1:0),r=1;r1?e-1:0),r=1;ro.stop(c(u),t(u))),o}function o5t(t,e,n){const r=Wh(t,(n||this).context);return function(i){return r?r.path.context(i)(e):""}}function s5t(t){let e=null;return function(n){return n?MA(n,e=e||jS(t)):t}}const wze=t=>t.data;function _ze(t,e){const n=mze.call(e,t);return n.root&&n.root.lookup||{}}function a5t(t,e,n){const r=_ze(t,this),i=r[e],o=r[n];return i&&o?i.path(o).map(wze):void 0}function l5t(t,e){const n=_ze(t,this)[e];return n?n.ancestors().map(wze):void 0}const Sze=()=>typeof window<"u"&&window||null;function c5t(){const t=Sze();return t?t.screen:{}}function u5t(){const t=Sze();return t?[t.innerWidth,t.innerHeight]:[void 0,void 0]}function f5t(){const t=this.context.dataflow,e=t.container&&t.container();return e?[e.clientWidth,e.clientHeight]:[void 0,void 0]}function Cze(t,e,n){if(!t)return[];const[r,i]=t,o=new uo().set(r[0],r[1],i[0],i[1]),s=n||this.context.dataflow.scenegraph().root;return aNe(s,o,d5t(e))}function d5t(t){let e=null;if(t){const n=pt(t.marktype),r=pt(t.markname);e=i=>(!n.length||n.some(o=>i.marktype===o))&&(!r.length||r.some(o=>i.name===o))}return e}function h5t(t,e,n){let r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:5;t=pt(t);const i=t[t.length-1];return i===void 0||Math.hypot(i[0]-e,i[1]-n)>r?[...t,[e,n]]:t}function p5t(t){return pt(t).reduce((e,n,r)=>{let[i,o]=n;return e+=r==0?`M ${i},${o} `:r===t.length-1?" Z":`L ${i},${o} `},"")}function g5t(t,e,n){const{x:r,y:i,mark:o}=n,s=new uo().set(Number.MAX_SAFE_INTEGER,Number.MAX_SAFE_INTEGER,Number.MIN_SAFE_INTEGER,Number.MIN_SAFE_INTEGER);for(const[l,c]of e)ls.x2&&(s.x2=l),cs.y2&&(s.y2=c);return s.translate(r,i),Cze([[s.x1,s.y1],[s.x2,s.y2]],t,o).filter(l=>m5t(l.x,l.y,e))}function m5t(t,e,n){let r=0;for(let i=0,o=n.length-1;ie!=a>e&&t<(s-l)*(e-c)/(a-c)+l&&r++}return r&1}const UA={random(){return Au()},cumulativeNormal:iB,cumulativeLogNormal:Vne,cumulativeUniform:Xne,densityNormal:zne,densityLogNormal:Wne,densityUniform:qne,quantileNormal:oB,quantileLogNormal:Gne,quantileUniform:Yne,sampleNormal:rB,sampleLogNormal:Une,sampleUniform:Hne,isArray:We,isBoolean:jy,isDate:Fv,isDefined(t){return t!==void 0},isNumber:Jn,isObject:ht,isRegExp:TIe,isString:gt,isTuple:J4,isValid(t){return t!=null&&t===t},toBoolean:yne,toDate(t){return xne(t)},toNumber:qs,toString:bne,indexof:HNt,join:GNt,lastindexof:qNt,replace:YNt,reverse:QNt,slice:XNt,flush:OIe,lerp:kIe,merge:zNt,pad:MIe,peek:$n,pluck:VNt,span:tR,inrange:i_,truncate:RIe,rgb:sy,lab:TN,hcl:kN,hsl:ON,luminance:xY,contrast:NNt,sequence:ol,format:yNt,utcFormat:xNt,utcParse:wNt,utcOffset:fLe,utcSequence:pLe,timeFormat:vze,timeParse:bNt,timeOffset:uLe,timeSequence:hLe,timeUnitSpecifier:JIe,monthFormat:_Nt,monthAbbrevFormat:SNt,dayFormat:CNt,dayAbbrevFormat:ONt,quarter:wIe,utcquarter:_Ie,week:tLe,utcweek:iLe,dayofyear:eLe,utcdayofyear:rLe,warn:LNt,info:$Nt,debug:FNt,extent(t){return Sh(t)},inScope:INt,intersect:Cze,clampRange:SIe,pinchDistance:UNt,pinchAngle:WNt,screen:c5t,containerSize:f5t,windowSize:u5t,bandspace:KNt,setdata:mNt,pathShape:s5t,panLinear:vIe,panLog:yIe,panPow:xIe,panSymlog:bIe,zoomLinear:dne,zoomLog:hne,zoomPow:uN,zoomSymlog:pne,encode:vNt,modify:BNt,lassoAppend:h5t,lassoPath:p5t,intersectLasso:g5t},v5t=["view","item","group","xy","x","y"],y5t="event.vega.",Oze="this.",Woe={},Eze={forbidden:["_"],allowed:["datum","event","item"],fieldvar:"datum",globalvar:t=>`_[${rt(yze+t)}]`,functions:x5t,constants:fze,visitors:Woe},bY=hze(Eze);function x5t(t){const e=dze(t);v5t.forEach(n=>e[n]=y5t+n);for(const n in UA)e[n]=Oze+n;return cn(e,ANt(t,UA,Woe)),e}function Ki(t,e,n){return arguments.length===1?UA[t]:(UA[t]=e,n&&(Woe[t]=n),bY&&(bY.functions[t]=Oze+t),this)}Ki("bandwidth",ZNt,Oa);Ki("copy",JNt,Oa);Ki("domain",e5t,Oa);Ki("range",n5t,Oa);Ki("invert",t5t,Oa);Ki("scale",r5t,Oa);Ki("gradient",i5t,Oa);Ki("geoArea",PNt,Oa);Ki("geoBounds",MNt,Oa);Ki("geoCentroid",RNt,Oa);Ki("geoShape",o5t,Oa);Ki("geoScale",DNt,Oa);Ki("indata",gNt,kNt);Ki("data",mze,Noe);Ki("treePath",a5t,Noe);Ki("treeAncestors",l5t,Noe);Ki("vlSelectionTest",aNt,Foe);Ki("vlSelectionIdTest",uNt,Foe);Ki("vlSelectionResolve",dNt,Foe);Ki("vlSelectionTuples",fNt);function kh(t,e){const n={};let r;try{t=gt(t)?t:rt(t)+"",r=Loe(t)}catch{je("Expression parse error: "+t)}r.visit(o=>{if(o.type!==ize)return;const s=o.callee.name,a=Eze.visitors[s];a&&a(s,o.arguments,e,n)});const i=bY(r);return i.globals.forEach(o=>{const s=yze+o;!vt(n,s)&&e.getSignal(o)&&(n[s]=e.signalRef(o))}),{$expr:cn({code:i.code},e.options.ast?{ast:r}:null),$fields:i.fields,$params:n}}function b5t(t){const e=this,n=t.operators||[];return t.background&&(e.background=t.background),t.eventConfig&&(e.eventConfig=t.eventConfig),t.locale&&(e.locale=t.locale),n.forEach(r=>e.parseOperator(r)),n.forEach(r=>e.parseOperatorParameters(r)),(t.streams||[]).forEach(r=>e.parseStream(r)),(t.updates||[]).forEach(r=>e.parseUpdate(r)),e.resolve()}const w5t=Wf(["rule"]),Mve=Wf(["group","image","rect"]);function _5t(t,e){let n="";return w5t[e]||(t.x2&&(t.x?(Mve[e]&&(n+="if(o.x>o.x2)$=o.x,o.x=o.x2,o.x2=$;"),n+="o.width=o.x2-o.x;"):n+="o.x=o.x2-(o.width||0);"),t.xc&&(n+="o.x=o.xc-(o.width||0)/2;"),t.y2&&(t.y?(Mve[e]&&(n+="if(o.y>o.y2)$=o.y,o.y=o.y2,o.y2=$;"),n+="o.height=o.y2-o.y;"):n+="o.y=o.y2-(o.height||0);"),t.yc&&(n+="o.y=o.yc-(o.height||0)/2;")),n}function Voe(t){return(t+"").toLowerCase()}function S5t(t){return Voe(t)==="operator"}function C5t(t){return Voe(t)==="collect"}function t2(t,e,n){n.endsWith(";")||(n="return("+n+");");const r=Function(...e.concat(n));return t&&t.functions?r.bind(t.functions):r}function O5t(t,e,n,r){return`((u = ${t}) < (v = ${e}) || u == null) && v != null ? ${n} : (u > v || v == null) && u != null ? ${r} : ((v = v instanceof Date ? +v : v), (u = u instanceof Date ? +u : u)) !== u && v === v ? ${n} - : v !== v && u === u ? ${r} : `}var d5t={operator:(t,e)=>n2(t,["_"],e.code),parameter:(t,e)=>n2(t,["datum","_"],e.code),event:(t,e)=>n2(t,["event"],e.code),handler:(t,e)=>{const n=`var datum=event.item&&event.item.datum;return ${e.code};`;return n2(t,["_","event"],n)},encode:(t,e)=>{const{marktype:n,channels:r}=e;let i="var o=item,datum=o.datum,m=0,$;";for(const o in r){const s="o["+rt(o)+"]";i+=`$=${r[o].code};if(${s}!==$)${s}=$,m=1;`}return i+=l5t(r,n),i+="return m;",n2(t,["item","_"],i)},codegen:{get(t){const e=`[${t.map(rt).join("][")}]`,n=Function("_",`return _${e};`);return n.path=e,n},comparator(t,e){let n;const r=(o,s)=>{const a=e[s];let l,c;return o.path?(l=`a${o.path}`,c=`b${o.path}`):((n=n||{})["f"+s]=o,l=`this.f${s}(a)`,c=`this.f${s}(b)`),f5t(l,c,-a,a)},i=Function("a","b","var u, v; return "+t.map(r).join("")+"0;");return n?i.bind(n):i}}};function h5t(t){const e=this;c5t(t.type)||!t.type?e.operator(t,t.update?e.operatorExpression(t.update):null):e.transform(t,t.type)}function p5t(t){const e=this;if(t.params){const n=e.get(t.id);n||je("Invalid operator id: "+t.id),e.dataflow.connect(n,n.parameters(e.parseParameters(t.params),t.react,t.initonly))}}function g5t(t,e){e=e||{};const n=this;for(const r in t){const i=t[r];e[r]=We(i)?i.map(o=>gve(o,n,e)):gve(i,n,e)}return e}function gve(t,e,n){if(!t||!ht(t))return t;for(let r=0,i=mve.length,o;ri&&i.$tupleid?jt:i);return e.fn[n]||(e.fn[n]=Jte(r,t.$order,e.expr.codegen))}function w5t(t,e){const n=t.$encode,r={};for(const i in n){const o=n[i];r[i]=Pl(e.encodeExpression(o.$expr),o.$fields),r[i].output=o.$output}return r}function _5t(t,e){return e}function S5t(t,e){const n=t.$subflow;return function(r,i,o){const s=e.fork().parse(n),a=s.get(n.operators[0].id),l=s.signals.parent;return l&&l.set(o),a.detachSubflow=()=>e.detach(s),a}}function C5t(){return jt}function O5t(t){var e=this,n=t.filter!=null?e.eventExpression(t.filter):void 0,r=t.stream!=null?e.get(t.stream):void 0,i;t.source?r=e.events(t.source,t.type,n):t.merge&&(i=t.merge.map(o=>e.get(o)),r=i[0].merge.apply(i[0],i.slice(1))),t.between&&(i=t.between.map(o=>e.get(o)),r=r.between(i[0],i[1])),t.filter&&(r=r.filter(n)),t.throttle!=null&&(r=r.throttle(+t.throttle)),t.debounce!=null&&(r=r.debounce(+t.debounce)),r==null&&je("Invalid stream definition: "+JSON.stringify(t)),t.consume&&r.consume(!0),e.stream(t,r)}function E5t(t){var e=this,n=ht(n=t.source)?n.$ref:n,r=e.get(n),i=null,o=t.update,s=void 0;r||je("Source not defined: "+t.source),i=t.target&&t.target.$expr?e.eventExpression(t.target.$expr):e.get(t.target),o&&o.$expr&&(o.$params&&(s=e.parseParameters(o.$params)),o=e.handlerExpression(o.$expr)),e.update(t,r,i,o,s)}const T5t={skip:!0};function k5t(t){var e=this,n={};if(t.signals){var r=n.signals={};Object.keys(e.signals).forEach(o=>{const s=e.signals[o];t.signals(o,s)&&(r[o]=s.value)})}if(t.data){var i=n.data={};Object.keys(e.data).forEach(o=>{const s=e.data[o];t.data(o,s)&&(i[o]=s.input.value)})}return e.subcontext&&t.recurse!==!1&&(n.subcontext=e.subcontext.map(o=>o.getState(t))),n}function A5t(t){var e=this,n=e.dataflow,r=t.data,i=t.signals;Object.keys(i||{}).forEach(o=>{n.update(e.signals[o],i[o],T5t)}),Object.keys(r||{}).forEach(o=>{n.pulse(e.data[o].input,n.changeset().remove(Tu).insert(r[o]))}),(t.subcontext||[]).forEach((o,s)=>{const a=e.subcontext[s];a&&a.setState(o)})}function oze(t,e,n,r){return new sze(t,e,n,r)}function sze(t,e,n,r){this.dataflow=t,this.transforms=e,this.events=t.events.bind(t),this.expr=r||d5t,this.signals={},this.scales={},this.nodes={},this.data={},this.fn={},n&&(this.functions=Object.create(n),this.functions.context=this)}function vve(t){this.dataflow=t.dataflow,this.transforms=t.transforms,this.events=t.events,this.expr=t.expr,this.signals=Object.create(t.signals),this.scales=Object.create(t.scales),this.nodes=Object.create(t.nodes),this.data=Object.create(t.data),this.fn=Object.create(t.fn),t.functions&&(this.functions=Object.create(t.functions),this.functions.context=this)}sze.prototype=vve.prototype={fork(){const t=new vve(this);return(this.subcontext||(this.subcontext=[])).push(t),t},detach(t){this.subcontext=this.subcontext.filter(n=>n!==t);const e=Object.keys(t.nodes);for(const n of e)t.nodes[n]._targets=null;for(const n of e)t.nodes[n].detach();t.nodes=null},get(t){return this.nodes[t]},set(t,e){return this.nodes[t]=e},add(t,e){const n=this,r=n.dataflow,i=t.value;if(n.set(t.id,e),u5t(t.type)&&i&&(i.$ingest?r.ingest(e,i.$ingest,i.$format):i.$request?r.preload(e,i.$request,i.$format):r.pulse(e,r.changeset().insert(i))),t.root&&(n.root=e),t.parent){let o=n.get(t.parent.$ref);o?(r.connect(o,[e]),e.targets().add(o)):(n.unresolved=n.unresolved||[]).push(()=>{o=n.get(t.parent.$ref),r.connect(o,[e]),e.targets().add(o)})}if(t.signal&&(n.signals[t.signal]=e),t.scale&&(n.scales[t.scale]=e),t.data)for(const o in t.data){const s=n.data[o]||(n.data[o]={});t.data[o].forEach(a=>s[a]=e)}},resolve(){return(this.unresolved||[]).forEach(t=>t()),delete this.unresolved,this},operator(t,e){this.add(t,this.dataflow.add(t.value,e))},transform(t,e){this.add(t,this.dataflow.add(this.transforms[koe(e)]))},stream(t,e){this.set(t.id,e)},update(t,e,n,r,i){this.dataflow.on(e,n,r,i,t.options)},operatorExpression(t){return this.expr.operator(this,t)},parameterExpression(t){return this.expr.parameter(this,t)},eventExpression(t){return this.expr.event(this,t)},handlerExpression(t){return this.expr.handler(this,t)},encodeExpression(t){return this.expr.encode(this,t)},parse:s5t,parseOperator:h5t,parseOperatorParameters:p5t,parseParameters:g5t,parseStream:O5t,parseUpdate:E5t,getState:k5t,setState:A5t};function P5t(t){const e=t.container();e&&(e.setAttribute("role","graphics-document"),e.setAttribute("aria-roleDescription","visualization"),aze(e,t.description()))}function aze(t,e){t&&(e==null?t.removeAttribute("aria-label"):t.setAttribute("aria-label",e))}function M5t(t){t.add(null,e=>(t._background=e.bg,t._resize=1,e.bg),{bg:t._signals.background})}const IV="default";function R5t(t){const e=t._signals.cursor||(t._signals.cursor=t.add({user:IV,item:null}));t.on(t.events("view","pointermove"),e,(n,r)=>{const i=e.value,o=i?gt(i)?i:i.user:IV,s=r.item&&r.item.cursor||null;return i&&o===i.user&&s==i.item?i:{user:o,item:s}}),t.add(null,function(n){let r=n.cursor,i=this.value;return gt(r)||(i=r.item,r=r.user),uY(t,r&&r!==IV?r:i||r),i},{cursor:e})}function uY(t,e){const n=t.globalCursor()?typeof document<"u"&&document.body:t.container();if(n)return e==null?n.style.removeProperty("cursor"):n.style.cursor=e}function A5(t,e){var n=t._runtime.data;return vt(n,e)||je("Unrecognized data set: "+e),n[e]}function D5t(t,e){return arguments.length<2?A5(this,t).values.value:JB.call(this,t,lb().remove(Tu).insert(e))}function JB(t,e){xLe(e)||je("Second argument to changes must be a changeset.");const n=A5(this,t);return n.modified=!0,this.pulse(n.input,e)}function I5t(t,e){return JB.call(this,t,lb().insert(e))}function L5t(t,e){return JB.call(this,t,lb().remove(e))}function lze(t){var e=t.padding();return Math.max(0,t._viewWidth+e.left+e.right)}function cze(t){var e=t.padding();return Math.max(0,t._viewHeight+e.top+e.bottom)}function e6(t){var e=t.padding(),n=t._origin;return[e.left+n[0],e.top+n[1]]}function $5t(t){var e=e6(t),n=lze(t),r=cze(t);t._renderer.background(t.background()),t._renderer.resize(n,r,e),t._handler.origin(e),t._resizeListeners.forEach(i=>{try{i(n,r)}catch(o){t.error(o)}})}function F5t(t,e,n){var r=t._renderer,i=r&&r.canvas(),o,s,a;return i&&(a=e6(t),s=e.changedTouches?e.changedTouches[0]:e,o=jB(s,i),o[0]-=a[0],o[1]-=a[1]),e.dataflow=t,e.item=n,e.vega=N5t(t,n,o),e}function N5t(t,e,n){const r=e?e.mark.marktype==="group"?e:e.mark.group:null;function i(s){var a=r,l;if(s){for(l=e;l;l=l.mark.group)if(l.mark.name===s){a=l;break}}return a&&a.mark&&a.mark.interactive?a:{}}function o(s){if(!s)return n;gt(s)&&(s=i(s));const a=n.slice();for(;s;)a[0]-=s.x||0,a[1]-=s.y||0,s=s.mark&&s.mark.group;return a}return{view:ra(t),item:ra(e||{}),group:i,xy:o,x:s=>o(s)[0],y:s=>o(s)[1]}}const yve="view",z5t="timer",j5t="window",B5t={trap:!1};function U5t(t){const e=cn({defaults:{}},t),n=(r,i)=>{i.forEach(o=>{We(r[o])&&(r[o]=Wf(r[o]))})};return n(e.defaults,["prevent","allow"]),n(e,["view","window","selector"]),e}function uze(t,e,n,r){t._eventListeners.push({type:n,sources:pt(e),handler:r})}function W5t(t,e){var n=t._eventConfig.defaults,r=n.prevent,i=n.allow;return r===!1||i===!0?!1:r===!0||i===!1?!0:r?r[e]:i?!i[e]:t.preventDefault()}function JI(t,e,n){const r=t._eventConfig&&t._eventConfig[e];return r===!1||ht(r)&&!r[n]?(t.warn(`Blocked ${e} ${n} event listener.`),!1):!0}function V5t(t,e,n){var r=this,i=new sB(n),o=function(c,u){r.runAsync(null,()=>{t===yve&&W5t(r,e)&&c.preventDefault(),i.receive(F5t(r,c,u))})},s;if(t===z5t)JI(r,"timer",e)&&r.timer(o,e);else if(t===yve)JI(r,"view",e)&&r.addEventListener(e,o,B5t);else if(t===j5t?JI(r,"window",e)&&typeof window<"u"&&(s=[window]):typeof document<"u"&&JI(r,"selector",e)&&(s=Array.from(document.querySelectorAll(t))),!s)r.warn("Can not resolve event source: "+t);else{for(var a=0,l=s.length;a=0;)e[i].stop();for(i=r.length;--i>=0;)for(s=r[i],o=s.sources.length;--o>=0;)s.sources[o].removeEventListener(s.type,s.handler);for(t&&t.call(this,this._handler,null,null,null),i=n.length;--i>=0;)l=n[i].type,a=n[i].handler,this._handler.off(l,a);return this}function gc(t,e,n){const r=document.createElement(t);for(const i in e)r.setAttribute(i,e[i]);return n!=null&&(r.textContent=n),r}const q5t="vega-bind",X5t="vega-bind-name",Y5t="vega-bind-radio";function Q5t(t,e,n){if(!e)return;const r=n.param;let i=n.state;return i||(i=n.state={elements:null,active:!1,set:null,update:s=>{s!=t.signal(r.signal)&&t.runAsync(null,()=>{i.source=!0,t.signal(r.signal,s)})}},r.debounce&&(i.update=ene(r.debounce,i.update))),(r.input==null&&r.element?K5t:J5t)(i,e,r,t),i.active||(t.on(t._signals[r.signal],null,()=>{i.source?i.source=!1:i.set(t.signal(r.signal))}),i.active=!0),i}function K5t(t,e,n,r){const i=n.event||"input",o=()=>t.update(e.value);r.signal(n.signal,e.value),e.addEventListener(i,o),uze(r,e,i,o),t.set=s=>{e.value=s,e.dispatchEvent(Z5t(i))}}function Z5t(t){return typeof Event<"u"?new Event(t):{type:t}}function J5t(t,e,n,r){const i=r.signal(n.signal),o=gc("div",{class:q5t}),s=n.input==="radio"?o:o.appendChild(gc("label"));s.appendChild(gc("span",{class:X5t},n.name||n.signal)),e.appendChild(o);let a=ezt;switch(n.input){case"checkbox":a=tzt;break;case"select":a=nzt;break;case"radio":a=rzt;break;case"range":a=izt;break}a(t,s,n,i)}function ezt(t,e,n,r){const i=gc("input");for(const o in n)o!=="signal"&&o!=="element"&&i.setAttribute(o==="input"?"type":o,n[o]);i.setAttribute("name",n.signal),i.value=r,e.appendChild(i),i.addEventListener("input",()=>t.update(i.value)),t.elements=[i],t.set=o=>i.value=o}function tzt(t,e,n,r){const i={type:"checkbox",name:n.signal};r&&(i.checked=!0);const o=gc("input",i);e.appendChild(o),o.addEventListener("change",()=>t.update(o.checked)),t.elements=[o],t.set=s=>o.checked=!!s||null}function nzt(t,e,n,r){const i=gc("select",{name:n.signal}),o=n.labels||[];n.options.forEach((s,a)=>{const l={value:s};P5(s,r)&&(l.selected=!0),i.appendChild(gc("option",l,(o[a]||s)+""))}),e.appendChild(i),i.addEventListener("change",()=>{t.update(n.options[i.selectedIndex])}),t.elements=[i],t.set=s=>{for(let a=0,l=n.options.length;a{const l={type:"radio",name:n.signal,value:s};P5(s,r)&&(l.checked=!0);const c=gc("input",l);c.addEventListener("change",()=>t.update(s));const u=gc("label",{},(o[a]||s)+"");return u.prepend(c),i.appendChild(u),c}),t.set=s=>{const a=t.elements,l=a.length;for(let c=0;c{l.textContent=a.value,t.update(+a.value)};a.addEventListener("input",c),a.addEventListener("change",c),t.elements=[a],t.set=u=>{a.value=u,l.textContent=u}}function P5(t,e){return t===e||t+""==e+""}function fze(t,e,n,r,i,o){return e=e||new r(t.loader()),e.initialize(n,lze(t),cze(t),e6(t),i,o).background(t.background())}function Aoe(t,e){return e?function(){try{e.apply(this,arguments)}catch(n){t.error(n)}}:null}function ozt(t,e,n,r){const i=new r(t.loader(),Aoe(t,t.tooltip())).scene(t.scenegraph().root).initialize(n,e6(t),t);return e&&e.handlers().forEach(o=>{i.on(o.type,o.handler)}),i}function szt(t,e){const n=this,r=n._renderType,i=n._eventConfig.bind,o=BB(r);t=n._el=t?LV(n,t,!0):null,P5t(n),o||n.error("Unrecognized renderer type: "+r);const s=o.handler||CR,a=t?o.renderer:o.headless;return n._renderer=a?fze(n,n._renderer,t,a):null,n._handler=ozt(n,n._handler,t,s),n._redraw=!0,t&&i!=="none"&&(e=e?n._elBind=LV(n,e,!0):t.appendChild(gc("form",{class:"vega-bindings"})),n._bind.forEach(l=>{l.param.element&&i!=="container"&&(l.element=LV(n,l.param.element,!!l.param.input))}),n._bind.forEach(l=>{Q5t(n,l.element||e,l)})),n}function LV(t,e,n){if(typeof e=="string")if(typeof document<"u"){if(e=document.querySelector(e),!e)return t.error("Signal bind element not found: "+e),null}else return t.error("DOM document instance not found."),null;if(e&&n)try{e.textContent=""}catch(r){e=null,t.error(r)}return e}const r2=t=>+t||0,azt=t=>({top:t,bottom:t,left:t,right:t});function _ve(t){return ht(t)?{top:r2(t.top),bottom:r2(t.bottom),left:r2(t.left),right:r2(t.right)}:azt(r2(t))}async function Poe(t,e,n,r){const i=BB(e),o=i&&i.headless;return o||je("Unrecognized renderer type: "+e),await t.runAsync(),fze(t,null,null,o,n,r).renderAsync(t._scenegraph.root)}async function lzt(t,e){t!==gv.Canvas&&t!==gv.SVG&&t!==gv.PNG&&je("Unrecognized image type: "+t);const n=await Poe(this,t,e);return t===gv.SVG?czt(n.svg(),"image/svg+xml"):n.canvas().toDataURL("image/png")}function czt(t,e){const n=new Blob([t],{type:e});return window.URL.createObjectURL(n)}async function uzt(t,e){return(await Poe(this,gv.Canvas,t,e)).canvas()}async function fzt(t){return(await Poe(this,gv.SVG,t)).svg()}function dzt(t,e,n){return oze(t,IS,WA,n).parse(e)}function hzt(t){var e=this._runtime.scales;return vt(e,t)||je("Unrecognized scale or projection: "+t),e[t].value}var dze="width",hze="height",Moe="padding",Sve={skip:!0};function pze(t,e){var n=t.autosize(),r=t.padding();return e-(n&&n.contains===Moe?r.left+r.right:0)}function gze(t,e){var n=t.autosize(),r=t.padding();return e-(n&&n.contains===Moe?r.top+r.bottom:0)}function pzt(t){var e=t._signals,n=e[dze],r=e[hze],i=e[Moe];function o(){t._autosize=t._resize=1}t._resizeWidth=t.add(null,a=>{t._width=a.size,t._viewWidth=pze(t,a.size),o()},{size:n}),t._resizeHeight=t.add(null,a=>{t._height=a.size,t._viewHeight=gze(t,a.size),o()},{size:r});const s=t.add(null,o,{pad:i});t._resizeWidth.rank=n.rank+1,t._resizeHeight.rank=r.rank+1,s.rank=i.rank+1}function gzt(t,e,n,r,i,o){this.runAfter(s=>{let a=0;s._autosize=0,s.width()!==n&&(a=1,s.signal(dze,n,Sve),s._resizeWidth.skip(!0)),s.height()!==r&&(a=1,s.signal(hze,r,Sve),s._resizeHeight.skip(!0)),s._viewWidth!==t&&(s._resize=1,s._viewWidth=t),s._viewHeight!==e&&(s._resize=1,s._viewHeight=e),(s._origin[0]!==i[0]||s._origin[1]!==i[1])&&(s._resize=1,s._origin=i),a&&s.run("enter"),o&&s.runAfter(l=>l.resize())},!1,1)}function mzt(t){return this._runtime.getState(t||{data:vzt,signals:yzt,recurse:!0})}function vzt(t,e){return e.modified&&We(e.input.value)&&!t.startsWith("_:vega:_")}function yzt(t,e){return!(t==="parent"||e instanceof IS.proxy)}function xzt(t){return this.runAsync(null,e=>{e._trigger=!1,e._runtime.setState(t)},e=>{e._trigger=!0}),this}function bzt(t,e){function n(r){t({timestamp:Date.now(),elapsed:r})}this._timers.push(KIt(n,e))}function wzt(t,e,n,r){const i=t.element();i&&i.setAttribute("title",_zt(r))}function _zt(t){return t==null?"":We(t)?mze(t):ht(t)&&!Nv(t)?Szt(t):t+""}function Szt(t){return Object.keys(t).map(e=>{const n=t[e];return e+": "+(We(n)?mze(n):vze(n))}).join(` -`)}function mze(t){return"["+t.map(vze).join(", ")+"]"}function vze(t){return We(t)?"[…]":ht(t)&&!Nv(t)?"{…}":t}function Czt(){if(this.renderer()==="canvas"&&this._renderer._canvas){let t=null;const e=()=>{t!=null&&t();const n=matchMedia(`(resolution: ${window.devicePixelRatio}dppx)`);n.addEventListener("change",e),t=()=>{n.removeEventListener("change",e)},this._renderer._canvas.getContext("2d").pixelRatio=window.devicePixelRatio||1,this._redraw=!0,this._resize=1,this.resize().runAsync()};e()}}function yze(t,e){const n=this;if(e=e||{},D_.call(n),e.loader&&n.loader(e.loader),e.logger&&n.logger(e.logger),e.logLevel!=null&&n.logLevel(e.logLevel),e.locale||t.locale){const o=cn({},t.locale,e.locale);n.locale(cLe(o.number,o.time))}n._el=null,n._elBind=null,n._renderType=e.renderer||gv.Canvas,n._scenegraph=new dFe;const r=n._scenegraph.root;n._renderer=null,n._tooltip=e.tooltip||wzt,n._redraw=!0,n._handler=new CR().scene(r),n._globalCursor=!1,n._preventDefault=!1,n._timers=[],n._eventListeners=[],n._resizeListeners=[],n._eventConfig=U5t(t.eventConfig),n.globalCursor(n._eventConfig.globalCursor);const i=dzt(n,t,e.expr);n._runtime=i,n._signals=i.signals,n._bind=(t.bindings||[]).map(o=>({state:null,param:cn({},o)})),i.root&&i.root.set(r),r.source=i.data.root.input,n.pulse(i.data.root.input,n.changeset().insert(r.items)),n._width=n.width(),n._height=n.height(),n._viewWidth=pze(n,n._width),n._viewHeight=gze(n,n._height),n._origin=[0,0],n._resize=0,n._autosize=1,pzt(n),M5t(n),R5t(n),n.description(t.description),e.hover&&n.hover(),e.container&&n.initialize(e.container,e.bind),e.watchPixelRatio&&n._watchPixelRatio()}function eL(t,e){return vt(t._signals,e)?t._signals[e]:je("Unrecognized signal name: "+rt(e))}function xze(t,e){const n=(t._targets||[]).filter(r=>r._update&&r._update.handler===e);return n.length?n[0]:null}function Cve(t,e,n,r){let i=xze(n,r);return i||(i=Aoe(t,()=>r(e,n.value)),i.handler=r,t.on(n,null,i)),t}function Ove(t,e,n){const r=xze(e,n);return r&&e._targets.remove(r),t}it(yze,D_,{async evaluate(t,e,n){if(await D_.prototype.evaluate.call(this,t,e),this._redraw||this._resize)try{this._renderer&&(this._resize&&(this._resize=0,$5t(this)),await this._renderer.renderAsync(this._scenegraph.root)),this._redraw=!1}catch(r){this.error(r)}return n&&p3(this,n),this},dirty(t){this._redraw=!0,this._renderer&&this._renderer.dirty(t)},description(t){if(arguments.length){const e=t!=null?t+"":null;return e!==this._desc&&aze(this._el,this._desc=e),this}return this._desc},container(){return this._el},scenegraph(){return this._scenegraph},origin(){return this._origin.slice()},signal(t,e,n){const r=eL(this,t);return arguments.length===1?r.value:this.update(r,e,n)},width(t){return arguments.length?this.signal("width",t):this.signal("width")},height(t){return arguments.length?this.signal("height",t):this.signal("height")},padding(t){return arguments.length?this.signal("padding",_ve(t)):_ve(this.signal("padding"))},autosize(t){return arguments.length?this.signal("autosize",t):this.signal("autosize")},background(t){return arguments.length?this.signal("background",t):this.signal("background")},renderer(t){return arguments.length?(BB(t)||je("Unrecognized renderer type: "+t),t!==this._renderType&&(this._renderType=t,this._resetRenderer()),this):this._renderType},tooltip(t){return arguments.length?(t!==this._tooltip&&(this._tooltip=t,this._resetRenderer()),this):this._tooltip},loader(t){return arguments.length?(t!==this._loader&&(D_.prototype.loader.call(this,t),this._resetRenderer()),this):this._loader},resize(){return this._autosize=1,this.touch(eL(this,"autosize"))},_resetRenderer(){this._renderer&&(this._renderer=null,this.initialize(this._el,this._elBind))},_resizeView:gzt,addEventListener(t,e,n){let r=e;return n&&n.trap===!1||(r=Aoe(this,e),r.raw=e),this._handler.on(t,r),this},removeEventListener(t,e){for(var n=this._handler.handlers(t),r=n.length,i,o;--r>=0;)if(o=n[r].type,i=n[r].handler,t===o&&(e===i||e===i.raw)){this._handler.off(o,i);break}return this},addResizeListener(t){const e=this._resizeListeners;return e.includes(t)||e.push(t),this},removeResizeListener(t){var e=this._resizeListeners,n=e.indexOf(t);return n>=0&&e.splice(n,1),this},addSignalListener(t,e){return Cve(this,t,eL(this,t),e)},removeSignalListener(t,e){return Ove(this,eL(this,t),e)},addDataListener(t,e){return Cve(this,t,A5(this,t).values,e)},removeDataListener(t,e){return Ove(this,A5(this,t).values,e)},globalCursor(t){if(arguments.length){if(this._globalCursor!==!!t){const e=uY(this,null);this._globalCursor=!!t,e&&uY(this,e)}return this}else return this._globalCursor},preventDefault(t){return arguments.length?(this._preventDefault=t,this):this._preventDefault},timer:bzt,events:V5t,finalize:H5t,hover:G5t,data:D5t,change:JB,insert:I5t,remove:L5t,scale:hzt,initialize:szt,toImageURL:lzt,toCanvas:uzt,toSVG:fzt,getState:mzt,setState:xzt,_watchPixelRatio:Czt});const Ozt="view",M5="[",R5="]",bze="{",wze="}",Ezt=":",_ze=",",Tzt="@",kzt=">",Azt=/[[\]{}]/,Pzt={"*":1,arc:1,area:1,group:1,image:1,line:1,path:1,rect:1,rule:1,shape:1,symbol:1,text:1,trail:1};let Sze,Cze;function qy(t,e,n){return Sze=e||Ozt,Cze=n||Pzt,Oze(t.trim()).map(fY)}function Mzt(t){return Cze[t]}function gk(t,e,n,r,i){const o=t.length;let s=0,a;for(;e=0?--s:r&&r.indexOf(a)>=0&&++s}return e}function Oze(t){const e=[],n=t.length;let r=0,i=0;for(;i' after between selector: "+t;r=r.map(fY);const i=fY(t.slice(1).trim());return i.between?{between:r,stream:i}:(i.between=r,i)}function Dzt(t){const e={source:Sze},n=[];let r=[0,0],i=0,o=0,s=t.length,a=0,l,c;if(t[s-1]===wze){if(a=t.lastIndexOf(bze),a>=0){try{r=Izt(t.substring(a+1,s-1))}catch{throw"Invalid throttle specification: "+t}t=t.slice(0,a).trim(),s=t.length}else throw"Unmatched right brace: "+t;a=0}if(!s)throw t;if(t[0]===Tzt&&(i=++a),l=gk(t,a,Ezt),l1?(e.type=n[1],i?e.markname=n[0].slice(1):Mzt(n[0])?e.marktype=n[0]:e.source=n[0]):e.type=n[0],e.type.slice(-1)==="!"&&(e.consume=!0,e.type=e.type.slice(0,-1)),c!=null&&(e.filter=c),r[0]&&(e.throttle=r[0]),r[1]&&(e.debounce=r[1]),e}function Izt(t){const e=t.split(_ze);if(!t.length||e.length>2)throw t;return e.map(n=>{const r=+n;if(r!==r)throw t;return r})}function Lzt(t){return ht(t)?t:{type:t||"pad"}}const i2=t=>+t||0,$zt=t=>({top:t,bottom:t,left:t,right:t});function Fzt(t){return ht(t)?t.signal?t:{top:i2(t.top),bottom:i2(t.bottom),left:i2(t.left),right:i2(t.right)}:$zt(i2(t))}const No=t=>ht(t)&&!We(t)?cn({},t):{value:t};function Eve(t,e,n,r){return n!=null?(ht(n)&&!We(n)||We(n)&&n.length&&ht(n[0])?t.update[e]=n:t[r||"enter"][e]={value:n},1):0}function Ss(t,e,n){for(const r in e)Eve(t,r,e[r]);for(const r in n)Eve(t,r,n[r],"update")}function AO(t,e,n){for(const r in e)n&&vt(n,r)||(t[r]=cn(t[r]||{},e[r]));return t}function Nw(t,e){return e&&(e.enter&&e.enter[t]||e.update&&e.update[t])}const Roe="mark",Doe="frame",Ioe="scope",Nzt="axis",zzt="axis-domain",jzt="axis-grid",Bzt="axis-label",Uzt="axis-tick",Wzt="axis-title",Vzt="legend",Gzt="legend-band",Hzt="legend-entry",qzt="legend-gradient",Eze="legend-label",Xzt="legend-symbol",Yzt="legend-title",Qzt="title",Kzt="title-text",Zzt="title-subtitle";function Jzt(t,e,n,r,i){const o={},s={};let a,l,c,u;l="lineBreak",e==="text"&&i[l]!=null&&!Nw(l,t)&&$V(o,l,i[l]),(n=="legend"||String(n).startsWith("axis"))&&(n=null),u=n===Doe?i.group:n===Roe?cn({},i.mark,i[e]):null;for(l in u)c=Nw(l,t)||(l==="fill"||l==="stroke")&&(Nw("fill",t)||Nw("stroke",t)),c||$V(o,l,u[l]);pt(r).forEach(f=>{const d=i.style&&i.style[f];for(const h in d)Nw(h,t)||$V(o,h,d[h])}),t=cn({},t);for(l in o)u=o[l],u.signal?(a=a||{})[l]=u:s[l]=u;return t.enter=cn(s,t.enter),a&&(t.update=cn(a,t.update)),t}function $V(t,e,n){t[e]=n&&n.signal?{signal:n.signal}:{value:n}}const Tze=t=>gt(t)?rt(t):t.signal?`(${t.signal})`:kze(t);function t6(t){if(t.gradient!=null)return tjt(t);let e=t.signal?`(${t.signal})`:t.color?ejt(t.color):t.field!=null?kze(t.field):t.value!==void 0?rt(t.value):void 0;return t.scale!=null&&(e=njt(t,e)),e===void 0&&(e=null),t.exponent!=null&&(e=`pow(${e},${R3(t.exponent)})`),t.mult!=null&&(e+=`*${R3(t.mult)}`),t.offset!=null&&(e+=`+${R3(t.offset)}`),t.round&&(e=`round(${e})`),e}const tL=(t,e,n,r)=>`(${t}(${[e,n,r].map(t6).join(",")})+'')`;function ejt(t){return t.c?tL("hcl",t.h,t.c,t.l):t.h||t.s?tL("hsl",t.h,t.s,t.l):t.l||t.a?tL("lab",t.l,t.a,t.b):t.r||t.g||t.b?tL("rgb",t.r,t.g,t.b):null}function tjt(t){const e=[t.start,t.stop,t.count].map(n=>n==null?null:rt(n));for(;e.length&&$n(e)==null;)e.pop();return e.unshift(Tze(t.gradient)),`gradient(${e.join(",")})`}function R3(t){return ht(t)?"("+t6(t)+")":t}function kze(t){return Aze(ht(t)?t:{datum:t})}function Aze(t){let e,n,r;if(t.signal)e="datum",r=t.signal;else if(t.group||t.parent){for(n=Math.max(1,t.level||1),e="item";n-- >0;)e+=".mark.group";t.parent?(r=t.parent,e+=".datum"):r=t.group}else t.datum?(e="datum",r=t.datum):je("Invalid field reference: "+rt(t));return t.signal||(r=gt(r)?Bh(r).map(rt).join("]["):Aze(r)),e+"["+r+"]"}function njt(t,e){const n=Tze(t.scale);return t.range!=null?e=`lerp(_range(${n}), ${+t.range})`:(e!==void 0&&(e=`_scale(${n}, ${e})`),t.band&&(e=(e?e+"+":"")+`_bandwidth(${n})`+(+t.band==1?"":"*"+R3(t.band)),t.extra&&(e=`(datum.extra ? _scale(${n}, datum.extra.value) : ${e})`)),e==null&&(e="0")),e}function rjt(t){let e="";return t.forEach(n=>{const r=t6(n);e+=n.test?`(${n.test})?${r}:`:r}),$n(e)===":"&&(e+="null"),e}function Pze(t,e,n,r,i,o){const s={};o=o||{},o.encoders={$encode:s},t=Jzt(t,e,n,r,i.config);for(const a in t)s[a]=ijt(t[a],e,o,i);return o}function ijt(t,e,n,r){const i={},o={};for(const s in t)t[s]!=null&&(i[s]=sjt(ojt(t[s]),r,n,o));return{$expr:{marktype:e,channels:i},$fields:Object.keys(o),$output:Object.keys(t)}}function ojt(t){return We(t)?rjt(t):t6(t)}function sjt(t,e,n,r){const i=Mh(t,e);return i.$fields.forEach(o=>r[o]=1),cn(n,i.$params),i.$expr}const ajt="outer",ljt=["value","update","init","react","bind"];function Tve(t,e){je(t+' for "outer" push: '+rt(e))}function Mze(t,e){const n=t.name;if(t.push===ajt)e.signals[n]||Tve("No prior signal definition",n),ljt.forEach(r=>{t[r]!==void 0&&Tve("Invalid property ",r)});else{const r=e.addSignal(n,t.value);t.react===!1&&(r.react=!1),t.bind&&e.addBinding(n,t.bind)}}function dY(t,e,n,r){this.id=-1,this.type=t,this.value=e,this.params=n,r&&(this.parent=r)}function n6(t,e,n,r){return new dY(t,e,n,r)}function D5(t,e){return n6("operator",t,e)}function zt(t){const e={$ref:t.id};return t.id<0&&(t.refs=t.refs||[]).push(e),e}function VA(t,e){return e?{$field:t,$name:e}:{$field:t}}const hY=VA("key");function kve(t,e){return{$compare:t,$order:e}}function cjt(t,e){const n={$key:t};return e&&(n.$flat=!0),n}const ujt="ascending",fjt="descending";function djt(t){return ht(t)?(t.order===fjt?"-":"+")+r6(t.op,t.field):""}function r6(t,e){return(t&&t.signal?"$"+t.signal:t||"")+(t&&e?"_":"")+(e&&e.signal?"$"+e.signal:e||"")}const Loe="scope",pY="view";function Oo(t){return t&&t.signal}function hjt(t){return t&&t.expr}function D3(t){if(Oo(t))return!0;if(ht(t)){for(const e in t)if(D3(t[e]))return!0}return!1}function hf(t,e){return t??e}function jx(t){return t&&t.signal||t}const Ave="timer";function GA(t,e){return(t.merge?gjt:t.stream?mjt:t.type?vjt:je("Invalid stream specification: "+rt(t)))(t,e)}function pjt(t){return t===Loe?pY:t||pY}function gjt(t,e){const n=t.merge.map(i=>GA(i,e)),r=$oe({merge:n},t,e);return e.addStream(r).id}function mjt(t,e){const n=GA(t.stream,e),r=$oe({stream:n},t,e);return e.addStream(r).id}function vjt(t,e){let n;t.type===Ave?(n=e.event(Ave,t.throttle),t={between:t.between,filter:t.filter}):n=e.event(pjt(t.source),t.type);const r=$oe({stream:n},t,e);return Object.keys(r).length===1?n:e.addStream(r).id}function $oe(t,e,n){let r=e.between;return r&&(r.length!==2&&je('Stream "between" parameter must have 2 entries: '+rt(e)),t.between=[GA(r[0],n),GA(r[1],n)]),r=e.filter?[].concat(e.filter):[],(e.marktype||e.markname||e.markrole)&&r.push(yjt(e.marktype,e.markname,e.markrole)),e.source===Loe&&r.push("inScope(event.item)"),r.length&&(t.filter=Mh("("+r.join(")&&(")+")",n).$expr),(r=e.throttle)!=null&&(t.throttle=+r),(r=e.debounce)!=null&&(t.debounce=+r),e.consume&&(t.consume=!0),t}function yjt(t,e,n){const r="event.item";return r+(t&&t!=="*"?"&&"+r+".mark.marktype==='"+t+"'":"")+(n?"&&"+r+".mark.role==='"+n+"'":"")+(e?"&&"+r+".mark.name==='"+e+"'":"")}const xjt={code:"_.$value",ast:{type:"Identifier",value:"value"}};function bjt(t,e,n){const r=t.encode,i={target:n};let o=t.events,s=t.update,a=[];o||je("Signal update missing events specification."),gt(o)&&(o=qy(o,e.isSubscope()?Loe:pY)),o=pt(o).filter(l=>l.signal||l.scale?(a.push(l),0):1),a.length>1&&(a=[_jt(a)]),o.length&&a.push(o.length>1?{merge:o}:o[0]),r!=null&&(s&&je("Signal encode and update are mutually exclusive."),s="encode(item(),"+rt(r)+")"),i.update=gt(s)?Mh(s,e):s.expr!=null?Mh(s.expr,e):s.value!=null?s.value:s.signal!=null?{$expr:xjt,$params:{$value:e.signalRef(s.signal)}}:je("Invalid signal update specification."),t.force&&(i.options={force:!0}),a.forEach(l=>e.addUpdate(cn(wjt(l,e),i)))}function wjt(t,e){return{source:t.signal?e.signalRef(t.signal):t.scale?e.scaleRef(t.scale):GA(t,e)}}function _jt(t){return{signal:"["+t.map(e=>e.scale?'scale("'+e.scale+'")':e.signal)+"]"}}function Sjt(t,e){const n=e.getSignal(t.name);let r=t.update;t.init&&(r?je("Signals can not include both init and update expressions."):(r=t.init,n.initonly=!0)),r&&(r=Mh(r,e),n.update=r.$expr,n.params=r.$params),t.on&&t.on.forEach(i=>bjt(i,e,n.id))}const Ar=t=>(e,n,r)=>n6(t,n,e||void 0,r),Rze=Ar("aggregate"),Cjt=Ar("axisticks"),Dze=Ar("bound"),rd=Ar("collect"),Pve=Ar("compare"),Ojt=Ar("datajoin"),Ize=Ar("encode"),Ejt=Ar("expression"),Tjt=Ar("facet"),kjt=Ar("field"),Ajt=Ar("key"),Pjt=Ar("legendentries"),Mjt=Ar("load"),Rjt=Ar("mark"),Djt=Ar("multiextent"),Ijt=Ar("multivalues"),Ljt=Ar("overlap"),$jt=Ar("params"),Lze=Ar("prefacet"),Fjt=Ar("projection"),Njt=Ar("proxy"),zjt=Ar("relay"),$ze=Ar("render"),jjt=Ar("scale"),fb=Ar("sieve"),Bjt=Ar("sortitems"),Fze=Ar("viewlayout"),Ujt=Ar("values");let Wjt=0;const Nze={min:"min",max:"max",count:"sum"};function Vjt(t,e){const n=t.type||"linear";C3e(n)||je("Unrecognized scale type: "+rt(n)),e.addScale(t.name,{type:n,domain:void 0})}function Gjt(t,e){const n=e.getScale(t.name).params;let r;n.domain=zze(t.domain,t,e),t.range!=null&&(n.range=Bze(t,e,n)),t.interpolate!=null&&t4t(t.interpolate,n),t.nice!=null&&(n.nice=e4t(t.nice,e)),t.bins!=null&&(n.bins=Jjt(t.bins,e));for(r in t)vt(n,r)||r==="name"||(n[r]=su(t[r],e))}function su(t,e){return ht(t)?t.signal?e.signalRef(t.signal):je("Unsupported object: "+rt(t)):t}function I3(t,e){return t.signal?e.signalRef(t.signal):t.map(n=>su(n,e))}function i6(t){je("Can not find data set: "+rt(t))}function zze(t,e,n){if(!t){(e.domainMin!=null||e.domainMax!=null)&&je("No scale domain defined for domainMin/domainMax to override.");return}return t.signal?n.signalRef(t.signal):(We(t)?Hjt:t.fields?Xjt:qjt)(t,e,n)}function Hjt(t,e,n){return t.map(r=>su(r,n))}function qjt(t,e,n){const r=n.getData(t.data);return r||i6(t.data),zS(e.type)?r.valuesRef(n,t.field,jze(t.sort,!1)):T3e(e.type)?r.domainRef(n,t.field):r.extentRef(n,t.field)}function Xjt(t,e,n){const r=t.data,i=t.fields.reduce((o,s)=>(s=gt(s)?{data:r,field:s}:We(s)||s.signal?Yjt(s,n):s,o.push(s),o),[]);return(zS(e.type)?Qjt:T3e(e.type)?Kjt:Zjt)(t,n,i)}function Yjt(t,e){const n="_:vega:_"+Wjt++,r=rd({});if(We(t))r.value={$ingest:t};else if(t.signal){const i="setdata("+rt(n)+","+t.signal+")";r.params.input=e.signalRef(i)}return e.addDataPipeline(n,[r,fb({})]),{data:n,field:"data"}}function Qjt(t,e,n){const r=jze(t.sort,!0);let i,o;const s=n.map(c=>{const u=e.getData(c.data);return u||i6(c.data),u.countsRef(e,c.field,r)}),a={groupby:hY,pulse:s};r&&(i=r.op||"count",o=r.field?r6(i,r.field):"count",a.ops=[Nze[i]],a.fields=[e.fieldRef(o)],a.as=[o]),i=e.add(Rze(a));const l=e.add(rd({pulse:zt(i)}));return o=e.add(Ujt({field:hY,sort:e.sortRef(r),pulse:zt(l)})),zt(o)}function jze(t,e){return t&&(!t.field&&!t.op?ht(t)?t.field="key":t={field:"key"}:!t.field&&t.op!=="count"?je("No field provided for sort aggregate op: "+t.op):e&&t.field&&t.op&&!Nze[t.op]&&je("Multiple domain scales can not be sorted using "+t.op)),t}function Kjt(t,e,n){const r=n.map(i=>{const o=e.getData(i.data);return o||i6(i.data),o.domainRef(e,i.field)});return zt(e.add(Ijt({values:r})))}function Zjt(t,e,n){const r=n.map(i=>{const o=e.getData(i.data);return o||i6(i.data),o.extentRef(e,i.field)});return zt(e.add(Djt({extents:r})))}function Jjt(t,e){return t.signal||We(t)?I3(t,e):e.objectProperty(t)}function e4t(t,e){return t.signal?e.signalRef(t.signal):ht(t)?{interval:su(t.interval),step:su(t.step)}:su(t)}function t4t(t,e){e.interpolate=su(t.type||t),t.gamma!=null&&(e.interpolateGamma=su(t.gamma))}function Bze(t,e,n){const r=e.config.range;let i=t.range;if(i.signal)return e.signalRef(i.signal);if(gt(i)){if(r&&vt(r,i))return t=cn({},t,{range:r[i]}),Bze(t,e,n);i==="width"?i=[0,{signal:"width"}]:i==="height"?i=zS(t.type)?[0,{signal:"height"}]:[{signal:"height"},0]:je("Unrecognized scale range value: "+rt(i))}else if(i.scheme){n.scheme=We(i.scheme)?I3(i.scheme,e):su(i.scheme,e),i.extent&&(n.schemeExtent=I3(i.extent,e)),i.count&&(n.schemeCount=su(i.count,e));return}else if(i.step){n.rangeStep=su(i.step,e);return}else{if(zS(t.type)&&!We(i))return zze(i,t,e);We(i)||je("Unsupported range type: "+rt(i))}return i.map(o=>(We(o)?I3:su)(o,e))}function n4t(t,e){const n=e.config.projection||{},r={};for(const i in t)i!=="name"&&(r[i]=gY(t[i],i,e));for(const i in n)r[i]==null&&(r[i]=gY(n[i],i,e));e.addProjection(t.name,r)}function gY(t,e,n){return We(t)?t.map(r=>gY(r,e,n)):ht(t)?t.signal?n.signalRef(t.signal):e==="fit"?t:je("Unsupported parameter object: "+rt(t)):t}const id="top",PO="left",MO="right",dy="bottom",Uze="center",r4t="vertical",i4t="start",o4t="middle",s4t="end",mY="index",Foe="label",a4t="offset",XS="perc",l4t="perc2",pu="value",DR="guide-label",Noe="guide-title",c4t="group-title",u4t="group-subtitle",Mve="symbol",L3="gradient",vY="discrete",yY="size",f4t="shape",d4t="fill",h4t="stroke",p4t="strokeWidth",g4t="strokeDash",m4t="opacity",zoe=[yY,f4t,d4t,h4t,p4t,g4t,m4t],IR={name:1,style:1,interactive:1},jn={value:0},gu={value:1},o6="group",Wze="rect",joe="rule",v4t="symbol",db="text";function HA(t){return t.type=o6,t.interactive=t.interactive||!1,t}function Ml(t,e){const n=(r,i)=>hf(t[r],hf(e[r],i));return n.isVertical=r=>r4t===hf(t.direction,e.direction||(r?e.symbolDirection:e.gradientDirection)),n.gradientLength=()=>hf(t.gradientLength,e.gradientLength||e.gradientWidth),n.gradientThickness=()=>hf(t.gradientThickness,e.gradientThickness||e.gradientHeight),n.entryColumns=()=>hf(t.columns,hf(e.columns,+n.isVertical(!0))),n}function Vze(t,e){const n=e&&(e.update&&e.update[t]||e.enter&&e.enter[t]);return n&&n.signal?n:n?n.value:null}function y4t(t,e,n){const r=e.config.style[n];return r&&r[t]}function s6(t,e,n){return`item.anchor === '${i4t}' ? ${t} : item.anchor === '${s4t}' ? ${e} : ${n}`}const Boe=s6(rt(PO),rt(MO),rt(Uze));function x4t(t){const e=t("tickBand");let n=t("tickOffset"),r,i;return e?e.signal?(r={signal:`(${e.signal}) === 'extent' ? 1 : 0.5`},i={signal:`(${e.signal}) === 'extent'`},ht(n)||(n={signal:`(${e.signal}) === 'extent' ? 0 : ${n}`})):e==="extent"?(r=1,i=!0,n=0):(r=.5,i=!1):(r=t("bandPosition"),i=t("tickExtra")),{extra:i,band:r,offset:n}}function Gze(t,e){return e?t?ht(t)?Object.assign({},t,{offset:Gze(t.offset,e)}):{value:t,offset:e}:e:t}function kc(t,e){return e?(t.name=e.name,t.style=e.style||t.style,t.interactive=!!e.interactive,t.encode=AO(t.encode,e,IR)):t.interactive=!1,t}function b4t(t,e,n,r){const i=Ml(t,n),o=i.isVertical(),s=i.gradientThickness(),a=i.gradientLength();let l,c,u,f,d;o?(c=[0,1],u=[0,0],f=s,d=a):(c=[0,0],u=[1,0],f=a,d=s);const h={enter:l={opacity:jn,x:jn,y:jn,width:No(f),height:No(d)},update:cn({},l,{opacity:gu,fill:{gradient:e,start:c,stop:u}}),exit:{opacity:jn}};return Ss(h,{stroke:i("gradientStrokeColor"),strokeWidth:i("gradientStrokeWidth")},{opacity:i("gradientOpacity")}),kc({type:Wze,role:qzt,encode:h},r)}function w4t(t,e,n,r,i){const o=Ml(t,n),s=o.isVertical(),a=o.gradientThickness(),l=o.gradientLength();let c,u,f,d,h="";s?(c="y",f="y2",u="x",d="width",h="1-"):(c="x",f="x2",u="y",d="height");const p={opacity:jn,fill:{scale:e,field:pu}};p[c]={signal:h+"datum."+XS,mult:l},p[u]=jn,p[f]={signal:h+"datum."+l4t,mult:l},p[d]=No(a);const g={enter:p,update:cn({},p,{opacity:gu}),exit:{opacity:jn}};return Ss(g,{stroke:o("gradientStrokeColor"),strokeWidth:o("gradientStrokeWidth")},{opacity:o("gradientOpacity")}),kc({type:Wze,role:Gzt,key:pu,from:i,encode:g},r)}const _4t=`datum.${XS}<=0?"${PO}":datum.${XS}>=1?"${MO}":"${Uze}"`,S4t=`datum.${XS}<=0?"${dy}":datum.${XS}>=1?"${id}":"${o4t}"`;function Rve(t,e,n,r){const i=Ml(t,e),o=i.isVertical(),s=No(i.gradientThickness()),a=i.gradientLength();let l=i("labelOverlap"),c,u,f,d,h="";const p={enter:c={opacity:jn},update:u={opacity:gu,text:{field:Foe}},exit:{opacity:jn}};return Ss(p,{fill:i("labelColor"),fillOpacity:i("labelOpacity"),font:i("labelFont"),fontSize:i("labelFontSize"),fontStyle:i("labelFontStyle"),fontWeight:i("labelFontWeight"),limit:hf(t.labelLimit,e.gradientLabelLimit)}),o?(c.align={value:"left"},c.baseline=u.baseline={signal:S4t},f="y",d="x",h="1-"):(c.align=u.align={signal:_4t},c.baseline={value:"top"},f="x",d="y"),c[f]=u[f]={signal:h+"datum."+XS,mult:a},c[d]=u[d]=s,s.offset=hf(t.labelOffset,e.gradientLabelOffset)||0,l=l?{separation:i("labelSeparation"),method:l,order:"datum."+mY}:void 0,kc({type:db,role:Eze,style:DR,key:pu,from:r,encode:p,overlap:l},n)}function C4t(t,e,n,r,i){const o=Ml(t,e),s=n.entries,a=!!(s&&s.interactive),l=s?s.name:void 0,c=o("clipHeight"),u=o("symbolOffset"),f={data:"value"},d=`(${i}) ? datum.${a4t} : datum.${yY}`,h=c?No(c):{field:yY},p=`datum.${mY}`,g=`max(1, ${i})`;let m,v,y,x,b;h.mult=.5,m={enter:v={opacity:jn,x:{signal:d,mult:.5,offset:u},y:h},update:y={opacity:gu,x:v.x,y:v.y},exit:{opacity:jn}};let w=null,_=null;t.fill||(w=e.symbolBaseFillColor,_=e.symbolBaseStrokeColor),Ss(m,{fill:o("symbolFillColor",w),shape:o("symbolType"),size:o("symbolSize"),stroke:o("symbolStrokeColor",_),strokeDash:o("symbolDash"),strokeDashOffset:o("symbolDashOffset"),strokeWidth:o("symbolStrokeWidth")},{opacity:o("symbolOpacity")}),zoe.forEach(E=>{t[E]&&(y[E]=v[E]={scale:t[E],field:pu})});const S=kc({type:v4t,role:Xzt,key:pu,from:f,clip:c?!0:void 0,encode:m},n.symbols),O=No(u);O.offset=o("labelOffset"),m={enter:v={opacity:jn,x:{signal:d,offset:O},y:h},update:y={opacity:gu,text:{field:Foe},x:v.x,y:v.y},exit:{opacity:jn}},Ss(m,{align:o("labelAlign"),baseline:o("labelBaseline"),fill:o("labelColor"),fillOpacity:o("labelOpacity"),font:o("labelFont"),fontSize:o("labelFontSize"),fontStyle:o("labelFontStyle"),fontWeight:o("labelFontWeight"),limit:o("labelLimit")});const k=kc({type:db,role:Eze,style:DR,key:pu,from:f,encode:m},n.labels);return m={enter:{noBound:{value:!c},width:jn,height:c?No(c):jn,opacity:jn},exit:{opacity:jn},update:y={opacity:gu,row:{signal:null},column:{signal:null}}},o.isVertical(!0)?(x=`ceil(item.mark.items.length / ${g})`,y.row.signal=`${p}%${x}`,y.column.signal=`floor(${p} / ${x})`,b={field:["row",p]}):(y.row.signal=`floor(${p} / ${g})`,y.column.signal=`${p} % ${g}`,b={field:p}),y.column.signal=`(${i})?${y.column.signal}:${p}`,r={facet:{data:r,name:"value",groupby:mY}},HA({role:Ioe,from:r,encode:AO(m,s,IR),marks:[S,k],name:l,interactive:a,sort:b})}function O4t(t,e){const n=Ml(t,e);return{align:n("gridAlign"),columns:n.entryColumns(),center:{row:!0,column:!1},padding:{row:n("rowPadding"),column:n("columnPadding")}}}const Uoe='item.orient === "left"',Woe='item.orient === "right"',a6=`(${Uoe} || ${Woe})`,E4t=`datum.vgrad && ${a6}`,T4t=s6('"top"','"bottom"','"middle"'),k4t=s6('"right"','"left"','"center"'),A4t=`datum.vgrad && ${Woe} ? (${k4t}) : (${a6} && !(datum.vgrad && ${Uoe})) ? "left" : ${Boe}`,P4t=`item._anchor || (${a6} ? "middle" : "start")`,M4t=`${E4t} ? (${Uoe} ? -90 : 90) : 0`,R4t=`${a6} ? (datum.vgrad ? (${Woe} ? "bottom" : "top") : ${T4t}) : "top"`;function D4t(t,e,n,r){const i=Ml(t,e),o={enter:{opacity:jn},update:{opacity:gu,x:{field:{group:"padding"}},y:{field:{group:"padding"}}},exit:{opacity:jn}};return Ss(o,{orient:i("titleOrient"),_anchor:i("titleAnchor"),anchor:{signal:P4t},angle:{signal:M4t},align:{signal:A4t},baseline:{signal:R4t},text:t.title,fill:i("titleColor"),fillOpacity:i("titleOpacity"),font:i("titleFont"),fontSize:i("titleFontSize"),fontStyle:i("titleFontStyle"),fontWeight:i("titleFontWeight"),limit:i("titleLimit"),lineHeight:i("titleLineHeight")},{align:i("titleAlign"),baseline:i("titleBaseline")}),kc({type:db,role:Yzt,style:Noe,from:r,encode:o},n)}function I4t(t,e){let n;return ht(t)&&(t.signal?n=t.signal:t.path?n="pathShape("+Dve(t.path)+")":t.sphere&&(n="geoShape("+Dve(t.sphere)+', {type: "Sphere"})')),n?e.signalRef(n):!!t}function Dve(t){return ht(t)&&t.signal?t.signal:rt(t)}function Hze(t){const e=t.role||"";return e.startsWith("axis")||e.startsWith("legend")||e.startsWith("title")?e:t.type===o6?Ioe:e||Roe}function L4t(t){return{marktype:t.type,name:t.name||void 0,role:t.role||Hze(t),zindex:+t.zindex||void 0,aria:t.aria,description:t.description}}function $4t(t,e){return t&&t.signal?e.signalRef(t.signal):t!==!1}function Voe(t,e){const n=_Le(t.type);n||je("Unrecognized transform type: "+rt(t.type));const r=n6(n.type.toLowerCase(),null,qze(n,t,e));return t.signal&&e.addSignal(t.signal,e.proxy(r)),r.metadata=n.metadata||{},r}function qze(t,e,n){const r={},i=t.params.length;for(let o=0;oIve(t,o,n)):Ive(t,i,n)}function Ive(t,e,n){const r=t.type;if(Oo(e))return $ve(r)?je("Expression references can not be signals."):FV(r)?n.fieldRef(e):Fve(r)?n.compareRef(e):n.signalRef(e.signal);{const i=t.expr||FV(r);return i&&j4t(e)?n.exprRef(e.expr,e.as):i&&B4t(e)?VA(e.field,e.as):$ve(r)?Mh(e,n):U4t(r)?zt(n.getData(e).values):FV(r)?VA(e):Fve(r)?n.compareRef(e):e}}function N4t(t,e,n){return gt(e.from)||je('Lookup "from" parameter must be a string literal.'),n.getData(e.from).lookupRef(n,e.key)}function z4t(t,e,n){const r=e[t.name];return t.array?(We(r)||je("Expected an array of sub-parameters. Instead: "+rt(r)),r.map(i=>Lve(t,i,n))):Lve(t,r,n)}function Lve(t,e,n){const r=t.params.length;let i;for(let s=0;st&&t.expr,B4t=t=>t&&t.field,U4t=t=>t==="data",$ve=t=>t==="expr",FV=t=>t==="field",Fve=t=>t==="compare";function W4t(t,e,n){let r,i,o,s,a;return t?(r=t.facet)&&(e||je("Only group marks can be faceted."),r.field!=null?s=a=$3(r,n):(t.data?a=zt(n.getData(t.data).aggregate):(o=Voe(cn({type:"aggregate",groupby:pt(r.groupby)},r.aggregate),n),o.params.key=n.keyRef(r.groupby),o.params.pulse=$3(r,n),s=a=zt(n.add(o))),i=n.keyRef(r.groupby,!0))):s=zt(n.add(rd(null,[{}]))),s||(s=$3(t,n)),{key:i,pulse:s,parent:a}}function $3(t,e){return t.$ref?t:t.data&&t.data.$ref?t.data:zt(e.getData(t.data).output)}function b1(t,e,n,r,i){this.scope=t,this.input=e,this.output=n,this.values=r,this.aggregate=i,this.index={}}b1.fromEntries=function(t,e){const n=e.length,r=e[n-1],i=e[n-2];let o=e[0],s=null,a=1;for(o&&o.type==="load"&&(o=e[1]),t.add(e[0]);af??"null").join(",")+"),0)",u=Mh(c,e);l.update=u.$expr,l.params=u.$params}function l6(t,e){const n=Hze(t),r=t.type===o6,i=t.from&&t.from.facet,o=t.overlap;let s=t.layout||n===Ioe||n===Doe,a,l,c,u,f,d,h;const p=n===Roe||s||i,g=W4t(t.from,r,e);l=e.add(Ojt({key:g.key||(t.key?VA(t.key):void 0),pulse:g.pulse,clean:!r}));const m=zt(l);l=c=e.add(rd({pulse:m})),l=e.add(Rjt({markdef:L4t(t),interactive:$4t(t.interactive,e),clip:I4t(t.clip,e),context:{$context:!0},groups:e.lookup(),parent:e.signals.parent?e.signalRef("parent"):null,index:e.markpath(),pulse:zt(l)}));const v=zt(l);l=u=e.add(Ize(Pze(t.encode,t.type,n,t.style,e,{mod:!1,pulse:v}))),l.params.parent=e.encode(),t.transform&&t.transform.forEach(_=>{const S=Voe(_,e),O=S.metadata;(O.generates||O.changes)&&je("Mark transforms should not generate new data."),O.nomod||(u.params.mod=!0),S.params.pulse=zt(l),e.add(l=S)}),t.sort&&(l=e.add(Bjt({sort:e.compareRef(t.sort),pulse:zt(l)})));const y=zt(l);(i||s)&&(s=e.add(Fze({layout:e.objectProperty(t.layout),legends:e.legends,mark:v,pulse:y})),d=zt(s));const x=e.add(Dze({mark:v,pulse:d||y}));h=zt(x),r&&(p&&(a=e.operators,a.pop(),s&&a.pop()),e.pushState(y,d||h,m),i?V4t(t,e,g):p?G4t(t,e,g):e.parse(t),e.popState(),p&&(s&&a.push(s),a.push(x))),o&&(h=H4t(o,h,e));const b=e.add($ze({pulse:h})),w=e.add(fb({pulse:zt(b)},void 0,e.parent()));t.name!=null&&(f=t.name,e.addData(f,new b1(e,c,b,w)),t.on&&t.on.forEach(_=>{(_.insert||_.remove||_.toggle)&&je("Marks only support modify triggers."),Yze(_,e,f)}))}function H4t(t,e,n){const r=t.method,i=t.bound,o=t.separation,s={separation:Oo(o)?n.signalRef(o.signal):o,method:Oo(r)?n.signalRef(r.signal):r,pulse:e};if(t.order&&(s.sort=n.compareRef({field:t.order})),i){const a=i.tolerance;s.boundTolerance=Oo(a)?n.signalRef(a.signal):+a,s.boundScale=n.scaleRef(i.scale),s.boundOrient=i.orient}return zt(n.add(Ljt(s)))}function q4t(t,e){const n=e.config.legend,r=t.encode||{},i=Ml(t,n),o=r.legend||{},s=o.name||void 0,a=o.interactive,l=o.style,c={};let u=0,f,d,h;zoe.forEach(x=>t[x]?(c[x]=t[x],u=u||t[x]):0),u||je("Missing valid scale for legend.");const p=X4t(t,e.scaleType(u)),g={title:t.title!=null,scales:c,type:p,vgrad:p!=="symbol"&&i.isVertical()},m=zt(e.add(rd(null,[g]))),v={enter:{x:{value:0},y:{value:0}}},y=zt(e.add(Pjt(d={type:p,scale:e.scaleRef(u),count:e.objectProperty(i("tickCount")),limit:e.property(i("symbolLimit")),values:e.objectProperty(t.values),minstep:e.property(t.tickMinStep),formatType:e.property(t.formatType),formatSpecifier:e.property(t.format)})));return p===L3?(h=[b4t(t,u,n,r.gradient),Rve(t,n,r.labels,y)],d.count=d.count||e.signalRef(`max(2,2*floor((${jx(i.gradientLength())})/100))`)):p===vY?h=[w4t(t,u,n,r.gradient,y),Rve(t,n,r.labels,y)]:(f=O4t(t,n),h=[C4t(t,n,r,y,jx(f.columns))],d.size=K4t(t,e,h[0].marks)),h=[HA({role:Hzt,from:m,encode:v,marks:h,layout:f,interactive:a})],g.title&&h.push(D4t(t,n,r.title,m)),l6(HA({role:Vzt,from:m,encode:AO(Q4t(i,t,n),o,IR),marks:h,aria:i("aria"),description:i("description"),zindex:i("zindex"),name:s,interactive:a,style:l}),e)}function X4t(t,e){let n=t.type||Mve;return!t.type&&Y4t(t)===1&&(t.fill||t.stroke)&&(n=Wre(e)?L3:cX(e)?vY:Mve),n!==L3?n:cX(e)?vY:L3}function Y4t(t){return zoe.reduce((e,n)=>e+(t[n]?1:0),0)}function Q4t(t,e,n){const r={enter:{},update:{}};return Ss(r,{orient:t("orient"),offset:t("offset"),padding:t("padding"),titlePadding:t("titlePadding"),cornerRadius:t("cornerRadius"),fill:t("fillColor"),stroke:t("strokeColor"),strokeWidth:n.strokeWidth,strokeDash:n.strokeDash,x:t("legendX"),y:t("legendY"),format:e.format,formatType:e.formatType}),r}function K4t(t,e,n){const r=jx(zve("size",t,n)),i=jx(zve("strokeWidth",t,n)),o=jx(Z4t(n[1].encode,e,DR));return Mh(`max(ceil(sqrt(${r})+${i}),${o})`,e)}function zve(t,e,n){return e[t]?`scale("${e[t]}",datum)`:Vze(t,n[0].encode)}function Z4t(t,e,n){return Vze("fontSize",t)||y4t("fontSize",e,n)}const J4t=`item.orient==="${PO}"?-90:item.orient==="${MO}"?90:0`;function eBt(t,e){t=gt(t)?{text:t}:t;const n=Ml(t,e.config.title),r=t.encode||{},i=r.group||{},o=i.name||void 0,s=i.interactive,a=i.style,l=[],c={},u=zt(e.add(rd(null,[c])));return l.push(rBt(t,n,tBt(t),u)),t.subtitle&&l.push(iBt(t,n,r.subtitle,u)),l6(HA({role:Qzt,from:u,encode:nBt(n,i),marks:l,aria:n("aria"),description:n("description"),zindex:n("zindex"),name:o,interactive:s,style:a}),e)}function tBt(t){const e=t.encode;return e&&e.title||cn({name:t.name,interactive:t.interactive,style:t.style},e)}function nBt(t,e){const n={enter:{},update:{}};return Ss(n,{orient:t("orient"),anchor:t("anchor"),align:{signal:Boe},angle:{signal:J4t},limit:t("limit"),frame:t("frame"),offset:t("offset")||0,padding:t("subtitlePadding")}),AO(n,e,IR)}function rBt(t,e,n,r){const i={value:0},o=t.text,s={enter:{opacity:i},update:{opacity:{value:1}},exit:{opacity:i}};return Ss(s,{text:o,align:{signal:"item.mark.group.align"},angle:{signal:"item.mark.group.angle"},limit:{signal:"item.mark.group.limit"},baseline:"top",dx:e("dx"),dy:e("dy"),fill:e("color"),font:e("font"),fontSize:e("fontSize"),fontStyle:e("fontStyle"),fontWeight:e("fontWeight"),lineHeight:e("lineHeight")},{align:e("align"),angle:e("angle"),baseline:e("baseline")}),kc({type:db,role:Kzt,style:c4t,from:r,encode:s},n)}function iBt(t,e,n,r){const i={value:0},o=t.subtitle,s={enter:{opacity:i},update:{opacity:{value:1}},exit:{opacity:i}};return Ss(s,{text:o,align:{signal:"item.mark.group.align"},angle:{signal:"item.mark.group.angle"},limit:{signal:"item.mark.group.limit"},baseline:"top",dx:e("dx"),dy:e("dy"),fill:e("subtitleColor"),font:e("subtitleFont"),fontSize:e("subtitleFontSize"),fontStyle:e("subtitleFontStyle"),fontWeight:e("subtitleFontWeight"),lineHeight:e("subtitleLineHeight")},{align:e("align"),angle:e("angle"),baseline:e("baseline")}),kc({type:db,role:Zzt,style:u4t,from:r,encode:s},n)}function oBt(t,e){const n=[];t.transform&&t.transform.forEach(r=>{n.push(Voe(r,e))}),t.on&&t.on.forEach(r=>{Yze(r,e,t.name)}),e.addDataPipeline(t.name,sBt(t,e,n))}function sBt(t,e,n){const r=[];let i=null,o=!1,s=!1,a,l,c,u,f;for(t.values?Oo(t.values)||D3(t.format)?(r.push(jve(e,t)),r.push(i=m0())):r.push(i=m0({$ingest:t.values,$format:t.format})):t.url?D3(t.url)||D3(t.format)?(r.push(jve(e,t)),r.push(i=m0())):r.push(i=m0({$request:t.url,$format:t.format})):t.source&&(i=a=pt(t.source).map(d=>zt(e.getData(d).output)),r.push(null)),l=0,c=n.length;lt===dy||t===id,c6=(t,e,n)=>Oo(t)?uBt(t.signal,e,n):t===PO||t===id?e:n,zo=(t,e,n)=>Oo(t)?lBt(t.signal,e,n):Qze(t)?e:n,Lf=(t,e,n)=>Oo(t)?cBt(t.signal,e,n):Qze(t)?n:e,Kze=(t,e,n)=>Oo(t)?fBt(t.signal,e,n):t===id?{value:e}:{value:n},aBt=(t,e,n)=>Oo(t)?dBt(t.signal,e,n):t===MO?{value:e}:{value:n},lBt=(t,e,n)=>Zze(`${t} === '${id}' || ${t} === '${dy}'`,e,n),cBt=(t,e,n)=>Zze(`${t} !== '${id}' && ${t} !== '${dy}'`,e,n),uBt=(t,e,n)=>Goe(`${t} === '${PO}' || ${t} === '${id}'`,e,n),fBt=(t,e,n)=>Goe(`${t} === '${id}'`,e,n),dBt=(t,e,n)=>Goe(`${t} === '${MO}'`,e,n),Zze=(t,e,n)=>(e=e!=null?No(e):e,n=n!=null?No(n):n,Bve(e)&&Bve(n)?(e=e?e.signal||rt(e.value):null,n=n?n.signal||rt(n.value):null,{signal:`${t} ? (${e}) : (${n})`}):[cn({test:t},e)].concat(n||[])),Bve=t=>t==null||Object.keys(t).length===1,Goe=(t,e,n)=>({signal:`${t} ? (${d_(e)}) : (${d_(n)})`}),hBt=(t,e,n,r,i)=>({signal:(r!=null?`${t} === '${PO}' ? (${d_(r)}) : `:"")+(n!=null?`${t} === '${dy}' ? (${d_(n)}) : `:"")+(i!=null?`${t} === '${MO}' ? (${d_(i)}) : `:"")+(e!=null?`${t} === '${id}' ? (${d_(e)}) : `:"")+"(null)"}),d_=t=>Oo(t)?t.signal:t==null?null:rt(t),pBt=(t,e)=>e===0?0:Oo(t)?{signal:`(${t.signal}) * ${e}`}:{value:t*e},F_=(t,e)=>{const n=t.signal;return n&&n.endsWith("(null)")?{signal:n.slice(0,-6)+e.signal}:t};function ew(t,e,n,r){let i;if(e&&vt(e,t))return e[t];if(vt(n,t))return n[t];if(t.startsWith("title")){switch(t){case"titleColor":i="fill";break;case"titleFont":case"titleFontSize":case"titleFontWeight":i=t[5].toLowerCase()+t.slice(6)}return r[Noe][i]}else if(t.startsWith("label")){switch(t){case"labelColor":i="fill";break;case"labelFont":case"labelFontSize":i=t[5].toLowerCase()+t.slice(6)}return r[DR][i]}return null}function Uve(t){const e={};for(const n of t)if(n)for(const r in n)e[r]=1;return Object.keys(e)}function gBt(t,e){var n=e.config,r=n.style,i=n.axis,o=e.scaleType(t.scale)==="band"&&n.axisBand,s=t.orient,a,l,c;if(Oo(s)){const f=Uve([n.axisX,n.axisY]),d=Uve([n.axisTop,n.axisBottom,n.axisLeft,n.axisRight]);a={};for(c of f)a[c]=zo(s,ew(c,n.axisX,i,r),ew(c,n.axisY,i,r));l={};for(c of d)l[c]=hBt(s.signal,ew(c,n.axisTop,i,r),ew(c,n.axisBottom,i,r),ew(c,n.axisLeft,i,r),ew(c,n.axisRight,i,r))}else a=s===id||s===dy?n.axisX:n.axisY,l=n["axis"+s[0].toUpperCase()+s.slice(1)];return a||l||o?cn({},i,a,l,o):i}function mBt(t,e,n,r){const i=Ml(t,e),o=t.orient;let s,a;const l={enter:s={opacity:jn},update:a={opacity:gu},exit:{opacity:jn}};Ss(l,{stroke:i("domainColor"),strokeCap:i("domainCap"),strokeDash:i("domainDash"),strokeDashOffset:i("domainDashOffset"),strokeWidth:i("domainWidth"),strokeOpacity:i("domainOpacity")});const c=Wve(t,0),u=Wve(t,1);return s.x=a.x=zo(o,c,jn),s.x2=a.x2=zo(o,u),s.y=a.y=Lf(o,c,jn),s.y2=a.y2=Lf(o,u),kc({type:joe,role:zzt,from:r,encode:l},n)}function Wve(t,e){return{scale:t.scale,range:e}}function vBt(t,e,n,r,i){const o=Ml(t,e),s=t.orient,a=t.gridScale,l=c6(s,1,-1),c=yBt(t.offset,l);let u,f,d;const h={enter:u={opacity:jn},update:d={opacity:gu},exit:f={opacity:jn}};Ss(h,{stroke:o("gridColor"),strokeCap:o("gridCap"),strokeDash:o("gridDash"),strokeDashOffset:o("gridDashOffset"),strokeOpacity:o("gridOpacity"),strokeWidth:o("gridWidth")});const p={scale:t.scale,field:pu,band:i.band,extra:i.extra,offset:i.offset,round:o("tickRound")},g=zo(s,{signal:"height"},{signal:"width"}),m=a?{scale:a,range:0,mult:l,offset:c}:{value:0,offset:c},v=a?{scale:a,range:1,mult:l,offset:c}:cn(g,{mult:l,offset:c});return u.x=d.x=zo(s,p,m),u.y=d.y=Lf(s,p,m),u.x2=d.x2=Lf(s,v),u.y2=d.y2=zo(s,v),f.x=zo(s,p),f.y=Lf(s,p),kc({type:joe,role:jzt,key:pu,from:r,encode:h},n)}function yBt(t,e){if(e!==1)if(!ht(t))t=Oo(e)?{signal:`(${e.signal}) * (${t||0})`}:e*(t||0);else{let n=t=cn({},t);for(;n.mult!=null;)if(ht(n.mult))n=n.mult=cn({},n.mult);else return n.mult=Oo(e)?{signal:`(${n.mult}) * (${e.signal})`}:n.mult*e,t;n.mult=e}return t}function xBt(t,e,n,r,i,o){const s=Ml(t,e),a=t.orient,l=c6(a,-1,1);let c,u,f;const d={enter:c={opacity:jn},update:f={opacity:gu},exit:u={opacity:jn}};Ss(d,{stroke:s("tickColor"),strokeCap:s("tickCap"),strokeDash:s("tickDash"),strokeDashOffset:s("tickDashOffset"),strokeOpacity:s("tickOpacity"),strokeWidth:s("tickWidth")});const h=No(i);h.mult=l;const p={scale:t.scale,field:pu,band:o.band,extra:o.extra,offset:o.offset,round:s("tickRound")};return f.y=c.y=zo(a,jn,p),f.y2=c.y2=zo(a,h),u.x=zo(a,p),f.x=c.x=Lf(a,jn,p),f.x2=c.x2=Lf(a,h),u.y=Lf(a,p),kc({type:joe,role:Uzt,key:pu,from:r,encode:d},n)}function NV(t,e,n,r,i){return{signal:'flush(range("'+t+'"), scale("'+t+'", datum.value), '+e+","+n+","+r+","+i+")"}}function bBt(t,e,n,r,i,o){const s=Ml(t,e),a=t.orient,l=t.scale,c=c6(a,-1,1),u=jx(s("labelFlush")),f=jx(s("labelFlushOffset")),d=s("labelAlign"),h=s("labelBaseline");let p=u===0||!!u,g;const m=No(i);m.mult=c,m.offset=No(s("labelPadding")||0),m.offset.mult=c;const v={scale:l,field:pu,band:.5,offset:Gze(o.offset,s("labelOffset"))},y=zo(a,p?NV(l,u,'"left"','"right"','"center"'):{value:"center"},aBt(a,"left","right")),x=zo(a,Kze(a,"bottom","top"),p?NV(l,u,'"top"','"bottom"','"middle"'):{value:"middle"}),b=NV(l,u,`-(${f})`,f,0);p=p&&f;const w={opacity:jn,x:zo(a,v,m),y:Lf(a,v,m)},_={enter:w,update:g={opacity:gu,text:{field:Foe},x:w.x,y:w.y,align:y,baseline:x},exit:{opacity:jn,x:w.x,y:w.y}};Ss(_,{dx:!d&&p?zo(a,b):null,dy:!h&&p?Lf(a,b):null}),Ss(_,{angle:s("labelAngle"),fill:s("labelColor"),fillOpacity:s("labelOpacity"),font:s("labelFont"),fontSize:s("labelFontSize"),fontWeight:s("labelFontWeight"),fontStyle:s("labelFontStyle"),limit:s("labelLimit"),lineHeight:s("labelLineHeight")},{align:d,baseline:h});const S=s("labelBound");let O=s("labelOverlap");return O=O||S?{separation:s("labelSeparation"),method:O,order:"datum.index",bound:S?{scale:l,orient:a,tolerance:S}:null}:void 0,g.align!==y&&(g.align=F_(g.align,y)),g.baseline!==x&&(g.baseline=F_(g.baseline,x)),kc({type:db,role:Bzt,style:DR,key:pu,from:r,encode:_,overlap:O},n)}function wBt(t,e,n,r){const i=Ml(t,e),o=t.orient,s=c6(o,-1,1);let a,l;const c={enter:a={opacity:jn,anchor:No(i("titleAnchor",null)),align:{signal:Boe}},update:l=cn({},a,{opacity:gu,text:No(t.title)}),exit:{opacity:jn}},u={signal:`lerp(range("${t.scale}"), ${s6(0,1,.5)})`};return l.x=zo(o,u),l.y=Lf(o,u),a.angle=zo(o,jn,pBt(s,90)),a.baseline=zo(o,Kze(o,dy,id),{value:dy}),l.angle=a.angle,l.baseline=a.baseline,Ss(c,{fill:i("titleColor"),fillOpacity:i("titleOpacity"),font:i("titleFont"),fontSize:i("titleFontSize"),fontStyle:i("titleFontStyle"),fontWeight:i("titleFontWeight"),limit:i("titleLimit"),lineHeight:i("titleLineHeight")},{align:i("titleAlign"),angle:i("titleAngle"),baseline:i("titleBaseline")}),_Bt(i,o,c,n),c.update.align=F_(c.update.align,a.align),c.update.angle=F_(c.update.angle,a.angle),c.update.baseline=F_(c.update.baseline,a.baseline),kc({type:db,role:Wzt,style:Noe,from:r,encode:c},n)}function _Bt(t,e,n,r){const i=(a,l)=>a!=null?(n.update[l]=F_(No(a),n.update[l]),!1):!Nw(l,r),o=i(t("titleX"),"x"),s=i(t("titleY"),"y");n.enter.auto=s===o?No(s):zo(e,No(s),No(o))}function SBt(t,e){const n=gBt(t,e),r=t.encode||{},i=r.axis||{},o=i.name||void 0,s=i.interactive,a=i.style,l=Ml(t,n),c=x4t(l),u={scale:t.scale,ticks:!!l("ticks"),labels:!!l("labels"),grid:!!l("grid"),domain:!!l("domain"),title:t.title!=null},f=zt(e.add(rd({},[u]))),d=zt(e.add(Cjt({scale:e.scaleRef(t.scale),extra:e.property(c.extra),count:e.objectProperty(t.tickCount),values:e.objectProperty(t.values),minstep:e.property(t.tickMinStep),formatType:e.property(t.formatType),formatSpecifier:e.property(t.format)}))),h=[];let p;return u.grid&&h.push(vBt(t,n,r.grid,d,c)),u.ticks&&(p=l("tickSize"),h.push(xBt(t,n,r.ticks,d,p,c))),u.labels&&(p=u.ticks?p:0,h.push(bBt(t,n,r.labels,d,p,c))),u.domain&&h.push(mBt(t,n,r.domain,f)),u.title&&h.push(wBt(t,n,r.title,f)),l6(HA({role:Nzt,from:f,encode:AO(CBt(l,t),i,IR),marks:h,aria:l("aria"),description:l("description"),zindex:l("zindex"),name:o,interactive:s,style:a}),e)}function CBt(t,e){const n={enter:{},update:{}};return Ss(n,{orient:t("orient"),offset:t("offset")||0,position:hf(e.position,0),titlePadding:t("titlePadding"),minExtent:t("minExtent"),maxExtent:t("maxExtent"),range:{signal:`abs(span(range("${e.scale}")))`},translate:t("translate"),format:e.format,formatType:e.formatType}),n}function Jze(t,e,n){const r=pt(t.signals),i=pt(t.scales);return n||r.forEach(o=>Mze(o,e)),pt(t.projections).forEach(o=>n4t(o,e)),i.forEach(o=>Vjt(o,e)),pt(t.data).forEach(o=>oBt(o,e)),i.forEach(o=>Gjt(o,e)),(n||r).forEach(o=>Sjt(o,e)),pt(t.axes).forEach(o=>SBt(o,e)),pt(t.marks).forEach(o=>l6(o,e)),pt(t.legends).forEach(o=>q4t(o,e)),t.title&&eBt(t.title,e),e.parseLambdas(),e}const OBt=t=>AO({enter:{x:{value:0},y:{value:0}},update:{width:{signal:"width"},height:{signal:"height"}}},t);function EBt(t,e){const n=e.config,r=zt(e.root=e.add(D5())),i=TBt(t,n);i.forEach(c=>Mze(c,e)),e.description=t.description||n.description,e.eventConfig=n.events,e.legends=e.objectProperty(n.legend&&n.legend.layout),e.locale=n.locale;const o=e.add(rd()),s=e.add(Ize(Pze(OBt(t.encode),o6,Doe,t.style,e,{pulse:zt(o)}))),a=e.add(Fze({layout:e.objectProperty(t.layout),legends:e.legends,autosize:e.signalRef("autosize"),mark:r,pulse:zt(s)}));e.operators.pop(),e.pushState(zt(s),zt(a),null),Jze(t,e,i),e.operators.push(a);let l=e.add(Dze({mark:r,pulse:zt(a)}));return l=e.add($ze({pulse:zt(l)})),l=e.add(fb({pulse:zt(l)})),e.addData("root",new b1(e,o,o,l)),e}function s2(t,e){return e&&e.signal?{name:t,update:e.signal}:{name:t,value:e}}function TBt(t,e){const n=s=>hf(t[s],e[s]),r=[s2("background",n("background")),s2("autosize",Lzt(n("autosize"))),s2("padding",Fzt(n("padding"))),s2("width",n("width")||0),s2("height",n("height")||0)],i=r.reduce((s,a)=>(s[a.name]=a,s),{}),o={};return pt(t.signals).forEach(s=>{vt(i,s.name)?s=cn(i[s.name],s):r.push(s),o[s.name]=s}),pt(e.signals).forEach(s=>{!vt(o,s.name)&&!vt(i,s.name)&&r.push(s)}),r}function eje(t,e){this.config=t||{},this.options=e||{},this.bindings=[],this.field={},this.signals={},this.lambdas={},this.scales={},this.events={},this.data={},this.streams=[],this.updates=[],this.operators=[],this.eventConfig=null,this.locale=null,this._id=0,this._subid=0,this._nextsub=[0],this._parent=[],this._encode=[],this._lookup=[],this._markpath=[]}function Vve(t){this.config=t.config,this.options=t.options,this.legends=t.legends,this.field=Object.create(t.field),this.signals=Object.create(t.signals),this.lambdas=Object.create(t.lambdas),this.scales=Object.create(t.scales),this.events=Object.create(t.events),this.data=Object.create(t.data),this.streams=[],this.updates=[],this.operators=[],this._id=0,this._subid=++t._nextsub[0],this._nextsub=t._nextsub,this._parent=t._parent.slice(),this._encode=t._encode.slice(),this._lookup=t._lookup.slice(),this._markpath=t._markpath}eje.prototype=Vve.prototype={parse(t){return Jze(t,this)},fork(){return new Vve(this)},isSubscope(){return this._subid>0},toRuntime(){return this.finish(),{description:this.description,operators:this.operators,streams:this.streams,updates:this.updates,bindings:this.bindings,eventConfig:this.eventConfig,locale:this.locale}},id(){return(this._subid?this._subid+":":0)+this._id++},add(t){return this.operators.push(t),t.id=this.id(),t.refs&&(t.refs.forEach(e=>{e.$ref=t.id}),t.refs=null),t},proxy(t){const e=t instanceof dY?zt(t):t;return this.add(Njt({value:e}))},addStream(t){return this.streams.push(t),t.id=this.id(),t},addUpdate(t){return this.updates.push(t),t},finish(){let t,e;this.root&&(this.root.root=!0);for(t in this.signals)this.signals[t].signal=t;for(t in this.scales)this.scales[t].scale=t;function n(r,i,o){let s,a;r&&(s=r.data||(r.data={}),a=s[i]||(s[i]=[]),a.push(o))}for(t in this.data){e=this.data[t],n(e.input,t,"input"),n(e.output,t,"output"),n(e.values,t,"values");for(const r in e.index)n(e.index[r],t,"index:"+r)}return this},pushState(t,e,n){this._encode.push(zt(this.add(fb({pulse:t})))),this._parent.push(e),this._lookup.push(n?zt(this.proxy(n)):null),this._markpath.push(-1)},popState(){this._encode.pop(),this._parent.pop(),this._lookup.pop(),this._markpath.pop()},parent(){return $n(this._parent)},encode(){return $n(this._encode)},lookup(){return $n(this._lookup)},markpath(){const t=this._markpath;return++t[t.length-1]},fieldRef(t,e){if(gt(t))return VA(t,e);t.signal||je("Unsupported field reference: "+rt(t));const n=t.signal;let r=this.field[n];if(!r){const i={name:this.signalRef(n)};e&&(i.as=e),this.field[n]=r=zt(this.add(kjt(i)))}return r},compareRef(t){let e=!1;const n=o=>Oo(o)?(e=!0,this.signalRef(o.signal)):hjt(o)?(e=!0,this.exprRef(o.expr)):o,r=pt(t.field).map(n),i=pt(t.order).map(n);return e?zt(this.add(Pve({fields:r,orders:i}))):kve(r,i)},keyRef(t,e){let n=!1;const r=o=>Oo(o)?(n=!0,zt(i[o.signal])):o,i=this.signals;return t=pt(t).map(r),n?zt(this.add(Ajt({fields:t,flat:e}))):cjt(t,e)},sortRef(t){if(!t)return t;const e=r6(t.op,t.field),n=t.order||ujt;return n.signal?zt(this.add(Pve({fields:e,orders:this.signalRef(n.signal)}))):kve(e,n)},event(t,e){const n=t+":"+e;if(!this.events[n]){const r=this.id();this.streams.push({id:r,source:t,type:e}),this.events[n]=r}return this.events[n]},hasOwnSignal(t){return vt(this.signals,t)},addSignal(t,e){this.hasOwnSignal(t)&&je("Duplicate signal name: "+rt(t));const n=e instanceof dY?e:this.add(D5(e));return this.signals[t]=n},getSignal(t){return this.signals[t]||je("Unrecognized signal name: "+rt(t)),this.signals[t]},signalRef(t){return this.signals[t]?zt(this.signals[t]):(vt(this.lambdas,t)||(this.lambdas[t]=this.add(D5(null))),zt(this.lambdas[t]))},parseLambdas(){const t=Object.keys(this.lambdas);for(let e=0,n=t.length;e0?",":"")+(ht(i)?i.signal||Hoe(i):rt(i))}return n+"]"}function ABt(t){let e="{",n=0,r,i;for(r in t)i=t[r],e+=(++n>1?",":"")+rt(r)+":"+(ht(i)?i.signal||Hoe(i):rt(i));return e+"}"}function PBt(){const t="sans-serif",r="#4c78a8",i="#000",o="#888",s="#ddd";return{description:"Vega visualization",padding:0,autosize:"pad",background:null,events:{defaults:{allow:["wheel"]}},group:null,mark:null,arc:{fill:r},area:{fill:r},image:null,line:{stroke:r,strokeWidth:2},path:{stroke:r},rect:{fill:r},rule:{stroke:i},shape:{stroke:r},symbol:{fill:r,size:64},text:{fill:i,font:t,fontSize:11},trail:{fill:r,size:2},style:{"guide-label":{fill:i,font:t,fontSize:10},"guide-title":{fill:i,font:t,fontSize:11,fontWeight:"bold"},"group-title":{fill:i,font:t,fontSize:13,fontWeight:"bold"},"group-subtitle":{fill:i,font:t,fontSize:12},point:{size:30,strokeWidth:2,shape:"circle"},circle:{size:30,strokeWidth:2},square:{size:30,strokeWidth:2,shape:"square"},cell:{fill:"transparent",stroke:s},view:{fill:"transparent"}},title:{orient:"top",anchor:"middle",offset:4,subtitlePadding:3},axis:{minExtent:0,maxExtent:200,bandPosition:.5,domain:!0,domainWidth:1,domainColor:o,grid:!1,gridWidth:1,gridColor:s,labels:!0,labelAngle:0,labelLimit:180,labelOffset:0,labelPadding:2,ticks:!0,tickColor:o,tickOffset:0,tickRound:!0,tickSize:5,tickWidth:1,titlePadding:4},axisBand:{tickOffset:-.5},projection:{type:"mercator"},legend:{orient:"right",padding:0,gridAlign:"each",columnPadding:10,rowPadding:2,symbolDirection:"vertical",gradientDirection:"vertical",gradientLength:200,gradientThickness:16,gradientStrokeColor:s,gradientStrokeWidth:0,gradientLabelOffset:2,labelAlign:"left",labelBaseline:"middle",labelLimit:160,labelOffset:4,labelOverlap:!0,symbolLimit:30,symbolType:"circle",symbolSize:100,symbolOffset:0,symbolStrokeWidth:1.5,symbolBaseFillColor:"transparent",symbolBaseStrokeColor:o,titleLimit:180,titleOrient:"top",titlePadding:5,layout:{offset:18,direction:"horizontal",left:{direction:"vertical"},right:{direction:"vertical"}}},range:{category:{scheme:"tableau10"},ordinal:{scheme:"blues"},heatmap:{scheme:"yellowgreenblue"},ramp:{scheme:"blues"},diverging:{scheme:"blueorange",extent:[1,0]},symbol:["circle","square","triangle-up","cross","diamond","triangle-right","triangle-down","triangle-left"]}}}function MBt(t,e,n){return ht(t)||je("Input Vega specification must be an object."),e=mO(PBt(),e,t.config),EBt(t,new eje(e,n)).toRuntime()}var RBt="5.30.0";cn(IS,C2t,iRt,$Rt,wIt,gLt,U$t,w$t,V$t,p3t,C3t,M3t);const DBt=Object.freeze(Object.defineProperty({__proto__:null,Bounds:fo,CanvasHandler:CR,CanvasRenderer:qN,DATE:Sl,DAY:qs,DAYOFYEAR:Ah,Dataflow:D_,Debug:VDe,Error:qte,EventStream:sB,Gradient:U3e,GroupItem:DB,HOURS:Oc,Handler:pie,HybridHandler:DFe,HybridRenderer:bX,Info:WDe,Item:RB,MILLISECONDS:Vf,MINUTES:Ec,MONTH:Zs,Marks:Tc,MultiPulse:yne,None:UDe,Operator:Ir,Parameters:oB,Pulse:jv,QUARTER:_l,RenderType:gv,Renderer:SR,ResourceLoader:Y3e,SECONDS:ku,SVGHandler:bFe,SVGRenderer:bie,SVGStringRenderer:RFe,Scenegraph:dFe,TIME_UNITS:lne,Transform:Re,View:yze,WEEK:_o,Warn:Xte,YEAR:xs,accessor:Pl,accessorFields:Ks,accessorName:Ni,array:pt,ascending:X4,bandwidthNRD:_ne,bin:OLe,bootstrapCI:ELe,boundClip:WFe,boundContext:xR,boundItem:gX,boundMark:lFe,boundStroke:Yg,changeset:lb,clampRange:tIe,codegenExpression:G5e,compare:Jte,constant:ra,cumulativeLogNormal:kne,cumulativeNormal:lB,cumulativeUniform:Rne,dayofyear:RIe,debounce:ene,defaultLocale:hne,definition:_Le,densityLogNormal:Tne,densityNormal:Sne,densityUniform:Mne,domChild:bo,domClear:Xc,domCreate:hv,domFind:hie,dotbin:TLe,error:je,expressionFunction:Zi,extend:cn,extent:Eh,extentIndex:nIe,falsy:Rm,fastmap:yO,field:Eu,flush:rIe,font:NB,fontFamily:_R,fontSize:Wh,format:h3,formatLocale:SN,formats:mne,hasOwnProperty:vt,id:tR,identity:na,inferType:fLe,inferTypes:dLe,ingest:cr,inherits:it,inrange:s_,interpolate:Vre,interpolateColors:PB,interpolateRange:k3e,intersect:zFe,intersectBoxLine:l_,intersectPath:Zre,intersectPoint:Jre,intersectRule:K3e,isArray:We,isBoolean:By,isDate:Nv,isFunction:fn,isIterable:iIe,isNumber:Jn,isObject:ht,isRegExp:oIe,isString:gt,isTuple:rB,key:tne,lerp:sIe,lineHeight:cy,loader:tB,locale:cLe,logger:Yte,lruCache:aIe,markup:xie,merge:lIe,mergeConfig:mO,multiLineOffset:uie,one:gO,pad:cIe,panLinear:YDe,panLog:QDe,panPow:KDe,panSymlog:ZDe,parse:MBt,parseExpression:xoe,parseSelector:qy,path:hB,pathCurves:Yre,pathEqual:VFe,pathParse:jS,pathRectangle:G3e,pathRender:RA,pathSymbols:V3e,pathTrail:H3e,peek:$n,point:jB,projection:zie,quantileLogNormal:Ane,quantileNormal:cB,quantileUniform:Dne,quantiles:bne,quantizeInterpolator:A3e,quarter:JDe,quartiles:wne,get random(){return Au},randomInteger:kEt,randomKDE:One,randomLCG:TEt,randomLogNormal:ALe,randomMixture:PLe,randomNormal:Cne,randomUniform:MLe,read:gLe,regressionConstant:Ine,regressionExp:DLe,regressionLinear:Lne,regressionLoess:$Le,regressionLog:RLe,regressionPoly:LLe,regressionPow:ILe,regressionQuad:$ne,renderModule:BB,repeat:eT,resetDefaultLocale:COt,resetSVGClipId:X3e,resetSVGDefIds:_Mt,responseType:pLe,runtimeContext:oze,sampleCurve:fB,sampleLogNormal:Ene,sampleNormal:aB,sampleUniform:Pne,scale:tr,sceneEqual:wie,sceneFromJSON:uFe,scenePickVisit:zN,sceneToJSON:cFe,sceneVisit:Gf,sceneZOrder:eie,scheme:Gre,serializeXML:kFe,setHybridRendererOptions:yMt,setRandom:OEt,span:nR,splitAccessPath:Bh,stringValue:rt,textMetrics:pc,timeBin:YIe,timeFloor:zIe,timeFormatLocale:CA,timeInterval:_O,timeOffset:UIe,timeSequence:GIe,timeUnitSpecifier:MIe,timeUnits:cne,toBoolean:nne,toDate:rne,toNumber:Ys,toSet:Wf,toString:ine,transform:SLe,transforms:IS,truncate:uIe,truthy:Tu,tupleid:jt,typeParsers:Kq,utcFloor:jIe,utcInterval:SO,utcOffset:WIe,utcSequence:HIe,utcdayofyear:LIe,utcquarter:eIe,utcweek:$Ie,version:RBt,visitArray:qm,week:DIe,writeConfig:vO,zero:rv,zoomLinear:Qte,zoomLog:Kte,zoomPow:mN,zoomSymlog:Zte},Symbol.toStringTag,{value:"Module"}));function IBt(t,e,n){let r;e.x2&&(e.x?(n&&t.x>t.x2&&(r=t.x,t.x=t.x2,t.x2=r),t.width=t.x2-t.x):t.x=t.x2-(t.width||0)),e.xc&&(t.x=t.xc-(t.width||0)/2),e.y2&&(e.y?(n&&t.y>t.y2&&(r=t.y,t.y=t.y2,t.y2=r),t.height=t.y2-t.y):t.y=t.y2-(t.height||0)),e.yc&&(t.y=t.yc-(t.height||0)/2)}var LBt={NaN:NaN,E:Math.E,LN2:Math.LN2,LN10:Math.LN10,LOG2E:Math.LOG2E,LOG10E:Math.LOG10E,PI:Math.PI,SQRT1_2:Math.SQRT1_2,SQRT2:Math.SQRT2,MIN_VALUE:Number.MIN_VALUE,MAX_VALUE:Number.MAX_VALUE},$Bt={"*":(t,e)=>t*e,"+":(t,e)=>t+e,"-":(t,e)=>t-e,"/":(t,e)=>t/e,"%":(t,e)=>t%e,">":(t,e)=>t>e,"<":(t,e)=>tt<=e,">=":(t,e)=>t>=e,"==":(t,e)=>t==e,"!=":(t,e)=>t!=e,"===":(t,e)=>t===e,"!==":(t,e)=>t!==e,"&":(t,e)=>t&e,"|":(t,e)=>t|e,"^":(t,e)=>t^e,"<<":(t,e)=>t<>":(t,e)=>t>>e,">>>":(t,e)=>t>>>e},FBt={"+":t=>+t,"-":t=>-t,"~":t=>~t,"!":t=>!t};const NBt=Array.prototype.slice,v0=(t,e,n)=>{const r=n?n(e[0]):e[0];return r[t].apply(r,NBt.call(e,1))},zBt=(t,e,n,r,i,o,s)=>new Date(t,e||0,n??1,r||0,i||0,o||0,s||0);var jBt={isNaN:Number.isNaN,isFinite:Number.isFinite,abs:Math.abs,acos:Math.acos,asin:Math.asin,atan:Math.atan,atan2:Math.atan2,ceil:Math.ceil,cos:Math.cos,exp:Math.exp,floor:Math.floor,log:Math.log,max:Math.max,min:Math.min,pow:Math.pow,random:Math.random,round:Math.round,sin:Math.sin,sqrt:Math.sqrt,tan:Math.tan,clamp:(t,e,n)=>Math.max(e,Math.min(n,t)),now:Date.now,utc:Date.UTC,datetime:zBt,date:t=>new Date(t).getDate(),day:t=>new Date(t).getDay(),year:t=>new Date(t).getFullYear(),month:t=>new Date(t).getMonth(),hours:t=>new Date(t).getHours(),minutes:t=>new Date(t).getMinutes(),seconds:t=>new Date(t).getSeconds(),milliseconds:t=>new Date(t).getMilliseconds(),time:t=>new Date(t).getTime(),timezoneoffset:t=>new Date(t).getTimezoneOffset(),utcdate:t=>new Date(t).getUTCDate(),utcday:t=>new Date(t).getUTCDay(),utcyear:t=>new Date(t).getUTCFullYear(),utcmonth:t=>new Date(t).getUTCMonth(),utchours:t=>new Date(t).getUTCHours(),utcminutes:t=>new Date(t).getUTCMinutes(),utcseconds:t=>new Date(t).getUTCSeconds(),utcmilliseconds:t=>new Date(t).getUTCMilliseconds(),length:t=>t.length,join:function(){return v0("join",arguments)},indexof:function(){return v0("indexOf",arguments)},lastindexof:function(){return v0("lastIndexOf",arguments)},slice:function(){return v0("slice",arguments)},reverse:t=>t.slice().reverse(),parseFloat,parseInt,upper:t=>String(t).toUpperCase(),lower:t=>String(t).toLowerCase(),substring:function(){return v0("substring",arguments,String)},split:function(){return v0("split",arguments,String)},replace:function(){return v0("replace",arguments,String)},trim:t=>String(t).trim(),regexp:RegExp,test:(t,e)=>RegExp(t).test(e)};const BBt=["view","item","group","xy","x","y"],xY=new Set([Function,eval,setTimeout,setInterval]);typeof setImmediate=="function"&&xY.add(setImmediate);const UBt={Literal:(t,e)=>e.value,Identifier:(t,e)=>{const n=e.name;return t.memberDepth>0?n:n==="datum"?t.datum:n==="event"?t.event:n==="item"?t.item:LBt[n]||t.params["$"+n]},MemberExpression:(t,e)=>{const n=!e.computed,r=t(e.object);n&&(t.memberDepth+=1);const i=t(e.property);if(n&&(t.memberDepth-=1),xY.has(r[i])){console.error(`Prevented interpretation of member "${i}" which could lead to insecure code execution`);return}return r[i]},CallExpression:(t,e)=>{const n=e.arguments;let r=e.callee.name;return r.startsWith("_")&&(r=r.slice(1)),r==="if"?t(n[0])?t(n[1]):t(n[2]):(t.fn[r]||jBt[r]).apply(t.fn,n.map(t))},ArrayExpression:(t,e)=>e.elements.map(t),BinaryExpression:(t,e)=>$Bt[e.operator](t(e.left),t(e.right)),UnaryExpression:(t,e)=>FBt[e.operator](t(e.argument)),ConditionalExpression:(t,e)=>t(e.test)?t(e.consequent):t(e.alternate),LogicalExpression:(t,e)=>e.operator==="&&"?t(e.left)&&t(e.right):t(e.left)||t(e.right),ObjectExpression:(t,e)=>e.properties.reduce((n,r)=>{t.memberDepth+=1;const i=t(r.key);return t.memberDepth-=1,xY.has(t(r.value))?console.error(`Prevented interpretation of property "${i}" which could lead to insecure code execution`):n[i]=t(r.value),n},{})};function a2(t,e,n,r,i,o){const s=a=>UBt[a.type](s,a);return s.memberDepth=0,s.fn=Object.create(e),s.params=n,s.datum=r,s.event=i,s.item=o,BBt.forEach(a=>s.fn[a]=function(){return i.vega[a](...arguments)}),s(t)}var WBt={operator(t,e){const n=e.ast,r=t.functions;return i=>a2(n,r,i)},parameter(t,e){const n=e.ast,r=t.functions;return(i,o)=>a2(n,r,o,i)},event(t,e){const n=e.ast,r=t.functions;return i=>a2(n,r,void 0,void 0,i)},handler(t,e){const n=e.ast,r=t.functions;return(i,o)=>{const s=o.item&&o.item.datum;return a2(n,r,i,s,o)}},encode(t,e){const{marktype:n,channels:r}=e,i=t.functions,o=n==="group"||n==="image"||n==="rect";return(s,a)=>{const l=s.datum;let c=0,u;for(const f in r)u=a2(r[f].ast,i,a,l,void 0,s),s[f]!==u&&(s[f]=u,c=1);return n!=="rule"&&IBt(s,r,o),c}}};const VBt="vega-lite",GBt='Dominik Moritz, Kanit "Ham" Wongsuphasawat, Arvind Satyanarayan, Jeffrey Heer',HBt="5.21.0",qBt=["Kanit Wongsuphasawat (http://kanitw.yellowpigz.com)","Dominik Moritz (https://www.domoritz.de)","Arvind Satyanarayan (https://arvindsatya.com)","Jeffrey Heer (https://jheer.org)"],XBt="https://vega.github.io/vega-lite/",YBt="Vega-Lite is a concise high-level language for interactive visualization.",QBt=["vega","chart","visualization"],KBt="build/vega-lite.js",ZBt="build/vega-lite.min.js",JBt="build/vega-lite.min.js",e6t="build/src/index",t6t="build/src/index.d.ts",n6t={vl2pdf:"./bin/vl2pdf",vl2png:"./bin/vl2png",vl2svg:"./bin/vl2svg",vl2vg:"./bin/vl2vg"},r6t=["bin","build","src","vega-lite*","tsconfig.json"],i6t={changelog:"conventional-changelog -p angular -r 2",prebuild:"yarn clean:build",build:"yarn build:only","build:only":"tsc -p tsconfig.build.json && rollup -c","prebuild:examples":"yarn build:only","build:examples":"yarn data && TZ=America/Los_Angeles scripts/build-examples.sh","prebuild:examples-full":"yarn build:only","build:examples-full":"TZ=America/Los_Angeles scripts/build-examples.sh 1","build:example":"TZ=America/Los_Angeles scripts/build-example.sh","build:toc":"yarn build:jekyll && scripts/generate-toc","build:site":"rollup -c site/rollup.config.mjs","build:jekyll":"pushd site && bundle exec jekyll build -q && popd","build:versions":"scripts/update-version.sh",clean:"yarn clean:build && del-cli 'site/data/*' 'examples/compiled/*.png' && find site/examples ! -name 'index.md' ! -name 'data' -type f -delete","clean:build":"del-cli 'build/*' !build/vega-lite-schema.json",data:"rsync -r node_modules/vega-datasets/data/* site/data","build-editor-preview":"scripts/build-editor-preview.sh",schema:"mkdir -p build && ts-json-schema-generator -f tsconfig.json -p src/index.ts -t TopLevelSpec --no-type-check --no-ref-encode > build/vega-lite-schema.json && yarn renameschema && cp build/vega-lite-schema.json site/_data/",renameschema:"scripts/rename-schema.sh",presite:"yarn data && yarn schema && yarn build:site && yarn build:versions && scripts/create-example-pages.sh",site:"yarn site:only","site:only":"pushd site && bundle exec jekyll serve -I -l && popd",prettierbase:"prettier '**/*.{md,css,yml}'",format:"eslint . --fix && yarn prettierbase --write",lint:"eslint . && yarn prettierbase --check",test:"yarn jest test/ && yarn lint && yarn schema && yarn jest examples/ && yarn test:runtime","test:cover":"yarn jest --collectCoverage test/","test:inspect":"node --inspect-brk ./node_modules/.bin/jest --runInBand test","test:runtime":"TZ=America/Los_Angeles npx jest test-runtime/ --config test-runtime/jest-config.json","test:runtime:generate":"yarn build:only && del-cli test-runtime/resources && VL_GENERATE_TESTS=true yarn test:runtime",watch:"tsc -p tsconfig.build.json -w","watch:site":"yarn build:site -w","watch:test":"yarn jest --watch test/","watch:test:runtime":"TZ=America/Los_Angeles npx jest --watch test-runtime/ --config test-runtime/jest-config.json",release:"release-it"},o6t={type:"git",url:"https://github.com/vega/vega-lite.git"},s6t="BSD-3-Clause",a6t={url:"https://github.com/vega/vega-lite/issues"},l6t={"@babel/core":"^7.24.9","@babel/preset-env":"^7.25.0","@babel/preset-typescript":"^7.24.7","@release-it/conventional-changelog":"^8.0.1","@rollup/plugin-alias":"^5.1.0","@rollup/plugin-babel":"^6.0.4","@rollup/plugin-commonjs":"^26.0.1","@rollup/plugin-json":"^6.1.0","@rollup/plugin-node-resolve":"^15.2.3","@rollup/plugin-terser":"^0.4.4","@types/d3":"^7.4.3","@types/jest":"^29.5.12","@types/pako":"^2.0.3","@typescript-eslint/eslint-plugin":"^7.17.0","@typescript-eslint/parser":"^7.17.0",ajv:"^8.17.1","ajv-formats":"^3.0.1",cheerio:"^1.0.0-rc.12","conventional-changelog-cli":"^5.0.0",d3:"^7.9.0","del-cli":"^5.1.0",eslint:"^8.57.0","eslint-config-prettier":"^9.1.0","eslint-plugin-jest":"^27.9.0","eslint-plugin-prettier":"^5.2.1","fast-json-stable-stringify":"~2.1.0","highlight.js":"^11.10.0",jest:"^29.7.0","jest-dev-server":"^10.0.0",mkdirp:"^3.0.1",pako:"^2.1.0",prettier:"^3.3.3",puppeteer:"^15.0.0","release-it":"17.6.0",rollup:"^4.19.1","rollup-plugin-bundle-size":"^1.0.3",serve:"^14.2.3",terser:"^5.31.3","ts-jest":"^29.2.3","ts-json-schema-generator":"^2.3.0",typescript:"~5.5.4","vega-cli":"^5.28.0","vega-datasets":"^2.8.1","vega-embed":"^6.26.0","vega-tooltip":"^0.34.0","yaml-front-matter":"^4.1.1"},c6t={"json-stringify-pretty-compact":"~3.0.0",tslib:"~2.6.3","vega-event-selector":"~3.0.1","vega-expression":"~5.1.1","vega-util":"~1.17.2",yargs:"~17.7.2"},u6t={vega:"^5.24.0"},f6t={node:">=18"},d6t="yarn@1.22.19",h6t={name:VBt,author:GBt,version:HBt,collaborators:qBt,homepage:XBt,description:YBt,keywords:QBt,main:KBt,unpkg:ZBt,jsdelivr:JBt,module:e6t,types:t6t,bin:n6t,files:r6t,scripts:i6t,repository:o6t,license:s6t,bugs:a6t,devDependencies:l6t,dependencies:c6t,peerDependencies:u6t,engines:f6t,packageManager:d6t};function qoe(t){return Ke(t,"or")}function Xoe(t){return Ke(t,"and")}function Yoe(t){return Ke(t,"not")}function F3(t,e){if(Yoe(t))F3(t.not,e);else if(Xoe(t))for(const n of t.and)F3(n,e);else if(qoe(t))for(const n of t.or)F3(n,e);else e(t)}function N_(t,e){return Yoe(t)?{not:N_(t.not,e)}:Xoe(t)?{and:t.and.map(n=>N_(n,e))}:qoe(t)?{or:t.or.map(n=>N_(n,e))}:e(t)}const Kt=structuredClone;function tje(t){throw new Error(t)}function YS(t,e){const n={};for(const r of e)vt(t,r)&&(n[r]=t[r]);return n}function gl(t,e){const n={...t};for(const r of e)delete n[r];return n}Set.prototype.toJSON=function(){return`Set(${[...this].map(t=>Tr(t)).join(",")})`};function Mn(t){if(Jn(t))return t;const e=gt(t)?t:Tr(t);if(e.length<250)return e;let n=0;for(let r=0;ra===0?s:`[${s}]`),o=i.map((s,a)=>i.slice(0,a+1).join(""));for(const s of o)e.add(s)}return e}function Zoe(t,e){return t===void 0||e===void 0?!0:Koe(wY(t),wY(e))}function Er(t){return Qe(t).length===0}const Qe=Object.keys,bs=Object.values,hy=Object.entries;function qA(t){return t===!0||t===!1}function hi(t){const e=t.replace(/\W/g,"_");return(t.match(/^\d+/)?"_":"")+e}function mk(t,e){return Yoe(t)?`!(${mk(t.not,e)})`:Xoe(t)?`(${t.and.map(n=>mk(n,e)).join(") && (")})`:qoe(t)?`(${t.or.map(n=>mk(n,e)).join(") || (")})`:e(t)}function I5(t,e){if(e.length===0)return!0;const n=e.shift();return n in t&&I5(t[n],e)&&delete t[n],Er(t)}function LR(t){return t.charAt(0).toUpperCase()+t.substr(1)}function Joe(t,e="datum"){const n=Bh(t),r=[];for(let i=1;i<=n.length;i++){const o=`[${n.slice(0,i).map(rt).join("][")}]`;r.push(`${e}${o}`)}return r.join(" && ")}function ije(t,e="datum"){return`${e}[${rt(Bh(t).join("."))}]`}function m6t(t){return t.replace(/(\[|\]|\.|'|")/g,"\\$1")}function Mu(t){return`${Bh(t).map(m6t).join("\\.")}`}function w1(t,e,n){return t.replace(new RegExp(e.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&"),"g"),n)}function RO(t){return`${Bh(t).join(".")}`}function KS(t){return t?Bh(t).length:0}function Xi(...t){return t.find(e=>e!==void 0)}let oje=42;function sje(t){const e=++oje;return t?String(t)+e:e}function v6t(){oje=42}function aje(t){return lje(t)?t:`__${t}`}function lje(t){return t.startsWith("__")}function XA(t){if(t!==void 0)return(t%360+360)%360}function u6(t){return Jn(t)?!0:!isNaN(t)&&!isNaN(parseFloat(t))}const Gve=Object.getPrototypeOf(structuredClone({}));function lc(t,e){if(t===e)return!0;if(t&&e&&typeof t=="object"&&typeof e=="object"){if(t.constructor.name!==e.constructor.name)return!1;let n,r;if(Array.isArray(t)){if(n=t.length,n!=e.length)return!1;for(r=n;r--!==0;)if(!lc(t[r],e[r]))return!1;return!0}if(t instanceof Map&&e instanceof Map){if(t.size!==e.size)return!1;for(const o of t.entries())if(!e.has(o[0]))return!1;for(const o of t.entries())if(!lc(o[1],e.get(o[0])))return!1;return!0}if(t instanceof Set&&e instanceof Set){if(t.size!==e.size)return!1;for(const o of t.entries())if(!e.has(o[0]))return!1;return!0}if(ArrayBuffer.isView(t)&&ArrayBuffer.isView(e)){if(n=t.length,n!=e.length)return!1;for(r=n;r--!==0;)if(t[r]!==e[r])return!1;return!0}if(t.constructor===RegExp)return t.source===e.source&&t.flags===e.flags;if(t.valueOf!==Object.prototype.valueOf&&t.valueOf!==Gve.valueOf)return t.valueOf()===e.valueOf();if(t.toString!==Object.prototype.toString&&t.toString!==Gve.toString)return t.toString()===e.toString();const i=Object.keys(t);if(n=i.length,n!==Object.keys(e).length)return!1;for(r=n;r--!==0;)if(!Object.prototype.hasOwnProperty.call(e,i[r]))return!1;for(r=n;r--!==0;){const o=i[r];if(!lc(t[o],e[o]))return!1}return!0}return t!==t&&e!==e}function Tr(t){const e=[];return function n(r){if(r&&r.toJSON&&typeof r.toJSON=="function"&&(r=r.toJSON()),r===void 0)return;if(typeof r=="number")return isFinite(r)?""+r:"null";if(typeof r!="object")return JSON.stringify(r);let i,o;if(Array.isArray(r)){for(o="[",i=0;iy6(t[e])?hi(`_${e}_${hy(t[e])}`):hi(`_${e}_${t[e]}`)).join("")}function Gr(t){return t===!0||gb(t)&&!t.binned}function ns(t){return t==="binned"||gb(t)&&t.binned===!0}function gb(t){return ht(t)}function y6(t){return Ke(t,"param")}function Hve(t){switch(t){case lg:case cg:case Jg:case Ol:case Xh:case Yh:case Ky:case em:case Yy:case Qy:case El:return 6;case Zy:return 4;default:return 10}}function zR(t){return Ke(t,"expr")}function is(t,{level:e}={level:0}){const n=Qe(t||{}),r={};for(const i of n)r[i]=e===0?nc(t[i]):is(t[i],{level:e-1});return r}function _je(t){const{anchor:e,frame:n,offset:r,orient:i,angle:o,limit:s,color:a,subtitleColor:l,subtitleFont:c,subtitleFontSize:u,subtitleFontStyle:f,subtitleFontWeight:d,subtitleLineHeight:h,subtitlePadding:p,...g}=t,m={...g,...a?{fill:a}:{}},v={...e?{anchor:e}:{},...n?{frame:n}:{},...r?{offset:r}:{},...i?{orient:i}:{},...o!==void 0?{angle:o}:{},...s!==void 0?{limit:s}:{}},y={...l?{subtitleColor:l}:{},...c?{subtitleFont:c}:{},...u?{subtitleFontSize:u}:{},...f?{subtitleFontStyle:f}:{},...d?{subtitleFontWeight:d}:{},...h?{subtitleLineHeight:h}:{},...p?{subtitlePadding:p}:{}},x=YS(t,["align","baseline","dx","dy","limit"]);return{titleMarkConfig:m,subtitleMarkConfig:x,nonMarkTitleProperties:v,subtitle:y}}function Km(t){return gt(t)||We(t)&>(t[0])}function Mt(t){return Ke(t,"signal")}function mb(t){return Ke(t,"step")}function B6t(t){return We(t)?!1:Ke(t,"fields")&&!Ke(t,"data")}function U6t(t){return We(t)?!1:Ke(t,"fields")&&Ke(t,"data")}function Zp(t){return We(t)?!1:Ke(t,"field")&&Ke(t,"data")}const W6t={aria:1,description:1,ariaRole:1,ariaRoleDescription:1,blend:1,opacity:1,fill:1,fillOpacity:1,stroke:1,strokeCap:1,strokeWidth:1,strokeOpacity:1,strokeDash:1,strokeDashOffset:1,strokeJoin:1,strokeOffset:1,strokeMiterLimit:1,startAngle:1,endAngle:1,padAngle:1,innerRadius:1,outerRadius:1,size:1,shape:1,interpolate:1,tension:1,orient:1,align:1,baseline:1,text:1,dir:1,dx:1,dy:1,ellipsis:1,limit:1,radius:1,theta:1,angle:1,font:1,fontSize:1,fontWeight:1,fontStyle:1,lineBreak:1,lineHeight:1,cursor:1,href:1,tooltip:1,cornerRadius:1,cornerRadiusTopLeft:1,cornerRadiusTopRight:1,cornerRadiusBottomLeft:1,cornerRadiusBottomRight:1,aspect:1,width:1,height:1,url:1,smooth:1},V6t=Qe(W6t),G6t={arc:1,area:1,group:1,image:1,line:1,path:1,rect:1,rule:1,shape:1,symbol:1,text:1,trail:1},_Y=["cornerRadius","cornerRadiusTopLeft","cornerRadiusTopRight","cornerRadiusBottomLeft","cornerRadiusBottomRight"];function Sje(t){const e=We(t.condition)?t.condition.map(qve):qve(t.condition);return{...nc(t),condition:e}}function nc(t){if(zR(t)){const{expr:e,...n}=t;return{signal:e,...n}}return t}function qve(t){if(zR(t)){const{expr:e,...n}=t;return{signal:e,...n}}return t}function Jr(t){if(zR(t)){const{expr:e,...n}=t;return{signal:e,...n}}return Mt(t)?t:t!==void 0?{value:t}:void 0}function H6t(t){return Mt(t)?t.signal:rt(t)}function Xve(t){return Mt(t)?t.signal:rt(t.value)}function Tf(t){return Mt(t)?t.signal:t==null?null:rt(t)}function q6t(t,e,n){for(const r of n){const i=Rh(r,e.markDef,e.config);i!==void 0&&(t[r]=Jr(i))}return t}function Cje(t){return[].concat(t.type,t.style??[])}function Or(t,e,n,r={}){const{vgChannel:i,ignoreVgConfig:o}=r;return i&&Ke(e,i)?e[i]:e[t]!==void 0?e[t]:o&&(!i||i===t)?void 0:Rh(t,e,n,r)}function Rh(t,e,n,{vgChannel:r}={}){const i=SY(t,e,n.style);return Xi(r?i:void 0,i,r?n[e.type][r]:void 0,n[e.type][t],r?n.mark[r]:n.mark[t])}function SY(t,e,n){return Oje(t,Cje(e),n)}function Oje(t,e,n){e=pt(e);let r;for(const i of e){const o=n[i];Ke(o,t)&&(r=o[t])}return r}function Eje(t,e){return pt(t).reduce((n,r)=>(n.field.push(ct(r,e)),n.order.push(r.sort??"ascending"),n),{field:[],order:[]})}function Tje(t,e){const n=[...t];return e.forEach(r=>{for(const i of n)if(lc(i,r))return;n.push(r)}),n}function kje(t,e){return lc(t,e)||!e?t:t?[...pt(t),...pt(e)].join(", "):e}function Aje(t,e){const n=t.value,r=e.value;if(n==null||r===null)return{explicit:t.explicit,value:null};if((Km(n)||Mt(n))&&(Km(r)||Mt(r)))return{explicit:t.explicit,value:kje(n,r)};if(Km(n)||Mt(n))return{explicit:t.explicit,value:n};if(Km(r)||Mt(r))return{explicit:t.explicit,value:r};if(!Km(n)&&!Mt(n)&&!Km(r)&&!Mt(r))return{explicit:t.explicit,value:Tje(n,r)};throw new Error("It should never reach here")}function cse(t){return`Invalid specification ${Tr(t)}. Make sure the specification includes at least one of the following properties: "mark", "layer", "facet", "hconcat", "vconcat", "concat", or "repeat".`}const X6t='Autosize "fit" only works for single views and layered views.';function Yve(t){return`${t=="width"?"Width":"Height"} "container" only works for single views and layered views.`}function Qve(t){const e=t=="width"?"Width":"Height",n=t=="width"?"x":"y";return`${e} "container" only works well with autosize "fit" or "fit-${n}".`}function Kve(t){return t?`Dropping "fit-${t}" because spec has discrete ${Tl(t)}.`:'Dropping "fit" because spec has discrete size.'}function use(t){return`Unknown field for ${t}. Cannot calculate view size.`}function Zve(t){return`Cannot project a selection on encoding channel "${t}", which has no field.`}function Y6t(t,e){return`Cannot project a selection on encoding channel "${t}" as it uses an aggregate function ("${e}").`}function Q6t(t){return`The "nearest" transform is not supported for ${t} marks.`}function Pje(t){return`Selection not supported for ${t} yet.`}function K6t(t){return`Cannot find a selection named "${t}".`}const Z6t="Scale bindings are currently only supported for scales with unbinned, continuous domains.",J6t="Sequntial scales are deprecated. The available quantitative scale type values are linear, log, pow, sqrt, symlog, time and utc",eUt="Legend bindings are only supported for selections over an individual field or encoding channel.";function tUt(t){return`Lookups can only be performed on selection parameters. "${t}" is a variable parameter.`}function nUt(t){return`Cannot define and lookup the "${t}" selection in the same view. Try moving the lookup into a second, layered view?`}const rUt="The same selection must be used to override scale domains in a layered view.",iUt='Interval selections should be initialized using "x", "y", "longitude", or "latitude" keys.';function oUt(t){return`Unknown repeated value "${t}".`}function Jve(t){return`The "columns" property cannot be used when "${t}" has nested row/column.`}const sUt="Axes cannot be shared in concatenated or repeated views yet (https://github.com/vega/vega-lite/issues/2415).";function aUt(t){return`Unrecognized parse "${t}".`}function eye(t,e,n){return`An ancestor parsed field "${t}" as ${n} but a child wants to parse the field as ${e}.`}const lUt="Attempt to add the same child twice.";function cUt(t){return`Ignoring an invalid transform: ${Tr(t)}.`}const uUt='If "from.fields" is not specified, "as" has to be a string that specifies the key to be used for the data from the secondary source.';function tye(t){return`Config.customFormatTypes is not true, thus custom format type and format for channel ${t} are dropped.`}function fUt(t){const{parentProjection:e,projection:n}=t;return`Layer's shared projection ${Tr(e)} is overridden by a child projection ${Tr(n)}.`}const dUt="Arc marks uses theta channel rather than angle, replacing angle with theta.";function hUt(t){return`${t}Offset dropped because ${t} is continuous`}function pUt(t,e,n){return`Channel ${t} is a ${e}. Converted to {value: ${Tr(n)}}.`}function Mje(t){return`Invalid field type "${t}".`}function gUt(t,e){return`Invalid field type "${t}" for aggregate: "${e}", using "quantitative" instead.`}function mUt(t){return`Invalid aggregation operator "${t}".`}function Rje(t,e){const{fill:n,stroke:r}=e;return`Dropping color ${t} as the plot also has ${n&&r?"fill and stroke":n?"fill":"stroke"}.`}function vUt(t){return`Position range does not support relative band size for ${t}.`}function CY(t,e){return`Dropping ${Tr(t)} from channel "${e}" since it does not contain any data field, datum, value, or signal.`}const yUt="Line marks cannot encode size with a non-groupby field. You may want to use trail marks instead.";function x6(t,e,n){return`${t} dropped as it is incompatible with "${e}".`}function xUt(t){return`${t}-encoding is dropped as ${t} is not a valid encoding channel.`}function bUt(t){return`${t} encoding should be discrete (ordinal / nominal / binned).`}function wUt(t){return`${t} encoding should be discrete (ordinal / nominal / binned) or use a discretizing scale (e.g. threshold).`}function _Ut(t){return`Facet encoding dropped as ${t.join(" and ")} ${t.length>1?"are":"is"} also specified.`}function jV(t,e){return`Using discrete channel "${t}" to encode "${e}" field can be misleading as it does not encode ${e==="ordinal"?"order":"magnitude"}.`}function SUt(t){return`The ${t} for range marks cannot be an expression`}function CUt(t,e){return`Line mark is for continuous lines and thus cannot be used with ${t&&e?"x2 and y2":t?"x2":"y2"}. We will use the rule mark (line segments) instead.`}function OUt(t,e){return`Specified orient "${t}" overridden with "${e}".`}function EUt(t){return`Cannot use the scale property "${t}" with non-color channel.`}function TUt(t){return`Cannot use the relative band size with ${t} scale.`}function kUt(t){return`Using unaggregated domain with raw field has no effect (${Tr(t)}).`}function AUt(t){return`Unaggregated domain not applicable for "${t}" since it produces values outside the origin domain of the source data.`}function PUt(t){return`Unaggregated domain is currently unsupported for log scale (${Tr(t)}).`}function MUt(t){return`Cannot apply size to non-oriented mark "${t}".`}function RUt(t,e,n){return`Channel "${t}" does not work with "${e}" scale. We are using "${n}" scale instead.`}function DUt(t,e){return`FieldDef does not work with "${t}" scale. We are using "${e}" scale instead.`}function Dje(t,e,n){return`${n}-scale's "${e}" is dropped as it does not work with ${t} scale.`}function Ije(t){return`The step for "${t}" is dropped because the ${t==="width"?"x":"y"} is continuous.`}function IUt(t,e,n,r){return`Conflicting ${e.toString()} property "${t.toString()}" (${Tr(n)} and ${Tr(r)}). Using ${Tr(n)}.`}function LUt(t,e,n,r){return`Conflicting ${e.toString()} property "${t.toString()}" (${Tr(n)} and ${Tr(r)}). Using the union of the two domains.`}function $Ut(t){return`Setting the scale to be independent for "${t}" means we also have to set the guide (axis or legend) to be independent.`}function FUt(t){return`Dropping sort property ${Tr(t)} as unioned domains only support boolean or op "count", "min", and "max".`}const nye="Domains that should be unioned has conflicting sort properties. Sort will be set to true.",NUt="Detected faceted independent scales that union domain of multiple fields from different data sources. We will use the first field. The result view size may be incorrect.",zUt="Detected faceted independent scales that union domain of the same fields from different source. We will assume that this is the same field from a different fork of the same data source. However, if this is not the case, the result view size may be incorrect.",jUt="Detected faceted independent scales that union domain of multiple fields from the same data source. We will use the first field. The result view size may be incorrect.";function BUt(t){return`Cannot stack "${t}" if there is already "${t}2".`}function UUt(t){return`Stack is applied to a non-linear scale (${t}).`}function WUt(t){return`Stacking is applied even though the aggregate function is non-summative ("${t}").`}function L5(t,e){return`Invalid ${t}: ${Tr(e)}.`}function VUt(t){return`Dropping day from datetime ${Tr(t)} as day cannot be combined with other units.`}function GUt(t,e){return`${e?"extent ":""}${e&&t?"and ":""}${t?"center ":""}${e&&t?"are ":"is "}not needed when data are aggregated.`}function HUt(t,e,n){return`${t} is not usually used with ${e} for ${n}.`}function qUt(t,e){return`Continuous axis should not have customized aggregation function ${t}; ${e} already agregates the axis.`}function rye(t){return`1D error band does not support ${t}.`}function Lje(t){return`Channel ${t} is required for "binned" bin.`}function XUt(t){return`Channel ${t} should not be used with "binned" bin.`}function YUt(t){return`Domain for ${t} is required for threshold scale.`}const $je=Yte(Xte);let JS=$je;function QUt(t){return JS=t,JS}function KUt(){return JS=$je,JS}function Ze(...t){JS.warn(...t)}function ZUt(...t){JS.debug(...t)}function vb(t){if(t&&ht(t)){for(const e of dse)if(Ke(t,e))return!0}return!1}const Fje=["january","february","march","april","may","june","july","august","september","october","november","december"],JUt=Fje.map(t=>t.substr(0,3)),Nje=["sunday","monday","tuesday","wednesday","thursday","friday","saturday"],e8t=Nje.map(t=>t.substr(0,3));function t8t(t){if(u6(t)&&(t=+t),Jn(t))return t>4&&Ze(L5("quarter",t)),t-1;throw new Error(L5("quarter",t))}function n8t(t){if(u6(t)&&(t=+t),Jn(t))return t-1;{const e=t.toLowerCase(),n=Fje.indexOf(e);if(n!==-1)return n;const r=e.substr(0,3),i=JUt.indexOf(r);if(i!==-1)return i;throw new Error(L5("month",t))}}function r8t(t){if(u6(t)&&(t=+t),Jn(t))return t%7;{const e=t.toLowerCase(),n=Nje.indexOf(e);if(n!==-1)return n;const r=e.substr(0,3),i=e8t.indexOf(r);if(i!==-1)return i;throw new Error(L5("day",t))}}function fse(t,e){const n=[];if(e&&t.day!==void 0&&Qe(t).length>1&&(Ze(VUt(t)),t=Kt(t),delete t.day),t.year!==void 0?n.push(t.year):n.push(2012),t.month!==void 0){const r=e?n8t(t.month):t.month;n.push(r)}else if(t.quarter!==void 0){const r=e?t8t(t.quarter):t.quarter;n.push(Jn(r)?r*3:`${r}*3`)}else n.push(0);if(t.date!==void 0)n.push(t.date);else if(t.day!==void 0){const r=e?r8t(t.day):t.day;n.push(Jn(r)?r+1:`${r}+1`)}else n.push(1);for(const r of["hours","minutes","seconds","milliseconds"]){const i=t[r];n.push(typeof i>"u"?0:i)}return n}function S1(t){const n=fse(t,!0).join(", ");return t.utc?`utc(${n})`:`datetime(${n})`}function i8t(t){const n=fse(t,!1).join(", ");return t.utc?`utc(${n})`:`datetime(${n})`}function o8t(t){const e=fse(t,!0);return t.utc?+new Date(Date.UTC(...e)):+new Date(...e)}const zje={year:1,quarter:1,month:1,week:1,day:1,dayofyear:1,date:1,hours:1,minutes:1,seconds:1,milliseconds:1},dse=Qe(zje);function s8t(t){return vt(zje,t)}function yb(t){return ht(t)?t.binned:jje(t)}function jje(t){return t&&t.startsWith("binned")}function hse(t){return t.startsWith("utc")}function a8t(t){return t.substring(3)}const l8t={"year-month":"%b %Y ","year-month-date":"%b %d, %Y "};function b6(t){return dse.filter(e=>Uje(t,e))}function Bje(t){const e=b6(t);return e[e.length-1]}function Uje(t,e){const n=t.indexOf(e);return!(n<0||n>0&&e==="seconds"&&t.charAt(n-1)==="i"||t.length>n+3&&e==="day"&&t.charAt(n+3)==="o"||n>0&&e==="year"&&t.charAt(n-1)==="f")}function c8t(t,e,{end:n}={end:!1}){const r=Joe(e),i=hse(t)?"utc":"";function o(l){return l==="quarter"?`(${i}quarter(${r})-1)`:`${i}${l}(${r})`}let s;const a={};for(const l of dse)Uje(t,l)&&(a[l]=o(l),s=l);return n&&(a[s]+="+1"),i8t(a)}function Wje(t){if(!t)return;const e=b6(t);return`timeUnitSpecifier(${Tr(e)}, ${Tr(l8t)})`}function u8t(t,e,n){if(!t)return;const r=Wje(t);return`${n||hse(t)?"utc":"time"}Format(${e}, ${r})`}function Uo(t){if(!t)return;let e;return gt(t)?jje(t)?e={unit:t.substring(6),binned:!0}:e={unit:t}:ht(t)&&(e={...t,...t.unit?{unit:t.unit}:{}}),hse(e.unit)&&(e.utc=!0,e.unit=a8t(e.unit)),e}function f8t(t){const{utc:e,...n}=Uo(t);return n.unit?(e?"utc":"")+Qe(n).map(r=>hi(`${r==="unit"?"":`_${r}_`}${n[r]}`)).join(""):(e?"utc":"")+"timeunit"+Qe(n).map(r=>hi(`_${r}_${n[r]}`)).join("")}function Vje(t,e=n=>n){const n=Uo(t),r=Bje(n.unit);if(r&&r!=="day"){const i={year:2001,month:1,date:1,hours:0,minutes:0,seconds:0,milliseconds:0},{step:o,part:s}=Gje(r,n.step),a={...i,[s]:+i[s]+o};return`${e(S1(a))} - ${e(S1(i))}`}}const d8t={year:1,month:1,date:1,hours:1,minutes:1,seconds:1,milliseconds:1};function h8t(t){return vt(d8t,t)}function Gje(t,e=1){if(h8t(t))return{part:t,step:e};switch(t){case"day":case"dayofyear":return{part:"date",step:e};case"quarter":return{part:"month",step:e*3};case"week":return{part:"date",step:e*7}}}function p8t(t){return Ke(t,"param")}function pse(t){return!!(t!=null&&t.field)&&t.equal!==void 0}function gse(t){return!!(t!=null&&t.field)&&t.lt!==void 0}function mse(t){return!!(t!=null&&t.field)&&t.lte!==void 0}function vse(t){return!!(t!=null&&t.field)&&t.gt!==void 0}function yse(t){return!!(t!=null&&t.field)&&t.gte!==void 0}function xse(t){if(t!=null&&t.field){if(We(t.range)&&t.range.length===2)return!0;if(Mt(t.range))return!0}return!1}function bse(t){return!!(t!=null&&t.field)&&(We(t.oneOf)||We(t.in))}function g8t(t){return!!(t!=null&&t.field)&&t.valid!==void 0}function Hje(t){return bse(t)||pse(t)||xse(t)||gse(t)||vse(t)||mse(t)||yse(t)}function wd(t,e){return P6(t,{timeUnit:e,wrapTime:!0})}function m8t(t,e){return t.map(n=>wd(n,e))}function qje(t,e=!0){const{field:n}=t,r=Uo(t.timeUnit),{unit:i,binned:o}=r||{},s=ct(t,{expr:"datum"}),a=i?`time(${o?s:c8t(i,n)})`:s;if(pse(t))return`${a}===${wd(t.equal,i)}`;if(gse(t)){const l=t.lt;return`${a}<${wd(l,i)}`}else if(vse(t)){const l=t.gt;return`${a}>${wd(l,i)}`}else if(mse(t)){const l=t.lte;return`${a}<=${wd(l,i)}`}else if(yse(t)){const l=t.gte;return`${a}>=${wd(l,i)}`}else{if(bse(t))return`indexof([${m8t(t.oneOf,i).join(",")}], ${a}) !== -1`;if(g8t(t))return w6(a,t.valid);if(xse(t)){const{range:l}=is(t),c=Mt(l)?{signal:`${l.signal}[0]`}:l[0],u=Mt(l)?{signal:`${l.signal}[1]`}:l[1];if(c!==null&&u!==null&&e)return"inrange("+a+", ["+wd(c,i)+", "+wd(u,i)+"])";const f=[];return c!==null&&f.push(`${a} >= ${wd(c,i)}`),u!==null&&f.push(`${a} <= ${wd(u,i)}`),f.length>0?f.join(" && "):"true"}}throw new Error(`Invalid field predicate: ${Tr(t)}`)}function w6(t,e=!0){return e?`isValid(${t}) && isFinite(+${t})`:`!isValid(${t}) || !isFinite(+${t})`}function v8t(t){return Hje(t)&&t.timeUnit?{...t,timeUnit:Uo(t.timeUnit)}:t}const jR={quantitative:"quantitative",ordinal:"ordinal",temporal:"temporal",nominal:"nominal",geojson:"geojson"};function y8t(t){return t==="quantitative"||t==="temporal"}function Xje(t){return t==="ordinal"||t==="nominal"}const C1=jR.quantitative,wse=jR.ordinal,eC=jR.temporal,_se=jR.nominal,IO=jR.geojson;function x8t(t){if(t)switch(t=t.toLowerCase(),t){case"q":case C1:return"quantitative";case"t":case eC:return"temporal";case"o":case wse:return"ordinal";case"n":case _se:return"nominal";case IO:return"geojson"}}const os={LINEAR:"linear",LOG:"log",POW:"pow",SQRT:"sqrt",SYMLOG:"symlog",IDENTITY:"identity",SEQUENTIAL:"sequential",TIME:"time",UTC:"utc",QUANTILE:"quantile",QUANTIZE:"quantize",THRESHOLD:"threshold",BIN_ORDINAL:"bin-ordinal",ORDINAL:"ordinal",POINT:"point",BAND:"band"},OY={linear:"numeric",log:"numeric",pow:"numeric",sqrt:"numeric",symlog:"numeric",identity:"numeric",sequential:"numeric",time:"time",utc:"time",ordinal:"ordinal","bin-ordinal":"bin-ordinal",point:"ordinal-position",band:"ordinal-position",quantile:"discretizing",quantize:"discretizing",threshold:"discretizing"};function b8t(t,e){const n=OY[t],r=OY[e];return n===r||n==="ordinal-position"&&r==="time"||r==="ordinal-position"&&n==="time"}const w8t={linear:0,log:1,pow:1,sqrt:1,symlog:1,identity:1,sequential:1,time:0,utc:0,point:10,band:11,ordinal:0,"bin-ordinal":0,quantile:0,quantize:0,threshold:0};function iye(t){return w8t[t]}const Yje=new Set(["linear","log","pow","sqrt","symlog"]),Qje=new Set([...Yje,"time","utc"]);function Kje(t){return Yje.has(t)}const Zje=new Set(["quantile","quantize","threshold"]),_8t=new Set([...Qje,...Zje,"sequential","identity"]),S8t=new Set(["ordinal","bin-ordinal","point","band"]);function Wo(t){return S8t.has(t)}function Hf(t){return _8t.has(t)}function eh(t){return Qje.has(t)}function tC(t){return Zje.has(t)}const C8t={pointPadding:.5,barBandPaddingInner:.1,rectBandPaddingInner:0,tickBandPaddingInner:.25,bandWithNestedOffsetPaddingInner:.2,bandWithNestedOffsetPaddingOuter:.2,minBandSize:2,minFontSize:8,maxFontSize:40,minOpacity:.3,maxOpacity:.8,minSize:4,minStrokeWidth:1,maxStrokeWidth:4,quantileCount:4,quantizeCount:4,zero:!0};function O8t(t){return!gt(t)&&Ke(t,"name")}function Jje(t){return Ke(t,"param")}function E8t(t){return Ke(t,"unionWith")}function T8t(t){return ht(t)&&"field"in t}const k8t={type:1,domain:1,domainMax:1,domainMin:1,domainMid:1,domainRaw:1,align:1,range:1,rangeMax:1,rangeMin:1,scheme:1,bins:1,reverse:1,round:1,clamp:1,nice:1,base:1,exponent:1,constant:1,interpolate:1,zero:1,padding:1,paddingInner:1,paddingOuter:1},{type:DXn,domain:IXn,range:LXn,rangeMax:$Xn,rangeMin:FXn,scheme:NXn,...A8t}=k8t,P8t=Qe(A8t);function EY(t,e){switch(e){case"type":case"domain":case"reverse":case"range":return!0;case"scheme":case"interpolate":return!["point","band","identity"].includes(t);case"bins":return!["point","band","identity","ordinal"].includes(t);case"round":return eh(t)||t==="band"||t==="point";case"padding":case"rangeMin":case"rangeMax":return eh(t)||["point","band"].includes(t);case"paddingOuter":case"align":return["point","band"].includes(t);case"paddingInner":return t==="band";case"domainMax":case"domainMid":case"domainMin":case"domainRaw":case"clamp":return eh(t);case"nice":return eh(t)||t==="quantize"||t==="threshold";case"exponent":return t==="pow";case"base":return t==="log";case"constant":return t==="symlog";case"zero":return Hf(t)&&!Tn(["log","time","utc","threshold","quantile"],t)}}function e4e(t,e){switch(e){case"interpolate":case"scheme":case"domainMid":return z_(t)?void 0:EUt(e);case"align":case"type":case"bins":case"domain":case"domainMax":case"domainMin":case"domainRaw":case"range":case"base":case"exponent":case"constant":case"nice":case"padding":case"paddingInner":case"paddingOuter":case"rangeMax":case"rangeMin":case"reverse":case"round":case"clamp":case"zero":return}}function M8t(t,e){return Tn([wse,_se],e)?t===void 0||Wo(t):e===eC?Tn([os.TIME,os.UTC,void 0],t):e===C1?Kje(t)||tC(t)||t===void 0:!0}function R8t(t,e,n=!1){if(!Kh(t))return!1;switch(t){case vi:case Yo:case Xy:case DO:case ju:case sd:return eh(e)||e==="band"?!0:e==="point"?!n:!1;case Jg:case Ky:case em:case Yy:case Qy:case hb:return eh(e)||tC(e)||Tn(["band","point","ordinal"],e);case Ol:case Xh:case Yh:return e!=="band";case Zy:case El:return e==="ordinal"||tC(e)}}function D8t(t){return ht(t)&&"value"in t}const Ua={arc:"arc",area:"area",bar:"bar",image:"image",line:"line",point:"point",rect:"rect",rule:"rule",text:"text",tick:"tick",trail:"trail",circle:"circle",square:"square",geoshape:"geoshape"},t4e=Ua.arc,_6=Ua.area,S6=Ua.bar,I8t=Ua.image,C6=Ua.line,O6=Ua.point,L8t=Ua.rect,$5=Ua.rule,n4e=Ua.text,Sse=Ua.tick,$8t=Ua.trail,Cse=Ua.circle,Ose=Ua.square,r4e=Ua.geoshape;function e0(t){return["line","area","trail"].includes(t)}function YA(t){return["rect","bar","image","arc","tick"].includes(t)}const F8t=new Set(Qe(Ua));function Dh(t){return Ke(t,"type")}const N8t=["stroke","strokeWidth","strokeDash","strokeDashOffset","strokeOpacity","strokeJoin","strokeMiterLimit"],z8t=["fill","fillOpacity"],j8t=[...N8t,...z8t],B8t={color:1,filled:1,invalid:1,order:1,radius2:1,theta2:1,timeUnitBandSize:1,timeUnitBandPosition:1},oye=Qe(B8t),BV=["binSpacing","continuousBandSize","discreteBandSize","minBandSize"],U8t={area:["line","point"],bar:BV,rect:BV,line:["point"],tick:["bandSize","thickness",...BV]},W8t={color:"#4c78a8",invalid:"break-paths-show-path-domains",timeUnitBandSize:1},V8t={mark:1,arc:1,area:1,bar:1,circle:1,image:1,line:1,point:1,rect:1,rule:1,square:1,text:1,tick:1,trail:1,geoshape:1},i4e=Qe(V8t);function O1(t){return Ke(t,"band")}const G8t={horizontal:["cornerRadiusTopRight","cornerRadiusBottomRight"],vertical:["cornerRadiusTopLeft","cornerRadiusTopRight"]},H8t=5,Ese={binSpacing:0,continuousBandSize:H8t,minBandSize:.25,timeUnitBandPosition:.5},q8t={...Ese,binSpacing:1},X8t={...Ese,thickness:1};function Y8t(t){return Dh(t)?t.type:t}function o4e(t,{isPath:e}){return t===void 0||t==="break-paths-show-path-domains"?e?"break-paths-show-domains":"filter":t===null?"show":t}function Tse({markDef:t,config:e,scaleChannel:n,scaleType:r,isCountAggregate:i}){var a,l;if(!r||!Hf(r)||i)return"always-valid";const o=o4e(Or("invalid",t,e),{isPath:e0(t.type)});return((l=(a=e.scale)==null?void 0:a.invalid)==null?void 0:l[n])!==void 0?"show":o}function Q8t(t){return t==="break-paths-filter-domains"||t==="break-paths-show-domains"}function s4e({scaleName:t,scale:e,mode:n}){const r=`domain('${t}')`;if(!e||!t)return;const i=`${r}[0]`,o=`peek(${r})`,s=e.domainHasZero();return s==="definitely"?{scale:t,value:0}:s==="maybe"?{signal:`scale('${t}', inrange(0, ${r}) ? 0 : ${n==="zeroOrMin"?i:o})`}:{signal:`scale('${t}', ${n==="zeroOrMin"?i:o})`}}function a4e({scaleChannel:t,channelDef:e,scale:n,scaleName:r,markDef:i,config:o}){var u;const s=n==null?void 0:n.get("type"),a=Xf(e),l=v6(a==null?void 0:a.aggregate),c=Tse({scaleChannel:t,markDef:i,config:o,scaleType:s,isCountAggregate:l});if(a&&c==="show"){const f=((u=o.scale.invalid)==null?void 0:u[t])??"zero-or-min";return{test:w6(ct(a,{expr:"datum"}),!1),...K8t(f,n,r)}}}function K8t(t,e,n){if(D8t(t)){const{value:r}=t;return Mt(r)?{signal:r.signal}:{value:r}}return s4e({scale:e,scaleName:n,mode:"zeroOrMin"})}function kse(t){const{channel:e,channelDef:n,markDef:r,scale:i,scaleName:o,config:s}=t,a=pb(e),l=Ase(t),c=a4e({scaleChannel:a,channelDef:n,scale:i,scaleName:o,markDef:r,config:s});return c!==void 0?[c,l]:l}function Z8t(t){const{datum:e}=t;return vb(e)?S1(e):`${Tr(e)}`}function Bx(t,e,n,r){const i={};if(e&&(i.scale=e),Zh(t)){const{datum:o}=t;vb(o)?i.signal=S1(o):Mt(o)?i.signal=o.signal:zR(o)?i.signal=o.expr:i.value=o}else i.field=ct(t,n);if(r){const{offset:o,band:s}=r;o&&(i.offset=o),s&&(i.band=s)}return i}function F5({scaleName:t,fieldOrDatumDef:e,fieldOrDatumDef2:n,offset:r,startSuffix:i,endSuffix:o="end",bandPosition:s=.5}){const a=!Mt(s)&&0{switch(e.fieldTitle){case"plain":return t.field;case"functional":return hWt(t);default:return dWt(t,e)}};let b4e=x4e;function w4e(t){b4e=t}function pWt(){w4e(x4e)}function j_(t,e,{allowDisabling:n,includeDefault:r=!0}){var a;const i=(a=Dse(t))==null?void 0:a.title;if(!Je(t))return i??t.title;const o=t,s=r?Ise(o,e):void 0;return n?Xi(i,o.title,s):i??o.title??s}function Dse(t){if(rC(t)&&t.axis)return t.axis;if(v4e(t)&&t.legend)return t.legend;if(Mse(t)&&t.header)return t.header}function Ise(t,e){return b4e(t,e)}function j5(t){if(y4e(t)){const{format:e,formatType:n}=t;return{format:e,formatType:n}}else{const e=Dse(t)??{},{format:n,formatType:r}=e;return{format:n,formatType:r}}}function gWt(t,e){var o;switch(e){case"latitude":case"longitude":return"quantitative";case"row":case"column":case"facet":case"shape":case"strokeDash":return"nominal";case"order":return"ordinal"}if(Rse(t)&&We(t.sort))return"ordinal";const{aggregate:n,bin:r,timeUnit:i}=t;if(i)return"temporal";if(r||n&&!Jy(n)&&!Ng(n))return"quantitative";if(xb(t)&&((o=t.scale)!=null&&o.type))switch(OY[t.scale.type]){case"numeric":case"discretizing":return"quantitative";case"time":return"temporal"}return"nominal"}function Xf(t){if(Je(t))return t;if(k6(t))return t.condition}function So(t){if(en(t))return t;if(VR(t))return t.condition}function _4e(t,e,n,r={}){if(gt(t)||Jn(t)||By(t)){const i=gt(t)?"string":Jn(t)?"number":"boolean";return Ze(pUt(e,i,t)),{value:t}}return en(t)?B5(t,e,n,r):VR(t)?{...t,condition:B5(t.condition,e,n,r)}:t}function B5(t,e,n,r){if(y4e(t)){const{format:i,formatType:o,...s}=t;if(E1(o)&&!n.customFormatTypes)return Ze(tye(e)),B5(s,e,n,r)}else{const i=rC(t)?"axis":v4e(t)?"legend":Mse(t)?"header":null;if(i&&t[i]){const{format:o,formatType:s,...a}=t[i];if(E1(s)&&!n.customFormatTypes)return Ze(tye(e)),B5({...t,[i]:a},e,n,r)}}return Je(t)?Lse(t,e,r):mWt(t)}function mWt(t){let e=t.type;if(e)return t;const{datum:n}=t;return e=Jn(n)?"quantitative":gt(n)?"nominal":vb(n)?"temporal":void 0,{...t,type:e}}function Lse(t,e,{compositeMark:n=!1}={}){const{aggregate:r,timeUnit:i,bin:o,field:s}=t,a={...t};if(!n&&r&&!lse(r)&&!Jy(r)&&!Ng(r)&&(Ze(mUt(r)),delete a.aggregate),i&&(a.timeUnit=Uo(i)),s&&(a.field=`${s}`),Gr(o)&&(a.bin=A6(o,e)),ns(o)&&!Yi(e)&&Ze(XUt(e)),Ra(a)){const{type:l}=a,c=x8t(l);l!==c&&(a.type=c),l!=="quantitative"&&v6(r)&&(Ze(gUt(l,r)),a.type="quantitative")}else if(!gje(e)){const l=gWt(a,e);a.type=l}if(Ra(a)){const{compatible:l,warning:c}=vWt(a,e)||{};l===!1&&Ze(c)}if(Rse(a)&>(a.sort)){const{sort:l}=a;if(aye(l))return{...a,sort:{encoding:l}};const c=l.substring(1);if(l.charAt(0)==="-"&&aye(c))return{...a,sort:{encoding:c,order:"descending"}}}if(Mse(a)){const{header:l}=a;if(l){const{orient:c,...u}=l;if(c)return{...a,header:{...u,labelOrient:l.labelOrient||c,titleOrient:l.titleOrient||c}}}}return a}function A6(t,e){return By(t)?{maxbins:Hve(e)}:t==="binned"?{binned:!0}:!t.maxbins&&!t.step?{...t,maxbins:Hve(e)}:t}const tw={compatible:!0};function vWt(t,e){const n=t.type;if(n==="geojson"&&e!=="shape")return{compatible:!1,warning:`Channel ${e} should not be used with a geojson data.`};switch(e){case lg:case cg:case f6:return z5(t)?tw:{compatible:!1,warning:bUt(e)};case vi:case Yo:case Xy:case DO:case Ol:case Xh:case Yh:case $R:case FR:case d6:case _1:case h6:case p6:case hb:case ju:case sd:case g6:return tw;case ld:case Ru:case ad:case cd:return n!==C1?{compatible:!1,warning:`Channel ${e} should be used with a quantitative field only, not ${t.type} field.`}:tw;case em:case Yy:case Qy:case Ky:case Jg:case Zg:case Kg:case od:case qh:return n==="nominal"&&!t.sort?{compatible:!1,warning:`Channel ${e} should not be used with an unsorted discrete field.`}:tw;case El:case Zy:return!z5(t)&&!uWt(t)?{compatible:!1,warning:wUt(e)}:tw;case ZS:return t.type==="nominal"&&!("sort"in t)?{compatible:!1,warning:"Channel order is inappropriate for nominal field, which has no inherent order."}:tw}}function iC(t){const{formatType:e}=j5(t);return e==="time"||!e&&yWt(t)}function yWt(t){return t&&(t.type==="temporal"||Je(t)&&!!t.timeUnit)}function P6(t,{timeUnit:e,type:n,wrapTime:r,undefinedIfExprNotRequired:i}){var l;const o=e&&((l=Uo(e))==null?void 0:l.unit);let s=o||n==="temporal",a;return zR(t)?a=t.expr:Mt(t)?a=t.signal:vb(t)?(s=!0,a=S1(t)):(gt(t)||Jn(t))&&s&&(a=`datetime(${Tr(t)})`,s8t(o)&&(Jn(t)&&t<1e4||gt(t)&&isNaN(Date.parse(t)))&&(a=S1({[o]:t}))),a?r&&s?`time(${a})`:a:i?void 0:Tr(t)}function S4e(t,e){const{type:n}=t;return e.map(r=>{const i=Je(t)&&!yb(t.timeUnit)?t.timeUnit:void 0,o=P6(r,{timeUnit:i,type:n,undefinedIfExprNotRequired:!0});return o!==void 0?{signal:o}:r})}function GR(t,e){return Gr(t.bin)?Kh(e)&&["ordinal","nominal"].includes(t.type):(console.warn("Only call this method for binned field defs."),!1)}const uye={labelAlign:{part:"labels",vgProp:"align"},labelBaseline:{part:"labels",vgProp:"baseline"},labelColor:{part:"labels",vgProp:"fill"},labelFont:{part:"labels",vgProp:"font"},labelFontSize:{part:"labels",vgProp:"fontSize"},labelFontStyle:{part:"labels",vgProp:"fontStyle"},labelFontWeight:{part:"labels",vgProp:"fontWeight"},labelOpacity:{part:"labels",vgProp:"opacity"},labelOffset:null,labelPadding:null,gridColor:{part:"grid",vgProp:"stroke"},gridDash:{part:"grid",vgProp:"strokeDash"},gridDashOffset:{part:"grid",vgProp:"strokeDashOffset"},gridOpacity:{part:"grid",vgProp:"opacity"},gridWidth:{part:"grid",vgProp:"strokeWidth"},tickColor:{part:"ticks",vgProp:"stroke"},tickDash:{part:"ticks",vgProp:"strokeDash"},tickDashOffset:{part:"ticks",vgProp:"strokeDashOffset"},tickOpacity:{part:"ticks",vgProp:"opacity"},tickSize:null,tickWidth:{part:"ticks",vgProp:"strokeWidth"}};function HR(t){return t==null?void 0:t.condition}const C4e=["domain","grid","labels","ticks","title"],xWt={grid:"grid",gridCap:"grid",gridColor:"grid",gridDash:"grid",gridDashOffset:"grid",gridOpacity:"grid",gridScale:"grid",gridWidth:"grid",orient:"main",bandPosition:"both",aria:"main",description:"main",domain:"main",domainCap:"main",domainColor:"main",domainDash:"main",domainDashOffset:"main",domainOpacity:"main",domainWidth:"main",format:"main",formatType:"main",labelAlign:"main",labelAngle:"main",labelBaseline:"main",labelBound:"main",labelColor:"main",labelFlush:"main",labelFlushOffset:"main",labelFont:"main",labelFontSize:"main",labelFontStyle:"main",labelFontWeight:"main",labelLimit:"main",labelLineHeight:"main",labelOffset:"main",labelOpacity:"main",labelOverlap:"main",labelPadding:"main",labels:"main",labelSeparation:"main",maxExtent:"main",minExtent:"main",offset:"both",position:"main",tickCap:"main",tickColor:"main",tickDash:"main",tickDashOffset:"main",tickMinStep:"both",tickOffset:"both",tickOpacity:"main",tickRound:"both",ticks:"main",tickSize:"main",tickWidth:"both",title:"main",titleAlign:"main",titleAnchor:"main",titleAngle:"main",titleBaseline:"main",titleColor:"main",titleFont:"main",titleFontSize:"main",titleFontStyle:"main",titleFontWeight:"main",titleLimit:"main",titleLineHeight:"main",titleOpacity:"main",titlePadding:"main",titleX:"main",titleY:"main",encode:"both",scale:"both",tickBand:"both",tickCount:"both",tickExtra:"both",translate:"both",values:"both",zindex:"both"},O4e={orient:1,aria:1,bandPosition:1,description:1,domain:1,domainCap:1,domainColor:1,domainDash:1,domainDashOffset:1,domainOpacity:1,domainWidth:1,format:1,formatType:1,grid:1,gridCap:1,gridColor:1,gridDash:1,gridDashOffset:1,gridOpacity:1,gridWidth:1,labelAlign:1,labelAngle:1,labelBaseline:1,labelBound:1,labelColor:1,labelFlush:1,labelFlushOffset:1,labelFont:1,labelFontSize:1,labelFontStyle:1,labelFontWeight:1,labelLimit:1,labelLineHeight:1,labelOffset:1,labelOpacity:1,labelOverlap:1,labelPadding:1,labels:1,labelSeparation:1,maxExtent:1,minExtent:1,offset:1,position:1,tickBand:1,tickCap:1,tickColor:1,tickCount:1,tickDash:1,tickDashOffset:1,tickExtra:1,tickMinStep:1,tickOffset:1,tickOpacity:1,tickRound:1,ticks:1,tickSize:1,tickWidth:1,title:1,titleAlign:1,titleAnchor:1,titleAngle:1,titleBaseline:1,titleColor:1,titleFont:1,titleFontSize:1,titleFontStyle:1,titleFontWeight:1,titleLimit:1,titleLineHeight:1,titleOpacity:1,titlePadding:1,titleX:1,titleY:1,translate:1,values:1,zindex:1},bWt={...O4e,style:1,labelExpr:1,encoding:1};function fye(t){return vt(bWt,t)}const wWt={axis:1,axisBand:1,axisBottom:1,axisDiscrete:1,axisLeft:1,axisPoint:1,axisQuantitative:1,axisRight:1,axisTemporal:1,axisTop:1,axisX:1,axisXBand:1,axisXDiscrete:1,axisXPoint:1,axisXQuantitative:1,axisXTemporal:1,axisY:1,axisYBand:1,axisYDiscrete:1,axisYPoint:1,axisYQuantitative:1,axisYTemporal:1},E4e=Qe(wWt);function nm(t){return Ke(t,"mark")}class M6{constructor(e,n){this.name=e,this.run=n}hasMatchingType(e){return nm(e)?Y8t(e.mark)===this.name:!1}}function Ux(t,e){const n=t&&t[e];return n?We(n)?QS(n,r=>!!r.field):Je(n)||k6(n):!1}function T4e(t,e){const n=t&&t[e];return n?We(n)?QS(n,r=>!!r.field):Je(n)||Zh(n)||VR(n):!1}function k4e(t,e){if(Yi(e)){const n=t[e];if((Je(n)||Zh(n))&&(Xje(n.type)||Je(n)&&n.timeUnit)){const r=rse(e);return T4e(t,r)}}return!1}function A4e(t){return QS(b6t,e=>{if(Ux(t,e)){const n=t[e];if(We(n))return QS(n,r=>!!r.aggregate);{const r=Xf(n);return r&&!!r.aggregate}}return!1})}function P4e(t,e){const n=[],r=[],i=[],o=[],s={};return $se(t,(a,l)=>{if(Je(a)){const{field:c,aggregate:u,bin:f,timeUnit:d,...h}=a;if(u||d||f){const p=Dse(a),g=p==null?void 0:p.title;let m=ct(a,{forAs:!0});const v={...g?[]:{title:j_(a,e,{allowDisabling:!0})},...h,field:m};if(u){let y;if(Jy(u)?(y="argmax",m=ct({op:"argmax",field:u.argmax},{forAs:!0}),v.field=`${m}.${c}`):Ng(u)?(y="argmin",m=ct({op:"argmin",field:u.argmin},{forAs:!0}),v.field=`${m}.${c}`):u!=="boxplot"&&u!=="errorbar"&&u!=="errorband"&&(y=u),y){const x={op:y,as:m};c&&(x.field=c),o.push(x)}}else if(n.push(m),Ra(a)&&Gr(f)){if(r.push({bin:f,field:c,as:m}),n.push(ct(a,{binSuffix:"end"})),GR(a,l)&&n.push(ct(a,{binSuffix:"range"})),Yi(l)){const y={field:`${m}_end`};s[`${l}2`]=y}v.bin="binned",gje(l)||(v.type=C1)}else if(d&&!yb(d)){i.push({timeUnit:d,field:c,as:m});const y=Ra(a)&&a.type!==eC&&"time";y&&(l===$R||l===_1?v.formatType=y:P6t(l)?v.legend={formatType:y,...v.legend}:Yi(l)&&(v.axis={formatType:y,...v.axis}))}s[l]=v}else n.push(c),s[l]=t[l]}else s[l]=t[l]}),{bins:r,timeUnits:i,aggregate:o,groupby:n,encoding:s}}function _Wt(t,e,n){const r=R6t(e,n);if(r){if(r==="binned"){const i=t[e===od?vi:Yo];return!!(Je(i)&&Je(t[e])&&ns(i.bin))}}else return!1;return!0}function SWt(t,e,n,r){const i={};for(const o of Qe(t))pje(o)||Ze(xUt(o));for(let o of E6t){if(!t[o])continue;const s=t[o];if(NR(o)){const a=O6t(o),l=i[a];if(Je(l)&&y8t(l.type)&&Je(s)&&!l.timeUnit){Ze(hUt(a));continue}}if(o==="angle"&&e==="arc"&&!t.theta&&(Ze(dUt),o=ju),!_Wt(t,o,e)){Ze(x6(o,e));continue}if(o===Jg&&e==="line"){const a=Xf(t[o]);if(a!=null&&a.aggregate){Ze(yUt);continue}}if(o===Ol&&(n?"fill"in t:"stroke"in t)){Ze(Rje("encoding",{fill:"fill"in t,stroke:"stroke"in t}));continue}if(o===FR||o===ZS&&!We(s)&&!qf(s)||o===_1&&We(s)){if(s){if(o===ZS){const a=t[o];if(m4e(a)){i[o]=a;continue}}i[o]=pt(s).reduce((a,l)=>(Je(l)?a.push(Lse(l,o)):Ze(CY(l,o)),a),[])}}else{if(o===_1&&s===null)i[o]=null;else if(!Je(s)&&!Zh(s)&&!qf(s)&&!WR(s)&&!Mt(s)){Ze(CY(s,o));continue}i[o]=_4e(s,o,r)}}return i}function R6(t,e){const n={};for(const r of Qe(t)){const i=_4e(t[r],r,e,{compositeMark:!0});n[r]=i}return n}function CWt(t){const e=[];for(const n of Qe(t))if(Ux(t,n)){const r=t[n],i=pt(r);for(const o of i)Je(o)?e.push(o):k6(o)&&e.push(o.condition)}return e}function $se(t,e,n){if(t)for(const r of Qe(t)){const i=t[r];if(We(i))for(const o of i)e.call(n,o,r);else e.call(n,i,r)}}function OWt(t,e,n,r){return t?Qe(t).reduce((i,o)=>{const s=t[o];return We(s)?s.reduce((a,l)=>e.call(r,a,l,o),i):e.call(r,i,s,o)},n):n}function M4e(t,e){return Qe(e).reduce((n,r)=>{switch(r){case vi:case Yo:case h6:case g6:case p6:case od:case qh:case Xy:case DO:case ju:case Zg:case sd:case Kg:case ad:case ld:case cd:case Ru:case $R:case El:case hb:case _1:return n;case ZS:if(t==="line"||t==="trail")return n;case FR:case d6:{const i=e[r];if(We(i)||Je(i))for(const o of pt(i))o.aggregate||n.push(ct(o,{}));return n}case Jg:if(t==="trail")return n;case Ol:case Xh:case Yh:case em:case Yy:case Qy:case Zy:case Ky:{const i=Xf(e[r]);return i&&!i.aggregate&&n.push(ct(i,{})),n}}},[])}function EWt(t){const{tooltip:e,...n}=t;if(!e)return{filteredEncoding:n};let r,i;if(We(e)){for(const o of e)o.aggregate?(r||(r=[]),r.push(o)):(i||(i=[]),i.push(o));r&&(n.tooltip=r)}else e.aggregate?n.tooltip=e:i=e;return We(i)&&i.length===1&&(i=i[0]),{customTooltipWithoutAggregatedField:i,filteredEncoding:n}}function kY(t,e,n,r=!0){if("tooltip"in n)return{tooltip:n.tooltip};const i=t.map(({fieldPrefix:s,titlePrefix:a})=>{const l=r?` of ${Fse(e)}`:"";return{field:s+e.field,type:e.type,title:Mt(a)?{signal:`${a}"${escape(l)}"`}:a+l}}),o=CWt(n).map(lWt);return{tooltip:[...i,...Jd(o,Mn)]}}function Fse(t){const{title:e,field:n}=t;return Xi(e,n)}function Nse(t,e,n,r,i){const{scale:o,axis:s}=n;return({partName:a,mark:l,positionPrefix:c,endPositionPrefix:u=void 0,extraEncoding:f={}})=>{const d=Fse(n);return R4e(t,a,i,{mark:l,encoding:{[e]:{field:`${c}_${n.field}`,type:n.type,...d!==void 0?{title:d}:{},...o!==void 0?{scale:o}:{},...s!==void 0?{axis:s}:{}},...gt(u)?{[`${e}2`]:{field:`${u}_${n.field}`}}:{},...r,...f}})}}function R4e(t,e,n,r){const{clip:i,color:o,opacity:s}=t,a=t.type;return t[e]||t[e]===void 0&&n[e]?[{...r,mark:{...n[e],...i?{clip:i}:{},...o?{color:o}:{},...s?{opacity:s}:{},...Dh(r.mark)?r.mark:{type:r.mark},style:`${a}-${String(e)}`,...By(t[e])?{}:t[e]}}]:[]}function D4e(t,e,n){const{encoding:r}=t,i=e==="vertical"?"y":"x",o=r[i],s=r[`${i}2`],a=r[`${i}Error`],l=r[`${i}Error2`];return{continuousAxisChannelDef:nL(o,n),continuousAxisChannelDef2:nL(s,n),continuousAxisChannelDefError:nL(a,n),continuousAxisChannelDefError2:nL(l,n),continuousAxis:i}}function nL(t,e){if(t!=null&&t.aggregate){const{aggregate:n,...r}=t;return n!==e&&Ze(qUt(n,e)),r}else return t}function I4e(t,e){const{mark:n,encoding:r}=t,{x:i,y:o}=r;if(Dh(n)&&n.orient)return n.orient;if(bv(i)){if(bv(o)){const s=Je(i)&&i.aggregate,a=Je(o)&&o.aggregate;if(!s&&a===e)return"vertical";if(!a&&s===e)return"horizontal";if(s===e&&a===e)throw new Error("Both x and y cannot have aggregate");return iC(o)&&!iC(i)?"horizontal":"vertical"}return"horizontal"}else{if(bv(o))return"vertical";throw new Error(`Need a valid continuous axis for ${e}s`)}}const U5="boxplot",TWt=["box","median","outliers","rule","ticks"],kWt=new M6(U5,$4e);function L4e(t){return Jn(t)?"tukey":t}function $4e(t,{config:e}){t={...t,encoding:R6(t.encoding,e)};const{mark:n,encoding:r,params:i,projection:o,...s}=t,a=Dh(n)?n:{type:n};i&&Ze(Pje("boxplot"));const l=a.extent??e.boxplot.extent,c=Or("size",a,e),u=a.invalid,f=L4e(l),{bins:d,timeUnits:h,transform:p,continuousAxisChannelDef:g,continuousAxis:m,groupby:v,aggregate:y,encodingWithoutContinuousAxis:x,ticksOrient:b,boxOrient:w,customTooltipWithoutAggregatedField:_}=AWt(t,l,e),S=RO(g.field),{color:O,size:k,...E}=x,M=X=>Nse(a,m,g,X,e.boxplot),A=M(E),P=M(x),T=(ht(e.boxplot.box)?e.boxplot.box.color:e.mark.color)||"#4c78a8",R=M({...E,...k?{size:k}:{},color:{condition:{test:`datum['lower_box_${g.field}'] >= datum['upper_box_${g.field}']`,...O||{value:T}}}}),I=kY([{fieldPrefix:f==="min-max"?"upper_whisker_":"max_",titlePrefix:"Max"},{fieldPrefix:"upper_box_",titlePrefix:"Q3"},{fieldPrefix:"mid_box_",titlePrefix:"Median"},{fieldPrefix:"lower_box_",titlePrefix:"Q1"},{fieldPrefix:f==="min-max"?"lower_whisker_":"min_",titlePrefix:"Min"}],g,x),B={type:"tick",color:"black",opacity:1,orient:b,invalid:u,aria:!1},$=f==="min-max"?I:kY([{fieldPrefix:"upper_whisker_",titlePrefix:"Upper Whisker"},{fieldPrefix:"lower_whisker_",titlePrefix:"Lower Whisker"}],g,x),z=[...A({partName:"rule",mark:{type:"rule",invalid:u,aria:!1},positionPrefix:"lower_whisker",endPositionPrefix:"lower_box",extraEncoding:$}),...A({partName:"rule",mark:{type:"rule",invalid:u,aria:!1},positionPrefix:"upper_box",endPositionPrefix:"upper_whisker",extraEncoding:$}),...A({partName:"ticks",mark:B,positionPrefix:"lower_whisker",extraEncoding:$}),...A({partName:"ticks",mark:B,positionPrefix:"upper_whisker",extraEncoding:$})],L=[...f!=="tukey"?z:[],...P({partName:"box",mark:{type:"bar",...c?{size:c}:{},orient:w,invalid:u,ariaRoleDescription:"box"},positionPrefix:"lower_box",endPositionPrefix:"upper_box",extraEncoding:I}),...R({partName:"median",mark:{type:"tick",invalid:u,...ht(e.boxplot.median)&&e.boxplot.median.color?{color:e.boxplot.median.color}:{},...c?{size:c}:{},orient:b,aria:!1},positionPrefix:"mid_box",extraEncoding:I})];if(f==="min-max")return{...s,transform:(s.transform??[]).concat(p),layer:L};const j=`datum["lower_box_${g.field}"]`,N=`datum["upper_box_${g.field}"]`,F=`(${N} - ${j})`,H=`${j} - ${l} * ${F}`,q=`${N} + ${l} * ${F}`,Y=`datum["${g.field}"]`,le={joinaggregate:F4e(g.field),groupby:v},K={transform:[{filter:`(${H} <= ${Y}) && (${Y} <= ${q})`},{aggregate:[{op:"min",field:g.field,as:`lower_whisker_${S}`},{op:"max",field:g.field,as:`upper_whisker_${S}`},{op:"min",field:`lower_box_${g.field}`,as:`lower_box_${S}`},{op:"max",field:`upper_box_${g.field}`,as:`upper_box_${S}`},...y],groupby:v}],layer:z},{tooltip:ee,...re}=E,{scale:me,axis:te}=g,ae=Fse(g),U=gl(te,["title"]),oe=R4e(a,"outliers",e.boxplot,{transform:[{filter:`(${Y} < ${H}) || (${Y} > ${q})`}],mark:"point",encoding:{[m]:{field:g.field,type:g.type,...ae!==void 0?{title:ae}:{},...me!==void 0?{scale:me}:{},...Er(U)?{}:{axis:U}},...re,...O?{color:O}:{},..._?{tooltip:_}:{}}})[0];let ne;const V=[...d,...h,le];return oe?ne={transform:V,layer:[oe,K]}:(ne=K,ne.transform.unshift(...V)),{...s,layer:[ne,{transform:p,layer:L}]}}function F4e(t){const e=RO(t);return[{op:"q1",field:t,as:`lower_box_${e}`},{op:"q3",field:t,as:`upper_box_${e}`}]}function AWt(t,e,n){const r=I4e(t,U5),{continuousAxisChannelDef:i,continuousAxis:o}=D4e(t,r,U5),s=i.field,a=RO(s),l=L4e(e),c=[...F4e(s),{op:"median",field:s,as:`mid_box_${a}`},{op:"min",field:s,as:(l==="min-max"?"lower_whisker_":"min_")+a},{op:"max",field:s,as:(l==="min-max"?"upper_whisker_":"max_")+a}],u=l==="min-max"||l==="tukey"?[]:[{calculate:`datum["upper_box_${a}"] - datum["lower_box_${a}"]`,as:`iqr_${a}`},{calculate:`min(datum["upper_box_${a}"] + datum["iqr_${a}"] * ${e}, datum["max_${a}"])`,as:`upper_whisker_${a}`},{calculate:`max(datum["lower_box_${a}"] - datum["iqr_${a}"] * ${e}, datum["min_${a}"])`,as:`lower_whisker_${a}`}],{[o]:f,...d}=t.encoding,{customTooltipWithoutAggregatedField:h,filteredEncoding:p}=EWt(d),{bins:g,timeUnits:m,aggregate:v,groupby:y,encoding:x}=P4e(p,n),b=r==="vertical"?"horizontal":"vertical",w=r,_=[...g,...m,{aggregate:[...v,...c],groupby:y},...u];return{bins:g,timeUnits:m,transform:_,groupby:y,aggregate:v,continuousAxisChannelDef:i,continuousAxis:o,encodingWithoutContinuousAxis:x,ticksOrient:b,boxOrient:w,customTooltipWithoutAggregatedField:h}}const zse="errorbar",PWt=["ticks","rule"],MWt=new M6(zse,N4e);function N4e(t,{config:e}){t={...t,encoding:R6(t.encoding,e)};const{transform:n,continuousAxisChannelDef:r,continuousAxis:i,encodingWithoutContinuousAxis:o,ticksOrient:s,markDef:a,outerSpec:l,tooltipEncoding:c}=z4e(t,zse,e);delete o.size;const u=Nse(a,i,r,o,e.errorbar),f=a.thickness,d=a.size,h={type:"tick",orient:s,aria:!1,...f!==void 0?{thickness:f}:{},...d!==void 0?{size:d}:{}},p=[...u({partName:"ticks",mark:h,positionPrefix:"lower",extraEncoding:c}),...u({partName:"ticks",mark:h,positionPrefix:"upper",extraEncoding:c}),...u({partName:"rule",mark:{type:"rule",ariaRoleDescription:"errorbar",...f!==void 0?{size:f}:{}},positionPrefix:"lower",endPositionPrefix:"upper",extraEncoding:c})];return{...l,transform:n,...p.length>1?{layer:p}:{...p[0]}}}function RWt(t,e){const{encoding:n}=t;if(DWt(n))return{orient:I4e(t,e),inputType:"raw"};const r=IWt(n),i=LWt(n),o=n.x,s=n.y;if(r){if(i)throw new Error(`${e} cannot be both type aggregated-upper-lower and aggregated-error`);const a=n.x2,l=n.y2;if(en(a)&&en(l))throw new Error(`${e} cannot have both x2 and y2`);if(en(a)){if(bv(o))return{orient:"horizontal",inputType:"aggregated-upper-lower"};throw new Error(`Both x and x2 have to be quantitative in ${e}`)}else if(en(l)){if(bv(s))return{orient:"vertical",inputType:"aggregated-upper-lower"};throw new Error(`Both y and y2 have to be quantitative in ${e}`)}throw new Error("No ranged axis")}else{const a=n.xError,l=n.xError2,c=n.yError,u=n.yError2;if(en(l)&&!en(a))throw new Error(`${e} cannot have xError2 without xError`);if(en(u)&&!en(c))throw new Error(`${e} cannot have yError2 without yError`);if(en(a)&&en(c))throw new Error(`${e} cannot have both xError and yError with both are quantiative`);if(en(a)){if(bv(o))return{orient:"horizontal",inputType:"aggregated-error"};throw new Error("All x, xError, and xError2 (if exist) have to be quantitative")}else if(en(c)){if(bv(s))return{orient:"vertical",inputType:"aggregated-error"};throw new Error("All y, yError, and yError2 (if exist) have to be quantitative")}throw new Error("No ranged axis")}}function DWt(t){return(en(t.x)||en(t.y))&&!en(t.x2)&&!en(t.y2)&&!en(t.xError)&&!en(t.xError2)&&!en(t.yError)&&!en(t.yError2)}function IWt(t){return en(t.x2)||en(t.y2)}function LWt(t){return en(t.xError)||en(t.xError2)||en(t.yError)||en(t.yError2)}function z4e(t,e,n){const{mark:r,encoding:i,params:o,projection:s,...a}=t,l=Dh(r)?r:{type:r};o&&Ze(Pje(e));const{orient:c,inputType:u}=RWt(t,e),{continuousAxisChannelDef:f,continuousAxisChannelDef2:d,continuousAxisChannelDefError:h,continuousAxisChannelDefError2:p,continuousAxis:g}=D4e(t,c,e),{errorBarSpecificAggregate:m,postAggregateCalculates:v,tooltipSummary:y,tooltipTitleWithFieldName:x}=$Wt(l,f,d,h,p,u,e,n),{[g]:b,[g==="x"?"x2":"y2"]:w,[g==="x"?"xError":"yError"]:_,[g==="x"?"xError2":"yError2"]:S,...O}=i,{bins:k,timeUnits:E,aggregate:M,groupby:A,encoding:P}=P4e(O,n),T=[...M,...m],R=u!=="raw"?[]:A,I=kY(y,f,P,x);return{transform:[...a.transform??[],...k,...E,...T.length===0?[]:[{aggregate:T,groupby:R}],...v],groupby:R,continuousAxisChannelDef:f,continuousAxis:g,encodingWithoutContinuousAxis:P,ticksOrient:c==="vertical"?"horizontal":"vertical",markDef:l,outerSpec:a,tooltipEncoding:I}}function $Wt(t,e,n,r,i,o,s,a){let l=[],c=[];const u=e.field;let f,d=!1;if(o==="raw"){const h=t.center?t.center:t.extent?t.extent==="iqr"?"median":"mean":a.errorbar.center,p=t.extent?t.extent:h==="mean"?"stderr":"iqr";if(h==="median"!=(p==="iqr")&&Ze(HUt(h,p,s)),p==="stderr"||p==="stdev")l=[{op:p,field:u,as:`extent_${u}`},{op:h,field:u,as:`center_${u}`}],c=[{calculate:`datum["center_${u}"] + datum["extent_${u}"]`,as:`upper_${u}`},{calculate:`datum["center_${u}"] - datum["extent_${u}"]`,as:`lower_${u}`}],f=[{fieldPrefix:"center_",titlePrefix:LR(h)},{fieldPrefix:"upper_",titlePrefix:dye(h,p,"+")},{fieldPrefix:"lower_",titlePrefix:dye(h,p,"-")}],d=!0;else{let g,m,v;p==="ci"?(g="mean",m="ci0",v="ci1"):(g="median",m="q1",v="q3"),l=[{op:m,field:u,as:`lower_${u}`},{op:v,field:u,as:`upper_${u}`},{op:g,field:u,as:`center_${u}`}],f=[{fieldPrefix:"upper_",titlePrefix:j_({field:u,aggregate:v,type:"quantitative"},a,{allowDisabling:!1})},{fieldPrefix:"lower_",titlePrefix:j_({field:u,aggregate:m,type:"quantitative"},a,{allowDisabling:!1})},{fieldPrefix:"center_",titlePrefix:j_({field:u,aggregate:g,type:"quantitative"},a,{allowDisabling:!1})}]}}else{(t.center||t.extent)&&Ze(GUt(t.center,t.extent)),o==="aggregated-upper-lower"?(f=[],c=[{calculate:`datum["${n.field}"]`,as:`upper_${u}`},{calculate:`datum["${u}"]`,as:`lower_${u}`}]):o==="aggregated-error"&&(f=[{fieldPrefix:"",titlePrefix:u}],c=[{calculate:`datum["${u}"] + datum["${r.field}"]`,as:`upper_${u}`}],i?c.push({calculate:`datum["${u}"] + datum["${i.field}"]`,as:`lower_${u}`}):c.push({calculate:`datum["${u}"] - datum["${r.field}"]`,as:`lower_${u}`}));for(const h of c)f.push({fieldPrefix:h.as.substring(0,6),titlePrefix:w1(w1(h.calculate,'datum["',""),'"]',"")})}return{postAggregateCalculates:c,errorBarSpecificAggregate:l,tooltipSummary:f,tooltipTitleWithFieldName:d}}function dye(t,e,n){return`${LR(t)} ${n} ${e}`}const jse="errorband",FWt=["band","borders"],NWt=new M6(jse,j4e);function j4e(t,{config:e}){t={...t,encoding:R6(t.encoding,e)};const{transform:n,continuousAxisChannelDef:r,continuousAxis:i,encodingWithoutContinuousAxis:o,markDef:s,outerSpec:a,tooltipEncoding:l}=z4e(t,jse,e),c=s,u=Nse(c,i,r,o,e.errorband),f=t.encoding.x!==void 0&&t.encoding.y!==void 0;let d={type:f?"area":"rect"},h={type:f?"line":"rule"};const p={...c.interpolate?{interpolate:c.interpolate}:{},...c.tension&&c.interpolate?{tension:c.tension}:{}};return f?(d={...d,...p,ariaRoleDescription:"errorband"},h={...h,...p,aria:!1}):c.interpolate?Ze(rye("interpolate")):c.tension&&Ze(rye("tension")),{...a,transform:n,layer:[...u({partName:"band",mark:d,positionPrefix:"lower",endPositionPrefix:"upper",extraEncoding:l}),...u({partName:"borders",mark:h,positionPrefix:"lower",extraEncoding:l}),...u({partName:"borders",mark:h,positionPrefix:"upper",extraEncoding:l})]}}const B4e={};function Bse(t,e,n){const r=new M6(t,e);B4e[t]={normalizer:r,parts:n}}function zWt(){return Qe(B4e)}Bse(U5,$4e,TWt);Bse(zse,N4e,PWt);Bse(jse,j4e,FWt);const jWt=["gradientHorizontalMaxLength","gradientHorizontalMinLength","gradientVerticalMaxLength","gradientVerticalMinLength","unselectedOpacity"],U4e={titleAlign:"align",titleAnchor:"anchor",titleAngle:"angle",titleBaseline:"baseline",titleColor:"color",titleFont:"font",titleFontSize:"fontSize",titleFontStyle:"fontStyle",titleFontWeight:"fontWeight",titleLimit:"limit",titleLineHeight:"lineHeight",titleOrient:"orient",titlePadding:"offset"},W4e={labelAlign:"align",labelAnchor:"anchor",labelAngle:"angle",labelBaseline:"baseline",labelColor:"color",labelFont:"font",labelFontSize:"fontSize",labelFontStyle:"fontStyle",labelFontWeight:"fontWeight",labelLimit:"limit",labelLineHeight:"lineHeight",labelOrient:"orient",labelPadding:"offset"},BWt=Qe(U4e),UWt=Qe(W4e),WWt={header:1,headerRow:1,headerColumn:1,headerFacet:1},V4e=Qe(WWt),G4e=["size","shape","fill","stroke","strokeDash","strokeWidth","opacity"],VWt={gradientHorizontalMaxLength:200,gradientHorizontalMinLength:100,gradientVerticalMaxLength:200,gradientVerticalMinLength:64,unselectedOpacity:.35},GWt={aria:1,clipHeight:1,columnPadding:1,columns:1,cornerRadius:1,description:1,direction:1,fillColor:1,format:1,formatType:1,gradientLength:1,gradientOpacity:1,gradientStrokeColor:1,gradientStrokeWidth:1,gradientThickness:1,gridAlign:1,labelAlign:1,labelBaseline:1,labelColor:1,labelFont:1,labelFontSize:1,labelFontStyle:1,labelFontWeight:1,labelLimit:1,labelOffset:1,labelOpacity:1,labelOverlap:1,labelPadding:1,labelSeparation:1,legendX:1,legendY:1,offset:1,orient:1,padding:1,rowPadding:1,strokeColor:1,symbolDash:1,symbolDashOffset:1,symbolFillColor:1,symbolLimit:1,symbolOffset:1,symbolOpacity:1,symbolSize:1,symbolStrokeColor:1,symbolStrokeWidth:1,symbolType:1,tickCount:1,tickMinStep:1,title:1,titleAlign:1,titleAnchor:1,titleBaseline:1,titleColor:1,titleFont:1,titleFontSize:1,titleFontStyle:1,titleFontWeight:1,titleLimit:1,titleLineHeight:1,titleOpacity:1,titleOrient:1,titlePadding:1,type:1,values:1,zindex:1},Yf="_vgsid_",HWt={point:{on:"click",fields:[Yf],toggle:"event.shiftKey",resolve:"global",clear:"dblclick"},interval:{on:"[pointerdown, window:pointerup] > window:pointermove!",encodings:["x","y"],translate:"[pointerdown, window:pointerup] > window:pointermove!",zoom:"wheel!",mark:{fill:"#333",fillOpacity:.125,stroke:"white"},resolve:"global",clear:"dblclick"}};function Use(t){return t==="legend"||!!(t!=null&&t.legend)}function UV(t){return Use(t)&&ht(t)}function Wse(t){return!!(t!=null&&t.select)}function H4e(t){const e=[];for(const n of t||[]){if(Wse(n))continue;const{expr:r,bind:i,...o}=n;if(i&&r){const s={...o,bind:i,init:r};e.push(s)}else{const s={...o,...r?{update:r}:{},...i?{bind:i}:{}};e.push(s)}}return e}function qWt(t){return D6(t)||Gse(t)||Vse(t)}function Vse(t){return Ke(t,"concat")}function D6(t){return Ke(t,"vconcat")}function Gse(t){return Ke(t,"hconcat")}function q4e({step:t,offsetIsDiscrete:e}){return e?t.for??"offset":"position"}function Ih(t){return Ke(t,"step")}function hye(t){return Ke(t,"view")||Ke(t,"width")||Ke(t,"height")}const pye=20,XWt={align:1,bounds:1,center:1,columns:1,spacing:1},YWt=Qe(XWt);function QWt(t,e,n){const r=n[e],i={},{spacing:o,columns:s}=r;o!==void 0&&(i.spacing=o),s!==void 0&&(T6(t)&&!UR(t.facet)||Vse(t))&&(i.columns=s),D6(t)&&(i.columns=1);for(const a of YWt)if(t[a]!==void 0)if(a==="spacing"){const l=t[a];i[a]=Jn(l)?l:{row:l.row??o,column:l.column??o}}else i[a]=t[a];return i}function AY(t,e){return t[e]??t[e==="width"?"continuousWidth":"continuousHeight"]}function PY(t,e){const n=W5(t,e);return Ih(n)?n.step:X4e}function W5(t,e){const n=t[e]??t[e==="width"?"discreteWidth":"discreteHeight"];return Xi(n,{step:t.step})}const X4e=20,KWt={continuousWidth:200,continuousHeight:200,step:X4e},ZWt={background:"white",padding:5,timeFormat:"%b %d, %Y",countTitle:"Count of Records",view:KWt,mark:W8t,arc:{},area:{},bar:q8t,circle:{},geoshape:{},image:{},line:{},point:{},rect:Ese,rule:{color:"black"},square:{},text:{color:"black"},tick:X8t,trail:{},boxplot:{size:14,extent:1.5,box:{},median:{color:"white"},outliers:{},rule:{},ticks:null},errorbar:{center:"mean",rule:!0,ticks:!1},errorband:{band:{opacity:.3},borders:!1},scale:C8t,projection:{},legend:VWt,header:{titlePadding:10,labelPadding:10},headerColumn:{},headerRow:{},headerFacet:{},selection:HWt,style:{},title:{},facet:{spacing:pye},concat:{spacing:pye},normalizedNumberFormat:".0%"},dp=["#4c78a8","#f58518","#e45756","#72b7b2","#54a24b","#eeca3b","#b279a2","#ff9da6","#9d755d","#bab0ac"],gye={text:11,guideLabel:10,guideTitle:11,groupTitle:13,groupSubtitle:12},mye={blue:dp[0],orange:dp[1],red:dp[2],teal:dp[3],green:dp[4],yellow:dp[5],purple:dp[6],pink:dp[7],brown:dp[8],gray0:"#000",gray1:"#111",gray2:"#222",gray3:"#333",gray4:"#444",gray5:"#555",gray6:"#666",gray7:"#777",gray8:"#888",gray9:"#999",gray10:"#aaa",gray11:"#bbb",gray12:"#ccc",gray13:"#ddd",gray14:"#eee",gray15:"#fff"};function JWt(t={}){return{signals:[{name:"color",value:ht(t)?{...mye,...t}:mye}],mark:{color:{signal:"color.blue"}},rule:{color:{signal:"color.gray0"}},text:{color:{signal:"color.gray0"}},style:{"guide-label":{fill:{signal:"color.gray0"}},"guide-title":{fill:{signal:"color.gray0"}},"group-title":{fill:{signal:"color.gray0"}},"group-subtitle":{fill:{signal:"color.gray0"}},cell:{stroke:{signal:"color.gray8"}}},axis:{domainColor:{signal:"color.gray13"},gridColor:{signal:"color.gray8"},tickColor:{signal:"color.gray13"}},range:{category:[{signal:"color.blue"},{signal:"color.orange"},{signal:"color.red"},{signal:"color.teal"},{signal:"color.green"},{signal:"color.yellow"},{signal:"color.purple"},{signal:"color.pink"},{signal:"color.brown"},{signal:"color.grey8"}]}}}function eVt(t){return{signals:[{name:"fontSize",value:ht(t)?{...gye,...t}:gye}],text:{fontSize:{signal:"fontSize.text"}},style:{"guide-label":{fontSize:{signal:"fontSize.guideLabel"}},"guide-title":{fontSize:{signal:"fontSize.guideTitle"}},"group-title":{fontSize:{signal:"fontSize.groupTitle"}},"group-subtitle":{fontSize:{signal:"fontSize.groupSubtitle"}}}}}function tVt(t){return{text:{font:t},style:{"guide-label":{font:t},"guide-title":{font:t},"group-title":{font:t},"group-subtitle":{font:t}}}}function Y4e(t){const e=Qe(t||{}),n={};for(const r of e){const i=t[r];n[r]=HR(i)?Sje(i):nc(i)}return n}function nVt(t){const e=Qe(t),n={};for(const r of e)n[r]=Y4e(t[r]);return n}const rVt=[...i4e,...E4e,...V4e,"background","padding","legend","lineBreak","scale","style","title","view"];function Q4e(t={}){const{color:e,font:n,fontSize:r,selection:i,...o}=t,s=mO({},Kt(ZWt),n?tVt(n):{},e?JWt(e):{},r?eVt(r):{},o||{});i&&vO(s,"selection",i,!0);const a=gl(s,rVt);for(const l of["background","lineBreak","padding"])s[l]&&(a[l]=nc(s[l]));for(const l of i4e)s[l]&&(a[l]=is(s[l]));for(const l of E4e)s[l]&&(a[l]=Y4e(s[l]));for(const l of V4e)s[l]&&(a[l]=is(s[l]));if(s.legend&&(a.legend=is(s.legend)),s.scale){const{invalid:l,...c}=s.scale,u=is(l,{level:1});a.scale={...is(c),...Qe(u).length>0?{invalid:u}:{}}}return s.style&&(a.style=nVt(s.style)),s.title&&(a.title=is(s.title)),s.view&&(a.view=is(s.view)),a}const iVt=new Set(["view",...F8t]),oVt=["color","fontSize","background","padding","facet","concat","numberFormat","numberFormatType","normalizedNumberFormat","normalizedNumberFormatType","timeFormat","countTitle","header","axisQuantitative","axisTemporal","axisDiscrete","axisPoint","axisXBand","axisXPoint","axisXDiscrete","axisXQuantitative","axisXTemporal","axisYBand","axisYPoint","axisYDiscrete","axisYQuantitative","axisYTemporal","scale","selection","overlay"],sVt={view:["continuousWidth","continuousHeight","discreteWidth","discreteHeight","step"],...U8t};function aVt(t){t=Kt(t);for(const e of oVt)delete t[e];if(t.axis)for(const e in t.axis)HR(t.axis[e])&&delete t.axis[e];if(t.legend)for(const e of jWt)delete t.legend[e];if(t.mark){for(const e of oye)delete t.mark[e];t.mark.tooltip&&ht(t.mark.tooltip)&&delete t.mark.tooltip}t.params&&(t.signals=(t.signals||[]).concat(H4e(t.params)),delete t.params);for(const e of iVt){for(const r of oye)delete t[e][r];const n=sVt[e];if(n)for(const r of n)delete t[e][r];cVt(t,e)}for(const e of zWt())delete t[e];lVt(t);for(const e in t)ht(t[e])&&Er(t[e])&&delete t[e];return Er(t)?void 0:t}function lVt(t){const{titleMarkConfig:e,subtitleMarkConfig:n,subtitle:r}=_je(t.title);Er(e)||(t.style["group-title"]={...t.style["group-title"],...e}),Er(n)||(t.style["group-subtitle"]={...t.style["group-subtitle"],...n}),Er(r)?delete t.title:t.title=r}function cVt(t,e,n,r){const i=t[e];e==="view"&&(n="cell");const o={...i,...t.style[n??e]};Er(o)||(t.style[n??e]=o),delete t[e]}function I6(t){return Ke(t,"layer")}function uVt(t){return Ke(t,"repeat")}function fVt(t){return!We(t.repeat)&&Ke(t.repeat,"layer")}class Hse{map(e,n){return T6(e)?this.mapFacet(e,n):uVt(e)?this.mapRepeat(e,n):Gse(e)?this.mapHConcat(e,n):D6(e)?this.mapVConcat(e,n):Vse(e)?this.mapConcat(e,n):this.mapLayerOrUnit(e,n)}mapLayerOrUnit(e,n){if(I6(e))return this.mapLayer(e,n);if(nm(e))return this.mapUnit(e,n);throw new Error(cse(e))}mapLayer(e,n){return{...e,layer:e.layer.map(r=>this.mapLayerOrUnit(r,n))}}mapHConcat(e,n){return{...e,hconcat:e.hconcat.map(r=>this.map(r,n))}}mapVConcat(e,n){return{...e,vconcat:e.vconcat.map(r=>this.map(r,n))}}mapConcat(e,n){const{concat:r,...i}=e;return{...i,concat:r.map(o=>this.map(o,n))}}mapFacet(e,n){return{...e,spec:this.map(e.spec,n)}}mapRepeat(e,n){return{...e,spec:this.map(e.spec,n)}}}const dVt={zero:1,center:1,normalize:1};function hVt(t){return vt(dVt,t)}const pVt=new Set([t4e,S6,_6,$5,O6,Cse,Ose,C6,n4e,Sse]),gVt=new Set([S6,_6,t4e]);function nw(t){return Je(t)&&nC(t)==="quantitative"&&!t.bin}function vye(t,e,{orient:n,type:r}){const i=e==="x"?"y":"radius",o=e==="x"&&["bar","area"].includes(r),s=t[e],a=t[i];if(Je(s)&&Je(a))if(nw(s)&&nw(a)){if(s.stack)return e;if(a.stack)return i;const l=Je(s)&&!!s.aggregate,c=Je(a)&&!!a.aggregate;if(l!==c)return l?e:i;if(o){if(n==="vertical")return i;if(n==="horizontal")return e}}else{if(nw(s))return e;if(nw(a))return i}else{if(nw(s))return o&&n==="vertical"?void 0:e;if(nw(a))return o&&n==="horizontal"?void 0:i}}function mVt(t){switch(t){case"x":return"y";case"y":return"x";case"theta":return"radius";case"radius":return"theta"}}function K4e(t,e){var g,m;const n=Dh(t)?t:{type:t},r=n.type;if(!pVt.has(r))return null;const i=vye(e,"x",n)||vye(e,"theta",n);if(!i)return null;const o=e[i],s=Je(o)?ct(o,{}):void 0,a=mVt(i),l=[],c=new Set;if(e[a]){const v=e[a],y=Je(v)?ct(v,{}):void 0;y&&y!==s&&(l.push(a),c.add(y))}const u=a==="x"?"xOffset":"yOffset",f=e[u],d=Je(f)?ct(f,{}):void 0;d&&d!==s&&(l.push(u),c.add(d));const h=T6t.reduce((v,y)=>{if(y!=="tooltip"&&Ux(e,y)){const x=e[y];for(const b of pt(x)){const w=Xf(b);if(w.aggregate)continue;const _=ct(w,{});(!_||!c.has(_))&&v.push({channel:y,fieldDef:w})}}return v},[]);let p;return o.stack!==void 0?By(o.stack)?p=o.stack?"zero":null:p=o.stack:gVt.has(r)&&(p="zero"),!p||!hVt(p)||A4e(e)&&h.length===0?null:((g=o==null?void 0:o.scale)!=null&&g.type&&((m=o==null?void 0:o.scale)==null?void 0:m.type)!==os.LINEAR&&o!=null&&o.stack&&Ze(UUt(o.scale.type)),en(e[Qh(i)])?(o.stack!==void 0&&Ze(BUt(i)),null):(Je(o)&&o.aggregate&&!z6t.has(o.aggregate)&&Ze(WUt(o.aggregate)),{groupbyChannels:l,groupbyFields:c,fieldChannel:i,impute:o.impute===null?!1:e0(r),stackBy:h,offset:p}))}function Z4e(t,e,n){const r=is(t),i=Or("orient",r,n);if(r.orient=bVt(r.type,e,i),i!==void 0&&i!==r.orient&&Ze(OUt(r.orient,i)),r.type==="bar"&&r.orient){const l=Or("cornerRadiusEnd",r,n);if(l!==void 0){const c=r.orient==="horizontal"&&e.x2||r.orient==="vertical"&&e.y2?["cornerRadius"]:G8t[r.orient];for(const u of c)r[u]=l;r.cornerRadiusEnd!==void 0&&delete r.cornerRadiusEnd}}const o=Or("opacity",r,n),s=Or("fillOpacity",r,n);return o===void 0&&s===void 0&&(r.opacity=yVt(r.type,e)),Or("cursor",r,n)===void 0&&(r.cursor=vVt(r,e,n)),r}function vVt(t,e,n){return e.href||t.href||Or("href",t,n)?"pointer":t.cursor}function yVt(t,e){if(Tn([O6,Sse,Cse,Ose],t)&&!A4e(e))return .7}function xVt(t,e,{graticule:n}){if(n)return!1;const r=Rh("filled",t,e),i=t.type;return Xi(r,i!==O6&&i!==C6&&i!==$5)}function bVt(t,e,n){switch(t){case O6:case Cse:case Ose:case n4e:case L8t:case I8t:return}const{x:r,y:i,x2:o,y2:s}=e;switch(t){case S6:if(Je(r)&&(ns(r.bin)||Je(i)&&i.aggregate&&!r.aggregate))return"vertical";if(Je(i)&&(ns(i.bin)||Je(r)&&r.aggregate&&!i.aggregate))return"horizontal";if(s||o){if(n)return n;if(!o)return(Je(r)&&r.type===C1&&!Gr(r.bin)||N5(r))&&Je(i)&&ns(i.bin)?"horizontal":"vertical";if(!s)return(Je(i)&&i.type===C1&&!Gr(i.bin)||N5(i))&&Je(r)&&ns(r.bin)?"vertical":"horizontal"}case $5:if(o&&!(Je(r)&&ns(r.bin))&&s&&!(Je(i)&&ns(i.bin)))return;case _6:if(s)return Je(i)&&ns(i.bin)?"horizontal":"vertical";if(o)return Je(r)&&ns(r.bin)?"vertical":"horizontal";if(t===$5){if(r&&!i)return"vertical";if(i&&!r)return"horizontal"}case C6:case Sse:{const a=cye(r),l=cye(i);if(n)return n;if(a&&!l)return t!=="tick"?"horizontal":"vertical";if(!a&&l)return t!=="tick"?"vertical":"horizontal";if(a&&l)return"vertical";{const c=Ra(r)&&r.type===eC,u=Ra(i)&&i.type===eC;if(c&&!u)return"vertical";if(!c&&u)return"horizontal"}return}}return"vertical"}function wVt(t){const{point:e,line:n,...r}=t;return Qe(r).length>1?r:r.type}function _Vt(t){for(const e of["line","area","rule","trail"])t[e]&&(t={...t,[e]:gl(t[e],["point","line"])});return t}function WV(t,e={},n){return t.point==="transparent"?{opacity:0}:t.point?ht(t.point)?t.point:{}:t.point!==void 0?null:e.point||n.shape?ht(e.point)?e.point:{}:void 0}function yye(t,e={}){return t.line?t.line===!0?{}:t.line:t.line!==void 0?null:e.line?e.line===!0?{}:e.line:void 0}class SVt{constructor(){this.name="path-overlay"}hasMatchingType(e,n){if(nm(e)){const{mark:r,encoding:i}=e,o=Dh(r)?r:{type:r};switch(o.type){case"line":case"rule":case"trail":return!!WV(o,n[o.type],i);case"area":return!!WV(o,n[o.type],i)||!!yye(o,n[o.type])}}return!1}run(e,n,r){const{config:i}=n,{params:o,projection:s,mark:a,name:l,encoding:c,...u}=e,f=R6(c,i),d=Dh(a)?a:{type:a},h=WV(d,i[d.type],f),p=d.type==="area"&&yye(d,i[d.type]),g=[{name:l,...o?{params:o}:{},mark:wVt({...d.type==="area"&&d.opacity===void 0&&d.fillOpacity===void 0?{opacity:.7}:{},...d}),encoding:gl(f,["shape"])}],m=K4e(Z4e(d,f,i),f);let v=f;if(m){const{fieldChannel:y,offset:x}=m;v={...f,[y]:{...f[y],...x?{stack:x}:{}}}}return v=gl(v,["y2","x2"]),p&&g.push({...s?{projection:s}:{},mark:{type:"line",...YS(d,["clip","interpolate","tension","tooltip"]),...p},encoding:v}),h&&g.push({...s?{projection:s}:{},mark:{type:"point",opacity:1,filled:!0,...YS(d,["clip","tooltip"]),...h},encoding:v}),r({...u,layer:g},{...n,config:_Vt(i)})}}function CVt(t,e){return e?UR(t)?eBe(t,e):J4e(t,e):t}function VV(t,e){return e?eBe(t,e):t}function MY(t,e,n){const r=e[t];if(sWt(r)){if(r.repeat in n)return{...e,[t]:n[r.repeat]};Ze(oUt(r.repeat));return}return e}function J4e(t,e){if(t=MY("field",t,e),t!==void 0){if(t===null)return null;if(Rse(t)&&ug(t.sort)){const n=MY("field",t.sort,e);t={...t,...n?{sort:n}:{}}}return t}}function xye(t,e){if(Je(t))return J4e(t,e);{const n=MY("datum",t,e);return n!==t&&!n.type&&(n.type="nominal"),n}}function bye(t,e){if(en(t)){const n=xye(t,e);if(n)return n;if(WR(t))return{condition:t.condition}}else{if(VR(t)){const n=xye(t.condition,e);if(n)return{...t,condition:n};{const{condition:r,...i}=t;return i}}return t}}function eBe(t,e){const n={};for(const r in t)if(Ke(t,r)){const i=t[r];if(We(i))n[r]=i.map(o=>bye(o,e)).filter(o=>o);else{const o=bye(i,e);o!==void 0&&(n[r]=o)}}return n}class OVt{constructor(){this.name="RuleForRangedLine"}hasMatchingType(e){if(nm(e)){const{encoding:n,mark:r}=e;if(r==="line"||Dh(r)&&r.type==="line")for(const i of C6t){const o=pb(i),s=n[o];if(n[i]&&(Je(s)&&!ns(s.bin)||Zh(s)))return!0}}return!1}run(e,n,r){const{encoding:i,mark:o}=e;return Ze(CUt(!!i.x2,!!i.y2)),r({...e,mark:ht(o)?{...o,type:"rule"}:"rule"},n)}}class EVt extends Hse{constructor(){super(...arguments),this.nonFacetUnitNormalizers=[kWt,MWt,NWt,new SVt,new OVt]}map(e,n){if(nm(e)){const r=Ux(e.encoding,lg),i=Ux(e.encoding,cg),o=Ux(e.encoding,f6);if(r||i||o)return this.mapFacetedUnit(e,n)}return super.map(e,n)}mapUnit(e,n){const{parentEncoding:r,parentProjection:i}=n,o=VV(e.encoding,n.repeater),s={...e,...e.name?{name:[n.repeaterPrefix,e.name].filter(l=>l).join("_")}:{},...o?{encoding:o}:{}};if(r||i)return this.mapUnitWithParentEncodingOrProjection(s,n);const a=this.mapLayerOrUnit.bind(this);for(const l of this.nonFacetUnitNormalizers)if(l.hasMatchingType(s,n.config))return l.run(s,n,a);return s}mapRepeat(e,n){return fVt(e)?this.mapLayerRepeat(e,n):this.mapNonLayerRepeat(e,n)}mapLayerRepeat(e,n){const{repeat:r,spec:i,...o}=e,{row:s,column:a,layer:l}=r,{repeater:c={},repeaterPrefix:u=""}=n;return s||a?this.mapRepeat({...e,repeat:{...s?{row:s}:{},...a?{column:a}:{}},spec:{repeat:{layer:l},spec:i}},n):{...o,layer:l.map(f=>{const d={...c,layer:f},h=`${(i.name?`${i.name}_`:"")+u}child__layer_${hi(f)}`,p=this.mapLayerOrUnit(i,{...n,repeater:d,repeaterPrefix:h});return p.name=h,p})}}mapNonLayerRepeat(e,n){const{repeat:r,spec:i,data:o,...s}=e;!We(r)&&e.columns&&(e=gl(e,["columns"]),Ze(Jve("repeat")));const a=[],{repeater:l={},repeaterPrefix:c=""}=n,u=!We(r)&&r.row||[l?l.row:null],f=!We(r)&&r.column||[l?l.column:null],d=We(r)&&r||[l?l.repeat:null];for(const p of d)for(const g of u)for(const m of f){const v={repeat:p,row:g,column:m,layer:l.layer},y=(i.name?`${i.name}_`:"")+c+"child__"+(We(r)?`${hi(p)}`:(r.row?`row_${hi(g)}`:"")+(r.column?`column_${hi(m)}`:"")),x=this.map(i,{...n,repeater:v,repeaterPrefix:y});x.name=y,a.push(gl(x,["data"]))}const h=We(r)?e.columns:r.column?r.column.length:1;return{data:i.data??o,align:"all",...s,columns:h,concat:a}}mapFacet(e,n){const{facet:r}=e;return UR(r)&&e.columns&&(e=gl(e,["columns"]),Ze(Jve("facet"))),super.mapFacet(e,n)}mapUnitWithParentEncodingOrProjection(e,n){const{encoding:r,projection:i}=e,{parentEncoding:o,parentProjection:s,config:a}=n,l=_ye({parentProjection:s,projection:i}),c=wye({parentEncoding:o,encoding:VV(r,n.repeater)});return this.mapUnit({...e,...l?{projection:l}:{},...c?{encoding:c}:{}},{config:a})}mapFacetedUnit(e,n){const{row:r,column:i,facet:o,...s}=e.encoding,{mark:a,width:l,projection:c,height:u,view:f,params:d,encoding:h,...p}=e,{facetMapping:g,layout:m}=this.getFacetMappingAndLayout({row:r,column:i,facet:o},n),v=VV(s,n.repeater);return this.mapFacet({...p,...m,facet:g,spec:{...l?{width:l}:{},...u?{height:u}:{},...f?{view:f}:{},...c?{projection:c}:{},mark:a,encoding:v,...d?{params:d}:{}}},n)}getFacetMappingAndLayout(e,n){const{row:r,column:i,facet:o}=e;if(r||i){o&&Ze(_Ut([...r?[lg]:[],...i?[cg]:[]]));const s={},a={};for(const l of[lg,cg]){const c=e[l];if(c){const{align:u,center:f,spacing:d,columns:h,...p}=c;s[l]=p;for(const g of["align","center","spacing"])c[g]!==void 0&&(a[g]??(a[g]={}),a[g][l]=c[g])}}return{facetMapping:s,layout:a}}else{const{align:s,center:a,spacing:l,columns:c,...u}=o;return{facetMapping:CVt(u,n.repeater),layout:{...s?{align:s}:{},...a?{center:a}:{},...l?{spacing:l}:{},...c?{columns:c}:{}}}}}mapLayer(e,{parentEncoding:n,parentProjection:r,...i}){const{encoding:o,projection:s,...a}=e,l={...i,parentEncoding:wye({parentEncoding:n,encoding:o,layer:!0}),parentProjection:_ye({parentProjection:r,projection:s})};return super.mapLayer({...a,...e.name?{name:[l.repeaterPrefix,e.name].filter(c=>c).join("_")}:{}},l)}}function wye({parentEncoding:t,encoding:e={},layer:n}){let r={};if(t){const i=new Set([...Qe(t),...Qe(e)]);for(const o of i){const s=e[o],a=t[o];if(en(s)){const l={...a,...s};r[o]=l}else VR(s)?r[o]={...s,condition:{...a,...s.condition}}:s||s===null?r[o]=s:(n||qf(a)||Mt(a)||en(a)||We(a))&&(r[o]=a)}}else r=e;return!r||Er(r)?void 0:r}function _ye(t){const{parentProjection:e,projection:n}=t;return e&&n&&Ze(fUt({parentProjection:e,projection:n})),n??e}function qse(t){return Ke(t,"filter")}function TVt(t){return Ke(t,"stop")}function tBe(t){return Ke(t,"lookup")}function kVt(t){return Ke(t,"data")}function AVt(t){return Ke(t,"param")}function PVt(t){return Ke(t,"pivot")}function MVt(t){return Ke(t,"density")}function RVt(t){return Ke(t,"quantile")}function DVt(t){return Ke(t,"regression")}function IVt(t){return Ke(t,"loess")}function LVt(t){return Ke(t,"sample")}function $Vt(t){return Ke(t,"window")}function FVt(t){return Ke(t,"joinaggregate")}function NVt(t){return Ke(t,"flatten")}function zVt(t){return Ke(t,"calculate")}function nBe(t){return Ke(t,"bin")}function jVt(t){return Ke(t,"impute")}function BVt(t){return Ke(t,"timeUnit")}function UVt(t){return Ke(t,"aggregate")}function WVt(t){return Ke(t,"stack")}function VVt(t){return Ke(t,"fold")}function GVt(t){return Ke(t,"extent")&&!Ke(t,"density")&&!Ke(t,"regression")}function HVt(t){return t.map(e=>qse(e)?{filter:N_(e.filter,v8t)}:e)}class qVt extends Hse{map(e,n){return n.emptySelections??(n.emptySelections={}),n.selectionPredicates??(n.selectionPredicates={}),e=Sye(e,n),super.map(e,n)}mapLayerOrUnit(e,n){if(e=Sye(e,n),e.encoding){const r={};for(const[i,o]of hy(e.encoding))r[i]=rBe(o,n);e={...e,encoding:r}}return super.mapLayerOrUnit(e,n)}mapUnit(e,n){const{selection:r,...i}=e;return r?{...i,params:hy(r).map(([o,s])=>{const{init:a,bind:l,empty:c,...u}=s;u.type==="single"?(u.type="point",u.toggle=!1):u.type==="multi"&&(u.type="point"),n.emptySelections[o]=c!=="none";for(const f of bs(n.selectionPredicates[o]??{}))f.empty=c!=="none";return{name:o,value:a,select:u,bind:l}})}:e}}function Sye(t,e){const{transform:n,...r}=t;if(n){const i=n.map(o=>{if(qse(o))return{filter:RY(o,e)};if(nBe(o)&&gb(o.bin))return{...o,bin:iBe(o.bin)};if(tBe(o)){const{selection:s,...a}=o.from;return s?{...o,from:{param:s,...a}}:o}return o});return{...r,transform:i}}return t}function rBe(t,e){var r,i;const n=Kt(t);if(Je(n)&&gb(n.bin)&&(n.bin=iBe(n.bin)),xb(n)&&((i=(r=n.scale)==null?void 0:r.domain)!=null&&i.selection)){const{selection:o,...s}=n.scale.domain;n.scale.domain={...s,...o?{param:o}:{}}}if(WR(n))if(We(n.condition))n.condition=n.condition.map(o=>{const{selection:s,param:a,test:l,...c}=o;return a?o:{...c,test:RY(o,e)}});else{const{selection:o,param:s,test:a,...l}=rBe(n.condition,e);n.condition=s?n.condition:{...l,test:RY(n.condition,e)}}return n}function iBe(t){const e=t.extent;if(e!=null&&e.selection){const{selection:n,...r}=e;return{...t,extent:{...r,param:n}}}return t}function RY(t,e){const n=r=>N_(r,i=>{var o;const s=e.emptySelections[i]??!0,a={param:i,empty:s};return(o=e.selectionPredicates)[i]??(o[i]=[]),e.selectionPredicates[i].push(a),a});return t.selection?n(t.selection):N_(t.test||t.filter,r=>r.selection?n(r.selection):r)}class DY extends Hse{map(e,n){const r=n.selections??[];if(e.params&&!nm(e)){const i=[];for(const o of e.params)Wse(o)?r.push(o):i.push(o);e.params=i}return n.selections=r,super.map(e,n)}mapUnit(e,n){const r=n.selections;if(!r||!r.length)return e;const i=(n.path??[]).concat(e.name),o=[];for(const s of r)if(!s.views||!s.views.length)o.push(s);else for(const a of s.views)(gt(a)&&(a===e.name||i.includes(a))||We(a)&&a.map(l=>i.indexOf(l)).every((l,c,u)=>l!==-1&&(c===0||l>u[c-1])))&&o.push(s);return o.length&&(e.params=o),e}}for(const t of["mapFacet","mapRepeat","mapHConcat","mapVConcat","mapLayer"]){const e=DY.prototype[t];DY.prototype[t]=function(n,r){return e.call(this,n,XVt(n,r))}}function XVt(t,e){return t.name?{...e,path:(e.path??[]).concat(t.name)}:e}function oBe(t,e){e===void 0&&(e=Q4e(t.config));const n=ZVt(t,e),{width:r,height:i}=t,o=JVt(n,{width:r,height:i,autosize:t.autosize},e);return{...n,...o?{autosize:o}:{}}}const YVt=new EVt,QVt=new qVt,KVt=new DY;function ZVt(t,e={}){const n={config:e};return KVt.map(YVt.map(QVt.map(t,n),n),n)}function Cye(t){return gt(t)?{type:t}:t??{}}function JVt(t,e,n){let{width:r,height:i}=e;const o=nm(t)||I6(t),s={};o?r=="container"&&i=="container"?(s.type="fit",s.contains="padding"):r=="container"?(s.type="fit-x",s.contains="padding"):i=="container"&&(s.type="fit-y",s.contains="padding"):(r=="container"&&(Ze(Yve("width")),r=void 0),i=="container"&&(Ze(Yve("height")),i=void 0));const a={type:"pad",...s,...n?Cye(n.autosize):{},...Cye(t.autosize)};if(a.type==="fit"&&!o&&(Ze(X6t),a.type="pad"),r=="container"&&!(a.type=="fit"||a.type=="fit-x")&&Ze(Qve("width")),i=="container"&&!(a.type=="fit"||a.type=="fit-y")&&Ze(Qve("height")),!lc(a,{type:"pad"}))return a}function e9t(t){return["fit","fit-x","fit-y"].includes(t)}function t9t(t){return t?`fit-${m6(t)}`:"fit"}const n9t=["background","padding"];function Oye(t,e){const n={};for(const r of n9t)t&&t[r]!==void 0&&(n[r]=nc(t[r]));return e&&(n.params=t.params),n}class rm{constructor(e={},n={}){this.explicit=e,this.implicit=n}clone(){return new rm(Kt(this.explicit),Kt(this.implicit))}combine(){return{...this.explicit,...this.implicit}}get(e){return Xi(this.explicit[e],this.implicit[e])}getWithExplicit(e){return this.explicit[e]!==void 0?{explicit:!0,value:this.explicit[e]}:this.implicit[e]!==void 0?{explicit:!1,value:this.implicit[e]}:{explicit:!1,value:void 0}}setWithExplicit(e,{value:n,explicit:r}){n!==void 0&&this.set(e,n,r)}set(e,n,r){return delete this[r?"implicit":"explicit"][e],this[r?"explicit":"implicit"][e]=n,this}copyKeyFromSplit(e,{explicit:n,implicit:r}){n[e]!==void 0?this.set(e,n[e],!0):r[e]!==void 0&&this.set(e,r[e],!1)}copyKeyFromObject(e,n){n[e]!==void 0&&this.set(e,n[e],!0)}copyAll(e){for(const n of Qe(e.combine())){const r=e.getWithExplicit(n);this.setWithExplicit(n,r)}}}function Md(t){return{explicit:!0,value:t}}function Gl(t){return{explicit:!1,value:t}}function sBe(t){return(e,n,r,i)=>{const o=t(e.value,n.value);return o>0?e:o<0?n:L6(e,n,r,i)}}function L6(t,e,n,r){return t.explicit&&e.explicit&&Ze(IUt(n,r,t.value,e.value)),t}function my(t,e,n,r,i=L6){return t===void 0||t.value===void 0?e:t.explicit&&!e.explicit?t:e.explicit&&!t.explicit?e:lc(t.value,e.value)?t:i(t,e,n,r)}class r9t extends rm{constructor(e={},n={},r=!1){super(e,n),this.explicit=e,this.implicit=n,this.parseNothing=r}clone(){const e=super.clone();return e.parseNothing=this.parseNothing,e}}function oC(t){return Ke(t,"url")}function QA(t){return Ke(t,"values")}function aBe(t){return Ke(t,"name")&&!oC(t)&&!QA(t)&&!Wv(t)}function Wv(t){return t&&(lBe(t)||cBe(t)||Xse(t))}function lBe(t){return Ke(t,"sequence")}function cBe(t){return Ke(t,"sphere")}function Xse(t){return Ke(t,"graticule")}var Fi;(function(t){t[t.Raw=0]="Raw",t[t.Main=1]="Main",t[t.Row=2]="Row",t[t.Column=3]="Column",t[t.Lookup=4]="Lookup",t[t.PreFilterInvalid=5]="PreFilterInvalid",t[t.PostFilterInvalid=6]="PostFilterInvalid"})(Fi||(Fi={}));function uBe({invalid:t,isPath:e}){switch(o4e(t,{isPath:e})){case"filter":return{marks:"exclude-invalid-values",scales:"exclude-invalid-values"};case"break-paths-show-domains":return{marks:e?"include-invalid-values":"exclude-invalid-values",scales:"include-invalid-values"};case"break-paths-filter-domains":return{marks:e?"include-invalid-values":"exclude-invalid-values",scales:"exclude-invalid-values"};case"show":return{marks:"include-invalid-values",scales:"include-invalid-values"}}}function i9t(t){const{marks:e,scales:n}=uBe(t);return e===n?Fi.Main:n==="include-invalid-values"?Fi.PreFilterInvalid:Fi.PostFilterInvalid}function fBe(t){const{signals:e,hasLegend:n,index:r,...i}=t;return i.field=Mu(i.field),i}function T1(t,e=!0,n=na){if(We(t)){const r=t.map(i=>T1(i,e,n));return e?`[${r.join(", ")}]`:r}else if(vb(t))return n(e?S1(t):o8t(t));return e?n(Tr(t)):t}function o9t(t,e){for(const n of bs(t.component.selection??{})){const r=n.name;let i=`${r}${vy}, ${n.resolve==="global"?"true":`{unit: ${Wx(t)}}`}`;for(const o of z6)o.defined(n)&&(o.signals&&(e=o.signals(t,n,e)),o.modifyExpr&&(i=o.modifyExpr(t,n,i)));e.push({name:r+L9t,on:[{events:{signal:n.name+vy},update:`modify(${rt(n.name+k1)}, ${i})`}]})}return Yse(e)}function s9t(t,e){if(t.component.selection&&Qe(t.component.selection).length){const n=rt(t.getName("cell"));e.unshift({name:"facet",value:{},on:[{events:qy("pointermove","scope"),update:`isTuple(facet) ? facet : group(${n}).datum`}]})}return Yse(e)}function a9t(t,e){let n=!1;for(const r of bs(t.component.selection??{})){const i=r.name,o=rt(i+k1);if(e.filter(a=>a.name===i).length===0){const a=r.resolve==="global"?"union":r.resolve,l=r.type==="point"?", true, true)":")";e.push({name:r.name,update:`${ABe}(${o}, ${rt(a)}${l}`})}n=!0;for(const a of z6)a.defined(r)&&a.topLevelSignals&&(e=a.topLevelSignals(t,r,e))}return n&&e.filter(i=>i.name==="unit").length===0&&e.unshift({name:"unit",value:{},on:[{events:"pointermove",update:"isTuple(group()) ? group() : unit"}]}),Yse(e)}function l9t(t,e){const n=[...e],r=Wx(t,{escape:!1});for(const i of bs(t.component.selection??{})){const o={name:i.name+k1};if(i.project.hasSelectionId&&(o.transform=[{type:"collect",sort:{field:Yf}}]),i.init){const a=i.project.items.map(fBe);o.values=i.project.hasSelectionId?i.init.map(l=>({unit:r,[Yf]:T1(l,!1)[0]})):i.init.map(l=>({unit:r,fields:a,values:T1(l,!1)}))}n.filter(a=>a.name===i.name+k1).length||n.push(o)}return n}function dBe(t,e){for(const n of bs(t.component.selection??{}))for(const r of z6)r.defined(n)&&r.marks&&(e=r.marks(t,n,e));return e}function c9t(t,e){for(const n of t.children)wi(n)&&(e=dBe(n,e));return e}function u9t(t,e,n,r){const i=IBe(t,e.param,e);return{signal:Hf(n.get("type"))&&We(r)&&r[0]>r[1]?`isValid(${i}) && reverse(${i})`:i}}function Yse(t){return t.map(e=>(e.on&&!e.on.length&&delete e.on,e))}class _r{constructor(e,n){this.debugName=n,this._children=[],this._parent=null,e&&(this.parent=e)}clone(){throw new Error("Cannot clone node")}get parent(){return this._parent}set parent(e){this._parent=e,e&&e.addChild(this)}get children(){return this._children}numChildren(){return this._children.length}addChild(e,n){if(this._children.includes(e)){Ze(lUt);return}n!==void 0?this._children.splice(n,0,e):this._children.push(e)}removeChild(e){const n=this._children.indexOf(e);return this._children.splice(n,1),n}remove(){let e=this._parent.removeChild(this);for(const n of this._children)n._parent=this._parent,this._parent.addChild(n,e++)}insertAsParentOf(e){const n=e.parent;n.removeChild(this),this.parent=n,e.parent=this}swapWithParent(){const e=this._parent,n=e.parent;for(const i of this._children)i.parent=e;this._children=[],e.removeChild(this);const r=e.parent.removeChild(e);this._parent=n,n.addChild(this,r),e.parent=this}}class ml extends _r{clone(){const e=new this.constructor;return e.debugName=`clone_${this.debugName}`,e._source=this._source,e._name=`clone_${this._name}`,e.type=this.type,e.refCounts=this.refCounts,e.refCounts[e._name]=0,e}constructor(e,n,r,i){super(e,n),this.type=r,this.refCounts=i,this._source=this._name=n,this.refCounts&&!(this._name in this.refCounts)&&(this.refCounts[this._name]=0)}dependentFields(){return new Set}producedFields(){return new Set}hash(){return this._hash===void 0&&(this._hash=`Output ${sje()}`),this._hash}getSource(){return this.refCounts[this._name]++,this._source}isRequired(){return!!this.refCounts[this._name]}setSource(e){this._source=e}}function GV(t){return t.as!==void 0}function Eye(t){return`${t}_end`}class xh extends _r{clone(){return new xh(null,Kt(this.timeUnits))}constructor(e,n){super(e),this.timeUnits=n}static makeFromEncoding(e,n){const r=n.reduceFieldDef((i,o,s)=>{const{field:a,timeUnit:l}=o;if(l){let c;if(yb(l)){if(wi(n)){const{mark:u,markDef:f,config:d}=n,h=gy({fieldDef:o,markDef:f,config:d});(YA(u)||h)&&(c={timeUnit:Uo(l),field:a})}}else c={as:ct(o,{forAs:!0}),field:a,timeUnit:l};if(wi(n)){const{mark:u,markDef:f,config:d}=n,h=gy({fieldDef:o,markDef:f,config:d});YA(u)&&Yi(s)&&h!==.5&&(c.rectBandPosition=h)}c&&(i[Mn(c)]=c)}return i},{});return Er(r)?null:new xh(e,r)}static makeFromTransform(e,n){const{timeUnit:r,...i}={...n},o=Uo(r),s={...i,timeUnit:o};return new xh(e,{[Mn(s)]:s})}merge(e){this.timeUnits={...this.timeUnits};for(const n in e.timeUnits)this.timeUnits[n]||(this.timeUnits[n]=e.timeUnits[n]);for(const n of e.children)e.removeChild(n),n.parent=this;e.remove()}removeFormulas(e){const n={};for(const[r,i]of hy(this.timeUnits)){const o=GV(i)?i.as:`${i.field}_end`;e.has(o)||(n[r]=i)}this.timeUnits=n}producedFields(){return new Set(bs(this.timeUnits).map(e=>GV(e)?e.as:Eye(e.field)))}dependentFields(){return new Set(bs(this.timeUnits).map(e=>e.field))}hash(){return`TimeUnit ${Mn(this.timeUnits)}`}assemble(){const e=[];for(const n of bs(this.timeUnits)){const{rectBandPosition:r}=n,i=Uo(n.timeUnit);if(GV(n)){const{field:o,as:s}=n,{unit:a,utc:l,...c}=i,u=[s,`${s}_end`];e.push({field:Mu(o),type:"timeunit",...a?{units:b6(a)}:{},...l?{timezone:"utc"}:{},...c,as:u}),e.push(...Tye(u,r,i))}else if(n){const{field:o}=n,s=o.replaceAll("\\.","."),a=hBe({timeUnit:i,field:s}),l=Eye(s);e.push({type:"formula",expr:a,as:l}),e.push(...Tye([s,l],r,i))}}return e}}const $6="offsetted_rect_start",F6="offsetted_rect_end";function hBe({timeUnit:t,field:e,reverse:n}){const{unit:r,utc:i}=t,o=Bje(r),{part:s,step:a}=Gje(o,t.step);return`${i?"utcOffset":"timeOffset"}('${s}', datum['${e}'], ${n?-a:a})`}function Tye([t,e],n,r){if(n!==void 0&&n!==.5){const i=`datum['${t}']`,o=`datum['${e}']`;return[{type:"formula",expr:kye([hBe({timeUnit:r,field:t,reverse:!0}),i],n+.5),as:`${t}_${$6}`},{type:"formula",expr:kye([i,o],n+.5),as:`${t}_${F6}`}]}return[]}function kye([t,e],n){return`${1-n} * ${t} + ${n} * ${e}`}const qR="_tuple_fields";class f9t{constructor(...e){this.items=e,this.hasChannel={},this.hasField={},this.hasSelectionId=!1}}const d9t={defined:()=>!0,parse:(t,e,n)=>{const r=e.name,i=e.project??(e.project=new f9t),o={},s={},a=new Set,l=(p,g)=>{const m=g==="visual"?p.channel:p.field;let v=hi(`${r}_${m}`);for(let y=1;a.has(v);y++)v=hi(`${r}_${m}_${y}`);return a.add(v),{[g]:v}},c=e.type,u=t.config.selection[c],f=n.value!==void 0?pt(n.value):null;let{fields:d,encodings:h}=ht(n.select)?n.select:{};if(!d&&!h&&f){for(const p of f)if(ht(p))for(const g of Qe(p))S6t(g)?(h||(h=[])).push(g):c==="interval"?(Ze(iUt),h=u.encodings):(d??(d=[])).push(g)}!d&&!h&&(h=u.encodings,"fields"in u&&(d=u.fields));for(const p of h??[]){const g=t.fieldDef(p);if(g){let m=g.field;if(g.aggregate){Ze(Y6t(p,g.aggregate));continue}else if(!m){Ze(Zve(p));continue}if(g.timeUnit&&!yb(g.timeUnit)){m=t.vgField(p);const v={timeUnit:g.timeUnit,as:m,field:g.field};s[Mn(v)]=v}if(!o[m]){const v=c==="interval"&&Kh(p)&&Hf(t.getScaleComponent(p).get("type"))?"R":g.bin?"R-RE":"E",y={field:m,channel:p,type:v,index:i.items.length};y.signals={...l(y,"data"),...l(y,"visual")},i.items.push(o[m]=y),i.hasField[m]=o[m],i.hasSelectionId=i.hasSelectionId||m===Yf,dje(p)?(y.geoChannel=p,y.channel=fje(p),i.hasChannel[y.channel]=o[m]):i.hasChannel[p]=o[m]}}else Ze(Zve(p))}for(const p of d??[]){if(i.hasField[p])continue;const g={type:"E",field:p,index:i.items.length};g.signals={...l(g,"data")},i.items.push(g),i.hasField[p]=g,i.hasSelectionId=i.hasSelectionId||p===Yf}f&&(e.init=f.map(p=>i.items.map(g=>ht(p)?p[g.geoChannel||g.channel]!==void 0?p[g.geoChannel||g.channel]:p[g.field]:p))),Er(s)||(i.timeUnit=new xh(null,s))},signals:(t,e,n)=>{const r=e.name+qR;return n.filter(o=>o.name===r).length>0||e.project.hasSelectionId?n:n.concat({name:r,value:e.project.items.map(fBe)})}},fg={defined:t=>t.type==="interval"&&t.resolve==="global"&&t.bind&&t.bind==="scales",parse:(t,e)=>{const n=e.scales=[];for(const r of e.project.items){const i=r.channel;if(!Kh(i))continue;const o=t.getScaleComponent(i),s=o?o.get("type"):void 0;if(s=="sequential"&&Ze(J6t),!o||!Hf(s)){Ze(Z6t);continue}o.set("selectionExtent",{param:e.name,field:r.field},!0),n.push(r)}},topLevelSignals:(t,e,n)=>{const r=e.scales.filter(s=>n.filter(a=>a.name===s.signals.data).length===0);if(!t.parent||Aye(t)||r.length===0)return n;const i=n.find(s=>s.name===e.name);let o=i.update;if(o.includes(ABe))i.update=`{${r.map(s=>`${rt(Mu(s.field))}: ${s.signals.data}`).join(", ")}}`;else{for(const s of r){const a=`${rt(Mu(s.field))}: ${s.signals.data}`;o.includes(a)||(o=`${o.substring(0,o.length-1)}, ${a}}`)}i.update=o}return n.concat(r.map(s=>({name:s.signals.data})))},signals:(t,e,n)=>{if(t.parent&&!Aye(t))for(const r of e.scales){const i=n.find(o=>o.name===r.signals.data);i.push="outer",delete i.value,delete i.update}return n}};function IY(t,e){return`domain(${rt(t.scaleName(e))})`}function Aye(t){return t.parent&&zO(t.parent)&&!t.parent.parent}const B_="_brush",pBe="_scale_trigger",l2="geo_interval_init_tick",gBe="_init",h9t="_center",p9t={defined:t=>t.type==="interval",parse:(t,e,n)=>{var r;if(t.hasProjection){const i={...ht(n.select)?n.select:{}};i.fields=[Yf],i.encodings||(i.encodings=n.value?Qe(n.value):[ld,ad]),n.select={type:"interval",...i}}if(e.translate&&!fg.defined(e)){const i=`!event.item || event.item.mark.name !== ${rt(e.name+B_)}`;for(const o of e.events){if(!o.between){Ze(`${o} is not an ordered event stream for interval selections.`);continue}const s=pt((r=o.between[0]).filter??(r.filter=[]));s.includes(i)||s.push(i)}}},signals:(t,e,n)=>{const r=e.name,i=r+vy,o=bs(e.project.hasChannel).filter(a=>a.channel===vi||a.channel===Yo),s=e.init?e.init[0]:null;if(n.push(...o.reduce((a,l)=>a.concat(g9t(t,e,l,s&&s[l.index])),[])),t.hasProjection){const a=rt(t.projectionName()),l=t.projectionName()+h9t,{x:c,y:u}=e.project.hasChannel,f=c&&c.signals.visual,d=u&&u.signals.visual,h=c?s&&s[c.index]:`${l}[0]`,p=u?s&&s[u.index]:`${l}[1]`,g=w=>t.getSizeSignalRef(w).signal,m=`[[${f?f+"[0]":"0"}, ${d?d+"[0]":"0"}],[${f?f+"[1]":g("width")}, ${d?d+"[1]":g("height")}]]`;s&&(n.unshift({name:r+gBe,init:`[scale(${a}, [${c?h[0]:h}, ${u?p[0]:p}]), scale(${a}, [${c?h[1]:h}, ${u?p[1]:p}])]`}),(!c||!u)&&(n.find(_=>_.name===l)||n.unshift({name:l,update:`invert(${a}, [${g("width")}/2, ${g("height")}/2])`})));const v=`intersect(${m}, {markname: ${rt(t.getName("marks"))}}, unit.mark)`,y=`{unit: ${Wx(t)}}`,x=`vlSelectionTuples(${v}, ${y})`,b=o.map(w=>w.signals.visual);return n.concat({name:i,on:[{events:[...b.length?[{signal:b.join(" || ")}]:[],...s?[{signal:l2}]:[]],update:x}]})}else{if(!fg.defined(e)){const c=r+pBe,u=o.map(f=>{const d=f.channel,{data:h,visual:p}=f.signals,g=rt(t.scaleName(d)),m=t.getScaleComponent(d).get("type"),v=Hf(m)?"+":"";return`(!isArray(${h}) || (${v}invert(${g}, ${p})[0] === ${v}${h}[0] && ${v}invert(${g}, ${p})[1] === ${v}${h}[1]))`});u.length&&n.push({name:c,value:{},on:[{events:o.map(f=>({scale:t.scaleName(f.channel)})),update:u.join(" && ")+` ? ${c} : {}`}]})}const a=o.map(c=>c.signals.data),l=`unit: ${Wx(t)}, fields: ${r+qR}, values`;return n.concat({name:i,...s?{init:`{${l}: ${T1(s)}}`}:{},...a.length?{on:[{events:[{signal:a.join(" || ")}],update:`${a.join(" && ")} ? {${l}: [${a}]} : null`}]}:{}})}},topLevelSignals:(t,e,n)=>(wi(t)&&t.hasProjection&&e.init&&(n.filter(i=>i.name===l2).length||n.unshift({name:l2,value:null,on:[{events:"timer{1}",update:`${l2} === null ? {} : ${l2}`}]})),n),marks:(t,e,n)=>{const r=e.name,{x:i,y:o}=e.project.hasChannel,s=i==null?void 0:i.signals.visual,a=o==null?void 0:o.signals.visual,l=`data(${rt(e.name+k1)})`;if(fg.defined(e)||!i&&!o)return n;const c={x:i!==void 0?{signal:`${s}[0]`}:{value:0},y:o!==void 0?{signal:`${a}[0]`}:{value:0},x2:i!==void 0?{signal:`${s}[1]`}:{field:{group:"width"}},y2:o!==void 0?{signal:`${a}[1]`}:{field:{group:"height"}}};if(e.resolve==="global")for(const m of Qe(c))c[m]=[{test:`${l}.length && ${l}[0].unit === ${Wx(t)}`,...c[m]},{value:0}];const{fill:u,fillOpacity:f,cursor:d,...h}=e.mark,p=Qe(h).reduce((m,v)=>(m[v]=[{test:[i!==void 0&&`${s}[0] !== ${s}[1]`,o!==void 0&&`${a}[0] !== ${a}[1]`].filter(y=>y).join(" && "),value:h[v]},{value:null}],m),{}),g=d??(e.translate?"move":null);return[{name:`${r+B_}_bg`,type:"rect",clip:!0,encode:{enter:{fill:{value:u},fillOpacity:{value:f}},update:c}},...n,{name:r+B_,type:"rect",clip:!0,encode:{enter:{...g?{cursor:{value:g}}:{},fill:{value:"transparent"}},update:{...c,...p}}}]}};function g9t(t,e,n,r){const i=!t.hasProjection,o=n.channel,s=n.signals.visual,a=rt(i?t.scaleName(o):t.projectionName()),l=d=>`scale(${a}, ${d})`,c=t.getSizeSignalRef(o===vi?"width":"height").signal,u=`${o}(unit)`,f=e.events.reduce((d,h)=>[...d,{events:h.between[0],update:`[${u}, ${u}]`},{events:h,update:`[${s}[0], clamp(${u}, 0, ${c})]`}],[]);if(i){const d=n.signals.data,h=fg.defined(e),p=t.getScaleComponent(o),g=p?p.get("type"):void 0,m=r?{init:T1(r,!0,l)}:{value:[]};return f.push({events:{signal:e.name+pBe},update:Hf(g)?`[${l(`${d}[0]`)}, ${l(`${d}[1]`)}]`:"[0, 0]"}),h?[{name:d,on:[]}]:[{name:s,...m,on:f},{name:d,...r?{init:T1(r)}:{},on:[{events:{signal:s},update:`${s}[0] === ${s}[1] ? null : invert(${a}, ${s})`}]}]}else{const d=o===vi?0:1,h=e.name+gBe,p=r?{init:`[${h}[0][${d}], ${h}[1][${d}]]`}:{value:[]};return[{name:s,...p,on:f}]}}const m9t={defined:t=>t.type==="point",signals:(t,e,n)=>{const r=e.name,i=r+qR,o=e.project,s="(item().isVoronoi ? datum.datum : datum)",a=bs(t.component.selection??{}).reduce((f,d)=>d.type==="interval"?f.concat(d.name+B_):f,[]).map(f=>`indexof(item().mark.name, '${f}') < 0`).join(" && "),l=`datum && item().mark.marktype !== 'group' && indexof(item().mark.role, 'legend') < 0${a?` && ${a}`:""}`;let c=`unit: ${Wx(t)}, `;if(e.project.hasSelectionId)c+=`${Yf}: ${s}[${rt(Yf)}]`;else{const f=o.items.map(d=>{const h=t.fieldDef(d.channel);return h!=null&&h.bin?`[${s}[${rt(t.vgField(d.channel,{}))}], ${s}[${rt(t.vgField(d.channel,{binSuffix:"end"}))}]]`:`${s}[${rt(d.field)}]`}).join(", ");c+=`fields: ${i}, values: [${f}]`}const u=e.events;return n.concat([{name:r+vy,on:u?[{events:u,update:`${l} ? {${c}} : null`,force:!0}]:[]}])}};function LO({model:t,channelDef:e,vgChannel:n,invalidValueRef:r,mainRefFn:i}){const o=WR(e)&&e.condition;let s=[];o&&(s=pt(o).map(c=>{const u=i(c);if(oWt(c)){const{param:f,empty:d}=c;return{test:DBe(t,{param:f,empty:d}),...u}}else return{test:H5(t,c.test),...u}})),r!==void 0&&s.push(r);const a=i(e);return a!==void 0&&s.push(a),s.length>1||s.length===1&&s[0].test?{[n]:s}:s.length===1?{[n]:s[0]}:{}}function Qse(t,e="text"){const n=t.encoding[e];return LO({model:t,channelDef:n,vgChannel:e,mainRefFn:r=>N6(r,t.config),invalidValueRef:void 0})}function N6(t,e,n="datum"){if(t){if(qf(t))return Jr(t.value);if(en(t)){const{format:r,formatType:i}=j5(t);return Pse({fieldOrDatumDef:t,format:r,formatType:i,expr:n,config:e})}}}function mBe(t,e={}){const{encoding:n,markDef:r,config:i,stack:o}=t,s=n.tooltip;if(We(s))return{tooltip:Pye({tooltip:s},o,i,e)};{const a=e.reactiveGeom?"datum.datum":"datum";return LO({model:t,channelDef:s,vgChannel:"tooltip",mainRefFn:c=>{const u=N6(c,i,a);if(u)return u;if(c===null)return;let f=Or("tooltip",r,i);if(f===!0&&(f={content:"encoding"}),gt(f))return{value:f};if(ht(f))return Mt(f)?f:f.content==="encoding"?Pye(n,o,i,e):{signal:a}},invalidValueRef:void 0})}}function vBe(t,e,n,{reactiveGeom:r}={}){const i={...n,...n.tooltipFormat},o=new Set,s=r?"datum.datum":"datum",a=[];function l(u,f){const d=pb(f),h=Ra(u)?u:{...u,type:t[d].type},p=h.title||Ise(h,i),g=pt(p).join(", ").replaceAll(/"/g,'\\"');let m;if(Yi(f)){const v=f==="x"?"x2":"y2",y=Xf(t[v]);if(ns(h.bin)&&y){const x=ct(h,{expr:s}),b=ct(y,{expr:s}),{format:w,formatType:_}=j5(h);m=BR(x,b,w,_,i),o.add(v)}}if((Yi(f)||f===ju||f===sd)&&e&&e.fieldChannel===f&&e.offset==="normalize"){const{format:v,formatType:y}=j5(h);m=Pse({fieldOrDatumDef:h,format:v,formatType:y,expr:s,config:i,normalizeStack:!0}).signal}m??(m=N6(h,i,s).signal),a.push({channel:f,key:g,value:m})}$se(t,(u,f)=>{Je(u)?l(u,f):k6(u)&&l(u.condition,f)});const c={};for(const{channel:u,key:f,value:d}of a)!o.has(u)&&!c[f]&&(c[f]=d);return c}function Pye(t,e,n,{reactiveGeom:r}={}){const i=vBe(t,e,n,{reactiveGeom:r}),o=hy(i).map(([s,a])=>`"${s}": ${a}`);return o.length>0?{signal:`{${o.join(", ")}}`}:void 0}function v9t(t){const{markDef:e,config:n}=t,r=Or("aria",e,n);return r===!1?{}:{...r?{aria:r}:{},...y9t(t),...x9t(t)}}function y9t(t){const{mark:e,markDef:n,config:r}=t;if(r.aria===!1)return{};const i=Or("ariaRoleDescription",n,r);return i!=null?{ariaRoleDescription:{value:i}}:vt(G6t,e)?{}:{ariaRoleDescription:{value:e}}}function x9t(t){const{encoding:e,markDef:n,config:r,stack:i}=t,o=e.description;if(o)return LO({model:t,channelDef:o,vgChannel:"description",mainRefFn:l=>N6(l,t.config),invalidValueRef:void 0});const s=Or("description",n,r);if(s!=null)return{description:Jr(s)};if(r.aria===!1)return{};const a=vBe(e,i,r);if(!Er(a))return{description:{signal:hy(a).map(([l,c],u)=>`"${u>0?"; ":""}${l}: " + (${c})`).join(" + ")}}}function cs(t,e,n={}){const{markDef:r,encoding:i,config:o}=e,{vgChannel:s}=n;let{defaultRef:a,defaultValue:l}=n;const c=i[t];a===void 0&&(l??(l=Or(t,r,o,{vgChannel:s,ignoreVgConfig:!WR(c)})),l!==void 0&&(a=Jr(l)));const u={markDef:r,config:o,scaleName:e.scaleName(t),scale:e.getScaleComponent(t)},f=a4e({...u,scaleChannel:t,channelDef:c});return LO({model:e,channelDef:c,vgChannel:s??t,invalidValueRef:f,mainRefFn:h=>Ase({...u,channel:t,channelDef:h,stack:null,defaultRef:a})})}function yBe(t,e={filled:void 0}){const{markDef:n,encoding:r,config:i}=t,{type:o}=n,s=e.filled??Or("filled",n,i),a=Tn(["bar","point","circle","square","geoshape"],o)?"transparent":void 0,l=Or(s===!0?"color":void 0,n,i,{vgChannel:"fill"})??i.mark[s===!0&&"color"]??a,c=Or(s===!1?"color":void 0,n,i,{vgChannel:"stroke"})??i.mark[s===!1&&"color"],u=s?"fill":"stroke",f={...l?{fill:Jr(l)}:{},...c?{stroke:Jr(c)}:{}};return n.color&&(s?n.fill:n.stroke)&&Ze(Rje("property",{fill:"fill"in n,stroke:"stroke"in n})),{...f,...cs("color",t,{vgChannel:u,defaultValue:s?l:c}),...cs("fill",t,{defaultValue:r.fill?l:void 0}),...cs("stroke",t,{defaultValue:r.stroke?c:void 0})}}function b9t(t){const{encoding:e,mark:n}=t,r=e.order;return!e0(n)&&qf(r)?LO({model:t,channelDef:r,vgChannel:"zindex",mainRefFn:i=>Jr(i.value),invalidValueRef:void 0}):{}}function sC({channel:t,markDef:e,encoding:n={},model:r,bandPosition:i}){const o=`${t}Offset`,s=e[o],a=n[o];if((o==="xOffset"||o==="yOffset")&&a)return{offsetType:"encoding",offset:Ase({channel:o,channelDef:a,markDef:e,config:r==null?void 0:r.config,scaleName:r.scaleName(o),scale:r.getScaleComponent(o),stack:null,defaultRef:Jr(s),bandPosition:i})};const l=e[o];return l?{offsetType:"visual",offset:l}:{}}function Ca(t,e,{defaultPos:n,vgChannel:r}){const{encoding:i,markDef:o,config:s,stack:a}=e,l=i[t],c=i[Qh(t)],u=e.scaleName(t),f=e.getScaleComponent(t),{offset:d,offsetType:h}=sC({channel:t,markDef:o,encoding:i,model:e,bandPosition:.5}),p=Kse({model:e,defaultPos:n,channel:t,scaleName:u,scale:f}),g=!l&&Yi(t)&&(i.latitude||i.longitude)?{field:e.getName(t)}:w9t({channel:t,channelDef:l,channel2Def:c,markDef:o,config:s,scaleName:u,scale:f,stack:a,offset:d,defaultRef:p,bandPosition:h==="encoding"?0:void 0});return g?{[r||t]:g}:void 0}function w9t(t){const{channel:e,channelDef:n,scaleName:r,stack:i,offset:o,markDef:s}=t;if(en(n)&&i&&e===i.fieldChannel){if(Je(n)){let a=n.bandPosition;if(a===void 0&&s.type==="text"&&(e==="radius"||e==="theta")&&(a=.5),a!==void 0)return F5({scaleName:r,fieldOrDatumDef:n,startSuffix:"start",bandPosition:a,offset:o})}return Bx(n,r,{suffix:"end"},{offset:o})}return kse(t)}function Kse({model:t,defaultPos:e,channel:n,scaleName:r,scale:i}){const{markDef:o,config:s}=t;return()=>{const a=pb(n),l=py(n),c=Or(n,o,s,{vgChannel:l});if(c!==void 0)return vk(n,c);switch(e){case"zeroOrMin":return Mye({scaleName:r,scale:i,mode:"zeroOrMin",mainChannel:a,config:s});case"zeroOrMax":return Mye({scaleName:r,scale:i,mode:{zeroOrMax:{widthSignal:t.width.signal,heightSignal:t.height.signal}},mainChannel:a,config:s});case"mid":return{...t[Tl(n)],mult:.5}}}}function Mye({mainChannel:t,config:e,...n}){const r=s4e(n),{mode:i}=n;if(r)return r;switch(t){case"radius":{if(i==="zeroOrMin")return{value:0};const{widthSignal:o,heightSignal:s}=i.zeroOrMax;return{signal:`min(${o},${s})/2`}}case"theta":return i==="zeroOrMin"?{value:0}:{signal:"2*PI"};case"x":return i==="zeroOrMin"?{value:0}:{field:{group:"width"}};case"y":return i==="zeroOrMin"?{field:{group:"height"}}:{value:0}}}const _9t={left:"x",center:"xc",right:"x2"},S9t={top:"y",middle:"yc",bottom:"y2"};function xBe(t,e,n,r="middle"){if(t==="radius"||t==="theta")return py(t);const i=t==="x"?"align":"baseline",o=Or(i,e,n);let s;return Mt(o)?(Ze(SUt(i)),s=void 0):s=o,t==="x"?_9t[s||(r==="top"?"left":"center")]:S9t[s||r]}function V5(t,e,{defaultPos:n,defaultPos2:r,range:i}){return i?bBe(t,e,{defaultPos:n,defaultPos2:r}):Ca(t,e,{defaultPos:n})}function bBe(t,e,{defaultPos:n,defaultPos2:r}){const{markDef:i,config:o}=e,s=Qh(t),a=Tl(t),l=C9t(e,r,s),c=l[a]?xBe(t,i,o):py(t);return{...Ca(t,e,{defaultPos:n,vgChannel:c}),...l}}function C9t(t,e,n){const{encoding:r,mark:i,markDef:o,stack:s,config:a}=t,l=pb(n),c=Tl(n),u=py(n),f=r[l],d=t.scaleName(l),h=t.getScaleComponent(l),{offset:p}=n in r||n in o?sC({channel:n,markDef:o,encoding:r,model:t}):sC({channel:l,markDef:o,encoding:r,model:t});if(!f&&(n==="x2"||n==="y2")&&(r.latitude||r.longitude)){const m=Tl(n),v=t.markDef[m];return v!=null?{[m]:{value:v}}:{[u]:{field:t.getName(n)}}}const g=O9t({channel:n,channelDef:f,channel2Def:r[n],markDef:o,config:a,scaleName:d,scale:h,stack:s,offset:p,defaultRef:void 0});return g!==void 0?{[u]:g}:rL(n,o)||rL(n,{[n]:SY(n,o,a.style),[c]:SY(c,o,a.style)})||rL(n,a[i])||rL(n,a.mark)||{[u]:Kse({model:t,defaultPos:e,channel:n,scaleName:d,scale:h})()}}function O9t({channel:t,channelDef:e,channel2Def:n,markDef:r,config:i,scaleName:o,scale:s,stack:a,offset:l,defaultRef:c}){return en(e)&&a&&t.charAt(0)===a.fieldChannel.charAt(0)?Bx(e,o,{suffix:"start"},{offset:l}):kse({channel:t,channelDef:n,scaleName:o,scale:s,stack:a,markDef:r,config:i,offset:l,defaultRef:c})}function rL(t,e){const n=Tl(t),r=py(t);if(e[r]!==void 0)return{[r]:vk(t,e[r])};if(e[t]!==void 0)return{[r]:vk(t,e[t])};if(e[n]){const i=e[n];if(O1(i))Ze(vUt(n));else return{[n]:vk(t,i)}}}function zg(t,e){const{config:n,encoding:r,markDef:i}=t,o=i.type,s=Qh(e),a=Tl(e),l=r[e],c=r[s],u=t.getScaleComponent(e),f=u?u.get("type"):void 0,d=i.orient,h=r[a]??r.size??Or("size",i,n,{vgChannel:a}),p=mje(e),g=o==="bar"&&(e==="x"?d==="vertical":d==="horizontal")||o==="tick"&&(e==="y"?d==="vertical":d==="horizontal");return Je(l)&&(Gr(l.bin)||ns(l.bin)||l.timeUnit&&!c)&&!(h&&!O1(h))&&!r[p]&&!Wo(f)?k9t({fieldDef:l,fieldDef2:c,channel:e,model:t}):(en(l)&&Wo(f)||g)&&!c?T9t(l,e,t):bBe(e,t,{defaultPos:"zeroOrMax",defaultPos2:"zeroOrMin"})}function E9t(t,e,n,r,i,o,s){if(O1(i))if(n){const l=n.get("type");if(l==="band"){let c=`bandwidth('${e}')`;i.band!==1&&(c=`${i.band} * ${c}`);const u=Rh("minBandSize",{type:s},r);return{signal:u?`max(${Tf(u)}, ${c})`:c}}else i.band!==1&&(Ze(TUt(l)),i=void 0)}else return{mult:i.band,field:{group:t}};else{if(Mt(i))return i;if(i)return{value:i}}if(n){const l=n.get("range");if(mb(l)&&Jn(l.step))return{value:l.step-2}}if(!o){const{bandPaddingInner:l,barBandPaddingInner:c,rectBandPaddingInner:u,tickBandPaddingInner:f}=r.scale,d=Xi(l,s==="tick"?f:s==="bar"?c:u);if(Mt(d))return{signal:`(1 - (${d.signal})) * ${t}`};if(Jn(d))return{signal:`${1-d} * ${t}`}}return{value:PY(r.view,t)-2}}function T9t(t,e,n){var k,E;const{markDef:r,encoding:i,config:o,stack:s}=n,a=r.orient,l=n.scaleName(e),c=n.getScaleComponent(e),u=Tl(e),f=Qh(e),d=mje(e),h=n.scaleName(d),p=n.getScaleComponent(rse(e)),g=r.type==="tick"||a==="horizontal"&&e==="y"||a==="vertical"&&e==="x";let m;(i.size||r.size)&&(g?m=cs("size",n,{vgChannel:u,defaultRef:Jr(r.size)}):Ze(MUt(r.type)));const v=!!m,y=p4e({channel:e,fieldDef:t,markDef:r,config:o,scaleType:(k=c||p)==null?void 0:k.get("type"),useVlSizeChannel:g});m=m||{[u]:E9t(u,h||l,p||c,o,y,!!t,r.type)};const x=((E=c||p)==null?void 0:E.get("type"))==="band"&&O1(y)&&!v?"top":"middle",b=xBe(e,r,o,x),w=b==="xc"||b==="yc",{offset:_,offsetType:S}=sC({channel:e,markDef:r,encoding:i,model:n,bandPosition:w?.5:0}),O=kse({channel:e,channelDef:t,markDef:r,config:o,scaleName:l,scale:c,stack:s,offset:_,defaultRef:Kse({model:n,defaultPos:"mid",channel:e,scaleName:l,scale:c}),bandPosition:w?S==="encoding"?0:.5:Mt(y)?{signal:`(1-${y})/2`}:O1(y)?(1-y.band)/2:0});if(u)return{[b]:O,...m};{const M=py(f),A=m[u],P=_?{...A,offset:_}:A;return{[b]:O,[M]:We(O)?[O[0],{...O[1],offset:P}]:{...O,offset:P}}}}function Rye(t,e,n,r,i,o,s){if(uje(t))return 0;const a=t==="x"||t==="y2",l=a?-e/2:e/2;if(Mt(n)||Mt(i)||Mt(r)||o){const c=Tf(n),u=Tf(i),f=Tf(r),d=Tf(o),p=o?`(${s} < ${d} ? ${a?"":"-"}0.5 * (${d} - (${s})) : ${l})`:l,g=f?`${f} + `:"",m=c?`(${c} ? -1 : 1) * `:"",v=u?`(${u} + ${p})`:p;return{signal:g+m+v}}else return i=i||0,r+(n?-i-l:+i+l)}function k9t({fieldDef:t,fieldDef2:e,channel:n,model:r}){var E;const{config:i,markDef:o,encoding:s}=r,a=r.getScaleComponent(n),l=r.scaleName(n),c=a?a.get("type"):void 0,u=a.get("reverse"),f=p4e({channel:n,fieldDef:t,markDef:o,config:i,scaleType:c}),d=(E=r.component.axes[n])==null?void 0:E[0],h=(d==null?void 0:d.get("translate"))??.5,p=Yi(n)?Or("binSpacing",o,i)??0:0,g=Qh(n),m=py(n),v=py(g),y=Rh("minBandSize",o,i),{offset:x}=sC({channel:n,markDef:o,encoding:s,model:r,bandPosition:0}),{offset:b}=sC({channel:g,markDef:o,encoding:s,model:r,bandPosition:0}),w=J8t({fieldDef:t,scaleName:l}),_=Rye(n,p,u,h,x,y,w),S=Rye(g,p,u,h,b??x,y,w),O=Mt(f)?{signal:`(1-${f.signal})/2`}:O1(f)?(1-f.band)/2:.5,k=gy({fieldDef:t,fieldDef2:e,markDef:o,config:i});if(Gr(t.bin)||t.timeUnit){const M=t.timeUnit&&k!==.5;return{[v]:Dye({fieldDef:t,scaleName:l,bandPosition:O,offset:S,useRectOffsetField:M}),[m]:Dye({fieldDef:t,scaleName:l,bandPosition:Mt(O)?{signal:`1-${O.signal}`}:1-O,offset:_,useRectOffsetField:M})}}else if(ns(t.bin)){const M=Bx(t,l,{},{offset:S});if(Je(e))return{[v]:M,[m]:Bx(e,l,{},{offset:_})};if(gb(t.bin)&&t.bin.step)return{[v]:M,[m]:{signal:`scale("${l}", ${ct(t,{expr:"datum"})} + ${t.bin.step})`,offset:_}}}Ze(Lje(g))}function Dye({fieldDef:t,scaleName:e,bandPosition:n,offset:r,useRectOffsetField:i}){return F5({scaleName:e,fieldOrDatumDef:t,bandPosition:n,offset:r,...i?{startSuffix:$6,endSuffix:F6}:{}})}const A9t=new Set(["aria","width","height"]);function Bu(t,e){const{fill:n=void 0,stroke:r=void 0}=e.color==="include"?yBe(t):{};return{...P9t(t.markDef,e),...Iye("fill",n),...Iye("stroke",r),...cs("opacity",t),...cs("fillOpacity",t),...cs("strokeOpacity",t),...cs("strokeWidth",t),...cs("strokeDash",t),...b9t(t),...mBe(t),...Qse(t,"href"),...v9t(t)}}function Iye(t,e){return e?{[t]:e}:{}}function P9t(t,e){return V6t.reduce((n,r)=>(!A9t.has(r)&&Ke(t,r)&&e[r]!=="ignore"&&(n[r]=Jr(t[r])),n),{})}function Zse(t){const{config:e,markDef:n}=t,r=new Set;if(t.forEachFieldDef((i,o)=>{var c;let s;if(!Kh(o)||!(s=t.getScaleType(o)))return;const a=v6(i.aggregate),l=Tse({scaleChannel:o,markDef:n,config:e,scaleType:s,isCountAggregate:a});if(Q8t(l)){const u=t.vgField(o,{expr:"datum",binSuffix:(c=t.stack)!=null&&c.impute?"mid":void 0});u&&r.add(u)}}),r.size>0)return{defined:{signal:[...r].map(o=>w6(o,!0)).join(" && ")}}}function Lye(t,e){if(e!==void 0)return{[t]:Jr(e)}}const HV="voronoi",wBe={defined:t=>t.type==="point"&&t.nearest,parse:(t,e)=>{if(e.events)for(const n of e.events)n.markname=t.getName(HV)},marks:(t,e,n)=>{const{x:r,y:i}=e.project.hasChannel,o=t.mark;if(e0(o))return Ze(Q6t(o)),n;const s={name:t.getName(HV),type:"path",interactive:!0,from:{data:t.getName("marks")},encode:{update:{fill:{value:"transparent"},strokeWidth:{value:.35},stroke:{value:"transparent"},isVoronoi:{value:!0},...mBe(t,{reactiveGeom:!0})}},transform:[{type:"voronoi",x:{expr:r||!i?"datum.datum.x || 0":"0"},y:{expr:i||!r?"datum.datum.y || 0":"0"},size:[t.getSizeSignalRef("width"),t.getSizeSignalRef("height")]}]};let a=0,l=!1;return n.forEach((c,u)=>{const f=c.name??"";f===t.component.mark[0].name?a=u:f.includes(HV)&&(l=!0)}),l||n.splice(a+1,0,s),n}},_Be={defined:t=>t.type==="point"&&t.resolve==="global"&&t.bind&&t.bind!=="scales"&&!Use(t.bind),parse:(t,e,n)=>PBe(e,n),topLevelSignals:(t,e,n)=>{const r=e.name,i=e.project,o=e.bind,s=e.init&&e.init[0],a=wBe.defined(e)?"(item().isVoronoi ? datum.datum : datum)":"datum";return i.items.forEach((l,c)=>{const u=hi(`${r}_${l.field}`);n.filter(d=>d.name===u).length||n.unshift({name:u,...s?{init:T1(s[c])}:{value:null},on:e.events?[{events:e.events,update:`datum && item().mark.marktype !== 'group' ? ${a}[${rt(l.field)}] : null`}]:[],bind:o[l.field]??o[l.channel]??o})}),n},signals:(t,e,n)=>{const r=e.name,i=e.project,o=n.find(c=>c.name===r+vy),s=r+qR,a=i.items.map(c=>hi(`${r}_${c.field}`)),l=a.map(c=>`${c} !== null`).join(" && ");return a.length&&(o.update=`${l} ? {fields: ${s}, values: [${a.join(", ")}]} : null`),delete o.value,delete o.on,n}},G5="_toggle",SBe={defined:t=>t.type==="point"&&!!t.toggle,signals:(t,e,n)=>n.concat({name:e.name+G5,value:!1,on:[{events:e.events,update:e.toggle}]}),modifyExpr:(t,e)=>{const n=e.name+vy,r=e.name+G5;return`${r} ? null : ${n}, `+(e.resolve==="global"?`${r} ? null : true, `:`${r} ? null : {unit: ${Wx(t)}}, `)+`${r} ? ${n} : null`}},M9t={defined:t=>t.clear!==void 0&&t.clear!==!1,parse:(t,e)=>{e.clear&&(e.clear=gt(e.clear)?qy(e.clear,"view"):e.clear)},topLevelSignals:(t,e,n)=>{if(_Be.defined(e))for(const r of e.project.items){const i=n.findIndex(o=>o.name===hi(`${e.name}_${r.field}`));i!==-1&&n[i].on.push({events:e.clear,update:"null"})}return n},signals:(t,e,n)=>{function r(i,o){i!==-1&&n[i].on&&n[i].on.push({events:e.clear,update:o})}if(e.type==="interval")for(const i of e.project.items){const o=n.findIndex(s=>s.name===i.signals.visual);if(r(o,"[0, 0]"),o===-1){const s=n.findIndex(a=>a.name===i.signals.data);r(s,"null")}}else{let i=n.findIndex(o=>o.name===e.name+vy);r(i,"null"),SBe.defined(e)&&(i=n.findIndex(o=>o.name===e.name+G5),r(i,"false"))}return n}},CBe={defined:t=>{const e=t.resolve==="global"&&t.bind&&Use(t.bind),n=t.project.items.length===1&&t.project.items[0].field!==Yf;return e&&!n&&Ze(eUt),e&&n},parse:(t,e,n)=>{const r=Kt(n);if(r.select=gt(r.select)?{type:r.select,toggle:e.toggle}:{...r.select,toggle:e.toggle},PBe(e,r),ht(n.select)&&(n.select.on||n.select.clear)){const s='event.item && indexof(event.item.mark.role, "legend") < 0';for(const a of e.events)a.filter=pt(a.filter??[]),a.filter.includes(s)||a.filter.push(s)}const i=UV(e.bind)?e.bind.legend:"click",o=gt(i)?qy(i,"view"):pt(i);e.bind={legend:{merge:o}}},topLevelSignals:(t,e,n)=>{const r=e.name,i=UV(e.bind)&&e.bind.legend,o=s=>a=>{const l=Kt(a);return l.markname=s,l};for(const s of e.project.items){if(!s.hasLegend)continue;const a=`${hi(s.field)}_legend`,l=`${r}_${a}`;if(n.filter(u=>u.name===l).length===0){const u=i.merge.map(o(`${a}_symbols`)).concat(i.merge.map(o(`${a}_labels`))).concat(i.merge.map(o(`${a}_entries`)));n.unshift({name:l,...e.init?{}:{value:null},on:[{events:u,update:"isDefined(datum.value) ? datum.value : item().items[0].items[0].datum.value",force:!0},{events:i.merge,update:`!event.item || !datum ? null : ${l}`,force:!0}]})}}return n},signals:(t,e,n)=>{const r=e.name,i=e.project,o=n.find(d=>d.name===r+vy),s=r+qR,a=i.items.filter(d=>d.hasLegend).map(d=>hi(`${r}_${hi(d.field)}_legend`)),c=`${a.map(d=>`${d} !== null`).join(" && ")} ? {fields: ${s}, values: [${a.join(", ")}]} : null`;e.events&&a.length>0?o.on.push({events:a.map(d=>({signal:d})),update:c}):a.length>0&&(o.update=c,delete o.value,delete o.on);const u=n.find(d=>d.name===r+G5),f=UV(e.bind)&&e.bind.legend;return u&&(e.events?u.on.push({...u.on[0],events:f}):u.on[0].events=f),n}};function R9t(t,e,n){var i;const r=(i=t.fieldDef(e))==null?void 0:i.field;for(const o of bs(t.component.selection??{})){const s=o.project.hasField[r]??o.project.hasChannel[e];if(s&&CBe.defined(o)){const a=n.get("selections")??[];a.push(o.name),n.set("selections",a,!1),s.hasLegend=!0}}}const OBe="_translate_anchor",EBe="_translate_delta",D9t={defined:t=>t.type==="interval"&&t.translate,signals:(t,e,n)=>{const r=e.name,i=fg.defined(e),o=r+OBe,{x:s,y:a}=e.project.hasChannel;let l=qy(e.translate,"scope");return i||(l=l.map(c=>(c.between[0].markname=r+B_,c))),n.push({name:o,value:{},on:[{events:l.map(c=>c.between[0]),update:"{x: x(unit), y: y(unit)"+(s!==void 0?`, extent_x: ${i?IY(t,vi):`slice(${s.signals.visual})`}`:"")+(a!==void 0?`, extent_y: ${i?IY(t,Yo):`slice(${a.signals.visual})`}`:"")+"}"}]},{name:r+EBe,value:{},on:[{events:l,update:`{x: ${o}.x - x(unit), y: ${o}.y - y(unit)}`}]}),s!==void 0&&$ye(t,e,s,"width",n),a!==void 0&&$ye(t,e,a,"height",n),n}};function $ye(t,e,n,r,i){const o=e.name,s=o+OBe,a=o+EBe,l=n.channel,c=fg.defined(e),u=i.find(w=>w.name===n.signals[c?"data":"visual"]),f=t.getSizeSignalRef(r).signal,d=t.getScaleComponent(l),h=d&&d.get("type"),p=d&&d.get("reverse"),g=c?l===vi?p?"":"-":p?"-":"":"",m=`${s}.extent_${l}`,v=`${g}${a}.${l} / ${c?`${f}`:`span(${m})`}`,y=!c||!d?"panLinear":h==="log"?"panLog":h==="symlog"?"panSymlog":h==="pow"?"panPow":"panLinear",x=c?h==="pow"?`, ${d.get("exponent")??1}`:h==="symlog"?`, ${d.get("constant")??1}`:"":"",b=`${y}(${m}, ${v}${x})`;u.on.push({events:{signal:a},update:c?b:`clampRange(${b}, 0, ${f})`})}const TBe="_zoom_anchor",kBe="_zoom_delta",I9t={defined:t=>t.type==="interval"&&t.zoom,signals:(t,e,n)=>{const r=e.name,i=fg.defined(e),o=r+kBe,{x:s,y:a}=e.project.hasChannel,l=rt(t.scaleName(vi)),c=rt(t.scaleName(Yo));let u=qy(e.zoom,"scope");return i||(u=u.map(f=>(f.markname=r+B_,f))),n.push({name:r+TBe,on:[{events:u,update:i?"{"+[l?`x: invert(${l}, x(unit))`:"",c?`y: invert(${c}, y(unit))`:""].filter(f=>f).join(", ")+"}":"{x: x(unit), y: y(unit)}"}]},{name:o,on:[{events:u,force:!0,update:"pow(1.001, event.deltaY * pow(16, event.deltaMode))"}]}),s!==void 0&&Fye(t,e,s,"width",n),a!==void 0&&Fye(t,e,a,"height",n),n}};function Fye(t,e,n,r,i){const o=e.name,s=n.channel,a=fg.defined(e),l=i.find(y=>y.name===n.signals[a?"data":"visual"]),c=t.getSizeSignalRef(r).signal,u=t.getScaleComponent(s),f=u&&u.get("type"),d=a?IY(t,s):l.name,h=o+kBe,p=`${o}${TBe}.${s}`,g=!a||!u?"zoomLinear":f==="log"?"zoomLog":f==="symlog"?"zoomSymlog":f==="pow"?"zoomPow":"zoomLinear",m=a?f==="pow"?`, ${u.get("exponent")??1}`:f==="symlog"?`, ${u.get("constant")??1}`:"":"",v=`${g}(${d}, ${p}, ${h}${m})`;l.on.push({events:{signal:h},update:a?v:`clampRange(${v}, 0, ${c})`})}const k1="_store",vy="_tuple",L9t="_modify",ABe="vlSelectionResolve",z6=[m9t,p9t,d9t,SBe,_Be,fg,CBe,M9t,D9t,I9t,wBe];function $9t(t){let e=t.parent;for(;e&&!mc(e);)e=e.parent;return e}function Wx(t,{escape:e}={escape:!0}){let n=e?rt(t.name):t.name;const r=$9t(t);if(r){const{facet:i}=r;for(const o of au)i[o]&&(n+=` + '__facet_${o}_' + (facet[${rt(r.vgField(o))}])`)}return n}function Jse(t){return bs(t.component.selection??{}).reduce((e,n)=>e||n.project.hasSelectionId,!1)}function PBe(t,e){(gt(e.select)||!e.select.on)&&delete t.events,(gt(e.select)||!e.select.clear)&&delete t.clear,(gt(e.select)||!e.select.toggle)&&delete t.toggle}function LY(t){const e=[];return t.type==="Identifier"?[t.name]:t.type==="Literal"?[t.value]:(t.type==="MemberExpression"&&(e.push(...LY(t.object)),e.push(...LY(t.property))),e)}function MBe(t){return t.object.type==="MemberExpression"?MBe(t.object):t.object.name==="datum"}function RBe(t){const e=xoe(t),n=new Set;return e.visit(r=>{r.type==="MemberExpression"&&MBe(r)&&n.add(LY(r).slice(1).join("."))}),n}class $O extends _r{clone(){return new $O(null,this.model,Kt(this.filter))}constructor(e,n,r){super(e),this.model=n,this.filter=r,this.expr=H5(this.model,this.filter,this),this._dependentFields=RBe(this.expr)}dependentFields(){return this._dependentFields}producedFields(){return new Set}assemble(){return{type:"filter",expr:this.expr}}hash(){return`Filter ${this.expr}`}}function F9t(t,e){const n={},r=t.config.selection;if(!e||!e.length)return n;for(const i of e){const o=hi(i.name),s=i.select,a=gt(s)?s:s.type,l=ht(s)?Kt(s):{type:a},c=r[a];for(const d in c)d==="fields"||d==="encodings"||(d==="mark"&&(l.mark={...c.mark,...l.mark}),(l[d]===void 0||l[d]===!0)&&(l[d]=Kt(c[d]??l[d])));const u=n[o]={...l,name:o,type:a,init:i.value,bind:i.bind,events:gt(l.on)?qy(l.on,"scope"):pt(Kt(l.on))},f=Kt(i);for(const d of z6)d.defined(u)&&d.parse&&d.parse(t,u,f)}return n}function DBe(t,e,n,r="datum"){const i=gt(e)?e:e.param,o=hi(i),s=rt(o+k1);let a;try{a=t.getSelectionComponent(o,i)}catch{return`!!${o}`}if(a.project.timeUnit){const d=n??t.component.data.raw,h=a.project.timeUnit.clone();d.parent?h.insertAsParentOf(d):d.parent=h}const l=a.project.hasSelectionId?"vlSelectionIdTest(":"vlSelectionTest(",c=a.resolve==="global"?")":`, ${rt(a.resolve)})`,u=`${l}${s}, ${r}${c}`,f=`length(data(${s}))`;return e.empty===!1?`${f} && ${u}`:`!${f} || ${u}`}function IBe(t,e,n){const r=hi(e),i=n.encoding;let o=n.field,s;try{s=t.getSelectionComponent(r,e)}catch{return r}if(!i&&!o)o=s.project.items[0].field,s.project.items.length>1&&Ze(`A "field" or "encoding" must be specified when using a selection as a scale domain. Using "field": ${rt(o)}.`);else if(i&&!o){const a=s.project.items.filter(l=>l.channel===i);!a.length||a.length>1?(o=s.project.items[0].field,Ze((a.length?"Multiple ":"No ")+`matching ${rt(i)} encoding found for selection ${rt(n.param)}. Using "field": ${rt(o)}.`)):o=a[0].field}return`${s.name}[${rt(Mu(o))}]`}function N9t(t,e){for(const[n,r]of hy(t.component.selection??{})){const i=t.getName(`lookup_${n}`);t.component.data.outputNodes[i]=r.materialized=new ml(new $O(e,t,{param:n}),i,Fi.Lookup,t.component.data.outputNodeRefCounts)}}function H5(t,e,n){return mk(e,r=>gt(r)?r:p8t(r)?DBe(t,r,n):qje(r))}function z9t(t,e){if(t)return We(t)&&!Km(t)?t.map(n=>Ise(n,e)).join(", "):t}function qV(t,e,n,r){var i,o;t.encode??(t.encode={}),(i=t.encode)[e]??(i[e]={}),(o=t.encode[e]).update??(o.update={}),t.encode[e].update[n]=r}function wT(t,e,n,r={header:!1}){var f,d;const{disable:i,orient:o,scale:s,labelExpr:a,title:l,zindex:c,...u}=t.combine();if(!i){for(const h in u){const p=h,g=xWt[p],m=u[p];if(g&&g!==e&&g!=="both")delete u[p];else if(HR(m)){const{condition:v,...y}=m,x=pt(v),b=uye[p];if(b){const{vgProp:w,part:_}=b,S=[...x.map(O=>{const{test:k,...E}=O;return{test:H5(null,k),...E}}),y];qV(u,_,w,S),delete u[p]}else if(b===null){const w={signal:x.map(_=>{const{test:S,...O}=_;return`${H5(null,S)} ? ${Xve(O)} : `}).join("")+Xve(y)};u[p]=w}}else if(Mt(m)){const v=uye[p];if(v){const{vgProp:y,part:x}=v;qV(u,x,y,m),delete u[p]}}Tn(["labelAlign","labelBaseline"],p)&&u[p]===null&&delete u[p]}if(e==="grid"){if(!u.grid)return;if(u.encode){const{grid:h}=u.encode;u.encode={...h?{grid:h}:{}},Er(u.encode)&&delete u.encode}return{scale:s,orient:o,...u,domain:!1,labels:!1,aria:!1,maxExtent:0,minExtent:0,ticks:!1,zindex:Xi(c,0)}}else{if(!r.header&&t.mainExtracted)return;if(a!==void 0){let p=a;(d=(f=u.encode)==null?void 0:f.labels)!=null&&d.update&&Mt(u.encode.labels.update.text)&&(p=w1(a,"datum.label",u.encode.labels.update.text.signal)),qV(u,"labels","text",{signal:p})}if(u.labelAlign===null&&delete u.labelAlign,u.encode){for(const p of C4e)t.hasAxisPart(p)||delete u.encode[p];Er(u.encode)&&delete u.encode}const h=z9t(l,n);return{scale:s,orient:o,grid:!1,...h?{title:h}:{},...u,...n.aria===!1?{aria:!1}:{},zindex:Xi(c,0)}}}}function LBe(t){const{axes:e}=t.component,n=[];for(const r of tm)if(e[r]){for(const i of e[r])if(!i.get("disable")&&!i.get("gridScale")){const o=r==="x"?"height":"width",s=t.getSizeSignalRef(o).signal;o!==s&&n.push({name:o,update:s})}}return n}function j9t(t,e){const{x:n=[],y:r=[]}=t;return[...n.map(i=>wT(i,"grid",e)),...r.map(i=>wT(i,"grid",e)),...n.map(i=>wT(i,"main",e)),...r.map(i=>wT(i,"main",e))].filter(i=>i)}function Nye(t,e,n,r){return Object.assign.apply(null,[{},...t.map(i=>{if(i==="axisOrient"){const o=n==="x"?"bottom":"left",s=e[n==="x"?"axisBottom":"axisLeft"]||{},a=e[n==="x"?"axisTop":"axisRight"]||{},l=new Set([...Qe(s),...Qe(a)]),c={};for(const u of l.values())c[u]={signal:`${r.signal} === "${o}" ? ${Tf(s[u])} : ${Tf(a[u])}`};return c}return e[i]})])}function B9t(t,e,n,r){const i=e==="band"?["axisDiscrete","axisBand"]:e==="point"?["axisDiscrete","axisPoint"]:Kje(e)?["axisQuantitative"]:e==="time"||e==="utc"?["axisTemporal"]:[],o=t==="x"?"axisX":"axisY",s=Mt(n)?"axisOrient":`axis${LR(n)}`,a=[...i,...i.map(c=>o+c.substr(4))],l=["axis",s,o];return{vlOnlyAxisConfig:Nye(a,r,t,n),vgAxisConfig:Nye(l,r,t,n),axisConfigStyle:U9t([...l,...a],r)}}function U9t(t,e){var r;const n=[{}];for(const i of t){let o=(r=e[i])==null?void 0:r.style;if(o){o=pt(o);for(const s of o)n.push(e.style[s])}}return Object.assign.apply(null,n)}function $Y(t,e,n,r={}){var o;const i=Oje(t,n,e);if(i!==void 0)return{configFrom:"style",configValue:i};for(const s of["vlOnlyAxisConfig","vgAxisConfig","axisConfigStyle"])if(((o=r[s])==null?void 0:o[t])!==void 0)return{configFrom:s,configValue:r[s][t]};return{}}const zye={scale:({model:t,channel:e})=>t.scaleName(e),format:({format:t})=>t,formatType:({formatType:t})=>t,grid:({fieldOrDatumDef:t,axis:e,scaleType:n})=>e.grid??W9t(n,t),gridScale:({model:t,channel:e})=>V9t(t,e),labelAlign:({axis:t,labelAngle:e,orient:n,channel:r})=>t.labelAlign||FBe(e,n,r),labelAngle:({labelAngle:t})=>t,labelBaseline:({axis:t,labelAngle:e,orient:n,channel:r})=>t.labelBaseline||$Be(e,n,r),labelFlush:({axis:t,fieldOrDatumDef:e,channel:n})=>t.labelFlush??H9t(e.type,n),labelOverlap:({axis:t,fieldOrDatumDef:e,scaleType:n})=>t.labelOverlap??q9t(e.type,n,Je(e)&&!!e.timeUnit,Je(e)?e.sort:void 0),orient:({orient:t})=>t,tickCount:({channel:t,model:e,axis:n,fieldOrDatumDef:r,scaleType:i})=>{const o=t==="x"?"width":t==="y"?"height":void 0,s=o?e.getSizeSignalRef(o):void 0;return n.tickCount??Y9t({fieldOrDatumDef:r,scaleType:i,size:s,values:n.values})},tickMinStep:Q9t,title:({axis:t,model:e,channel:n})=>{if(t.title!==void 0)return t.title;const r=NBe(e,n);if(r!==void 0)return r;const i=e.typedFieldDef(n),o=n==="x"?"x2":"y2",s=e.fieldDef(o);return Tje(i?[lye(i)]:[],Je(s)?[lye(s)]:[])},values:({axis:t,fieldOrDatumDef:e})=>K9t(t,e),zindex:({axis:t,fieldOrDatumDef:e,mark:n})=>t.zindex??Z9t(n,e)};function W9t(t,e){return!Wo(t)&&Je(e)&&!Gr(e==null?void 0:e.bin)&&!ns(e==null?void 0:e.bin)}function V9t(t,e){const n=e==="x"?"y":"x";if(t.getScaleComponent(n))return t.scaleName(n)}function G9t(t,e,n,r,i){const o=e==null?void 0:e.labelAngle;if(o!==void 0)return Mt(o)?o:XA(o);{const{configValue:s}=$Y("labelAngle",r,e==null?void 0:e.style,i);return s!==void 0?XA(s):n===vi&&Tn([_se,wse],t.type)&&!(Je(t)&&t.timeUnit)?270:void 0}}function FY(t){return`(((${t.signal} % 360) + 360) % 360)`}function $Be(t,e,n,r){if(t!==void 0)if(n==="x"){if(Mt(t)){const i=FY(t),o=Mt(e)?`(${e.signal} === "top")`:e==="top";return{signal:`(45 < ${i} && ${i} < 135) || (225 < ${i} && ${i} < 315) ? "middle" :(${i} <= 45 || 315 <= ${i}) === ${o} ? "bottom" : "top"`}}if(45{if(xb(r)&&h4e(r.sort)){const{field:o,timeUnit:s}=r,a=r.sort,l=a.map((c,u)=>`${qje({field:o,timeUnit:s,equal:c})} ? ${u} : `).join("")+a.length;e=new aC(e,{calculate:l,as:lC(r,i,{forAs:!0})})}}),e}producedFields(){return new Set([this.transform.as])}dependentFields(){return this._dependentFields}assemble(){return{type:"formula",expr:this.transform.calculate,as:this.transform.as}}hash(){return`Calculate ${Mn(this.transform)}`}}function lC(t,e,n){return ct(t,{prefix:e,suffix:"sort_index",...n})}function j6(t,e){return Tn(["top","bottom"],e)?"column":Tn(["left","right"],e)||t==="row"?"row":"column"}function cC(t,e,n,r){const i=r==="row"?n.headerRow:r==="column"?n.headerColumn:n.headerFacet;return Xi((e||{})[t],i[t],n.header[t])}function B6(t,e,n,r){const i={};for(const o of t){const s=cC(o,e||{},n,r);s!==void 0&&(i[o]=s)}return i}const eae=["row","column"],tae=["header","footer"];function J9t(t,e){const n=t.component.layoutHeaders[e].title,r=t.config?t.config:void 0,i=t.component.layoutHeaders[e].facetFieldDef?t.component.layoutHeaders[e].facetFieldDef:void 0,{titleAnchor:o,titleAngle:s,titleOrient:a}=B6(["titleAnchor","titleAngle","titleOrient"],i.header,r,e),l=j6(e,a),c=XA(s);return{name:`${e}-title`,type:"group",role:`${l}-title`,title:{text:n,...e==="row"?{orient:"left"}:{},style:"guide-title",...jBe(c,l),...zBe(l,c,o),...BBe(r,i,e,BWt,U4e)}}}function zBe(t,e,n="middle"){switch(n){case"start":return{align:"left"};case"end":return{align:"right"}}const r=FBe(e,t==="row"?"left":"top",t==="row"?"y":"x");return r?{align:r}:{}}function jBe(t,e){const n=$Be(t,e==="row"?"left":"top",e==="row"?"y":"x",!0);return n?{baseline:n}:{}}function e7t(t,e){const n=t.component.layoutHeaders[e],r=[];for(const i of tae)if(n[i])for(const o of n[i]){const s=n7t(t,e,i,n,o);s!=null&&r.push(s)}return r}function t7t(t,e){const{sort:n}=t;return ug(n)?{field:ct(n,{expr:"datum"}),order:n.order??"ascending"}:We(n)?{field:lC(t,e,{expr:"datum"}),order:"ascending"}:{field:ct(t,{expr:"datum"}),order:n??"ascending"}}function NY(t,e,n){const{format:r,formatType:i,labelAngle:o,labelAnchor:s,labelOrient:a,labelExpr:l}=B6(["format","formatType","labelAngle","labelAnchor","labelOrient","labelExpr"],t.header,n,e),c=Pse({fieldOrDatumDef:t,format:r,formatType:i,expr:"parent",config:n}).signal,u=j6(e,a);return{text:{signal:l?w1(w1(l,"datum.label",c),"datum.value",ct(t,{expr:"parent"})):c},...e==="row"?{orient:"left"}:{},style:"guide-label",frame:"group",...jBe(o,u),...zBe(u,o,s),...BBe(n,t,e,UWt,W4e)}}function n7t(t,e,n,r,i){if(i){let o=null;const{facetFieldDef:s}=r,a=t.config?t.config:void 0;if(s&&i.labels){const{labelOrient:f}=B6(["labelOrient"],s.header,a,e);(e==="row"&&!Tn(["top","bottom"],f)||e==="column"&&!Tn(["left","right"],f))&&(o=NY(s,e,a))}const l=mc(t)&&!UR(t.facet),c=i.axes,u=(c==null?void 0:c.length)>0;if(o||u){const f=e==="row"?"height":"width";return{name:t.getName(`${e}_${n}`),type:"group",role:`${e}-${n}`,...r.facetFieldDef?{from:{data:t.getName(`${e}_domain`)},sort:t7t(s,e)}:{},...u&&l?{from:{data:t.getName(`facet_domain_${e}`)}}:{},...o?{title:o}:{},...i.sizeSignal?{encode:{update:{[f]:i.sizeSignal}}}:{},...u?{axes:c}:{}}}}return null}const r7t={column:{start:0,end:1},row:{start:1,end:0}};function i7t(t,e){return r7t[e][t]}function o7t(t,e){const n={};for(const r of au){const i=t[r];if(i!=null&&i.facetFieldDef){const{titleAnchor:o,titleOrient:s}=B6(["titleAnchor","titleOrient"],i.facetFieldDef.header,e,r),a=j6(r,s),l=i7t(o,a);l!==void 0&&(n[a]=l)}}return Er(n)?void 0:n}function BBe(t,e,n,r,i){const o={};for(const s of r){if(!i[s])continue;const a=cC(s,e==null?void 0:e.header,t,n);a!==void 0&&(o[i[s]]=a)}return o}function nae(t){return[...iL(t,"width"),...iL(t,"height"),...iL(t,"childWidth"),...iL(t,"childHeight")]}function iL(t,e){const n=e==="width"?"x":"y",r=t.component.layoutSize.get(e);if(!r||r==="merged")return[];const i=t.getSizeSignalRef(e).signal;if(r==="step"){const o=t.getScaleComponent(n);if(o){const s=o.get("type"),a=o.get("range");if(Wo(s)&&mb(a)){const l=t.scaleName(n);return mc(t.parent)&&t.parent.component.resolve.scale[n]==="independent"?[jye(l,a)]:[jye(l,a),{name:i,update:UBe(l,o,`domain('${l}').length`)}]}}throw new Error("layout size is step although width/height is not step.")}else if(r=="container"){const o=i.endsWith("width"),s=o?"containerSize()[0]":"containerSize()[1]",a=AY(t.config.view,o?"width":"height"),l=`isFinite(${s}) ? ${s} : ${a}`;return[{name:i,init:l,on:[{update:l,events:"window:resize"}]}]}else return[{name:i,value:r}]}function jye(t,e){const n=`${t}_step`;return Mt(e.step)?{name:n,update:e.step.signal}:{name:n,value:e.step}}function UBe(t,e,n){const r=e.get("type"),i=e.get("padding"),o=Xi(e.get("paddingOuter"),i);let s=e.get("paddingInner");return s=r==="band"?s!==void 0?s:i:1,`bandspace(${n}, ${Tf(s)}, ${Tf(o)}) * ${t}_step`}function WBe(t){return t==="childWidth"?"width":t==="childHeight"?"height":t}function VBe(t,e){return Qe(t).reduce((n,r)=>({...n,...LO({model:e,channelDef:t[r],vgChannel:r,mainRefFn:i=>Jr(i.value),invalidValueRef:void 0})}),{})}function GBe(t,e){if(mc(e))return t==="theta"?"independent":"shared";if(zO(e))return"shared";if(cae(e))return Yi(t)||t==="theta"||t==="radius"?"independent":"shared";throw new Error("invalid model type for resolve")}function rae(t,e){const n=t.scale[e],r=Yi(e)?"axis":"legend";return n==="independent"?(t[r][e]==="shared"&&Ze($Ut(e)),"independent"):t[r][e]||"shared"}const s7t={...GWt,disable:1,labelExpr:1,selections:1,opacity:1,shape:1,stroke:1,fill:1,size:1,strokeWidth:1,strokeDash:1,encode:1},HBe=Qe(s7t);class a7t extends rm{}const Bye={symbols:l7t,gradient:c7t,labels:u7t,entries:f7t};function l7t(t,{fieldOrDatumDef:e,model:n,channel:r,legendCmpt:i,legendType:o}){if(o!=="symbol")return;const{markDef:s,encoding:a,config:l,mark:c}=n,u=s.filled&&c!=="trail";let f={...q6t({},n,j8t),...yBe(n,{filled:u})};const d=i.get("symbolOpacity")??l.legend.symbolOpacity,h=i.get("symbolFillColor")??l.legend.symbolFillColor,p=i.get("symbolStrokeColor")??l.legend.symbolStrokeColor,g=d===void 0?qBe(a.opacity)??s.opacity:void 0;if(f.fill){if(r==="fill"||u&&r===Ol)delete f.fill;else if(Ke(f.fill,"field"))h?delete f.fill:(f.fill=Jr(l.legend.symbolBaseFillColor??"black"),f.fillOpacity=Jr(g??1));else if(We(f.fill)){const m=zY(a.fill??a.color)??s.fill??(u&&s.color);m&&(f.fill=Jr(m))}}if(f.stroke){if(r==="stroke"||!u&&r===Ol)delete f.stroke;else if(Ke(f.stroke,"field")||p)delete f.stroke;else if(We(f.stroke)){const m=Xi(zY(a.stroke||a.color),s.stroke,u?s.color:void 0);m&&(f.stroke={value:m})}}if(r!==em){const m=Je(e)&&YBe(n,i,e);m?f.opacity=[{test:m,...Jr(g??1)},Jr(l.legend.unselectedOpacity)]:g&&(f.opacity=Jr(g))}return f={...f,...t},Er(f)?void 0:f}function c7t(t,{model:e,legendType:n,legendCmpt:r}){if(n!=="gradient")return;const{config:i,markDef:o,encoding:s}=e;let a={};const c=(r.get("gradientOpacity")??i.legend.gradientOpacity)===void 0?qBe(s.opacity)||o.opacity:void 0;return c&&(a.opacity=Jr(c)),a={...a,...t},Er(a)?void 0:a}function u7t(t,{fieldOrDatumDef:e,model:n,channel:r,legendCmpt:i}){const o=n.legend(r)||{},s=n.config,a=Je(e)?YBe(n,i,e):void 0,l=a?[{test:a,value:1},{value:s.legend.unselectedOpacity}]:void 0,{format:c,formatType:u}=o;let f;E1(u)?f=kf({fieldOrDatumDef:e,field:"datum.value",format:c,formatType:u,config:s}):c===void 0&&u===void 0&&s.customFormatTypes&&(e.type==="quantitative"&&s.numberFormatType?f=kf({fieldOrDatumDef:e,field:"datum.value",format:s.numberFormat,formatType:s.numberFormatType,config:s}):e.type==="temporal"&&s.timeFormatType&&Je(e)&&e.timeUnit===void 0&&(f=kf({fieldOrDatumDef:e,field:"datum.value",format:s.timeFormat,formatType:s.timeFormatType,config:s})));const d={...l?{opacity:l}:{},...f?{text:f}:{},...t};return Er(d)?void 0:d}function f7t(t,{legendCmpt:e}){const n=e.get("selections");return n!=null&&n.length?{...t,fill:{value:"transparent"}}:t}function qBe(t){return XBe(t,(e,n)=>Math.max(e,n.value))}function zY(t){return XBe(t,(e,n)=>Xi(e,n.value))}function XBe(t,e){if(aWt(t))return pt(t.condition).reduce(e,t.value);if(qf(t))return t.value}function YBe(t,e,n){const r=e.get("selections");if(!(r!=null&&r.length))return;const i=rt(n.field);return r.map(o=>`(!length(data(${rt(hi(o)+k1)})) || (${o}[${i}] && indexof(${o}[${i}], datum.value) >= 0))`).join(" || ")}const Uye={direction:({direction:t})=>t,format:({fieldOrDatumDef:t,legend:e,config:n})=>{const{format:r,formatType:i}=e;return u4e(t,t.type,r,i,n,!1)},formatType:({legend:t,fieldOrDatumDef:e,scaleType:n})=>{const{formatType:r}=t;return f4e(r,e,n)},gradientLength:t=>{const{legend:e,legendConfig:n}=t;return e.gradientLength??n.gradientLength??y7t(t)},labelOverlap:({legend:t,legendConfig:e,scaleType:n})=>t.labelOverlap??e.labelOverlap??x7t(n),symbolType:({legend:t,markDef:e,channel:n,encoding:r})=>t.symbolType??h7t(e.type,n,r.shape,e.shape),title:({fieldOrDatumDef:t,config:e})=>j_(t,e,{allowDisabling:!0}),type:({legendType:t,scaleType:e,channel:n})=>{if(z_(n)&&eh(e)){if(t==="gradient")return}else if(t==="symbol")return;return t},values:({fieldOrDatumDef:t,legend:e})=>d7t(e,t)};function d7t(t,e){const n=t.values;if(We(n))return S4e(e,n);if(Mt(n))return n}function h7t(t,e,n,r){if(e!=="shape"){const i=zY(n)??r;if(i)return i}switch(t){case"bar":case"rect":case"image":case"square":return"square";case"line":case"trail":case"rule":return"stroke";case"arc":case"point":case"circle":case"tick":case"geoshape":case"area":case"text":return"circle"}}function p7t(t){const{legend:e}=t;return Xi(e.type,g7t(t))}function g7t({channel:t,timeUnit:e,scaleType:n}){if(z_(t)){if(Tn(["quarter","month","day"],e))return"symbol";if(eh(n))return"gradient"}return"symbol"}function m7t({legendConfig:t,legendType:e,orient:n,legend:r}){return r.direction??t[e?"gradientDirection":"symbolDirection"]??v7t(n,e)}function v7t(t,e){switch(t){case"top":case"bottom":return"horizontal";case"left":case"right":case"none":case void 0:return;default:return e==="gradient"?"horizontal":void 0}}function y7t({legendConfig:t,model:e,direction:n,orient:r,scaleType:i}){const{gradientHorizontalMaxLength:o,gradientHorizontalMinLength:s,gradientVerticalMaxLength:a,gradientVerticalMinLength:l}=t;if(eh(i))return n==="horizontal"?r==="top"||r==="bottom"?Wye(e,"width",s,o):s:Wye(e,"height",l,a)}function Wye(t,e,n,r){return{signal:`clamp(${t.getSizeSignalRef(e).signal}, ${n}, ${r})`}}function x7t(t){if(Tn(["quantile","threshold","log","symlog"],t))return"greedy"}function QBe(t){const e=wi(t)?b7t(t):C7t(t);return t.component.legends=e,e}function b7t(t){const{encoding:e}=t,n={};for(const r of[Ol,...G4e]){const i=So(e[r]);!i||!t.getScaleComponent(r)||r===El&&Je(i)&&i.type===IO||(n[r]=S7t(t,r))}return n}function w7t(t,e){const n=t.scaleName(e);if(t.mark==="trail"){if(e==="color")return{stroke:n};if(e==="size")return{strokeWidth:n}}return e==="color"?t.markDef.filled?{fill:n}:{stroke:n}:{[e]:n}}function _7t(t,e,n,r){switch(e){case"disable":return n!==void 0;case"values":return!!(n!=null&&n.values);case"title":if(e==="title"&&t===(r==null?void 0:r.title))return!0}return t===(n||{})[e]}function S7t(t,e){var b;let n=t.legend(e);const{markDef:r,encoding:i,config:o}=t,s=o.legend,a=new a7t({},w7t(t,e));R9t(t,e,a);const l=n!==void 0?!n:s.disable;if(a.set("disable",l,n!==void 0),l)return a;n=n||{};const c=t.getScaleComponent(e).get("type"),u=So(i[e]),f=Je(u)?(b=Uo(u.timeUnit))==null?void 0:b.unit:void 0,d=n.orient||o.legend.orient||"right",h=p7t({legend:n,channel:e,timeUnit:f,scaleType:c}),p=m7t({legend:n,legendType:h,orient:d,legendConfig:s}),g={legend:n,channel:e,model:t,markDef:r,encoding:i,fieldOrDatumDef:u,legendConfig:s,config:o,scaleType:c,orient:d,legendType:h,direction:p};for(const w of HBe){if(h==="gradient"&&w.startsWith("symbol")||h==="symbol"&&w.startsWith("gradient"))continue;const _=w in Uye?Uye[w](g):n[w];if(_!==void 0){const S=_7t(_,w,n,t.fieldDef(e));(S||o.legend[w]===void 0)&&a.set(w,_,S)}}const m=(n==null?void 0:n.encoding)??{},v=a.get("selections"),y={},x={fieldOrDatumDef:u,model:t,channel:e,legendCmpt:a,legendType:h};for(const w of["labels","legend","title","symbols","gradient","entries"]){const _=VBe(m[w]??{},t),S=w in Bye?Bye[w](_,x):_;S!==void 0&&!Er(S)&&(y[w]={...v!=null&&v.length&&Je(u)?{name:`${hi(u.field)}_legend_${w}`}:{},...v!=null&&v.length?{interactive:!!v}:{},update:S})}return Er(y)||a.set("encode",y,!!(n!=null&&n.encoding)),a}function C7t(t){const{legends:e,resolve:n}=t.component;for(const r of t.children){QBe(r);for(const i of Qe(r.component.legends))n.legend[i]=rae(t.component.resolve,i),n.legend[i]==="shared"&&(e[i]=KBe(e[i],r.component.legends[i]),e[i]||(n.legend[i]="independent",delete e[i]))}for(const r of Qe(e))for(const i of t.children)i.component.legends[r]&&n.legend[r]==="shared"&&delete i.component.legends[r];return e}function KBe(t,e){var o,s,a,l;if(!t)return e.clone();const n=t.getWithExplicit("orient"),r=e.getWithExplicit("orient");if(n.explicit&&r.explicit&&n.value!==r.value)return;let i=!1;for(const c of HBe){const u=my(t.getWithExplicit(c),e.getWithExplicit(c),c,"legend",(f,d)=>{switch(c){case"symbolType":return O7t(f,d);case"title":return Aje(f,d);case"type":return i=!0,Gl("symbol")}return L6(f,d,c,"legend")});t.setWithExplicit(c,u)}return i&&((s=(o=t.implicit)==null?void 0:o.encode)!=null&&s.gradient&&I5(t.implicit,["encode","gradient"]),(l=(a=t.explicit)==null?void 0:a.encode)!=null&&l.gradient&&I5(t.explicit,["encode","gradient"])),t}function O7t(t,e){return e.value==="circle"?e:t}function E7t(t,e,n,r){var i,o;t.encode??(t.encode={}),(i=t.encode)[e]??(i[e]={}),(o=t.encode[e]).update??(o.update={}),t.encode[e].update[n]=r}function ZBe(t){const e=t.component.legends,n={};for(const i of Qe(e)){const o=t.getScaleComponent(i),s=Tr(o.get("domains"));if(n[s])for(const a of n[s])KBe(a,e[i])||n[s].push(e[i]);else n[s]=[e[i].clone()]}return bs(n).flat().map(i=>T7t(i,t.config)).filter(i=>i!==void 0)}function T7t(t,e){var s,a,l;const{disable:n,labelExpr:r,selections:i,...o}=t.combine();if(!n){if(e.aria===!1&&o.aria==null&&(o.aria=!1),(s=o.encode)!=null&&s.symbols){const c=o.encode.symbols.update;c.fill&&c.fill.value!=="transparent"&&!c.stroke&&!o.stroke&&(c.stroke={value:"transparent"});for(const u of G4e)o[u]&&delete c[u]}if(o.title||delete o.title,r!==void 0){let c=r;(l=(a=o.encode)==null?void 0:a.labels)!=null&&l.update&&Mt(o.encode.labels.update.text)&&(c=w1(r,"datum.label",o.encode.labels.update.text.signal)),E7t(o,"labels","text",{signal:c})}return o}}function k7t(t){return zO(t)||cae(t)?A7t(t):JBe(t)}function A7t(t){return t.children.reduce((e,n)=>e.concat(n.assembleProjections()),JBe(t))}function JBe(t){const e=t.component.projection;if(!e||e.merged)return[];const n=e.combine(),{name:r}=n;if(e.data){const i={signal:`[${e.size.map(s=>s.signal).join(", ")}]`},o=e.data.reduce((s,a)=>{const l=Mt(a)?a.signal:`data('${t.lookupDataSource(a)}')`;return Tn(s,l)||s.push(l),s},[]);if(o.length<=0)throw new Error("Projection's fit didn't find any data sources");return[{name:r,size:i,fit:{signal:o.length>1?`[${o.join(", ")}]`:o[0]},...n}]}else return[{name:r,translate:{signal:"[width / 2, height / 2]"},...n}]}const P7t=["type","clipAngle","clipExtent","center","rotate","precision","reflectX","reflectY","coefficient","distance","fraction","lobes","parallel","radius","ratio","spacing","tilt"];class e6e extends rm{constructor(e,n,r,i){super({...n},{name:e}),this.specifiedProjection=n,this.size=r,this.data=i,this.merged=!1}get isFit(){return!!this.data}}function t6e(t){t.component.projection=wi(t)?M7t(t):I7t(t)}function M7t(t){if(t.hasProjection){const e=is(t.specifiedProjection),n=!(e&&(e.scale!=null||e.translate!=null)),r=n?[t.getSizeSignalRef("width"),t.getSizeSignalRef("height")]:void 0,i=n?R7t(t):void 0,o=new e6e(t.projectionName(!0),{...is(t.config.projection),...e},r,i);return o.get("type")||o.set("type","equalEarth",!1),o}}function R7t(t){const e=[],{encoding:n}=t;for(const r of[[ld,ad],[Ru,cd]])(So(n[r[0]])||So(n[r[1]]))&&e.push({signal:t.getName(`geojson_${e.length}`)});return t.channelHasField(El)&&t.typedFieldDef(El).type===IO&&e.push({signal:t.getName(`geojson_${e.length}`)}),e.length===0&&e.push(t.requestDataName(Fi.Main)),e}function D7t(t,e){const n=Qoe(P7t,i=>!!(!vt(t.explicit,i)&&!vt(e.explicit,i)||vt(t.explicit,i)&&vt(e.explicit,i)&&lc(t.get(i),e.get(i))));if(lc(t.size,e.size)){if(n)return t;if(lc(t.explicit,{}))return e;if(lc(e.explicit,{}))return t}return null}function I7t(t){if(t.children.length===0)return;let e;for(const r of t.children)t6e(r);const n=Qoe(t.children,r=>{const i=r.component.projection;if(i)if(e){const o=D7t(e,i);return o&&(e=o),!!o}else return e=i,!0;else return!0});if(e&&n){const r=t.projectionName(!0),i=new e6e(r,e.specifiedProjection,e.size,Kt(e.data));for(const o of t.children){const s=o.component.projection;s&&(s.isFit&&i.data.push(...o.component.projection.data),o.renameProjection(s.get("name"),r),s.merged=!0)}return i}}function L7t(t,e,n,r){if(GR(e,n)){const i=wi(t)?t.axis(n)??t.legend(n)??{}:{},o=ct(e,{expr:"datum"}),s=ct(e,{expr:"datum",binSuffix:"end"});return{formulaAs:ct(e,{binSuffix:"range",forAs:!0}),formula:BR(o,s,i.format,i.formatType,r)}}return{}}function n6e(t,e){return`${wje(t)}_${e}`}function $7t(t,e){return{signal:t.getName(`${e}_bins`),extentSignal:t.getName(`${e}_extent`)}}function iae(t,e,n){const r=A6(n,void 0)??{},i=n6e(r,e);return t.getName(`${i}_bins`)}function F7t(t){return"as"in t}function Vye(t,e,n){let r,i;F7t(t)?r=gt(t.as)?[t.as,`${t.as}_end`]:[t.as[0],t.as[1]]:r=[ct(t,{forAs:!0}),ct(t,{binSuffix:"end",forAs:!0})];const o={...A6(e,void 0)},s=n6e(o,t.field),{signal:a,extentSignal:l}=$7t(n,s);if(y6(o.extent)){const u=o.extent;i=IBe(n,u.param,u),delete o.extent}const c={bin:o,field:t.field,as:[r],...a?{signal:a}:{},...l?{extentSignal:l}:{},...i?{span:i}:{}};return{key:s,binComponent:c}}class bh extends _r{clone(){return new bh(null,Kt(this.bins))}constructor(e,n){super(e),this.bins=n}static makeFromEncoding(e,n){const r=n.reduceFieldDef((i,o,s)=>{if(Ra(o)&&Gr(o.bin)){const{key:a,binComponent:l}=Vye(o,o.bin,n);i[a]={...l,...i[a],...L7t(n,o,s,n.config)}}return i},{});return Er(r)?null:new bh(e,r)}static makeFromTransform(e,n,r){const{key:i,binComponent:o}=Vye(n,n.bin,r);return new bh(e,{[i]:o})}merge(e,n){for(const r of Qe(e.bins))r in this.bins?(n(e.bins[r].signal,this.bins[r].signal),this.bins[r].as=Jd([...this.bins[r].as,...e.bins[r].as],Mn)):this.bins[r]=e.bins[r];for(const r of e.children)e.removeChild(r),r.parent=this;e.remove()}producedFields(){return new Set(bs(this.bins).map(e=>e.as).flat(2))}dependentFields(){return new Set(bs(this.bins).map(e=>e.field))}hash(){return`Bin ${Mn(this.bins)}`}assemble(){return bs(this.bins).flatMap(e=>{const n=[],[r,...i]=e.as,{extent:o,...s}=e.bin,a={type:"bin",field:Mu(e.field),as:r,signal:e.signal,...y6(o)?{extent:null}:{extent:o},...e.span?{span:{signal:`span(${e.span})`}}:{},...s};!o&&e.extentSignal&&(n.push({type:"extent",field:Mu(e.field),signal:e.extentSignal}),a.extent={signal:e.extentSignal}),n.push(a);for(const l of i)for(let c=0;c<2;c++)n.push({type:"formula",expr:ct({field:r[c]},{expr:"datum"}),as:l[c]});return e.formula&&n.push({type:"formula",expr:e.formula,as:e.formulaAs}),n})}}function N7t(t,e,n,r){var o;const i=wi(r)?r.encoding[Qh(e)]:void 0;if(Ra(n)&&wi(r)&&g4e(n,i,r.markDef,r.config)){t.add(ct(n,{})),t.add(ct(n,{suffix:"end"}));const{mark:s,markDef:a,config:l}=r,c=gy({fieldDef:n,markDef:a,config:l});YA(s)&&c!==.5&&Yi(e)&&(t.add(ct(n,{suffix:$6})),t.add(ct(n,{suffix:F6}))),n.bin&&GR(n,e)&&t.add(ct(n,{binSuffix:"range"}))}else if(dje(e)){const s=fje(e);t.add(r.getName(s))}else t.add(ct(n));return xb(n)&&T8t((o=n.scale)==null?void 0:o.range)&&t.add(n.scale.range.field),t}function z7t(t,e){for(const n of Qe(e)){const r=e[n];for(const i of Qe(r))n in t?t[n][i]=new Set([...t[n][i]??[],...r[i]]):t[n]={[i]:r[i]}}}class $f extends _r{clone(){return new $f(null,new Set(this.dimensions),Kt(this.measures))}constructor(e,n,r){super(e),this.dimensions=n,this.measures=r}get groupBy(){return this.dimensions}static makeFromEncoding(e,n){let r=!1;n.forEachFieldDef(s=>{s.aggregate&&(r=!0)});const i={},o=new Set;return!r||(n.forEachFieldDef((s,a)=>{const{aggregate:l,field:c}=s;if(l)if(l==="count")i["*"]??(i["*"]={}),i["*"].count=new Set([ct(s,{forAs:!0})]);else{if(Ng(l)||Jy(l)){const u=Ng(l)?"argmin":"argmax",f=l[u];i[f]??(i[f]={}),i[f][u]=new Set([ct({op:u,field:f},{forAs:!0})])}else i[c]??(i[c]={}),i[c][l]=new Set([ct(s,{forAs:!0})]);Kh(a)&&n.scaleDomain(a)==="unaggregated"&&(i[c]??(i[c]={}),i[c].min=new Set([ct({field:c,aggregate:"min"},{forAs:!0})]),i[c].max=new Set([ct({field:c,aggregate:"max"},{forAs:!0})]))}else N7t(o,a,s,n)}),o.size+Qe(i).length===0)?null:new $f(e,o,i)}static makeFromTransform(e,n){var r;const i=new Set,o={};for(const s of n.aggregate){const{op:a,field:l,as:c}=s;a&&(a==="count"?(o["*"]??(o["*"]={}),o["*"].count=new Set([c||ct(s,{forAs:!0})])):(o[l]??(o[l]={}),(r=o[l])[a]??(r[a]=new Set),o[l][a].add(c||ct(s,{forAs:!0}))))}for(const s of n.groupby??[])i.add(s);return i.size+Qe(o).length===0?null:new $f(e,i,o)}merge(e){return rje(this.dimensions,e.dimensions)?(z7t(this.measures,e.measures),!0):(ZUt("different dimensions, cannot merge"),!1)}addDimensions(e){e.forEach(this.dimensions.add,this.dimensions)}dependentFields(){return new Set([...this.dimensions,...Qe(this.measures)])}producedFields(){const e=new Set;for(const n of Qe(this.measures))for(const r of Qe(this.measures[n])){const i=this.measures[n][r];i.size===0?e.add(`${r}_${n}`):i.forEach(e.add,e)}return e}hash(){return`Aggregate ${Mn({dimensions:this.dimensions,measures:this.measures})}`}assemble(){const e=[],n=[],r=[];for(const o of Qe(this.measures))for(const s of Qe(this.measures[o]))for(const a of this.measures[o][s])r.push(a),e.push(s),n.push(o==="*"?null:Mu(o));return{type:"aggregate",groupby:[...this.dimensions].map(Mu),ops:e,fields:n,as:r}}}class FO extends _r{constructor(e,n,r,i){super(e),this.model=n,this.name=r,this.data=i;for(const o of au){const s=n.facet[o];if(s){const{bin:a,sort:l}=s;this[o]={name:n.getName(`${o}_domain`),fields:[ct(s),...Gr(a)?[ct(s,{binSuffix:"end"})]:[]],...ug(l)?{sortField:l}:We(l)?{sortIndexField:lC(s,o)}:{}}}}this.childModel=n.child}hash(){let e="Facet";for(const n of au)this[n]&&(e+=` ${n.charAt(0)}:${Mn(this[n])}`);return e}get fields(){var n;const e=[];for(const r of au)(n=this[r])!=null&&n.fields&&e.push(...this[r].fields);return e}dependentFields(){const e=new Set(this.fields);for(const n of au)this[n]&&(this[n].sortField&&e.add(this[n].sortField.field),this[n].sortIndexField&&e.add(this[n].sortIndexField));return e}producedFields(){return new Set}getSource(){return this.name}getChildIndependentFieldsWithStep(){const e={};for(const n of tm){const r=this.childModel.component.scales[n];if(r&&!r.merged){const i=r.get("type"),o=r.get("range");if(Wo(i)&&mb(o)){const s=U6(this.childModel,n),a=lae(s);a?e[n]=a:Ze(use(n))}}}return e}assembleRowColumnHeaderData(e,n,r){const i={row:"y",column:"x",facet:void 0}[e],o=[],s=[],a=[];i&&r&&r[i]&&(n?(o.push(`distinct_${r[i]}`),s.push("max")):(o.push(r[i]),s.push("distinct")),a.push(`distinct_${r[i]}`));const{sortField:l,sortIndexField:c}=this[e];if(l){const{op:u=E6,field:f}=l;o.push(f),s.push(u),a.push(ct(l,{forAs:!0}))}else c&&(o.push(c),s.push("max"),a.push(c));return{name:this[e].name,source:n??this.data,transform:[{type:"aggregate",groupby:this[e].fields,...o.length?{fields:o,ops:s,as:a}:{}}]}}assembleFacetHeaderData(e){var l;const{columns:n}=this.model.layout,{layoutHeaders:r}=this.model.component,i=[],o={};for(const c of eae){for(const u of tae){const f=(r[c]&&r[c][u])??[];for(const d of f)if(((l=d.axes)==null?void 0:l.length)>0){o[c]=!0;break}}if(o[c]){const u=`length(data("${this.facet.name}"))`,f=c==="row"?n?{signal:`ceil(${u} / ${n})`}:1:n?{signal:`min(${u}, ${n})`}:{signal:u};i.push({name:`${this.facet.name}_${c}`,transform:[{type:"sequence",start:0,stop:f}]})}}const{row:s,column:a}=o;return(s||a)&&i.unshift(this.assembleRowColumnHeaderData("facet",null,e)),i}assemble(){const e=[];let n=null;const r=this.getChildIndependentFieldsWithStep(),{column:i,row:o,facet:s}=this;if(i&&o&&(r.x||r.y)){n=`cross_${this.column.name}_${this.row.name}`;const a=[].concat(r.x??[],r.y??[]),l=a.map(()=>"distinct");e.push({name:n,source:this.data,transform:[{type:"aggregate",groupby:this.fields,fields:a,ops:l}]})}for(const a of[cg,lg])this[a]&&e.push(this.assembleRowColumnHeaderData(a,n,r));if(s){const a=this.assembleFacetHeaderData(r);a&&e.push(...a)}return e}}function Gye(t){return t.startsWith("'")&&t.endsWith("'")||t.startsWith('"')&&t.endsWith('"')?t.slice(1,-1):t}function j7t(t,e){const n=Joe(t);if(e==="number")return`toNumber(${n})`;if(e==="boolean")return`toBoolean(${n})`;if(e==="string")return`toString(${n})`;if(e==="date")return`toDate(${n})`;if(e==="flatten")return n;if(e.startsWith("date:")){const r=Gye(e.slice(5,e.length));return`timeParse(${n},'${r}')`}else if(e.startsWith("utc:")){const r=Gye(e.slice(4,e.length));return`utcParse(${n},'${r}')`}else return Ze(aUt(e)),null}function B7t(t){const e={};return F3(t.filter,n=>{if(Hje(n)){let r=null;pse(n)?r=nc(n.equal):mse(n)?r=nc(n.lte):gse(n)?r=nc(n.lt):vse(n)?r=nc(n.gt):yse(n)?r=nc(n.gte):xse(n)?r=n.range[0]:bse(n)&&(r=(n.oneOf??n.in)[0]),r&&(vb(r)?e[n.field]="date":Jn(r)?e[n.field]="number":gt(r)&&(e[n.field]="string")),n.timeUnit&&(e[n.field]="date")}}),e}function U7t(t){const e={};function n(r){iC(r)?e[r.field]="date":r.type==="quantitative"&&N6t(r.aggregate)?e[r.field]="number":KS(r.field)>1?r.field in e||(e[r.field]="flatten"):xb(r)&&ug(r.sort)&&KS(r.sort.field)>1&&(r.sort.field in e||(e[r.sort.field]="flatten"))}if((wi(t)||mc(t))&&t.forEachFieldDef((r,i)=>{if(Ra(r))n(r);else{const o=pb(i),s=t.fieldDef(o);n({...r,type:s.type})}}),wi(t)){const{mark:r,markDef:i,encoding:o}=t;if(e0(r)&&!t.encoding.order){const s=i.orient==="horizontal"?"y":"x",a=o[s];Je(a)&&a.type==="quantitative"&&!(a.field in e)&&(e[a.field]="number")}}return e}function W7t(t){const e={};if(wi(t)&&t.component.selection)for(const n of Qe(t.component.selection)){const r=t.component.selection[n];for(const i of r.project.items)!i.channel&&KS(i.field)>1&&(e[i.field]="flatten")}return e}class Qs extends _r{clone(){return new Qs(null,Kt(this._parse))}constructor(e,n){super(e),this._parse=n}hash(){return`Parse ${Mn(this._parse)}`}static makeExplicit(e,n,r){var s;let i={};const o=n.data;return!Wv(o)&&((s=o==null?void 0:o.format)!=null&&s.parse)&&(i=o.format.parse),this.makeWithAncestors(e,i,{},r)}static makeWithAncestors(e,n,r,i){for(const a of Qe(r)){const l=i.getWithExplicit(a);l.value!==void 0&&(l.explicit||l.value===r[a]||l.value==="derived"||r[a]==="flatten"?delete r[a]:Ze(eye(a,r[a],l.value)))}for(const a of Qe(n)){const l=i.get(a);l!==void 0&&(l===n[a]?delete n[a]:Ze(eye(a,n[a],l)))}const o=new rm(n,r);i.copyAll(o);const s={};for(const a of Qe(o.combine())){const l=o.get(a);l!==null&&(s[a]=l)}return Qe(s).length===0||i.parseNothing?null:new Qs(e,s)}get parse(){return this._parse}merge(e){this._parse={...this._parse,...e.parse},e.remove()}assembleFormatParse(){const e={};for(const n of Qe(this._parse)){const r=this._parse[n];KS(n)===1&&(e[n]=r)}return e}producedFields(){return new Set(Qe(this._parse))}dependentFields(){return new Set(Qe(this._parse))}assembleTransforms(e=!1){return Qe(this._parse).filter(n=>e?KS(n)>1:!0).map(n=>{const r=j7t(n,this._parse[n]);return r?{type:"formula",expr:r,as:RO(n)}:null}).filter(n=>n!==null)}}class yy extends _r{clone(){return new yy(null)}constructor(e){super(e)}dependentFields(){return new Set}producedFields(){return new Set([Yf])}hash(){return"Identifier"}assemble(){return{type:"identifier",as:Yf}}}class XR extends _r{clone(){return new XR(null,this.params)}constructor(e,n){super(e),this.params=n}dependentFields(){return new Set}producedFields(){}hash(){return`Graticule ${Mn(this.params)}`}assemble(){return{type:"graticule",...this.params===!0?{}:this.params}}}class YR extends _r{clone(){return new YR(null,this.params)}constructor(e,n){super(e),this.params=n}dependentFields(){return new Set}producedFields(){return new Set([this.params.as??"data"])}hash(){return`Hash ${Mn(this.params)}`}assemble(){return{type:"sequence",...this.params}}}class A1 extends _r{constructor(e){super(null),e??(e={name:"source"});let n;if(Wv(e)||(n=e.format?{...gl(e.format,["parse"])}:{}),QA(e))this._data={values:e.values};else if(oC(e)){if(this._data={url:e.url},!n.type){let r=/(?:\.([^.]+))?$/.exec(e.url)[1];Tn(["json","csv","tsv","dsv","topojson"],r)||(r="json"),n.type=r}}else cBe(e)?this._data={values:[{type:"Sphere"}]}:(aBe(e)||Wv(e))&&(this._data={});this._generator=Wv(e),e.name&&(this._name=e.name),n&&!Er(n)&&(this._data.format=n)}dependentFields(){return new Set}producedFields(){}get data(){return this._data}hasName(){return!!this._name}get isGenerator(){return this._generator}get dataName(){return this._name}set dataName(e){this._name=e}set parent(e){throw new Error("Source nodes have to be roots.")}remove(){throw new Error("Source nodes are roots and cannot be removed.")}hash(){throw new Error("Cannot hash sources")}assemble(){return{name:this._name,...this._data,transform:[]}}}var Hye=function(t,e,n,r,i){if(r==="m")throw new TypeError("Private method is not writable");if(r==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return r==="a"?i.call(t,n):i?i.value=n:e.set(t,n),n},V7t=function(t,e,n,r){if(n==="a"&&!r)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!r:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return n==="m"?r:n==="a"?r.call(t):r?r.value:e.get(t)},_T;function oae(t){return t instanceof A1||t instanceof XR||t instanceof YR}class sae{constructor(){_T.set(this,void 0),Hye(this,_T,!1,"f")}setModified(){Hye(this,_T,!0,"f")}get modifiedFlag(){return V7t(this,_T,"f")}}_T=new WeakMap;class bb extends sae{getNodeDepths(e,n,r){r.set(e,n);for(const i of e.children)this.getNodeDepths(i,n+1,r);return r}optimize(e){const r=[...this.getNodeDepths(e,0,new Map).entries()].sort((i,o)=>o[1]-i[1]);for(const i of r)this.run(i[0]);return this.modifiedFlag}}class aae extends sae{optimize(e){this.run(e);for(const n of e.children)this.optimize(n);return this.modifiedFlag}}class G7t extends aae{mergeNodes(e,n){const r=n.shift();for(const i of n)e.removeChild(i),i.parent=r,i.remove()}run(e){const n=e.children.map(i=>i.hash()),r={};for(let i=0;i1&&(this.setModified(),this.mergeNodes(e,r[i]))}}class H7t extends aae{constructor(e){super(),this.requiresSelectionId=e&&Jse(e)}run(e){e instanceof yy&&(this.requiresSelectionId&&(oae(e.parent)||e.parent instanceof $f||e.parent instanceof Qs)||(this.setModified(),e.remove()))}}class q7t extends sae{optimize(e){return this.run(e,new Set),this.modifiedFlag}run(e,n){let r=new Set;e instanceof xh&&(r=e.producedFields(),Koe(r,n)&&(this.setModified(),e.removeFormulas(n),e.producedFields.length===0&&e.remove()));for(const i of e.children)this.run(i,new Set([...n,...r]))}}class X7t extends aae{constructor(){super()}run(e){e instanceof ml&&!e.isRequired()&&(this.setModified(),e.remove())}}class Y7t extends bb{run(e){if(!oae(e)&&!(e.numChildren()>1)){for(const n of e.children)if(n instanceof Qs)if(e instanceof Qs)this.setModified(),e.merge(n);else{if(Zoe(e.producedFields(),n.dependentFields()))continue;this.setModified(),n.swapWithParent()}}}}class Q7t extends bb{run(e){const n=[...e.children],r=e.children.filter(i=>i instanceof Qs);if(e.numChildren()>1&&r.length>=1){const i={},o=new Set;for(const s of r){const a=s.parse;for(const l of Qe(a))l in i?i[l]!==a[l]&&o.add(l):i[l]=a[l]}for(const s of o)delete i[s];if(!Er(i)){this.setModified();const s=new Qs(e,i);for(const a of n){if(a instanceof Qs)for(const l of Qe(i))delete a.parse[l];e.removeChild(a),a.parent=s,a instanceof Qs&&Qe(a.parse).length===0&&a.remove()}}}}}class K7t extends bb{run(e){e instanceof ml||e.numChildren()>0||e instanceof FO||e instanceof A1||(this.setModified(),e.remove())}}class Z7t extends bb{run(e){const n=e.children.filter(i=>i instanceof xh),r=n.pop();for(const i of n)this.setModified(),r.merge(i)}}class J7t extends bb{run(e){const n=e.children.filter(i=>i instanceof $f),r={};for(const i of n){const o=Mn(i.groupBy);o in r||(r[o]=[]),r[o].push(i)}for(const i of Qe(r)){const o=r[i];if(o.length>1){const s=o.pop();for(const a of o)s.merge(a)&&(e.removeChild(a),a.parent=s,a.remove(),this.setModified())}}}}class eGt extends bb{constructor(e){super(),this.model=e}run(e){const n=!(oae(e)||e instanceof $O||e instanceof Qs||e instanceof yy),r=[],i=[];for(const o of e.children)o instanceof bh&&(n&&!Zoe(e.producedFields(),o.dependentFields())?r.push(o):i.push(o));if(r.length>0){const o=r.pop();for(const s of r)o.merge(s,this.model.renameSignal.bind(this.model));this.setModified(),e instanceof bh?e.merge(o,this.model.renameSignal.bind(this.model)):o.swapWithParent()}if(i.length>1){const o=i.pop();for(const s of i)o.merge(s,this.model.renameSignal.bind(this.model));this.setModified()}}}class tGt extends bb{run(e){const n=[...e.children];if(!QS(n,s=>s instanceof ml)||e.numChildren()<=1)return;const i=[];let o;for(const s of n)if(s instanceof ml){let a=s;for(;a.numChildren()===1;){const[l]=a.children;if(l instanceof ml)a=l;else break}i.push(...a.children),o?(e.removeChild(s),s.parent=o.parent,o.parent.removeChild(o),o.parent=a,this.setModified()):o=a}else i.push(s);if(i.length){this.setModified();for(const s of i)s.parent.removeChild(s),s.parent=o}}}class wb extends _r{clone(){return new wb(null,Kt(this.transform))}constructor(e,n){super(e),this.transform=n}addDimensions(e){this.transform.groupby=Jd(this.transform.groupby.concat(e),n=>n)}dependentFields(){const e=new Set;return this.transform.groupby&&this.transform.groupby.forEach(e.add,e),this.transform.joinaggregate.map(n=>n.field).filter(n=>n!==void 0).forEach(e.add,e),e}producedFields(){return new Set(this.transform.joinaggregate.map(this.getDefaultName))}getDefaultName(e){return e.as??ct(e)}hash(){return`JoinAggregateTransform ${Mn(this.transform)}`}assemble(){const e=[],n=[],r=[];for(const o of this.transform.joinaggregate)n.push(o.op),r.push(this.getDefaultName(o)),e.push(o.field===void 0?null:o.field);const i=this.transform.groupby;return{type:"joinaggregate",as:r,ops:n,fields:e,...i!==void 0?{groupby:i}:{}}}}class uC extends _r{clone(){return new uC(null,{...this.filter})}constructor(e,n){super(e),this.filter=n}static make(e,n,r){const{config:i,markDef:o}=n,{marks:s,scales:a}=r;if(s==="include-invalid-values"&&a==="include-invalid-values")return null;const l=n.reduceFieldDef((c,u,f)=>{const d=Kh(f)&&n.getScaleComponent(f);if(d){const h=d.get("type"),{aggregate:p}=u,g=Tse({scaleChannel:f,markDef:o,config:i,scaleType:h,isCountAggregate:v6(p)});g!=="show"&&g!=="always-valid"&&(c[u.field]=u)}return c},{});return Qe(l).length?new uC(e,l):null}dependentFields(){return new Set(Qe(this.filter))}producedFields(){return new Set}hash(){return`FilterInvalid ${Mn(this.filter)}`}assemble(){const e=Qe(this.filter).reduce((n,r)=>{const i=this.filter[r],o=ct(i,{expr:"datum"});return i!==null&&(i.type==="temporal"?n.push(`(isDate(${o}) || (${jY(o)}))`):i.type==="quantitative"&&n.push(jY(o))),n},[]);return e.length>0?{type:"filter",expr:e.join(" && ")}:null}}function jY(t){return`isValid(${t}) && isFinite(+${t})`}function nGt(t){return t.stack.stackBy.reduce((e,n)=>{const r=n.fieldDef,i=ct(r);return i&&e.push(i),e},[])}function rGt(t){return We(t)&&t.every(e=>gt(e))&&t.length>1}class dg extends _r{clone(){return new dg(null,Kt(this._stack))}constructor(e,n){super(e),this._stack=n}static makeFromTransform(e,n){const{stack:r,groupby:i,as:o,offset:s="zero"}=n,a=[],l=[];if(n.sort!==void 0)for(const f of n.sort)a.push(f.field),l.push(Xi(f.order,"ascending"));const c={field:a,order:l};let u;return rGt(o)?u=o:gt(o)?u=[o,`${o}_end`]:u=[`${n.stack}_start`,`${n.stack}_end`],new dg(e,{dimensionFieldDefs:[],stackField:r,groupby:i,offset:s,sort:c,facetby:[],as:u})}static makeFromEncoding(e,n){const r=n.stack,{encoding:i}=n;if(!r)return null;const{groupbyChannels:o,fieldChannel:s,offset:a,impute:l}=r,c=o.map(h=>{const p=i[h];return Xf(p)}).filter(h=>!!h),u=nGt(n),f=n.encoding.order;let d;if(We(f)||Je(f))d=Eje(f);else{const h=m4e(f)?f.sort:s==="y"?"descending":"ascending";d=u.reduce((p,g)=>(p.field.includes(g)||(p.field.push(g),p.order.push(h)),p),{field:[],order:[]})}return new dg(e,{dimensionFieldDefs:c,stackField:n.vgField(s),facetby:[],stackby:u,sort:d,offset:a,impute:l,as:[n.vgField(s,{suffix:"start",forAs:!0}),n.vgField(s,{suffix:"end",forAs:!0})]})}get stack(){return this._stack}addDimensions(e){this._stack.facetby.push(...e)}dependentFields(){const e=new Set;return e.add(this._stack.stackField),this.getGroupbyFields().forEach(e.add,e),this._stack.facetby.forEach(e.add,e),this._stack.sort.field.forEach(e.add,e),e}producedFields(){return new Set(this._stack.as)}hash(){return`Stack ${Mn(this._stack)}`}getGroupbyFields(){const{dimensionFieldDefs:e,impute:n,groupby:r}=this._stack;return e.length>0?e.map(i=>i.bin?n?[ct(i,{binSuffix:"mid"})]:[ct(i,{}),ct(i,{binSuffix:"end"})]:[ct(i)]).flat():r??[]}assemble(){const e=[],{facetby:n,dimensionFieldDefs:r,stackField:i,stackby:o,sort:s,offset:a,impute:l,as:c}=this._stack;if(l)for(const u of r){const{bandPosition:f=.5,bin:d}=u;if(d){const h=ct(u,{expr:"datum"}),p=ct(u,{expr:"datum",binSuffix:"end"});e.push({type:"formula",expr:`${jY(h)} ? ${f}*${h}+${1-f}*${p} : ${h}`,as:ct(u,{binSuffix:"mid",forAs:!0})})}e.push({type:"impute",field:i,groupby:[...o,...n],key:ct(u,{binSuffix:"mid"}),method:"value",value:0})}return e.push({type:"stack",groupby:[...this.getGroupbyFields(),...n],field:i,sort:s,as:c,offset:a}),e}}class NO extends _r{clone(){return new NO(null,Kt(this.transform))}constructor(e,n){super(e),this.transform=n}addDimensions(e){this.transform.groupby=Jd(this.transform.groupby.concat(e),n=>n)}dependentFields(){const e=new Set;return(this.transform.groupby??[]).forEach(e.add,e),(this.transform.sort??[]).forEach(n=>e.add(n.field)),this.transform.window.map(n=>n.field).filter(n=>n!==void 0).forEach(e.add,e),e}producedFields(){return new Set(this.transform.window.map(this.getDefaultName))}getDefaultName(e){return e.as??ct(e)}hash(){return`WindowTransform ${Mn(this.transform)}`}assemble(){const e=[],n=[],r=[],i=[];for(const f of this.transform.window)n.push(f.op),r.push(this.getDefaultName(f)),i.push(f.param===void 0?null:f.param),e.push(f.field===void 0?null:f.field);const o=this.transform.frame,s=this.transform.groupby;if(o&&o[0]===null&&o[1]===null&&n.every(f=>lse(f)))return{type:"joinaggregate",as:r,ops:n,fields:e,...s!==void 0?{groupby:s}:{}};const a=[],l=[];if(this.transform.sort!==void 0)for(const f of this.transform.sort)a.push(f.field),l.push(f.order??"ascending");const c={field:a,order:l},u=this.transform.ignorePeers;return{type:"window",params:i,as:r,ops:n,fields:e,sort:c,...u!==void 0?{ignorePeers:u}:{},...s!==void 0?{groupby:s}:{},...o!==void 0?{frame:o}:{}}}}function iGt(t){function e(n){if(!(n instanceof FO)){const r=n.clone();if(r instanceof ml){const i=UY+r.getSource();r.setSource(i),t.model.component.data.outputNodes[i]=r}else(r instanceof $f||r instanceof dg||r instanceof NO||r instanceof wb)&&r.addDimensions(t.fields);for(const i of n.children.flatMap(e))i.parent=r;return[r]}return n.children.flatMap(e)}return e}function BY(t){if(t instanceof FO)if(t.numChildren()===1&&!(t.children[0]instanceof ml)){const e=t.children[0];(e instanceof $f||e instanceof dg||e instanceof NO||e instanceof wb)&&e.addDimensions(t.fields),e.swapWithParent(),BY(t)}else{const e=t.model.component.data.main;r6e(e);const n=iGt(t),r=t.children.map(n).flat();for(const i of r)i.parent=e}else t.children.map(BY)}function r6e(t){if(t instanceof ml&&t.type===Fi.Main&&t.numChildren()===1){const e=t.children[0];e instanceof FO||(e.swapWithParent(),r6e(t))}}const UY="scale_",oL=5;function WY(t){for(const e of t){for(const n of e.children)if(n.parent!==e)return!1;if(!WY(e.children))return!1}return!0}function Yu(t,e){let n=!1;for(const r of e)n=t.optimize(r)||n;return n}function qye(t,e,n){let r=t.sources,i=!1;return i=Yu(new X7t,r)||i,i=Yu(new H7t(e),r)||i,r=r.filter(o=>o.numChildren()>0),i=Yu(new K7t,r)||i,r=r.filter(o=>o.numChildren()>0),n||(i=Yu(new Y7t,r)||i,i=Yu(new eGt(e),r)||i,i=Yu(new q7t,r)||i,i=Yu(new Q7t,r)||i,i=Yu(new J7t,r)||i,i=Yu(new Z7t,r)||i,i=Yu(new G7t,r)||i,i=Yu(new tGt,r)||i),t.sources=r,i}function oGt(t,e){WY(t.sources);let n=0,r=0;for(let i=0;ie(n))}}function i6e(t){wi(t)?sGt(t):aGt(t)}function sGt(t){const e=t.component.scales;for(const n of Qe(e)){const r=cGt(t,n);if(e[n].setWithExplicit("domains",r),fGt(t,n),t.component.data.isFaceted){let o=t;for(;!mc(o)&&o.parent;)o=o.parent;if(o.component.resolve.scale[n]==="shared")for(const a of r.value)Zp(a)&&(a.data=UY+a.data.replace(UY,""))}}}function aGt(t){for(const n of t.children)i6e(n);const e=t.component.scales;for(const n of Qe(e)){let r,i=null;for(const o of t.children){const s=o.component.scales[n];if(s){r===void 0?r=s.getWithExplicit("domains"):r=my(r,s.getWithExplicit("domains"),"domains","scale",VY);const a=s.get("selectionExtent");i&&a&&i.param!==a.param&&Ze(rUt),i=a}}e[n].setWithExplicit("domains",r),i&&e[n].set("selectionExtent",i,!0)}}function lGt(t,e,n,r){if(t==="unaggregated"){const{valid:i,reason:o}=Xye(e,n);if(!i){Ze(o);return}}else if(t===void 0&&r.useUnaggregatedDomain){const{valid:i}=Xye(e,n);if(i)return"unaggregated"}return t}function cGt(t,e){const n=t.getScaleComponent(e).get("type"),{encoding:r}=t,i=lGt(t.scaleDomain(e),t.typedFieldDef(e),n,t.config.scale);return i!==t.scaleDomain(e)&&(t.specifiedScales[e]={...t.specifiedScales[e],domain:i}),e==="x"&&So(r.x2)?So(r.x)?my(Im(n,i,t,"x"),Im(n,i,t,"x2"),"domain","scale",VY):Im(n,i,t,"x2"):e==="y"&&So(r.y2)?So(r.y)?my(Im(n,i,t,"y"),Im(n,i,t,"y2"),"domain","scale",VY):Im(n,i,t,"y2"):Im(n,i,t,e)}function uGt(t,e,n){return t.map(r=>({signal:`{data: ${P6(r,{timeUnit:n,type:e})}}`}))}function XV(t,e,n){var i;const r=(i=Uo(n))==null?void 0:i.unit;return e==="temporal"||r?uGt(t,e,r):[t]}function Im(t,e,n,r){const{encoding:i,markDef:o,mark:s,config:a,stack:l}=n,c=So(i[r]),{type:u}=c,f=c.timeUnit,d=i9t({invalid:Rh("invalid",o,a),isPath:e0(s)});if(E8t(e)){const g=Im(t,void 0,n,r),m=XV(e.unionWith,u,f);return Md([...m,...g.value])}else{if(Mt(e))return Md([e]);if(e&&e!=="unaggregated"&&!Jje(e))return Md(XV(e,u,f))}if(l&&r===l.fieldChannel){if(l.offset==="normalize")return Gl([[0,1]]);const g=n.requestDataName(d);return Gl([{data:g,field:n.vgField(r,{suffix:"start"})},{data:g,field:n.vgField(r,{suffix:"end"})}])}const h=Kh(r)&&Je(c)?dGt(n,r,t):void 0;if(Zh(c)){const g=XV([c.datum],u,f);return Gl(g)}const p=c;if(e==="unaggregated"){const{field:g}=c;return Gl([{data:n.requestDataName(d),field:ct({field:g,aggregate:"min"})},{data:n.requestDataName(d),field:ct({field:g,aggregate:"max"})}])}else if(Gr(p.bin)){if(Wo(t))return Gl(t==="bin-ordinal"?[]:[{data:qA(h)?n.requestDataName(d):n.requestDataName(Fi.Raw),field:n.vgField(r,GR(p,r)?{binSuffix:"range"}:{}),sort:h===!0||!ht(h)?{field:n.vgField(r,{}),op:"min"}:h}]);{const{bin:g}=p;if(Gr(g)){const m=iae(n,p.field,g);return Gl([new Do(()=>{const v=n.getSignalName(m);return`[${v}.start, ${v}.stop]`})])}else return Gl([{data:n.requestDataName(d),field:n.vgField(r,{})}])}}else if(p.timeUnit&&Tn(["time","utc"],t)){const g=i[Qh(r)];if(g4e(p,g,o,a)){const m=n.requestDataName(d),v=gy({fieldDef:p,fieldDef2:g,markDef:o,config:a}),y=YA(s)&&v!==.5&&Yi(r);return Gl([{data:m,field:n.vgField(r,y?{suffix:$6}:{})},{data:m,field:n.vgField(r,{suffix:y?F6:"end"})}])}}return Gl(h?[{data:qA(h)?n.requestDataName(d):n.requestDataName(Fi.Raw),field:n.vgField(r),sort:h}]:[{data:n.requestDataName(d),field:n.vgField(r)}])}function YV(t,e){const{op:n,field:r,order:i}=t;return{op:n??(e?"sum":E6),...r?{field:Mu(r)}:{},...i?{order:i}:{}}}function fGt(t,e){var a;const n=t.component.scales[e],r=t.specifiedScales[e].domain,i=(a=t.fieldDef(e))==null?void 0:a.bin,o=Jje(r)?r:void 0,s=gb(i)&&y6(i.extent)?i.extent:void 0;(o||s)&&n.set("selectionExtent",o??s,!0)}function dGt(t,e,n){if(!Wo(n))return;const r=t.fieldDef(e),i=r.sort;if(h4e(i))return{op:"min",field:lC(r,e),order:"ascending"};const{stack:o}=t,s=o?new Set([...o.groupbyFields,...o.stackBy.map(a=>a.fieldDef.field)]):void 0;if(ug(i)){const a=o&&!s.has(i.field);return YV(i,a)}else if(iWt(i)){const{encoding:a,order:l}=i,c=t.fieldDef(a),{aggregate:u,field:f}=c,d=o&&!s.has(f);if(Ng(u)||Jy(u))return YV({field:ct(c),order:l},d);if(lse(u)||!u)return YV({op:u,field:f,order:l},d)}else{if(i==="descending")return{op:"min",field:t.vgField(e),order:"descending"};if(Tn(["ascending",void 0],i))return!0}}function Xye(t,e){const{aggregate:n,type:r}=t;return n?gt(n)&&!j6t.has(n)?{valid:!1,reason:AUt(n)}:r==="quantitative"&&e==="log"?{valid:!1,reason:PUt(t)}:{valid:!0}:{valid:!1,reason:kUt(t)}}function VY(t,e,n,r){return t.explicit&&e.explicit&&Ze(LUt(n,r,t.value,e.value)),{explicit:t.explicit,value:[...t.value,...e.value]}}function hGt(t){const e=Jd(t.map(s=>{if(Zp(s)){const{sort:a,...l}=s;return l}return s}),Mn),n=Jd(t.map(s=>{if(Zp(s)){const a=s.sort;return a!==void 0&&!qA(a)&&("op"in a&&a.op==="count"&&delete a.field,a.order==="ascending"&&delete a.order),a}}).filter(s=>s!==void 0),Mn);if(e.length===0)return;if(e.length===1){const s=t[0];if(Zp(s)&&n.length>0){let a=n[0];if(n.length>1){Ze(nye);const l=n.filter(c=>ht(c)&&"op"in c&&c.op!=="min");n.every(c=>ht(c)&&"op"in c)&&l.length===1?a=l[0]:a=!0}else if(ht(a)&&"field"in a){const l=a.field;s.field===l&&(a=a.order?{order:a.order}:!0)}return{...s,sort:a}}return s}const r=Jd(n.map(s=>qA(s)||!("op"in s)||gt(s.op)&&vt($6t,s.op)?s:(Ze(FUt(s)),!0)),Mn);let i;r.length===1?i=r[0]:r.length>1&&(Ze(nye),i=!0);const o=Jd(t.map(s=>Zp(s)?s.data:null),s=>s);return o.length===1&&o[0]!==null?{data:o[0],fields:e.map(a=>a.field),...i?{sort:i}:{}}:{fields:e,...i?{sort:i}:{}}}function lae(t){if(Zp(t)&>(t.field))return t.field;if(B6t(t)){let e;for(const n of t.fields)if(Zp(n)&>(n.field)){if(!e)e=n.field;else if(e!==n.field)return Ze(NUt),e}return Ze(zUt),e}else if(U6t(t)){Ze(jUt);const e=t.fields[0];return gt(e)?e:void 0}}function U6(t,e){const r=t.component.scales[e].get("domains").map(i=>(Zp(i)&&(i.data=t.lookupDataSource(i.data)),i));return hGt(r)}function o6e(t){return zO(t)||cae(t)?t.children.reduce((e,n)=>e.concat(o6e(n)),Yye(t)):Yye(t)}function Yye(t){return Qe(t.component.scales).reduce((e,n)=>{const r=t.component.scales[n];if(r.merged)return e;const i=r.combine(),{name:o,type:s,selectionExtent:a,domains:l,range:c,reverse:u,...f}=i,d=pGt(i.range,o,n,t),h=U6(t,n),p=a?u9t(t,a,r,h):null;return e.push({name:o,type:s,...h?{domain:h}:{},...p?{domainRaw:p}:{},range:d,...u!==void 0?{reverse:u}:{},...f}),e},[])}function pGt(t,e,n,r){if(Yi(n)){if(mb(t))return{step:{signal:`${e}_step`}}}else if(ht(t)&&Zp(t))return{...t,data:r.lookupDataSource(t.data)};return t}class s6e extends rm{constructor(e,n){super({},{name:e}),this.merged=!1,this.setWithExplicit("type",n)}domainHasZero(){const e=this.get("type");if(Tn([os.LOG,os.TIME,os.UTC],e))return"definitely-not";const n=this.get("zero");if(n===!0||n===void 0&&Tn([os.LINEAR,os.SQRT,os.POW],e))return"definitely";const r=this.get("domains");if(r.length>0){let i=!1,o=!1,s=!1;for(const a of r){if(We(a)){const l=a[0],c=a[a.length-1];if(Jn(l)&&Jn(c))if(l<=0&&c>=0){i=!0;continue}else{o=!0;continue}}s=!0}if(i)return"definitely";if(o&&!s)return"definitely-not"}return"maybe"}}const gGt=["range","scheme"];function mGt(t){const e=t.component.scales;for(const n of ase){const r=e[n];if(!r)continue;const i=vGt(n,t);r.setWithExplicit("range",i)}}function Qye(t,e){const n=t.fieldDef(e);if(n!=null&&n.bin){const{bin:r,field:i}=n,o=Tl(e),s=t.getName(o);if(ht(r)&&r.binned&&r.step!==void 0)return new Do(()=>{const a=t.scaleName(e),l=`(domain("${a}")[1] - domain("${a}")[0]) / ${r.step}`;return`${t.getSignalName(s)} / (${l})`});if(Gr(r)){const a=iae(t,i,r);return new Do(()=>{const l=t.getSignalName(a),c=`(${l}.stop - ${l}.start) / ${l}.step`;return`${t.getSignalName(s)} / (${c})`})}}}function vGt(t,e){const n=e.specifiedScales[t],{size:r}=e,o=e.getScaleComponent(t).get("type");for(const f of gGt)if(n[f]!==void 0){const d=EY(o,f),h=e4e(t,f);if(!d)Ze(Dje(o,f,t));else if(h)Ze(h);else switch(f){case"range":{const p=n.range;if(We(p)){if(Yi(t))return Md(p.map(g=>{if(g==="width"||g==="height"){const m=e.getName(g),v=e.getSignalName.bind(e);return Do.fromName(v,m)}return g}))}else if(ht(p))return Md({data:e.requestDataName(Fi.Main),field:p.field,sort:{op:"min",field:e.vgField(t)}});return Md(p)}case"scheme":return Md(yGt(n[f]))}}const s=t===vi||t==="xOffset"?"width":"height",a=r[s];if(Ih(a)){if(Yi(t))if(Wo(o)){const f=l6e(a,e,t);if(f)return Md({step:f})}else Ze(Ije(s));else if(NR(t)){const f=t===Xy?"x":"y";if(e.getScaleComponent(f).get("type")==="band"){const p=c6e(a,o);if(p)return Md(p)}}}const{rangeMin:l,rangeMax:c}=n,u=xGt(t,e);return(l!==void 0||c!==void 0)&&EY(o,"rangeMin")&&We(u)&&u.length===2?Md([l??u[0],c??u[1]]):Gl(u)}function yGt(t){return O8t(t)?{scheme:t.name,...gl(t,["name"])}:{scheme:t}}function a6e(t,e,n,{center:r}={}){const i=Tl(t),o=e.getName(i),s=e.getSignalName.bind(e);return t===Yo&&Hf(n)?r?[Do.fromName(a=>`${s(a)}/2`,o),Do.fromName(a=>`-${s(a)}/2`,o)]:[Do.fromName(s,o),0]:r?[Do.fromName(a=>`-${s(a)}/2`,o),Do.fromName(a=>`${s(a)}/2`,o)]:[0,Do.fromName(s,o)]}function xGt(t,e){const{size:n,config:r,mark:i,encoding:o}=e,{type:s}=So(o[t]),l=e.getScaleComponent(t).get("type"),{domain:c,domainMid:u}=e.specifiedScales[t];switch(t){case vi:case Yo:{if(Tn(["point","band"],l)){const f=u6e(t,n,r.view);if(Ih(f))return{step:l6e(f,e,t)}}return a6e(t,e,l)}case Xy:case DO:return bGt(t,e,l);case Jg:{const f=SGt(i,r),d=CGt(i,n,e,r);return tC(l)?_Gt(f,d,wGt(l,r,c,t)):[f,d]}case ju:return[0,Math.PI*2];case hb:return[0,360];case sd:return[0,new Do(()=>{const f=e.getSignalName(mc(e.parent)?"child_width":"width"),d=e.getSignalName(mc(e.parent)?"child_height":"height");return`min(${f},${d})/2`})];case Ky:return[r.scale.minStrokeWidth,r.scale.maxStrokeWidth];case Zy:return[[1,0],[4,2],[2,1],[1,1],[1,2,4,2]];case El:return"symbol";case Ol:case Xh:case Yh:return l==="ordinal"?s==="nominal"?"category":"ordinal":u!==void 0?"diverging":i==="rect"||i==="geoshape"?"heatmap":"ramp";case em:case Yy:case Qy:return[r.scale.minOpacity,r.scale.maxOpacity]}}function l6e(t,e,n){const{encoding:r}=e,i=e.getScaleComponent(n),o=rse(n),s=r[o];if(q4e({step:t,offsetIsDiscrete:en(s)&&Xje(s.type)})==="offset"&&T4e(r,o)){const l=e.getScaleComponent(o);let u=`domain('${e.scaleName(o)}').length`;if(l.get("type")==="band"){const d=l.get("paddingInner")??l.get("padding")??0,h=l.get("paddingOuter")??l.get("padding")??0;u=`bandspace(${u}, ${d}, ${h})`}const f=i.get("paddingInner")??i.get("padding");return{signal:`${t.step} * ${u} / (1-${H6t(f)})`}}else return t.step}function c6e(t,e){if(q4e({step:t,offsetIsDiscrete:Wo(e)})==="offset")return{step:t.step}}function bGt(t,e,n){const r=t===Xy?"x":"y",i=e.getScaleComponent(r);if(!i)return a6e(r,e,n,{center:!0});const o=i.get("type"),s=e.scaleName(r),{markDef:a,config:l}=e;if(o==="band"){const c=u6e(r,e.size,e.config.view);if(Ih(c)){const u=c6e(c,n);if(u)return u}return[0,{signal:`bandwidth('${s}')`}]}else{const c=e.encoding[r];if(Je(c)&&c.timeUnit){const u=Vje(c.timeUnit,p=>`scale('${s}', ${p})`),f=e.config.scale.bandWithNestedOffsetPaddingInner,d=gy({fieldDef:c,markDef:a,config:l})-.5,h=d!==0?` + ${d}`:"";if(f){const p=Mt(f)?`${f.signal}/2`+h:`${f/2+d}`,g=Mt(f)?`(1 - ${f.signal}/2)`+h:`${1-f/2+d}`;return[{signal:`${p} * (${u})`},{signal:`${g} * (${u})`}]}return[0,{signal:u}]}return tje(`Cannot use ${t} scale if ${r} scale is not discrete.`)}}function u6e(t,e,n){const r=t===vi?"width":"height",i=e[r];return i||W5(n,r)}function wGt(t,e,n,r){switch(t){case"quantile":return e.scale.quantileCount;case"quantize":return e.scale.quantizeCount;case"threshold":return n!==void 0&&We(n)?n.length+1:(Ze(YUt(r)),3)}}function _Gt(t,e,n){const r=()=>{const i=Tf(e),o=Tf(t),s=`(${i} - ${o}) / (${n} - 1)`;return`sequence(${o}, ${i} + ${s}, ${s})`};return Mt(e)?new Do(r):{signal:r()}}function SGt(t,e){switch(t){case"bar":case"tick":return e.scale.minBandSize;case"line":case"trail":case"rule":return e.scale.minStrokeWidth;case"text":return e.scale.minFontSize;case"point":case"square":case"circle":return e.scale.minSize}throw new Error(x6("size",t))}const Kye=.95;function CGt(t,e,n,r){const i={x:Qye(n,"x"),y:Qye(n,"y")};switch(t){case"bar":case"tick":{if(r.scale.maxBandSize!==void 0)return r.scale.maxBandSize;const o=Zye(e,i,r.view);return Jn(o)?o-1:new Do(()=>`${o.signal} - 1`)}case"line":case"trail":case"rule":return r.scale.maxStrokeWidth;case"text":return r.scale.maxFontSize;case"point":case"square":case"circle":{if(r.scale.maxSize)return r.scale.maxSize;const o=Zye(e,i,r.view);return Jn(o)?Math.pow(Kye*o,2):new Do(()=>`pow(${Kye} * ${o.signal}, 2)`)}}throw new Error(x6("size",t))}function Zye(t,e,n){const r=Ih(t.width)?t.width.step:PY(n,"width"),i=Ih(t.height)?t.height.step:PY(n,"height");return e.x||e.y?new Do(()=>`min(${[e.x?e.x.signal:r,e.y?e.y.signal:i].join(", ")})`):Math.min(r,i)}function f6e(t,e){wi(t)?OGt(t,e):h6e(t,e)}function OGt(t,e){const n=t.component.scales,{config:r,encoding:i,markDef:o,specifiedScales:s}=t;for(const a of Qe(n)){const l=s[a],c=n[a],u=t.getScaleComponent(a),f=So(i[a]),d=l[e],h=u.get("type"),p=u.get("padding"),g=u.get("paddingInner"),m=EY(h,e),v=e4e(a,e);if(d!==void 0&&(m?v&&Ze(v):Ze(Dje(h,e,a))),m&&v===void 0)if(d!==void 0){const y=f.timeUnit,x=f.type;switch(e){case"domainMax":case"domainMin":vb(l[e])||x==="temporal"||y?c.set(e,{signal:P6(l[e],{type:x,timeUnit:y})},!0):c.set(e,l[e],!0);break;default:c.copyKeyFromObject(e,l)}}else{const y=Ke(Jye,e)?Jye[e]({model:t,channel:a,fieldOrDatumDef:f,scaleType:h,scalePadding:p,scalePaddingInner:g,domain:l.domain,domainMin:l.domainMin,domainMax:l.domainMax,markDef:o,config:r,hasNestedOffsetScale:k4e(i,a),hasSecondaryRangeChannel:!!i[Qh(a)]}):r.scale[e];y!==void 0&&c.set(e,y,!1)}}}const Jye={bins:({model:t,fieldOrDatumDef:e})=>Je(e)?EGt(t,e):void 0,interpolate:({channel:t,fieldOrDatumDef:e})=>TGt(t,e.type),nice:({scaleType:t,channel:e,domain:n,domainMin:r,domainMax:i,fieldOrDatumDef:o})=>kGt(t,e,n,r,i,o),padding:({channel:t,scaleType:e,fieldOrDatumDef:n,markDef:r,config:i})=>AGt(t,e,i.scale,n,r,i.bar),paddingInner:({scalePadding:t,channel:e,markDef:n,scaleType:r,config:i,hasNestedOffsetScale:o})=>PGt(t,e,n.type,r,i.scale,o),paddingOuter:({scalePadding:t,channel:e,scaleType:n,scalePaddingInner:r,config:i,hasNestedOffsetScale:o})=>MGt(t,e,n,r,i.scale,o),reverse:({fieldOrDatumDef:t,scaleType:e,channel:n,config:r})=>{const i=Je(t)?t.sort:void 0;return RGt(e,i,n,r.scale)},zero:({channel:t,fieldOrDatumDef:e,domain:n,markDef:r,scaleType:i,config:o,hasSecondaryRangeChannel:s})=>DGt(t,e,n,r,i,o.scale,s)};function d6e(t){wi(t)?mGt(t):h6e(t,"range")}function h6e(t,e){const n=t.component.scales;for(const r of t.children)e==="range"?d6e(r):f6e(r,e);for(const r of Qe(n)){let i;for(const o of t.children){const s=o.component.scales[r];if(s){const a=s.getWithExplicit(e);i=my(i,a,e,"scale",sBe((l,c)=>{switch(e){case"range":return l.step&&c.step?l.step-c.step:0}return 0}))}}n[r].setWithExplicit(e,i)}}function EGt(t,e){const n=e.bin;if(Gr(n)){const r=iae(t,e.field,n);return new Do(()=>t.getSignalName(r))}else if(ns(n)&&gb(n)&&n.step!==void 0)return{step:n.step}}function TGt(t,e){if(Tn([Ol,Xh,Yh],t)&&e!=="nominal")return"hcl"}function kGt(t,e,n,r,i,o){var s;if(!((s=Xf(o))!=null&&s.bin||We(n)||i!=null||r!=null||Tn([os.TIME,os.UTC],t)))return Yi(e)?!0:void 0}function AGt(t,e,n,r,i,o){if(Yi(t)){if(eh(e)){if(n.continuousPadding!==void 0)return n.continuousPadding;const{type:s,orient:a}=i;if(s==="bar"&&!(Je(r)&&(r.bin||r.timeUnit))&&(a==="vertical"&&t==="x"||a==="horizontal"&&t==="y"))return o.continuousBandSize}if(e===os.POINT)return n.pointPadding}}function PGt(t,e,n,r,i,o=!1){if(t===void 0){if(Yi(e)){const{bandPaddingInner:s,barBandPaddingInner:a,rectBandPaddingInner:l,tickBandPaddingInner:c,bandWithNestedOffsetPaddingInner:u}=i;return o?u:Xi(s,n==="bar"?a:n==="tick"?c:l)}else if(NR(e)&&r===os.BAND)return i.offsetBandPaddingInner}}function MGt(t,e,n,r,i,o=!1){if(t===void 0){if(Yi(e)){const{bandPaddingOuter:s,bandWithNestedOffsetPaddingOuter:a}=i;if(o)return a;if(n===os.BAND)return Xi(s,Mt(r)?{signal:`${r.signal}/2`}:r/2)}else if(NR(e)){if(n===os.POINT)return .5;if(n===os.BAND)return i.offsetBandPaddingOuter}}}function RGt(t,e,n,r){if(n==="x"&&r.xReverse!==void 0)return Hf(t)&&e==="descending"?Mt(r.xReverse)?{signal:`!${r.xReverse.signal}`}:!r.xReverse:r.xReverse;if(Hf(t)&&e==="descending")return!0}function DGt(t,e,n,r,i,o,s){if(!!n&&n!=="unaggregated"&&Hf(i)){if(We(n)){const l=n[0],c=n[n.length-1];if(Jn(l)&&l<=0&&Jn(c)&&c>=0)return!0}return!1}if(t==="size"&&e.type==="quantitative"&&!tC(i))return!0;if(!(Je(e)&&e.bin)&&Tn([...tm,...k6t],t)){const{orient:l,type:c}=r;return Tn(["bar","area","line","trail"],c)&&(l==="horizontal"&&t==="y"||l==="vertical"&&t==="x")?!1:Tn(["bar","area"],c)&&!s?!0:o==null?void 0:o.zero}return!1}function IGt(t,e,n,r,i=!1){const o=LGt(e,n,r,i),{type:s}=t;return Kh(e)?s!==void 0?R8t(e,s)?Je(n)&&!M8t(s,n.type)?(Ze(DUt(s,o)),o):s:(Ze(RUt(e,s,o)),o):o:null}function LGt(t,e,n,r){var i;switch(e.type){case"nominal":case"ordinal":{if(z_(t)||zV(t)==="discrete")return t==="shape"&&e.type==="ordinal"&&Ze(jV(t,"ordinal")),"ordinal";if(Yi(t)||NR(t)){if(Tn(["rect","bar","image","rule","tick"],n.type)||r)return"band"}else if(n.type==="arc"&&t in sse)return"band";const o=n[Tl(t)];return O1(o)||rC(e)&&((i=e.axis)!=null&&i.tickBand)?"band":"point"}case"temporal":return z_(t)?"time":zV(t)==="discrete"?(Ze(jV(t,"temporal")),"ordinal"):Je(e)&&e.timeUnit&&Uo(e.timeUnit).utc?"utc":"time";case"quantitative":return z_(t)?Je(e)&&Gr(e.bin)?"bin-ordinal":"linear":zV(t)==="discrete"?(Ze(jV(t,"quantitative")),"ordinal"):"linear";case"geojson":return}throw new Error(Mje(e.type))}function $Gt(t,{ignoreRange:e}={}){p6e(t),i6e(t);for(const n of P8t)f6e(t,n);e||d6e(t)}function p6e(t){wi(t)?t.component.scales=FGt(t):t.component.scales=zGt(t)}function FGt(t){const{encoding:e,mark:n,markDef:r}=t,i={};for(const o of ase){const s=So(e[o]);if(s&&n===r4e&&o===El&&s.type===IO)continue;let a=s&&s.scale;if(s&&a!==null&&a!==!1){a??(a={});const l=k4e(e,o),c=IGt(a,o,s,r,l);i[o]=new s6e(t.scaleName(`${o}`,!0),{value:c,explicit:a.type===c})}}return i}const NGt=sBe((t,e)=>iye(t)-iye(e));function zGt(t){var e;const n=t.component.scales={},r={},i=t.component.resolve;for(const o of t.children){p6e(o);for(const s of Qe(o.component.scales))if((e=i.scale)[s]??(e[s]=GBe(s,t)),i.scale[s]==="shared"){const a=r[s],l=o.component.scales[s].getWithExplicit("type");a?b8t(a.value,l.value)?r[s]=my(a,l,"type","scale",NGt):(i.scale[s]="independent",delete r[s]):r[s]=l}}for(const o of Qe(r)){const s=t.scaleName(o,!0),a=r[o];n[o]=new s6e(s,a);for(const l of t.children){const c=l.component.scales[o];c&&(l.renameScale(c.get("name"),s),c.merged=!0)}}return n}class QV{constructor(){this.nameMap={}}rename(e,n){this.nameMap[e]=n}has(e){return this.nameMap[e]!==void 0}get(e){for(;this.nameMap[e]&&e!==this.nameMap[e];)e=this.nameMap[e];return e}}function wi(t){return(t==null?void 0:t.type)==="unit"}function mc(t){return(t==null?void 0:t.type)==="facet"}function cae(t){return(t==null?void 0:t.type)==="concat"}function zO(t){return(t==null?void 0:t.type)==="layer"}class uae{constructor(e,n,r,i,o,s,a){this.type=n,this.parent=r,this.config=o,this.correctDataNames=l=>{var c,u,f;return(c=l.from)!=null&&c.data&&(l.from.data=this.lookupDataSource(l.from.data)),(f=(u=l.from)==null?void 0:u.facet)!=null&&f.data&&(l.from.facet.data=this.lookupDataSource(l.from.facet.data)),l},this.parent=r,this.config=o,this.view=is(a),this.name=e.name??i,this.title=Km(e.title)?{text:e.title}:e.title?is(e.title):void 0,this.scaleNameMap=r?r.scaleNameMap:new QV,this.projectionNameMap=r?r.projectionNameMap:new QV,this.signalNameMap=r?r.signalNameMap:new QV,this.data=e.data,this.description=e.description,this.transforms=HVt(e.transform??[]),this.layout=n==="layer"||n==="unit"?{}:QWt(e,n,o),this.component={data:{sources:r?r.component.data.sources:[],outputNodes:r?r.component.data.outputNodes:{},outputNodeRefCounts:r?r.component.data.outputNodeRefCounts:{},isFaceted:T6(e)||(r==null?void 0:r.component.data.isFaceted)&&e.data===void 0},layoutSize:new rm,layoutHeaders:{row:{},column:{},facet:{}},mark:null,resolve:{scale:{},axis:{},legend:{},...s?Kt(s):{}},selection:null,scales:null,projection:null,axes:{},legends:{}}}get width(){return this.getSizeSignalRef("width")}get height(){return this.getSizeSignalRef("height")}parse(){this.parseScale(),this.parseLayoutSize(),this.renameTopLevelLayoutSizeSignal(),this.parseSelections(),this.parseProjection(),this.parseData(),this.parseAxesAndHeaders(),this.parseLegends(),this.parseMarkGroup()}parseScale(){$Gt(this)}parseProjection(){t6e(this)}renameTopLevelLayoutSizeSignal(){this.getName("width")!=="width"&&this.renameSignal(this.getName("width"),"width"),this.getName("height")!=="height"&&this.renameSignal(this.getName("height"),"height")}parseLegends(){QBe(this)}assembleEncodeFromView(e){const{style:n,...r}=e,i={};for(const o of Qe(r)){const s=r[o];s!==void 0&&(i[o]=Jr(s))}return i}assembleGroupEncodeEntry(e){let n={};return this.view&&(n=this.assembleEncodeFromView(this.view)),!e&&(this.description&&(n.description=Jr(this.description)),this.type==="unit"||this.type==="layer")?{width:this.getSizeSignalRef("width"),height:this.getSizeSignalRef("height"),...n}:Er(n)?void 0:n}assembleLayout(){if(!this.layout)return;const{spacing:e,...n}=this.layout,{component:r,config:i}=this,o=o7t(r.layoutHeaders,i);return{padding:e,...this.assembleDefaultLayout(),...n,...o?{titleBand:o}:{}}}assembleDefaultLayout(){return{}}assembleHeaderMarks(){const{layoutHeaders:e}=this.component;let n=[];for(const r of au)e[r].title&&n.push(J9t(this,r));for(const r of eae)n=n.concat(e7t(this,r));return n}assembleAxes(){return j9t(this.component.axes,this.config)}assembleLegends(){return ZBe(this)}assembleProjections(){return k7t(this)}assembleTitle(){const{encoding:e,...n}=this.title??{},r={..._je(this.config.title).nonMarkTitleProperties,...n,...e?{encode:{update:e}}:{}};if(r.text)return Tn(["unit","layer"],this.type)?Tn(["middle",void 0],r.anchor)&&(r.frame??(r.frame="group")):r.anchor??(r.anchor="start"),Er(r)?void 0:r}assembleGroup(e=[]){const n={};e=e.concat(this.assembleSignals()),e.length>0&&(n.signals=e);const r=this.assembleLayout();r&&(n.layout=r),n.marks=[].concat(this.assembleHeaderMarks(),this.assembleMarks());const i=!this.parent||mc(this.parent)?o6e(this):[];i.length>0&&(n.scales=i);const o=this.assembleAxes();o.length>0&&(n.axes=o);const s=this.assembleLegends();return s.length>0&&(n.legends=s),n}getName(e){return hi((this.name?`${this.name}_`:"")+e)}getDataName(e){return this.getName(Fi[e].toLowerCase())}requestDataName(e){const n=this.getDataName(e),r=this.component.data.outputNodeRefCounts;return r[n]=(r[n]||0)+1,n}getSizeSignalRef(e){if(mc(this.parent)){const n=WBe(e),r=m6(n),i=this.component.scales[r];if(i&&!i.merged){const o=i.get("type"),s=i.get("range");if(Wo(o)&&mb(s)){const a=i.get("name"),l=U6(this,r),c=lae(l);if(c){const u=ct({aggregate:"distinct",field:c},{expr:"datum"});return{signal:UBe(a,i,u)}}else return Ze(use(r)),null}}}return{signal:this.signalNameMap.get(this.getName(e))}}lookupDataSource(e){const n=this.component.data.outputNodes[e];return n?n.getSource():e}getSignalName(e){return this.signalNameMap.get(e)}renameSignal(e,n){this.signalNameMap.rename(e,n)}renameScale(e,n){this.scaleNameMap.rename(e,n)}renameProjection(e,n){this.projectionNameMap.rename(e,n)}scaleName(e,n){if(n)return this.getName(e);if(pje(e)&&Kh(e)&&this.component.scales[e]||this.scaleNameMap.has(this.getName(e)))return this.scaleNameMap.get(this.getName(e))}projectionName(e){if(e)return this.getName("projection");if(this.component.projection&&!this.component.projection.merged||this.projectionNameMap.has(this.getName("projection")))return this.projectionNameMap.get(this.getName("projection"))}getScaleComponent(e){if(!this.component.scales)throw new Error("getScaleComponent cannot be called before parseScale(). Make sure you have called parseScale or use parseUnitModelWithScale().");const n=this.component.scales[e];return n&&!n.merged?n:this.parent?this.parent.getScaleComponent(e):void 0}getScaleType(e){const n=this.getScaleComponent(e);return n?n.get("type"):void 0}getSelectionComponent(e,n){let r=this.component.selection[e];if(!r&&this.parent&&(r=this.parent.getSelectionComponent(e,n)),!r)throw new Error(K6t(n));return r}hasAxisOrientSignalRef(){var e,n;return((e=this.component.axes.x)==null?void 0:e.some(r=>r.hasOrientSignalRef()))||((n=this.component.axes.y)==null?void 0:n.some(r=>r.hasOrientSignalRef()))}}class g6e extends uae{vgField(e,n={}){const r=this.fieldDef(e);if(r)return ct(r,n)}reduceFieldDef(e,n){return OWt(this.getMapping(),(r,i,o)=>{const s=Xf(i);return s?e(r,s,o):r},n)}forEachFieldDef(e,n){$se(this.getMapping(),(r,i)=>{const o=Xf(r);o&&e(o,i)},n)}}class W6 extends _r{clone(){return new W6(null,Kt(this.transform))}constructor(e,n){super(e),this.transform=n,this.transform=Kt(n);const r=this.transform.as??[void 0,void 0];this.transform.as=[r[0]??"value",r[1]??"density"];const i=this.transform.resolve??"shared";this.transform.resolve=i}dependentFields(){return new Set([this.transform.density,...this.transform.groupby??[]])}producedFields(){return new Set(this.transform.as)}hash(){return`DensityTransform ${Mn(this.transform)}`}assemble(){const{density:e,...n}=this.transform,r={type:"kde",field:e,...n};return r.resolve=this.transform.resolve,r}}class V6 extends _r{clone(){return new V6(null,Kt(this.transform))}constructor(e,n){super(e),this.transform=n,this.transform=Kt(n)}dependentFields(){return new Set([this.transform.extent])}producedFields(){return new Set([])}hash(){return`ExtentTransform ${Mn(this.transform)}`}assemble(){const{extent:e,param:n}=this.transform;return{type:"extent",field:e,signal:n}}}class G6 extends _r{clone(){return new G6(this.parent,Kt(this.transform))}constructor(e,n){super(e),this.transform=n,this.transform=Kt(n);const{flatten:r,as:i=[]}=this.transform;this.transform.as=r.map((o,s)=>i[s]??o)}dependentFields(){return new Set(this.transform.flatten)}producedFields(){return new Set(this.transform.as)}hash(){return`FlattenTransform ${Mn(this.transform)}`}assemble(){const{flatten:e,as:n}=this.transform;return{type:"flatten",fields:e,as:n}}}class H6 extends _r{clone(){return new H6(null,Kt(this.transform))}constructor(e,n){super(e),this.transform=n,this.transform=Kt(n);const r=this.transform.as??[void 0,void 0];this.transform.as=[r[0]??"key",r[1]??"value"]}dependentFields(){return new Set(this.transform.fold)}producedFields(){return new Set(this.transform.as)}hash(){return`FoldTransform ${Mn(this.transform)}`}assemble(){const{fold:e,as:n}=this.transform;return{type:"fold",fields:e,as:n}}}class U_ extends _r{clone(){return new U_(null,Kt(this.fields),this.geojson,this.signal)}static parseAll(e,n){if(n.component.projection&&!n.component.projection.isFit)return e;let r=0;for(const i of[[ld,ad],[Ru,cd]]){const o=i.map(s=>{const a=So(n.encoding[s]);return Je(a)?a.field:Zh(a)?{expr:`${a.datum}`}:qf(a)?{expr:`${a.value}`}:void 0});(o[0]||o[1])&&(e=new U_(e,o,null,n.getName(`geojson_${r++}`)))}if(n.channelHasField(El)){const i=n.typedFieldDef(El);i.type===IO&&(e=new U_(e,null,i.field,n.getName(`geojson_${r++}`)))}return e}constructor(e,n,r,i){super(e),this.fields=n,this.geojson=r,this.signal=i}dependentFields(){const e=(this.fields??[]).filter(gt);return new Set([...this.geojson?[this.geojson]:[],...e])}producedFields(){return new Set}hash(){return`GeoJSON ${this.geojson} ${this.signal} ${Mn(this.fields)}`}assemble(){return[...this.geojson?[{type:"filter",expr:`isValid(datum["${this.geojson}"])`}]:[],{type:"geojson",...this.fields?{fields:this.fields}:{},...this.geojson?{geojson:this.geojson}:{},signal:this.signal}]}}class KA extends _r{clone(){return new KA(null,this.projection,Kt(this.fields),Kt(this.as))}constructor(e,n,r,i){super(e),this.projection=n,this.fields=r,this.as=i}static parseAll(e,n){if(!n.projectionName())return e;for(const r of[[ld,ad],[Ru,cd]]){const i=r.map(s=>{const a=So(n.encoding[s]);return Je(a)?a.field:Zh(a)?{expr:`${a.datum}`}:qf(a)?{expr:`${a.value}`}:void 0}),o=r[0]===Ru?"2":"";(i[0]||i[1])&&(e=new KA(e,n.projectionName(),i,[n.getName(`x${o}`),n.getName(`y${o}`)]))}return e}dependentFields(){return new Set(this.fields.filter(gt))}producedFields(){return new Set(this.as)}hash(){return`Geopoint ${this.projection} ${Mn(this.fields)} ${Mn(this.as)}`}assemble(){return{type:"geopoint",projection:this.projection,fields:this.fields,as:this.as}}}class Vx extends _r{clone(){return new Vx(null,Kt(this.transform))}constructor(e,n){super(e),this.transform=n}dependentFields(){return new Set([this.transform.impute,this.transform.key,...this.transform.groupby??[]])}producedFields(){return new Set([this.transform.impute])}processSequence(e){const{start:n=0,stop:r,step:i}=e;return{signal:`sequence(${[n,r,...i?[i]:[]].join(",")})`}}static makeFromTransform(e,n){return new Vx(e,n)}static makeFromEncoding(e,n){const r=n.encoding,i=r.x,o=r.y;if(Je(i)&&Je(o)){const s=i.impute?i:o.impute?o:void 0;if(s===void 0)return;const a=i.impute?o:o.impute?i:void 0,{method:l,value:c,frame:u,keyvals:f}=s.impute,d=M4e(n.mark,r);return new Vx(e,{impute:s.field,key:a.field,...l?{method:l}:{},...c!==void 0?{value:c}:{},...u?{frame:u}:{},...f!==void 0?{keyvals:f}:{},...d.length?{groupby:d}:{}})}return null}hash(){return`Impute ${Mn(this.transform)}`}assemble(){const{impute:e,key:n,keyvals:r,method:i,groupby:o,value:s,frame:a=[null,null]}=this.transform,l={type:"impute",field:e,key:n,...r?{keyvals:TVt(r)?this.processSequence(r):r}:{},method:"value",...o?{groupby:o}:{},value:!i||i==="value"?s:null};if(i&&i!=="value"){const c={type:"window",as:[`imputed_${e}_value`],ops:[i],fields:[e],frame:a,ignorePeers:!1,...o?{groupby:o}:{}},u={type:"formula",expr:`datum.${e} === null ? datum.imputed_${e}_value : datum.${e}`,as:e};return[l,c,u]}else return[l]}}class q6 extends _r{clone(){return new q6(null,Kt(this.transform))}constructor(e,n){super(e),this.transform=n,this.transform=Kt(n);const r=this.transform.as??[void 0,void 0];this.transform.as=[r[0]??n.on,r[1]??n.loess]}dependentFields(){return new Set([this.transform.loess,this.transform.on,...this.transform.groupby??[]])}producedFields(){return new Set(this.transform.as)}hash(){return`LoessTransform ${Mn(this.transform)}`}assemble(){const{loess:e,on:n,...r}=this.transform;return{type:"loess",x:n,y:e,...r}}}class ZA extends _r{clone(){return new ZA(null,Kt(this.transform),this.secondary)}constructor(e,n,r){super(e),this.transform=n,this.secondary=r}static make(e,n,r,i){const o=n.component.data.sources,{from:s}=r;let a=null;if(kVt(s)){let l=y6e(s.data,o);l||(l=new A1(s.data),o.push(l));const c=n.getName(`lookup_${i}`);a=new ml(l,c,Fi.Lookup,n.component.data.outputNodeRefCounts),n.component.data.outputNodes[c]=a}else if(AVt(s)){const l=s.param;r={as:l,...r};let c;try{c=n.getSelectionComponent(hi(l),l)}catch{throw new Error(tUt(l))}if(a=c.materialized,!a)throw new Error(nUt(l))}return new ZA(e,r,a.getSource())}dependentFields(){return new Set([this.transform.lookup])}producedFields(){return new Set(this.transform.as?pt(this.transform.as):this.transform.from.fields)}hash(){return`Lookup ${Mn({transform:this.transform,secondary:this.secondary})}`}assemble(){let e;if(this.transform.from.fields)e={values:this.transform.from.fields,...this.transform.as?{as:pt(this.transform.as)}:{}};else{let n=this.transform.as;gt(n)||(Ze(uUt),n="_lookup"),e={as:[n]}}return{type:"lookup",from:this.secondary,key:this.transform.from.key,fields:[this.transform.lookup],...e,...this.transform.default?{default:this.transform.default}:{}}}}class X6 extends _r{clone(){return new X6(null,Kt(this.transform))}constructor(e,n){super(e),this.transform=n,this.transform=Kt(n);const r=this.transform.as??[void 0,void 0];this.transform.as=[r[0]??"prob",r[1]??"value"]}dependentFields(){return new Set([this.transform.quantile,...this.transform.groupby??[]])}producedFields(){return new Set(this.transform.as)}hash(){return`QuantileTransform ${Mn(this.transform)}`}assemble(){const{quantile:e,...n}=this.transform;return{type:"quantile",field:e,...n}}}class Y6 extends _r{clone(){return new Y6(null,Kt(this.transform))}constructor(e,n){super(e),this.transform=n,this.transform=Kt(n);const r=this.transform.as??[void 0,void 0];this.transform.as=[r[0]??n.on,r[1]??n.regression]}dependentFields(){return new Set([this.transform.regression,this.transform.on,...this.transform.groupby??[]])}producedFields(){return new Set(this.transform.as)}hash(){return`RegressionTransform ${Mn(this.transform)}`}assemble(){const{regression:e,on:n,...r}=this.transform;return{type:"regression",x:n,y:e,...r}}}class Q6 extends _r{clone(){return new Q6(null,Kt(this.transform))}constructor(e,n){super(e),this.transform=n}addDimensions(e){this.transform.groupby=Jd((this.transform.groupby??[]).concat(e),n=>n)}producedFields(){}dependentFields(){return new Set([this.transform.pivot,this.transform.value,...this.transform.groupby??[]])}hash(){return`PivotTransform ${Mn(this.transform)}`}assemble(){const{pivot:e,value:n,groupby:r,limit:i,op:o}=this.transform;return{type:"pivot",field:e,value:n,...i!==void 0?{limit:i}:{},...o!==void 0?{op:o}:{},...r!==void 0?{groupby:r}:{}}}}class K6 extends _r{clone(){return new K6(null,Kt(this.transform))}constructor(e,n){super(e),this.transform=n}dependentFields(){return new Set}producedFields(){return new Set}hash(){return`SampleTransform ${Mn(this.transform)}`}assemble(){return{type:"sample",size:this.transform.sample}}}function m6e(t){let e=0;function n(r,i){if(r instanceof A1&&!r.isGenerator&&!oC(r.data)&&(t.push(i),i={name:null,source:i.name,transform:[]}),r instanceof Qs&&(r.parent instanceof A1&&!i.source?(i.format={...i.format,parse:r.assembleFormatParse()},i.transform.push(...r.assembleTransforms(!0))):i.transform.push(...r.assembleTransforms())),r instanceof FO){i.name||(i.name=`data_${e++}`),!i.source||i.transform.length>0?(t.push(i),r.data=i.name):r.data=i.source,t.push(...r.assemble());return}switch((r instanceof XR||r instanceof YR||r instanceof uC||r instanceof $O||r instanceof aC||r instanceof KA||r instanceof $f||r instanceof ZA||r instanceof NO||r instanceof wb||r instanceof H6||r instanceof G6||r instanceof W6||r instanceof q6||r instanceof X6||r instanceof Y6||r instanceof yy||r instanceof K6||r instanceof Q6||r instanceof V6)&&i.transform.push(r.assemble()),(r instanceof bh||r instanceof xh||r instanceof Vx||r instanceof dg||r instanceof U_)&&i.transform.push(...r.assemble()),r instanceof ml&&(i.source&&i.transform.length===0?r.setSource(i.source):r.parent instanceof ml?r.setSource(i.name):(i.name||(i.name=`data_${e++}`),r.setSource(i.name),r.numChildren()===1&&(t.push(i),i={name:null,source:i.name,transform:[]}))),r.numChildren()){case 0:r instanceof ml&&(!i.source||i.transform.length>0)&&t.push(i);break;case 1:n(r.children[0],i);break;default:{i.name||(i.name=`data_${e++}`);let o=i.name;!i.source||i.transform.length>0?t.push(i):o=i.source;for(const s of r.children)n(s,{name:null,source:o,transform:[]});break}}}return n}function jGt(t){const e=[],n=m6e(e);for(const r of t.children)n(r,{source:t.name,name:null,transform:[]});return e}function BGt(t,e){const n=[],r=m6e(n);let i=0;for(const s of t.sources){s.hasName()||(s.dataName=`source_${i++}`);const a=s.assemble();r(s,a)}for(const s of n)s.transform.length===0&&delete s.transform;let o=0;for(const[s,a]of n.entries())(a.transform??[]).length===0&&!a.source&&n.splice(o++,0,n.splice(s,1)[0]);for(const s of n)for(const a of s.transform??[])a.type==="lookup"&&(a.from=t.outputNodes[a.from].getSource());for(const s of n)s.name in e&&(s.values=e[s.name]);return n}function UGt(t){return t==="top"||t==="left"||Mt(t)?"header":"footer"}function WGt(t){for(const e of au)VGt(t,e);e0e(t,"x"),e0e(t,"y")}function VGt(t,e){var s;const{facet:n,config:r,child:i,component:o}=t;if(t.channelHasField(e)){const a=n[e],l=cC("title",null,r,e);let c=j_(a,r,{allowDisabling:!0,includeDefault:l===void 0||!!l});i.component.layoutHeaders[e].title&&(c=We(c)?c.join(", "):c,c+=` / ${i.component.layoutHeaders[e].title}`,i.component.layoutHeaders[e].title=null);const u=cC("labelOrient",a.header,r,e),f=a.header!==null?Xi((s=a.header)==null?void 0:s.labels,r.header.labels,!0):!1,d=Tn(["bottom","right"],u)?"footer":"header";o.layoutHeaders[e]={title:a.header!==null?c:null,facetFieldDef:a,[d]:e==="facet"?[]:[v6e(t,e,f)]}}}function v6e(t,e,n){const r=e==="row"?"height":"width";return{labels:n,sizeSignal:t.child.component.layoutSize.get(r)?t.child.getSizeSignalRef(r):void 0,axes:[]}}function e0e(t,e){const{child:n}=t;if(n.component.axes[e]){const{layoutHeaders:r,resolve:i}=t.component;if(i.axis[e]=rae(i,e),i.axis[e]==="shared"){const o=e==="x"?"column":"row",s=r[o];for(const a of n.component.axes[e]){const l=UGt(a.get("orient"));s[l]??(s[l]=[v6e(t,o,!1)]);const c=wT(a,"main",t.config,{header:!0});c&&s[l][0].axes.push(c),a.mainExtracted=!0}}}}function GGt(t){fae(t),q5(t,"width"),q5(t,"height")}function HGt(t){fae(t);const e=t.layout.columns===1?"width":"childWidth",n=t.layout.columns===void 0?"height":"childHeight";q5(t,e),q5(t,n)}function fae(t){for(const e of t.children)e.parseLayoutSize()}function q5(t,e){const n=WBe(e),r=m6(n),i=t.component.resolve,o=t.component.layoutSize;let s;for(const a of t.children){const l=a.component.layoutSize.getWithExplicit(n),c=i.scale[r]??GBe(r,t);if(c==="independent"&&l.value==="step"){s=void 0;break}if(s){if(c==="independent"&&s.value!==l.value){s=void 0;break}s=my(s,l,n,"")}else s=l}if(s){for(const a of t.children)t.renameSignal(a.getName(n),t.getName(e)),a.component.layoutSize.set(n,"merged",!1);o.setWithExplicit(e,s)}else o.setWithExplicit(e,{explicit:!1,value:void 0})}function qGt(t){const{size:e,component:n}=t;for(const r of tm){const i=Tl(r);if(e[i]){const o=e[i];n.layoutSize.set(i,Ih(o)?"step":o,!0)}else{const o=XGt(t,i);n.layoutSize.set(i,o,!1)}}}function XGt(t,e){const n=e==="width"?"x":"y",r=t.config,i=t.getScaleComponent(n);if(i){const o=i.get("type"),s=i.get("range");if(Wo(o)){const a=W5(r.view,e);return mb(s)||Ih(a)?"step":a}else return AY(r.view,e)}else{if(t.hasProjection||t.mark==="arc")return AY(r.view,e);{const o=W5(r.view,e);return Ih(o)?o.step:o}}}function GY(t,e,n){return ct(e,{suffix:`by_${ct(t)}`,...n})}class yk extends g6e{constructor(e,n,r,i){super(e,"facet",n,r,i,e.resolve),this.child=mae(e.spec,this,this.getName("child"),void 0,i),this.children=[this.child],this.facet=this.initFacet(e.facet)}initFacet(e){if(!UR(e))return{facet:this.initFacetFieldDef(e,"facet")};const n=Qe(e),r={};for(const i of n){if(![lg,cg].includes(i)){Ze(x6(i,"facet"));break}const o=e[i];if(o.field===void 0){Ze(CY(o,i));break}r[i]=this.initFacetFieldDef(o,i)}return r}initFacetFieldDef(e,n){const r=Lse(e,n);return r.header?r.header=is(r.header):r.header===null&&(r.header=null),r}channelHasField(e){return Ke(this.facet,e)}fieldDef(e){return this.facet[e]}parseData(){this.component.data=Z6(this),this.child.parseData()}parseLayoutSize(){fae(this)}parseSelections(){this.child.parseSelections(),this.component.selection=this.child.component.selection}parseMarkGroup(){this.child.parseMarkGroup()}parseAxesAndHeaders(){this.child.parseAxesAndHeaders(),WGt(this)}assembleSelectionTopLevelSignals(e){return this.child.assembleSelectionTopLevelSignals(e)}assembleSignals(){return this.child.assembleSignals(),[]}assembleSelectionData(e){return this.child.assembleSelectionData(e)}getHeaderLayoutMixins(){const e={};for(const n of au)for(const r of tae){const i=this.component.layoutHeaders[n],o=i[r],{facetFieldDef:s}=i;if(s){const a=cC("titleOrient",s.header,this.config,n);if(["right","bottom"].includes(a)){const l=j6(n,a);e.titleAnchor??(e.titleAnchor={}),e.titleAnchor[l]="end"}}if(o!=null&&o[0]){const a=n==="row"?"height":"width",l=r==="header"?"headerBand":"footerBand";n!=="facet"&&!this.child.component.layoutSize.get(a)&&(e[l]??(e[l]={}),e[l][n]=.5),i.title&&(e.offset??(e.offset={}),e.offset[n==="row"?"rowTitle":"columnTitle"]=10)}}return e}assembleDefaultLayout(){const{column:e,row:n}=this.facet,r=e?this.columnDistinctSignal():n?1:void 0;let i="all";return(!n&&this.component.resolve.scale.x==="independent"||!e&&this.component.resolve.scale.y==="independent")&&(i="none"),{...this.getHeaderLayoutMixins(),...r?{columns:r}:{},bounds:"full",align:i}}assembleLayoutSignals(){return this.child.assembleLayoutSignals()}columnDistinctSignal(){if(!(this.parent&&this.parent instanceof yk))return{signal:`length(data('${this.getName("column_domain")}'))`}}assembleGroupStyle(){}assembleGroup(e){return this.parent&&this.parent instanceof yk?{...this.channelHasField("column")?{encode:{update:{columns:{field:ct(this.facet.column,{prefix:"distinct"})}}}}:{},...super.assembleGroup(e)}:super.assembleGroup(e)}getCardinalityAggregateForChild(){const e=[],n=[],r=[];if(this.child instanceof yk){if(this.child.channelHasField("column")){const i=ct(this.child.facet.column);e.push(i),n.push("distinct"),r.push(`distinct_${i}`)}}else for(const i of tm){const o=this.child.component.scales[i];if(o&&!o.merged){const s=o.get("type"),a=o.get("range");if(Wo(s)&&mb(a)){const l=U6(this.child,i),c=lae(l);c?(e.push(c),n.push("distinct"),r.push(`distinct_${c}`)):Ze(use(i))}}}return{fields:e,ops:n,as:r}}assembleFacet(){const{name:e,data:n}=this.component.data.facetRoot,{row:r,column:i}=this.facet,{fields:o,ops:s,as:a}=this.getCardinalityAggregateForChild(),l=[];for(const u of au){const f=this.facet[u];if(f){l.push(ct(f));const{bin:d,sort:h}=f;if(Gr(d)&&l.push(ct(f,{binSuffix:"end"})),ug(h)){const{field:p,op:g=E6}=h,m=GY(f,h);r&&i?(o.push(m),s.push("max"),a.push(m)):(o.push(p),s.push(g),a.push(m))}else if(We(h)){const p=lC(f,u);o.push(p),s.push("max"),a.push(p)}}}const c=!!r&&!!i;return{name:e,data:n,groupby:l,...c||o.length>0?{aggregate:{...c?{cross:c}:{},...o.length?{fields:o,ops:s,as:a}:{}}}:{}}}facetSortFields(e){const{facet:n}=this,r=n[e];return r?ug(r.sort)?[GY(r,r.sort,{expr:"datum"})]:We(r.sort)?[lC(r,e,{expr:"datum"})]:[ct(r,{expr:"datum"})]:[]}facetSortOrder(e){const{facet:n}=this,r=n[e];if(r){const{sort:i}=r;return[(ug(i)?i.order:!We(i)&&i)||"ascending"]}return[]}assembleLabelTitle(){var i;const{facet:e,config:n}=this;if(e.facet)return NY(e.facet,"facet",n);const r={row:["top","bottom"],column:["left","right"]};for(const o of eae)if(e[o]){const s=cC("labelOrient",(i=e[o])==null?void 0:i.header,n,o);if(r[o].includes(s))return NY(e[o],o,n)}}assembleMarks(){const{child:e}=this,n=this.component.data.facetRoot,r=jGt(n),i=e.assembleGroupEncodeEntry(!1),o=this.assembleLabelTitle()||e.assembleTitle(),s=e.assembleGroupStyle();return[{name:this.getName("cell"),type:"group",...o?{title:o}:{},...s?{style:s}:{},from:{facet:this.assembleFacet()},sort:{field:au.map(l=>this.facetSortFields(l)).flat(),order:au.map(l=>this.facetSortOrder(l)).flat()},...r.length>0?{data:r}:{},...i?{encode:{update:i}}:{},...e.assembleGroup(s9t(this,[]))}]}getMapping(){return this.facet}}function YGt(t,e){const{row:n,column:r}=e;if(n&&r){let i=null;for(const o of[n,r])if(ug(o.sort)){const{field:s,op:a=E6}=o.sort;t=i=new wb(t,{joinaggregate:[{op:a,field:s,as:GY(o,o.sort,{forAs:!0})}],groupby:[ct(o)]})}return i}return null}function y6e(t,e){var n,r,i,o;for(const s of e){const a=s.data;if(t.name&&s.hasName()&&t.name!==s.dataName)continue;const l=(n=t.format)==null?void 0:n.mesh,c=(r=a.format)==null?void 0:r.feature;if(l&&c)continue;const u=(i=t.format)==null?void 0:i.feature;if((u||c)&&u!==c)continue;const f=(o=a.format)==null?void 0:o.mesh;if(!((l||f)&&l!==f)){if(QA(t)&&QA(a)){if(lc(t.values,a.values))return s}else if(oC(t)&&oC(a)){if(t.url===a.url)return s}else if(aBe(t)&&t.name===s.dataName)return s}}return null}function QGt(t,e){if(t.data||!t.parent){if(t.data===null){const r=new A1({values:[]});return e.push(r),r}const n=y6e(t.data,e);if(n)return Wv(t.data)||(n.data.format=nje({},t.data.format,n.data.format)),!n.hasName()&&t.data.name&&(n.dataName=t.data.name),n;{const r=new A1(t.data);return e.push(r),r}}else return t.parent.component.data.facetRoot?t.parent.component.data.facetRoot:t.parent.component.data.main}function KGt(t,e,n){let r=0;for(const i of e.transforms){let o,s;if(zVt(i))s=t=new aC(t,i),o="derived";else if(qse(i)){const a=B7t(i);s=t=Qs.makeWithAncestors(t,{},a,n)??t,t=new $O(t,e,i.filter)}else if(nBe(i))s=t=bh.makeFromTransform(t,i,e),o="number";else if(BVt(i))o="date",n.getWithExplicit(i.field).value===void 0&&(t=new Qs(t,{[i.field]:o}),n.set(i.field,o,!1)),s=t=xh.makeFromTransform(t,i);else if(UVt(i))s=t=$f.makeFromTransform(t,i),o="number",Jse(e)&&(t=new yy(t));else if(tBe(i))s=t=ZA.make(t,e,i,r++),o="derived";else if($Vt(i))s=t=new NO(t,i),o="number";else if(FVt(i))s=t=new wb(t,i),o="number";else if(WVt(i))s=t=dg.makeFromTransform(t,i),o="derived";else if(VVt(i))s=t=new H6(t,i),o="derived";else if(GVt(i))s=t=new V6(t,i),o="derived";else if(NVt(i))s=t=new G6(t,i),o="derived";else if(PVt(i))s=t=new Q6(t,i),o="derived";else if(LVt(i))t=new K6(t,i);else if(jVt(i))s=t=Vx.makeFromTransform(t,i),o="derived";else if(MVt(i))s=t=new W6(t,i),o="derived";else if(RVt(i))s=t=new X6(t,i),o="derived";else if(DVt(i))s=t=new Y6(t,i),o="derived";else if(IVt(i))s=t=new q6(t,i),o="derived";else{Ze(cUt(i));continue}if(s&&o!==void 0)for(const a of s.producedFields()??[])n.set(a,o,!1)}return t}function Z6(t){var m;let e=QGt(t,t.component.data.sources);const{outputNodes:n,outputNodeRefCounts:r}=t.component.data,i=t.data,s=!(i&&(Wv(i)||oC(i)||QA(i)))&&t.parent?t.parent.component.data.ancestorParse.clone():new r9t;Wv(i)?(lBe(i)?e=new YR(e,i.sequence):Xse(i)&&(e=new XR(e,i.graticule)),s.parseNothing=!0):((m=i==null?void 0:i.format)==null?void 0:m.parse)===null&&(s.parseNothing=!0),e=Qs.makeExplicit(e,t,s)??e,e=new yy(e);const a=t.parent&&zO(t.parent);(wi(t)||mc(t))&&a&&(e=bh.makeFromEncoding(e,t)??e),t.transforms.length>0&&(e=KGt(e,t,s));const l=W7t(t),c=U7t(t);e=Qs.makeWithAncestors(e,{},{...l,...c},s)??e,wi(t)&&(e=U_.parseAll(e,t),e=KA.parseAll(e,t)),(wi(t)||mc(t))&&(a||(e=bh.makeFromEncoding(e,t)??e),e=xh.makeFromEncoding(e,t)??e,e=aC.parseAllForSortIndex(e,t));const u=e=sL(Fi.Raw,t,e);if(wi(t)){const v=$f.makeFromEncoding(e,t);v&&(e=v,Jse(t)&&(e=new yy(e))),e=Vx.makeFromEncoding(e,t)??e,e=dg.makeFromEncoding(e,t)??e}let f,d;if(wi(t)){const{markDef:v,mark:y,config:x}=t,b=Or("invalid",v,x),{marks:w,scales:_}=d=uBe({invalid:b,isPath:e0(y)});w!==_&&_==="include-invalid-values"&&(f=e=sL(Fi.PreFilterInvalid,t,e)),w==="exclude-invalid-values"&&(e=uC.make(e,t,d)??e)}const h=e=sL(Fi.Main,t,e);let p;if(wi(t)&&d){const{marks:v,scales:y}=d;v==="include-invalid-values"&&y==="exclude-invalid-values"&&(e=uC.make(e,t,d)??e,p=e=sL(Fi.PostFilterInvalid,t,e))}wi(t)&&N9t(t,h);let g=null;if(mc(t)){const v=t.getName("facet");e=YGt(e,t.facet)??e,g=new FO(e,t,v,h.getSource()),n[v]=g}return{...t.component.data,outputNodes:n,outputNodeRefCounts:r,raw:u,main:h,facetRoot:g,ancestorParse:s,preFilterInvalid:f,postFilterInvalid:p}}function sL(t,e,n){const{outputNodes:r,outputNodeRefCounts:i}=e.component.data,o=e.getDataName(t),s=new ml(n,o,t,i);return r[o]=s,s}class ZGt extends uae{constructor(e,n,r,i){var o,s,a,l;super(e,"concat",n,r,i,e.resolve),(((s=(o=e.resolve)==null?void 0:o.axis)==null?void 0:s.x)==="shared"||((l=(a=e.resolve)==null?void 0:a.axis)==null?void 0:l.y)==="shared")&&Ze(sUt),this.children=this.getChildren(e).map((c,u)=>mae(c,this,this.getName(`concat_${u}`),void 0,i))}parseData(){this.component.data=Z6(this);for(const e of this.children)e.parseData()}parseSelections(){this.component.selection={};for(const e of this.children){e.parseSelections();for(const n of Qe(e.component.selection))this.component.selection[n]=e.component.selection[n]}}parseMarkGroup(){for(const e of this.children)e.parseMarkGroup()}parseAxesAndHeaders(){for(const e of this.children)e.parseAxesAndHeaders()}getChildren(e){return D6(e)?e.vconcat:Gse(e)?e.hconcat:e.concat}parseLayoutSize(){HGt(this)}parseAxisGroup(){return null}assembleSelectionTopLevelSignals(e){return this.children.reduce((n,r)=>r.assembleSelectionTopLevelSignals(n),e)}assembleSignals(){return this.children.forEach(e=>e.assembleSignals()),[]}assembleLayoutSignals(){const e=nae(this);for(const n of this.children)e.push(...n.assembleLayoutSignals());return e}assembleSelectionData(e){return this.children.reduce((n,r)=>r.assembleSelectionData(n),e)}assembleMarks(){return this.children.map(e=>{const n=e.assembleTitle(),r=e.assembleGroupStyle(),i=e.assembleGroupEncodeEntry(!1);return{type:"group",name:e.getName("group"),...n?{title:n}:{},...r?{style:r}:{},...i?{encode:{update:i}}:{},...e.assembleGroup()}})}assembleGroupStyle(){}assembleDefaultLayout(){const e=this.layout.columns;return{...e!=null?{columns:e}:{},bounds:"full",align:"each"}}}function JGt(t){return t===!1||t===null}const eHt={disable:1,gridScale:1,scale:1,...O4e,labelExpr:1,encode:1},x6e=Qe(eHt);class dae extends rm{constructor(e={},n={},r=!1){super(),this.explicit=e,this.implicit=n,this.mainExtracted=r}clone(){return new dae(Kt(this.explicit),Kt(this.implicit),this.mainExtracted)}hasAxisPart(e){return e==="axis"?!0:e==="grid"||e==="title"?!!this.get(e):!JGt(this.get(e))}hasOrientSignalRef(){return Mt(this.explicit.orient)}}function tHt(t,e,n){const{encoding:r,config:i}=t,o=So(r[e])??So(r[Qh(e)]),s=t.axis(e)||{},{format:a,formatType:l}=s;if(E1(l))return{text:kf({fieldOrDatumDef:o,field:"datum.value",format:a,formatType:l,config:i}),...n};if(a===void 0&&l===void 0&&i.customFormatTypes){if(nC(o)==="quantitative"){if(rC(o)&&o.stack==="normalize"&&i.normalizedNumberFormatType)return{text:kf({fieldOrDatumDef:o,field:"datum.value",format:i.normalizedNumberFormat,formatType:i.normalizedNumberFormatType,config:i}),...n};if(i.numberFormatType)return{text:kf({fieldOrDatumDef:o,field:"datum.value",format:i.numberFormat,formatType:i.numberFormatType,config:i}),...n}}if(nC(o)==="temporal"&&i.timeFormatType&&Je(o)&&!o.timeUnit)return{text:kf({fieldOrDatumDef:o,field:"datum.value",format:i.timeFormat,formatType:i.timeFormatType,config:i}),...n}}return n}function nHt(t){return tm.reduce((e,n)=>(t.component.scales[n]&&(e[n]=[cHt(n,t)]),e),{})}const rHt={bottom:"top",top:"bottom",left:"right",right:"left"};function iHt(t){const{axes:e,resolve:n}=t.component,r={top:0,bottom:0,right:0,left:0};for(const i of t.children){i.parseAxesAndHeaders();for(const o of Qe(i.component.axes))n.axis[o]=rae(t.component.resolve,o),n.axis[o]==="shared"&&(e[o]=oHt(e[o],i.component.axes[o]),e[o]||(n.axis[o]="independent",delete e[o]))}for(const i of tm){for(const o of t.children)if(o.component.axes[i]){if(n.axis[i]==="independent"){e[i]=(e[i]??[]).concat(o.component.axes[i]);for(const s of o.component.axes[i]){const{value:a,explicit:l}=s.getWithExplicit("orient");if(!Mt(a)){if(r[a]>0&&!l){const c=rHt[a];r[a]>r[c]&&s.set("orient",c,!1)}r[a]++}}}delete o.component.axes[i]}if(n.axis[i]==="independent"&&e[i]&&e[i].length>1)for(const[o,s]of(e[i]||[]).entries())o>0&&s.get("grid")&&!s.explicit.grid&&(s.implicit.grid=!1)}}function oHt(t,e){if(t){if(t.length!==e.length)return;const n=t.length;for(let r=0;rn.clone());return t}function sHt(t,e){for(const n of x6e){const r=my(t.getWithExplicit(n),e.getWithExplicit(n),n,"axis",(i,o)=>{switch(n){case"title":return Aje(i,o);case"gridScale":return{explicit:i.explicit,value:Xi(i.value,o.value)}}return L6(i,o,n,"axis")});t.setWithExplicit(n,r)}return t}function aHt(t,e,n,r,i){if(e==="disable")return n!==void 0;switch(n=n||{},e){case"titleAngle":case"labelAngle":return t===(Mt(n.labelAngle)?n.labelAngle:XA(n.labelAngle));case"values":return!!n.values;case"encode":return!!n.encoding||!!n.labelAngle;case"title":if(t===NBe(r,i))return!0}return t===n[e]}const lHt=new Set(["grid","translate","format","formatType","orient","labelExpr","tickCount","position","tickMinStep"]);function cHt(t,e){var v,y;let n=e.axis(t);const r=new dae,i=So(e.encoding[t]),{mark:o,config:s}=e,a=(n==null?void 0:n.orient)||((v=s[t==="x"?"axisX":"axisY"])==null?void 0:v.orient)||((y=s.axis)==null?void 0:y.orient)||X9t(t),l=e.getScaleComponent(t).get("type"),c=B9t(t,l,a,e.config),u=n!==void 0?!n:$Y("disable",s.style,n==null?void 0:n.style,c).configValue;if(r.set("disable",u,n!==void 0),u)return r;n=n||{};const f=G9t(i,n,t,s.style,c),d=f4e(n.formatType,i,l),h=u4e(i,i.type,n.format,n.formatType,s,!0),p={fieldOrDatumDef:i,axis:n,channel:t,model:e,scaleType:l,orient:a,labelAngle:f,format:h,formatType:d,mark:o,config:s};for(const x of x6e){const b=x in zye?zye[x](p):fye(x)?n[x]:void 0,w=b!==void 0,_=aHt(b,x,n,e,t);if(w&&_)r.set(x,b,_);else{const{configValue:S=void 0,configFrom:O=void 0}=fye(x)&&x!=="values"?$Y(x,s.style,n.style,c):{},k=S!==void 0;w&&!k?r.set(x,b,_):(O!=="vgAxisConfig"||lHt.has(x)&&k||HR(S)||Mt(S))&&r.set(x,S,!1)}}const g=n.encoding??{},m=C4e.reduce((x,b)=>{if(!r.hasAxisPart(b))return x;const w=VBe(g[b]??{},e),_=b==="labels"?tHt(e,t,w):w;return _!==void 0&&!Er(_)&&(x[b]={update:_}),x},{});return Er(m)||r.set("encode",m,!!n.encoding||n.labelAngle!==void 0),r}function uHt({encoding:t,size:e}){for(const n of tm){const r=Tl(n);Ih(e[r])&&bv(t[n])&&(delete e[r],Ze(Ije(r)))}return e}const fHt={vgMark:"arc",encodeEntry:t=>({...Bu(t,{align:"ignore",baseline:"ignore",color:"include",size:"ignore",orient:"ignore",theta:"ignore"}),...Ca("x",t,{defaultPos:"mid"}),...Ca("y",t,{defaultPos:"mid"}),...zg(t,"radius"),...zg(t,"theta")})},dHt={vgMark:"area",encodeEntry:t=>({...Bu(t,{align:"ignore",baseline:"ignore",color:"include",orient:"include",size:"ignore",theta:"ignore"}),...V5("x",t,{defaultPos:"zeroOrMin",defaultPos2:"zeroOrMin",range:t.markDef.orient==="horizontal"}),...V5("y",t,{defaultPos:"zeroOrMin",defaultPos2:"zeroOrMin",range:t.markDef.orient==="vertical"}),...Zse(t)})},hHt={vgMark:"rect",encodeEntry:t=>({...Bu(t,{align:"ignore",baseline:"ignore",color:"include",orient:"ignore",size:"ignore",theta:"ignore"}),...zg(t,"x"),...zg(t,"y")})},pHt={vgMark:"shape",encodeEntry:t=>({...Bu(t,{align:"ignore",baseline:"ignore",color:"include",size:"ignore",orient:"ignore",theta:"ignore"})}),postEncodingTransform:t=>{const{encoding:e}=t,n=e.shape;return[{type:"geoshape",projection:t.projectionName(),...n&&Je(n)&&n.type===IO?{field:ct(n,{expr:"datum"})}:{}}]}},gHt={vgMark:"image",encodeEntry:t=>({...Bu(t,{align:"ignore",baseline:"ignore",color:"ignore",orient:"ignore",size:"ignore",theta:"ignore"}),...zg(t,"x"),...zg(t,"y"),...Qse(t,"url")})},mHt={vgMark:"line",encodeEntry:t=>({...Bu(t,{align:"ignore",baseline:"ignore",color:"include",size:"ignore",orient:"ignore",theta:"ignore"}),...Ca("x",t,{defaultPos:"mid"}),...Ca("y",t,{defaultPos:"mid"}),...cs("size",t,{vgChannel:"strokeWidth"}),...Zse(t)})},vHt={vgMark:"trail",encodeEntry:t=>({...Bu(t,{align:"ignore",baseline:"ignore",color:"include",size:"include",orient:"ignore",theta:"ignore"}),...Ca("x",t,{defaultPos:"mid"}),...Ca("y",t,{defaultPos:"mid"}),...cs("size",t),...Zse(t)})};function hae(t,e){const{config:n}=t;return{...Bu(t,{align:"ignore",baseline:"ignore",color:"include",size:"include",orient:"ignore",theta:"ignore"}),...Ca("x",t,{defaultPos:"mid"}),...Ca("y",t,{defaultPos:"mid"}),...cs("size",t),...cs("angle",t),...yHt(t,n,e)}}function yHt(t,e,n){return n?{shape:{value:n}}:cs("shape",t)}const xHt={vgMark:"symbol",encodeEntry:t=>hae(t)},bHt={vgMark:"symbol",encodeEntry:t=>hae(t,"circle")},wHt={vgMark:"symbol",encodeEntry:t=>hae(t,"square")},_Ht={vgMark:"rect",encodeEntry:t=>({...Bu(t,{align:"ignore",baseline:"ignore",color:"include",orient:"ignore",size:"ignore",theta:"ignore"}),...zg(t,"x"),...zg(t,"y")})},SHt={vgMark:"rule",encodeEntry:t=>{const{markDef:e}=t,n=e.orient;return!t.encoding.x&&!t.encoding.y&&!t.encoding.latitude&&!t.encoding.longitude?{}:{...Bu(t,{align:"ignore",baseline:"ignore",color:"include",orient:"ignore",size:"ignore",theta:"ignore"}),...V5("x",t,{defaultPos:n==="horizontal"?"zeroOrMax":"mid",defaultPos2:"zeroOrMin",range:n!=="vertical"}),...V5("y",t,{defaultPos:n==="vertical"?"zeroOrMax":"mid",defaultPos2:"zeroOrMin",range:n!=="horizontal"}),...cs("size",t,{vgChannel:"strokeWidth"})}}},CHt={vgMark:"text",encodeEntry:t=>{const{config:e,encoding:n}=t;return{...Bu(t,{align:"include",baseline:"include",color:"include",size:"ignore",orient:"ignore",theta:"include"}),...Ca("x",t,{defaultPos:"mid"}),...Ca("y",t,{defaultPos:"mid"}),...Qse(t),...cs("size",t,{vgChannel:"fontSize"}),...cs("angle",t),...Lye("align",OHt(t.markDef,n,e)),...Lye("baseline",EHt(t.markDef,n,e)),...Ca("radius",t,{defaultPos:null}),...Ca("theta",t,{defaultPos:null})}}};function OHt(t,e,n){if(Or("align",t,n)===void 0)return"center"}function EHt(t,e,n){if(Or("baseline",t,n)===void 0)return"middle"}const THt={vgMark:"rect",encodeEntry:t=>{const{config:e,markDef:n}=t,r=n.orient,i=r==="horizontal"?"x":"y",o=r==="horizontal"?"y":"x",s=r==="horizontal"?"height":"width";return{...Bu(t,{align:"ignore",baseline:"ignore",color:"include",orient:"ignore",size:"ignore",theta:"ignore"}),...zg(t,i),...Ca(o,t,{defaultPos:"mid",vgChannel:o==="y"?"yc":"xc"}),[s]:Jr(Or("thickness",n,e))}}},aL={arc:fHt,area:dHt,bar:hHt,circle:bHt,geoshape:pHt,image:gHt,line:mHt,point:xHt,rect:_Ht,rule:SHt,square:wHt,text:CHt,tick:THt,trail:vHt};function kHt(t){if(Tn([C6,_6,$8t],t.mark)){const e=M4e(t.mark,t.encoding);if(e.length>0)return AHt(t,e)}else if(t.mark===S6){const e=_Y.some(n=>Or(n,t.markDef,t.config));if(t.stack&&!t.fieldDef("size")&&e)return PHt(t)}return pae(t)}const t0e="faceted_path_";function AHt(t,e){return[{name:t.getName("pathgroup"),type:"group",from:{facet:{name:t0e+t.requestDataName(Fi.Main),data:t.requestDataName(Fi.Main),groupby:e}},encode:{update:{width:{field:{group:"width"}},height:{field:{group:"height"}}}},marks:pae(t,{fromPrefix:t0e})}]}const n0e="stack_group_";function PHt(t){var c;const[e]=pae(t,{fromPrefix:n0e}),n=t.scaleName(t.stack.fieldChannel),r=(u={})=>t.vgField(t.stack.fieldChannel,u),i=(u,f)=>{const d=[r({prefix:"min",suffix:"start",expr:f}),r({prefix:"max",suffix:"start",expr:f}),r({prefix:"min",suffix:"end",expr:f}),r({prefix:"max",suffix:"end",expr:f})];return`${u}(${d.map(h=>`scale('${n}',${h})`).join(",")})`};let o,s;t.stack.fieldChannel==="x"?(o={...YS(e.encode.update,["y","yc","y2","height",..._Y]),x:{signal:i("min","datum")},x2:{signal:i("max","datum")},clip:{value:!0}},s={x:{field:{group:"x"},mult:-1},height:{field:{group:"height"}}},e.encode.update={...gl(e.encode.update,["y","yc","y2"]),height:{field:{group:"height"}}}):(o={...YS(e.encode.update,["x","xc","x2","width"]),y:{signal:i("min","datum")},y2:{signal:i("max","datum")},clip:{value:!0}},s={y:{field:{group:"y"},mult:-1},width:{field:{group:"width"}}},e.encode.update={...gl(e.encode.update,["x","xc","x2"]),width:{field:{group:"width"}}});for(const u of _Y){const f=Rh(u,t.markDef,t.config);e.encode.update[u]?(o[u]=e.encode.update[u],delete e.encode.update[u]):f&&(o[u]=Jr(f)),f&&(e.encode.update[u]={value:0})}const a=[];if(((c=t.stack.groupbyChannels)==null?void 0:c.length)>0)for(const u of t.stack.groupbyChannels){const f=t.fieldDef(u),d=ct(f);d&&a.push(d),(f!=null&&f.bin||f!=null&&f.timeUnit)&&a.push(ct(f,{binSuffix:"end"}))}return o=["stroke","strokeWidth","strokeJoin","strokeCap","strokeDash","strokeDashOffset","strokeMiterLimit","strokeOpacity"].reduce((u,f)=>{if(e.encode.update[f])return{...u,[f]:e.encode.update[f]};{const d=Rh(f,t.markDef,t.config);return d!==void 0?{...u,[f]:Jr(d)}:u}},o),o.stroke&&(o.strokeForeground={value:!0},o.strokeOffset={value:0}),[{type:"group",from:{facet:{data:t.requestDataName(Fi.Main),name:n0e+t.requestDataName(Fi.Main),groupby:a,aggregate:{fields:[r({suffix:"start"}),r({suffix:"start"}),r({suffix:"end"}),r({suffix:"end"})],ops:["min","max","min","max"]}}},encode:{update:o},marks:[{type:"group",encode:{update:s},marks:[e]}]}]}function MHt(t){const{encoding:e,stack:n,mark:r,markDef:i,config:o}=t,s=e.order;if(!(!We(s)&&qf(s)&&bY(s.value)||!s&&bY(Or("order",i,o)))){if((We(s)||Je(s))&&!n)return Eje(s,{expr:"datum"});if(e0(r)){const a=i.orient==="horizontal"?"y":"x",l=e[a];if(Je(l))return{field:a}}}}function pae(t,e={fromPrefix:""}){const{mark:n,markDef:r,encoding:i,config:o}=t,s=Xi(r.clip,RHt(t),DHt(t)),a=Cje(r),l=i.key,c=MHt(t),u=IHt(t),f=Or("aria",r,o),d=aL[n].postEncodingTransform?aL[n].postEncodingTransform(t):null;return[{name:t.getName("marks"),type:aL[n].vgMark,...s?{clip:s}:{},...a?{style:a}:{},...l?{key:l.field}:{},...c?{sort:c}:{},...u||{},...f===!1?{aria:f}:{},from:{data:e.fromPrefix+t.requestDataName(Fi.Main)},encode:{update:aL[n].encodeEntry(t)},...d?{transform:d}:{}}]}function RHt(t){const e=t.getScaleComponent("x"),n=t.getScaleComponent("y");return e!=null&&e.get("selectionExtent")||n!=null&&n.get("selectionExtent")?!0:void 0}function DHt(t){const e=t.component.projection;return e&&!e.isFit?!0:void 0}function IHt(t){if(!t.component.selection)return null;const e=Qe(t.component.selection).length;let n=e,r=t.parent;for(;r&&n===0;)n=Qe(r.component.selection).length,r=r.parent;return n?{interactive:e>0||t.mark==="geoshape"||!!t.encoding.tooltip||!!t.markDef.tooltip}:null}class b6e extends g6e{constructor(e,n,r,i={},o){super(e,"unit",n,r,o,void 0,hye(e)?e.view:void 0),this.specifiedScales={},this.specifiedAxes={},this.specifiedLegends={},this.specifiedProjection={},this.selection=[],this.children=[];const s=Dh(e.mark)?{...e.mark}:{type:e.mark},a=s.type;s.filled===void 0&&(s.filled=xVt(s,o,{graticule:e.data&&Xse(e.data)}));const l=this.encoding=SWt(e.encoding||{},a,s.filled,o);this.markDef=Z4e(s,l,o),this.size=uHt({encoding:l,size:hye(e)?{...i,...e.width?{width:e.width}:{},...e.height?{height:e.height}:{}}:i}),this.stack=K4e(this.markDef,l),this.specifiedScales=this.initScales(a,l),this.specifiedAxes=this.initAxes(l),this.specifiedLegends=this.initLegends(l),this.specifiedProjection=e.projection,this.selection=(e.params??[]).filter(c=>Wse(c))}get hasProjection(){const{encoding:e}=this,n=this.mark===r4e,r=e&&x6t.some(i=>en(e[i]));return n||r}scaleDomain(e){const n=this.specifiedScales[e];return n?n.domain:void 0}axis(e){return this.specifiedAxes[e]}legend(e){return this.specifiedLegends[e]}initScales(e,n){return ase.reduce((r,i)=>{const o=So(n[i]);return o&&(r[i]=this.initScale(o.scale??{})),r},{})}initScale(e){const{domain:n,range:r}=e,i=is(e);return We(n)&&(i.domain=n.map(nc)),We(r)&&(i.range=r.map(nc)),i}initAxes(e){return tm.reduce((n,r)=>{const i=e[r];if(en(i)||r===vi&&en(e.x2)||r===Yo&&en(e.y2)){const o=en(i)?i.axis:void 0;n[r]=o&&this.initAxis({...o})}return n},{})}initAxis(e){const n=Qe(e),r={};for(const i of n){const o=e[i];r[i]=HR(o)?Sje(o):nc(o)}return r}initLegends(e){return A6t.reduce((n,r)=>{const i=So(e[r]);if(i&&M6t(r)){const o=i.legend;n[r]=o&&is(o)}return n},{})}parseData(){this.component.data=Z6(this)}parseLayoutSize(){qGt(this)}parseSelections(){this.component.selection=F9t(this,this.selection)}parseMarkGroup(){this.component.mark=kHt(this)}parseAxesAndHeaders(){this.component.axes=nHt(this)}assembleSelectionTopLevelSignals(e){return a9t(this,e)}assembleSignals(){return[...LBe(this),...o9t(this,[])]}assembleSelectionData(e){return l9t(this,e)}assembleLayout(){return null}assembleLayoutSignals(){return nae(this)}assembleMarks(){let e=this.component.mark??[];return(!this.parent||!zO(this.parent))&&(e=dBe(this,e)),e.map(this.correctDataNames)}assembleGroupStyle(){const{style:e}=this.view||{};return e!==void 0?e:this.encoding.x||this.encoding.y?"cell":"view"}getMapping(){return this.encoding}get mark(){return this.markDef.type}channelHasField(e){return Ux(this.encoding,e)}fieldDef(e){const n=this.encoding[e];return Xf(n)}typedFieldDef(e){const n=this.fieldDef(e);return Ra(n)?n:null}}class gae extends uae{constructor(e,n,r,i,o){super(e,"layer",n,r,o,e.resolve,e.view);const s={...i,...e.width?{width:e.width}:{},...e.height?{height:e.height}:{}};this.children=e.layer.map((a,l)=>{if(I6(a))return new gae(a,this,this.getName(`layer_${l}`),s,o);if(nm(a))return new b6e(a,this,this.getName(`layer_${l}`),s,o);throw new Error(cse(a))})}parseData(){this.component.data=Z6(this);for(const e of this.children)e.parseData()}parseLayoutSize(){GGt(this)}parseSelections(){this.component.selection={};for(const e of this.children){e.parseSelections();for(const n of Qe(e.component.selection))this.component.selection[n]=e.component.selection[n]}}parseMarkGroup(){for(const e of this.children)e.parseMarkGroup()}parseAxesAndHeaders(){iHt(this)}assembleSelectionTopLevelSignals(e){return this.children.reduce((n,r)=>r.assembleSelectionTopLevelSignals(n),e)}assembleSignals(){return this.children.reduce((e,n)=>e.concat(n.assembleSignals()),LBe(this))}assembleLayoutSignals(){return this.children.reduce((e,n)=>e.concat(n.assembleLayoutSignals()),nae(this))}assembleSelectionData(e){return this.children.reduce((n,r)=>r.assembleSelectionData(n),e)}assembleGroupStyle(){const e=new Set;for(const r of this.children)for(const i of pt(r.assembleGroupStyle()))e.add(i);const n=Array.from(e);return n.length>1?n:n.length===1?n[0]:void 0}assembleTitle(){let e=super.assembleTitle();if(e)return e;for(const n of this.children)if(e=n.assembleTitle(),e)return e}assembleLayout(){return null}assembleMarks(){return c9t(this,this.children.flatMap(e=>e.assembleMarks()))}assembleLegends(){return this.children.reduce((e,n)=>e.concat(n.assembleLegends()),ZBe(this))}}function mae(t,e,n,r,i){if(T6(t))return new yk(t,e,n,i);if(I6(t))return new gae(t,e,n,r,i);if(nm(t))return new b6e(t,e,n,r,i);if(qWt(t))return new ZGt(t,e,n,i);throw new Error(cse(t))}function LHt(t,e={}){e.logger&&QUt(e.logger),e.fieldTitle&&w4e(e.fieldTitle);try{const n=Q4e(mO(e.config,t.config)),r=oBe(t,n),i=mae(r,null,"",void 0,n);return i.parse(),oGt(i.component.data,i),{spec:FHt(i,$Ht(t,r.autosize,n,i),t.datasets,t.usermeta),normalized:r}}finally{e.logger&&KUt(),e.fieldTitle&&pWt()}}function $Ht(t,e,n,r){const i=r.component.layoutSize.get("width"),o=r.component.layoutSize.get("height");if(e===void 0?(e={type:"pad"},r.hasAxisOrientSignalRef()&&(e.resize=!0)):gt(e)&&(e={type:e}),i&&o&&e9t(e.type)){if(i==="step"&&o==="step")Ze(Kve()),e.type="pad";else if(i==="step"||o==="step"){const s=i==="step"?"width":"height";Ze(Kve(m6(s)));const a=s==="width"?"height":"width";e.type=t9t(a)}}return{...Qe(e).length===1&&e.type?e.type==="pad"?{}:{autosize:e.type}:{autosize:e},...Oye(n,!1),...Oye(t,!0)}}function FHt(t,e,n={},r){const i=t.config?aVt(t.config):void 0,o=[].concat(t.assembleSelectionData([]),BGt(t.component.data,n)),s=t.assembleProjections(),a=t.assembleTitle(),l=t.assembleGroupStyle(),c=t.assembleGroupEncodeEntry(!0);let u=t.assembleLayoutSignals();u=u.filter(h=>(h.name==="width"||h.name==="height")&&h.value!==void 0?(e[h.name]=+h.value,!1):!0);const{params:f,...d}=e;return{$schema:"https://vega.github.io/schema/vega/v5.json",...t.description?{description:t.description}:{},...d,...a?{title:a}:{},...l?{style:l}:{},...c?{encode:{update:c}}:{},data:o,...s.length>0?{projections:s}:{},...t.assembleGroup([...u,...t.assembleSelectionTopLevelSignals([]),...H4e(f)]),...i?{config:i}:{},...r?{usermeta:r}:{}}}const NHt=h6t.version,zHt=Object.freeze(Object.defineProperty({__proto__:null,accessPathDepth:KS,accessPathWithDatum:Joe,compile:LHt,contains:Tn,deepEqual:lc,deleteNestedProperty:I5,duplicate:Kt,entries:hy,every:Qoe,fieldIntersection:Zoe,flatAccessWithDatum:ije,getFirstDefined:Xi,hasIntersection:Koe,hasProperty:Ke,hash:Mn,internalField:aje,isBoolean:qA,isEmpty:Er,isEqual:g6t,isInternalField:lje,isNullOrFalse:bY,isNumeric:u6,keys:Qe,logicalExpr:mk,mergeDeep:nje,never:tje,normalize:oBe,normalizeAngle:XA,omit:gl,pick:YS,prefixGenerator:wY,removePathFromField:RO,replaceAll:w1,replacePathInField:Mu,resetIdCounter:v6t,setEqual:rje,some:QS,stringify:Tr,titleCase:LR,unique:Jd,uniqueId:sje,vals:bs,varName:hi,version:NHt},Symbol.toStringTag,{value:"Module"}));function w6e(t){const[e,n]=/schema\/([\w-]+)\/([\w\.\-]+)\.json$/g.exec(t).slice(1,3);return{library:e,version:n}}var jHt="vega-themes",BHt="2.15.0",UHt="Themes for stylized Vega and Vega-Lite visualizations.",WHt=["vega","vega-lite","themes","style"],VHt="BSD-3-Clause",GHt={name:"UW Interactive Data Lab",url:"https://idl.cs.washington.edu"},HHt=[{name:"Emily Gu",url:"https://github.com/emilygu"},{name:"Arvind Satyanarayan",url:"http://arvindsatya.com"},{name:"Jeffrey Heer",url:"https://idl.cs.washington.edu"},{name:"Dominik Moritz",url:"https://www.domoritz.de"}],qHt="build/vega-themes.js",XHt="build/vega-themes.module.js",YHt="build/vega-themes.min.js",QHt="build/vega-themes.min.js",KHt="build/vega-themes.module.d.ts",ZHt={type:"git",url:"https://github.com/vega/vega-themes.git"},JHt=["src","build"],eqt={prebuild:"yarn clean",build:"rollup -c",clean:"rimraf build && rimraf examples/build","copy:data":"rsync -r node_modules/vega-datasets/data/* examples/data","copy:build":"rsync -r build/* examples/build","deploy:gh":"yarn build && mkdir -p examples/build && rsync -r build/* examples/build && gh-pages -d examples",preversion:"yarn lint",serve:"browser-sync start -s -f build examples --serveStatic examples",start:"yarn build && concurrently --kill-others -n Server,Rollup 'yarn serve' 'rollup -c -w'",format:"eslint . --fix",lint:"eslint .",release:"release-it"},tqt={"@babel/core":"^7.24.6","@babel/plugin-transform-runtime":"^7.24.6","@babel/preset-env":"^7.24.6","@babel/preset-typescript":"^7.24.6","@release-it/conventional-changelog":"^8.0.1","@rollup/plugin-json":"^6.1.0","@rollup/plugin-node-resolve":"^15.2.3","@rollup/plugin-terser":"^0.4.4","@typescript-eslint/eslint-plugin":"^7.11.0","@typescript-eslint/parser":"^7.11.0","browser-sync":"^3.0.2",concurrently:"^8.2.2",eslint:"^8.45.0","eslint-config-prettier":"^9.1.0","eslint-plugin-prettier":"^5.1.3","gh-pages":"^6.1.1",prettier:"^3.2.5","release-it":"^17.3.0",rollup:"^4.18.0","rollup-plugin-bundle-size":"^1.0.3","rollup-plugin-ts":"^3.4.5",typescript:"^5.4.5",vega:"^5.25.0","vega-lite":"^5.9.3"},nqt={vega:"*","vega-lite":"*"},rqt={},iqt={name:jHt,version:BHt,description:UHt,keywords:WHt,license:VHt,author:GHt,contributors:HHt,main:qHt,module:XHt,unpkg:YHt,jsdelivr:QHt,types:KHt,repository:ZHt,files:JHt,scripts:eqt,devDependencies:tqt,peerDependencies:nqt,dependencies:rqt};const rw="#fff",r0e="#888",oqt={background:"#333",view:{stroke:r0e},title:{color:rw,subtitleColor:rw},style:{"guide-label":{fill:rw},"guide-title":{fill:rw}},axis:{domainColor:rw,gridColor:r0e,tickColor:rw}},y0="#4572a7",sqt={background:"#fff",arc:{fill:y0},area:{fill:y0},line:{stroke:y0,strokeWidth:2},path:{stroke:y0},rect:{fill:y0},shape:{stroke:y0},symbol:{fill:y0,strokeWidth:1.5,size:50},axis:{bandPosition:.5,grid:!0,gridColor:"#000000",gridOpacity:1,gridWidth:.5,labelPadding:10,tickSize:5,tickWidth:.5},axisBand:{grid:!1,tickExtra:!0},legend:{labelBaseline:"middle",labelFontSize:11,symbolSize:50,symbolType:"square"},range:{category:["#4572a7","#aa4643","#8aa453","#71598e","#4598ae","#d98445","#94aace","#d09393","#b9cc98","#a99cbc"]}},x0="#30a2da",KV="#cbcbcb",aqt="#999",lqt="#333",i0e="#f0f0f0",o0e="#333",cqt={arc:{fill:x0},area:{fill:x0},axis:{domainColor:KV,grid:!0,gridColor:KV,gridWidth:1,labelColor:aqt,labelFontSize:10,titleColor:lqt,tickColor:KV,tickSize:10,titleFontSize:14,titlePadding:10,labelPadding:4},axisBand:{grid:!1},background:i0e,group:{fill:i0e},legend:{labelColor:o0e,labelFontSize:11,padding:1,symbolSize:30,symbolType:"square",titleColor:o0e,titleFontSize:14,titlePadding:10},line:{stroke:x0,strokeWidth:2},path:{stroke:x0,strokeWidth:.5},rect:{fill:x0},range:{category:["#30a2da","#fc4f30","#e5ae38","#6d904f","#8b8b8b","#b96db8","#ff9e27","#56cc60","#52d2ca","#52689e","#545454","#9fe4f8"],diverging:["#cc0020","#e77866","#f6e7e1","#d6e8ed","#91bfd9","#1d78b5"],heatmap:["#d6e8ed","#cee0e5","#91bfd9","#549cc6","#1d78b5"]},point:{filled:!0,shape:"circle"},shape:{stroke:x0},bar:{binSpacing:2,fill:x0,stroke:null},title:{anchor:"start",fontSize:24,fontWeight:600,offset:20}},b0="#000",uqt={group:{fill:"#e5e5e5"},arc:{fill:b0},area:{fill:b0},line:{stroke:b0},path:{stroke:b0},rect:{fill:b0},shape:{stroke:b0},symbol:{fill:b0,size:40},axis:{domain:!1,grid:!0,gridColor:"#FFFFFF",gridOpacity:1,labelColor:"#7F7F7F",labelPadding:4,tickColor:"#7F7F7F",tickSize:5.67,titleFontSize:16,titleFontWeight:"normal"},legend:{labelBaseline:"middle",labelFontSize:11,symbolSize:40},range:{category:["#000000","#7F7F7F","#1A1A1A","#999999","#333333","#B0B0B0","#4D4D4D","#C9C9C9","#666666","#DCDCDC"]}},fqt=22,dqt="normal",s0e="Benton Gothic, sans-serif",a0e=11.5,hqt="normal",w0="#82c6df",ZV="Benton Gothic Bold, sans-serif",l0e="normal",c0e=13,c2={"category-6":["#ec8431","#829eb1","#c89d29","#3580b1","#adc839","#ab7fb4"],"fire-7":["#fbf2c7","#f9e39c","#f8d36e","#f4bb6a","#e68a4f","#d15a40","#ab4232"],"fireandice-6":["#e68a4f","#f4bb6a","#f9e39c","#dadfe2","#a6b7c6","#849eae"],"ice-7":["#edefee","#dadfe2","#c4ccd2","#a6b7c6","#849eae","#607785","#47525d"]},pqt={background:"#ffffff",title:{anchor:"start",color:"#000000",font:ZV,fontSize:fqt,fontWeight:dqt},arc:{fill:w0},area:{fill:w0},line:{stroke:w0,strokeWidth:2},path:{stroke:w0},rect:{fill:w0},shape:{stroke:w0},symbol:{fill:w0,size:30},axis:{labelFont:s0e,labelFontSize:a0e,labelFontWeight:hqt,titleFont:ZV,titleFontSize:c0e,titleFontWeight:l0e},axisX:{labelAngle:0,labelPadding:4,tickSize:3},axisY:{labelBaseline:"middle",maxExtent:45,minExtent:45,tickSize:2,titleAlign:"left",titleAngle:0,titleX:-45,titleY:-11},legend:{labelFont:s0e,labelFontSize:a0e,symbolType:"square",titleFont:ZV,titleFontSize:c0e,titleFontWeight:l0e},range:{category:c2["category-6"],diverging:c2["fireandice-6"],heatmap:c2["fire-7"],ordinal:c2["fire-7"],ramp:c2["fire-7"]}},_0="#ab5787",lL="#979797",gqt={background:"#f9f9f9",arc:{fill:_0},area:{fill:_0},line:{stroke:_0},path:{stroke:_0},rect:{fill:_0},shape:{stroke:_0},symbol:{fill:_0,size:30},axis:{domainColor:lL,domainWidth:.5,gridWidth:.2,labelColor:lL,tickColor:lL,tickWidth:.2,titleColor:lL},axisBand:{grid:!1},axisX:{grid:!0,tickSize:10},axisY:{domain:!1,grid:!0,tickSize:0},legend:{labelFontSize:11,padding:1,symbolSize:30,symbolType:"square"},range:{category:["#ab5787","#51b2e5","#703c5c","#168dd9","#d190b6","#00609f","#d365ba","#154866","#666666","#c4c4c4"]}},S0="#3e5c69",mqt={background:"#fff",arc:{fill:S0},area:{fill:S0},line:{stroke:S0},path:{stroke:S0},rect:{fill:S0},shape:{stroke:S0},symbol:{fill:S0},axis:{domainWidth:.5,grid:!0,labelPadding:2,tickSize:5,tickWidth:.5,titleFontWeight:"normal"},axisBand:{grid:!1},axisX:{gridWidth:.2},axisY:{gridDash:[3],gridWidth:.4},legend:{labelFontSize:11,padding:1,symbolType:"square"},range:{category:["#3e5c69","#6793a6","#182429","#0570b0","#3690c0","#74a9cf","#a6bddb","#e2ddf2"]}},jc="#1696d2",u0e="#000000",vqt="#FFFFFF",cL="Lato",JV="Lato",yqt="Lato",xqt="#DEDDDD",bqt=18,u2={"main-colors":["#1696d2","#d2d2d2","#000000","#fdbf11","#ec008b","#55b748","#5c5859","#db2b27"],"shades-blue":["#CFE8F3","#A2D4EC","#73BFE2","#46ABDB","#1696D2","#12719E","#0A4C6A","#062635"],"shades-gray":["#F5F5F5","#ECECEC","#E3E3E3","#DCDBDB","#D2D2D2","#9D9D9D","#696969","#353535"],"shades-yellow":["#FFF2CF","#FCE39E","#FDD870","#FCCB41","#FDBF11","#E88E2D","#CA5800","#843215"],"shades-magenta":["#F5CBDF","#EB99C2","#E46AA7","#E54096","#EC008B","#AF1F6B","#761548","#351123"],"shades-green":["#DCEDD9","#BCDEB4","#98CF90","#78C26D","#55B748","#408941","#2C5C2D","#1A2E19"],"shades-black":["#D5D5D4","#ADABAC","#848081","#5C5859","#332D2F","#262223","#1A1717","#0E0C0D"],"shades-red":["#F8D5D4","#F1AAA9","#E9807D","#E25552","#DB2B27","#A4201D","#6E1614","#370B0A"],"one-group":["#1696d2","#000000"],"two-groups-cat-1":["#1696d2","#000000"],"two-groups-cat-2":["#1696d2","#fdbf11"],"two-groups-cat-3":["#1696d2","#db2b27"],"two-groups-seq":["#a2d4ec","#1696d2"],"three-groups-cat":["#1696d2","#fdbf11","#000000"],"three-groups-seq":["#a2d4ec","#1696d2","#0a4c6a"],"four-groups-cat-1":["#000000","#d2d2d2","#fdbf11","#1696d2"],"four-groups-cat-2":["#1696d2","#ec0008b","#fdbf11","#5c5859"],"four-groups-seq":["#cfe8f3","#73bf42","#1696d2","#0a4c6a"],"five-groups-cat-1":["#1696d2","#fdbf11","#d2d2d2","#ec008b","#000000"],"five-groups-cat-2":["#1696d2","#0a4c6a","#d2d2d2","#fdbf11","#332d2f"],"five-groups-seq":["#cfe8f3","#73bf42","#1696d2","#0a4c6a","#000000"],"six-groups-cat-1":["#1696d2","#ec008b","#fdbf11","#000000","#d2d2d2","#55b748"],"six-groups-cat-2":["#1696d2","#d2d2d2","#ec008b","#fdbf11","#332d2f","#0a4c6a"],"six-groups-seq":["#cfe8f3","#a2d4ec","#73bfe2","#46abdb","#1696d2","#12719e"],"diverging-colors":["#ca5800","#fdbf11","#fdd870","#fff2cf","#cfe8f3","#73bfe2","#1696d2","#0a4c6a"]},wqt={background:vqt,title:{anchor:"start",fontSize:bqt,font:cL},axisX:{domain:!0,domainColor:u0e,domainWidth:1,grid:!1,labelFontSize:12,labelFont:JV,labelAngle:0,tickColor:u0e,tickSize:5,titleFontSize:12,titlePadding:10,titleFont:cL},axisY:{domain:!1,domainWidth:1,grid:!0,gridColor:xqt,gridWidth:1,labelFontSize:12,labelFont:JV,labelPadding:8,ticks:!1,titleFontSize:12,titlePadding:10,titleFont:cL,titleAngle:0,titleY:-10,titleX:18},legend:{labelFontSize:12,labelFont:JV,symbolSize:100,titleFontSize:12,titlePadding:10,titleFont:cL,orient:"right",offset:10},view:{stroke:"transparent"},range:{category:u2["six-groups-cat-1"],diverging:u2["diverging-colors"],heatmap:u2["diverging-colors"],ordinal:u2["six-groups-seq"],ramp:u2["shades-blue"]},area:{fill:jc},rect:{fill:jc},line:{color:jc,stroke:jc,strokeWidth:5},trail:{color:jc,stroke:jc,strokeWidth:0,size:1},path:{stroke:jc,strokeWidth:.5},point:{filled:!0},text:{font:yqt,color:jc,fontSize:11,align:"center",fontWeight:400,size:11},style:{bar:{fill:jc,stroke:null}},arc:{fill:jc},shape:{stroke:jc},symbol:{fill:jc,size:30}},C0="#3366CC",f0e="#ccc",uL="Arial, sans-serif",_qt={arc:{fill:C0},area:{fill:C0},path:{stroke:C0},rect:{fill:C0},shape:{stroke:C0},symbol:{stroke:C0},circle:{fill:C0},background:"#fff",padding:{top:10,right:10,bottom:10,left:10},style:{"guide-label":{font:uL,fontSize:12},"guide-title":{font:uL,fontSize:12},"group-title":{font:uL,fontSize:12}},title:{font:uL,fontSize:14,fontWeight:"bold",dy:-3,anchor:"start"},axis:{gridColor:f0e,tickColor:f0e,domain:!1,grid:!0},range:{category:["#4285F4","#DB4437","#F4B400","#0F9D58","#AB47BC","#00ACC1","#FF7043","#9E9D24","#5C6BC0","#F06292","#00796B","#C2185B"],heatmap:["#c6dafc","#5e97f6","#2a56c6"]}},vae=t=>t*(1/3+1),d0e=vae(9),h0e=vae(10),p0e=vae(12),f2="Segoe UI",g0e="wf_standard-font, helvetica, arial, sans-serif",m0e="#252423",d2="#605E5C",v0e="transparent",Sqt="#C8C6C4",of="#118DFF",Cqt="#12239E",Oqt="#E66C37",Eqt="#6B007B",Tqt="#E044A7",kqt="#744EC2",Aqt="#D9B300",Pqt="#D64550",_6e=of,S6e="#DEEFFF",y0e=[S6e,_6e],Mqt=[S6e,"#c7e4ff","#b0d9ff","#9aceff","#83c3ff","#6cb9ff","#55aeff","#3fa3ff","#2898ff",_6e],Rqt={view:{stroke:v0e},background:v0e,font:f2,header:{titleFont:g0e,titleFontSize:p0e,titleColor:m0e,labelFont:f2,labelFontSize:h0e,labelColor:d2},axis:{ticks:!1,grid:!1,domain:!1,labelColor:d2,labelFontSize:d0e,titleFont:g0e,titleColor:m0e,titleFontSize:p0e,titleFontWeight:"normal"},axisQuantitative:{tickCount:3,grid:!0,gridColor:Sqt,gridDash:[1,5],labelFlush:!1},axisBand:{tickExtra:!0},axisX:{labelPadding:5},axisY:{labelPadding:10},bar:{fill:of},line:{stroke:of,strokeWidth:3,strokeCap:"round",strokeJoin:"round"},text:{font:f2,fontSize:d0e,fill:d2},arc:{fill:of},area:{fill:of,line:!0,opacity:.6},path:{stroke:of},rect:{fill:of},point:{fill:of,filled:!0,size:75},shape:{stroke:of},symbol:{fill:of,strokeWidth:1.5,size:50},legend:{titleFont:f2,titleFontWeight:"bold",titleColor:d2,labelFont:f2,labelFontSize:h0e,labelColor:d2,symbolType:"circle",symbolSize:75},range:{category:[of,Cqt,Oqt,Eqt,Tqt,kqt,Aqt,Pqt],diverging:y0e,heatmap:y0e,ordinal:Mqt}},e9='IBM Plex Sans,system-ui,-apple-system,BlinkMacSystemFont,".sfnstext-regular",sans-serif',Dqt='IBM Plex Sans Condensed, system-ui, -apple-system, BlinkMacSystemFont, ".SFNSText-Regular", sans-serif',t9=400,fL={textPrimary:{g90:"#f4f4f4",g100:"#f4f4f4",white:"#161616",g10:"#161616"},textSecondary:{g90:"#c6c6c6",g100:"#c6c6c6",white:"#525252",g10:"#525252"},layerAccent01:{white:"#e0e0e0",g10:"#e0e0e0",g90:"#525252",g100:"#393939"},gridBg:{white:"#ffffff",g10:"#ffffff",g90:"#161616",g100:"#161616"}},Iqt=["#8a3ffc","#33b1ff","#007d79","#ff7eb6","#fa4d56","#fff1f1","#6fdc8c","#4589ff","#d12771","#d2a106","#08bdba","#bae6ff","#ba4e00","#d4bbff"],Lqt=["#6929c4","#1192e8","#005d5d","#9f1853","#fa4d56","#570408","#198038","#002d9c","#ee538b","#b28600","#009d9a","#012749","#8a3800","#a56eff"];function J6({theme:t,background:e}){const n=["white","g10"].includes(t)?"light":"dark",r=fL.gridBg[t],i=fL.textPrimary[t],o=fL.textSecondary[t],s=n==="dark"?Iqt:Lqt,a=n==="dark"?"#d4bbff":"#6929c4";return{background:e,arc:{fill:a},area:{fill:a},path:{stroke:a},rect:{fill:a},shape:{stroke:a},symbol:{stroke:a},circle:{fill:a},view:{fill:r,stroke:r},group:{fill:r},title:{color:i,anchor:"start",dy:-15,fontSize:16,font:e9,fontWeight:600},axis:{labelColor:o,labelFontSize:12,labelFont:Dqt,labelFontWeight:t9,titleColor:i,titleFontWeight:600,titleFontSize:12,grid:!0,gridColor:fL.layerAccent01[t],labelAngle:0},axisX:{titlePadding:10},axisY:{titlePadding:2.5},style:{"guide-label":{font:e9,fill:o,fontWeight:t9},"guide-title":{font:e9,fill:o,fontWeight:t9}},range:{category:s,diverging:["#750e13","#a2191f","#da1e28","#fa4d56","#ff8389","#ffb3b8","#ffd7d9","#fff1f1","#e5f6ff","#bae6ff","#82cfff","#33b1ff","#1192e8","#0072c3","#00539a","#003a6d"],heatmap:["#f6f2ff","#e8daff","#d4bbff","#be95ff","#a56eff","#8a3ffc","#6929c4","#491d8b","#31135e","#1c0f30"]}}}const $qt=J6({theme:"white",background:"#ffffff"}),Fqt=J6({theme:"g10",background:"#f4f4f4"}),Nqt=J6({theme:"g90",background:"#262626"}),zqt=J6({theme:"g100",background:"#161616"}),jqt=iqt.version,Bqt=Object.freeze(Object.defineProperty({__proto__:null,carbong10:Fqt,carbong100:zqt,carbong90:Nqt,carbonwhite:$qt,dark:oqt,excel:sqt,fivethirtyeight:cqt,ggplot2:uqt,googlecharts:_qt,latimes:pqt,powerbi:Rqt,quartz:gqt,urbaninstitute:wqt,version:jqt,vox:mqt},Symbol.toStringTag,{value:"Module"}));function Uqt(t,e,n,r){if(We(t))return`[${t.map(i=>e(gt(i)?i:x0e(i,n))).join(", ")}]`;if(ht(t)){let i="";const{title:o,image:s,...a}=t;o&&(i+=`

${e(o)}

`),s&&(i+=``);const l=Object.keys(a);if(l.length>0){i+="";for(const c of l){let u=a[c];u!==void 0&&(ht(u)&&(u=x0e(u,n)),i+=``)}i+="
${e(c)}${e(u)}
"}return i||"{}"}return e(t)}function Wqt(t){const e=[];return function(n,r){if(typeof r!="object"||r===null)return r;const i=e.indexOf(this)+1;return e.length=i,e.length>t?"[Object]":e.indexOf(r)>=0?"[Circular]":(e.push(r),r)}}function x0e(t,e){return JSON.stringify(t,Wqt(e))}var Vqt=`#vg-tooltip-element { + : v !== v && u === u ? ${r} : `}var E5t={operator:(t,e)=>t2(t,["_"],e.code),parameter:(t,e)=>t2(t,["datum","_"],e.code),event:(t,e)=>t2(t,["event"],e.code),handler:(t,e)=>{const n=`var datum=event.item&&event.item.datum;return ${e.code};`;return t2(t,["_","event"],n)},encode:(t,e)=>{const{marktype:n,channels:r}=e;let i="var o=item,datum=o.datum,m=0,$;";for(const o in r){const s="o["+rt(o)+"]";i+=`$=${r[o].code};if(${s}!==$)${s}=$,m=1;`}return i+=_5t(r,n),i+="return m;",t2(t,["item","_"],i)},codegen:{get(t){const e=`[${t.map(rt).join("][")}]`,n=Function("_",`return _${e};`);return n.path=e,n},comparator(t,e){let n;const r=(o,s)=>{const a=e[s];let l,c;return o.path?(l=`a${o.path}`,c=`b${o.path}`):((n=n||{})["f"+s]=o,l=`this.f${s}(a)`,c=`this.f${s}(b)`),O5t(l,c,-a,a)},i=Function("a","b","var u, v; return "+t.map(r).join("")+"0;");return n?i.bind(n):i}}};function T5t(t){const e=this;S5t(t.type)||!t.type?e.operator(t,t.update?e.operatorExpression(t.update):null):e.transform(t,t.type)}function k5t(t){const e=this;if(t.params){const n=e.get(t.id);n||je("Invalid operator id: "+t.id),e.dataflow.connect(n,n.parameters(e.parseParameters(t.params),t.react,t.initonly))}}function A5t(t,e){e=e||{};const n=this;for(const r in t){const i=t[r];e[r]=We(i)?i.map(o=>Rve(o,n,e)):Rve(i,n,e)}return e}function Rve(t,e,n){if(!t||!ht(t))return t;for(let r=0,i=Dve.length,o;ri&&i.$tupleid?jt:i);return e.fn[n]||(e.fn[n]=gne(r,t.$order,e.expr.codegen))}function L5t(t,e){const n=t.$encode,r={};for(const i in n){const o=n[i];r[i]=kl(e.encodeExpression(o.$expr),o.$fields),r[i].output=o.$output}return r}function $5t(t,e){return e}function F5t(t,e){const n=t.$subflow;return function(r,i,o){const s=e.fork().parse(n),a=s.get(n.operators[0].id),l=s.signals.parent;return l&&l.set(o),a.detachSubflow=()=>e.detach(s),a}}function N5t(){return jt}function z5t(t){var e=this,n=t.filter!=null?e.eventExpression(t.filter):void 0,r=t.stream!=null?e.get(t.stream):void 0,i;t.source?r=e.events(t.source,t.type,n):t.merge&&(i=t.merge.map(o=>e.get(o)),r=i[0].merge.apply(i[0],i.slice(1))),t.between&&(i=t.between.map(o=>e.get(o)),r=r.between(i[0],i[1])),t.filter&&(r=r.filter(n)),t.throttle!=null&&(r=r.throttle(+t.throttle)),t.debounce!=null&&(r=r.debounce(+t.debounce)),r==null&&je("Invalid stream definition: "+JSON.stringify(t)),t.consume&&r.consume(!0),e.stream(t,r)}function j5t(t){var e=this,n=ht(n=t.source)?n.$ref:n,r=e.get(n),i=null,o=t.update,s=void 0;r||je("Source not defined: "+t.source),i=t.target&&t.target.$expr?e.eventExpression(t.target.$expr):e.get(t.target),o&&o.$expr&&(o.$params&&(s=e.parseParameters(o.$params)),o=e.handlerExpression(o.$expr)),e.update(t,r,i,o,s)}const B5t={skip:!0};function U5t(t){var e=this,n={};if(t.signals){var r=n.signals={};Object.keys(e.signals).forEach(o=>{const s=e.signals[o];t.signals(o,s)&&(r[o]=s.value)})}if(t.data){var i=n.data={};Object.keys(e.data).forEach(o=>{const s=e.data[o];t.data(o,s)&&(i[o]=s.input.value)})}return e.subcontext&&t.recurse!==!1&&(n.subcontext=e.subcontext.map(o=>o.getState(t))),n}function W5t(t){var e=this,n=e.dataflow,r=t.data,i=t.signals;Object.keys(i||{}).forEach(o=>{n.update(e.signals[o],i[o],B5t)}),Object.keys(r||{}).forEach(o=>{n.pulse(e.data[o].input,n.changeset().remove(Tu).insert(r[o]))}),(t.subcontext||[]).forEach((o,s)=>{const a=e.subcontext[s];a&&a.setState(o)})}function Tze(t,e,n,r){return new kze(t,e,n,r)}function kze(t,e,n,r){this.dataflow=t,this.transforms=e,this.events=t.events.bind(t),this.expr=r||E5t,this.signals={},this.scales={},this.nodes={},this.data={},this.fn={},n&&(this.functions=Object.create(n),this.functions.context=this)}function Ive(t){this.dataflow=t.dataflow,this.transforms=t.transforms,this.events=t.events,this.expr=t.expr,this.signals=Object.create(t.signals),this.scales=Object.create(t.scales),this.nodes=Object.create(t.nodes),this.data=Object.create(t.data),this.fn=Object.create(t.fn),t.functions&&(this.functions=Object.create(t.functions),this.functions.context=this)}kze.prototype=Ive.prototype={fork(){const t=new Ive(this);return(this.subcontext||(this.subcontext=[])).push(t),t},detach(t){this.subcontext=this.subcontext.filter(n=>n!==t);const e=Object.keys(t.nodes);for(const n of e)t.nodes[n]._targets=null;for(const n of e)t.nodes[n].detach();t.nodes=null},get(t){return this.nodes[t]},set(t,e){return this.nodes[t]=e},add(t,e){const n=this,r=n.dataflow,i=t.value;if(n.set(t.id,e),C5t(t.type)&&i&&(i.$ingest?r.ingest(e,i.$ingest,i.$format):i.$request?r.preload(e,i.$request,i.$format):r.pulse(e,r.changeset().insert(i))),t.root&&(n.root=e),t.parent){let o=n.get(t.parent.$ref);o?(r.connect(o,[e]),e.targets().add(o)):(n.unresolved=n.unresolved||[]).push(()=>{o=n.get(t.parent.$ref),r.connect(o,[e]),e.targets().add(o)})}if(t.signal&&(n.signals[t.signal]=e),t.scale&&(n.scales[t.scale]=e),t.data)for(const o in t.data){const s=n.data[o]||(n.data[o]={});t.data[o].forEach(a=>s[a]=e)}},resolve(){return(this.unresolved||[]).forEach(t=>t()),delete this.unresolved,this},operator(t,e){this.add(t,this.dataflow.add(t.value,e))},transform(t,e){this.add(t,this.dataflow.add(this.transforms[Voe(e)]))},stream(t,e){this.set(t.id,e)},update(t,e,n,r,i){this.dataflow.on(e,n,r,i,t.options)},operatorExpression(t){return this.expr.operator(this,t)},parameterExpression(t){return this.expr.parameter(this,t)},eventExpression(t){return this.expr.event(this,t)},handlerExpression(t){return this.expr.handler(this,t)},encodeExpression(t){return this.expr.encode(this,t)},parse:b5t,parseOperator:T5t,parseOperatorParameters:k5t,parseParameters:A5t,parseStream:z5t,parseUpdate:j5t,getState:U5t,setState:W5t};function V5t(t){const e=t.container();e&&(e.setAttribute("role","graphics-document"),e.setAttribute("aria-roleDescription","visualization"),Aze(e,t.description()))}function Aze(t,e){t&&(e==null?t.removeAttribute("aria-label"):t.setAttribute("aria-label",e))}function G5t(t){t.add(null,e=>(t._background=e.bg,t._resize=1,e.bg),{bg:t._signals.background})}const IV="default";function H5t(t){const e=t._signals.cursor||(t._signals.cursor=t.add({user:IV,item:null}));t.on(t.events("view","pointermove"),e,(n,r)=>{const i=e.value,o=i?gt(i)?i:i.user:IV,s=r.item&&r.item.cursor||null;return i&&o===i.user&&s==i.item?i:{user:o,item:s}}),t.add(null,function(n){let r=n.cursor,i=this.value;return gt(r)||(i=r.item,r=r.user),wY(t,r&&r!==IV?r:i||r),i},{cursor:e})}function wY(t,e){const n=t.globalCursor()?typeof document<"u"&&document.body:t.container();if(n)return e==null?n.style.removeProperty("cursor"):n.style.cursor=e}function S5(t,e){var n=t._runtime.data;return vt(n,e)||je("Unrecognized data set: "+e),n[e]}function q5t(t,e){return arguments.length<2?S5(this,t).values.value:YB.call(this,t,l1().remove(Tu).insert(e))}function YB(t,e){BLe(e)||je("Second argument to changes must be a changeset.");const n=S5(this,t);return n.modified=!0,this.pulse(n.input,e)}function X5t(t,e){return YB.call(this,t,l1().insert(e))}function Y5t(t,e){return YB.call(this,t,l1().remove(e))}function Pze(t){var e=t.padding();return Math.max(0,t._viewWidth+e.left+e.right)}function Mze(t){var e=t.padding();return Math.max(0,t._viewHeight+e.top+e.bottom)}function QB(t){var e=t.padding(),n=t._origin;return[e.left+n[0],e.top+n[1]]}function Q5t(t){var e=QB(t),n=Pze(t),r=Mze(t);t._renderer.background(t.background()),t._renderer.resize(n,r,e),t._handler.origin(e),t._resizeListeners.forEach(i=>{try{i(n,r)}catch(o){t.error(o)}})}function K5t(t,e,n){var r=t._renderer,i=r&&r.canvas(),o,s,a;return i&&(a=QB(t),s=e.changedTouches?e.changedTouches[0]:e,o=$B(s,i),o[0]-=a[0],o[1]-=a[1]),e.dataflow=t,e.item=n,e.vega=Z5t(t,n,o),e}function Z5t(t,e,n){const r=e?e.mark.marktype==="group"?e:e.mark.group:null;function i(s){var a=r,l;if(s){for(l=e;l;l=l.mark.group)if(l.mark.name===s){a=l;break}}return a&&a.mark&&a.mark.interactive?a:{}}function o(s){if(!s)return n;gt(s)&&(s=i(s));const a=n.slice();for(;s;)a[0]-=s.x||0,a[1]-=s.y||0,s=s.mark&&s.mark.group;return a}return{view:ta(t),item:ta(e||{}),group:i,xy:o,x:s=>o(s)[0],y:s=>o(s)[1]}}const Lve="view",J5t="timer",ezt="window",tzt={trap:!1};function nzt(t){const e=cn({defaults:{}},t),n=(r,i)=>{i.forEach(o=>{We(r[o])&&(r[o]=Wf(r[o]))})};return n(e.defaults,["prevent","allow"]),n(e,["view","window","selector"]),e}function Rze(t,e,n,r){t._eventListeners.push({type:n,sources:pt(e),handler:r})}function rzt(t,e){var n=t._eventConfig.defaults,r=n.prevent,i=n.allow;return r===!1||i===!0?!1:r===!0||i===!1?!0:r?r[e]:i?!i[e]:t.preventDefault()}function QI(t,e,n){const r=t._eventConfig&&t._eventConfig[e];return r===!1||ht(r)&&!r[n]?(t.warn(`Blocked ${e} ${n} event listener.`),!1):!0}function izt(t,e,n){var r=this,i=new nB(n),o=function(c,u){r.runAsync(null,()=>{t===Lve&&rzt(r,e)&&c.preventDefault(),i.receive(K5t(r,c,u))})},s;if(t===J5t)QI(r,"timer",e)&&r.timer(o,e);else if(t===Lve)QI(r,"view",e)&&r.addEventListener(e,o,tzt);else if(t===ezt?QI(r,"window",e)&&typeof window<"u"&&(s=[window]):typeof document<"u"&&QI(r,"selector",e)&&(s=Array.from(document.querySelectorAll(t))),!s)r.warn("Can not resolve event source: "+t);else{for(var a=0,l=s.length;a=0;)e[i].stop();for(i=r.length;--i>=0;)for(s=r[i],o=s.sources.length;--o>=0;)s.sources[o].removeEventListener(s.type,s.handler);for(t&&t.call(this,this._handler,null,null,null),i=n.length;--i>=0;)l=n[i].type,a=n[i].handler,this._handler.off(l,a);return this}function hc(t,e,n){const r=document.createElement(t);for(const i in e)r.setAttribute(i,e[i]);return n!=null&&(r.textContent=n),r}const azt="vega-bind",lzt="vega-bind-name",czt="vega-bind-radio";function uzt(t,e,n){if(!e)return;const r=n.param;let i=n.state;return i||(i=n.state={elements:null,active:!1,set:null,update:s=>{s!=t.signal(r.signal)&&t.runAsync(null,()=>{i.source=!0,t.signal(r.signal,s)})}},r.debounce&&(i.update=mne(r.debounce,i.update))),(r.input==null&&r.element?fzt:hzt)(i,e,r,t),i.active||(t.on(t._signals[r.signal],null,()=>{i.source?i.source=!1:i.set(t.signal(r.signal))}),i.active=!0),i}function fzt(t,e,n,r){const i=n.event||"input",o=()=>t.update(e.value);r.signal(n.signal,e.value),e.addEventListener(i,o),Rze(r,e,i,o),t.set=s=>{e.value=s,e.dispatchEvent(dzt(i))}}function dzt(t){return typeof Event<"u"?new Event(t):{type:t}}function hzt(t,e,n,r){const i=r.signal(n.signal),o=hc("div",{class:azt}),s=n.input==="radio"?o:o.appendChild(hc("label"));s.appendChild(hc("span",{class:lzt},n.name||n.signal)),e.appendChild(o);let a=pzt;switch(n.input){case"checkbox":a=gzt;break;case"select":a=mzt;break;case"radio":a=vzt;break;case"range":a=yzt;break}a(t,s,n,i)}function pzt(t,e,n,r){const i=hc("input");for(const o in n)o!=="signal"&&o!=="element"&&i.setAttribute(o==="input"?"type":o,n[o]);i.setAttribute("name",n.signal),i.value=r,e.appendChild(i),i.addEventListener("input",()=>t.update(i.value)),t.elements=[i],t.set=o=>i.value=o}function gzt(t,e,n,r){const i={type:"checkbox",name:n.signal};r&&(i.checked=!0);const o=hc("input",i);e.appendChild(o),o.addEventListener("change",()=>t.update(o.checked)),t.elements=[o],t.set=s=>o.checked=!!s||null}function mzt(t,e,n,r){const i=hc("select",{name:n.signal}),o=n.labels||[];n.options.forEach((s,a)=>{const l={value:s};C5(s,r)&&(l.selected=!0),i.appendChild(hc("option",l,(o[a]||s)+""))}),e.appendChild(i),i.addEventListener("change",()=>{t.update(n.options[i.selectedIndex])}),t.elements=[i],t.set=s=>{for(let a=0,l=n.options.length;a{const l={type:"radio",name:n.signal,value:s};C5(s,r)&&(l.checked=!0);const c=hc("input",l);c.addEventListener("change",()=>t.update(s));const u=hc("label",{},(o[a]||s)+"");return u.prepend(c),i.appendChild(u),c}),t.set=s=>{const a=t.elements,l=a.length;for(let c=0;c{l.textContent=a.value,t.update(+a.value)};a.addEventListener("input",c),a.addEventListener("change",c),t.elements=[a],t.set=u=>{a.value=u,l.textContent=u}}function C5(t,e){return t===e||t+""==e+""}function Dze(t,e,n,r,i,o){return e=e||new r(t.loader()),e.initialize(n,Pze(t),Mze(t),QB(t),i,o).background(t.background())}function Goe(t,e){return e?function(){try{e.apply(this,arguments)}catch(n){t.error(n)}}:null}function xzt(t,e,n,r){const i=new r(t.loader(),Goe(t,t.tooltip())).scene(t.scenegraph().root).initialize(n,QB(t),t);return e&&e.handlers().forEach(o=>{i.on(o.type,o.handler)}),i}function bzt(t,e){const n=this,r=n._renderType,i=n._eventConfig.bind,o=FB(r);t=n._el=t?LV(n,t,!0):null,V5t(n),o||n.error("Unrecognized renderer type: "+r);const s=o.handler||SR,a=t?o.renderer:o.headless;return n._renderer=a?Dze(n,n._renderer,t,a):null,n._handler=xzt(n,n._handler,t,s),n._redraw=!0,t&&i!=="none"&&(e=e?n._elBind=LV(n,e,!0):t.appendChild(hc("form",{class:"vega-bindings"})),n._bind.forEach(l=>{l.param.element&&i!=="container"&&(l.element=LV(n,l.param.element,!!l.param.input))}),n._bind.forEach(l=>{uzt(n,l.element||e,l)})),n}function LV(t,e,n){if(typeof e=="string")if(typeof document<"u"){if(e=document.querySelector(e),!e)return t.error("Signal bind element not found: "+e),null}else return t.error("DOM document instance not found."),null;if(e&&n)try{e.textContent=""}catch(r){e=null,t.error(r)}return e}const n2=t=>+t||0,wzt=t=>({top:t,bottom:t,left:t,right:t});function zve(t){return ht(t)?{top:n2(t.top),bottom:n2(t.bottom),left:n2(t.left),right:n2(t.right)}:wzt(n2(t))}async function Hoe(t,e,n,r){const i=FB(e),o=i&&i.headless;return o||je("Unrecognized renderer type: "+e),await t.runAsync(),Dze(t,null,null,o,n,r).renderAsync(t._scenegraph.root)}async function _zt(t,e){t!==pv.Canvas&&t!==pv.SVG&&t!==pv.PNG&&je("Unrecognized image type: "+t);const n=await Hoe(this,t,e);return t===pv.SVG?Szt(n.svg(),"image/svg+xml"):n.canvas().toDataURL("image/png")}function Szt(t,e){const n=new Blob([t],{type:e});return window.URL.createObjectURL(n)}async function Czt(t,e){return(await Hoe(this,pv.Canvas,t,e)).canvas()}async function Ozt(t){return(await Hoe(this,pv.SVG,t)).svg()}function Ezt(t,e,n){return Tze(t,IS,UA,n).parse(e)}function Tzt(t){var e=this._runtime.scales;return vt(e,t)||je("Unrecognized scale or projection: "+t),e[t].value}var Ize="width",Lze="height",qoe="padding",jve={skip:!0};function $ze(t,e){var n=t.autosize(),r=t.padding();return e-(n&&n.contains===qoe?r.left+r.right:0)}function Fze(t,e){var n=t.autosize(),r=t.padding();return e-(n&&n.contains===qoe?r.top+r.bottom:0)}function kzt(t){var e=t._signals,n=e[Ize],r=e[Lze],i=e[qoe];function o(){t._autosize=t._resize=1}t._resizeWidth=t.add(null,a=>{t._width=a.size,t._viewWidth=$ze(t,a.size),o()},{size:n}),t._resizeHeight=t.add(null,a=>{t._height=a.size,t._viewHeight=Fze(t,a.size),o()},{size:r});const s=t.add(null,o,{pad:i});t._resizeWidth.rank=n.rank+1,t._resizeHeight.rank=r.rank+1,s.rank=i.rank+1}function Azt(t,e,n,r,i,o){this.runAfter(s=>{let a=0;s._autosize=0,s.width()!==n&&(a=1,s.signal(Ize,n,jve),s._resizeWidth.skip(!0)),s.height()!==r&&(a=1,s.signal(Lze,r,jve),s._resizeHeight.skip(!0)),s._viewWidth!==t&&(s._resize=1,s._viewWidth=t),s._viewHeight!==e&&(s._resize=1,s._viewHeight=e),(s._origin[0]!==i[0]||s._origin[1]!==i[1])&&(s._resize=1,s._origin=i),a&&s.run("enter"),o&&s.runAfter(l=>l.resize())},!1,1)}function Pzt(t){return this._runtime.getState(t||{data:Mzt,signals:Rzt,recurse:!0})}function Mzt(t,e){return e.modified&&We(e.input.value)&&!t.startsWith("_:vega:_")}function Rzt(t,e){return!(t==="parent"||e instanceof IS.proxy)}function Dzt(t){return this.runAsync(null,e=>{e._trigger=!1,e._runtime.setState(t)},e=>{e._trigger=!0}),this}function Izt(t,e){function n(r){t({timestamp:Date.now(),elapsed:r})}this._timers.push(fLt(n,e))}function Lzt(t,e,n,r){const i=t.element();i&&i.setAttribute("title",$zt(r))}function $zt(t){return t==null?"":We(t)?Nze(t):ht(t)&&!Fv(t)?Fzt(t):t+""}function Fzt(t){return Object.keys(t).map(e=>{const n=t[e];return e+": "+(We(n)?Nze(n):zze(n))}).join(` +`)}function Nze(t){return"["+t.map(zze).join(", ")+"]"}function zze(t){return We(t)?"[…]":ht(t)&&!Fv(t)?"{…}":t}function Nzt(){if(this.renderer()==="canvas"&&this._renderer._canvas){let t=null;const e=()=>{t!=null&&t();const n=matchMedia(`(resolution: ${window.devicePixelRatio}dppx)`);n.addEventListener("change",e),t=()=>{n.removeEventListener("change",e)},this._renderer._canvas.getContext("2d").pixelRatio=window.devicePixelRatio||1,this._redraw=!0,this._resize=1,this.resize().runAsync()};e()}}function jze(t,e){const n=this;if(e=e||{},R_.call(n),e.loader&&n.loader(e.loader),e.logger&&n.logger(e.logger),e.logLevel!=null&&n.logLevel(e.logLevel),e.locale||t.locale){const o=cn({},t.locale,e.locale);n.locale(MLe(o.number,o.time))}n._el=null,n._elBind=null,n._renderType=e.renderer||pv.Canvas,n._scenegraph=new IFe;const r=n._scenegraph.root;n._renderer=null,n._tooltip=e.tooltip||Lzt,n._redraw=!0,n._handler=new SR().scene(r),n._globalCursor=!1,n._preventDefault=!1,n._timers=[],n._eventListeners=[],n._resizeListeners=[],n._eventConfig=nzt(t.eventConfig),n.globalCursor(n._eventConfig.globalCursor);const i=Ezt(n,t,e.expr);n._runtime=i,n._signals=i.signals,n._bind=(t.bindings||[]).map(o=>({state:null,param:cn({},o)})),i.root&&i.root.set(r),r.source=i.data.root.input,n.pulse(i.data.root.input,n.changeset().insert(r.items)),n._width=n.width(),n._height=n.height(),n._viewWidth=$ze(n,n._width),n._viewHeight=Fze(n,n._height),n._origin=[0,0],n._resize=0,n._autosize=1,kzt(n),G5t(n),H5t(n),n.description(t.description),e.hover&&n.hover(),e.container&&n.initialize(e.container,e.bind),e.watchPixelRatio&&n._watchPixelRatio()}function KI(t,e){return vt(t._signals,e)?t._signals[e]:je("Unrecognized signal name: "+rt(e))}function Bze(t,e){const n=(t._targets||[]).filter(r=>r._update&&r._update.handler===e);return n.length?n[0]:null}function Bve(t,e,n,r){let i=Bze(n,r);return i||(i=Goe(t,()=>r(e,n.value)),i.handler=r,t.on(n,null,i)),t}function Uve(t,e,n){const r=Bze(e,n);return r&&e._targets.remove(r),t}it(jze,R_,{async evaluate(t,e,n){if(await R_.prototype.evaluate.call(this,t,e),this._redraw||this._resize)try{this._renderer&&(this._resize&&(this._resize=0,Q5t(this)),await this._renderer.renderAsync(this._scenegraph.root)),this._redraw=!1}catch(r){this.error(r)}return n&&u3(this,n),this},dirty(t){this._redraw=!0,this._renderer&&this._renderer.dirty(t)},description(t){if(arguments.length){const e=t!=null?t+"":null;return e!==this._desc&&Aze(this._el,this._desc=e),this}return this._desc},container(){return this._el},scenegraph(){return this._scenegraph},origin(){return this._origin.slice()},signal(t,e,n){const r=KI(this,t);return arguments.length===1?r.value:this.update(r,e,n)},width(t){return arguments.length?this.signal("width",t):this.signal("width")},height(t){return arguments.length?this.signal("height",t):this.signal("height")},padding(t){return arguments.length?this.signal("padding",zve(t)):zve(this.signal("padding"))},autosize(t){return arguments.length?this.signal("autosize",t):this.signal("autosize")},background(t){return arguments.length?this.signal("background",t):this.signal("background")},renderer(t){return arguments.length?(FB(t)||je("Unrecognized renderer type: "+t),t!==this._renderType&&(this._renderType=t,this._resetRenderer()),this):this._renderType},tooltip(t){return arguments.length?(t!==this._tooltip&&(this._tooltip=t,this._resetRenderer()),this):this._tooltip},loader(t){return arguments.length?(t!==this._loader&&(R_.prototype.loader.call(this,t),this._resetRenderer()),this):this._loader},resize(){return this._autosize=1,this.touch(KI(this,"autosize"))},_resetRenderer(){this._renderer&&(this._renderer=null,this.initialize(this._el,this._elBind))},_resizeView:Azt,addEventListener(t,e,n){let r=e;return n&&n.trap===!1||(r=Goe(this,e),r.raw=e),this._handler.on(t,r),this},removeEventListener(t,e){for(var n=this._handler.handlers(t),r=n.length,i,o;--r>=0;)if(o=n[r].type,i=n[r].handler,t===o&&(e===i||e===i.raw)){this._handler.off(o,i);break}return this},addResizeListener(t){const e=this._resizeListeners;return e.includes(t)||e.push(t),this},removeResizeListener(t){var e=this._resizeListeners,n=e.indexOf(t);return n>=0&&e.splice(n,1),this},addSignalListener(t,e){return Bve(this,t,KI(this,t),e)},removeSignalListener(t,e){return Uve(this,KI(this,t),e)},addDataListener(t,e){return Bve(this,t,S5(this,t).values,e)},removeDataListener(t,e){return Uve(this,S5(this,t).values,e)},globalCursor(t){if(arguments.length){if(this._globalCursor!==!!t){const e=wY(this,null);this._globalCursor=!!t,e&&wY(this,e)}return this}else return this._globalCursor},preventDefault(t){return arguments.length?(this._preventDefault=t,this):this._preventDefault},timer:Izt,events:izt,finalize:szt,hover:ozt,data:q5t,change:YB,insert:X5t,remove:Y5t,scale:Tzt,initialize:bzt,toImageURL:_zt,toCanvas:Czt,toSVG:Ozt,getState:Pzt,setState:Dzt,_watchPixelRatio:Nzt});const zzt="view",O5="[",E5="]",Uze="{",Wze="}",jzt=":",Vze=",",Bzt="@",Uzt=">",Wzt=/[[\]{}]/,Vzt={"*":1,arc:1,area:1,group:1,image:1,line:1,path:1,rect:1,rule:1,shape:1,symbol:1,text:1,trail:1};let Gze,Hze;function Hy(t,e,n){return Gze=e||zzt,Hze=n||Vzt,qze(t.trim()).map(_Y)}function Gzt(t){return Hze[t]}function pk(t,e,n,r,i){const o=t.length;let s=0,a;for(;e=0?--s:r&&r.indexOf(a)>=0&&++s}return e}function qze(t){const e=[],n=t.length;let r=0,i=0;for(;i' after between selector: "+t;r=r.map(_Y);const i=_Y(t.slice(1).trim());return i.between?{between:r,stream:i}:(i.between=r,i)}function qzt(t){const e={source:Gze},n=[];let r=[0,0],i=0,o=0,s=t.length,a=0,l,c;if(t[s-1]===Wze){if(a=t.lastIndexOf(Uze),a>=0){try{r=Xzt(t.substring(a+1,s-1))}catch{throw"Invalid throttle specification: "+t}t=t.slice(0,a).trim(),s=t.length}else throw"Unmatched right brace: "+t;a=0}if(!s)throw t;if(t[0]===Bzt&&(i=++a),l=pk(t,a,jzt),l1?(e.type=n[1],i?e.markname=n[0].slice(1):Gzt(n[0])?e.marktype=n[0]:e.source=n[0]):e.type=n[0],e.type.slice(-1)==="!"&&(e.consume=!0,e.type=e.type.slice(0,-1)),c!=null&&(e.filter=c),r[0]&&(e.throttle=r[0]),r[1]&&(e.debounce=r[1]),e}function Xzt(t){const e=t.split(Vze);if(!t.length||e.length>2)throw t;return e.map(n=>{const r=+n;if(r!==r)throw t;return r})}function Yzt(t){return ht(t)?t:{type:t||"pad"}}const r2=t=>+t||0,Qzt=t=>({top:t,bottom:t,left:t,right:t});function Kzt(t){return ht(t)?t.signal?t:{top:r2(t.top),bottom:r2(t.bottom),left:r2(t.left),right:r2(t.right)}:Qzt(r2(t))}const No=t=>ht(t)&&!We(t)?cn({},t):{value:t};function Wve(t,e,n,r){return n!=null?(ht(n)&&!We(n)||We(n)&&n.length&&ht(n[0])?t.update[e]=n:t[r||"enter"][e]={value:n},1):0}function _s(t,e,n){for(const r in e)Wve(t,r,e[r]);for(const r in n)Wve(t,r,n[r],"update")}function kO(t,e,n){for(const r in e)n&&vt(n,r)||(t[r]=cn(t[r]||{},e[r]));return t}function Fw(t,e){return e&&(e.enter&&e.enter[t]||e.update&&e.update[t])}const Xoe="mark",Yoe="frame",Qoe="scope",Zzt="axis",Jzt="axis-domain",ejt="axis-grid",tjt="axis-label",njt="axis-tick",rjt="axis-title",ijt="legend",ojt="legend-band",sjt="legend-entry",ajt="legend-gradient",Xze="legend-label",ljt="legend-symbol",cjt="legend-title",ujt="title",fjt="title-text",djt="title-subtitle";function hjt(t,e,n,r,i){const o={},s={};let a,l,c,u;l="lineBreak",e==="text"&&i[l]!=null&&!Fw(l,t)&&$V(o,l,i[l]),(n=="legend"||String(n).startsWith("axis"))&&(n=null),u=n===Yoe?i.group:n===Xoe?cn({},i.mark,i[e]):null;for(l in u)c=Fw(l,t)||(l==="fill"||l==="stroke")&&(Fw("fill",t)||Fw("stroke",t)),c||$V(o,l,u[l]);pt(r).forEach(f=>{const d=i.style&&i.style[f];for(const h in d)Fw(h,t)||$V(o,h,d[h])}),t=cn({},t);for(l in o)u=o[l],u.signal?(a=a||{})[l]=u:s[l]=u;return t.enter=cn(s,t.enter),a&&(t.update=cn(a,t.update)),t}function $V(t,e,n){t[e]=n&&n.signal?{signal:n.signal}:{value:n}}const Yze=t=>gt(t)?rt(t):t.signal?`(${t.signal})`:Qze(t);function KB(t){if(t.gradient!=null)return gjt(t);let e=t.signal?`(${t.signal})`:t.color?pjt(t.color):t.field!=null?Qze(t.field):t.value!==void 0?rt(t.value):void 0;return t.scale!=null&&(e=mjt(t,e)),e===void 0&&(e=null),t.exponent!=null&&(e=`pow(${e},${k3(t.exponent)})`),t.mult!=null&&(e+=`*${k3(t.mult)}`),t.offset!=null&&(e+=`+${k3(t.offset)}`),t.round&&(e=`round(${e})`),e}const ZI=(t,e,n,r)=>`(${t}(${[e,n,r].map(KB).join(",")})+'')`;function pjt(t){return t.c?ZI("hcl",t.h,t.c,t.l):t.h||t.s?ZI("hsl",t.h,t.s,t.l):t.l||t.a?ZI("lab",t.l,t.a,t.b):t.r||t.g||t.b?ZI("rgb",t.r,t.g,t.b):null}function gjt(t){const e=[t.start,t.stop,t.count].map(n=>n==null?null:rt(n));for(;e.length&&$n(e)==null;)e.pop();return e.unshift(Yze(t.gradient)),`gradient(${e.join(",")})`}function k3(t){return ht(t)?"("+KB(t)+")":t}function Qze(t){return Kze(ht(t)?t:{datum:t})}function Kze(t){let e,n,r;if(t.signal)e="datum",r=t.signal;else if(t.group||t.parent){for(n=Math.max(1,t.level||1),e="item";n-- >0;)e+=".mark.group";t.parent?(r=t.parent,e+=".datum"):r=t.group}else t.datum?(e="datum",r=t.datum):je("Invalid field reference: "+rt(t));return t.signal||(r=gt(r)?Nh(r).map(rt).join("]["):Kze(r)),e+"["+r+"]"}function mjt(t,e){const n=Yze(t.scale);return t.range!=null?e=`lerp(_range(${n}), ${+t.range})`:(e!==void 0&&(e=`_scale(${n}, ${e})`),t.band&&(e=(e?e+"+":"")+`_bandwidth(${n})`+(+t.band==1?"":"*"+k3(t.band)),t.extra&&(e=`(datum.extra ? _scale(${n}, datum.extra.value) : ${e})`)),e==null&&(e="0")),e}function vjt(t){let e="";return t.forEach(n=>{const r=KB(n);e+=n.test?`(${n.test})?${r}:`:r}),$n(e)===":"&&(e+="null"),e}function Zze(t,e,n,r,i,o){const s={};o=o||{},o.encoders={$encode:s},t=hjt(t,e,n,r,i.config);for(const a in t)s[a]=yjt(t[a],e,o,i);return o}function yjt(t,e,n,r){const i={},o={};for(const s in t)t[s]!=null&&(i[s]=bjt(xjt(t[s]),r,n,o));return{$expr:{marktype:e,channels:i},$fields:Object.keys(o),$output:Object.keys(t)}}function xjt(t){return We(t)?vjt(t):KB(t)}function bjt(t,e,n,r){const i=kh(t,e);return i.$fields.forEach(o=>r[o]=1),cn(n,i.$params),i.$expr}const wjt="outer",_jt=["value","update","init","react","bind"];function Vve(t,e){je(t+' for "outer" push: '+rt(e))}function Jze(t,e){const n=t.name;if(t.push===wjt)e.signals[n]||Vve("No prior signal definition",n),_jt.forEach(r=>{t[r]!==void 0&&Vve("Invalid property ",r)});else{const r=e.addSignal(n,t.value);t.react===!1&&(r.react=!1),t.bind&&e.addBinding(n,t.bind)}}function SY(t,e,n,r){this.id=-1,this.type=t,this.value=e,this.params=n,r&&(this.parent=r)}function ZB(t,e,n,r){return new SY(t,e,n,r)}function T5(t,e){return ZB("operator",t,e)}function zt(t){const e={$ref:t.id};return t.id<0&&(t.refs=t.refs||[]).push(e),e}function WA(t,e){return e?{$field:t,$name:e}:{$field:t}}const CY=WA("key");function Gve(t,e){return{$compare:t,$order:e}}function Sjt(t,e){const n={$key:t};return e&&(n.$flat=!0),n}const Cjt="ascending",Ojt="descending";function Ejt(t){return ht(t)?(t.order===Ojt?"-":"+")+JB(t.op,t.field):""}function JB(t,e){return(t&&t.signal?"$"+t.signal:t||"")+(t&&e?"_":"")+(e&&e.signal?"$"+e.signal:e||"")}const Koe="scope",OY="view";function Co(t){return t&&t.signal}function Tjt(t){return t&&t.expr}function A3(t){if(Co(t))return!0;if(ht(t)){for(const e in t)if(A3(t[e]))return!0}return!1}function hf(t,e){return t??e}function zx(t){return t&&t.signal||t}const Hve="timer";function VA(t,e){return(t.merge?Ajt:t.stream?Pjt:t.type?Mjt:je("Invalid stream specification: "+rt(t)))(t,e)}function kjt(t){return t===Koe?OY:t||OY}function Ajt(t,e){const n=t.merge.map(i=>VA(i,e)),r=Zoe({merge:n},t,e);return e.addStream(r).id}function Pjt(t,e){const n=VA(t.stream,e),r=Zoe({stream:n},t,e);return e.addStream(r).id}function Mjt(t,e){let n;t.type===Hve?(n=e.event(Hve,t.throttle),t={between:t.between,filter:t.filter}):n=e.event(kjt(t.source),t.type);const r=Zoe({stream:n},t,e);return Object.keys(r).length===1?n:e.addStream(r).id}function Zoe(t,e,n){let r=e.between;return r&&(r.length!==2&&je('Stream "between" parameter must have 2 entries: '+rt(e)),t.between=[VA(r[0],n),VA(r[1],n)]),r=e.filter?[].concat(e.filter):[],(e.marktype||e.markname||e.markrole)&&r.push(Rjt(e.marktype,e.markname,e.markrole)),e.source===Koe&&r.push("inScope(event.item)"),r.length&&(t.filter=kh("("+r.join(")&&(")+")",n).$expr),(r=e.throttle)!=null&&(t.throttle=+r),(r=e.debounce)!=null&&(t.debounce=+r),e.consume&&(t.consume=!0),t}function Rjt(t,e,n){const r="event.item";return r+(t&&t!=="*"?"&&"+r+".mark.marktype==='"+t+"'":"")+(n?"&&"+r+".mark.role==='"+n+"'":"")+(e?"&&"+r+".mark.name==='"+e+"'":"")}const Djt={code:"_.$value",ast:{type:"Identifier",value:"value"}};function Ijt(t,e,n){const r=t.encode,i={target:n};let o=t.events,s=t.update,a=[];o||je("Signal update missing events specification."),gt(o)&&(o=Hy(o,e.isSubscope()?Koe:OY)),o=pt(o).filter(l=>l.signal||l.scale?(a.push(l),0):1),a.length>1&&(a=[$jt(a)]),o.length&&a.push(o.length>1?{merge:o}:o[0]),r!=null&&(s&&je("Signal encode and update are mutually exclusive."),s="encode(item(),"+rt(r)+")"),i.update=gt(s)?kh(s,e):s.expr!=null?kh(s.expr,e):s.value!=null?s.value:s.signal!=null?{$expr:Djt,$params:{$value:e.signalRef(s.signal)}}:je("Invalid signal update specification."),t.force&&(i.options={force:!0}),a.forEach(l=>e.addUpdate(cn(Ljt(l,e),i)))}function Ljt(t,e){return{source:t.signal?e.signalRef(t.signal):t.scale?e.scaleRef(t.scale):VA(t,e)}}function $jt(t){return{signal:"["+t.map(e=>e.scale?'scale("'+e.scale+'")':e.signal)+"]"}}function Fjt(t,e){const n=e.getSignal(t.name);let r=t.update;t.init&&(r?je("Signals can not include both init and update expressions."):(r=t.init,n.initonly=!0)),r&&(r=kh(r,e),n.update=r.$expr,n.params=r.$params),t.on&&t.on.forEach(i=>Ijt(i,e,n.id))}const Ar=t=>(e,n,r)=>ZB(t,n,e||void 0,r),eje=Ar("aggregate"),Njt=Ar("axisticks"),tje=Ar("bound"),nd=Ar("collect"),qve=Ar("compare"),zjt=Ar("datajoin"),nje=Ar("encode"),jjt=Ar("expression"),Bjt=Ar("facet"),Ujt=Ar("field"),Wjt=Ar("key"),Vjt=Ar("legendentries"),Gjt=Ar("load"),Hjt=Ar("mark"),qjt=Ar("multiextent"),Xjt=Ar("multivalues"),Yjt=Ar("overlap"),Qjt=Ar("params"),rje=Ar("prefacet"),Kjt=Ar("projection"),Zjt=Ar("proxy"),Jjt=Ar("relay"),ije=Ar("render"),e4t=Ar("scale"),f1=Ar("sieve"),t4t=Ar("sortitems"),oje=Ar("viewlayout"),n4t=Ar("values");let r4t=0;const sje={min:"min",max:"max",count:"sum"};function i4t(t,e){const n=t.type||"linear";H3e(n)||je("Unrecognized scale type: "+rt(n)),e.addScale(t.name,{type:n,domain:void 0})}function o4t(t,e){const n=e.getScale(t.name).params;let r;n.domain=aje(t.domain,t,e),t.range!=null&&(n.range=cje(t,e,n)),t.interpolate!=null&&g4t(t.interpolate,n),t.nice!=null&&(n.nice=p4t(t.nice,e)),t.bins!=null&&(n.bins=h4t(t.bins,e));for(r in t)vt(n,r)||r==="name"||(n[r]=su(t[r],e))}function su(t,e){return ht(t)?t.signal?e.signalRef(t.signal):je("Unsupported object: "+rt(t)):t}function P3(t,e){return t.signal?e.signalRef(t.signal):t.map(n=>su(n,e))}function e6(t){je("Can not find data set: "+rt(t))}function aje(t,e,n){if(!t){(e.domainMin!=null||e.domainMax!=null)&&je("No scale domain defined for domainMin/domainMax to override.");return}return t.signal?n.signalRef(t.signal):(We(t)?s4t:t.fields?l4t:a4t)(t,e,n)}function s4t(t,e,n){return t.map(r=>su(r,n))}function a4t(t,e,n){const r=n.getData(t.data);return r||e6(t.data),zS(e.type)?r.valuesRef(n,t.field,lje(t.sort,!1)):Y3e(e.type)?r.domainRef(n,t.field):r.extentRef(n,t.field)}function l4t(t,e,n){const r=t.data,i=t.fields.reduce((o,s)=>(s=gt(s)?{data:r,field:s}:We(s)||s.signal?c4t(s,n):s,o.push(s),o),[]);return(zS(e.type)?u4t:Y3e(e.type)?f4t:d4t)(t,n,i)}function c4t(t,e){const n="_:vega:_"+r4t++,r=nd({});if(We(t))r.value={$ingest:t};else if(t.signal){const i="setdata("+rt(n)+","+t.signal+")";r.params.input=e.signalRef(i)}return e.addDataPipeline(n,[r,f1({})]),{data:n,field:"data"}}function u4t(t,e,n){const r=lje(t.sort,!0);let i,o;const s=n.map(c=>{const u=e.getData(c.data);return u||e6(c.data),u.countsRef(e,c.field,r)}),a={groupby:CY,pulse:s};r&&(i=r.op||"count",o=r.field?JB(i,r.field):"count",a.ops=[sje[i]],a.fields=[e.fieldRef(o)],a.as=[o]),i=e.add(eje(a));const l=e.add(nd({pulse:zt(i)}));return o=e.add(n4t({field:CY,sort:e.sortRef(r),pulse:zt(l)})),zt(o)}function lje(t,e){return t&&(!t.field&&!t.op?ht(t)?t.field="key":t={field:"key"}:!t.field&&t.op!=="count"?je("No field provided for sort aggregate op: "+t.op):e&&t.field&&t.op&&!sje[t.op]&&je("Multiple domain scales can not be sorted using "+t.op)),t}function f4t(t,e,n){const r=n.map(i=>{const o=e.getData(i.data);return o||e6(i.data),o.domainRef(e,i.field)});return zt(e.add(Xjt({values:r})))}function d4t(t,e,n){const r=n.map(i=>{const o=e.getData(i.data);return o||e6(i.data),o.extentRef(e,i.field)});return zt(e.add(qjt({extents:r})))}function h4t(t,e){return t.signal||We(t)?P3(t,e):e.objectProperty(t)}function p4t(t,e){return t.signal?e.signalRef(t.signal):ht(t)?{interval:su(t.interval),step:su(t.step)}:su(t)}function g4t(t,e){e.interpolate=su(t.type||t),t.gamma!=null&&(e.interpolateGamma=su(t.gamma))}function cje(t,e,n){const r=e.config.range;let i=t.range;if(i.signal)return e.signalRef(i.signal);if(gt(i)){if(r&&vt(r,i))return t=cn({},t,{range:r[i]}),cje(t,e,n);i==="width"?i=[0,{signal:"width"}]:i==="height"?i=zS(t.type)?[0,{signal:"height"}]:[{signal:"height"},0]:je("Unrecognized scale range value: "+rt(i))}else if(i.scheme){n.scheme=We(i.scheme)?P3(i.scheme,e):su(i.scheme,e),i.extent&&(n.schemeExtent=P3(i.extent,e)),i.count&&(n.schemeCount=su(i.count,e));return}else if(i.step){n.rangeStep=su(i.step,e);return}else{if(zS(t.type)&&!We(i))return aje(i,t,e);We(i)||je("Unsupported range type: "+rt(i))}return i.map(o=>(We(o)?P3:su)(o,e))}function m4t(t,e){const n=e.config.projection||{},r={};for(const i in t)i!=="name"&&(r[i]=EY(t[i],i,e));for(const i in n)r[i]==null&&(r[i]=EY(n[i],i,e));e.addProjection(t.name,r)}function EY(t,e,n){return We(t)?t.map(r=>EY(r,e,n)):ht(t)?t.signal?n.signalRef(t.signal):e==="fit"?t:je("Unsupported parameter object: "+rt(t)):t}const rd="top",AO="left",PO="right",fy="bottom",uje="center",v4t="vertical",y4t="start",x4t="middle",b4t="end",TY="index",Joe="label",w4t="offset",XS="perc",_4t="perc2",pu="value",RR="guide-label",ese="guide-title",S4t="group-title",C4t="group-subtitle",Xve="symbol",M3="gradient",kY="discrete",AY="size",O4t="shape",E4t="fill",T4t="stroke",k4t="strokeWidth",A4t="strokeDash",P4t="opacity",tse=[AY,O4t,E4t,T4t,k4t,A4t,P4t],DR={name:1,style:1,interactive:1},jn={value:0},gu={value:1},t6="group",fje="rect",nse="rule",M4t="symbol",d1="text";function GA(t){return t.type=t6,t.interactive=t.interactive||!1,t}function Al(t,e){const n=(r,i)=>hf(t[r],hf(e[r],i));return n.isVertical=r=>v4t===hf(t.direction,e.direction||(r?e.symbolDirection:e.gradientDirection)),n.gradientLength=()=>hf(t.gradientLength,e.gradientLength||e.gradientWidth),n.gradientThickness=()=>hf(t.gradientThickness,e.gradientThickness||e.gradientHeight),n.entryColumns=()=>hf(t.columns,hf(e.columns,+n.isVertical(!0))),n}function dje(t,e){const n=e&&(e.update&&e.update[t]||e.enter&&e.enter[t]);return n&&n.signal?n:n?n.value:null}function R4t(t,e,n){const r=e.config.style[n];return r&&r[t]}function n6(t,e,n){return`item.anchor === '${y4t}' ? ${t} : item.anchor === '${b4t}' ? ${e} : ${n}`}const rse=n6(rt(AO),rt(PO),rt(uje));function D4t(t){const e=t("tickBand");let n=t("tickOffset"),r,i;return e?e.signal?(r={signal:`(${e.signal}) === 'extent' ? 1 : 0.5`},i={signal:`(${e.signal}) === 'extent'`},ht(n)||(n={signal:`(${e.signal}) === 'extent' ? 0 : ${n}`})):e==="extent"?(r=1,i=!0,n=0):(r=.5,i=!1):(r=t("bandPosition"),i=t("tickExtra")),{extra:i,band:r,offset:n}}function hje(t,e){return e?t?ht(t)?Object.assign({},t,{offset:hje(t.offset,e)}):{value:t,offset:e}:e:t}function Tc(t,e){return e?(t.name=e.name,t.style=e.style||t.style,t.interactive=!!e.interactive,t.encode=kO(t.encode,e,DR)):t.interactive=!1,t}function I4t(t,e,n,r){const i=Al(t,n),o=i.isVertical(),s=i.gradientThickness(),a=i.gradientLength();let l,c,u,f,d;o?(c=[0,1],u=[0,0],f=s,d=a):(c=[0,0],u=[1,0],f=a,d=s);const h={enter:l={opacity:jn,x:jn,y:jn,width:No(f),height:No(d)},update:cn({},l,{opacity:gu,fill:{gradient:e,start:c,stop:u}}),exit:{opacity:jn}};return _s(h,{stroke:i("gradientStrokeColor"),strokeWidth:i("gradientStrokeWidth")},{opacity:i("gradientOpacity")}),Tc({type:fje,role:ajt,encode:h},r)}function L4t(t,e,n,r,i){const o=Al(t,n),s=o.isVertical(),a=o.gradientThickness(),l=o.gradientLength();let c,u,f,d,h="";s?(c="y",f="y2",u="x",d="width",h="1-"):(c="x",f="x2",u="y",d="height");const p={opacity:jn,fill:{scale:e,field:pu}};p[c]={signal:h+"datum."+XS,mult:l},p[u]=jn,p[f]={signal:h+"datum."+_4t,mult:l},p[d]=No(a);const g={enter:p,update:cn({},p,{opacity:gu}),exit:{opacity:jn}};return _s(g,{stroke:o("gradientStrokeColor"),strokeWidth:o("gradientStrokeWidth")},{opacity:o("gradientOpacity")}),Tc({type:fje,role:ojt,key:pu,from:i,encode:g},r)}const $4t=`datum.${XS}<=0?"${AO}":datum.${XS}>=1?"${PO}":"${uje}"`,F4t=`datum.${XS}<=0?"${fy}":datum.${XS}>=1?"${rd}":"${x4t}"`;function Yve(t,e,n,r){const i=Al(t,e),o=i.isVertical(),s=No(i.gradientThickness()),a=i.gradientLength();let l=i("labelOverlap"),c,u,f,d,h="";const p={enter:c={opacity:jn},update:u={opacity:gu,text:{field:Joe}},exit:{opacity:jn}};return _s(p,{fill:i("labelColor"),fillOpacity:i("labelOpacity"),font:i("labelFont"),fontSize:i("labelFontSize"),fontStyle:i("labelFontStyle"),fontWeight:i("labelFontWeight"),limit:hf(t.labelLimit,e.gradientLabelLimit)}),o?(c.align={value:"left"},c.baseline=u.baseline={signal:F4t},f="y",d="x",h="1-"):(c.align=u.align={signal:$4t},c.baseline={value:"top"},f="x",d="y"),c[f]=u[f]={signal:h+"datum."+XS,mult:a},c[d]=u[d]=s,s.offset=hf(t.labelOffset,e.gradientLabelOffset)||0,l=l?{separation:i("labelSeparation"),method:l,order:"datum."+TY}:void 0,Tc({type:d1,role:Xze,style:RR,key:pu,from:r,encode:p,overlap:l},n)}function N4t(t,e,n,r,i){const o=Al(t,e),s=n.entries,a=!!(s&&s.interactive),l=s?s.name:void 0,c=o("clipHeight"),u=o("symbolOffset"),f={data:"value"},d=`(${i}) ? datum.${w4t} : datum.${AY}`,h=c?No(c):{field:AY},p=`datum.${TY}`,g=`max(1, ${i})`;let m,v,y,x,b;h.mult=.5,m={enter:v={opacity:jn,x:{signal:d,mult:.5,offset:u},y:h},update:y={opacity:gu,x:v.x,y:v.y},exit:{opacity:jn}};let w=null,_=null;t.fill||(w=e.symbolBaseFillColor,_=e.symbolBaseStrokeColor),_s(m,{fill:o("symbolFillColor",w),shape:o("symbolType"),size:o("symbolSize"),stroke:o("symbolStrokeColor",_),strokeDash:o("symbolDash"),strokeDashOffset:o("symbolDashOffset"),strokeWidth:o("symbolStrokeWidth")},{opacity:o("symbolOpacity")}),tse.forEach(E=>{t[E]&&(y[E]=v[E]={scale:t[E],field:pu})});const S=Tc({type:M4t,role:ljt,key:pu,from:f,clip:c?!0:void 0,encode:m},n.symbols),O=No(u);O.offset=o("labelOffset"),m={enter:v={opacity:jn,x:{signal:d,offset:O},y:h},update:y={opacity:gu,text:{field:Joe},x:v.x,y:v.y},exit:{opacity:jn}},_s(m,{align:o("labelAlign"),baseline:o("labelBaseline"),fill:o("labelColor"),fillOpacity:o("labelOpacity"),font:o("labelFont"),fontSize:o("labelFontSize"),fontStyle:o("labelFontStyle"),fontWeight:o("labelFontWeight"),limit:o("labelLimit")});const k=Tc({type:d1,role:Xze,style:RR,key:pu,from:f,encode:m},n.labels);return m={enter:{noBound:{value:!c},width:jn,height:c?No(c):jn,opacity:jn},exit:{opacity:jn},update:y={opacity:gu,row:{signal:null},column:{signal:null}}},o.isVertical(!0)?(x=`ceil(item.mark.items.length / ${g})`,y.row.signal=`${p}%${x}`,y.column.signal=`floor(${p} / ${x})`,b={field:["row",p]}):(y.row.signal=`floor(${p} / ${g})`,y.column.signal=`${p} % ${g}`,b={field:p}),y.column.signal=`(${i})?${y.column.signal}:${p}`,r={facet:{data:r,name:"value",groupby:TY}},GA({role:Qoe,from:r,encode:kO(m,s,DR),marks:[S,k],name:l,interactive:a,sort:b})}function z4t(t,e){const n=Al(t,e);return{align:n("gridAlign"),columns:n.entryColumns(),center:{row:!0,column:!1},padding:{row:n("rowPadding"),column:n("columnPadding")}}}const ise='item.orient === "left"',ose='item.orient === "right"',r6=`(${ise} || ${ose})`,j4t=`datum.vgrad && ${r6}`,B4t=n6('"top"','"bottom"','"middle"'),U4t=n6('"right"','"left"','"center"'),W4t=`datum.vgrad && ${ose} ? (${U4t}) : (${r6} && !(datum.vgrad && ${ise})) ? "left" : ${rse}`,V4t=`item._anchor || (${r6} ? "middle" : "start")`,G4t=`${j4t} ? (${ise} ? -90 : 90) : 0`,H4t=`${r6} ? (datum.vgrad ? (${ose} ? "bottom" : "top") : ${B4t}) : "top"`;function q4t(t,e,n,r){const i=Al(t,e),o={enter:{opacity:jn},update:{opacity:gu,x:{field:{group:"padding"}},y:{field:{group:"padding"}}},exit:{opacity:jn}};return _s(o,{orient:i("titleOrient"),_anchor:i("titleAnchor"),anchor:{signal:V4t},angle:{signal:G4t},align:{signal:W4t},baseline:{signal:H4t},text:t.title,fill:i("titleColor"),fillOpacity:i("titleOpacity"),font:i("titleFont"),fontSize:i("titleFontSize"),fontStyle:i("titleFontStyle"),fontWeight:i("titleFontWeight"),limit:i("titleLimit"),lineHeight:i("titleLineHeight")},{align:i("titleAlign"),baseline:i("titleBaseline")}),Tc({type:d1,role:cjt,style:ese,from:r,encode:o},n)}function X4t(t,e){let n;return ht(t)&&(t.signal?n=t.signal:t.path?n="pathShape("+Qve(t.path)+")":t.sphere&&(n="geoShape("+Qve(t.sphere)+', {type: "Sphere"})')),n?e.signalRef(n):!!t}function Qve(t){return ht(t)&&t.signal?t.signal:rt(t)}function pje(t){const e=t.role||"";return e.startsWith("axis")||e.startsWith("legend")||e.startsWith("title")?e:t.type===t6?Qoe:e||Xoe}function Y4t(t){return{marktype:t.type,name:t.name||void 0,role:t.role||pje(t),zindex:+t.zindex||void 0,aria:t.aria,description:t.description}}function Q4t(t,e){return t&&t.signal?e.signalRef(t.signal):t!==!1}function sse(t,e){const n=VLe(t.type);n||je("Unrecognized transform type: "+rt(t.type));const r=ZB(n.type.toLowerCase(),null,gje(n,t,e));return t.signal&&e.addSignal(t.signal,e.proxy(r)),r.metadata=n.metadata||{},r}function gje(t,e,n){const r={},i=t.params.length;for(let o=0;oKve(t,o,n)):Kve(t,i,n)}function Kve(t,e,n){const r=t.type;if(Co(e))return Jve(r)?je("Expression references can not be signals."):FV(r)?n.fieldRef(e):eye(r)?n.compareRef(e):n.signalRef(e.signal);{const i=t.expr||FV(r);return i&&eBt(e)?n.exprRef(e.expr,e.as):i&&tBt(e)?WA(e.field,e.as):Jve(r)?kh(e,n):nBt(r)?zt(n.getData(e).values):FV(r)?WA(e):eye(r)?n.compareRef(e):e}}function Z4t(t,e,n){return gt(e.from)||je('Lookup "from" parameter must be a string literal.'),n.getData(e.from).lookupRef(n,e.key)}function J4t(t,e,n){const r=e[t.name];return t.array?(We(r)||je("Expected an array of sub-parameters. Instead: "+rt(r)),r.map(i=>Zve(t,i,n))):Zve(t,r,n)}function Zve(t,e,n){const r=t.params.length;let i;for(let s=0;st&&t.expr,tBt=t=>t&&t.field,nBt=t=>t==="data",Jve=t=>t==="expr",FV=t=>t==="field",eye=t=>t==="compare";function rBt(t,e,n){let r,i,o,s,a;return t?(r=t.facet)&&(e||je("Only group marks can be faceted."),r.field!=null?s=a=R3(r,n):(t.data?a=zt(n.getData(t.data).aggregate):(o=sse(cn({type:"aggregate",groupby:pt(r.groupby)},r.aggregate),n),o.params.key=n.keyRef(r.groupby),o.params.pulse=R3(r,n),s=a=zt(n.add(o))),i=n.keyRef(r.groupby,!0))):s=zt(n.add(nd(null,[{}]))),s||(s=R3(t,n)),{key:i,pulse:s,parent:a}}function R3(t,e){return t.$ref?t:t.data&&t.data.$ref?t.data:zt(e.getData(t.data).output)}function bb(t,e,n,r,i){this.scope=t,this.input=e,this.output=n,this.values=r,this.aggregate=i,this.index={}}bb.fromEntries=function(t,e){const n=e.length,r=e[n-1],i=e[n-2];let o=e[0],s=null,a=1;for(o&&o.type==="load"&&(o=e[1]),t.add(e[0]);af??"null").join(",")+"),0)",u=kh(c,e);l.update=u.$expr,l.params=u.$params}function i6(t,e){const n=pje(t),r=t.type===t6,i=t.from&&t.from.facet,o=t.overlap;let s=t.layout||n===Qoe||n===Yoe,a,l,c,u,f,d,h;const p=n===Xoe||s||i,g=rBt(t.from,r,e);l=e.add(zjt({key:g.key||(t.key?WA(t.key):void 0),pulse:g.pulse,clean:!r}));const m=zt(l);l=c=e.add(nd({pulse:m})),l=e.add(Hjt({markdef:Y4t(t),interactive:Q4t(t.interactive,e),clip:X4t(t.clip,e),context:{$context:!0},groups:e.lookup(),parent:e.signals.parent?e.signalRef("parent"):null,index:e.markpath(),pulse:zt(l)}));const v=zt(l);l=u=e.add(nje(Zze(t.encode,t.type,n,t.style,e,{mod:!1,pulse:v}))),l.params.parent=e.encode(),t.transform&&t.transform.forEach(_=>{const S=sse(_,e),O=S.metadata;(O.generates||O.changes)&&je("Mark transforms should not generate new data."),O.nomod||(u.params.mod=!0),S.params.pulse=zt(l),e.add(l=S)}),t.sort&&(l=e.add(t4t({sort:e.compareRef(t.sort),pulse:zt(l)})));const y=zt(l);(i||s)&&(s=e.add(oje({layout:e.objectProperty(t.layout),legends:e.legends,mark:v,pulse:y})),d=zt(s));const x=e.add(tje({mark:v,pulse:d||y}));h=zt(x),r&&(p&&(a=e.operators,a.pop(),s&&a.pop()),e.pushState(y,d||h,m),i?iBt(t,e,g):p?oBt(t,e,g):e.parse(t),e.popState(),p&&(s&&a.push(s),a.push(x))),o&&(h=sBt(o,h,e));const b=e.add(ije({pulse:h})),w=e.add(f1({pulse:zt(b)},void 0,e.parent()));t.name!=null&&(f=t.name,e.addData(f,new bb(e,c,b,w)),t.on&&t.on.forEach(_=>{(_.insert||_.remove||_.toggle)&&je("Marks only support modify triggers."),vje(_,e,f)}))}function sBt(t,e,n){const r=t.method,i=t.bound,o=t.separation,s={separation:Co(o)?n.signalRef(o.signal):o,method:Co(r)?n.signalRef(r.signal):r,pulse:e};if(t.order&&(s.sort=n.compareRef({field:t.order})),i){const a=i.tolerance;s.boundTolerance=Co(a)?n.signalRef(a.signal):+a,s.boundScale=n.scaleRef(i.scale),s.boundOrient=i.orient}return zt(n.add(Yjt(s)))}function aBt(t,e){const n=e.config.legend,r=t.encode||{},i=Al(t,n),o=r.legend||{},s=o.name||void 0,a=o.interactive,l=o.style,c={};let u=0,f,d,h;tse.forEach(x=>t[x]?(c[x]=t[x],u=u||t[x]):0),u||je("Missing valid scale for legend.");const p=lBt(t,e.scaleType(u)),g={title:t.title!=null,scales:c,type:p,vgrad:p!=="symbol"&&i.isVertical()},m=zt(e.add(nd(null,[g]))),v={enter:{x:{value:0},y:{value:0}}},y=zt(e.add(Vjt(d={type:p,scale:e.scaleRef(u),count:e.objectProperty(i("tickCount")),limit:e.property(i("symbolLimit")),values:e.objectProperty(t.values),minstep:e.property(t.tickMinStep),formatType:e.property(t.formatType),formatSpecifier:e.property(t.format)})));return p===M3?(h=[I4t(t,u,n,r.gradient),Yve(t,n,r.labels,y)],d.count=d.count||e.signalRef(`max(2,2*floor((${zx(i.gradientLength())})/100))`)):p===kY?h=[L4t(t,u,n,r.gradient,y),Yve(t,n,r.labels,y)]:(f=z4t(t,n),h=[N4t(t,n,r,y,zx(f.columns))],d.size=fBt(t,e,h[0].marks)),h=[GA({role:sjt,from:m,encode:v,marks:h,layout:f,interactive:a})],g.title&&h.push(q4t(t,n,r.title,m)),i6(GA({role:ijt,from:m,encode:kO(uBt(i,t,n),o,DR),marks:h,aria:i("aria"),description:i("description"),zindex:i("zindex"),name:s,interactive:a,style:l}),e)}function lBt(t,e){let n=t.type||Xve;return!t.type&&cBt(t)===1&&(t.fill||t.stroke)&&(n=oie(e)?M3:bX(e)?kY:Xve),n!==M3?n:bX(e)?kY:M3}function cBt(t){return tse.reduce((e,n)=>e+(t[n]?1:0),0)}function uBt(t,e,n){const r={enter:{},update:{}};return _s(r,{orient:t("orient"),offset:t("offset"),padding:t("padding"),titlePadding:t("titlePadding"),cornerRadius:t("cornerRadius"),fill:t("fillColor"),stroke:t("strokeColor"),strokeWidth:n.strokeWidth,strokeDash:n.strokeDash,x:t("legendX"),y:t("legendY"),format:e.format,formatType:e.formatType}),r}function fBt(t,e,n){const r=zx(nye("size",t,n)),i=zx(nye("strokeWidth",t,n)),o=zx(dBt(n[1].encode,e,RR));return kh(`max(ceil(sqrt(${r})+${i}),${o})`,e)}function nye(t,e,n){return e[t]?`scale("${e[t]}",datum)`:dje(t,n[0].encode)}function dBt(t,e,n){return dje("fontSize",t)||R4t("fontSize",e,n)}const hBt=`item.orient==="${AO}"?-90:item.orient==="${PO}"?90:0`;function pBt(t,e){t=gt(t)?{text:t}:t;const n=Al(t,e.config.title),r=t.encode||{},i=r.group||{},o=i.name||void 0,s=i.interactive,a=i.style,l=[],c={},u=zt(e.add(nd(null,[c])));return l.push(vBt(t,n,gBt(t),u)),t.subtitle&&l.push(yBt(t,n,r.subtitle,u)),i6(GA({role:ujt,from:u,encode:mBt(n,i),marks:l,aria:n("aria"),description:n("description"),zindex:n("zindex"),name:o,interactive:s,style:a}),e)}function gBt(t){const e=t.encode;return e&&e.title||cn({name:t.name,interactive:t.interactive,style:t.style},e)}function mBt(t,e){const n={enter:{},update:{}};return _s(n,{orient:t("orient"),anchor:t("anchor"),align:{signal:rse},angle:{signal:hBt},limit:t("limit"),frame:t("frame"),offset:t("offset")||0,padding:t("subtitlePadding")}),kO(n,e,DR)}function vBt(t,e,n,r){const i={value:0},o=t.text,s={enter:{opacity:i},update:{opacity:{value:1}},exit:{opacity:i}};return _s(s,{text:o,align:{signal:"item.mark.group.align"},angle:{signal:"item.mark.group.angle"},limit:{signal:"item.mark.group.limit"},baseline:"top",dx:e("dx"),dy:e("dy"),fill:e("color"),font:e("font"),fontSize:e("fontSize"),fontStyle:e("fontStyle"),fontWeight:e("fontWeight"),lineHeight:e("lineHeight")},{align:e("align"),angle:e("angle"),baseline:e("baseline")}),Tc({type:d1,role:fjt,style:S4t,from:r,encode:s},n)}function yBt(t,e,n,r){const i={value:0},o=t.subtitle,s={enter:{opacity:i},update:{opacity:{value:1}},exit:{opacity:i}};return _s(s,{text:o,align:{signal:"item.mark.group.align"},angle:{signal:"item.mark.group.angle"},limit:{signal:"item.mark.group.limit"},baseline:"top",dx:e("dx"),dy:e("dy"),fill:e("subtitleColor"),font:e("subtitleFont"),fontSize:e("subtitleFontSize"),fontStyle:e("subtitleFontStyle"),fontWeight:e("subtitleFontWeight"),lineHeight:e("subtitleLineHeight")},{align:e("align"),angle:e("angle"),baseline:e("baseline")}),Tc({type:d1,role:djt,style:C4t,from:r,encode:s},n)}function xBt(t,e){const n=[];t.transform&&t.transform.forEach(r=>{n.push(sse(r,e))}),t.on&&t.on.forEach(r=>{vje(r,e,t.name)}),e.addDataPipeline(t.name,bBt(t,e,n))}function bBt(t,e,n){const r=[];let i=null,o=!1,s=!1,a,l,c,u,f;for(t.values?Co(t.values)||A3(t.format)?(r.push(rye(e,t)),r.push(i=g0())):r.push(i=g0({$ingest:t.values,$format:t.format})):t.url?A3(t.url)||A3(t.format)?(r.push(rye(e,t)),r.push(i=g0())):r.push(i=g0({$request:t.url,$format:t.format})):t.source&&(i=a=pt(t.source).map(d=>zt(e.getData(d).output)),r.push(null)),l=0,c=n.length;lt===fy||t===rd,o6=(t,e,n)=>Co(t)?CBt(t.signal,e,n):t===AO||t===rd?e:n,zo=(t,e,n)=>Co(t)?_Bt(t.signal,e,n):yje(t)?e:n,Lf=(t,e,n)=>Co(t)?SBt(t.signal,e,n):yje(t)?n:e,xje=(t,e,n)=>Co(t)?OBt(t.signal,e,n):t===rd?{value:e}:{value:n},wBt=(t,e,n)=>Co(t)?EBt(t.signal,e,n):t===PO?{value:e}:{value:n},_Bt=(t,e,n)=>bje(`${t} === '${rd}' || ${t} === '${fy}'`,e,n),SBt=(t,e,n)=>bje(`${t} !== '${rd}' && ${t} !== '${fy}'`,e,n),CBt=(t,e,n)=>ase(`${t} === '${AO}' || ${t} === '${rd}'`,e,n),OBt=(t,e,n)=>ase(`${t} === '${rd}'`,e,n),EBt=(t,e,n)=>ase(`${t} === '${PO}'`,e,n),bje=(t,e,n)=>(e=e!=null?No(e):e,n=n!=null?No(n):n,iye(e)&&iye(n)?(e=e?e.signal||rt(e.value):null,n=n?n.signal||rt(n.value):null,{signal:`${t} ? (${e}) : (${n})`}):[cn({test:t},e)].concat(n||[])),iye=t=>t==null||Object.keys(t).length===1,ase=(t,e,n)=>({signal:`${t} ? (${u_(e)}) : (${u_(n)})`}),TBt=(t,e,n,r,i)=>({signal:(r!=null?`${t} === '${AO}' ? (${u_(r)}) : `:"")+(n!=null?`${t} === '${fy}' ? (${u_(n)}) : `:"")+(i!=null?`${t} === '${PO}' ? (${u_(i)}) : `:"")+(e!=null?`${t} === '${rd}' ? (${u_(e)}) : `:"")+"(null)"}),u_=t=>Co(t)?t.signal:t==null?null:rt(t),kBt=(t,e)=>e===0?0:Co(t)?{signal:`(${t.signal}) * ${e}`}:{value:t*e},$_=(t,e)=>{const n=t.signal;return n&&n.endsWith("(null)")?{signal:n.slice(0,-6)+e.signal}:t};function ew(t,e,n,r){let i;if(e&&vt(e,t))return e[t];if(vt(n,t))return n[t];if(t.startsWith("title")){switch(t){case"titleColor":i="fill";break;case"titleFont":case"titleFontSize":case"titleFontWeight":i=t[5].toLowerCase()+t.slice(6)}return r[ese][i]}else if(t.startsWith("label")){switch(t){case"labelColor":i="fill";break;case"labelFont":case"labelFontSize":i=t[5].toLowerCase()+t.slice(6)}return r[RR][i]}return null}function oye(t){const e={};for(const n of t)if(n)for(const r in n)e[r]=1;return Object.keys(e)}function ABt(t,e){var n=e.config,r=n.style,i=n.axis,o=e.scaleType(t.scale)==="band"&&n.axisBand,s=t.orient,a,l,c;if(Co(s)){const f=oye([n.axisX,n.axisY]),d=oye([n.axisTop,n.axisBottom,n.axisLeft,n.axisRight]);a={};for(c of f)a[c]=zo(s,ew(c,n.axisX,i,r),ew(c,n.axisY,i,r));l={};for(c of d)l[c]=TBt(s.signal,ew(c,n.axisTop,i,r),ew(c,n.axisBottom,i,r),ew(c,n.axisLeft,i,r),ew(c,n.axisRight,i,r))}else a=s===rd||s===fy?n.axisX:n.axisY,l=n["axis"+s[0].toUpperCase()+s.slice(1)];return a||l||o?cn({},i,a,l,o):i}function PBt(t,e,n,r){const i=Al(t,e),o=t.orient;let s,a;const l={enter:s={opacity:jn},update:a={opacity:gu},exit:{opacity:jn}};_s(l,{stroke:i("domainColor"),strokeCap:i("domainCap"),strokeDash:i("domainDash"),strokeDashOffset:i("domainDashOffset"),strokeWidth:i("domainWidth"),strokeOpacity:i("domainOpacity")});const c=sye(t,0),u=sye(t,1);return s.x=a.x=zo(o,c,jn),s.x2=a.x2=zo(o,u),s.y=a.y=Lf(o,c,jn),s.y2=a.y2=Lf(o,u),Tc({type:nse,role:Jzt,from:r,encode:l},n)}function sye(t,e){return{scale:t.scale,range:e}}function MBt(t,e,n,r,i){const o=Al(t,e),s=t.orient,a=t.gridScale,l=o6(s,1,-1),c=RBt(t.offset,l);let u,f,d;const h={enter:u={opacity:jn},update:d={opacity:gu},exit:f={opacity:jn}};_s(h,{stroke:o("gridColor"),strokeCap:o("gridCap"),strokeDash:o("gridDash"),strokeDashOffset:o("gridDashOffset"),strokeOpacity:o("gridOpacity"),strokeWidth:o("gridWidth")});const p={scale:t.scale,field:pu,band:i.band,extra:i.extra,offset:i.offset,round:o("tickRound")},g=zo(s,{signal:"height"},{signal:"width"}),m=a?{scale:a,range:0,mult:l,offset:c}:{value:0,offset:c},v=a?{scale:a,range:1,mult:l,offset:c}:cn(g,{mult:l,offset:c});return u.x=d.x=zo(s,p,m),u.y=d.y=Lf(s,p,m),u.x2=d.x2=Lf(s,v),u.y2=d.y2=zo(s,v),f.x=zo(s,p),f.y=Lf(s,p),Tc({type:nse,role:ejt,key:pu,from:r,encode:h},n)}function RBt(t,e){if(e!==1)if(!ht(t))t=Co(e)?{signal:`(${e.signal}) * (${t||0})`}:e*(t||0);else{let n=t=cn({},t);for(;n.mult!=null;)if(ht(n.mult))n=n.mult=cn({},n.mult);else return n.mult=Co(e)?{signal:`(${n.mult}) * (${e.signal})`}:n.mult*e,t;n.mult=e}return t}function DBt(t,e,n,r,i,o){const s=Al(t,e),a=t.orient,l=o6(a,-1,1);let c,u,f;const d={enter:c={opacity:jn},update:f={opacity:gu},exit:u={opacity:jn}};_s(d,{stroke:s("tickColor"),strokeCap:s("tickCap"),strokeDash:s("tickDash"),strokeDashOffset:s("tickDashOffset"),strokeOpacity:s("tickOpacity"),strokeWidth:s("tickWidth")});const h=No(i);h.mult=l;const p={scale:t.scale,field:pu,band:o.band,extra:o.extra,offset:o.offset,round:s("tickRound")};return f.y=c.y=zo(a,jn,p),f.y2=c.y2=zo(a,h),u.x=zo(a,p),f.x=c.x=Lf(a,jn,p),f.x2=c.x2=Lf(a,h),u.y=Lf(a,p),Tc({type:nse,role:njt,key:pu,from:r,encode:d},n)}function NV(t,e,n,r,i){return{signal:'flush(range("'+t+'"), scale("'+t+'", datum.value), '+e+","+n+","+r+","+i+")"}}function IBt(t,e,n,r,i,o){const s=Al(t,e),a=t.orient,l=t.scale,c=o6(a,-1,1),u=zx(s("labelFlush")),f=zx(s("labelFlushOffset")),d=s("labelAlign"),h=s("labelBaseline");let p=u===0||!!u,g;const m=No(i);m.mult=c,m.offset=No(s("labelPadding")||0),m.offset.mult=c;const v={scale:l,field:pu,band:.5,offset:hje(o.offset,s("labelOffset"))},y=zo(a,p?NV(l,u,'"left"','"right"','"center"'):{value:"center"},wBt(a,"left","right")),x=zo(a,xje(a,"bottom","top"),p?NV(l,u,'"top"','"bottom"','"middle"'):{value:"middle"}),b=NV(l,u,`-(${f})`,f,0);p=p&&f;const w={opacity:jn,x:zo(a,v,m),y:Lf(a,v,m)},_={enter:w,update:g={opacity:gu,text:{field:Joe},x:w.x,y:w.y,align:y,baseline:x},exit:{opacity:jn,x:w.x,y:w.y}};_s(_,{dx:!d&&p?zo(a,b):null,dy:!h&&p?Lf(a,b):null}),_s(_,{angle:s("labelAngle"),fill:s("labelColor"),fillOpacity:s("labelOpacity"),font:s("labelFont"),fontSize:s("labelFontSize"),fontWeight:s("labelFontWeight"),fontStyle:s("labelFontStyle"),limit:s("labelLimit"),lineHeight:s("labelLineHeight")},{align:d,baseline:h});const S=s("labelBound");let O=s("labelOverlap");return O=O||S?{separation:s("labelSeparation"),method:O,order:"datum.index",bound:S?{scale:l,orient:a,tolerance:S}:null}:void 0,g.align!==y&&(g.align=$_(g.align,y)),g.baseline!==x&&(g.baseline=$_(g.baseline,x)),Tc({type:d1,role:tjt,style:RR,key:pu,from:r,encode:_,overlap:O},n)}function LBt(t,e,n,r){const i=Al(t,e),o=t.orient,s=o6(o,-1,1);let a,l;const c={enter:a={opacity:jn,anchor:No(i("titleAnchor",null)),align:{signal:rse}},update:l=cn({},a,{opacity:gu,text:No(t.title)}),exit:{opacity:jn}},u={signal:`lerp(range("${t.scale}"), ${n6(0,1,.5)})`};return l.x=zo(o,u),l.y=Lf(o,u),a.angle=zo(o,jn,kBt(s,90)),a.baseline=zo(o,xje(o,fy,rd),{value:fy}),l.angle=a.angle,l.baseline=a.baseline,_s(c,{fill:i("titleColor"),fillOpacity:i("titleOpacity"),font:i("titleFont"),fontSize:i("titleFontSize"),fontStyle:i("titleFontStyle"),fontWeight:i("titleFontWeight"),limit:i("titleLimit"),lineHeight:i("titleLineHeight")},{align:i("titleAlign"),angle:i("titleAngle"),baseline:i("titleBaseline")}),$Bt(i,o,c,n),c.update.align=$_(c.update.align,a.align),c.update.angle=$_(c.update.angle,a.angle),c.update.baseline=$_(c.update.baseline,a.baseline),Tc({type:d1,role:rjt,style:ese,from:r,encode:c},n)}function $Bt(t,e,n,r){const i=(a,l)=>a!=null?(n.update[l]=$_(No(a),n.update[l]),!1):!Fw(l,r),o=i(t("titleX"),"x"),s=i(t("titleY"),"y");n.enter.auto=s===o?No(s):zo(e,No(s),No(o))}function FBt(t,e){const n=ABt(t,e),r=t.encode||{},i=r.axis||{},o=i.name||void 0,s=i.interactive,a=i.style,l=Al(t,n),c=D4t(l),u={scale:t.scale,ticks:!!l("ticks"),labels:!!l("labels"),grid:!!l("grid"),domain:!!l("domain"),title:t.title!=null},f=zt(e.add(nd({},[u]))),d=zt(e.add(Njt({scale:e.scaleRef(t.scale),extra:e.property(c.extra),count:e.objectProperty(t.tickCount),values:e.objectProperty(t.values),minstep:e.property(t.tickMinStep),formatType:e.property(t.formatType),formatSpecifier:e.property(t.format)}))),h=[];let p;return u.grid&&h.push(MBt(t,n,r.grid,d,c)),u.ticks&&(p=l("tickSize"),h.push(DBt(t,n,r.ticks,d,p,c))),u.labels&&(p=u.ticks?p:0,h.push(IBt(t,n,r.labels,d,p,c))),u.domain&&h.push(PBt(t,n,r.domain,f)),u.title&&h.push(LBt(t,n,r.title,f)),i6(GA({role:Zzt,from:f,encode:kO(NBt(l,t),i,DR),marks:h,aria:l("aria"),description:l("description"),zindex:l("zindex"),name:o,interactive:s,style:a}),e)}function NBt(t,e){const n={enter:{},update:{}};return _s(n,{orient:t("orient"),offset:t("offset")||0,position:hf(e.position,0),titlePadding:t("titlePadding"),minExtent:t("minExtent"),maxExtent:t("maxExtent"),range:{signal:`abs(span(range("${e.scale}")))`},translate:t("translate"),format:e.format,formatType:e.formatType}),n}function wje(t,e,n){const r=pt(t.signals),i=pt(t.scales);return n||r.forEach(o=>Jze(o,e)),pt(t.projections).forEach(o=>m4t(o,e)),i.forEach(o=>i4t(o,e)),pt(t.data).forEach(o=>xBt(o,e)),i.forEach(o=>o4t(o,e)),(n||r).forEach(o=>Fjt(o,e)),pt(t.axes).forEach(o=>FBt(o,e)),pt(t.marks).forEach(o=>i6(o,e)),pt(t.legends).forEach(o=>aBt(o,e)),t.title&&pBt(t.title,e),e.parseLambdas(),e}const zBt=t=>kO({enter:{x:{value:0},y:{value:0}},update:{width:{signal:"width"},height:{signal:"height"}}},t);function jBt(t,e){const n=e.config,r=zt(e.root=e.add(T5())),i=BBt(t,n);i.forEach(c=>Jze(c,e)),e.description=t.description||n.description,e.eventConfig=n.events,e.legends=e.objectProperty(n.legend&&n.legend.layout),e.locale=n.locale;const o=e.add(nd()),s=e.add(nje(Zze(zBt(t.encode),t6,Yoe,t.style,e,{pulse:zt(o)}))),a=e.add(oje({layout:e.objectProperty(t.layout),legends:e.legends,autosize:e.signalRef("autosize"),mark:r,pulse:zt(s)}));e.operators.pop(),e.pushState(zt(s),zt(a),null),wje(t,e,i),e.operators.push(a);let l=e.add(tje({mark:r,pulse:zt(a)}));return l=e.add(ije({pulse:zt(l)})),l=e.add(f1({pulse:zt(l)})),e.addData("root",new bb(e,o,o,l)),e}function o2(t,e){return e&&e.signal?{name:t,update:e.signal}:{name:t,value:e}}function BBt(t,e){const n=s=>hf(t[s],e[s]),r=[o2("background",n("background")),o2("autosize",Yzt(n("autosize"))),o2("padding",Kzt(n("padding"))),o2("width",n("width")||0),o2("height",n("height")||0)],i=r.reduce((s,a)=>(s[a.name]=a,s),{}),o={};return pt(t.signals).forEach(s=>{vt(i,s.name)?s=cn(i[s.name],s):r.push(s),o[s.name]=s}),pt(e.signals).forEach(s=>{!vt(o,s.name)&&!vt(i,s.name)&&r.push(s)}),r}function _je(t,e){this.config=t||{},this.options=e||{},this.bindings=[],this.field={},this.signals={},this.lambdas={},this.scales={},this.events={},this.data={},this.streams=[],this.updates=[],this.operators=[],this.eventConfig=null,this.locale=null,this._id=0,this._subid=0,this._nextsub=[0],this._parent=[],this._encode=[],this._lookup=[],this._markpath=[]}function aye(t){this.config=t.config,this.options=t.options,this.legends=t.legends,this.field=Object.create(t.field),this.signals=Object.create(t.signals),this.lambdas=Object.create(t.lambdas),this.scales=Object.create(t.scales),this.events=Object.create(t.events),this.data=Object.create(t.data),this.streams=[],this.updates=[],this.operators=[],this._id=0,this._subid=++t._nextsub[0],this._nextsub=t._nextsub,this._parent=t._parent.slice(),this._encode=t._encode.slice(),this._lookup=t._lookup.slice(),this._markpath=t._markpath}_je.prototype=aye.prototype={parse(t){return wje(t,this)},fork(){return new aye(this)},isSubscope(){return this._subid>0},toRuntime(){return this.finish(),{description:this.description,operators:this.operators,streams:this.streams,updates:this.updates,bindings:this.bindings,eventConfig:this.eventConfig,locale:this.locale}},id(){return(this._subid?this._subid+":":0)+this._id++},add(t){return this.operators.push(t),t.id=this.id(),t.refs&&(t.refs.forEach(e=>{e.$ref=t.id}),t.refs=null),t},proxy(t){const e=t instanceof SY?zt(t):t;return this.add(Zjt({value:e}))},addStream(t){return this.streams.push(t),t.id=this.id(),t},addUpdate(t){return this.updates.push(t),t},finish(){let t,e;this.root&&(this.root.root=!0);for(t in this.signals)this.signals[t].signal=t;for(t in this.scales)this.scales[t].scale=t;function n(r,i,o){let s,a;r&&(s=r.data||(r.data={}),a=s[i]||(s[i]=[]),a.push(o))}for(t in this.data){e=this.data[t],n(e.input,t,"input"),n(e.output,t,"output"),n(e.values,t,"values");for(const r in e.index)n(e.index[r],t,"index:"+r)}return this},pushState(t,e,n){this._encode.push(zt(this.add(f1({pulse:t})))),this._parent.push(e),this._lookup.push(n?zt(this.proxy(n)):null),this._markpath.push(-1)},popState(){this._encode.pop(),this._parent.pop(),this._lookup.pop(),this._markpath.pop()},parent(){return $n(this._parent)},encode(){return $n(this._encode)},lookup(){return $n(this._lookup)},markpath(){const t=this._markpath;return++t[t.length-1]},fieldRef(t,e){if(gt(t))return WA(t,e);t.signal||je("Unsupported field reference: "+rt(t));const n=t.signal;let r=this.field[n];if(!r){const i={name:this.signalRef(n)};e&&(i.as=e),this.field[n]=r=zt(this.add(Ujt(i)))}return r},compareRef(t){let e=!1;const n=o=>Co(o)?(e=!0,this.signalRef(o.signal)):Tjt(o)?(e=!0,this.exprRef(o.expr)):o,r=pt(t.field).map(n),i=pt(t.order).map(n);return e?zt(this.add(qve({fields:r,orders:i}))):Gve(r,i)},keyRef(t,e){let n=!1;const r=o=>Co(o)?(n=!0,zt(i[o.signal])):o,i=this.signals;return t=pt(t).map(r),n?zt(this.add(Wjt({fields:t,flat:e}))):Sjt(t,e)},sortRef(t){if(!t)return t;const e=JB(t.op,t.field),n=t.order||Cjt;return n.signal?zt(this.add(qve({fields:e,orders:this.signalRef(n.signal)}))):Gve(e,n)},event(t,e){const n=t+":"+e;if(!this.events[n]){const r=this.id();this.streams.push({id:r,source:t,type:e}),this.events[n]=r}return this.events[n]},hasOwnSignal(t){return vt(this.signals,t)},addSignal(t,e){this.hasOwnSignal(t)&&je("Duplicate signal name: "+rt(t));const n=e instanceof SY?e:this.add(T5(e));return this.signals[t]=n},getSignal(t){return this.signals[t]||je("Unrecognized signal name: "+rt(t)),this.signals[t]},signalRef(t){return this.signals[t]?zt(this.signals[t]):(vt(this.lambdas,t)||(this.lambdas[t]=this.add(T5(null))),zt(this.lambdas[t]))},parseLambdas(){const t=Object.keys(this.lambdas);for(let e=0,n=t.length;e0?",":"")+(ht(i)?i.signal||lse(i):rt(i))}return n+"]"}function WBt(t){let e="{",n=0,r,i;for(r in t)i=t[r],e+=(++n>1?",":"")+rt(r)+":"+(ht(i)?i.signal||lse(i):rt(i));return e+"}"}function VBt(){const t="sans-serif",r="#4c78a8",i="#000",o="#888",s="#ddd";return{description:"Vega visualization",padding:0,autosize:"pad",background:null,events:{defaults:{allow:["wheel"]}},group:null,mark:null,arc:{fill:r},area:{fill:r},image:null,line:{stroke:r,strokeWidth:2},path:{stroke:r},rect:{fill:r},rule:{stroke:i},shape:{stroke:r},symbol:{fill:r,size:64},text:{fill:i,font:t,fontSize:11},trail:{fill:r,size:2},style:{"guide-label":{fill:i,font:t,fontSize:10},"guide-title":{fill:i,font:t,fontSize:11,fontWeight:"bold"},"group-title":{fill:i,font:t,fontSize:13,fontWeight:"bold"},"group-subtitle":{fill:i,font:t,fontSize:12},point:{size:30,strokeWidth:2,shape:"circle"},circle:{size:30,strokeWidth:2},square:{size:30,strokeWidth:2,shape:"square"},cell:{fill:"transparent",stroke:s},view:{fill:"transparent"}},title:{orient:"top",anchor:"middle",offset:4,subtitlePadding:3},axis:{minExtent:0,maxExtent:200,bandPosition:.5,domain:!0,domainWidth:1,domainColor:o,grid:!1,gridWidth:1,gridColor:s,labels:!0,labelAngle:0,labelLimit:180,labelOffset:0,labelPadding:2,ticks:!0,tickColor:o,tickOffset:0,tickRound:!0,tickSize:5,tickWidth:1,titlePadding:4},axisBand:{tickOffset:-.5},projection:{type:"mercator"},legend:{orient:"right",padding:0,gridAlign:"each",columnPadding:10,rowPadding:2,symbolDirection:"vertical",gradientDirection:"vertical",gradientLength:200,gradientThickness:16,gradientStrokeColor:s,gradientStrokeWidth:0,gradientLabelOffset:2,labelAlign:"left",labelBaseline:"middle",labelLimit:160,labelOffset:4,labelOverlap:!0,symbolLimit:30,symbolType:"circle",symbolSize:100,symbolOffset:0,symbolStrokeWidth:1.5,symbolBaseFillColor:"transparent",symbolBaseStrokeColor:o,titleLimit:180,titleOrient:"top",titlePadding:5,layout:{offset:18,direction:"horizontal",left:{direction:"vertical"},right:{direction:"vertical"}}},range:{category:{scheme:"tableau10"},ordinal:{scheme:"blues"},heatmap:{scheme:"yellowgreenblue"},ramp:{scheme:"blues"},diverging:{scheme:"blueorange",extent:[1,0]},symbol:["circle","square","triangle-up","cross","diamond","triangle-right","triangle-down","triangle-left"]}}}function GBt(t,e,n){return ht(t)||je("Input Vega specification must be an object."),e=gO(VBt(),e,t.config),jBt(t,new _je(e,n)).toRuntime()}var HBt="5.30.0";cn(IS,N2t,yRt,QRt,LIt,ALt,n3t,L$t,i3t,k3t,N3t,G3t);const qBt=Object.freeze(Object.defineProperty({__proto__:null,Bounds:uo,CanvasHandler:SR,CanvasRenderer:BN,DATE:wl,DAY:Gs,DAYOFYEAR:Eh,Dataflow:R_,Debug:dIe,Error:cne,EventStream:nB,Gradient:uFe,GroupItem:AB,HOURS:Cc,Handler:Pie,HybridHandler:tNe,HybridRenderer:MX,Info:fIe,Item:kB,MILLISECONDS:Vf,MINUTES:Oc,MONTH:Qs,Marks:Ec,MultiPulse:Ine,None:uIe,Operator:Ir,Parameters:tB,Pulse:zv,QUARTER:bl,RenderType:pv,Renderer:_R,ResourceLoader:vFe,SECONDS:ku,SVGHandler:UFe,SVGRenderer:$ie,SVGStringRenderer:eNe,Scenegraph:IFe,TIME_UNITS:Cne,Transform:De,View:jze,WEEK:wo,Warn:une,YEAR:xs,accessor:kl,accessorFields:Ys,accessorName:Ni,array:pt,ascending:V4,bandwidthNRD:Nne,bin:qLe,bootstrapCI:XLe,boundClip:fNe,boundContext:yR,boundItem:EX,boundMark:PFe,boundStroke:qg,changeset:l1,clampRange:SIe,codegenExpression:hze,compare:gne,constant:ta,cumulativeLogNormal:Vne,cumulativeNormal:iB,cumulativeUniform:Xne,dayofyear:eLe,debounce:mne,defaultLocale:Ane,definition:VLe,densityLogNormal:Wne,densityNormal:zne,densityUniform:qne,domChild:xo,domClear:qc,domCreate:dv,domFind:Aie,dotbin:YLe,error:je,expressionFunction:Ki,extend:cn,extent:Sh,extentIndex:CIe,falsy:Pm,fastmap:vO,field:Eu,flush:OIe,font:IB,fontFamily:wR,fontSize:jh,format:c3,formatLocale:vN,formats:Rne,hasOwnProperty:vt,id:eR,identity:ea,inferType:DLe,inferTypes:ILe,ingest:cr,inherits:it,inrange:i_,interpolate:sie,interpolateColors:EB,interpolateRange:Q3e,intersect:aNe,intersectBoxLine:s_,intersectPath:pie,intersectPoint:gie,intersectRule:xFe,isArray:We,isBoolean:jy,isDate:Fv,isFunction:fn,isIterable:EIe,isNumber:Jn,isObject:ht,isRegExp:TIe,isString:gt,isTuple:J4,key:vne,lerp:kIe,lineHeight:ly,loader:K4,locale:MLe,logger:fne,lruCache:AIe,markup:Lie,merge:PIe,mergeConfig:gO,multiLineOffset:Eie,one:pO,pad:MIe,panLinear:vIe,panLog:yIe,panPow:xIe,panSymlog:bIe,parse:GBt,parseExpression:Loe,parseSelector:Hy,path:cB,pathCurves:fie,pathEqual:dNe,pathParse:jS,pathRectangle:hFe,pathRender:MA,pathSymbols:dFe,pathTrail:pFe,peek:$n,point:$B,projection:toe,quantileLogNormal:Gne,quantileNormal:oB,quantileUniform:Yne,quantiles:$ne,quantizeInterpolator:K3e,quarter:wIe,quartiles:Fne,get random(){return Au},randomInteger:UEt,randomKDE:Bne,randomLCG:BEt,randomLogNormal:KLe,randomMixture:ZLe,randomNormal:jne,randomUniform:JLe,read:FLe,regressionConstant:Qne,regressionExp:t$e,regressionLinear:Kne,regressionLoess:i$e,regressionLog:e$e,regressionPoly:r$e,regressionPow:n$e,regressionQuad:Zne,renderModule:FB,repeat:J2,resetDefaultLocale:NOt,resetSVGClipId:mFe,resetSVGDefIds:$Mt,responseType:$Le,runtimeContext:Tze,sampleCurve:aB,sampleLogNormal:Une,sampleNormal:rB,sampleUniform:Hne,scale:tr,sceneEqual:Fie,sceneFromJSON:RFe,scenePickVisit:DN,sceneToJSON:MFe,sceneVisit:Gf,sceneZOrder:mie,scheme:aie,serializeXML:QFe,setHybridRendererOptions:RMt,setRandom:zEt,span:tR,splitAccessPath:Nh,stringValue:rt,textMetrics:dc,timeBin:vLe,timeFloor:aLe,timeFormatLocale:SA,timeInterval:wO,timeOffset:uLe,timeSequence:hLe,timeUnitSpecifier:JIe,timeUnits:One,toBoolean:yne,toDate:xne,toNumber:qs,toSet:Wf,toString:bne,transform:GLe,transforms:IS,truncate:RIe,truthy:Tu,tupleid:jt,typeParsers:lX,utcFloor:lLe,utcInterval:_O,utcOffset:fLe,utcSequence:pLe,utcdayofyear:rLe,utcquarter:_Ie,utcweek:iLe,version:HBt,visitArray:Gm,week:tLe,writeConfig:mO,zero:nv,zoomLinear:dne,zoomLog:hne,zoomPow:uN,zoomSymlog:pne},Symbol.toStringTag,{value:"Module"}));function XBt(t,e,n){let r;e.x2&&(e.x?(n&&t.x>t.x2&&(r=t.x,t.x=t.x2,t.x2=r),t.width=t.x2-t.x):t.x=t.x2-(t.width||0)),e.xc&&(t.x=t.xc-(t.width||0)/2),e.y2&&(e.y?(n&&t.y>t.y2&&(r=t.y,t.y=t.y2,t.y2=r),t.height=t.y2-t.y):t.y=t.y2-(t.height||0)),e.yc&&(t.y=t.yc-(t.height||0)/2)}var YBt={NaN:NaN,E:Math.E,LN2:Math.LN2,LN10:Math.LN10,LOG2E:Math.LOG2E,LOG10E:Math.LOG10E,PI:Math.PI,SQRT1_2:Math.SQRT1_2,SQRT2:Math.SQRT2,MIN_VALUE:Number.MIN_VALUE,MAX_VALUE:Number.MAX_VALUE},QBt={"*":(t,e)=>t*e,"+":(t,e)=>t+e,"-":(t,e)=>t-e,"/":(t,e)=>t/e,"%":(t,e)=>t%e,">":(t,e)=>t>e,"<":(t,e)=>tt<=e,">=":(t,e)=>t>=e,"==":(t,e)=>t==e,"!=":(t,e)=>t!=e,"===":(t,e)=>t===e,"!==":(t,e)=>t!==e,"&":(t,e)=>t&e,"|":(t,e)=>t|e,"^":(t,e)=>t^e,"<<":(t,e)=>t<>":(t,e)=>t>>e,">>>":(t,e)=>t>>>e},KBt={"+":t=>+t,"-":t=>-t,"~":t=>~t,"!":t=>!t};const ZBt=Array.prototype.slice,m0=(t,e,n)=>{const r=n?n(e[0]):e[0];return r[t].apply(r,ZBt.call(e,1))},JBt=(t,e,n,r,i,o,s)=>new Date(t,e||0,n??1,r||0,i||0,o||0,s||0);var e6t={isNaN:Number.isNaN,isFinite:Number.isFinite,abs:Math.abs,acos:Math.acos,asin:Math.asin,atan:Math.atan,atan2:Math.atan2,ceil:Math.ceil,cos:Math.cos,exp:Math.exp,floor:Math.floor,log:Math.log,max:Math.max,min:Math.min,pow:Math.pow,random:Math.random,round:Math.round,sin:Math.sin,sqrt:Math.sqrt,tan:Math.tan,clamp:(t,e,n)=>Math.max(e,Math.min(n,t)),now:Date.now,utc:Date.UTC,datetime:JBt,date:t=>new Date(t).getDate(),day:t=>new Date(t).getDay(),year:t=>new Date(t).getFullYear(),month:t=>new Date(t).getMonth(),hours:t=>new Date(t).getHours(),minutes:t=>new Date(t).getMinutes(),seconds:t=>new Date(t).getSeconds(),milliseconds:t=>new Date(t).getMilliseconds(),time:t=>new Date(t).getTime(),timezoneoffset:t=>new Date(t).getTimezoneOffset(),utcdate:t=>new Date(t).getUTCDate(),utcday:t=>new Date(t).getUTCDay(),utcyear:t=>new Date(t).getUTCFullYear(),utcmonth:t=>new Date(t).getUTCMonth(),utchours:t=>new Date(t).getUTCHours(),utcminutes:t=>new Date(t).getUTCMinutes(),utcseconds:t=>new Date(t).getUTCSeconds(),utcmilliseconds:t=>new Date(t).getUTCMilliseconds(),length:t=>t.length,join:function(){return m0("join",arguments)},indexof:function(){return m0("indexOf",arguments)},lastindexof:function(){return m0("lastIndexOf",arguments)},slice:function(){return m0("slice",arguments)},reverse:t=>t.slice().reverse(),parseFloat,parseInt,upper:t=>String(t).toUpperCase(),lower:t=>String(t).toLowerCase(),substring:function(){return m0("substring",arguments,String)},split:function(){return m0("split",arguments,String)},replace:function(){return m0("replace",arguments,String)},trim:t=>String(t).trim(),regexp:RegExp,test:(t,e)=>RegExp(t).test(e)};const t6t=["view","item","group","xy","x","y"],PY=new Set([Function,eval,setTimeout,setInterval]);typeof setImmediate=="function"&&PY.add(setImmediate);const n6t={Literal:(t,e)=>e.value,Identifier:(t,e)=>{const n=e.name;return t.memberDepth>0?n:n==="datum"?t.datum:n==="event"?t.event:n==="item"?t.item:YBt[n]||t.params["$"+n]},MemberExpression:(t,e)=>{const n=!e.computed,r=t(e.object);n&&(t.memberDepth+=1);const i=t(e.property);if(n&&(t.memberDepth-=1),PY.has(r[i])){console.error(`Prevented interpretation of member "${i}" which could lead to insecure code execution`);return}return r[i]},CallExpression:(t,e)=>{const n=e.arguments;let r=e.callee.name;return r.startsWith("_")&&(r=r.slice(1)),r==="if"?t(n[0])?t(n[1]):t(n[2]):(t.fn[r]||e6t[r]).apply(t.fn,n.map(t))},ArrayExpression:(t,e)=>e.elements.map(t),BinaryExpression:(t,e)=>QBt[e.operator](t(e.left),t(e.right)),UnaryExpression:(t,e)=>KBt[e.operator](t(e.argument)),ConditionalExpression:(t,e)=>t(e.test)?t(e.consequent):t(e.alternate),LogicalExpression:(t,e)=>e.operator==="&&"?t(e.left)&&t(e.right):t(e.left)||t(e.right),ObjectExpression:(t,e)=>e.properties.reduce((n,r)=>{t.memberDepth+=1;const i=t(r.key);return t.memberDepth-=1,PY.has(t(r.value))?console.error(`Prevented interpretation of property "${i}" which could lead to insecure code execution`):n[i]=t(r.value),n},{})};function s2(t,e,n,r,i,o){const s=a=>n6t[a.type](s,a);return s.memberDepth=0,s.fn=Object.create(e),s.params=n,s.datum=r,s.event=i,s.item=o,t6t.forEach(a=>s.fn[a]=function(){return i.vega[a](...arguments)}),s(t)}var r6t={operator(t,e){const n=e.ast,r=t.functions;return i=>s2(n,r,i)},parameter(t,e){const n=e.ast,r=t.functions;return(i,o)=>s2(n,r,o,i)},event(t,e){const n=e.ast,r=t.functions;return i=>s2(n,r,void 0,void 0,i)},handler(t,e){const n=e.ast,r=t.functions;return(i,o)=>{const s=o.item&&o.item.datum;return s2(n,r,i,s,o)}},encode(t,e){const{marktype:n,channels:r}=e,i=t.functions,o=n==="group"||n==="image"||n==="rect";return(s,a)=>{const l=s.datum;let c=0,u;for(const f in r)u=s2(r[f].ast,i,a,l,void 0,s),s[f]!==u&&(s[f]=u,c=1);return n!=="rule"&&XBt(s,r,o),c}}};const i6t="vega-lite",o6t='Dominik Moritz, Kanit "Ham" Wongsuphasawat, Arvind Satyanarayan, Jeffrey Heer',s6t="5.21.0",a6t=["Kanit Wongsuphasawat (http://kanitw.yellowpigz.com)","Dominik Moritz (https://www.domoritz.de)","Arvind Satyanarayan (https://arvindsatya.com)","Jeffrey Heer (https://jheer.org)"],l6t="https://vega.github.io/vega-lite/",c6t="Vega-Lite is a concise high-level language for interactive visualization.",u6t=["vega","chart","visualization"],f6t="build/vega-lite.js",d6t="build/vega-lite.min.js",h6t="build/vega-lite.min.js",p6t="build/src/index",g6t="build/src/index.d.ts",m6t={vl2pdf:"./bin/vl2pdf",vl2png:"./bin/vl2png",vl2svg:"./bin/vl2svg",vl2vg:"./bin/vl2vg"},v6t=["bin","build","src","vega-lite*","tsconfig.json"],y6t={changelog:"conventional-changelog -p angular -r 2",prebuild:"yarn clean:build",build:"yarn build:only","build:only":"tsc -p tsconfig.build.json && rollup -c","prebuild:examples":"yarn build:only","build:examples":"yarn data && TZ=America/Los_Angeles scripts/build-examples.sh","prebuild:examples-full":"yarn build:only","build:examples-full":"TZ=America/Los_Angeles scripts/build-examples.sh 1","build:example":"TZ=America/Los_Angeles scripts/build-example.sh","build:toc":"yarn build:jekyll && scripts/generate-toc","build:site":"rollup -c site/rollup.config.mjs","build:jekyll":"pushd site && bundle exec jekyll build -q && popd","build:versions":"scripts/update-version.sh",clean:"yarn clean:build && del-cli 'site/data/*' 'examples/compiled/*.png' && find site/examples ! -name 'index.md' ! -name 'data' -type f -delete","clean:build":"del-cli 'build/*' !build/vega-lite-schema.json",data:"rsync -r node_modules/vega-datasets/data/* site/data","build-editor-preview":"scripts/build-editor-preview.sh",schema:"mkdir -p build && ts-json-schema-generator -f tsconfig.json -p src/index.ts -t TopLevelSpec --no-type-check --no-ref-encode > build/vega-lite-schema.json && yarn renameschema && cp build/vega-lite-schema.json site/_data/",renameschema:"scripts/rename-schema.sh",presite:"yarn data && yarn schema && yarn build:site && yarn build:versions && scripts/create-example-pages.sh",site:"yarn site:only","site:only":"pushd site && bundle exec jekyll serve -I -l && popd",prettierbase:"prettier '**/*.{md,css,yml}'",format:"eslint . --fix && yarn prettierbase --write",lint:"eslint . && yarn prettierbase --check",test:"yarn jest test/ && yarn lint && yarn schema && yarn jest examples/ && yarn test:runtime","test:cover":"yarn jest --collectCoverage test/","test:inspect":"node --inspect-brk ./node_modules/.bin/jest --runInBand test","test:runtime":"TZ=America/Los_Angeles npx jest test-runtime/ --config test-runtime/jest-config.json","test:runtime:generate":"yarn build:only && del-cli test-runtime/resources && VL_GENERATE_TESTS=true yarn test:runtime",watch:"tsc -p tsconfig.build.json -w","watch:site":"yarn build:site -w","watch:test":"yarn jest --watch test/","watch:test:runtime":"TZ=America/Los_Angeles npx jest --watch test-runtime/ --config test-runtime/jest-config.json",release:"release-it"},x6t={type:"git",url:"https://github.com/vega/vega-lite.git"},b6t="BSD-3-Clause",w6t={url:"https://github.com/vega/vega-lite/issues"},_6t={"@babel/core":"^7.24.9","@babel/preset-env":"^7.25.0","@babel/preset-typescript":"^7.24.7","@release-it/conventional-changelog":"^8.0.1","@rollup/plugin-alias":"^5.1.0","@rollup/plugin-babel":"^6.0.4","@rollup/plugin-commonjs":"^26.0.1","@rollup/plugin-json":"^6.1.0","@rollup/plugin-node-resolve":"^15.2.3","@rollup/plugin-terser":"^0.4.4","@types/d3":"^7.4.3","@types/jest":"^29.5.12","@types/pako":"^2.0.3","@typescript-eslint/eslint-plugin":"^7.17.0","@typescript-eslint/parser":"^7.17.0",ajv:"^8.17.1","ajv-formats":"^3.0.1",cheerio:"^1.0.0-rc.12","conventional-changelog-cli":"^5.0.0",d3:"^7.9.0","del-cli":"^5.1.0",eslint:"^8.57.0","eslint-config-prettier":"^9.1.0","eslint-plugin-jest":"^27.9.0","eslint-plugin-prettier":"^5.2.1","fast-json-stable-stringify":"~2.1.0","highlight.js":"^11.10.0",jest:"^29.7.0","jest-dev-server":"^10.0.0",mkdirp:"^3.0.1",pako:"^2.1.0",prettier:"^3.3.3",puppeteer:"^15.0.0","release-it":"17.6.0",rollup:"^4.19.1","rollup-plugin-bundle-size":"^1.0.3",serve:"^14.2.3",terser:"^5.31.3","ts-jest":"^29.2.3","ts-json-schema-generator":"^2.3.0",typescript:"~5.5.4","vega-cli":"^5.28.0","vega-datasets":"^2.8.1","vega-embed":"^6.26.0","vega-tooltip":"^0.34.0","yaml-front-matter":"^4.1.1"},S6t={"json-stringify-pretty-compact":"~3.0.0",tslib:"~2.6.3","vega-event-selector":"~3.0.1","vega-expression":"~5.1.1","vega-util":"~1.17.2",yargs:"~17.7.2"},C6t={vega:"^5.24.0"},O6t={node:">=18"},E6t="yarn@1.22.19",T6t={name:i6t,author:o6t,version:s6t,collaborators:a6t,homepage:l6t,description:c6t,keywords:u6t,main:f6t,unpkg:d6t,jsdelivr:h6t,module:p6t,types:g6t,bin:m6t,files:v6t,scripts:y6t,repository:x6t,license:b6t,bugs:w6t,devDependencies:_6t,dependencies:S6t,peerDependencies:C6t,engines:O6t,packageManager:E6t};function cse(t){return Ke(t,"or")}function use(t){return Ke(t,"and")}function fse(t){return Ke(t,"not")}function D3(t,e){if(fse(t))D3(t.not,e);else if(use(t))for(const n of t.and)D3(n,e);else if(cse(t))for(const n of t.or)D3(n,e);else e(t)}function F_(t,e){return fse(t)?{not:F_(t.not,e)}:use(t)?{and:t.and.map(n=>F_(n,e))}:cse(t)?{or:t.or.map(n=>F_(n,e))}:e(t)}const Kt=structuredClone;function Sje(t){throw new Error(t)}function YS(t,e){const n={};for(const r of e)vt(t,r)&&(n[r]=t[r]);return n}function hl(t,e){const n={...t};for(const r of e)delete n[r];return n}Set.prototype.toJSON=function(){return`Set(${[...this].map(t=>Tr(t)).join(",")})`};function Mn(t){if(Jn(t))return t;const e=gt(t)?t:Tr(t);if(e.length<250)return e;let n=0;for(let r=0;ra===0?s:`[${s}]`),o=i.map((s,a)=>i.slice(0,a+1).join(""));for(const s of o)e.add(s)}return e}function pse(t,e){return t===void 0||e===void 0?!0:hse(RY(t),RY(e))}function Er(t){return Qe(t).length===0}const Qe=Object.keys,bs=Object.values,dy=Object.entries;function HA(t){return t===!0||t===!1}function pi(t){const e=t.replace(/\W/g,"_");return(t.match(/^\d+/)?"_":"")+e}function gk(t,e){return fse(t)?`!(${gk(t.not,e)})`:use(t)?`(${t.and.map(n=>gk(n,e)).join(") && (")})`:cse(t)?`(${t.or.map(n=>gk(n,e)).join(") || (")})`:e(t)}function k5(t,e){if(e.length===0)return!0;const n=e.shift();return n in t&&k5(t[n],e)&&delete t[n],Er(t)}function IR(t){return t.charAt(0).toUpperCase()+t.substr(1)}function gse(t,e="datum"){const n=Nh(t),r=[];for(let i=1;i<=n.length;i++){const o=`[${n.slice(0,i).map(rt).join("][")}]`;r.push(`${e}${o}`)}return r.join(" && ")}function Eje(t,e="datum"){return`${e}[${rt(Nh(t).join("."))}]`}function P6t(t){return t.replace(/(\[|\]|\.|'|")/g,"\\$1")}function Mu(t){return`${Nh(t).map(P6t).join("\\.")}`}function wb(t,e,n){return t.replace(new RegExp(e.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&"),"g"),n)}function MO(t){return`${Nh(t).join(".")}`}function KS(t){return t?Nh(t).length:0}function qi(...t){return t.find(e=>e!==void 0)}let Tje=42;function kje(t){const e=++Tje;return t?String(t)+e:e}function M6t(){Tje=42}function Aje(t){return Pje(t)?t:`__${t}`}function Pje(t){return t.startsWith("__")}function qA(t){if(t!==void 0)return(t%360+360)%360}function s6(t){return Jn(t)?!0:!isNaN(t)&&!isNaN(parseFloat(t))}const lye=Object.getPrototypeOf(structuredClone({}));function oc(t,e){if(t===e)return!0;if(t&&e&&typeof t=="object"&&typeof e=="object"){if(t.constructor.name!==e.constructor.name)return!1;let n,r;if(Array.isArray(t)){if(n=t.length,n!=e.length)return!1;for(r=n;r--!==0;)if(!oc(t[r],e[r]))return!1;return!0}if(t instanceof Map&&e instanceof Map){if(t.size!==e.size)return!1;for(const o of t.entries())if(!e.has(o[0]))return!1;for(const o of t.entries())if(!oc(o[1],e.get(o[0])))return!1;return!0}if(t instanceof Set&&e instanceof Set){if(t.size!==e.size)return!1;for(const o of t.entries())if(!e.has(o[0]))return!1;return!0}if(ArrayBuffer.isView(t)&&ArrayBuffer.isView(e)){if(n=t.length,n!=e.length)return!1;for(r=n;r--!==0;)if(t[r]!==e[r])return!1;return!0}if(t.constructor===RegExp)return t.source===e.source&&t.flags===e.flags;if(t.valueOf!==Object.prototype.valueOf&&t.valueOf!==lye.valueOf)return t.valueOf()===e.valueOf();if(t.toString!==Object.prototype.toString&&t.toString!==lye.toString)return t.toString()===e.toString();const i=Object.keys(t);if(n=i.length,n!==Object.keys(e).length)return!1;for(r=n;r--!==0;)if(!Object.prototype.hasOwnProperty.call(e,i[r]))return!1;for(r=n;r--!==0;){const o=i[r];if(!oc(t[o],e[o]))return!1}return!0}return t!==t&&e!==e}function Tr(t){const e=[];return function n(r){if(r&&r.toJSON&&typeof r.toJSON=="function"&&(r=r.toJSON()),r===void 0)return;if(typeof r=="number")return isFinite(r)?""+r:"null";if(typeof r!="object")return JSON.stringify(r);let i,o;if(Array.isArray(r)){for(o="[",i=0;ip6(t[e])?pi(`_${e}_${dy(t[e])}`):pi(`_${e}_${t[e]}`)).join("")}function Gr(t){return t===!0||g1(t)&&!t.binned}function ns(t){return t==="binned"||g1(t)&&t.binned===!0}function g1(t){return ht(t)}function p6(t){return Ke(t,"param")}function cye(t){switch(t){case og:case sg:case Kg:case Sl:case Gh:case Hh:case Qy:case Zg:case Xy:case Yy:case Cl:return 6;case Ky:return 4;default:return 10}}function NR(t){return Ke(t,"expr")}function is(t,{level:e}={level:0}){const n=Qe(t||{}),r={};for(const i of n)r[i]=e===0?ec(t[i]):is(t[i],{level:e-1});return r}function Vje(t){const{anchor:e,frame:n,offset:r,orient:i,angle:o,limit:s,color:a,subtitleColor:l,subtitleFont:c,subtitleFontSize:u,subtitleFontStyle:f,subtitleFontWeight:d,subtitleLineHeight:h,subtitlePadding:p,...g}=t,m={...g,...a?{fill:a}:{}},v={...e?{anchor:e}:{},...n?{frame:n}:{},...r?{offset:r}:{},...i?{orient:i}:{},...o!==void 0?{angle:o}:{},...s!==void 0?{limit:s}:{}},y={...l?{subtitleColor:l}:{},...c?{subtitleFont:c}:{},...u?{subtitleFontSize:u}:{},...f?{subtitleFontStyle:f}:{},...d?{subtitleFontWeight:d}:{},...h?{subtitleLineHeight:h}:{},...p?{subtitlePadding:p}:{}},x=YS(t,["align","baseline","dx","dy","limit"]);return{titleMarkConfig:m,subtitleMarkConfig:x,nonMarkTitleProperties:v,subtitle:y}}function Ym(t){return gt(t)||We(t)&>(t[0])}function Mt(t){return Ke(t,"signal")}function m1(t){return Ke(t,"step")}function tUt(t){return We(t)?!1:Ke(t,"fields")&&!Ke(t,"data")}function nUt(t){return We(t)?!1:Ke(t,"fields")&&Ke(t,"data")}function Yp(t){return We(t)?!1:Ke(t,"field")&&Ke(t,"data")}const rUt={aria:1,description:1,ariaRole:1,ariaRoleDescription:1,blend:1,opacity:1,fill:1,fillOpacity:1,stroke:1,strokeCap:1,strokeWidth:1,strokeOpacity:1,strokeDash:1,strokeDashOffset:1,strokeJoin:1,strokeOffset:1,strokeMiterLimit:1,startAngle:1,endAngle:1,padAngle:1,innerRadius:1,outerRadius:1,size:1,shape:1,interpolate:1,tension:1,orient:1,align:1,baseline:1,text:1,dir:1,dx:1,dy:1,ellipsis:1,limit:1,radius:1,theta:1,angle:1,font:1,fontSize:1,fontWeight:1,fontStyle:1,lineBreak:1,lineHeight:1,cursor:1,href:1,tooltip:1,cornerRadius:1,cornerRadiusTopLeft:1,cornerRadiusTopRight:1,cornerRadiusBottomLeft:1,cornerRadiusBottomRight:1,aspect:1,width:1,height:1,url:1,smooth:1},iUt=Qe(rUt),oUt={arc:1,area:1,group:1,image:1,line:1,path:1,rect:1,rule:1,shape:1,symbol:1,text:1,trail:1},DY=["cornerRadius","cornerRadiusTopLeft","cornerRadiusTopRight","cornerRadiusBottomLeft","cornerRadiusBottomRight"];function Gje(t){const e=We(t.condition)?t.condition.map(uye):uye(t.condition);return{...ec(t),condition:e}}function ec(t){if(NR(t)){const{expr:e,...n}=t;return{signal:e,...n}}return t}function uye(t){if(NR(t)){const{expr:e,...n}=t;return{signal:e,...n}}return t}function Jr(t){if(NR(t)){const{expr:e,...n}=t;return{signal:e,...n}}return Mt(t)?t:t!==void 0?{value:t}:void 0}function sUt(t){return Mt(t)?t.signal:rt(t)}function fye(t){return Mt(t)?t.signal:rt(t.value)}function Tf(t){return Mt(t)?t.signal:t==null?null:rt(t)}function aUt(t,e,n){for(const r of n){const i=Ah(r,e.markDef,e.config);i!==void 0&&(t[r]=Jr(i))}return t}function Hje(t){return[].concat(t.type,t.style??[])}function Or(t,e,n,r={}){const{vgChannel:i,ignoreVgConfig:o}=r;return i&&Ke(e,i)?e[i]:e[t]!==void 0?e[t]:o&&(!i||i===t)?void 0:Ah(t,e,n,r)}function Ah(t,e,n,{vgChannel:r}={}){const i=IY(t,e,n.style);return qi(r?i:void 0,i,r?n[e.type][r]:void 0,n[e.type][t],r?n.mark[r]:n.mark[t])}function IY(t,e,n){return qje(t,Hje(e),n)}function qje(t,e,n){e=pt(e);let r;for(const i of e){const o=n[i];Ke(o,t)&&(r=o[t])}return r}function Xje(t,e){return pt(t).reduce((n,r)=>(n.field.push(lt(r,e)),n.order.push(r.sort??"ascending"),n),{field:[],order:[]})}function Yje(t,e){const n=[...t];return e.forEach(r=>{for(const i of n)if(oc(i,r))return;n.push(r)}),n}function Qje(t,e){return oc(t,e)||!e?t:t?[...pt(t),...pt(e)].join(", "):e}function Kje(t,e){const n=t.value,r=e.value;if(n==null||r===null)return{explicit:t.explicit,value:null};if((Ym(n)||Mt(n))&&(Ym(r)||Mt(r)))return{explicit:t.explicit,value:Qje(n,r)};if(Ym(n)||Mt(n))return{explicit:t.explicit,value:n};if(Ym(r)||Mt(r))return{explicit:t.explicit,value:r};if(!Ym(n)&&!Mt(n)&&!Ym(r)&&!Mt(r))return{explicit:t.explicit,value:Yje(n,r)};throw new Error("It should never reach here")}function Ose(t){return`Invalid specification ${Tr(t)}. Make sure the specification includes at least one of the following properties: "mark", "layer", "facet", "hconcat", "vconcat", "concat", or "repeat".`}const lUt='Autosize "fit" only works for single views and layered views.';function dye(t){return`${t=="width"?"Width":"Height"} "container" only works for single views and layered views.`}function hye(t){const e=t=="width"?"Width":"Height",n=t=="width"?"x":"y";return`${e} "container" only works well with autosize "fit" or "fit-${n}".`}function pye(t){return t?`Dropping "fit-${t}" because spec has discrete ${Ol(t)}.`:'Dropping "fit" because spec has discrete size.'}function Ese(t){return`Unknown field for ${t}. Cannot calculate view size.`}function gye(t){return`Cannot project a selection on encoding channel "${t}", which has no field.`}function cUt(t,e){return`Cannot project a selection on encoding channel "${t}" as it uses an aggregate function ("${e}").`}function uUt(t){return`The "nearest" transform is not supported for ${t} marks.`}function Zje(t){return`Selection not supported for ${t} yet.`}function fUt(t){return`Cannot find a selection named "${t}".`}const dUt="Scale bindings are currently only supported for scales with unbinned, continuous domains.",hUt="Sequntial scales are deprecated. The available quantitative scale type values are linear, log, pow, sqrt, symlog, time and utc",pUt="Legend bindings are only supported for selections over an individual field or encoding channel.";function gUt(t){return`Lookups can only be performed on selection parameters. "${t}" is a variable parameter.`}function mUt(t){return`Cannot define and lookup the "${t}" selection in the same view. Try moving the lookup into a second, layered view?`}const vUt="The same selection must be used to override scale domains in a layered view.",yUt='Interval selections should be initialized using "x", "y", "longitude", or "latitude" keys.';function xUt(t){return`Unknown repeated value "${t}".`}function mye(t){return`The "columns" property cannot be used when "${t}" has nested row/column.`}const bUt="Axes cannot be shared in concatenated or repeated views yet (https://github.com/vega/vega-lite/issues/2415).";function wUt(t){return`Unrecognized parse "${t}".`}function vye(t,e,n){return`An ancestor parsed field "${t}" as ${n} but a child wants to parse the field as ${e}.`}const _Ut="Attempt to add the same child twice.";function SUt(t){return`Ignoring an invalid transform: ${Tr(t)}.`}const CUt='If "from.fields" is not specified, "as" has to be a string that specifies the key to be used for the data from the secondary source.';function yye(t){return`Config.customFormatTypes is not true, thus custom format type and format for channel ${t} are dropped.`}function OUt(t){const{parentProjection:e,projection:n}=t;return`Layer's shared projection ${Tr(e)} is overridden by a child projection ${Tr(n)}.`}const EUt="Arc marks uses theta channel rather than angle, replacing angle with theta.";function TUt(t){return`${t}Offset dropped because ${t} is continuous`}function kUt(t,e,n){return`Channel ${t} is a ${e}. Converted to {value: ${Tr(n)}}.`}function Jje(t){return`Invalid field type "${t}".`}function AUt(t,e){return`Invalid field type "${t}" for aggregate: "${e}", using "quantitative" instead.`}function PUt(t){return`Invalid aggregation operator "${t}".`}function e4e(t,e){const{fill:n,stroke:r}=e;return`Dropping color ${t} as the plot also has ${n&&r?"fill and stroke":n?"fill":"stroke"}.`}function MUt(t){return`Position range does not support relative band size for ${t}.`}function LY(t,e){return`Dropping ${Tr(t)} from channel "${e}" since it does not contain any data field, datum, value, or signal.`}const RUt="Line marks cannot encode size with a non-groupby field. You may want to use trail marks instead.";function g6(t,e,n){return`${t} dropped as it is incompatible with "${e}".`}function DUt(t){return`${t}-encoding is dropped as ${t} is not a valid encoding channel.`}function IUt(t){return`${t} encoding should be discrete (ordinal / nominal / binned).`}function LUt(t){return`${t} encoding should be discrete (ordinal / nominal / binned) or use a discretizing scale (e.g. threshold).`}function $Ut(t){return`Facet encoding dropped as ${t.join(" and ")} ${t.length>1?"are":"is"} also specified.`}function jV(t,e){return`Using discrete channel "${t}" to encode "${e}" field can be misleading as it does not encode ${e==="ordinal"?"order":"magnitude"}.`}function FUt(t){return`The ${t} for range marks cannot be an expression`}function NUt(t,e){return`Line mark is for continuous lines and thus cannot be used with ${t&&e?"x2 and y2":t?"x2":"y2"}. We will use the rule mark (line segments) instead.`}function zUt(t,e){return`Specified orient "${t}" overridden with "${e}".`}function jUt(t){return`Cannot use the scale property "${t}" with non-color channel.`}function BUt(t){return`Cannot use the relative band size with ${t} scale.`}function UUt(t){return`Using unaggregated domain with raw field has no effect (${Tr(t)}).`}function WUt(t){return`Unaggregated domain not applicable for "${t}" since it produces values outside the origin domain of the source data.`}function VUt(t){return`Unaggregated domain is currently unsupported for log scale (${Tr(t)}).`}function GUt(t){return`Cannot apply size to non-oriented mark "${t}".`}function HUt(t,e,n){return`Channel "${t}" does not work with "${e}" scale. We are using "${n}" scale instead.`}function qUt(t,e){return`FieldDef does not work with "${t}" scale. We are using "${e}" scale instead.`}function t4e(t,e,n){return`${n}-scale's "${e}" is dropped as it does not work with ${t} scale.`}function n4e(t){return`The step for "${t}" is dropped because the ${t==="width"?"x":"y"} is continuous.`}function XUt(t,e,n,r){return`Conflicting ${e.toString()} property "${t.toString()}" (${Tr(n)} and ${Tr(r)}). Using ${Tr(n)}.`}function YUt(t,e,n,r){return`Conflicting ${e.toString()} property "${t.toString()}" (${Tr(n)} and ${Tr(r)}). Using the union of the two domains.`}function QUt(t){return`Setting the scale to be independent for "${t}" means we also have to set the guide (axis or legend) to be independent.`}function KUt(t){return`Dropping sort property ${Tr(t)} as unioned domains only support boolean or op "count", "min", and "max".`}const xye="Domains that should be unioned has conflicting sort properties. Sort will be set to true.",ZUt="Detected faceted independent scales that union domain of multiple fields from different data sources. We will use the first field. The result view size may be incorrect.",JUt="Detected faceted independent scales that union domain of the same fields from different source. We will assume that this is the same field from a different fork of the same data source. However, if this is not the case, the result view size may be incorrect.",e8t="Detected faceted independent scales that union domain of multiple fields from the same data source. We will use the first field. The result view size may be incorrect.";function t8t(t){return`Cannot stack "${t}" if there is already "${t}2".`}function n8t(t){return`Stack is applied to a non-linear scale (${t}).`}function r8t(t){return`Stacking is applied even though the aggregate function is non-summative ("${t}").`}function A5(t,e){return`Invalid ${t}: ${Tr(e)}.`}function i8t(t){return`Dropping day from datetime ${Tr(t)} as day cannot be combined with other units.`}function o8t(t,e){return`${e?"extent ":""}${e&&t?"and ":""}${t?"center ":""}${e&&t?"are ":"is "}not needed when data are aggregated.`}function s8t(t,e,n){return`${t} is not usually used with ${e} for ${n}.`}function a8t(t,e){return`Continuous axis should not have customized aggregation function ${t}; ${e} already agregates the axis.`}function bye(t){return`1D error band does not support ${t}.`}function r4e(t){return`Channel ${t} is required for "binned" bin.`}function l8t(t){return`Channel ${t} should not be used with "binned" bin.`}function c8t(t){return`Domain for ${t} is required for threshold scale.`}const i4e=fne(une);let JS=i4e;function u8t(t){return JS=t,JS}function f8t(){return JS=i4e,JS}function Ze(...t){JS.warn(...t)}function d8t(...t){JS.debug(...t)}function v1(t){if(t&&ht(t)){for(const e of kse)if(Ke(t,e))return!0}return!1}const o4e=["january","february","march","april","may","june","july","august","september","october","november","december"],h8t=o4e.map(t=>t.substr(0,3)),s4e=["sunday","monday","tuesday","wednesday","thursday","friday","saturday"],p8t=s4e.map(t=>t.substr(0,3));function g8t(t){if(s6(t)&&(t=+t),Jn(t))return t>4&&Ze(A5("quarter",t)),t-1;throw new Error(A5("quarter",t))}function m8t(t){if(s6(t)&&(t=+t),Jn(t))return t-1;{const e=t.toLowerCase(),n=o4e.indexOf(e);if(n!==-1)return n;const r=e.substr(0,3),i=h8t.indexOf(r);if(i!==-1)return i;throw new Error(A5("month",t))}}function v8t(t){if(s6(t)&&(t=+t),Jn(t))return t%7;{const e=t.toLowerCase(),n=s4e.indexOf(e);if(n!==-1)return n;const r=e.substr(0,3),i=p8t.indexOf(r);if(i!==-1)return i;throw new Error(A5("day",t))}}function Tse(t,e){const n=[];if(e&&t.day!==void 0&&Qe(t).length>1&&(Ze(i8t(t)),t=Kt(t),delete t.day),t.year!==void 0?n.push(t.year):n.push(2012),t.month!==void 0){const r=e?m8t(t.month):t.month;n.push(r)}else if(t.quarter!==void 0){const r=e?g8t(t.quarter):t.quarter;n.push(Jn(r)?r*3:`${r}*3`)}else n.push(0);if(t.date!==void 0)n.push(t.date);else if(t.day!==void 0){const r=e?v8t(t.day):t.day;n.push(Jn(r)?r+1:`${r}+1`)}else n.push(1);for(const r of["hours","minutes","seconds","milliseconds"]){const i=t[r];n.push(typeof i>"u"?0:i)}return n}function Sb(t){const n=Tse(t,!0).join(", ");return t.utc?`utc(${n})`:`datetime(${n})`}function y8t(t){const n=Tse(t,!1).join(", ");return t.utc?`utc(${n})`:`datetime(${n})`}function x8t(t){const e=Tse(t,!0);return t.utc?+new Date(Date.UTC(...e)):+new Date(...e)}const a4e={year:1,quarter:1,month:1,week:1,day:1,dayofyear:1,date:1,hours:1,minutes:1,seconds:1,milliseconds:1},kse=Qe(a4e);function b8t(t){return vt(a4e,t)}function y1(t){return ht(t)?t.binned:l4e(t)}function l4e(t){return t&&t.startsWith("binned")}function Ase(t){return t.startsWith("utc")}function w8t(t){return t.substring(3)}const _8t={"year-month":"%b %Y ","year-month-date":"%b %d, %Y "};function m6(t){return kse.filter(e=>u4e(t,e))}function c4e(t){const e=m6(t);return e[e.length-1]}function u4e(t,e){const n=t.indexOf(e);return!(n<0||n>0&&e==="seconds"&&t.charAt(n-1)==="i"||t.length>n+3&&e==="day"&&t.charAt(n+3)==="o"||n>0&&e==="year"&&t.charAt(n-1)==="f")}function S8t(t,e,{end:n}={end:!1}){const r=gse(e),i=Ase(t)?"utc":"";function o(l){return l==="quarter"?`(${i}quarter(${r})-1)`:`${i}${l}(${r})`}let s;const a={};for(const l of kse)u4e(t,l)&&(a[l]=o(l),s=l);return n&&(a[s]+="+1"),y8t(a)}function f4e(t){if(!t)return;const e=m6(t);return`timeUnitSpecifier(${Tr(e)}, ${Tr(_8t)})`}function C8t(t,e,n){if(!t)return;const r=f4e(t);return`${n||Ase(t)?"utc":"time"}Format(${e}, ${r})`}function Uo(t){if(!t)return;let e;return gt(t)?l4e(t)?e={unit:t.substring(6),binned:!0}:e={unit:t}:ht(t)&&(e={...t,...t.unit?{unit:t.unit}:{}}),Ase(e.unit)&&(e.utc=!0,e.unit=w8t(e.unit)),e}function O8t(t){const{utc:e,...n}=Uo(t);return n.unit?(e?"utc":"")+Qe(n).map(r=>pi(`${r==="unit"?"":`_${r}_`}${n[r]}`)).join(""):(e?"utc":"")+"timeunit"+Qe(n).map(r=>pi(`_${r}_${n[r]}`)).join("")}function d4e(t,e=n=>n){const n=Uo(t),r=c4e(n.unit);if(r&&r!=="day"){const i={year:2001,month:1,date:1,hours:0,minutes:0,seconds:0,milliseconds:0},{step:o,part:s}=h4e(r,n.step),a={...i,[s]:+i[s]+o};return`${e(Sb(a))} - ${e(Sb(i))}`}}const E8t={year:1,month:1,date:1,hours:1,minutes:1,seconds:1,milliseconds:1};function T8t(t){return vt(E8t,t)}function h4e(t,e=1){if(T8t(t))return{part:t,step:e};switch(t){case"day":case"dayofyear":return{part:"date",step:e};case"quarter":return{part:"month",step:e*3};case"week":return{part:"date",step:e*7}}}function k8t(t){return Ke(t,"param")}function Pse(t){return!!(t!=null&&t.field)&&t.equal!==void 0}function Mse(t){return!!(t!=null&&t.field)&&t.lt!==void 0}function Rse(t){return!!(t!=null&&t.field)&&t.lte!==void 0}function Dse(t){return!!(t!=null&&t.field)&&t.gt!==void 0}function Ise(t){return!!(t!=null&&t.field)&&t.gte!==void 0}function Lse(t){if(t!=null&&t.field){if(We(t.range)&&t.range.length===2)return!0;if(Mt(t.range))return!0}return!1}function $se(t){return!!(t!=null&&t.field)&&(We(t.oneOf)||We(t.in))}function A8t(t){return!!(t!=null&&t.field)&&t.valid!==void 0}function p4e(t){return $se(t)||Pse(t)||Lse(t)||Mse(t)||Dse(t)||Rse(t)||Ise(t)}function bd(t,e){return E6(t,{timeUnit:e,wrapTime:!0})}function P8t(t,e){return t.map(n=>bd(n,e))}function g4e(t,e=!0){const{field:n}=t,r=Uo(t.timeUnit),{unit:i,binned:o}=r||{},s=lt(t,{expr:"datum"}),a=i?`time(${o?s:S8t(i,n)})`:s;if(Pse(t))return`${a}===${bd(t.equal,i)}`;if(Mse(t)){const l=t.lt;return`${a}<${bd(l,i)}`}else if(Dse(t)){const l=t.gt;return`${a}>${bd(l,i)}`}else if(Rse(t)){const l=t.lte;return`${a}<=${bd(l,i)}`}else if(Ise(t)){const l=t.gte;return`${a}>=${bd(l,i)}`}else{if($se(t))return`indexof([${P8t(t.oneOf,i).join(",")}], ${a}) !== -1`;if(A8t(t))return v6(a,t.valid);if(Lse(t)){const{range:l}=is(t),c=Mt(l)?{signal:`${l.signal}[0]`}:l[0],u=Mt(l)?{signal:`${l.signal}[1]`}:l[1];if(c!==null&&u!==null&&e)return"inrange("+a+", ["+bd(c,i)+", "+bd(u,i)+"])";const f=[];return c!==null&&f.push(`${a} >= ${bd(c,i)}`),u!==null&&f.push(`${a} <= ${bd(u,i)}`),f.length>0?f.join(" && "):"true"}}throw new Error(`Invalid field predicate: ${Tr(t)}`)}function v6(t,e=!0){return e?`isValid(${t}) && isFinite(+${t})`:`!isValid(${t}) || !isFinite(+${t})`}function M8t(t){return p4e(t)&&t.timeUnit?{...t,timeUnit:Uo(t.timeUnit)}:t}const zR={quantitative:"quantitative",ordinal:"ordinal",temporal:"temporal",nominal:"nominal",geojson:"geojson"};function R8t(t){return t==="quantitative"||t==="temporal"}function m4e(t){return t==="ordinal"||t==="nominal"}const Cb=zR.quantitative,Fse=zR.ordinal,eC=zR.temporal,Nse=zR.nominal,DO=zR.geojson;function D8t(t){if(t)switch(t=t.toLowerCase(),t){case"q":case Cb:return"quantitative";case"t":case eC:return"temporal";case"o":case Fse:return"ordinal";case"n":case Nse:return"nominal";case DO:return"geojson"}}const os={LINEAR:"linear",LOG:"log",POW:"pow",SQRT:"sqrt",SYMLOG:"symlog",IDENTITY:"identity",SEQUENTIAL:"sequential",TIME:"time",UTC:"utc",QUANTILE:"quantile",QUANTIZE:"quantize",THRESHOLD:"threshold",BIN_ORDINAL:"bin-ordinal",ORDINAL:"ordinal",POINT:"point",BAND:"band"},$Y={linear:"numeric",log:"numeric",pow:"numeric",sqrt:"numeric",symlog:"numeric",identity:"numeric",sequential:"numeric",time:"time",utc:"time",ordinal:"ordinal","bin-ordinal":"bin-ordinal",point:"ordinal-position",band:"ordinal-position",quantile:"discretizing",quantize:"discretizing",threshold:"discretizing"};function I8t(t,e){const n=$Y[t],r=$Y[e];return n===r||n==="ordinal-position"&&r==="time"||r==="ordinal-position"&&n==="time"}const L8t={linear:0,log:1,pow:1,sqrt:1,symlog:1,identity:1,sequential:1,time:0,utc:0,point:10,band:11,ordinal:0,"bin-ordinal":0,quantile:0,quantize:0,threshold:0};function wye(t){return L8t[t]}const v4e=new Set(["linear","log","pow","sqrt","symlog"]),y4e=new Set([...v4e,"time","utc"]);function x4e(t){return v4e.has(t)}const b4e=new Set(["quantile","quantize","threshold"]),$8t=new Set([...y4e,...b4e,"sequential","identity"]),F8t=new Set(["ordinal","bin-ordinal","point","band"]);function Wo(t){return F8t.has(t)}function Hf(t){return $8t.has(t)}function Kd(t){return y4e.has(t)}function tC(t){return b4e.has(t)}const N8t={pointPadding:.5,barBandPaddingInner:.1,rectBandPaddingInner:0,tickBandPaddingInner:.25,bandWithNestedOffsetPaddingInner:.2,bandWithNestedOffsetPaddingOuter:.2,minBandSize:2,minFontSize:8,maxFontSize:40,minOpacity:.3,maxOpacity:.8,minSize:4,minStrokeWidth:1,maxStrokeWidth:4,quantileCount:4,quantizeCount:4,zero:!0};function z8t(t){return!gt(t)&&Ke(t,"name")}function w4e(t){return Ke(t,"param")}function j8t(t){return Ke(t,"unionWith")}function B8t(t){return ht(t)&&"field"in t}const U8t={type:1,domain:1,domainMax:1,domainMin:1,domainMid:1,domainRaw:1,align:1,range:1,rangeMax:1,rangeMin:1,scheme:1,bins:1,reverse:1,round:1,clamp:1,nice:1,base:1,exponent:1,constant:1,interpolate:1,zero:1,padding:1,paddingInner:1,paddingOuter:1},{type:kXn,domain:AXn,range:PXn,rangeMax:MXn,rangeMin:RXn,scheme:DXn,...W8t}=U8t,V8t=Qe(W8t);function FY(t,e){switch(e){case"type":case"domain":case"reverse":case"range":return!0;case"scheme":case"interpolate":return!["point","band","identity"].includes(t);case"bins":return!["point","band","identity","ordinal"].includes(t);case"round":return Kd(t)||t==="band"||t==="point";case"padding":case"rangeMin":case"rangeMax":return Kd(t)||["point","band"].includes(t);case"paddingOuter":case"align":return["point","band"].includes(t);case"paddingInner":return t==="band";case"domainMax":case"domainMid":case"domainMin":case"domainRaw":case"clamp":return Kd(t);case"nice":return Kd(t)||t==="quantize"||t==="threshold";case"exponent":return t==="pow";case"base":return t==="log";case"constant":return t==="symlog";case"zero":return Hf(t)&&!En(["log","time","utc","threshold","quantile"],t)}}function _4e(t,e){switch(e){case"interpolate":case"scheme":case"domainMid":return N_(t)?void 0:jUt(e);case"align":case"type":case"bins":case"domain":case"domainMax":case"domainMin":case"domainRaw":case"range":case"base":case"exponent":case"constant":case"nice":case"padding":case"paddingInner":case"paddingOuter":case"rangeMax":case"rangeMin":case"reverse":case"round":case"clamp":case"zero":return}}function G8t(t,e){return En([Fse,Nse],e)?t===void 0||Wo(t):e===eC?En([os.TIME,os.UTC,void 0],t):e===Cb?x4e(t)||tC(t)||t===void 0:!0}function H8t(t,e,n=!1){if(!Xh(t))return!1;switch(t){case yi:case Yo:case qy:case RO:case ju:case od:return Kd(e)||e==="band"?!0:e==="point"?!n:!1;case Kg:case Qy:case Zg:case Xy:case Yy:case h1:return Kd(e)||tC(e)||En(["band","point","ordinal"],e);case Sl:case Gh:case Hh:return e!=="band";case Ky:case Cl:return e==="ordinal"||tC(e)}}function q8t(t){return ht(t)&&"value"in t}const ja={arc:"arc",area:"area",bar:"bar",image:"image",line:"line",point:"point",rect:"rect",rule:"rule",text:"text",tick:"tick",trail:"trail",circle:"circle",square:"square",geoshape:"geoshape"},S4e=ja.arc,y6=ja.area,x6=ja.bar,X8t=ja.image,b6=ja.line,w6=ja.point,Y8t=ja.rect,P5=ja.rule,C4e=ja.text,zse=ja.tick,Q8t=ja.trail,jse=ja.circle,Bse=ja.square,O4e=ja.geoshape;function Jy(t){return["line","area","trail"].includes(t)}function XA(t){return["rect","bar","image","arc","tick"].includes(t)}const K8t=new Set(Qe(ja));function Ph(t){return Ke(t,"type")}const Z8t=["stroke","strokeWidth","strokeDash","strokeDashOffset","strokeOpacity","strokeJoin","strokeMiterLimit"],J8t=["fill","fillOpacity"],eWt=[...Z8t,...J8t],tWt={color:1,filled:1,invalid:1,order:1,radius2:1,theta2:1,timeUnitBandSize:1,timeUnitBandPosition:1},_ye=Qe(tWt),BV=["binSpacing","continuousBandSize","discreteBandSize","minBandSize"],nWt={area:["line","point"],bar:BV,rect:BV,line:["point"],tick:["bandSize","thickness",...BV]},rWt={color:"#4c78a8",invalid:"break-paths-show-path-domains",timeUnitBandSize:1},iWt={mark:1,arc:1,area:1,bar:1,circle:1,image:1,line:1,point:1,rect:1,rule:1,square:1,text:1,tick:1,trail:1,geoshape:1},E4e=Qe(iWt);function Ob(t){return Ke(t,"band")}const oWt={horizontal:["cornerRadiusTopRight","cornerRadiusBottomRight"],vertical:["cornerRadiusTopLeft","cornerRadiusTopRight"]},sWt=5,Use={binSpacing:0,continuousBandSize:sWt,minBandSize:.25,timeUnitBandPosition:.5},aWt={...Use,binSpacing:1},lWt={...Use,thickness:1};function cWt(t){return Ph(t)?t.type:t}function T4e(t,{isPath:e}){return t===void 0||t==="break-paths-show-path-domains"?e?"break-paths-show-domains":"filter":t===null?"show":t}function Wse({markDef:t,config:e,scaleChannel:n,scaleType:r,isCountAggregate:i}){var a,l;if(!r||!Hf(r)||i)return"always-valid";const o=T4e(Or("invalid",t,e),{isPath:Jy(t.type)});return((l=(a=e.scale)==null?void 0:a.invalid)==null?void 0:l[n])!==void 0?"show":o}function uWt(t){return t==="break-paths-filter-domains"||t==="break-paths-show-domains"}function k4e({scaleName:t,scale:e,mode:n}){const r=`domain('${t}')`;if(!e||!t)return;const i=`${r}[0]`,o=`peek(${r})`,s=e.domainHasZero();return s==="definitely"?{scale:t,value:0}:s==="maybe"?{signal:`scale('${t}', inrange(0, ${r}) ? 0 : ${n==="zeroOrMin"?i:o})`}:{signal:`scale('${t}', ${n==="zeroOrMin"?i:o})`}}function A4e({scaleChannel:t,channelDef:e,scale:n,scaleName:r,markDef:i,config:o}){var u;const s=n==null?void 0:n.get("type"),a=Xf(e),l=h6(a==null?void 0:a.aggregate),c=Wse({scaleChannel:t,markDef:i,config:o,scaleType:s,isCountAggregate:l});if(a&&c==="show"){const f=((u=o.scale.invalid)==null?void 0:u[t])??"zero-or-min";return{test:v6(lt(a,{expr:"datum"}),!1),...fWt(f,n,r)}}}function fWt(t,e,n){if(q8t(t)){const{value:r}=t;return Mt(r)?{signal:r.signal}:{value:r}}return k4e({scale:e,scaleName:n,mode:"zeroOrMin"})}function Vse(t){const{channel:e,channelDef:n,markDef:r,scale:i,scaleName:o,config:s}=t,a=p1(e),l=Gse(t),c=A4e({scaleChannel:a,channelDef:n,scale:i,scaleName:o,markDef:r,config:s});return c!==void 0?[c,l]:l}function dWt(t){const{datum:e}=t;return v1(e)?Sb(e):`${Tr(e)}`}function jx(t,e,n,r){const i={};if(e&&(i.scale=e),Yh(t)){const{datum:o}=t;v1(o)?i.signal=Sb(o):Mt(o)?i.signal=o.signal:NR(o)?i.signal=o.expr:i.value=o}else i.field=lt(t,n);if(r){const{offset:o,band:s}=r;o&&(i.offset=o),s&&(i.band=s)}return i}function M5({scaleName:t,fieldOrDatumDef:e,fieldOrDatumDef2:n,offset:r,startSuffix:i,endSuffix:o="end",bandPosition:s=.5}){const a=!Mt(s)&&0{switch(e.fieldTitle){case"plain":return t.field;case"functional":return TWt(t);default:return EWt(t,e)}};let U4e=B4e;function W4e(t){U4e=t}function kWt(){W4e(B4e)}function z_(t,e,{allowDisabling:n,includeDefault:r=!0}){var a;const i=(a=Yse(t))==null?void 0:a.title;if(!Je(t))return i??t.title;const o=t,s=r?Qse(o,e):void 0;return n?qi(i,o.title,s):i??o.title??s}function Yse(t){if(rC(t)&&t.axis)return t.axis;if(z4e(t)&&t.legend)return t.legend;if(qse(t)&&t.header)return t.header}function Qse(t,e){return U4e(t,e)}function I5(t){if(j4e(t)){const{format:e,formatType:n}=t;return{format:e,formatType:n}}else{const e=Yse(t)??{},{format:n,formatType:r}=e;return{format:n,formatType:r}}}function AWt(t,e){var o;switch(e){case"latitude":case"longitude":return"quantitative";case"row":case"column":case"facet":case"shape":case"strokeDash":return"nominal";case"order":return"ordinal"}if(Xse(t)&&We(t.sort))return"ordinal";const{aggregate:n,bin:r,timeUnit:i}=t;if(i)return"temporal";if(r||n&&!Zy(n)&&!Lg(n))return"quantitative";if(x1(t)&&((o=t.scale)!=null&&o.type))switch($Y[t.scale.type]){case"numeric":case"discretizing":return"quantitative";case"time":return"temporal"}return"nominal"}function Xf(t){if(Je(t))return t;if(C6(t))return t.condition}function _o(t){if(en(t))return t;if(WR(t))return t.condition}function V4e(t,e,n,r={}){if(gt(t)||Jn(t)||jy(t)){const i=gt(t)?"string":Jn(t)?"number":"boolean";return Ze(kUt(e,i,t)),{value:t}}return en(t)?L5(t,e,n,r):WR(t)?{...t,condition:L5(t.condition,e,n,r)}:t}function L5(t,e,n,r){if(j4e(t)){const{format:i,formatType:o,...s}=t;if(Eb(o)&&!n.customFormatTypes)return Ze(yye(e)),L5(s,e,n,r)}else{const i=rC(t)?"axis":z4e(t)?"legend":qse(t)?"header":null;if(i&&t[i]){const{format:o,formatType:s,...a}=t[i];if(Eb(s)&&!n.customFormatTypes)return Ze(yye(e)),L5({...t,[i]:a},e,n,r)}}return Je(t)?Kse(t,e,r):PWt(t)}function PWt(t){let e=t.type;if(e)return t;const{datum:n}=t;return e=Jn(n)?"quantitative":gt(n)?"nominal":v1(n)?"temporal":void 0,{...t,type:e}}function Kse(t,e,{compositeMark:n=!1}={}){const{aggregate:r,timeUnit:i,bin:o,field:s}=t,a={...t};if(!n&&r&&!Cse(r)&&!Zy(r)&&!Lg(r)&&(Ze(PUt(r)),delete a.aggregate),i&&(a.timeUnit=Uo(i)),s&&(a.field=`${s}`),Gr(o)&&(a.bin=O6(o,e)),ns(o)&&!Xi(e)&&Ze(l8t(e)),Pa(a)){const{type:l}=a,c=D8t(l);l!==c&&(a.type=c),l!=="quantitative"&&h6(r)&&(Ze(AUt(l,r)),a.type="quantitative")}else if(!Fje(e)){const l=AWt(a,e);a.type=l}if(Pa(a)){const{compatible:l,warning:c}=MWt(a,e)||{};l===!1&&Ze(c)}if(Xse(a)&>(a.sort)){const{sort:l}=a;if(Cye(l))return{...a,sort:{encoding:l}};const c=l.substring(1);if(l.charAt(0)==="-"&&Cye(c))return{...a,sort:{encoding:c,order:"descending"}}}if(qse(a)){const{header:l}=a;if(l){const{orient:c,...u}=l;if(c)return{...a,header:{...u,labelOrient:l.labelOrient||c,titleOrient:l.titleOrient||c}}}}return a}function O6(t,e){return jy(t)?{maxbins:cye(e)}:t==="binned"?{binned:!0}:!t.maxbins&&!t.step?{...t,maxbins:cye(e)}:t}const tw={compatible:!0};function MWt(t,e){const n=t.type;if(n==="geojson"&&e!=="shape")return{compatible:!1,warning:`Channel ${e} should not be used with a geojson data.`};switch(e){case og:case sg:case a6:return D5(t)?tw:{compatible:!1,warning:IUt(e)};case yi:case Yo:case qy:case RO:case Sl:case Gh:case Hh:case LR:case $R:case l6:case _b:case c6:case u6:case h1:case ju:case od:case f6:return tw;case ad:case Ru:case sd:case ld:return n!==Cb?{compatible:!1,warning:`Channel ${e} should be used with a quantitative field only, not ${t.type} field.`}:tw;case Zg:case Xy:case Yy:case Qy:case Kg:case Qg:case Yg:case id:case Vh:return n==="nominal"&&!t.sort?{compatible:!1,warning:`Channel ${e} should not be used with an unsorted discrete field.`}:tw;case Cl:case Ky:return!D5(t)&&!CWt(t)?{compatible:!1,warning:LUt(e)}:tw;case ZS:return t.type==="nominal"&&!("sort"in t)?{compatible:!1,warning:"Channel order is inappropriate for nominal field, which has no inherent order."}:tw}}function iC(t){const{formatType:e}=I5(t);return e==="time"||!e&&RWt(t)}function RWt(t){return t&&(t.type==="temporal"||Je(t)&&!!t.timeUnit)}function E6(t,{timeUnit:e,type:n,wrapTime:r,undefinedIfExprNotRequired:i}){var l;const o=e&&((l=Uo(e))==null?void 0:l.unit);let s=o||n==="temporal",a;return NR(t)?a=t.expr:Mt(t)?a=t.signal:v1(t)?(s=!0,a=Sb(t)):(gt(t)||Jn(t))&&s&&(a=`datetime(${Tr(t)})`,b8t(o)&&(Jn(t)&&t<1e4||gt(t)&&isNaN(Date.parse(t)))&&(a=Sb({[o]:t}))),a?r&&s?`time(${a})`:a:i?void 0:Tr(t)}function G4e(t,e){const{type:n}=t;return e.map(r=>{const i=Je(t)&&!y1(t.timeUnit)?t.timeUnit:void 0,o=E6(r,{timeUnit:i,type:n,undefinedIfExprNotRequired:!0});return o!==void 0?{signal:o}:r})}function VR(t,e){return Gr(t.bin)?Xh(e)&&["ordinal","nominal"].includes(t.type):(console.warn("Only call this method for binned field defs."),!1)}const Tye={labelAlign:{part:"labels",vgProp:"align"},labelBaseline:{part:"labels",vgProp:"baseline"},labelColor:{part:"labels",vgProp:"fill"},labelFont:{part:"labels",vgProp:"font"},labelFontSize:{part:"labels",vgProp:"fontSize"},labelFontStyle:{part:"labels",vgProp:"fontStyle"},labelFontWeight:{part:"labels",vgProp:"fontWeight"},labelOpacity:{part:"labels",vgProp:"opacity"},labelOffset:null,labelPadding:null,gridColor:{part:"grid",vgProp:"stroke"},gridDash:{part:"grid",vgProp:"strokeDash"},gridDashOffset:{part:"grid",vgProp:"strokeDashOffset"},gridOpacity:{part:"grid",vgProp:"opacity"},gridWidth:{part:"grid",vgProp:"strokeWidth"},tickColor:{part:"ticks",vgProp:"stroke"},tickDash:{part:"ticks",vgProp:"strokeDash"},tickDashOffset:{part:"ticks",vgProp:"strokeDashOffset"},tickOpacity:{part:"ticks",vgProp:"opacity"},tickSize:null,tickWidth:{part:"ticks",vgProp:"strokeWidth"}};function GR(t){return t==null?void 0:t.condition}const H4e=["domain","grid","labels","ticks","title"],DWt={grid:"grid",gridCap:"grid",gridColor:"grid",gridDash:"grid",gridDashOffset:"grid",gridOpacity:"grid",gridScale:"grid",gridWidth:"grid",orient:"main",bandPosition:"both",aria:"main",description:"main",domain:"main",domainCap:"main",domainColor:"main",domainDash:"main",domainDashOffset:"main",domainOpacity:"main",domainWidth:"main",format:"main",formatType:"main",labelAlign:"main",labelAngle:"main",labelBaseline:"main",labelBound:"main",labelColor:"main",labelFlush:"main",labelFlushOffset:"main",labelFont:"main",labelFontSize:"main",labelFontStyle:"main",labelFontWeight:"main",labelLimit:"main",labelLineHeight:"main",labelOffset:"main",labelOpacity:"main",labelOverlap:"main",labelPadding:"main",labels:"main",labelSeparation:"main",maxExtent:"main",minExtent:"main",offset:"both",position:"main",tickCap:"main",tickColor:"main",tickDash:"main",tickDashOffset:"main",tickMinStep:"both",tickOffset:"both",tickOpacity:"main",tickRound:"both",ticks:"main",tickSize:"main",tickWidth:"both",title:"main",titleAlign:"main",titleAnchor:"main",titleAngle:"main",titleBaseline:"main",titleColor:"main",titleFont:"main",titleFontSize:"main",titleFontStyle:"main",titleFontWeight:"main",titleLimit:"main",titleLineHeight:"main",titleOpacity:"main",titlePadding:"main",titleX:"main",titleY:"main",encode:"both",scale:"both",tickBand:"both",tickCount:"both",tickExtra:"both",translate:"both",values:"both",zindex:"both"},q4e={orient:1,aria:1,bandPosition:1,description:1,domain:1,domainCap:1,domainColor:1,domainDash:1,domainDashOffset:1,domainOpacity:1,domainWidth:1,format:1,formatType:1,grid:1,gridCap:1,gridColor:1,gridDash:1,gridDashOffset:1,gridOpacity:1,gridWidth:1,labelAlign:1,labelAngle:1,labelBaseline:1,labelBound:1,labelColor:1,labelFlush:1,labelFlushOffset:1,labelFont:1,labelFontSize:1,labelFontStyle:1,labelFontWeight:1,labelLimit:1,labelLineHeight:1,labelOffset:1,labelOpacity:1,labelOverlap:1,labelPadding:1,labels:1,labelSeparation:1,maxExtent:1,minExtent:1,offset:1,position:1,tickBand:1,tickCap:1,tickColor:1,tickCount:1,tickDash:1,tickDashOffset:1,tickExtra:1,tickMinStep:1,tickOffset:1,tickOpacity:1,tickRound:1,ticks:1,tickSize:1,tickWidth:1,title:1,titleAlign:1,titleAnchor:1,titleAngle:1,titleBaseline:1,titleColor:1,titleFont:1,titleFontSize:1,titleFontStyle:1,titleFontWeight:1,titleLimit:1,titleLineHeight:1,titleOpacity:1,titlePadding:1,titleX:1,titleY:1,translate:1,values:1,zindex:1},IWt={...q4e,style:1,labelExpr:1,encoding:1};function kye(t){return vt(IWt,t)}const LWt={axis:1,axisBand:1,axisBottom:1,axisDiscrete:1,axisLeft:1,axisPoint:1,axisQuantitative:1,axisRight:1,axisTemporal:1,axisTop:1,axisX:1,axisXBand:1,axisXDiscrete:1,axisXPoint:1,axisXQuantitative:1,axisXTemporal:1,axisY:1,axisYBand:1,axisYDiscrete:1,axisYPoint:1,axisYQuantitative:1,axisYTemporal:1},X4e=Qe(LWt);function em(t){return Ke(t,"mark")}class T6{constructor(e,n){this.name=e,this.run=n}hasMatchingType(e){return em(e)?cWt(e.mark)===this.name:!1}}function Bx(t,e){const n=t&&t[e];return n?We(n)?QS(n,r=>!!r.field):Je(n)||C6(n):!1}function Y4e(t,e){const n=t&&t[e];return n?We(n)?QS(n,r=>!!r.field):Je(n)||Yh(n)||WR(n):!1}function Q4e(t,e){if(Xi(e)){const n=t[e];if((Je(n)||Yh(n))&&(m4e(n.type)||Je(n)&&n.timeUnit)){const r=xse(e);return Y4e(t,r)}}return!1}function K4e(t){return QS(I6t,e=>{if(Bx(t,e)){const n=t[e];if(We(n))return QS(n,r=>!!r.aggregate);{const r=Xf(n);return r&&!!r.aggregate}}return!1})}function Z4e(t,e){const n=[],r=[],i=[],o=[],s={};return Zse(t,(a,l)=>{if(Je(a)){const{field:c,aggregate:u,bin:f,timeUnit:d,...h}=a;if(u||d||f){const p=Yse(a),g=p==null?void 0:p.title;let m=lt(a,{forAs:!0});const v={...g?[]:{title:z_(a,e,{allowDisabling:!0})},...h,field:m};if(u){let y;if(Zy(u)?(y="argmax",m=lt({op:"argmax",field:u.argmax},{forAs:!0}),v.field=`${m}.${c}`):Lg(u)?(y="argmin",m=lt({op:"argmin",field:u.argmin},{forAs:!0}),v.field=`${m}.${c}`):u!=="boxplot"&&u!=="errorbar"&&u!=="errorband"&&(y=u),y){const x={op:y,as:m};c&&(x.field=c),o.push(x)}}else if(n.push(m),Pa(a)&&Gr(f)){if(r.push({bin:f,field:c,as:m}),n.push(lt(a,{binSuffix:"end"})),VR(a,l)&&n.push(lt(a,{binSuffix:"range"})),Xi(l)){const y={field:`${m}_end`};s[`${l}2`]=y}v.bin="binned",Fje(l)||(v.type=Cb)}else if(d&&!y1(d)){i.push({timeUnit:d,field:c,as:m});const y=Pa(a)&&a.type!==eC&&"time";y&&(l===LR||l===_b?v.formatType=y:V6t(l)?v.legend={formatType:y,...v.legend}:Xi(l)&&(v.axis={formatType:y,...v.axis}))}s[l]=v}else n.push(c),s[l]=t[l]}else s[l]=t[l]}),{bins:r,timeUnits:i,aggregate:o,groupby:n,encoding:s}}function $Wt(t,e,n){const r=H6t(e,n);if(r){if(r==="binned"){const i=t[e===id?yi:Yo];return!!(Je(i)&&Je(t[e])&&ns(i.bin))}}else return!1;return!0}function FWt(t,e,n,r){const i={};for(const o of Qe(t))$je(o)||Ze(DUt(o));for(let o of j6t){if(!t[o])continue;const s=t[o];if(FR(o)){const a=z6t(o),l=i[a];if(Je(l)&&R8t(l.type)&&Je(s)&&!l.timeUnit){Ze(TUt(a));continue}}if(o==="angle"&&e==="arc"&&!t.theta&&(Ze(EUt),o=ju),!$Wt(t,o,e)){Ze(g6(o,e));continue}if(o===Kg&&e==="line"){const a=Xf(t[o]);if(a!=null&&a.aggregate){Ze(RUt);continue}}if(o===Sl&&(n?"fill"in t:"stroke"in t)){Ze(e4e("encoding",{fill:"fill"in t,stroke:"stroke"in t}));continue}if(o===$R||o===ZS&&!We(s)&&!qf(s)||o===_b&&We(s)){if(s){if(o===ZS){const a=t[o];if(N4e(a)){i[o]=a;continue}}i[o]=pt(s).reduce((a,l)=>(Je(l)?a.push(Kse(l,o)):Ze(LY(l,o)),a),[])}}else{if(o===_b&&s===null)i[o]=null;else if(!Je(s)&&!Yh(s)&&!qf(s)&&!UR(s)&&!Mt(s)){Ze(LY(s,o));continue}i[o]=V4e(s,o,r)}}return i}function k6(t,e){const n={};for(const r of Qe(t)){const i=V4e(t[r],r,e,{compositeMark:!0});n[r]=i}return n}function NWt(t){const e=[];for(const n of Qe(t))if(Bx(t,n)){const r=t[n],i=pt(r);for(const o of i)Je(o)?e.push(o):C6(o)&&e.push(o.condition)}return e}function Zse(t,e,n){if(t)for(const r of Qe(t)){const i=t[r];if(We(i))for(const o of i)e.call(n,o,r);else e.call(n,i,r)}}function zWt(t,e,n,r){return t?Qe(t).reduce((i,o)=>{const s=t[o];return We(s)?s.reduce((a,l)=>e.call(r,a,l,o),i):e.call(r,i,s,o)},n):n}function J4e(t,e){return Qe(e).reduce((n,r)=>{switch(r){case yi:case Yo:case c6:case f6:case u6:case id:case Vh:case qy:case RO:case ju:case Qg:case od:case Yg:case sd:case ad:case ld:case Ru:case LR:case Cl:case h1:case _b:return n;case ZS:if(t==="line"||t==="trail")return n;case $R:case l6:{const i=e[r];if(We(i)||Je(i))for(const o of pt(i))o.aggregate||n.push(lt(o,{}));return n}case Kg:if(t==="trail")return n;case Sl:case Gh:case Hh:case Zg:case Xy:case Yy:case Ky:case Qy:{const i=Xf(e[r]);return i&&!i.aggregate&&n.push(lt(i,{})),n}}},[])}function jWt(t){const{tooltip:e,...n}=t;if(!e)return{filteredEncoding:n};let r,i;if(We(e)){for(const o of e)o.aggregate?(r||(r=[]),r.push(o)):(i||(i=[]),i.push(o));r&&(n.tooltip=r)}else e.aggregate?n.tooltip=e:i=e;return We(i)&&i.length===1&&(i=i[0]),{customTooltipWithoutAggregatedField:i,filteredEncoding:n}}function zY(t,e,n,r=!0){if("tooltip"in n)return{tooltip:n.tooltip};const i=t.map(({fieldPrefix:s,titlePrefix:a})=>{const l=r?` of ${Jse(e)}`:"";return{field:s+e.field,type:e.type,title:Mt(a)?{signal:`${a}"${escape(l)}"`}:a+l}}),o=NWt(n).map(_Wt);return{tooltip:[...i,...Qd(o,Mn)]}}function Jse(t){const{title:e,field:n}=t;return qi(e,n)}function eae(t,e,n,r,i){const{scale:o,axis:s}=n;return({partName:a,mark:l,positionPrefix:c,endPositionPrefix:u=void 0,extraEncoding:f={}})=>{const d=Jse(n);return eBe(t,a,i,{mark:l,encoding:{[e]:{field:`${c}_${n.field}`,type:n.type,...d!==void 0?{title:d}:{},...o!==void 0?{scale:o}:{},...s!==void 0?{axis:s}:{}},...gt(u)?{[`${e}2`]:{field:`${u}_${n.field}`}}:{},...r,...f}})}}function eBe(t,e,n,r){const{clip:i,color:o,opacity:s}=t,a=t.type;return t[e]||t[e]===void 0&&n[e]?[{...r,mark:{...n[e],...i?{clip:i}:{},...o?{color:o}:{},...s?{opacity:s}:{},...Ph(r.mark)?r.mark:{type:r.mark},style:`${a}-${String(e)}`,...jy(t[e])?{}:t[e]}}]:[]}function tBe(t,e,n){const{encoding:r}=t,i=e==="vertical"?"y":"x",o=r[i],s=r[`${i}2`],a=r[`${i}Error`],l=r[`${i}Error2`];return{continuousAxisChannelDef:JI(o,n),continuousAxisChannelDef2:JI(s,n),continuousAxisChannelDefError:JI(a,n),continuousAxisChannelDefError2:JI(l,n),continuousAxis:i}}function JI(t,e){if(t!=null&&t.aggregate){const{aggregate:n,...r}=t;return n!==e&&Ze(a8t(n,e)),r}else return t}function nBe(t,e){const{mark:n,encoding:r}=t,{x:i,y:o}=r;if(Ph(n)&&n.orient)return n.orient;if(xv(i)){if(xv(o)){const s=Je(i)&&i.aggregate,a=Je(o)&&o.aggregate;if(!s&&a===e)return"vertical";if(!a&&s===e)return"horizontal";if(s===e&&a===e)throw new Error("Both x and y cannot have aggregate");return iC(o)&&!iC(i)?"horizontal":"vertical"}return"horizontal"}else{if(xv(o))return"vertical";throw new Error(`Need a valid continuous axis for ${e}s`)}}const $5="boxplot",BWt=["box","median","outliers","rule","ticks"],UWt=new T6($5,iBe);function rBe(t){return Jn(t)?"tukey":t}function iBe(t,{config:e}){t={...t,encoding:k6(t.encoding,e)};const{mark:n,encoding:r,params:i,projection:o,...s}=t,a=Ph(n)?n:{type:n};i&&Ze(Zje("boxplot"));const l=a.extent??e.boxplot.extent,c=Or("size",a,e),u=a.invalid,f=rBe(l),{bins:d,timeUnits:h,transform:p,continuousAxisChannelDef:g,continuousAxis:m,groupby:v,aggregate:y,encodingWithoutContinuousAxis:x,ticksOrient:b,boxOrient:w,customTooltipWithoutAggregatedField:_}=WWt(t,l,e),S=MO(g.field),{color:O,size:k,...E}=x,P=X=>eae(a,m,g,X,e.boxplot),A=P(E),R=P(x),T=(ht(e.boxplot.box)?e.boxplot.box.color:e.mark.color)||"#4c78a8",M=P({...E,...k?{size:k}:{},color:{condition:{test:`datum['lower_box_${g.field}'] >= datum['upper_box_${g.field}']`,...O||{value:T}}}}),I=zY([{fieldPrefix:f==="min-max"?"upper_whisker_":"max_",titlePrefix:"Max"},{fieldPrefix:"upper_box_",titlePrefix:"Q3"},{fieldPrefix:"mid_box_",titlePrefix:"Median"},{fieldPrefix:"lower_box_",titlePrefix:"Q1"},{fieldPrefix:f==="min-max"?"lower_whisker_":"min_",titlePrefix:"Min"}],g,x),j={type:"tick",color:"black",opacity:1,orient:b,invalid:u,aria:!1},N=f==="min-max"?I:zY([{fieldPrefix:"upper_whisker_",titlePrefix:"Upper Whisker"},{fieldPrefix:"lower_whisker_",titlePrefix:"Lower Whisker"}],g,x),z=[...A({partName:"rule",mark:{type:"rule",invalid:u,aria:!1},positionPrefix:"lower_whisker",endPositionPrefix:"lower_box",extraEncoding:N}),...A({partName:"rule",mark:{type:"rule",invalid:u,aria:!1},positionPrefix:"upper_box",endPositionPrefix:"upper_whisker",extraEncoding:N}),...A({partName:"ticks",mark:j,positionPrefix:"lower_whisker",extraEncoding:N}),...A({partName:"ticks",mark:j,positionPrefix:"upper_whisker",extraEncoding:N})],L=[...f!=="tukey"?z:[],...R({partName:"box",mark:{type:"bar",...c?{size:c}:{},orient:w,invalid:u,ariaRoleDescription:"box"},positionPrefix:"lower_box",endPositionPrefix:"upper_box",extraEncoding:I}),...M({partName:"median",mark:{type:"tick",invalid:u,...ht(e.boxplot.median)&&e.boxplot.median.color?{color:e.boxplot.median.color}:{},...c?{size:c}:{},orient:b,aria:!1},positionPrefix:"mid_box",extraEncoding:I})];if(f==="min-max")return{...s,transform:(s.transform??[]).concat(p),layer:L};const B=`datum["lower_box_${g.field}"]`,F=`datum["upper_box_${g.field}"]`,$=`(${F} - ${B})`,q=`${B} - ${l} * ${$}`,G=`${F} + ${l} * ${$}`,Y=`datum["${g.field}"]`,le={joinaggregate:oBe(g.field),groupby:v},K={transform:[{filter:`(${q} <= ${Y}) && (${Y} <= ${G})`},{aggregate:[{op:"min",field:g.field,as:`lower_whisker_${S}`},{op:"max",field:g.field,as:`upper_whisker_${S}`},{op:"min",field:`lower_box_${g.field}`,as:`lower_box_${S}`},{op:"max",field:`upper_box_${g.field}`,as:`upper_box_${S}`},...y],groupby:v}],layer:z},{tooltip:ee,...re}=E,{scale:ge,axis:te}=g,ae=Jse(g),U=hl(te,["title"]),oe=eBe(a,"outliers",e.boxplot,{transform:[{filter:`(${Y} < ${q}) || (${Y} > ${G})`}],mark:"point",encoding:{[m]:{field:g.field,type:g.type,...ae!==void 0?{title:ae}:{},...ge!==void 0?{scale:ge}:{},...Er(U)?{}:{axis:U}},...re,...O?{color:O}:{},..._?{tooltip:_}:{}}})[0];let ne;const V=[...d,...h,le];return oe?ne={transform:V,layer:[oe,K]}:(ne=K,ne.transform.unshift(...V)),{...s,layer:[ne,{transform:p,layer:L}]}}function oBe(t){const e=MO(t);return[{op:"q1",field:t,as:`lower_box_${e}`},{op:"q3",field:t,as:`upper_box_${e}`}]}function WWt(t,e,n){const r=nBe(t,$5),{continuousAxisChannelDef:i,continuousAxis:o}=tBe(t,r,$5),s=i.field,a=MO(s),l=rBe(e),c=[...oBe(s),{op:"median",field:s,as:`mid_box_${a}`},{op:"min",field:s,as:(l==="min-max"?"lower_whisker_":"min_")+a},{op:"max",field:s,as:(l==="min-max"?"upper_whisker_":"max_")+a}],u=l==="min-max"||l==="tukey"?[]:[{calculate:`datum["upper_box_${a}"] - datum["lower_box_${a}"]`,as:`iqr_${a}`},{calculate:`min(datum["upper_box_${a}"] + datum["iqr_${a}"] * ${e}, datum["max_${a}"])`,as:`upper_whisker_${a}`},{calculate:`max(datum["lower_box_${a}"] - datum["iqr_${a}"] * ${e}, datum["min_${a}"])`,as:`lower_whisker_${a}`}],{[o]:f,...d}=t.encoding,{customTooltipWithoutAggregatedField:h,filteredEncoding:p}=jWt(d),{bins:g,timeUnits:m,aggregate:v,groupby:y,encoding:x}=Z4e(p,n),b=r==="vertical"?"horizontal":"vertical",w=r,_=[...g,...m,{aggregate:[...v,...c],groupby:y},...u];return{bins:g,timeUnits:m,transform:_,groupby:y,aggregate:v,continuousAxisChannelDef:i,continuousAxis:o,encodingWithoutContinuousAxis:x,ticksOrient:b,boxOrient:w,customTooltipWithoutAggregatedField:h}}const tae="errorbar",VWt=["ticks","rule"],GWt=new T6(tae,sBe);function sBe(t,{config:e}){t={...t,encoding:k6(t.encoding,e)};const{transform:n,continuousAxisChannelDef:r,continuousAxis:i,encodingWithoutContinuousAxis:o,ticksOrient:s,markDef:a,outerSpec:l,tooltipEncoding:c}=aBe(t,tae,e);delete o.size;const u=eae(a,i,r,o,e.errorbar),f=a.thickness,d=a.size,h={type:"tick",orient:s,aria:!1,...f!==void 0?{thickness:f}:{},...d!==void 0?{size:d}:{}},p=[...u({partName:"ticks",mark:h,positionPrefix:"lower",extraEncoding:c}),...u({partName:"ticks",mark:h,positionPrefix:"upper",extraEncoding:c}),...u({partName:"rule",mark:{type:"rule",ariaRoleDescription:"errorbar",...f!==void 0?{size:f}:{}},positionPrefix:"lower",endPositionPrefix:"upper",extraEncoding:c})];return{...l,transform:n,...p.length>1?{layer:p}:{...p[0]}}}function HWt(t,e){const{encoding:n}=t;if(qWt(n))return{orient:nBe(t,e),inputType:"raw"};const r=XWt(n),i=YWt(n),o=n.x,s=n.y;if(r){if(i)throw new Error(`${e} cannot be both type aggregated-upper-lower and aggregated-error`);const a=n.x2,l=n.y2;if(en(a)&&en(l))throw new Error(`${e} cannot have both x2 and y2`);if(en(a)){if(xv(o))return{orient:"horizontal",inputType:"aggregated-upper-lower"};throw new Error(`Both x and x2 have to be quantitative in ${e}`)}else if(en(l)){if(xv(s))return{orient:"vertical",inputType:"aggregated-upper-lower"};throw new Error(`Both y and y2 have to be quantitative in ${e}`)}throw new Error("No ranged axis")}else{const a=n.xError,l=n.xError2,c=n.yError,u=n.yError2;if(en(l)&&!en(a))throw new Error(`${e} cannot have xError2 without xError`);if(en(u)&&!en(c))throw new Error(`${e} cannot have yError2 without yError`);if(en(a)&&en(c))throw new Error(`${e} cannot have both xError and yError with both are quantiative`);if(en(a)){if(xv(o))return{orient:"horizontal",inputType:"aggregated-error"};throw new Error("All x, xError, and xError2 (if exist) have to be quantitative")}else if(en(c)){if(xv(s))return{orient:"vertical",inputType:"aggregated-error"};throw new Error("All y, yError, and yError2 (if exist) have to be quantitative")}throw new Error("No ranged axis")}}function qWt(t){return(en(t.x)||en(t.y))&&!en(t.x2)&&!en(t.y2)&&!en(t.xError)&&!en(t.xError2)&&!en(t.yError)&&!en(t.yError2)}function XWt(t){return en(t.x2)||en(t.y2)}function YWt(t){return en(t.xError)||en(t.xError2)||en(t.yError)||en(t.yError2)}function aBe(t,e,n){const{mark:r,encoding:i,params:o,projection:s,...a}=t,l=Ph(r)?r:{type:r};o&&Ze(Zje(e));const{orient:c,inputType:u}=HWt(t,e),{continuousAxisChannelDef:f,continuousAxisChannelDef2:d,continuousAxisChannelDefError:h,continuousAxisChannelDefError2:p,continuousAxis:g}=tBe(t,c,e),{errorBarSpecificAggregate:m,postAggregateCalculates:v,tooltipSummary:y,tooltipTitleWithFieldName:x}=QWt(l,f,d,h,p,u,e,n),{[g]:b,[g==="x"?"x2":"y2"]:w,[g==="x"?"xError":"yError"]:_,[g==="x"?"xError2":"yError2"]:S,...O}=i,{bins:k,timeUnits:E,aggregate:P,groupby:A,encoding:R}=Z4e(O,n),T=[...P,...m],M=u!=="raw"?[]:A,I=zY(y,f,R,x);return{transform:[...a.transform??[],...k,...E,...T.length===0?[]:[{aggregate:T,groupby:M}],...v],groupby:M,continuousAxisChannelDef:f,continuousAxis:g,encodingWithoutContinuousAxis:R,ticksOrient:c==="vertical"?"horizontal":"vertical",markDef:l,outerSpec:a,tooltipEncoding:I}}function QWt(t,e,n,r,i,o,s,a){let l=[],c=[];const u=e.field;let f,d=!1;if(o==="raw"){const h=t.center?t.center:t.extent?t.extent==="iqr"?"median":"mean":a.errorbar.center,p=t.extent?t.extent:h==="mean"?"stderr":"iqr";if(h==="median"!=(p==="iqr")&&Ze(s8t(h,p,s)),p==="stderr"||p==="stdev")l=[{op:p,field:u,as:`extent_${u}`},{op:h,field:u,as:`center_${u}`}],c=[{calculate:`datum["center_${u}"] + datum["extent_${u}"]`,as:`upper_${u}`},{calculate:`datum["center_${u}"] - datum["extent_${u}"]`,as:`lower_${u}`}],f=[{fieldPrefix:"center_",titlePrefix:IR(h)},{fieldPrefix:"upper_",titlePrefix:Aye(h,p,"+")},{fieldPrefix:"lower_",titlePrefix:Aye(h,p,"-")}],d=!0;else{let g,m,v;p==="ci"?(g="mean",m="ci0",v="ci1"):(g="median",m="q1",v="q3"),l=[{op:m,field:u,as:`lower_${u}`},{op:v,field:u,as:`upper_${u}`},{op:g,field:u,as:`center_${u}`}],f=[{fieldPrefix:"upper_",titlePrefix:z_({field:u,aggregate:v,type:"quantitative"},a,{allowDisabling:!1})},{fieldPrefix:"lower_",titlePrefix:z_({field:u,aggregate:m,type:"quantitative"},a,{allowDisabling:!1})},{fieldPrefix:"center_",titlePrefix:z_({field:u,aggregate:g,type:"quantitative"},a,{allowDisabling:!1})}]}}else{(t.center||t.extent)&&Ze(o8t(t.center,t.extent)),o==="aggregated-upper-lower"?(f=[],c=[{calculate:`datum["${n.field}"]`,as:`upper_${u}`},{calculate:`datum["${u}"]`,as:`lower_${u}`}]):o==="aggregated-error"&&(f=[{fieldPrefix:"",titlePrefix:u}],c=[{calculate:`datum["${u}"] + datum["${r.field}"]`,as:`upper_${u}`}],i?c.push({calculate:`datum["${u}"] + datum["${i.field}"]`,as:`lower_${u}`}):c.push({calculate:`datum["${u}"] - datum["${r.field}"]`,as:`lower_${u}`}));for(const h of c)f.push({fieldPrefix:h.as.substring(0,6),titlePrefix:wb(wb(h.calculate,'datum["',""),'"]',"")})}return{postAggregateCalculates:c,errorBarSpecificAggregate:l,tooltipSummary:f,tooltipTitleWithFieldName:d}}function Aye(t,e,n){return`${IR(t)} ${n} ${e}`}const nae="errorband",KWt=["band","borders"],ZWt=new T6(nae,lBe);function lBe(t,{config:e}){t={...t,encoding:k6(t.encoding,e)};const{transform:n,continuousAxisChannelDef:r,continuousAxis:i,encodingWithoutContinuousAxis:o,markDef:s,outerSpec:a,tooltipEncoding:l}=aBe(t,nae,e),c=s,u=eae(c,i,r,o,e.errorband),f=t.encoding.x!==void 0&&t.encoding.y!==void 0;let d={type:f?"area":"rect"},h={type:f?"line":"rule"};const p={...c.interpolate?{interpolate:c.interpolate}:{},...c.tension&&c.interpolate?{tension:c.tension}:{}};return f?(d={...d,...p,ariaRoleDescription:"errorband"},h={...h,...p,aria:!1}):c.interpolate?Ze(bye("interpolate")):c.tension&&Ze(bye("tension")),{...a,transform:n,layer:[...u({partName:"band",mark:d,positionPrefix:"lower",endPositionPrefix:"upper",extraEncoding:l}),...u({partName:"borders",mark:h,positionPrefix:"lower",extraEncoding:l}),...u({partName:"borders",mark:h,positionPrefix:"upper",extraEncoding:l})]}}const cBe={};function rae(t,e,n){const r=new T6(t,e);cBe[t]={normalizer:r,parts:n}}function JWt(){return Qe(cBe)}rae($5,iBe,BWt);rae(tae,sBe,VWt);rae(nae,lBe,KWt);const eVt=["gradientHorizontalMaxLength","gradientHorizontalMinLength","gradientVerticalMaxLength","gradientVerticalMinLength","unselectedOpacity"],uBe={titleAlign:"align",titleAnchor:"anchor",titleAngle:"angle",titleBaseline:"baseline",titleColor:"color",titleFont:"font",titleFontSize:"fontSize",titleFontStyle:"fontStyle",titleFontWeight:"fontWeight",titleLimit:"limit",titleLineHeight:"lineHeight",titleOrient:"orient",titlePadding:"offset"},fBe={labelAlign:"align",labelAnchor:"anchor",labelAngle:"angle",labelBaseline:"baseline",labelColor:"color",labelFont:"font",labelFontSize:"fontSize",labelFontStyle:"fontStyle",labelFontWeight:"fontWeight",labelLimit:"limit",labelLineHeight:"lineHeight",labelOrient:"orient",labelPadding:"offset"},tVt=Qe(uBe),nVt=Qe(fBe),rVt={header:1,headerRow:1,headerColumn:1,headerFacet:1},dBe=Qe(rVt),hBe=["size","shape","fill","stroke","strokeDash","strokeWidth","opacity"],iVt={gradientHorizontalMaxLength:200,gradientHorizontalMinLength:100,gradientVerticalMaxLength:200,gradientVerticalMinLength:64,unselectedOpacity:.35},oVt={aria:1,clipHeight:1,columnPadding:1,columns:1,cornerRadius:1,description:1,direction:1,fillColor:1,format:1,formatType:1,gradientLength:1,gradientOpacity:1,gradientStrokeColor:1,gradientStrokeWidth:1,gradientThickness:1,gridAlign:1,labelAlign:1,labelBaseline:1,labelColor:1,labelFont:1,labelFontSize:1,labelFontStyle:1,labelFontWeight:1,labelLimit:1,labelOffset:1,labelOpacity:1,labelOverlap:1,labelPadding:1,labelSeparation:1,legendX:1,legendY:1,offset:1,orient:1,padding:1,rowPadding:1,strokeColor:1,symbolDash:1,symbolDashOffset:1,symbolFillColor:1,symbolLimit:1,symbolOffset:1,symbolOpacity:1,symbolSize:1,symbolStrokeColor:1,symbolStrokeWidth:1,symbolType:1,tickCount:1,tickMinStep:1,title:1,titleAlign:1,titleAnchor:1,titleBaseline:1,titleColor:1,titleFont:1,titleFontSize:1,titleFontStyle:1,titleFontWeight:1,titleLimit:1,titleLineHeight:1,titleOpacity:1,titleOrient:1,titlePadding:1,type:1,values:1,zindex:1},Yf="_vgsid_",sVt={point:{on:"click",fields:[Yf],toggle:"event.shiftKey",resolve:"global",clear:"dblclick"},interval:{on:"[pointerdown, window:pointerup] > window:pointermove!",encodings:["x","y"],translate:"[pointerdown, window:pointerup] > window:pointermove!",zoom:"wheel!",mark:{fill:"#333",fillOpacity:.125,stroke:"white"},resolve:"global",clear:"dblclick"}};function iae(t){return t==="legend"||!!(t!=null&&t.legend)}function UV(t){return iae(t)&&ht(t)}function oae(t){return!!(t!=null&&t.select)}function pBe(t){const e=[];for(const n of t||[]){if(oae(n))continue;const{expr:r,bind:i,...o}=n;if(i&&r){const s={...o,bind:i,init:r};e.push(s)}else{const s={...o,...r?{update:r}:{},...i?{bind:i}:{}};e.push(s)}}return e}function aVt(t){return A6(t)||aae(t)||sae(t)}function sae(t){return Ke(t,"concat")}function A6(t){return Ke(t,"vconcat")}function aae(t){return Ke(t,"hconcat")}function gBe({step:t,offsetIsDiscrete:e}){return e?t.for??"offset":"position"}function Mh(t){return Ke(t,"step")}function Pye(t){return Ke(t,"view")||Ke(t,"width")||Ke(t,"height")}const Mye=20,lVt={align:1,bounds:1,center:1,columns:1,spacing:1},cVt=Qe(lVt);function uVt(t,e,n){const r=n[e],i={},{spacing:o,columns:s}=r;o!==void 0&&(i.spacing=o),s!==void 0&&(S6(t)&&!BR(t.facet)||sae(t))&&(i.columns=s),A6(t)&&(i.columns=1);for(const a of cVt)if(t[a]!==void 0)if(a==="spacing"){const l=t[a];i[a]=Jn(l)?l:{row:l.row??o,column:l.column??o}}else i[a]=t[a];return i}function jY(t,e){return t[e]??t[e==="width"?"continuousWidth":"continuousHeight"]}function BY(t,e){const n=F5(t,e);return Mh(n)?n.step:mBe}function F5(t,e){const n=t[e]??t[e==="width"?"discreteWidth":"discreteHeight"];return qi(n,{step:t.step})}const mBe=20,fVt={continuousWidth:200,continuousHeight:200,step:mBe},dVt={background:"white",padding:5,timeFormat:"%b %d, %Y",countTitle:"Count of Records",view:fVt,mark:rWt,arc:{},area:{},bar:aWt,circle:{},geoshape:{},image:{},line:{},point:{},rect:Use,rule:{color:"black"},square:{},text:{color:"black"},tick:lWt,trail:{},boxplot:{size:14,extent:1.5,box:{},median:{color:"white"},outliers:{},rule:{},ticks:null},errorbar:{center:"mean",rule:!0,ticks:!1},errorband:{band:{opacity:.3},borders:!1},scale:N8t,projection:{},legend:iVt,header:{titlePadding:10,labelPadding:10},headerColumn:{},headerRow:{},headerFacet:{},selection:sVt,style:{},title:{},facet:{spacing:Mye},concat:{spacing:Mye},normalizedNumberFormat:".0%"},cp=["#4c78a8","#f58518","#e45756","#72b7b2","#54a24b","#eeca3b","#b279a2","#ff9da6","#9d755d","#bab0ac"],Rye={text:11,guideLabel:10,guideTitle:11,groupTitle:13,groupSubtitle:12},Dye={blue:cp[0],orange:cp[1],red:cp[2],teal:cp[3],green:cp[4],yellow:cp[5],purple:cp[6],pink:cp[7],brown:cp[8],gray0:"#000",gray1:"#111",gray2:"#222",gray3:"#333",gray4:"#444",gray5:"#555",gray6:"#666",gray7:"#777",gray8:"#888",gray9:"#999",gray10:"#aaa",gray11:"#bbb",gray12:"#ccc",gray13:"#ddd",gray14:"#eee",gray15:"#fff"};function hVt(t={}){return{signals:[{name:"color",value:ht(t)?{...Dye,...t}:Dye}],mark:{color:{signal:"color.blue"}},rule:{color:{signal:"color.gray0"}},text:{color:{signal:"color.gray0"}},style:{"guide-label":{fill:{signal:"color.gray0"}},"guide-title":{fill:{signal:"color.gray0"}},"group-title":{fill:{signal:"color.gray0"}},"group-subtitle":{fill:{signal:"color.gray0"}},cell:{stroke:{signal:"color.gray8"}}},axis:{domainColor:{signal:"color.gray13"},gridColor:{signal:"color.gray8"},tickColor:{signal:"color.gray13"}},range:{category:[{signal:"color.blue"},{signal:"color.orange"},{signal:"color.red"},{signal:"color.teal"},{signal:"color.green"},{signal:"color.yellow"},{signal:"color.purple"},{signal:"color.pink"},{signal:"color.brown"},{signal:"color.grey8"}]}}}function pVt(t){return{signals:[{name:"fontSize",value:ht(t)?{...Rye,...t}:Rye}],text:{fontSize:{signal:"fontSize.text"}},style:{"guide-label":{fontSize:{signal:"fontSize.guideLabel"}},"guide-title":{fontSize:{signal:"fontSize.guideTitle"}},"group-title":{fontSize:{signal:"fontSize.groupTitle"}},"group-subtitle":{fontSize:{signal:"fontSize.groupSubtitle"}}}}}function gVt(t){return{text:{font:t},style:{"guide-label":{font:t},"guide-title":{font:t},"group-title":{font:t},"group-subtitle":{font:t}}}}function vBe(t){const e=Qe(t||{}),n={};for(const r of e){const i=t[r];n[r]=GR(i)?Gje(i):ec(i)}return n}function mVt(t){const e=Qe(t),n={};for(const r of e)n[r]=vBe(t[r]);return n}const vVt=[...E4e,...X4e,...dBe,"background","padding","legend","lineBreak","scale","style","title","view"];function yBe(t={}){const{color:e,font:n,fontSize:r,selection:i,...o}=t,s=gO({},Kt(dVt),n?gVt(n):{},e?hVt(e):{},r?pVt(r):{},o||{});i&&mO(s,"selection",i,!0);const a=hl(s,vVt);for(const l of["background","lineBreak","padding"])s[l]&&(a[l]=ec(s[l]));for(const l of E4e)s[l]&&(a[l]=is(s[l]));for(const l of X4e)s[l]&&(a[l]=vBe(s[l]));for(const l of dBe)s[l]&&(a[l]=is(s[l]));if(s.legend&&(a.legend=is(s.legend)),s.scale){const{invalid:l,...c}=s.scale,u=is(l,{level:1});a.scale={...is(c),...Qe(u).length>0?{invalid:u}:{}}}return s.style&&(a.style=mVt(s.style)),s.title&&(a.title=is(s.title)),s.view&&(a.view=is(s.view)),a}const yVt=new Set(["view",...K8t]),xVt=["color","fontSize","background","padding","facet","concat","numberFormat","numberFormatType","normalizedNumberFormat","normalizedNumberFormatType","timeFormat","countTitle","header","axisQuantitative","axisTemporal","axisDiscrete","axisPoint","axisXBand","axisXPoint","axisXDiscrete","axisXQuantitative","axisXTemporal","axisYBand","axisYPoint","axisYDiscrete","axisYQuantitative","axisYTemporal","scale","selection","overlay"],bVt={view:["continuousWidth","continuousHeight","discreteWidth","discreteHeight","step"],...nWt};function wVt(t){t=Kt(t);for(const e of xVt)delete t[e];if(t.axis)for(const e in t.axis)GR(t.axis[e])&&delete t.axis[e];if(t.legend)for(const e of eVt)delete t.legend[e];if(t.mark){for(const e of _ye)delete t.mark[e];t.mark.tooltip&&ht(t.mark.tooltip)&&delete t.mark.tooltip}t.params&&(t.signals=(t.signals||[]).concat(pBe(t.params)),delete t.params);for(const e of yVt){for(const r of _ye)delete t[e][r];const n=bVt[e];if(n)for(const r of n)delete t[e][r];SVt(t,e)}for(const e of JWt())delete t[e];_Vt(t);for(const e in t)ht(t[e])&&Er(t[e])&&delete t[e];return Er(t)?void 0:t}function _Vt(t){const{titleMarkConfig:e,subtitleMarkConfig:n,subtitle:r}=Vje(t.title);Er(e)||(t.style["group-title"]={...t.style["group-title"],...e}),Er(n)||(t.style["group-subtitle"]={...t.style["group-subtitle"],...n}),Er(r)?delete t.title:t.title=r}function SVt(t,e,n,r){const i=t[e];e==="view"&&(n="cell");const o={...i,...t.style[n??e]};Er(o)||(t.style[n??e]=o),delete t[e]}function P6(t){return Ke(t,"layer")}function CVt(t){return Ke(t,"repeat")}function OVt(t){return!We(t.repeat)&&Ke(t.repeat,"layer")}class lae{map(e,n){return S6(e)?this.mapFacet(e,n):CVt(e)?this.mapRepeat(e,n):aae(e)?this.mapHConcat(e,n):A6(e)?this.mapVConcat(e,n):sae(e)?this.mapConcat(e,n):this.mapLayerOrUnit(e,n)}mapLayerOrUnit(e,n){if(P6(e))return this.mapLayer(e,n);if(em(e))return this.mapUnit(e,n);throw new Error(Ose(e))}mapLayer(e,n){return{...e,layer:e.layer.map(r=>this.mapLayerOrUnit(r,n))}}mapHConcat(e,n){return{...e,hconcat:e.hconcat.map(r=>this.map(r,n))}}mapVConcat(e,n){return{...e,vconcat:e.vconcat.map(r=>this.map(r,n))}}mapConcat(e,n){const{concat:r,...i}=e;return{...i,concat:r.map(o=>this.map(o,n))}}mapFacet(e,n){return{...e,spec:this.map(e.spec,n)}}mapRepeat(e,n){return{...e,spec:this.map(e.spec,n)}}}const EVt={zero:1,center:1,normalize:1};function TVt(t){return vt(EVt,t)}const kVt=new Set([S4e,x6,y6,P5,w6,jse,Bse,b6,C4e,zse]),AVt=new Set([x6,y6,S4e]);function nw(t){return Je(t)&&nC(t)==="quantitative"&&!t.bin}function Iye(t,e,{orient:n,type:r}){const i=e==="x"?"y":"radius",o=e==="x"&&["bar","area"].includes(r),s=t[e],a=t[i];if(Je(s)&&Je(a))if(nw(s)&&nw(a)){if(s.stack)return e;if(a.stack)return i;const l=Je(s)&&!!s.aggregate,c=Je(a)&&!!a.aggregate;if(l!==c)return l?e:i;if(o){if(n==="vertical")return i;if(n==="horizontal")return e}}else{if(nw(s))return e;if(nw(a))return i}else{if(nw(s))return o&&n==="vertical"?void 0:e;if(nw(a))return o&&n==="horizontal"?void 0:i}}function PVt(t){switch(t){case"x":return"y";case"y":return"x";case"theta":return"radius";case"radius":return"theta"}}function xBe(t,e){var g,m;const n=Ph(t)?t:{type:t},r=n.type;if(!kVt.has(r))return null;const i=Iye(e,"x",n)||Iye(e,"theta",n);if(!i)return null;const o=e[i],s=Je(o)?lt(o,{}):void 0,a=PVt(i),l=[],c=new Set;if(e[a]){const v=e[a],y=Je(v)?lt(v,{}):void 0;y&&y!==s&&(l.push(a),c.add(y))}const u=a==="x"?"xOffset":"yOffset",f=e[u],d=Je(f)?lt(f,{}):void 0;d&&d!==s&&(l.push(u),c.add(d));const h=B6t.reduce((v,y)=>{if(y!=="tooltip"&&Bx(e,y)){const x=e[y];for(const b of pt(x)){const w=Xf(b);if(w.aggregate)continue;const _=lt(w,{});(!_||!c.has(_))&&v.push({channel:y,fieldDef:w})}}return v},[]);let p;return o.stack!==void 0?jy(o.stack)?p=o.stack?"zero":null:p=o.stack:AVt.has(r)&&(p="zero"),!p||!TVt(p)||K4e(e)&&h.length===0?null:((g=o==null?void 0:o.scale)!=null&&g.type&&((m=o==null?void 0:o.scale)==null?void 0:m.type)!==os.LINEAR&&o!=null&&o.stack&&Ze(n8t(o.scale.type)),en(e[qh(i)])?(o.stack!==void 0&&Ze(t8t(i)),null):(Je(o)&&o.aggregate&&!J6t.has(o.aggregate)&&Ze(r8t(o.aggregate)),{groupbyChannels:l,groupbyFields:c,fieldChannel:i,impute:o.impute===null?!1:Jy(r),stackBy:h,offset:p}))}function bBe(t,e,n){const r=is(t),i=Or("orient",r,n);if(r.orient=IVt(r.type,e,i),i!==void 0&&i!==r.orient&&Ze(zUt(r.orient,i)),r.type==="bar"&&r.orient){const l=Or("cornerRadiusEnd",r,n);if(l!==void 0){const c=r.orient==="horizontal"&&e.x2||r.orient==="vertical"&&e.y2?["cornerRadius"]:oWt[r.orient];for(const u of c)r[u]=l;r.cornerRadiusEnd!==void 0&&delete r.cornerRadiusEnd}}const o=Or("opacity",r,n),s=Or("fillOpacity",r,n);return o===void 0&&s===void 0&&(r.opacity=RVt(r.type,e)),Or("cursor",r,n)===void 0&&(r.cursor=MVt(r,e,n)),r}function MVt(t,e,n){return e.href||t.href||Or("href",t,n)?"pointer":t.cursor}function RVt(t,e){if(En([w6,zse,jse,Bse],t)&&!K4e(e))return .7}function DVt(t,e,{graticule:n}){if(n)return!1;const r=Ah("filled",t,e),i=t.type;return qi(r,i!==w6&&i!==b6&&i!==P5)}function IVt(t,e,n){switch(t){case w6:case jse:case Bse:case C4e:case Y8t:case X8t:return}const{x:r,y:i,x2:o,y2:s}=e;switch(t){case x6:if(Je(r)&&(ns(r.bin)||Je(i)&&i.aggregate&&!r.aggregate))return"vertical";if(Je(i)&&(ns(i.bin)||Je(r)&&r.aggregate&&!i.aggregate))return"horizontal";if(s||o){if(n)return n;if(!o)return(Je(r)&&r.type===Cb&&!Gr(r.bin)||R5(r))&&Je(i)&&ns(i.bin)?"horizontal":"vertical";if(!s)return(Je(i)&&i.type===Cb&&!Gr(i.bin)||R5(i))&&Je(r)&&ns(r.bin)?"vertical":"horizontal"}case P5:if(o&&!(Je(r)&&ns(r.bin))&&s&&!(Je(i)&&ns(i.bin)))return;case y6:if(s)return Je(i)&&ns(i.bin)?"horizontal":"vertical";if(o)return Je(r)&&ns(r.bin)?"vertical":"horizontal";if(t===P5){if(r&&!i)return"vertical";if(i&&!r)return"horizontal"}case b6:case zse:{const a=Eye(r),l=Eye(i);if(n)return n;if(a&&!l)return t!=="tick"?"horizontal":"vertical";if(!a&&l)return t!=="tick"?"vertical":"horizontal";if(a&&l)return"vertical";{const c=Pa(r)&&r.type===eC,u=Pa(i)&&i.type===eC;if(c&&!u)return"vertical";if(!c&&u)return"horizontal"}return}}return"vertical"}function LVt(t){const{point:e,line:n,...r}=t;return Qe(r).length>1?r:r.type}function $Vt(t){for(const e of["line","area","rule","trail"])t[e]&&(t={...t,[e]:hl(t[e],["point","line"])});return t}function WV(t,e={},n){return t.point==="transparent"?{opacity:0}:t.point?ht(t.point)?t.point:{}:t.point!==void 0?null:e.point||n.shape?ht(e.point)?e.point:{}:void 0}function Lye(t,e={}){return t.line?t.line===!0?{}:t.line:t.line!==void 0?null:e.line?e.line===!0?{}:e.line:void 0}class FVt{constructor(){this.name="path-overlay"}hasMatchingType(e,n){if(em(e)){const{mark:r,encoding:i}=e,o=Ph(r)?r:{type:r};switch(o.type){case"line":case"rule":case"trail":return!!WV(o,n[o.type],i);case"area":return!!WV(o,n[o.type],i)||!!Lye(o,n[o.type])}}return!1}run(e,n,r){const{config:i}=n,{params:o,projection:s,mark:a,name:l,encoding:c,...u}=e,f=k6(c,i),d=Ph(a)?a:{type:a},h=WV(d,i[d.type],f),p=d.type==="area"&&Lye(d,i[d.type]),g=[{name:l,...o?{params:o}:{},mark:LVt({...d.type==="area"&&d.opacity===void 0&&d.fillOpacity===void 0?{opacity:.7}:{},...d}),encoding:hl(f,["shape"])}],m=xBe(bBe(d,f,i),f);let v=f;if(m){const{fieldChannel:y,offset:x}=m;v={...f,[y]:{...f[y],...x?{stack:x}:{}}}}return v=hl(v,["y2","x2"]),p&&g.push({...s?{projection:s}:{},mark:{type:"line",...YS(d,["clip","interpolate","tension","tooltip"]),...p},encoding:v}),h&&g.push({...s?{projection:s}:{},mark:{type:"point",opacity:1,filled:!0,...YS(d,["clip","tooltip"]),...h},encoding:v}),r({...u,layer:g},{...n,config:$Vt(i)})}}function NVt(t,e){return e?BR(t)?_Be(t,e):wBe(t,e):t}function VV(t,e){return e?_Be(t,e):t}function UY(t,e,n){const r=e[t];if(bWt(r)){if(r.repeat in n)return{...e,[t]:n[r.repeat]};Ze(xUt(r.repeat));return}return e}function wBe(t,e){if(t=UY("field",t,e),t!==void 0){if(t===null)return null;if(Xse(t)&&ag(t.sort)){const n=UY("field",t.sort,e);t={...t,...n?{sort:n}:{}}}return t}}function $ye(t,e){if(Je(t))return wBe(t,e);{const n=UY("datum",t,e);return n!==t&&!n.type&&(n.type="nominal"),n}}function Fye(t,e){if(en(t)){const n=$ye(t,e);if(n)return n;if(UR(t))return{condition:t.condition}}else{if(WR(t)){const n=$ye(t.condition,e);if(n)return{...t,condition:n};{const{condition:r,...i}=t;return i}}return t}}function _Be(t,e){const n={};for(const r in t)if(Ke(t,r)){const i=t[r];if(We(i))n[r]=i.map(o=>Fye(o,e)).filter(o=>o);else{const o=Fye(i,e);o!==void 0&&(n[r]=o)}}return n}class zVt{constructor(){this.name="RuleForRangedLine"}hasMatchingType(e){if(em(e)){const{encoding:n,mark:r}=e;if(r==="line"||Ph(r)&&r.type==="line")for(const i of N6t){const o=p1(i),s=n[o];if(n[i]&&(Je(s)&&!ns(s.bin)||Yh(s)))return!0}}return!1}run(e,n,r){const{encoding:i,mark:o}=e;return Ze(NUt(!!i.x2,!!i.y2)),r({...e,mark:ht(o)?{...o,type:"rule"}:"rule"},n)}}class jVt extends lae{constructor(){super(...arguments),this.nonFacetUnitNormalizers=[UWt,GWt,ZWt,new FVt,new zVt]}map(e,n){if(em(e)){const r=Bx(e.encoding,og),i=Bx(e.encoding,sg),o=Bx(e.encoding,a6);if(r||i||o)return this.mapFacetedUnit(e,n)}return super.map(e,n)}mapUnit(e,n){const{parentEncoding:r,parentProjection:i}=n,o=VV(e.encoding,n.repeater),s={...e,...e.name?{name:[n.repeaterPrefix,e.name].filter(l=>l).join("_")}:{},...o?{encoding:o}:{}};if(r||i)return this.mapUnitWithParentEncodingOrProjection(s,n);const a=this.mapLayerOrUnit.bind(this);for(const l of this.nonFacetUnitNormalizers)if(l.hasMatchingType(s,n.config))return l.run(s,n,a);return s}mapRepeat(e,n){return OVt(e)?this.mapLayerRepeat(e,n):this.mapNonLayerRepeat(e,n)}mapLayerRepeat(e,n){const{repeat:r,spec:i,...o}=e,{row:s,column:a,layer:l}=r,{repeater:c={},repeaterPrefix:u=""}=n;return s||a?this.mapRepeat({...e,repeat:{...s?{row:s}:{},...a?{column:a}:{}},spec:{repeat:{layer:l},spec:i}},n):{...o,layer:l.map(f=>{const d={...c,layer:f},h=`${(i.name?`${i.name}_`:"")+u}child__layer_${pi(f)}`,p=this.mapLayerOrUnit(i,{...n,repeater:d,repeaterPrefix:h});return p.name=h,p})}}mapNonLayerRepeat(e,n){const{repeat:r,spec:i,data:o,...s}=e;!We(r)&&e.columns&&(e=hl(e,["columns"]),Ze(mye("repeat")));const a=[],{repeater:l={},repeaterPrefix:c=""}=n,u=!We(r)&&r.row||[l?l.row:null],f=!We(r)&&r.column||[l?l.column:null],d=We(r)&&r||[l?l.repeat:null];for(const p of d)for(const g of u)for(const m of f){const v={repeat:p,row:g,column:m,layer:l.layer},y=(i.name?`${i.name}_`:"")+c+"child__"+(We(r)?`${pi(p)}`:(r.row?`row_${pi(g)}`:"")+(r.column?`column_${pi(m)}`:"")),x=this.map(i,{...n,repeater:v,repeaterPrefix:y});x.name=y,a.push(hl(x,["data"]))}const h=We(r)?e.columns:r.column?r.column.length:1;return{data:i.data??o,align:"all",...s,columns:h,concat:a}}mapFacet(e,n){const{facet:r}=e;return BR(r)&&e.columns&&(e=hl(e,["columns"]),Ze(mye("facet"))),super.mapFacet(e,n)}mapUnitWithParentEncodingOrProjection(e,n){const{encoding:r,projection:i}=e,{parentEncoding:o,parentProjection:s,config:a}=n,l=zye({parentProjection:s,projection:i}),c=Nye({parentEncoding:o,encoding:VV(r,n.repeater)});return this.mapUnit({...e,...l?{projection:l}:{},...c?{encoding:c}:{}},{config:a})}mapFacetedUnit(e,n){const{row:r,column:i,facet:o,...s}=e.encoding,{mark:a,width:l,projection:c,height:u,view:f,params:d,encoding:h,...p}=e,{facetMapping:g,layout:m}=this.getFacetMappingAndLayout({row:r,column:i,facet:o},n),v=VV(s,n.repeater);return this.mapFacet({...p,...m,facet:g,spec:{...l?{width:l}:{},...u?{height:u}:{},...f?{view:f}:{},...c?{projection:c}:{},mark:a,encoding:v,...d?{params:d}:{}}},n)}getFacetMappingAndLayout(e,n){const{row:r,column:i,facet:o}=e;if(r||i){o&&Ze($Ut([...r?[og]:[],...i?[sg]:[]]));const s={},a={};for(const l of[og,sg]){const c=e[l];if(c){const{align:u,center:f,spacing:d,columns:h,...p}=c;s[l]=p;for(const g of["align","center","spacing"])c[g]!==void 0&&(a[g]??(a[g]={}),a[g][l]=c[g])}}return{facetMapping:s,layout:a}}else{const{align:s,center:a,spacing:l,columns:c,...u}=o;return{facetMapping:NVt(u,n.repeater),layout:{...s?{align:s}:{},...a?{center:a}:{},...l?{spacing:l}:{},...c?{columns:c}:{}}}}}mapLayer(e,{parentEncoding:n,parentProjection:r,...i}){const{encoding:o,projection:s,...a}=e,l={...i,parentEncoding:Nye({parentEncoding:n,encoding:o,layer:!0}),parentProjection:zye({parentProjection:r,projection:s})};return super.mapLayer({...a,...e.name?{name:[l.repeaterPrefix,e.name].filter(c=>c).join("_")}:{}},l)}}function Nye({parentEncoding:t,encoding:e={},layer:n}){let r={};if(t){const i=new Set([...Qe(t),...Qe(e)]);for(const o of i){const s=e[o],a=t[o];if(en(s)){const l={...a,...s};r[o]=l}else WR(s)?r[o]={...s,condition:{...a,...s.condition}}:s||s===null?r[o]=s:(n||qf(a)||Mt(a)||en(a)||We(a))&&(r[o]=a)}}else r=e;return!r||Er(r)?void 0:r}function zye(t){const{parentProjection:e,projection:n}=t;return e&&n&&Ze(OUt({parentProjection:e,projection:n})),n??e}function cae(t){return Ke(t,"filter")}function BVt(t){return Ke(t,"stop")}function SBe(t){return Ke(t,"lookup")}function UVt(t){return Ke(t,"data")}function WVt(t){return Ke(t,"param")}function VVt(t){return Ke(t,"pivot")}function GVt(t){return Ke(t,"density")}function HVt(t){return Ke(t,"quantile")}function qVt(t){return Ke(t,"regression")}function XVt(t){return Ke(t,"loess")}function YVt(t){return Ke(t,"sample")}function QVt(t){return Ke(t,"window")}function KVt(t){return Ke(t,"joinaggregate")}function ZVt(t){return Ke(t,"flatten")}function JVt(t){return Ke(t,"calculate")}function CBe(t){return Ke(t,"bin")}function e9t(t){return Ke(t,"impute")}function t9t(t){return Ke(t,"timeUnit")}function n9t(t){return Ke(t,"aggregate")}function r9t(t){return Ke(t,"stack")}function i9t(t){return Ke(t,"fold")}function o9t(t){return Ke(t,"extent")&&!Ke(t,"density")&&!Ke(t,"regression")}function s9t(t){return t.map(e=>cae(e)?{filter:F_(e.filter,M8t)}:e)}class a9t extends lae{map(e,n){return n.emptySelections??(n.emptySelections={}),n.selectionPredicates??(n.selectionPredicates={}),e=jye(e,n),super.map(e,n)}mapLayerOrUnit(e,n){if(e=jye(e,n),e.encoding){const r={};for(const[i,o]of dy(e.encoding))r[i]=OBe(o,n);e={...e,encoding:r}}return super.mapLayerOrUnit(e,n)}mapUnit(e,n){const{selection:r,...i}=e;return r?{...i,params:dy(r).map(([o,s])=>{const{init:a,bind:l,empty:c,...u}=s;u.type==="single"?(u.type="point",u.toggle=!1):u.type==="multi"&&(u.type="point"),n.emptySelections[o]=c!=="none";for(const f of bs(n.selectionPredicates[o]??{}))f.empty=c!=="none";return{name:o,value:a,select:u,bind:l}})}:e}}function jye(t,e){const{transform:n,...r}=t;if(n){const i=n.map(o=>{if(cae(o))return{filter:WY(o,e)};if(CBe(o)&&g1(o.bin))return{...o,bin:EBe(o.bin)};if(SBe(o)){const{selection:s,...a}=o.from;return s?{...o,from:{param:s,...a}}:o}return o});return{...r,transform:i}}return t}function OBe(t,e){var r,i;const n=Kt(t);if(Je(n)&&g1(n.bin)&&(n.bin=EBe(n.bin)),x1(n)&&((i=(r=n.scale)==null?void 0:r.domain)!=null&&i.selection)){const{selection:o,...s}=n.scale.domain;n.scale.domain={...s,...o?{param:o}:{}}}if(UR(n))if(We(n.condition))n.condition=n.condition.map(o=>{const{selection:s,param:a,test:l,...c}=o;return a?o:{...c,test:WY(o,e)}});else{const{selection:o,param:s,test:a,...l}=OBe(n.condition,e);n.condition=s?n.condition:{...l,test:WY(n.condition,e)}}return n}function EBe(t){const e=t.extent;if(e!=null&&e.selection){const{selection:n,...r}=e;return{...t,extent:{...r,param:n}}}return t}function WY(t,e){const n=r=>F_(r,i=>{var o;const s=e.emptySelections[i]??!0,a={param:i,empty:s};return(o=e.selectionPredicates)[i]??(o[i]=[]),e.selectionPredicates[i].push(a),a});return t.selection?n(t.selection):F_(t.test||t.filter,r=>r.selection?n(r.selection):r)}class VY extends lae{map(e,n){const r=n.selections??[];if(e.params&&!em(e)){const i=[];for(const o of e.params)oae(o)?r.push(o):i.push(o);e.params=i}return n.selections=r,super.map(e,n)}mapUnit(e,n){const r=n.selections;if(!r||!r.length)return e;const i=(n.path??[]).concat(e.name),o=[];for(const s of r)if(!s.views||!s.views.length)o.push(s);else for(const a of s.views)(gt(a)&&(a===e.name||i.includes(a))||We(a)&&a.map(l=>i.indexOf(l)).every((l,c,u)=>l!==-1&&(c===0||l>u[c-1])))&&o.push(s);return o.length&&(e.params=o),e}}for(const t of["mapFacet","mapRepeat","mapHConcat","mapVConcat","mapLayer"]){const e=VY.prototype[t];VY.prototype[t]=function(n,r){return e.call(this,n,l9t(n,r))}}function l9t(t,e){return t.name?{...e,path:(e.path??[]).concat(t.name)}:e}function TBe(t,e){e===void 0&&(e=yBe(t.config));const n=d9t(t,e),{width:r,height:i}=t,o=h9t(n,{width:r,height:i,autosize:t.autosize},e);return{...n,...o?{autosize:o}:{}}}const c9t=new jVt,u9t=new a9t,f9t=new VY;function d9t(t,e={}){const n={config:e};return f9t.map(c9t.map(u9t.map(t,n),n),n)}function Bye(t){return gt(t)?{type:t}:t??{}}function h9t(t,e,n){let{width:r,height:i}=e;const o=em(t)||P6(t),s={};o?r=="container"&&i=="container"?(s.type="fit",s.contains="padding"):r=="container"?(s.type="fit-x",s.contains="padding"):i=="container"&&(s.type="fit-y",s.contains="padding"):(r=="container"&&(Ze(dye("width")),r=void 0),i=="container"&&(Ze(dye("height")),i=void 0));const a={type:"pad",...s,...n?Bye(n.autosize):{},...Bye(t.autosize)};if(a.type==="fit"&&!o&&(Ze(lUt),a.type="pad"),r=="container"&&!(a.type=="fit"||a.type=="fit-x")&&Ze(hye("width")),i=="container"&&!(a.type=="fit"||a.type=="fit-y")&&Ze(hye("height")),!oc(a,{type:"pad"}))return a}function p9t(t){return["fit","fit-x","fit-y"].includes(t)}function g9t(t){return t?`fit-${d6(t)}`:"fit"}const m9t=["background","padding"];function Uye(t,e){const n={};for(const r of m9t)t&&t[r]!==void 0&&(n[r]=ec(t[r]));return e&&(n.params=t.params),n}class tm{constructor(e={},n={}){this.explicit=e,this.implicit=n}clone(){return new tm(Kt(this.explicit),Kt(this.implicit))}combine(){return{...this.explicit,...this.implicit}}get(e){return qi(this.explicit[e],this.implicit[e])}getWithExplicit(e){return this.explicit[e]!==void 0?{explicit:!0,value:this.explicit[e]}:this.implicit[e]!==void 0?{explicit:!1,value:this.implicit[e]}:{explicit:!1,value:void 0}}setWithExplicit(e,{value:n,explicit:r}){n!==void 0&&this.set(e,n,r)}set(e,n,r){return delete this[r?"implicit":"explicit"][e],this[r?"explicit":"implicit"][e]=n,this}copyKeyFromSplit(e,{explicit:n,implicit:r}){n[e]!==void 0?this.set(e,n[e],!0):r[e]!==void 0&&this.set(e,r[e],!1)}copyKeyFromObject(e,n){n[e]!==void 0&&this.set(e,n[e],!0)}copyAll(e){for(const n of Qe(e.combine())){const r=e.getWithExplicit(n);this.setWithExplicit(n,r)}}}function Ad(t){return{explicit:!0,value:t}}function Wl(t){return{explicit:!1,value:t}}function kBe(t){return(e,n,r,i)=>{const o=t(e.value,n.value);return o>0?e:o<0?n:M6(e,n,r,i)}}function M6(t,e,n,r){return t.explicit&&e.explicit&&Ze(XUt(n,r,t.value,e.value)),t}function gy(t,e,n,r,i=M6){return t===void 0||t.value===void 0?e:t.explicit&&!e.explicit?t:e.explicit&&!t.explicit?e:oc(t.value,e.value)?t:i(t,e,n,r)}class v9t extends tm{constructor(e={},n={},r=!1){super(e,n),this.explicit=e,this.implicit=n,this.parseNothing=r}clone(){const e=super.clone();return e.parseNothing=this.parseNothing,e}}function oC(t){return Ke(t,"url")}function YA(t){return Ke(t,"values")}function ABe(t){return Ke(t,"name")&&!oC(t)&&!YA(t)&&!Uv(t)}function Uv(t){return t&&(PBe(t)||MBe(t)||uae(t))}function PBe(t){return Ke(t,"sequence")}function MBe(t){return Ke(t,"sphere")}function uae(t){return Ke(t,"graticule")}var Fi;(function(t){t[t.Raw=0]="Raw",t[t.Main=1]="Main",t[t.Row=2]="Row",t[t.Column=3]="Column",t[t.Lookup=4]="Lookup",t[t.PreFilterInvalid=5]="PreFilterInvalid",t[t.PostFilterInvalid=6]="PostFilterInvalid"})(Fi||(Fi={}));function RBe({invalid:t,isPath:e}){switch(T4e(t,{isPath:e})){case"filter":return{marks:"exclude-invalid-values",scales:"exclude-invalid-values"};case"break-paths-show-domains":return{marks:e?"include-invalid-values":"exclude-invalid-values",scales:"include-invalid-values"};case"break-paths-filter-domains":return{marks:e?"include-invalid-values":"exclude-invalid-values",scales:"exclude-invalid-values"};case"show":return{marks:"include-invalid-values",scales:"include-invalid-values"}}}function y9t(t){const{marks:e,scales:n}=RBe(t);return e===n?Fi.Main:n==="include-invalid-values"?Fi.PreFilterInvalid:Fi.PostFilterInvalid}function DBe(t){const{signals:e,hasLegend:n,index:r,...i}=t;return i.field=Mu(i.field),i}function Tb(t,e=!0,n=ea){if(We(t)){const r=t.map(i=>Tb(i,e,n));return e?`[${r.join(", ")}]`:r}else if(v1(t))return n(e?Sb(t):x8t(t));return e?n(Tr(t)):t}function x9t(t,e){for(const n of bs(t.component.selection??{})){const r=n.name;let i=`${r}${my}, ${n.resolve==="global"?"true":`{unit: ${Ux(t)}}`}`;for(const o of L6)o.defined(n)&&(o.signals&&(e=o.signals(t,n,e)),o.modifyExpr&&(i=o.modifyExpr(t,n,i)));e.push({name:r+Y9t,on:[{events:{signal:n.name+my},update:`modify(${rt(n.name+kb)}, ${i})`}]})}return fae(e)}function b9t(t,e){if(t.component.selection&&Qe(t.component.selection).length){const n=rt(t.getName("cell"));e.unshift({name:"facet",value:{},on:[{events:Hy("pointermove","scope"),update:`isTuple(facet) ? facet : group(${n}).datum`}]})}return fae(e)}function w9t(t,e){let n=!1;for(const r of bs(t.component.selection??{})){const i=r.name,o=rt(i+kb);if(e.filter(a=>a.name===i).length===0){const a=r.resolve==="global"?"union":r.resolve,l=r.type==="point"?", true, true)":")";e.push({name:r.name,update:`${KBe}(${o}, ${rt(a)}${l}`})}n=!0;for(const a of L6)a.defined(r)&&a.topLevelSignals&&(e=a.topLevelSignals(t,r,e))}return n&&e.filter(i=>i.name==="unit").length===0&&e.unshift({name:"unit",value:{},on:[{events:"pointermove",update:"isTuple(group()) ? group() : unit"}]}),fae(e)}function _9t(t,e){const n=[...e],r=Ux(t,{escape:!1});for(const i of bs(t.component.selection??{})){const o={name:i.name+kb};if(i.project.hasSelectionId&&(o.transform=[{type:"collect",sort:{field:Yf}}]),i.init){const a=i.project.items.map(DBe);o.values=i.project.hasSelectionId?i.init.map(l=>({unit:r,[Yf]:Tb(l,!1)[0]})):i.init.map(l=>({unit:r,fields:a,values:Tb(l,!1)}))}n.filter(a=>a.name===i.name+kb).length||n.push(o)}return n}function IBe(t,e){for(const n of bs(t.component.selection??{}))for(const r of L6)r.defined(n)&&r.marks&&(e=r.marks(t,n,e));return e}function S9t(t,e){for(const n of t.children)_i(n)&&(e=IBe(n,e));return e}function C9t(t,e,n,r){const i=n6e(t,e.param,e);return{signal:Hf(n.get("type"))&&We(r)&&r[0]>r[1]?`isValid(${i}) && reverse(${i})`:i}}function fae(t){return t.map(e=>(e.on&&!e.on.length&&delete e.on,e))}class _r{constructor(e,n){this.debugName=n,this._children=[],this._parent=null,e&&(this.parent=e)}clone(){throw new Error("Cannot clone node")}get parent(){return this._parent}set parent(e){this._parent=e,e&&e.addChild(this)}get children(){return this._children}numChildren(){return this._children.length}addChild(e,n){if(this._children.includes(e)){Ze(_Ut);return}n!==void 0?this._children.splice(n,0,e):this._children.push(e)}removeChild(e){const n=this._children.indexOf(e);return this._children.splice(n,1),n}remove(){let e=this._parent.removeChild(this);for(const n of this._children)n._parent=this._parent,this._parent.addChild(n,e++)}insertAsParentOf(e){const n=e.parent;n.removeChild(this),this.parent=n,e.parent=this}swapWithParent(){const e=this._parent,n=e.parent;for(const i of this._children)i.parent=e;this._children=[],e.removeChild(this);const r=e.parent.removeChild(e);this._parent=n,n.addChild(this,r),e.parent=this}}class pl extends _r{clone(){const e=new this.constructor;return e.debugName=`clone_${this.debugName}`,e._source=this._source,e._name=`clone_${this._name}`,e.type=this.type,e.refCounts=this.refCounts,e.refCounts[e._name]=0,e}constructor(e,n,r,i){super(e,n),this.type=r,this.refCounts=i,this._source=this._name=n,this.refCounts&&!(this._name in this.refCounts)&&(this.refCounts[this._name]=0)}dependentFields(){return new Set}producedFields(){return new Set}hash(){return this._hash===void 0&&(this._hash=`Output ${kje()}`),this._hash}getSource(){return this.refCounts[this._name]++,this._source}isRequired(){return!!this.refCounts[this._name]}setSource(e){this._source=e}}function GV(t){return t.as!==void 0}function Wye(t){return`${t}_end`}class mh extends _r{clone(){return new mh(null,Kt(this.timeUnits))}constructor(e,n){super(e),this.timeUnits=n}static makeFromEncoding(e,n){const r=n.reduceFieldDef((i,o,s)=>{const{field:a,timeUnit:l}=o;if(l){let c;if(y1(l)){if(_i(n)){const{mark:u,markDef:f,config:d}=n,h=py({fieldDef:o,markDef:f,config:d});(XA(u)||h)&&(c={timeUnit:Uo(l),field:a})}}else c={as:lt(o,{forAs:!0}),field:a,timeUnit:l};if(_i(n)){const{mark:u,markDef:f,config:d}=n,h=py({fieldDef:o,markDef:f,config:d});XA(u)&&Xi(s)&&h!==.5&&(c.rectBandPosition=h)}c&&(i[Mn(c)]=c)}return i},{});return Er(r)?null:new mh(e,r)}static makeFromTransform(e,n){const{timeUnit:r,...i}={...n},o=Uo(r),s={...i,timeUnit:o};return new mh(e,{[Mn(s)]:s})}merge(e){this.timeUnits={...this.timeUnits};for(const n in e.timeUnits)this.timeUnits[n]||(this.timeUnits[n]=e.timeUnits[n]);for(const n of e.children)e.removeChild(n),n.parent=this;e.remove()}removeFormulas(e){const n={};for(const[r,i]of dy(this.timeUnits)){const o=GV(i)?i.as:`${i.field}_end`;e.has(o)||(n[r]=i)}this.timeUnits=n}producedFields(){return new Set(bs(this.timeUnits).map(e=>GV(e)?e.as:Wye(e.field)))}dependentFields(){return new Set(bs(this.timeUnits).map(e=>e.field))}hash(){return`TimeUnit ${Mn(this.timeUnits)}`}assemble(){const e=[];for(const n of bs(this.timeUnits)){const{rectBandPosition:r}=n,i=Uo(n.timeUnit);if(GV(n)){const{field:o,as:s}=n,{unit:a,utc:l,...c}=i,u=[s,`${s}_end`];e.push({field:Mu(o),type:"timeunit",...a?{units:m6(a)}:{},...l?{timezone:"utc"}:{},...c,as:u}),e.push(...Vye(u,r,i))}else if(n){const{field:o}=n,s=o.replaceAll("\\.","."),a=LBe({timeUnit:i,field:s}),l=Wye(s);e.push({type:"formula",expr:a,as:l}),e.push(...Vye([s,l],r,i))}}return e}}const R6="offsetted_rect_start",D6="offsetted_rect_end";function LBe({timeUnit:t,field:e,reverse:n}){const{unit:r,utc:i}=t,o=c4e(r),{part:s,step:a}=h4e(o,t.step);return`${i?"utcOffset":"timeOffset"}('${s}', datum['${e}'], ${n?-a:a})`}function Vye([t,e],n,r){if(n!==void 0&&n!==.5){const i=`datum['${t}']`,o=`datum['${e}']`;return[{type:"formula",expr:Gye([LBe({timeUnit:r,field:t,reverse:!0}),i],n+.5),as:`${t}_${R6}`},{type:"formula",expr:Gye([i,o],n+.5),as:`${t}_${D6}`}]}return[]}function Gye([t,e],n){return`${1-n} * ${t} + ${n} * ${e}`}const HR="_tuple_fields";class O9t{constructor(...e){this.items=e,this.hasChannel={},this.hasField={},this.hasSelectionId=!1}}const E9t={defined:()=>!0,parse:(t,e,n)=>{const r=e.name,i=e.project??(e.project=new O9t),o={},s={},a=new Set,l=(p,g)=>{const m=g==="visual"?p.channel:p.field;let v=pi(`${r}_${m}`);for(let y=1;a.has(v);y++)v=pi(`${r}_${m}_${y}`);return a.add(v),{[g]:v}},c=e.type,u=t.config.selection[c],f=n.value!==void 0?pt(n.value):null;let{fields:d,encodings:h}=ht(n.select)?n.select:{};if(!d&&!h&&f){for(const p of f)if(ht(p))for(const g of Qe(p))F6t(g)?(h||(h=[])).push(g):c==="interval"?(Ze(yUt),h=u.encodings):(d??(d=[])).push(g)}!d&&!h&&(h=u.encodings,"fields"in u&&(d=u.fields));for(const p of h??[]){const g=t.fieldDef(p);if(g){let m=g.field;if(g.aggregate){Ze(cUt(p,g.aggregate));continue}else if(!m){Ze(gye(p));continue}if(g.timeUnit&&!y1(g.timeUnit)){m=t.vgField(p);const v={timeUnit:g.timeUnit,as:m,field:g.field};s[Mn(v)]=v}if(!o[m]){const v=c==="interval"&&Xh(p)&&Hf(t.getScaleComponent(p).get("type"))?"R":g.bin?"R-RE":"E",y={field:m,channel:p,type:v,index:i.items.length};y.signals={...l(y,"data"),...l(y,"visual")},i.items.push(o[m]=y),i.hasField[m]=o[m],i.hasSelectionId=i.hasSelectionId||m===Yf,Ije(p)?(y.geoChannel=p,y.channel=Dje(p),i.hasChannel[y.channel]=o[m]):i.hasChannel[p]=o[m]}}else Ze(gye(p))}for(const p of d??[]){if(i.hasField[p])continue;const g={type:"E",field:p,index:i.items.length};g.signals={...l(g,"data")},i.items.push(g),i.hasField[p]=g,i.hasSelectionId=i.hasSelectionId||p===Yf}f&&(e.init=f.map(p=>i.items.map(g=>ht(p)?p[g.geoChannel||g.channel]!==void 0?p[g.geoChannel||g.channel]:p[g.field]:p))),Er(s)||(i.timeUnit=new mh(null,s))},signals:(t,e,n)=>{const r=e.name+HR;return n.filter(o=>o.name===r).length>0||e.project.hasSelectionId?n:n.concat({name:r,value:e.project.items.map(DBe)})}},lg={defined:t=>t.type==="interval"&&t.resolve==="global"&&t.bind&&t.bind==="scales",parse:(t,e)=>{const n=e.scales=[];for(const r of e.project.items){const i=r.channel;if(!Xh(i))continue;const o=t.getScaleComponent(i),s=o?o.get("type"):void 0;if(s=="sequential"&&Ze(hUt),!o||!Hf(s)){Ze(dUt);continue}o.set("selectionExtent",{param:e.name,field:r.field},!0),n.push(r)}},topLevelSignals:(t,e,n)=>{const r=e.scales.filter(s=>n.filter(a=>a.name===s.signals.data).length===0);if(!t.parent||Hye(t)||r.length===0)return n;const i=n.find(s=>s.name===e.name);let o=i.update;if(o.includes(KBe))i.update=`{${r.map(s=>`${rt(Mu(s.field))}: ${s.signals.data}`).join(", ")}}`;else{for(const s of r){const a=`${rt(Mu(s.field))}: ${s.signals.data}`;o.includes(a)||(o=`${o.substring(0,o.length-1)}, ${a}}`)}i.update=o}return n.concat(r.map(s=>({name:s.signals.data})))},signals:(t,e,n)=>{if(t.parent&&!Hye(t))for(const r of e.scales){const i=n.find(o=>o.name===r.signals.data);i.push="outer",delete i.value,delete i.update}return n}};function GY(t,e){return`domain(${rt(t.scaleName(e))})`}function Hye(t){return t.parent&&NO(t.parent)&&!t.parent.parent}const j_="_brush",$Be="_scale_trigger",a2="geo_interval_init_tick",FBe="_init",T9t="_center",k9t={defined:t=>t.type==="interval",parse:(t,e,n)=>{var r;if(t.hasProjection){const i={...ht(n.select)?n.select:{}};i.fields=[Yf],i.encodings||(i.encodings=n.value?Qe(n.value):[ad,sd]),n.select={type:"interval",...i}}if(e.translate&&!lg.defined(e)){const i=`!event.item || event.item.mark.name !== ${rt(e.name+j_)}`;for(const o of e.events){if(!o.between){Ze(`${o} is not an ordered event stream for interval selections.`);continue}const s=pt((r=o.between[0]).filter??(r.filter=[]));s.includes(i)||s.push(i)}}},signals:(t,e,n)=>{const r=e.name,i=r+my,o=bs(e.project.hasChannel).filter(a=>a.channel===yi||a.channel===Yo),s=e.init?e.init[0]:null;if(n.push(...o.reduce((a,l)=>a.concat(A9t(t,e,l,s&&s[l.index])),[])),t.hasProjection){const a=rt(t.projectionName()),l=t.projectionName()+T9t,{x:c,y:u}=e.project.hasChannel,f=c&&c.signals.visual,d=u&&u.signals.visual,h=c?s&&s[c.index]:`${l}[0]`,p=u?s&&s[u.index]:`${l}[1]`,g=w=>t.getSizeSignalRef(w).signal,m=`[[${f?f+"[0]":"0"}, ${d?d+"[0]":"0"}],[${f?f+"[1]":g("width")}, ${d?d+"[1]":g("height")}]]`;s&&(n.unshift({name:r+FBe,init:`[scale(${a}, [${c?h[0]:h}, ${u?p[0]:p}]), scale(${a}, [${c?h[1]:h}, ${u?p[1]:p}])]`}),(!c||!u)&&(n.find(_=>_.name===l)||n.unshift({name:l,update:`invert(${a}, [${g("width")}/2, ${g("height")}/2])`})));const v=`intersect(${m}, {markname: ${rt(t.getName("marks"))}}, unit.mark)`,y=`{unit: ${Ux(t)}}`,x=`vlSelectionTuples(${v}, ${y})`,b=o.map(w=>w.signals.visual);return n.concat({name:i,on:[{events:[...b.length?[{signal:b.join(" || ")}]:[],...s?[{signal:a2}]:[]],update:x}]})}else{if(!lg.defined(e)){const c=r+$Be,u=o.map(f=>{const d=f.channel,{data:h,visual:p}=f.signals,g=rt(t.scaleName(d)),m=t.getScaleComponent(d).get("type"),v=Hf(m)?"+":"";return`(!isArray(${h}) || (${v}invert(${g}, ${p})[0] === ${v}${h}[0] && ${v}invert(${g}, ${p})[1] === ${v}${h}[1]))`});u.length&&n.push({name:c,value:{},on:[{events:o.map(f=>({scale:t.scaleName(f.channel)})),update:u.join(" && ")+` ? ${c} : {}`}]})}const a=o.map(c=>c.signals.data),l=`unit: ${Ux(t)}, fields: ${r+HR}, values`;return n.concat({name:i,...s?{init:`{${l}: ${Tb(s)}}`}:{},...a.length?{on:[{events:[{signal:a.join(" || ")}],update:`${a.join(" && ")} ? {${l}: [${a}]} : null`}]}:{}})}},topLevelSignals:(t,e,n)=>(_i(t)&&t.hasProjection&&e.init&&(n.filter(i=>i.name===a2).length||n.unshift({name:a2,value:null,on:[{events:"timer{1}",update:`${a2} === null ? {} : ${a2}`}]})),n),marks:(t,e,n)=>{const r=e.name,{x:i,y:o}=e.project.hasChannel,s=i==null?void 0:i.signals.visual,a=o==null?void 0:o.signals.visual,l=`data(${rt(e.name+kb)})`;if(lg.defined(e)||!i&&!o)return n;const c={x:i!==void 0?{signal:`${s}[0]`}:{value:0},y:o!==void 0?{signal:`${a}[0]`}:{value:0},x2:i!==void 0?{signal:`${s}[1]`}:{field:{group:"width"}},y2:o!==void 0?{signal:`${a}[1]`}:{field:{group:"height"}}};if(e.resolve==="global")for(const m of Qe(c))c[m]=[{test:`${l}.length && ${l}[0].unit === ${Ux(t)}`,...c[m]},{value:0}];const{fill:u,fillOpacity:f,cursor:d,...h}=e.mark,p=Qe(h).reduce((m,v)=>(m[v]=[{test:[i!==void 0&&`${s}[0] !== ${s}[1]`,o!==void 0&&`${a}[0] !== ${a}[1]`].filter(y=>y).join(" && "),value:h[v]},{value:null}],m),{}),g=d??(e.translate?"move":null);return[{name:`${r+j_}_bg`,type:"rect",clip:!0,encode:{enter:{fill:{value:u},fillOpacity:{value:f}},update:c}},...n,{name:r+j_,type:"rect",clip:!0,encode:{enter:{...g?{cursor:{value:g}}:{},fill:{value:"transparent"}},update:{...c,...p}}}]}};function A9t(t,e,n,r){const i=!t.hasProjection,o=n.channel,s=n.signals.visual,a=rt(i?t.scaleName(o):t.projectionName()),l=d=>`scale(${a}, ${d})`,c=t.getSizeSignalRef(o===yi?"width":"height").signal,u=`${o}(unit)`,f=e.events.reduce((d,h)=>[...d,{events:h.between[0],update:`[${u}, ${u}]`},{events:h,update:`[${s}[0], clamp(${u}, 0, ${c})]`}],[]);if(i){const d=n.signals.data,h=lg.defined(e),p=t.getScaleComponent(o),g=p?p.get("type"):void 0,m=r?{init:Tb(r,!0,l)}:{value:[]};return f.push({events:{signal:e.name+$Be},update:Hf(g)?`[${l(`${d}[0]`)}, ${l(`${d}[1]`)}]`:"[0, 0]"}),h?[{name:d,on:[]}]:[{name:s,...m,on:f},{name:d,...r?{init:Tb(r)}:{},on:[{events:{signal:s},update:`${s}[0] === ${s}[1] ? null : invert(${a}, ${s})`}]}]}else{const d=o===yi?0:1,h=e.name+FBe,p=r?{init:`[${h}[0][${d}], ${h}[1][${d}]]`}:{value:[]};return[{name:s,...p,on:f}]}}const P9t={defined:t=>t.type==="point",signals:(t,e,n)=>{const r=e.name,i=r+HR,o=e.project,s="(item().isVoronoi ? datum.datum : datum)",a=bs(t.component.selection??{}).reduce((f,d)=>d.type==="interval"?f.concat(d.name+j_):f,[]).map(f=>`indexof(item().mark.name, '${f}') < 0`).join(" && "),l=`datum && item().mark.marktype !== 'group' && indexof(item().mark.role, 'legend') < 0${a?` && ${a}`:""}`;let c=`unit: ${Ux(t)}, `;if(e.project.hasSelectionId)c+=`${Yf}: ${s}[${rt(Yf)}]`;else{const f=o.items.map(d=>{const h=t.fieldDef(d.channel);return h!=null&&h.bin?`[${s}[${rt(t.vgField(d.channel,{}))}], ${s}[${rt(t.vgField(d.channel,{binSuffix:"end"}))}]]`:`${s}[${rt(d.field)}]`}).join(", ");c+=`fields: ${i}, values: [${f}]`}const u=e.events;return n.concat([{name:r+my,on:u?[{events:u,update:`${l} ? {${c}} : null`,force:!0}]:[]}])}};function IO({model:t,channelDef:e,vgChannel:n,invalidValueRef:r,mainRefFn:i}){const o=UR(e)&&e.condition;let s=[];o&&(s=pt(o).map(c=>{const u=i(c);if(xWt(c)){const{param:f,empty:d}=c;return{test:t6e(t,{param:f,empty:d}),...u}}else return{test:j5(t,c.test),...u}})),r!==void 0&&s.push(r);const a=i(e);return a!==void 0&&s.push(a),s.length>1||s.length===1&&s[0].test?{[n]:s}:s.length===1?{[n]:s[0]}:{}}function dae(t,e="text"){const n=t.encoding[e];return IO({model:t,channelDef:n,vgChannel:e,mainRefFn:r=>I6(r,t.config),invalidValueRef:void 0})}function I6(t,e,n="datum"){if(t){if(qf(t))return Jr(t.value);if(en(t)){const{format:r,formatType:i}=I5(t);return Hse({fieldOrDatumDef:t,format:r,formatType:i,expr:n,config:e})}}}function NBe(t,e={}){const{encoding:n,markDef:r,config:i,stack:o}=t,s=n.tooltip;if(We(s))return{tooltip:qye({tooltip:s},o,i,e)};{const a=e.reactiveGeom?"datum.datum":"datum";return IO({model:t,channelDef:s,vgChannel:"tooltip",mainRefFn:c=>{const u=I6(c,i,a);if(u)return u;if(c===null)return;let f=Or("tooltip",r,i);if(f===!0&&(f={content:"encoding"}),gt(f))return{value:f};if(ht(f))return Mt(f)?f:f.content==="encoding"?qye(n,o,i,e):{signal:a}},invalidValueRef:void 0})}}function zBe(t,e,n,{reactiveGeom:r}={}){const i={...n,...n.tooltipFormat},o=new Set,s=r?"datum.datum":"datum",a=[];function l(u,f){const d=p1(f),h=Pa(u)?u:{...u,type:t[d].type},p=h.title||Qse(h,i),g=pt(p).join(", ").replaceAll(/"/g,'\\"');let m;if(Xi(f)){const v=f==="x"?"x2":"y2",y=Xf(t[v]);if(ns(h.bin)&&y){const x=lt(h,{expr:s}),b=lt(y,{expr:s}),{format:w,formatType:_}=I5(h);m=jR(x,b,w,_,i),o.add(v)}}if((Xi(f)||f===ju||f===od)&&e&&e.fieldChannel===f&&e.offset==="normalize"){const{format:v,formatType:y}=I5(h);m=Hse({fieldOrDatumDef:h,format:v,formatType:y,expr:s,config:i,normalizeStack:!0}).signal}m??(m=I6(h,i,s).signal),a.push({channel:f,key:g,value:m})}Zse(t,(u,f)=>{Je(u)?l(u,f):C6(u)&&l(u.condition,f)});const c={};for(const{channel:u,key:f,value:d}of a)!o.has(u)&&!c[f]&&(c[f]=d);return c}function qye(t,e,n,{reactiveGeom:r}={}){const i=zBe(t,e,n,{reactiveGeom:r}),o=dy(i).map(([s,a])=>`"${s}": ${a}`);return o.length>0?{signal:`{${o.join(", ")}}`}:void 0}function M9t(t){const{markDef:e,config:n}=t,r=Or("aria",e,n);return r===!1?{}:{...r?{aria:r}:{},...R9t(t),...D9t(t)}}function R9t(t){const{mark:e,markDef:n,config:r}=t;if(r.aria===!1)return{};const i=Or("ariaRoleDescription",n,r);return i!=null?{ariaRoleDescription:{value:i}}:vt(oUt,e)?{}:{ariaRoleDescription:{value:e}}}function D9t(t){const{encoding:e,markDef:n,config:r,stack:i}=t,o=e.description;if(o)return IO({model:t,channelDef:o,vgChannel:"description",mainRefFn:l=>I6(l,t.config),invalidValueRef:void 0});const s=Or("description",n,r);if(s!=null)return{description:Jr(s)};if(r.aria===!1)return{};const a=zBe(e,i,r);if(!Er(a))return{description:{signal:dy(a).map(([l,c],u)=>`"${u>0?"; ":""}${l}: " + (${c})`).join(" + ")}}}function cs(t,e,n={}){const{markDef:r,encoding:i,config:o}=e,{vgChannel:s}=n;let{defaultRef:a,defaultValue:l}=n;const c=i[t];a===void 0&&(l??(l=Or(t,r,o,{vgChannel:s,ignoreVgConfig:!UR(c)})),l!==void 0&&(a=Jr(l)));const u={markDef:r,config:o,scaleName:e.scaleName(t),scale:e.getScaleComponent(t)},f=A4e({...u,scaleChannel:t,channelDef:c});return IO({model:e,channelDef:c,vgChannel:s??t,invalidValueRef:f,mainRefFn:h=>Gse({...u,channel:t,channelDef:h,stack:null,defaultRef:a})})}function jBe(t,e={filled:void 0}){const{markDef:n,encoding:r,config:i}=t,{type:o}=n,s=e.filled??Or("filled",n,i),a=En(["bar","point","circle","square","geoshape"],o)?"transparent":void 0,l=Or(s===!0?"color":void 0,n,i,{vgChannel:"fill"})??i.mark[s===!0&&"color"]??a,c=Or(s===!1?"color":void 0,n,i,{vgChannel:"stroke"})??i.mark[s===!1&&"color"],u=s?"fill":"stroke",f={...l?{fill:Jr(l)}:{},...c?{stroke:Jr(c)}:{}};return n.color&&(s?n.fill:n.stroke)&&Ze(e4e("property",{fill:"fill"in n,stroke:"stroke"in n})),{...f,...cs("color",t,{vgChannel:u,defaultValue:s?l:c}),...cs("fill",t,{defaultValue:r.fill?l:void 0}),...cs("stroke",t,{defaultValue:r.stroke?c:void 0})}}function I9t(t){const{encoding:e,mark:n}=t,r=e.order;return!Jy(n)&&qf(r)?IO({model:t,channelDef:r,vgChannel:"zindex",mainRefFn:i=>Jr(i.value),invalidValueRef:void 0}):{}}function sC({channel:t,markDef:e,encoding:n={},model:r,bandPosition:i}){const o=`${t}Offset`,s=e[o],a=n[o];if((o==="xOffset"||o==="yOffset")&&a)return{offsetType:"encoding",offset:Gse({channel:o,channelDef:a,markDef:e,config:r==null?void 0:r.config,scaleName:r.scaleName(o),scale:r.getScaleComponent(o),stack:null,defaultRef:Jr(s),bandPosition:i})};const l=e[o];return l?{offsetType:"visual",offset:l}:{}}function _a(t,e,{defaultPos:n,vgChannel:r}){const{encoding:i,markDef:o,config:s,stack:a}=e,l=i[t],c=i[qh(t)],u=e.scaleName(t),f=e.getScaleComponent(t),{offset:d,offsetType:h}=sC({channel:t,markDef:o,encoding:i,model:e,bandPosition:.5}),p=hae({model:e,defaultPos:n,channel:t,scaleName:u,scale:f}),g=!l&&Xi(t)&&(i.latitude||i.longitude)?{field:e.getName(t)}:L9t({channel:t,channelDef:l,channel2Def:c,markDef:o,config:s,scaleName:u,scale:f,stack:a,offset:d,defaultRef:p,bandPosition:h==="encoding"?0:void 0});return g?{[r||t]:g}:void 0}function L9t(t){const{channel:e,channelDef:n,scaleName:r,stack:i,offset:o,markDef:s}=t;if(en(n)&&i&&e===i.fieldChannel){if(Je(n)){let a=n.bandPosition;if(a===void 0&&s.type==="text"&&(e==="radius"||e==="theta")&&(a=.5),a!==void 0)return M5({scaleName:r,fieldOrDatumDef:n,startSuffix:"start",bandPosition:a,offset:o})}return jx(n,r,{suffix:"end"},{offset:o})}return Vse(t)}function hae({model:t,defaultPos:e,channel:n,scaleName:r,scale:i}){const{markDef:o,config:s}=t;return()=>{const a=p1(n),l=hy(n),c=Or(n,o,s,{vgChannel:l});if(c!==void 0)return mk(n,c);switch(e){case"zeroOrMin":return Xye({scaleName:r,scale:i,mode:"zeroOrMin",mainChannel:a,config:s});case"zeroOrMax":return Xye({scaleName:r,scale:i,mode:{zeroOrMax:{widthSignal:t.width.signal,heightSignal:t.height.signal}},mainChannel:a,config:s});case"mid":return{...t[Ol(n)],mult:.5}}}}function Xye({mainChannel:t,config:e,...n}){const r=k4e(n),{mode:i}=n;if(r)return r;switch(t){case"radius":{if(i==="zeroOrMin")return{value:0};const{widthSignal:o,heightSignal:s}=i.zeroOrMax;return{signal:`min(${o},${s})/2`}}case"theta":return i==="zeroOrMin"?{value:0}:{signal:"2*PI"};case"x":return i==="zeroOrMin"?{value:0}:{field:{group:"width"}};case"y":return i==="zeroOrMin"?{field:{group:"height"}}:{value:0}}}const $9t={left:"x",center:"xc",right:"x2"},F9t={top:"y",middle:"yc",bottom:"y2"};function BBe(t,e,n,r="middle"){if(t==="radius"||t==="theta")return hy(t);const i=t==="x"?"align":"baseline",o=Or(i,e,n);let s;return Mt(o)?(Ze(FUt(i)),s=void 0):s=o,t==="x"?$9t[s||(r==="top"?"left":"center")]:F9t[s||r]}function N5(t,e,{defaultPos:n,defaultPos2:r,range:i}){return i?UBe(t,e,{defaultPos:n,defaultPos2:r}):_a(t,e,{defaultPos:n})}function UBe(t,e,{defaultPos:n,defaultPos2:r}){const{markDef:i,config:o}=e,s=qh(t),a=Ol(t),l=N9t(e,r,s),c=l[a]?BBe(t,i,o):hy(t);return{..._a(t,e,{defaultPos:n,vgChannel:c}),...l}}function N9t(t,e,n){const{encoding:r,mark:i,markDef:o,stack:s,config:a}=t,l=p1(n),c=Ol(n),u=hy(n),f=r[l],d=t.scaleName(l),h=t.getScaleComponent(l),{offset:p}=n in r||n in o?sC({channel:n,markDef:o,encoding:r,model:t}):sC({channel:l,markDef:o,encoding:r,model:t});if(!f&&(n==="x2"||n==="y2")&&(r.latitude||r.longitude)){const m=Ol(n),v=t.markDef[m];return v!=null?{[m]:{value:v}}:{[u]:{field:t.getName(n)}}}const g=z9t({channel:n,channelDef:f,channel2Def:r[n],markDef:o,config:a,scaleName:d,scale:h,stack:s,offset:p,defaultRef:void 0});return g!==void 0?{[u]:g}:eL(n,o)||eL(n,{[n]:IY(n,o,a.style),[c]:IY(c,o,a.style)})||eL(n,a[i])||eL(n,a.mark)||{[u]:hae({model:t,defaultPos:e,channel:n,scaleName:d,scale:h})()}}function z9t({channel:t,channelDef:e,channel2Def:n,markDef:r,config:i,scaleName:o,scale:s,stack:a,offset:l,defaultRef:c}){return en(e)&&a&&t.charAt(0)===a.fieldChannel.charAt(0)?jx(e,o,{suffix:"start"},{offset:l}):Vse({channel:t,channelDef:n,scaleName:o,scale:s,stack:a,markDef:r,config:i,offset:l,defaultRef:c})}function eL(t,e){const n=Ol(t),r=hy(t);if(e[r]!==void 0)return{[r]:mk(t,e[r])};if(e[t]!==void 0)return{[r]:mk(t,e[t])};if(e[n]){const i=e[n];if(Ob(i))Ze(MUt(n));else return{[n]:mk(t,i)}}}function $g(t,e){const{config:n,encoding:r,markDef:i}=t,o=i.type,s=qh(e),a=Ol(e),l=r[e],c=r[s],u=t.getScaleComponent(e),f=u?u.get("type"):void 0,d=i.orient,h=r[a]??r.size??Or("size",i,n,{vgChannel:a}),p=Nje(e),g=o==="bar"&&(e==="x"?d==="vertical":d==="horizontal")||o==="tick"&&(e==="y"?d==="vertical":d==="horizontal");return Je(l)&&(Gr(l.bin)||ns(l.bin)||l.timeUnit&&!c)&&!(h&&!Ob(h))&&!r[p]&&!Wo(f)?U9t({fieldDef:l,fieldDef2:c,channel:e,model:t}):(en(l)&&Wo(f)||g)&&!c?B9t(l,e,t):UBe(e,t,{defaultPos:"zeroOrMax",defaultPos2:"zeroOrMin"})}function j9t(t,e,n,r,i,o,s){if(Ob(i))if(n){const l=n.get("type");if(l==="band"){let c=`bandwidth('${e}')`;i.band!==1&&(c=`${i.band} * ${c}`);const u=Ah("minBandSize",{type:s},r);return{signal:u?`max(${Tf(u)}, ${c})`:c}}else i.band!==1&&(Ze(BUt(l)),i=void 0)}else return{mult:i.band,field:{group:t}};else{if(Mt(i))return i;if(i)return{value:i}}if(n){const l=n.get("range");if(m1(l)&&Jn(l.step))return{value:l.step-2}}if(!o){const{bandPaddingInner:l,barBandPaddingInner:c,rectBandPaddingInner:u,tickBandPaddingInner:f}=r.scale,d=qi(l,s==="tick"?f:s==="bar"?c:u);if(Mt(d))return{signal:`(1 - (${d.signal})) * ${t}`};if(Jn(d))return{signal:`${1-d} * ${t}`}}return{value:BY(r.view,t)-2}}function B9t(t,e,n){var k,E;const{markDef:r,encoding:i,config:o,stack:s}=n,a=r.orient,l=n.scaleName(e),c=n.getScaleComponent(e),u=Ol(e),f=qh(e),d=Nje(e),h=n.scaleName(d),p=n.getScaleComponent(xse(e)),g=r.type==="tick"||a==="horizontal"&&e==="y"||a==="vertical"&&e==="x";let m;(i.size||r.size)&&(g?m=cs("size",n,{vgChannel:u,defaultRef:Jr(r.size)}):Ze(GUt(r.type)));const v=!!m,y=$4e({channel:e,fieldDef:t,markDef:r,config:o,scaleType:(k=c||p)==null?void 0:k.get("type"),useVlSizeChannel:g});m=m||{[u]:j9t(u,h||l,p||c,o,y,!!t,r.type)};const x=((E=c||p)==null?void 0:E.get("type"))==="band"&&Ob(y)&&!v?"top":"middle",b=BBe(e,r,o,x),w=b==="xc"||b==="yc",{offset:_,offsetType:S}=sC({channel:e,markDef:r,encoding:i,model:n,bandPosition:w?.5:0}),O=Vse({channel:e,channelDef:t,markDef:r,config:o,scaleName:l,scale:c,stack:s,offset:_,defaultRef:hae({model:n,defaultPos:"mid",channel:e,scaleName:l,scale:c}),bandPosition:w?S==="encoding"?0:.5:Mt(y)?{signal:`(1-${y})/2`}:Ob(y)?(1-y.band)/2:0});if(u)return{[b]:O,...m};{const P=hy(f),A=m[u],R=_?{...A,offset:_}:A;return{[b]:O,[P]:We(O)?[O[0],{...O[1],offset:R}]:{...O,offset:R}}}}function Yye(t,e,n,r,i,o,s){if(Rje(t))return 0;const a=t==="x"||t==="y2",l=a?-e/2:e/2;if(Mt(n)||Mt(i)||Mt(r)||o){const c=Tf(n),u=Tf(i),f=Tf(r),d=Tf(o),p=o?`(${s} < ${d} ? ${a?"":"-"}0.5 * (${d} - (${s})) : ${l})`:l,g=f?`${f} + `:"",m=c?`(${c} ? -1 : 1) * `:"",v=u?`(${u} + ${p})`:p;return{signal:g+m+v}}else return i=i||0,r+(n?-i-l:+i+l)}function U9t({fieldDef:t,fieldDef2:e,channel:n,model:r}){var E;const{config:i,markDef:o,encoding:s}=r,a=r.getScaleComponent(n),l=r.scaleName(n),c=a?a.get("type"):void 0,u=a.get("reverse"),f=$4e({channel:n,fieldDef:t,markDef:o,config:i,scaleType:c}),d=(E=r.component.axes[n])==null?void 0:E[0],h=(d==null?void 0:d.get("translate"))??.5,p=Xi(n)?Or("binSpacing",o,i)??0:0,g=qh(n),m=hy(n),v=hy(g),y=Ah("minBandSize",o,i),{offset:x}=sC({channel:n,markDef:o,encoding:s,model:r,bandPosition:0}),{offset:b}=sC({channel:g,markDef:o,encoding:s,model:r,bandPosition:0}),w=hWt({fieldDef:t,scaleName:l}),_=Yye(n,p,u,h,x,y,w),S=Yye(g,p,u,h,b??x,y,w),O=Mt(f)?{signal:`(1-${f.signal})/2`}:Ob(f)?(1-f.band)/2:.5,k=py({fieldDef:t,fieldDef2:e,markDef:o,config:i});if(Gr(t.bin)||t.timeUnit){const P=t.timeUnit&&k!==.5;return{[v]:Qye({fieldDef:t,scaleName:l,bandPosition:O,offset:S,useRectOffsetField:P}),[m]:Qye({fieldDef:t,scaleName:l,bandPosition:Mt(O)?{signal:`1-${O.signal}`}:1-O,offset:_,useRectOffsetField:P})}}else if(ns(t.bin)){const P=jx(t,l,{},{offset:S});if(Je(e))return{[v]:P,[m]:jx(e,l,{},{offset:_})};if(g1(t.bin)&&t.bin.step)return{[v]:P,[m]:{signal:`scale("${l}", ${lt(t,{expr:"datum"})} + ${t.bin.step})`,offset:_}}}Ze(r4e(g))}function Qye({fieldDef:t,scaleName:e,bandPosition:n,offset:r,useRectOffsetField:i}){return M5({scaleName:e,fieldOrDatumDef:t,bandPosition:n,offset:r,...i?{startSuffix:R6,endSuffix:D6}:{}})}const W9t=new Set(["aria","width","height"]);function Bu(t,e){const{fill:n=void 0,stroke:r=void 0}=e.color==="include"?jBe(t):{};return{...V9t(t.markDef,e),...Kye("fill",n),...Kye("stroke",r),...cs("opacity",t),...cs("fillOpacity",t),...cs("strokeOpacity",t),...cs("strokeWidth",t),...cs("strokeDash",t),...I9t(t),...NBe(t),...dae(t,"href"),...M9t(t)}}function Kye(t,e){return e?{[t]:e}:{}}function V9t(t,e){return iUt.reduce((n,r)=>(!W9t.has(r)&&Ke(t,r)&&e[r]!=="ignore"&&(n[r]=Jr(t[r])),n),{})}function pae(t){const{config:e,markDef:n}=t,r=new Set;if(t.forEachFieldDef((i,o)=>{var c;let s;if(!Xh(o)||!(s=t.getScaleType(o)))return;const a=h6(i.aggregate),l=Wse({scaleChannel:o,markDef:n,config:e,scaleType:s,isCountAggregate:a});if(uWt(l)){const u=t.vgField(o,{expr:"datum",binSuffix:(c=t.stack)!=null&&c.impute?"mid":void 0});u&&r.add(u)}}),r.size>0)return{defined:{signal:[...r].map(o=>v6(o,!0)).join(" && ")}}}function Zye(t,e){if(e!==void 0)return{[t]:Jr(e)}}const HV="voronoi",WBe={defined:t=>t.type==="point"&&t.nearest,parse:(t,e)=>{if(e.events)for(const n of e.events)n.markname=t.getName(HV)},marks:(t,e,n)=>{const{x:r,y:i}=e.project.hasChannel,o=t.mark;if(Jy(o))return Ze(uUt(o)),n;const s={name:t.getName(HV),type:"path",interactive:!0,from:{data:t.getName("marks")},encode:{update:{fill:{value:"transparent"},strokeWidth:{value:.35},stroke:{value:"transparent"},isVoronoi:{value:!0},...NBe(t,{reactiveGeom:!0})}},transform:[{type:"voronoi",x:{expr:r||!i?"datum.datum.x || 0":"0"},y:{expr:i||!r?"datum.datum.y || 0":"0"},size:[t.getSizeSignalRef("width"),t.getSizeSignalRef("height")]}]};let a=0,l=!1;return n.forEach((c,u)=>{const f=c.name??"";f===t.component.mark[0].name?a=u:f.includes(HV)&&(l=!0)}),l||n.splice(a+1,0,s),n}},VBe={defined:t=>t.type==="point"&&t.resolve==="global"&&t.bind&&t.bind!=="scales"&&!iae(t.bind),parse:(t,e,n)=>ZBe(e,n),topLevelSignals:(t,e,n)=>{const r=e.name,i=e.project,o=e.bind,s=e.init&&e.init[0],a=WBe.defined(e)?"(item().isVoronoi ? datum.datum : datum)":"datum";return i.items.forEach((l,c)=>{const u=pi(`${r}_${l.field}`);n.filter(d=>d.name===u).length||n.unshift({name:u,...s?{init:Tb(s[c])}:{value:null},on:e.events?[{events:e.events,update:`datum && item().mark.marktype !== 'group' ? ${a}[${rt(l.field)}] : null`}]:[],bind:o[l.field]??o[l.channel]??o})}),n},signals:(t,e,n)=>{const r=e.name,i=e.project,o=n.find(c=>c.name===r+my),s=r+HR,a=i.items.map(c=>pi(`${r}_${c.field}`)),l=a.map(c=>`${c} !== null`).join(" && ");return a.length&&(o.update=`${l} ? {fields: ${s}, values: [${a.join(", ")}]} : null`),delete o.value,delete o.on,n}},z5="_toggle",GBe={defined:t=>t.type==="point"&&!!t.toggle,signals:(t,e,n)=>n.concat({name:e.name+z5,value:!1,on:[{events:e.events,update:e.toggle}]}),modifyExpr:(t,e)=>{const n=e.name+my,r=e.name+z5;return`${r} ? null : ${n}, `+(e.resolve==="global"?`${r} ? null : true, `:`${r} ? null : {unit: ${Ux(t)}}, `)+`${r} ? ${n} : null`}},G9t={defined:t=>t.clear!==void 0&&t.clear!==!1,parse:(t,e)=>{e.clear&&(e.clear=gt(e.clear)?Hy(e.clear,"view"):e.clear)},topLevelSignals:(t,e,n)=>{if(VBe.defined(e))for(const r of e.project.items){const i=n.findIndex(o=>o.name===pi(`${e.name}_${r.field}`));i!==-1&&n[i].on.push({events:e.clear,update:"null"})}return n},signals:(t,e,n)=>{function r(i,o){i!==-1&&n[i].on&&n[i].on.push({events:e.clear,update:o})}if(e.type==="interval")for(const i of e.project.items){const o=n.findIndex(s=>s.name===i.signals.visual);if(r(o,"[0, 0]"),o===-1){const s=n.findIndex(a=>a.name===i.signals.data);r(s,"null")}}else{let i=n.findIndex(o=>o.name===e.name+my);r(i,"null"),GBe.defined(e)&&(i=n.findIndex(o=>o.name===e.name+z5),r(i,"false"))}return n}},HBe={defined:t=>{const e=t.resolve==="global"&&t.bind&&iae(t.bind),n=t.project.items.length===1&&t.project.items[0].field!==Yf;return e&&!n&&Ze(pUt),e&&n},parse:(t,e,n)=>{const r=Kt(n);if(r.select=gt(r.select)?{type:r.select,toggle:e.toggle}:{...r.select,toggle:e.toggle},ZBe(e,r),ht(n.select)&&(n.select.on||n.select.clear)){const s='event.item && indexof(event.item.mark.role, "legend") < 0';for(const a of e.events)a.filter=pt(a.filter??[]),a.filter.includes(s)||a.filter.push(s)}const i=UV(e.bind)?e.bind.legend:"click",o=gt(i)?Hy(i,"view"):pt(i);e.bind={legend:{merge:o}}},topLevelSignals:(t,e,n)=>{const r=e.name,i=UV(e.bind)&&e.bind.legend,o=s=>a=>{const l=Kt(a);return l.markname=s,l};for(const s of e.project.items){if(!s.hasLegend)continue;const a=`${pi(s.field)}_legend`,l=`${r}_${a}`;if(n.filter(u=>u.name===l).length===0){const u=i.merge.map(o(`${a}_symbols`)).concat(i.merge.map(o(`${a}_labels`))).concat(i.merge.map(o(`${a}_entries`)));n.unshift({name:l,...e.init?{}:{value:null},on:[{events:u,update:"isDefined(datum.value) ? datum.value : item().items[0].items[0].datum.value",force:!0},{events:i.merge,update:`!event.item || !datum ? null : ${l}`,force:!0}]})}}return n},signals:(t,e,n)=>{const r=e.name,i=e.project,o=n.find(d=>d.name===r+my),s=r+HR,a=i.items.filter(d=>d.hasLegend).map(d=>pi(`${r}_${pi(d.field)}_legend`)),c=`${a.map(d=>`${d} !== null`).join(" && ")} ? {fields: ${s}, values: [${a.join(", ")}]} : null`;e.events&&a.length>0?o.on.push({events:a.map(d=>({signal:d})),update:c}):a.length>0&&(o.update=c,delete o.value,delete o.on);const u=n.find(d=>d.name===r+z5),f=UV(e.bind)&&e.bind.legend;return u&&(e.events?u.on.push({...u.on[0],events:f}):u.on[0].events=f),n}};function H9t(t,e,n){var i;const r=(i=t.fieldDef(e))==null?void 0:i.field;for(const o of bs(t.component.selection??{})){const s=o.project.hasField[r]??o.project.hasChannel[e];if(s&&HBe.defined(o)){const a=n.get("selections")??[];a.push(o.name),n.set("selections",a,!1),s.hasLegend=!0}}}const qBe="_translate_anchor",XBe="_translate_delta",q9t={defined:t=>t.type==="interval"&&t.translate,signals:(t,e,n)=>{const r=e.name,i=lg.defined(e),o=r+qBe,{x:s,y:a}=e.project.hasChannel;let l=Hy(e.translate,"scope");return i||(l=l.map(c=>(c.between[0].markname=r+j_,c))),n.push({name:o,value:{},on:[{events:l.map(c=>c.between[0]),update:"{x: x(unit), y: y(unit)"+(s!==void 0?`, extent_x: ${i?GY(t,yi):`slice(${s.signals.visual})`}`:"")+(a!==void 0?`, extent_y: ${i?GY(t,Yo):`slice(${a.signals.visual})`}`:"")+"}"}]},{name:r+XBe,value:{},on:[{events:l,update:`{x: ${o}.x - x(unit), y: ${o}.y - y(unit)}`}]}),s!==void 0&&Jye(t,e,s,"width",n),a!==void 0&&Jye(t,e,a,"height",n),n}};function Jye(t,e,n,r,i){const o=e.name,s=o+qBe,a=o+XBe,l=n.channel,c=lg.defined(e),u=i.find(w=>w.name===n.signals[c?"data":"visual"]),f=t.getSizeSignalRef(r).signal,d=t.getScaleComponent(l),h=d&&d.get("type"),p=d&&d.get("reverse"),g=c?l===yi?p?"":"-":p?"-":"":"",m=`${s}.extent_${l}`,v=`${g}${a}.${l} / ${c?`${f}`:`span(${m})`}`,y=!c||!d?"panLinear":h==="log"?"panLog":h==="symlog"?"panSymlog":h==="pow"?"panPow":"panLinear",x=c?h==="pow"?`, ${d.get("exponent")??1}`:h==="symlog"?`, ${d.get("constant")??1}`:"":"",b=`${y}(${m}, ${v}${x})`;u.on.push({events:{signal:a},update:c?b:`clampRange(${b}, 0, ${f})`})}const YBe="_zoom_anchor",QBe="_zoom_delta",X9t={defined:t=>t.type==="interval"&&t.zoom,signals:(t,e,n)=>{const r=e.name,i=lg.defined(e),o=r+QBe,{x:s,y:a}=e.project.hasChannel,l=rt(t.scaleName(yi)),c=rt(t.scaleName(Yo));let u=Hy(e.zoom,"scope");return i||(u=u.map(f=>(f.markname=r+j_,f))),n.push({name:r+YBe,on:[{events:u,update:i?"{"+[l?`x: invert(${l}, x(unit))`:"",c?`y: invert(${c}, y(unit))`:""].filter(f=>f).join(", ")+"}":"{x: x(unit), y: y(unit)}"}]},{name:o,on:[{events:u,force:!0,update:"pow(1.001, event.deltaY * pow(16, event.deltaMode))"}]}),s!==void 0&&e0e(t,e,s,"width",n),a!==void 0&&e0e(t,e,a,"height",n),n}};function e0e(t,e,n,r,i){const o=e.name,s=n.channel,a=lg.defined(e),l=i.find(y=>y.name===n.signals[a?"data":"visual"]),c=t.getSizeSignalRef(r).signal,u=t.getScaleComponent(s),f=u&&u.get("type"),d=a?GY(t,s):l.name,h=o+QBe,p=`${o}${YBe}.${s}`,g=!a||!u?"zoomLinear":f==="log"?"zoomLog":f==="symlog"?"zoomSymlog":f==="pow"?"zoomPow":"zoomLinear",m=a?f==="pow"?`, ${u.get("exponent")??1}`:f==="symlog"?`, ${u.get("constant")??1}`:"":"",v=`${g}(${d}, ${p}, ${h}${m})`;l.on.push({events:{signal:h},update:a?v:`clampRange(${v}, 0, ${c})`})}const kb="_store",my="_tuple",Y9t="_modify",KBe="vlSelectionResolve",L6=[P9t,k9t,E9t,GBe,VBe,lg,HBe,G9t,q9t,X9t,WBe];function Q9t(t){let e=t.parent;for(;e&&!pc(e);)e=e.parent;return e}function Ux(t,{escape:e}={escape:!0}){let n=e?rt(t.name):t.name;const r=Q9t(t);if(r){const{facet:i}=r;for(const o of au)i[o]&&(n+=` + '__facet_${o}_' + (facet[${rt(r.vgField(o))}])`)}return n}function gae(t){return bs(t.component.selection??{}).reduce((e,n)=>e||n.project.hasSelectionId,!1)}function ZBe(t,e){(gt(e.select)||!e.select.on)&&delete t.events,(gt(e.select)||!e.select.clear)&&delete t.clear,(gt(e.select)||!e.select.toggle)&&delete t.toggle}function HY(t){const e=[];return t.type==="Identifier"?[t.name]:t.type==="Literal"?[t.value]:(t.type==="MemberExpression"&&(e.push(...HY(t.object)),e.push(...HY(t.property))),e)}function JBe(t){return t.object.type==="MemberExpression"?JBe(t.object):t.object.name==="datum"}function e6e(t){const e=Loe(t),n=new Set;return e.visit(r=>{r.type==="MemberExpression"&&JBe(r)&&n.add(HY(r).slice(1).join("."))}),n}class LO extends _r{clone(){return new LO(null,this.model,Kt(this.filter))}constructor(e,n,r){super(e),this.model=n,this.filter=r,this.expr=j5(this.model,this.filter,this),this._dependentFields=e6e(this.expr)}dependentFields(){return this._dependentFields}producedFields(){return new Set}assemble(){return{type:"filter",expr:this.expr}}hash(){return`Filter ${this.expr}`}}function K9t(t,e){const n={},r=t.config.selection;if(!e||!e.length)return n;for(const i of e){const o=pi(i.name),s=i.select,a=gt(s)?s:s.type,l=ht(s)?Kt(s):{type:a},c=r[a];for(const d in c)d==="fields"||d==="encodings"||(d==="mark"&&(l.mark={...c.mark,...l.mark}),(l[d]===void 0||l[d]===!0)&&(l[d]=Kt(c[d]??l[d])));const u=n[o]={...l,name:o,type:a,init:i.value,bind:i.bind,events:gt(l.on)?Hy(l.on,"scope"):pt(Kt(l.on))},f=Kt(i);for(const d of L6)d.defined(u)&&d.parse&&d.parse(t,u,f)}return n}function t6e(t,e,n,r="datum"){const i=gt(e)?e:e.param,o=pi(i),s=rt(o+kb);let a;try{a=t.getSelectionComponent(o,i)}catch{return`!!${o}`}if(a.project.timeUnit){const d=n??t.component.data.raw,h=a.project.timeUnit.clone();d.parent?h.insertAsParentOf(d):d.parent=h}const l=a.project.hasSelectionId?"vlSelectionIdTest(":"vlSelectionTest(",c=a.resolve==="global"?")":`, ${rt(a.resolve)})`,u=`${l}${s}, ${r}${c}`,f=`length(data(${s}))`;return e.empty===!1?`${f} && ${u}`:`!${f} || ${u}`}function n6e(t,e,n){const r=pi(e),i=n.encoding;let o=n.field,s;try{s=t.getSelectionComponent(r,e)}catch{return r}if(!i&&!o)o=s.project.items[0].field,s.project.items.length>1&&Ze(`A "field" or "encoding" must be specified when using a selection as a scale domain. Using "field": ${rt(o)}.`);else if(i&&!o){const a=s.project.items.filter(l=>l.channel===i);!a.length||a.length>1?(o=s.project.items[0].field,Ze((a.length?"Multiple ":"No ")+`matching ${rt(i)} encoding found for selection ${rt(n.param)}. Using "field": ${rt(o)}.`)):o=a[0].field}return`${s.name}[${rt(Mu(o))}]`}function Z9t(t,e){for(const[n,r]of dy(t.component.selection??{})){const i=t.getName(`lookup_${n}`);t.component.data.outputNodes[i]=r.materialized=new pl(new LO(e,t,{param:n}),i,Fi.Lookup,t.component.data.outputNodeRefCounts)}}function j5(t,e,n){return gk(e,r=>gt(r)?r:k8t(r)?t6e(t,r,n):g4e(r))}function J9t(t,e){if(t)return We(t)&&!Ym(t)?t.map(n=>Qse(n,e)).join(", "):t}function qV(t,e,n,r){var i,o;t.encode??(t.encode={}),(i=t.encode)[e]??(i[e]={}),(o=t.encode[e]).update??(o.update={}),t.encode[e].update[n]=r}function bT(t,e,n,r={header:!1}){var f,d;const{disable:i,orient:o,scale:s,labelExpr:a,title:l,zindex:c,...u}=t.combine();if(!i){for(const h in u){const p=h,g=DWt[p],m=u[p];if(g&&g!==e&&g!=="both")delete u[p];else if(GR(m)){const{condition:v,...y}=m,x=pt(v),b=Tye[p];if(b){const{vgProp:w,part:_}=b,S=[...x.map(O=>{const{test:k,...E}=O;return{test:j5(null,k),...E}}),y];qV(u,_,w,S),delete u[p]}else if(b===null){const w={signal:x.map(_=>{const{test:S,...O}=_;return`${j5(null,S)} ? ${fye(O)} : `}).join("")+fye(y)};u[p]=w}}else if(Mt(m)){const v=Tye[p];if(v){const{vgProp:y,part:x}=v;qV(u,x,y,m),delete u[p]}}En(["labelAlign","labelBaseline"],p)&&u[p]===null&&delete u[p]}if(e==="grid"){if(!u.grid)return;if(u.encode){const{grid:h}=u.encode;u.encode={...h?{grid:h}:{}},Er(u.encode)&&delete u.encode}return{scale:s,orient:o,...u,domain:!1,labels:!1,aria:!1,maxExtent:0,minExtent:0,ticks:!1,zindex:qi(c,0)}}else{if(!r.header&&t.mainExtracted)return;if(a!==void 0){let p=a;(d=(f=u.encode)==null?void 0:f.labels)!=null&&d.update&&Mt(u.encode.labels.update.text)&&(p=wb(a,"datum.label",u.encode.labels.update.text.signal)),qV(u,"labels","text",{signal:p})}if(u.labelAlign===null&&delete u.labelAlign,u.encode){for(const p of H4e)t.hasAxisPart(p)||delete u.encode[p];Er(u.encode)&&delete u.encode}const h=J9t(l,n);return{scale:s,orient:o,grid:!1,...h?{title:h}:{},...u,...n.aria===!1?{aria:!1}:{},zindex:qi(c,0)}}}}function r6e(t){const{axes:e}=t.component,n=[];for(const r of Jg)if(e[r]){for(const i of e[r])if(!i.get("disable")&&!i.get("gridScale")){const o=r==="x"?"height":"width",s=t.getSizeSignalRef(o).signal;o!==s&&n.push({name:o,update:s})}}return n}function e7t(t,e){const{x:n=[],y:r=[]}=t;return[...n.map(i=>bT(i,"grid",e)),...r.map(i=>bT(i,"grid",e)),...n.map(i=>bT(i,"main",e)),...r.map(i=>bT(i,"main",e))].filter(i=>i)}function t0e(t,e,n,r){return Object.assign.apply(null,[{},...t.map(i=>{if(i==="axisOrient"){const o=n==="x"?"bottom":"left",s=e[n==="x"?"axisBottom":"axisLeft"]||{},a=e[n==="x"?"axisTop":"axisRight"]||{},l=new Set([...Qe(s),...Qe(a)]),c={};for(const u of l.values())c[u]={signal:`${r.signal} === "${o}" ? ${Tf(s[u])} : ${Tf(a[u])}`};return c}return e[i]})])}function t7t(t,e,n,r){const i=e==="band"?["axisDiscrete","axisBand"]:e==="point"?["axisDiscrete","axisPoint"]:x4e(e)?["axisQuantitative"]:e==="time"||e==="utc"?["axisTemporal"]:[],o=t==="x"?"axisX":"axisY",s=Mt(n)?"axisOrient":`axis${IR(n)}`,a=[...i,...i.map(c=>o+c.substr(4))],l=["axis",s,o];return{vlOnlyAxisConfig:t0e(a,r,t,n),vgAxisConfig:t0e(l,r,t,n),axisConfigStyle:n7t([...l,...a],r)}}function n7t(t,e){var r;const n=[{}];for(const i of t){let o=(r=e[i])==null?void 0:r.style;if(o){o=pt(o);for(const s of o)n.push(e.style[s])}}return Object.assign.apply(null,n)}function qY(t,e,n,r={}){var o;const i=qje(t,n,e);if(i!==void 0)return{configFrom:"style",configValue:i};for(const s of["vlOnlyAxisConfig","vgAxisConfig","axisConfigStyle"])if(((o=r[s])==null?void 0:o[t])!==void 0)return{configFrom:s,configValue:r[s][t]};return{}}const n0e={scale:({model:t,channel:e})=>t.scaleName(e),format:({format:t})=>t,formatType:({formatType:t})=>t,grid:({fieldOrDatumDef:t,axis:e,scaleType:n})=>e.grid??r7t(n,t),gridScale:({model:t,channel:e})=>i7t(t,e),labelAlign:({axis:t,labelAngle:e,orient:n,channel:r})=>t.labelAlign||o6e(e,n,r),labelAngle:({labelAngle:t})=>t,labelBaseline:({axis:t,labelAngle:e,orient:n,channel:r})=>t.labelBaseline||i6e(e,n,r),labelFlush:({axis:t,fieldOrDatumDef:e,channel:n})=>t.labelFlush??s7t(e.type,n),labelOverlap:({axis:t,fieldOrDatumDef:e,scaleType:n})=>t.labelOverlap??a7t(e.type,n,Je(e)&&!!e.timeUnit,Je(e)?e.sort:void 0),orient:({orient:t})=>t,tickCount:({channel:t,model:e,axis:n,fieldOrDatumDef:r,scaleType:i})=>{const o=t==="x"?"width":t==="y"?"height":void 0,s=o?e.getSizeSignalRef(o):void 0;return n.tickCount??c7t({fieldOrDatumDef:r,scaleType:i,size:s,values:n.values})},tickMinStep:u7t,title:({axis:t,model:e,channel:n})=>{if(t.title!==void 0)return t.title;const r=s6e(e,n);if(r!==void 0)return r;const i=e.typedFieldDef(n),o=n==="x"?"x2":"y2",s=e.fieldDef(o);return Yje(i?[Oye(i)]:[],Je(s)?[Oye(s)]:[])},values:({axis:t,fieldOrDatumDef:e})=>f7t(t,e),zindex:({axis:t,fieldOrDatumDef:e,mark:n})=>t.zindex??d7t(n,e)};function r7t(t,e){return!Wo(t)&&Je(e)&&!Gr(e==null?void 0:e.bin)&&!ns(e==null?void 0:e.bin)}function i7t(t,e){const n=e==="x"?"y":"x";if(t.getScaleComponent(n))return t.scaleName(n)}function o7t(t,e,n,r,i){const o=e==null?void 0:e.labelAngle;if(o!==void 0)return Mt(o)?o:qA(o);{const{configValue:s}=qY("labelAngle",r,e==null?void 0:e.style,i);return s!==void 0?qA(s):n===yi&&En([Nse,Fse],t.type)&&!(Je(t)&&t.timeUnit)?270:void 0}}function XY(t){return`(((${t.signal} % 360) + 360) % 360)`}function i6e(t,e,n,r){if(t!==void 0)if(n==="x"){if(Mt(t)){const i=XY(t),o=Mt(e)?`(${e.signal} === "top")`:e==="top";return{signal:`(45 < ${i} && ${i} < 135) || (225 < ${i} && ${i} < 315) ? "middle" :(${i} <= 45 || 315 <= ${i}) === ${o} ? "bottom" : "top"`}}if(45{if(x1(r)&&L4e(r.sort)){const{field:o,timeUnit:s}=r,a=r.sort,l=a.map((c,u)=>`${g4e({field:o,timeUnit:s,equal:c})} ? ${u} : `).join("")+a.length;e=new aC(e,{calculate:l,as:lC(r,i,{forAs:!0})})}}),e}producedFields(){return new Set([this.transform.as])}dependentFields(){return this._dependentFields}assemble(){return{type:"formula",expr:this.transform.calculate,as:this.transform.as}}hash(){return`Calculate ${Mn(this.transform)}`}}function lC(t,e,n){return lt(t,{prefix:e,suffix:"sort_index",...n})}function $6(t,e){return En(["top","bottom"],e)?"column":En(["left","right"],e)||t==="row"?"row":"column"}function cC(t,e,n,r){const i=r==="row"?n.headerRow:r==="column"?n.headerColumn:n.headerFacet;return qi((e||{})[t],i[t],n.header[t])}function F6(t,e,n,r){const i={};for(const o of t){const s=cC(o,e||{},n,r);s!==void 0&&(i[o]=s)}return i}const mae=["row","column"],vae=["header","footer"];function h7t(t,e){const n=t.component.layoutHeaders[e].title,r=t.config?t.config:void 0,i=t.component.layoutHeaders[e].facetFieldDef?t.component.layoutHeaders[e].facetFieldDef:void 0,{titleAnchor:o,titleAngle:s,titleOrient:a}=F6(["titleAnchor","titleAngle","titleOrient"],i.header,r,e),l=$6(e,a),c=qA(s);return{name:`${e}-title`,type:"group",role:`${l}-title`,title:{text:n,...e==="row"?{orient:"left"}:{},style:"guide-title",...l6e(c,l),...a6e(l,c,o),...c6e(r,i,e,tVt,uBe)}}}function a6e(t,e,n="middle"){switch(n){case"start":return{align:"left"};case"end":return{align:"right"}}const r=o6e(e,t==="row"?"left":"top",t==="row"?"y":"x");return r?{align:r}:{}}function l6e(t,e){const n=i6e(t,e==="row"?"left":"top",e==="row"?"y":"x",!0);return n?{baseline:n}:{}}function p7t(t,e){const n=t.component.layoutHeaders[e],r=[];for(const i of vae)if(n[i])for(const o of n[i]){const s=m7t(t,e,i,n,o);s!=null&&r.push(s)}return r}function g7t(t,e){const{sort:n}=t;return ag(n)?{field:lt(n,{expr:"datum"}),order:n.order??"ascending"}:We(n)?{field:lC(t,e,{expr:"datum"}),order:"ascending"}:{field:lt(t,{expr:"datum"}),order:n??"ascending"}}function YY(t,e,n){const{format:r,formatType:i,labelAngle:o,labelAnchor:s,labelOrient:a,labelExpr:l}=F6(["format","formatType","labelAngle","labelAnchor","labelOrient","labelExpr"],t.header,n,e),c=Hse({fieldOrDatumDef:t,format:r,formatType:i,expr:"parent",config:n}).signal,u=$6(e,a);return{text:{signal:l?wb(wb(l,"datum.label",c),"datum.value",lt(t,{expr:"parent"})):c},...e==="row"?{orient:"left"}:{},style:"guide-label",frame:"group",...l6e(o,u),...a6e(u,o,s),...c6e(n,t,e,nVt,fBe)}}function m7t(t,e,n,r,i){if(i){let o=null;const{facetFieldDef:s}=r,a=t.config?t.config:void 0;if(s&&i.labels){const{labelOrient:f}=F6(["labelOrient"],s.header,a,e);(e==="row"&&!En(["top","bottom"],f)||e==="column"&&!En(["left","right"],f))&&(o=YY(s,e,a))}const l=pc(t)&&!BR(t.facet),c=i.axes,u=(c==null?void 0:c.length)>0;if(o||u){const f=e==="row"?"height":"width";return{name:t.getName(`${e}_${n}`),type:"group",role:`${e}-${n}`,...r.facetFieldDef?{from:{data:t.getName(`${e}_domain`)},sort:g7t(s,e)}:{},...u&&l?{from:{data:t.getName(`facet_domain_${e}`)}}:{},...o?{title:o}:{},...i.sizeSignal?{encode:{update:{[f]:i.sizeSignal}}}:{},...u?{axes:c}:{}}}}return null}const v7t={column:{start:0,end:1},row:{start:1,end:0}};function y7t(t,e){return v7t[e][t]}function x7t(t,e){const n={};for(const r of au){const i=t[r];if(i!=null&&i.facetFieldDef){const{titleAnchor:o,titleOrient:s}=F6(["titleAnchor","titleOrient"],i.facetFieldDef.header,e,r),a=$6(r,s),l=y7t(o,a);l!==void 0&&(n[a]=l)}}return Er(n)?void 0:n}function c6e(t,e,n,r,i){const o={};for(const s of r){if(!i[s])continue;const a=cC(s,e==null?void 0:e.header,t,n);a!==void 0&&(o[i[s]]=a)}return o}function yae(t){return[...tL(t,"width"),...tL(t,"height"),...tL(t,"childWidth"),...tL(t,"childHeight")]}function tL(t,e){const n=e==="width"?"x":"y",r=t.component.layoutSize.get(e);if(!r||r==="merged")return[];const i=t.getSizeSignalRef(e).signal;if(r==="step"){const o=t.getScaleComponent(n);if(o){const s=o.get("type"),a=o.get("range");if(Wo(s)&&m1(a)){const l=t.scaleName(n);return pc(t.parent)&&t.parent.component.resolve.scale[n]==="independent"?[r0e(l,a)]:[r0e(l,a),{name:i,update:u6e(l,o,`domain('${l}').length`)}]}}throw new Error("layout size is step although width/height is not step.")}else if(r=="container"){const o=i.endsWith("width"),s=o?"containerSize()[0]":"containerSize()[1]",a=jY(t.config.view,o?"width":"height"),l=`isFinite(${s}) ? ${s} : ${a}`;return[{name:i,init:l,on:[{update:l,events:"window:resize"}]}]}else return[{name:i,value:r}]}function r0e(t,e){const n=`${t}_step`;return Mt(e.step)?{name:n,update:e.step.signal}:{name:n,value:e.step}}function u6e(t,e,n){const r=e.get("type"),i=e.get("padding"),o=qi(e.get("paddingOuter"),i);let s=e.get("paddingInner");return s=r==="band"?s!==void 0?s:i:1,`bandspace(${n}, ${Tf(s)}, ${Tf(o)}) * ${t}_step`}function f6e(t){return t==="childWidth"?"width":t==="childHeight"?"height":t}function d6e(t,e){return Qe(t).reduce((n,r)=>({...n,...IO({model:e,channelDef:t[r],vgChannel:r,mainRefFn:i=>Jr(i.value),invalidValueRef:void 0})}),{})}function h6e(t,e){if(pc(e))return t==="theta"?"independent":"shared";if(NO(e))return"shared";if(Oae(e))return Xi(t)||t==="theta"||t==="radius"?"independent":"shared";throw new Error("invalid model type for resolve")}function xae(t,e){const n=t.scale[e],r=Xi(e)?"axis":"legend";return n==="independent"?(t[r][e]==="shared"&&Ze(QUt(e)),"independent"):t[r][e]||"shared"}const b7t={...oVt,disable:1,labelExpr:1,selections:1,opacity:1,shape:1,stroke:1,fill:1,size:1,strokeWidth:1,strokeDash:1,encode:1},p6e=Qe(b7t);class w7t extends tm{}const i0e={symbols:_7t,gradient:S7t,labels:C7t,entries:O7t};function _7t(t,{fieldOrDatumDef:e,model:n,channel:r,legendCmpt:i,legendType:o}){if(o!=="symbol")return;const{markDef:s,encoding:a,config:l,mark:c}=n,u=s.filled&&c!=="trail";let f={...aUt({},n,eWt),...jBe(n,{filled:u})};const d=i.get("symbolOpacity")??l.legend.symbolOpacity,h=i.get("symbolFillColor")??l.legend.symbolFillColor,p=i.get("symbolStrokeColor")??l.legend.symbolStrokeColor,g=d===void 0?g6e(a.opacity)??s.opacity:void 0;if(f.fill){if(r==="fill"||u&&r===Sl)delete f.fill;else if(Ke(f.fill,"field"))h?delete f.fill:(f.fill=Jr(l.legend.symbolBaseFillColor??"black"),f.fillOpacity=Jr(g??1));else if(We(f.fill)){const m=QY(a.fill??a.color)??s.fill??(u&&s.color);m&&(f.fill=Jr(m))}}if(f.stroke){if(r==="stroke"||!u&&r===Sl)delete f.stroke;else if(Ke(f.stroke,"field")||p)delete f.stroke;else if(We(f.stroke)){const m=qi(QY(a.stroke||a.color),s.stroke,u?s.color:void 0);m&&(f.stroke={value:m})}}if(r!==Zg){const m=Je(e)&&v6e(n,i,e);m?f.opacity=[{test:m,...Jr(g??1)},Jr(l.legend.unselectedOpacity)]:g&&(f.opacity=Jr(g))}return f={...f,...t},Er(f)?void 0:f}function S7t(t,{model:e,legendType:n,legendCmpt:r}){if(n!=="gradient")return;const{config:i,markDef:o,encoding:s}=e;let a={};const c=(r.get("gradientOpacity")??i.legend.gradientOpacity)===void 0?g6e(s.opacity)||o.opacity:void 0;return c&&(a.opacity=Jr(c)),a={...a,...t},Er(a)?void 0:a}function C7t(t,{fieldOrDatumDef:e,model:n,channel:r,legendCmpt:i}){const o=n.legend(r)||{},s=n.config,a=Je(e)?v6e(n,i,e):void 0,l=a?[{test:a,value:1},{value:s.legend.unselectedOpacity}]:void 0,{format:c,formatType:u}=o;let f;Eb(u)?f=kf({fieldOrDatumDef:e,field:"datum.value",format:c,formatType:u,config:s}):c===void 0&&u===void 0&&s.customFormatTypes&&(e.type==="quantitative"&&s.numberFormatType?f=kf({fieldOrDatumDef:e,field:"datum.value",format:s.numberFormat,formatType:s.numberFormatType,config:s}):e.type==="temporal"&&s.timeFormatType&&Je(e)&&e.timeUnit===void 0&&(f=kf({fieldOrDatumDef:e,field:"datum.value",format:s.timeFormat,formatType:s.timeFormatType,config:s})));const d={...l?{opacity:l}:{},...f?{text:f}:{},...t};return Er(d)?void 0:d}function O7t(t,{legendCmpt:e}){const n=e.get("selections");return n!=null&&n.length?{...t,fill:{value:"transparent"}}:t}function g6e(t){return m6e(t,(e,n)=>Math.max(e,n.value))}function QY(t){return m6e(t,(e,n)=>qi(e,n.value))}function m6e(t,e){if(wWt(t))return pt(t.condition).reduce(e,t.value);if(qf(t))return t.value}function v6e(t,e,n){const r=e.get("selections");if(!(r!=null&&r.length))return;const i=rt(n.field);return r.map(o=>`(!length(data(${rt(pi(o)+kb)})) || (${o}[${i}] && indexof(${o}[${i}], datum.value) >= 0))`).join(" || ")}const o0e={direction:({direction:t})=>t,format:({fieldOrDatumDef:t,legend:e,config:n})=>{const{format:r,formatType:i}=e;return R4e(t,t.type,r,i,n,!1)},formatType:({legend:t,fieldOrDatumDef:e,scaleType:n})=>{const{formatType:r}=t;return D4e(r,e,n)},gradientLength:t=>{const{legend:e,legendConfig:n}=t;return e.gradientLength??n.gradientLength??R7t(t)},labelOverlap:({legend:t,legendConfig:e,scaleType:n})=>t.labelOverlap??e.labelOverlap??D7t(n),symbolType:({legend:t,markDef:e,channel:n,encoding:r})=>t.symbolType??T7t(e.type,n,r.shape,e.shape),title:({fieldOrDatumDef:t,config:e})=>z_(t,e,{allowDisabling:!0}),type:({legendType:t,scaleType:e,channel:n})=>{if(N_(n)&&Kd(e)){if(t==="gradient")return}else if(t==="symbol")return;return t},values:({fieldOrDatumDef:t,legend:e})=>E7t(e,t)};function E7t(t,e){const n=t.values;if(We(n))return G4e(e,n);if(Mt(n))return n}function T7t(t,e,n,r){if(e!=="shape"){const i=QY(n)??r;if(i)return i}switch(t){case"bar":case"rect":case"image":case"square":return"square";case"line":case"trail":case"rule":return"stroke";case"arc":case"point":case"circle":case"tick":case"geoshape":case"area":case"text":return"circle"}}function k7t(t){const{legend:e}=t;return qi(e.type,A7t(t))}function A7t({channel:t,timeUnit:e,scaleType:n}){if(N_(t)){if(En(["quarter","month","day"],e))return"symbol";if(Kd(n))return"gradient"}return"symbol"}function P7t({legendConfig:t,legendType:e,orient:n,legend:r}){return r.direction??t[e?"gradientDirection":"symbolDirection"]??M7t(n,e)}function M7t(t,e){switch(t){case"top":case"bottom":return"horizontal";case"left":case"right":case"none":case void 0:return;default:return e==="gradient"?"horizontal":void 0}}function R7t({legendConfig:t,model:e,direction:n,orient:r,scaleType:i}){const{gradientHorizontalMaxLength:o,gradientHorizontalMinLength:s,gradientVerticalMaxLength:a,gradientVerticalMinLength:l}=t;if(Kd(i))return n==="horizontal"?r==="top"||r==="bottom"?s0e(e,"width",s,o):s:s0e(e,"height",l,a)}function s0e(t,e,n,r){return{signal:`clamp(${t.getSizeSignalRef(e).signal}, ${n}, ${r})`}}function D7t(t){if(En(["quantile","threshold","log","symlog"],t))return"greedy"}function y6e(t){const e=_i(t)?I7t(t):N7t(t);return t.component.legends=e,e}function I7t(t){const{encoding:e}=t,n={};for(const r of[Sl,...hBe]){const i=_o(e[r]);!i||!t.getScaleComponent(r)||r===Cl&&Je(i)&&i.type===DO||(n[r]=F7t(t,r))}return n}function L7t(t,e){const n=t.scaleName(e);if(t.mark==="trail"){if(e==="color")return{stroke:n};if(e==="size")return{strokeWidth:n}}return e==="color"?t.markDef.filled?{fill:n}:{stroke:n}:{[e]:n}}function $7t(t,e,n,r){switch(e){case"disable":return n!==void 0;case"values":return!!(n!=null&&n.values);case"title":if(e==="title"&&t===(r==null?void 0:r.title))return!0}return t===(n||{})[e]}function F7t(t,e){var b;let n=t.legend(e);const{markDef:r,encoding:i,config:o}=t,s=o.legend,a=new w7t({},L7t(t,e));H9t(t,e,a);const l=n!==void 0?!n:s.disable;if(a.set("disable",l,n!==void 0),l)return a;n=n||{};const c=t.getScaleComponent(e).get("type"),u=_o(i[e]),f=Je(u)?(b=Uo(u.timeUnit))==null?void 0:b.unit:void 0,d=n.orient||o.legend.orient||"right",h=k7t({legend:n,channel:e,timeUnit:f,scaleType:c}),p=P7t({legend:n,legendType:h,orient:d,legendConfig:s}),g={legend:n,channel:e,model:t,markDef:r,encoding:i,fieldOrDatumDef:u,legendConfig:s,config:o,scaleType:c,orient:d,legendType:h,direction:p};for(const w of p6e){if(h==="gradient"&&w.startsWith("symbol")||h==="symbol"&&w.startsWith("gradient"))continue;const _=w in o0e?o0e[w](g):n[w];if(_!==void 0){const S=$7t(_,w,n,t.fieldDef(e));(S||o.legend[w]===void 0)&&a.set(w,_,S)}}const m=(n==null?void 0:n.encoding)??{},v=a.get("selections"),y={},x={fieldOrDatumDef:u,model:t,channel:e,legendCmpt:a,legendType:h};for(const w of["labels","legend","title","symbols","gradient","entries"]){const _=d6e(m[w]??{},t),S=w in i0e?i0e[w](_,x):_;S!==void 0&&!Er(S)&&(y[w]={...v!=null&&v.length&&Je(u)?{name:`${pi(u.field)}_legend_${w}`}:{},...v!=null&&v.length?{interactive:!!v}:{},update:S})}return Er(y)||a.set("encode",y,!!(n!=null&&n.encoding)),a}function N7t(t){const{legends:e,resolve:n}=t.component;for(const r of t.children){y6e(r);for(const i of Qe(r.component.legends))n.legend[i]=xae(t.component.resolve,i),n.legend[i]==="shared"&&(e[i]=x6e(e[i],r.component.legends[i]),e[i]||(n.legend[i]="independent",delete e[i]))}for(const r of Qe(e))for(const i of t.children)i.component.legends[r]&&n.legend[r]==="shared"&&delete i.component.legends[r];return e}function x6e(t,e){var o,s,a,l;if(!t)return e.clone();const n=t.getWithExplicit("orient"),r=e.getWithExplicit("orient");if(n.explicit&&r.explicit&&n.value!==r.value)return;let i=!1;for(const c of p6e){const u=gy(t.getWithExplicit(c),e.getWithExplicit(c),c,"legend",(f,d)=>{switch(c){case"symbolType":return z7t(f,d);case"title":return Kje(f,d);case"type":return i=!0,Wl("symbol")}return M6(f,d,c,"legend")});t.setWithExplicit(c,u)}return i&&((s=(o=t.implicit)==null?void 0:o.encode)!=null&&s.gradient&&k5(t.implicit,["encode","gradient"]),(l=(a=t.explicit)==null?void 0:a.encode)!=null&&l.gradient&&k5(t.explicit,["encode","gradient"])),t}function z7t(t,e){return e.value==="circle"?e:t}function j7t(t,e,n,r){var i,o;t.encode??(t.encode={}),(i=t.encode)[e]??(i[e]={}),(o=t.encode[e]).update??(o.update={}),t.encode[e].update[n]=r}function b6e(t){const e=t.component.legends,n={};for(const i of Qe(e)){const o=t.getScaleComponent(i),s=Tr(o.get("domains"));if(n[s])for(const a of n[s])x6e(a,e[i])||n[s].push(e[i]);else n[s]=[e[i].clone()]}return bs(n).flat().map(i=>B7t(i,t.config)).filter(i=>i!==void 0)}function B7t(t,e){var s,a,l;const{disable:n,labelExpr:r,selections:i,...o}=t.combine();if(!n){if(e.aria===!1&&o.aria==null&&(o.aria=!1),(s=o.encode)!=null&&s.symbols){const c=o.encode.symbols.update;c.fill&&c.fill.value!=="transparent"&&!c.stroke&&!o.stroke&&(c.stroke={value:"transparent"});for(const u of hBe)o[u]&&delete c[u]}if(o.title||delete o.title,r!==void 0){let c=r;(l=(a=o.encode)==null?void 0:a.labels)!=null&&l.update&&Mt(o.encode.labels.update.text)&&(c=wb(r,"datum.label",o.encode.labels.update.text.signal)),j7t(o,"labels","text",{signal:c})}return o}}function U7t(t){return NO(t)||Oae(t)?W7t(t):w6e(t)}function W7t(t){return t.children.reduce((e,n)=>e.concat(n.assembleProjections()),w6e(t))}function w6e(t){const e=t.component.projection;if(!e||e.merged)return[];const n=e.combine(),{name:r}=n;if(e.data){const i={signal:`[${e.size.map(s=>s.signal).join(", ")}]`},o=e.data.reduce((s,a)=>{const l=Mt(a)?a.signal:`data('${t.lookupDataSource(a)}')`;return En(s,l)||s.push(l),s},[]);if(o.length<=0)throw new Error("Projection's fit didn't find any data sources");return[{name:r,size:i,fit:{signal:o.length>1?`[${o.join(", ")}]`:o[0]},...n}]}else return[{name:r,translate:{signal:"[width / 2, height / 2]"},...n}]}const V7t=["type","clipAngle","clipExtent","center","rotate","precision","reflectX","reflectY","coefficient","distance","fraction","lobes","parallel","radius","ratio","spacing","tilt"];class _6e extends tm{constructor(e,n,r,i){super({...n},{name:e}),this.specifiedProjection=n,this.size=r,this.data=i,this.merged=!1}get isFit(){return!!this.data}}function S6e(t){t.component.projection=_i(t)?G7t(t):X7t(t)}function G7t(t){if(t.hasProjection){const e=is(t.specifiedProjection),n=!(e&&(e.scale!=null||e.translate!=null)),r=n?[t.getSizeSignalRef("width"),t.getSizeSignalRef("height")]:void 0,i=n?H7t(t):void 0,o=new _6e(t.projectionName(!0),{...is(t.config.projection),...e},r,i);return o.get("type")||o.set("type","equalEarth",!1),o}}function H7t(t){const e=[],{encoding:n}=t;for(const r of[[ad,sd],[Ru,ld]])(_o(n[r[0]])||_o(n[r[1]]))&&e.push({signal:t.getName(`geojson_${e.length}`)});return t.channelHasField(Cl)&&t.typedFieldDef(Cl).type===DO&&e.push({signal:t.getName(`geojson_${e.length}`)}),e.length===0&&e.push(t.requestDataName(Fi.Main)),e}function q7t(t,e){const n=dse(V7t,i=>!!(!vt(t.explicit,i)&&!vt(e.explicit,i)||vt(t.explicit,i)&&vt(e.explicit,i)&&oc(t.get(i),e.get(i))));if(oc(t.size,e.size)){if(n)return t;if(oc(t.explicit,{}))return e;if(oc(e.explicit,{}))return t}return null}function X7t(t){if(t.children.length===0)return;let e;for(const r of t.children)S6e(r);const n=dse(t.children,r=>{const i=r.component.projection;if(i)if(e){const o=q7t(e,i);return o&&(e=o),!!o}else return e=i,!0;else return!0});if(e&&n){const r=t.projectionName(!0),i=new _6e(r,e.specifiedProjection,e.size,Kt(e.data));for(const o of t.children){const s=o.component.projection;s&&(s.isFit&&i.data.push(...o.component.projection.data),o.renameProjection(s.get("name"),r),s.merged=!0)}return i}}function Y7t(t,e,n,r){if(VR(e,n)){const i=_i(t)?t.axis(n)??t.legend(n)??{}:{},o=lt(e,{expr:"datum"}),s=lt(e,{expr:"datum",binSuffix:"end"});return{formulaAs:lt(e,{binSuffix:"range",forAs:!0}),formula:jR(o,s,i.format,i.formatType,r)}}return{}}function C6e(t,e){return`${Wje(t)}_${e}`}function Q7t(t,e){return{signal:t.getName(`${e}_bins`),extentSignal:t.getName(`${e}_extent`)}}function bae(t,e,n){const r=O6(n,void 0)??{},i=C6e(r,e);return t.getName(`${i}_bins`)}function K7t(t){return"as"in t}function a0e(t,e,n){let r,i;K7t(t)?r=gt(t.as)?[t.as,`${t.as}_end`]:[t.as[0],t.as[1]]:r=[lt(t,{forAs:!0}),lt(t,{binSuffix:"end",forAs:!0})];const o={...O6(e,void 0)},s=C6e(o,t.field),{signal:a,extentSignal:l}=Q7t(n,s);if(p6(o.extent)){const u=o.extent;i=n6e(n,u.param,u),delete o.extent}const c={bin:o,field:t.field,as:[r],...a?{signal:a}:{},...l?{extentSignal:l}:{},...i?{span:i}:{}};return{key:s,binComponent:c}}class vh extends _r{clone(){return new vh(null,Kt(this.bins))}constructor(e,n){super(e),this.bins=n}static makeFromEncoding(e,n){const r=n.reduceFieldDef((i,o,s)=>{if(Pa(o)&&Gr(o.bin)){const{key:a,binComponent:l}=a0e(o,o.bin,n);i[a]={...l,...i[a],...Y7t(n,o,s,n.config)}}return i},{});return Er(r)?null:new vh(e,r)}static makeFromTransform(e,n,r){const{key:i,binComponent:o}=a0e(n,n.bin,r);return new vh(e,{[i]:o})}merge(e,n){for(const r of Qe(e.bins))r in this.bins?(n(e.bins[r].signal,this.bins[r].signal),this.bins[r].as=Qd([...this.bins[r].as,...e.bins[r].as],Mn)):this.bins[r]=e.bins[r];for(const r of e.children)e.removeChild(r),r.parent=this;e.remove()}producedFields(){return new Set(bs(this.bins).map(e=>e.as).flat(2))}dependentFields(){return new Set(bs(this.bins).map(e=>e.field))}hash(){return`Bin ${Mn(this.bins)}`}assemble(){return bs(this.bins).flatMap(e=>{const n=[],[r,...i]=e.as,{extent:o,...s}=e.bin,a={type:"bin",field:Mu(e.field),as:r,signal:e.signal,...p6(o)?{extent:null}:{extent:o},...e.span?{span:{signal:`span(${e.span})`}}:{},...s};!o&&e.extentSignal&&(n.push({type:"extent",field:Mu(e.field),signal:e.extentSignal}),a.extent={signal:e.extentSignal}),n.push(a);for(const l of i)for(let c=0;c<2;c++)n.push({type:"formula",expr:lt({field:r[c]},{expr:"datum"}),as:l[c]});return e.formula&&n.push({type:"formula",expr:e.formula,as:e.formulaAs}),n})}}function Z7t(t,e,n,r){var o;const i=_i(r)?r.encoding[qh(e)]:void 0;if(Pa(n)&&_i(r)&&F4e(n,i,r.markDef,r.config)){t.add(lt(n,{})),t.add(lt(n,{suffix:"end"}));const{mark:s,markDef:a,config:l}=r,c=py({fieldDef:n,markDef:a,config:l});XA(s)&&c!==.5&&Xi(e)&&(t.add(lt(n,{suffix:R6})),t.add(lt(n,{suffix:D6}))),n.bin&&VR(n,e)&&t.add(lt(n,{binSuffix:"range"}))}else if(Ije(e)){const s=Dje(e);t.add(r.getName(s))}else t.add(lt(n));return x1(n)&&B8t((o=n.scale)==null?void 0:o.range)&&t.add(n.scale.range.field),t}function J7t(t,e){for(const n of Qe(e)){const r=e[n];for(const i of Qe(r))n in t?t[n][i]=new Set([...t[n][i]??[],...r[i]]):t[n]={[i]:r[i]}}}class $f extends _r{clone(){return new $f(null,new Set(this.dimensions),Kt(this.measures))}constructor(e,n,r){super(e),this.dimensions=n,this.measures=r}get groupBy(){return this.dimensions}static makeFromEncoding(e,n){let r=!1;n.forEachFieldDef(s=>{s.aggregate&&(r=!0)});const i={},o=new Set;return!r||(n.forEachFieldDef((s,a)=>{const{aggregate:l,field:c}=s;if(l)if(l==="count")i["*"]??(i["*"]={}),i["*"].count=new Set([lt(s,{forAs:!0})]);else{if(Lg(l)||Zy(l)){const u=Lg(l)?"argmin":"argmax",f=l[u];i[f]??(i[f]={}),i[f][u]=new Set([lt({op:u,field:f},{forAs:!0})])}else i[c]??(i[c]={}),i[c][l]=new Set([lt(s,{forAs:!0})]);Xh(a)&&n.scaleDomain(a)==="unaggregated"&&(i[c]??(i[c]={}),i[c].min=new Set([lt({field:c,aggregate:"min"},{forAs:!0})]),i[c].max=new Set([lt({field:c,aggregate:"max"},{forAs:!0})]))}else Z7t(o,a,s,n)}),o.size+Qe(i).length===0)?null:new $f(e,o,i)}static makeFromTransform(e,n){var r;const i=new Set,o={};for(const s of n.aggregate){const{op:a,field:l,as:c}=s;a&&(a==="count"?(o["*"]??(o["*"]={}),o["*"].count=new Set([c||lt(s,{forAs:!0})])):(o[l]??(o[l]={}),(r=o[l])[a]??(r[a]=new Set),o[l][a].add(c||lt(s,{forAs:!0}))))}for(const s of n.groupby??[])i.add(s);return i.size+Qe(o).length===0?null:new $f(e,i,o)}merge(e){return Oje(this.dimensions,e.dimensions)?(J7t(this.measures,e.measures),!0):(d8t("different dimensions, cannot merge"),!1)}addDimensions(e){e.forEach(this.dimensions.add,this.dimensions)}dependentFields(){return new Set([...this.dimensions,...Qe(this.measures)])}producedFields(){const e=new Set;for(const n of Qe(this.measures))for(const r of Qe(this.measures[n])){const i=this.measures[n][r];i.size===0?e.add(`${r}_${n}`):i.forEach(e.add,e)}return e}hash(){return`Aggregate ${Mn({dimensions:this.dimensions,measures:this.measures})}`}assemble(){const e=[],n=[],r=[];for(const o of Qe(this.measures))for(const s of Qe(this.measures[o]))for(const a of this.measures[o][s])r.push(a),e.push(s),n.push(o==="*"?null:Mu(o));return{type:"aggregate",groupby:[...this.dimensions].map(Mu),ops:e,fields:n,as:r}}}class $O extends _r{constructor(e,n,r,i){super(e),this.model=n,this.name=r,this.data=i;for(const o of au){const s=n.facet[o];if(s){const{bin:a,sort:l}=s;this[o]={name:n.getName(`${o}_domain`),fields:[lt(s),...Gr(a)?[lt(s,{binSuffix:"end"})]:[]],...ag(l)?{sortField:l}:We(l)?{sortIndexField:lC(s,o)}:{}}}}this.childModel=n.child}hash(){let e="Facet";for(const n of au)this[n]&&(e+=` ${n.charAt(0)}:${Mn(this[n])}`);return e}get fields(){var n;const e=[];for(const r of au)(n=this[r])!=null&&n.fields&&e.push(...this[r].fields);return e}dependentFields(){const e=new Set(this.fields);for(const n of au)this[n]&&(this[n].sortField&&e.add(this[n].sortField.field),this[n].sortIndexField&&e.add(this[n].sortIndexField));return e}producedFields(){return new Set}getSource(){return this.name}getChildIndependentFieldsWithStep(){const e={};for(const n of Jg){const r=this.childModel.component.scales[n];if(r&&!r.merged){const i=r.get("type"),o=r.get("range");if(Wo(i)&&m1(o)){const s=N6(this.childModel,n),a=Cae(s);a?e[n]=a:Ze(Ese(n))}}}return e}assembleRowColumnHeaderData(e,n,r){const i={row:"y",column:"x",facet:void 0}[e],o=[],s=[],a=[];i&&r&&r[i]&&(n?(o.push(`distinct_${r[i]}`),s.push("max")):(o.push(r[i]),s.push("distinct")),a.push(`distinct_${r[i]}`));const{sortField:l,sortIndexField:c}=this[e];if(l){const{op:u=_6,field:f}=l;o.push(f),s.push(u),a.push(lt(l,{forAs:!0}))}else c&&(o.push(c),s.push("max"),a.push(c));return{name:this[e].name,source:n??this.data,transform:[{type:"aggregate",groupby:this[e].fields,...o.length?{fields:o,ops:s,as:a}:{}}]}}assembleFacetHeaderData(e){var l;const{columns:n}=this.model.layout,{layoutHeaders:r}=this.model.component,i=[],o={};for(const c of mae){for(const u of vae){const f=(r[c]&&r[c][u])??[];for(const d of f)if(((l=d.axes)==null?void 0:l.length)>0){o[c]=!0;break}}if(o[c]){const u=`length(data("${this.facet.name}"))`,f=c==="row"?n?{signal:`ceil(${u} / ${n})`}:1:n?{signal:`min(${u}, ${n})`}:{signal:u};i.push({name:`${this.facet.name}_${c}`,transform:[{type:"sequence",start:0,stop:f}]})}}const{row:s,column:a}=o;return(s||a)&&i.unshift(this.assembleRowColumnHeaderData("facet",null,e)),i}assemble(){const e=[];let n=null;const r=this.getChildIndependentFieldsWithStep(),{column:i,row:o,facet:s}=this;if(i&&o&&(r.x||r.y)){n=`cross_${this.column.name}_${this.row.name}`;const a=[].concat(r.x??[],r.y??[]),l=a.map(()=>"distinct");e.push({name:n,source:this.data,transform:[{type:"aggregate",groupby:this.fields,fields:a,ops:l}]})}for(const a of[sg,og])this[a]&&e.push(this.assembleRowColumnHeaderData(a,n,r));if(s){const a=this.assembleFacetHeaderData(r);a&&e.push(...a)}return e}}function l0e(t){return t.startsWith("'")&&t.endsWith("'")||t.startsWith('"')&&t.endsWith('"')?t.slice(1,-1):t}function eGt(t,e){const n=gse(t);if(e==="number")return`toNumber(${n})`;if(e==="boolean")return`toBoolean(${n})`;if(e==="string")return`toString(${n})`;if(e==="date")return`toDate(${n})`;if(e==="flatten")return n;if(e.startsWith("date:")){const r=l0e(e.slice(5,e.length));return`timeParse(${n},'${r}')`}else if(e.startsWith("utc:")){const r=l0e(e.slice(4,e.length));return`utcParse(${n},'${r}')`}else return Ze(wUt(e)),null}function tGt(t){const e={};return D3(t.filter,n=>{if(p4e(n)){let r=null;Pse(n)?r=ec(n.equal):Rse(n)?r=ec(n.lte):Mse(n)?r=ec(n.lt):Dse(n)?r=ec(n.gt):Ise(n)?r=ec(n.gte):Lse(n)?r=n.range[0]:$se(n)&&(r=(n.oneOf??n.in)[0]),r&&(v1(r)?e[n.field]="date":Jn(r)?e[n.field]="number":gt(r)&&(e[n.field]="string")),n.timeUnit&&(e[n.field]="date")}}),e}function nGt(t){const e={};function n(r){iC(r)?e[r.field]="date":r.type==="quantitative"&&Z6t(r.aggregate)?e[r.field]="number":KS(r.field)>1?r.field in e||(e[r.field]="flatten"):x1(r)&&ag(r.sort)&&KS(r.sort.field)>1&&(r.sort.field in e||(e[r.sort.field]="flatten"))}if((_i(t)||pc(t))&&t.forEachFieldDef((r,i)=>{if(Pa(r))n(r);else{const o=p1(i),s=t.fieldDef(o);n({...r,type:s.type})}}),_i(t)){const{mark:r,markDef:i,encoding:o}=t;if(Jy(r)&&!t.encoding.order){const s=i.orient==="horizontal"?"y":"x",a=o[s];Je(a)&&a.type==="quantitative"&&!(a.field in e)&&(e[a.field]="number")}}return e}function rGt(t){const e={};if(_i(t)&&t.component.selection)for(const n of Qe(t.component.selection)){const r=t.component.selection[n];for(const i of r.project.items)!i.channel&&KS(i.field)>1&&(e[i.field]="flatten")}return e}class Xs extends _r{clone(){return new Xs(null,Kt(this._parse))}constructor(e,n){super(e),this._parse=n}hash(){return`Parse ${Mn(this._parse)}`}static makeExplicit(e,n,r){var s;let i={};const o=n.data;return!Uv(o)&&((s=o==null?void 0:o.format)!=null&&s.parse)&&(i=o.format.parse),this.makeWithAncestors(e,i,{},r)}static makeWithAncestors(e,n,r,i){for(const a of Qe(r)){const l=i.getWithExplicit(a);l.value!==void 0&&(l.explicit||l.value===r[a]||l.value==="derived"||r[a]==="flatten"?delete r[a]:Ze(vye(a,r[a],l.value)))}for(const a of Qe(n)){const l=i.get(a);l!==void 0&&(l===n[a]?delete n[a]:Ze(vye(a,n[a],l)))}const o=new tm(n,r);i.copyAll(o);const s={};for(const a of Qe(o.combine())){const l=o.get(a);l!==null&&(s[a]=l)}return Qe(s).length===0||i.parseNothing?null:new Xs(e,s)}get parse(){return this._parse}merge(e){this._parse={...this._parse,...e.parse},e.remove()}assembleFormatParse(){const e={};for(const n of Qe(this._parse)){const r=this._parse[n];KS(n)===1&&(e[n]=r)}return e}producedFields(){return new Set(Qe(this._parse))}dependentFields(){return new Set(Qe(this._parse))}assembleTransforms(e=!1){return Qe(this._parse).filter(n=>e?KS(n)>1:!0).map(n=>{const r=eGt(n,this._parse[n]);return r?{type:"formula",expr:r,as:MO(n)}:null}).filter(n=>n!==null)}}class vy extends _r{clone(){return new vy(null)}constructor(e){super(e)}dependentFields(){return new Set}producedFields(){return new Set([Yf])}hash(){return"Identifier"}assemble(){return{type:"identifier",as:Yf}}}class qR extends _r{clone(){return new qR(null,this.params)}constructor(e,n){super(e),this.params=n}dependentFields(){return new Set}producedFields(){}hash(){return`Graticule ${Mn(this.params)}`}assemble(){return{type:"graticule",...this.params===!0?{}:this.params}}}class XR extends _r{clone(){return new XR(null,this.params)}constructor(e,n){super(e),this.params=n}dependentFields(){return new Set}producedFields(){return new Set([this.params.as??"data"])}hash(){return`Hash ${Mn(this.params)}`}assemble(){return{type:"sequence",...this.params}}}class Ab extends _r{constructor(e){super(null),e??(e={name:"source"});let n;if(Uv(e)||(n=e.format?{...hl(e.format,["parse"])}:{}),YA(e))this._data={values:e.values};else if(oC(e)){if(this._data={url:e.url},!n.type){let r=/(?:\.([^.]+))?$/.exec(e.url)[1];En(["json","csv","tsv","dsv","topojson"],r)||(r="json"),n.type=r}}else MBe(e)?this._data={values:[{type:"Sphere"}]}:(ABe(e)||Uv(e))&&(this._data={});this._generator=Uv(e),e.name&&(this._name=e.name),n&&!Er(n)&&(this._data.format=n)}dependentFields(){return new Set}producedFields(){}get data(){return this._data}hasName(){return!!this._name}get isGenerator(){return this._generator}get dataName(){return this._name}set dataName(e){this._name=e}set parent(e){throw new Error("Source nodes have to be roots.")}remove(){throw new Error("Source nodes are roots and cannot be removed.")}hash(){throw new Error("Cannot hash sources")}assemble(){return{name:this._name,...this._data,transform:[]}}}var c0e=function(t,e,n,r,i){if(r==="m")throw new TypeError("Private method is not writable");if(r==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return r==="a"?i.call(t,n):i?i.value=n:e.set(t,n),n},iGt=function(t,e,n,r){if(n==="a"&&!r)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!r:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return n==="m"?r:n==="a"?r.call(t):r?r.value:e.get(t)},wT;function wae(t){return t instanceof Ab||t instanceof qR||t instanceof XR}class _ae{constructor(){wT.set(this,void 0),c0e(this,wT,!1,"f")}setModified(){c0e(this,wT,!0,"f")}get modifiedFlag(){return iGt(this,wT,"f")}}wT=new WeakMap;class b1 extends _ae{getNodeDepths(e,n,r){r.set(e,n);for(const i of e.children)this.getNodeDepths(i,n+1,r);return r}optimize(e){const r=[...this.getNodeDepths(e,0,new Map).entries()].sort((i,o)=>o[1]-i[1]);for(const i of r)this.run(i[0]);return this.modifiedFlag}}class Sae extends _ae{optimize(e){this.run(e);for(const n of e.children)this.optimize(n);return this.modifiedFlag}}class oGt extends Sae{mergeNodes(e,n){const r=n.shift();for(const i of n)e.removeChild(i),i.parent=r,i.remove()}run(e){const n=e.children.map(i=>i.hash()),r={};for(let i=0;i1&&(this.setModified(),this.mergeNodes(e,r[i]))}}class sGt extends Sae{constructor(e){super(),this.requiresSelectionId=e&&gae(e)}run(e){e instanceof vy&&(this.requiresSelectionId&&(wae(e.parent)||e.parent instanceof $f||e.parent instanceof Xs)||(this.setModified(),e.remove()))}}class aGt extends _ae{optimize(e){return this.run(e,new Set),this.modifiedFlag}run(e,n){let r=new Set;e instanceof mh&&(r=e.producedFields(),hse(r,n)&&(this.setModified(),e.removeFormulas(n),e.producedFields.length===0&&e.remove()));for(const i of e.children)this.run(i,new Set([...n,...r]))}}class lGt extends Sae{constructor(){super()}run(e){e instanceof pl&&!e.isRequired()&&(this.setModified(),e.remove())}}class cGt extends b1{run(e){if(!wae(e)&&!(e.numChildren()>1)){for(const n of e.children)if(n instanceof Xs)if(e instanceof Xs)this.setModified(),e.merge(n);else{if(pse(e.producedFields(),n.dependentFields()))continue;this.setModified(),n.swapWithParent()}}}}class uGt extends b1{run(e){const n=[...e.children],r=e.children.filter(i=>i instanceof Xs);if(e.numChildren()>1&&r.length>=1){const i={},o=new Set;for(const s of r){const a=s.parse;for(const l of Qe(a))l in i?i[l]!==a[l]&&o.add(l):i[l]=a[l]}for(const s of o)delete i[s];if(!Er(i)){this.setModified();const s=new Xs(e,i);for(const a of n){if(a instanceof Xs)for(const l of Qe(i))delete a.parse[l];e.removeChild(a),a.parent=s,a instanceof Xs&&Qe(a.parse).length===0&&a.remove()}}}}}class fGt extends b1{run(e){e instanceof pl||e.numChildren()>0||e instanceof $O||e instanceof Ab||(this.setModified(),e.remove())}}class dGt extends b1{run(e){const n=e.children.filter(i=>i instanceof mh),r=n.pop();for(const i of n)this.setModified(),r.merge(i)}}class hGt extends b1{run(e){const n=e.children.filter(i=>i instanceof $f),r={};for(const i of n){const o=Mn(i.groupBy);o in r||(r[o]=[]),r[o].push(i)}for(const i of Qe(r)){const o=r[i];if(o.length>1){const s=o.pop();for(const a of o)s.merge(a)&&(e.removeChild(a),a.parent=s,a.remove(),this.setModified())}}}}class pGt extends b1{constructor(e){super(),this.model=e}run(e){const n=!(wae(e)||e instanceof LO||e instanceof Xs||e instanceof vy),r=[],i=[];for(const o of e.children)o instanceof vh&&(n&&!pse(e.producedFields(),o.dependentFields())?r.push(o):i.push(o));if(r.length>0){const o=r.pop();for(const s of r)o.merge(s,this.model.renameSignal.bind(this.model));this.setModified(),e instanceof vh?e.merge(o,this.model.renameSignal.bind(this.model)):o.swapWithParent()}if(i.length>1){const o=i.pop();for(const s of i)o.merge(s,this.model.renameSignal.bind(this.model));this.setModified()}}}class gGt extends b1{run(e){const n=[...e.children];if(!QS(n,s=>s instanceof pl)||e.numChildren()<=1)return;const i=[];let o;for(const s of n)if(s instanceof pl){let a=s;for(;a.numChildren()===1;){const[l]=a.children;if(l instanceof pl)a=l;else break}i.push(...a.children),o?(e.removeChild(s),s.parent=o.parent,o.parent.removeChild(o),o.parent=a,this.setModified()):o=a}else i.push(s);if(i.length){this.setModified();for(const s of i)s.parent.removeChild(s),s.parent=o}}}class w1 extends _r{clone(){return new w1(null,Kt(this.transform))}constructor(e,n){super(e),this.transform=n}addDimensions(e){this.transform.groupby=Qd(this.transform.groupby.concat(e),n=>n)}dependentFields(){const e=new Set;return this.transform.groupby&&this.transform.groupby.forEach(e.add,e),this.transform.joinaggregate.map(n=>n.field).filter(n=>n!==void 0).forEach(e.add,e),e}producedFields(){return new Set(this.transform.joinaggregate.map(this.getDefaultName))}getDefaultName(e){return e.as??lt(e)}hash(){return`JoinAggregateTransform ${Mn(this.transform)}`}assemble(){const e=[],n=[],r=[];for(const o of this.transform.joinaggregate)n.push(o.op),r.push(this.getDefaultName(o)),e.push(o.field===void 0?null:o.field);const i=this.transform.groupby;return{type:"joinaggregate",as:r,ops:n,fields:e,...i!==void 0?{groupby:i}:{}}}}class uC extends _r{clone(){return new uC(null,{...this.filter})}constructor(e,n){super(e),this.filter=n}static make(e,n,r){const{config:i,markDef:o}=n,{marks:s,scales:a}=r;if(s==="include-invalid-values"&&a==="include-invalid-values")return null;const l=n.reduceFieldDef((c,u,f)=>{const d=Xh(f)&&n.getScaleComponent(f);if(d){const h=d.get("type"),{aggregate:p}=u,g=Wse({scaleChannel:f,markDef:o,config:i,scaleType:h,isCountAggregate:h6(p)});g!=="show"&&g!=="always-valid"&&(c[u.field]=u)}return c},{});return Qe(l).length?new uC(e,l):null}dependentFields(){return new Set(Qe(this.filter))}producedFields(){return new Set}hash(){return`FilterInvalid ${Mn(this.filter)}`}assemble(){const e=Qe(this.filter).reduce((n,r)=>{const i=this.filter[r],o=lt(i,{expr:"datum"});return i!==null&&(i.type==="temporal"?n.push(`(isDate(${o}) || (${KY(o)}))`):i.type==="quantitative"&&n.push(KY(o))),n},[]);return e.length>0?{type:"filter",expr:e.join(" && ")}:null}}function KY(t){return`isValid(${t}) && isFinite(+${t})`}function mGt(t){return t.stack.stackBy.reduce((e,n)=>{const r=n.fieldDef,i=lt(r);return i&&e.push(i),e},[])}function vGt(t){return We(t)&&t.every(e=>gt(e))&&t.length>1}class cg extends _r{clone(){return new cg(null,Kt(this._stack))}constructor(e,n){super(e),this._stack=n}static makeFromTransform(e,n){const{stack:r,groupby:i,as:o,offset:s="zero"}=n,a=[],l=[];if(n.sort!==void 0)for(const f of n.sort)a.push(f.field),l.push(qi(f.order,"ascending"));const c={field:a,order:l};let u;return vGt(o)?u=o:gt(o)?u=[o,`${o}_end`]:u=[`${n.stack}_start`,`${n.stack}_end`],new cg(e,{dimensionFieldDefs:[],stackField:r,groupby:i,offset:s,sort:c,facetby:[],as:u})}static makeFromEncoding(e,n){const r=n.stack,{encoding:i}=n;if(!r)return null;const{groupbyChannels:o,fieldChannel:s,offset:a,impute:l}=r,c=o.map(h=>{const p=i[h];return Xf(p)}).filter(h=>!!h),u=mGt(n),f=n.encoding.order;let d;if(We(f)||Je(f))d=Xje(f);else{const h=N4e(f)?f.sort:s==="y"?"descending":"ascending";d=u.reduce((p,g)=>(p.field.includes(g)||(p.field.push(g),p.order.push(h)),p),{field:[],order:[]})}return new cg(e,{dimensionFieldDefs:c,stackField:n.vgField(s),facetby:[],stackby:u,sort:d,offset:a,impute:l,as:[n.vgField(s,{suffix:"start",forAs:!0}),n.vgField(s,{suffix:"end",forAs:!0})]})}get stack(){return this._stack}addDimensions(e){this._stack.facetby.push(...e)}dependentFields(){const e=new Set;return e.add(this._stack.stackField),this.getGroupbyFields().forEach(e.add,e),this._stack.facetby.forEach(e.add,e),this._stack.sort.field.forEach(e.add,e),e}producedFields(){return new Set(this._stack.as)}hash(){return`Stack ${Mn(this._stack)}`}getGroupbyFields(){const{dimensionFieldDefs:e,impute:n,groupby:r}=this._stack;return e.length>0?e.map(i=>i.bin?n?[lt(i,{binSuffix:"mid"})]:[lt(i,{}),lt(i,{binSuffix:"end"})]:[lt(i)]).flat():r??[]}assemble(){const e=[],{facetby:n,dimensionFieldDefs:r,stackField:i,stackby:o,sort:s,offset:a,impute:l,as:c}=this._stack;if(l)for(const u of r){const{bandPosition:f=.5,bin:d}=u;if(d){const h=lt(u,{expr:"datum"}),p=lt(u,{expr:"datum",binSuffix:"end"});e.push({type:"formula",expr:`${KY(h)} ? ${f}*${h}+${1-f}*${p} : ${h}`,as:lt(u,{binSuffix:"mid",forAs:!0})})}e.push({type:"impute",field:i,groupby:[...o,...n],key:lt(u,{binSuffix:"mid"}),method:"value",value:0})}return e.push({type:"stack",groupby:[...this.getGroupbyFields(),...n],field:i,sort:s,as:c,offset:a}),e}}class FO extends _r{clone(){return new FO(null,Kt(this.transform))}constructor(e,n){super(e),this.transform=n}addDimensions(e){this.transform.groupby=Qd(this.transform.groupby.concat(e),n=>n)}dependentFields(){const e=new Set;return(this.transform.groupby??[]).forEach(e.add,e),(this.transform.sort??[]).forEach(n=>e.add(n.field)),this.transform.window.map(n=>n.field).filter(n=>n!==void 0).forEach(e.add,e),e}producedFields(){return new Set(this.transform.window.map(this.getDefaultName))}getDefaultName(e){return e.as??lt(e)}hash(){return`WindowTransform ${Mn(this.transform)}`}assemble(){const e=[],n=[],r=[],i=[];for(const f of this.transform.window)n.push(f.op),r.push(this.getDefaultName(f)),i.push(f.param===void 0?null:f.param),e.push(f.field===void 0?null:f.field);const o=this.transform.frame,s=this.transform.groupby;if(o&&o[0]===null&&o[1]===null&&n.every(f=>Cse(f)))return{type:"joinaggregate",as:r,ops:n,fields:e,...s!==void 0?{groupby:s}:{}};const a=[],l=[];if(this.transform.sort!==void 0)for(const f of this.transform.sort)a.push(f.field),l.push(f.order??"ascending");const c={field:a,order:l},u=this.transform.ignorePeers;return{type:"window",params:i,as:r,ops:n,fields:e,sort:c,...u!==void 0?{ignorePeers:u}:{},...s!==void 0?{groupby:s}:{},...o!==void 0?{frame:o}:{}}}}function yGt(t){function e(n){if(!(n instanceof $O)){const r=n.clone();if(r instanceof pl){const i=JY+r.getSource();r.setSource(i),t.model.component.data.outputNodes[i]=r}else(r instanceof $f||r instanceof cg||r instanceof FO||r instanceof w1)&&r.addDimensions(t.fields);for(const i of n.children.flatMap(e))i.parent=r;return[r]}return n.children.flatMap(e)}return e}function ZY(t){if(t instanceof $O)if(t.numChildren()===1&&!(t.children[0]instanceof pl)){const e=t.children[0];(e instanceof $f||e instanceof cg||e instanceof FO||e instanceof w1)&&e.addDimensions(t.fields),e.swapWithParent(),ZY(t)}else{const e=t.model.component.data.main;O6e(e);const n=yGt(t),r=t.children.map(n).flat();for(const i of r)i.parent=e}else t.children.map(ZY)}function O6e(t){if(t instanceof pl&&t.type===Fi.Main&&t.numChildren()===1){const e=t.children[0];e instanceof $O||(e.swapWithParent(),O6e(t))}}const JY="scale_",nL=5;function eQ(t){for(const e of t){for(const n of e.children)if(n.parent!==e)return!1;if(!eQ(e.children))return!1}return!0}function Yu(t,e){let n=!1;for(const r of e)n=t.optimize(r)||n;return n}function u0e(t,e,n){let r=t.sources,i=!1;return i=Yu(new lGt,r)||i,i=Yu(new sGt(e),r)||i,r=r.filter(o=>o.numChildren()>0),i=Yu(new fGt,r)||i,r=r.filter(o=>o.numChildren()>0),n||(i=Yu(new cGt,r)||i,i=Yu(new pGt(e),r)||i,i=Yu(new aGt,r)||i,i=Yu(new uGt,r)||i,i=Yu(new hGt,r)||i,i=Yu(new dGt,r)||i,i=Yu(new oGt,r)||i,i=Yu(new gGt,r)||i),t.sources=r,i}function xGt(t,e){eQ(t.sources);let n=0,r=0;for(let i=0;ie(n))}}function E6e(t){_i(t)?bGt(t):wGt(t)}function bGt(t){const e=t.component.scales;for(const n of Qe(e)){const r=SGt(t,n);if(e[n].setWithExplicit("domains",r),OGt(t,n),t.component.data.isFaceted){let o=t;for(;!pc(o)&&o.parent;)o=o.parent;if(o.component.resolve.scale[n]==="shared")for(const a of r.value)Yp(a)&&(a.data=JY+a.data.replace(JY,""))}}}function wGt(t){for(const n of t.children)E6e(n);const e=t.component.scales;for(const n of Qe(e)){let r,i=null;for(const o of t.children){const s=o.component.scales[n];if(s){r===void 0?r=s.getWithExplicit("domains"):r=gy(r,s.getWithExplicit("domains"),"domains","scale",tQ);const a=s.get("selectionExtent");i&&a&&i.param!==a.param&&Ze(vUt),i=a}}e[n].setWithExplicit("domains",r),i&&e[n].set("selectionExtent",i,!0)}}function _Gt(t,e,n,r){if(t==="unaggregated"){const{valid:i,reason:o}=f0e(e,n);if(!i){Ze(o);return}}else if(t===void 0&&r.useUnaggregatedDomain){const{valid:i}=f0e(e,n);if(i)return"unaggregated"}return t}function SGt(t,e){const n=t.getScaleComponent(e).get("type"),{encoding:r}=t,i=_Gt(t.scaleDomain(e),t.typedFieldDef(e),n,t.config.scale);return i!==t.scaleDomain(e)&&(t.specifiedScales[e]={...t.specifiedScales[e],domain:i}),e==="x"&&_o(r.x2)?_o(r.x)?gy(Rm(n,i,t,"x"),Rm(n,i,t,"x2"),"domain","scale",tQ):Rm(n,i,t,"x2"):e==="y"&&_o(r.y2)?_o(r.y)?gy(Rm(n,i,t,"y"),Rm(n,i,t,"y2"),"domain","scale",tQ):Rm(n,i,t,"y2"):Rm(n,i,t,e)}function CGt(t,e,n){return t.map(r=>({signal:`{data: ${E6(r,{timeUnit:n,type:e})}}`}))}function XV(t,e,n){var i;const r=(i=Uo(n))==null?void 0:i.unit;return e==="temporal"||r?CGt(t,e,r):[t]}function Rm(t,e,n,r){const{encoding:i,markDef:o,mark:s,config:a,stack:l}=n,c=_o(i[r]),{type:u}=c,f=c.timeUnit,d=y9t({invalid:Ah("invalid",o,a),isPath:Jy(s)});if(j8t(e)){const g=Rm(t,void 0,n,r),m=XV(e.unionWith,u,f);return Ad([...m,...g.value])}else{if(Mt(e))return Ad([e]);if(e&&e!=="unaggregated"&&!w4e(e))return Ad(XV(e,u,f))}if(l&&r===l.fieldChannel){if(l.offset==="normalize")return Wl([[0,1]]);const g=n.requestDataName(d);return Wl([{data:g,field:n.vgField(r,{suffix:"start"})},{data:g,field:n.vgField(r,{suffix:"end"})}])}const h=Xh(r)&&Je(c)?EGt(n,r,t):void 0;if(Yh(c)){const g=XV([c.datum],u,f);return Wl(g)}const p=c;if(e==="unaggregated"){const{field:g}=c;return Wl([{data:n.requestDataName(d),field:lt({field:g,aggregate:"min"})},{data:n.requestDataName(d),field:lt({field:g,aggregate:"max"})}])}else if(Gr(p.bin)){if(Wo(t))return Wl(t==="bin-ordinal"?[]:[{data:HA(h)?n.requestDataName(d):n.requestDataName(Fi.Raw),field:n.vgField(r,VR(p,r)?{binSuffix:"range"}:{}),sort:h===!0||!ht(h)?{field:n.vgField(r,{}),op:"min"}:h}]);{const{bin:g}=p;if(Gr(g)){const m=bae(n,p.field,g);return Wl([new Do(()=>{const v=n.getSignalName(m);return`[${v}.start, ${v}.stop]`})])}else return Wl([{data:n.requestDataName(d),field:n.vgField(r,{})}])}}else if(p.timeUnit&&En(["time","utc"],t)){const g=i[qh(r)];if(F4e(p,g,o,a)){const m=n.requestDataName(d),v=py({fieldDef:p,fieldDef2:g,markDef:o,config:a}),y=XA(s)&&v!==.5&&Xi(r);return Wl([{data:m,field:n.vgField(r,y?{suffix:R6}:{})},{data:m,field:n.vgField(r,{suffix:y?D6:"end"})}])}}return Wl(h?[{data:HA(h)?n.requestDataName(d):n.requestDataName(Fi.Raw),field:n.vgField(r),sort:h}]:[{data:n.requestDataName(d),field:n.vgField(r)}])}function YV(t,e){const{op:n,field:r,order:i}=t;return{op:n??(e?"sum":_6),...r?{field:Mu(r)}:{},...i?{order:i}:{}}}function OGt(t,e){var a;const n=t.component.scales[e],r=t.specifiedScales[e].domain,i=(a=t.fieldDef(e))==null?void 0:a.bin,o=w4e(r)?r:void 0,s=g1(i)&&p6(i.extent)?i.extent:void 0;(o||s)&&n.set("selectionExtent",o??s,!0)}function EGt(t,e,n){if(!Wo(n))return;const r=t.fieldDef(e),i=r.sort;if(L4e(i))return{op:"min",field:lC(r,e),order:"ascending"};const{stack:o}=t,s=o?new Set([...o.groupbyFields,...o.stackBy.map(a=>a.fieldDef.field)]):void 0;if(ag(i)){const a=o&&!s.has(i.field);return YV(i,a)}else if(yWt(i)){const{encoding:a,order:l}=i,c=t.fieldDef(a),{aggregate:u,field:f}=c,d=o&&!s.has(f);if(Lg(u)||Zy(u))return YV({field:lt(c),order:l},d);if(Cse(u)||!u)return YV({op:u,field:f,order:l},d)}else{if(i==="descending")return{op:"min",field:t.vgField(e),order:"descending"};if(En(["ascending",void 0],i))return!0}}function f0e(t,e){const{aggregate:n,type:r}=t;return n?gt(n)&&!eUt.has(n)?{valid:!1,reason:WUt(n)}:r==="quantitative"&&e==="log"?{valid:!1,reason:VUt(t)}:{valid:!0}:{valid:!1,reason:UUt(t)}}function tQ(t,e,n,r){return t.explicit&&e.explicit&&Ze(YUt(n,r,t.value,e.value)),{explicit:t.explicit,value:[...t.value,...e.value]}}function TGt(t){const e=Qd(t.map(s=>{if(Yp(s)){const{sort:a,...l}=s;return l}return s}),Mn),n=Qd(t.map(s=>{if(Yp(s)){const a=s.sort;return a!==void 0&&!HA(a)&&("op"in a&&a.op==="count"&&delete a.field,a.order==="ascending"&&delete a.order),a}}).filter(s=>s!==void 0),Mn);if(e.length===0)return;if(e.length===1){const s=t[0];if(Yp(s)&&n.length>0){let a=n[0];if(n.length>1){Ze(xye);const l=n.filter(c=>ht(c)&&"op"in c&&c.op!=="min");n.every(c=>ht(c)&&"op"in c)&&l.length===1?a=l[0]:a=!0}else if(ht(a)&&"field"in a){const l=a.field;s.field===l&&(a=a.order?{order:a.order}:!0)}return{...s,sort:a}}return s}const r=Qd(n.map(s=>HA(s)||!("op"in s)||gt(s.op)&&vt(Q6t,s.op)?s:(Ze(KUt(s)),!0)),Mn);let i;r.length===1?i=r[0]:r.length>1&&(Ze(xye),i=!0);const o=Qd(t.map(s=>Yp(s)?s.data:null),s=>s);return o.length===1&&o[0]!==null?{data:o[0],fields:e.map(a=>a.field),...i?{sort:i}:{}}:{fields:e,...i?{sort:i}:{}}}function Cae(t){if(Yp(t)&>(t.field))return t.field;if(tUt(t)){let e;for(const n of t.fields)if(Yp(n)&>(n.field)){if(!e)e=n.field;else if(e!==n.field)return Ze(ZUt),e}return Ze(JUt),e}else if(nUt(t)){Ze(e8t);const e=t.fields[0];return gt(e)?e:void 0}}function N6(t,e){const r=t.component.scales[e].get("domains").map(i=>(Yp(i)&&(i.data=t.lookupDataSource(i.data)),i));return TGt(r)}function T6e(t){return NO(t)||Oae(t)?t.children.reduce((e,n)=>e.concat(T6e(n)),d0e(t)):d0e(t)}function d0e(t){return Qe(t.component.scales).reduce((e,n)=>{const r=t.component.scales[n];if(r.merged)return e;const i=r.combine(),{name:o,type:s,selectionExtent:a,domains:l,range:c,reverse:u,...f}=i,d=kGt(i.range,o,n,t),h=N6(t,n),p=a?C9t(t,a,r,h):null;return e.push({name:o,type:s,...h?{domain:h}:{},...p?{domainRaw:p}:{},range:d,...u!==void 0?{reverse:u}:{},...f}),e},[])}function kGt(t,e,n,r){if(Xi(n)){if(m1(t))return{step:{signal:`${e}_step`}}}else if(ht(t)&&Yp(t))return{...t,data:r.lookupDataSource(t.data)};return t}class k6e extends tm{constructor(e,n){super({},{name:e}),this.merged=!1,this.setWithExplicit("type",n)}domainHasZero(){const e=this.get("type");if(En([os.LOG,os.TIME,os.UTC],e))return"definitely-not";const n=this.get("zero");if(n===!0||n===void 0&&En([os.LINEAR,os.SQRT,os.POW],e))return"definitely";const r=this.get("domains");if(r.length>0){let i=!1,o=!1,s=!1;for(const a of r){if(We(a)){const l=a[0],c=a[a.length-1];if(Jn(l)&&Jn(c))if(l<=0&&c>=0){i=!0;continue}else{o=!0;continue}}s=!0}if(i)return"definitely";if(o&&!s)return"definitely-not"}return"maybe"}}const AGt=["range","scheme"];function PGt(t){const e=t.component.scales;for(const n of Sse){const r=e[n];if(!r)continue;const i=MGt(n,t);r.setWithExplicit("range",i)}}function h0e(t,e){const n=t.fieldDef(e);if(n!=null&&n.bin){const{bin:r,field:i}=n,o=Ol(e),s=t.getName(o);if(ht(r)&&r.binned&&r.step!==void 0)return new Do(()=>{const a=t.scaleName(e),l=`(domain("${a}")[1] - domain("${a}")[0]) / ${r.step}`;return`${t.getSignalName(s)} / (${l})`});if(Gr(r)){const a=bae(t,i,r);return new Do(()=>{const l=t.getSignalName(a),c=`(${l}.stop - ${l}.start) / ${l}.step`;return`${t.getSignalName(s)} / (${c})`})}}}function MGt(t,e){const n=e.specifiedScales[t],{size:r}=e,o=e.getScaleComponent(t).get("type");for(const f of AGt)if(n[f]!==void 0){const d=FY(o,f),h=_4e(t,f);if(!d)Ze(t4e(o,f,t));else if(h)Ze(h);else switch(f){case"range":{const p=n.range;if(We(p)){if(Xi(t))return Ad(p.map(g=>{if(g==="width"||g==="height"){const m=e.getName(g),v=e.getSignalName.bind(e);return Do.fromName(v,m)}return g}))}else if(ht(p))return Ad({data:e.requestDataName(Fi.Main),field:p.field,sort:{op:"min",field:e.vgField(t)}});return Ad(p)}case"scheme":return Ad(RGt(n[f]))}}const s=t===yi||t==="xOffset"?"width":"height",a=r[s];if(Mh(a)){if(Xi(t))if(Wo(o)){const f=P6e(a,e,t);if(f)return Ad({step:f})}else Ze(n4e(s));else if(FR(t)){const f=t===qy?"x":"y";if(e.getScaleComponent(f).get("type")==="band"){const p=M6e(a,o);if(p)return Ad(p)}}}const{rangeMin:l,rangeMax:c}=n,u=DGt(t,e);return(l!==void 0||c!==void 0)&&FY(o,"rangeMin")&&We(u)&&u.length===2?Ad([l??u[0],c??u[1]]):Wl(u)}function RGt(t){return z8t(t)?{scheme:t.name,...hl(t,["name"])}:{scheme:t}}function A6e(t,e,n,{center:r}={}){const i=Ol(t),o=e.getName(i),s=e.getSignalName.bind(e);return t===Yo&&Hf(n)?r?[Do.fromName(a=>`${s(a)}/2`,o),Do.fromName(a=>`-${s(a)}/2`,o)]:[Do.fromName(s,o),0]:r?[Do.fromName(a=>`-${s(a)}/2`,o),Do.fromName(a=>`${s(a)}/2`,o)]:[0,Do.fromName(s,o)]}function DGt(t,e){const{size:n,config:r,mark:i,encoding:o}=e,{type:s}=_o(o[t]),l=e.getScaleComponent(t).get("type"),{domain:c,domainMid:u}=e.specifiedScales[t];switch(t){case yi:case Yo:{if(En(["point","band"],l)){const f=R6e(t,n,r.view);if(Mh(f))return{step:P6e(f,e,t)}}return A6e(t,e,l)}case qy:case RO:return IGt(t,e,l);case Kg:{const f=FGt(i,r),d=NGt(i,n,e,r);return tC(l)?$Gt(f,d,LGt(l,r,c,t)):[f,d]}case ju:return[0,Math.PI*2];case h1:return[0,360];case od:return[0,new Do(()=>{const f=e.getSignalName(pc(e.parent)?"child_width":"width"),d=e.getSignalName(pc(e.parent)?"child_height":"height");return`min(${f},${d})/2`})];case Qy:return[r.scale.minStrokeWidth,r.scale.maxStrokeWidth];case Ky:return[[1,0],[4,2],[2,1],[1,1],[1,2,4,2]];case Cl:return"symbol";case Sl:case Gh:case Hh:return l==="ordinal"?s==="nominal"?"category":"ordinal":u!==void 0?"diverging":i==="rect"||i==="geoshape"?"heatmap":"ramp";case Zg:case Xy:case Yy:return[r.scale.minOpacity,r.scale.maxOpacity]}}function P6e(t,e,n){const{encoding:r}=e,i=e.getScaleComponent(n),o=xse(n),s=r[o];if(gBe({step:t,offsetIsDiscrete:en(s)&&m4e(s.type)})==="offset"&&Y4e(r,o)){const l=e.getScaleComponent(o);let u=`domain('${e.scaleName(o)}').length`;if(l.get("type")==="band"){const d=l.get("paddingInner")??l.get("padding")??0,h=l.get("paddingOuter")??l.get("padding")??0;u=`bandspace(${u}, ${d}, ${h})`}const f=i.get("paddingInner")??i.get("padding");return{signal:`${t.step} * ${u} / (1-${sUt(f)})`}}else return t.step}function M6e(t,e){if(gBe({step:t,offsetIsDiscrete:Wo(e)})==="offset")return{step:t.step}}function IGt(t,e,n){const r=t===qy?"x":"y",i=e.getScaleComponent(r);if(!i)return A6e(r,e,n,{center:!0});const o=i.get("type"),s=e.scaleName(r),{markDef:a,config:l}=e;if(o==="band"){const c=R6e(r,e.size,e.config.view);if(Mh(c)){const u=M6e(c,n);if(u)return u}return[0,{signal:`bandwidth('${s}')`}]}else{const c=e.encoding[r];if(Je(c)&&c.timeUnit){const u=d4e(c.timeUnit,p=>`scale('${s}', ${p})`),f=e.config.scale.bandWithNestedOffsetPaddingInner,d=py({fieldDef:c,markDef:a,config:l})-.5,h=d!==0?` + ${d}`:"";if(f){const p=Mt(f)?`${f.signal}/2`+h:`${f/2+d}`,g=Mt(f)?`(1 - ${f.signal}/2)`+h:`${1-f/2+d}`;return[{signal:`${p} * (${u})`},{signal:`${g} * (${u})`}]}return[0,{signal:u}]}return Sje(`Cannot use ${t} scale if ${r} scale is not discrete.`)}}function R6e(t,e,n){const r=t===yi?"width":"height",i=e[r];return i||F5(n,r)}function LGt(t,e,n,r){switch(t){case"quantile":return e.scale.quantileCount;case"quantize":return e.scale.quantizeCount;case"threshold":return n!==void 0&&We(n)?n.length+1:(Ze(c8t(r)),3)}}function $Gt(t,e,n){const r=()=>{const i=Tf(e),o=Tf(t),s=`(${i} - ${o}) / (${n} - 1)`;return`sequence(${o}, ${i} + ${s}, ${s})`};return Mt(e)?new Do(r):{signal:r()}}function FGt(t,e){switch(t){case"bar":case"tick":return e.scale.minBandSize;case"line":case"trail":case"rule":return e.scale.minStrokeWidth;case"text":return e.scale.minFontSize;case"point":case"square":case"circle":return e.scale.minSize}throw new Error(g6("size",t))}const p0e=.95;function NGt(t,e,n,r){const i={x:h0e(n,"x"),y:h0e(n,"y")};switch(t){case"bar":case"tick":{if(r.scale.maxBandSize!==void 0)return r.scale.maxBandSize;const o=g0e(e,i,r.view);return Jn(o)?o-1:new Do(()=>`${o.signal} - 1`)}case"line":case"trail":case"rule":return r.scale.maxStrokeWidth;case"text":return r.scale.maxFontSize;case"point":case"square":case"circle":{if(r.scale.maxSize)return r.scale.maxSize;const o=g0e(e,i,r.view);return Jn(o)?Math.pow(p0e*o,2):new Do(()=>`pow(${p0e} * ${o.signal}, 2)`)}}throw new Error(g6("size",t))}function g0e(t,e,n){const r=Mh(t.width)?t.width.step:BY(n,"width"),i=Mh(t.height)?t.height.step:BY(n,"height");return e.x||e.y?new Do(()=>`min(${[e.x?e.x.signal:r,e.y?e.y.signal:i].join(", ")})`):Math.min(r,i)}function D6e(t,e){_i(t)?zGt(t,e):L6e(t,e)}function zGt(t,e){const n=t.component.scales,{config:r,encoding:i,markDef:o,specifiedScales:s}=t;for(const a of Qe(n)){const l=s[a],c=n[a],u=t.getScaleComponent(a),f=_o(i[a]),d=l[e],h=u.get("type"),p=u.get("padding"),g=u.get("paddingInner"),m=FY(h,e),v=_4e(a,e);if(d!==void 0&&(m?v&&Ze(v):Ze(t4e(h,e,a))),m&&v===void 0)if(d!==void 0){const y=f.timeUnit,x=f.type;switch(e){case"domainMax":case"domainMin":v1(l[e])||x==="temporal"||y?c.set(e,{signal:E6(l[e],{type:x,timeUnit:y})},!0):c.set(e,l[e],!0);break;default:c.copyKeyFromObject(e,l)}}else{const y=Ke(m0e,e)?m0e[e]({model:t,channel:a,fieldOrDatumDef:f,scaleType:h,scalePadding:p,scalePaddingInner:g,domain:l.domain,domainMin:l.domainMin,domainMax:l.domainMax,markDef:o,config:r,hasNestedOffsetScale:Q4e(i,a),hasSecondaryRangeChannel:!!i[qh(a)]}):r.scale[e];y!==void 0&&c.set(e,y,!1)}}}const m0e={bins:({model:t,fieldOrDatumDef:e})=>Je(e)?jGt(t,e):void 0,interpolate:({channel:t,fieldOrDatumDef:e})=>BGt(t,e.type),nice:({scaleType:t,channel:e,domain:n,domainMin:r,domainMax:i,fieldOrDatumDef:o})=>UGt(t,e,n,r,i,o),padding:({channel:t,scaleType:e,fieldOrDatumDef:n,markDef:r,config:i})=>WGt(t,e,i.scale,n,r,i.bar),paddingInner:({scalePadding:t,channel:e,markDef:n,scaleType:r,config:i,hasNestedOffsetScale:o})=>VGt(t,e,n.type,r,i.scale,o),paddingOuter:({scalePadding:t,channel:e,scaleType:n,scalePaddingInner:r,config:i,hasNestedOffsetScale:o})=>GGt(t,e,n,r,i.scale,o),reverse:({fieldOrDatumDef:t,scaleType:e,channel:n,config:r})=>{const i=Je(t)?t.sort:void 0;return HGt(e,i,n,r.scale)},zero:({channel:t,fieldOrDatumDef:e,domain:n,markDef:r,scaleType:i,config:o,hasSecondaryRangeChannel:s})=>qGt(t,e,n,r,i,o.scale,s)};function I6e(t){_i(t)?PGt(t):L6e(t,"range")}function L6e(t,e){const n=t.component.scales;for(const r of t.children)e==="range"?I6e(r):D6e(r,e);for(const r of Qe(n)){let i;for(const o of t.children){const s=o.component.scales[r];if(s){const a=s.getWithExplicit(e);i=gy(i,a,e,"scale",kBe((l,c)=>{switch(e){case"range":return l.step&&c.step?l.step-c.step:0}return 0}))}}n[r].setWithExplicit(e,i)}}function jGt(t,e){const n=e.bin;if(Gr(n)){const r=bae(t,e.field,n);return new Do(()=>t.getSignalName(r))}else if(ns(n)&&g1(n)&&n.step!==void 0)return{step:n.step}}function BGt(t,e){if(En([Sl,Gh,Hh],t)&&e!=="nominal")return"hcl"}function UGt(t,e,n,r,i,o){var s;if(!((s=Xf(o))!=null&&s.bin||We(n)||i!=null||r!=null||En([os.TIME,os.UTC],t)))return Xi(e)?!0:void 0}function WGt(t,e,n,r,i,o){if(Xi(t)){if(Kd(e)){if(n.continuousPadding!==void 0)return n.continuousPadding;const{type:s,orient:a}=i;if(s==="bar"&&!(Je(r)&&(r.bin||r.timeUnit))&&(a==="vertical"&&t==="x"||a==="horizontal"&&t==="y"))return o.continuousBandSize}if(e===os.POINT)return n.pointPadding}}function VGt(t,e,n,r,i,o=!1){if(t===void 0){if(Xi(e)){const{bandPaddingInner:s,barBandPaddingInner:a,rectBandPaddingInner:l,tickBandPaddingInner:c,bandWithNestedOffsetPaddingInner:u}=i;return o?u:qi(s,n==="bar"?a:n==="tick"?c:l)}else if(FR(e)&&r===os.BAND)return i.offsetBandPaddingInner}}function GGt(t,e,n,r,i,o=!1){if(t===void 0){if(Xi(e)){const{bandPaddingOuter:s,bandWithNestedOffsetPaddingOuter:a}=i;if(o)return a;if(n===os.BAND)return qi(s,Mt(r)?{signal:`${r.signal}/2`}:r/2)}else if(FR(e)){if(n===os.POINT)return .5;if(n===os.BAND)return i.offsetBandPaddingOuter}}}function HGt(t,e,n,r){if(n==="x"&&r.xReverse!==void 0)return Hf(t)&&e==="descending"?Mt(r.xReverse)?{signal:`!${r.xReverse.signal}`}:!r.xReverse:r.xReverse;if(Hf(t)&&e==="descending")return!0}function qGt(t,e,n,r,i,o,s){if(!!n&&n!=="unaggregated"&&Hf(i)){if(We(n)){const l=n[0],c=n[n.length-1];if(Jn(l)&&l<=0&&Jn(c)&&c>=0)return!0}return!1}if(t==="size"&&e.type==="quantitative"&&!tC(i))return!0;if(!(Je(e)&&e.bin)&&En([...Jg,...U6t],t)){const{orient:l,type:c}=r;return En(["bar","area","line","trail"],c)&&(l==="horizontal"&&t==="y"||l==="vertical"&&t==="x")?!1:En(["bar","area"],c)&&!s?!0:o==null?void 0:o.zero}return!1}function XGt(t,e,n,r,i=!1){const o=YGt(e,n,r,i),{type:s}=t;return Xh(e)?s!==void 0?H8t(e,s)?Je(n)&&!G8t(s,n.type)?(Ze(qUt(s,o)),o):s:(Ze(HUt(e,s,o)),o):o:null}function YGt(t,e,n,r){var i;switch(e.type){case"nominal":case"ordinal":{if(N_(t)||zV(t)==="discrete")return t==="shape"&&e.type==="ordinal"&&Ze(jV(t,"ordinal")),"ordinal";if(Xi(t)||FR(t)){if(En(["rect","bar","image","rule","tick"],n.type)||r)return"band"}else if(n.type==="arc"&&t in _se)return"band";const o=n[Ol(t)];return Ob(o)||rC(e)&&((i=e.axis)!=null&&i.tickBand)?"band":"point"}case"temporal":return N_(t)?"time":zV(t)==="discrete"?(Ze(jV(t,"temporal")),"ordinal"):Je(e)&&e.timeUnit&&Uo(e.timeUnit).utc?"utc":"time";case"quantitative":return N_(t)?Je(e)&&Gr(e.bin)?"bin-ordinal":"linear":zV(t)==="discrete"?(Ze(jV(t,"quantitative")),"ordinal"):"linear";case"geojson":return}throw new Error(Jje(e.type))}function QGt(t,{ignoreRange:e}={}){$6e(t),E6e(t);for(const n of V8t)D6e(t,n);e||I6e(t)}function $6e(t){_i(t)?t.component.scales=KGt(t):t.component.scales=JGt(t)}function KGt(t){const{encoding:e,mark:n,markDef:r}=t,i={};for(const o of Sse){const s=_o(e[o]);if(s&&n===O4e&&o===Cl&&s.type===DO)continue;let a=s&&s.scale;if(s&&a!==null&&a!==!1){a??(a={});const l=Q4e(e,o),c=XGt(a,o,s,r,l);i[o]=new k6e(t.scaleName(`${o}`,!0),{value:c,explicit:a.type===c})}}return i}const ZGt=kBe((t,e)=>wye(t)-wye(e));function JGt(t){var e;const n=t.component.scales={},r={},i=t.component.resolve;for(const o of t.children){$6e(o);for(const s of Qe(o.component.scales))if((e=i.scale)[s]??(e[s]=h6e(s,t)),i.scale[s]==="shared"){const a=r[s],l=o.component.scales[s].getWithExplicit("type");a?I8t(a.value,l.value)?r[s]=gy(a,l,"type","scale",ZGt):(i.scale[s]="independent",delete r[s]):r[s]=l}}for(const o of Qe(r)){const s=t.scaleName(o,!0),a=r[o];n[o]=new k6e(s,a);for(const l of t.children){const c=l.component.scales[o];c&&(l.renameScale(c.get("name"),s),c.merged=!0)}}return n}class QV{constructor(){this.nameMap={}}rename(e,n){this.nameMap[e]=n}has(e){return this.nameMap[e]!==void 0}get(e){for(;this.nameMap[e]&&e!==this.nameMap[e];)e=this.nameMap[e];return e}}function _i(t){return(t==null?void 0:t.type)==="unit"}function pc(t){return(t==null?void 0:t.type)==="facet"}function Oae(t){return(t==null?void 0:t.type)==="concat"}function NO(t){return(t==null?void 0:t.type)==="layer"}class Eae{constructor(e,n,r,i,o,s,a){this.type=n,this.parent=r,this.config=o,this.correctDataNames=l=>{var c,u,f;return(c=l.from)!=null&&c.data&&(l.from.data=this.lookupDataSource(l.from.data)),(f=(u=l.from)==null?void 0:u.facet)!=null&&f.data&&(l.from.facet.data=this.lookupDataSource(l.from.facet.data)),l},this.parent=r,this.config=o,this.view=is(a),this.name=e.name??i,this.title=Ym(e.title)?{text:e.title}:e.title?is(e.title):void 0,this.scaleNameMap=r?r.scaleNameMap:new QV,this.projectionNameMap=r?r.projectionNameMap:new QV,this.signalNameMap=r?r.signalNameMap:new QV,this.data=e.data,this.description=e.description,this.transforms=s9t(e.transform??[]),this.layout=n==="layer"||n==="unit"?{}:uVt(e,n,o),this.component={data:{sources:r?r.component.data.sources:[],outputNodes:r?r.component.data.outputNodes:{},outputNodeRefCounts:r?r.component.data.outputNodeRefCounts:{},isFaceted:S6(e)||(r==null?void 0:r.component.data.isFaceted)&&e.data===void 0},layoutSize:new tm,layoutHeaders:{row:{},column:{},facet:{}},mark:null,resolve:{scale:{},axis:{},legend:{},...s?Kt(s):{}},selection:null,scales:null,projection:null,axes:{},legends:{}}}get width(){return this.getSizeSignalRef("width")}get height(){return this.getSizeSignalRef("height")}parse(){this.parseScale(),this.parseLayoutSize(),this.renameTopLevelLayoutSizeSignal(),this.parseSelections(),this.parseProjection(),this.parseData(),this.parseAxesAndHeaders(),this.parseLegends(),this.parseMarkGroup()}parseScale(){QGt(this)}parseProjection(){S6e(this)}renameTopLevelLayoutSizeSignal(){this.getName("width")!=="width"&&this.renameSignal(this.getName("width"),"width"),this.getName("height")!=="height"&&this.renameSignal(this.getName("height"),"height")}parseLegends(){y6e(this)}assembleEncodeFromView(e){const{style:n,...r}=e,i={};for(const o of Qe(r)){const s=r[o];s!==void 0&&(i[o]=Jr(s))}return i}assembleGroupEncodeEntry(e){let n={};return this.view&&(n=this.assembleEncodeFromView(this.view)),!e&&(this.description&&(n.description=Jr(this.description)),this.type==="unit"||this.type==="layer")?{width:this.getSizeSignalRef("width"),height:this.getSizeSignalRef("height"),...n}:Er(n)?void 0:n}assembleLayout(){if(!this.layout)return;const{spacing:e,...n}=this.layout,{component:r,config:i}=this,o=x7t(r.layoutHeaders,i);return{padding:e,...this.assembleDefaultLayout(),...n,...o?{titleBand:o}:{}}}assembleDefaultLayout(){return{}}assembleHeaderMarks(){const{layoutHeaders:e}=this.component;let n=[];for(const r of au)e[r].title&&n.push(h7t(this,r));for(const r of mae)n=n.concat(p7t(this,r));return n}assembleAxes(){return e7t(this.component.axes,this.config)}assembleLegends(){return b6e(this)}assembleProjections(){return U7t(this)}assembleTitle(){const{encoding:e,...n}=this.title??{},r={...Vje(this.config.title).nonMarkTitleProperties,...n,...e?{encode:{update:e}}:{}};if(r.text)return En(["unit","layer"],this.type)?En(["middle",void 0],r.anchor)&&(r.frame??(r.frame="group")):r.anchor??(r.anchor="start"),Er(r)?void 0:r}assembleGroup(e=[]){const n={};e=e.concat(this.assembleSignals()),e.length>0&&(n.signals=e);const r=this.assembleLayout();r&&(n.layout=r),n.marks=[].concat(this.assembleHeaderMarks(),this.assembleMarks());const i=!this.parent||pc(this.parent)?T6e(this):[];i.length>0&&(n.scales=i);const o=this.assembleAxes();o.length>0&&(n.axes=o);const s=this.assembleLegends();return s.length>0&&(n.legends=s),n}getName(e){return pi((this.name?`${this.name}_`:"")+e)}getDataName(e){return this.getName(Fi[e].toLowerCase())}requestDataName(e){const n=this.getDataName(e),r=this.component.data.outputNodeRefCounts;return r[n]=(r[n]||0)+1,n}getSizeSignalRef(e){if(pc(this.parent)){const n=f6e(e),r=d6(n),i=this.component.scales[r];if(i&&!i.merged){const o=i.get("type"),s=i.get("range");if(Wo(o)&&m1(s)){const a=i.get("name"),l=N6(this,r),c=Cae(l);if(c){const u=lt({aggregate:"distinct",field:c},{expr:"datum"});return{signal:u6e(a,i,u)}}else return Ze(Ese(r)),null}}}return{signal:this.signalNameMap.get(this.getName(e))}}lookupDataSource(e){const n=this.component.data.outputNodes[e];return n?n.getSource():e}getSignalName(e){return this.signalNameMap.get(e)}renameSignal(e,n){this.signalNameMap.rename(e,n)}renameScale(e,n){this.scaleNameMap.rename(e,n)}renameProjection(e,n){this.projectionNameMap.rename(e,n)}scaleName(e,n){if(n)return this.getName(e);if($je(e)&&Xh(e)&&this.component.scales[e]||this.scaleNameMap.has(this.getName(e)))return this.scaleNameMap.get(this.getName(e))}projectionName(e){if(e)return this.getName("projection");if(this.component.projection&&!this.component.projection.merged||this.projectionNameMap.has(this.getName("projection")))return this.projectionNameMap.get(this.getName("projection"))}getScaleComponent(e){if(!this.component.scales)throw new Error("getScaleComponent cannot be called before parseScale(). Make sure you have called parseScale or use parseUnitModelWithScale().");const n=this.component.scales[e];return n&&!n.merged?n:this.parent?this.parent.getScaleComponent(e):void 0}getScaleType(e){const n=this.getScaleComponent(e);return n?n.get("type"):void 0}getSelectionComponent(e,n){let r=this.component.selection[e];if(!r&&this.parent&&(r=this.parent.getSelectionComponent(e,n)),!r)throw new Error(fUt(n));return r}hasAxisOrientSignalRef(){var e,n;return((e=this.component.axes.x)==null?void 0:e.some(r=>r.hasOrientSignalRef()))||((n=this.component.axes.y)==null?void 0:n.some(r=>r.hasOrientSignalRef()))}}class F6e extends Eae{vgField(e,n={}){const r=this.fieldDef(e);if(r)return lt(r,n)}reduceFieldDef(e,n){return zWt(this.getMapping(),(r,i,o)=>{const s=Xf(i);return s?e(r,s,o):r},n)}forEachFieldDef(e,n){Zse(this.getMapping(),(r,i)=>{const o=Xf(r);o&&e(o,i)},n)}}class z6 extends _r{clone(){return new z6(null,Kt(this.transform))}constructor(e,n){super(e),this.transform=n,this.transform=Kt(n);const r=this.transform.as??[void 0,void 0];this.transform.as=[r[0]??"value",r[1]??"density"];const i=this.transform.resolve??"shared";this.transform.resolve=i}dependentFields(){return new Set([this.transform.density,...this.transform.groupby??[]])}producedFields(){return new Set(this.transform.as)}hash(){return`DensityTransform ${Mn(this.transform)}`}assemble(){const{density:e,...n}=this.transform,r={type:"kde",field:e,...n};return r.resolve=this.transform.resolve,r}}class j6 extends _r{clone(){return new j6(null,Kt(this.transform))}constructor(e,n){super(e),this.transform=n,this.transform=Kt(n)}dependentFields(){return new Set([this.transform.extent])}producedFields(){return new Set([])}hash(){return`ExtentTransform ${Mn(this.transform)}`}assemble(){const{extent:e,param:n}=this.transform;return{type:"extent",field:e,signal:n}}}class B6 extends _r{clone(){return new B6(this.parent,Kt(this.transform))}constructor(e,n){super(e),this.transform=n,this.transform=Kt(n);const{flatten:r,as:i=[]}=this.transform;this.transform.as=r.map((o,s)=>i[s]??o)}dependentFields(){return new Set(this.transform.flatten)}producedFields(){return new Set(this.transform.as)}hash(){return`FlattenTransform ${Mn(this.transform)}`}assemble(){const{flatten:e,as:n}=this.transform;return{type:"flatten",fields:e,as:n}}}class U6 extends _r{clone(){return new U6(null,Kt(this.transform))}constructor(e,n){super(e),this.transform=n,this.transform=Kt(n);const r=this.transform.as??[void 0,void 0];this.transform.as=[r[0]??"key",r[1]??"value"]}dependentFields(){return new Set(this.transform.fold)}producedFields(){return new Set(this.transform.as)}hash(){return`FoldTransform ${Mn(this.transform)}`}assemble(){const{fold:e,as:n}=this.transform;return{type:"fold",fields:e,as:n}}}class B_ extends _r{clone(){return new B_(null,Kt(this.fields),this.geojson,this.signal)}static parseAll(e,n){if(n.component.projection&&!n.component.projection.isFit)return e;let r=0;for(const i of[[ad,sd],[Ru,ld]]){const o=i.map(s=>{const a=_o(n.encoding[s]);return Je(a)?a.field:Yh(a)?{expr:`${a.datum}`}:qf(a)?{expr:`${a.value}`}:void 0});(o[0]||o[1])&&(e=new B_(e,o,null,n.getName(`geojson_${r++}`)))}if(n.channelHasField(Cl)){const i=n.typedFieldDef(Cl);i.type===DO&&(e=new B_(e,null,i.field,n.getName(`geojson_${r++}`)))}return e}constructor(e,n,r,i){super(e),this.fields=n,this.geojson=r,this.signal=i}dependentFields(){const e=(this.fields??[]).filter(gt);return new Set([...this.geojson?[this.geojson]:[],...e])}producedFields(){return new Set}hash(){return`GeoJSON ${this.geojson} ${this.signal} ${Mn(this.fields)}`}assemble(){return[...this.geojson?[{type:"filter",expr:`isValid(datum["${this.geojson}"])`}]:[],{type:"geojson",...this.fields?{fields:this.fields}:{},...this.geojson?{geojson:this.geojson}:{},signal:this.signal}]}}class QA extends _r{clone(){return new QA(null,this.projection,Kt(this.fields),Kt(this.as))}constructor(e,n,r,i){super(e),this.projection=n,this.fields=r,this.as=i}static parseAll(e,n){if(!n.projectionName())return e;for(const r of[[ad,sd],[Ru,ld]]){const i=r.map(s=>{const a=_o(n.encoding[s]);return Je(a)?a.field:Yh(a)?{expr:`${a.datum}`}:qf(a)?{expr:`${a.value}`}:void 0}),o=r[0]===Ru?"2":"";(i[0]||i[1])&&(e=new QA(e,n.projectionName(),i,[n.getName(`x${o}`),n.getName(`y${o}`)]))}return e}dependentFields(){return new Set(this.fields.filter(gt))}producedFields(){return new Set(this.as)}hash(){return`Geopoint ${this.projection} ${Mn(this.fields)} ${Mn(this.as)}`}assemble(){return{type:"geopoint",projection:this.projection,fields:this.fields,as:this.as}}}class Wx extends _r{clone(){return new Wx(null,Kt(this.transform))}constructor(e,n){super(e),this.transform=n}dependentFields(){return new Set([this.transform.impute,this.transform.key,...this.transform.groupby??[]])}producedFields(){return new Set([this.transform.impute])}processSequence(e){const{start:n=0,stop:r,step:i}=e;return{signal:`sequence(${[n,r,...i?[i]:[]].join(",")})`}}static makeFromTransform(e,n){return new Wx(e,n)}static makeFromEncoding(e,n){const r=n.encoding,i=r.x,o=r.y;if(Je(i)&&Je(o)){const s=i.impute?i:o.impute?o:void 0;if(s===void 0)return;const a=i.impute?o:o.impute?i:void 0,{method:l,value:c,frame:u,keyvals:f}=s.impute,d=J4e(n.mark,r);return new Wx(e,{impute:s.field,key:a.field,...l?{method:l}:{},...c!==void 0?{value:c}:{},...u?{frame:u}:{},...f!==void 0?{keyvals:f}:{},...d.length?{groupby:d}:{}})}return null}hash(){return`Impute ${Mn(this.transform)}`}assemble(){const{impute:e,key:n,keyvals:r,method:i,groupby:o,value:s,frame:a=[null,null]}=this.transform,l={type:"impute",field:e,key:n,...r?{keyvals:BVt(r)?this.processSequence(r):r}:{},method:"value",...o?{groupby:o}:{},value:!i||i==="value"?s:null};if(i&&i!=="value"){const c={type:"window",as:[`imputed_${e}_value`],ops:[i],fields:[e],frame:a,ignorePeers:!1,...o?{groupby:o}:{}},u={type:"formula",expr:`datum.${e} === null ? datum.imputed_${e}_value : datum.${e}`,as:e};return[l,c,u]}else return[l]}}class W6 extends _r{clone(){return new W6(null,Kt(this.transform))}constructor(e,n){super(e),this.transform=n,this.transform=Kt(n);const r=this.transform.as??[void 0,void 0];this.transform.as=[r[0]??n.on,r[1]??n.loess]}dependentFields(){return new Set([this.transform.loess,this.transform.on,...this.transform.groupby??[]])}producedFields(){return new Set(this.transform.as)}hash(){return`LoessTransform ${Mn(this.transform)}`}assemble(){const{loess:e,on:n,...r}=this.transform;return{type:"loess",x:n,y:e,...r}}}class KA extends _r{clone(){return new KA(null,Kt(this.transform),this.secondary)}constructor(e,n,r){super(e),this.transform=n,this.secondary=r}static make(e,n,r,i){const o=n.component.data.sources,{from:s}=r;let a=null;if(UVt(s)){let l=j6e(s.data,o);l||(l=new Ab(s.data),o.push(l));const c=n.getName(`lookup_${i}`);a=new pl(l,c,Fi.Lookup,n.component.data.outputNodeRefCounts),n.component.data.outputNodes[c]=a}else if(WVt(s)){const l=s.param;r={as:l,...r};let c;try{c=n.getSelectionComponent(pi(l),l)}catch{throw new Error(gUt(l))}if(a=c.materialized,!a)throw new Error(mUt(l))}return new KA(e,r,a.getSource())}dependentFields(){return new Set([this.transform.lookup])}producedFields(){return new Set(this.transform.as?pt(this.transform.as):this.transform.from.fields)}hash(){return`Lookup ${Mn({transform:this.transform,secondary:this.secondary})}`}assemble(){let e;if(this.transform.from.fields)e={values:this.transform.from.fields,...this.transform.as?{as:pt(this.transform.as)}:{}};else{let n=this.transform.as;gt(n)||(Ze(CUt),n="_lookup"),e={as:[n]}}return{type:"lookup",from:this.secondary,key:this.transform.from.key,fields:[this.transform.lookup],...e,...this.transform.default?{default:this.transform.default}:{}}}}class V6 extends _r{clone(){return new V6(null,Kt(this.transform))}constructor(e,n){super(e),this.transform=n,this.transform=Kt(n);const r=this.transform.as??[void 0,void 0];this.transform.as=[r[0]??"prob",r[1]??"value"]}dependentFields(){return new Set([this.transform.quantile,...this.transform.groupby??[]])}producedFields(){return new Set(this.transform.as)}hash(){return`QuantileTransform ${Mn(this.transform)}`}assemble(){const{quantile:e,...n}=this.transform;return{type:"quantile",field:e,...n}}}class G6 extends _r{clone(){return new G6(null,Kt(this.transform))}constructor(e,n){super(e),this.transform=n,this.transform=Kt(n);const r=this.transform.as??[void 0,void 0];this.transform.as=[r[0]??n.on,r[1]??n.regression]}dependentFields(){return new Set([this.transform.regression,this.transform.on,...this.transform.groupby??[]])}producedFields(){return new Set(this.transform.as)}hash(){return`RegressionTransform ${Mn(this.transform)}`}assemble(){const{regression:e,on:n,...r}=this.transform;return{type:"regression",x:n,y:e,...r}}}class H6 extends _r{clone(){return new H6(null,Kt(this.transform))}constructor(e,n){super(e),this.transform=n}addDimensions(e){this.transform.groupby=Qd((this.transform.groupby??[]).concat(e),n=>n)}producedFields(){}dependentFields(){return new Set([this.transform.pivot,this.transform.value,...this.transform.groupby??[]])}hash(){return`PivotTransform ${Mn(this.transform)}`}assemble(){const{pivot:e,value:n,groupby:r,limit:i,op:o}=this.transform;return{type:"pivot",field:e,value:n,...i!==void 0?{limit:i}:{},...o!==void 0?{op:o}:{},...r!==void 0?{groupby:r}:{}}}}class q6 extends _r{clone(){return new q6(null,Kt(this.transform))}constructor(e,n){super(e),this.transform=n}dependentFields(){return new Set}producedFields(){return new Set}hash(){return`SampleTransform ${Mn(this.transform)}`}assemble(){return{type:"sample",size:this.transform.sample}}}function N6e(t){let e=0;function n(r,i){if(r instanceof Ab&&!r.isGenerator&&!oC(r.data)&&(t.push(i),i={name:null,source:i.name,transform:[]}),r instanceof Xs&&(r.parent instanceof Ab&&!i.source?(i.format={...i.format,parse:r.assembleFormatParse()},i.transform.push(...r.assembleTransforms(!0))):i.transform.push(...r.assembleTransforms())),r instanceof $O){i.name||(i.name=`data_${e++}`),!i.source||i.transform.length>0?(t.push(i),r.data=i.name):r.data=i.source,t.push(...r.assemble());return}switch((r instanceof qR||r instanceof XR||r instanceof uC||r instanceof LO||r instanceof aC||r instanceof QA||r instanceof $f||r instanceof KA||r instanceof FO||r instanceof w1||r instanceof U6||r instanceof B6||r instanceof z6||r instanceof W6||r instanceof V6||r instanceof G6||r instanceof vy||r instanceof q6||r instanceof H6||r instanceof j6)&&i.transform.push(r.assemble()),(r instanceof vh||r instanceof mh||r instanceof Wx||r instanceof cg||r instanceof B_)&&i.transform.push(...r.assemble()),r instanceof pl&&(i.source&&i.transform.length===0?r.setSource(i.source):r.parent instanceof pl?r.setSource(i.name):(i.name||(i.name=`data_${e++}`),r.setSource(i.name),r.numChildren()===1&&(t.push(i),i={name:null,source:i.name,transform:[]}))),r.numChildren()){case 0:r instanceof pl&&(!i.source||i.transform.length>0)&&t.push(i);break;case 1:n(r.children[0],i);break;default:{i.name||(i.name=`data_${e++}`);let o=i.name;!i.source||i.transform.length>0?t.push(i):o=i.source;for(const s of r.children)n(s,{name:null,source:o,transform:[]});break}}}return n}function eHt(t){const e=[],n=N6e(e);for(const r of t.children)n(r,{source:t.name,name:null,transform:[]});return e}function tHt(t,e){const n=[],r=N6e(n);let i=0;for(const s of t.sources){s.hasName()||(s.dataName=`source_${i++}`);const a=s.assemble();r(s,a)}for(const s of n)s.transform.length===0&&delete s.transform;let o=0;for(const[s,a]of n.entries())(a.transform??[]).length===0&&!a.source&&n.splice(o++,0,n.splice(s,1)[0]);for(const s of n)for(const a of s.transform??[])a.type==="lookup"&&(a.from=t.outputNodes[a.from].getSource());for(const s of n)s.name in e&&(s.values=e[s.name]);return n}function nHt(t){return t==="top"||t==="left"||Mt(t)?"header":"footer"}function rHt(t){for(const e of au)iHt(t,e);v0e(t,"x"),v0e(t,"y")}function iHt(t,e){var s;const{facet:n,config:r,child:i,component:o}=t;if(t.channelHasField(e)){const a=n[e],l=cC("title",null,r,e);let c=z_(a,r,{allowDisabling:!0,includeDefault:l===void 0||!!l});i.component.layoutHeaders[e].title&&(c=We(c)?c.join(", "):c,c+=` / ${i.component.layoutHeaders[e].title}`,i.component.layoutHeaders[e].title=null);const u=cC("labelOrient",a.header,r,e),f=a.header!==null?qi((s=a.header)==null?void 0:s.labels,r.header.labels,!0):!1,d=En(["bottom","right"],u)?"footer":"header";o.layoutHeaders[e]={title:a.header!==null?c:null,facetFieldDef:a,[d]:e==="facet"?[]:[z6e(t,e,f)]}}}function z6e(t,e,n){const r=e==="row"?"height":"width";return{labels:n,sizeSignal:t.child.component.layoutSize.get(r)?t.child.getSizeSignalRef(r):void 0,axes:[]}}function v0e(t,e){const{child:n}=t;if(n.component.axes[e]){const{layoutHeaders:r,resolve:i}=t.component;if(i.axis[e]=xae(i,e),i.axis[e]==="shared"){const o=e==="x"?"column":"row",s=r[o];for(const a of n.component.axes[e]){const l=nHt(a.get("orient"));s[l]??(s[l]=[z6e(t,o,!1)]);const c=bT(a,"main",t.config,{header:!0});c&&s[l][0].axes.push(c),a.mainExtracted=!0}}}}function oHt(t){Tae(t),B5(t,"width"),B5(t,"height")}function sHt(t){Tae(t);const e=t.layout.columns===1?"width":"childWidth",n=t.layout.columns===void 0?"height":"childHeight";B5(t,e),B5(t,n)}function Tae(t){for(const e of t.children)e.parseLayoutSize()}function B5(t,e){const n=f6e(e),r=d6(n),i=t.component.resolve,o=t.component.layoutSize;let s;for(const a of t.children){const l=a.component.layoutSize.getWithExplicit(n),c=i.scale[r]??h6e(r,t);if(c==="independent"&&l.value==="step"){s=void 0;break}if(s){if(c==="independent"&&s.value!==l.value){s=void 0;break}s=gy(s,l,n,"")}else s=l}if(s){for(const a of t.children)t.renameSignal(a.getName(n),t.getName(e)),a.component.layoutSize.set(n,"merged",!1);o.setWithExplicit(e,s)}else o.setWithExplicit(e,{explicit:!1,value:void 0})}function aHt(t){const{size:e,component:n}=t;for(const r of Jg){const i=Ol(r);if(e[i]){const o=e[i];n.layoutSize.set(i,Mh(o)?"step":o,!0)}else{const o=lHt(t,i);n.layoutSize.set(i,o,!1)}}}function lHt(t,e){const n=e==="width"?"x":"y",r=t.config,i=t.getScaleComponent(n);if(i){const o=i.get("type"),s=i.get("range");if(Wo(o)){const a=F5(r.view,e);return m1(s)||Mh(a)?"step":a}else return jY(r.view,e)}else{if(t.hasProjection||t.mark==="arc")return jY(r.view,e);{const o=F5(r.view,e);return Mh(o)?o.step:o}}}function nQ(t,e,n){return lt(e,{suffix:`by_${lt(t)}`,...n})}class vk extends F6e{constructor(e,n,r,i){super(e,"facet",n,r,i,e.resolve),this.child=Rae(e.spec,this,this.getName("child"),void 0,i),this.children=[this.child],this.facet=this.initFacet(e.facet)}initFacet(e){if(!BR(e))return{facet:this.initFacetFieldDef(e,"facet")};const n=Qe(e),r={};for(const i of n){if(![og,sg].includes(i)){Ze(g6(i,"facet"));break}const o=e[i];if(o.field===void 0){Ze(LY(o,i));break}r[i]=this.initFacetFieldDef(o,i)}return r}initFacetFieldDef(e,n){const r=Kse(e,n);return r.header?r.header=is(r.header):r.header===null&&(r.header=null),r}channelHasField(e){return Ke(this.facet,e)}fieldDef(e){return this.facet[e]}parseData(){this.component.data=X6(this),this.child.parseData()}parseLayoutSize(){Tae(this)}parseSelections(){this.child.parseSelections(),this.component.selection=this.child.component.selection}parseMarkGroup(){this.child.parseMarkGroup()}parseAxesAndHeaders(){this.child.parseAxesAndHeaders(),rHt(this)}assembleSelectionTopLevelSignals(e){return this.child.assembleSelectionTopLevelSignals(e)}assembleSignals(){return this.child.assembleSignals(),[]}assembleSelectionData(e){return this.child.assembleSelectionData(e)}getHeaderLayoutMixins(){const e={};for(const n of au)for(const r of vae){const i=this.component.layoutHeaders[n],o=i[r],{facetFieldDef:s}=i;if(s){const a=cC("titleOrient",s.header,this.config,n);if(["right","bottom"].includes(a)){const l=$6(n,a);e.titleAnchor??(e.titleAnchor={}),e.titleAnchor[l]="end"}}if(o!=null&&o[0]){const a=n==="row"?"height":"width",l=r==="header"?"headerBand":"footerBand";n!=="facet"&&!this.child.component.layoutSize.get(a)&&(e[l]??(e[l]={}),e[l][n]=.5),i.title&&(e.offset??(e.offset={}),e.offset[n==="row"?"rowTitle":"columnTitle"]=10)}}return e}assembleDefaultLayout(){const{column:e,row:n}=this.facet,r=e?this.columnDistinctSignal():n?1:void 0;let i="all";return(!n&&this.component.resolve.scale.x==="independent"||!e&&this.component.resolve.scale.y==="independent")&&(i="none"),{...this.getHeaderLayoutMixins(),...r?{columns:r}:{},bounds:"full",align:i}}assembleLayoutSignals(){return this.child.assembleLayoutSignals()}columnDistinctSignal(){if(!(this.parent&&this.parent instanceof vk))return{signal:`length(data('${this.getName("column_domain")}'))`}}assembleGroupStyle(){}assembleGroup(e){return this.parent&&this.parent instanceof vk?{...this.channelHasField("column")?{encode:{update:{columns:{field:lt(this.facet.column,{prefix:"distinct"})}}}}:{},...super.assembleGroup(e)}:super.assembleGroup(e)}getCardinalityAggregateForChild(){const e=[],n=[],r=[];if(this.child instanceof vk){if(this.child.channelHasField("column")){const i=lt(this.child.facet.column);e.push(i),n.push("distinct"),r.push(`distinct_${i}`)}}else for(const i of Jg){const o=this.child.component.scales[i];if(o&&!o.merged){const s=o.get("type"),a=o.get("range");if(Wo(s)&&m1(a)){const l=N6(this.child,i),c=Cae(l);c?(e.push(c),n.push("distinct"),r.push(`distinct_${c}`)):Ze(Ese(i))}}}return{fields:e,ops:n,as:r}}assembleFacet(){const{name:e,data:n}=this.component.data.facetRoot,{row:r,column:i}=this.facet,{fields:o,ops:s,as:a}=this.getCardinalityAggregateForChild(),l=[];for(const u of au){const f=this.facet[u];if(f){l.push(lt(f));const{bin:d,sort:h}=f;if(Gr(d)&&l.push(lt(f,{binSuffix:"end"})),ag(h)){const{field:p,op:g=_6}=h,m=nQ(f,h);r&&i?(o.push(m),s.push("max"),a.push(m)):(o.push(p),s.push(g),a.push(m))}else if(We(h)){const p=lC(f,u);o.push(p),s.push("max"),a.push(p)}}}const c=!!r&&!!i;return{name:e,data:n,groupby:l,...c||o.length>0?{aggregate:{...c?{cross:c}:{},...o.length?{fields:o,ops:s,as:a}:{}}}:{}}}facetSortFields(e){const{facet:n}=this,r=n[e];return r?ag(r.sort)?[nQ(r,r.sort,{expr:"datum"})]:We(r.sort)?[lC(r,e,{expr:"datum"})]:[lt(r,{expr:"datum"})]:[]}facetSortOrder(e){const{facet:n}=this,r=n[e];if(r){const{sort:i}=r;return[(ag(i)?i.order:!We(i)&&i)||"ascending"]}return[]}assembleLabelTitle(){var i;const{facet:e,config:n}=this;if(e.facet)return YY(e.facet,"facet",n);const r={row:["top","bottom"],column:["left","right"]};for(const o of mae)if(e[o]){const s=cC("labelOrient",(i=e[o])==null?void 0:i.header,n,o);if(r[o].includes(s))return YY(e[o],o,n)}}assembleMarks(){const{child:e}=this,n=this.component.data.facetRoot,r=eHt(n),i=e.assembleGroupEncodeEntry(!1),o=this.assembleLabelTitle()||e.assembleTitle(),s=e.assembleGroupStyle();return[{name:this.getName("cell"),type:"group",...o?{title:o}:{},...s?{style:s}:{},from:{facet:this.assembleFacet()},sort:{field:au.map(l=>this.facetSortFields(l)).flat(),order:au.map(l=>this.facetSortOrder(l)).flat()},...r.length>0?{data:r}:{},...i?{encode:{update:i}}:{},...e.assembleGroup(b9t(this,[]))}]}getMapping(){return this.facet}}function cHt(t,e){const{row:n,column:r}=e;if(n&&r){let i=null;for(const o of[n,r])if(ag(o.sort)){const{field:s,op:a=_6}=o.sort;t=i=new w1(t,{joinaggregate:[{op:a,field:s,as:nQ(o,o.sort,{forAs:!0})}],groupby:[lt(o)]})}return i}return null}function j6e(t,e){var n,r,i,o;for(const s of e){const a=s.data;if(t.name&&s.hasName()&&t.name!==s.dataName)continue;const l=(n=t.format)==null?void 0:n.mesh,c=(r=a.format)==null?void 0:r.feature;if(l&&c)continue;const u=(i=t.format)==null?void 0:i.feature;if((u||c)&&u!==c)continue;const f=(o=a.format)==null?void 0:o.mesh;if(!((l||f)&&l!==f)){if(YA(t)&&YA(a)){if(oc(t.values,a.values))return s}else if(oC(t)&&oC(a)){if(t.url===a.url)return s}else if(ABe(t)&&t.name===s.dataName)return s}}return null}function uHt(t,e){if(t.data||!t.parent){if(t.data===null){const r=new Ab({values:[]});return e.push(r),r}const n=j6e(t.data,e);if(n)return Uv(t.data)||(n.data.format=Cje({},t.data.format,n.data.format)),!n.hasName()&&t.data.name&&(n.dataName=t.data.name),n;{const r=new Ab(t.data);return e.push(r),r}}else return t.parent.component.data.facetRoot?t.parent.component.data.facetRoot:t.parent.component.data.main}function fHt(t,e,n){let r=0;for(const i of e.transforms){let o,s;if(JVt(i))s=t=new aC(t,i),o="derived";else if(cae(i)){const a=tGt(i);s=t=Xs.makeWithAncestors(t,{},a,n)??t,t=new LO(t,e,i.filter)}else if(CBe(i))s=t=vh.makeFromTransform(t,i,e),o="number";else if(t9t(i))o="date",n.getWithExplicit(i.field).value===void 0&&(t=new Xs(t,{[i.field]:o}),n.set(i.field,o,!1)),s=t=mh.makeFromTransform(t,i);else if(n9t(i))s=t=$f.makeFromTransform(t,i),o="number",gae(e)&&(t=new vy(t));else if(SBe(i))s=t=KA.make(t,e,i,r++),o="derived";else if(QVt(i))s=t=new FO(t,i),o="number";else if(KVt(i))s=t=new w1(t,i),o="number";else if(r9t(i))s=t=cg.makeFromTransform(t,i),o="derived";else if(i9t(i))s=t=new U6(t,i),o="derived";else if(o9t(i))s=t=new j6(t,i),o="derived";else if(ZVt(i))s=t=new B6(t,i),o="derived";else if(VVt(i))s=t=new H6(t,i),o="derived";else if(YVt(i))t=new q6(t,i);else if(e9t(i))s=t=Wx.makeFromTransform(t,i),o="derived";else if(GVt(i))s=t=new z6(t,i),o="derived";else if(HVt(i))s=t=new V6(t,i),o="derived";else if(qVt(i))s=t=new G6(t,i),o="derived";else if(XVt(i))s=t=new W6(t,i),o="derived";else{Ze(SUt(i));continue}if(s&&o!==void 0)for(const a of s.producedFields()??[])n.set(a,o,!1)}return t}function X6(t){var m;let e=uHt(t,t.component.data.sources);const{outputNodes:n,outputNodeRefCounts:r}=t.component.data,i=t.data,s=!(i&&(Uv(i)||oC(i)||YA(i)))&&t.parent?t.parent.component.data.ancestorParse.clone():new v9t;Uv(i)?(PBe(i)?e=new XR(e,i.sequence):uae(i)&&(e=new qR(e,i.graticule)),s.parseNothing=!0):((m=i==null?void 0:i.format)==null?void 0:m.parse)===null&&(s.parseNothing=!0),e=Xs.makeExplicit(e,t,s)??e,e=new vy(e);const a=t.parent&&NO(t.parent);(_i(t)||pc(t))&&a&&(e=vh.makeFromEncoding(e,t)??e),t.transforms.length>0&&(e=fHt(e,t,s));const l=rGt(t),c=nGt(t);e=Xs.makeWithAncestors(e,{},{...l,...c},s)??e,_i(t)&&(e=B_.parseAll(e,t),e=QA.parseAll(e,t)),(_i(t)||pc(t))&&(a||(e=vh.makeFromEncoding(e,t)??e),e=mh.makeFromEncoding(e,t)??e,e=aC.parseAllForSortIndex(e,t));const u=e=rL(Fi.Raw,t,e);if(_i(t)){const v=$f.makeFromEncoding(e,t);v&&(e=v,gae(t)&&(e=new vy(e))),e=Wx.makeFromEncoding(e,t)??e,e=cg.makeFromEncoding(e,t)??e}let f,d;if(_i(t)){const{markDef:v,mark:y,config:x}=t,b=Or("invalid",v,x),{marks:w,scales:_}=d=RBe({invalid:b,isPath:Jy(y)});w!==_&&_==="include-invalid-values"&&(f=e=rL(Fi.PreFilterInvalid,t,e)),w==="exclude-invalid-values"&&(e=uC.make(e,t,d)??e)}const h=e=rL(Fi.Main,t,e);let p;if(_i(t)&&d){const{marks:v,scales:y}=d;v==="include-invalid-values"&&y==="exclude-invalid-values"&&(e=uC.make(e,t,d)??e,p=e=rL(Fi.PostFilterInvalid,t,e))}_i(t)&&Z9t(t,h);let g=null;if(pc(t)){const v=t.getName("facet");e=cHt(e,t.facet)??e,g=new $O(e,t,v,h.getSource()),n[v]=g}return{...t.component.data,outputNodes:n,outputNodeRefCounts:r,raw:u,main:h,facetRoot:g,ancestorParse:s,preFilterInvalid:f,postFilterInvalid:p}}function rL(t,e,n){const{outputNodes:r,outputNodeRefCounts:i}=e.component.data,o=e.getDataName(t),s=new pl(n,o,t,i);return r[o]=s,s}class dHt extends Eae{constructor(e,n,r,i){var o,s,a,l;super(e,"concat",n,r,i,e.resolve),(((s=(o=e.resolve)==null?void 0:o.axis)==null?void 0:s.x)==="shared"||((l=(a=e.resolve)==null?void 0:a.axis)==null?void 0:l.y)==="shared")&&Ze(bUt),this.children=this.getChildren(e).map((c,u)=>Rae(c,this,this.getName(`concat_${u}`),void 0,i))}parseData(){this.component.data=X6(this);for(const e of this.children)e.parseData()}parseSelections(){this.component.selection={};for(const e of this.children){e.parseSelections();for(const n of Qe(e.component.selection))this.component.selection[n]=e.component.selection[n]}}parseMarkGroup(){for(const e of this.children)e.parseMarkGroup()}parseAxesAndHeaders(){for(const e of this.children)e.parseAxesAndHeaders()}getChildren(e){return A6(e)?e.vconcat:aae(e)?e.hconcat:e.concat}parseLayoutSize(){sHt(this)}parseAxisGroup(){return null}assembleSelectionTopLevelSignals(e){return this.children.reduce((n,r)=>r.assembleSelectionTopLevelSignals(n),e)}assembleSignals(){return this.children.forEach(e=>e.assembleSignals()),[]}assembleLayoutSignals(){const e=yae(this);for(const n of this.children)e.push(...n.assembleLayoutSignals());return e}assembleSelectionData(e){return this.children.reduce((n,r)=>r.assembleSelectionData(n),e)}assembleMarks(){return this.children.map(e=>{const n=e.assembleTitle(),r=e.assembleGroupStyle(),i=e.assembleGroupEncodeEntry(!1);return{type:"group",name:e.getName("group"),...n?{title:n}:{},...r?{style:r}:{},...i?{encode:{update:i}}:{},...e.assembleGroup()}})}assembleGroupStyle(){}assembleDefaultLayout(){const e=this.layout.columns;return{...e!=null?{columns:e}:{},bounds:"full",align:"each"}}}function hHt(t){return t===!1||t===null}const pHt={disable:1,gridScale:1,scale:1,...q4e,labelExpr:1,encode:1},B6e=Qe(pHt);class kae extends tm{constructor(e={},n={},r=!1){super(),this.explicit=e,this.implicit=n,this.mainExtracted=r}clone(){return new kae(Kt(this.explicit),Kt(this.implicit),this.mainExtracted)}hasAxisPart(e){return e==="axis"?!0:e==="grid"||e==="title"?!!this.get(e):!hHt(this.get(e))}hasOrientSignalRef(){return Mt(this.explicit.orient)}}function gHt(t,e,n){const{encoding:r,config:i}=t,o=_o(r[e])??_o(r[qh(e)]),s=t.axis(e)||{},{format:a,formatType:l}=s;if(Eb(l))return{text:kf({fieldOrDatumDef:o,field:"datum.value",format:a,formatType:l,config:i}),...n};if(a===void 0&&l===void 0&&i.customFormatTypes){if(nC(o)==="quantitative"){if(rC(o)&&o.stack==="normalize"&&i.normalizedNumberFormatType)return{text:kf({fieldOrDatumDef:o,field:"datum.value",format:i.normalizedNumberFormat,formatType:i.normalizedNumberFormatType,config:i}),...n};if(i.numberFormatType)return{text:kf({fieldOrDatumDef:o,field:"datum.value",format:i.numberFormat,formatType:i.numberFormatType,config:i}),...n}}if(nC(o)==="temporal"&&i.timeFormatType&&Je(o)&&!o.timeUnit)return{text:kf({fieldOrDatumDef:o,field:"datum.value",format:i.timeFormat,formatType:i.timeFormatType,config:i}),...n}}return n}function mHt(t){return Jg.reduce((e,n)=>(t.component.scales[n]&&(e[n]=[SHt(n,t)]),e),{})}const vHt={bottom:"top",top:"bottom",left:"right",right:"left"};function yHt(t){const{axes:e,resolve:n}=t.component,r={top:0,bottom:0,right:0,left:0};for(const i of t.children){i.parseAxesAndHeaders();for(const o of Qe(i.component.axes))n.axis[o]=xae(t.component.resolve,o),n.axis[o]==="shared"&&(e[o]=xHt(e[o],i.component.axes[o]),e[o]||(n.axis[o]="independent",delete e[o]))}for(const i of Jg){for(const o of t.children)if(o.component.axes[i]){if(n.axis[i]==="independent"){e[i]=(e[i]??[]).concat(o.component.axes[i]);for(const s of o.component.axes[i]){const{value:a,explicit:l}=s.getWithExplicit("orient");if(!Mt(a)){if(r[a]>0&&!l){const c=vHt[a];r[a]>r[c]&&s.set("orient",c,!1)}r[a]++}}}delete o.component.axes[i]}if(n.axis[i]==="independent"&&e[i]&&e[i].length>1)for(const[o,s]of(e[i]||[]).entries())o>0&&s.get("grid")&&!s.explicit.grid&&(s.implicit.grid=!1)}}function xHt(t,e){if(t){if(t.length!==e.length)return;const n=t.length;for(let r=0;rn.clone());return t}function bHt(t,e){for(const n of B6e){const r=gy(t.getWithExplicit(n),e.getWithExplicit(n),n,"axis",(i,o)=>{switch(n){case"title":return Kje(i,o);case"gridScale":return{explicit:i.explicit,value:qi(i.value,o.value)}}return M6(i,o,n,"axis")});t.setWithExplicit(n,r)}return t}function wHt(t,e,n,r,i){if(e==="disable")return n!==void 0;switch(n=n||{},e){case"titleAngle":case"labelAngle":return t===(Mt(n.labelAngle)?n.labelAngle:qA(n.labelAngle));case"values":return!!n.values;case"encode":return!!n.encoding||!!n.labelAngle;case"title":if(t===s6e(r,i))return!0}return t===n[e]}const _Ht=new Set(["grid","translate","format","formatType","orient","labelExpr","tickCount","position","tickMinStep"]);function SHt(t,e){var v,y;let n=e.axis(t);const r=new kae,i=_o(e.encoding[t]),{mark:o,config:s}=e,a=(n==null?void 0:n.orient)||((v=s[t==="x"?"axisX":"axisY"])==null?void 0:v.orient)||((y=s.axis)==null?void 0:y.orient)||l7t(t),l=e.getScaleComponent(t).get("type"),c=t7t(t,l,a,e.config),u=n!==void 0?!n:qY("disable",s.style,n==null?void 0:n.style,c).configValue;if(r.set("disable",u,n!==void 0),u)return r;n=n||{};const f=o7t(i,n,t,s.style,c),d=D4e(n.formatType,i,l),h=R4e(i,i.type,n.format,n.formatType,s,!0),p={fieldOrDatumDef:i,axis:n,channel:t,model:e,scaleType:l,orient:a,labelAngle:f,format:h,formatType:d,mark:o,config:s};for(const x of B6e){const b=x in n0e?n0e[x](p):kye(x)?n[x]:void 0,w=b!==void 0,_=wHt(b,x,n,e,t);if(w&&_)r.set(x,b,_);else{const{configValue:S=void 0,configFrom:O=void 0}=kye(x)&&x!=="values"?qY(x,s.style,n.style,c):{},k=S!==void 0;w&&!k?r.set(x,b,_):(O!=="vgAxisConfig"||_Ht.has(x)&&k||GR(S)||Mt(S))&&r.set(x,S,!1)}}const g=n.encoding??{},m=H4e.reduce((x,b)=>{if(!r.hasAxisPart(b))return x;const w=d6e(g[b]??{},e),_=b==="labels"?gHt(e,t,w):w;return _!==void 0&&!Er(_)&&(x[b]={update:_}),x},{});return Er(m)||r.set("encode",m,!!n.encoding||n.labelAngle!==void 0),r}function CHt({encoding:t,size:e}){for(const n of Jg){const r=Ol(n);Mh(e[r])&&xv(t[n])&&(delete e[r],Ze(n4e(r)))}return e}const OHt={vgMark:"arc",encodeEntry:t=>({...Bu(t,{align:"ignore",baseline:"ignore",color:"include",size:"ignore",orient:"ignore",theta:"ignore"}),..._a("x",t,{defaultPos:"mid"}),..._a("y",t,{defaultPos:"mid"}),...$g(t,"radius"),...$g(t,"theta")})},EHt={vgMark:"area",encodeEntry:t=>({...Bu(t,{align:"ignore",baseline:"ignore",color:"include",orient:"include",size:"ignore",theta:"ignore"}),...N5("x",t,{defaultPos:"zeroOrMin",defaultPos2:"zeroOrMin",range:t.markDef.orient==="horizontal"}),...N5("y",t,{defaultPos:"zeroOrMin",defaultPos2:"zeroOrMin",range:t.markDef.orient==="vertical"}),...pae(t)})},THt={vgMark:"rect",encodeEntry:t=>({...Bu(t,{align:"ignore",baseline:"ignore",color:"include",orient:"ignore",size:"ignore",theta:"ignore"}),...$g(t,"x"),...$g(t,"y")})},kHt={vgMark:"shape",encodeEntry:t=>({...Bu(t,{align:"ignore",baseline:"ignore",color:"include",size:"ignore",orient:"ignore",theta:"ignore"})}),postEncodingTransform:t=>{const{encoding:e}=t,n=e.shape;return[{type:"geoshape",projection:t.projectionName(),...n&&Je(n)&&n.type===DO?{field:lt(n,{expr:"datum"})}:{}}]}},AHt={vgMark:"image",encodeEntry:t=>({...Bu(t,{align:"ignore",baseline:"ignore",color:"ignore",orient:"ignore",size:"ignore",theta:"ignore"}),...$g(t,"x"),...$g(t,"y"),...dae(t,"url")})},PHt={vgMark:"line",encodeEntry:t=>({...Bu(t,{align:"ignore",baseline:"ignore",color:"include",size:"ignore",orient:"ignore",theta:"ignore"}),..._a("x",t,{defaultPos:"mid"}),..._a("y",t,{defaultPos:"mid"}),...cs("size",t,{vgChannel:"strokeWidth"}),...pae(t)})},MHt={vgMark:"trail",encodeEntry:t=>({...Bu(t,{align:"ignore",baseline:"ignore",color:"include",size:"include",orient:"ignore",theta:"ignore"}),..._a("x",t,{defaultPos:"mid"}),..._a("y",t,{defaultPos:"mid"}),...cs("size",t),...pae(t)})};function Aae(t,e){const{config:n}=t;return{...Bu(t,{align:"ignore",baseline:"ignore",color:"include",size:"include",orient:"ignore",theta:"ignore"}),..._a("x",t,{defaultPos:"mid"}),..._a("y",t,{defaultPos:"mid"}),...cs("size",t),...cs("angle",t),...RHt(t,n,e)}}function RHt(t,e,n){return n?{shape:{value:n}}:cs("shape",t)}const DHt={vgMark:"symbol",encodeEntry:t=>Aae(t)},IHt={vgMark:"symbol",encodeEntry:t=>Aae(t,"circle")},LHt={vgMark:"symbol",encodeEntry:t=>Aae(t,"square")},$Ht={vgMark:"rect",encodeEntry:t=>({...Bu(t,{align:"ignore",baseline:"ignore",color:"include",orient:"ignore",size:"ignore",theta:"ignore"}),...$g(t,"x"),...$g(t,"y")})},FHt={vgMark:"rule",encodeEntry:t=>{const{markDef:e}=t,n=e.orient;return!t.encoding.x&&!t.encoding.y&&!t.encoding.latitude&&!t.encoding.longitude?{}:{...Bu(t,{align:"ignore",baseline:"ignore",color:"include",orient:"ignore",size:"ignore",theta:"ignore"}),...N5("x",t,{defaultPos:n==="horizontal"?"zeroOrMax":"mid",defaultPos2:"zeroOrMin",range:n!=="vertical"}),...N5("y",t,{defaultPos:n==="vertical"?"zeroOrMax":"mid",defaultPos2:"zeroOrMin",range:n!=="horizontal"}),...cs("size",t,{vgChannel:"strokeWidth"})}}},NHt={vgMark:"text",encodeEntry:t=>{const{config:e,encoding:n}=t;return{...Bu(t,{align:"include",baseline:"include",color:"include",size:"ignore",orient:"ignore",theta:"include"}),..._a("x",t,{defaultPos:"mid"}),..._a("y",t,{defaultPos:"mid"}),...dae(t),...cs("size",t,{vgChannel:"fontSize"}),...cs("angle",t),...Zye("align",zHt(t.markDef,n,e)),...Zye("baseline",jHt(t.markDef,n,e)),..._a("radius",t,{defaultPos:null}),..._a("theta",t,{defaultPos:null})}}};function zHt(t,e,n){if(Or("align",t,n)===void 0)return"center"}function jHt(t,e,n){if(Or("baseline",t,n)===void 0)return"middle"}const BHt={vgMark:"rect",encodeEntry:t=>{const{config:e,markDef:n}=t,r=n.orient,i=r==="horizontal"?"x":"y",o=r==="horizontal"?"y":"x",s=r==="horizontal"?"height":"width";return{...Bu(t,{align:"ignore",baseline:"ignore",color:"include",orient:"ignore",size:"ignore",theta:"ignore"}),...$g(t,i),..._a(o,t,{defaultPos:"mid",vgChannel:o==="y"?"yc":"xc"}),[s]:Jr(Or("thickness",n,e))}}},iL={arc:OHt,area:EHt,bar:THt,circle:IHt,geoshape:kHt,image:AHt,line:PHt,point:DHt,rect:$Ht,rule:FHt,square:LHt,text:NHt,tick:BHt,trail:MHt};function UHt(t){if(En([b6,y6,Q8t],t.mark)){const e=J4e(t.mark,t.encoding);if(e.length>0)return WHt(t,e)}else if(t.mark===x6){const e=DY.some(n=>Or(n,t.markDef,t.config));if(t.stack&&!t.fieldDef("size")&&e)return VHt(t)}return Pae(t)}const y0e="faceted_path_";function WHt(t,e){return[{name:t.getName("pathgroup"),type:"group",from:{facet:{name:y0e+t.requestDataName(Fi.Main),data:t.requestDataName(Fi.Main),groupby:e}},encode:{update:{width:{field:{group:"width"}},height:{field:{group:"height"}}}},marks:Pae(t,{fromPrefix:y0e})}]}const x0e="stack_group_";function VHt(t){var c;const[e]=Pae(t,{fromPrefix:x0e}),n=t.scaleName(t.stack.fieldChannel),r=(u={})=>t.vgField(t.stack.fieldChannel,u),i=(u,f)=>{const d=[r({prefix:"min",suffix:"start",expr:f}),r({prefix:"max",suffix:"start",expr:f}),r({prefix:"min",suffix:"end",expr:f}),r({prefix:"max",suffix:"end",expr:f})];return`${u}(${d.map(h=>`scale('${n}',${h})`).join(",")})`};let o,s;t.stack.fieldChannel==="x"?(o={...YS(e.encode.update,["y","yc","y2","height",...DY]),x:{signal:i("min","datum")},x2:{signal:i("max","datum")},clip:{value:!0}},s={x:{field:{group:"x"},mult:-1},height:{field:{group:"height"}}},e.encode.update={...hl(e.encode.update,["y","yc","y2"]),height:{field:{group:"height"}}}):(o={...YS(e.encode.update,["x","xc","x2","width"]),y:{signal:i("min","datum")},y2:{signal:i("max","datum")},clip:{value:!0}},s={y:{field:{group:"y"},mult:-1},width:{field:{group:"width"}}},e.encode.update={...hl(e.encode.update,["x","xc","x2"]),width:{field:{group:"width"}}});for(const u of DY){const f=Ah(u,t.markDef,t.config);e.encode.update[u]?(o[u]=e.encode.update[u],delete e.encode.update[u]):f&&(o[u]=Jr(f)),f&&(e.encode.update[u]={value:0})}const a=[];if(((c=t.stack.groupbyChannels)==null?void 0:c.length)>0)for(const u of t.stack.groupbyChannels){const f=t.fieldDef(u),d=lt(f);d&&a.push(d),(f!=null&&f.bin||f!=null&&f.timeUnit)&&a.push(lt(f,{binSuffix:"end"}))}return o=["stroke","strokeWidth","strokeJoin","strokeCap","strokeDash","strokeDashOffset","strokeMiterLimit","strokeOpacity"].reduce((u,f)=>{if(e.encode.update[f])return{...u,[f]:e.encode.update[f]};{const d=Ah(f,t.markDef,t.config);return d!==void 0?{...u,[f]:Jr(d)}:u}},o),o.stroke&&(o.strokeForeground={value:!0},o.strokeOffset={value:0}),[{type:"group",from:{facet:{data:t.requestDataName(Fi.Main),name:x0e+t.requestDataName(Fi.Main),groupby:a,aggregate:{fields:[r({suffix:"start"}),r({suffix:"start"}),r({suffix:"end"}),r({suffix:"end"})],ops:["min","max","min","max"]}}},encode:{update:o},marks:[{type:"group",encode:{update:s},marks:[e]}]}]}function GHt(t){const{encoding:e,stack:n,mark:r,markDef:i,config:o}=t,s=e.order;if(!(!We(s)&&qf(s)&&MY(s.value)||!s&&MY(Or("order",i,o)))){if((We(s)||Je(s))&&!n)return Xje(s,{expr:"datum"});if(Jy(r)){const a=i.orient==="horizontal"?"y":"x",l=e[a];if(Je(l))return{field:a}}}}function Pae(t,e={fromPrefix:""}){const{mark:n,markDef:r,encoding:i,config:o}=t,s=qi(r.clip,HHt(t),qHt(t)),a=Hje(r),l=i.key,c=GHt(t),u=XHt(t),f=Or("aria",r,o),d=iL[n].postEncodingTransform?iL[n].postEncodingTransform(t):null;return[{name:t.getName("marks"),type:iL[n].vgMark,...s?{clip:s}:{},...a?{style:a}:{},...l?{key:l.field}:{},...c?{sort:c}:{},...u||{},...f===!1?{aria:f}:{},from:{data:e.fromPrefix+t.requestDataName(Fi.Main)},encode:{update:iL[n].encodeEntry(t)},...d?{transform:d}:{}}]}function HHt(t){const e=t.getScaleComponent("x"),n=t.getScaleComponent("y");return e!=null&&e.get("selectionExtent")||n!=null&&n.get("selectionExtent")?!0:void 0}function qHt(t){const e=t.component.projection;return e&&!e.isFit?!0:void 0}function XHt(t){if(!t.component.selection)return null;const e=Qe(t.component.selection).length;let n=e,r=t.parent;for(;r&&n===0;)n=Qe(r.component.selection).length,r=r.parent;return n?{interactive:e>0||t.mark==="geoshape"||!!t.encoding.tooltip||!!t.markDef.tooltip}:null}class U6e extends F6e{constructor(e,n,r,i={},o){super(e,"unit",n,r,o,void 0,Pye(e)?e.view:void 0),this.specifiedScales={},this.specifiedAxes={},this.specifiedLegends={},this.specifiedProjection={},this.selection=[],this.children=[];const s=Ph(e.mark)?{...e.mark}:{type:e.mark},a=s.type;s.filled===void 0&&(s.filled=DVt(s,o,{graticule:e.data&&uae(e.data)}));const l=this.encoding=FWt(e.encoding||{},a,s.filled,o);this.markDef=bBe(s,l,o),this.size=CHt({encoding:l,size:Pye(e)?{...i,...e.width?{width:e.width}:{},...e.height?{height:e.height}:{}}:i}),this.stack=xBe(this.markDef,l),this.specifiedScales=this.initScales(a,l),this.specifiedAxes=this.initAxes(l),this.specifiedLegends=this.initLegends(l),this.specifiedProjection=e.projection,this.selection=(e.params??[]).filter(c=>oae(c))}get hasProjection(){const{encoding:e}=this,n=this.mark===O4e,r=e&&D6t.some(i=>en(e[i]));return n||r}scaleDomain(e){const n=this.specifiedScales[e];return n?n.domain:void 0}axis(e){return this.specifiedAxes[e]}legend(e){return this.specifiedLegends[e]}initScales(e,n){return Sse.reduce((r,i)=>{const o=_o(n[i]);return o&&(r[i]=this.initScale(o.scale??{})),r},{})}initScale(e){const{domain:n,range:r}=e,i=is(e);return We(n)&&(i.domain=n.map(ec)),We(r)&&(i.range=r.map(ec)),i}initAxes(e){return Jg.reduce((n,r)=>{const i=e[r];if(en(i)||r===yi&&en(e.x2)||r===Yo&&en(e.y2)){const o=en(i)?i.axis:void 0;n[r]=o&&this.initAxis({...o})}return n},{})}initAxis(e){const n=Qe(e),r={};for(const i of n){const o=e[i];r[i]=GR(o)?Gje(o):ec(o)}return r}initLegends(e){return W6t.reduce((n,r)=>{const i=_o(e[r]);if(i&&G6t(r)){const o=i.legend;n[r]=o&&is(o)}return n},{})}parseData(){this.component.data=X6(this)}parseLayoutSize(){aHt(this)}parseSelections(){this.component.selection=K9t(this,this.selection)}parseMarkGroup(){this.component.mark=UHt(this)}parseAxesAndHeaders(){this.component.axes=mHt(this)}assembleSelectionTopLevelSignals(e){return w9t(this,e)}assembleSignals(){return[...r6e(this),...x9t(this,[])]}assembleSelectionData(e){return _9t(this,e)}assembleLayout(){return null}assembleLayoutSignals(){return yae(this)}assembleMarks(){let e=this.component.mark??[];return(!this.parent||!NO(this.parent))&&(e=IBe(this,e)),e.map(this.correctDataNames)}assembleGroupStyle(){const{style:e}=this.view||{};return e!==void 0?e:this.encoding.x||this.encoding.y?"cell":"view"}getMapping(){return this.encoding}get mark(){return this.markDef.type}channelHasField(e){return Bx(this.encoding,e)}fieldDef(e){const n=this.encoding[e];return Xf(n)}typedFieldDef(e){const n=this.fieldDef(e);return Pa(n)?n:null}}class Mae extends Eae{constructor(e,n,r,i,o){super(e,"layer",n,r,o,e.resolve,e.view);const s={...i,...e.width?{width:e.width}:{},...e.height?{height:e.height}:{}};this.children=e.layer.map((a,l)=>{if(P6(a))return new Mae(a,this,this.getName(`layer_${l}`),s,o);if(em(a))return new U6e(a,this,this.getName(`layer_${l}`),s,o);throw new Error(Ose(a))})}parseData(){this.component.data=X6(this);for(const e of this.children)e.parseData()}parseLayoutSize(){oHt(this)}parseSelections(){this.component.selection={};for(const e of this.children){e.parseSelections();for(const n of Qe(e.component.selection))this.component.selection[n]=e.component.selection[n]}}parseMarkGroup(){for(const e of this.children)e.parseMarkGroup()}parseAxesAndHeaders(){yHt(this)}assembleSelectionTopLevelSignals(e){return this.children.reduce((n,r)=>r.assembleSelectionTopLevelSignals(n),e)}assembleSignals(){return this.children.reduce((e,n)=>e.concat(n.assembleSignals()),r6e(this))}assembleLayoutSignals(){return this.children.reduce((e,n)=>e.concat(n.assembleLayoutSignals()),yae(this))}assembleSelectionData(e){return this.children.reduce((n,r)=>r.assembleSelectionData(n),e)}assembleGroupStyle(){const e=new Set;for(const r of this.children)for(const i of pt(r.assembleGroupStyle()))e.add(i);const n=Array.from(e);return n.length>1?n:n.length===1?n[0]:void 0}assembleTitle(){let e=super.assembleTitle();if(e)return e;for(const n of this.children)if(e=n.assembleTitle(),e)return e}assembleLayout(){return null}assembleMarks(){return S9t(this,this.children.flatMap(e=>e.assembleMarks()))}assembleLegends(){return this.children.reduce((e,n)=>e.concat(n.assembleLegends()),b6e(this))}}function Rae(t,e,n,r,i){if(S6(t))return new vk(t,e,n,i);if(P6(t))return new Mae(t,e,n,r,i);if(em(t))return new U6e(t,e,n,r,i);if(aVt(t))return new dHt(t,e,n,i);throw new Error(Ose(t))}function YHt(t,e={}){e.logger&&u8t(e.logger),e.fieldTitle&&W4e(e.fieldTitle);try{const n=yBe(gO(e.config,t.config)),r=TBe(t,n),i=Rae(r,null,"",void 0,n);return i.parse(),xGt(i.component.data,i),{spec:KHt(i,QHt(t,r.autosize,n,i),t.datasets,t.usermeta),normalized:r}}finally{e.logger&&f8t(),e.fieldTitle&&kWt()}}function QHt(t,e,n,r){const i=r.component.layoutSize.get("width"),o=r.component.layoutSize.get("height");if(e===void 0?(e={type:"pad"},r.hasAxisOrientSignalRef()&&(e.resize=!0)):gt(e)&&(e={type:e}),i&&o&&p9t(e.type)){if(i==="step"&&o==="step")Ze(pye()),e.type="pad";else if(i==="step"||o==="step"){const s=i==="step"?"width":"height";Ze(pye(d6(s)));const a=s==="width"?"height":"width";e.type=g9t(a)}}return{...Qe(e).length===1&&e.type?e.type==="pad"?{}:{autosize:e.type}:{autosize:e},...Uye(n,!1),...Uye(t,!0)}}function KHt(t,e,n={},r){const i=t.config?wVt(t.config):void 0,o=[].concat(t.assembleSelectionData([]),tHt(t.component.data,n)),s=t.assembleProjections(),a=t.assembleTitle(),l=t.assembleGroupStyle(),c=t.assembleGroupEncodeEntry(!0);let u=t.assembleLayoutSignals();u=u.filter(h=>(h.name==="width"||h.name==="height")&&h.value!==void 0?(e[h.name]=+h.value,!1):!0);const{params:f,...d}=e;return{$schema:"https://vega.github.io/schema/vega/v5.json",...t.description?{description:t.description}:{},...d,...a?{title:a}:{},...l?{style:l}:{},...c?{encode:{update:c}}:{},data:o,...s.length>0?{projections:s}:{},...t.assembleGroup([...u,...t.assembleSelectionTopLevelSignals([]),...pBe(f)]),...i?{config:i}:{},...r?{usermeta:r}:{}}}const ZHt=T6t.version,JHt=Object.freeze(Object.defineProperty({__proto__:null,accessPathDepth:KS,accessPathWithDatum:gse,compile:YHt,contains:En,deepEqual:oc,deleteNestedProperty:k5,duplicate:Kt,entries:dy,every:dse,fieldIntersection:pse,flatAccessWithDatum:Eje,getFirstDefined:qi,hasIntersection:hse,hasProperty:Ke,hash:Mn,internalField:Aje,isBoolean:HA,isEmpty:Er,isEqual:A6t,isInternalField:Pje,isNullOrFalse:MY,isNumeric:s6,keys:Qe,logicalExpr:gk,mergeDeep:Cje,never:Sje,normalize:TBe,normalizeAngle:qA,omit:hl,pick:YS,prefixGenerator:RY,removePathFromField:MO,replaceAll:wb,replacePathInField:Mu,resetIdCounter:M6t,setEqual:Oje,some:QS,stringify:Tr,titleCase:IR,unique:Qd,uniqueId:kje,vals:bs,varName:pi,version:ZHt},Symbol.toStringTag,{value:"Module"}));function W6e(t){const[e,n]=/schema\/([\w-]+)\/([\w\.\-]+)\.json$/g.exec(t).slice(1,3);return{library:e,version:n}}var eqt="vega-themes",tqt="2.15.0",nqt="Themes for stylized Vega and Vega-Lite visualizations.",rqt=["vega","vega-lite","themes","style"],iqt="BSD-3-Clause",oqt={name:"UW Interactive Data Lab",url:"https://idl.cs.washington.edu"},sqt=[{name:"Emily Gu",url:"https://github.com/emilygu"},{name:"Arvind Satyanarayan",url:"http://arvindsatya.com"},{name:"Jeffrey Heer",url:"https://idl.cs.washington.edu"},{name:"Dominik Moritz",url:"https://www.domoritz.de"}],aqt="build/vega-themes.js",lqt="build/vega-themes.module.js",cqt="build/vega-themes.min.js",uqt="build/vega-themes.min.js",fqt="build/vega-themes.module.d.ts",dqt={type:"git",url:"https://github.com/vega/vega-themes.git"},hqt=["src","build"],pqt={prebuild:"yarn clean",build:"rollup -c",clean:"rimraf build && rimraf examples/build","copy:data":"rsync -r node_modules/vega-datasets/data/* examples/data","copy:build":"rsync -r build/* examples/build","deploy:gh":"yarn build && mkdir -p examples/build && rsync -r build/* examples/build && gh-pages -d examples",preversion:"yarn lint",serve:"browser-sync start -s -f build examples --serveStatic examples",start:"yarn build && concurrently --kill-others -n Server,Rollup 'yarn serve' 'rollup -c -w'",format:"eslint . --fix",lint:"eslint .",release:"release-it"},gqt={"@babel/core":"^7.24.6","@babel/plugin-transform-runtime":"^7.24.6","@babel/preset-env":"^7.24.6","@babel/preset-typescript":"^7.24.6","@release-it/conventional-changelog":"^8.0.1","@rollup/plugin-json":"^6.1.0","@rollup/plugin-node-resolve":"^15.2.3","@rollup/plugin-terser":"^0.4.4","@typescript-eslint/eslint-plugin":"^7.11.0","@typescript-eslint/parser":"^7.11.0","browser-sync":"^3.0.2",concurrently:"^8.2.2",eslint:"^8.45.0","eslint-config-prettier":"^9.1.0","eslint-plugin-prettier":"^5.1.3","gh-pages":"^6.1.1",prettier:"^3.2.5","release-it":"^17.3.0",rollup:"^4.18.0","rollup-plugin-bundle-size":"^1.0.3","rollup-plugin-ts":"^3.4.5",typescript:"^5.4.5",vega:"^5.25.0","vega-lite":"^5.9.3"},mqt={vega:"*","vega-lite":"*"},vqt={},yqt={name:eqt,version:tqt,description:nqt,keywords:rqt,license:iqt,author:oqt,contributors:sqt,main:aqt,module:lqt,unpkg:cqt,jsdelivr:uqt,types:fqt,repository:dqt,files:hqt,scripts:pqt,devDependencies:gqt,peerDependencies:mqt,dependencies:vqt};const rw="#fff",b0e="#888",xqt={background:"#333",view:{stroke:b0e},title:{color:rw,subtitleColor:rw},style:{"guide-label":{fill:rw},"guide-title":{fill:rw}},axis:{domainColor:rw,gridColor:b0e,tickColor:rw}},v0="#4572a7",bqt={background:"#fff",arc:{fill:v0},area:{fill:v0},line:{stroke:v0,strokeWidth:2},path:{stroke:v0},rect:{fill:v0},shape:{stroke:v0},symbol:{fill:v0,strokeWidth:1.5,size:50},axis:{bandPosition:.5,grid:!0,gridColor:"#000000",gridOpacity:1,gridWidth:.5,labelPadding:10,tickSize:5,tickWidth:.5},axisBand:{grid:!1,tickExtra:!0},legend:{labelBaseline:"middle",labelFontSize:11,symbolSize:50,symbolType:"square"},range:{category:["#4572a7","#aa4643","#8aa453","#71598e","#4598ae","#d98445","#94aace","#d09393","#b9cc98","#a99cbc"]}},y0="#30a2da",KV="#cbcbcb",wqt="#999",_qt="#333",w0e="#f0f0f0",_0e="#333",Sqt={arc:{fill:y0},area:{fill:y0},axis:{domainColor:KV,grid:!0,gridColor:KV,gridWidth:1,labelColor:wqt,labelFontSize:10,titleColor:_qt,tickColor:KV,tickSize:10,titleFontSize:14,titlePadding:10,labelPadding:4},axisBand:{grid:!1},background:w0e,group:{fill:w0e},legend:{labelColor:_0e,labelFontSize:11,padding:1,symbolSize:30,symbolType:"square",titleColor:_0e,titleFontSize:14,titlePadding:10},line:{stroke:y0,strokeWidth:2},path:{stroke:y0,strokeWidth:.5},rect:{fill:y0},range:{category:["#30a2da","#fc4f30","#e5ae38","#6d904f","#8b8b8b","#b96db8","#ff9e27","#56cc60","#52d2ca","#52689e","#545454","#9fe4f8"],diverging:["#cc0020","#e77866","#f6e7e1","#d6e8ed","#91bfd9","#1d78b5"],heatmap:["#d6e8ed","#cee0e5","#91bfd9","#549cc6","#1d78b5"]},point:{filled:!0,shape:"circle"},shape:{stroke:y0},bar:{binSpacing:2,fill:y0,stroke:null},title:{anchor:"start",fontSize:24,fontWeight:600,offset:20}},x0="#000",Cqt={group:{fill:"#e5e5e5"},arc:{fill:x0},area:{fill:x0},line:{stroke:x0},path:{stroke:x0},rect:{fill:x0},shape:{stroke:x0},symbol:{fill:x0,size:40},axis:{domain:!1,grid:!0,gridColor:"#FFFFFF",gridOpacity:1,labelColor:"#7F7F7F",labelPadding:4,tickColor:"#7F7F7F",tickSize:5.67,titleFontSize:16,titleFontWeight:"normal"},legend:{labelBaseline:"middle",labelFontSize:11,symbolSize:40},range:{category:["#000000","#7F7F7F","#1A1A1A","#999999","#333333","#B0B0B0","#4D4D4D","#C9C9C9","#666666","#DCDCDC"]}},Oqt=22,Eqt="normal",S0e="Benton Gothic, sans-serif",C0e=11.5,Tqt="normal",b0="#82c6df",ZV="Benton Gothic Bold, sans-serif",O0e="normal",E0e=13,l2={"category-6":["#ec8431","#829eb1","#c89d29","#3580b1","#adc839","#ab7fb4"],"fire-7":["#fbf2c7","#f9e39c","#f8d36e","#f4bb6a","#e68a4f","#d15a40","#ab4232"],"fireandice-6":["#e68a4f","#f4bb6a","#f9e39c","#dadfe2","#a6b7c6","#849eae"],"ice-7":["#edefee","#dadfe2","#c4ccd2","#a6b7c6","#849eae","#607785","#47525d"]},kqt={background:"#ffffff",title:{anchor:"start",color:"#000000",font:ZV,fontSize:Oqt,fontWeight:Eqt},arc:{fill:b0},area:{fill:b0},line:{stroke:b0,strokeWidth:2},path:{stroke:b0},rect:{fill:b0},shape:{stroke:b0},symbol:{fill:b0,size:30},axis:{labelFont:S0e,labelFontSize:C0e,labelFontWeight:Tqt,titleFont:ZV,titleFontSize:E0e,titleFontWeight:O0e},axisX:{labelAngle:0,labelPadding:4,tickSize:3},axisY:{labelBaseline:"middle",maxExtent:45,minExtent:45,tickSize:2,titleAlign:"left",titleAngle:0,titleX:-45,titleY:-11},legend:{labelFont:S0e,labelFontSize:C0e,symbolType:"square",titleFont:ZV,titleFontSize:E0e,titleFontWeight:O0e},range:{category:l2["category-6"],diverging:l2["fireandice-6"],heatmap:l2["fire-7"],ordinal:l2["fire-7"],ramp:l2["fire-7"]}},w0="#ab5787",oL="#979797",Aqt={background:"#f9f9f9",arc:{fill:w0},area:{fill:w0},line:{stroke:w0},path:{stroke:w0},rect:{fill:w0},shape:{stroke:w0},symbol:{fill:w0,size:30},axis:{domainColor:oL,domainWidth:.5,gridWidth:.2,labelColor:oL,tickColor:oL,tickWidth:.2,titleColor:oL},axisBand:{grid:!1},axisX:{grid:!0,tickSize:10},axisY:{domain:!1,grid:!0,tickSize:0},legend:{labelFontSize:11,padding:1,symbolSize:30,symbolType:"square"},range:{category:["#ab5787","#51b2e5","#703c5c","#168dd9","#d190b6","#00609f","#d365ba","#154866","#666666","#c4c4c4"]}},_0="#3e5c69",Pqt={background:"#fff",arc:{fill:_0},area:{fill:_0},line:{stroke:_0},path:{stroke:_0},rect:{fill:_0},shape:{stroke:_0},symbol:{fill:_0},axis:{domainWidth:.5,grid:!0,labelPadding:2,tickSize:5,tickWidth:.5,titleFontWeight:"normal"},axisBand:{grid:!1},axisX:{gridWidth:.2},axisY:{gridDash:[3],gridWidth:.4},legend:{labelFontSize:11,padding:1,symbolType:"square"},range:{category:["#3e5c69","#6793a6","#182429","#0570b0","#3690c0","#74a9cf","#a6bddb","#e2ddf2"]}},zc="#1696d2",T0e="#000000",Mqt="#FFFFFF",sL="Lato",JV="Lato",Rqt="Lato",Dqt="#DEDDDD",Iqt=18,c2={"main-colors":["#1696d2","#d2d2d2","#000000","#fdbf11","#ec008b","#55b748","#5c5859","#db2b27"],"shades-blue":["#CFE8F3","#A2D4EC","#73BFE2","#46ABDB","#1696D2","#12719E","#0A4C6A","#062635"],"shades-gray":["#F5F5F5","#ECECEC","#E3E3E3","#DCDBDB","#D2D2D2","#9D9D9D","#696969","#353535"],"shades-yellow":["#FFF2CF","#FCE39E","#FDD870","#FCCB41","#FDBF11","#E88E2D","#CA5800","#843215"],"shades-magenta":["#F5CBDF","#EB99C2","#E46AA7","#E54096","#EC008B","#AF1F6B","#761548","#351123"],"shades-green":["#DCEDD9","#BCDEB4","#98CF90","#78C26D","#55B748","#408941","#2C5C2D","#1A2E19"],"shades-black":["#D5D5D4","#ADABAC","#848081","#5C5859","#332D2F","#262223","#1A1717","#0E0C0D"],"shades-red":["#F8D5D4","#F1AAA9","#E9807D","#E25552","#DB2B27","#A4201D","#6E1614","#370B0A"],"one-group":["#1696d2","#000000"],"two-groups-cat-1":["#1696d2","#000000"],"two-groups-cat-2":["#1696d2","#fdbf11"],"two-groups-cat-3":["#1696d2","#db2b27"],"two-groups-seq":["#a2d4ec","#1696d2"],"three-groups-cat":["#1696d2","#fdbf11","#000000"],"three-groups-seq":["#a2d4ec","#1696d2","#0a4c6a"],"four-groups-cat-1":["#000000","#d2d2d2","#fdbf11","#1696d2"],"four-groups-cat-2":["#1696d2","#ec0008b","#fdbf11","#5c5859"],"four-groups-seq":["#cfe8f3","#73bf42","#1696d2","#0a4c6a"],"five-groups-cat-1":["#1696d2","#fdbf11","#d2d2d2","#ec008b","#000000"],"five-groups-cat-2":["#1696d2","#0a4c6a","#d2d2d2","#fdbf11","#332d2f"],"five-groups-seq":["#cfe8f3","#73bf42","#1696d2","#0a4c6a","#000000"],"six-groups-cat-1":["#1696d2","#ec008b","#fdbf11","#000000","#d2d2d2","#55b748"],"six-groups-cat-2":["#1696d2","#d2d2d2","#ec008b","#fdbf11","#332d2f","#0a4c6a"],"six-groups-seq":["#cfe8f3","#a2d4ec","#73bfe2","#46abdb","#1696d2","#12719e"],"diverging-colors":["#ca5800","#fdbf11","#fdd870","#fff2cf","#cfe8f3","#73bfe2","#1696d2","#0a4c6a"]},Lqt={background:Mqt,title:{anchor:"start",fontSize:Iqt,font:sL},axisX:{domain:!0,domainColor:T0e,domainWidth:1,grid:!1,labelFontSize:12,labelFont:JV,labelAngle:0,tickColor:T0e,tickSize:5,titleFontSize:12,titlePadding:10,titleFont:sL},axisY:{domain:!1,domainWidth:1,grid:!0,gridColor:Dqt,gridWidth:1,labelFontSize:12,labelFont:JV,labelPadding:8,ticks:!1,titleFontSize:12,titlePadding:10,titleFont:sL,titleAngle:0,titleY:-10,titleX:18},legend:{labelFontSize:12,labelFont:JV,symbolSize:100,titleFontSize:12,titlePadding:10,titleFont:sL,orient:"right",offset:10},view:{stroke:"transparent"},range:{category:c2["six-groups-cat-1"],diverging:c2["diverging-colors"],heatmap:c2["diverging-colors"],ordinal:c2["six-groups-seq"],ramp:c2["shades-blue"]},area:{fill:zc},rect:{fill:zc},line:{color:zc,stroke:zc,strokeWidth:5},trail:{color:zc,stroke:zc,strokeWidth:0,size:1},path:{stroke:zc,strokeWidth:.5},point:{filled:!0},text:{font:Rqt,color:zc,fontSize:11,align:"center",fontWeight:400,size:11},style:{bar:{fill:zc,stroke:null}},arc:{fill:zc},shape:{stroke:zc},symbol:{fill:zc,size:30}},S0="#3366CC",k0e="#ccc",aL="Arial, sans-serif",$qt={arc:{fill:S0},area:{fill:S0},path:{stroke:S0},rect:{fill:S0},shape:{stroke:S0},symbol:{stroke:S0},circle:{fill:S0},background:"#fff",padding:{top:10,right:10,bottom:10,left:10},style:{"guide-label":{font:aL,fontSize:12},"guide-title":{font:aL,fontSize:12},"group-title":{font:aL,fontSize:12}},title:{font:aL,fontSize:14,fontWeight:"bold",dy:-3,anchor:"start"},axis:{gridColor:k0e,tickColor:k0e,domain:!1,grid:!0},range:{category:["#4285F4","#DB4437","#F4B400","#0F9D58","#AB47BC","#00ACC1","#FF7043","#9E9D24","#5C6BC0","#F06292","#00796B","#C2185B"],heatmap:["#c6dafc","#5e97f6","#2a56c6"]}},Dae=t=>t*(1/3+1),A0e=Dae(9),P0e=Dae(10),M0e=Dae(12),u2="Segoe UI",R0e="wf_standard-font, helvetica, arial, sans-serif",D0e="#252423",f2="#605E5C",I0e="transparent",Fqt="#C8C6C4",of="#118DFF",Nqt="#12239E",zqt="#E66C37",jqt="#6B007B",Bqt="#E044A7",Uqt="#744EC2",Wqt="#D9B300",Vqt="#D64550",V6e=of,G6e="#DEEFFF",L0e=[G6e,V6e],Gqt=[G6e,"#c7e4ff","#b0d9ff","#9aceff","#83c3ff","#6cb9ff","#55aeff","#3fa3ff","#2898ff",V6e],Hqt={view:{stroke:I0e},background:I0e,font:u2,header:{titleFont:R0e,titleFontSize:M0e,titleColor:D0e,labelFont:u2,labelFontSize:P0e,labelColor:f2},axis:{ticks:!1,grid:!1,domain:!1,labelColor:f2,labelFontSize:A0e,titleFont:R0e,titleColor:D0e,titleFontSize:M0e,titleFontWeight:"normal"},axisQuantitative:{tickCount:3,grid:!0,gridColor:Fqt,gridDash:[1,5],labelFlush:!1},axisBand:{tickExtra:!0},axisX:{labelPadding:5},axisY:{labelPadding:10},bar:{fill:of},line:{stroke:of,strokeWidth:3,strokeCap:"round",strokeJoin:"round"},text:{font:u2,fontSize:A0e,fill:f2},arc:{fill:of},area:{fill:of,line:!0,opacity:.6},path:{stroke:of},rect:{fill:of},point:{fill:of,filled:!0,size:75},shape:{stroke:of},symbol:{fill:of,strokeWidth:1.5,size:50},legend:{titleFont:u2,titleFontWeight:"bold",titleColor:f2,labelFont:u2,labelFontSize:P0e,labelColor:f2,symbolType:"circle",symbolSize:75},range:{category:[of,Nqt,zqt,jqt,Bqt,Uqt,Wqt,Vqt],diverging:L0e,heatmap:L0e,ordinal:Gqt}},e9='IBM Plex Sans,system-ui,-apple-system,BlinkMacSystemFont,".sfnstext-regular",sans-serif',qqt='IBM Plex Sans Condensed, system-ui, -apple-system, BlinkMacSystemFont, ".SFNSText-Regular", sans-serif',t9=400,lL={textPrimary:{g90:"#f4f4f4",g100:"#f4f4f4",white:"#161616",g10:"#161616"},textSecondary:{g90:"#c6c6c6",g100:"#c6c6c6",white:"#525252",g10:"#525252"},layerAccent01:{white:"#e0e0e0",g10:"#e0e0e0",g90:"#525252",g100:"#393939"},gridBg:{white:"#ffffff",g10:"#ffffff",g90:"#161616",g100:"#161616"}},Xqt=["#8a3ffc","#33b1ff","#007d79","#ff7eb6","#fa4d56","#fff1f1","#6fdc8c","#4589ff","#d12771","#d2a106","#08bdba","#bae6ff","#ba4e00","#d4bbff"],Yqt=["#6929c4","#1192e8","#005d5d","#9f1853","#fa4d56","#570408","#198038","#002d9c","#ee538b","#b28600","#009d9a","#012749","#8a3800","#a56eff"];function Y6({theme:t,background:e}){const n=["white","g10"].includes(t)?"light":"dark",r=lL.gridBg[t],i=lL.textPrimary[t],o=lL.textSecondary[t],s=n==="dark"?Xqt:Yqt,a=n==="dark"?"#d4bbff":"#6929c4";return{background:e,arc:{fill:a},area:{fill:a},path:{stroke:a},rect:{fill:a},shape:{stroke:a},symbol:{stroke:a},circle:{fill:a},view:{fill:r,stroke:r},group:{fill:r},title:{color:i,anchor:"start",dy:-15,fontSize:16,font:e9,fontWeight:600},axis:{labelColor:o,labelFontSize:12,labelFont:qqt,labelFontWeight:t9,titleColor:i,titleFontWeight:600,titleFontSize:12,grid:!0,gridColor:lL.layerAccent01[t],labelAngle:0},axisX:{titlePadding:10},axisY:{titlePadding:2.5},style:{"guide-label":{font:e9,fill:o,fontWeight:t9},"guide-title":{font:e9,fill:o,fontWeight:t9}},range:{category:s,diverging:["#750e13","#a2191f","#da1e28","#fa4d56","#ff8389","#ffb3b8","#ffd7d9","#fff1f1","#e5f6ff","#bae6ff","#82cfff","#33b1ff","#1192e8","#0072c3","#00539a","#003a6d"],heatmap:["#f6f2ff","#e8daff","#d4bbff","#be95ff","#a56eff","#8a3ffc","#6929c4","#491d8b","#31135e","#1c0f30"]}}}const Qqt=Y6({theme:"white",background:"#ffffff"}),Kqt=Y6({theme:"g10",background:"#f4f4f4"}),Zqt=Y6({theme:"g90",background:"#262626"}),Jqt=Y6({theme:"g100",background:"#161616"}),eXt=yqt.version,tXt=Object.freeze(Object.defineProperty({__proto__:null,carbong10:Kqt,carbong100:Jqt,carbong90:Zqt,carbonwhite:Qqt,dark:xqt,excel:bqt,fivethirtyeight:Sqt,ggplot2:Cqt,googlecharts:$qt,latimes:kqt,powerbi:Hqt,quartz:Aqt,urbaninstitute:Lqt,version:eXt,vox:Pqt},Symbol.toStringTag,{value:"Module"}));function nXt(t,e,n,r){if(We(t))return`[${t.map(i=>e(gt(i)?i:$0e(i,n))).join(", ")}]`;if(ht(t)){let i="";const{title:o,image:s,...a}=t;o&&(i+=`

${e(o)}

`),s&&(i+=``);const l=Object.keys(a);if(l.length>0){i+="";for(const c of l){let u=a[c];u!==void 0&&(ht(u)&&(u=$0e(u,n)),i+=``)}i+="
${e(c)}${e(u)}
"}return i||"{}"}return e(t)}function rXt(t){const e=[];return function(n,r){if(typeof r!="object"||r===null)return r;const i=e.indexOf(this)+1;return e.length=i,e.length>t?"[Object]":e.indexOf(r)>=0?"[Circular]":(e.push(r),r)}}function $0e(t,e){return JSON.stringify(t,rXt(e))}var iXt=`#vg-tooltip-element { visibility: hidden; padding: 8px; position: fixed; @@ -329,7 +322,16 @@ https://github.com/nodeca/pako/blob/main/LICENSE #vg-tooltip-element.dark-theme td.key { color: #bfbfbf; } -`;const C6e="vg-tooltip-element",Gqt={offsetX:10,offsetY:10,id:C6e,styleId:"vega-tooltip-style",theme:"light",disableDefaultStyle:!1,sanitize:Hqt,maxDepth:2,formatTooltip:Uqt,baseURL:""};function Hqt(t){return String(t).replace(/&/g,"&").replace(/window.innerWidth&&(i=+t.clientX-n-e.width);let o=t.clientY+r;return o+e.height>window.innerHeight&&(o=+t.clientY-r-e.height),{x:i,y:o}}class Yqt{constructor(e){this.options={...Gqt,...e};const n=this.options.id;if(this.el=null,this.call=this.tooltipHandler.bind(this),!this.options.disableDefaultStyle&&!document.getElementById(this.options.styleId)){const r=document.createElement("style");r.setAttribute("id",this.options.styleId),r.innerHTML=qqt(n);const i=document.head;i.childNodes.length>0?i.insertBefore(r,i.childNodes[0]):i.appendChild(r)}}tooltipHandler(e,n,r,i){if(this.el=document.getElementById(this.options.id),this.el||(this.el=document.createElement("div"),this.el.setAttribute("id",this.options.id),this.el.classList.add("vg-tooltip"),(document.fullscreenElement??document.body).appendChild(this.el)),i==null||i===""){this.el.classList.remove("visible",`${this.options.theme}-theme`);return}this.el.innerHTML=this.options.formatTooltip(i,this.options.sanitize,this.options.maxDepth,this.options.baseURL),this.el.classList.add("visible",`${this.options.theme}-theme`);const{x:o,y:s}=Xqt(n,this.el.getBoundingClientRect(),this.options.offsetX,this.options.offsetY);this.el.style.top=`${s}px`,this.el.style.left=`${o}px`}}var n9={};function Qqt(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}class Kqt{constructor(){this.max=1e3,this.map=new Map}get(e){const n=this.map.get(e);if(n!==void 0)return this.map.delete(e),this.map.set(e,n),n}delete(e){return this.map.delete(e)}set(e,n){if(!this.delete(e)&&n!==void 0){if(this.map.size>=this.max){const i=this.map.keys().next().value;this.delete(i)}this.map.set(e,n)}return this}}var Zqt=Kqt;const Jqt=Object.freeze({loose:!0}),eXt=Object.freeze({}),tXt=t=>t?typeof t!="object"?Jqt:t:eXt;var yae=tXt,HY={exports:{}};const nXt="2.0.0",O6e=256,rXt=Number.MAX_SAFE_INTEGER||9007199254740991,iXt=16,oXt=O6e-6,sXt=["major","premajor","minor","preminor","patch","prepatch","prerelease"];var xae={MAX_LENGTH:O6e,MAX_SAFE_COMPONENT_LENGTH:iXt,MAX_SAFE_BUILD_LENGTH:oXt,MAX_SAFE_INTEGER:rXt,RELEASE_TYPES:sXt,SEMVER_SPEC_VERSION:nXt,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2};const aXt=typeof process=="object"&&n9&&n9.NODE_DEBUG&&/\bsemver\b/i.test(n9.NODE_DEBUG)?(...t)=>console.error("SEMVER",...t):()=>{};var eU=aXt;(function(t,e){const{MAX_SAFE_COMPONENT_LENGTH:n,MAX_SAFE_BUILD_LENGTH:r,MAX_LENGTH:i}=xae,o=eU;e=t.exports={};const s=e.re=[],a=e.safeRe=[],l=e.src=[],c=e.t={};let u=0;const f="[a-zA-Z0-9-]",d=[["\\s",1],["\\d",i],[f,r]],h=g=>{for(const[m,v]of d)g=g.split(`${m}*`).join(`${m}{0,${v}}`).split(`${m}+`).join(`${m}{1,${v}}`);return g},p=(g,m,v)=>{const y=h(m),x=u++;o(g,x,m),c[g]=x,l[x]=m,s[x]=new RegExp(m,v?"g":void 0),a[x]=new RegExp(y,v?"g":void 0)};p("NUMERICIDENTIFIER","0|[1-9]\\d*"),p("NUMERICIDENTIFIERLOOSE","\\d+"),p("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${f}*`),p("MAINVERSION",`(${l[c.NUMERICIDENTIFIER]})\\.(${l[c.NUMERICIDENTIFIER]})\\.(${l[c.NUMERICIDENTIFIER]})`),p("MAINVERSIONLOOSE",`(${l[c.NUMERICIDENTIFIERLOOSE]})\\.(${l[c.NUMERICIDENTIFIERLOOSE]})\\.(${l[c.NUMERICIDENTIFIERLOOSE]})`),p("PRERELEASEIDENTIFIER",`(?:${l[c.NUMERICIDENTIFIER]}|${l[c.NONNUMERICIDENTIFIER]})`),p("PRERELEASEIDENTIFIERLOOSE",`(?:${l[c.NUMERICIDENTIFIERLOOSE]}|${l[c.NONNUMERICIDENTIFIER]})`),p("PRERELEASE",`(?:-(${l[c.PRERELEASEIDENTIFIER]}(?:\\.${l[c.PRERELEASEIDENTIFIER]})*))`),p("PRERELEASELOOSE",`(?:-?(${l[c.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${l[c.PRERELEASEIDENTIFIERLOOSE]})*))`),p("BUILDIDENTIFIER",`${f}+`),p("BUILD",`(?:\\+(${l[c.BUILDIDENTIFIER]}(?:\\.${l[c.BUILDIDENTIFIER]})*))`),p("FULLPLAIN",`v?${l[c.MAINVERSION]}${l[c.PRERELEASE]}?${l[c.BUILD]}?`),p("FULL",`^${l[c.FULLPLAIN]}$`),p("LOOSEPLAIN",`[v=\\s]*${l[c.MAINVERSIONLOOSE]}${l[c.PRERELEASELOOSE]}?${l[c.BUILD]}?`),p("LOOSE",`^${l[c.LOOSEPLAIN]}$`),p("GTLT","((?:<|>)?=?)"),p("XRANGEIDENTIFIERLOOSE",`${l[c.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),p("XRANGEIDENTIFIER",`${l[c.NUMERICIDENTIFIER]}|x|X|\\*`),p("XRANGEPLAIN",`[v=\\s]*(${l[c.XRANGEIDENTIFIER]})(?:\\.(${l[c.XRANGEIDENTIFIER]})(?:\\.(${l[c.XRANGEIDENTIFIER]})(?:${l[c.PRERELEASE]})?${l[c.BUILD]}?)?)?`),p("XRANGEPLAINLOOSE",`[v=\\s]*(${l[c.XRANGEIDENTIFIERLOOSE]})(?:\\.(${l[c.XRANGEIDENTIFIERLOOSE]})(?:\\.(${l[c.XRANGEIDENTIFIERLOOSE]})(?:${l[c.PRERELEASELOOSE]})?${l[c.BUILD]}?)?)?`),p("XRANGE",`^${l[c.GTLT]}\\s*${l[c.XRANGEPLAIN]}$`),p("XRANGELOOSE",`^${l[c.GTLT]}\\s*${l[c.XRANGEPLAINLOOSE]}$`),p("COERCEPLAIN",`(^|[^\\d])(\\d{1,${n}})(?:\\.(\\d{1,${n}}))?(?:\\.(\\d{1,${n}}))?`),p("COERCE",`${l[c.COERCEPLAIN]}(?:$|[^\\d])`),p("COERCEFULL",l[c.COERCEPLAIN]+`(?:${l[c.PRERELEASE]})?(?:${l[c.BUILD]})?(?:$|[^\\d])`),p("COERCERTL",l[c.COERCE],!0),p("COERCERTLFULL",l[c.COERCEFULL],!0),p("LONETILDE","(?:~>?)"),p("TILDETRIM",`(\\s*)${l[c.LONETILDE]}\\s+`,!0),e.tildeTrimReplace="$1~",p("TILDE",`^${l[c.LONETILDE]}${l[c.XRANGEPLAIN]}$`),p("TILDELOOSE",`^${l[c.LONETILDE]}${l[c.XRANGEPLAINLOOSE]}$`),p("LONECARET","(?:\\^)"),p("CARETTRIM",`(\\s*)${l[c.LONECARET]}\\s+`,!0),e.caretTrimReplace="$1^",p("CARET",`^${l[c.LONECARET]}${l[c.XRANGEPLAIN]}$`),p("CARETLOOSE",`^${l[c.LONECARET]}${l[c.XRANGEPLAINLOOSE]}$`),p("COMPARATORLOOSE",`^${l[c.GTLT]}\\s*(${l[c.LOOSEPLAIN]})$|^$`),p("COMPARATOR",`^${l[c.GTLT]}\\s*(${l[c.FULLPLAIN]})$|^$`),p("COMPARATORTRIM",`(\\s*)${l[c.GTLT]}\\s*(${l[c.LOOSEPLAIN]}|${l[c.XRANGEPLAIN]})`,!0),e.comparatorTrimReplace="$1$2$3",p("HYPHENRANGE",`^\\s*(${l[c.XRANGEPLAIN]})\\s+-\\s+(${l[c.XRANGEPLAIN]})\\s*$`),p("HYPHENRANGELOOSE",`^\\s*(${l[c.XRANGEPLAINLOOSE]})\\s+-\\s+(${l[c.XRANGEPLAINLOOSE]})\\s*$`),p("STAR","(<|>)?=?\\s*\\*"),p("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$"),p("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")})(HY,HY.exports);var bae=HY.exports;const b0e=/^[0-9]+$/,E6e=(t,e)=>{const n=b0e.test(t),r=b0e.test(e);return n&&r&&(t=+t,e=+e),t===e?0:n&&!r?-1:r&&!n?1:tE6e(e,t);var cXt={compareIdentifiers:E6e,rcompareIdentifiers:lXt};const dL=eU,{MAX_LENGTH:w0e,MAX_SAFE_INTEGER:hL}=xae,{safeRe:_0e,t:S0e}=bae,uXt=yae,{compareIdentifiers:iw}=cXt;let fXt=class _d{constructor(e,n){if(n=uXt(n),e instanceof _d){if(e.loose===!!n.loose&&e.includePrerelease===!!n.includePrerelease)return e;e=e.version}else if(typeof e!="string")throw new TypeError(`Invalid version. Must be a string. Got type "${typeof e}".`);if(e.length>w0e)throw new TypeError(`version is longer than ${w0e} characters`);dL("SemVer",e,n),this.options=n,this.loose=!!n.loose,this.includePrerelease=!!n.includePrerelease;const r=e.trim().match(n.loose?_0e[S0e.LOOSE]:_0e[S0e.FULL]);if(!r)throw new TypeError(`Invalid Version: ${e}`);if(this.raw=e,this.major=+r[1],this.minor=+r[2],this.patch=+r[3],this.major>hL||this.major<0)throw new TypeError("Invalid major version");if(this.minor>hL||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>hL||this.patch<0)throw new TypeError("Invalid patch version");r[4]?this.prerelease=r[4].split(".").map(i=>{if(/^[0-9]+$/.test(i)){const o=+i;if(o>=0&&o=0;)typeof this.prerelease[o]=="number"&&(this.prerelease[o]++,o=-2);if(o===-1){if(n===this.prerelease.join(".")&&r===!1)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(i)}}if(n){let o=[n,i];r===!1&&(o=[n]),iw(this.prerelease[0],n)===0?isNaN(this.prerelease[1])&&(this.prerelease=o):this.prerelease=o}break}default:throw new Error(`invalid increment argument: ${e}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}};var wae=fXt;const C0e=wae,dXt=(t,e,n)=>new C0e(t,n).compare(new C0e(e,n));var jO=dXt;const hXt=jO,pXt=(t,e,n)=>hXt(t,e,n)===0;var gXt=pXt;const mXt=jO,vXt=(t,e,n)=>mXt(t,e,n)!==0;var yXt=vXt;const xXt=jO,bXt=(t,e,n)=>xXt(t,e,n)>0;var wXt=bXt;const _Xt=jO,SXt=(t,e,n)=>_Xt(t,e,n)>=0;var CXt=SXt;const OXt=jO,EXt=(t,e,n)=>OXt(t,e,n)<0;var TXt=EXt;const kXt=jO,AXt=(t,e,n)=>kXt(t,e,n)<=0;var PXt=AXt;const MXt=gXt,RXt=yXt,DXt=wXt,IXt=CXt,LXt=TXt,$Xt=PXt,FXt=(t,e,n,r)=>{switch(e){case"===":return typeof t=="object"&&(t=t.version),typeof n=="object"&&(n=n.version),t===n;case"!==":return typeof t=="object"&&(t=t.version),typeof n=="object"&&(n=n.version),t!==n;case"":case"=":case"==":return MXt(t,n,r);case"!=":return RXt(t,n,r);case">":return DXt(t,n,r);case">=":return IXt(t,n,r);case"<":return LXt(t,n,r);case"<=":return $Xt(t,n,r);default:throw new TypeError(`Invalid operator: ${e}`)}};var NXt=FXt,r9,O0e;function zXt(){if(O0e)return r9;O0e=1;const t=Symbol("SemVer ANY");class e{static get ANY(){return t}constructor(u,f){if(f=n(f),u instanceof e){if(u.loose===!!f.loose)return u;u=u.value}u=u.trim().split(/\s+/).join(" "),s("comparator",u,f),this.options=f,this.loose=!!f.loose,this.parse(u),this.semver===t?this.value="":this.value=this.operator+this.semver.version,s("comp",this)}parse(u){const f=this.options.loose?r[i.COMPARATORLOOSE]:r[i.COMPARATOR],d=u.match(f);if(!d)throw new TypeError(`Invalid comparator: ${u}`);this.operator=d[1]!==void 0?d[1]:"",this.operator==="="&&(this.operator=""),d[2]?this.semver=new a(d[2],this.options.loose):this.semver=t}toString(){return this.value}test(u){if(s("Comparator.test",u,this.options.loose),this.semver===t||u===t)return!0;if(typeof u=="string")try{u=new a(u,this.options)}catch{return!1}return o(u,this.operator,this.semver,this.options)}intersects(u,f){if(!(u instanceof e))throw new TypeError("a Comparator is required");return this.operator===""?this.value===""?!0:new l(u.value,f).test(this.value):u.operator===""?u.value===""?!0:new l(this.value,f).test(u.semver):(f=n(f),f.includePrerelease&&(this.value==="<0.0.0-0"||u.value==="<0.0.0-0")||!f.includePrerelease&&(this.value.startsWith("<0.0.0")||u.value.startsWith("<0.0.0"))?!1:!!(this.operator.startsWith(">")&&u.operator.startsWith(">")||this.operator.startsWith("<")&&u.operator.startsWith("<")||this.semver.version===u.semver.version&&this.operator.includes("=")&&u.operator.includes("=")||o(this.semver,"<",u.semver,f)&&this.operator.startsWith(">")&&u.operator.startsWith("<")||o(this.semver,">",u.semver,f)&&this.operator.startsWith("<")&&u.operator.startsWith(">")))}}r9=e;const n=yae,{safeRe:r,t:i}=bae,o=NXt,s=eU,a=wae,l=T6e();return r9}var i9,E0e;function T6e(){if(E0e)return i9;E0e=1;class t{constructor(T,R){if(R=r(R),T instanceof t)return T.loose===!!R.loose&&T.includePrerelease===!!R.includePrerelease?T:new t(T.raw,R);if(T instanceof i)return this.raw=T.value,this.set=[[T]],this.format(),this;if(this.options=R,this.loose=!!R.loose,this.includePrerelease=!!R.includePrerelease,this.raw=T.trim().split(/\s+/).join(" "),this.set=this.raw.split("||").map(I=>this.parseRange(I.trim())).filter(I=>I.length),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){const I=this.set[0];if(this.set=this.set.filter(B=>!p(B[0])),this.set.length===0)this.set=[I];else if(this.set.length>1){for(const B of this.set)if(B.length===1&&g(B[0])){this.set=[B];break}}}this.format()}format(){return this.range=this.set.map(T=>T.join(" ").trim()).join("||").trim(),this.range}toString(){return this.range}parseRange(T){const I=((this.options.includePrerelease&&d)|(this.options.loose&&h))+":"+T,B=n.get(I);if(B)return B;const $=this.options.loose,z=$?a[l.HYPHENRANGELOOSE]:a[l.HYPHENRANGE];T=T.replace(z,M(this.options.includePrerelease)),o("hyphen replace",T),T=T.replace(a[l.COMPARATORTRIM],c),o("comparator trim",T),T=T.replace(a[l.TILDETRIM],u),o("tilde trim",T),T=T.replace(a[l.CARETTRIM],f),o("caret trim",T);let L=T.split(" ").map(H=>v(H,this.options)).join(" ").split(/\s+/).map(H=>E(H,this.options));$&&(L=L.filter(H=>(o("loose invalid filter",H,this.options),!!H.match(a[l.COMPARATORLOOSE])))),o("range list",L);const j=new Map,N=L.map(H=>new i(H,this.options));for(const H of N){if(p(H))return[H];j.set(H.value,H)}j.size>1&&j.has("")&&j.delete("");const F=[...j.values()];return n.set(I,F),F}intersects(T,R){if(!(T instanceof t))throw new TypeError("a Range is required");return this.set.some(I=>m(I,R)&&T.set.some(B=>m(B,R)&&I.every($=>B.every(z=>$.intersects(z,R)))))}test(T){if(!T)return!1;if(typeof T=="string")try{T=new s(T,this.options)}catch{return!1}for(let R=0;RP.value==="<0.0.0-0",g=P=>P.value==="",m=(P,T)=>{let R=!0;const I=P.slice();let B=I.pop();for(;R&&I.length;)R=I.every($=>B.intersects($,T)),B=I.pop();return R},v=(P,T)=>(o("comp",P,T),P=w(P,T),o("caret",P),P=x(P,T),o("tildes",P),P=S(P,T),o("xrange",P),P=k(P,T),o("stars",P),P),y=P=>!P||P.toLowerCase()==="x"||P==="*",x=(P,T)=>P.trim().split(/\s+/).map(R=>b(R,T)).join(" "),b=(P,T)=>{const R=T.loose?a[l.TILDELOOSE]:a[l.TILDE];return P.replace(R,(I,B,$,z,L)=>{o("tilde",P,I,B,$,z,L);let j;return y(B)?j="":y($)?j=`>=${B}.0.0 <${+B+1}.0.0-0`:y(z)?j=`>=${B}.${$}.0 <${B}.${+$+1}.0-0`:L?(o("replaceTilde pr",L),j=`>=${B}.${$}.${z}-${L} <${B}.${+$+1}.0-0`):j=`>=${B}.${$}.${z} <${B}.${+$+1}.0-0`,o("tilde return",j),j})},w=(P,T)=>P.trim().split(/\s+/).map(R=>_(R,T)).join(" "),_=(P,T)=>{o("caret",P,T);const R=T.loose?a[l.CARETLOOSE]:a[l.CARET],I=T.includePrerelease?"-0":"";return P.replace(R,(B,$,z,L,j)=>{o("caret",P,B,$,z,L,j);let N;return y($)?N="":y(z)?N=`>=${$}.0.0${I} <${+$+1}.0.0-0`:y(L)?$==="0"?N=`>=${$}.${z}.0${I} <${$}.${+z+1}.0-0`:N=`>=${$}.${z}.0${I} <${+$+1}.0.0-0`:j?(o("replaceCaret pr",j),$==="0"?z==="0"?N=`>=${$}.${z}.${L}-${j} <${$}.${z}.${+L+1}-0`:N=`>=${$}.${z}.${L}-${j} <${$}.${+z+1}.0-0`:N=`>=${$}.${z}.${L}-${j} <${+$+1}.0.0-0`):(o("no pr"),$==="0"?z==="0"?N=`>=${$}.${z}.${L}${I} <${$}.${z}.${+L+1}-0`:N=`>=${$}.${z}.${L}${I} <${$}.${+z+1}.0-0`:N=`>=${$}.${z}.${L} <${+$+1}.0.0-0`),o("caret return",N),N})},S=(P,T)=>(o("replaceXRanges",P,T),P.split(/\s+/).map(R=>O(R,T)).join(" ")),O=(P,T)=>{P=P.trim();const R=T.loose?a[l.XRANGELOOSE]:a[l.XRANGE];return P.replace(R,(I,B,$,z,L,j)=>{o("xRange",P,I,B,$,z,L,j);const N=y($),F=N||y(z),H=F||y(L),q=H;return B==="="&&q&&(B=""),j=T.includePrerelease?"-0":"",N?B===">"||B==="<"?I="<0.0.0-0":I="*":B&&q?(F&&(z=0),L=0,B===">"?(B=">=",F?($=+$+1,z=0,L=0):(z=+z+1,L=0)):B==="<="&&(B="<",F?$=+$+1:z=+z+1),B==="<"&&(j="-0"),I=`${B+$}.${z}.${L}${j}`):F?I=`>=${$}.0.0${j} <${+$+1}.0.0-0`:H&&(I=`>=${$}.${z}.0${j} <${$}.${+z+1}.0-0`),o("xRange return",I),I})},k=(P,T)=>(o("replaceStars",P,T),P.trim().replace(a[l.STAR],"")),E=(P,T)=>(o("replaceGTE0",P,T),P.trim().replace(a[T.includePrerelease?l.GTE0PRE:l.GTE0],"")),M=P=>(T,R,I,B,$,z,L,j,N,F,H,q)=>(y(I)?R="":y(B)?R=`>=${I}.0.0${P?"-0":""}`:y($)?R=`>=${I}.${B}.0${P?"-0":""}`:z?R=`>=${R}`:R=`>=${R}${P?"-0":""}`,y(N)?j="":y(F)?j=`<${+N+1}.0.0-0`:y(H)?j=`<${N}.${+F+1}.0-0`:q?j=`<=${N}.${F}.${H}-${q}`:P?j=`<${N}.${F}.${+H+1}-0`:j=`<=${j}`,`${R} ${j}`.trim()),A=(P,T,R)=>{for(let I=0;I0){const B=P[I].semver;if(B.major===T.major&&B.minor===T.minor&&B.patch===T.patch)return!0}return!1}return!0};return i9}const jXt=T6e(),BXt=(t,e,n)=>{try{e=new jXt(e,n)}catch{return!1}return e.test(t)};var UXt=BXt,k6e=Qqt(UXt);function WXt(t,e,n){const r=t.open(e),i=1e4,o=250,{origin:s}=new URL(e);let a=~~(i/o);function l(u){u.source===r&&(a=0,t.removeEventListener("message",l,!1))}t.addEventListener("message",l,!1);function c(){a<=0||(r.postMessage(n,s),setTimeout(c,o),a-=1)}setTimeout(c,o)}var VXt=`.vega-embed { +`;const H6e="vg-tooltip-element",oXt={offsetX:10,offsetY:10,id:H6e,styleId:"vega-tooltip-style",theme:"light",disableDefaultStyle:!1,sanitize:sXt,maxDepth:2,formatTooltip:nXt,baseURL:"",anchor:"cursor",position:["top","bottom","left","right","top-left","top-right","bottom-left","bottom-right"]};function sXt(t){return String(t).replace(/&/g,"&").replace(/=0&&t.y>=0&&t.x+e.width<=window.innerWidth&&t.y+e.height<=window.innerHeight}function uXt(t,e,n){return t.clientX>=e.x&&t.clientX<=e.x+n.width&&t.clientY>=e.y&&t.clientY<=e.y+n.height}class fXt{constructor(e){this.options={...oXt,...e};const n=this.options.id;if(this.el=null,this.call=this.tooltipHandler.bind(this),!this.options.disableDefaultStyle&&!document.getElementById(this.options.styleId)){const r=document.createElement("style");r.setAttribute("id",this.options.styleId),r.innerHTML=aXt(n);const i=document.head;i.childNodes.length>0?i.insertBefore(r,i.childNodes[0]):i.appendChild(r)}}tooltipHandler(e,n,r,i){if(this.el=document.getElementById(this.options.id),this.el||(this.el=document.createElement("div"),this.el.setAttribute("id",this.options.id),this.el.classList.add("vg-tooltip"),(document.fullscreenElement??document.body).appendChild(this.el)),i==null||i===""){this.el.classList.remove("visible",`${this.options.theme}-theme`);return}this.el.innerHTML=this.options.formatTooltip(i,this.options.sanitize,this.options.maxDepth,this.options.baseURL),this.el.classList.add("visible",`${this.options.theme}-theme`);const{x:o,y:s}=this.options.anchor==="mark"?lXt(e,n,r,this.el.getBoundingClientRect(),this.options):q6e(n,this.el.getBoundingClientRect(),this.options);this.el.style.top=`${s}px`,this.el.style.left=`${o}px`}}var n9={};/*! + * https://github.com/Starcounter-Jack/JSON-Patch + * (c) 2017-2022 Joachim Wester + * MIT licensed + */var dXt=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)i.hasOwnProperty(o)&&(r[o]=i[o])},t(e,n)};return function(e,n){t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),hXt=Object.prototype.hasOwnProperty;function rQ(t,e){return hXt.call(t,e)}function iQ(t){if(Array.isArray(t)){for(var e=new Array(t.length),n=0;n=48&&r<=57){e++;continue}return!1}return!0}function U0(t){return t.indexOf("/")===-1&&t.indexOf("~")===-1?t:t.replace(/~/g,"~0").replace(/\//g,"~1")}function Q6e(t){return t.replace(/~1/g,"/").replace(/~0/g,"~")}function sQ(t){if(t===void 0)return!0;if(t){if(Array.isArray(t)){for(var e=0,n=t.length;e0&&l[u-1]=="constructor"))throw new TypeError("JSON-Patch: modifying `__proto__` or `constructor/prototype` prop is banned for security reasons, if this was on purpose, please set `banPrototypeModifications` flag false and pass it to this function. More info in fast-json-patch README");if(n&&d===void 0&&(c[h]===void 0?d=l.slice(0,u).join("/"):u==f-1&&(d=e.path),d!==void 0&&p(e,0,t,d)),u++,Array.isArray(c)){if(h==="-")h=c.length;else{if(n&&!oQ(h))throw new Ii("Expected an unsigned base-10 integer value, making the new referenced value the array element with the zero-based index","OPERATION_PATH_ILLEGAL_ARRAY_INDEX",o,e,t);oQ(h)&&(h=~~h)}if(u>=f){if(n&&e.op==="add"&&h>c.length)throw new Ii("The specified index MUST NOT be greater than the number of elements in the array","OPERATION_VALUE_OUT_OF_BOUNDS",o,e,t);var s=gXt[e.op].call(e,c,h,t);if(s.test===!1)throw new Ii("Test operation failed","TEST_OPERATION_FAILED",o,e,t);return s}}else if(u>=f){var s=f_[e.op].call(e,c,h,t);if(s.test===!1)throw new Ii("Test operation failed","TEST_OPERATION_FAILED",o,e,t);return s}if(c=c[h],n&&u0)throw new Ii('Operation `path` property must start with "/"',"OPERATION_PATH_INVALID",e,t,n);if((t.op==="move"||t.op==="copy")&&typeof t.from!="string")throw new Ii("Operation `from` property is not present (applicable in `move` and `copy` operations)","OPERATION_FROM_REQUIRED",e,t,n);if((t.op==="add"||t.op==="replace"||t.op==="test")&&t.value===void 0)throw new Ii("Operation `value` property is not present (applicable in `add`, `replace` and `test` operations)","OPERATION_VALUE_REQUIRED",e,t,n);if((t.op==="add"||t.op==="replace"||t.op==="test")&&sQ(t.value))throw new Ii("Operation `value` property is not present (applicable in `add`, `replace` and `test` operations)","OPERATION_VALUE_CANNOT_CONTAIN_UNDEFINED",e,t,n);if(n){if(t.op=="add"){var i=t.path.split("/").length,o=r.split("/").length;if(i!==o+1&&i!==o)throw new Ii("Cannot perform an `add` operation at the desired path","OPERATION_PATH_CANNOT_ADD",e,t,n)}else if(t.op==="replace"||t.op==="remove"||t.op==="_get"){if(t.path!==r)throw new Ii("Cannot perform the operation at a path that does not exist","OPERATION_PATH_UNRESOLVABLE",e,t,n)}else if(t.op==="move"||t.op==="copy"){var s={op:"_get",path:t.from,value:void 0},a=Z6e([s],n);if(a&&a.name==="OPERATION_PATH_UNRESOLVABLE")throw new Ii("Cannot perform the operation from a path that does not exist","OPERATION_FROM_UNRESOLVABLE",e,t,n)}}}else throw new Ii("Operation `op` property is not one of operations defined in RFC-6902","OPERATION_OP_INVALID",e,t,n)}function Z6e(t,e,n){try{if(!Array.isArray(t))throw new Ii("Patch sequence must be an array","SEQUENCE_NOT_AN_ARRAY");if(e)Q6(sc(e),sc(t),n||!0);else{n=n||W5;for(var r=0;r0&&(t.patches=[],t.callback&&t.callback(r)),r}function Lae(t,e,n,r,i){if(e!==t){typeof e.toJSON=="function"&&(e=e.toJSON());for(var o=iQ(e),s=iQ(t),a=!1,l=s.length-1;l>=0;l--){var c=s[l],u=t[c];if(rQ(e,c)&&!(e[c]===void 0&&u!==void 0&&Array.isArray(e)===!1)){var f=e[c];typeof u=="object"&&u!=null&&typeof f=="object"&&f!=null&&Array.isArray(u)===Array.isArray(f)?Lae(u,f,n,r+"/"+U0(c),i):u!==f&&(i&&n.push({op:"test",path:r+"/"+U0(c),value:sc(u)}),n.push({op:"replace",path:r+"/"+U0(c),value:sc(f)}))}else Array.isArray(t)===Array.isArray(e)?(i&&n.push({op:"test",path:r+"/"+U0(c),value:sc(u)}),n.push({op:"remove",path:r+"/"+U0(c)}),a=!0):(i&&n.push({op:"test",path:r,value:t}),n.push({op:"replace",path:r,value:e}))}if(!(!a&&o.length==s.length))for(var l=0;l=this.max){const o=this.map.keys().next().value;this.delete(o)}this.map.set(n,r)}return this}}return r9=t,r9}var i9,z0e;function $ae(){if(z0e)return i9;z0e=1;const t=Object.freeze({loose:!0}),e=Object.freeze({});return i9=r=>r?typeof r!="object"?t:r:e,i9}var cL={exports:{}},o9,j0e;function Fae(){if(j0e)return o9;j0e=1;const t="2.0.0",e=256,n=Number.MAX_SAFE_INTEGER||9007199254740991,r=16,i=e-6;return o9={MAX_LENGTH:e,MAX_SAFE_COMPONENT_LENGTH:r,MAX_SAFE_BUILD_LENGTH:i,MAX_SAFE_INTEGER:n,RELEASE_TYPES:["major","premajor","minor","preminor","patch","prepatch","prerelease"],SEMVER_SPEC_VERSION:t,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2},o9}var s9,B0e;function K6(){return B0e||(B0e=1,s9=typeof process=="object"&&n9&&n9.NODE_DEBUG&&/\bsemver\b/i.test(n9.NODE_DEBUG)?(...e)=>console.error("SEMVER",...e):()=>{}),s9}var U0e;function Nae(){return U0e||(U0e=1,function(t,e){const{MAX_SAFE_COMPONENT_LENGTH:n,MAX_SAFE_BUILD_LENGTH:r,MAX_LENGTH:i}=Fae(),o=K6();e=t.exports={};const s=e.re=[],a=e.safeRe=[],l=e.src=[],c=e.t={};let u=0;const f="[a-zA-Z0-9-]",d=[["\\s",1],["\\d",i],[f,r]],h=g=>{for(const[m,v]of d)g=g.split(`${m}*`).join(`${m}{0,${v}}`).split(`${m}+`).join(`${m}{1,${v}}`);return g},p=(g,m,v)=>{const y=h(m),x=u++;o(g,x,m),c[g]=x,l[x]=m,s[x]=new RegExp(m,v?"g":void 0),a[x]=new RegExp(y,v?"g":void 0)};p("NUMERICIDENTIFIER","0|[1-9]\\d*"),p("NUMERICIDENTIFIERLOOSE","\\d+"),p("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${f}*`),p("MAINVERSION",`(${l[c.NUMERICIDENTIFIER]})\\.(${l[c.NUMERICIDENTIFIER]})\\.(${l[c.NUMERICIDENTIFIER]})`),p("MAINVERSIONLOOSE",`(${l[c.NUMERICIDENTIFIERLOOSE]})\\.(${l[c.NUMERICIDENTIFIERLOOSE]})\\.(${l[c.NUMERICIDENTIFIERLOOSE]})`),p("PRERELEASEIDENTIFIER",`(?:${l[c.NUMERICIDENTIFIER]}|${l[c.NONNUMERICIDENTIFIER]})`),p("PRERELEASEIDENTIFIERLOOSE",`(?:${l[c.NUMERICIDENTIFIERLOOSE]}|${l[c.NONNUMERICIDENTIFIER]})`),p("PRERELEASE",`(?:-(${l[c.PRERELEASEIDENTIFIER]}(?:\\.${l[c.PRERELEASEIDENTIFIER]})*))`),p("PRERELEASELOOSE",`(?:-?(${l[c.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${l[c.PRERELEASEIDENTIFIERLOOSE]})*))`),p("BUILDIDENTIFIER",`${f}+`),p("BUILD",`(?:\\+(${l[c.BUILDIDENTIFIER]}(?:\\.${l[c.BUILDIDENTIFIER]})*))`),p("FULLPLAIN",`v?${l[c.MAINVERSION]}${l[c.PRERELEASE]}?${l[c.BUILD]}?`),p("FULL",`^${l[c.FULLPLAIN]}$`),p("LOOSEPLAIN",`[v=\\s]*${l[c.MAINVERSIONLOOSE]}${l[c.PRERELEASELOOSE]}?${l[c.BUILD]}?`),p("LOOSE",`^${l[c.LOOSEPLAIN]}$`),p("GTLT","((?:<|>)?=?)"),p("XRANGEIDENTIFIERLOOSE",`${l[c.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),p("XRANGEIDENTIFIER",`${l[c.NUMERICIDENTIFIER]}|x|X|\\*`),p("XRANGEPLAIN",`[v=\\s]*(${l[c.XRANGEIDENTIFIER]})(?:\\.(${l[c.XRANGEIDENTIFIER]})(?:\\.(${l[c.XRANGEIDENTIFIER]})(?:${l[c.PRERELEASE]})?${l[c.BUILD]}?)?)?`),p("XRANGEPLAINLOOSE",`[v=\\s]*(${l[c.XRANGEIDENTIFIERLOOSE]})(?:\\.(${l[c.XRANGEIDENTIFIERLOOSE]})(?:\\.(${l[c.XRANGEIDENTIFIERLOOSE]})(?:${l[c.PRERELEASELOOSE]})?${l[c.BUILD]}?)?)?`),p("XRANGE",`^${l[c.GTLT]}\\s*${l[c.XRANGEPLAIN]}$`),p("XRANGELOOSE",`^${l[c.GTLT]}\\s*${l[c.XRANGEPLAINLOOSE]}$`),p("COERCEPLAIN",`(^|[^\\d])(\\d{1,${n}})(?:\\.(\\d{1,${n}}))?(?:\\.(\\d{1,${n}}))?`),p("COERCE",`${l[c.COERCEPLAIN]}(?:$|[^\\d])`),p("COERCEFULL",l[c.COERCEPLAIN]+`(?:${l[c.PRERELEASE]})?(?:${l[c.BUILD]})?(?:$|[^\\d])`),p("COERCERTL",l[c.COERCE],!0),p("COERCERTLFULL",l[c.COERCEFULL],!0),p("LONETILDE","(?:~>?)"),p("TILDETRIM",`(\\s*)${l[c.LONETILDE]}\\s+`,!0),e.tildeTrimReplace="$1~",p("TILDE",`^${l[c.LONETILDE]}${l[c.XRANGEPLAIN]}$`),p("TILDELOOSE",`^${l[c.LONETILDE]}${l[c.XRANGEPLAINLOOSE]}$`),p("LONECARET","(?:\\^)"),p("CARETTRIM",`(\\s*)${l[c.LONECARET]}\\s+`,!0),e.caretTrimReplace="$1^",p("CARET",`^${l[c.LONECARET]}${l[c.XRANGEPLAIN]}$`),p("CARETLOOSE",`^${l[c.LONECARET]}${l[c.XRANGEPLAINLOOSE]}$`),p("COMPARATORLOOSE",`^${l[c.GTLT]}\\s*(${l[c.LOOSEPLAIN]})$|^$`),p("COMPARATOR",`^${l[c.GTLT]}\\s*(${l[c.FULLPLAIN]})$|^$`),p("COMPARATORTRIM",`(\\s*)${l[c.GTLT]}\\s*(${l[c.LOOSEPLAIN]}|${l[c.XRANGEPLAIN]})`,!0),e.comparatorTrimReplace="$1$2$3",p("HYPHENRANGE",`^\\s*(${l[c.XRANGEPLAIN]})\\s+-\\s+(${l[c.XRANGEPLAIN]})\\s*$`),p("HYPHENRANGELOOSE",`^\\s*(${l[c.XRANGEPLAINLOOSE]})\\s+-\\s+(${l[c.XRANGEPLAINLOOSE]})\\s*$`),p("STAR","(<|>)?=?\\s*\\*"),p("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$"),p("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")}(cL,cL.exports)),cL.exports}var a9,W0e;function AXt(){if(W0e)return a9;W0e=1;const t=/^[0-9]+$/,e=(r,i)=>{const o=t.test(r),s=t.test(i);return o&&s&&(r=+r,i=+i),r===i?0:o&&!s?-1:s&&!o?1:re(i,r)},a9}var l9,V0e;function zae(){if(V0e)return l9;V0e=1;const t=K6(),{MAX_LENGTH:e,MAX_SAFE_INTEGER:n}=Fae(),{safeRe:r,t:i}=Nae(),o=$ae(),{compareIdentifiers:s}=AXt();class a{constructor(c,u){if(u=o(u),c instanceof a){if(c.loose===!!u.loose&&c.includePrerelease===!!u.includePrerelease)return c;c=c.version}else if(typeof c!="string")throw new TypeError(`Invalid version. Must be a string. Got type "${typeof c}".`);if(c.length>e)throw new TypeError(`version is longer than ${e} characters`);t("SemVer",c,u),this.options=u,this.loose=!!u.loose,this.includePrerelease=!!u.includePrerelease;const f=c.trim().match(u.loose?r[i.LOOSE]:r[i.FULL]);if(!f)throw new TypeError(`Invalid Version: ${c}`);if(this.raw=c,this.major=+f[1],this.minor=+f[2],this.patch=+f[3],this.major>n||this.major<0)throw new TypeError("Invalid major version");if(this.minor>n||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>n||this.patch<0)throw new TypeError("Invalid patch version");f[4]?this.prerelease=f[4].split(".").map(d=>{if(/^[0-9]+$/.test(d)){const h=+d;if(h>=0&&h=0;)typeof this.prerelease[h]=="number"&&(this.prerelease[h]++,h=-2);if(h===-1){if(u===this.prerelease.join(".")&&f===!1)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(d)}}if(u){let h=[u,d];f===!1&&(h=[u]),s(this.prerelease[0],u)===0?isNaN(this.prerelease[1])&&(this.prerelease=h):this.prerelease=h}break}default:throw new Error(`invalid increment argument: ${c}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}}return l9=a,l9}var c9,G0e;function zO(){if(G0e)return c9;G0e=1;const t=zae();return c9=(n,r,i)=>new t(n,i).compare(new t(r,i)),c9}var u9,H0e;function PXt(){if(H0e)return u9;H0e=1;const t=zO();return u9=(n,r,i)=>t(n,r,i)===0,u9}var f9,q0e;function MXt(){if(q0e)return f9;q0e=1;const t=zO();return f9=(n,r,i)=>t(n,r,i)!==0,f9}var d9,X0e;function RXt(){if(X0e)return d9;X0e=1;const t=zO();return d9=(n,r,i)=>t(n,r,i)>0,d9}var h9,Y0e;function DXt(){if(Y0e)return h9;Y0e=1;const t=zO();return h9=(n,r,i)=>t(n,r,i)>=0,h9}var p9,Q0e;function IXt(){if(Q0e)return p9;Q0e=1;const t=zO();return p9=(n,r,i)=>t(n,r,i)<0,p9}var g9,K0e;function LXt(){if(K0e)return g9;K0e=1;const t=zO();return g9=(n,r,i)=>t(n,r,i)<=0,g9}var m9,Z0e;function $Xt(){if(Z0e)return m9;Z0e=1;const t=PXt(),e=MXt(),n=RXt(),r=DXt(),i=IXt(),o=LXt();return m9=(a,l,c,u)=>{switch(l){case"===":return typeof a=="object"&&(a=a.version),typeof c=="object"&&(c=c.version),a===c;case"!==":return typeof a=="object"&&(a=a.version),typeof c=="object"&&(c=c.version),a!==c;case"":case"=":case"==":return t(a,c,u);case"!=":return e(a,c,u);case">":return n(a,c,u);case">=":return r(a,c,u);case"<":return i(a,c,u);case"<=":return o(a,c,u);default:throw new TypeError(`Invalid operator: ${l}`)}},m9}var v9,J0e;function FXt(){if(J0e)return v9;J0e=1;const t=Symbol("SemVer ANY");class e{static get ANY(){return t}constructor(u,f){if(f=n(f),u instanceof e){if(u.loose===!!f.loose)return u;u=u.value}u=u.trim().split(/\s+/).join(" "),s("comparator",u,f),this.options=f,this.loose=!!f.loose,this.parse(u),this.semver===t?this.value="":this.value=this.operator+this.semver.version,s("comp",this)}parse(u){const f=this.options.loose?r[i.COMPARATORLOOSE]:r[i.COMPARATOR],d=u.match(f);if(!d)throw new TypeError(`Invalid comparator: ${u}`);this.operator=d[1]!==void 0?d[1]:"",this.operator==="="&&(this.operator=""),d[2]?this.semver=new a(d[2],this.options.loose):this.semver=t}toString(){return this.value}test(u){if(s("Comparator.test",u,this.options.loose),this.semver===t||u===t)return!0;if(typeof u=="string")try{u=new a(u,this.options)}catch{return!1}return o(u,this.operator,this.semver,this.options)}intersects(u,f){if(!(u instanceof e))throw new TypeError("a Comparator is required");return this.operator===""?this.value===""?!0:new l(u.value,f).test(this.value):u.operator===""?u.value===""?!0:new l(this.value,f).test(u.semver):(f=n(f),f.includePrerelease&&(this.value==="<0.0.0-0"||u.value==="<0.0.0-0")||!f.includePrerelease&&(this.value.startsWith("<0.0.0")||u.value.startsWith("<0.0.0"))?!1:!!(this.operator.startsWith(">")&&u.operator.startsWith(">")||this.operator.startsWith("<")&&u.operator.startsWith("<")||this.semver.version===u.semver.version&&this.operator.includes("=")&&u.operator.includes("=")||o(this.semver,"<",u.semver,f)&&this.operator.startsWith(">")&&u.operator.startsWith("<")||o(this.semver,">",u.semver,f)&&this.operator.startsWith("<")&&u.operator.startsWith(">")))}}v9=e;const n=$ae(),{safeRe:r,t:i}=Nae(),o=$Xt(),s=K6(),a=zae(),l=J6e();return v9}var y9,exe;function J6e(){if(exe)return y9;exe=1;const t=/\s+/g;class e{constructor(M,I){if(I=i(I),M instanceof e)return M.loose===!!I.loose&&M.includePrerelease===!!I.includePrerelease?M:new e(M.raw,I);if(M instanceof o)return this.raw=M.value,this.set=[[M]],this.formatted=void 0,this;if(this.options=I,this.loose=!!I.loose,this.includePrerelease=!!I.includePrerelease,this.raw=M.trim().replace(t," "),this.set=this.raw.split("||").map(j=>this.parseRange(j.trim())).filter(j=>j.length),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){const j=this.set[0];if(this.set=this.set.filter(N=>!g(N[0])),this.set.length===0)this.set=[j];else if(this.set.length>1){for(const N of this.set)if(N.length===1&&m(N[0])){this.set=[N];break}}}this.formatted=void 0}get range(){if(this.formatted===void 0){this.formatted="";for(let M=0;M0&&(this.formatted+="||");const I=this.set[M];for(let j=0;j0&&(this.formatted+=" "),this.formatted+=I[j].toString().trim()}}return this.formatted}format(){return this.range}toString(){return this.range}parseRange(M){const j=((this.options.includePrerelease&&h)|(this.options.loose&&p))+":"+M,N=r.get(j);if(N)return N;const z=this.options.loose,L=z?l[c.HYPHENRANGELOOSE]:l[c.HYPHENRANGE];M=M.replace(L,A(this.options.includePrerelease)),s("hyphen replace",M),M=M.replace(l[c.COMPARATORTRIM],u),s("comparator trim",M),M=M.replace(l[c.TILDETRIM],f),s("tilde trim",M),M=M.replace(l[c.CARETTRIM],d),s("caret trim",M);let B=M.split(" ").map(G=>y(G,this.options)).join(" ").split(/\s+/).map(G=>P(G,this.options));z&&(B=B.filter(G=>(s("loose invalid filter",G,this.options),!!G.match(l[c.COMPARATORLOOSE])))),s("range list",B);const F=new Map,$=B.map(G=>new o(G,this.options));for(const G of $){if(g(G))return[G];F.set(G.value,G)}F.size>1&&F.has("")&&F.delete("");const q=[...F.values()];return r.set(j,q),q}intersects(M,I){if(!(M instanceof e))throw new TypeError("a Range is required");return this.set.some(j=>v(j,I)&&M.set.some(N=>v(N,I)&&j.every(z=>N.every(L=>z.intersects(L,I)))))}test(M){if(!M)return!1;if(typeof M=="string")try{M=new a(M,this.options)}catch{return!1}for(let I=0;IT.value==="<0.0.0-0",m=T=>T.value==="",v=(T,M)=>{let I=!0;const j=T.slice();let N=j.pop();for(;I&&j.length;)I=j.every(z=>N.intersects(z,M)),N=j.pop();return I},y=(T,M)=>(s("comp",T,M),T=_(T,M),s("caret",T),T=b(T,M),s("tildes",T),T=O(T,M),s("xrange",T),T=E(T,M),s("stars",T),T),x=T=>!T||T.toLowerCase()==="x"||T==="*",b=(T,M)=>T.trim().split(/\s+/).map(I=>w(I,M)).join(" "),w=(T,M)=>{const I=M.loose?l[c.TILDELOOSE]:l[c.TILDE];return T.replace(I,(j,N,z,L,B)=>{s("tilde",T,j,N,z,L,B);let F;return x(N)?F="":x(z)?F=`>=${N}.0.0 <${+N+1}.0.0-0`:x(L)?F=`>=${N}.${z}.0 <${N}.${+z+1}.0-0`:B?(s("replaceTilde pr",B),F=`>=${N}.${z}.${L}-${B} <${N}.${+z+1}.0-0`):F=`>=${N}.${z}.${L} <${N}.${+z+1}.0-0`,s("tilde return",F),F})},_=(T,M)=>T.trim().split(/\s+/).map(I=>S(I,M)).join(" "),S=(T,M)=>{s("caret",T,M);const I=M.loose?l[c.CARETLOOSE]:l[c.CARET],j=M.includePrerelease?"-0":"";return T.replace(I,(N,z,L,B,F)=>{s("caret",T,N,z,L,B,F);let $;return x(z)?$="":x(L)?$=`>=${z}.0.0${j} <${+z+1}.0.0-0`:x(B)?z==="0"?$=`>=${z}.${L}.0${j} <${z}.${+L+1}.0-0`:$=`>=${z}.${L}.0${j} <${+z+1}.0.0-0`:F?(s("replaceCaret pr",F),z==="0"?L==="0"?$=`>=${z}.${L}.${B}-${F} <${z}.${L}.${+B+1}-0`:$=`>=${z}.${L}.${B}-${F} <${z}.${+L+1}.0-0`:$=`>=${z}.${L}.${B}-${F} <${+z+1}.0.0-0`):(s("no pr"),z==="0"?L==="0"?$=`>=${z}.${L}.${B}${j} <${z}.${L}.${+B+1}-0`:$=`>=${z}.${L}.${B}${j} <${z}.${+L+1}.0-0`:$=`>=${z}.${L}.${B} <${+z+1}.0.0-0`),s("caret return",$),$})},O=(T,M)=>(s("replaceXRanges",T,M),T.split(/\s+/).map(I=>k(I,M)).join(" ")),k=(T,M)=>{T=T.trim();const I=M.loose?l[c.XRANGELOOSE]:l[c.XRANGE];return T.replace(I,(j,N,z,L,B,F)=>{s("xRange",T,j,N,z,L,B,F);const $=x(z),q=$||x(L),G=q||x(B),Y=G;return N==="="&&Y&&(N=""),F=M.includePrerelease?"-0":"",$?N===">"||N==="<"?j="<0.0.0-0":j="*":N&&Y?(q&&(L=0),B=0,N===">"?(N=">=",q?(z=+z+1,L=0,B=0):(L=+L+1,B=0)):N==="<="&&(N="<",q?z=+z+1:L=+L+1),N==="<"&&(F="-0"),j=`${N+z}.${L}.${B}${F}`):q?j=`>=${z}.0.0${F} <${+z+1}.0.0-0`:G&&(j=`>=${z}.${L}.0${F} <${z}.${+L+1}.0-0`),s("xRange return",j),j})},E=(T,M)=>(s("replaceStars",T,M),T.trim().replace(l[c.STAR],"")),P=(T,M)=>(s("replaceGTE0",T,M),T.trim().replace(l[M.includePrerelease?c.GTE0PRE:c.GTE0],"")),A=T=>(M,I,j,N,z,L,B,F,$,q,G,Y)=>(x(j)?I="":x(N)?I=`>=${j}.0.0${T?"-0":""}`:x(z)?I=`>=${j}.${N}.0${T?"-0":""}`:L?I=`>=${I}`:I=`>=${I}${T?"-0":""}`,x($)?F="":x(q)?F=`<${+$+1}.0.0-0`:x(G)?F=`<${$}.${+q+1}.0-0`:Y?F=`<=${$}.${q}.${G}-${Y}`:T?F=`<${$}.${q}.${+G+1}-0`:F=`<=${F}`,`${I} ${F}`.trim()),R=(T,M,I)=>{for(let j=0;j0){const N=T[j].semver;if(N.major===M.major&&N.minor===M.minor&&N.patch===M.patch)return!0}return!1}return!0};return y9}var x9,txe;function NXt(){if(txe)return x9;txe=1;const t=J6e();return x9=(n,r,i)=>{try{r=new t(r,i)}catch{return!1}return r.test(n)},x9}var zXt=NXt(),eUe=TXt(zXt);function jXt(t,e,n){const r=t.open(e),i=1e4,o=250,{origin:s}=new URL(e);let a=~~(i/o);function l(u){u.source===r&&(a=0,t.removeEventListener("message",l,!1))}t.addEventListener("message",l,!1);function c(){a<=0||(r.postMessage(n,s),setTimeout(c,o),a-=1)}setTimeout(c,o)}var BXt=`.vega-embed { position: relative; display: inline-block; box-sizing: border-box; @@ -447,12 +449,12 @@ https://github.com/nodeca/pako/blob/main/LICENSE transform: scale(1); } } -`;function A6e(t,...e){for(const n of e)GXt(t,n);return t}function GXt(t,e){for(const n of Object.keys(e))vO(t,n,e[n],!0)}const uf=DBt;let JA=zHt;const pL=typeof window<"u"?window:void 0;var IEe;JA===void 0&&((IEe=pL==null?void 0:pL.vl)!=null&&IEe.compile)&&(JA=pL.vl);const HXt={export:{svg:!0,png:!0},source:!0,compiled:!0,editor:!0},qXt={CLICK_TO_VIEW_ACTIONS:"Click to view actions",COMPILED_ACTION:"View Compiled Vega",EDITOR_ACTION:"Open in Vega Editor",PNG_ACTION:"Save as PNG",SOURCE_ACTION:"View Source",SVG_ACTION:"Save as SVG"},ST={vega:"Vega","vega-lite":"Vega-Lite"},X5={vega:uf.version,"vega-lite":JA?JA.version:"not available"},XXt={vega:t=>t,"vega-lite":(t,e)=>JA.compile(t,{config:e}).spec},YXt=` +`;function tUe(t,...e){for(const n of e)UXt(t,n);return t}function UXt(t,e){for(const n of Object.keys(e))mO(t,n,e[n],!0)}const uf=qBt;let JA=JHt;const uL=typeof window<"u"?window:void 0;var a2e;JA===void 0&&((a2e=uL==null?void 0:uL.vl)!=null&&a2e.compile)&&(JA=uL.vl);const WXt={export:{svg:!0,png:!0},source:!0,compiled:!0,editor:!0},VXt={CLICK_TO_VIEW_ACTIONS:"Click to view actions",COMPILED_ACTION:"View Compiled Vega",EDITOR_ACTION:"Open in Vega Editor",PNG_ACTION:"Save as PNG",SOURCE_ACTION:"View Source",SVG_ACTION:"Save as SVG"},_T={vega:"Vega","vega-lite":"Vega-Lite"},V5={vega:uf.version,"vega-lite":JA?JA.version:"not available"},GXt={vega:t=>t,"vega-lite":(t,e)=>JA.compile(t,{config:e}).spec},HXt=` -`,QXt="chart-wrapper";function KXt(t){return typeof t=="function"}function T0e(t,e,n,r){const i=`${e}
`,o=`
${n}`,s=window.open("");s.document.write(i+t+o),s.document.title=`${ST[r]} JSON Source`}function ZXt(t,e){if(t.$schema){const n=w6e(t.$schema);e&&e!==n.library&&console.warn(`The given visualization spec is written in ${ST[n.library]}, but mode argument sets ${ST[e]??e}.`);const r=n.library;return k6e(X5[r],`^${n.version.slice(1)}`)||console.warn(`The input spec uses ${ST[r]} ${n.version}, but the current version of ${ST[r]} is v${X5[r]}.`),r}return"mark"in t||"encoding"in t||"layer"in t||"hconcat"in t||"vconcat"in t||"facet"in t||"repeat"in t?"vega-lite":"marks"in t||"signals"in t||"scales"in t||"axes"in t?"vega":e??"vega"}function P6e(t){return!!(t&&"load"in t)}function k0e(t){return P6e(t)?t:uf.loader(t)}function JXt(t){var n;const e=((n=t.usermeta)==null?void 0:n.embedOptions)??{};return gt(e.defaultStyle)&&(e.defaultStyle=!1),e}async function eYt(t,e,n={}){let r,i;gt(e)?(i=k0e(n.loader),r=JSON.parse(await i.load(e))):r=e;const o=JXt(r),s=o.loader;(!i||s)&&(i=k0e(n.loader??s));const a=await A0e(o,i),l=await A0e(n,i),c={...A6e(l,a),config:mO(l.config??{},a.config??{})};return await nYt(t,r,c,i)}async function A0e(t,e){const n=gt(t.config)?JSON.parse(await e.load(t.config)):t.config??{},r=gt(t.patch)?JSON.parse(await e.load(t.patch)):t.patch;return{...t,...r?{patch:r}:{},...n?{config:n}:{}}}function tYt(t){const e=t.getRootNode?t.getRootNode():document;return e instanceof ShadowRoot?{root:e,rootContainer:e}:{root:document,rootContainer:document.head??document.body}}async function nYt(t,e,n={},r){const i=n.theme?mO(Bqt[n.theme],n.config??{}):n.config,o=By(n.actions)?n.actions:A6e({},HXt,n.actions??{}),s={...qXt,...n.i18n},a=n.renderer??"canvas",l=n.logLevel??uf.Warn,c=n.downloadFileName??"visualization",u=typeof t=="string"?document.querySelector(t):t;if(!u)throw new Error(`${t} does not exist`);if(n.defaultStyle!==!1){const w="vega-embed-style",{root:_,rootContainer:S}=tYt(u);if(!_.getElementById(w)){const O=document.createElement("style");O.id=w,O.innerHTML=n.defaultStyle===void 0||n.defaultStyle===!0?VXt.toString():n.defaultStyle,S.appendChild(O)}}const f=ZXt(e,n.mode);let d=XXt[f](e,i);if(f==="vega-lite"&&d.$schema){const w=w6e(d.$schema);k6e(X5.vega,`^${w.version.slice(1)}`)||console.warn(`The compiled spec uses Vega ${w.version}, but current version is v${X5.vega}.`)}u.classList.add("vega-embed"),o&&u.classList.add("has-actions"),u.innerHTML="";let h=u;if(o){const w=document.createElement("div");w.classList.add(QXt),u.appendChild(w),h=w}const p=n.patch;if(p&&(d=p instanceof Function?p(d):G4(d,p,!0,!1).newDocument),n.formatLocale&&uf.formatLocale(n.formatLocale),n.timeFormatLocale&&uf.timeFormatLocale(n.timeFormatLocale),n.expressionFunctions)for(const w in n.expressionFunctions){const _=n.expressionFunctions[w];"fn"in _?uf.expressionFunction(w,_.fn,_.visitor):_ instanceof Function&&uf.expressionFunction(w,_)}const{ast:g}=n,m=uf.parse(d,f==="vega-lite"?{}:i,{ast:g}),v=new(n.viewClass||uf.View)(m,{loader:r,logLevel:l,renderer:a,...g?{expr:uf.expressionInterpreter??n.expr??WBt}:{}});if(v.addSignalListener("autosize",(w,_)=>{const{type:S}=_;S=="fit-x"?(h.classList.add("fit-x"),h.classList.remove("fit-y")):S=="fit-y"?(h.classList.remove("fit-x"),h.classList.add("fit-y")):S=="fit"?h.classList.add("fit-x","fit-y"):h.classList.remove("fit-x","fit-y")}),n.tooltip!==!1){const{loader:w,tooltip:_}=n,S=w&&!P6e(w)?w==null?void 0:w.baseURL:void 0,O=KXt(_)?_:new Yqt({baseURL:S,..._===!0?{}:_}).call;v.tooltip(O)}let{hover:y}=n;if(y===void 0&&(y=f==="vega"),y){const{hoverSet:w,updateSet:_}=typeof y=="boolean"?{}:y;v.hover(w,_)}n&&(n.width!=null&&v.width(n.width),n.height!=null&&v.height(n.height),n.padding!=null&&v.padding(n.padding)),await v.initialize(h,n.bind).runAsync();let x;if(o!==!1){let w=u;if(n.defaultStyle!==!1||n.forceActionsMenu){const S=document.createElement("details");S.title=s.CLICK_TO_VIEW_ACTIONS,u.append(S),w=S;const O=document.createElement("summary");O.innerHTML=YXt,S.append(O),x=k=>{S.contains(k.target)||S.removeAttribute("open")},document.addEventListener("click",x)}const _=document.createElement("div");if(w.append(_),_.classList.add("vega-actions"),o===!0||o.export!==!1){for(const S of["svg","png"])if(o===!0||o.export===!0||o.export[S]){const O=s[`${S.toUpperCase()}_ACTION`],k=document.createElement("a"),E=ht(n.scaleFactor)?n.scaleFactor[S]:n.scaleFactor;k.text=O,k.href="#",k.target="_blank",k.download=`${c}.${S}`,k.addEventListener("mousedown",async function(M){M.preventDefault();const A=await v.toImageURL(S,E);this.href=A}),_.append(k)}}if(o===!0||o.source!==!1){const S=document.createElement("a");S.text=s.SOURCE_ACTION,S.href="#",S.addEventListener("click",function(O){T0e(RW(e),n.sourceHeader??"",n.sourceFooter??"",f),O.preventDefault()}),_.append(S)}if(f==="vega-lite"&&(o===!0||o.compiled!==!1)){const S=document.createElement("a");S.text=s.COMPILED_ACTION,S.href="#",S.addEventListener("click",function(O){T0e(RW(d),n.sourceHeader??"",n.sourceFooter??"","vega"),O.preventDefault()}),_.append(S)}if(o===!0||o.editor!==!1){const S=n.editorUrl??"https://vega.github.io/editor/",O=document.createElement("a");O.text=s.EDITOR_ACTION,O.href="#",O.addEventListener("click",function(k){WXt(window,S,{config:i,mode:p?"vega":f,renderer:a,spec:RW(p?d:e)}),k.preventDefault()}),_.append(O)}}function b(){x&&document.removeEventListener("click",x),v.finalize()}return{view:v,spec:e,vgSpec:d,finalize:b,embedOptions:n}}function rYt(t){return!!t&&{}.toString.call(t)==="[object Function]"}function iYt(t,e,n){n&&(rYt(n)?n(t.data(e)):t.change(e,uf.changeset().remove(()=>!0).insert(n)))}function oYt(t,e){Object.keys(e).forEach(n=>{iYt(t,n,e[n])})}function M6e(t){const e=new Set;return t.forEach(n=>{Object.keys(n).forEach(r=>{e.add(r)})}),e}const R6e=()=>{};function o9(t,e){const n=Object.keys(e);return n.forEach(r=>{try{t.addSignalListener(r,e[r])}catch(i){console.warn("Cannot add invalid signal listener.",i)}}),n.length>0}var sYt=function t(e,n){if(e===n)return!0;if(e&&n&&typeof e=="object"&&typeof n=="object"){if(e.constructor!==n.constructor)return!1;var r,i,o;if(Array.isArray(e)){if(r=e.length,r!=n.length)return!1;for(i=r;i--!==0;)if(!t(e[i],n[i]))return!1;return!0}if(e.constructor===RegExp)return e.source===n.source&&e.flags===n.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===n.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===n.toString();if(o=Object.keys(e),r=o.length,r!==Object.keys(n).length)return!1;for(i=r;i--!==0;)if(!Object.prototype.hasOwnProperty.call(n,o[i]))return!1;for(i=r;i--!==0;){var s=o[i];if(!t(e[s],n[s]))return!1}return!0}return e!==e&&n!==n};const aYt=on(sYt);function lYt(t,e){if(t===e)return!1;const n={width:!1,height:!1,isExpensive:!1},r=M6e([t,e]);return r.has("width")&&(!("width"in t)||!("width"in e)||t.width!==e.width)&&("width"in t&&typeof t.width=="number"?n.width=t.width:n.isExpensive=!0),r.has("height")&&(!("height"in t)||!("height"in e)||t.height!==e.height)&&("height"in t&&typeof t.height=="number"?n.height=t.height:n.isExpensive=!0),r.delete("width"),r.delete("height"),[...r].some(i=>!(i in t)||!(i in e)||!aYt(t[i],e[i]))&&(n.isExpensive=!0),n.width!==!1||n.height!==!1||n.isExpensive?n:!1}function P0e(t,e){const n=Object.keys(e);return n.forEach(r=>{try{t.removeSignalListener(r,e[r])}catch(i){console.warn("Cannot remove invalid signal listener.",i)}}),n.length>0}function s9(t){const{spec:e,width:n,height:r}=t;return typeof n<"u"&&typeof r<"u"?{...e,width:n,height:r}:typeof n<"u"?{...e,width:n}:typeof r<"u"?{...e,height:r}:e}function CT(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}class D6e extends de.PureComponent{constructor(){super(...arguments),CT(this,"containerRef",de.createRef()),CT(this,"resultPromise",void 0),CT(this,"handleError",e=>{const{onError:n=R6e}=this.props;n(e,this.containerRef.current),console.warn(e)}),CT(this,"modifyView",e=>{this.resultPromise&&this.resultPromise.then(n=>(n&&e(n.view),!0)).catch(this.handleError)})}componentDidMount(){this.createView()}componentDidUpdate(e){const n=M6e([this.props,e]);if(n.delete("className"),n.delete("signalListeners"),n.delete("spec"),n.delete("style"),n.delete("width"),n.delete("height"),Array.from(n).some(r=>this.props[r]!==e[r]))this.clearView(),this.createView();else{const r=lYt(s9(this.props),s9(e)),{signalListeners:i}=this.props,{signalListeners:o}=e;if(r)if(r.isExpensive)this.clearView(),this.createView();else{const s=!Dq(i,o);this.modifyView(a=>{r.width!==!1&&a.width(r.width),r.height!==!1&&a.height(r.height),s&&(o&&P0e(a,o),i&&o9(a,i)),a.run()})}else Dq(i,o)||this.modifyView(s=>{o&&P0e(s,o),i&&o9(s,i),s.run()})}}componentWillUnmount(){this.clearView()}createView(){const{spec:e,onNewView:n,signalListeners:r={},width:i,height:o,...s}=this.props;if(this.containerRef.current){const a=s9(this.props);this.resultPromise=eYt(this.containerRef.current,a,s).then(l=>{if(l){const{view:c}=l;o9(c,r)&&c.run()}return l}).catch(this.handleError),n&&this.modifyView(n)}}clearView(){return this.resultPromise&&this.resultPromise.then(e=>{e&&e.finalize()}).catch(this.handleError),this.resultPromise=void 0,this}render(){const{className:e,style:n}=this.props;return de.createElement("div",{ref:this.containerRef,className:e,style:n})}}CT(D6e,"propTypes",{className:pe.string,onError:pe.func});function qY(){return qY=Object.assign||function(t){for(var e=1;e{this.update();const{onNewView:n=R6e}=this.props;n(e)})}componentDidMount(){this.update()}componentDidUpdate(e){Dq(this.props.data,e.data)||this.update()}update(){const{data:e}=this.props;this.vegaEmbed.current&&e&&Object.keys(e).length>0&&this.vegaEmbed.current.modifyView(n=>{oYt(n,e),n.resize().run()})}render(){const{data:e,...n}=this.props;return de.createElement(D6e,qY({ref:this.vegaEmbed},n,{onNewView:this.handleNewView}))}}XY(I6e,"defaultProps",{data:cYt});function YY(){return YY=Object.assign||function(t){for(var e=1;ee in t?fYt(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,hYt=(t,e,n)=>dYt(t,e+"",n);const Cs=j_t(()=>({configuration:{},extensions:[],contributionsResult:{},contributionsRecord:{}}));function W_(t){return typeof t=="object"&&t!==null}function fC(t,e){e=dC(e);let n=t;for(const r of e)if(W_(n))n=n[r];else return;return n}function L6e(t,e,n){return $6e(t,dC(e),n)}function $6e(t,e,n){if(e.length===1){const r=e[0];if(W_(t)){const i=t[r];if(n===i)return t;const o=Array.isArray(t)?[...t]:{...t};return o[r]=n,o}else if(t===void 0){const i=typeof r=="number"?[]:{};return i[r]=n,i}}else if(e.length>1&&W_(t)){const r=e[0],i=t[r];if(W_(i)||i===void 0){const o=$6e(i,e.slice(1),n);if(i!==o){const s=Array.isArray(t)?[...t]:{...t};return s[r]=o,s}}}return t}function dC(t){if(Array.isArray(t))return t;if(!t||t==="")return[];if(typeof t=="number")return[t];{const e=t.split(".");for(let n=0;ni===r[o])}function F6e(t,e){const n={};return Object.getOwnPropertyNames(t).forEach(r=>{n[r]=e(t[r],r)}),n}function gYt(t,e){return Object.prototype.hasOwnProperty.call(t,e)}const mYt="http://localhost:8888",vYt="chartlets";async function _ae(t,...e){try{return{status:"ok",data:await t(...e)}}catch(n){return n instanceof N3?{status:"failed",error:n.apiError}:{status:"failed",error:{message:`${n.message||n}`}}}}async function Sae(t,e,n){const r=await fetch(t,e),i=await r.json();if(typeof i=="object"){if(i.error)throw new N3(i.error);if(!r.ok)throw new N3({status:r.status,message:r.statusText});if(gYt(i,"result"))return n?n(i.result):i.result}throw new N3({message:`unexpected response from ${t}`})}class N3 extends Error{constructor(e){super(e.message),hYt(this,"apiError"),this.apiError=e}}function Cae(t,e){const n=(e==null?void 0:e.serverUrl)||mYt,r=(e==null?void 0:e.endpointName)||vYt;return`${n}/${r}/${t}`}async function yYt(t){return _ae(xYt,t)}async function xYt(t){return Sae(Cae("contributions",t),void 0,bYt)}function bYt(t){return{...t,contributions:F6e(t.contributions,e=>e.map(n=>({...n,layout:n.layout?N6e(n.layout):void 0,callbacks:wYt(n.callbacks)})))}}function wYt(t){return t?t.map(N6e):[]}function N6e(t){return{...t,inputs:t.inputs?M0e(t.inputs):[],outputs:t.outputs?M0e(t.outputs):[]}}function M0e(t){return t?t.map(_Yt):[]}function _Yt(t){return{...t,property:dC(t.property)}}const a9="color:light-dark(lightblue, lightblue)",l9="font-weight:bold",c9="color:light-dark(darkgrey, lightgray)";let gL;function SYt(t){gL&&(gL(),gL=void 0),(!t||t.enabled)&&(gL=Cs.subscribe(CYt))}function CYt(t,e){const n=FDe(e,t),r=n.length;console.groupCollapsed(`chartlets: state changed (${r} difference${r===1?"":"s"})`),n.forEach(OYt),console.debug("chartlets: change details:",{prev:e,next:t,delta:n}),console.groupEnd()}function OYt(t,e){const n=`%c${e+1} %c${t.type} %c${t.path.join(".")}`;t.type==="CREATE"?console.debug("chartlets:",n,a9,l9,c9,{value:t.value}):t.type==="CHANGE"?console.debug("chartlets:",n,a9,l9,c9,{value:t.value,oldValue:t.oldValue}):t.type==="REMOVE"&&console.debug("chartlets:",n,a9,l9,c9,{oldValue:t.oldValue})}function z6e(t){return!!t.components}function Oae(t,e,n){return t.map(r=>EYt(r,e,n))}const QY={};function EYt(t,e,n){let r;const i=t.link||"component";return i==="component"&&e.component?r=j6e(t,e.component):i==="container"&&e.container?r=R0e(t,e.container):i==="app"&&n?(console.log(),r=R0e(t,n)):console.warn("input with unknown data source:",t),(r===void 0||r===QY)&&(r=null,console.warn("value is undefined for input",t)),r}function j6e(t,e){if(e.id===t.id)return fC(e,t.property);if(z6e(e))for(let n=0;n{i=V6e(i,o.stateChanges.filter(s=>s.link==="app"))}),i!==r&&n.setState(i)}}function PYt(t,e){let n=t;return n&&e.forEach(r=>{n=W6e(n,r)}),n}function MYt(t,e){return e.forEach(({contribPoint:n,contribIndex:r,stateChanges:i})=>{const o=t[n][r],s=V6e(o.container,i.filter(l=>l.link==="container")),a=PYt(o.component,i.filter(l=>!l.link||l.link==="component"));(s!==o.container||a!==o.component)&&(t={...t,[n]:B6e(t[n],r,{...o,container:s,component:a})})}),t}function W6e(t,e){if(t.id===e.id){const n=e.property,r=fC(t,n),i=e.value;if(r!==i)return L6e(t,n,i)}else if(z6e(t)){const n=t;let r=n;for(let i=0;i{(!t||fC(t,n.property)!==n.value)&&(t=L6e(t,n.property,n.value))}),t}function G6e(t){var e;const{configuration:n}=Cs.getState(),r=(e=n.logging)==null?void 0:e.enabled;if(!t.length){r&&console.info("chartlets: invokeCallbacks - no requests",t);return}const i=DYt();r&&console.info(`chartlets: invokeCallbacks (${i})-->`,t),TYt(t,n.api).then(o=>{o.data?(r&&console.info(`chartlets: invokeCallbacks <--(${i})`,o.data),U6e(o.data)):console.error("callback failed:",o.error,"for call requests:",t)})}let RYt=0;function DYt(){return RYt++}function IYt(t,e){const{contributionsRecord:n}=Cs.getState(),r=LYt(n,t,e);G6e(r)}function LYt(t,e,n){return $Yt().filter(r=>FYt(r.propertyPath,e,n)).map(r=>{const i=t[r.contribPoint][r.contribIndex],o=i.callbacks[r.callbackIndex],s=Oae(o.inputs,i,e);return{...r,inputValues:s}})}function $Yt(){const{contributionsRecord:t}=Cs.getState(),e=[];return Object.getOwnPropertyNames(t).forEach(n=>{t[n].forEach((r,i)=>{(r.callbacks||[]).forEach((o,s)=>(o.inputs||[]).forEach((a,l)=>{!a.noTrigger&&a.link==="app"&&e.push({contribPoint:n,contribIndex:i,callbackIndex:s,inputIndex:l,propertyPath:dC(a.property)})}),[])})}),e}function FYt(t,e,n){const r=fC(e,t),i=fC(n,t);return!Object.is(r,i)}function NYt(t){t.logging&&SYt(t.logging),t.hostStore&&t.hostStore.subscribe(IYt),Cs.setState({configuration:{...t}})}function zYt(t){t&&NYt(t);const{configuration:e}=Cs.getState();Cs.setState({contributionsResult:{status:"pending"}}),yYt(e.api).then(jYt)}function jYt(t){let e={contributionsResult:t};if(t.data){const{extensions:n,contributions:r}=t.data;e={...e,extensions:n,contributionsRecord:F6e(r,i=>i.map(BYt))}}Cs.setState(e)}function BYt(t){return{...t,container:{...t.initialState},componentResult:{}}}function UYt(t,e,n){U6e([{contribPoint:t,contribIndex:e,stateChanges:[{link:"component",id:n.id,property:n.property,value:n.value}]}]);const r=WYt(t,e,n);G6e(r)}function WYt(t,e,n){const{configuration:r,contributionsRecord:i}=Cs.getState(),{hostStore:o}=r,s=o==null?void 0:o.getState(),a=i[t][e],l=[];return(a.callbacks||[]).forEach((c,u)=>{if(c.inputs&&c.inputs.length){const f=c.inputs,d=f.findIndex(h=>!h.noTrigger&&(!h.link||h.link==="component")&&h.id===n.id&&pYt(h.property,n.property));d>=0&&l.push({contribPoint:t,contribIndex:e,callbackIndex:u,inputIndex:d,inputValues:Oae(f,a,s)})}}),l}async function VYt(t,e,n,r){return _ae(GYt,t,e,n,r)}async function GYt(t,e,n,r){return Sae(Cae(`layout/${t}/${e}`,r),{body:JSON.stringify({inputValues:n}),method:"post"})}function HYt(t,e,n,r=!0){const{configuration:i,contributionsRecord:o}=Cs.getState(),s=o[t][e];if(s.container===n)return;const a=!!s.componentResult.status;if(!r||a)u9(t,e,{container:n});else if(!a){u9(t,e,{container:n,componentResult:{status:"pending"}});const l=qYt(t,e);VYt(t,e,l,i.api).then(c=>{u9(t,e,{componentResult:c,component:c.data})})}}function qYt(t,e){const{configuration:n,contributionsRecord:r}=Cs.getState(),{hostStore:i}=n,o=r[t][e],s=o.layout.inputs;return s&&s.length>0?Oae(s,o,i==null?void 0:i.getState()):[]}function u9(t,e,n){const{contributionsRecord:r}=Cs.getState(),i=r[t],o=i[e],s=n.container?{...n,container:{...o.container,...n.container}}:n;Cs.setState({contributionsRecord:{...r,[t]:B6e(i,e,s)}})}var H6e={exports:{}},h2={};/** +`,qXt="chart-wrapper";function XXt(t){return typeof t=="function"}function nxe(t,e,n,r){const i=`${e}
`,o=`
${n}`,s=window.open("");s.document.write(i+t+o),s.document.title=`${_T[r]} JSON Source`}function YXt(t,e){if(t.$schema){const n=W6e(t.$schema);e&&e!==n.library&&console.warn(`The given visualization spec is written in ${_T[n.library]}, but mode argument sets ${_T[e]??e}.`);const r=n.library;return eUe(V5[r],`^${n.version.slice(1)}`)||console.warn(`The input spec uses ${_T[r]} ${n.version}, but the current version of ${_T[r]} is v${V5[r]}.`),r}return"mark"in t||"encoding"in t||"layer"in t||"hconcat"in t||"vconcat"in t||"facet"in t||"repeat"in t?"vega-lite":"marks"in t||"signals"in t||"scales"in t||"axes"in t?"vega":e??"vega"}function nUe(t){return!!(t&&"load"in t)}function rxe(t){return nUe(t)?t:uf.loader(t)}function QXt(t){var n;const e=((n=t.usermeta)==null?void 0:n.embedOptions)??{};return gt(e.defaultStyle)&&(e.defaultStyle=!1),e}async function KXt(t,e,n={}){let r,i;gt(e)?(i=rxe(n.loader),r=JSON.parse(await i.load(e))):r=e;const o=QXt(r),s=o.loader;(!i||s)&&(i=rxe(n.loader??s));const a=await ixe(o,i),l=await ixe(n,i),c={...tUe(l,a),config:gO(l.config??{},a.config??{})};return await JXt(t,r,c,i)}async function ixe(t,e){const n=gt(t.config)?JSON.parse(await e.load(t.config)):t.config??{},r=gt(t.patch)?JSON.parse(await e.load(t.patch)):t.patch;return{...t,...r?{patch:r}:{},...n?{config:n}:{}}}function ZXt(t){const e=t.getRootNode?t.getRootNode():document;return e instanceof ShadowRoot?{root:e,rootContainer:e}:{root:document,rootContainer:document.head??document.body}}async function JXt(t,e,n={},r){const i=n.theme?gO(tXt[n.theme],n.config??{}):n.config,o=jy(n.actions)?n.actions:tUe({},WXt,n.actions??{}),s={...VXt,...n.i18n},a=n.renderer??"canvas",l=n.logLevel??uf.Warn,c=n.downloadFileName??"visualization",u=typeof t=="string"?document.querySelector(t):t;if(!u)throw new Error(`${t} does not exist`);if(n.defaultStyle!==!1){const w="vega-embed-style",{root:_,rootContainer:S}=ZXt(u);if(!_.getElementById(w)){const O=document.createElement("style");O.id=w,O.innerHTML=n.defaultStyle===void 0||n.defaultStyle===!0?BXt.toString():n.defaultStyle,S.appendChild(O)}}const f=YXt(e,n.mode);let d=GXt[f](e,i);if(f==="vega-lite"&&d.$schema){const w=W6e(d.$schema);eUe(V5.vega,`^${w.version.slice(1)}`)||console.warn(`The compiled spec uses Vega ${w.version}, but current version is v${V5.vega}.`)}u.classList.add("vega-embed"),o&&u.classList.add("has-actions"),u.innerHTML="";let h=u;if(o){const w=document.createElement("div");w.classList.add(qXt),u.appendChild(w),h=w}const p=n.patch;if(p&&(d=p instanceof Function?p(d):Q6(d,p,!0,!1).newDocument),n.formatLocale&&uf.formatLocale(n.formatLocale),n.timeFormatLocale&&uf.timeFormatLocale(n.timeFormatLocale),n.expressionFunctions)for(const w in n.expressionFunctions){const _=n.expressionFunctions[w];"fn"in _?uf.expressionFunction(w,_.fn,_.visitor):_ instanceof Function&&uf.expressionFunction(w,_)}const{ast:g}=n,m=uf.parse(d,f==="vega-lite"?{}:i,{ast:g}),v=new(n.viewClass||uf.View)(m,{loader:r,logLevel:l,renderer:a,...g?{expr:uf.expressionInterpreter??n.expr??r6t}:{}});if(v.addSignalListener("autosize",(w,_)=>{const{type:S}=_;S=="fit-x"?(h.classList.add("fit-x"),h.classList.remove("fit-y")):S=="fit-y"?(h.classList.remove("fit-x"),h.classList.add("fit-y")):S=="fit"?h.classList.add("fit-x","fit-y"):h.classList.remove("fit-x","fit-y")}),n.tooltip!==!1){const{loader:w,tooltip:_}=n,S=w&&!nUe(w)?w==null?void 0:w.baseURL:void 0,O=XXt(_)?_:new fXt({baseURL:S,..._===!0?{}:_}).call;v.tooltip(O)}let{hover:y}=n;if(y===void 0&&(y=f==="vega"),y){const{hoverSet:w,updateSet:_}=typeof y=="boolean"?{}:y;v.hover(w,_)}n&&(n.width!=null&&v.width(n.width),n.height!=null&&v.height(n.height),n.padding!=null&&v.padding(n.padding)),await v.initialize(h,n.bind).runAsync();let x;if(o!==!1){let w=u;if(n.defaultStyle!==!1||n.forceActionsMenu){const S=document.createElement("details");S.title=s.CLICK_TO_VIEW_ACTIONS,u.append(S),w=S;const O=document.createElement("summary");O.innerHTML=HXt,S.append(O),x=k=>{S.contains(k.target)||S.removeAttribute("open")},document.addEventListener("click",x)}const _=document.createElement("div");if(w.append(_),_.classList.add("vega-actions"),o===!0||o.export!==!1){for(const S of["svg","png"])if(o===!0||o.export===!0||o.export[S]){const O=s[`${S.toUpperCase()}_ACTION`],k=document.createElement("a"),E=ht(n.scaleFactor)?n.scaleFactor[S]:n.scaleFactor;k.text=O,k.href="#",k.target="_blank",k.download=`${c}.${S}`,k.addEventListener("mousedown",async function(P){P.preventDefault();const A=await v.toImageURL(S,E);this.href=A}),_.append(k)}}if(o===!0||o.source!==!1){const S=document.createElement("a");S.text=s.SOURCE_ACTION,S.href="#",S.addEventListener("click",function(O){nxe(RW(e),n.sourceHeader??"",n.sourceFooter??"",f),O.preventDefault()}),_.append(S)}if(f==="vega-lite"&&(o===!0||o.compiled!==!1)){const S=document.createElement("a");S.text=s.COMPILED_ACTION,S.href="#",S.addEventListener("click",function(O){nxe(RW(d),n.sourceHeader??"",n.sourceFooter??"","vega"),O.preventDefault()}),_.append(S)}if(o===!0||o.editor!==!1){const S=n.editorUrl??"https://vega.github.io/editor/",O=document.createElement("a");O.text=s.EDITOR_ACTION,O.href="#",O.addEventListener("click",function(k){jXt(window,S,{config:i,mode:p?"vega":f,renderer:a,spec:RW(p?d:e)}),k.preventDefault()}),_.append(O)}}function b(){x&&document.removeEventListener("click",x),v.finalize()}return{view:v,spec:e,vgSpec:d,finalize:b,embedOptions:n}}function eYt(t){return!!t&&{}.toString.call(t)==="[object Function]"}function tYt(t,e,n){n&&(eYt(n)?n(t.data(e)):t.change(e,uf.changeset().remove(()=>!0).insert(n)))}function nYt(t,e){Object.keys(e).forEach(n=>{tYt(t,n,e[n])})}function rUe(t){const e=new Set;return t.forEach(n=>{Object.keys(n).forEach(r=>{e.add(r)})}),e}const iUe=()=>{};function b9(t,e){const n=Object.keys(e);return n.forEach(r=>{try{t.addSignalListener(r,e[r])}catch(i){console.warn("Cannot add invalid signal listener.",i)}}),n.length>0}var rYt=function t(e,n){if(e===n)return!0;if(e&&n&&typeof e=="object"&&typeof n=="object"){if(e.constructor!==n.constructor)return!1;var r,i,o;if(Array.isArray(e)){if(r=e.length,r!=n.length)return!1;for(i=r;i--!==0;)if(!t(e[i],n[i]))return!1;return!0}if(e.constructor===RegExp)return e.source===n.source&&e.flags===n.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===n.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===n.toString();if(o=Object.keys(e),r=o.length,r!==Object.keys(n).length)return!1;for(i=r;i--!==0;)if(!Object.prototype.hasOwnProperty.call(n,o[i]))return!1;for(i=r;i--!==0;){var s=o[i];if(!t(e[s],n[s]))return!1}return!0}return e!==e&&n!==n};const iYt=sn(rYt);function oYt(t,e){if(t===e)return!1;const n={width:!1,height:!1,isExpensive:!1},r=rUe([t,e]);return r.has("width")&&(!("width"in t)||!("width"in e)||t.width!==e.width)&&("width"in t&&typeof t.width=="number"?n.width=t.width:n.isExpensive=!0),r.has("height")&&(!("height"in t)||!("height"in e)||t.height!==e.height)&&("height"in t&&typeof t.height=="number"?n.height=t.height:n.isExpensive=!0),r.delete("width"),r.delete("height"),[...r].some(i=>!(i in t)||!(i in e)||!iYt(t[i],e[i]))&&(n.isExpensive=!0),n.width!==!1||n.height!==!1||n.isExpensive?n:!1}function oxe(t,e){const n=Object.keys(e);return n.forEach(r=>{try{t.removeSignalListener(r,e[r])}catch(i){console.warn("Cannot remove invalid signal listener.",i)}}),n.length>0}function w9(t){const{spec:e,width:n,height:r}=t;return typeof n<"u"&&typeof r<"u"?{...e,width:n,height:r}:typeof n<"u"?{...e,width:n}:typeof r<"u"?{...e,height:r}:e}function ST(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}class oUe extends de.PureComponent{constructor(){super(...arguments),ST(this,"containerRef",de.createRef()),ST(this,"resultPromise",void 0),ST(this,"handleError",e=>{const{onError:n=iUe}=this.props;n(e,this.containerRef.current),console.warn(e)}),ST(this,"modifyView",e=>{this.resultPromise&&this.resultPromise.then(n=>(n&&e(n.view),!0)).catch(this.handleError)})}componentDidMount(){this.createView()}componentDidUpdate(e){const n=rUe([this.props,e]);if(n.delete("className"),n.delete("signalListeners"),n.delete("spec"),n.delete("style"),n.delete("width"),n.delete("height"),Array.from(n).some(r=>this.props[r]!==e[r]))this.clearView(),this.createView();else{const r=oYt(w9(this.props),w9(e)),{signalListeners:i}=this.props,{signalListeners:o}=e;if(r)if(r.isExpensive)this.clearView(),this.createView();else{const s=!Yq(i,o);this.modifyView(a=>{r.width!==!1&&a.width(r.width),r.height!==!1&&a.height(r.height),s&&(o&&oxe(a,o),i&&b9(a,i)),a.run()})}else Yq(i,o)||this.modifyView(s=>{o&&oxe(s,o),i&&b9(s,i),s.run()})}}componentWillUnmount(){this.clearView()}createView(){const{spec:e,onNewView:n,signalListeners:r={},width:i,height:o,...s}=this.props;if(this.containerRef.current){const a=w9(this.props);this.resultPromise=KXt(this.containerRef.current,a,s).then(l=>{if(l){const{view:c}=l;b9(c,r)&&c.run()}return l}).catch(this.handleError),n&&this.modifyView(n)}}clearView(){return this.resultPromise&&this.resultPromise.then(e=>{e&&e.finalize()}).catch(this.handleError),this.resultPromise=void 0,this}render(){const{className:e,style:n}=this.props;return de.createElement("div",{ref:this.containerRef,className:e,style:n})}}ST(oUe,"propTypes",{className:pe.string,onError:pe.func});function lQ(){return lQ=Object.assign||function(t){for(var e=1;e{this.update();const{onNewView:n=iUe}=this.props;n(e)})}componentDidMount(){this.update()}componentDidUpdate(e){Yq(this.props.data,e.data)||this.update()}update(){const{data:e}=this.props;this.vegaEmbed.current&&e&&Object.keys(e).length>0&&this.vegaEmbed.current.modifyView(n=>{nYt(n,e),n.resize().run()})}render(){const{data:e,...n}=this.props;return de.createElement(oUe,lQ({ref:this.vegaEmbed},n,{onNewView:this.handleNewView}))}}cQ(sUe,"defaultProps",{data:sYt});function uQ(){return uQ=Object.assign||function(t){for(var e=1;ee in t?lYt(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,aUe=(t,e,n)=>cYt(t,typeof e!="symbol"?e+"":e,n);const Ss=mSt(()=>({configuration:{},extensions:[],contributionsResult:{},contributionsRecord:{}}));function U_(t){return typeof t=="object"&&t!==null}function Z6(t,e){e=fC(e);let n=t;for(const r of e)if(U_(n))n=n[r];else return;return n}function fQ(t,e,n){return lUe(t,fC(e),n)}function lUe(t,e,n){if(e.length===1){const r=e[0];if(U_(t)){const i=t[r];if(n===i)return t;const o=Array.isArray(t)?[...t]:{...t};return o[r]=n,o}else if(t===void 0){const i=typeof r=="number"?[]:{};return i[r]=n,i}}else if(e.length>1&&U_(t)){const r=e[0],i=t[r];if(U_(i)||i===void 0){const o=lUe(i,e.slice(1),n);if(i!==o){const s=Array.isArray(t)?[...t]:{...t};return s[r]=o,s}}}return t}function fC(t){if(Array.isArray(t))return t;if(!t||t==="")return[];if(typeof t=="number")return[t];{const e=t.split(".");for(let n=0;ntypeof e=="number"?e.toString():e).join("."):typeof t=="number"?t.toString():""}function uYt(t,e){if(t===e)return!0;const n=fC(t),r=fC(e);return n.length===r.length&&n.every((i,o)=>i===r[o])}function cUe(t,e){const n={};return Object.getOwnPropertyNames(t).forEach(r=>{n[r]=e(t[r],r)}),n}function fYt(t,e){return Object.prototype.hasOwnProperty.call(t,e)}const dYt="http://localhost:8888",hYt="chartlets";async function Bae(t,...e){try{return{status:"ok",data:await t(...e)}}catch(n){return n instanceof I3?{status:"failed",error:n.apiError}:{status:"failed",error:{message:`${n.message||n}`}}}}async function Uae(t,e,n){const r=await fetch(t,e),i=await r.json();if(typeof i=="object"){if(i.error)throw new I3(i.error);if(!r.ok)throw new I3({status:r.status,message:r.statusText});if(fYt(i,"result"))return n?n(i.result):i.result}throw new I3({message:`unexpected response from ${t}`})}class I3 extends Error{constructor(e){super(e.message),aUe(this,"apiError"),this.apiError=e}}function Wae(t,e){const n=(e==null?void 0:e.serverUrl)||dYt,r=(e==null?void 0:e.endpointName)||hYt;return`${n}/${r}/${t}`}async function pYt(t){return Bae(gYt,t)}async function gYt(t){return Uae(Wae("contributions",t),void 0,mYt)}function mYt(t){return{...t,contributions:cUe(t.contributions,e=>e.map(n=>({...n,layout:n.layout?uUe(n.layout):void 0,callbacks:vYt(n.callbacks)})))}}function vYt(t){return t?t.map(uUe):[]}function uUe(t){return{...t,inputs:t.inputs?sxe(t.inputs):[],outputs:t.outputs?sxe(t.outputs):[]}}function sxe(t){return t?t.map(yYt):[]}function yYt(t){return{...t,property:fC(t.property)}}function xYt(t){return!!t&&typeof t.set=="function"}const _9="color:light-dark(lightblue, lightblue)",S9="font-weight:bold",C9="color:light-dark(darkgrey, lightgray)";let fL;function bYt(t){fL&&(fL(),fL=void 0),(!t||t.enabled)&&(fL=Ss.subscribe(wYt))}function wYt(t,e){const n=lIe(e,t),r=n.length;console.groupCollapsed(`chartlets: state changed (${r} difference${r===1?"":"s"})`),n.forEach(_Yt),console.debug("chartlets: change details:",{prev:e,next:t,delta:n}),console.groupEnd()}function _Yt(t,e){const n=`%c${e+1} %c${t.type} %c${t.path.join(".")}`;t.type==="CREATE"?console.debug("chartlets:",n,_9,S9,C9,{value:t.value}):t.type==="CHANGE"?console.debug("chartlets:",n,_9,S9,C9,{value:t.value,oldValue:t.oldValue}):t.type==="REMOVE"&&console.debug("chartlets:",n,_9,S9,C9,{oldValue:t.oldValue})}function fUe(t){return!!t.id&&!t.id.startsWith("@")}function dUe(t){return t.id==="@app"}function hUe(t){return t.id==="@container"}function W_(t){return U_(t)&&typeof t.type=="string"}function pUe(t){return W_(t)&&Array.isArray(t.children)}function Vae(t,e,n){return t.map(r=>SYt(r,e,n))}const dQ={};function SYt(t,e,n){let r;const{id:i,property:o}=t;return fUe(t)&&e.component?r=gUe(e.component,i,o):hUe(t)&&e.container?r=CYt(e.container,o):dUe(t)&&n?r=OYt(n,o):console.warn("input with unknown data source:",t),(r===void 0||r===dQ)&&(r=null,console.warn("value is undefined for input",t)),r}function gUe(t,e,n){if(t.id===e)return Z6(t,n);if(pUe(t))for(let r=0;r{const o=t[n][r],s=MYt(o.container,i.filter(hUe)),a=AYt(o.component,i.filter(fUe));(s!==o.container||a!==o.component)&&(t={...t,[n]:mUe(t[n],r,{...o,container:s,component:a})})}),t}function AYt(t,e){let n=t;return n&&e.forEach(r=>{n=yUe(n,r)}),n}function yUe(t,e){if(W_(t)&&t.id===e.id){const n=fC(e.property),r=e.value;if(n.length===0)return W_(r)?r:t;const i=Z6(t,n);if(n[n.length-1]==="children"&&!Array.isArray(r)&&r!==null&&r!==void 0)return fQ(t,n,[r]);if(i!==r)return fQ(t,n,r)}else if(pUe(t)){const n=t;let r=n;for(let i=0;i{n.stateChanges.forEach(r=>{dUe(r)&&e.set(jae(r.property),r.value)})})}function MYt(t,e){return e.forEach(n=>{(!t||Z6(t,n.property)!==n.value)&&(t=fQ(t,n.property,n.value))}),t}function xUe(t){var e;const{configuration:n}=Ss.getState(),r=(e=n.logging)==null?void 0:e.enabled,i=DYt();r&&console.info(`chartlets: invokeCallbacks (${i})-->`,t),EYt(t,n.api).then(o=>{o.data?(r&&console.info(`chartlets: invokeCallbacks <--(${i})`,o.data),vUe(o.data)):console.error("callback failed:",o.error,"for call requests:",t)})}let RYt=0;function DYt(){return RYt++}function IYt(){const{extensions:t,configuration:e,contributionsRecord:n}=Ss.getState(),{hostStore:r}=e;if(!r||t.length===0)return;const i=$Yt();if(!i||i.length===0)return;const o=LYt(i,n,r);o&&o.length>0&&xUe(o)}function LYt(t,e,n){return t.map(r=>{const i=e[r.contribPoint][r.contribIndex],o=i.callbacks[r.callbackIndex],s=Vae(o.inputs,i,n);return{...r,inputValues:s}})}function $Yt(){const{contributionsRecord:t}=Ss.getState(),e=[];return Object.getOwnPropertyNames(t).forEach(n=>{t[n].forEach((r,i)=>{(r.callbacks||[]).forEach((o,s)=>(o.inputs||[]).forEach((a,l)=>{!a.noTrigger&&a.id==="@app"&&a.property&&e.push({contribPoint:n,contribIndex:i,callbackIndex:s,inputIndex:l,property:jae(a.property)})}),[])})}),e}function FYt(t){t.logging&&bYt(t.logging),t.hostStore&&t.hostStore.subscribe(IYt),Ss.setState({configuration:{...t}})}function NYt(t){t&&FYt(t);const{configuration:e}=Ss.getState();Ss.setState({contributionsResult:{status:"pending"}}),pYt(e.api).then(zYt)}function zYt(t){let e={contributionsResult:t};if(t.data){const{extensions:n,contributions:r}=t.data;e={...e,extensions:n,contributionsRecord:cUe(r,i=>i.map(jYt))}}Ss.setState(e)}function jYt(t){return{...t,container:{...t.initialState},componentResult:{}}}function BYt(t,e,n){if(Ss.getState().extensions.length===0)return;vUe([{contribPoint:t,contribIndex:e,stateChanges:[{id:n.id,property:n.property,value:n.value}]}]);const r=UYt(t,e,n);r&&r.length>0&&xUe(r)}function UYt(t,e,n){const{configuration:r,contributionsRecord:i}=Ss.getState(),{hostStore:o}=r,s=i[t][e],a=[];return(s.callbacks||[]).forEach((l,c)=>{if(l.inputs&&l.inputs.length){const u=l.inputs,f=u.findIndex(d=>!d.noTrigger&&d.id&&!d.id.startsWith("@")&&d.id===n.id&&uYt(d.property,n.property));f>=0&&a.push({contribPoint:t,contribIndex:e,callbackIndex:c,inputIndex:f,inputValues:Vae(u,s,o)})}}),a}async function WYt(t,e,n,r){return Bae(VYt,t,e,n,r)}async function VYt(t,e,n,r){return Uae(Wae(`layout/${t}/${e}`,r),{body:JSON.stringify({inputValues:n}),method:"post"})}function GYt(t,e,n,r=!0){const{configuration:i,contributionsRecord:o}=Ss.getState(),s=o[t][e];if(s.container===n)return;const a=!!s.componentResult.status;if(!r||a)O9(t,e,{container:n});else if(!a){O9(t,e,{container:n,componentResult:{status:"pending"}});const l=HYt(t,e);WYt(t,e,l,i.api).then(c=>{O9(t,e,{componentResult:c,component:c.data})})}}function HYt(t,e){const{configuration:n,contributionsRecord:r}=Ss.getState(),{hostStore:i}=n,o=r[t][e],s=o.layout.inputs;return s&&s.length>0?Vae(s,o,i):[]}function O9(t,e,n){const{contributionsRecord:r}=Ss.getState(),i=r[t],o=i[e],s=n.container?{...n,container:{...o.container,...n.container}}:n;Ss.setState({contributionsRecord:{...r,[t]:mUe(i,e,s)}})}class qYt{constructor(){aUe(this,"components",new Map)}register(e,n){const r=this.components.get(e);return this.components.set(e,n),()=>{typeof r=="function"?this.components.set(e,r):this.components.delete(e)}}lookup(e){return this.components.get(e)}get types(){return Array.from(this.components.keys())}}const nm=new qYt;var bUe={exports:{}},d2={};/** * @license React * react-jsx-runtime.production.min.js * @@ -460,25 +462,25 @@ https://github.com/nodeca/pako/blob/main/LICENSE * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var D0e;function XYt(){if(D0e)return h2;D0e=1;var t=de,e=Symbol.for("react.element"),n=Symbol.for("react.fragment"),r=Object.prototype.hasOwnProperty,i=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,o={key:!0,ref:!0,__self:!0,__source:!0};function s(a,l,c){var u,f={},d=null,h=null;c!==void 0&&(d=""+c),l.key!==void 0&&(d=""+l.key),l.ref!==void 0&&(h=l.ref);for(u in l)r.call(l,u)&&!o.hasOwnProperty(u)&&(f[u]=l[u]);if(a&&a.defaultProps)for(u in l=a.defaultProps,l)f[u]===void 0&&(f[u]=l[u]);return{$$typeof:e,type:a,key:d,ref:h,props:f,_owner:i.current}}return h2.Fragment=n,h2.jsx=s,h2.jsxs=s,h2}H6e.exports=XYt();var Li=H6e.exports;function YYt({id:t,name:e,style:n,text:r,disabled:i,onChange:o}){const s=a=>{t&&o({componentType:"Button",id:t,property:"n_clicks",value:a.buttons})};return Li.jsx(Vr,{id:t,name:e,style:n,disabled:i,onClick:s,children:r})}function QYt({components:t,onChange:e}){return!t||t.length===0?null:Li.jsx(Li.Fragment,{children:t.map((n,r)=>{const i=n.id||r;return Li.jsx(q6e,{...n,onChange:e},i)})})}function KYt({id:t,style:e,components:n,onChange:r}){return Li.jsx(ot,{id:t,style:e,children:Li.jsx(QYt,{components:n,onChange:r})})}function ZYt({id:t,name:e,value:n,disabled:r,style:i,label:o,onChange:s}){const a=l=>{if(t)return s({componentType:"Checkbox",id:t,property:"value",value:l.currentTarget.checked})};return Li.jsx(Gg,{variant:"filled",size:"small",style:i,children:Li.jsx(Px,{label:o,control:Li.jsx(zF,{id:t,name:e,checked:!!n,disabled:r,onChange:a})})})}function JYt({id:t,name:e,value:n,options:r,disabled:i,style:o,label:s,onChange:a}){const l=c=>{if(!t)return;let u=c.target.value;return typeof n=="number"&&(u=Number.parseInt(u)),a({componentType:"Dropdown",id:t,property:"value",value:u})};return Li.jsxs(Gg,{variant:"filled",size:"small",style:o,children:[s&&Li.jsx(Ly,{id:`${t}-label`,children:s}),Li.jsx(Hg,{labelId:`${t}-label`,id:t,name:e,value:`${n}`,disabled:i,onChange:l,children:r&&r.map(([c,u],f)=>Li.jsx(_i,{value:u,children:c},f))})]})}function eQt({id:t,style:e,chart:n,onChange:r}){if(!n)return Li.jsx("div",{id:t,style:e});const{datasets:i,...o}=n,s=(a,l)=>{if(t)return r({componentType:"Plot",id:t,property:"points",value:l})};return Li.jsx(uYt,{spec:o,data:i,style:e,signalListeners:{onClick:s},actions:!1})}function tQt({id:t,style:e,text:n}){return Li.jsx(Jt,{id:t,style:e,children:n})}function q6e({type:t,...e}){if(t==="Plot")return Li.jsx(eQt,{...e});if(t==="Dropdown")return Li.jsx(JYt,{...e});if(t==="Button")return Li.jsx(YYt,{...e});if(t==="Box")return Li.jsx(KYt,{...e});if(t==="Checkbox")return Li.jsx(ZYt,{...e});if(t==="Typography")return Li.jsx(tQt,{...e})}const nQt=t=>t.contributionsRecord,rQt=Cs,iQt=()=>rQt(nQt),X6e="POST_MESSAGE";function ws(t,e){return{type:X6e,messageType:t,messageText:typeof e=="string"?e:e.message}}const Y6e="HIDE_MESSAGE";function oQt(t){return{type:Y6e,messageId:t}}var sQt={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]};const I0e=on(sQt);var L0e={red:0,orange:60,yellow:120,green:180,blue:240,purple:300};function aQt(t){var e,n=[],r=1,i;if(typeof t=="string")if(t=t.toLowerCase(),I0e[t])n=I0e[t].slice(),i="rgb";else if(t==="transparent")r=0,i="rgb",n=[0,0,0];else if(/^#[A-Fa-f0-9]+$/.test(t)){var o=t.slice(1),s=o.length,a=s<=4;r=1,a?(n=[parseInt(o[0]+o[0],16),parseInt(o[1]+o[1],16),parseInt(o[2]+o[2],16)],s===4&&(r=parseInt(o[3]+o[3],16)/255)):(n=[parseInt(o[0]+o[1],16),parseInt(o[2]+o[3],16),parseInt(o[4]+o[5],16)],s===8&&(r=parseInt(o[6]+o[7],16)/255)),n[0]||(n[0]=0),n[1]||(n[1]=0),n[2]||(n[2]=0),i="rgb"}else if(e=/^((?:rgb|hs[lvb]|hwb|cmyk?|xy[zy]|gray|lab|lchu?v?|[ly]uv|lms)a?)\s*\(([^\)]*)\)/.exec(t)){var l=e[1],c=l==="rgb",o=l.replace(/a$/,"");i=o;var s=o==="cmyk"?4:o==="gray"?1:3;n=e[2].trim().split(/\s*[,\/]\s*|\s+/).map(function(d,h){if(/%$/.test(d))return h===s?parseFloat(d)/100:o==="rgb"?parseFloat(d)*255/100:parseFloat(d);if(o[h]==="h"){if(/deg$/.test(d))return parseFloat(d);if(L0e[d]!==void 0)return L0e[d]}return parseFloat(d)}),l===o&&n.push(1),r=c||n[s]===void 0?1:n[s],n=n.slice(0,s)}else t.length>10&&/[0-9](?:\s|\/)/.test(t)&&(n=t.match(/([0-9]+)/g).map(function(u){return parseFloat(u)}),i=t.match(/([a-z])/ig).join("").toLowerCase());else isNaN(t)?Array.isArray(t)||t.length?(n=[t[0],t[1],t[2]],i="rgb",r=t.length===4?t[3]:1):t instanceof Object&&(t.r!=null||t.red!=null||t.R!=null?(i="rgb",n=[t.r||t.red||t.R||0,t.g||t.green||t.G||0,t.b||t.blue||t.B||0]):(i="hsl",n=[t.h||t.hue||t.H||0,t.s||t.saturation||t.S||0,t.l||t.lightness||t.L||t.b||t.brightness]),r=t.a||t.alpha||t.opacity||1,t.opacity!=null&&(r/=100)):(i="rgb",n=[t>>>16,(t&65280)>>>8,t&255]);return{space:i,values:n,alpha:r}}const KY={name:"rgb",min:[0,0,0],max:[255,255,255],channel:["red","green","blue"],alias:["RGB"]},f9={name:"hsl",min:[0,0,0],max:[360,100,100],channel:["hue","saturation","lightness"],alias:["HSL"],rgb:function(t){var e=t[0]/360,n=t[1]/100,r=t[2]/100,i,o,s,a,l,c=0;if(n===0)return l=r*255,[l,l,l];for(o=r<.5?r*(1+n):r+n-r*n,i=2*r-o,a=[0,0,0];c<3;)s=e+1/3*-(c-1),s<0?s++:s>1&&s--,l=6*s<1?i+(o-i)*6*s:2*s<1?o:3*s<2?i+(o-i)*(2/3-s)*6:i,a[c++]=l*255;return a}};KY.hsl=function(t){var e=t[0]/255,n=t[1]/255,r=t[2]/255,i=Math.min(e,n,r),o=Math.max(e,n,r),s=o-i,a,l,c;return o===i?a=0:e===o?a=(n-r)/s:n===o?a=2+(r-e)/s:r===o&&(a=4+(e-n)/s),a=Math.min(a*60,360),a<0&&(a+=360),c=(i+o)/2,o===i?l=0:c<=.5?l=s/(o+i):l=s/(2-o-i),[a,l*100,c*100]};function lQt(t){Array.isArray(t)&&t.raw&&(t=String.raw(...arguments));var e,n=aQt(t);if(!n.space)return[];const r=n.space[0]==="h"?f9.min:KY.min,i=n.space[0]==="h"?f9.max:KY.max;return e=Array(3),e[0]=Math.min(Math.max(n.values[0],r[0]),i[0]),e[1]=Math.min(Math.max(n.values[1],r[1]),i[1]),e[2]=Math.min(Math.max(n.values[2],r[2]),i[2]),n.space[0]==="h"&&(e=f9.rgb(e)),e.push(Math.min(Math.max(n.alpha,0),1)),e}function Eae(t,e,n,r="circle"){if(t.getGeometry()instanceof hh)t.setStyle(cQt(7,e,"white",2,r));else{n=typeof n=="number"?n:.25;let i=lQt(e);Array.isArray(i)?i=[i[0],i[1],i[2],n]:i=[255,255,255,n],t.setStyle(fQt(i,e,2))}}function cQt(t,e,n,r,i="circle"){return new Zd({image:uQt(t,e,n,r,i)})}function uQt(t,e,n,r,i){const o=new a1({color:e}),s=new ph({color:n,width:r});switch(i){case"square":return new mq({fill:o,stroke:s,radius:t,points:4,angle:Math.PI/4,rotation:0});case"diamond":return new mq({fill:o,stroke:s,radius:t,points:4,angle:Math.PI/4,rotation:Math.PI/4});default:return new VM({fill:o,stroke:s,radius:t})}}function fQt(t,e,n){const r=new a1({color:t}),i=new ph({color:e,width:n});return new Zd({fill:r,stroke:i})}function dQt(t,e,n){Hs[t]}function hQt(t,e,n){if(Hs[t]){const i=Hs[t].getSource(),o=i==null?void 0:i.getFeatureById(e);o&&Eae(o,n.color,n.opacity)}}function pQt(t,e,n){if(Hs[t]){const r=Hs[t],i=r.getView().getProjection(),s=(Array.isArray(e)?cq(e):e).transform(sO,i);s.getType()==="Point"?r.getView().setCenter(s.getFirstCoordinate()):n?r.getView().fit(s,{size:r.getSize()}):r.getView().setCenter(ty(s.getExtent()))}}const Q6e="1.4.0-dev.1",gQt=["userPlaceGroups","timeSeriesGroups","statistics"],mQt=["selectedDatasetId","selectedVariableName","selectedDataset2Id","selectedVariable2Name","selectedTime","selectedTimeRange","selectedUserPlaceId","selectedPlaceId","selectedPlaceGroupIds","sidebarPanelId","layerMenuOpen","sidebarOpen","sidebarPosition","variableSplitPos","variableCompareMode","selectedBaseMapId","selectedOverlayId","userBaseMaps","userOverlays","userColorBars","mapProjection"];function vQt(t){return{version:Q6e,creationDate:new Date().toUTCString(),apiUrl:ji(t).url,viewerUrl:ZC.origin,state:{dataState:$0e(t.dataState,gQt),controlState:$0e(t.controlState,mQt),mapState:yQt()}}}function $0e(t,e){const n={};return e.forEach(r=>{n[r]=t[r]}),n}function yQt(){if(Hs.map){const e=Hs.map.getView(),n=e.getProjection().getCode(),r=e.getCenter();if(r!==void 0){const i=e.getZoom(),o=e.getRotation();return{view:{projection:n,center:r,zoom:i,rotation:o}}}}}const Tae="APPLY_PERSISTED_STATE";function xQt(t){return e=>{console.debug("Restoring persisted state:",t),e(bQt(t));const{mapState:n}=t.state;n&&wQt(n)}}function bQt(t){return{type:Tae,persistedState:t}}function wQt(t){Hs.map&&(console.log("Restoring map:",t),Hs.map.setView(new jd(t.view)))}const Y5="UPDATE_SERVER_INFO";function _Qt(){return(t,e)=>{const n=ji(e());t(QR(Y5,ge.get("Connecting to server"))),Hpt(n.url).then(r=>{t(SQt(r))}).catch(r=>{t(ws("error",r))}).then(()=>{t(KR(Y5))})}}function SQt(t){return{type:Y5,serverInfo:t}}const F0e="SHARE_STATE_PERMALINK";function K6e(){return(t,e)=>{const n=ji(e());t(QR(F0e,ge.get("Creating permalink"))),Zpt(n.url,e().userAuthState.accessToken,vQt(e())).then(r=>{if(r){const i=`${ZC.origin}?stateKey=${r}`;navigator.clipboard.writeText(i).then(()=>{t(ws("success",ge.get("Permalink copied to clipboard")))})}else t(ws("error",ge.get("Failed to create permalink")))}).finally(()=>t(KR(F0e)))}}const N0e="UPDATE_RESOURCES";function Z6e(){return(t,e)=>{const n=ji(e());t(QR(N0e,ge.get("Updating resources"))),Qpt(n.url,e().userAuthState.accessToken).then(r=>{r&&window.location.reload()}).finally(()=>t(KR(N0e)))}}const eP="UPDATE_DATASETS";function J6e(){return(t,e)=>{const n=ji(e());t(QR(eP,ge.get("Loading data"))),Bpt(n.url,e().userAuthState.accessToken).then(r=>{const i=rwt();if(r=r.map(o=>({...o,variables:[...o.variables,...i[o.id]||[]]})),t(z0e(r)),r.length>0){const o=e().controlState.selectedDatasetId||r[0].id;t(bUe(o,r,!0))}}).catch(r=>{t(ws("error",r)),t(z0e([]))}).then(()=>{t(KR(eP))})}}function z0e(t){return{type:eP,datasets:t}}function CQt(t,e){return(n,r)=>{n(OQt(t,e));const i={};r().dataState.datasets.forEach(o=>{const[s,a]=lte(o);a.length>=0&&(i[o.id]=a)}),nwt(i)}}const eUe="UPDATE_DATASET_USER_VARIABLES";function OQt(t,e){return{type:eUe,datasetId:t,userVariables:e}}const kae="UPDATE_DATASET_PLACE_GROUP";function EQt(t,e){return{type:kae,datasetId:t,placeGroup:e}}const Aae="ADD_DRAWN_USER_PLACE";function TQt(t,e,n,r,i){return(o,s)=>{o(kQt(t,e,n,r,i)),s().controlState.autoShowTimeSeries&&s().controlState.selectedPlaceId===e&&o(tU())}}function kQt(t,e,n,r,i){return{type:Aae,placeGroupTitle:t,id:e,properties:n,geometry:r,selected:i}}const Pae="ADD_IMPORTED_USER_PLACES";function AQt(t,e,n){return{type:Pae,placeGroups:t,mapProjection:e,selected:n}}function tUe(t){return(e,n)=>{const r=Mwt(n());let i;try{if(r==="csv"){const o=Rwt(n());i=Ubt(t,o)}else if(r==="geojson"){const o=Dwt(n());i=qbt(t,o)}else if(r==="wkt"){const o=Iwt(n());i=Kbt(t,o)}else i=[]}catch(o){e(ws("error",o)),e(_b("addUserPlacesFromText")),i=[]}if(i.length>0){if(e(AQt(i,zy(n()),!0)),i.length===1&&i[0].features.length===1){const s=i[0].features[0];e(nU(s.id,JM(n()),!0)),n().controlState.autoShowTimeSeries&&e(tU())}let o=0;i.forEach(s=>{o+=s.features?s.features.length:0}),e(ws("info",ge.get(`Imported ${o} place(s) in ${i.length} groups(s), 1 selected`)))}else e(ws("warning",ge.get("No places imported")))}}const Mae="RENAME_USER_PLACE_GROUP";function PQt(t,e){return{type:Mae,placeGroupId:t,newName:e}}const nUe="RENAME_USER_PLACE";function MQt(t,e,n){return r=>{r(RQt(t,e,n)),dQt(t)}}function RQt(t,e,n){return{type:nUe,placeGroupId:t,placeId:e,newName:n}}const rUe="RESTYLE_USER_PLACE";function DQt(t,e,n){return r=>{r(IQt(t,e,n)),hQt(t,e,n)}}function IQt(t,e,n){return{type:rUe,placeGroupId:t,placeId:e,placeStyle:n}}const Rae="REMOVE_USER_PLACE";function LQt(t,e,n){return{type:Rae,placeGroupId:t,placeId:e,places:n}}const iUe="REMOVE_USER_PLACE_GROUP";function $Qt(t){return{type:iUe,placeGroupId:t}}function oUe(){return(t,e)=>{const n=ji(e()),r=ho(e()),i=ja(e()),o=eR(e()),s=pO(e()),a=e().controlState.sidebarOpen,l=e().controlState.sidebarPanelId;r&&i&&o&&(l!=="stats"&&t(Nae("stats")),a||t(Fae(!0)),t(j0e(null)),Xpt(n.url,r,i,o,s,e().userAuthState.accessToken).then(c=>t(j0e(c))).catch(c=>{t(ws("error",c))}))}}const sUe="ADD_STATISTICS";function j0e(t){return{type:sUe,statistics:t}}const aUe="REMOVE_STATISTICS";function FQt(t){return{type:aUe,index:t}}function tU(){return(t,e)=>{const n=ji(e()),r=ho(e()),i=hO(e()),o=ja(e()),s=fO(e()),a=vDe(e()),l=e().controlState.timeSeriesUpdateMode,c=e().controlState.timeSeriesUseMedian,u=e().controlState.timeSeriesIncludeStdev;let f=a_t(e());const d=e().controlState.sidebarOpen,h=e().controlState.sidebarPanelId,p=DRe(e());if(r&&o&&s&&i){h!=="timeSeries"&&t(Nae("timeSeries")),d||t(Fae(!0));const g=i.labels,m=g.length;f=f>0?f:m;let v=m-1,y=v-f+1;const x=()=>{const w=y>=0?g[y]:null,_=g[v];return qpt(n.url,r,o,a.id,a.geometry,w,_,c,u,e().userAuthState.accessToken)},b=w=>{if(w!==null&&B0e(p,a.id)){const _=y>0,S=_?(m-y)/m:1;t(NQt({...w,dataProgress:S},l,v===m-1?"new":"append")),_&&B0e(p,a.id)&&(y-=f,v-=f,x().then(b))}else t(ws("info","No data found here"))};x().then(b).catch(w=>{t(ws("error",w))})}}}function B0e(t,e){return dte(t,e)!==null}const lUe="UPDATE_TIME_SERIES";function NQt(t,e,n){return{type:lUe,timeSeries:t,updateMode:e,dataMode:n}}const cUe="ADD_PLACE_GROUP_TIME_SERIES";function zQt(t,e){return{type:cUe,timeSeriesGroupId:t,timeSeries:e}}const uUe="REMOVE_TIME_SERIES";function jQt(t,e){return{type:uUe,groupId:t,index:e}}const fUe="REMOVE_TIME_SERIES_GROUP";function BQt(t){return{type:fUe,id:t}}const dUe="REMOVE_ALL_TIME_SERIES";function UQt(){return{type:dUe}}const Dae="CONFIGURE_SERVERS";function WQt(t,e,n){return(r,i)=>{i().controlState.selectedServerId!==e?(r(UQt()),r(U0e(t,e)),r(Iae(n))):i().dataState.userServers!==t&&r(U0e(t,e))}}function U0e(t,e){return{type:Dae,servers:t,selectedServerId:e}}function Iae(t,e=!1){return(n,r)=>{n(_Qt()),n(J6e()),n(GQt()),n(qQt());const i=ji(r());zYt({hostStore:VQt(t),logging:{enabled:!1},api:{serverUrl:i.url,endpointName:"viewer/ext"}});const o=jp.get("stateKey");if(o&&e){const s=ji(t.getState()).url;Kpt(s,r().userAuthState.accessToken,o).then(a=>{if(typeof a=="object"){const l=a,{apiUrl:c}=l;n(c===s?xQt(l):ws("warning","Failed to restore state, backend mismatch"))}else n(ws("warning",a))})}}}function VQt(t){return{_initialState:t.getState(),getInitialState(){return this._initialState},getState(){return t.getState()},setState(e,n){throw new Error("Changing the host state from contributions is not yet supported")},_prevState:t.getState(),subscribe(e){return t.subscribe(()=>{const n=t.getState();n!==this._prevState&&(e(n,this._prevState),this._prevState=n)})}}}const hUe="UPDATE_EXPRESSION_CAPABILITIES";function GQt(){return(t,e)=>{const n=ji(e());Gpt(n.url).then(r=>{t(HQt(r))}).catch(r=>{t(ws("error",r))})}}function HQt(t){return{type:hUe,expressionCapabilities:t}}const pUe="UPDATE_COLOR_BARS";function qQt(){return(t,e)=>{const n=ji(e());Fpt(n.url).then(r=>{t(XQt(r))}).catch(r=>{t(ws("error",r))})}}function XQt(t){return{type:pUe,colorBars:t}}const gUe="UPDATE_VARIABLE_COLOR_BAR";function YQt(t,e,n,r){return(i,o)=>{const s=o().controlState.selectedDatasetId,a=o().controlState.selectedVariableName;s&&a&&i(mUe(s,a,t,e,n,r))}}function QQt(t,e,n,r){return(i,o)=>{const s=o().controlState.selectedDatasetId,a=o().controlState.selectedVariable2Name;s&&a&&i(mUe(s,a,t,e,n,r))}}function mUe(t,e,n,r,i,o){if(i==="log"){let[s,a]=r;s<=0&&(s=.001),a<=s&&(a=1),r=[s,a]}return{type:gUe,datasetId:t,variableName:e,colorBarName:n,colorBarMinMax:r,colorBarNorm:i,opacity:o}}const vUe="UPDATE_VARIABLE_VOLUME";function KQt(t,e,n,r,i){return{type:vUe,datasetId:t,variableName:e,variableColorBar:n,volumeRenderMode:r,volumeIsoThreshold:i}}function ZQt(){return(t,e)=>{const{exportTimeSeries:n,exportTimeSeriesSeparator:r,exportPlaces:i,exportPlacesAsCollection:o,exportZipArchive:s,exportFileName:a}=e().controlState;let l=[];n?(l=[],XM(e()).forEach(u=>{u.placeGroups&&(l=l.concat(u.placeGroups))}),l=[...l,...YM(e())]):i&&(l=dO(e())),tKt(e().dataState.timeSeriesGroups,l,{includeTimeSeries:n,includePlaces:i,separator:r,placesAsCollection:o,zip:s,fileName:a})}}class yUe{}class JQt extends yUe{constructor(n){super();gn(this,"fileName");gn(this,"zipArchive");this.fileName=n,this.zipArchive=new $_t}write(n,r){this.zipArchive.file(n,r)}close(){this.zipArchive.generateAsync({type:"blob"}).then(n=>$De.saveAs(n,this.fileName))}}class eKt extends yUe{write(e,n){const r=new Blob([n],{type:"text/plain;charset=utf-8"});$De.saveAs(r,e)}close(){}}function tKt(t,e,n){const{includeTimeSeries:r,includePlaces:i,placesAsCollection:o,zip:s}=n;let{separator:a,fileName:l}=n;if(a=a||"TAB",a.toUpperCase()==="TAB"&&(a=" "),l=l||"export",!r&&!i)return;let c;s?c=new JQt(`${l}.zip`):c=new eKt;let u;if(r){const{colNames:f,dataRows:d,referencedPlaces:h}=cbt(t,e),p={number:!0,string:!0},g=f.join(a),m=d.map(y=>y.map(x=>p[typeof x]?x+"":"").join(a)),v=[g].concat(m).join(` -`);c.write(`${l}.txt`,v),u=h}else u={},e.forEach(f=>{f.features&&f.features.forEach(d=>{u[d.id]=d})});if(i)if(o){const f={type:"FeatureCollection",features:Object.keys(u).map(d=>u[d])};c.write(`${l}.geojson`,JSON.stringify(f,null,2))}else Object.keys(u).forEach(f=>{c.write(`${f}.geojson`,JSON.stringify(u[f],null,2))});c.close()}const xUe="SELECT_DATASET";function bUe(t,e,n){return(r,i)=>{r(nKt(t,e));const o=i().controlState.datasetLocateMode;t&&n&&o!=="doNothing"&&r(wUe(t,i().controlState.datasetLocateMode==="panAndZoom"))}}function nKt(t,e){return{type:xUe,selectedDatasetId:t,datasets:e}}function rKt(){return(t,e)=>{const n=QM(e());n&&t(wUe(n,!0))}}function iKt(){return(t,e)=>{const n=fO(e());n&&t(_Ue(n,!0))}}function wUe(t,e){return(n,r)=>{const i=XM(r()),o=dA(i,t);o&&o.bbox&&n(ZY(o.bbox,e))}}const oKt=["Point","LineString","LinearRing","Polygon","MultiPoint","MultiLineString","MultiPolygon","Circle"];function _Ue(t,e){return(n,r)=>{const i=dO(r()),o=dte(i,t);o&&(o.bbox&&o.bbox.length===4?n(ZY(o.bbox,e)):o.geometry&&oKt.includes(o.geometry.type)&&n(ZY(new rb().readGeometry(o.geometry),e)))}}function ZY(t,e){return n=>{if(t!==null){const r="map";n(sKt(r,t)),pQt(r,t,e)}}}const SUe="FLY_TO";function sKt(t,e){return{type:SUe,mapId:t,location:e}}const CUe="SELECT_PLACE_GROUPS";function aKt(t){return(e,n)=>{const r=ji(n());e(lKt(t));const i=ho(n()),o=mDe(n());if(i!==null&&o.length>0){for(const s of o)if(!nO(s)){const a=i.id,l=s.id,c=`${kae}-${a}-${l}`;e(QR(c,ge.get("Loading places"))),Vpt(r.url,a,l,n().userAuthState.accessToken).then(u=>{e(EQt(i.id,u))}).catch(u=>{e(ws("error",u))}).finally(()=>{e(KR(c))})}}}}function lKt(t){return{type:CUe,selectedPlaceGroupIds:t}}const OUe="SELECT_PLACE";function nU(t,e,n){return(r,i)=>{r(cKt(t,e));const o=i().controlState.placeLocateMode;n&&t&&o!=="doNothing"&&r(_Ue(t,i().controlState.placeLocateMode==="panAndZoom"))}}function cKt(t,e){return{type:OUe,placeId:t,places:e}}const EUe="SET_LAYER_VISIBILITY";function uKt(t,e){return{type:EUe,layerId:t,visible:e}}const TUe="SET_MAP_POINT_INFO_BOX_ENABLED";function fKt(t){return{type:TUe,mapPointInfoBoxEnabled:t}}const kUe="SET_VARIABLE_COMPARE_MODE";function dKt(t){return{type:kUe,variableCompareMode:t}}const Lae="SET_VARIABLE_SPLIT_POS";function hKt(t){return{type:Lae,variableSplitPos:t}}const AUe="SELECT_VARIABLE";function PUe(t){return{type:AUe,selectedVariableName:t}}const MUe="SELECT_VARIABLE_2";function pKt(t,e){return{type:MUe,selectedDataset2Id:t,selectedVariable2Name:e}}const RUe="SELECT_TIME";function rU(t){return{type:RUe,selectedTime:t}}const DUe="INC_SELECTED_TIME";function gKt(t){return{type:DUe,increment:t}}const $ae="SELECT_TIME_RANGE";function IUe(t,e,n){return{type:$ae,selectedTimeRange:t,selectedGroupId:e,selectedValueRange:n}}const mKt="SELECT_TIME_SERIES_UPDATE_MODE",LUe="UPDATE_TIME_ANIMATION";function vKt(t,e){return{type:LUe,timeAnimationActive:t,timeAnimationInterval:e}}const $Ue="SET_MAP_INTERACTION";function FUe(t){return{type:$Ue,mapInteraction:t}}const NUe="SET_LAYER_MENU_OPEN";function zUe(t){return{type:NUe,layerMenuOpen:t}}const jUe="SET_SIDEBAR_POSITION";function yKt(t){return{type:jUe,sidebarPosition:t}}const BUe="SET_SIDEBAR_OPEN";function Fae(t){return{type:BUe,sidebarOpen:t}}const UUe="SET_SIDEBAR_PANEL_ID";function Nae(t){return{type:UUe,sidebarPanelId:t}}const WUe="SET_VOLUME_RENDER_MODE";function xKt(t){return{type:WUe,volumeRenderMode:t}}const VUe="UPDATE_VOLUME_STATE";function bKt(t,e){return{type:VUe,volumeId:t,volumeState:e}}const GUe="SET_VISIBLE_INFO_CARD_ELEMENTS";function wKt(t){return{type:GUe,visibleElements:t}}const HUe="UPDATE_INFO_CARD_ELEMENT_VIEW_MODE";function _Kt(t,e){return{type:HUe,elementType:t,viewMode:e}}const qUe="ADD_ACTIVITY";function QR(t,e){return{type:qUe,id:t,message:e}}const XUe="REMOVE_ACTIVITY";function KR(t){return{type:XUe,id:t}}const YUe="CHANGE_LOCALE";function QUe(t){return{type:YUe,locale:t}}const KUe="OPEN_DIALOG";function _b(t){return{type:KUe,dialogId:t}}const ZUe="CLOSE_DIALOG";function BO(t){return{type:ZUe,dialogId:t}}const zae="UPDATE_SETTINGS";function ZR(t){return{type:zae,settings:t}}const JUe="STORE_SETTINGS";function e8e(){return{type:JUe}}function t8e(t){return e=>{e(SKt(t)),e(CKt(t))}}const n8e="ADD_USER_COLOR_BAR";function SKt(t){return{type:n8e,colorBarId:t}}const r8e="REMOVE_USER_COLOR_BAR";function i8e(t){return{type:r8e,colorBarId:t}}function o8e(t){return e=>{e(a8e(t)),e(jae(t))}}const s8e="UPDATE_USER_COLOR_BAR";function a8e(t){return{type:s8e,userColorBar:t}}function CKt(t){return(e,n)=>{const r=n().controlState.userColorBars.find(i=>i.id===t);r&&e(jae(r))}}function jae(t){return e=>{bgt(t).then(({imageData:n,errorMessage:r})=>{e(a8e({...t,imageData:n,errorMessage:r}))})}}function OKt(){return(t,e)=>{e().controlState.userColorBars.forEach(n=>{n.imageData||t(jae(n))})}}function l8e(t){return{type:zae,settings:{userColorBars:t}}}const W0e=["http","https","mailto","tel"];function EKt(t){const e=(t||"").trim(),n=e.charAt(0);if(n==="#"||n==="/")return e;const r=e.indexOf(":");if(r===-1)return e;let i=-1;for(;++ii||(i=e.indexOf("#"),i!==-1&&r>i)?e:"javascript:void(0)"}/*! + */var axe;function XYt(){if(axe)return d2;axe=1;var t=de,e=Symbol.for("react.element"),n=Symbol.for("react.fragment"),r=Object.prototype.hasOwnProperty,i=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,o={key:!0,ref:!0,__self:!0,__source:!0};function s(a,l,c){var u,f={},d=null,h=null;c!==void 0&&(d=""+c),l.key!==void 0&&(d=""+l.key),l.ref!==void 0&&(h=l.ref);for(u in l)r.call(l,u)&&!o.hasOwnProperty(u)&&(f[u]=l[u]);if(a&&a.defaultProps)for(u in l=a.defaultProps,l)f[u]===void 0&&(f[u]=l[u]);return{$$typeof:e,type:a,key:d,ref:h,props:f,_owner:i.current}}return d2.Fragment=n,d2.jsx=s,d2.jsxs=s,d2}bUe.exports=XYt();var Ci=bUe.exports;function wUe(t){const{type:e}=t,n=nm.lookup(e);return typeof n=="function"?Ci.jsx(n,{...t}):(console.error(`chartlets: invalid component type encountered: ${e}`),null)}function _Ue({nodes:t,onChange:e}){return!t||t.length===0?null:Ci.jsx(Ci.Fragment,{children:t.map((n,r)=>{if(W_(n)){const i=n.id||r;return Ci.jsx(wUe,{...n,onChange:e},i)}else{if(typeof n=="string")return n;n&&console.warn("chartlets: invalid child node encountered:",n)}})})}const YYt=t=>t.contributionsRecord,QYt=Ss,KYt=()=>QYt(YYt);function ZYt({id:t,style:e,color:n,component:r,children:i,onChange:o}){return Ci.jsx(ot,{id:t,style:e,color:n,component:r||"div",children:Ci.jsx(_Ue,{nodes:i,onChange:o})})}function JYt({type:t,id:e,name:n,style:r,variant:i,color:o,disabled:s,text:a,startIcon:l,endIcon:c,onChange:u}){const f=d=>{e&&u({componentType:t,id:e,property:"clicked",value:!0})};return Ci.jsx(Vr,{id:e,name:n,style:r,variant:i,color:o,disabled:s,startIcon:l&&Ci.jsx(sA,{children:l}),endIcon:c&&Ci.jsx(sA,{children:c}),onClick:f,children:a})}function eQt({type:t,id:e,name:n,value:r,disabled:i,style:o,label:s,onChange:a}){const l=c=>{if(e)return a({componentType:t,id:e,property:"value",value:c.currentTarget.checked})};return Ci.jsx(Ug,{variant:"filled",size:"small",style:o,children:Ci.jsx(Px,{label:s,control:Ci.jsx(LF,{id:e,name:n,checked:!!r,disabled:i,onChange:l})})})}function tQt({id:t,style:e,size:n,value:r,variant:i}){return Ci.jsx(Dy,{id:t,style:e,size:n,value:r,variant:i})}function nQt({type:t,id:e,name:n,style:r,color:i,icon:o,size:s,disabled:a,onChange:l}){const c=u=>{e&&l({componentType:t,id:e,property:"clicked",value:!0})};return Ci.jsx(Ht,{id:e,name:n,style:r,color:i,size:s,disabled:a,onClick:c,children:Ci.jsx(sA,{children:o})})}function rQt({type:t,id:e,style:n,chart:r,onChange:i}){if(!r)return Ci.jsx("div",{id:e,style:n});const{datasets:o,...s}=r,a=(l,c)=>{if(e)return i({componentType:t,id:e,property:"points",value:c})};return Ci.jsx(aYt,{spec:s,data:o,style:n,signalListeners:{onClick:a},actions:!1})}function iQt({type:t,id:e,name:n,value:r,options:i,disabled:o,style:s,label:a,onChange:l}){const c=u=>{if(!e)return;let f=u.target.value;return typeof r=="number"&&(f=Number.parseInt(f)),l({componentType:t,id:e,property:"value",value:f})};return Ci.jsxs(Ug,{variant:"filled",size:"small",style:s,children:[a&&Ci.jsx(Ly,{id:`${e}-label`,children:a}),Ci.jsx(Wg,{labelId:`${e}-label`,id:e,name:n,value:`${r}`,disabled:o,onChange:c,children:Array.isArray(i)&&i.map(oQt).map(([u,f],d)=>Ci.jsx(ti,{value:u,children:f},d))})]})}function oQt(t){return typeof t=="string"?[t,t]:typeof t=="number"?[t,t.toString()]:Array.isArray(t)?t:[t.value,t.label||`${t.value}`]}function sQt({id:t,style:e,align:n,gutterBottom:r,noWrap:i,variant:o,children:s,onChange:a}){return Ci.jsx(Jt,{id:t,style:e,align:n,gutterBottom:r,noWrap:i,variant:o,children:Ci.jsx(_Ue,{nodes:s,onChange:a})})}nm.register("Box",ZYt);nm.register("Button",JYt);nm.register("Checkbox",eQt);nm.register("CircularProgress",tQt);nm.register("IconButton",nQt);nm.register("Plot",rQt);nm.register("Select",iQt);nm.register("Typography",sQt);function aQt(t){return(e,n)=>{const r=Oo(n());NYt({hostStore:Y_t(t),logging:{enabled:!1},api:{serverUrl:r.url,endpointName:"viewer/ext"}})}}const SUe="POST_MESSAGE";function gc(t,e){return{type:SUe,messageType:t,messageText:typeof e=="string"?e:e.message}}const CUe="HIDE_MESSAGE";function lQt(t){return{type:CUe,messageId:t}}var cQt={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]};const lxe=sn(cQt);var cxe={red:0,orange:60,yellow:120,green:180,blue:240,purple:300};function uQt(t){var e,n=[],r=1,i;if(typeof t=="string")if(t=t.toLowerCase(),lxe[t])n=lxe[t].slice(),i="rgb";else if(t==="transparent")r=0,i="rgb",n=[0,0,0];else if(/^#[A-Fa-f0-9]+$/.test(t)){var o=t.slice(1),s=o.length,a=s<=4;r=1,a?(n=[parseInt(o[0]+o[0],16),parseInt(o[1]+o[1],16),parseInt(o[2]+o[2],16)],s===4&&(r=parseInt(o[3]+o[3],16)/255)):(n=[parseInt(o[0]+o[1],16),parseInt(o[2]+o[3],16),parseInt(o[4]+o[5],16)],s===8&&(r=parseInt(o[6]+o[7],16)/255)),n[0]||(n[0]=0),n[1]||(n[1]=0),n[2]||(n[2]=0),i="rgb"}else if(e=/^((?:rgb|hs[lvb]|hwb|cmyk?|xy[zy]|gray|lab|lchu?v?|[ly]uv|lms)a?)\s*\(([^\)]*)\)/.exec(t)){var l=e[1],c=l==="rgb",o=l.replace(/a$/,"");i=o;var s=o==="cmyk"?4:o==="gray"?1:3;n=e[2].trim().split(/\s*[,\/]\s*|\s+/).map(function(d,h){if(/%$/.test(d))return h===s?parseFloat(d)/100:o==="rgb"?parseFloat(d)*255/100:parseFloat(d);if(o[h]==="h"){if(/deg$/.test(d))return parseFloat(d);if(cxe[d]!==void 0)return cxe[d]}return parseFloat(d)}),l===o&&n.push(1),r=c||n[s]===void 0?1:n[s],n=n.slice(0,s)}else t.length>10&&/[0-9](?:\s|\/)/.test(t)&&(n=t.match(/([0-9]+)/g).map(function(u){return parseFloat(u)}),i=t.match(/([a-z])/ig).join("").toLowerCase());else isNaN(t)?Array.isArray(t)||t.length?(n=[t[0],t[1],t[2]],i="rgb",r=t.length===4?t[3]:1):t instanceof Object&&(t.r!=null||t.red!=null||t.R!=null?(i="rgb",n=[t.r||t.red||t.R||0,t.g||t.green||t.G||0,t.b||t.blue||t.B||0]):(i="hsl",n=[t.h||t.hue||t.H||0,t.s||t.saturation||t.S||0,t.l||t.lightness||t.L||t.b||t.brightness]),r=t.a||t.alpha||t.opacity||1,t.opacity!=null&&(r/=100)):(i="rgb",n=[t>>>16,(t&65280)>>>8,t&255]);return{space:i,values:n,alpha:r}}const hQ={name:"rgb",min:[0,0,0],max:[255,255,255],channel:["red","green","blue"],alias:["RGB"]},E9={name:"hsl",min:[0,0,0],max:[360,100,100],channel:["hue","saturation","lightness"],alias:["HSL"],rgb:function(t){var e=t[0]/360,n=t[1]/100,r=t[2]/100,i,o,s,a,l,c=0;if(n===0)return l=r*255,[l,l,l];for(o=r<.5?r*(1+n):r+n-r*n,i=2*r-o,a=[0,0,0];c<3;)s=e+1/3*-(c-1),s<0?s++:s>1&&s--,l=6*s<1?i+(o-i)*6*s:2*s<1?o:3*s<2?i+(o-i)*(2/3-s)*6:i,a[c++]=l*255;return a}};hQ.hsl=function(t){var e=t[0]/255,n=t[1]/255,r=t[2]/255,i=Math.min(e,n,r),o=Math.max(e,n,r),s=o-i,a,l,c;return o===i?a=0:e===o?a=(n-r)/s:n===o?a=2+(r-e)/s:r===o&&(a=4+(e-n)/s),a=Math.min(a*60,360),a<0&&(a+=360),c=(i+o)/2,o===i?l=0:c<=.5?l=s/(o+i):l=s/(2-o-i),[a,l*100,c*100]};function fQt(t){Array.isArray(t)&&t.raw&&(t=String.raw(...arguments));var e,n=uQt(t);if(!n.space)return[];const r=n.space[0]==="h"?E9.min:hQ.min,i=n.space[0]==="h"?E9.max:hQ.max;return e=Array(3),e[0]=Math.min(Math.max(n.values[0],r[0]),i[0]),e[1]=Math.min(Math.max(n.values[1],r[1]),i[1]),e[2]=Math.min(Math.max(n.values[2],r[2]),i[2]),n.space[0]==="h"&&(e=E9.rgb(e)),e.push(Math.min(Math.max(n.alpha,0),1)),e}function Gae(t,e,n,r="circle"){if(t.getGeometry()instanceof uh)t.setStyle(dQt(7,e,"white",2,r));else{n=typeof n=="number"?n:.25;let i=fQt(e);Array.isArray(i)?i=[i[0],i[1],i[2],n]:i=[255,255,255,n],t.setStyle(pQt(i,e,2))}}function dQt(t,e,n,r,i="circle"){return new Yd({image:hQt(t,e,n,r,i)})}function hQt(t,e,n,r,i){const o=new ab({color:e}),s=new fh({color:n,width:r});switch(i){case"square":return new kq({fill:o,stroke:s,radius:t,points:4,angle:Math.PI/4,rotation:0});case"diamond":return new kq({fill:o,stroke:s,radius:t,points:4,angle:Math.PI/4,rotation:Math.PI/4});default:return new BM({fill:o,stroke:s,radius:t})}}function pQt(t,e,n){const r=new ab({color:t}),i=new fh({color:e,width:n});return new Yd({fill:r,stroke:i})}function gQt(t,e,n){Kc[t]}function mQt(t,e,n){if(Kc[t]){const i=Kc[t].getSource(),o=i==null?void 0:i.getFeatureById(e);o&&Gae(o,n.color,n.opacity)}}function vQt(t,e,n){if(Kc[t]){const r=Kc[t],i=r.getView().getProjection(),s=(Array.isArray(e)?Sq(e):e).transform(tO,i);s.getType()==="Point"?r.getView().setCenter(s.getFirstCoordinate()):n?r.getView().fit(s,{size:r.getSize()}):r.getView().setCenter(ey(s.getExtent()))}}const G5="UPDATE_SERVER_INFO";function yQt(){return(t,e)=>{const n=Oo(e());t(nU(G5,me.get("Connecting to server"))),sSt(n.url).then(r=>{t(xQt(r))}).catch(r=>{t(gc("error",r))}).then(()=>{t(rU(G5))})}}function xQt(t){return{type:G5,serverInfo:t}}const uxe="UPDATE_RESOURCES";function OUe(){return(t,e)=>{const n=Oo(e());t(nU(uxe,me.get("Updating resources"))),uSt(n.url,e().userAuthState.accessToken).then(r=>{r&&window.location.reload()}).finally(()=>t(rU(uxe)))}}const eP="UPDATE_DATASETS";function EUe(){return(t,e)=>{const n=Oo(e());t(nU(eP,me.get("Loading data"))),tSt(n.url,e().userAuthState.accessToken).then(r=>{const i=lwt();if(r=r.map(o=>({...o,variables:[...o.variables,...i[o.id]||[]]})),t(fxe(r)),r.length>0){const o=e().controlState.selectedDatasetId||r[0].id;t(qUe(o,r,!0))}}).catch(r=>{t(gc("error",r)),t(fxe([]))}).then(()=>{t(rU(eP))})}}function fxe(t){return{type:eP,datasets:t}}function bQt(t,e){return(n,r)=>{n(wQt(t,e));const i={};r().dataState.datasets.forEach(o=>{const[s,a]=Bte(o);a.length>=0&&(i[o.id]=a)}),awt(i)}}const TUe="UPDATE_DATASET_USER_VARIABLES";function wQt(t,e){return{type:TUe,datasetId:t,userVariables:e}}const Hae="UPDATE_DATASET_PLACE_GROUP";function _Qt(t,e){return{type:Hae,datasetId:t,placeGroup:e}}const qae="ADD_DRAWN_USER_PLACE";function SQt(t,e,n,r,i){return(o,s)=>{o(CQt(t,e,n,r,i)),s().controlState.autoShowTimeSeries&&s().controlState.selectedPlaceId===e&&o(J6())}}function CQt(t,e,n,r,i){return{type:qae,placeGroupTitle:t,id:e,properties:n,geometry:r,selected:i}}const Xae="ADD_IMPORTED_USER_PLACES";function OQt(t,e,n){return{type:Xae,placeGroups:t,mapProjection:e,selected:n}}function kUe(t){return(e,n)=>{const r=Vwt(n());let i;try{if(r==="csv"){const o=Gwt(n());i=q1t(t,o)}else if(r==="geojson"){const o=Hwt(n());i=Z1t(t,o)}else if(r==="wkt"){const o=qwt(n());i=nwt(t,o)}else i=[]}catch(o){e(gc("error",o)),e(_1("addUserPlacesFromText")),i=[]}if(i.length>0){if(e(OQt(i,Ny(n()),!0)),i.length===1&&i[0].features.length===1){const s=i[0].features[0];e(eU(s.id,ZM(n()),!0)),n().controlState.autoShowTimeSeries&&e(J6())}let o=0;i.forEach(s=>{o+=s.features?s.features.length:0}),e(gc("info",me.get(`Imported ${o} place(s) in ${i.length} groups(s), 1 selected`)))}else e(gc("warning",me.get("No places imported")))}}const Yae="RENAME_USER_PLACE_GROUP";function EQt(t,e){return{type:Yae,placeGroupId:t,newName:e}}const AUe="RENAME_USER_PLACE";function TQt(t,e,n){return r=>{r(kQt(t,e,n)),gQt(t)}}function kQt(t,e,n){return{type:AUe,placeGroupId:t,placeId:e,newName:n}}const PUe="RESTYLE_USER_PLACE";function AQt(t,e,n){return r=>{r(PQt(t,e,n)),mQt(t,e,n)}}function PQt(t,e,n){return{type:PUe,placeGroupId:t,placeId:e,placeStyle:n}}const Qae="REMOVE_USER_PLACE";function MQt(t,e,n){return{type:Qae,placeGroupId:t,placeId:e,places:n}}const MUe="REMOVE_USER_PLACE_GROUP";function RQt(t){return{type:MUe,placeGroupId:t}}function RUe(){return(t,e)=>{const n=Oo(e()),r=fo(e()),i=Na(e()),o=JM(e()),s=i1(e()),a=e().controlState.sidebarOpen,l=e().controlState.sidebarPanelId;r&&i&&o&&(l!=="stats"&&t(nle("stats")),a||t(tle(!0)),t(dxe(null)),lSt(n.url,r,i,o,s,e().userAuthState.accessToken).then(c=>t(dxe(c))).catch(c=>{t(gc("error",c))}))}}const DUe="ADD_STATISTICS";function dxe(t){return{type:DUe,statistics:t}}const IUe="REMOVE_STATISTICS";function DQt(t){return{type:IUe,index:t}}function J6(){return(t,e)=>{const n=Oo(e()),r=fo(e()),i=hO(e()),o=Na(e()),s=fO(e()),a=one(e()),l=e().controlState.timeSeriesUpdateMode,c=e().controlState.timeSeriesUseMedian,u=e().controlState.timeSeriesIncludeStdev;let f=w_t(e());const d=e().controlState.sidebarOpen,h=e().controlState.sidebarPanelId,p=KRe(e());if(r&&o&&s&&i){h!=="timeSeries"&&t(nle("timeSeries")),d||t(tle(!0));const g=i.labels,m=g.length;f=f>0?f:m;let v=m-1,y=v-f+1;const x=()=>{const w=y>=0?g[y]:null,_=g[v];return aSt(n.url,r,o,a.id,a.geometry,w,_,c,u,e().userAuthState.accessToken)},b=w=>{if(w!==null&&hxe(p,a.id)){const _=y>0,S=_?(m-y)/m:1;t(IQt({...w,dataProgress:S},l,v===m-1?"new":"append")),_&&hxe(p,a.id)&&(y-=f,v-=f,x().then(b))}else t(gc("info","No data found here"))};x().then(b).catch(w=>{t(gc("error",w))})}}}function hxe(t,e){return Gte(t,e)!==null}const LUe="UPDATE_TIME_SERIES";function IQt(t,e,n){return{type:LUe,timeSeries:t,updateMode:e,dataMode:n}}const $Ue="ADD_PLACE_GROUP_TIME_SERIES";function LQt(t,e){return{type:$Ue,timeSeriesGroupId:t,timeSeries:e}}const FUe="REMOVE_TIME_SERIES";function $Qt(t,e){return{type:FUe,groupId:t,index:e}}const NUe="REMOVE_TIME_SERIES_GROUP";function FQt(t){return{type:NUe,id:t}}const zUe="REMOVE_ALL_TIME_SERIES";function NQt(){return{type:zUe}}const Kae="CONFIGURE_SERVERS";function zQt(t,e,n){return(r,i)=>{i().controlState.selectedServerId!==e?(r(NQt()),r(pxe(t,e)),r(Zae(n))):i().dataState.userServers!==t&&r(pxe(t,e))}}function pxe(t,e){return{type:Kae,servers:t,selectedServerId:e}}function Zae(t){return e=>{e(yQt()),e(EUe()),e(jQt()),e(UQt()),e(aQt(t))}}const jUe="UPDATE_EXPRESSION_CAPABILITIES";function jQt(){return(t,e)=>{const n=Oo(e());oSt(n.url).then(r=>{t(BQt(r))}).catch(r=>{t(gc("error",r))})}}function BQt(t){return{type:jUe,expressionCapabilities:t}}const BUe="UPDATE_COLOR_BARS";function UQt(){return(t,e)=>{const n=Oo(e());K_t(n.url).then(r=>{t(WQt(r))}).catch(r=>{t(gc("error",r))})}}function WQt(t){return{type:BUe,colorBars:t}}const UUe="UPDATE_VARIABLE_COLOR_BAR";function VQt(t,e,n,r){return(i,o)=>{const s=o().controlState.selectedDatasetId,a=o().controlState.selectedVariableName;s&&a&&i(WUe(s,a,t,e,n,r))}}function GQt(t,e,n,r){return(i,o)=>{const s=o().controlState.selectedDatasetId,a=o().controlState.selectedVariable2Name;s&&a&&i(WUe(s,a,t,e,n,r))}}function WUe(t,e,n,r,i,o){if(i==="log"){let[s,a]=r;s<=0&&(s=.001),a<=s&&(a=1),r=[s,a]}return{type:UUe,datasetId:t,variableName:e,colorBarName:n,colorBarMinMax:r,colorBarNorm:i,opacity:o}}const VUe="UPDATE_VARIABLE_VOLUME";function HQt(t,e,n,r,i){return{type:VUe,datasetId:t,variableName:e,variableColorBar:n,volumeRenderMode:r,volumeIsoThreshold:i}}function qQt(){return(t,e)=>{const{exportTimeSeries:n,exportTimeSeriesSeparator:r,exportPlaces:i,exportPlacesAsCollection:o,exportZipArchive:s,exportFileName:a}=e().controlState;let l=[];n?(l=[],HM(e()).forEach(u=>{u.placeGroups&&(l=l.concat(u.placeGroups))}),l=[...l,...qM(e())]):i&&(l=dO(e())),QQt(e().dataState.timeSeriesGroups,l,{includeTimeSeries:n,includePlaces:i,separator:r,placesAsCollection:o,zip:s,fileName:a})}}class GUe{}class XQt extends GUe{constructor(n){super();gn(this,"fileName");gn(this,"zipArchive");this.fileName=n,this.zipArchive=new dSt}write(n,r){this.zipArchive.file(n,r)}close(){this.zipArchive.generateAsync({type:"blob"}).then(n=>aIe.saveAs(n,this.fileName))}}class YQt extends GUe{write(e,n){const r=new Blob([n],{type:"text/plain;charset=utf-8"});aIe.saveAs(r,e)}close(){}}function QQt(t,e,n){const{includeTimeSeries:r,includePlaces:i,placesAsCollection:o,zip:s}=n;let{separator:a,fileName:l}=n;if(a=a||"TAB",a.toUpperCase()==="TAB"&&(a=" "),l=l||"export",!r&&!i)return;let c;s?c=new XQt(`${l}.zip`):c=new YQt;let u;if(r){const{colNames:f,dataRows:d,referencedPlaces:h}=p1t(t,e),p={number:!0,string:!0},g=f.join(a),m=d.map(y=>y.map(x=>p[typeof x]?x+"":"").join(a)),v=[g].concat(m).join(` +`);c.write(`${l}.txt`,v),u=h}else u={},e.forEach(f=>{f.features&&f.features.forEach(d=>{u[d.id]=d})});if(i)if(o){const f={type:"FeatureCollection",features:Object.keys(u).map(d=>u[d])};c.write(`${l}.geojson`,JSON.stringify(f,null,2))}else Object.keys(u).forEach(f=>{c.write(`${f}.geojson`,JSON.stringify(u[f],null,2))});c.close()}const HUe="SELECT_DATASET";function qUe(t,e,n){return(r,i)=>{r(KQt(t,e));const o=i().controlState.datasetLocateMode;t&&n&&o!=="doNothing"&&r(XUe(t,i().controlState.datasetLocateMode==="panAndZoom"))}}function KQt(t,e){return{type:HUe,selectedDatasetId:t,datasets:e}}function ZQt(){return(t,e)=>{const n=uO(e());n&&t(XUe(n,!0))}}function JQt(){return(t,e)=>{const n=fO(e());n&&t(YUe(n,!0))}}function XUe(t,e){return(n,r)=>{const i=HM(r()),o=yA(i,t);o&&o.bbox&&n(pQ(o.bbox,e))}}const eKt=["Point","LineString","LinearRing","Polygon","MultiPoint","MultiLineString","MultiPolygon","Circle"];function YUe(t,e){return(n,r)=>{const i=dO(r()),o=Gte(i,t);o&&(o.bbox&&o.bbox.length===4?n(pQ(o.bbox,e)):o.geometry&&eKt.includes(o.geometry.type)&&n(pQ(new t1().readGeometry(o.geometry),e)))}}function pQ(t,e){return n=>{if(t!==null){const r="map";n(tKt(r,t)),vQt(r,t,e)}}}const QUe="FLY_TO";function tKt(t,e){return{type:QUe,mapId:t,location:e}}const KUe="SELECT_PLACE_GROUPS";function nKt(t){return(e,n)=>{const r=Oo(n());e(rKt(t));const i=fo(n()),o=UDe(n());if(i!==null&&o.length>0){for(const s of o)if(!iO(s)){const a=i.id,l=s.id,c=`${Hae}-${a}-${l}`;e(nU(c,me.get("Loading places"))),iSt(r.url,a,l,n().userAuthState.accessToken).then(u=>{e(_Qt(i.id,u))}).catch(u=>{e(gc("error",u))}).finally(()=>{e(rU(c))})}}}}function rKt(t){return{type:KUe,selectedPlaceGroupIds:t}}const ZUe="SELECT_PLACE";function eU(t,e,n){return(r,i)=>{r(iKt(t,e));const o=i().controlState.placeLocateMode;n&&t&&o!=="doNothing"&&r(YUe(t,i().controlState.placeLocateMode==="panAndZoom"))}}function iKt(t,e){return{type:ZUe,placeId:t,places:e}}const JUe="SET_LAYER_VISIBILITY";function oKt(t,e){return{type:JUe,layerId:t,visible:e}}const e8e="SET_MAP_POINT_INFO_BOX_ENABLED";function sKt(t){return{type:e8e,mapPointInfoBoxEnabled:t}}const t8e="SET_VARIABLE_COMPARE_MODE";function aKt(t){return{type:t8e,variableCompareMode:t}}const Jae="SET_VARIABLE_SPLIT_POS";function lKt(t){return{type:Jae,variableSplitPos:t}}const n8e="SELECT_VARIABLE";function r8e(t){return{type:n8e,selectedVariableName:t}}const i8e="SELECT_VARIABLE_2";function cKt(t,e){return{type:i8e,selectedDataset2Id:t,selectedVariable2Name:e}}const o8e="SELECT_TIME";function tU(t){return{type:o8e,selectedTime:t}}const s8e="INC_SELECTED_TIME";function uKt(t){return{type:s8e,increment:t}}const ele="SELECT_TIME_RANGE";function a8e(t,e,n){return{type:ele,selectedTimeRange:t,selectedGroupId:e,selectedValueRange:n}}const fKt="SELECT_TIME_SERIES_UPDATE_MODE",l8e="UPDATE_TIME_ANIMATION";function dKt(t,e){return{type:l8e,timeAnimationActive:t,timeAnimationInterval:e}}const c8e="SET_MAP_INTERACTION";function u8e(t){return{type:c8e,mapInteraction:t}}const f8e="SET_LAYER_MENU_OPEN";function d8e(t){return{type:f8e,layerMenuOpen:t}}const h8e="SET_SIDEBAR_POSITION";function hKt(t){return{type:h8e,sidebarPosition:t}}const p8e="SET_SIDEBAR_OPEN";function tle(t){return{type:p8e,sidebarOpen:t}}const g8e="SET_SIDEBAR_PANEL_ID";function nle(t){return{type:g8e,sidebarPanelId:t}}const m8e="SET_VOLUME_RENDER_MODE";function pKt(t){return{type:m8e,volumeRenderMode:t}}const v8e="UPDATE_VOLUME_STATE";function gKt(t,e){return{type:v8e,volumeId:t,volumeState:e}}const y8e="SET_VISIBLE_INFO_CARD_ELEMENTS";function mKt(t){return{type:y8e,visibleElements:t}}const x8e="UPDATE_INFO_CARD_ELEMENT_VIEW_MODE";function vKt(t,e){return{type:x8e,elementType:t,viewMode:e}}const b8e="ADD_ACTIVITY";function nU(t,e){return{type:b8e,id:t,message:e}}const w8e="REMOVE_ACTIVITY";function rU(t){return{type:w8e,id:t}}const _8e="CHANGE_LOCALE";function S8e(t){return{type:_8e,locale:t}}const C8e="OPEN_DIALOG";function _1(t){return{type:C8e,dialogId:t}}const O8e="CLOSE_DIALOG";function jO(t){return{type:O8e,dialogId:t}}const rle="UPDATE_SETTINGS";function YR(t){return{type:rle,settings:t}}const E8e="STORE_SETTINGS";function T8e(){return{type:E8e}}function k8e(t){return e=>{e(yKt(t)),e(xKt(t))}}const A8e="ADD_USER_COLOR_BAR";function yKt(t){return{type:A8e,colorBarId:t}}const P8e="REMOVE_USER_COLOR_BAR";function M8e(t){return{type:P8e,colorBarId:t}}function R8e(t){return e=>{e(I8e(t)),e(ile(t))}}const D8e="UPDATE_USER_COLOR_BAR";function I8e(t){return{type:D8e,userColorBar:t}}function xKt(t){return(e,n)=>{const r=n().controlState.userColorBars.find(i=>i.id===t);r&&e(ile(r))}}function ile(t){return e=>{kwt(t).then(({imageData:n,errorMessage:r})=>{e(I8e({...t,imageData:n,errorMessage:r}))})}}function bKt(){return(t,e)=>{e().controlState.userColorBars.forEach(n=>{n.imageData||t(ile(n))})}}function L8e(t){return{type:rle,settings:{userColorBars:t}}}const gxe=["http","https","mailto","tel"];function wKt(t){const e=(t||"").trim(),n=e.charAt(0);if(n==="#"||n==="/")return e;const r=e.indexOf(":");if(r===-1)return e;let i=-1;for(;++ii||(i=e.indexOf("#"),i!==-1&&r>i)?e:"javascript:void(0)"}/*! * Determine if an object is a Buffer * * @author Feross Aboukhadijeh * @license MIT - */var TKt=function(e){return e!=null&&e.constructor!=null&&typeof e.constructor.isBuffer=="function"&&e.constructor.isBuffer(e)};const c8e=on(TKt);function xk(t){return!t||typeof t!="object"?"":"position"in t||"type"in t?V0e(t.position):"start"in t||"end"in t?V0e(t):"line"in t||"column"in t?JY(t):""}function JY(t){return G0e(t&&t.line)+":"+G0e(t&&t.column)}function V0e(t){return JY(t&&t.start)+"-"+JY(t&&t.end)}function G0e(t){return t&&typeof t=="number"?t:1}class Uu extends Error{constructor(e,n,r){const i=[null,null];let o={start:{line:null,column:null},end:{line:null,column:null}};if(super(),typeof n=="string"&&(r=n,n=void 0),typeof r=="string"){const s=r.indexOf(":");s===-1?i[1]=r:(i[0]=r.slice(0,s),i[1]=r.slice(s+1))}n&&("type"in n||"position"in n?n.position&&(o=n.position):"start"in n||"end"in n?o=n:("line"in n||"column"in n)&&(o.start=n)),this.name=xk(n)||"1:1",this.message=typeof e=="object"?e.message:e,this.stack="",typeof e=="object"&&e.stack&&(this.stack=e.stack),this.reason=this.message,this.fatal,this.line=o.start.line,this.column=o.start.column,this.position=o,this.source=i[0],this.ruleId=i[1],this.file,this.actual,this.expected,this.url,this.note}}Uu.prototype.file="";Uu.prototype.name="";Uu.prototype.reason="";Uu.prototype.message="";Uu.prototype.stack="";Uu.prototype.fatal=null;Uu.prototype.column=null;Uu.prototype.line=null;Uu.prototype.source=null;Uu.prototype.ruleId=null;Uu.prototype.position=null;const kd={basename:kKt,dirname:AKt,extname:PKt,join:MKt,sep:"/"};function kKt(t,e){if(e!==void 0&&typeof e!="string")throw new TypeError('"ext" argument must be a string');JR(t);let n=0,r=-1,i=t.length,o;if(e===void 0||e.length===0||e.length>t.length){for(;i--;)if(t.charCodeAt(i)===47){if(o){n=i+1;break}}else r<0&&(o=!0,r=i+1);return r<0?"":t.slice(n,r)}if(e===t)return"";let s=-1,a=e.length-1;for(;i--;)if(t.charCodeAt(i)===47){if(o){n=i+1;break}}else s<0&&(o=!0,s=i+1),a>-1&&(t.charCodeAt(i)===e.charCodeAt(a--)?a<0&&(r=i):(a=-1,r=s));return n===r?r=s:r<0&&(r=t.length),t.slice(n,r)}function AKt(t){if(JR(t),t.length===0)return".";let e=-1,n=t.length,r;for(;--n;)if(t.charCodeAt(n)===47){if(r){e=n;break}}else r||(r=!0);return e<0?t.charCodeAt(0)===47?"/":".":e===1&&t.charCodeAt(0)===47?"//":t.slice(0,e)}function PKt(t){JR(t);let e=t.length,n=-1,r=0,i=-1,o=0,s;for(;e--;){const a=t.charCodeAt(e);if(a===47){if(s){r=e+1;break}continue}n<0&&(s=!0,n=e+1),a===46?i<0?i=e:o!==1&&(o=1):i>-1&&(o=-1)}return i<0||n<0||o===0||o===1&&i===n-1&&i===r+1?"":t.slice(i,n)}function MKt(...t){let e=-1,n;for(;++e0&&t.charCodeAt(t.length-1)===47&&(n+="/"),e?"/"+n:n}function DKt(t,e){let n="",r=0,i=-1,o=0,s=-1,a,l;for(;++s<=t.length;){if(s2){if(l=n.lastIndexOf("/"),l!==n.length-1){l<0?(n="",r=0):(n=n.slice(0,l),r=n.length-1-n.lastIndexOf("/")),i=s,o=0;continue}}else if(n.length>0){n="",r=0,i=s,o=0;continue}}e&&(n=n.length>0?n+"/..":"..",r=2)}else n.length>0?n+="/"+t.slice(i+1,s):n=t.slice(i+1,s),r=s-i-1;i=s,o=0}else a===46&&o>-1?o++:o=-1}return n}function JR(t){if(typeof t!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(t))}const IKt={cwd:LKt};function LKt(){return"/"}function eQ(t){return t!==null&&typeof t=="object"&&t.href&&t.origin}function $Kt(t){if(typeof t=="string")t=new URL(t);else if(!eQ(t)){const e=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+t+"`");throw e.code="ERR_INVALID_ARG_TYPE",e}if(t.protocol!=="file:"){const e=new TypeError("The URL must be of scheme file");throw e.code="ERR_INVALID_URL_SCHEME",e}return FKt(t)}function FKt(t){if(t.hostname!==""){const r=new TypeError('File URL host must be "localhost" or empty on darwin');throw r.code="ERR_INVALID_FILE_URL_HOST",r}const e=t.pathname;let n=-1;for(;++n"u"||z3.call(e,i)},Z0e=function(e,n){X0e&&n.name==="__proto__"?X0e(e,n.name,{enumerable:!0,configurable:!0,value:n.newValue,writable:!0}):e[n.name]=n.newValue},J0e=function(e,n){if(n==="__proto__")if(z3.call(e,n)){if(Y0e)return Y0e(e,n).value}else return;return e[n]},zKt=function t(){var e,n,r,i,o,s,a=arguments[0],l=1,c=arguments.length,u=!1;for(typeof a=="boolean"&&(u=a,a=arguments[1]||{},l=2),(a==null||typeof a!="object"&&typeof a!="function")&&(a={});ls.length;let l;a&&s.push(i);try{l=t.apply(this,s)}catch(c){const u=c;if(a&&n)throw u;return i(u)}a||(l&&l.then&&typeof l.then=="function"?l.then(o,i):l instanceof Error?i(l):o(l))}function i(s,...a){n||(n=!0,e(s,...a))}function o(s){i(null,s)}}const UKt=h8e().freeze(),d8e={}.hasOwnProperty;function h8e(){const t=jKt(),e=[];let n={},r,i=-1;return o.data=s,o.Parser=void 0,o.Compiler=void 0,o.freeze=a,o.attachers=e,o.use=l,o.parse=c,o.stringify=u,o.run=f,o.runSync=d,o.process=h,o.processSync=p,o;function o(){const g=h8e();let m=-1;for(;++m{if(_||!S||!O)w(_);else{const k=o.stringify(S,O);k==null||(GKt(k)?O.value=k:O.result=k),w(_,O)}});function w(_,S){_||!S?x(_):y?y(S):m(null,S)}}}function p(g){let m;o.freeze(),g9("processSync",o.Parser),m9("processSync",o.Compiler);const v=p2(g);return o.process(v,y),rxe("processSync","process",m),v;function y(x){m=!0,q0e(x)}}}function txe(t,e){return typeof t=="function"&&t.prototype&&(WKt(t.prototype)||e in t.prototype)}function WKt(t){let e;for(e in t)if(d8e.call(t,e))return!0;return!1}function g9(t,e){if(typeof e!="function")throw new TypeError("Cannot `"+t+"` without `Parser`")}function m9(t,e){if(typeof e!="function")throw new TypeError("Cannot `"+t+"` without `Compiler`")}function v9(t,e){if(e)throw new Error("Cannot call `"+t+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function nxe(t){if(!tQ(t)||typeof t.type!="string")throw new TypeError("Expected node, got `"+t+"`")}function rxe(t,e,n){if(!n)throw new Error("`"+t+"` finished async. Use `"+e+"` instead")}function p2(t){return VKt(t)?t:new u8e(t)}function VKt(t){return!!(t&&typeof t=="object"&&"message"in t&&"messages"in t)}function GKt(t){return typeof t=="string"||c8e(t)}const HKt={};function qKt(t,e){const n=HKt,r=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,i=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return p8e(t,r,i)}function p8e(t,e,n){if(XKt(t)){if("value"in t)return t.type==="html"&&!n?"":t.value;if(e&&"alt"in t&&t.alt)return t.alt;if("children"in t)return ixe(t.children,e,n)}return Array.isArray(t)?ixe(t,e,n):""}function ixe(t,e,n){const r=[];let i=-1;for(;++ii?0:i+e:e=e>i?i:e,n=n>0?n:0,r.length<1e4)s=Array.from(r),s.unshift(e,n),t.splice(...s);else for(n&&t.splice(e,n);o0?(Lh(t,t.length,0,e),t):e}const oxe={}.hasOwnProperty;function YKt(t){const e={};let n=-1;for(;++ns))return;const S=e.events.length;let O=S,k,E;for(;O--;)if(e.events[O][0]==="exit"&&e.events[O][1].type==="chunkFlow"){if(k){E=e.events[O][1].end;break}k=!0}for(v(r),_=S;_x;){const w=n[b];e.containerState=w[1],w[0].exit.call(e,t)}n.length=x}function y(){i.write([null]),o=void 0,i=void 0,e.containerState._closeFlow=void 0}}function lZt(t,e,n){return Br(t,t.attempt(this.parser.constructs.document,e,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function axe(t){if(t===null||vl(t)||rZt(t))return 1;if(nZt(t))return 2}function Bae(t,e,n){const r=[];let i=-1;for(;++i1&&t[n][1].end.offset-t[n][1].start.offset>1?2:1;const f=Object.assign({},t[r][1].end),d=Object.assign({},t[n][1].start);lxe(f,-l),lxe(d,l),s={type:l>1?"strongSequence":"emphasisSequence",start:f,end:Object.assign({},t[r][1].end)},a={type:l>1?"strongSequence":"emphasisSequence",start:Object.assign({},t[n][1].start),end:d},o={type:l>1?"strongText":"emphasisText",start:Object.assign({},t[r][1].end),end:Object.assign({},t[n][1].start)},i={type:l>1?"strong":"emphasis",start:Object.assign({},s.start),end:Object.assign({},a.end)},t[r][1].end=Object.assign({},s.start),t[n][1].start=Object.assign({},a.end),c=[],t[r][1].end.offset-t[r][1].start.offset&&(c=Yc(c,[["enter",t[r][1],e],["exit",t[r][1],e]])),c=Yc(c,[["enter",i,e],["enter",s,e],["exit",s,e],["enter",o,e]]),c=Yc(c,Bae(e.parser.constructs.insideSpan.null,t.slice(r+1,n),e)),c=Yc(c,[["exit",o,e],["enter",a,e],["exit",a,e],["exit",i,e]]),t[n][1].end.offset-t[n][1].start.offset?(u=2,c=Yc(c,[["enter",t[n][1],e],["exit",t[n][1],e]])):u=0,Lh(t,r-1,n-r+3,c),n=r+c.length-u-2;break}}for(n=-1;++n0&&sr(_)?Br(t,y,"linePrefix",o+1)(_):y(_)}function y(_){return _===null||Qt(_)?t.check(uxe,g,b)(_):(t.enter("codeFlowValue"),x(_))}function x(_){return _===null||Qt(_)?(t.exit("codeFlowValue"),y(_)):(t.consume(_),x)}function b(_){return t.exit("codeFenced"),e(_)}function w(_,S,O){let k=0;return E;function E(R){return _.enter("lineEnding"),_.consume(R),_.exit("lineEnding"),M}function M(R){return _.enter("codeFencedFence"),sr(R)?Br(_,A,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(R):A(R)}function A(R){return R===a?(_.enter("codeFencedFenceSequence"),P(R)):O(R)}function P(R){return R===a?(k++,_.consume(R),P):k>=s?(_.exit("codeFencedFenceSequence"),sr(R)?Br(_,T,"whitespace")(R):T(R)):O(R)}function T(R){return R===null||Qt(R)?(_.exit("codeFencedFence"),S(R)):O(R)}}}function bZt(t,e,n){const r=this;return i;function i(s){return s===null?n(s):(t.enter("lineEnding"),t.consume(s),t.exit("lineEnding"),o)}function o(s){return r.parser.lazy[r.now().line]?n(s):e(s)}}const y9={name:"codeIndented",tokenize:_Zt},wZt={tokenize:SZt,partial:!0};function _Zt(t,e,n){const r=this;return i;function i(c){return t.enter("codeIndented"),Br(t,o,"linePrefix",5)(c)}function o(c){const u=r.events[r.events.length-1];return u&&u[1].type==="linePrefix"&&u[2].sliceSerialize(u[1],!0).length>=4?s(c):n(c)}function s(c){return c===null?l(c):Qt(c)?t.attempt(wZt,s,l)(c):(t.enter("codeFlowValue"),a(c))}function a(c){return c===null||Qt(c)?(t.exit("codeFlowValue"),s(c)):(t.consume(c),a)}function l(c){return t.exit("codeIndented"),e(c)}}function SZt(t,e,n){const r=this;return i;function i(s){return r.parser.lazy[r.now().line]?n(s):Qt(s)?(t.enter("lineEnding"),t.consume(s),t.exit("lineEnding"),i):Br(t,o,"linePrefix",5)(s)}function o(s){const a=r.events[r.events.length-1];return a&&a[1].type==="linePrefix"&&a[2].sliceSerialize(a[1],!0).length>=4?e(s):Qt(s)?i(s):n(s)}}const CZt={name:"codeText",tokenize:TZt,resolve:OZt,previous:EZt};function OZt(t){let e=t.length-4,n=3,r,i;if((t[n][1].type==="lineEnding"||t[n][1].type==="space")&&(t[e][1].type==="lineEnding"||t[e][1].type==="space")){for(r=n;++r=4?e(s):t.interrupt(r.parser.constructs.flow,n,e)(s)}}function x8e(t,e,n,r,i,o,s,a,l){const c=l||Number.POSITIVE_INFINITY;let u=0;return f;function f(v){return v===60?(t.enter(r),t.enter(i),t.enter(o),t.consume(v),t.exit(o),d):v===null||v===32||v===41||nQ(v)?n(v):(t.enter(r),t.enter(s),t.enter(a),t.enter("chunkString",{contentType:"string"}),g(v))}function d(v){return v===62?(t.enter(o),t.consume(v),t.exit(o),t.exit(i),t.exit(r),e):(t.enter(a),t.enter("chunkString",{contentType:"string"}),h(v))}function h(v){return v===62?(t.exit("chunkString"),t.exit(a),d(v)):v===null||v===60||Qt(v)?n(v):(t.consume(v),v===92?p:h)}function p(v){return v===60||v===62||v===92?(t.consume(v),h):h(v)}function g(v){return!u&&(v===null||v===41||vl(v))?(t.exit("chunkString"),t.exit(a),t.exit(s),t.exit(r),e(v)):u999||h===null||h===91||h===93&&!l||h===94&&!a&&"_hiddenFootnoteSupport"in s.parser.constructs?n(h):h===93?(t.exit(o),t.enter(i),t.consume(h),t.exit(i),t.exit(r),e):Qt(h)?(t.enter("lineEnding"),t.consume(h),t.exit("lineEnding"),u):(t.enter("chunkString",{contentType:"string"}),f(h))}function f(h){return h===null||h===91||h===93||Qt(h)||a++>999?(t.exit("chunkString"),u(h)):(t.consume(h),l||(l=!sr(h)),h===92?d:f)}function d(h){return h===91||h===92||h===93?(t.consume(h),a++,f):f(h)}}function w8e(t,e,n,r,i,o){let s;return a;function a(d){return d===34||d===39||d===40?(t.enter(r),t.enter(i),t.consume(d),t.exit(i),s=d===40?41:d,l):n(d)}function l(d){return d===s?(t.enter(i),t.consume(d),t.exit(i),t.exit(r),e):(t.enter(o),c(d))}function c(d){return d===s?(t.exit(o),l(s)):d===null?n(d):Qt(d)?(t.enter("lineEnding"),t.consume(d),t.exit("lineEnding"),Br(t,c,"linePrefix")):(t.enter("chunkString",{contentType:"string"}),u(d))}function u(d){return d===s||d===null||Qt(d)?(t.exit("chunkString"),c(d)):(t.consume(d),d===92?f:u)}function f(d){return d===s||d===92?(t.consume(d),u):u(d)}}function bk(t,e){let n;return r;function r(i){return Qt(i)?(t.enter("lineEnding"),t.consume(i),t.exit("lineEnding"),n=!0,r):sr(i)?Br(t,r,n?"linePrefix":"lineSuffix")(i):e(i)}}function V_(t){return t.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const IZt={name:"definition",tokenize:$Zt},LZt={tokenize:FZt,partial:!0};function $Zt(t,e,n){const r=this;let i;return o;function o(h){return t.enter("definition"),s(h)}function s(h){return b8e.call(r,t,a,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(h)}function a(h){return i=V_(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),h===58?(t.enter("definitionMarker"),t.consume(h),t.exit("definitionMarker"),l):n(h)}function l(h){return vl(h)?bk(t,c)(h):c(h)}function c(h){return x8e(t,u,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(h)}function u(h){return t.attempt(LZt,f,f)(h)}function f(h){return sr(h)?Br(t,d,"whitespace")(h):d(h)}function d(h){return h===null||Qt(h)?(t.exit("definition"),r.parser.defined.push(i),e(h)):n(h)}}function FZt(t,e,n){return r;function r(a){return vl(a)?bk(t,i)(a):n(a)}function i(a){return w8e(t,o,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(a)}function o(a){return sr(a)?Br(t,s,"whitespace")(a):s(a)}function s(a){return a===null||Qt(a)?e(a):n(a)}}const NZt={name:"hardBreakEscape",tokenize:zZt};function zZt(t,e,n){return r;function r(o){return t.enter("hardBreakEscape"),t.consume(o),i}function i(o){return Qt(o)?(t.exit("hardBreakEscape"),e(o)):n(o)}}const jZt={name:"headingAtx",tokenize:UZt,resolve:BZt};function BZt(t,e){let n=t.length-2,r=3,i,o;return t[r][1].type==="whitespace"&&(r+=2),n-2>r&&t[n][1].type==="whitespace"&&(n-=2),t[n][1].type==="atxHeadingSequence"&&(r===n-1||n-4>r&&t[n-2][1].type==="whitespace")&&(n-=r+1===n?2:4),n>r&&(i={type:"atxHeadingText",start:t[r][1].start,end:t[n][1].end},o={type:"chunkText",start:t[r][1].start,end:t[n][1].end,contentType:"text"},Lh(t,r,n-r+1,[["enter",i,e],["enter",o,e],["exit",o,e],["exit",i,e]])),t}function UZt(t,e,n){let r=0;return i;function i(u){return t.enter("atxHeading"),o(u)}function o(u){return t.enter("atxHeadingSequence"),s(u)}function s(u){return u===35&&r++<6?(t.consume(u),s):u===null||vl(u)?(t.exit("atxHeadingSequence"),a(u)):n(u)}function a(u){return u===35?(t.enter("atxHeadingSequence"),l(u)):u===null||Qt(u)?(t.exit("atxHeading"),e(u)):sr(u)?Br(t,a,"whitespace")(u):(t.enter("atxHeadingText"),c(u))}function l(u){return u===35?(t.consume(u),l):(t.exit("atxHeadingSequence"),a(u))}function c(u){return u===null||u===35||vl(u)?(t.exit("atxHeadingText"),a(u)):(t.consume(u),c)}}const WZt=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],dxe=["pre","script","style","textarea"],VZt={name:"htmlFlow",tokenize:XZt,resolveTo:qZt,concrete:!0},GZt={tokenize:QZt,partial:!0},HZt={tokenize:YZt,partial:!0};function qZt(t){let e=t.length;for(;e--&&!(t[e][0]==="enter"&&t[e][1].type==="htmlFlow"););return e>1&&t[e-2][1].type==="linePrefix"&&(t[e][1].start=t[e-2][1].start,t[e+1][1].start=t[e-2][1].start,t.splice(e-2,2)),t}function XZt(t,e,n){const r=this;let i,o,s,a,l;return c;function c(F){return u(F)}function u(F){return t.enter("htmlFlow"),t.enter("htmlFlowData"),t.consume(F),f}function f(F){return F===33?(t.consume(F),d):F===47?(t.consume(F),o=!0,g):F===63?(t.consume(F),i=3,r.interrupt?e:L):Hd(F)?(t.consume(F),s=String.fromCharCode(F),m):n(F)}function d(F){return F===45?(t.consume(F),i=2,h):F===91?(t.consume(F),i=5,a=0,p):Hd(F)?(t.consume(F),i=4,r.interrupt?e:L):n(F)}function h(F){return F===45?(t.consume(F),r.interrupt?e:L):n(F)}function p(F){const H="CDATA[";return F===H.charCodeAt(a++)?(t.consume(F),a===H.length?r.interrupt?e:A:p):n(F)}function g(F){return Hd(F)?(t.consume(F),s=String.fromCharCode(F),m):n(F)}function m(F){if(F===null||F===47||F===62||vl(F)){const H=F===47,q=s.toLowerCase();return!H&&!o&&dxe.includes(q)?(i=1,r.interrupt?e(F):A(F)):WZt.includes(s.toLowerCase())?(i=6,H?(t.consume(F),v):r.interrupt?e(F):A(F)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(F):o?y(F):x(F))}return F===45||cc(F)?(t.consume(F),s+=String.fromCharCode(F),m):n(F)}function v(F){return F===62?(t.consume(F),r.interrupt?e:A):n(F)}function y(F){return sr(F)?(t.consume(F),y):E(F)}function x(F){return F===47?(t.consume(F),E):F===58||F===95||Hd(F)?(t.consume(F),b):sr(F)?(t.consume(F),x):E(F)}function b(F){return F===45||F===46||F===58||F===95||cc(F)?(t.consume(F),b):w(F)}function w(F){return F===61?(t.consume(F),_):sr(F)?(t.consume(F),w):x(F)}function _(F){return F===null||F===60||F===61||F===62||F===96?n(F):F===34||F===39?(t.consume(F),l=F,S):sr(F)?(t.consume(F),_):O(F)}function S(F){return F===l?(t.consume(F),l=null,k):F===null||Qt(F)?n(F):(t.consume(F),S)}function O(F){return F===null||F===34||F===39||F===47||F===60||F===61||F===62||F===96||vl(F)?w(F):(t.consume(F),O)}function k(F){return F===47||F===62||sr(F)?x(F):n(F)}function E(F){return F===62?(t.consume(F),M):n(F)}function M(F){return F===null||Qt(F)?A(F):sr(F)?(t.consume(F),M):n(F)}function A(F){return F===45&&i===2?(t.consume(F),I):F===60&&i===1?(t.consume(F),B):F===62&&i===4?(t.consume(F),j):F===63&&i===3?(t.consume(F),L):F===93&&i===5?(t.consume(F),z):Qt(F)&&(i===6||i===7)?(t.exit("htmlFlowData"),t.check(GZt,N,P)(F)):F===null||Qt(F)?(t.exit("htmlFlowData"),P(F)):(t.consume(F),A)}function P(F){return t.check(HZt,T,N)(F)}function T(F){return t.enter("lineEnding"),t.consume(F),t.exit("lineEnding"),R}function R(F){return F===null||Qt(F)?P(F):(t.enter("htmlFlowData"),A(F))}function I(F){return F===45?(t.consume(F),L):A(F)}function B(F){return F===47?(t.consume(F),s="",$):A(F)}function $(F){if(F===62){const H=s.toLowerCase();return dxe.includes(H)?(t.consume(F),j):A(F)}return Hd(F)&&s.length<8?(t.consume(F),s+=String.fromCharCode(F),$):A(F)}function z(F){return F===93?(t.consume(F),L):A(F)}function L(F){return F===62?(t.consume(F),j):F===45&&i===2?(t.consume(F),L):A(F)}function j(F){return F===null||Qt(F)?(t.exit("htmlFlowData"),N(F)):(t.consume(F),j)}function N(F){return t.exit("htmlFlow"),e(F)}}function YZt(t,e,n){const r=this;return i;function i(s){return Qt(s)?(t.enter("lineEnding"),t.consume(s),t.exit("lineEnding"),o):n(s)}function o(s){return r.parser.lazy[r.now().line]?n(s):e(s)}}function QZt(t,e,n){return r;function r(i){return t.enter("lineEnding"),t.consume(i),t.exit("lineEnding"),t.attempt(iU,e,n)}}const KZt={name:"htmlText",tokenize:ZZt};function ZZt(t,e,n){const r=this;let i,o,s;return a;function a(L){return t.enter("htmlText"),t.enter("htmlTextData"),t.consume(L),l}function l(L){return L===33?(t.consume(L),c):L===47?(t.consume(L),w):L===63?(t.consume(L),x):Hd(L)?(t.consume(L),O):n(L)}function c(L){return L===45?(t.consume(L),u):L===91?(t.consume(L),o=0,p):Hd(L)?(t.consume(L),y):n(L)}function u(L){return L===45?(t.consume(L),h):n(L)}function f(L){return L===null?n(L):L===45?(t.consume(L),d):Qt(L)?(s=f,B(L)):(t.consume(L),f)}function d(L){return L===45?(t.consume(L),h):f(L)}function h(L){return L===62?I(L):L===45?d(L):f(L)}function p(L){const j="CDATA[";return L===j.charCodeAt(o++)?(t.consume(L),o===j.length?g:p):n(L)}function g(L){return L===null?n(L):L===93?(t.consume(L),m):Qt(L)?(s=g,B(L)):(t.consume(L),g)}function m(L){return L===93?(t.consume(L),v):g(L)}function v(L){return L===62?I(L):L===93?(t.consume(L),v):g(L)}function y(L){return L===null||L===62?I(L):Qt(L)?(s=y,B(L)):(t.consume(L),y)}function x(L){return L===null?n(L):L===63?(t.consume(L),b):Qt(L)?(s=x,B(L)):(t.consume(L),x)}function b(L){return L===62?I(L):x(L)}function w(L){return Hd(L)?(t.consume(L),_):n(L)}function _(L){return L===45||cc(L)?(t.consume(L),_):S(L)}function S(L){return Qt(L)?(s=S,B(L)):sr(L)?(t.consume(L),S):I(L)}function O(L){return L===45||cc(L)?(t.consume(L),O):L===47||L===62||vl(L)?k(L):n(L)}function k(L){return L===47?(t.consume(L),I):L===58||L===95||Hd(L)?(t.consume(L),E):Qt(L)?(s=k,B(L)):sr(L)?(t.consume(L),k):I(L)}function E(L){return L===45||L===46||L===58||L===95||cc(L)?(t.consume(L),E):M(L)}function M(L){return L===61?(t.consume(L),A):Qt(L)?(s=M,B(L)):sr(L)?(t.consume(L),M):k(L)}function A(L){return L===null||L===60||L===61||L===62||L===96?n(L):L===34||L===39?(t.consume(L),i=L,P):Qt(L)?(s=A,B(L)):sr(L)?(t.consume(L),A):(t.consume(L),T)}function P(L){return L===i?(t.consume(L),i=void 0,R):L===null?n(L):Qt(L)?(s=P,B(L)):(t.consume(L),P)}function T(L){return L===null||L===34||L===39||L===60||L===61||L===96?n(L):L===47||L===62||vl(L)?k(L):(t.consume(L),T)}function R(L){return L===47||L===62||vl(L)?k(L):n(L)}function I(L){return L===62?(t.consume(L),t.exit("htmlTextData"),t.exit("htmlText"),e):n(L)}function B(L){return t.exit("htmlTextData"),t.enter("lineEnding"),t.consume(L),t.exit("lineEnding"),$}function $(L){return sr(L)?Br(t,z,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(L):z(L)}function z(L){return t.enter("htmlTextData"),s(L)}}const Wae={name:"labelEnd",tokenize:iJt,resolveTo:rJt,resolveAll:nJt},JZt={tokenize:oJt},eJt={tokenize:sJt},tJt={tokenize:aJt};function nJt(t){let e=-1;for(;++e=3&&(c===null||Qt(c))?(t.exit("thematicBreak"),e(c)):n(c)}function l(c){return c===i?(t.consume(c),r++,l):(t.exit("thematicBreakSequence"),sr(c)?Br(t,a,"whitespace")(c):a(c))}}const Va={name:"list",tokenize:mJt,continuation:{tokenize:vJt},exit:xJt},pJt={tokenize:bJt,partial:!0},gJt={tokenize:yJt,partial:!0};function mJt(t,e,n){const r=this,i=r.events[r.events.length-1];let o=i&&i[1].type==="linePrefix"?i[2].sliceSerialize(i[1],!0).length:0,s=0;return a;function a(h){const p=r.containerState.type||(h===42||h===43||h===45?"listUnordered":"listOrdered");if(p==="listUnordered"?!r.containerState.marker||h===r.containerState.marker:rQ(h)){if(r.containerState.type||(r.containerState.type=p,t.enter(p,{_container:!0})),p==="listUnordered")return t.enter("listItemPrefix"),h===42||h===45?t.check(j3,n,c)(h):c(h);if(!r.interrupt||h===49)return t.enter("listItemPrefix"),t.enter("listItemValue"),l(h)}return n(h)}function l(h){return rQ(h)&&++s<10?(t.consume(h),l):(!r.interrupt||s<2)&&(r.containerState.marker?h===r.containerState.marker:h===41||h===46)?(t.exit("listItemValue"),c(h)):n(h)}function c(h){return t.enter("listItemMarker"),t.consume(h),t.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||h,t.check(iU,r.interrupt?n:u,t.attempt(pJt,d,f))}function u(h){return r.containerState.initialBlankLine=!0,o++,d(h)}function f(h){return sr(h)?(t.enter("listItemPrefixWhitespace"),t.consume(h),t.exit("listItemPrefixWhitespace"),d):n(h)}function d(h){return r.containerState.size=o+r.sliceSerialize(t.exit("listItemPrefix"),!0).length,e(h)}}function vJt(t,e,n){const r=this;return r.containerState._closeFlow=void 0,t.check(iU,i,o);function i(a){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,Br(t,e,"listItemIndent",r.containerState.size+1)(a)}function o(a){return r.containerState.furtherBlankLines||!sr(a)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,s(a)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,t.attempt(gJt,e,s)(a))}function s(a){return r.containerState._closeFlow=!0,r.interrupt=void 0,Br(t,t.attempt(Va,e,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(a)}}function yJt(t,e,n){const r=this;return Br(t,i,"listItemIndent",r.containerState.size+1);function i(o){const s=r.events[r.events.length-1];return s&&s[1].type==="listItemIndent"&&s[2].sliceSerialize(s[1],!0).length===r.containerState.size?e(o):n(o)}}function xJt(t){t.exit(this.containerState.type)}function bJt(t,e,n){const r=this;return Br(t,i,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function i(o){const s=r.events[r.events.length-1];return!sr(o)&&s&&s[1].type==="listItemPrefixWhitespace"?e(o):n(o)}}const hxe={name:"setextUnderline",tokenize:_Jt,resolveTo:wJt};function wJt(t,e){let n=t.length,r,i,o;for(;n--;)if(t[n][0]==="enter"){if(t[n][1].type==="content"){r=n;break}t[n][1].type==="paragraph"&&(i=n)}else t[n][1].type==="content"&&t.splice(n,1),!o&&t[n][1].type==="definition"&&(o=n);const s={type:"setextHeading",start:Object.assign({},t[i][1].start),end:Object.assign({},t[t.length-1][1].end)};return t[i][1].type="setextHeadingText",o?(t.splice(i,0,["enter",s,e]),t.splice(o+1,0,["exit",t[r][1],e]),t[r][1].end=Object.assign({},t[o][1].end)):t[r][1]=s,t.push(["exit",s,e]),t}function _Jt(t,e,n){const r=this;let i;return o;function o(c){let u=r.events.length,f;for(;u--;)if(r.events[u][1].type!=="lineEnding"&&r.events[u][1].type!=="linePrefix"&&r.events[u][1].type!=="content"){f=r.events[u][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||f)?(t.enter("setextHeadingLine"),i=c,s(c)):n(c)}function s(c){return t.enter("setextHeadingLineSequence"),a(c)}function a(c){return c===i?(t.consume(c),a):(t.exit("setextHeadingLineSequence"),sr(c)?Br(t,l,"lineSuffix")(c):l(c))}function l(c){return c===null||Qt(c)?(t.exit("setextHeadingLine"),e(c)):n(c)}}const SJt={tokenize:CJt};function CJt(t){const e=this,n=t.attempt(iU,r,t.attempt(this.parser.constructs.flowInitial,i,Br(t,t.attempt(this.parser.constructs.flow,i,t.attempt(AZt,i)),"linePrefix")));return n;function r(o){if(o===null){t.consume(o);return}return t.enter("lineEndingBlank"),t.consume(o),t.exit("lineEndingBlank"),e.currentConstruct=void 0,n}function i(o){if(o===null){t.consume(o);return}return t.enter("lineEnding"),t.consume(o),t.exit("lineEnding"),e.currentConstruct=void 0,n}}const OJt={resolveAll:S8e()},EJt=_8e("string"),TJt=_8e("text");function _8e(t){return{tokenize:e,resolveAll:S8e(t==="text"?kJt:void 0)};function e(n){const r=this,i=this.parser.constructs[t],o=n.attempt(i,s,a);return s;function s(u){return c(u)?o(u):a(u)}function a(u){if(u===null){n.consume(u);return}return n.enter("data"),n.consume(u),l}function l(u){return c(u)?(n.exit("data"),o(u)):(n.consume(u),l)}function c(u){if(u===null)return!0;const f=i[u];let d=-1;if(f)for(;++d-1){const a=s[0];typeof a=="string"?s[0]=a.slice(r):s.shift()}o>0&&s.push(t[i].slice(0,o))}return s}function MJt(t,e){let n=-1;const r=[];let i;for(;++nt.length){for(;i--;)if(t.charCodeAt(i)===47){if(o){n=i+1;break}}else r<0&&(o=!0,r=i+1);return r<0?"":t.slice(n,r)}if(e===t)return"";let s=-1,a=e.length-1;for(;i--;)if(t.charCodeAt(i)===47){if(o){n=i+1;break}}else s<0&&(o=!0,s=i+1),a>-1&&(t.charCodeAt(i)===e.charCodeAt(a--)?a<0&&(r=i):(a=-1,r=s));return n===r?r=s:r<0&&(r=t.length),t.slice(n,r)}function CKt(t){if(QR(t),t.length===0)return".";let e=-1,n=t.length,r;for(;--n;)if(t.charCodeAt(n)===47){if(r){e=n;break}}else r||(r=!0);return e<0?t.charCodeAt(0)===47?"/":".":e===1&&t.charCodeAt(0)===47?"//":t.slice(0,e)}function OKt(t){QR(t);let e=t.length,n=-1,r=0,i=-1,o=0,s;for(;e--;){const a=t.charCodeAt(e);if(a===47){if(s){r=e+1;break}continue}n<0&&(s=!0,n=e+1),a===46?i<0?i=e:o!==1&&(o=1):i>-1&&(o=-1)}return i<0||n<0||o===0||o===1&&i===n-1&&i===r+1?"":t.slice(i,n)}function EKt(...t){let e=-1,n;for(;++e0&&t.charCodeAt(t.length-1)===47&&(n+="/"),e?"/"+n:n}function kKt(t,e){let n="",r=0,i=-1,o=0,s=-1,a,l;for(;++s<=t.length;){if(s2){if(l=n.lastIndexOf("/"),l!==n.length-1){l<0?(n="",r=0):(n=n.slice(0,l),r=n.length-1-n.lastIndexOf("/")),i=s,o=0;continue}}else if(n.length>0){n="",r=0,i=s,o=0;continue}}e&&(n=n.length>0?n+"/..":"..",r=2)}else n.length>0?n+="/"+t.slice(i+1,s):n=t.slice(i+1,s),r=s-i-1;i=s,o=0}else a===46&&o>-1?o++:o=-1}return n}function QR(t){if(typeof t!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(t))}const AKt={cwd:PKt};function PKt(){return"/"}function mQ(t){return t!==null&&typeof t=="object"&&t.href&&t.origin}function MKt(t){if(typeof t=="string")t=new URL(t);else if(!mQ(t)){const e=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+t+"`");throw e.code="ERR_INVALID_ARG_TYPE",e}if(t.protocol!=="file:"){const e=new TypeError("The URL must be of scheme file");throw e.code="ERR_INVALID_URL_SCHEME",e}return RKt(t)}function RKt(t){if(t.hostname!==""){const r=new TypeError('File URL host must be "localhost" or empty on darwin');throw r.code="ERR_INVALID_FILE_URL_HOST",r}const e=t.pathname;let n=-1;for(;++n"u"||L3.call(e,i)},Cxe=function(e,n){bxe&&n.name==="__proto__"?bxe(e,n.name,{enumerable:!0,configurable:!0,value:n.newValue,writable:!0}):e[n.name]=n.newValue},Oxe=function(e,n){if(n==="__proto__")if(L3.call(e,n)){if(wxe)return wxe(e,n).value}else return;return e[n]},IKt=function t(){var e,n,r,i,o,s,a=arguments[0],l=1,c=arguments.length,u=!1;for(typeof a=="boolean"&&(u=a,a=arguments[1]||{},l=2),(a==null||typeof a!="object"&&typeof a!="function")&&(a={});ls.length;let l;a&&s.push(i);try{l=t.apply(this,s)}catch(c){const u=c;if(a&&n)throw u;return i(u)}a||(l&&l.then&&typeof l.then=="function"?l.then(o,i):l instanceof Error?i(l):o(l))}function i(s,...a){n||(n=!0,e(s,...a))}function o(s){i(null,s)}}const FKt=j8e().freeze(),z8e={}.hasOwnProperty;function j8e(){const t=LKt(),e=[];let n={},r,i=-1;return o.data=s,o.Parser=void 0,o.Compiler=void 0,o.freeze=a,o.attachers=e,o.use=l,o.parse=c,o.stringify=u,o.run=f,o.runSync=d,o.process=h,o.processSync=p,o;function o(){const g=j8e();let m=-1;for(;++m{if(_||!S||!O)w(_);else{const k=o.stringify(S,O);k==null||(jKt(k)?O.value=k:O.result=k),w(_,O)}});function w(_,S){_||!S?x(_):y?y(S):m(null,S)}}}function p(g){let m;o.freeze(),P9("processSync",o.Parser),M9("processSync",o.Compiler);const v=h2(g);return o.process(v,y),Axe("processSync","process",m),v;function y(x){m=!0,xxe(x)}}}function Txe(t,e){return typeof t=="function"&&t.prototype&&(NKt(t.prototype)||e in t.prototype)}function NKt(t){let e;for(e in t)if(z8e.call(t,e))return!0;return!1}function P9(t,e){if(typeof e!="function")throw new TypeError("Cannot `"+t+"` without `Parser`")}function M9(t,e){if(typeof e!="function")throw new TypeError("Cannot `"+t+"` without `Compiler`")}function R9(t,e){if(e)throw new Error("Cannot call `"+t+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function kxe(t){if(!vQ(t)||typeof t.type!="string")throw new TypeError("Expected node, got `"+t+"`")}function Axe(t,e,n){if(!n)throw new Error("`"+t+"` finished async. Use `"+e+"` instead")}function h2(t){return zKt(t)?t:new F8e(t)}function zKt(t){return!!(t&&typeof t=="object"&&"message"in t&&"messages"in t)}function jKt(t){return typeof t=="string"||$8e(t)}const BKt={};function UKt(t,e){const n=BKt,r=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,i=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return B8e(t,r,i)}function B8e(t,e,n){if(WKt(t)){if("value"in t)return t.type==="html"&&!n?"":t.value;if(e&&"alt"in t&&t.alt)return t.alt;if("children"in t)return Pxe(t.children,e,n)}return Array.isArray(t)?Pxe(t,e,n):""}function Pxe(t,e,n){const r=[];let i=-1;for(;++ii?0:i+e:e=e>i?i:e,n=n>0?n:0,r.length<1e4)s=Array.from(r),s.unshift(e,n),t.splice(...s);else for(n&&t.splice(e,n);o0?(Rh(t,t.length,0,e),t):e}const Mxe={}.hasOwnProperty;function VKt(t){const e={};let n=-1;for(;++ns))return;const S=e.events.length;let O=S,k,E;for(;O--;)if(e.events[O][0]==="exit"&&e.events[O][1].type==="chunkFlow"){if(k){E=e.events[O][1].end;break}k=!0}for(v(r),_=S;_x;){const w=n[b];e.containerState=w[1],w[0].exit.call(e,t)}n.length=x}function y(){i.write([null]),o=void 0,i=void 0,e.containerState._closeFlow=void 0}}function rZt(t,e,n){return Br(t,t.attempt(this.parser.constructs.document,e,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function Dxe(t){if(t===null||gl(t)||ZKt(t))return 1;if(KKt(t))return 2}function ole(t,e,n){const r=[];let i=-1;for(;++i1&&t[n][1].end.offset-t[n][1].start.offset>1?2:1;const f=Object.assign({},t[r][1].end),d=Object.assign({},t[n][1].start);Ixe(f,-l),Ixe(d,l),s={type:l>1?"strongSequence":"emphasisSequence",start:f,end:Object.assign({},t[r][1].end)},a={type:l>1?"strongSequence":"emphasisSequence",start:Object.assign({},t[n][1].start),end:d},o={type:l>1?"strongText":"emphasisText",start:Object.assign({},t[r][1].end),end:Object.assign({},t[n][1].start)},i={type:l>1?"strong":"emphasis",start:Object.assign({},s.start),end:Object.assign({},a.end)},t[r][1].end=Object.assign({},s.start),t[n][1].start=Object.assign({},a.end),c=[],t[r][1].end.offset-t[r][1].start.offset&&(c=Xc(c,[["enter",t[r][1],e],["exit",t[r][1],e]])),c=Xc(c,[["enter",i,e],["enter",s,e],["exit",s,e],["enter",o,e]]),c=Xc(c,ole(e.parser.constructs.insideSpan.null,t.slice(r+1,n),e)),c=Xc(c,[["exit",o,e],["enter",a,e],["exit",a,e],["exit",i,e]]),t[n][1].end.offset-t[n][1].start.offset?(u=2,c=Xc(c,[["enter",t[n][1],e],["exit",t[n][1],e]])):u=0,Rh(t,r-1,n-r+3,c),n=r+c.length-u-2;break}}for(n=-1;++n0&&sr(_)?Br(t,y,"linePrefix",o+1)(_):y(_)}function y(_){return _===null||Qt(_)?t.check($xe,g,b)(_):(t.enter("codeFlowValue"),x(_))}function x(_){return _===null||Qt(_)?(t.exit("codeFlowValue"),y(_)):(t.consume(_),x)}function b(_){return t.exit("codeFenced"),e(_)}function w(_,S,O){let k=0;return E;function E(M){return _.enter("lineEnding"),_.consume(M),_.exit("lineEnding"),P}function P(M){return _.enter("codeFencedFence"),sr(M)?Br(_,A,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(M):A(M)}function A(M){return M===a?(_.enter("codeFencedFenceSequence"),R(M)):O(M)}function R(M){return M===a?(k++,_.consume(M),R):k>=s?(_.exit("codeFencedFenceSequence"),sr(M)?Br(_,T,"whitespace")(M):T(M)):O(M)}function T(M){return M===null||Qt(M)?(_.exit("codeFencedFence"),S(M)):O(M)}}}function gZt(t,e,n){const r=this;return i;function i(s){return s===null?n(s):(t.enter("lineEnding"),t.consume(s),t.exit("lineEnding"),o)}function o(s){return r.parser.lazy[r.now().line]?n(s):e(s)}}const D9={name:"codeIndented",tokenize:vZt},mZt={tokenize:yZt,partial:!0};function vZt(t,e,n){const r=this;return i;function i(c){return t.enter("codeIndented"),Br(t,o,"linePrefix",5)(c)}function o(c){const u=r.events[r.events.length-1];return u&&u[1].type==="linePrefix"&&u[2].sliceSerialize(u[1],!0).length>=4?s(c):n(c)}function s(c){return c===null?l(c):Qt(c)?t.attempt(mZt,s,l)(c):(t.enter("codeFlowValue"),a(c))}function a(c){return c===null||Qt(c)?(t.exit("codeFlowValue"),s(c)):(t.consume(c),a)}function l(c){return t.exit("codeIndented"),e(c)}}function yZt(t,e,n){const r=this;return i;function i(s){return r.parser.lazy[r.now().line]?n(s):Qt(s)?(t.enter("lineEnding"),t.consume(s),t.exit("lineEnding"),i):Br(t,o,"linePrefix",5)(s)}function o(s){const a=r.events[r.events.length-1];return a&&a[1].type==="linePrefix"&&a[2].sliceSerialize(a[1],!0).length>=4?e(s):Qt(s)?i(s):n(s)}}const xZt={name:"codeText",tokenize:_Zt,resolve:bZt,previous:wZt};function bZt(t){let e=t.length-4,n=3,r,i;if((t[n][1].type==="lineEnding"||t[n][1].type==="space")&&(t[e][1].type==="lineEnding"||t[e][1].type==="space")){for(r=n;++r=4?e(s):t.interrupt(r.parser.constructs.flow,n,e)(s)}}function H8e(t,e,n,r,i,o,s,a,l){const c=l||Number.POSITIVE_INFINITY;let u=0;return f;function f(v){return v===60?(t.enter(r),t.enter(i),t.enter(o),t.consume(v),t.exit(o),d):v===null||v===32||v===41||yQ(v)?n(v):(t.enter(r),t.enter(s),t.enter(a),t.enter("chunkString",{contentType:"string"}),g(v))}function d(v){return v===62?(t.enter(o),t.consume(v),t.exit(o),t.exit(i),t.exit(r),e):(t.enter(a),t.enter("chunkString",{contentType:"string"}),h(v))}function h(v){return v===62?(t.exit("chunkString"),t.exit(a),d(v)):v===null||v===60||Qt(v)?n(v):(t.consume(v),v===92?p:h)}function p(v){return v===60||v===62||v===92?(t.consume(v),h):h(v)}function g(v){return!u&&(v===null||v===41||gl(v))?(t.exit("chunkString"),t.exit(a),t.exit(s),t.exit(r),e(v)):u999||h===null||h===91||h===93&&!l||h===94&&!a&&"_hiddenFootnoteSupport"in s.parser.constructs?n(h):h===93?(t.exit(o),t.enter(i),t.consume(h),t.exit(i),t.exit(r),e):Qt(h)?(t.enter("lineEnding"),t.consume(h),t.exit("lineEnding"),u):(t.enter("chunkString",{contentType:"string"}),f(h))}function f(h){return h===null||h===91||h===93||Qt(h)||a++>999?(t.exit("chunkString"),u(h)):(t.consume(h),l||(l=!sr(h)),h===92?d:f)}function d(h){return h===91||h===92||h===93?(t.consume(h),a++,f):f(h)}}function X8e(t,e,n,r,i,o){let s;return a;function a(d){return d===34||d===39||d===40?(t.enter(r),t.enter(i),t.consume(d),t.exit(i),s=d===40?41:d,l):n(d)}function l(d){return d===s?(t.enter(i),t.consume(d),t.exit(i),t.exit(r),e):(t.enter(o),c(d))}function c(d){return d===s?(t.exit(o),l(s)):d===null?n(d):Qt(d)?(t.enter("lineEnding"),t.consume(d),t.exit("lineEnding"),Br(t,c,"linePrefix")):(t.enter("chunkString",{contentType:"string"}),u(d))}function u(d){return d===s||d===null||Qt(d)?(t.exit("chunkString"),c(d)):(t.consume(d),d===92?f:u)}function f(d){return d===s||d===92?(t.consume(d),u):u(d)}}function xk(t,e){let n;return r;function r(i){return Qt(i)?(t.enter("lineEnding"),t.consume(i),t.exit("lineEnding"),n=!0,r):sr(i)?Br(t,r,n?"linePrefix":"lineSuffix")(i):e(i)}}function V_(t){return t.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const AZt={name:"definition",tokenize:MZt},PZt={tokenize:RZt,partial:!0};function MZt(t,e,n){const r=this;let i;return o;function o(h){return t.enter("definition"),s(h)}function s(h){return q8e.call(r,t,a,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(h)}function a(h){return i=V_(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),h===58?(t.enter("definitionMarker"),t.consume(h),t.exit("definitionMarker"),l):n(h)}function l(h){return gl(h)?xk(t,c)(h):c(h)}function c(h){return H8e(t,u,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(h)}function u(h){return t.attempt(PZt,f,f)(h)}function f(h){return sr(h)?Br(t,d,"whitespace")(h):d(h)}function d(h){return h===null||Qt(h)?(t.exit("definition"),r.parser.defined.push(i),e(h)):n(h)}}function RZt(t,e,n){return r;function r(a){return gl(a)?xk(t,i)(a):n(a)}function i(a){return X8e(t,o,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(a)}function o(a){return sr(a)?Br(t,s,"whitespace")(a):s(a)}function s(a){return a===null||Qt(a)?e(a):n(a)}}const DZt={name:"hardBreakEscape",tokenize:IZt};function IZt(t,e,n){return r;function r(o){return t.enter("hardBreakEscape"),t.consume(o),i}function i(o){return Qt(o)?(t.exit("hardBreakEscape"),e(o)):n(o)}}const LZt={name:"headingAtx",tokenize:FZt,resolve:$Zt};function $Zt(t,e){let n=t.length-2,r=3,i,o;return t[r][1].type==="whitespace"&&(r+=2),n-2>r&&t[n][1].type==="whitespace"&&(n-=2),t[n][1].type==="atxHeadingSequence"&&(r===n-1||n-4>r&&t[n-2][1].type==="whitespace")&&(n-=r+1===n?2:4),n>r&&(i={type:"atxHeadingText",start:t[r][1].start,end:t[n][1].end},o={type:"chunkText",start:t[r][1].start,end:t[n][1].end,contentType:"text"},Rh(t,r,n-r+1,[["enter",i,e],["enter",o,e],["exit",o,e],["exit",i,e]])),t}function FZt(t,e,n){let r=0;return i;function i(u){return t.enter("atxHeading"),o(u)}function o(u){return t.enter("atxHeadingSequence"),s(u)}function s(u){return u===35&&r++<6?(t.consume(u),s):u===null||gl(u)?(t.exit("atxHeadingSequence"),a(u)):n(u)}function a(u){return u===35?(t.enter("atxHeadingSequence"),l(u)):u===null||Qt(u)?(t.exit("atxHeading"),e(u)):sr(u)?Br(t,a,"whitespace")(u):(t.enter("atxHeadingText"),c(u))}function l(u){return u===35?(t.consume(u),l):(t.exit("atxHeadingSequence"),a(u))}function c(u){return u===null||u===35||gl(u)?(t.exit("atxHeadingText"),a(u)):(t.consume(u),c)}}const NZt=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],Nxe=["pre","script","style","textarea"],zZt={name:"htmlFlow",tokenize:WZt,resolveTo:UZt,concrete:!0},jZt={tokenize:GZt,partial:!0},BZt={tokenize:VZt,partial:!0};function UZt(t){let e=t.length;for(;e--&&!(t[e][0]==="enter"&&t[e][1].type==="htmlFlow"););return e>1&&t[e-2][1].type==="linePrefix"&&(t[e][1].start=t[e-2][1].start,t[e+1][1].start=t[e-2][1].start,t.splice(e-2,2)),t}function WZt(t,e,n){const r=this;let i,o,s,a,l;return c;function c($){return u($)}function u($){return t.enter("htmlFlow"),t.enter("htmlFlowData"),t.consume($),f}function f($){return $===33?(t.consume($),d):$===47?(t.consume($),o=!0,g):$===63?(t.consume($),i=3,r.interrupt?e:L):Wd($)?(t.consume($),s=String.fromCharCode($),m):n($)}function d($){return $===45?(t.consume($),i=2,h):$===91?(t.consume($),i=5,a=0,p):Wd($)?(t.consume($),i=4,r.interrupt?e:L):n($)}function h($){return $===45?(t.consume($),r.interrupt?e:L):n($)}function p($){const q="CDATA[";return $===q.charCodeAt(a++)?(t.consume($),a===q.length?r.interrupt?e:A:p):n($)}function g($){return Wd($)?(t.consume($),s=String.fromCharCode($),m):n($)}function m($){if($===null||$===47||$===62||gl($)){const q=$===47,G=s.toLowerCase();return!q&&!o&&Nxe.includes(G)?(i=1,r.interrupt?e($):A($)):NZt.includes(s.toLowerCase())?(i=6,q?(t.consume($),v):r.interrupt?e($):A($)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n($):o?y($):x($))}return $===45||ac($)?(t.consume($),s+=String.fromCharCode($),m):n($)}function v($){return $===62?(t.consume($),r.interrupt?e:A):n($)}function y($){return sr($)?(t.consume($),y):E($)}function x($){return $===47?(t.consume($),E):$===58||$===95||Wd($)?(t.consume($),b):sr($)?(t.consume($),x):E($)}function b($){return $===45||$===46||$===58||$===95||ac($)?(t.consume($),b):w($)}function w($){return $===61?(t.consume($),_):sr($)?(t.consume($),w):x($)}function _($){return $===null||$===60||$===61||$===62||$===96?n($):$===34||$===39?(t.consume($),l=$,S):sr($)?(t.consume($),_):O($)}function S($){return $===l?(t.consume($),l=null,k):$===null||Qt($)?n($):(t.consume($),S)}function O($){return $===null||$===34||$===39||$===47||$===60||$===61||$===62||$===96||gl($)?w($):(t.consume($),O)}function k($){return $===47||$===62||sr($)?x($):n($)}function E($){return $===62?(t.consume($),P):n($)}function P($){return $===null||Qt($)?A($):sr($)?(t.consume($),P):n($)}function A($){return $===45&&i===2?(t.consume($),I):$===60&&i===1?(t.consume($),j):$===62&&i===4?(t.consume($),B):$===63&&i===3?(t.consume($),L):$===93&&i===5?(t.consume($),z):Qt($)&&(i===6||i===7)?(t.exit("htmlFlowData"),t.check(jZt,F,R)($)):$===null||Qt($)?(t.exit("htmlFlowData"),R($)):(t.consume($),A)}function R($){return t.check(BZt,T,F)($)}function T($){return t.enter("lineEnding"),t.consume($),t.exit("lineEnding"),M}function M($){return $===null||Qt($)?R($):(t.enter("htmlFlowData"),A($))}function I($){return $===45?(t.consume($),L):A($)}function j($){return $===47?(t.consume($),s="",N):A($)}function N($){if($===62){const q=s.toLowerCase();return Nxe.includes(q)?(t.consume($),B):A($)}return Wd($)&&s.length<8?(t.consume($),s+=String.fromCharCode($),N):A($)}function z($){return $===93?(t.consume($),L):A($)}function L($){return $===62?(t.consume($),B):$===45&&i===2?(t.consume($),L):A($)}function B($){return $===null||Qt($)?(t.exit("htmlFlowData"),F($)):(t.consume($),B)}function F($){return t.exit("htmlFlow"),e($)}}function VZt(t,e,n){const r=this;return i;function i(s){return Qt(s)?(t.enter("lineEnding"),t.consume(s),t.exit("lineEnding"),o):n(s)}function o(s){return r.parser.lazy[r.now().line]?n(s):e(s)}}function GZt(t,e,n){return r;function r(i){return t.enter("lineEnding"),t.consume(i),t.exit("lineEnding"),t.attempt(iU,e,n)}}const HZt={name:"htmlText",tokenize:qZt};function qZt(t,e,n){const r=this;let i,o,s;return a;function a(L){return t.enter("htmlText"),t.enter("htmlTextData"),t.consume(L),l}function l(L){return L===33?(t.consume(L),c):L===47?(t.consume(L),w):L===63?(t.consume(L),x):Wd(L)?(t.consume(L),O):n(L)}function c(L){return L===45?(t.consume(L),u):L===91?(t.consume(L),o=0,p):Wd(L)?(t.consume(L),y):n(L)}function u(L){return L===45?(t.consume(L),h):n(L)}function f(L){return L===null?n(L):L===45?(t.consume(L),d):Qt(L)?(s=f,j(L)):(t.consume(L),f)}function d(L){return L===45?(t.consume(L),h):f(L)}function h(L){return L===62?I(L):L===45?d(L):f(L)}function p(L){const B="CDATA[";return L===B.charCodeAt(o++)?(t.consume(L),o===B.length?g:p):n(L)}function g(L){return L===null?n(L):L===93?(t.consume(L),m):Qt(L)?(s=g,j(L)):(t.consume(L),g)}function m(L){return L===93?(t.consume(L),v):g(L)}function v(L){return L===62?I(L):L===93?(t.consume(L),v):g(L)}function y(L){return L===null||L===62?I(L):Qt(L)?(s=y,j(L)):(t.consume(L),y)}function x(L){return L===null?n(L):L===63?(t.consume(L),b):Qt(L)?(s=x,j(L)):(t.consume(L),x)}function b(L){return L===62?I(L):x(L)}function w(L){return Wd(L)?(t.consume(L),_):n(L)}function _(L){return L===45||ac(L)?(t.consume(L),_):S(L)}function S(L){return Qt(L)?(s=S,j(L)):sr(L)?(t.consume(L),S):I(L)}function O(L){return L===45||ac(L)?(t.consume(L),O):L===47||L===62||gl(L)?k(L):n(L)}function k(L){return L===47?(t.consume(L),I):L===58||L===95||Wd(L)?(t.consume(L),E):Qt(L)?(s=k,j(L)):sr(L)?(t.consume(L),k):I(L)}function E(L){return L===45||L===46||L===58||L===95||ac(L)?(t.consume(L),E):P(L)}function P(L){return L===61?(t.consume(L),A):Qt(L)?(s=P,j(L)):sr(L)?(t.consume(L),P):k(L)}function A(L){return L===null||L===60||L===61||L===62||L===96?n(L):L===34||L===39?(t.consume(L),i=L,R):Qt(L)?(s=A,j(L)):sr(L)?(t.consume(L),A):(t.consume(L),T)}function R(L){return L===i?(t.consume(L),i=void 0,M):L===null?n(L):Qt(L)?(s=R,j(L)):(t.consume(L),R)}function T(L){return L===null||L===34||L===39||L===60||L===61||L===96?n(L):L===47||L===62||gl(L)?k(L):(t.consume(L),T)}function M(L){return L===47||L===62||gl(L)?k(L):n(L)}function I(L){return L===62?(t.consume(L),t.exit("htmlTextData"),t.exit("htmlText"),e):n(L)}function j(L){return t.exit("htmlTextData"),t.enter("lineEnding"),t.consume(L),t.exit("lineEnding"),N}function N(L){return sr(L)?Br(t,z,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(L):z(L)}function z(L){return t.enter("htmlTextData"),s(L)}}const ale={name:"labelEnd",tokenize:JZt,resolveTo:ZZt,resolveAll:KZt},XZt={tokenize:eJt},YZt={tokenize:tJt},QZt={tokenize:nJt};function KZt(t){let e=-1;for(;++e=3&&(c===null||Qt(c))?(t.exit("thematicBreak"),e(c)):n(c)}function l(c){return c===i?(t.consume(c),r++,l):(t.exit("thematicBreakSequence"),sr(c)?Br(t,a,"whitespace")(c):a(c))}}const Ua={name:"list",tokenize:fJt,continuation:{tokenize:dJt},exit:pJt},cJt={tokenize:gJt,partial:!0},uJt={tokenize:hJt,partial:!0};function fJt(t,e,n){const r=this,i=r.events[r.events.length-1];let o=i&&i[1].type==="linePrefix"?i[2].sliceSerialize(i[1],!0).length:0,s=0;return a;function a(h){const p=r.containerState.type||(h===42||h===43||h===45?"listUnordered":"listOrdered");if(p==="listUnordered"?!r.containerState.marker||h===r.containerState.marker:xQ(h)){if(r.containerState.type||(r.containerState.type=p,t.enter(p,{_container:!0})),p==="listUnordered")return t.enter("listItemPrefix"),h===42||h===45?t.check($3,n,c)(h):c(h);if(!r.interrupt||h===49)return t.enter("listItemPrefix"),t.enter("listItemValue"),l(h)}return n(h)}function l(h){return xQ(h)&&++s<10?(t.consume(h),l):(!r.interrupt||s<2)&&(r.containerState.marker?h===r.containerState.marker:h===41||h===46)?(t.exit("listItemValue"),c(h)):n(h)}function c(h){return t.enter("listItemMarker"),t.consume(h),t.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||h,t.check(iU,r.interrupt?n:u,t.attempt(cJt,d,f))}function u(h){return r.containerState.initialBlankLine=!0,o++,d(h)}function f(h){return sr(h)?(t.enter("listItemPrefixWhitespace"),t.consume(h),t.exit("listItemPrefixWhitespace"),d):n(h)}function d(h){return r.containerState.size=o+r.sliceSerialize(t.exit("listItemPrefix"),!0).length,e(h)}}function dJt(t,e,n){const r=this;return r.containerState._closeFlow=void 0,t.check(iU,i,o);function i(a){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,Br(t,e,"listItemIndent",r.containerState.size+1)(a)}function o(a){return r.containerState.furtherBlankLines||!sr(a)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,s(a)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,t.attempt(uJt,e,s)(a))}function s(a){return r.containerState._closeFlow=!0,r.interrupt=void 0,Br(t,t.attempt(Ua,e,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(a)}}function hJt(t,e,n){const r=this;return Br(t,i,"listItemIndent",r.containerState.size+1);function i(o){const s=r.events[r.events.length-1];return s&&s[1].type==="listItemIndent"&&s[2].sliceSerialize(s[1],!0).length===r.containerState.size?e(o):n(o)}}function pJt(t){t.exit(this.containerState.type)}function gJt(t,e,n){const r=this;return Br(t,i,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function i(o){const s=r.events[r.events.length-1];return!sr(o)&&s&&s[1].type==="listItemPrefixWhitespace"?e(o):n(o)}}const zxe={name:"setextUnderline",tokenize:vJt,resolveTo:mJt};function mJt(t,e){let n=t.length,r,i,o;for(;n--;)if(t[n][0]==="enter"){if(t[n][1].type==="content"){r=n;break}t[n][1].type==="paragraph"&&(i=n)}else t[n][1].type==="content"&&t.splice(n,1),!o&&t[n][1].type==="definition"&&(o=n);const s={type:"setextHeading",start:Object.assign({},t[i][1].start),end:Object.assign({},t[t.length-1][1].end)};return t[i][1].type="setextHeadingText",o?(t.splice(i,0,["enter",s,e]),t.splice(o+1,0,["exit",t[r][1],e]),t[r][1].end=Object.assign({},t[o][1].end)):t[r][1]=s,t.push(["exit",s,e]),t}function vJt(t,e,n){const r=this;let i;return o;function o(c){let u=r.events.length,f;for(;u--;)if(r.events[u][1].type!=="lineEnding"&&r.events[u][1].type!=="linePrefix"&&r.events[u][1].type!=="content"){f=r.events[u][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||f)?(t.enter("setextHeadingLine"),i=c,s(c)):n(c)}function s(c){return t.enter("setextHeadingLineSequence"),a(c)}function a(c){return c===i?(t.consume(c),a):(t.exit("setextHeadingLineSequence"),sr(c)?Br(t,l,"lineSuffix")(c):l(c))}function l(c){return c===null||Qt(c)?(t.exit("setextHeadingLine"),e(c)):n(c)}}const yJt={tokenize:xJt};function xJt(t){const e=this,n=t.attempt(iU,r,t.attempt(this.parser.constructs.flowInitial,i,Br(t,t.attempt(this.parser.constructs.flow,i,t.attempt(CZt,i)),"linePrefix")));return n;function r(o){if(o===null){t.consume(o);return}return t.enter("lineEndingBlank"),t.consume(o),t.exit("lineEndingBlank"),e.currentConstruct=void 0,n}function i(o){if(o===null){t.consume(o);return}return t.enter("lineEnding"),t.consume(o),t.exit("lineEnding"),e.currentConstruct=void 0,n}}const bJt={resolveAll:Q8e()},wJt=Y8e("string"),_Jt=Y8e("text");function Y8e(t){return{tokenize:e,resolveAll:Q8e(t==="text"?SJt:void 0)};function e(n){const r=this,i=this.parser.constructs[t],o=n.attempt(i,s,a);return s;function s(u){return c(u)?o(u):a(u)}function a(u){if(u===null){n.consume(u);return}return n.enter("data"),n.consume(u),l}function l(u){return c(u)?(n.exit("data"),o(u)):(n.consume(u),l)}function c(u){if(u===null)return!0;const f=i[u];let d=-1;if(f)for(;++d-1){const a=s[0];typeof a=="string"?s[0]=a.slice(r):s.shift()}o>0&&s.push(t[i].slice(0,o))}return s}function EJt(t,e){let n=-1;const r=[];let i;for(;++n13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)===65535||(n&65535)===65534||n>1114111?"�":String.fromCharCode(n)}const GJt=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function HJt(t){return t.replace(GJt,qJt)}function qJt(t,e,n){if(e)return e;if(n.charCodeAt(0)===35){const i=n.charCodeAt(1),o=i===120||i===88;return C8e(n.slice(o?2:1),o?16:10)}return Uae(n)||t}const O8e={}.hasOwnProperty,XJt=function(t,e,n){return typeof e!="string"&&(n=e,e=void 0),YJt(n)(VJt(UJt(n).document().write(WJt()(t,e,!0))))};function YJt(t){const e={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:a(he),autolinkProtocol:M,autolinkEmail:M,atxHeading:a(ne),blockQuote:a(me),characterEscape:M,characterReference:M,codeFenced:a(te),codeFencedFenceInfo:l,codeFencedFenceMeta:l,codeIndented:a(te,l),codeText:a(ae,l),codeTextData:M,data:M,codeFlowValue:M,definition:a(U),definitionDestinationString:l,definitionLabelString:l,definitionTitleString:l,emphasis:a(oe),hardBreakEscape:a(V),hardBreakTrailing:a(V),htmlFlow:a(X,l),htmlFlowData:M,htmlText:a(X,l),htmlTextData:M,image:a(Z),label:l,link:a(he),listItem:a(G),listItemValue:p,listOrdered:a(xe,h),listUnordered:a(xe),paragraph:a(W),reference:q,referenceString:l,resourceDestinationString:l,resourceTitleString:l,setextHeading:a(ne),strong:a(J),thematicBreak:a(ye)},exit:{atxHeading:u(),atxHeadingSequence:S,autolink:u(),autolinkEmail:re,autolinkProtocol:ee,blockQuote:u(),characterEscapeValue:A,characterReferenceMarkerHexadecimal:le,characterReferenceMarkerNumeric:le,characterReferenceValue:K,codeFenced:u(y),codeFencedFence:v,codeFencedFenceInfo:g,codeFencedFenceMeta:m,codeFlowValue:A,codeIndented:u(x),codeText:u(B),codeTextData:A,data:A,definition:u(),definitionDestinationString:_,definitionLabelString:b,definitionTitleString:w,emphasis:u(),hardBreakEscape:u(T),hardBreakTrailing:u(T),htmlFlow:u(R),htmlFlowData:A,htmlText:u(I),htmlTextData:A,image:u(z),label:j,labelText:L,lineEnding:P,link:u($),listItem:u(),listOrdered:u(),listUnordered:u(),paragraph:u(),referenceString:Y,resourceDestinationString:N,resourceTitleString:F,resource:H,setextHeading:u(E),setextHeadingLineSequence:k,setextHeadingText:O,strong:u(),thematicBreak:u()}};E8e(e,(t||{}).mdastExtensions||[]);const n={};return r;function r(ie){let fe={type:"root",children:[]};const Q={stack:[fe],tokenStack:[],config:e,enter:c,exit:f,buffer:l,resume:d,setData:o,getData:s},_e=[];let we=-1;for(;++we0){const Ie=Q.tokenStack[Q.tokenStack.length-1];(Ie[1]||gxe).call(Q,void 0,Ie[0])}for(fe.position={start:vm(ie.length>0?ie[0][1].start:{line:1,column:1,offset:0}),end:vm(ie.length>0?ie[ie.length-2][1].end:{line:1,column:1,offset:0})},we=-1;++we{const r=this.data("settings");return XJt(n,Object.assign({},r,t,{extensions:this.data("micromarkExtensions")||[],mdastExtensions:this.data("fromMarkdownExtensions")||[]}))}})}function ZJt(t,e){const n={type:"element",tagName:"blockquote",properties:{},children:t.wrap(t.all(e),!0)};return t.patch(e,n),t.applyData(e,n)}function JJt(t,e){const n={type:"element",tagName:"br",properties:{},children:[]};return t.patch(e,n),[t.applyData(e,n),{type:"text",value:` -`}]}function een(t,e){const n=e.value?e.value+` -`:"",r=e.lang?e.lang.match(/^[^ \t]+(?=[ \t]|$)/):null,i={};r&&(i.className=["language-"+r]);let o={type:"element",tagName:"code",properties:i,children:[{type:"text",value:n}]};return e.meta&&(o.data={meta:e.meta}),t.patch(e,o),o=t.applyData(e,o),o={type:"element",tagName:"pre",properties:{},children:[o]},t.patch(e,o),o}function ten(t,e){const n={type:"element",tagName:"del",properties:{},children:t.all(e)};return t.patch(e,n),t.applyData(e,n)}function nen(t,e){const n={type:"element",tagName:"em",properties:{},children:t.all(e)};return t.patch(e,n),t.applyData(e,n)}function UO(t){const e=[];let n=-1,r=0,i=0;for(;++n55295&&o<57344){const a=t.charCodeAt(n+1);o<56320&&a>56319&&a<57344?(s=String.fromCharCode(o,a),i=1):s="�"}else s=String.fromCharCode(o);s&&(e.push(t.slice(r,n),encodeURIComponent(s)),r=n+i+1,s=""),i&&(n+=i,i=0)}return e.join("")+t.slice(r)}function T8e(t,e){const n=String(e.identifier).toUpperCase(),r=UO(n.toLowerCase()),i=t.footnoteOrder.indexOf(n);let o;i===-1?(t.footnoteOrder.push(n),t.footnoteCounts[n]=1,o=t.footnoteOrder.length):(t.footnoteCounts[n]++,o=i+1);const s=t.footnoteCounts[n],a={type:"element",tagName:"a",properties:{href:"#"+t.clobberPrefix+"fn-"+r,id:t.clobberPrefix+"fnref-"+r+(s>1?"-"+s:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(o)}]};t.patch(e,a);const l={type:"element",tagName:"sup",properties:{},children:[a]};return t.patch(e,l),t.applyData(e,l)}function ren(t,e){const n=t.footnoteById;let r=1;for(;r in n;)r++;const i=String(r);return n[i]={type:"footnoteDefinition",identifier:i,children:[{type:"paragraph",children:e.children}],position:e.position},T8e(t,{type:"footnoteReference",identifier:i,position:e.position})}function ien(t,e){const n={type:"element",tagName:"h"+e.depth,properties:{},children:t.all(e)};return t.patch(e,n),t.applyData(e,n)}function oen(t,e){if(t.dangerous){const n={type:"raw",value:e.value};return t.patch(e,n),t.applyData(e,n)}return null}function k8e(t,e){const n=e.referenceType;let r="]";if(n==="collapsed"?r+="[]":n==="full"&&(r+="["+(e.label||e.identifier)+"]"),e.type==="imageReference")return{type:"text",value:"!["+e.alt+r};const i=t.all(e),o=i[0];o&&o.type==="text"?o.value="["+o.value:i.unshift({type:"text",value:"["});const s=i[i.length-1];return s&&s.type==="text"?s.value+=r:i.push({type:"text",value:r}),i}function sen(t,e){const n=t.definition(e.identifier);if(!n)return k8e(t,e);const r={src:UO(n.url||""),alt:e.alt};n.title!==null&&n.title!==void 0&&(r.title=n.title);const i={type:"element",tagName:"img",properties:r,children:[]};return t.patch(e,i),t.applyData(e,i)}function aen(t,e){const n={src:UO(e.url)};e.alt!==null&&e.alt!==void 0&&(n.alt=e.alt),e.title!==null&&e.title!==void 0&&(n.title=e.title);const r={type:"element",tagName:"img",properties:n,children:[]};return t.patch(e,r),t.applyData(e,r)}function len(t,e){const n={type:"text",value:e.value.replace(/\r?\n|\r/g," ")};t.patch(e,n);const r={type:"element",tagName:"code",properties:{},children:[n]};return t.patch(e,r),t.applyData(e,r)}function cen(t,e){const n=t.definition(e.identifier);if(!n)return k8e(t,e);const r={href:UO(n.url||"")};n.title!==null&&n.title!==void 0&&(r.title=n.title);const i={type:"element",tagName:"a",properties:r,children:t.all(e)};return t.patch(e,i),t.applyData(e,i)}function uen(t,e){const n={href:UO(e.url)};e.title!==null&&e.title!==void 0&&(n.title=e.title);const r={type:"element",tagName:"a",properties:n,children:t.all(e)};return t.patch(e,r),t.applyData(e,r)}function fen(t,e,n){const r=t.all(e),i=n?den(n):A8e(e),o={},s=[];if(typeof e.checked=="boolean"){const u=r[0];let f;u&&u.type==="element"&&u.tagName==="p"?f=u:(f={type:"element",tagName:"p",properties:{},children:[]},r.unshift(f)),f.children.length>0&&f.children.unshift({type:"text",value:" "}),f.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:e.checked,disabled:!0},children:[]}),o.className=["task-list-item"]}let a=-1;for(;++a13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)===65535||(n&65535)===65534||n>1114111?"�":String.fromCharCode(n)}const jJt=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function BJt(t){return t.replace(jJt,UJt)}function UJt(t,e,n){if(e)return e;if(n.charCodeAt(0)===35){const i=n.charCodeAt(1),o=i===120||i===88;return K8e(n.slice(o?2:1),o?16:10)}return sle(n)||t}const Z8e={}.hasOwnProperty,WJt=function(t,e,n){return typeof e!="string"&&(n=e,e=void 0),VJt(n)(zJt(FJt(n).document().write(NJt()(t,e,!0))))};function VJt(t){const e={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:a(he),autolinkProtocol:P,autolinkEmail:P,atxHeading:a(ne),blockQuote:a(ge),characterEscape:P,characterReference:P,codeFenced:a(te),codeFencedFenceInfo:l,codeFencedFenceMeta:l,codeIndented:a(te,l),codeText:a(ae,l),codeTextData:P,data:P,codeFlowValue:P,definition:a(U),definitionDestinationString:l,definitionLabelString:l,definitionTitleString:l,emphasis:a(oe),hardBreakEscape:a(V),hardBreakTrailing:a(V),htmlFlow:a(X,l),htmlFlowData:P,htmlText:a(X,l),htmlTextData:P,image:a(Z),label:l,link:a(he),listItem:a(H),listItemValue:p,listOrdered:a(xe,h),listUnordered:a(xe),paragraph:a(W),reference:G,referenceString:l,resourceDestinationString:l,resourceTitleString:l,setextHeading:a(ne),strong:a(J),thematicBreak:a(ye)},exit:{atxHeading:u(),atxHeadingSequence:S,autolink:u(),autolinkEmail:re,autolinkProtocol:ee,blockQuote:u(),characterEscapeValue:A,characterReferenceMarkerHexadecimal:le,characterReferenceMarkerNumeric:le,characterReferenceValue:K,codeFenced:u(y),codeFencedFence:v,codeFencedFenceInfo:g,codeFencedFenceMeta:m,codeFlowValue:A,codeIndented:u(x),codeText:u(j),codeTextData:A,data:A,definition:u(),definitionDestinationString:_,definitionLabelString:b,definitionTitleString:w,emphasis:u(),hardBreakEscape:u(T),hardBreakTrailing:u(T),htmlFlow:u(M),htmlFlowData:A,htmlText:u(I),htmlTextData:A,image:u(z),label:B,labelText:L,lineEnding:R,link:u(N),listItem:u(),listOrdered:u(),listUnordered:u(),paragraph:u(),referenceString:Y,resourceDestinationString:F,resourceTitleString:$,resource:q,setextHeading:u(E),setextHeadingLineSequence:k,setextHeadingText:O,strong:u(),thematicBreak:u()}};J8e(e,(t||{}).mdastExtensions||[]);const n={};return r;function r(ie){let fe={type:"root",children:[]};const Q={stack:[fe],tokenStack:[],config:e,enter:c,exit:f,buffer:l,resume:d,setData:o,getData:s},_e=[];let we=-1;for(;++we0){const Ie=Q.tokenStack[Q.tokenStack.length-1];(Ie[1]||Bxe).call(Q,void 0,Ie[0])}for(fe.position={start:mm(ie.length>0?ie[0][1].start:{line:1,column:1,offset:0}),end:mm(ie.length>0?ie[ie.length-2][1].end:{line:1,column:1,offset:0})},we=-1;++we{const r=this.data("settings");return WJt(n,Object.assign({},r,t,{extensions:this.data("micromarkExtensions")||[],mdastExtensions:this.data("fromMarkdownExtensions")||[]}))}})}function qJt(t,e){const n={type:"element",tagName:"blockquote",properties:{},children:t.wrap(t.all(e),!0)};return t.patch(e,n),t.applyData(e,n)}function XJt(t,e){const n={type:"element",tagName:"br",properties:{},children:[]};return t.patch(e,n),[t.applyData(e,n),{type:"text",value:` +`}]}function YJt(t,e){const n=e.value?e.value+` +`:"",r=e.lang?e.lang.match(/^[^ \t]+(?=[ \t]|$)/):null,i={};r&&(i.className=["language-"+r]);let o={type:"element",tagName:"code",properties:i,children:[{type:"text",value:n}]};return e.meta&&(o.data={meta:e.meta}),t.patch(e,o),o=t.applyData(e,o),o={type:"element",tagName:"pre",properties:{},children:[o]},t.patch(e,o),o}function QJt(t,e){const n={type:"element",tagName:"del",properties:{},children:t.all(e)};return t.patch(e,n),t.applyData(e,n)}function KJt(t,e){const n={type:"element",tagName:"em",properties:{},children:t.all(e)};return t.patch(e,n),t.applyData(e,n)}function BO(t){const e=[];let n=-1,r=0,i=0;for(;++n55295&&o<57344){const a=t.charCodeAt(n+1);o<56320&&a>56319&&a<57344?(s=String.fromCharCode(o,a),i=1):s="�"}else s=String.fromCharCode(o);s&&(e.push(t.slice(r,n),encodeURIComponent(s)),r=n+i+1,s=""),i&&(n+=i,i=0)}return e.join("")+t.slice(r)}function eWe(t,e){const n=String(e.identifier).toUpperCase(),r=BO(n.toLowerCase()),i=t.footnoteOrder.indexOf(n);let o;i===-1?(t.footnoteOrder.push(n),t.footnoteCounts[n]=1,o=t.footnoteOrder.length):(t.footnoteCounts[n]++,o=i+1);const s=t.footnoteCounts[n],a={type:"element",tagName:"a",properties:{href:"#"+t.clobberPrefix+"fn-"+r,id:t.clobberPrefix+"fnref-"+r+(s>1?"-"+s:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(o)}]};t.patch(e,a);const l={type:"element",tagName:"sup",properties:{},children:[a]};return t.patch(e,l),t.applyData(e,l)}function ZJt(t,e){const n=t.footnoteById;let r=1;for(;r in n;)r++;const i=String(r);return n[i]={type:"footnoteDefinition",identifier:i,children:[{type:"paragraph",children:e.children}],position:e.position},eWe(t,{type:"footnoteReference",identifier:i,position:e.position})}function JJt(t,e){const n={type:"element",tagName:"h"+e.depth,properties:{},children:t.all(e)};return t.patch(e,n),t.applyData(e,n)}function een(t,e){if(t.dangerous){const n={type:"raw",value:e.value};return t.patch(e,n),t.applyData(e,n)}return null}function tWe(t,e){const n=e.referenceType;let r="]";if(n==="collapsed"?r+="[]":n==="full"&&(r+="["+(e.label||e.identifier)+"]"),e.type==="imageReference")return{type:"text",value:"!["+e.alt+r};const i=t.all(e),o=i[0];o&&o.type==="text"?o.value="["+o.value:i.unshift({type:"text",value:"["});const s=i[i.length-1];return s&&s.type==="text"?s.value+=r:i.push({type:"text",value:r}),i}function ten(t,e){const n=t.definition(e.identifier);if(!n)return tWe(t,e);const r={src:BO(n.url||""),alt:e.alt};n.title!==null&&n.title!==void 0&&(r.title=n.title);const i={type:"element",tagName:"img",properties:r,children:[]};return t.patch(e,i),t.applyData(e,i)}function nen(t,e){const n={src:BO(e.url)};e.alt!==null&&e.alt!==void 0&&(n.alt=e.alt),e.title!==null&&e.title!==void 0&&(n.title=e.title);const r={type:"element",tagName:"img",properties:n,children:[]};return t.patch(e,r),t.applyData(e,r)}function ren(t,e){const n={type:"text",value:e.value.replace(/\r?\n|\r/g," ")};t.patch(e,n);const r={type:"element",tagName:"code",properties:{},children:[n]};return t.patch(e,r),t.applyData(e,r)}function ien(t,e){const n=t.definition(e.identifier);if(!n)return tWe(t,e);const r={href:BO(n.url||"")};n.title!==null&&n.title!==void 0&&(r.title=n.title);const i={type:"element",tagName:"a",properties:r,children:t.all(e)};return t.patch(e,i),t.applyData(e,i)}function oen(t,e){const n={href:BO(e.url)};e.title!==null&&e.title!==void 0&&(n.title=e.title);const r={type:"element",tagName:"a",properties:n,children:t.all(e)};return t.patch(e,r),t.applyData(e,r)}function sen(t,e,n){const r=t.all(e),i=n?aen(n):nWe(e),o={},s=[];if(typeof e.checked=="boolean"){const u=r[0];let f;u&&u.type==="element"&&u.tagName==="p"?f=u:(f={type:"element",tagName:"p",properties:{},children:[]},r.unshift(f)),f.children.length>0&&f.children.unshift({type:"text",value:" "}),f.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:e.checked,disabled:!0},children:[]}),o.className=["task-list-item"]}let a=-1;for(;++a1}function hen(t,e){const n={},r=t.all(e);let i=-1;for(typeof e.start=="number"&&e.start!==1&&(n.start=e.start);++i-1?r.offset:null}}}function yen(t,e){const n=t.all(e),r=n.shift(),i=[];if(r){const s={type:"element",tagName:"thead",properties:{},children:t.wrap([r],!0)};t.patch(e.children[0],s),i.push(s)}if(n.length>0){const s={type:"element",tagName:"tbody",properties:{},children:t.wrap(n,!0)},a=Vae(e.children[1]),l=Gae(e.children[e.children.length-1]);a.line&&l.line&&(s.position={start:a,end:l}),i.push(s)}const o={type:"element",tagName:"table",properties:{},children:t.wrap(i,!0)};return t.patch(e,o),t.applyData(e,o)}function xen(t,e,n){const r=n?n.children:void 0,o=(r?r.indexOf(e):1)===0?"th":"td",s=n&&n.type==="table"?n.align:void 0,a=s?s.length:e.children.length;let l=-1;const c=[];for(;++l0,!0),r[0]),i=r.index+r[0].length,r=n.exec(e);return o.push(yxe(e.slice(i),i>0,!1)),o.join("")}function yxe(t,e,n){let r=0,i=t.length;if(e){let o=t.codePointAt(r);for(;o===mxe||o===vxe;)r++,o=t.codePointAt(r)}if(n){let o=t.codePointAt(i-1);for(;o===mxe||o===vxe;)i--,o=t.codePointAt(i-1)}return i>r?t.slice(r,i):""}function _en(t,e){const n={type:"text",value:wen(String(e.value))};return t.patch(e,n),t.applyData(e,n)}function Sen(t,e){const n={type:"element",tagName:"hr",properties:{},children:[]};return t.patch(e,n),t.applyData(e,n)}const Cen={blockquote:ZJt,break:JJt,code:een,delete:ten,emphasis:nen,footnoteReference:T8e,footnote:ren,heading:ien,html:oen,imageReference:sen,image:aen,inlineCode:len,linkReference:cen,link:uen,listItem:fen,list:hen,paragraph:pen,root:gen,strong:men,table:yen,tableCell:ben,tableRow:xen,text:_en,thematicBreak:Sen,toml:mL,yaml:mL,definition:mL,footnoteDefinition:mL};function mL(){return null}const M8e=function(t){if(t==null)return ken;if(typeof t=="string")return Ten(t);if(typeof t=="object")return Array.isArray(t)?Oen(t):Een(t);if(typeof t=="function")return oU(t);throw new Error("Expected function, string, or object as test")};function Oen(t){const e=[];let n=-1;for(;++n":""))+")"})}return f;function f(){let d=[],h,p,g;if((!e||i(a,l,c[c.length-1]||null))&&(d=Ren(n(a,c)),d[0]===xxe))return d;if(a.children&&d[0]!==Pen)for(p=(r?a.children.length:-1)+o,g=c.concat(a);p>-1&&p{const i=wxe(r.identifier);i&&!bxe.call(e,i)&&(e[i]=r)}),n;function n(r){const i=wxe(r);return i&&bxe.call(e,i)?e[i]:null}}function wxe(t){return String(t||"").toUpperCase()}const Q5={}.hasOwnProperty;function Len(t,e){const n=e||{},r=n.allowDangerousHtml||!1,i={};return s.dangerous=r,s.clobberPrefix=n.clobberPrefix===void 0||n.clobberPrefix===null?"user-content-":n.clobberPrefix,s.footnoteLabel=n.footnoteLabel||"Footnotes",s.footnoteLabelTagName=n.footnoteLabelTagName||"h2",s.footnoteLabelProperties=n.footnoteLabelProperties||{className:["sr-only"]},s.footnoteBackLabel=n.footnoteBackLabel||"Back to content",s.unknownHandler=n.unknownHandler,s.passThrough=n.passThrough,s.handlers={...Cen,...n.handlers},s.definition=Ien(t),s.footnoteById=i,s.footnoteOrder=[],s.footnoteCounts={},s.patch=$en,s.applyData=Fen,s.one=a,s.all=l,s.wrap=zen,s.augment=o,Hae(t,"footnoteDefinition",c=>{const u=String(c.identifier).toUpperCase();Q5.call(i,u)||(i[u]=c)}),s;function o(c,u){if(c&&"data"in c&&c.data){const f=c.data;f.hName&&(u.type!=="element"&&(u={type:"element",tagName:"",properties:{},children:[]}),u.tagName=f.hName),u.type==="element"&&f.hProperties&&(u.properties={...u.properties,...f.hProperties}),"children"in u&&u.children&&f.hChildren&&(u.children=f.hChildren)}if(c){const f="type"in c?c:{position:c};Den(f)||(u.position={start:Vae(f),end:Gae(f)})}return u}function s(c,u,f,d){return Array.isArray(f)&&(d=f,f={}),o(c,{type:"element",tagName:u,properties:f||{},children:d||[]})}function a(c,u){return R8e(s,c,u)}function l(c){return qae(s,c)}}function $en(t,e){t.position&&(e.position=ven(t))}function Fen(t,e){let n=e;if(t&&t.data){const r=t.data.hName,i=t.data.hChildren,o=t.data.hProperties;typeof r=="string"&&(n.type==="element"?n.tagName=r:n={type:"element",tagName:r,properties:{},children:[]}),n.type==="element"&&o&&(n.properties={...n.properties,...o}),"children"in n&&n.children&&i!==null&&i!==void 0&&(n.children=i)}return n}function R8e(t,e,n){const r=e&&e.type;if(!r)throw new Error("Expected node, got `"+e+"`");return Q5.call(t.handlers,r)?t.handlers[r](t,e,n):t.passThrough&&t.passThrough.includes(r)?"children"in e?{...e,children:qae(t,e)}:e:t.unknownHandler?t.unknownHandler(t,e,n):Nen(t,e)}function qae(t,e){const n=[];if("children"in e){const r=e.children;let i=-1;for(;++i1}function len(t,e){const n={},r=t.all(e);let i=-1;for(typeof e.start=="number"&&e.start!==1&&(n.start=e.start);++i-1?r.offset:null}}}function hen(t,e){const n=t.all(e),r=n.shift(),i=[];if(r){const s={type:"element",tagName:"thead",properties:{},children:t.wrap([r],!0)};t.patch(e.children[0],s),i.push(s)}if(n.length>0){const s={type:"element",tagName:"tbody",properties:{},children:t.wrap(n,!0)},a=lle(e.children[1]),l=cle(e.children[e.children.length-1]);a.line&&l.line&&(s.position={start:a,end:l}),i.push(s)}const o={type:"element",tagName:"table",properties:{},children:t.wrap(i,!0)};return t.patch(e,o),t.applyData(e,o)}function pen(t,e,n){const r=n?n.children:void 0,o=(r?r.indexOf(e):1)===0?"th":"td",s=n&&n.type==="table"?n.align:void 0,a=s?s.length:e.children.length;let l=-1;const c=[];for(;++l0,!0),r[0]),i=r.index+r[0].length,r=n.exec(e);return o.push(Vxe(e.slice(i),i>0,!1)),o.join("")}function Vxe(t,e,n){let r=0,i=t.length;if(e){let o=t.codePointAt(r);for(;o===Uxe||o===Wxe;)r++,o=t.codePointAt(r)}if(n){let o=t.codePointAt(i-1);for(;o===Uxe||o===Wxe;)i--,o=t.codePointAt(i-1)}return i>r?t.slice(r,i):""}function ven(t,e){const n={type:"text",value:men(String(e.value))};return t.patch(e,n),t.applyData(e,n)}function yen(t,e){const n={type:"element",tagName:"hr",properties:{},children:[]};return t.patch(e,n),t.applyData(e,n)}const xen={blockquote:qJt,break:XJt,code:YJt,delete:QJt,emphasis:KJt,footnoteReference:eWe,footnote:ZJt,heading:JJt,html:een,imageReference:ten,image:nen,inlineCode:ren,linkReference:ien,link:oen,listItem:sen,list:len,paragraph:cen,root:uen,strong:fen,table:hen,tableCell:gen,tableRow:pen,text:ven,thematicBreak:yen,toml:dL,yaml:dL,definition:dL,footnoteDefinition:dL};function dL(){return null}const iWe=function(t){if(t==null)return Sen;if(typeof t=="string")return _en(t);if(typeof t=="object")return Array.isArray(t)?ben(t):wen(t);if(typeof t=="function")return oU(t);throw new Error("Expected function, string, or object as test")};function ben(t){const e=[];let n=-1;for(;++n":""))+")"})}return f;function f(){let d=[],h,p,g;if((!e||i(a,l,c[c.length-1]||null))&&(d=Ten(n(a,c)),d[0]===Gxe))return d;if(a.children&&d[0]!==Oen)for(p=(r?a.children.length:-1)+o,g=c.concat(a);p>-1&&p{const i=qxe(r.identifier);i&&!Hxe.call(e,i)&&(e[i]=r)}),n;function n(r){const i=qxe(r);return i&&Hxe.call(e,i)?e[i]:null}}function qxe(t){return String(t||"").toUpperCase()}const H5={}.hasOwnProperty;function Pen(t,e){const n=e||{},r=n.allowDangerousHtml||!1,i={};return s.dangerous=r,s.clobberPrefix=n.clobberPrefix===void 0||n.clobberPrefix===null?"user-content-":n.clobberPrefix,s.footnoteLabel=n.footnoteLabel||"Footnotes",s.footnoteLabelTagName=n.footnoteLabelTagName||"h2",s.footnoteLabelProperties=n.footnoteLabelProperties||{className:["sr-only"]},s.footnoteBackLabel=n.footnoteBackLabel||"Back to content",s.unknownHandler=n.unknownHandler,s.passThrough=n.passThrough,s.handlers={...xen,...n.handlers},s.definition=Aen(t),s.footnoteById=i,s.footnoteOrder=[],s.footnoteCounts={},s.patch=Men,s.applyData=Ren,s.one=a,s.all=l,s.wrap=Ien,s.augment=o,ule(t,"footnoteDefinition",c=>{const u=String(c.identifier).toUpperCase();H5.call(i,u)||(i[u]=c)}),s;function o(c,u){if(c&&"data"in c&&c.data){const f=c.data;f.hName&&(u.type!=="element"&&(u={type:"element",tagName:"",properties:{},children:[]}),u.tagName=f.hName),u.type==="element"&&f.hProperties&&(u.properties={...u.properties,...f.hProperties}),"children"in u&&u.children&&f.hChildren&&(u.children=f.hChildren)}if(c){const f="type"in c?c:{position:c};ken(f)||(u.position={start:lle(f),end:cle(f)})}return u}function s(c,u,f,d){return Array.isArray(f)&&(d=f,f={}),o(c,{type:"element",tagName:u,properties:f||{},children:d||[]})}function a(c,u){return oWe(s,c,u)}function l(c){return fle(s,c)}}function Men(t,e){t.position&&(e.position=den(t))}function Ren(t,e){let n=e;if(t&&t.data){const r=t.data.hName,i=t.data.hChildren,o=t.data.hProperties;typeof r=="string"&&(n.type==="element"?n.tagName=r:n={type:"element",tagName:r,properties:{},children:[]}),n.type==="element"&&o&&(n.properties={...n.properties,...o}),"children"in n&&n.children&&i!==null&&i!==void 0&&(n.children=i)}return n}function oWe(t,e,n){const r=e&&e.type;if(!r)throw new Error("Expected node, got `"+e+"`");return H5.call(t.handlers,r)?t.handlers[r](t,e,n):t.passThrough&&t.passThrough.includes(r)?"children"in e?{...e,children:fle(t,e)}:e:t.unknownHandler?t.unknownHandler(t,e,n):Den(t,e)}function fle(t,e){const n=[];if("children"in e){const r=e.children;let i=-1;for(;++i0&&n.push({type:"text",value:` -`}),n}function jen(t){const e=[];let n=-1;for(;++n1?"-"+a:""),dataFootnoteBackref:!0,className:["data-footnote-backref"],ariaLabel:t.footnoteBackLabel},children:[{type:"text",value:"↩"}]};a>1&&f.children.push({type:"element",tagName:"sup",children:[{type:"text",value:String(a)}]}),l.length>0&&l.push({type:"text",value:" "}),l.push(f)}const c=i[i.length-1];if(c&&c.type==="element"&&c.tagName==="p"){const f=c.children[c.children.length-1];f&&f.type==="text"?f.value+=" ":c.children.push({type:"text",value:" "}),c.children.push(...l)}else i.push(...l);const u={type:"element",tagName:"li",properties:{id:t.clobberPrefix+"fn-"+s},children:t.wrap(i,!0)};t.patch(r,u),e.push(u)}if(e.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:t.footnoteLabelTagName,properties:{...JSON.parse(JSON.stringify(t.footnoteLabelProperties)),id:"footnote-label"},children:[{type:"text",value:t.footnoteLabel}]},{type:"text",value:` +`}),n}function Len(t){const e=[];let n=-1;for(;++n1?"-"+a:""),dataFootnoteBackref:!0,className:["data-footnote-backref"],ariaLabel:t.footnoteBackLabel},children:[{type:"text",value:"↩"}]};a>1&&f.children.push({type:"element",tagName:"sup",children:[{type:"text",value:String(a)}]}),l.length>0&&l.push({type:"text",value:" "}),l.push(f)}const c=i[i.length-1];if(c&&c.type==="element"&&c.tagName==="p"){const f=c.children[c.children.length-1];f&&f.type==="text"?f.value+=" ":c.children.push({type:"text",value:" "}),c.children.push(...l)}else i.push(...l);const u={type:"element",tagName:"li",properties:{id:t.clobberPrefix+"fn-"+s},children:t.wrap(i,!0)};t.patch(r,u),e.push(u)}if(e.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:t.footnoteLabelTagName,properties:{...JSON.parse(JSON.stringify(t.footnoteLabelProperties)),id:"footnote-label"},children:[{type:"text",value:t.footnoteLabel}]},{type:"text",value:` `},{type:"element",tagName:"ol",properties:{},children:t.wrap(e,!0)},{type:"text",value:` -`}]}}function D8e(t,e){const n=Len(t,e),r=n.one(t,null),i=jen(n);return i&&r.children.push({type:"text",value:` -`},i),Array.isArray(r)?{type:"root",children:r}:r}const Ben=function(t,e){return t&&"run"in t?Uen(t,e):Wen(t||e)};function Uen(t,e){return(n,r,i)=>{t.run(D8e(n,e),r,o=>{i(o)})}}function Wen(t){return e=>D8e(e,t)}class eD{constructor(e,n,r){this.property=e,this.normal=n,r&&(this.space=r)}}eD.prototype.property={};eD.prototype.normal={};eD.prototype.space=null;function I8e(t,e){const n={},r={};let i=-1;for(;++i4&&n.slice(0,4)==="data"&&Xen.test(e)){if(e.charAt(4)==="-"){const o=e.slice(5).replace(Sxe,Zen);r="data"+o.charAt(0).toUpperCase()+o.slice(1)}else{const o=e.slice(4);if(!Sxe.test(o)){let s=o.replace(Yen,Ken);s.charAt(0)!=="-"&&(s="-"+s),e="data"+s}}i=Xae}return new i(r,e)}function Ken(t){return"-"+t.toLowerCase()}function Zen(t){return t.charAt(1).toUpperCase()}const Cxe={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"},Jen=I8e([F8e,$8e,j8e,B8e,Hen],"html"),etn=I8e([F8e,$8e,j8e,B8e,qen],"svg");function ttn(t){if(t.allowedElements&&t.disallowedElements)throw new TypeError("Only one of `allowedElements` and `disallowedElements` should be defined");if(t.allowedElements||t.disallowedElements||t.allowElement)return e=>{Hae(e,"element",(n,r,i)=>{const o=i;let s;if(t.allowedElements?s=!t.allowedElements.includes(n.tagName):t.disallowedElements&&(s=t.disallowedElements.includes(n.tagName)),!s&&t.allowElement&&typeof r=="number"&&(s=!t.allowElement(n,r,o)),s&&typeof r=="number")return t.unwrapDisallowed&&n.children?o.children.splice(r,1,...n.children):o.children.splice(r,1),r})}}var U8e={exports:{}},Sr={};/** +`}]}}function sWe(t,e){const n=Pen(t,e),r=n.one(t,null),i=Len(n);return i&&r.children.push({type:"text",value:` +`},i),Array.isArray(r)?{type:"root",children:r}:r}const $en=function(t,e){return t&&"run"in t?Fen(t,e):Nen(t||e)};function Fen(t,e){return(n,r,i)=>{t.run(sWe(n,e),r,o=>{i(o)})}}function Nen(t){return e=>sWe(e,t)}class KR{constructor(e,n,r){this.property=e,this.normal=n,r&&(this.space=r)}}KR.prototype.property={};KR.prototype.normal={};KR.prototype.space=null;function aWe(t,e){const n={},r={};let i=-1;for(;++i4&&n.slice(0,4)==="data"&&Wen.test(e)){if(e.charAt(4)==="-"){const o=e.slice(5).replace(Yxe,qen);r="data"+o.charAt(0).toUpperCase()+o.slice(1)}else{const o=e.slice(4);if(!Yxe.test(o)){let s=o.replace(Ven,Hen);s.charAt(0)!=="-"&&(s="-"+s),e="data"+s}}i=dle}return new i(r,e)}function Hen(t){return"-"+t.toLowerCase()}function qen(t){return t.charAt(1).toUpperCase()}const Qxe={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"},Xen=aWe([uWe,cWe,hWe,pWe,Ben],"html"),Yen=aWe([uWe,cWe,hWe,pWe,Uen],"svg");function Qen(t){if(t.allowedElements&&t.disallowedElements)throw new TypeError("Only one of `allowedElements` and `disallowedElements` should be defined");if(t.allowedElements||t.disallowedElements||t.allowElement)return e=>{ule(e,"element",(n,r,i)=>{const o=i;let s;if(t.allowedElements?s=!t.allowedElements.includes(n.tagName):t.disallowedElements&&(s=t.disallowedElements.includes(n.tagName)),!s&&t.allowElement&&typeof r=="number"&&(s=!t.allowElement(n,r,o)),s&&typeof r=="number")return t.unwrapDisallowed&&n.children?o.children.splice(r,1,...n.children):o.children.splice(r,1),r})}}var gWe={exports:{}},Sr={};/** * @license React * react-is.production.min.js * @@ -486,85 +488,85 @@ https://github.com/nodeca/pako/blob/main/LICENSE * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var Yae=Symbol.for("react.element"),Qae=Symbol.for("react.portal"),sU=Symbol.for("react.fragment"),aU=Symbol.for("react.strict_mode"),lU=Symbol.for("react.profiler"),cU=Symbol.for("react.provider"),uU=Symbol.for("react.context"),ntn=Symbol.for("react.server_context"),fU=Symbol.for("react.forward_ref"),dU=Symbol.for("react.suspense"),hU=Symbol.for("react.suspense_list"),pU=Symbol.for("react.memo"),gU=Symbol.for("react.lazy"),rtn=Symbol.for("react.offscreen"),W8e;W8e=Symbol.for("react.module.reference");function Vu(t){if(typeof t=="object"&&t!==null){var e=t.$$typeof;switch(e){case Yae:switch(t=t.type,t){case sU:case lU:case aU:case dU:case hU:return t;default:switch(t=t&&t.$$typeof,t){case ntn:case uU:case fU:case gU:case pU:case cU:return t;default:return e}}case Qae:return e}}}Sr.ContextConsumer=uU;Sr.ContextProvider=cU;Sr.Element=Yae;Sr.ForwardRef=fU;Sr.Fragment=sU;Sr.Lazy=gU;Sr.Memo=pU;Sr.Portal=Qae;Sr.Profiler=lU;Sr.StrictMode=aU;Sr.Suspense=dU;Sr.SuspenseList=hU;Sr.isAsyncMode=function(){return!1};Sr.isConcurrentMode=function(){return!1};Sr.isContextConsumer=function(t){return Vu(t)===uU};Sr.isContextProvider=function(t){return Vu(t)===cU};Sr.isElement=function(t){return typeof t=="object"&&t!==null&&t.$$typeof===Yae};Sr.isForwardRef=function(t){return Vu(t)===fU};Sr.isFragment=function(t){return Vu(t)===sU};Sr.isLazy=function(t){return Vu(t)===gU};Sr.isMemo=function(t){return Vu(t)===pU};Sr.isPortal=function(t){return Vu(t)===Qae};Sr.isProfiler=function(t){return Vu(t)===lU};Sr.isStrictMode=function(t){return Vu(t)===aU};Sr.isSuspense=function(t){return Vu(t)===dU};Sr.isSuspenseList=function(t){return Vu(t)===hU};Sr.isValidElementType=function(t){return typeof t=="string"||typeof t=="function"||t===sU||t===lU||t===aU||t===dU||t===hU||t===rtn||typeof t=="object"&&t!==null&&(t.$$typeof===gU||t.$$typeof===pU||t.$$typeof===cU||t.$$typeof===uU||t.$$typeof===fU||t.$$typeof===W8e||t.getModuleId!==void 0)};Sr.typeOf=Vu;U8e.exports=Sr;var itn=U8e.exports;const otn=on(itn);function stn(t){const e=t&&typeof t=="object"&&t.type==="text"?t.value||"":t;return typeof e=="string"&&e.replace(/[ \t\n\f\r]/g,"")===""}function atn(t){return t.join(" ").trim()}function ltn(t,e){const n={};return(t[t.length-1]===""?[...t,""]:t).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}var Kae={exports:{}},Oxe=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,ctn=/\n/g,utn=/^\s*/,ftn=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,dtn=/^:\s*/,htn=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,ptn=/^[;\s]*/,gtn=/^\s+|\s+$/g,mtn=` -`,Exe="/",Txe="*",ex="",vtn="comment",ytn="declaration",xtn=function(t,e){if(typeof t!="string")throw new TypeError("First argument must be a string");if(!t)return[];e=e||{};var n=1,r=1;function i(p){var g=p.match(ctn);g&&(n+=g.length);var m=p.lastIndexOf(mtn);r=~m?p.length-m:r+p.length}function o(){var p={line:n,column:r};return function(g){return g.position=new s(p),c(),g}}function s(p){this.start=p,this.end={line:n,column:r},this.source=e.source}s.prototype.content=t;function a(p){var g=new Error(e.source+":"+n+":"+r+": "+p);if(g.reason=p,g.filename=e.source,g.line=n,g.column=r,g.source=t,!e.silent)throw g}function l(p){var g=p.exec(t);if(g){var m=g[0];return i(m),t=t.slice(m.length),g}}function c(){l(utn)}function u(p){var g;for(p=p||[];g=f();)g!==!1&&p.push(g);return p}function f(){var p=o();if(!(Exe!=t.charAt(0)||Txe!=t.charAt(1))){for(var g=2;ex!=t.charAt(g)&&(Txe!=t.charAt(g)||Exe!=t.charAt(g+1));)++g;if(g+=2,ex===t.charAt(g-1))return a("End of comment missing");var m=t.slice(2,g-2);return r+=2,i(m),t=t.slice(g),r+=2,p({type:vtn,comment:m})}}function d(){var p=o(),g=l(ftn);if(g){if(f(),!l(dtn))return a("property missing ':'");var m=l(htn),v=p({type:ytn,property:kxe(g[0].replace(Oxe,ex)),value:m?kxe(m[0].replace(Oxe,ex)):ex});return l(ptn),v}}function h(){var p=[];u(p);for(var g;g=d();)g!==!1&&(p.push(g),u(p));return p}return c(),h()};function kxe(t){return t?t.replace(gtn,ex):ex}var btn=xtn;function V8e(t,e){var n=null;if(!t||typeof t!="string")return n;for(var r,i=btn(t),o=typeof e=="function",s,a,l=0,c=i.length;l0?de.createElement(h,l,f):de.createElement(h,l)}function Otn(t){let e=-1;for(;++e for more info)`),delete vL[o]}const e=UKt().use(KJt).use(t.remarkPlugins||[]).use(Ben,{...t.remarkRehypeOptions,allowDangerousHtml:!0}).use(t.rehypePlugins||[]).use(ttn,t),n=new u8e;typeof t.children=="string"?n.value=t.children:t.children!==void 0&&t.children!==null&&console.warn(`[react-markdown] Warning: please pass a string as \`children\` (not: \`${t.children}\`)`);const r=e.runSync(e.parse(n),n);if(r.type!=="root")throw new TypeError("Expected a `root` node");let i=de.createElement(de.Fragment,{},G8e({options:t,schema:Jen,listDepth:0},r));return t.className&&(i=de.createElement("div",{className:t.className},i)),i}mU.propTypes={children:pe.string,className:pe.string,allowElement:pe.func,allowedElements:pe.arrayOf(pe.string),disallowedElements:pe.arrayOf(pe.string),unwrapDisallowed:pe.bool,remarkPlugins:pe.arrayOf(pe.oneOfType([pe.object,pe.func,pe.arrayOf(pe.oneOfType([pe.bool,pe.string,pe.object,pe.func,pe.arrayOf(pe.any)]))])),rehypePlugins:pe.arrayOf(pe.oneOfType([pe.object,pe.func,pe.arrayOf(pe.oneOfType([pe.bool,pe.string,pe.object,pe.func,pe.arrayOf(pe.any)]))])),sourcePos:pe.bool,rawSourcePos:pe.bool,skipHtml:pe.bool,includeElementIndex:pe.bool,transformLinkUri:pe.oneOfType([pe.func,pe.bool]),linkTarget:pe.oneOfType([pe.func,pe.string]),transformImageUri:pe.func,components:pe.object};const VO=lt(C.jsx("path",{d:"M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"}),"Close");function H8e(t){const[e,n]=D.useState();return D.useEffect(()=>{t?fetch(t).then(r=>r.text()).then(r=>n(r)).catch(r=>{console.error(r)}):n(void 0)},[t]),e}const _9={dialog:t=>({backgroundColor:t.palette.grey[200]}),appBar:{position:"relative"},title:t=>({marginLeft:t.spacing(2),flex:1})},Mtn=oa("div")(({theme:t})=>({marginTop:t.spacing(4),marginLeft:t.spacing(40),marginRight:t.spacing(40)})),Rtn=de.forwardRef(function(e,n){return C.jsx(cat,{direction:"up",ref:n,...e})}),Dtn=({title:t,href:e,open:n,onClose:r})=>{const i=H8e(e);return C.jsxs(ed,{fullScreen:!0,open:n,onClose:r,TransitionComponent:Rtn,PaperProps:{tabIndex:-1},children:[C.jsx(wAe,{sx:_9.appBar,children:C.jsxs(C4,{children:[C.jsx(Ht,{edge:"start",color:"inherit",onClick:r,"aria-label":"close",size:"large",children:C.jsx(VO,{})}),C.jsx(Jt,{variant:"h6",sx:_9.title,children:t})]})}),C.jsx(zf,{sx:_9.dialog,children:C.jsx(Mtn,{children:C.jsx(mU,{children:i||"",linkTarget:"_blank"})})})]})},Pxe=lt(C.jsx("path",{d:"M12 12c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4m0 2c-2.67 0-8 1.34-8 4v2h16v-2c0-2.66-5.33-4-8-4"}),"Person"),Itn=({userInfo:t})=>C.jsxs(rW,{container:!0,justifyContent:"center",spacing:1,children:[C.jsx(rW,{item:!0,children:C.jsx("img",{src:t.picture,width:84,alt:ge.get("User Profile")})}),C.jsx(rW,{item:!0,children:C.jsx(Al,{elevation:3,children:C.jsxs(DM,{children:[C.jsx(M_,{children:C.jsx(du,{primary:t.name,secondary:ge.get("User name")})}),C.jsx(Oh,{light:!0}),C.jsx(M_,{children:C.jsx(du,{primary:`${t.email} (${t.email_verified?ge.get("verified"):ge.get("not verified")})`,secondary:ge.get("E-mail")})}),C.jsx(Oh,{light:!0}),C.jsx(M_,{children:C.jsx(du,{primary:t.nickname,secondary:ge.get("Nickname")})})]})})})]}),g2={imageAvatar:{width:32,height:32,color:"#fff",backgroundColor:Tx[300]},letterAvatar:{width:32,height:32,color:"#fff",backgroundColor:Tx[300]},signInProgress:{color:Tx[300],position:"absolute",top:"50%",left:"50%",zIndex:1,marginTop:-12,marginLeft:-12},iconButton:{padding:0}},Ltn=oa("div")(({theme:t})=>({margin:t.spacing(1),position:"relative"})),$tn=({updateAccessToken:t})=>{const e=Edt(),[n,r]=D.useState(null),[i,o]=D.useState(!1);D.useEffect(()=>{e.user&&e.user.access_token?t(e.user.access_token):t(null)},[e.user,t]);const s=()=>{c(),o(!0)},a=()=>{o(!1)},l=d=>{r(d.currentTarget)},c=()=>{r(null)},u=()=>{e.signinRedirect().then(()=>{}).catch(d=>{console.error(d)})},f=()=>{c(),e.signoutRedirect().then(()=>{}).catch(d=>{console.error(d)})};if(e.user){const d=e.user.profile;let h,p=C.jsx(Pxe,{});if(!d)h=C.jsx(eW,{sx:g2.letterAvatar,children:"?"});else if(d.picture)h=C.jsx(eW,{sx:g2.imageAvatar,src:d.picture,alt:d.name});else{const g=d.given_name||d.name||d.nickname,m=d.family_name;let v=null;g&&m?v=g[0]+m[0]:g?v=g[0]:m&&(v=m[0]),v!==null&&(p=v.toUpperCase()),h=C.jsx(eW,{sx:g2.letterAvatar,children:p})}return C.jsxs(D.Fragment,{children:[C.jsx(Ht,{onClick:l,"aria-controls":"user-menu","aria-haspopup":"true",size:"small",sx:g2.iconButton,children:h}),C.jsxs(Z1,{id:"user-menu",anchorEl:n,keepMounted:!0,open:!!n,onClose:c,children:[C.jsx(_i,{onClick:s,children:ge.get("Profile")}),C.jsx(_i,{onClick:f,children:ge.get("Log out")})]}),C.jsxs(ed,{open:i,keepMounted:!0,onClose:a,"aria-labelledby":"alert-dialog-slide-title","aria-describedby":"alert-dialog-slide-description",children:[C.jsx(Iy,{id:"alert-dialog-slide-title",children:ge.get("User Profile")}),C.jsx(zf,{children:C.jsx(Itn,{userInfo:e.user.profile})}),C.jsx(Q1,{children:C.jsx(Vr,{onClick:a,children:"OK"})})]})]})}else{let d=C.jsx(Ht,{onClick:e.isLoading?void 0:u,size:"small",children:C.jsx(Pxe,{})});return e.isLoading&&(d=C.jsxs(Ltn,{children:[d,C.jsx(Y1,{size:24,sx:g2.signInProgress})]})),d}},Ftn=t=>wn.instance.authClient?C.jsx($tn,{...t}):null,Ntn=Ftn,q8e="UPDATE_ACCESS_TOKEN";function ztn(t){return(e,n)=>{const r=n().userAuthState.accessToken;r!==t&&(e(jtn(t)),(t===null||r===null)&&e(J6e()))}}function jtn(t){return{type:q8e,accessToken:t}}const Btn=t=>({}),Utn={updateAccessToken:ztn},Wtn=Rn(Btn,Utn)(Ntn),Vtn=t=>({locale:t.controlState.locale,appName:wn.instance.branding.appBarTitle,allowRefresh:wn.instance.branding.allowRefresh,allowSharing:wn.instance.branding.allowRefresh}),Gtn={openDialog:_b,updateResources:Z6e,shareStatePermalink:K6e},Htn={appBar:t=>({zIndex:t.zIndex.drawer+1,transition:t.transitions.create(["width","margin"],{easing:t.transitions.easing.sharp,duration:t.transitions.duration.leavingScreen})})},qtn=be("a")(()=>({display:"flex",alignItems:"center"})),Xtn=be("img")(({theme:t})=>({marginLeft:t.spacing(1)})),ym={toolbar:t=>({backgroundColor:wn.instance.branding.headerBackgroundColor,paddingRight:t.spacing(1)}),logo:t=>({marginLeft:t.spacing(1)}),title:t=>({flexGrow:1,marginLeft:t.spacing(1),...wn.instance.branding.headerTitleStyle}),imageAvatar:{width:24,height:24,color:"#fff",backgroundColor:Tx[300]},letterAvatar:{width:24,height:24,color:"#fff",backgroundColor:Tx[300]},signInWrapper:t=>({margin:t.spacing(1),position:"relative"}),signInProgress:{color:Tx[300],position:"absolute",top:"50%",left:"50%",zIndex:1,marginTop:"-12px",marginLeft:"-12px"},iconButton:t=>({marginLeft:t.spacing(2),...wn.instance.branding.headerIconStyle})},Ytn=({appName:t,openDialog:e,allowRefresh:n,updateResources:r,allowSharing:i,shareStatePermalink:o})=>{const[s,a]=D.useState(!1),l=()=>{e("settings")},c=()=>{window.open("https://xcube-dev.github.io/xcube-viewer/","Manual")},u=()=>{a(!0)},f=()=>{a(!1)};return C.jsxs(wAe,{position:"absolute",sx:Htn.appBar,elevation:0,children:[C.jsxs(C4,{disableGutters:!0,sx:ym.toolbar,variant:"dense",children:[C.jsx(qtn,{href:wn.instance.branding.organisationUrl||"",target:"_blank",rel:"noreferrer",children:C.jsx(Xtn,{src:wn.instance.branding.logoImage,width:wn.instance.branding.logoWidth,alt:"xcube logo"})}),C.jsx(Jt,{component:"h1",variant:"h6",color:"inherit",noWrap:!0,sx:ym.title,children:t}),C.jsx(Wtn,{}),n&&C.jsx(Rt,{arrow:!0,title:ge.get("Refresh"),children:C.jsx(Ht,{onClick:r,size:"small",sx:ym.iconButton,children:C.jsx(wPe,{})})}),i&&C.jsx(Rt,{arrow:!0,title:ge.get("Share"),children:C.jsx(Ht,{onClick:o,size:"small",sx:ym.iconButton,children:C.jsx(_Pe,{})})}),wn.instance.branding.allowDownloads&&C.jsx(Rt,{arrow:!0,title:ge.get("Export data"),children:C.jsx(Ht,{onClick:()=>e("export"),size:"small",sx:ym.iconButton,children:C.jsx(SPe,{})})}),C.jsx(Rt,{arrow:!0,title:ge.get("Help"),children:C.jsx(Ht,{onClick:c,size:"small",sx:ym.iconButton,children:C.jsx(xPe,{})})}),C.jsx(Rt,{arrow:!0,title:ge.get("Imprint"),children:C.jsx(Ht,{onClick:u,size:"small",sx:ym.iconButton,children:C.jsx(Idt,{})})}),C.jsx(Rt,{arrow:!0,title:ge.get("Settings"),children:C.jsx(Ht,{onClick:l,size:"small",sx:ym.iconButton,children:C.jsx(bPe,{})})})]}),C.jsx(Dtn,{title:ge.get("Imprint"),href:"docs/imprint.md",open:s,onClose:f})]})},Qtn=Rn(Vtn,Gtn)(Ytn),Ktn=oa("form")(({theme:t})=>({display:"flex",flexWrap:"wrap",paddingTop:t.spacing(1),paddingLeft:t.spacing(1),paddingRight:t.spacing(1),flexGrow:0}));function Ztn({children:t}){return C.jsx(Ktn,{autoComplete:"off",children:t})}const X8e=lt(C.jsx("path",{d:"M19.3 16.9c.4-.7.7-1.5.7-2.4 0-2.5-2-4.5-4.5-4.5S11 12 11 14.5s2 4.5 4.5 4.5c.9 0 1.7-.3 2.4-.7l3.2 3.2 1.4-1.4zm-3.8.1c-1.4 0-2.5-1.1-2.5-2.5s1.1-2.5 2.5-2.5 2.5 1.1 2.5 2.5-1.1 2.5-2.5 2.5M12 20v2C6.48 22 2 17.52 2 12S6.48 2 12 2c4.84 0 8.87 3.44 9.8 8h-2.07c-.64-2.46-2.4-4.47-4.73-5.41V5c0 1.1-.9 2-2 2h-2v2c0 .55-.45 1-1 1H8v2h2v3H9l-4.79-4.79C4.08 10.79 4 11.38 4 12c0 4.41 3.59 8 8 8"}),"TravelExplore"),lu=({sx:t,className:e,disabled:n,onClick:r,icon:i,tooltipText:o,toggle:s,value:a,selected:l})=>{const c=f=>{s?r(f,a):r(f)},u=o?C.jsx(Rt,{arrow:!0,title:o,children:i}):i;return s?C.jsx(yr,{sx:{padding:.3,...t},className:e,disabled:n,size:"small",onClick:c,value:a||"",selected:l,children:u}):C.jsx(Ht,{sx:t,className:e,disabled:n,size:"small",onClick:c,children:u})},Jtn=oa(Gg)(({theme:t})=>({marginRight:t.spacing(1)}));function tP({label:t,control:e,actions:n}){return C.jsx(Jtn,{variant:"standard",children:C.jsxs(ot,{children:[t,e,n]})})}function enn({selectedDatasetId:t,datasets:e,selectDataset:n,locateSelectedDataset:r}){const i=D.useMemo(()=>e.sort((d,h)=>{const p=d.groupTitle||"zzz",g=h.groupTitle||"zzz",m=p.localeCompare(g);return m!==0?m:d.title.localeCompare(h.title)}),[e]),o=i.length>0&&!!i[0].groupTitle,s=d=>{const h=d.target.value||null;n(h,e,!0)};t=t||"",e=e||[];const a=C.jsx(Ly,{shrink:!0,htmlFor:"dataset-select",children:ge.get("Dataset")}),l=[];let c;i.forEach(d=>{if(o){const h=d.groupTitle||ge.get("Others");h!==c&&l.push(C.jsx(Oh,{children:C.jsx(Jt,{fontSize:"small",color:"text.secondary",children:h})},h)),c=h}l.push(C.jsx(_i,{value:d.id,selected:d.id===t,children:d.title},d.id))});const u=C.jsx(Hg,{variant:"standard",value:t,onChange:s,input:C.jsx(Rg,{name:"dataset",id:"dataset-select"}),displayEmpty:!0,name:"dataset",children:l}),f=C.jsx(lu,{onClick:r,tooltipText:ge.get("Locate dataset in map"),icon:C.jsx(X8e,{})});return C.jsx(tP,{label:a,control:u,actions:f})}const tnn=t=>({locale:t.controlState.locale,selectedDatasetId:t.controlState.selectedDatasetId,datasets:t.dataState.datasets}),nnn={selectDataset:bUe,locateSelectedDataset:rKt},rnn=Rn(tnn,nnn)(enn),lQ=lt(C.jsx("path",{d:"M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2m-5.97 4.06L14.09 6l1.41 1.41L16.91 6l1.06 1.06-1.41 1.41 1.41 1.41-1.06 1.06-1.41-1.4-1.41 1.41-1.06-1.06 1.41-1.41zm-6.78.66h5v1.5h-5zM11.5 16h-2v2H8v-2H6v-1.5h2v-2h1.5v2h2zm6.5 1.25h-5v-1.5h5zm0-2.5h-5v-1.5h5z"}),"Calculate"),Y8e=lt(C.jsx("path",{d:"M18 4H6v2l6.5 6L6 18v2h12v-3h-7l5-5-5-5h7z"}),"Functions"),cQ=lt(C.jsx("path",{fillRule:"evenodd",d:"M16 9V4h1c.55 0 1-.45 1-1s-.45-1-1-1H7c-.55 0-1 .45-1 1s.45 1 1 1h1v5c0 1.66-1.34 3-3 3v2h5.97v7l1 1 1-1v-7H19v-2c-1.66 0-3-1.34-3-3"}),"PushPin"),inn=lt(C.jsx("path",{d:"M23 8c0 1.1-.9 2-2 2-.18 0-.35-.02-.51-.07l-3.56 3.55c.05.16.07.34.07.52 0 1.1-.9 2-2 2s-2-.9-2-2c0-.18.02-.36.07-.52l-2.55-2.55c-.16.05-.34.07-.52.07s-.36-.02-.52-.07l-4.55 4.56c.05.16.07.33.07.51 0 1.1-.9 2-2 2s-2-.9-2-2 .9-2 2-2c.18 0 .35.02.51.07l4.56-4.55C8.02 9.36 8 9.18 8 9c0-1.1.9-2 2-2s2 .9 2 2c0 .18-.02.36-.07.52l2.55 2.55c.16-.05.34-.07.52-.07s.36.02.52.07l3.55-3.56C19.02 8.35 19 8.18 19 8c0-1.1.9-2 2-2s2 .9 2 2"}),"Timeline"),ol={toggleButton:{padding:.3}},K5="userVariablesDialog";function onn(){return{id:Uf("user"),name:"",title:"",units:"",expression:"",colorBarName:"bone",colorBarMin:0,colorBarMax:1,shape:[],dims:[],dtype:"float64",timeChunkSize:null,attrs:{}}}function snn(t){return{...t,id:Uf("user"),name:`${t.name}_copy`,title:t.title?`${t.title} Copy`:""}}const ann={variables:!0,constants:!1,arrayOperators:!1,otherOperators:!1,arrayFunctions:!1,otherFunctions:!1},Q8e=["variables","constants","arrayOperators","otherOperators","arrayFunctions","otherFunctions"],lnn={variables:"Variables",constants:"Constants",arrayOperators:"Array operators",otherOperators:"Other operators",arrayFunctions:"Array functions",otherFunctions:"Other functions"};function cnn({selectedDatasetId:t,selectedVariableName:e,selectedDataset2Id:n,selectedVariable2Name:r,variables:i,userVariablesAllowed:o,canAddTimeSeries:s,addTimeSeries:a,canAddStatistics:l,addStatistics:c,selectVariable:u,selectVariable2:f,openDialog:d}){const h=O=>{u(O.target.value||null)},p=()=>{d(K5)},g=()=>{a()},m=()=>{c()},v=t===n&&e===r,y=C.jsx(Ly,{shrink:!0,htmlFor:"variable-select",children:ge.get("Variable")}),x=C.jsx(Hg,{variant:"standard",value:e||"",onChange:h,input:C.jsx(Rg,{name:"variable",id:"variable-select"}),displayEmpty:!0,name:"variable",renderValue:()=>Mxe(i.find(O=>O.name===e)),children:(i||[]).map(O=>C.jsxs(_i,{value:O.name,selected:O.name===e,children:[jM(O)&&C.jsx(GAe,{children:C.jsx(lQ,{fontSize:"small"})}),C.jsx(du,{children:Mxe(O)}),t===n&&O.name===r&&C.jsx(cQ,{fontSize:"small",color:"secondary"})]},O.name))}),b=o&&C.jsx(lu,{onClick:p,tooltipText:ge.get("Create and manage user variables"),icon:C.jsx(lQ,{})},"userVariables"),w=C.jsx(lu,{disabled:!s,onClick:g,tooltipText:ge.get("Show time-series diagram"),icon:C.jsx(inn,{})},"timeSeries"),_=C.jsx(lu,{disabled:!l,onClick:m,tooltipText:ge.get("Add statistics"),icon:C.jsx(Y8e,{})},"statistics"),S=C.jsx(yr,{selected:v,value:"comparison",size:"small",sx:{...ol.toggleButton,marginLeft:.4},onClick:()=>f(t,e),children:C.jsx(Rt,{arrow:!0,title:ge.get("Make it 2nd variable for comparison"),children:C.jsx(cQ,{fontSize:"small"})})},"variable2");return C.jsx(tP,{label:y,control:x,actions:[S,b,w,_]})}function Mxe(t){return t?t.title||t.name:"?"}const unn=t=>({locale:t.controlState.locale,selectedDatasetId:t.controlState.selectedDatasetId,selectedVariableName:t.controlState.selectedVariableName,selectedDataset2Id:t.controlState.selectedDataset2Id,selectedVariable2Name:t.controlState.selectedVariable2Name,userVariablesAllowed:Lwt(),canAddTimeSeries:yDe(t),canAddStatistics:xDe(t),variables:Vwt(t)}),fnn={openDialog:_b,selectVariable:PUe,selectVariable2:pKt,addTimeSeries:tU,addStatistics:oUe},dnn=Rn(unn,fnn)(cnn),GO=lt(C.jsx("path",{d:"M3 17.25V21h3.75L17.81 9.94l-3.75-3.75zM20.71 7.04c.39-.39.39-1.02 0-1.41l-2.34-2.34a.996.996 0 0 0-1.41 0l-1.83 1.83 3.75 3.75z"}),"Edit"),vU=lt(C.jsx("path",{d:"M7 11v2h10v-2zm5-9C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8"}),"RemoveCircleOutline"),K8e=({itemValue:t,setItemValue:e,validateItemValue:n,editMode:r,setEditMode:i,labelText:o,select:s,actions:a})=>{const l=D.useRef(null),[c,u]=D.useState("");D.useEffect(()=>{r&&u(t)},[r,t,u]),D.useEffect(()=>{if(r){const p=l.current;p!==null&&(p.focus(),p.select())}},[r]);const f=C.jsx(Ly,{shrink:!0,htmlFor:"place-select",children:o});if(!r)return C.jsx(tP,{label:f,control:s,actions:a});const d=n?n(c):!0,h=C.jsx(Rg,{value:c,error:!d,inputRef:l,onBlur:()=>i(!1),onKeyUp:p=>{p.code==="Escape"?i(!1):p.code==="Enter"&&d&&(i(!1),e(c))},onChange:p=>{u(p.currentTarget.value)}});return C.jsx(tP,{label:f,control:h})},hnn={select:{minWidth:"5em"}};function pnn({placeGroups:t,selectPlaceGroups:e,renameUserPlaceGroup:n,removeUserPlaceGroup:r,selectedPlaceGroupIds:i,selectedPlaceGroupsTitle:o}){const[s,a]=D.useState(!1);if(t=t||[],i=i||[],t.length===0)return null;const l=i.length===1?i[0]:null,c=g=>{n(l,g)},u=g=>{e(g.target.value||null)},f=()=>o,d=C.jsx(Hg,{variant:"standard",multiple:!0,displayEmpty:!0,onChange:u,input:C.jsx(Rg,{name:"place-groups",id:"place-groups-select"}),value:i,renderValue:f,name:"place-groups",sx:hnn.select,children:t.map(g=>C.jsxs(_i,{value:g.id,children:[C.jsx(zF,{checked:i.indexOf(g.id)>-1}),C.jsx(du,{primary:g.title})]},g.id))});let h=!1;l!==null&&l.startsWith(tO)&&(h=!!t.find(g=>g.id===l&&g.features&&g.features.length>=0));let p;if(h){const g=()=>{a(!0)},m=()=>{r(l)};p=[C.jsx(lu,{onClick:g,tooltipText:ge.get("Rename place group"),icon:C.jsx(GO,{})},"editPlaceGroup"),C.jsx(lu,{onClick:m,tooltipText:ge.get("Remove places"),icon:C.jsx(vU,{})},"removePlaceGroup")]}return C.jsx(K8e,{itemValue:o,setItemValue:c,validateItemValue:g=>g.trim().length>0,editMode:s,setEditMode:a,labelText:ge.get("Places"),select:d,actions:p})}const gnn=t=>({locale:t.controlState.locale,selectedPlaceGroupIds:t.controlState.selectedPlaceGroupIds,placeGroups:V4(t),selectedPlaceGroupsTitle:n_t(t)}),mnn={selectPlaceGroups:aKt,renameUserPlaceGroup:PQt,removeUserPlaceGroup:$Qt},vnn=Rn(gnn,mnn)(pnn),ynn=lt(C.jsx("path",{d:"M16.56 8.94 7.62 0 6.21 1.41l2.38 2.38-5.15 5.15c-.59.59-.59 1.54 0 2.12l5.5 5.5c.29.29.68.44 1.06.44s.77-.15 1.06-.44l5.5-5.5c.59-.58.59-1.53 0-2.12M5.21 10 10 5.21 14.79 10zM19 11.5s-2 2.17-2 3.5c0 1.1.9 2 2 2s2-.9 2-2c0-1.33-2-3.5-2-3.5M2 20h20v4H2z"}),"FormatColorFill"),O0={container:{display:"grid",gridTemplateColumns:"auto 120px",gridTemplateRows:"auto",gridTemplateAreas:"'colorLabel colorValue' 'opacityLabel opacityValue'",rowGap:1,columnGap:2.5,padding:1},colorLabel:{gridArea:"colorLabel",alignSelf:"center"},colorValue:{gridArea:"colorValue",alignSelf:"center",width:"100%",height:"22px",borderWidth:1,borderStyle:"solid",borderColor:"black"},opacityLabel:{gridArea:"opacityLabel",alignSelf:"center"},opacityValue:{gridArea:"opacityValue",alignSelf:"center",width:"100%"},colorMenuItem:{padding:"4px 8px 4px 8px"},colorMenuItemBox:{width:"104px",height:"18px"}},xnn=({anchorEl:t,setAnchorEl:e,isPoint:n,placeStyle:r,updatePlaceStyle:i})=>{const[o,s]=D.useState(null);function a(l){s(l.currentTarget)}return C.jsxs(C.Fragment,{children:[C.jsx(K1,{open:t!==null,anchorEl:t,onClose:()=>e(null),anchorOrigin:{vertical:"bottom",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"left"},children:C.jsxs(ot,{sx:O0.container,children:[C.jsx(Jt,{sx:O0.colorLabel,children:ge.get("Color")}),C.jsx(Jt,{sx:O0.opacityLabel,color:n?"text.secondary":"text.primary",children:ge.get("Opacity")}),C.jsx(ot,{sx:O0.colorValue,style:{backgroundColor:r.color},onClick:a}),C.jsx(QC,{sx:O0.opacityValue,disabled:n,size:"small",min:0,max:1,step:.05,value:r.opacity,onChange:(l,c)=>i({...r,opacity:c})})]})}),C.jsx(Z1,{open:!!o,anchorEl:o,onClose:()=>s(null),children:Dee.map(([l,c])=>C.jsx(_i,{selected:r.color===l,sx:O0.colorMenuItem,onClick:()=>i({...r,color:l}),children:C.jsx(Rt,{title:l,children:C.jsx(ot,{sx:{...O0.colorMenuItemBox,backgroundColor:l}})})},l))})]})},bnn={select:{minWidth:"5em"}};function wnn({selectPlace:t,placeLabels:e,selectedPlaceId:n,selectedPlaceGroupIds:r,selectedPlaceInfo:i,renameUserPlace:o,restyleUserPlace:s,removeUserPlace:a,places:l,locateSelectedPlace:c}){const[u,f]=D.useState(!1),[d,h]=D.useState(null);l=l||[],e=e||[],n=n||"",r=r||[];const p=r.length===1?r[0]:null,g=l.findIndex(S=>S.id===n),m=g>=0?e[g]:"",v=S=>{o(p,n,S)},y=S=>{s(p,n,S)},x=S=>{t(S.target.value||null,l,!0)},b=C.jsx(Hg,{variant:"standard",value:n,onChange:x,input:C.jsx(Rg,{name:"place",id:"place-select"}),displayEmpty:!0,name:"place",sx:bnn.select,disabled:l.length===0,children:l.map((S,O)=>C.jsx(_i,{value:S.id,selected:S.id===n,children:e[O]},S.id))}),w=p!==null&&p.startsWith(tO)&&n!=="";let _=[C.jsx(lu,{onClick:c,tooltipText:ge.get("Locate place in map"),icon:C.jsx(X8e,{})},"locatePlace")];if(!u&&w){const S=()=>{f(!0)},O=E=>{h(E.currentTarget)},k=()=>{a(p,n,l)};_=[C.jsx(lu,{onClick:S,tooltipText:ge.get("Rename place"),icon:C.jsx(GO,{})},"editButton"),C.jsx(lu,{onClick:O,tooltipText:ge.get("Style place"),icon:C.jsx(ynn,{})},"styleButton"),C.jsx(lu,{onClick:k,tooltipText:ge.get("Remove place"),icon:C.jsx(vU,{})},"removeButton")].concat(_)}return C.jsxs(C.Fragment,{children:[C.jsx(K8e,{itemValue:m,setItemValue:v,validateItemValue:S=>S.trim().length>0,editMode:u,setEditMode:f,labelText:ge.get("Place"),select:b,actions:_}),i&&C.jsx(xnn,{anchorEl:d,setAnchorEl:h,isPoint:i.place.geometry.type==="Point",placeStyle:i,updatePlaceStyle:y})]})}const _nn=t=>({locale:t.controlState.locale,datasets:t.dataState.datasets,selectedPlaceGroupIds:t.controlState.selectedPlaceGroupIds,selectedPlaceId:t.controlState.selectedPlaceId,selectedPlaceInfo:eR(t),places:JM(t),placeLabels:s_t(t)}),Snn={selectPlace:nU,renameUserPlace:MQt,restyleUserPlace:DQt,removeUserPlace:LQt,locateSelectedPlace:iKt,openDialog:_b},Cnn=Rn(_nn,Snn)(wnn),Onn=lt(C.jsx("path",{d:"M12 2C8.14 2 5 5.14 5 9c0 5.25 7 13 7 13s7-7.75 7-13c0-3.86-3.14-7-7-7m4 8h-3v3h-2v-3H8V8h3V5h2v3h3z"}),"AddLocation"),Enn=lt(C.jsx("path",{d:"M11.71 17.99C8.53 17.84 6 15.22 6 12c0-3.31 2.69-6 6-6 3.22 0 5.84 2.53 5.99 5.71l-2.1-.63C15.48 9.31 13.89 8 12 8c-2.21 0-4 1.79-4 4 0 1.89 1.31 3.48 3.08 3.89zM22 12c0 .3-.01.6-.04.9l-1.97-.59c.01-.1.01-.21.01-.31 0-4.42-3.58-8-8-8s-8 3.58-8 8 3.58 8 8 8c.1 0 .21 0 .31-.01l.59 1.97c-.3.03-.6.04-.9.04-5.52 0-10-4.48-10-10S6.48 2 12 2s10 4.48 10 10m-3.77 4.26L22 15l-10-3 3 10 1.26-3.77 4.27 4.27 1.98-1.98z"}),"AdsClick"),Tnn=lt([C.jsx("path",{d:"m12 2-5.5 9h11z"},"0"),C.jsx("circle",{cx:"17.5",cy:"17.5",r:"4.5"},"1"),C.jsx("path",{d:"M3 13.5h8v8H3z"},"2")],"Category"),knn=lt(C.jsx("circle",{cx:"12",cy:"12",r:"8"}),"FiberManualRecord"),Ann=lt(C.jsx("path",{d:"M19.35 10.04C18.67 6.59 15.64 4 12 4 9.11 4 6.6 5.64 5.35 8.04 2.34 8.36 0 10.91 0 14c0 3.31 2.69 6 6 6h13c2.76 0 5-2.24 5-5 0-2.64-2.05-4.78-4.65-4.96M14 13v4h-4v-4H7l5-5 5 5z"}),"CloudUpload"),Pnn=oa(Gg)(({theme:t})=>({marginTop:t.spacing(2),marginLeft:t.spacing(1),marginRight:t.spacing(2)}));function Mnn({mapInteraction:t,setMapInteraction:e}){function n(r,i){e(i!==null?i:"Select")}return C.jsx(Pnn,{variant:"standard",children:C.jsxs(KC,{size:"small",value:t,exclusive:!0,onChange:n,children:[C.jsx(yr,{value:"Select",size:"small",sx:ol.toggleButton,children:C.jsx(Rt,{arrow:!0,title:ge.get("Select a place in map"),children:C.jsx(Enn,{})})},0),C.jsx(yr,{value:"Point",size:"small",sx:ol.toggleButton,children:C.jsx(Rt,{arrow:!0,title:ge.get("Add a point location in map"),children:C.jsx(Onn,{})})},1),C.jsx(yr,{value:"Polygon",size:"small",sx:ol.toggleButton,children:C.jsx(Rt,{arrow:!0,title:ge.get("Draw a polygon area in map"),children:C.jsx(Tnn,{})})},2),C.jsx(yr,{value:"Circle",size:"small",sx:ol.toggleButton,children:C.jsx(Rt,{arrow:!0,title:ge.get("Draw a circular area in map"),children:C.jsx(knn,{})})},3),C.jsx(yr,{value:"Geometry",size:"small",sx:ol.toggleButton,children:C.jsx(Rt,{arrow:!0,title:ge.get("Import places"),children:C.jsx(Ann,{})})},4)]})})}const Rnn=t=>({mapInteraction:t.controlState.mapInteraction}),Dnn={setMapInteraction:FUe},Inn=Rn(Rnn,Dnn)(Mnn);var Rxe=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},tD=(typeof window>"u"?"undefined":Rxe(window))==="object"&&(typeof document>"u"?"undefined":Rxe(document))==="object"&&document.nodeType===9,Lnn={}.constructor;function uQ(t){if(t==null||typeof t!="object")return t;if(Array.isArray(t))return t.map(uQ);if(t.constructor!==Lnn)return t;var e={};for(var n in t)e[n]=uQ(t[n]);return e}function Zae(t,e,n){t===void 0&&(t="unnamed");var r=n.jss,i=uQ(e),o=r.plugins.onCreateRule(t,i,n);return o||(t[0],null)}var Dxe=function(e,n){for(var r="",i=0;i<+~=|^:(),"'`\s])/g,Ixe=typeof CSS<"u"&&CSS.escape,Jae=function(t){return Ixe?Ixe(t):t.replace($nn,"\\$1")},Z8e=function(){function t(n,r,i){this.type="style",this.isProcessed=!1;var o=i.sheet,s=i.Renderer;this.key=n,this.options=i,this.style=r,o?this.renderer=o.renderer:s&&(this.renderer=new s)}var e=t.prototype;return e.prop=function(r,i,o){if(i===void 0)return this.style[r];var s=o?o.force:!1;if(!s&&this.style[r]===i)return this;var a=i;(!o||o.process!==!1)&&(a=this.options.jss.plugins.onChangeValue(i,r,this));var l=a==null||a===!1,c=r in this.style;if(l&&!c&&!s)return this;var u=l&&c;if(u?delete this.style[r]:this.style[r]=a,this.renderable&&this.renderer)return u?this.renderer.removeProperty(this.renderable,r):this.renderer.setProperty(this.renderable,r,a),this;var f=this.options.sheet;return f&&f.attached,this},t}(),fQ=function(t){AM(e,t);function e(r,i,o){var s;s=t.call(this,r,i,o)||this;var a=o.selector,l=o.scoped,c=o.sheet,u=o.generateId;return a?s.selectorText=a:l!==!1&&(s.id=u(bt(bt(s)),c),s.selectorText="."+Jae(s.id)),s}var n=e.prototype;return n.applyTo=function(i){var o=this.renderer;if(o){var s=this.toJSON();for(var a in s)o.setProperty(i,a,s[a])}return this},n.toJSON=function(){var i={};for(var o in this.style){var s=this.style[o];typeof s!="object"?i[o]=s:Array.isArray(s)&&(i[o]=Gx(s))}return i},n.toString=function(i){var o=this.options.sheet,s=o?o.options.link:!1,a=s?ve({},i,{allowEmpty:!0}):i;return nP(this.selectorText,this.style,a)},Pn(e,[{key:"selector",set:function(i){if(i!==this.selectorText){this.selectorText=i;var o=this.renderer,s=this.renderable;if(!(!s||!o)){var a=o.setSelector(s,i);a||o.replaceRule(s,this)}}},get:function(){return this.selectorText}}]),e}(Z8e),Fnn={onCreateRule:function(e,n,r){return e[0]==="@"||r.parent&&r.parent.type==="keyframes"?null:new fQ(e,n,r)}},S9={indent:1,children:!0},Nnn=/@([\w-]+)/,znn=function(){function t(n,r,i){this.type="conditional",this.isProcessed=!1,this.key=n;var o=n.match(Nnn);this.at=o?o[1]:"unknown",this.query=i.name||"@"+this.at,this.options=i,this.rules=new yU(ve({},i,{parent:this}));for(var s in r)this.rules.add(s,r[s]);this.rules.process()}var e=t.prototype;return e.getRule=function(r){return this.rules.get(r)},e.indexOf=function(r){return this.rules.indexOf(r)},e.addRule=function(r,i,o){var s=this.rules.add(r,i,o);return s?(this.options.jss.plugins.onProcessRule(s),s):null},e.replaceRule=function(r,i,o){var s=this.rules.replace(r,i,o);return s&&this.options.jss.plugins.onProcessRule(s),s},e.toString=function(r){r===void 0&&(r=S9);var i=HO(r),o=i.linebreak;if(r.indent==null&&(r.indent=S9.indent),r.children==null&&(r.children=S9.children),r.children===!1)return this.query+" {}";var s=this.rules.toString(r);return s?this.query+" {"+o+s+o+"}":""},t}(),jnn=/@container|@media|@supports\s+/,Bnn={onCreateRule:function(e,n,r){return jnn.test(e)?new znn(e,n,r):null}},C9={indent:1,children:!0},Unn=/@keyframes\s+([\w-]+)/,dQ=function(){function t(n,r,i){this.type="keyframes",this.at="@keyframes",this.isProcessed=!1;var o=n.match(Unn);o&&o[1]?this.name=o[1]:this.name="noname",this.key=this.type+"-"+this.name,this.options=i;var s=i.scoped,a=i.sheet,l=i.generateId;this.id=s===!1?this.name:Jae(l(this,a)),this.rules=new yU(ve({},i,{parent:this}));for(var c in r)this.rules.add(c,r[c],ve({},i,{parent:this}));this.rules.process()}var e=t.prototype;return e.toString=function(r){r===void 0&&(r=C9);var i=HO(r),o=i.linebreak;if(r.indent==null&&(r.indent=C9.indent),r.children==null&&(r.children=C9.children),r.children===!1)return this.at+" "+this.id+" {}";var s=this.rules.toString(r);return s&&(s=""+o+s+o),this.at+" "+this.id+" {"+s+"}"},t}(),Wnn=/@keyframes\s+/,Vnn=/\$([\w-]+)/g,hQ=function(e,n){return typeof e=="string"?e.replace(Vnn,function(r,i){return i in n?n[i]:r}):e},Lxe=function(e,n,r){var i=e[n],o=hQ(i,r);o!==i&&(e[n]=o)},Gnn={onCreateRule:function(e,n,r){return typeof e=="string"&&Wnn.test(e)?new dQ(e,n,r):null},onProcessStyle:function(e,n,r){return n.type!=="style"||!r||("animation-name"in e&&Lxe(e,"animation-name",r.keyframes),"animation"in e&&Lxe(e,"animation",r.keyframes)),e},onChangeValue:function(e,n,r){var i=r.options.sheet;if(!i)return e;switch(n){case"animation":return hQ(e,i.keyframes);case"animation-name":return hQ(e,i.keyframes);default:return e}}},Hnn=function(t){AM(e,t);function e(){return t.apply(this,arguments)||this}var n=e.prototype;return n.toString=function(i){var o=this.options.sheet,s=o?o.options.link:!1,a=s?ve({},i,{allowEmpty:!0}):i;return nP(this.key,this.style,a)},e}(Z8e),qnn={onCreateRule:function(e,n,r){return r.parent&&r.parent.type==="keyframes"?new Hnn(e,n,r):null}},Xnn=function(){function t(n,r,i){this.type="font-face",this.at="@font-face",this.isProcessed=!1,this.key=n,this.style=r,this.options=i}var e=t.prototype;return e.toString=function(r){var i=HO(r),o=i.linebreak;if(Array.isArray(this.style)){for(var s="",a=0;a=this.index){i.push(r);return}for(var s=0;so){i.splice(s,0,r);return}}},e.reset=function(){this.registry=[]},e.remove=function(r){var i=this.registry.indexOf(r);this.registry.splice(i,1)},e.toString=function(r){for(var i=r===void 0?{}:r,o=i.attached,s=Dt(i,["attached"]),a=HO(s),l=a.linebreak,c="",u=0;u-1?i.substr(0,o-1):i;e.style.setProperty(n,s,o>-1?"important":"")}}catch{return!1}return!0},arn=function(e,n){try{e.attributeStyleMap?e.attributeStyleMap.delete(n):e.style.removeProperty(n)}catch{}},lrn=function(e,n){return e.selectorText=n,e.selectorText===n},tWe=eWe(function(){return document.querySelector("head")});function crn(t,e){for(var n=0;ne.index&&r.options.insertionPoint===e.insertionPoint)return r}return null}function urn(t,e){for(var n=t.length-1;n>=0;n--){var r=t[n];if(r.attached&&r.options.insertionPoint===e.insertionPoint)return r}return null}function frn(t){for(var e=tWe(),n=0;n0){var n=crn(e,t);if(n&&n.renderer)return{parent:n.renderer.element.parentNode,node:n.renderer.element};if(n=urn(e,t),n&&n.renderer)return{parent:n.renderer.element.parentNode,node:n.renderer.element.nextSibling}}var r=t.insertionPoint;if(r&&typeof r=="string"){var i=frn(r);if(i)return{parent:i.parentNode,node:i.nextSibling}}return!1}function hrn(t,e){var n=e.insertionPoint,r=drn(e);if(r!==!1&&r.parent){r.parent.insertBefore(t,r.node);return}if(n&&typeof n.nodeType=="number"){var i=n,o=i.parentNode;o&&o.insertBefore(t,i.nextSibling);return}tWe().appendChild(t)}var prn=eWe(function(){var t=document.querySelector('meta[property="csp-nonce"]');return t?t.getAttribute("content"):null}),jxe=function(e,n,r){try{"insertRule"in e?e.insertRule(n,r):"appendRule"in e&&e.appendRule(n)}catch{return!1}return e.cssRules[r]},Bxe=function(e,n){var r=e.cssRules.length;return n===void 0||n>r?r:n},grn=function(){var e=document.createElement("style");return e.textContent=` -`,e},mrn=function(){function t(n){this.getPropertyValue=orn,this.setProperty=srn,this.removeProperty=arn,this.setSelector=lrn,this.hasInsertedRules=!1,this.cssRules=[],n&&wk.add(n),this.sheet=n;var r=this.sheet?this.sheet.options:{},i=r.media,o=r.meta,s=r.element;this.element=s||grn(),this.element.setAttribute("data-jss",""),i&&this.element.setAttribute("media",i),o&&this.element.setAttribute("data-meta",o);var a=prn();a&&this.element.setAttribute("nonce",a)}var e=t.prototype;return e.attach=function(){if(!(this.element.parentNode||!this.sheet)){hrn(this.element,this.sheet.options);var r=!!(this.sheet&&this.sheet.deployed);this.hasInsertedRules&&r&&(this.hasInsertedRules=!1,this.deploy())}},e.detach=function(){if(this.sheet){var r=this.element.parentNode;r&&r.removeChild(this.element),this.sheet.options.link&&(this.cssRules=[],this.element.textContent=` + */var hle=Symbol.for("react.element"),ple=Symbol.for("react.portal"),sU=Symbol.for("react.fragment"),aU=Symbol.for("react.strict_mode"),lU=Symbol.for("react.profiler"),cU=Symbol.for("react.provider"),uU=Symbol.for("react.context"),Ken=Symbol.for("react.server_context"),fU=Symbol.for("react.forward_ref"),dU=Symbol.for("react.suspense"),hU=Symbol.for("react.suspense_list"),pU=Symbol.for("react.memo"),gU=Symbol.for("react.lazy"),Zen=Symbol.for("react.offscreen"),mWe;mWe=Symbol.for("react.module.reference");function Vu(t){if(typeof t=="object"&&t!==null){var e=t.$$typeof;switch(e){case hle:switch(t=t.type,t){case sU:case lU:case aU:case dU:case hU:return t;default:switch(t=t&&t.$$typeof,t){case Ken:case uU:case fU:case gU:case pU:case cU:return t;default:return e}}case ple:return e}}}Sr.ContextConsumer=uU;Sr.ContextProvider=cU;Sr.Element=hle;Sr.ForwardRef=fU;Sr.Fragment=sU;Sr.Lazy=gU;Sr.Memo=pU;Sr.Portal=ple;Sr.Profiler=lU;Sr.StrictMode=aU;Sr.Suspense=dU;Sr.SuspenseList=hU;Sr.isAsyncMode=function(){return!1};Sr.isConcurrentMode=function(){return!1};Sr.isContextConsumer=function(t){return Vu(t)===uU};Sr.isContextProvider=function(t){return Vu(t)===cU};Sr.isElement=function(t){return typeof t=="object"&&t!==null&&t.$$typeof===hle};Sr.isForwardRef=function(t){return Vu(t)===fU};Sr.isFragment=function(t){return Vu(t)===sU};Sr.isLazy=function(t){return Vu(t)===gU};Sr.isMemo=function(t){return Vu(t)===pU};Sr.isPortal=function(t){return Vu(t)===ple};Sr.isProfiler=function(t){return Vu(t)===lU};Sr.isStrictMode=function(t){return Vu(t)===aU};Sr.isSuspense=function(t){return Vu(t)===dU};Sr.isSuspenseList=function(t){return Vu(t)===hU};Sr.isValidElementType=function(t){return typeof t=="string"||typeof t=="function"||t===sU||t===lU||t===aU||t===dU||t===hU||t===Zen||typeof t=="object"&&t!==null&&(t.$$typeof===gU||t.$$typeof===pU||t.$$typeof===cU||t.$$typeof===uU||t.$$typeof===fU||t.$$typeof===mWe||t.getModuleId!==void 0)};Sr.typeOf=Vu;gWe.exports=Sr;var Jen=gWe.exports;const etn=sn(Jen);function ttn(t){const e=t&&typeof t=="object"&&t.type==="text"?t.value||"":t;return typeof e=="string"&&e.replace(/[ \t\n\f\r]/g,"")===""}function ntn(t){return t.join(" ").trim()}function rtn(t,e){const n={};return(t[t.length-1]===""?[...t,""]:t).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}var gle={exports:{}},Kxe=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,itn=/\n/g,otn=/^\s*/,stn=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,atn=/^:\s*/,ltn=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,ctn=/^[;\s]*/,utn=/^\s+|\s+$/g,ftn=` +`,Zxe="/",Jxe="*",ex="",dtn="comment",htn="declaration",ptn=function(t,e){if(typeof t!="string")throw new TypeError("First argument must be a string");if(!t)return[];e=e||{};var n=1,r=1;function i(p){var g=p.match(itn);g&&(n+=g.length);var m=p.lastIndexOf(ftn);r=~m?p.length-m:r+p.length}function o(){var p={line:n,column:r};return function(g){return g.position=new s(p),c(),g}}function s(p){this.start=p,this.end={line:n,column:r},this.source=e.source}s.prototype.content=t;function a(p){var g=new Error(e.source+":"+n+":"+r+": "+p);if(g.reason=p,g.filename=e.source,g.line=n,g.column=r,g.source=t,!e.silent)throw g}function l(p){var g=p.exec(t);if(g){var m=g[0];return i(m),t=t.slice(m.length),g}}function c(){l(otn)}function u(p){var g;for(p=p||[];g=f();)g!==!1&&p.push(g);return p}function f(){var p=o();if(!(Zxe!=t.charAt(0)||Jxe!=t.charAt(1))){for(var g=2;ex!=t.charAt(g)&&(Jxe!=t.charAt(g)||Zxe!=t.charAt(g+1));)++g;if(g+=2,ex===t.charAt(g-1))return a("End of comment missing");var m=t.slice(2,g-2);return r+=2,i(m),t=t.slice(g),r+=2,p({type:dtn,comment:m})}}function d(){var p=o(),g=l(stn);if(g){if(f(),!l(atn))return a("property missing ':'");var m=l(ltn),v=p({type:htn,property:ebe(g[0].replace(Kxe,ex)),value:m?ebe(m[0].replace(Kxe,ex)):ex});return l(ctn),v}}function h(){var p=[];u(p);for(var g;g=d();)g!==!1&&(p.push(g),u(p));return p}return c(),h()};function ebe(t){return t?t.replace(utn,ex):ex}var gtn=ptn;function vWe(t,e){var n=null;if(!t||typeof t!="string")return n;for(var r,i=gtn(t),o=typeof e=="function",s,a,l=0,c=i.length;l0?de.createElement(h,l,f):de.createElement(h,l)}function btn(t){let e=-1;for(;++e for more info)`),delete hL[o]}const e=FKt().use(HJt).use(t.remarkPlugins||[]).use($en,{...t.remarkRehypeOptions,allowDangerousHtml:!0}).use(t.rehypePlugins||[]).use(Qen,t),n=new F8e;typeof t.children=="string"?n.value=t.children:t.children!==void 0&&t.children!==null&&console.warn(`[react-markdown] Warning: please pass a string as \`children\` (not: \`${t.children}\`)`);const r=e.runSync(e.parse(n),n);if(r.type!=="root")throw new TypeError("Expected a `root` node");let i=de.createElement(de.Fragment,{},yWe({options:t,schema:Xen,listDepth:0},r));return t.className&&(i=de.createElement("div",{className:t.className},i)),i}mU.propTypes={children:pe.string,className:pe.string,allowElement:pe.func,allowedElements:pe.arrayOf(pe.string),disallowedElements:pe.arrayOf(pe.string),unwrapDisallowed:pe.bool,remarkPlugins:pe.arrayOf(pe.oneOfType([pe.object,pe.func,pe.arrayOf(pe.oneOfType([pe.bool,pe.string,pe.object,pe.func,pe.arrayOf(pe.any)]))])),rehypePlugins:pe.arrayOf(pe.oneOfType([pe.object,pe.func,pe.arrayOf(pe.oneOfType([pe.bool,pe.string,pe.object,pe.func,pe.arrayOf(pe.any)]))])),sourcePos:pe.bool,rawSourcePos:pe.bool,skipHtml:pe.bool,includeElementIndex:pe.bool,transformLinkUri:pe.oneOfType([pe.func,pe.bool]),linkTarget:pe.oneOfType([pe.func,pe.string]),transformImageUri:pe.func,components:pe.object};const WO=ct(C.jsx("path",{d:"M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"}),"Close");function xWe(t){const[e,n]=D.useState();return D.useEffect(()=>{t?fetch(t).then(r=>r.text()).then(r=>n(r)).catch(r=>{console.error(r)}):n(void 0)},[t]),e}const F9={dialog:t=>({backgroundColor:t.palette.grey[200]}),appBar:{position:"relative"},title:t=>({marginLeft:t.spacing(2),flex:1})},Etn=ra("div")(({theme:t})=>({marginTop:t.spacing(4),marginLeft:t.spacing(40),marginRight:t.spacing(40)})),Ttn=de.forwardRef(function(e,n){return C.jsx($at,{direction:"up",ref:n,...e})}),nbe=({title:t,text:e,href:n,open:r,onClose:i})=>{let o=xWe(n);return o&&e?o=o.replace("${text}",e):o||(o=e),C.jsxs(ed,{fullScreen:!0,open:r,onClose:i,TransitionComponent:Ttn,PaperProps:{tabIndex:-1},children:[C.jsx(XAe,{sx:F9.appBar,children:C.jsxs(b4,{children:[C.jsx(Ht,{edge:"start",color:"inherit",onClick:i,"aria-label":"close",size:"large",children:C.jsx(WO,{})}),C.jsx(Jt,{variant:"h6",sx:F9.title,children:t})]})}),C.jsx(zf,{sx:F9.dialog,children:C.jsx(Etn,{children:C.jsx(mU,{children:o||"",linkTarget:"_blank"})})})]})},rbe=ct(C.jsx("path",{d:"M12 12c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4m0 2c-2.67 0-8 1.34-8 4v2h16v-2c0-2.66-5.33-4-8-4"}),"Person"),ktn=({userInfo:t})=>C.jsxs(rW,{container:!0,justifyContent:"center",spacing:1,children:[C.jsx(rW,{item:!0,children:C.jsx("img",{src:t.picture,width:84,alt:me.get("User Profile")})}),C.jsx(rW,{item:!0,children:C.jsx(Tl,{elevation:3,children:C.jsxs(DM,{children:[C.jsx(P_,{children:C.jsx(du,{primary:t.name,secondary:me.get("User name")})}),C.jsx(_h,{light:!0}),C.jsx(P_,{children:C.jsx(du,{primary:`${t.email} (${t.email_verified?me.get("verified"):me.get("not verified")})`,secondary:me.get("E-mail")})}),C.jsx(_h,{light:!0}),C.jsx(P_,{children:C.jsx(du,{primary:t.nickname,secondary:me.get("Nickname")})})]})})})]}),p2={imageAvatar:{width:32,height:32,color:"#fff",backgroundColor:Tx[300]},letterAvatar:{width:32,height:32,color:"#fff",backgroundColor:Tx[300]},signInProgress:{color:Tx[300],position:"absolute",top:"50%",left:"50%",zIndex:1,marginTop:-12,marginLeft:-12},iconButton:{padding:0}},Atn=ra("div")(({theme:t})=>({margin:t.spacing(1),position:"relative"})),Ptn=({updateAccessToken:t})=>{const e=nht(),[n,r]=D.useState(null),[i,o]=D.useState(!1);D.useEffect(()=>{e.user&&e.user.access_token?t(e.user.access_token):t(null)},[e.user,t]);const s=()=>{c(),o(!0)},a=()=>{o(!1)},l=d=>{r(d.currentTarget)},c=()=>{r(null)},u=()=>{e.signinRedirect().then(()=>{}).catch(d=>{console.error(d)})},f=()=>{c(),e.signoutRedirect().then(()=>{}).catch(d=>{console.error(d)})};if(e.user){const d=e.user.profile;let h,p=C.jsx(rbe,{});if(!d)h=C.jsx(eW,{sx:p2.letterAvatar,children:"?"});else if(d.picture)h=C.jsx(eW,{sx:p2.imageAvatar,src:d.picture,alt:d.name});else{const g=d.given_name||d.name||d.nickname,m=d.family_name;let v=null;g&&m?v=g[0]+m[0]:g?v=g[0]:m&&(v=m[0]),v!==null&&(p=v.toUpperCase()),h=C.jsx(eW,{sx:p2.letterAvatar,children:p})}return C.jsxs(D.Fragment,{children:[C.jsx(Ht,{onClick:l,"aria-controls":"user-menu","aria-haspopup":"true",size:"small",sx:p2.iconButton,children:h}),C.jsxs($y,{id:"user-menu",anchorEl:n,keepMounted:!0,open:!!n,onClose:c,children:[C.jsx(ti,{onClick:s,children:me.get("Profile")}),C.jsx(ti,{onClick:f,children:me.get("Log out")})]}),C.jsxs(ed,{open:i,keepMounted:!0,onClose:a,"aria-labelledby":"alert-dialog-slide-title","aria-describedby":"alert-dialog-slide-description",children:[C.jsx(Iy,{id:"alert-dialog-slide-title",children:me.get("User Profile")}),C.jsx(zf,{children:C.jsx(ktn,{userInfo:e.user.profile})}),C.jsx(Yb,{children:C.jsx(Vr,{onClick:a,children:"OK"})})]})]})}else{let d=C.jsx(Ht,{onClick:e.isLoading?void 0:u,size:"small",children:C.jsx(rbe,{})});return e.isLoading&&(d=C.jsxs(Atn,{children:[d,C.jsx(Dy,{size:24,sx:p2.signInProgress})]})),d}},Mtn=t=>Pn.instance.authClient?C.jsx(Ptn,{...t}):null,Rtn=Mtn,bWe="UPDATE_ACCESS_TOKEN";function Dtn(t){return(e,n)=>{const r=n().userAuthState.accessToken;r!==t&&(e(Itn(t)),(t===null||r===null)&&e(EUe()))}}function Itn(t){return{type:bWe,accessToken:t}}const Ltn=t=>({}),$tn={updateAccessToken:Dtn},Ftn=Rn(Ltn,$tn)(Rtn),Ntn=t=>({locale:t.controlState.locale,appName:Pn.instance.branding.appBarTitle,allowRefresh:Pn.instance.branding.allowRefresh}),ztn={openDialog:_1,updateResources:OUe},jtn={appBar:t=>({zIndex:t.zIndex.drawer+1,transition:t.transitions.create(["width","margin"],{easing:t.transitions.easing.sharp,duration:t.transitions.duration.leavingScreen})})},Btn=be("a")(()=>({display:"flex",alignItems:"center"})),Utn=be("img")(({theme:t})=>({marginLeft:t.spacing(1)})),C0={toolbar:t=>({backgroundColor:Pn.instance.branding.headerBackgroundColor,paddingRight:t.spacing(1)}),logo:t=>({marginLeft:t.spacing(1)}),title:t=>({flexGrow:1,marginLeft:t.spacing(1),...Pn.instance.branding.headerTitleStyle}),imageAvatar:{width:24,height:24,color:"#fff",backgroundColor:Tx[300]},letterAvatar:{width:24,height:24,color:"#fff",backgroundColor:Tx[300]},signInWrapper:t=>({margin:t.spacing(1),position:"relative"}),signInProgress:{color:Tx[300],position:"absolute",top:"50%",left:"50%",zIndex:1,marginTop:"-12px",marginLeft:"-12px"},iconButton:t=>({marginLeft:t.spacing(2),...Pn.instance.branding.headerIconStyle})},Wtn=({appName:t,openDialog:e,allowRefresh:n,updateResources:r})=>{const[i,o]=D.useState(!1),[s,a]=D.useState(!1),[l,c]=D.useState(!1),u=D.useRef(null),f=D.useMemo(()=>Q_t(),[]),d=()=>{e("settings")},h=()=>{a(!0)},p=()=>{a(!1)},g=()=>{a(!1),window.open("https://xcube-dev.github.io/xcube-viewer/","Manual")},m=()=>{c(!0)},v=()=>{c(!1)},y=()=>{o(!0)},x=()=>{o(!1)};return C.jsxs(XAe,{position:"absolute",sx:jtn.appBar,elevation:0,children:[C.jsxs(b4,{disableGutters:!0,sx:C0.toolbar,variant:"dense",children:[C.jsx(Btn,{href:Pn.instance.branding.organisationUrl||"",target:"_blank",rel:"noreferrer",children:C.jsx(Utn,{src:Pn.instance.branding.logoImage,width:Pn.instance.branding.logoWidth,alt:"xcube logo"})}),C.jsx(Jt,{component:"h1",variant:"h6",color:"inherit",noWrap:!0,sx:C0.title,children:t}),C.jsx(Ftn,{}),n&&C.jsx(Lt,{arrow:!0,title:me.get("Refresh"),children:C.jsx(Ht,{onClick:r,size:"small",sx:C0.iconButton,children:C.jsx(XPe,{})})}),Pn.instance.branding.allowDownloads&&C.jsx(Lt,{arrow:!0,title:me.get("Export data"),children:C.jsx(Ht,{onClick:()=>e("export"),size:"small",sx:C0.iconButton,children:C.jsx(YPe,{})})}),C.jsx(Lt,{arrow:!0,title:me.get("Help"),children:C.jsx(Ht,{onClick:h,size:"small",sx:C0.iconButton,ref:u,children:C.jsx(HPe,{})})}),C.jsx(Lt,{arrow:!0,title:me.get("Imprint"),children:C.jsx(Ht,{onClick:y,size:"small",sx:C0.iconButton,children:C.jsx(uht,{})})}),C.jsx(Lt,{arrow:!0,title:me.get("Settings"),children:C.jsx(Ht,{onClick:d,size:"small",sx:C0.iconButton,children:C.jsx(qPe,{})})})]}),C.jsx(nbe,{title:me.get("Imprint"),href:"docs/imprint.md",open:i,onClose:x}),C.jsx(nbe,{title:me.get("Developer Reference"),href:me.get("docs/dev-reference.en.md"),text:f,open:l,onClose:v}),C.jsxs($y,{anchorEl:u.current,open:s,onClose:p,children:[C.jsx(ti,{onClick:g,children:"Documentation"}),C.jsx(ti,{onClick:m,children:"Developer Reference"})]})]})},Vtn=Rn(Ntn,ztn)(Wtn),Gtn=ra("form")(({theme:t})=>({display:"flex",flexWrap:"wrap",paddingTop:t.spacing(1),paddingLeft:t.spacing(1),paddingRight:t.spacing(1),flexGrow:0}));function Htn({children:t}){return C.jsx(Gtn,{autoComplete:"off",children:t})}const wWe=ct(C.jsx("path",{d:"M19.3 16.9c.4-.7.7-1.5.7-2.4 0-2.5-2-4.5-4.5-4.5S11 12 11 14.5s2 4.5 4.5 4.5c.9 0 1.7-.3 2.4-.7l3.2 3.2 1.4-1.4zm-3.8.1c-1.4 0-2.5-1.1-2.5-2.5s1.1-2.5 2.5-2.5 2.5 1.1 2.5 2.5-1.1 2.5-2.5 2.5M12 20v2C6.48 22 2 17.52 2 12S6.48 2 12 2c4.84 0 8.87 3.44 9.8 8h-2.07c-.64-2.46-2.4-4.47-4.73-5.41V5c0 1.1-.9 2-2 2h-2v2c0 .55-.45 1-1 1H8v2h2v3H9l-4.79-4.79C4.08 10.79 4 11.38 4 12c0 4.41 3.59 8 8 8"}),"TravelExplore"),lu=({sx:t,className:e,disabled:n,onClick:r,icon:i,tooltipText:o,toggle:s,value:a,selected:l})=>{const c=f=>{s?r(f,a):r(f)},u=o?C.jsx(Lt,{arrow:!0,title:o,children:i}):i;return s?C.jsx(yr,{sx:{padding:.3,...t},className:e,disabled:n,size:"small",onClick:c,value:a||"",selected:l,children:u}):C.jsx(Ht,{sx:t,className:e,disabled:n,size:"small",onClick:c,children:u})},qtn=ra(Ug)(({theme:t})=>({marginRight:t.spacing(1)}));function tP({label:t,control:e,actions:n}){return C.jsx(qtn,{variant:"standard",children:C.jsxs(ot,{children:[t,e,n]})})}function Xtn({selectedDatasetId:t,datasets:e,selectDataset:n,locateSelectedDataset:r}){const i=D.useMemo(()=>e.sort((d,h)=>{const p=d.groupTitle||"zzz",g=h.groupTitle||"zzz",m=p.localeCompare(g);return m!==0?m:d.title.localeCompare(h.title)}),[e]),o=i.length>0&&!!i[0].groupTitle,s=d=>{const h=d.target.value||null;n(h,e,!0)};t=t||"",e=e||[];const a=C.jsx(Ly,{shrink:!0,htmlFor:"dataset-select",children:me.get("Dataset")}),l=[];let c;i.forEach(d=>{if(o){const h=d.groupTitle||me.get("Others");h!==c&&l.push(C.jsx(_h,{children:C.jsx(Jt,{fontSize:"small",color:"text.secondary",children:h})},h)),c=h}l.push(C.jsx(ti,{value:d.id,selected:d.id===t,children:d.title},d.id))});const u=C.jsx(Wg,{variant:"standard",value:t,onChange:s,input:C.jsx(Ag,{name:"dataset",id:"dataset-select"}),displayEmpty:!0,name:"dataset",children:l}),f=C.jsx(lu,{onClick:r,tooltipText:me.get("Locate dataset in map"),icon:C.jsx(wWe,{})});return C.jsx(tP,{label:a,control:u,actions:f})}const Ytn=t=>({locale:t.controlState.locale,selectedDatasetId:t.controlState.selectedDatasetId,datasets:t.dataState.datasets}),Qtn={selectDataset:qUe,locateSelectedDataset:ZQt},Ktn=Rn(Ytn,Qtn)(Xtn),CQ=ct(C.jsx("path",{d:"M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2m-5.97 4.06L14.09 6l1.41 1.41L16.91 6l1.06 1.06-1.41 1.41 1.41 1.41-1.06 1.06-1.41-1.4-1.41 1.41-1.06-1.06 1.41-1.41zm-6.78.66h5v1.5h-5zM11.5 16h-2v2H8v-2H6v-1.5h2v-2h1.5v2h2zm6.5 1.25h-5v-1.5h5zm0-2.5h-5v-1.5h5z"}),"Calculate"),_We=ct(C.jsx("path",{d:"M18 4H6v2l6.5 6L6 18v2h12v-3h-7l5-5-5-5h7z"}),"Functions"),OQ=ct(C.jsx("path",{fillRule:"evenodd",d:"M16 9V4h1c.55 0 1-.45 1-1s-.45-1-1-1H7c-.55 0-1 .45-1 1s.45 1 1 1h1v5c0 1.66-1.34 3-3 3v2h5.97v7l1 1 1-1v-7H19v-2c-1.66 0-3-1.34-3-3"}),"PushPin"),Ztn=ct(C.jsx("path",{d:"M23 8c0 1.1-.9 2-2 2-.18 0-.35-.02-.51-.07l-3.56 3.55c.05.16.07.34.07.52 0 1.1-.9 2-2 2s-2-.9-2-2c0-.18.02-.36.07-.52l-2.55-2.55c-.16.05-.34.07-.52.07s-.36-.02-.52-.07l-4.55 4.56c.05.16.07.33.07.51 0 1.1-.9 2-2 2s-2-.9-2-2 .9-2 2-2c.18 0 .35.02.51.07l4.56-4.55C8.02 9.36 8 9.18 8 9c0-1.1.9-2 2-2s2 .9 2 2c0 .18-.02.36-.07.52l2.55 2.55c.16-.05.34-.07.52-.07s.36.02.52.07l3.55-3.56C19.02 8.35 19 8.18 19 8c0-1.1.9-2 2-2s2 .9 2 2"}),"Timeline"),rl={toggleButton:{padding:.3}},q5="userVariablesDialog";function Jtn(){return{id:Uf("user"),name:"",title:"",units:"",expression:"",colorBarName:"bone",colorBarMin:0,colorBarMax:1,shape:[],dims:[],dtype:"float64",timeChunkSize:null,attrs:{}}}function enn(t){return{...t,id:Uf("user"),name:`${t.name}_copy`,title:t.title?`${t.title} Copy`:""}}const tnn={variables:!0,constants:!1,arrayOperators:!1,otherOperators:!1,arrayFunctions:!1,otherFunctions:!1},SWe=["variables","constants","arrayOperators","otherOperators","arrayFunctions","otherFunctions"],nnn={variables:"Variables",constants:"Constants",arrayOperators:"Array operators",otherOperators:"Other operators",arrayFunctions:"Array functions",otherFunctions:"Other functions"};function rnn({selectedDatasetId:t,selectedVariableName:e,selectedDataset2Id:n,selectedVariable2Name:r,variables:i,userVariablesAllowed:o,canAddTimeSeries:s,addTimeSeries:a,canAddStatistics:l,addStatistics:c,selectVariable:u,selectVariable2:f,openDialog:d}){const h=O=>{u(O.target.value||null)},p=()=>{d(q5)},g=()=>{a()},m=()=>{c()},v=t===n&&e===r,y=C.jsx(Ly,{shrink:!0,htmlFor:"variable-select",children:me.get("Variable")}),x=C.jsx(Wg,{variant:"standard",value:e||"",onChange:h,input:C.jsx(Ag,{name:"variable",id:"variable-select"}),displayEmpty:!0,name:"variable",renderValue:()=>ibe(i.find(O=>O.name===e)),children:(i||[]).map(O=>C.jsxs(ti,{value:O.name,selected:O.name===e,children:[XM(O)&&C.jsx(yPe,{children:C.jsx(CQ,{fontSize:"small"})}),C.jsx(du,{children:ibe(O)}),t===n&&O.name===r&&C.jsx(OQ,{fontSize:"small",color:"secondary"})]},O.name))}),b=o&&C.jsx(lu,{onClick:p,tooltipText:me.get("Create and manage user variables"),icon:C.jsx(CQ,{})},"userVariables"),w=C.jsx(lu,{disabled:!s,onClick:g,tooltipText:me.get("Show time-series diagram"),icon:C.jsx(Ztn,{})},"timeSeries"),_=C.jsx(lu,{disabled:!l,onClick:m,tooltipText:me.get("Add statistics"),icon:C.jsx(_We,{})},"statistics"),S=C.jsx(yr,{selected:v,value:"comparison",size:"small",sx:{...rl.toggleButton,marginLeft:.4},onClick:()=>f(t,e),children:C.jsx(Lt,{arrow:!0,title:me.get("Make it 2nd variable for comparison"),children:C.jsx(OQ,{fontSize:"small"})})},"variable2");return C.jsx(tP,{label:y,control:x,actions:[S,b,w,_]})}function ibe(t){return t?t.title||t.name:"?"}const inn=t=>({locale:t.controlState.locale,selectedDatasetId:t.controlState.selectedDatasetId,selectedVariableName:t.controlState.selectedVariableName,selectedDataset2Id:t.controlState.selectedDataset2Id,selectedVariable2Name:t.controlState.selectedVariable2Name,userVariablesAllowed:Xwt(),canAddTimeSeries:WDe(t),canAddStatistics:VDe(t),variables:r_t(t)}),onn={openDialog:_1,selectVariable:r8e,selectVariable2:cKt,addTimeSeries:J6,addStatistics:RUe},snn=Rn(inn,onn)(rnn),VO=ct(C.jsx("path",{d:"M3 17.25V21h3.75L17.81 9.94l-3.75-3.75zM20.71 7.04c.39-.39.39-1.02 0-1.41l-2.34-2.34a.996.996 0 0 0-1.41 0l-1.83 1.83 3.75 3.75z"}),"Edit"),vU=ct(C.jsx("path",{d:"M7 11v2h10v-2zm5-9C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8"}),"RemoveCircleOutline"),CWe=({itemValue:t,setItemValue:e,validateItemValue:n,editMode:r,setEditMode:i,labelText:o,select:s,actions:a})=>{const l=D.useRef(null),[c,u]=D.useState("");D.useEffect(()=>{r&&u(t)},[r,t,u]),D.useEffect(()=>{if(r){const p=l.current;p!==null&&(p.focus(),p.select())}},[r]);const f=C.jsx(Ly,{shrink:!0,htmlFor:"place-select",children:o});if(!r)return C.jsx(tP,{label:f,control:s,actions:a});const d=n?n(c):!0,h=C.jsx(Ag,{value:c,error:!d,inputRef:l,onBlur:()=>i(!1),onKeyUp:p=>{p.code==="Escape"?i(!1):p.code==="Enter"&&d&&(i(!1),e(c))},onChange:p=>{u(p.currentTarget.value)}});return C.jsx(tP,{label:f,control:h})},ann={select:{minWidth:"5em"}};function lnn({placeGroups:t,selectPlaceGroups:e,renameUserPlaceGroup:n,removeUserPlaceGroup:r,selectedPlaceGroupIds:i,selectedPlaceGroupsTitle:o}){const[s,a]=D.useState(!1);if(t=t||[],i=i||[],t.length===0)return null;const l=i.length===1?i[0]:null,c=g=>{n(l,g)},u=g=>{e(g.target.value||null)},f=()=>o,d=C.jsx(Wg,{variant:"standard",multiple:!0,displayEmpty:!0,onChange:u,input:C.jsx(Ag,{name:"place-groups",id:"place-groups-select"}),value:i,renderValue:f,name:"place-groups",sx:ann.select,children:t.map(g=>C.jsxs(ti,{value:g.id,children:[C.jsx(LF,{checked:i.indexOf(g.id)>-1}),C.jsx(du,{primary:g.title})]},g.id))});let h=!1;l!==null&&l.startsWith(rO)&&(h=!!t.find(g=>g.id===l&&g.features&&g.features.length>=0));let p;if(h){const g=()=>{a(!0)},m=()=>{r(l)};p=[C.jsx(lu,{onClick:g,tooltipText:me.get("Rename place group"),icon:C.jsx(VO,{})},"editPlaceGroup"),C.jsx(lu,{onClick:m,tooltipText:me.get("Remove places"),icon:C.jsx(vU,{})},"removePlaceGroup")]}return C.jsx(CWe,{itemValue:o,setItemValue:c,validateItemValue:g=>g.trim().length>0,editMode:s,setEditMode:a,labelText:me.get("Places"),select:d,actions:p})}const cnn=t=>({locale:t.controlState.locale,selectedPlaceGroupIds:t.controlState.selectedPlaceGroupIds,placeGroups:B4(t),selectedPlaceGroupsTitle:g_t(t)}),unn={selectPlaceGroups:nKt,renameUserPlaceGroup:EQt,removeUserPlaceGroup:RQt},fnn=Rn(cnn,unn)(lnn),dnn=ct(C.jsx("path",{d:"M16.56 8.94 7.62 0 6.21 1.41l2.38 2.38-5.15 5.15c-.59.59-.59 1.54 0 2.12l5.5 5.5c.29.29.68.44 1.06.44s.77-.15 1.06-.44l5.5-5.5c.59-.58.59-1.53 0-2.12M5.21 10 10 5.21 14.79 10zM19 11.5s-2 2.17-2 3.5c0 1.1.9 2 2 2s2-.9 2-2c0-1.33-2-3.5-2-3.5M2 20h20v4H2z"}),"FormatColorFill"),O0={container:{display:"grid",gridTemplateColumns:"auto 120px",gridTemplateRows:"auto",gridTemplateAreas:"'colorLabel colorValue' 'opacityLabel opacityValue'",rowGap:1,columnGap:2.5,padding:1},colorLabel:{gridArea:"colorLabel",alignSelf:"center"},colorValue:{gridArea:"colorValue",alignSelf:"center",width:"100%",height:"22px",borderWidth:1,borderStyle:"solid",borderColor:"black"},opacityLabel:{gridArea:"opacityLabel",alignSelf:"center"},opacityValue:{gridArea:"opacityValue",alignSelf:"center",width:"100%"},colorMenuItem:{padding:"4px 8px 4px 8px"},colorMenuItemBox:{width:"104px",height:"18px"}},hnn=({anchorEl:t,setAnchorEl:e,isPoint:n,placeStyle:r,updatePlaceStyle:i})=>{const[o,s]=D.useState(null);function a(l){s(l.currentTarget)}return C.jsxs(C.Fragment,{children:[C.jsx(Qb,{open:t!==null,anchorEl:t,onClose:()=>e(null),anchorOrigin:{vertical:"bottom",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"left"},children:C.jsxs(ot,{sx:O0.container,children:[C.jsx(Jt,{sx:O0.colorLabel,children:me.get("Color")}),C.jsx(Jt,{sx:O0.opacityLabel,color:n?"text.secondary":"text.primary",children:me.get("Opacity")}),C.jsx(ot,{sx:O0.colorValue,style:{backgroundColor:r.color},onClick:a}),C.jsx(YC,{sx:O0.opacityValue,disabled:n,size:"small",min:0,max:1,step:.05,value:r.opacity,onChange:(l,c)=>i({...r,opacity:c})})]})}),C.jsx($y,{open:!!o,anchorEl:o,onClose:()=>s(null),children:Yee.map(([l,c])=>C.jsx(ti,{selected:r.color===l,sx:O0.colorMenuItem,onClick:()=>i({...r,color:l}),children:C.jsx(Lt,{title:l,children:C.jsx(ot,{sx:{...O0.colorMenuItemBox,backgroundColor:l}})})},l))})]})},pnn={select:{minWidth:"5em"}};function gnn({selectPlace:t,placeLabels:e,selectedPlaceId:n,selectedPlaceGroupIds:r,selectedPlaceInfo:i,renameUserPlace:o,restyleUserPlace:s,removeUserPlace:a,places:l,locateSelectedPlace:c}){const[u,f]=D.useState(!1),[d,h]=D.useState(null);l=l||[],e=e||[],n=n||"",r=r||[];const p=r.length===1?r[0]:null,g=l.findIndex(S=>S.id===n),m=g>=0?e[g]:"",v=S=>{o(p,n,S)},y=S=>{s(p,n,S)},x=S=>{t(S.target.value||null,l,!0)},b=C.jsx(Wg,{variant:"standard",value:n,onChange:x,input:C.jsx(Ag,{name:"place",id:"place-select"}),displayEmpty:!0,name:"place",sx:pnn.select,disabled:l.length===0,children:l.map((S,O)=>C.jsx(ti,{value:S.id,selected:S.id===n,children:e[O]},S.id))}),w=p!==null&&p.startsWith(rO)&&n!=="";let _=[C.jsx(lu,{onClick:c,tooltipText:me.get("Locate place in map"),icon:C.jsx(wWe,{})},"locatePlace")];if(!u&&w){const S=()=>{f(!0)},O=E=>{h(E.currentTarget)},k=()=>{a(p,n,l)};_=[C.jsx(lu,{onClick:S,tooltipText:me.get("Rename place"),icon:C.jsx(VO,{})},"editButton"),C.jsx(lu,{onClick:O,tooltipText:me.get("Style place"),icon:C.jsx(dnn,{})},"styleButton"),C.jsx(lu,{onClick:k,tooltipText:me.get("Remove place"),icon:C.jsx(vU,{})},"removeButton")].concat(_)}return C.jsxs(C.Fragment,{children:[C.jsx(CWe,{itemValue:m,setItemValue:v,validateItemValue:S=>S.trim().length>0,editMode:u,setEditMode:f,labelText:me.get("Place"),select:b,actions:_}),i&&C.jsx(hnn,{anchorEl:d,setAnchorEl:h,isPoint:i.place.geometry.type==="Point",placeStyle:i,updatePlaceStyle:y})]})}const mnn=t=>({locale:t.controlState.locale,datasets:t.dataState.datasets,selectedPlaceGroupIds:t.controlState.selectedPlaceGroupIds,selectedPlaceId:t.controlState.selectedPlaceId,selectedPlaceInfo:JM(t),places:ZM(t),placeLabels:b_t(t)}),vnn={selectPlace:eU,renameUserPlace:TQt,restyleUserPlace:AQt,removeUserPlace:MQt,locateSelectedPlace:JQt,openDialog:_1},ynn=Rn(mnn,vnn)(gnn),xnn=ct(C.jsx("path",{d:"M12 2C8.14 2 5 5.14 5 9c0 5.25 7 13 7 13s7-7.75 7-13c0-3.86-3.14-7-7-7m4 8h-3v3h-2v-3H8V8h3V5h2v3h3z"}),"AddLocation"),bnn=ct(C.jsx("path",{d:"M11.71 17.99C8.53 17.84 6 15.22 6 12c0-3.31 2.69-6 6-6 3.22 0 5.84 2.53 5.99 5.71l-2.1-.63C15.48 9.31 13.89 8 12 8c-2.21 0-4 1.79-4 4 0 1.89 1.31 3.48 3.08 3.89zM22 12c0 .3-.01.6-.04.9l-1.97-.59c.01-.1.01-.21.01-.31 0-4.42-3.58-8-8-8s-8 3.58-8 8 3.58 8 8 8c.1 0 .21 0 .31-.01l.59 1.97c-.3.03-.6.04-.9.04-5.52 0-10-4.48-10-10S6.48 2 12 2s10 4.48 10 10m-3.77 4.26L22 15l-10-3 3 10 1.26-3.77 4.27 4.27 1.98-1.98z"}),"AdsClick"),wnn=ct([C.jsx("path",{d:"m12 2-5.5 9h11z"},"0"),C.jsx("circle",{cx:"17.5",cy:"17.5",r:"4.5"},"1"),C.jsx("path",{d:"M3 13.5h8v8H3z"},"2")],"Category"),_nn=ct(C.jsx("circle",{cx:"12",cy:"12",r:"8"}),"FiberManualRecord"),Snn=ct(C.jsx("path",{d:"M19.35 10.04C18.67 6.59 15.64 4 12 4 9.11 4 6.6 5.64 5.35 8.04 2.34 8.36 0 10.91 0 14c0 3.31 2.69 6 6 6h13c2.76 0 5-2.24 5-5 0-2.64-2.05-4.78-4.65-4.96M14 13v4h-4v-4H7l5-5 5 5z"}),"CloudUpload"),Cnn=ra(Ug)(({theme:t})=>({marginTop:t.spacing(2),marginLeft:t.spacing(1),marginRight:t.spacing(2)}));function Onn({mapInteraction:t,setMapInteraction:e}){function n(r,i){e(i!==null?i:"Select")}return C.jsx(Cnn,{variant:"standard",children:C.jsxs(QC,{size:"small",value:t,exclusive:!0,onChange:n,children:[C.jsx(yr,{value:"Select",size:"small",sx:rl.toggleButton,children:C.jsx(Lt,{arrow:!0,title:me.get("Select a place in map"),children:C.jsx(bnn,{})})},0),C.jsx(yr,{value:"Point",size:"small",sx:rl.toggleButton,children:C.jsx(Lt,{arrow:!0,title:me.get("Add a point location in map"),children:C.jsx(xnn,{})})},1),C.jsx(yr,{value:"Polygon",size:"small",sx:rl.toggleButton,children:C.jsx(Lt,{arrow:!0,title:me.get("Draw a polygon area in map"),children:C.jsx(wnn,{})})},2),C.jsx(yr,{value:"Circle",size:"small",sx:rl.toggleButton,children:C.jsx(Lt,{arrow:!0,title:me.get("Draw a circular area in map"),children:C.jsx(_nn,{})})},3),C.jsx(yr,{value:"Geometry",size:"small",sx:rl.toggleButton,children:C.jsx(Lt,{arrow:!0,title:me.get("Import places"),children:C.jsx(Snn,{})})},4)]})})}const Enn=t=>({mapInteraction:t.controlState.mapInteraction}),Tnn={setMapInteraction:u8e},knn=Rn(Enn,Tnn)(Onn);var obe=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ZR=(typeof window>"u"?"undefined":obe(window))==="object"&&(typeof document>"u"?"undefined":obe(document))==="object"&&document.nodeType===9,Ann={}.constructor;function EQ(t){if(t==null||typeof t!="object")return t;if(Array.isArray(t))return t.map(EQ);if(t.constructor!==Ann)return t;var e={};for(var n in t)e[n]=EQ(t[n]);return e}function mle(t,e,n){t===void 0&&(t="unnamed");var r=n.jss,i=EQ(e),o=r.plugins.onCreateRule(t,i,n);return o||(t[0],null)}var sbe=function(e,n){for(var r="",i=0;i<+~=|^:(),"'`\s])/g,abe=typeof CSS<"u"&&CSS.escape,vle=function(t){return abe?abe(t):t.replace(Pnn,"\\$1")},OWe=function(){function t(n,r,i){this.type="style",this.isProcessed=!1;var o=i.sheet,s=i.Renderer;this.key=n,this.options=i,this.style=r,o?this.renderer=o.renderer:s&&(this.renderer=new s)}var e=t.prototype;return e.prop=function(r,i,o){if(i===void 0)return this.style[r];var s=o?o.force:!1;if(!s&&this.style[r]===i)return this;var a=i;(!o||o.process!==!1)&&(a=this.options.jss.plugins.onChangeValue(i,r,this));var l=a==null||a===!1,c=r in this.style;if(l&&!c&&!s)return this;var u=l&&c;if(u?delete this.style[r]:this.style[r]=a,this.renderable&&this.renderer)return u?this.renderer.removeProperty(this.renderable,r):this.renderer.setProperty(this.renderable,r,a),this;var f=this.options.sheet;return f&&f.attached,this},t}(),TQ=function(t){AM(e,t);function e(r,i,o){var s;s=t.call(this,r,i,o)||this;var a=o.selector,l=o.scoped,c=o.sheet,u=o.generateId;return a?s.selectorText=a:l!==!1&&(s.id=u(bt(bt(s)),c),s.selectorText="."+vle(s.id)),s}var n=e.prototype;return n.applyTo=function(i){var o=this.renderer;if(o){var s=this.toJSON();for(var a in s)o.setProperty(i,a,s[a])}return this},n.toJSON=function(){var i={};for(var o in this.style){var s=this.style[o];typeof s!="object"?i[o]=s:Array.isArray(s)&&(i[o]=Gx(s))}return i},n.toString=function(i){var o=this.options.sheet,s=o?o.options.link:!1,a=s?ve({},i,{allowEmpty:!0}):i;return nP(this.selectorText,this.style,a)},An(e,[{key:"selector",set:function(i){if(i!==this.selectorText){this.selectorText=i;var o=this.renderer,s=this.renderable;if(!(!s||!o)){var a=o.setSelector(s,i);a||o.replaceRule(s,this)}}},get:function(){return this.selectorText}}]),e}(OWe),Mnn={onCreateRule:function(e,n,r){return e[0]==="@"||r.parent&&r.parent.type==="keyframes"?null:new TQ(e,n,r)}},N9={indent:1,children:!0},Rnn=/@([\w-]+)/,Dnn=function(){function t(n,r,i){this.type="conditional",this.isProcessed=!1,this.key=n;var o=n.match(Rnn);this.at=o?o[1]:"unknown",this.query=i.name||"@"+this.at,this.options=i,this.rules=new yU(ve({},i,{parent:this}));for(var s in r)this.rules.add(s,r[s]);this.rules.process()}var e=t.prototype;return e.getRule=function(r){return this.rules.get(r)},e.indexOf=function(r){return this.rules.indexOf(r)},e.addRule=function(r,i,o){var s=this.rules.add(r,i,o);return s?(this.options.jss.plugins.onProcessRule(s),s):null},e.replaceRule=function(r,i,o){var s=this.rules.replace(r,i,o);return s&&this.options.jss.plugins.onProcessRule(s),s},e.toString=function(r){r===void 0&&(r=N9);var i=GO(r),o=i.linebreak;if(r.indent==null&&(r.indent=N9.indent),r.children==null&&(r.children=N9.children),r.children===!1)return this.query+" {}";var s=this.rules.toString(r);return s?this.query+" {"+o+s+o+"}":""},t}(),Inn=/@container|@media|@supports\s+/,Lnn={onCreateRule:function(e,n,r){return Inn.test(e)?new Dnn(e,n,r):null}},z9={indent:1,children:!0},$nn=/@keyframes\s+([\w-]+)/,kQ=function(){function t(n,r,i){this.type="keyframes",this.at="@keyframes",this.isProcessed=!1;var o=n.match($nn);o&&o[1]?this.name=o[1]:this.name="noname",this.key=this.type+"-"+this.name,this.options=i;var s=i.scoped,a=i.sheet,l=i.generateId;this.id=s===!1?this.name:vle(l(this,a)),this.rules=new yU(ve({},i,{parent:this}));for(var c in r)this.rules.add(c,r[c],ve({},i,{parent:this}));this.rules.process()}var e=t.prototype;return e.toString=function(r){r===void 0&&(r=z9);var i=GO(r),o=i.linebreak;if(r.indent==null&&(r.indent=z9.indent),r.children==null&&(r.children=z9.children),r.children===!1)return this.at+" "+this.id+" {}";var s=this.rules.toString(r);return s&&(s=""+o+s+o),this.at+" "+this.id+" {"+s+"}"},t}(),Fnn=/@keyframes\s+/,Nnn=/\$([\w-]+)/g,AQ=function(e,n){return typeof e=="string"?e.replace(Nnn,function(r,i){return i in n?n[i]:r}):e},lbe=function(e,n,r){var i=e[n],o=AQ(i,r);o!==i&&(e[n]=o)},znn={onCreateRule:function(e,n,r){return typeof e=="string"&&Fnn.test(e)?new kQ(e,n,r):null},onProcessStyle:function(e,n,r){return n.type!=="style"||!r||("animation-name"in e&&lbe(e,"animation-name",r.keyframes),"animation"in e&&lbe(e,"animation",r.keyframes)),e},onChangeValue:function(e,n,r){var i=r.options.sheet;if(!i)return e;switch(n){case"animation":return AQ(e,i.keyframes);case"animation-name":return AQ(e,i.keyframes);default:return e}}},jnn=function(t){AM(e,t);function e(){return t.apply(this,arguments)||this}var n=e.prototype;return n.toString=function(i){var o=this.options.sheet,s=o?o.options.link:!1,a=s?ve({},i,{allowEmpty:!0}):i;return nP(this.key,this.style,a)},e}(OWe),Bnn={onCreateRule:function(e,n,r){return r.parent&&r.parent.type==="keyframes"?new jnn(e,n,r):null}},Unn=function(){function t(n,r,i){this.type="font-face",this.at="@font-face",this.isProcessed=!1,this.key=n,this.style=r,this.options=i}var e=t.prototype;return e.toString=function(r){var i=GO(r),o=i.linebreak;if(Array.isArray(this.style)){for(var s="",a=0;a=this.index){i.push(r);return}for(var s=0;so){i.splice(s,0,r);return}}},e.reset=function(){this.registry=[]},e.remove=function(r){var i=this.registry.indexOf(r);this.registry.splice(i,1)},e.toString=function(r){for(var i=r===void 0?{}:r,o=i.attached,s=Rt(i,["attached"]),a=GO(s),l=a.linebreak,c="",u=0;u-1?i.substr(0,o-1):i;e.style.setProperty(n,s,o>-1?"important":"")}}catch{return!1}return!0},trn=function(e,n){try{e.attributeStyleMap?e.attributeStyleMap.delete(n):e.style.removeProperty(n)}catch{}},nrn=function(e,n){return e.selectorText=n,e.selectorText===n},kWe=TWe(function(){return document.querySelector("head")});function rrn(t,e){for(var n=0;ne.index&&r.options.insertionPoint===e.insertionPoint)return r}return null}function irn(t,e){for(var n=t.length-1;n>=0;n--){var r=t[n];if(r.attached&&r.options.insertionPoint===e.insertionPoint)return r}return null}function orn(t){for(var e=kWe(),n=0;n0){var n=rrn(e,t);if(n&&n.renderer)return{parent:n.renderer.element.parentNode,node:n.renderer.element};if(n=irn(e,t),n&&n.renderer)return{parent:n.renderer.element.parentNode,node:n.renderer.element.nextSibling}}var r=t.insertionPoint;if(r&&typeof r=="string"){var i=orn(r);if(i)return{parent:i.parentNode,node:i.nextSibling}}return!1}function arn(t,e){var n=e.insertionPoint,r=srn(e);if(r!==!1&&r.parent){r.parent.insertBefore(t,r.node);return}if(n&&typeof n.nodeType=="number"){var i=n,o=i.parentNode;o&&o.insertBefore(t,i.nextSibling);return}kWe().appendChild(t)}var lrn=TWe(function(){var t=document.querySelector('meta[property="csp-nonce"]');return t?t.getAttribute("content"):null}),hbe=function(e,n,r){try{"insertRule"in e?e.insertRule(n,r):"appendRule"in e&&e.appendRule(n)}catch{return!1}return e.cssRules[r]},pbe=function(e,n){var r=e.cssRules.length;return n===void 0||n>r?r:n},crn=function(){var e=document.createElement("style");return e.textContent=` +`,e},urn=function(){function t(n){this.getPropertyValue=Jnn,this.setProperty=ern,this.removeProperty=trn,this.setSelector=nrn,this.hasInsertedRules=!1,this.cssRules=[],n&&bk.add(n),this.sheet=n;var r=this.sheet?this.sheet.options:{},i=r.media,o=r.meta,s=r.element;this.element=s||crn(),this.element.setAttribute("data-jss",""),i&&this.element.setAttribute("media",i),o&&this.element.setAttribute("data-meta",o);var a=lrn();a&&this.element.setAttribute("nonce",a)}var e=t.prototype;return e.attach=function(){if(!(this.element.parentNode||!this.sheet)){arn(this.element,this.sheet.options);var r=!!(this.sheet&&this.sheet.deployed);this.hasInsertedRules&&r&&(this.hasInsertedRules=!1,this.deploy())}},e.detach=function(){if(this.sheet){var r=this.element.parentNode;r&&r.removeChild(this.element),this.sheet.options.link&&(this.cssRules=[],this.element.textContent=` `)}},e.deploy=function(){var r=this.sheet;if(r){if(r.options.link){this.insertRules(r.rules);return}this.element.textContent=` `+r.toString()+` -`}},e.insertRules=function(r,i){for(var o=0;o{n[o]&&(i[o]=`${e[o]} ${n[o]}`)}),i}const h_={set:(t,e,n,r)=>{let i=t.get(e);i||(i=new Map,t.set(e,i)),i.set(n,r)},get:(t,e,n)=>{const r=t.get(e);return r?r.get(n):void 0},delete:(t,e,n)=>{t.get(e).delete(n)}};function oWe(){const t=n4();return(t==null?void 0:t.$$material)??t}const xrn=["checked","disabled","error","focused","focusVisible","required","expanded","selected"];function brn(t={}){const{disableGlobal:e=!1,productionPrefix:n="jss",seed:r=""}=t,i=r===""?"":`${r}-`;let o=0;const s=()=>(o+=1,o);return(a,l)=>{const c=l.options.name;if(c&&c.startsWith("Mui")&&!l.options.link&&!e){if(xrn.includes(a.key))return`Mui-${a.key}`;const u=`${i}${c}-${a.key}`;return!l.options.theme[aAe]||r!==""?u:`${u}-${s()}`}return`${i}${n}${s()}`}}var sWe=Date.now(),O9="fnValues"+sWe,E9="fnStyle"+ ++sWe,wrn=function(){return{onCreateRule:function(n,r,i){if(typeof r!="function")return null;var o=Zae(n,{},i);return o[E9]=r,o},onProcessStyle:function(n,r){if(O9 in r||E9 in r)return n;var i={};for(var o in n){var s=n[o];typeof s=="function"&&(delete n[o],i[o]=s)}return r[O9]=i,n},onUpdate:function(n,r,i,o){var s=r,a=s[E9];a&&(s.style=a(n)||{});var l=s[O9];if(l)for(var c in l)s.prop(c,l[c](n),o)}}},Vv="@global",mQ="@global ",_rn=function(){function t(n,r,i){this.type="global",this.at=Vv,this.isProcessed=!1,this.key=n,this.options=i,this.rules=new yU(ve({},i,{parent:this}));for(var o in r)this.rules.add(o,r[o]);this.rules.process()}var e=t.prototype;return e.getRule=function(r){return this.rules.get(r)},e.addRule=function(r,i,o){var s=this.rules.add(r,i,o);return s&&this.options.jss.plugins.onProcessRule(s),s},e.replaceRule=function(r,i,o){var s=this.rules.replace(r,i,o);return s&&this.options.jss.plugins.onProcessRule(s),s},e.indexOf=function(r){return this.rules.indexOf(r)},e.toString=function(r){return this.rules.toString(r)},t}(),Srn=function(){function t(n,r,i){this.type="global",this.at=Vv,this.isProcessed=!1,this.key=n,this.options=i;var o=n.substr(mQ.length);this.rule=i.jss.createRule(o,r,ve({},i,{parent:this}))}var e=t.prototype;return e.toString=function(r){return this.rule?this.rule.toString(r):""},t}(),Crn=/\s*,\s*/g;function aWe(t,e){for(var n=t.split(Crn),r="",i=0;i-1){var o=dWe[e];if(!Array.isArray(o))return un.js+xy(o)in n?un.css+o:!1;if(!i)return!1;for(var s=0;sr?1:-1:n.length-r.length};return{onProcessStyle:function(n,r){if(r.type!=="style")return n;for(var i={},o=Object.keys(n).sort(t),s=0;s"u"?null:vin(),yin()]}}const bin=nWe(xin()),win=brn(),_in=new Map,Sin={disableGeneration:!1,generateClassName:win,jss:bin,sheetsCache:null,sheetsManager:_in,sheetsRegistry:null},Cin=D.createContext(Sin);let Gxe=-1e9;function Oin(){return Gxe+=1,Gxe}function Hxe(t){return t.length===0}function Ein(t){const{variant:e,...n}=t;let r=e||"";return Object.keys(n).sort().forEach(i=>{i==="color"?r+=Hxe(r)?t[i]:De(t[i]):r+=`${Hxe(r)?i:De(i)}${De(t[i].toString())}`}),r}const Tin={};function kin(t){const e=typeof t=="function";return{create:(n,r)=>{let i;try{i=e?t(n):t}catch(l){throw l}if(!r||!n.components||!n.components[r]||!n.components[r].styleOverrides&&!n.components[r].variants)return i;const o=n.components[r].styleOverrides||{},s=n.components[r].variants||[],a={...i};return Object.keys(o).forEach(l=>{a[l]=Bo(a[l]||{},o[l])}),s.forEach(l=>{const c=Ein(l.props);a[c]=Bo(a[c]||{},l.style)}),a},options:{}}}function Ain({state:t,stylesOptions:e},n,r){if(e.disableGeneration)return n||{};t.cacheClasses||(t.cacheClasses={value:null,lastProp:null,lastJSS:{}});let i=!1;return t.classes!==t.cacheClasses.lastJSS&&(t.cacheClasses.lastJSS=t.classes,i=!0),n!==t.cacheClasses.lastProp&&(t.cacheClasses.lastProp=n,i=!0),i&&(t.cacheClasses.value=iWe({baseClasses:t.cacheClasses.lastJSS,newClasses:n,Component:r})),t.cacheClasses.value}function Pin({state:t,theme:e,stylesOptions:n,stylesCreator:r,name:i},o){if(n.disableGeneration)return;let s=h_.get(n.sheetsManager,r,e);s||(s={refs:0,staticSheet:null,dynamicStyles:null},h_.set(n.sheetsManager,r,e,s));const a={...r.options,...n,theme:e,flip:typeof n.flip=="boolean"?n.flip:e.direction==="rtl"};a.generateId=a.serverGenerateClassName||a.generateClassName;const l=n.sheetsRegistry;if(s.refs===0){let c;n.sheetsCache&&(c=h_.get(n.sheetsCache,r,e));const u=r.create(e,i);c||(c=n.jss.createStyleSheet(u,{link:!1,...a}),c.attach(),n.sheetsCache&&h_.set(n.sheetsCache,r,e,c)),l&&l.add(c),s.staticSheet=c,s.dynamicStyles=rWe(u)}if(s.dynamicStyles){const c=n.jss.createStyleSheet(s.dynamicStyles,{link:!0,...a});c.update(o),c.attach(),t.dynamicSheet=c,t.classes=iWe({baseClasses:s.staticSheet.classes,newClasses:c.classes}),l&&l.add(c)}else t.classes=s.staticSheet.classes;s.refs+=1}function Min({state:t},e){t.dynamicSheet&&t.dynamicSheet.update(e)}function Rin({state:t,theme:e,stylesOptions:n,stylesCreator:r}){if(n.disableGeneration)return;const i=h_.get(n.sheetsManager,r,e);i.refs-=1;const o=n.sheetsRegistry;i.refs===0&&(h_.delete(n.sheetsManager,r,e),n.jss.removeStyleSheet(i.staticSheet),o&&o.remove(i.staticSheet)),t.dynamicSheet&&(n.jss.removeStyleSheet(t.dynamicSheet),o&&o.remove(t.dynamicSheet))}function Din(t,e){const n=D.useRef([]);let r;const i=D.useMemo(()=>({}),e);n.current!==i&&(n.current=i,r=t()),D.useEffect(()=>()=>{r&&r()},[i])}function Iin(t,e={}){const{name:n,classNamePrefix:r,Component:i,defaultTheme:o=Tin,...s}=e,a=kin(t),l=n||r||"makeStyles";return a.options={index:Oin(),name:n,meta:l,classNamePrefix:l},(u={})=>{const f=oWe()||o,d={...D.useContext(Cin),...s},h=D.useRef(),p=D.useRef();return Din(()=>{const m={name:n,state:{},stylesCreator:a,stylesOptions:d,theme:f};return Pin(m,u),p.current=!1,h.current=m,()=>{Rin(m)}},[f,a]),D.useEffect(()=>{p.current&&Min(h.current,u),p.current=!0}),Ain(h.current,u.classes,i)}}function Lin(t){const{theme:e,name:n,props:r}=t;if(!e||!e.components||!e.components[n]||!e.components[n].defaultProps)return r;const i={...r},o=e.components[n].defaultProps;let s;for(s in o)i[s]===void 0&&(i[s]=o[s]);return i}const $in=(t,e={})=>n=>{const{defaultTheme:r,withTheme:i=!1,name:o,...s}=e;let a=o;const l=Iin(t,{defaultTheme:r,Component:n,name:o||n.displayName,classNamePrefix:a,...s}),c=D.forwardRef(function(f,d){const{classes:h,...p}=f,g=l({...n.defaultProps,...f});let m,v=p;return(typeof o=="string"||i)&&(m=oWe()||r,o&&(v=Lin({theme:m,name:o,props:p})),i&&!v.theme&&(v.theme=m)),C.jsx(n,{ref:d,classes:g,...v})});return AH(c,n),c},Fin=["localeText"],xQ=D.createContext(null),pWe=function(e){const{localeText:n}=e,r=Dt(e,Fin),{utils:i,localeText:o}=D.useContext(xQ)??{utils:void 0,localeText:void 0},s=An({props:r,name:"MuiLocalizationProvider"}),{children:a,dateAdapter:l,dateFormats:c,dateLibInstance:u,adapterLocale:f,localeText:d}=s,h=D.useMemo(()=>ve({},d,o,n),[d,o,n]),p=D.useMemo(()=>{if(!l)return i||null;const v=new l({locale:f,formats:c,instance:u});if(!v.isMUIAdapter)throw new Error(["MUI X: The date adapter should be imported from `@mui/x-date-pickers` or `@mui/x-date-pickers-pro`, not from `@date-io`","For example, `import { AdapterDayjs } from '@mui/x-date-pickers/AdapterDayjs'` instead of `import AdapterDayjs from '@date-io/dayjs'`","More information on the installation documentation: https://mui.com/x/react-date-pickers/getting-started/#installation"].join(` -`));return v},[l,f,c,u,i]),g=D.useMemo(()=>p?{minDate:p.date("1900-01-01T00:00:00.000"),maxDate:p.date("2099-12-31T00:00:00.000")}:null,[p]),m=D.useMemo(()=>({utils:p,defaultDates:g,localeText:h}),[g,p,h]);return C.jsx(xQ.Provider,{value:m,children:a})};var bQ={exports:{}};(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var n=function(l,c){switch(l){case"P":return c.date({width:"short"});case"PP":return c.date({width:"medium"});case"PPP":return c.date({width:"long"});case"PPPP":default:return c.date({width:"full"})}},r=function(l,c){switch(l){case"p":return c.time({width:"short"});case"pp":return c.time({width:"medium"});case"ppp":return c.time({width:"long"});case"pppp":default:return c.time({width:"full"})}},i=function(l,c){var u=l.match(/(P+)(p+)?/)||[],f=u[1],d=u[2];if(!d)return n(l,c);var h;switch(f){case"P":h=c.dateTime({width:"short"});break;case"PP":h=c.dateTime({width:"medium"});break;case"PPP":h=c.dateTime({width:"long"});break;case"PPPP":default:h=c.dateTime({width:"full"});break}return h.replace("{{date}}",n(f,c)).replace("{{time}}",r(d,c))},o={p:r,P:i},s=o;e.default=s,t.exports=e.default})(bQ,bQ.exports);var Nin=bQ.exports;const zin=on(Nin),jin={y:{sectionType:"year",contentType:"digit",maxLength:4},yy:"year",yyy:{sectionType:"year",contentType:"digit",maxLength:4},yyyy:"year",M:{sectionType:"month",contentType:"digit",maxLength:2},MM:"month",MMMM:{sectionType:"month",contentType:"letter"},MMM:{sectionType:"month",contentType:"letter"},L:{sectionType:"month",contentType:"digit",maxLength:2},LL:"month",LLL:{sectionType:"month",contentType:"letter"},LLLL:{sectionType:"month",contentType:"letter"},d:{sectionType:"day",contentType:"digit",maxLength:2},dd:"day",do:{sectionType:"day",contentType:"digit-with-letter"},E:{sectionType:"weekDay",contentType:"letter"},EE:{sectionType:"weekDay",contentType:"letter"},EEE:{sectionType:"weekDay",contentType:"letter"},EEEE:{sectionType:"weekDay",contentType:"letter"},EEEEE:{sectionType:"weekDay",contentType:"letter"},i:{sectionType:"weekDay",contentType:"digit",maxLength:1},ii:"weekDay",iii:{sectionType:"weekDay",contentType:"letter"},iiii:{sectionType:"weekDay",contentType:"letter"},e:{sectionType:"weekDay",contentType:"digit",maxLength:1},ee:"weekDay",eee:{sectionType:"weekDay",contentType:"letter"},eeee:{sectionType:"weekDay",contentType:"letter"},eeeee:{sectionType:"weekDay",contentType:"letter"},eeeeee:{sectionType:"weekDay",contentType:"letter"},c:{sectionType:"weekDay",contentType:"digit",maxLength:1},cc:"weekDay",ccc:{sectionType:"weekDay",contentType:"letter"},cccc:{sectionType:"weekDay",contentType:"letter"},ccccc:{sectionType:"weekDay",contentType:"letter"},cccccc:{sectionType:"weekDay",contentType:"letter"},a:"meridiem",aa:"meridiem",aaa:"meridiem",H:{sectionType:"hours",contentType:"digit",maxLength:2},HH:"hours",h:{sectionType:"hours",contentType:"digit",maxLength:2},hh:"hours",m:{sectionType:"minutes",contentType:"digit",maxLength:2},mm:"minutes",s:{sectionType:"seconds",contentType:"digit",maxLength:2},ss:"seconds"},Bin={year:"yyyy",month:"LLLL",monthShort:"MMM",dayOfMonth:"d",dayOfMonthFull:"do",weekday:"EEEE",weekdayShort:"EEEEEE",hours24h:"HH",hours12h:"hh",meridiem:"aa",minutes:"mm",seconds:"ss",fullDate:"PP",keyboardDate:"P",shortDate:"MMM d",normalDate:"d MMMM",normalDateWithWeekday:"EEE, MMM d",fullTime:"p",fullTime12h:"hh:mm aa",fullTime24h:"HH:mm",keyboardDateTime:"P p",keyboardDateTime12h:"P hh:mm aa",keyboardDateTime24h:"P HH:mm"};class Uin{constructor(e){this.isMUIAdapter=!0,this.isTimezoneCompatible=!1,this.lib=void 0,this.locale=void 0,this.formats=void 0,this.formatTokenMap=jin,this.escapedCharacters={start:"'",end:"'"},this.longFormatters=void 0,this.date=s=>typeof s>"u"?new Date:s===null?null:new Date(s),this.getInvalidDate=()=>new Date("Invalid Date"),this.getTimezone=()=>"default",this.setTimezone=s=>s,this.toJsDate=s=>s,this.getCurrentLocaleCode=()=>this.locale.code,this.is12HourCycleInCurrentLocale=()=>/a/.test(this.locale.formatLong.time({width:"short"})),this.expandFormat=s=>{const a=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g;return s.match(a).map(l=>{const c=l[0];if(c==="p"||c==="P"){const u=this.longFormatters[c];return u(l,this.locale.formatLong)}return l}).join("")},this.formatNumber=s=>s,this.getDayOfWeek=s=>s.getDay()+1;const{locale:n,formats:r,longFormatters:i,lib:o}=e;this.locale=n,this.formats=ve({},Bin,r),this.longFormatters=i,this.lib=o||"date-fns"}}class Win extends Uin{constructor({locale:e,formats:n}={}){super({locale:e??Dte,formats:n,longFormatters:zin}),this.parse=(r,i)=>r===""?null:R1t(r,i,new Date,{locale:this.locale}),this.isValid=r=>r==null?!1:dRe(r),this.format=(r,i)=>this.formatByString(r,this.formats[i]),this.formatByString=(r,i)=>Sxt(r,i,{locale:this.locale}),this.isEqual=(r,i)=>r===null&&i===null?!0:r===null||i===null?!1:Fxt(r,i),this.isSameYear=(r,i)=>$1t(r,i),this.isSameMonth=(r,i)=>L1t(r,i),this.isSameDay=(r,i)=>C0t(r,i),this.isSameHour=(r,i)=>I1t(r,i),this.isAfter=(r,i)=>TW(r,i),this.isAfterYear=(r,i)=>TW(r,Xhe(i)),this.isAfterDay=(r,i)=>TW(r,qhe(i)),this.isBefore=(r,i)=>kW(r,i),this.isBeforeYear=(r,i)=>kW(r,this.startOfYear(i)),this.isBeforeDay=(r,i)=>kW(r,this.startOfDay(i)),this.isWithinRange=(r,[i,o])=>F1t(r,{start:i,end:o}),this.startOfYear=r=>k0t(r),this.startOfMonth=r=>T0t(r),this.startOfWeek=r=>xA(r,{locale:this.locale}),this.startOfDay=r=>Cq(r),this.endOfYear=r=>Xhe(r),this.endOfMonth=r=>E0t(r),this.endOfWeek=r=>A0t(r,{locale:this.locale}),this.endOfDay=r=>qhe(r),this.addYears=(r,i)=>_0t(r,i),this.addMonths=(r,i)=>uRe(r,i),this.addWeeks=(r,i)=>w0t(r,i),this.addDays=(r,i)=>cRe(r,i),this.addHours=(r,i)=>m0t(r,i),this.addMinutes=(r,i)=>x0t(r,i),this.addSeconds=(r,i)=>b0t(r,i),this.getYear=r=>$xt(r),this.getMonth=r=>Pxt(r),this.getDate=r=>Ext(r),this.getHours=r=>Txt(r),this.getMinutes=r=>Axt(r),this.getSeconds=r=>Mxt(r),this.getMilliseconds=r=>kxt(r),this.setYear=(r,i)=>sbt(r,i),this.setMonth=(r,i)=>ebt(r,i),this.setDate=(r,i)=>tbt(r,i),this.setHours=(r,i)=>nbt(r,i),this.setMinutes=(r,i)=>ibt(r,i),this.setSeconds=(r,i)=>obt(r,i),this.setMilliseconds=(r,i)=>rbt(r,i),this.getDaysInMonth=r=>bRe(r),this.getWeekArray=r=>{const i=this.startOfWeek(this.startOfMonth(r)),o=this.endOfWeek(this.endOfMonth(r));let s=0,a=i;const l=[];for(;this.isBefore(a,o);){const c=Math.floor(s/7);l[c]=l[c]||[],l[c].push(a),a=this.addDays(a,1),s+=1}return l},this.getWeekNumber=r=>Lxt(r,{locale:this.locale}),this.getYearRange=([r,i])=>{const o=this.startOfYear(r),s=this.endOfYear(i),a=[];let l=o;for(;this.isBefore(l,s);)a.push(l),l=this.addYears(l,1);return a}}}const qd=(t,e)=>t.length!==e.length?!1:e.every(n=>t.includes(n)),Vin=({openTo:t,defaultOpenTo:e,views:n,defaultViews:r})=>{const i=n??r;let o;if(t!=null)o=t;else if(i.includes(e))o=e;else if(i.length>0)o=i[0];else throw new Error("MUI X: The `views` prop must contain at least one view.");return{views:i,openTo:o}},J5=(t,e,n)=>{let r=e;return r=t.setHours(r,t.getHours(n)),r=t.setMinutes(r,t.getMinutes(n)),r=t.setSeconds(r,t.getSeconds(n)),r=t.setMilliseconds(r,t.getMilliseconds(n)),r},Sk=({date:t,disableFuture:e,disablePast:n,maxDate:r,minDate:i,isDateDisabled:o,utils:s,timezone:a})=>{const l=J5(s,s.date(void 0,a),t);n&&s.isBefore(i,l)&&(i=l),e&&s.isAfter(r,l)&&(r=l);let c=t,u=t;for(s.isBefore(t,i)&&(c=i,u=null),s.isAfter(t,r)&&(u&&(u=r),c=null);c||u;){if(c&&s.isAfter(c,r)&&(c=null),u&&s.isBefore(u,i)&&(u=null),c){if(!o(c))return c;c=s.addDays(c,1)}if(u){if(!o(u))return u;u=s.addDays(u,-1)}}return null},Gin=(t,e)=>e==null||!t.isValid(e)?null:e,Du=(t,e,n)=>e==null||!t.isValid(e)?n:e,Hin=(t,e,n)=>!t.isValid(e)&&e!=null&&!t.isValid(n)&&n!=null?!0:t.isEqual(e,n),nle=(t,e)=>{const r=[t.startOfYear(e)];for(;r.length<12;){const i=r[r.length-1];r.push(t.addMonths(i,1))}return r},rle=(t,e,n)=>n==="date"?t.startOfDay(t.date(void 0,e)):t.date(void 0,e),Jp=(t,e)=>{const n=t.setHours(t.date(),e==="am"?2:14);return t.format(n,"meridiem")},qin=["year","month","day"],hC=t=>qin.includes(t),qxe=(t,{format:e,views:n},r)=>{if(e!=null)return e;const i=t.formats;return qd(n,["year"])?i.year:qd(n,["month"])?i.month:qd(n,["day"])?i.dayOfMonth:qd(n,["month","year"])?`${i.month} ${i.year}`:qd(n,["day","month"])?`${i.month} ${i.dayOfMonth}`:i.keyboardDate},Xin=(t,e)=>{const n=t.startOfWeek(e);return[0,1,2,3,4,5,6].map(r=>t.addDays(n,r))},gWe=["hours","minutes","seconds"],pC=t=>gWe.includes(t),TT=t=>gWe.includes(t)||t==="meridiem",Yin=(t,e)=>t?e.getHours(t)>=12?"pm":"am":null,rP=(t,e,n)=>n&&(t>=12?"pm":"am")!==e?e==="am"?t-12:t+12:t,Qin=(t,e,n,r)=>{const i=rP(r.getHours(t),e,n);return r.setHours(t,i)},Xxe=(t,e)=>e.getHours(t)*3600+e.getMinutes(t)*60+e.getSeconds(t),nD=(t,e)=>(n,r)=>t?e.isAfter(n,r):Xxe(n,e)>Xxe(r,e),Yxe=(t,{format:e,views:n,ampm:r})=>{if(e!=null)return e;const i=t.formats;return qd(n,["hours"])?r?`${i.hours12h} ${i.meridiem}`:i.hours24h:qd(n,["minutes"])?i.minutes:qd(n,["seconds"])?i.seconds:qd(n,["minutes","seconds"])?`${i.minutes}:${i.seconds}`:qd(n,["hours","minutes","seconds"])?r?`${i.hours12h}:${i.minutes}:${i.seconds} ${i.meridiem}`:`${i.hours24h}:${i.minutes}:${i.seconds}`:r?`${i.hours12h}:${i.minutes} ${i.meridiem}`:`${i.hours24h}:${i.minutes}`},bf={year:1,month:2,day:3,hours:4,minutes:5,seconds:6,milliseconds:7},Kin=t=>Math.max(...t.map(e=>bf[e.type]??1)),v2=(t,e,n)=>{if(e===bf.year)return t.startOfYear(n);if(e===bf.month)return t.startOfMonth(n);if(e===bf.day)return t.startOfDay(n);let r=n;return e{let o=i?i():v2(e,n,rle(e,r));t.minDate!=null&&e.isAfterDay(t.minDate,o)&&(o=v2(e,n,t.minDate)),t.maxDate!=null&&e.isBeforeDay(t.maxDate,o)&&(o=v2(e,n,t.maxDate));const s=nD(t.disableIgnoringDatePartForTimeValidation??!1,e);return t.minTime!=null&&s(t.minTime,o)&&(o=v2(e,n,t.disableIgnoringDatePartForTimeValidation?t.minTime:J5(e,o,t.minTime))),t.maxTime!=null&&s(o,t.maxTime)&&(o=v2(e,n,t.disableIgnoringDatePartForTimeValidation?t.maxTime:J5(e,o,t.maxTime))),o},mWe=(t,e)=>{const n=t.formatTokenMap[e];if(n==null)throw new Error([`MUI X: The token "${e}" is not supported by the Date and Time Pickers.`,"Please try using another token or open an issue on https://github.com/mui/mui-x/issues/new/choose if you think it should be supported."].join(` -`));return typeof n=="string"?{type:n,contentType:n==="meridiem"?"letter":"digit",maxLength:void 0}:{type:n.sectionType,contentType:n.contentType,maxLength:n.maxLength}},Jin=t=>{switch(t){case"ArrowUp":return 1;case"ArrowDown":return-1;case"PageUp":return 5;case"PageDown":return-5;default:return 0}},xU=(t,e)=>{const n=[],r=t.date(void 0,"default"),i=t.startOfWeek(r),o=t.endOfWeek(r);let s=i;for(;t.isBefore(s,o);)n.push(s),s=t.addDays(s,1);return n.map(a=>t.formatByString(a,e))},vWe=(t,e,n,r)=>{switch(n){case"month":return nle(t,t.date(void 0,e)).map(i=>t.formatByString(i,r));case"weekDay":return xU(t,r);case"meridiem":{const i=t.date(void 0,e);return[t.startOfDay(i),t.endOfDay(i)].map(o=>t.formatByString(o,r))}default:return[]}},Qxe="s",eon=["0","1","2","3","4","5","6","7","8","9"],ton=t=>{const e=t.date(void 0);return t.formatByString(t.setSeconds(e,0),Qxe)==="0"?eon:Array.from({length:10}).map((r,i)=>t.formatByString(t.setSeconds(e,i),Qxe))},P1=(t,e)=>{if(e[0]==="0")return t;const n=[];let r="";for(let i=0;i-1&&(n.push(o.toString()),r="")}return n.join("")},ile=(t,e)=>e[0]==="0"?t:t.split("").map(n=>e[Number(n)]).join(""),Kxe=(t,e)=>{const n=P1(t,e);return n!==" "&&!Number.isNaN(Number(n))},yWe=(t,e)=>{let n=t;for(n=Number(n).toString();n.length{if(i.type==="day"&&i.contentType==="digit-with-letter"){const s=t.setDate(n.longestMonth,e);return t.formatByString(s,i.format)}let o=e.toString();return i.hasLeadingZerosInInput&&(o=yWe(o,i.maxLength)),ile(o,r)},non=(t,e,n,r,i,o,s,a)=>{const l=Jin(r),c=r==="Home",u=r==="End",f=n.value===""||c||u,d=()=>{const p=i[n.type]({currentDate:s,format:n.format,contentType:n.contentType}),g=x=>xWe(t,x,p,o,n),m=n.type==="minutes"&&(a!=null&&a.minutesStep)?a.minutesStep:1;let y=parseInt(P1(n.value,o),10)+l*m;if(f){if(n.type==="year"&&!u&&!c)return t.formatByString(t.date(void 0,e),n.format);l>0||c?y=p.minimum:y=p.maximum}return y%m!==0&&((l<0||c)&&(y+=m-(m+y)%m),(l>0||u)&&(y-=y%m)),y>p.maximum?g(p.minimum+(y-p.maximum-1)%(p.maximum-p.minimum+1)):y{const p=vWe(t,e,n.type,n.format);if(p.length===0)return n.value;if(f)return l>0||c?p[0]:p[p.length-1];const v=((p.indexOf(n.value)+l)%p.length+p.length)%p.length;return p[v]};return n.contentType==="digit"||n.contentType==="digit-with-letter"?d():h()},ole=(t,e,n)=>{let r=t.value||t.placeholder;const i=e==="non-input"?t.hasLeadingZerosInFormat:t.hasLeadingZerosInInput;return e==="non-input"&&t.hasLeadingZerosInInput&&!t.hasLeadingZerosInFormat&&(r=Number(P1(r,n)).toString()),["input-rtl","input-ltr"].includes(e)&&t.contentType==="digit"&&!i&&r.length===1&&(r=`${r}‎`),e==="input-rtl"&&(r=`⁨${r}⁩`),r},Zxe=(t,e,n,r)=>t.formatByString(t.parse(e,n),r),bWe=(t,e)=>t.formatByString(t.date(void 0,"system"),e).length===4,wWe=(t,e,n,r)=>{if(e!=="digit")return!1;const i=t.date(void 0,"default");switch(n){case"year":return bWe(t,r)?t.formatByString(t.setYear(i,1),r)==="0001":t.formatByString(t.setYear(i,2001),r)==="01";case"month":return t.formatByString(t.startOfYear(i),r).length>1;case"day":return t.formatByString(t.startOfMonth(i),r).length>1;case"weekDay":return t.formatByString(t.startOfWeek(i),r).length>1;case"hours":return t.formatByString(t.setHours(i,1),r).length>1;case"minutes":return t.formatByString(t.setMinutes(i,1),r).length>1;case"seconds":return t.formatByString(t.setSeconds(i,1),r).length>1;default:throw new Error("Invalid section type")}},ron=(t,e,n)=>{const r=e.some(l=>l.type==="day"),i=[],o=[];for(let l=0;lt.map(e=>`${e.startSeparator}${e.value||e.placeholder}${e.endSeparator}`).join(""),oon=(t,e,n)=>{const i=t.map(o=>{const s=ole(o,n?"input-rtl":"input-ltr",e);return`${o.startSeparator}${s}${o.endSeparator}`}).join("");return n?`⁦${i}⁩`:i},son=(t,e,n)=>{const r=t.date(void 0,n),i=t.endOfYear(r),o=t.endOfDay(r),{maxDaysInMonth:s,longestMonth:a}=nle(t,r).reduce((l,c)=>{const u=t.getDaysInMonth(c);return u>l.maxDaysInMonth?{maxDaysInMonth:u,longestMonth:c}:l},{maxDaysInMonth:0,longestMonth:null});return{year:({format:l})=>({minimum:0,maximum:bWe(t,l)?9999:99}),month:()=>({minimum:1,maximum:t.getMonth(i)+1}),day:({currentDate:l})=>({minimum:1,maximum:l!=null&&t.isValid(l)?t.getDaysInMonth(l):s,longestMonth:a}),weekDay:({format:l,contentType:c})=>{if(c==="digit"){const u=xU(t,l).map(Number);return{minimum:Math.min(...u),maximum:Math.max(...u)}}return{minimum:1,maximum:7}},hours:({format:l})=>{const c=t.getHours(o);return P1(t.formatByString(t.endOfDay(r),l),e)!==c.toString()?{minimum:1,maximum:Number(P1(t.formatByString(t.startOfDay(r),l),e))}:{minimum:0,maximum:c}},minutes:()=>({minimum:0,maximum:t.getMinutes(o)}),seconds:()=>({minimum:0,maximum:t.getSeconds(o)}),meridiem:()=>({minimum:0,maximum:1}),empty:()=>({minimum:0,maximum:0})}},aon=(t,e,n,r)=>{switch(e.type){case"year":return t.setYear(r,t.getYear(n));case"month":return t.setMonth(r,t.getMonth(n));case"weekDay":{const i=xU(t,e.format),o=t.formatByString(n,e.format),s=i.indexOf(o),l=i.indexOf(e.value)-s;return t.addDays(n,l)}case"day":return t.setDate(r,t.getDate(n));case"meridiem":{const i=t.getHours(n)<12,o=t.getHours(r);return i&&o>=12?t.addHours(r,-12):!i&&o<12?t.addHours(r,12):r}case"hours":return t.setHours(r,t.getHours(n));case"minutes":return t.setMinutes(r,t.getMinutes(n));case"seconds":return t.setSeconds(r,t.getSeconds(n));default:return r}},Jxe={year:1,month:2,day:3,weekDay:4,hours:5,minutes:6,seconds:7,meridiem:8,empty:9},e1e=(t,e,n,r,i)=>[...n].sort((o,s)=>Jxe[o.type]-Jxe[s.type]).reduce((o,s)=>!i||s.modified?aon(t,s,e,o):o,r),lon=()=>navigator.userAgent.toLowerCase().includes("android"),con=(t,e)=>{const n={};if(!e)return t.forEach((l,c)=>{const u=c===0?null:c-1,f=c===t.length-1?null:c+1;n[c]={leftIndex:u,rightIndex:f}}),{neighbors:n,startIndex:0,endIndex:t.length-1};const r={},i={};let o=0,s=0,a=t.length-1;for(;a>=0;){s=t.findIndex((l,c)=>{var u;return c>=o&&((u=l.endSeparator)==null?void 0:u.includes(" "))&&l.endSeparator!==" / "}),s===-1&&(s=t.length-1);for(let l=s;l>=o;l-=1)i[l]=a,r[a]=l,a-=1;o=s+1}return t.forEach((l,c)=>{const u=i[c],f=u===0?null:r[u-1],d=u===t.length-1?null:r[u+1];n[c]={leftIndex:f,rightIndex:d}}),{neighbors:n,startIndex:r[0],endIndex:r[t.length-1]}},wQ=(t,e)=>t==null?null:t==="all"?"all":typeof t=="string"?e.findIndex(n=>n.type===t):t,uon=(t,e)=>{if(t.value)switch(t.type){case"month":{if(t.contentType==="digit")return e.format(e.setMonth(e.date(),Number(t.value)-1),"month");const n=e.parse(t.value,t.format);return n?e.format(n,"month"):void 0}case"day":return t.contentType==="digit"?e.format(e.setDate(e.startOfYear(e.date()),Number(t.value)),"dayOfMonthFull"):t.value;case"weekDay":return;default:return}},fon=(t,e)=>{if(t.value)switch(t.type){case"weekDay":return t.contentType==="letter"?void 0:Number(t.value);case"meridiem":{const n=e.parse(`01:00 ${t.value}`,`${e.formats.hours12h}:${e.formats.minutes} ${t.format}`);return n?e.getHours(n)>=12?1:0:void 0}case"day":return t.contentType==="digit-with-letter"?parseInt(t.value,10):Number(t.value);case"month":{if(t.contentType==="digit")return Number(t.value);const n=e.parse(t.value,t.format);return n?e.getMonth(n)+1:void 0}default:return t.contentType!=="letter"?Number(t.value):void 0}},don=["value","referenceDate"],ia={emptyValue:null,getTodayValue:rle,getInitialReferenceValue:t=>{let{value:e,referenceDate:n}=t,r=Dt(t,don);return e!=null&&r.utils.isValid(e)?e:n??Zin(r)},cleanValue:Gin,areValuesEqual:Hin,isSameError:(t,e)=>t===e,hasError:t=>t!=null,defaultErrorState:null,getTimezone:(t,e)=>e==null||!t.isValid(e)?null:t.getTimezone(e),setTimezone:(t,e,n)=>n==null?null:t.setTimezone(n,e)},hon={updateReferenceValue:(t,e,n)=>e==null||!t.isValid(e)?n:e,getSectionsFromValue:(t,e,n,r)=>!t.isValid(e)&&!!n?n:r(e),getV7HiddenInputValueFromSections:ion,getV6InputValueFromSections:oon,getActiveDateManager:(t,e)=>({date:e.value,referenceDate:e.referenceValue,getSections:n=>n,getNewValuesFromNewActiveDate:n=>({value:n,referenceValue:n==null||!t.isValid(n)?e.referenceValue:n})}),parseValueStr:(t,e,n)=>n(t.trim(),e)},sle=({props:t,value:e,timezone:n,adapter:r})=>{if(e===null)return null;const{shouldDisableDate:i,shouldDisableMonth:o,shouldDisableYear:s,disablePast:a,disableFuture:l}=t,c=r.utils.date(void 0,n),u=Du(r.utils,t.minDate,r.defaultDates.minDate),f=Du(r.utils,t.maxDate,r.defaultDates.maxDate);switch(!0){case!r.utils.isValid(e):return"invalidDate";case!!(i&&i(e)):return"shouldDisableDate";case!!(o&&o(e)):return"shouldDisableMonth";case!!(s&&s(e)):return"shouldDisableYear";case!!(l&&r.utils.isAfterDay(e,c)):return"disableFuture";case!!(a&&r.utils.isBeforeDay(e,c)):return"disablePast";case!!(u&&r.utils.isBeforeDay(e,u)):return"minDate";case!!(f&&r.utils.isAfterDay(e,f)):return"maxDate";default:return null}};sle.valueManager=ia;const _We=({adapter:t,value:e,timezone:n,props:r})=>{if(e===null)return null;const{minTime:i,maxTime:o,minutesStep:s,shouldDisableTime:a,disableIgnoringDatePartForTimeValidation:l=!1,disablePast:c,disableFuture:u}=r,f=t.utils.date(void 0,n),d=nD(l,t.utils);switch(!0){case!t.utils.isValid(e):return"invalidDate";case!!(i&&d(i,e)):return"minTime";case!!(o&&d(e,o)):return"maxTime";case!!(u&&t.utils.isAfter(e,f)):return"disableFuture";case!!(c&&t.utils.isBefore(e,f)):return"disablePast";case!!(a&&a(e,"hours")):return"shouldDisableTime-hours";case!!(a&&a(e,"minutes")):return"shouldDisableTime-minutes";case!!(a&&a(e,"seconds")):return"shouldDisableTime-seconds";case!!(s&&t.utils.getMinutes(e)%s!==0):return"minutesStep";default:return null}};_We.valueManager=ia;const bU=({adapter:t,value:e,timezone:n,props:r})=>{const i=sle({adapter:t,value:e,timezone:n,props:r});return i!==null?i:_We({adapter:t,value:e,timezone:n,props:r})};bU.valueManager=ia;const SWe=["disablePast","disableFuture","minDate","maxDate","shouldDisableDate","shouldDisableMonth","shouldDisableYear"],CWe=["disablePast","disableFuture","minTime","maxTime","shouldDisableTime","minutesStep","ampm","disableIgnoringDatePartForTimeValidation"],OWe=["minDateTime","maxDateTime"],pon=[...SWe,...CWe,...OWe],EWe=t=>pon.reduce((e,n)=>(t.hasOwnProperty(n)&&(e[n]=t[n]),e),{}),gon=t=>({components:{MuiLocalizationProvider:{defaultProps:{localeText:ve({},t)}}}}),TWe=t=>{const{utils:e,formatKey:n,contextTranslation:r,propsTranslation:i}=t;return o=>{const s=o!==null&&e.isValid(o)?e.format(o,n):null;return(i??r)(o,e,s)}},kWe={previousMonth:"Previous month",nextMonth:"Next month",openPreviousView:"Open previous view",openNextView:"Open next view",calendarViewSwitchingButtonAriaLabel:t=>t==="year"?"year view is open, switch to calendar view":"calendar view is open, switch to year view",start:"Start",end:"End",startDate:"Start date",startTime:"Start time",endDate:"End date",endTime:"End time",cancelButtonLabel:"Cancel",clearButtonLabel:"Clear",okButtonLabel:"OK",todayButtonLabel:"Today",datePickerToolbarTitle:"Select date",dateTimePickerToolbarTitle:"Select date & time",timePickerToolbarTitle:"Select time",dateRangePickerToolbarTitle:"Select date range",clockLabelText:(t,e,n,r)=>`Select ${t}. ${!r&&(e===null||!n.isValid(e))?"No time selected":`Selected time is ${r??n.format(e,"fullTime")}`}`,hoursClockNumberText:t=>`${t} hours`,minutesClockNumberText:t=>`${t} minutes`,secondsClockNumberText:t=>`${t} seconds`,selectViewText:t=>`Select ${t}`,calendarWeekNumberHeaderLabel:"Week number",calendarWeekNumberHeaderText:"#",calendarWeekNumberAriaLabelText:t=>`Week ${t}`,calendarWeekNumberText:t=>`${t}`,openDatePickerDialogue:(t,e,n)=>n||t!==null&&e.isValid(t)?`Choose date, selected date is ${n??e.format(t,"fullDate")}`:"Choose date",openTimePickerDialogue:(t,e,n)=>n||t!==null&&e.isValid(t)?`Choose time, selected time is ${n??e.format(t,"fullTime")}`:"Choose time",fieldClearLabel:"Clear",timeTableLabel:"pick time",dateTableLabel:"pick date",fieldYearPlaceholder:t=>"Y".repeat(t.digitAmount),fieldMonthPlaceholder:t=>t.contentType==="letter"?"MMMM":"MM",fieldDayPlaceholder:()=>"DD",fieldWeekDayPlaceholder:t=>t.contentType==="letter"?"EEEE":"EE",fieldHoursPlaceholder:()=>"hh",fieldMinutesPlaceholder:()=>"mm",fieldSecondsPlaceholder:()=>"ss",fieldMeridiemPlaceholder:()=>"aa",year:"Year",month:"Month",day:"Day",weekDay:"Week day",hours:"Hours",minutes:"Minutes",seconds:"Seconds",meridiem:"Meridiem",empty:"Empty"},mon=kWe;gon(kWe);const Cb=()=>{const t=D.useContext(xQ);if(t===null)throw new Error(["MUI X: Can not find the date and time pickers localization context.","It looks like you forgot to wrap your component in LocalizationProvider.","This can also happen if you are bundling multiple versions of the `@mui/x-date-pickers` package"].join(` + */AWe();function MWe(t={}){const{baseClasses:e,newClasses:n,Component:r}=t;if(!n)return e;const i={...e};return Object.keys(n).forEach(o=>{n[o]&&(i[o]=`${e[o]} ${n[o]}`)}),i}const d_={set:(t,e,n,r)=>{let i=t.get(e);i||(i=new Map,t.set(e,i)),i.set(n,r)},get:(t,e,n)=>{const r=t.get(e);return r?r.get(n):void 0},delete:(t,e,n)=>{t.get(e).delete(n)}};function RWe(){const t=Zj();return(t==null?void 0:t.$$material)??t}const hrn=["checked","disabled","error","focused","focusVisible","required","expanded","selected"];function prn(t={}){const{disableGlobal:e=!1,productionPrefix:n="jss",seed:r=""}=t,i=r===""?"":`${r}-`;let o=0;const s=()=>(o+=1,o);return(a,l)=>{const c=l.options.name;if(c&&c.startsWith("Mui")&&!l.options.link&&!e){if(hrn.includes(a.key))return`Mui-${a.key}`;const u=`${i}${c}-${a.key}`;return!l.options.theme[IAe]||r!==""?u:`${u}-${s()}`}return`${i}${n}${s()}`}}var DWe=Date.now(),j9="fnValues"+DWe,B9="fnStyle"+ ++DWe,grn=function(){return{onCreateRule:function(n,r,i){if(typeof r!="function")return null;var o=mle(n,{},i);return o[B9]=r,o},onProcessStyle:function(n,r){if(j9 in r||B9 in r)return n;var i={};for(var o in n){var s=n[o];typeof s=="function"&&(delete n[o],i[o]=s)}return r[j9]=i,n},onUpdate:function(n,r,i,o){var s=r,a=s[B9];a&&(s.style=a(n)||{});var l=s[j9];if(l)for(var c in l)s.prop(c,l[c](n),o)}}},Wv="@global",RQ="@global ",mrn=function(){function t(n,r,i){this.type="global",this.at=Wv,this.isProcessed=!1,this.key=n,this.options=i,this.rules=new yU(ve({},i,{parent:this}));for(var o in r)this.rules.add(o,r[o]);this.rules.process()}var e=t.prototype;return e.getRule=function(r){return this.rules.get(r)},e.addRule=function(r,i,o){var s=this.rules.add(r,i,o);return s&&this.options.jss.plugins.onProcessRule(s),s},e.replaceRule=function(r,i,o){var s=this.rules.replace(r,i,o);return s&&this.options.jss.plugins.onProcessRule(s),s},e.indexOf=function(r){return this.rules.indexOf(r)},e.toString=function(r){return this.rules.toString(r)},t}(),vrn=function(){function t(n,r,i){this.type="global",this.at=Wv,this.isProcessed=!1,this.key=n,this.options=i;var o=n.substr(RQ.length);this.rule=i.jss.createRule(o,r,ve({},i,{parent:this}))}var e=t.prototype;return e.toString=function(r){return this.rule?this.rule.toString(r):""},t}(),yrn=/\s*,\s*/g;function IWe(t,e){for(var n=t.split(yrn),r="",i=0;i-1){var o=zWe[e];if(!Array.isArray(o))return un.js+yy(o)in n?un.css+o:!1;if(!i)return!1;for(var s=0;sr?1:-1:n.length-r.length};return{onProcessStyle:function(n,r){if(r.type!=="style")return n;for(var i={},o=Object.keys(n).sort(t),s=0;s"u"?null:fin(),din()]}}const pin=AWe(hin()),gin=prn(),min=new Map,vin={disableGeneration:!1,generateClassName:gin,jss:pin,sheetsCache:null,sheetsManager:min,sheetsRegistry:null},yin=D.createContext(vin);let ybe=-1e9;function xin(){return ybe+=1,ybe}function xbe(t){return t.length===0}function bin(t){const{variant:e,...n}=t;let r=e||"";return Object.keys(n).sort().forEach(i=>{i==="color"?r+=xbe(r)?t[i]:Re(t[i]):r+=`${xbe(r)?i:Re(i)}${Re(t[i].toString())}`}),r}const win={};function _in(t){const e=typeof t=="function";return{create:(n,r)=>{let i;try{i=e?t(n):t}catch(l){throw l}if(!r||!n.components||!n.components[r]||!n.components[r].styleOverrides&&!n.components[r].variants)return i;const o=n.components[r].styleOverrides||{},s=n.components[r].variants||[],a={...i};return Object.keys(o).forEach(l=>{a[l]=Bo(a[l]||{},o[l])}),s.forEach(l=>{const c=bin(l.props);a[c]=Bo(a[c]||{},l.style)}),a},options:{}}}function Sin({state:t,stylesOptions:e},n,r){if(e.disableGeneration)return n||{};t.cacheClasses||(t.cacheClasses={value:null,lastProp:null,lastJSS:{}});let i=!1;return t.classes!==t.cacheClasses.lastJSS&&(t.cacheClasses.lastJSS=t.classes,i=!0),n!==t.cacheClasses.lastProp&&(t.cacheClasses.lastProp=n,i=!0),i&&(t.cacheClasses.value=MWe({baseClasses:t.cacheClasses.lastJSS,newClasses:n,Component:r})),t.cacheClasses.value}function Cin({state:t,theme:e,stylesOptions:n,stylesCreator:r,name:i},o){if(n.disableGeneration)return;let s=d_.get(n.sheetsManager,r,e);s||(s={refs:0,staticSheet:null,dynamicStyles:null},d_.set(n.sheetsManager,r,e,s));const a={...r.options,...n,theme:e,flip:typeof n.flip=="boolean"?n.flip:e.direction==="rtl"};a.generateId=a.serverGenerateClassName||a.generateClassName;const l=n.sheetsRegistry;if(s.refs===0){let c;n.sheetsCache&&(c=d_.get(n.sheetsCache,r,e));const u=r.create(e,i);c||(c=n.jss.createStyleSheet(u,{link:!1,...a}),c.attach(),n.sheetsCache&&d_.set(n.sheetsCache,r,e,c)),l&&l.add(c),s.staticSheet=c,s.dynamicStyles=PWe(u)}if(s.dynamicStyles){const c=n.jss.createStyleSheet(s.dynamicStyles,{link:!0,...a});c.update(o),c.attach(),t.dynamicSheet=c,t.classes=MWe({baseClasses:s.staticSheet.classes,newClasses:c.classes}),l&&l.add(c)}else t.classes=s.staticSheet.classes;s.refs+=1}function Oin({state:t},e){t.dynamicSheet&&t.dynamicSheet.update(e)}function Ein({state:t,theme:e,stylesOptions:n,stylesCreator:r}){if(n.disableGeneration)return;const i=d_.get(n.sheetsManager,r,e);i.refs-=1;const o=n.sheetsRegistry;i.refs===0&&(d_.delete(n.sheetsManager,r,e),n.jss.removeStyleSheet(i.staticSheet),o&&o.remove(i.staticSheet)),t.dynamicSheet&&(n.jss.removeStyleSheet(t.dynamicSheet),o&&o.remove(t.dynamicSheet))}function Tin(t,e){const n=D.useRef([]);let r;const i=D.useMemo(()=>({}),e);n.current!==i&&(n.current=i,r=t()),D.useEffect(()=>()=>{r&&r()},[i])}function kin(t,e={}){const{name:n,classNamePrefix:r,Component:i,defaultTheme:o=win,...s}=e,a=_in(t),l=n||r||"makeStyles";return a.options={index:xin(),name:n,meta:l,classNamePrefix:l},(u={})=>{const f=RWe()||o,d={...D.useContext(yin),...s},h=D.useRef(),p=D.useRef();return Tin(()=>{const m={name:n,state:{},stylesCreator:a,stylesOptions:d,theme:f};return Cin(m,u),p.current=!1,h.current=m,()=>{Ein(m)}},[f,a]),D.useEffect(()=>{p.current&&Oin(h.current,u),p.current=!0}),Sin(h.current,u.classes,i)}}function Ain(t){const{theme:e,name:n,props:r}=t;if(!e||!e.components||!e.components[n]||!e.components[n].defaultProps)return r;const i={...r},o=e.components[n].defaultProps;let s;for(s in o)i[s]===void 0&&(i[s]=o[s]);return i}const Pin=(t,e={})=>n=>{const{defaultTheme:r,withTheme:i=!1,name:o,...s}=e;let a=o;const l=kin(t,{defaultTheme:r,Component:n,name:o||n.displayName,classNamePrefix:a,...s}),c=D.forwardRef(function(f,d){const{classes:h,...p}=f,g=l({...n.defaultProps,...f});let m,v=p;return(typeof o=="string"||i)&&(m=RWe()||r,o&&(v=Ain({theme:m,name:o,props:p})),i&&!v.theme&&(v.theme=m)),C.jsx(n,{ref:d,classes:g,...v})});return VH(c,n),c},Min=["localeText"],LQ=D.createContext(null),BWe=function(e){const{localeText:n}=e,r=Rt(e,Min),{utils:i,localeText:o}=D.useContext(LQ)??{utils:void 0,localeText:void 0},s=kn({props:r,name:"MuiLocalizationProvider"}),{children:a,dateAdapter:l,dateFormats:c,dateLibInstance:u,adapterLocale:f,localeText:d}=s,h=D.useMemo(()=>ve({},d,o,n),[d,o,n]),p=D.useMemo(()=>{if(!l)return i||null;const v=new l({locale:f,formats:c,instance:u});if(!v.isMUIAdapter)throw new Error(["MUI X: The date adapter should be imported from `@mui/x-date-pickers` or `@mui/x-date-pickers-pro`, not from `@date-io`","For example, `import { AdapterDayjs } from '@mui/x-date-pickers/AdapterDayjs'` instead of `import AdapterDayjs from '@date-io/dayjs'`","More information on the installation documentation: https://mui.com/x/react-date-pickers/getting-started/#installation"].join(` +`));return v},[l,f,c,u,i]),g=D.useMemo(()=>p?{minDate:p.date("1900-01-01T00:00:00.000"),maxDate:p.date("2099-12-31T00:00:00.000")}:null,[p]),m=D.useMemo(()=>({utils:p,defaultDates:g,localeText:h}),[g,p,h]);return C.jsx(LQ.Provider,{value:m,children:a})};var $Q={exports:{}};(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var n=function(l,c){switch(l){case"P":return c.date({width:"short"});case"PP":return c.date({width:"medium"});case"PPP":return c.date({width:"long"});case"PPPP":default:return c.date({width:"full"})}},r=function(l,c){switch(l){case"p":return c.time({width:"short"});case"pp":return c.time({width:"medium"});case"ppp":return c.time({width:"long"});case"pppp":default:return c.time({width:"full"})}},i=function(l,c){var u=l.match(/(P+)(p+)?/)||[],f=u[1],d=u[2];if(!d)return n(l,c);var h;switch(f){case"P":h=c.dateTime({width:"short"});break;case"PP":h=c.dateTime({width:"medium"});break;case"PPP":h=c.dateTime({width:"long"});break;case"PPPP":default:h=c.dateTime({width:"full"});break}return h.replace("{{date}}",n(f,c)).replace("{{time}}",r(d,c))},o={p:r,P:i},s=o;e.default=s,t.exports=e.default})($Q,$Q.exports);var Rin=$Q.exports;const Din=sn(Rin),Iin={y:{sectionType:"year",contentType:"digit",maxLength:4},yy:"year",yyy:{sectionType:"year",contentType:"digit",maxLength:4},yyyy:"year",M:{sectionType:"month",contentType:"digit",maxLength:2},MM:"month",MMMM:{sectionType:"month",contentType:"letter"},MMM:{sectionType:"month",contentType:"letter"},L:{sectionType:"month",contentType:"digit",maxLength:2},LL:"month",LLL:{sectionType:"month",contentType:"letter"},LLLL:{sectionType:"month",contentType:"letter"},d:{sectionType:"day",contentType:"digit",maxLength:2},dd:"day",do:{sectionType:"day",contentType:"digit-with-letter"},E:{sectionType:"weekDay",contentType:"letter"},EE:{sectionType:"weekDay",contentType:"letter"},EEE:{sectionType:"weekDay",contentType:"letter"},EEEE:{sectionType:"weekDay",contentType:"letter"},EEEEE:{sectionType:"weekDay",contentType:"letter"},i:{sectionType:"weekDay",contentType:"digit",maxLength:1},ii:"weekDay",iii:{sectionType:"weekDay",contentType:"letter"},iiii:{sectionType:"weekDay",contentType:"letter"},e:{sectionType:"weekDay",contentType:"digit",maxLength:1},ee:"weekDay",eee:{sectionType:"weekDay",contentType:"letter"},eeee:{sectionType:"weekDay",contentType:"letter"},eeeee:{sectionType:"weekDay",contentType:"letter"},eeeeee:{sectionType:"weekDay",contentType:"letter"},c:{sectionType:"weekDay",contentType:"digit",maxLength:1},cc:"weekDay",ccc:{sectionType:"weekDay",contentType:"letter"},cccc:{sectionType:"weekDay",contentType:"letter"},ccccc:{sectionType:"weekDay",contentType:"letter"},cccccc:{sectionType:"weekDay",contentType:"letter"},a:"meridiem",aa:"meridiem",aaa:"meridiem",H:{sectionType:"hours",contentType:"digit",maxLength:2},HH:"hours",h:{sectionType:"hours",contentType:"digit",maxLength:2},hh:"hours",m:{sectionType:"minutes",contentType:"digit",maxLength:2},mm:"minutes",s:{sectionType:"seconds",contentType:"digit",maxLength:2},ss:"seconds"},Lin={year:"yyyy",month:"LLLL",monthShort:"MMM",dayOfMonth:"d",dayOfMonthFull:"do",weekday:"EEEE",weekdayShort:"EEEEEE",hours24h:"HH",hours12h:"hh",meridiem:"aa",minutes:"mm",seconds:"ss",fullDate:"PP",keyboardDate:"P",shortDate:"MMM d",normalDate:"d MMMM",normalDateWithWeekday:"EEE, MMM d",fullTime:"p",fullTime12h:"hh:mm aa",fullTime24h:"HH:mm",keyboardDateTime:"P p",keyboardDateTime12h:"P hh:mm aa",keyboardDateTime24h:"P HH:mm"};class $in{constructor(e){this.isMUIAdapter=!0,this.isTimezoneCompatible=!1,this.lib=void 0,this.locale=void 0,this.formats=void 0,this.formatTokenMap=Iin,this.escapedCharacters={start:"'",end:"'"},this.longFormatters=void 0,this.date=s=>typeof s>"u"?new Date:s===null?null:new Date(s),this.getInvalidDate=()=>new Date("Invalid Date"),this.getTimezone=()=>"default",this.setTimezone=s=>s,this.toJsDate=s=>s,this.getCurrentLocaleCode=()=>this.locale.code,this.is12HourCycleInCurrentLocale=()=>/a/.test(this.locale.formatLong.time({width:"short"})),this.expandFormat=s=>{const a=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g;return s.match(a).map(l=>{const c=l[0];if(c==="p"||c==="P"){const u=this.longFormatters[c];return u(l,this.locale.formatLong)}return l}).join("")},this.formatNumber=s=>s,this.getDayOfWeek=s=>s.getDay()+1;const{locale:n,formats:r,longFormatters:i,lib:o}=e;this.locale=n,this.formats=ve({},Lin,r),this.longFormatters=i,this.lib=o||"date-fns"}}class Fin extends $in{constructor({locale:e,formats:n}={}){super({locale:e??Yte,formats:n,longFormatters:Din}),this.parse=(r,i)=>r===""?null:Fbt(r,i,new Date,{locale:this.locale}),this.isValid=r=>r==null?!1:PRe(r),this.format=(r,i)=>this.formatByString(r,this.formats[i]),this.formatByString=(r,i)=>kxt(r,i,{locale:this.locale}),this.isEqual=(r,i)=>r===null&&i===null?!0:r===null||i===null?!1:Uxt(r,i),this.isSameYear=(r,i)=>Bbt(r,i),this.isSameMonth=(r,i)=>jbt(r,i),this.isSameDay=(r,i)=>A0t(r,i),this.isSameHour=(r,i)=>zbt(r,i),this.isAfter=(r,i)=>TW(r,i),this.isAfterYear=(r,i)=>TW(r,fpe(i)),this.isAfterDay=(r,i)=>TW(r,upe(i)),this.isBefore=(r,i)=>kW(r,i),this.isBeforeYear=(r,i)=>kW(r,this.startOfYear(i)),this.isBeforeDay=(r,i)=>kW(r,this.startOfDay(i)),this.isWithinRange=(r,[i,o])=>Ubt(r,{start:i,end:o}),this.startOfYear=r=>D0t(r),this.startOfMonth=r=>R0t(r),this.startOfWeek=r=>xA(r,{locale:this.locale}),this.startOfDay=r=>zq(r),this.endOfYear=r=>fpe(r),this.endOfMonth=r=>M0t(r),this.endOfWeek=r=>I0t(r,{locale:this.locale}),this.endOfDay=r=>upe(r),this.addYears=(r,i)=>T0t(r,i),this.addMonths=(r,i)=>kRe(r,i),this.addWeeks=(r,i)=>E0t(r,i),this.addDays=(r,i)=>TRe(r,i),this.addHours=(r,i)=>w0t(r,i),this.addMinutes=(r,i)=>C0t(r,i),this.addSeconds=(r,i)=>O0t(r,i),this.getYear=r=>Bxt(r),this.getMonth=r=>Lxt(r),this.getDate=r=>Mxt(r),this.getHours=r=>Rxt(r),this.getMinutes=r=>Ixt(r),this.getSeconds=r=>$xt(r),this.getMilliseconds=r=>Dxt(r),this.setYear=(r,i)=>f1t(r,i),this.setMonth=(r,i)=>o1t(r,i),this.setDate=(r,i)=>s1t(r,i),this.setHours=(r,i)=>a1t(r,i),this.setMinutes=(r,i)=>c1t(r,i),this.setSeconds=(r,i)=>u1t(r,i),this.setMilliseconds=(r,i)=>l1t(r,i),this.getDaysInMonth=r=>NRe(r),this.getWeekArray=r=>{const i=this.startOfWeek(this.startOfMonth(r)),o=this.endOfWeek(this.endOfMonth(r));let s=0,a=i;const l=[];for(;this.isBefore(a,o);){const c=Math.floor(s/7);l[c]=l[c]||[],l[c].push(a),a=this.addDays(a,1),s+=1}return l},this.getWeekNumber=r=>jxt(r,{locale:this.locale}),this.getYearRange=([r,i])=>{const o=this.startOfYear(r),s=this.endOfYear(i),a=[];let l=o;for(;this.isBefore(l,s);)a.push(l),l=this.addYears(l,1);return a}}}const Vd=(t,e)=>t.length!==e.length?!1:e.every(n=>t.includes(n)),Nin=({openTo:t,defaultOpenTo:e,views:n,defaultViews:r})=>{const i=n??r;let o;if(t!=null)o=t;else if(i.includes(e))o=e;else if(i.length>0)o=i[0];else throw new Error("MUI X: The `views` prop must contain at least one view.");return{views:i,openTo:o}},Y5=(t,e,n)=>{let r=e;return r=t.setHours(r,t.getHours(n)),r=t.setMinutes(r,t.getMinutes(n)),r=t.setSeconds(r,t.getSeconds(n)),r=t.setMilliseconds(r,t.getMilliseconds(n)),r},_k=({date:t,disableFuture:e,disablePast:n,maxDate:r,minDate:i,isDateDisabled:o,utils:s,timezone:a})=>{const l=Y5(s,s.date(void 0,a),t);n&&s.isBefore(i,l)&&(i=l),e&&s.isAfter(r,l)&&(r=l);let c=t,u=t;for(s.isBefore(t,i)&&(c=i,u=null),s.isAfter(t,r)&&(u&&(u=r),c=null);c||u;){if(c&&s.isAfter(c,r)&&(c=null),u&&s.isBefore(u,i)&&(u=null),c){if(!o(c))return c;c=s.addDays(c,1)}if(u){if(!o(u))return u;u=s.addDays(u,-1)}}return null},zin=(t,e)=>e==null||!t.isValid(e)?null:e,Du=(t,e,n)=>e==null||!t.isValid(e)?n:e,jin=(t,e,n)=>!t.isValid(e)&&e!=null&&!t.isValid(n)&&n!=null?!0:t.isEqual(e,n),ble=(t,e)=>{const r=[t.startOfYear(e)];for(;r.length<12;){const i=r[r.length-1];r.push(t.addMonths(i,1))}return r},wle=(t,e,n)=>n==="date"?t.startOfDay(t.date(void 0,e)):t.date(void 0,e),Qp=(t,e)=>{const n=t.setHours(t.date(),e==="am"?2:14);return t.format(n,"meridiem")},Bin=["year","month","day"],dC=t=>Bin.includes(t),bbe=(t,{format:e,views:n},r)=>{if(e!=null)return e;const i=t.formats;return Vd(n,["year"])?i.year:Vd(n,["month"])?i.month:Vd(n,["day"])?i.dayOfMonth:Vd(n,["month","year"])?`${i.month} ${i.year}`:Vd(n,["day","month"])?`${i.month} ${i.dayOfMonth}`:i.keyboardDate},Uin=(t,e)=>{const n=t.startOfWeek(e);return[0,1,2,3,4,5,6].map(r=>t.addDays(n,r))},UWe=["hours","minutes","seconds"],hC=t=>UWe.includes(t),ET=t=>UWe.includes(t)||t==="meridiem",Win=(t,e)=>t?e.getHours(t)>=12?"pm":"am":null,rP=(t,e,n)=>n&&(t>=12?"pm":"am")!==e?e==="am"?t-12:t+12:t,Vin=(t,e,n,r)=>{const i=rP(r.getHours(t),e,n);return r.setHours(t,i)},wbe=(t,e)=>e.getHours(t)*3600+e.getMinutes(t)*60+e.getSeconds(t),JR=(t,e)=>(n,r)=>t?e.isAfter(n,r):wbe(n,e)>wbe(r,e),_be=(t,{format:e,views:n,ampm:r})=>{if(e!=null)return e;const i=t.formats;return Vd(n,["hours"])?r?`${i.hours12h} ${i.meridiem}`:i.hours24h:Vd(n,["minutes"])?i.minutes:Vd(n,["seconds"])?i.seconds:Vd(n,["minutes","seconds"])?`${i.minutes}:${i.seconds}`:Vd(n,["hours","minutes","seconds"])?r?`${i.hours12h}:${i.minutes}:${i.seconds} ${i.meridiem}`:`${i.hours24h}:${i.minutes}:${i.seconds}`:r?`${i.hours12h}:${i.minutes} ${i.meridiem}`:`${i.hours24h}:${i.minutes}`},bf={year:1,month:2,day:3,hours:4,minutes:5,seconds:6,milliseconds:7},Gin=t=>Math.max(...t.map(e=>bf[e.type]??1)),m2=(t,e,n)=>{if(e===bf.year)return t.startOfYear(n);if(e===bf.month)return t.startOfMonth(n);if(e===bf.day)return t.startOfDay(n);let r=n;return e{let o=i?i():m2(e,n,wle(e,r));t.minDate!=null&&e.isAfterDay(t.minDate,o)&&(o=m2(e,n,t.minDate)),t.maxDate!=null&&e.isBeforeDay(t.maxDate,o)&&(o=m2(e,n,t.maxDate));const s=JR(t.disableIgnoringDatePartForTimeValidation??!1,e);return t.minTime!=null&&s(t.minTime,o)&&(o=m2(e,n,t.disableIgnoringDatePartForTimeValidation?t.minTime:Y5(e,o,t.minTime))),t.maxTime!=null&&s(o,t.maxTime)&&(o=m2(e,n,t.disableIgnoringDatePartForTimeValidation?t.maxTime:Y5(e,o,t.maxTime))),o},WWe=(t,e)=>{const n=t.formatTokenMap[e];if(n==null)throw new Error([`MUI X: The token "${e}" is not supported by the Date and Time Pickers.`,"Please try using another token or open an issue on https://github.com/mui/mui-x/issues/new/choose if you think it should be supported."].join(` +`));return typeof n=="string"?{type:n,contentType:n==="meridiem"?"letter":"digit",maxLength:void 0}:{type:n.sectionType,contentType:n.contentType,maxLength:n.maxLength}},qin=t=>{switch(t){case"ArrowUp":return 1;case"ArrowDown":return-1;case"PageUp":return 5;case"PageDown":return-5;default:return 0}},xU=(t,e)=>{const n=[],r=t.date(void 0,"default"),i=t.startOfWeek(r),o=t.endOfWeek(r);let s=i;for(;t.isBefore(s,o);)n.push(s),s=t.addDays(s,1);return n.map(a=>t.formatByString(a,e))},VWe=(t,e,n,r)=>{switch(n){case"month":return ble(t,t.date(void 0,e)).map(i=>t.formatByString(i,r));case"weekDay":return xU(t,r);case"meridiem":{const i=t.date(void 0,e);return[t.startOfDay(i),t.endOfDay(i)].map(o=>t.formatByString(o,r))}default:return[]}},Sbe="s",Xin=["0","1","2","3","4","5","6","7","8","9"],Yin=t=>{const e=t.date(void 0);return t.formatByString(t.setSeconds(e,0),Sbe)==="0"?Xin:Array.from({length:10}).map((r,i)=>t.formatByString(t.setSeconds(e,i),Sbe))},Pb=(t,e)=>{if(e[0]==="0")return t;const n=[];let r="";for(let i=0;i-1&&(n.push(o.toString()),r="")}return n.join("")},_le=(t,e)=>e[0]==="0"?t:t.split("").map(n=>e[Number(n)]).join(""),Cbe=(t,e)=>{const n=Pb(t,e);return n!==" "&&!Number.isNaN(Number(n))},GWe=(t,e)=>{let n=t;for(n=Number(n).toString();n.length{if(i.type==="day"&&i.contentType==="digit-with-letter"){const s=t.setDate(n.longestMonth,e);return t.formatByString(s,i.format)}let o=e.toString();return i.hasLeadingZerosInInput&&(o=GWe(o,i.maxLength)),_le(o,r)},Qin=(t,e,n,r,i,o,s,a)=>{const l=qin(r),c=r==="Home",u=r==="End",f=n.value===""||c||u,d=()=>{const p=i[n.type]({currentDate:s,format:n.format,contentType:n.contentType}),g=x=>HWe(t,x,p,o,n),m=n.type==="minutes"&&(a!=null&&a.minutesStep)?a.minutesStep:1;let y=parseInt(Pb(n.value,o),10)+l*m;if(f){if(n.type==="year"&&!u&&!c)return t.formatByString(t.date(void 0,e),n.format);l>0||c?y=p.minimum:y=p.maximum}return y%m!==0&&((l<0||c)&&(y+=m-(m+y)%m),(l>0||u)&&(y-=y%m)),y>p.maximum?g(p.minimum+(y-p.maximum-1)%(p.maximum-p.minimum+1)):y{const p=VWe(t,e,n.type,n.format);if(p.length===0)return n.value;if(f)return l>0||c?p[0]:p[p.length-1];const v=((p.indexOf(n.value)+l)%p.length+p.length)%p.length;return p[v]};return n.contentType==="digit"||n.contentType==="digit-with-letter"?d():h()},Sle=(t,e,n)=>{let r=t.value||t.placeholder;const i=e==="non-input"?t.hasLeadingZerosInFormat:t.hasLeadingZerosInInput;return e==="non-input"&&t.hasLeadingZerosInInput&&!t.hasLeadingZerosInFormat&&(r=Number(Pb(r,n)).toString()),["input-rtl","input-ltr"].includes(e)&&t.contentType==="digit"&&!i&&r.length===1&&(r=`${r}‎`),e==="input-rtl"&&(r=`⁨${r}⁩`),r},Obe=(t,e,n,r)=>t.formatByString(t.parse(e,n),r),qWe=(t,e)=>t.formatByString(t.date(void 0,"system"),e).length===4,XWe=(t,e,n,r)=>{if(e!=="digit")return!1;const i=t.date(void 0,"default");switch(n){case"year":return qWe(t,r)?t.formatByString(t.setYear(i,1),r)==="0001":t.formatByString(t.setYear(i,2001),r)==="01";case"month":return t.formatByString(t.startOfYear(i),r).length>1;case"day":return t.formatByString(t.startOfMonth(i),r).length>1;case"weekDay":return t.formatByString(t.startOfWeek(i),r).length>1;case"hours":return t.formatByString(t.setHours(i,1),r).length>1;case"minutes":return t.formatByString(t.setMinutes(i,1),r).length>1;case"seconds":return t.formatByString(t.setSeconds(i,1),r).length>1;default:throw new Error("Invalid section type")}},Kin=(t,e,n)=>{const r=e.some(l=>l.type==="day"),i=[],o=[];for(let l=0;lt.map(e=>`${e.startSeparator}${e.value||e.placeholder}${e.endSeparator}`).join(""),Jin=(t,e,n)=>{const i=t.map(o=>{const s=Sle(o,n?"input-rtl":"input-ltr",e);return`${o.startSeparator}${s}${o.endSeparator}`}).join("");return n?`⁦${i}⁩`:i},eon=(t,e,n)=>{const r=t.date(void 0,n),i=t.endOfYear(r),o=t.endOfDay(r),{maxDaysInMonth:s,longestMonth:a}=ble(t,r).reduce((l,c)=>{const u=t.getDaysInMonth(c);return u>l.maxDaysInMonth?{maxDaysInMonth:u,longestMonth:c}:l},{maxDaysInMonth:0,longestMonth:null});return{year:({format:l})=>({minimum:0,maximum:qWe(t,l)?9999:99}),month:()=>({minimum:1,maximum:t.getMonth(i)+1}),day:({currentDate:l})=>({minimum:1,maximum:l!=null&&t.isValid(l)?t.getDaysInMonth(l):s,longestMonth:a}),weekDay:({format:l,contentType:c})=>{if(c==="digit"){const u=xU(t,l).map(Number);return{minimum:Math.min(...u),maximum:Math.max(...u)}}return{minimum:1,maximum:7}},hours:({format:l})=>{const c=t.getHours(o);return Pb(t.formatByString(t.endOfDay(r),l),e)!==c.toString()?{minimum:1,maximum:Number(Pb(t.formatByString(t.startOfDay(r),l),e))}:{minimum:0,maximum:c}},minutes:()=>({minimum:0,maximum:t.getMinutes(o)}),seconds:()=>({minimum:0,maximum:t.getSeconds(o)}),meridiem:()=>({minimum:0,maximum:1}),empty:()=>({minimum:0,maximum:0})}},ton=(t,e,n,r)=>{switch(e.type){case"year":return t.setYear(r,t.getYear(n));case"month":return t.setMonth(r,t.getMonth(n));case"weekDay":{const i=xU(t,e.format),o=t.formatByString(n,e.format),s=i.indexOf(o),l=i.indexOf(e.value)-s;return t.addDays(n,l)}case"day":return t.setDate(r,t.getDate(n));case"meridiem":{const i=t.getHours(n)<12,o=t.getHours(r);return i&&o>=12?t.addHours(r,-12):!i&&o<12?t.addHours(r,12):r}case"hours":return t.setHours(r,t.getHours(n));case"minutes":return t.setMinutes(r,t.getMinutes(n));case"seconds":return t.setSeconds(r,t.getSeconds(n));default:return r}},Ebe={year:1,month:2,day:3,weekDay:4,hours:5,minutes:6,seconds:7,meridiem:8,empty:9},Tbe=(t,e,n,r,i)=>[...n].sort((o,s)=>Ebe[o.type]-Ebe[s.type]).reduce((o,s)=>!i||s.modified?ton(t,s,e,o):o,r),non=()=>navigator.userAgent.toLowerCase().includes("android"),ron=(t,e)=>{const n={};if(!e)return t.forEach((l,c)=>{const u=c===0?null:c-1,f=c===t.length-1?null:c+1;n[c]={leftIndex:u,rightIndex:f}}),{neighbors:n,startIndex:0,endIndex:t.length-1};const r={},i={};let o=0,s=0,a=t.length-1;for(;a>=0;){s=t.findIndex((l,c)=>{var u;return c>=o&&((u=l.endSeparator)==null?void 0:u.includes(" "))&&l.endSeparator!==" / "}),s===-1&&(s=t.length-1);for(let l=s;l>=o;l-=1)i[l]=a,r[a]=l,a-=1;o=s+1}return t.forEach((l,c)=>{const u=i[c],f=u===0?null:r[u-1],d=u===t.length-1?null:r[u+1];n[c]={leftIndex:f,rightIndex:d}}),{neighbors:n,startIndex:r[0],endIndex:r[t.length-1]}},FQ=(t,e)=>t==null?null:t==="all"?"all":typeof t=="string"?e.findIndex(n=>n.type===t):t,ion=(t,e)=>{if(t.value)switch(t.type){case"month":{if(t.contentType==="digit")return e.format(e.setMonth(e.date(),Number(t.value)-1),"month");const n=e.parse(t.value,t.format);return n?e.format(n,"month"):void 0}case"day":return t.contentType==="digit"?e.format(e.setDate(e.startOfYear(e.date()),Number(t.value)),"dayOfMonthFull"):t.value;case"weekDay":return;default:return}},oon=(t,e)=>{if(t.value)switch(t.type){case"weekDay":return t.contentType==="letter"?void 0:Number(t.value);case"meridiem":{const n=e.parse(`01:00 ${t.value}`,`${e.formats.hours12h}:${e.formats.minutes} ${t.format}`);return n?e.getHours(n)>=12?1:0:void 0}case"day":return t.contentType==="digit-with-letter"?parseInt(t.value,10):Number(t.value);case"month":{if(t.contentType==="digit")return Number(t.value);const n=e.parse(t.value,t.format);return n?e.getMonth(n)+1:void 0}default:return t.contentType!=="letter"?Number(t.value):void 0}},son=["value","referenceDate"],na={emptyValue:null,getTodayValue:wle,getInitialReferenceValue:t=>{let{value:e,referenceDate:n}=t,r=Rt(t,son);return e!=null&&r.utils.isValid(e)?e:n??Hin(r)},cleanValue:zin,areValuesEqual:jin,isSameError:(t,e)=>t===e,hasError:t=>t!=null,defaultErrorState:null,getTimezone:(t,e)=>e==null||!t.isValid(e)?null:t.getTimezone(e),setTimezone:(t,e,n)=>n==null?null:t.setTimezone(n,e)},aon={updateReferenceValue:(t,e,n)=>e==null||!t.isValid(e)?n:e,getSectionsFromValue:(t,e,n,r)=>!t.isValid(e)&&!!n?n:r(e),getV7HiddenInputValueFromSections:Zin,getV6InputValueFromSections:Jin,getActiveDateManager:(t,e)=>({date:e.value,referenceDate:e.referenceValue,getSections:n=>n,getNewValuesFromNewActiveDate:n=>({value:n,referenceValue:n==null||!t.isValid(n)?e.referenceValue:n})}),parseValueStr:(t,e,n)=>n(t.trim(),e)},Cle=({props:t,value:e,timezone:n,adapter:r})=>{if(e===null)return null;const{shouldDisableDate:i,shouldDisableMonth:o,shouldDisableYear:s,disablePast:a,disableFuture:l}=t,c=r.utils.date(void 0,n),u=Du(r.utils,t.minDate,r.defaultDates.minDate),f=Du(r.utils,t.maxDate,r.defaultDates.maxDate);switch(!0){case!r.utils.isValid(e):return"invalidDate";case!!(i&&i(e)):return"shouldDisableDate";case!!(o&&o(e)):return"shouldDisableMonth";case!!(s&&s(e)):return"shouldDisableYear";case!!(l&&r.utils.isAfterDay(e,c)):return"disableFuture";case!!(a&&r.utils.isBeforeDay(e,c)):return"disablePast";case!!(u&&r.utils.isBeforeDay(e,u)):return"minDate";case!!(f&&r.utils.isAfterDay(e,f)):return"maxDate";default:return null}};Cle.valueManager=na;const YWe=({adapter:t,value:e,timezone:n,props:r})=>{if(e===null)return null;const{minTime:i,maxTime:o,minutesStep:s,shouldDisableTime:a,disableIgnoringDatePartForTimeValidation:l=!1,disablePast:c,disableFuture:u}=r,f=t.utils.date(void 0,n),d=JR(l,t.utils);switch(!0){case!t.utils.isValid(e):return"invalidDate";case!!(i&&d(i,e)):return"minTime";case!!(o&&d(e,o)):return"maxTime";case!!(u&&t.utils.isAfter(e,f)):return"disableFuture";case!!(c&&t.utils.isBefore(e,f)):return"disablePast";case!!(a&&a(e,"hours")):return"shouldDisableTime-hours";case!!(a&&a(e,"minutes")):return"shouldDisableTime-minutes";case!!(a&&a(e,"seconds")):return"shouldDisableTime-seconds";case!!(s&&t.utils.getMinutes(e)%s!==0):return"minutesStep";default:return null}};YWe.valueManager=na;const bU=({adapter:t,value:e,timezone:n,props:r})=>{const i=Cle({adapter:t,value:e,timezone:n,props:r});return i!==null?i:YWe({adapter:t,value:e,timezone:n,props:r})};bU.valueManager=na;const QWe=["disablePast","disableFuture","minDate","maxDate","shouldDisableDate","shouldDisableMonth","shouldDisableYear"],KWe=["disablePast","disableFuture","minTime","maxTime","shouldDisableTime","minutesStep","ampm","disableIgnoringDatePartForTimeValidation"],ZWe=["minDateTime","maxDateTime"],lon=[...QWe,...KWe,...ZWe],JWe=t=>lon.reduce((e,n)=>(t.hasOwnProperty(n)&&(e[n]=t[n]),e),{}),con=t=>({components:{MuiLocalizationProvider:{defaultProps:{localeText:ve({},t)}}}}),eVe=t=>{const{utils:e,formatKey:n,contextTranslation:r,propsTranslation:i}=t;return o=>{const s=o!==null&&e.isValid(o)?e.format(o,n):null;return(i??r)(o,e,s)}},tVe={previousMonth:"Previous month",nextMonth:"Next month",openPreviousView:"Open previous view",openNextView:"Open next view",calendarViewSwitchingButtonAriaLabel:t=>t==="year"?"year view is open, switch to calendar view":"calendar view is open, switch to year view",start:"Start",end:"End",startDate:"Start date",startTime:"Start time",endDate:"End date",endTime:"End time",cancelButtonLabel:"Cancel",clearButtonLabel:"Clear",okButtonLabel:"OK",todayButtonLabel:"Today",datePickerToolbarTitle:"Select date",dateTimePickerToolbarTitle:"Select date & time",timePickerToolbarTitle:"Select time",dateRangePickerToolbarTitle:"Select date range",clockLabelText:(t,e,n,r)=>`Select ${t}. ${!r&&(e===null||!n.isValid(e))?"No time selected":`Selected time is ${r??n.format(e,"fullTime")}`}`,hoursClockNumberText:t=>`${t} hours`,minutesClockNumberText:t=>`${t} minutes`,secondsClockNumberText:t=>`${t} seconds`,selectViewText:t=>`Select ${t}`,calendarWeekNumberHeaderLabel:"Week number",calendarWeekNumberHeaderText:"#",calendarWeekNumberAriaLabelText:t=>`Week ${t}`,calendarWeekNumberText:t=>`${t}`,openDatePickerDialogue:(t,e,n)=>n||t!==null&&e.isValid(t)?`Choose date, selected date is ${n??e.format(t,"fullDate")}`:"Choose date",openTimePickerDialogue:(t,e,n)=>n||t!==null&&e.isValid(t)?`Choose time, selected time is ${n??e.format(t,"fullTime")}`:"Choose time",fieldClearLabel:"Clear",timeTableLabel:"pick time",dateTableLabel:"pick date",fieldYearPlaceholder:t=>"Y".repeat(t.digitAmount),fieldMonthPlaceholder:t=>t.contentType==="letter"?"MMMM":"MM",fieldDayPlaceholder:()=>"DD",fieldWeekDayPlaceholder:t=>t.contentType==="letter"?"EEEE":"EE",fieldHoursPlaceholder:()=>"hh",fieldMinutesPlaceholder:()=>"mm",fieldSecondsPlaceholder:()=>"ss",fieldMeridiemPlaceholder:()=>"aa",year:"Year",month:"Month",day:"Day",weekDay:"Week day",hours:"Hours",minutes:"Minutes",seconds:"Seconds",meridiem:"Meridiem",empty:"Empty"},uon=tVe;con(tVe);const C1=()=>{const t=D.useContext(LQ);if(t===null)throw new Error(["MUI X: Can not find the date and time pickers localization context.","It looks like you forgot to wrap your component in LocalizationProvider.","This can also happen if you are bundling multiple versions of the `@mui/x-date-pickers` package"].join(` `));if(t.utils===null)throw new Error(["MUI X: Can not find the date and time pickers adapter from its localization context.","It looks like you forgot to pass a `dateAdapter` to your LocalizationProvider."].join(` -`));const e=D.useMemo(()=>ve({},mon,t.localeText),[t.localeText]);return D.useMemo(()=>ve({},t,{localeText:e}),[t,e])},pr=()=>Cb().utils,rD=()=>Cb().defaultDates,Ob=t=>{const e=pr(),n=D.useRef();return n.current===void 0&&(n.current=e.date(void 0,t)),n.current};function AWe(t){const{props:e,validator:n,value:r,timezone:i,onError:o}=t,s=Cb(),a=D.useRef(n.valueManager.defaultErrorState),l=n({adapter:s,value:r,timezone:i,props:e}),c=n.valueManager.hasError(l);D.useEffect(()=>{o&&!n.valueManager.isSameError(l,a.current)&&o(l,r),a.current=l},[n,o,l,r]);const u=st(f=>n({adapter:s,value:f,timezone:i,props:e}));return{validationError:l,hasValidationError:c,getValidationErrorForNewValue:u}}const Rl=()=>Cb().localeText,von=({utils:t,format:e})=>{let n=10,r=e,i=t.expandFormat(e);for(;i!==r;)if(r=i,i=t.expandFormat(r),n-=1,n<0)throw new Error("MUI X: The format expansion seems to be in an infinite loop. Please open an issue with the format passed to the picker component.");return i},yon=({utils:t,expandedFormat:e})=>{const n=[],{start:r,end:i}=t.escapedCharacters,o=new RegExp(`(\\${r}[^\\${i}]*\\${i})+`,"g");let s=null;for(;s=o.exec(e);)n.push({start:s.index,end:o.lastIndex-1});return n},xon=(t,e,n,r)=>{switch(n.type){case"year":return e.fieldYearPlaceholder({digitAmount:t.formatByString(t.date(void 0,"default"),r).length,format:r});case"month":return e.fieldMonthPlaceholder({contentType:n.contentType,format:r});case"day":return e.fieldDayPlaceholder({format:r});case"weekDay":return e.fieldWeekDayPlaceholder({contentType:n.contentType,format:r});case"hours":return e.fieldHoursPlaceholder({format:r});case"minutes":return e.fieldMinutesPlaceholder({format:r});case"seconds":return e.fieldSecondsPlaceholder({format:r});case"meridiem":return e.fieldMeridiemPlaceholder({format:r});default:return r}},bon=({utils:t,date:e,shouldRespectLeadingZeros:n,localeText:r,localizedDigits:i,now:o,token:s,startSeparator:a})=>{if(s==="")throw new Error("MUI X: Should not call `commitToken` with an empty token");const l=mWe(t,s),c=wWe(t,l.contentType,l.type,s),u=n?c:l.contentType==="digit",f=e!=null&&t.isValid(e);let d=f?t.formatByString(e,s):"",h=null;if(u)if(c)h=d===""?t.formatByString(o,s).length:d.length;else{if(l.maxLength==null)throw new Error(`MUI X: The token ${s} should have a 'maxDigitNumber' property on it's adapter`);h=l.maxLength,f&&(d=ile(yWe(P1(d,i),h),i))}return ve({},l,{format:s,maxLength:h,value:d,placeholder:xon(t,r,l,s),hasLeadingZerosInFormat:c,hasLeadingZerosInInput:u,startSeparator:a,endSeparator:"",modified:!1})},won=t=>{var h;const{utils:e,expandedFormat:n,escapedParts:r}=t,i=e.date(void 0),o=[];let s="";const a=Object.keys(e.formatTokenMap).sort((p,g)=>g.length-p.length),l=/^([a-zA-Z]+)/,c=new RegExp(`^(${a.join("|")})*$`),u=new RegExp(`^(${a.join("|")})`),f=p=>r.find(g=>g.start<=p&&g.end>=p);let d=0;for(;d0;){const y=u.exec(v)[1];v=v.slice(y.length),o.push(bon(ve({},t,{now:i,token:y,startSeparator:s}))),s=""}d+=m.length}else{const v=n[d];g&&(p==null?void 0:p.start)===d||(p==null?void 0:p.end)===d||(o.length===0?s+=v:o[o.length-1].endSeparator+=v),d+=1}}return o.length===0&&s.length>0&&o.push({type:"empty",contentType:"letter",maxLength:null,format:"",value:"",placeholder:"",hasLeadingZerosInFormat:!1,hasLeadingZerosInInput:!1,startSeparator:s,endSeparator:"",modified:!1}),o},_on=({isRtl:t,formatDensity:e,sections:n})=>n.map(r=>{const i=o=>{let s=o;return t&&s!==null&&s.includes(" ")&&(s=`⁩${s}⁦`),e==="spacious"&&["/",".","-"].includes(s)&&(s=` ${s} `),s};return r.startSeparator=i(r.startSeparator),r.endSeparator=i(r.endSeparator),r}),t1e=t=>{let e=von(t);t.isRtl&&t.enableAccessibleFieldDOMStructure&&(e=e.split(" ").reverse().join(" "));const n=yon(ve({},t,{expandedFormat:e})),r=won(ve({},t,{expandedFormat:e,escapedParts:n}));return _on(ve({},t,{sections:r}))},ale=({timezone:t,value:e,defaultValue:n,onChange:r,valueManager:i})=>{const o=pr(),s=D.useRef(n),a=e??s.current??i.emptyValue,l=D.useMemo(()=>i.getTimezone(o,a),[o,i,a]),c=st(h=>l==null?h:i.setTimezone(o,l,h)),u=t??l??"default",f=D.useMemo(()=>i.setTimezone(o,u,a),[i,o,u,a]),d=st((h,...p)=>{const g=c(h);r==null||r(g,...p)});return{value:f,handleValueChange:d,timezone:u}},qO=({name:t,timezone:e,value:n,defaultValue:r,onChange:i,valueManager:o})=>{const[s,a]=wc({name:t,state:"value",controlled:n,default:r??o.emptyValue}),l=st((c,...u)=>{a(c),i==null||i(c,...u)});return ale({timezone:e,value:s,defaultValue:void 0,onChange:l,valueManager:o})},Son=t=>{const e=pr(),n=Rl(),r=Cb(),i=Ho(),{valueManager:o,fieldValueManager:s,valueType:a,validator:l,internalProps:c,internalProps:{value:u,defaultValue:f,referenceDate:d,onChange:h,format:p,formatDensity:g="dense",selectedSections:m,onSelectedSectionsChange:v,shouldRespectLeadingZeros:y=!1,timezone:x,enableAccessibleFieldDOMStructure:b=!1}}=t,{timezone:w,value:_,handleValueChange:S}=ale({timezone:x,value:u,defaultValue:f,onChange:h,valueManager:o}),O=D.useMemo(()=>ton(e),[e]),k=D.useMemo(()=>son(e,O,w),[e,O,w]),E=D.useCallback((q,Y=null)=>s.getSectionsFromValue(e,q,Y,le=>t1e({utils:e,localeText:n,localizedDigits:O,format:p,date:le,formatDensity:g,shouldRespectLeadingZeros:y,enableAccessibleFieldDOMStructure:b,isRtl:i})),[s,p,n,O,i,y,e,g,b]),[M,A]=D.useState(()=>{const q=E(_),Y={sections:q,value:_,referenceValue:o.emptyValue,tempValueStrAndroid:null},le=Kin(q),K=o.getInitialReferenceValue({referenceDate:d,value:_,utils:e,props:c,granularity:le,timezone:w});return ve({},Y,{referenceValue:K})}),[P,T]=wc({controlled:m,default:null,name:"useField",state:"selectedSections"}),R=q=>{T(q),v==null||v(q)},I=D.useMemo(()=>wQ(P,M.sections),[P,M.sections]),B=I==="all"?0:I,$=({value:q,referenceValue:Y,sections:le})=>{if(A(ee=>ve({},ee,{sections:le,value:q,referenceValue:Y,tempValueStrAndroid:null})),o.areValuesEqual(e,M.value,q))return;const K={validationError:l({adapter:r,value:q,timezone:w,props:c})};S(q,K)},z=(q,Y)=>{const le=[...M.sections];return le[q]=ve({},le[q],{value:Y,modified:!0}),le},L=()=>{$({value:o.emptyValue,referenceValue:M.referenceValue,sections:E(o.emptyValue)})},j=()=>{if(B==null)return;const q=M.sections[B],Y=s.getActiveDateManager(e,M,q),K=Y.getSections(M.sections).filter(te=>te.value!=="").length===(q.value===""?0:1),ee=z(B,""),re=K?null:e.getInvalidDate(),me=Y.getNewValuesFromNewActiveDate(re);$(ve({},me,{sections:ee}))},N=q=>{const Y=(ee,re)=>{const me=e.parse(ee,p);if(me==null||!e.isValid(me))return null;const te=t1e({utils:e,localeText:n,localizedDigits:O,format:p,date:me,formatDensity:g,shouldRespectLeadingZeros:y,enableAccessibleFieldDOMStructure:b,isRtl:i});return e1e(e,me,te,re,!1)},le=s.parseValueStr(q,M.referenceValue,Y),K=s.updateReferenceValue(e,le,M.referenceValue);$({value:le,referenceValue:K,sections:E(le,M.sections)})},F=({activeSection:q,newSectionValue:Y,shouldGoToNextSection:le})=>{le&&Bve({},U,te,{sections:ee,tempValueStrAndroid:null}))},H=q=>A(Y=>ve({},Y,{tempValueStrAndroid:q}));return D.useEffect(()=>{const q=E(M.value);A(Y=>ve({},Y,{sections:q}))},[p,e.locale,i]),D.useEffect(()=>{let q;o.areValuesEqual(e,M.value,_)?q=o.getTimezone(e,M.value)!==o.getTimezone(e,_):q=!0,q&&A(Y=>ve({},Y,{value:_,referenceValue:s.updateReferenceValue(e,_,Y.referenceValue),sections:E(_)}))},[_]),{state:M,activeSectionIndex:B,parsedSelectedSections:I,setSelectedSections:R,clearValue:L,clearActiveSection:j,updateSectionValue:F,updateValueFromValueStr:N,setTempAndroidValueStr:H,getSectionsFromValue:E,sectionsValueBoundaries:k,localizedDigits:O,timezone:w}},Con=5e3,aw=t=>t.saveQuery!=null,Oon=({sections:t,updateSectionValue:e,sectionsValueBoundaries:n,localizedDigits:r,setTempAndroidValueStr:i,timezone:o})=>{const s=pr(),[a,l]=D.useState(null),c=st(()=>l(null));D.useEffect(()=>{var p;a!=null&&((p=t[a.sectionIndex])==null?void 0:p.type)!==a.sectionType&&c()},[t,a,c]),D.useEffect(()=>{if(a!=null){const p=setTimeout(()=>c(),Con);return()=>{clearTimeout(p)}}return()=>{}},[a,c]);const u=({keyPressed:p,sectionIndex:g},m,v)=>{const y=p.toLowerCase(),x=t[g];if(a!=null&&(!v||v(a.value))&&a.sectionIndex===g){const w=`${a.value}${y}`,_=m(w,x);if(!aw(_))return l({sectionIndex:g,value:w,sectionType:x.type}),_}const b=m(y,x);return aw(b)&&!b.saveQuery?(c(),null):(l({sectionIndex:g,value:y,sectionType:x.type}),aw(b)?null:b)},f=p=>{const g=(y,x,b)=>{const w=x.filter(_=>_.toLowerCase().startsWith(b));return w.length===0?{saveQuery:!1}:{sectionValue:w[0],shouldGoToNextSection:w.length===1}},m=(y,x,b,w)=>{const _=S=>vWe(s,o,x.type,S);if(x.contentType==="letter")return g(x.format,_(x.format),y);if(b&&w!=null&&mWe(s,b).contentType==="letter"){const S=_(b),O=g(b,S,y);return aw(O)?{saveQuery:!1}:ve({},O,{sectionValue:w(O.sectionValue,S)})}return{saveQuery:!1}};return u(p,(y,x)=>{switch(x.type){case"month":{const b=w=>Zxe(s,w,s.formats.month,x.format);return m(y,x,s.formats.month,b)}case"weekDay":{const b=(w,_)=>_.indexOf(w).toString();return m(y,x,s.formats.weekday,b)}case"meridiem":return m(y,x);default:return{saveQuery:!1}}})},d=p=>{const g=(v,y)=>{const x=P1(v,r),b=Number(x),w=n[y.type]({currentDate:null,format:y.format,contentType:y.contentType});if(b>w.maximum)return{saveQuery:!1};if(bw.maximum||x.length===w.maximum.toString().length;return{sectionValue:xWe(s,b,w,r,y),shouldGoToNextSection:_}};return u(p,(v,y)=>{if(y.contentType==="digit"||y.contentType==="digit-with-letter")return g(v,y);if(y.type==="month"){const x=wWe(s,"digit","month","MM"),b=g(v,{type:y.type,format:"MM",hasLeadingZerosInFormat:x,hasLeadingZerosInInput:!0,contentType:"digit",maxLength:2});if(aw(b))return b;const w=Zxe(s,b.sectionValue,"MM",y.format);return ve({},b,{sectionValue:w})}if(y.type==="weekDay"){const x=g(v,y);if(aw(x))return x;const b=xU(s,y.format)[Number(x.sectionValue)-1];return ve({},x,{sectionValue:b})}return{saveQuery:!1}},v=>Kxe(v,r))};return{applyCharacterEditing:st(p=>{const g=t[p.sectionIndex],v=Kxe(p.keyPressed,r)?d(ve({},p,{keyPressed:ile(p.keyPressed,r)})):f(p);if(v==null){i(null);return}e({activeSection:g,newSectionValue:v.sectionValue,shouldGoToNextSection:v.shouldGoToNextSection})}),resetCharacterQuery:c}};function Eon(t,e){return Array.isArray(e)?e.every(n=>t.indexOf(n)!==-1):t.indexOf(e)!==-1}const Ton=(t,e)=>n=>{(n.key==="Enter"||n.key===" ")&&(t(n),n.preventDefault(),n.stopPropagation())},Za=(t=document)=>{const e=t.activeElement;return e?e.shadowRoot?Za(e.shadowRoot):e:null},ez=t=>Array.from(t.children).indexOf(Za(document)),kon="@media (pointer: fine)",Aon=t=>{const{internalProps:{disabled:e,readOnly:n=!1},forwardedProps:{sectionListRef:r,onBlur:i,onClick:o,onFocus:s,onInput:a,onPaste:l,focused:c,autoFocus:u=!1},fieldValueManager:f,applyCharacterEditing:d,resetCharacterQuery:h,setSelectedSections:p,parsedSelectedSections:g,state:m,clearActiveSection:v,clearValue:y,updateSectionValue:x,updateValueFromValueStr:b,sectionOrder:w,areAllSectionsEmpty:_,sectionsValueBoundaries:S}=t,O=D.useRef(null),k=dn(r,O),E=Rl(),M=pr(),A=Jf(),[P,T]=D.useState(!1),R=D.useMemo(()=>({syncSelectionToDOM:()=>{if(!O.current)return;const ae=document.getSelection();if(!ae)return;if(g==null){ae.rangeCount>0&&O.current.getRoot().contains(ae.getRangeAt(0).startContainer)&&ae.removeAllRanges(),P&&O.current.getRoot().blur();return}if(!O.current.getRoot().contains(Za(document)))return;const U=new window.Range;let oe;g==="all"?oe=O.current.getRoot():m.sections[g].type==="empty"?oe=O.current.getSectionContainer(g):oe=O.current.getSectionContent(g),U.selectNodeContents(oe),oe.focus(),ae.removeAllRanges(),ae.addRange(U)},getActiveSectionIndexFromDOM:()=>{const ae=Za(document);return!ae||!O.current||!O.current.getRoot().contains(ae)?null:O.current.getSectionIndexFromDOMElement(ae)},focusField:(ae=0)=>{if(!O.current)return;const U=wQ(ae,m.sections);T(!0),O.current.getSectionContent(U).focus()},setSelectedSections:ae=>{if(!O.current)return;const U=wQ(ae,m.sections);T((U==="all"?0:U)!==null),p(ae)},isFieldFocused:()=>{const ae=Za(document);return!!O.current&&O.current.getRoot().contains(ae)}}),[g,p,m.sections,P]),I=st(ae=>{if(!O.current)return;const U=m.sections[ae];O.current.getSectionContent(ae).innerHTML=U.value||U.placeholder,R.syncSelectionToDOM()}),B=st((ae,...U)=>{ae.isDefaultPrevented()||!O.current||(T(!0),o==null||o(ae,...U),g==="all"?setTimeout(()=>{const oe=document.getSelection().getRangeAt(0).startOffset;if(oe===0){p(w.startIndex);return}let ne=0,V=0;for(;V{if(a==null||a(ae),!O.current||g!=="all")return;const oe=ae.target.textContent??"";O.current.getRoot().innerHTML=m.sections.map(ne=>`${ne.startSeparator}${ne.value||ne.placeholder}${ne.endSeparator}`).join(""),R.syncSelectionToDOM(),oe.length===0||oe.charCodeAt(0)===10?(h(),y(),p("all")):oe.length>1?b(oe):d({keyPressed:oe,sectionIndex:0})}),z=st(ae=>{if(l==null||l(ae),n||g!=="all"){ae.preventDefault();return}const U=ae.clipboardData.getData("text");ae.preventDefault(),h(),b(U)}),L=st((...ae)=>{if(s==null||s(...ae),P||!O.current)return;T(!0),O.current.getSectionIndexFromDOMElement(Za(document))!=null||p(w.startIndex)}),j=st((...ae)=>{i==null||i(...ae),setTimeout(()=>{if(!O.current)return;const U=Za(document);!O.current.getRoot().contains(U)&&(T(!1),p(null))})}),N=st(ae=>U=>{U.isDefaultPrevented()||p(ae)}),F=st(ae=>{ae.preventDefault()}),H=st(ae=>()=>{p(ae)}),q=st(ae=>{if(ae.preventDefault(),n||e||typeof g!="number")return;const U=m.sections[g],oe=ae.clipboardData.getData("text"),ne=/^[a-zA-Z]+$/.test(oe),V=/^[0-9]+$/.test(oe),X=/^(([a-zA-Z]+)|)([0-9]+)(([a-zA-Z]+)|)$/.test(oe);U.contentType==="letter"&&ne||U.contentType==="digit"&&V||U.contentType==="digit-with-letter"&&X?(h(),x({activeSection:U,newSectionValue:oe,shouldGoToNextSection:!0})):!ne&&!V&&(h(),b(oe))}),Y=st(ae=>{ae.preventDefault(),ae.dataTransfer.dropEffect="none"}),le=st(ae=>{if(!O.current)return;const U=ae.target,oe=U.textContent??"",ne=O.current.getSectionIndexFromDOMElement(U),V=m.sections[ne];if(n||!O.current){I(ne);return}if(oe.length===0){if(V.value===""){I(ne);return}const X=ae.nativeEvent.inputType;if(X==="insertParagraph"||X==="insertLineBreak"){I(ne);return}h(),v();return}d({keyPressed:oe,sectionIndex:ne}),I(ne)});Ei(()=>{if(!(!P||!O.current)){if(g==="all")O.current.getRoot().focus();else if(typeof g=="number"){const ae=O.current.getSectionContent(g);ae&&ae.focus()}}},[g,P]);const K=D.useMemo(()=>m.sections.reduce((ae,U)=>(ae[U.type]=S[U.type]({currentDate:null,contentType:U.contentType,format:U.format}),ae),{}),[S,m.sections]),ee=g==="all",re=D.useMemo(()=>m.sections.map((ae,U)=>{const oe=!ee&&!e&&!n;return{container:{"data-sectionindex":U,onClick:N(U)},content:{tabIndex:ee||U>0?-1:0,contentEditable:!ee&&!e&&!n,role:"spinbutton",id:`${A}-${ae.type}`,"aria-labelledby":`${A}-${ae.type}`,"aria-readonly":n,"aria-valuenow":fon(ae,M),"aria-valuemin":K[ae.type].minimum,"aria-valuemax":K[ae.type].maximum,"aria-valuetext":ae.value?uon(ae,M):E.empty,"aria-label":E[ae.type],"aria-disabled":e,spellCheck:oe?!1:void 0,autoCapitalize:oe?"off":void 0,autoCorrect:oe?"off":void 0,[parseInt(D.version,10)>=17?"enterKeyHint":"enterkeyhint"]:oe?"next":void 0,children:ae.value||ae.placeholder,onInput:le,onPaste:q,onFocus:H(U),onDragOver:Y,onMouseUp:F,inputMode:ae.contentType==="letter"?"text":"numeric"},before:{children:ae.startSeparator},after:{children:ae.endSeparator}}}),[m.sections,H,q,Y,le,N,F,e,n,ee,E,M,K,A]),me=st(ae=>{b(ae.target.value)}),te=D.useMemo(()=>_?"":f.getV7HiddenInputValueFromSections(m.sections),[_,m.sections,f]);return D.useEffect(()=>{if(O.current==null)throw new Error(["MUI X: The `sectionListRef` prop has not been initialized by `PickersSectionList`","You probably tried to pass a component to the `textField` slot that contains an `` element instead of a `PickersSectionList`.","","If you want to keep using an `` HTML element for the editing, please remove the `enableAccessibleFieldDOMStructure` prop from your picker or field component:","","","","Learn more about the field accessible DOM structure on the MUI documentation: https://mui.com/x/react-date-pickers/fields/#fields-to-edit-a-single-element"].join(` -`));u&&O.current&&O.current.getSectionContent(w.startIndex).focus()},[]),{interactions:R,returnedValue:{autoFocus:u,readOnly:n,focused:c??P,sectionListRef:k,onBlur:j,onClick:B,onFocus:L,onInput:$,onPaste:z,enableAccessibleFieldDOMStructure:!0,elements:re,tabIndex:g===0?-1:0,contentEditable:ee,value:te,onChange:me,areAllSectionsEmpty:_}}},p_=t=>t.replace(/[\u2066\u2067\u2068\u2069]/g,""),Pon=(t,e,n)=>{let r=0,i=n?1:0;const o=[];for(let s=0;s{const e=Ho(),n=D.useRef(),r=D.useRef(),{forwardedProps:{onFocus:i,onClick:o,onPaste:s,onBlur:a,inputRef:l,placeholder:c},internalProps:{readOnly:u=!1,disabled:f=!1},parsedSelectedSections:d,activeSectionIndex:h,state:p,fieldValueManager:g,valueManager:m,applyCharacterEditing:v,resetCharacterQuery:y,updateSectionValue:x,updateValueFromValueStr:b,clearActiveSection:w,clearValue:_,setTempAndroidValueStr:S,setSelectedSections:O,getSectionsFromValue:k,areAllSectionsEmpty:E,localizedDigits:M}=t,A=D.useRef(null),P=dn(l,A),T=D.useMemo(()=>Pon(p.sections,M,e),[p.sections,M,e]),R=D.useMemo(()=>({syncSelectionToDOM:()=>{if(!A.current)return;if(d==null){A.current.scrollLeft&&(A.current.scrollLeft=0);return}if(A.current!==Za(document))return;const le=A.current.scrollTop;if(d==="all")A.current.select();else{const K=T[d],ee=K.type==="empty"?K.startInInput-K.startSeparator.length:K.startInInput,re=K.type==="empty"?K.endInInput+K.endSeparator.length:K.endInInput;(ee!==A.current.selectionStart||re!==A.current.selectionEnd)&&A.current===Za(document)&&A.current.setSelectionRange(ee,re),clearTimeout(r.current),r.current=setTimeout(()=>{A.current&&A.current===Za(document)&&A.current.selectionStart===A.current.selectionEnd&&(A.current.selectionStart!==ee||A.current.selectionEnd!==re)&&R.syncSelectionToDOM()})}A.current.scrollTop=le},getActiveSectionIndexFromDOM:()=>{const le=A.current.selectionStart??0,K=A.current.selectionEnd??0;if(le===0&&K===0)return null;const ee=le<=T[0].startInInput?1:T.findIndex(re=>re.startInInput-re.startSeparator.length>le);return ee===-1?T.length-1:ee-1},focusField:(le=0)=>{var K;(K=A.current)==null||K.focus(),O(le)},setSelectedSections:le=>O(le),isFieldFocused:()=>A.current===Za(document)}),[A,d,T,O]),I=()=>{const le=A.current.selectionStart??0;let K;le<=T[0].startInInput||le>=T[T.length-1].endInInput?K=1:K=T.findIndex(re=>re.startInInput-re.startSeparator.length>le);const ee=K===-1?T.length-1:K-1;O(ee)},B=st((...le)=>{i==null||i(...le);const K=A.current;clearTimeout(n.current),n.current=setTimeout(()=>{!K||K!==A.current||h==null&&(K.value.length&&Number(K.selectionEnd)-Number(K.selectionStart)===K.value.length?O("all"):I())})}),$=st((le,...K)=>{le.isDefaultPrevented()||(o==null||o(le,...K),I())}),z=st(le=>{if(s==null||s(le),le.preventDefault(),u||f)return;const K=le.clipboardData.getData("text");if(typeof d=="number"){const ee=p.sections[d],re=/^[a-zA-Z]+$/.test(K),me=/^[0-9]+$/.test(K),te=/^(([a-zA-Z]+)|)([0-9]+)(([a-zA-Z]+)|)$/.test(K);if(ee.contentType==="letter"&&re||ee.contentType==="digit"&&me||ee.contentType==="digit-with-letter"&&te){y(),x({activeSection:ee,newSectionValue:K,shouldGoToNextSection:!0});return}if(re||me)return}y(),b(K)}),L=st((...le)=>{a==null||a(...le),O(null)}),j=st(le=>{if(u)return;const K=le.target.value;if(K===""){y(),_();return}const ee=le.nativeEvent.data,re=ee&&ee.length>1,me=re?ee:K,te=p_(me);if(h==null||re){b(re?ee:te);return}let ae;if(d==="all"&&te.length===1)ae=te;else{const U=p_(g.getV6InputValueFromSections(T,M,e));let oe=-1,ne=-1;for(let he=0;heV.end)return;const Z=te.length-U.length+V.end-p_(V.endSeparator||"").length;ae=te.slice(V.start+p_(V.startSeparator||"").length,Z)}if(ae.length===0){lon()&&S(me),y(),w();return}v({keyPressed:ae,sectionIndex:h})}),N=D.useMemo(()=>c!==void 0?c:g.getV6InputValueFromSections(k(m.emptyValue),M,e),[c,g,k,m.emptyValue,M,e]),F=D.useMemo(()=>p.tempValueStrAndroid??g.getV6InputValueFromSections(p.sections,M,e),[p.sections,g,p.tempValueStrAndroid,M,e]);D.useEffect(()=>(A.current&&A.current===Za(document)&&O("all"),()=>{clearTimeout(n.current),clearTimeout(r.current)}),[]);const H=D.useMemo(()=>h==null||p.sections[h].contentType==="letter"?"text":"numeric",[h,p.sections]),Y=!(A.current&&A.current===Za(document))&&E;return{interactions:R,returnedValue:{readOnly:u,onBlur:L,onClick:$,onFocus:B,onPaste:z,inputRef:P,enableAccessibleFieldDOMStructure:!1,placeholder:N,inputMode:H,autoComplete:"off",value:Y?"":F,onChange:j}}},Ron=t=>{const e=pr(),{internalProps:n,internalProps:{unstableFieldRef:r,minutesStep:i,enableAccessibleFieldDOMStructure:o=!1,disabled:s=!1,readOnly:a=!1},forwardedProps:{onKeyDown:l,error:c,clearable:u,onClear:f},fieldValueManager:d,valueManager:h,validator:p}=t,g=Ho(),m=Son(t),{state:v,activeSectionIndex:y,parsedSelectedSections:x,setSelectedSections:b,clearValue:w,clearActiveSection:_,updateSectionValue:S,setTempAndroidValueStr:O,sectionsValueBoundaries:k,localizedDigits:E,timezone:M}=m,A=Oon({sections:v.sections,updateSectionValue:S,sectionsValueBoundaries:k,localizedDigits:E,setTempAndroidValueStr:O,timezone:M}),{resetCharacterQuery:P}=A,T=h.areValuesEqual(e,v.value,h.emptyValue),R=o?Aon:Mon,I=D.useMemo(()=>con(v.sections,g&&!o),[v.sections,g,o]),{returnedValue:B,interactions:$}=R(ve({},t,m,A,{areAllSectionsEmpty:T,sectionOrder:I})),z=st(q=>{if(l==null||l(q),!s)switch(!0){case((q.ctrlKey||q.metaKey)&&String.fromCharCode(q.keyCode)==="A"&&!q.shiftKey&&!q.altKey):{q.preventDefault(),b("all");break}case q.key==="ArrowRight":{if(q.preventDefault(),x==null)b(I.startIndex);else if(x==="all")b(I.endIndex);else{const Y=I.neighbors[x].rightIndex;Y!==null&&b(Y)}break}case q.key==="ArrowLeft":{if(q.preventDefault(),x==null)b(I.endIndex);else if(x==="all")b(I.startIndex);else{const Y=I.neighbors[x].leftIndex;Y!==null&&b(Y)}break}case q.key==="Delete":{if(q.preventDefault(),a)break;x==null||x==="all"?w():_(),P();break}case["ArrowUp","ArrowDown","Home","End","PageUp","PageDown"].includes(q.key):{if(q.preventDefault(),a||y==null)break;const Y=v.sections[y],le=d.getActiveDateManager(e,v,Y),K=non(e,M,Y,q.key,k,E,le.date,{minutesStep:i});S({activeSection:Y,newSectionValue:K,shouldGoToNextSection:!1});break}}});Ei(()=>{$.syncSelectionToDOM()});const{hasValidationError:L}=AWe({props:n,validator:p,timezone:M,value:v.value,onError:n.onError}),j=D.useMemo(()=>c!==void 0?c:L,[L,c]);D.useEffect(()=>{!j&&y==null&&P()},[v.referenceValue,y,j]),D.useEffect(()=>{v.tempValueStrAndroid!=null&&y!=null&&(P(),_())},[v.sections]),D.useImperativeHandle(r,()=>({getSections:()=>v.sections,getActiveSectionIndex:$.getActiveSectionIndexFromDOM,setSelectedSections:$.setSelectedSections,focusField:$.focusField,isFieldFocused:$.isFieldFocused}));const N=st((q,...Y)=>{q.preventDefault(),f==null||f(q,...Y),w(),$.isFieldFocused()?b(I.startIndex):$.focusField(0)}),F={onKeyDown:z,onClear:N,error:j,clearable:!!(u&&!T&&!a&&!s)},H={disabled:s,readOnly:a};return ve({},t.forwardedProps,F,H,B)},Don=lt(C.jsx("path",{d:"M7 10l5 5 5-5z"}),"ArrowDropDown"),Ion=lt(C.jsx("path",{d:"M15.41 16.59L10.83 12l4.58-4.59L14 6l-6 6 6 6 1.41-1.41z"}),"ArrowLeft"),Lon=lt(C.jsx("path",{d:"M8.59 16.59L13.17 12 8.59 7.41 10 6l6 6-6 6-1.41-1.41z"}),"ArrowRight"),$on=lt(C.jsx("path",{d:"M17 12h-5v5h5v-5zM16 1v2H8V1H6v2H5c-1.11 0-1.99.9-1.99 2L3 19c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2h-1V1h-2zm3 18H5V8h14v11z"}),"Calendar");lt(C.jsxs(D.Fragment,{children:[C.jsx("path",{d:"M11.99 2C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2zM12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z"}),C.jsx("path",{d:"M12.5 7H11v6l5.25 3.15.75-1.23-4.5-2.67z"})]}),"Clock");const Fon=lt(C.jsx("path",{d:"M9 11H7v2h2v-2zm4 0h-2v2h2v-2zm4 0h-2v2h2v-2zm2-7h-1V2h-2v2H8V2H6v2H5c-1.11 0-1.99.9-1.99 2L3 20c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm0 16H5V9h14v11z"}),"DateRange"),Non=lt(C.jsxs(D.Fragment,{children:[C.jsx("path",{d:"M11.99 2C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2zM12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z"}),C.jsx("path",{d:"M12.5 7H11v6l5.25 3.15.75-1.23-4.5-2.67z"})]}),"Time"),zon=lt(C.jsx("path",{d:"M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"}),"Clear"),jon=["clearable","onClear","InputProps","sx","slots","slotProps"],Bon=["ownerState"],Uon=t=>{const e=Rl(),{clearable:n,onClear:r,InputProps:i,sx:o,slots:s,slotProps:a}=t,l=Dt(t,jon),c=(s==null?void 0:s.clearButton)??Ht,u=Zt({elementType:c,externalSlotProps:a==null?void 0:a.clearButton,ownerState:{},className:"clearButton",additionalProps:{title:e.fieldClearLabel}}),f=Dt(u,Bon),d=(s==null?void 0:s.clearIcon)??zon,h=Zt({elementType:d,externalSlotProps:a==null?void 0:a.clearIcon,ownerState:{}});return ve({},l,{InputProps:ve({},i,{endAdornment:C.jsxs(D.Fragment,{children:[n&&C.jsx(WAe,{position:"end",sx:{marginRight:i!=null&&i.endAdornment?-1:-1.5},children:C.jsx(c,ve({},f,{onClick:r,children:C.jsx(d,ve({fontSize:"small"},h))}))}),i==null?void 0:i.endAdornment]})}),sx:[{"& .clearButton":{opacity:1},"@media (pointer: fine)":{"& .clearButton":{opacity:0},"&:hover, &:focus-within":{".clearButton":{opacity:1}}}},...Array.isArray(o)?o:[o]]})},Won=["value","defaultValue","referenceDate","format","formatDensity","onChange","timezone","onError","shouldRespectLeadingZeros","selectedSections","onSelectedSectionsChange","unstableFieldRef","enableAccessibleFieldDOMStructure","disabled","readOnly","dateSeparator"],Von=(t,e)=>D.useMemo(()=>{const n=ve({},t),r={},i=o=>{n.hasOwnProperty(o)&&(r[o]=n[o],delete n[o])};return Won.forEach(i),SWe.forEach(i),CWe.forEach(i),OWe.forEach(i),{forwardedProps:n,internalProps:r}},[t,e]),Gon=D.createContext(null);function PWe(t){const{contextValue:e,localeText:n,children:r}=t;return C.jsx(Gon.Provider,{value:e,children:C.jsx(pWe,{localeText:n,children:r})})}const Hon=t=>{const e=pr(),n=rD(),i=t.ampm??e.is12HourCycleInCurrentLocale()?e.formats.keyboardDateTime12h:e.formats.keyboardDateTime24h;return ve({},t,{disablePast:t.disablePast??!1,disableFuture:t.disableFuture??!1,format:t.format??i,disableIgnoringDatePartForTimeValidation:!!(t.minDateTime||t.maxDateTime),minDate:Du(e,t.minDateTime??t.minDate,n.minDate),maxDate:Du(e,t.maxDateTime??t.maxDate,n.maxDate),minTime:t.minDateTime??t.minTime,maxTime:t.maxDateTime??t.maxTime})},qon=t=>{const e=Hon(t),{forwardedProps:n,internalProps:r}=Von(e,"date-time");return Ron({forwardedProps:n,internalProps:r,valueManager:ia,fieldValueManager:hon,validator:bU,valueType:"date-time"})};function Xon(t){return Ye("MuiPickersTextField",t)}qe("MuiPickersTextField",["root","focused","disabled","error","required"]);function Yon(t){return Ye("MuiPickersInputBase",t)}const H_=qe("MuiPickersInputBase",["root","focused","disabled","error","notchedOutline","sectionContent","sectionBefore","sectionAfter","adornedStart","adornedEnd","input"]);function Qon(t){return Ye("MuiPickersSectionList",t)}const y2=qe("MuiPickersSectionList",["root","section","sectionContent"]),Kon=["slots","slotProps","elements","sectionListRef"],MWe=be("div",{name:"MuiPickersSectionList",slot:"Root",overridesResolver:(t,e)=>e.root})({direction:"ltr /*! @noflip */",outline:"none"}),RWe=be("span",{name:"MuiPickersSectionList",slot:"Section",overridesResolver:(t,e)=>e.section})({}),DWe=be("span",{name:"MuiPickersSectionList",slot:"SectionSeparator",overridesResolver:(t,e)=>e.sectionSeparator})({whiteSpace:"pre"}),IWe=be("span",{name:"MuiPickersSectionList",slot:"SectionContent",overridesResolver:(t,e)=>e.sectionContent})({outline:"none"}),Zon=t=>{const{classes:e}=t;return Xe({root:["root"],section:["section"],sectionContent:["sectionContent"]},Qon,e)};function Jon(t){const{slots:e,slotProps:n,element:r,classes:i}=t,o=(e==null?void 0:e.section)??RWe,s=Zt({elementType:o,externalSlotProps:n==null?void 0:n.section,externalForwardedProps:r.container,className:i.section,ownerState:{}}),a=(e==null?void 0:e.sectionContent)??IWe,l=Zt({elementType:a,externalSlotProps:n==null?void 0:n.sectionContent,externalForwardedProps:r.content,additionalProps:{suppressContentEditableWarning:!0},className:i.sectionContent,ownerState:{}}),c=(e==null?void 0:e.sectionSeparator)??DWe,u=Zt({elementType:c,externalSlotProps:n==null?void 0:n.sectionSeparator,externalForwardedProps:r.before,ownerState:{position:"before"}}),f=Zt({elementType:c,externalSlotProps:n==null?void 0:n.sectionSeparator,externalForwardedProps:r.after,ownerState:{position:"after"}});return C.jsxs(o,ve({},s,{children:[C.jsx(c,ve({},u)),C.jsx(a,ve({},l)),C.jsx(c,ve({},f))]}))}const esn=D.forwardRef(function(e,n){const r=An({props:e,name:"MuiPickersSectionList"}),{slots:i,slotProps:o,elements:s,sectionListRef:a}=r,l=Dt(r,Kon),c=Zon(r),u=D.useRef(null),f=dn(n,u),d=g=>{if(!u.current)throw new Error(`MUI X: Cannot call sectionListRef.${g} before the mount of the component.`);return u.current};D.useImperativeHandle(a,()=>({getRoot(){return d("getRoot")},getSectionContainer(g){return d("getSectionContainer").querySelector(`.${y2.section}[data-sectionindex="${g}"]`)},getSectionContent(g){return d("getSectionContent").querySelector(`.${y2.section}[data-sectionindex="${g}"] .${y2.sectionContent}`)},getSectionIndexFromDOMElement(g){const m=d("getSectionIndexFromDOMElement");if(g==null||!m.contains(g))return null;let v=null;return g.classList.contains(y2.section)?v=g:g.classList.contains(y2.sectionContent)&&(v=g.parentElement),v==null?null:Number(v.dataset.sectionindex)}}));const h=(i==null?void 0:i.root)??MWe,p=Zt({elementType:h,externalSlotProps:o==null?void 0:o.root,externalForwardedProps:l,additionalProps:{ref:f,suppressContentEditableWarning:!0},className:c.root,ownerState:{}});return C.jsx(h,ve({},p,{children:p.contentEditable?s.map(({content:g,before:m,after:v})=>`${m.children}${g.children}${v.children}`).join(""):C.jsx(D.Fragment,{children:s.map((g,m)=>C.jsx(Jon,{slots:i,slotProps:o,element:g,classes:c},m))})}))}),tsn=["elements","areAllSectionsEmpty","defaultValue","label","value","onChange","id","autoFocus","endAdornment","startAdornment","renderSuffix","slots","slotProps","contentEditable","tabIndex","onInput","onPaste","onKeyDown","fullWidth","name","readOnly","inputProps","inputRef","sectionListRef"],nsn=t=>Math.round(t*1e5)/1e5,wU=be("div",{name:"MuiPickersInputBase",slot:"Root",overridesResolver:(t,e)=>e.root})(({theme:t})=>ve({},t.typography.body1,{color:(t.vars||t).palette.text.primary,cursor:"text",padding:0,display:"flex",justifyContent:"flex-start",alignItems:"center",position:"relative",boxSizing:"border-box",letterSpacing:`${nsn(.15/16)}em`,variants:[{props:{fullWidth:!0},style:{width:"100%"}}]})),lle=be(MWe,{name:"MuiPickersInputBase",slot:"SectionsContainer",overridesResolver:(t,e)=>e.sectionsContainer})(({theme:t})=>({padding:"4px 0 5px",fontFamily:t.typography.fontFamily,fontSize:"inherit",lineHeight:"1.4375em",flexGrow:1,outline:"none",display:"flex",flexWrap:"nowrap",overflow:"hidden",letterSpacing:"inherit",width:"182px",variants:[{props:{isRtl:!0},style:{textAlign:"right /*! @noflip */"}},{props:{size:"small"},style:{paddingTop:1}},{props:{adornedStart:!1,focused:!1,filled:!1},style:{color:"currentColor",opacity:0}},{props:({adornedStart:e,focused:n,filled:r,label:i})=>!e&&!n&&!r&&i==null,style:t.vars?{opacity:t.vars.opacity.inputPlaceholder}:{opacity:t.palette.mode==="light"?.42:.5}}]})),rsn=be(RWe,{name:"MuiPickersInputBase",slot:"Section",overridesResolver:(t,e)=>e.section})(({theme:t})=>({fontFamily:t.typography.fontFamily,fontSize:"inherit",letterSpacing:"inherit",lineHeight:"1.4375em",display:"flex"})),isn=be(IWe,{name:"MuiPickersInputBase",slot:"SectionContent",overridesResolver:(t,e)=>e.content})(({theme:t})=>({fontFamily:t.typography.fontFamily,lineHeight:"1.4375em",letterSpacing:"inherit",width:"fit-content",outline:"none"})),osn=be(DWe,{name:"MuiPickersInputBase",slot:"Separator",overridesResolver:(t,e)=>e.separator})(()=>({whiteSpace:"pre",letterSpacing:"inherit"})),ssn=be("input",{name:"MuiPickersInputBase",slot:"Input",overridesResolver:(t,e)=>e.hiddenInput})(ve({},iAe)),asn=t=>{const{focused:e,disabled:n,error:r,classes:i,fullWidth:o,readOnly:s,color:a,size:l,endAdornment:c,startAdornment:u}=t,f={root:["root",e&&!n&&"focused",n&&"disabled",s&&"readOnly",r&&"error",o&&"fullWidth",`color${De(a)}`,l==="small"&&"inputSizeSmall",!!u&&"adornedStart",!!c&&"adornedEnd"],notchedOutline:["notchedOutline"],input:["input"],sectionsContainer:["sectionsContainer"],sectionContent:["sectionContent"],sectionBefore:["sectionBefore"],sectionAfter:["sectionAfter"]};return Xe(f,Yon,i)},cle=D.forwardRef(function(e,n){const r=An({props:e,name:"MuiPickersInputBase"}),{elements:i,areAllSectionsEmpty:o,value:s,onChange:a,id:l,endAdornment:c,startAdornment:u,renderSuffix:f,slots:d,slotProps:h,contentEditable:p,tabIndex:g,onInput:m,onPaste:v,onKeyDown:y,name:x,readOnly:b,inputProps:w,inputRef:_,sectionListRef:S}=r,O=Dt(r,tsn),k=D.useRef(null),E=dn(n,k),M=dn(w==null?void 0:w.ref,_),A=Ho(),P=za();if(!P)throw new Error("MUI X: PickersInputBase should always be used inside a PickersTextField component");const T=L=>{var j;if(P.disabled){L.stopPropagation();return}(j=P.onFocus)==null||j.call(P,L)};D.useEffect(()=>{P&&P.setAdornedStart(!!u)},[P,u]),D.useEffect(()=>{P&&(o?P.onEmpty():P.onFilled())},[P,o]);const R=ve({},r,P,{isRtl:A}),I=asn(R),B=(d==null?void 0:d.root)||wU,$=Zt({elementType:B,externalSlotProps:h==null?void 0:h.root,externalForwardedProps:O,additionalProps:{"aria-invalid":P.error,ref:E},className:I.root,ownerState:R}),z=(d==null?void 0:d.input)||lle;return C.jsxs(B,ve({},$,{children:[u,C.jsx(esn,{sectionListRef:S,elements:i,contentEditable:p,tabIndex:g,className:I.sectionsContainer,onFocus:T,onBlur:P.onBlur,onInput:m,onPaste:v,onKeyDown:y,slots:{root:z,section:rsn,sectionContent:isn,sectionSeparator:osn},slotProps:{root:{ownerState:R},sectionContent:{className:H_.sectionContent},sectionSeparator:({position:L})=>({className:L==="before"?H_.sectionBefore:H_.sectionAfter})}}),c,f?f(ve({},P)):null,C.jsx(ssn,ve({name:x,className:I.input,value:s,onChange:a,id:l,"aria-hidden":"true",tabIndex:-1,readOnly:b,required:P.required,disabled:P.disabled},w,{ref:M}))]}))});function lsn(t){return Ye("MuiPickersOutlinedInput",t)}const Qu=ve({},H_,qe("MuiPickersOutlinedInput",["root","notchedOutline","input"])),csn=["children","className","label","notched","shrink"],usn=be("fieldset",{name:"MuiPickersOutlinedInput",slot:"NotchedOutline",overridesResolver:(t,e)=>e.notchedOutline})(({theme:t})=>{const e=t.palette.mode==="light"?"rgba(0, 0, 0, 0.23)":"rgba(255, 255, 255, 0.23)";return{textAlign:"left",position:"absolute",bottom:0,right:0,top:-5,left:0,margin:0,padding:"0 8px",pointerEvents:"none",borderRadius:"inherit",borderStyle:"solid",borderWidth:1,overflow:"hidden",minWidth:"0%",borderColor:t.vars?`rgba(${t.vars.palette.common.onBackgroundChannel} / 0.23)`:e}}),n1e=be("span")(({theme:t})=>({fontFamily:t.typography.fontFamily,fontSize:"inherit"})),fsn=be("legend")(({theme:t})=>({float:"unset",width:"auto",overflow:"hidden",variants:[{props:{withLabel:!1},style:{padding:0,lineHeight:"11px",transition:t.transitions.create("width",{duration:150,easing:t.transitions.easing.easeOut})}},{props:{withLabel:!0},style:{display:"block",padding:0,height:11,fontSize:"0.75em",visibility:"hidden",maxWidth:.01,transition:t.transitions.create("max-width",{duration:50,easing:t.transitions.easing.easeOut}),whiteSpace:"nowrap","& > span":{paddingLeft:5,paddingRight:5,display:"inline-block",opacity:0,visibility:"visible"}}},{props:{withLabel:!0,notched:!0},style:{maxWidth:"100%",transition:t.transitions.create("max-width",{duration:100,easing:t.transitions.easing.easeOut,delay:50})}}]}));function dsn(t){const{className:e,label:n}=t,r=Dt(t,csn),i=n!=null&&n!=="",o=ve({},t,{withLabel:i});return C.jsx(usn,ve({"aria-hidden":!0,className:e},r,{ownerState:o,children:C.jsx(fsn,{ownerState:o,children:i?C.jsx(n1e,{children:n}):C.jsx(n1e,{className:"notranslate",children:"​"})})}))}const hsn=["label","autoFocus","ownerState","notched"],psn=be(wU,{name:"MuiPickersOutlinedInput",slot:"Root",overridesResolver:(t,e)=>e.root})(({theme:t})=>{const e=t.palette.mode==="light"?"rgba(0, 0, 0, 0.23)":"rgba(255, 255, 255, 0.23)";return{padding:"0 14px",borderRadius:(t.vars||t).shape.borderRadius,[`&:hover .${Qu.notchedOutline}`]:{borderColor:(t.vars||t).palette.text.primary},"@media (hover: none)":{[`&:hover .${Qu.notchedOutline}`]:{borderColor:t.vars?`rgba(${t.vars.palette.common.onBackgroundChannel} / 0.23)`:e}},[`&.${Qu.focused} .${Qu.notchedOutline}`]:{borderStyle:"solid",borderWidth:2},[`&.${Qu.disabled}`]:{[`& .${Qu.notchedOutline}`]:{borderColor:(t.vars||t).palette.action.disabled},"*":{color:(t.vars||t).palette.action.disabled}},[`&.${Qu.error} .${Qu.notchedOutline}`]:{borderColor:(t.vars||t).palette.error.main},variants:Object.keys((t.vars??t).palette).filter(n=>{var r;return((r=(t.vars??t).palette[n])==null?void 0:r.main)??!1}).map(n=>({props:{color:n},style:{[`&.${Qu.focused}:not(.${Qu.error}) .${Qu.notchedOutline}`]:{borderColor:(t.vars||t).palette[n].main}}}))}}),gsn=be(lle,{name:"MuiPickersOutlinedInput",slot:"SectionsContainer",overridesResolver:(t,e)=>e.sectionsContainer})({padding:"16.5px 0",variants:[{props:{size:"small"},style:{padding:"8.5px 0"}}]}),msn=t=>{const{classes:e}=t,r=Xe({root:["root"],notchedOutline:["notchedOutline"],input:["input"]},lsn,e);return ve({},e,r)},LWe=D.forwardRef(function(e,n){const r=An({props:e,name:"MuiPickersOutlinedInput"}),{label:i,ownerState:o,notched:s}=r,a=Dt(r,hsn),l=za(),c=ve({},r,o,l,{color:(l==null?void 0:l.color)||"primary"}),u=msn(c);return C.jsx(cle,ve({slots:{root:psn,input:gsn},renderSuffix:f=>C.jsx(dsn,{shrink:!!(s||f.adornedStart||f.focused||f.filled),notched:!!(s||f.adornedStart||f.focused||f.filled),className:u.notchedOutline,label:i!=null&&i!==""&&(l!=null&&l.required)?C.jsxs(D.Fragment,{children:[i," ","*"]}):i,ownerState:c})},a,{label:i,classes:u,ref:n}))});LWe.muiName="Input";function vsn(t){return Ye("MuiPickersFilledInput",t)}const E0=ve({},H_,qe("MuiPickersFilledInput",["root","underline","input"])),ysn=["label","autoFocus","disableUnderline","ownerState"],xsn=be(wU,{name:"MuiPickersFilledInput",slot:"Root",overridesResolver:(t,e)=>e.root,shouldForwardProp:t=>i3(t)&&t!=="disableUnderline"})(({theme:t})=>{const e=t.palette.mode==="light",n=e?"rgba(0, 0, 0, 0.42)":"rgba(255, 255, 255, 0.7)",r=e?"rgba(0, 0, 0, 0.06)":"rgba(255, 255, 255, 0.09)",i=e?"rgba(0, 0, 0, 0.09)":"rgba(255, 255, 255, 0.13)",o=e?"rgba(0, 0, 0, 0.12)":"rgba(255, 255, 255, 0.12)";return{backgroundColor:t.vars?t.vars.palette.FilledInput.bg:r,borderTopLeftRadius:(t.vars||t).shape.borderRadius,borderTopRightRadius:(t.vars||t).shape.borderRadius,transition:t.transitions.create("background-color",{duration:t.transitions.duration.shorter,easing:t.transitions.easing.easeOut}),"&:hover":{backgroundColor:t.vars?t.vars.palette.FilledInput.hoverBg:i,"@media (hover: none)":{backgroundColor:t.vars?t.vars.palette.FilledInput.bg:r}},[`&.${E0.focused}`]:{backgroundColor:t.vars?t.vars.palette.FilledInput.bg:r},[`&.${E0.disabled}`]:{backgroundColor:t.vars?t.vars.palette.FilledInput.disabledBg:o},variants:[...Object.keys((t.vars??t).palette).filter(s=>(t.vars??t).palette[s].main).map(s=>{var a;return{props:{color:s,disableUnderline:!1},style:{"&::after":{borderBottom:`2px solid ${(a=(t.vars||t).palette[s])==null?void 0:a.main}`}}}}),{props:{disableUnderline:!1},style:{"&::after":{left:0,bottom:0,content:'""',position:"absolute",right:0,transform:"scaleX(0)",transition:t.transitions.create("transform",{duration:t.transitions.duration.shorter,easing:t.transitions.easing.easeOut}),pointerEvents:"none"},[`&.${E0.focused}:after`]:{transform:"scaleX(1) translateX(0)"},[`&.${E0.error}`]:{"&:before, &:after":{borderBottomColor:(t.vars||t).palette.error.main}},"&::before":{borderBottom:`1px solid ${t.vars?`rgba(${t.vars.palette.common.onBackgroundChannel} / ${t.vars.opacity.inputUnderline})`:n}`,left:0,bottom:0,content:'"\\00a0"',position:"absolute",right:0,transition:t.transitions.create("border-bottom-color",{duration:t.transitions.duration.shorter}),pointerEvents:"none"},[`&:hover:not(.${E0.disabled}, .${E0.error}):before`]:{borderBottom:`1px solid ${(t.vars||t).palette.text.primary}`},[`&.${E0.disabled}:before`]:{borderBottomStyle:"dotted"}}},{props:({startAdornment:s})=>!!s,style:{paddingLeft:12}},{props:({endAdornment:s})=>!!s,style:{paddingRight:12}}]}}),bsn=be(lle,{name:"MuiPickersFilledInput",slot:"sectionsContainer",overridesResolver:(t,e)=>e.sectionsContainer})({paddingTop:25,paddingRight:12,paddingBottom:8,paddingLeft:12,variants:[{props:{size:"small"},style:{paddingTop:21,paddingBottom:4}},{props:({startAdornment:t})=>!!t,style:{paddingLeft:0}},{props:({endAdornment:t})=>!!t,style:{paddingRight:0}},{props:{hiddenLabel:!0},style:{paddingTop:16,paddingBottom:17}},{props:{hiddenLabel:!0,size:"small"},style:{paddingTop:8,paddingBottom:9}}]}),wsn=t=>{const{classes:e,disableUnderline:n}=t,i=Xe({root:["root",!n&&"underline"],input:["input"]},vsn,e);return ve({},e,i)},$We=D.forwardRef(function(e,n){const r=An({props:e,name:"MuiPickersFilledInput"}),{label:i,disableUnderline:o=!1,ownerState:s}=r,a=Dt(r,ysn),l=za(),c=ve({},r,s,l,{color:(l==null?void 0:l.color)||"primary"}),u=wsn(c);return C.jsx(cle,ve({slots:{root:xsn,input:bsn},slotProps:{root:{disableUnderline:o}}},a,{label:i,classes:u,ref:n}))});$We.muiName="Input";function _sn(t){return Ye("MuiPickersFilledInput",t)}const x2=ve({},H_,qe("MuiPickersInput",["root","input"])),Ssn=["label","autoFocus","disableUnderline","ownerState"],Csn=be(wU,{name:"MuiPickersInput",slot:"Root",overridesResolver:(t,e)=>e.root})(({theme:t})=>{let n=t.palette.mode==="light"?"rgba(0, 0, 0, 0.42)":"rgba(255, 255, 255, 0.7)";return t.vars&&(n=`rgba(${t.vars.palette.common.onBackgroundChannel} / ${t.vars.opacity.inputUnderline})`),{"label + &":{marginTop:16},variants:[...Object.keys((t.vars??t).palette).filter(r=>(t.vars??t).palette[r].main).map(r=>({props:{color:r},style:{"&::after":{borderBottom:`2px solid ${(t.vars||t).palette[r].main}`}}})),{props:{disableUnderline:!1},style:{"&::after":{background:"red",left:0,bottom:0,content:'""',position:"absolute",right:0,transform:"scaleX(0)",transition:t.transitions.create("transform",{duration:t.transitions.duration.shorter,easing:t.transitions.easing.easeOut}),pointerEvents:"none"},[`&.${x2.focused}:after`]:{transform:"scaleX(1) translateX(0)"},[`&.${x2.error}`]:{"&:before, &:after":{borderBottomColor:(t.vars||t).palette.error.main}},"&::before":{borderBottom:`1px solid ${n}`,left:0,bottom:0,content:'"\\00a0"',position:"absolute",right:0,transition:t.transitions.create("border-bottom-color",{duration:t.transitions.duration.shorter}),pointerEvents:"none"},[`&:hover:not(.${x2.disabled}, .${x2.error}):before`]:{borderBottom:`2px solid ${(t.vars||t).palette.text.primary}`,"@media (hover: none)":{borderBottom:`1px solid ${n}`}},[`&.${x2.disabled}:before`]:{borderBottomStyle:"dotted"}}}]}}),Osn=t=>{const{classes:e,disableUnderline:n}=t,i=Xe({root:["root",!n&&"underline"],input:["input"]},_sn,e);return ve({},e,i)},FWe=D.forwardRef(function(e,n){const r=An({props:e,name:"MuiPickersInput"}),{label:i,disableUnderline:o=!1,ownerState:s}=r,a=Dt(r,Ssn),l=za(),c=ve({},r,s,l,{disableUnderline:o,color:(l==null?void 0:l.color)||"primary"}),u=Osn(c);return C.jsx(cle,ve({slots:{root:Csn}},a,{label:i,classes:u,ref:n}))});FWe.muiName="Input";const Esn=["onFocus","onBlur","className","color","disabled","error","variant","required","InputProps","inputProps","inputRef","sectionListRef","elements","areAllSectionsEmpty","onClick","onKeyDown","onKeyUp","onPaste","onInput","endAdornment","startAdornment","tabIndex","contentEditable","focused","value","onChange","fullWidth","id","name","helperText","FormHelperTextProps","label","InputLabelProps"],Tsn={standard:FWe,filled:$We,outlined:LWe},ksn=be(Gg,{name:"MuiPickersTextField",slot:"Root",overridesResolver:(t,e)=>e.root})({}),Asn=t=>{const{focused:e,disabled:n,classes:r,required:i}=t;return Xe({root:["root",e&&!n&&"focused",n&&"disabled",i&&"required"]},Xon,r)},Psn=D.forwardRef(function(e,n){const r=An({props:e,name:"MuiPickersTextField"}),{onFocus:i,onBlur:o,className:s,color:a="primary",disabled:l=!1,error:c=!1,variant:u="outlined",required:f=!1,InputProps:d,inputProps:h,inputRef:p,sectionListRef:g,elements:m,areAllSectionsEmpty:v,onClick:y,onKeyDown:x,onKeyUp:b,onPaste:w,onInput:_,endAdornment:S,startAdornment:O,tabIndex:k,contentEditable:E,focused:M,value:A,onChange:P,fullWidth:T,id:R,name:I,helperText:B,FormHelperTextProps:$,label:z,InputLabelProps:L}=r,j=Dt(r,Esn),N=D.useRef(null),F=dn(n,N),H=Jf(R),q=B&&H?`${H}-helper-text`:void 0,Y=z&&H?`${H}-label`:void 0,le=ve({},r,{color:a,disabled:l,error:c,focused:M,required:f,variant:u}),K=Asn(le),ee=Tsn[u];return C.jsxs(ksn,ve({className:Oe(K.root,s),ref:F,focused:M,onFocus:i,onBlur:o,disabled:l,variant:u,error:c,color:a,fullWidth:T,required:f,ownerState:le},j,{children:[C.jsx(Ly,ve({htmlFor:H,id:Y},L,{children:z})),C.jsx(ee,ve({elements:m,areAllSectionsEmpty:v,onClick:y,onKeyDown:x,onKeyUp:b,onInput:_,onPaste:w,endAdornment:S,startAdornment:O,tabIndex:k,contentEditable:E,value:A,onChange:P,id:H,fullWidth:T,inputProps:h,inputRef:p,sectionListRef:g,label:z,name:I,role:"group","aria-labelledby":Y},d)),B&&C.jsx(Eee,ve({id:q},$,{children:B}))]}))}),Msn=["enableAccessibleFieldDOMStructure"],Rsn=["InputProps","readOnly"],Dsn=["onPaste","onKeyDown","inputMode","readOnly","InputProps","inputProps","inputRef"],Isn=t=>{let{enableAccessibleFieldDOMStructure:e}=t,n=Dt(t,Msn);if(e){const{InputProps:f,readOnly:d}=n,h=Dt(n,Rsn);return ve({},h,{InputProps:ve({},f??{},{readOnly:d})})}const{onPaste:r,onKeyDown:i,inputMode:o,readOnly:s,InputProps:a,inputProps:l,inputRef:c}=n,u=Dt(n,Dsn);return ve({},u,{InputProps:ve({},a??{},{readOnly:s}),inputProps:ve({},l??{},{inputMode:o,onPaste:r,onKeyDown:i,ref:c})})},Lsn=["slots","slotProps","InputProps","inputProps"],NWe=D.forwardRef(function(e,n){const r=An({props:e,name:"MuiDateTimeField"}),{slots:i,slotProps:o,InputProps:s,inputProps:a}=r,l=Dt(r,Lsn),c=r,u=(i==null?void 0:i.textField)??(e.enableAccessibleFieldDOMStructure?Psn:ui),f=Zt({elementType:u,externalSlotProps:o==null?void 0:o.textField,externalForwardedProps:l,ownerState:c,additionalProps:{ref:n}});f.inputProps=ve({},a,f.inputProps),f.InputProps=ve({},s,f.InputProps);const d=qon(f),h=Isn(d),p=Uon(ve({},h,{slots:i,slotProps:o}));return C.jsx(u,ve({},p))});function $sn(t){return Ye("MuiDateTimePickerTabs",t)}qe("MuiDateTimePickerTabs",["root"]);const Fsn=t=>hC(t)?"date":"time",Nsn=t=>t==="date"?"day":"hours",zsn=t=>{const{classes:e}=t;return Xe({root:["root"]},$sn,e)},jsn=be(Ree,{name:"MuiDateTimePickerTabs",slot:"Root",overridesResolver:(t,e)=>e.root})(({theme:t})=>({boxShadow:`0 -1px 0 0 inset ${(t.vars||t).palette.divider}`,"&:last-child":{boxShadow:`0 1px 0 0 inset ${(t.vars||t).palette.divider}`,[`& .${c3.indicator}`]:{bottom:"auto",top:0}}})),Bsn=function(e){const n=An({props:e,name:"MuiDateTimePickerTabs"}),{dateIcon:r=C.jsx(Fon,{}),onViewChange:i,timeIcon:o=C.jsx(Non,{}),view:s,hidden:a=typeof window>"u"||window.innerHeight<667,className:l,sx:c}=n,u=Rl(),f=zsn(n),d=(h,p)=>{i(Nsn(p))};return a?null:C.jsxs(jsn,{ownerState:n,variant:"fullWidth",value:Fsn(s),onChange:d,className:Oe(l,f.root),sx:c,children:[C.jsx(SS,{value:"date","aria-label":u.dateTableLabel,icon:C.jsx(D.Fragment,{children:r})}),C.jsx(SS,{value:"time","aria-label":u.timeTableLabel,icon:C.jsx(D.Fragment,{children:o})})]})};function Usn(t){return Ye("MuiPickersToolbarText",t)}const _Q=qe("MuiPickersToolbarText",["root","selected"]),Wsn=["className","selected","value"],Vsn=t=>{const{classes:e,selected:n}=t;return Xe({root:["root",n&&"selected"]},Usn,e)},Gsn=be(Jt,{name:"MuiPickersToolbarText",slot:"Root",overridesResolver:(t,e)=>[e.root,{[`&.${_Q.selected}`]:e.selected}]})(({theme:t})=>({transition:t.transitions.create("color"),color:(t.vars||t).palette.text.secondary,[`&.${_Q.selected}`]:{color:(t.vars||t).palette.text.primary}})),zWe=D.forwardRef(function(e,n){const r=An({props:e,name:"MuiPickersToolbarText"}),{className:i,value:o}=r,s=Dt(r,Wsn),a=Vsn(r);return C.jsx(Gsn,ve({ref:n,className:Oe(a.root,i),component:"span"},s,{children:o}))});function jWe(t){return Ye("MuiPickersToolbar",t)}const Hsn=qe("MuiPickersToolbar",["root","content"]),qsn=["children","className","toolbarTitle","hidden","titleId","isLandscape","classes","landscapeDirection"],Xsn=t=>{const{classes:e,isLandscape:n}=t;return Xe({root:["root"],content:["content"],penIconButton:["penIconButton",n&&"penIconButtonLandscape"]},jWe,e)},Ysn=be("div",{name:"MuiPickersToolbar",slot:"Root",overridesResolver:(t,e)=>e.root})(({theme:t})=>({display:"flex",flexDirection:"column",alignItems:"flex-start",justifyContent:"space-between",padding:t.spacing(2,3),variants:[{props:{isLandscape:!0},style:{height:"auto",maxWidth:160,padding:16,justifyContent:"flex-start",flexWrap:"wrap"}}]})),Qsn=be("div",{name:"MuiPickersToolbar",slot:"Content",overridesResolver:(t,e)=>e.content})({display:"flex",flexWrap:"wrap",width:"100%",flex:1,justifyContent:"space-between",alignItems:"center",flexDirection:"row",variants:[{props:{isLandscape:!0},style:{justifyContent:"flex-start",alignItems:"flex-start",flexDirection:"column"}},{props:{isLandscape:!0,landscapeDirection:"row"},style:{flexDirection:"row"}}]}),Ksn=D.forwardRef(function(e,n){const r=An({props:e,name:"MuiPickersToolbar"}),{children:i,className:o,toolbarTitle:s,hidden:a,titleId:l}=r,c=Dt(r,qsn),u=r,f=Xsn(u);return a?null:C.jsxs(Ysn,ve({ref:n,className:Oe(f.root,o),ownerState:u},c,{children:[C.jsx(Jt,{color:"text.secondary",variant:"overline",id:l,children:s}),C.jsx(Qsn,{className:f.content,ownerState:u,children:i})]}))}),Zsn=["align","className","selected","typographyClassName","value","variant","width"],Jsn=t=>{const{classes:e}=t;return Xe({root:["root"]},jWe,e)},ean=be(Vr,{name:"MuiPickersToolbarButton",slot:"Root",overridesResolver:(t,e)=>e.root})({padding:0,minWidth:16,textTransform:"none"}),xm=D.forwardRef(function(e,n){const r=An({props:e,name:"MuiPickersToolbarButton"}),{align:i,className:o,selected:s,typographyClassName:a,value:l,variant:c,width:u}=r,f=Dt(r,Zsn),d=Jsn(r);return C.jsx(ean,ve({variant:"text",ref:n,className:Oe(d.root,o)},u?{sx:{width:u}}:{},f,{children:C.jsx(zWe,{align:i,className:a,variant:c,value:l,selected:s})}))});function tan(t){return Ye("MuiDateTimePickerToolbar",t)}const D9=qe("MuiDateTimePickerToolbar",["root","dateContainer","timeContainer","timeDigitsContainer","separator","timeLabelReverse","ampmSelection","ampmLandscape","ampmLabel"]);function nan(t,{disableFuture:e,maxDate:n,timezone:r}){const i=pr();return D.useMemo(()=>{const o=i.date(void 0,r),s=i.startOfMonth(e&&i.isBefore(o,n)?o:n);return!i.isAfter(s,t)},[e,n,t,i,r])}function ran(t,{disablePast:e,minDate:n,timezone:r}){const i=pr();return D.useMemo(()=>{const o=i.date(void 0,r),s=i.startOfMonth(e&&i.isAfter(o,n)?o:n);return!i.isBefore(s,t)},[e,n,t,i,r])}function ule(t,e,n,r){const i=pr(),o=Yin(t,i),s=D.useCallback(a=>{const l=t==null?null:Qin(t,a,!!e,i);n(l,r??"partial")},[e,t,n,r,i]);return{meridiemMode:o,handleMeridiemChange:s}}const iP=36,_U=2,SU=320,ian=280,CU=336,BWe=232,kT=48,oan=["ampm","ampmInClock","value","onChange","view","isLandscape","onViewChange","toolbarFormat","toolbarPlaceholder","views","disabled","readOnly","toolbarVariant","toolbarTitle","className"],san=t=>{const{classes:e,isLandscape:n,isRtl:r}=t;return Xe({root:["root"],dateContainer:["dateContainer"],timeContainer:["timeContainer",r&&"timeLabelReverse"],timeDigitsContainer:["timeDigitsContainer",r&&"timeLabelReverse"],separator:["separator"],ampmSelection:["ampmSelection",n&&"ampmLandscape"],ampmLabel:["ampmLabel"]},tan,e)},aan=be(Ksn,{name:"MuiDateTimePickerToolbar",slot:"Root",overridesResolver:(t,e)=>e.root})(({theme:t})=>({paddingLeft:16,paddingRight:16,justifyContent:"space-around",position:"relative",variants:[{props:{toolbarVariant:"desktop"},style:{borderBottom:`1px solid ${(t.vars||t).palette.divider}`,[`& .${Hsn.content} .${_Q.selected}`]:{color:(t.vars||t).palette.primary.main,fontWeight:t.typography.fontWeightBold}}},{props:{toolbarVariant:"desktop",isLandscape:!0},style:{borderRight:`1px solid ${(t.vars||t).palette.divider}`}},{props:{toolbarVariant:"desktop",isLandscape:!1},style:{paddingLeft:24,paddingRight:0}}]})),lan=be("div",{name:"MuiDateTimePickerToolbar",slot:"DateContainer",overridesResolver:(t,e)=>e.dateContainer})({display:"flex",flexDirection:"column",alignItems:"flex-start"}),can=be("div",{name:"MuiDateTimePickerToolbar",slot:"TimeContainer",overridesResolver:(t,e)=>e.timeContainer})({display:"flex",flexDirection:"row",variants:[{props:{isRtl:!0},style:{flexDirection:"row-reverse"}},{props:{toolbarVariant:"desktop",isLandscape:!1},style:{gap:9,marginRight:4,alignSelf:"flex-end"}},{props:({isLandscape:t,toolbarVariant:e})=>t&&e!=="desktop",style:{flexDirection:"column"}},{props:({isLandscape:t,toolbarVariant:e,isRtl:n})=>t&&e!=="desktop"&&n,style:{flexDirection:"column-reverse"}}]}),uan=be("div",{name:"MuiDateTimePickerToolbar",slot:"TimeDigitsContainer",overridesResolver:(t,e)=>e.timeDigitsContainer})({display:"flex",variants:[{props:{isRtl:!0},style:{flexDirection:"row-reverse"}},{props:{toolbarVariant:"desktop"},style:{gap:1.5}}]}),r1e=be(zWe,{name:"MuiDateTimePickerToolbar",slot:"Separator",overridesResolver:(t,e)=>e.separator})({margin:"0 4px 0 2px",cursor:"default",variants:[{props:{toolbarVariant:"desktop"},style:{margin:0}}]}),fan=be("div",{name:"MuiDateTimePickerToolbar",slot:"AmPmSelection",overridesResolver:(t,e)=>[{[`.${D9.ampmLabel}`]:e.ampmLabel},{[`&.${D9.ampmLandscape}`]:e.ampmLandscape},e.ampmSelection]})({display:"flex",flexDirection:"column",marginRight:"auto",marginLeft:12,[`& .${D9.ampmLabel}`]:{fontSize:17},variants:[{props:{isLandscape:!0},style:{margin:"4px 0 auto",flexDirection:"row",justifyContent:"space-around",width:"100%"}}]});function dan(t){const e=An({props:t,name:"MuiDateTimePickerToolbar"}),{ampm:n,ampmInClock:r,value:i,onChange:o,view:s,isLandscape:a,onViewChange:l,toolbarFormat:c,toolbarPlaceholder:u="––",views:f,disabled:d,readOnly:h,toolbarVariant:p="mobile",toolbarTitle:g,className:m}=e,v=Dt(e,oan),y=Ho(),x=ve({},e,{isRtl:y}),b=pr(),{meridiemMode:w,handleMeridiemChange:_}=ule(i,n,o),S=!!(n&&!r),O=p==="desktop",k=Rl(),E=san(x),M=g??k.dateTimePickerToolbarTitle,A=T=>n?b.format(T,"hours12h"):b.format(T,"hours24h"),P=D.useMemo(()=>i?c?b.formatByString(i,c):b.format(i,"shortDate"):u,[i,c,u,b]);return C.jsxs(aan,ve({isLandscape:a,className:Oe(E.root,m),toolbarTitle:M},v,{ownerState:x,children:[C.jsxs(lan,{className:E.dateContainer,ownerState:x,children:[f.includes("year")&&C.jsx(xm,{tabIndex:-1,variant:"subtitle1",onClick:()=>l("year"),selected:s==="year",value:i?b.format(i,"year"):"–"}),f.includes("day")&&C.jsx(xm,{tabIndex:-1,variant:O?"h5":"h4",onClick:()=>l("day"),selected:s==="day",value:P})]}),C.jsxs(can,{className:E.timeContainer,ownerState:x,children:[C.jsxs(uan,{className:E.timeDigitsContainer,ownerState:x,children:[f.includes("hours")&&C.jsxs(D.Fragment,{children:[C.jsx(xm,{variant:O?"h5":"h3",width:O&&!a?kT:void 0,onClick:()=>l("hours"),selected:s==="hours",value:i?A(i):"--"}),C.jsx(r1e,{variant:O?"h5":"h3",value:":",className:E.separator,ownerState:x}),C.jsx(xm,{variant:O?"h5":"h3",width:O&&!a?kT:void 0,onClick:()=>l("minutes"),selected:s==="minutes"||!f.includes("minutes")&&s==="hours",value:i?b.format(i,"minutes"):"--",disabled:!f.includes("minutes")})]}),f.includes("seconds")&&C.jsxs(D.Fragment,{children:[C.jsx(r1e,{variant:O?"h5":"h3",value:":",className:E.separator,ownerState:x}),C.jsx(xm,{variant:O?"h5":"h3",width:O&&!a?kT:void 0,onClick:()=>l("seconds"),selected:s==="seconds",value:i?b.format(i,"seconds"):"--"})]})]}),S&&!O&&C.jsxs(fan,{className:E.ampmSelection,ownerState:x,children:[C.jsx(xm,{variant:"subtitle2",selected:w==="am",typographyClassName:E.ampmLabel,value:Jp(b,"am"),onClick:h?void 0:()=>_("am"),disabled:d}),C.jsx(xm,{variant:"subtitle2",selected:w==="pm",typographyClassName:E.ampmLabel,value:Jp(b,"pm"),onClick:h?void 0:()=>_("pm"),disabled:d})]}),n&&O&&C.jsx(xm,{variant:"h5",onClick:()=>l("meridiem"),selected:s==="meridiem",value:i&&w?Jp(b,w):"--",width:kT})]})]}))}function UWe(t,e){var a;const n=pr(),r=rD(),i=An({props:t,name:e}),o=i.ampm??n.is12HourCycleInCurrentLocale(),s=D.useMemo(()=>{var l;return((l=i.localeText)==null?void 0:l.toolbarTitle)==null?i.localeText:ve({},i.localeText,{dateTimePickerToolbarTitle:i.localeText.toolbarTitle})},[i.localeText]);return ve({},i,Vin({views:i.views,openTo:i.openTo,defaultViews:["year","day","hours","minutes"],defaultOpenTo:"day"}),{ampm:o,localeText:s,orientation:i.orientation??"portrait",disableIgnoringDatePartForTimeValidation:i.disableIgnoringDatePartForTimeValidation??!!(i.minDateTime||i.maxDateTime||i.disablePast||i.disableFuture),disableFuture:i.disableFuture??!1,disablePast:i.disablePast??!1,minDate:Du(n,i.minDateTime??i.minDate,r.minDate),maxDate:Du(n,i.maxDateTime??i.maxDate,r.maxDate),minTime:i.minDateTime??i.minTime,maxTime:i.maxDateTime??i.maxTime,slots:ve({toolbar:dan,tabs:Bsn},i.slots),slotProps:ve({},i.slotProps,{toolbar:ve({ampm:o},(a=i.slotProps)==null?void 0:a.toolbar)})})}const WWe=({shouldDisableDate:t,shouldDisableMonth:e,shouldDisableYear:n,minDate:r,maxDate:i,disableFuture:o,disablePast:s,timezone:a})=>{const l=Cb();return D.useCallback(c=>sle({adapter:l,value:c,timezone:a,props:{shouldDisableDate:t,shouldDisableMonth:e,shouldDisableYear:n,minDate:r,maxDate:i,disableFuture:o,disablePast:s}})!==null,[l,t,e,n,r,i,o,s,a])},han=(t,e,n)=>(r,i)=>{switch(i.type){case"changeMonth":return ve({},r,{slideDirection:i.direction,currentMonth:i.newMonth,isMonthSwitchingAnimating:!t});case"finishMonthSwitchingAnimation":return ve({},r,{isMonthSwitchingAnimating:!1});case"changeFocusedDay":{if(r.focusedDay!=null&&i.focusedDay!=null&&n.isSameDay(i.focusedDay,r.focusedDay))return r;const o=i.focusedDay!=null&&!e&&!n.isSameMonth(r.currentMonth,i.focusedDay);return ve({},r,{focusedDay:i.focusedDay,isMonthSwitchingAnimating:o&&!t&&!i.withoutMonthSwitchingAnimation,currentMonth:o?n.startOfMonth(i.focusedDay):r.currentMonth,slideDirection:i.focusedDay!=null&&n.isAfterDay(i.focusedDay,r.currentMonth)?"left":"right"})}default:throw new Error("missing support")}},pan=t=>{const{value:e,referenceDate:n,disableFuture:r,disablePast:i,disableSwitchToMonthOnDayFocus:o=!1,maxDate:s,minDate:a,onMonthChange:l,reduceAnimations:c,shouldDisableDate:u,timezone:f}=t,d=pr(),h=D.useRef(han(!!c,o,d)).current,p=D.useMemo(()=>ia.getInitialReferenceValue({value:e,utils:d,timezone:f,props:t,referenceDate:n,granularity:bf.day}),[]),[g,m]=D.useReducer(h,{isMonthSwitchingAnimating:!1,focusedDay:p,currentMonth:d.startOfMonth(p),slideDirection:"left"}),v=D.useCallback(_=>{m(ve({type:"changeMonth"},_)),l&&l(_.newMonth)},[l]),y=D.useCallback(_=>{const S=_;d.isSameMonth(S,g.currentMonth)||v({newMonth:d.startOfMonth(S),direction:d.isAfterDay(S,g.currentMonth)?"left":"right"})},[g.currentMonth,v,d]),x=WWe({shouldDisableDate:u,minDate:a,maxDate:s,disableFuture:r,disablePast:i,timezone:f}),b=D.useCallback(()=>{m({type:"finishMonthSwitchingAnimation"})},[]),w=st((_,S)=>{x(_)||m({type:"changeFocusedDay",focusedDay:_,withoutMonthSwitchingAnimation:S})});return{referenceDate:p,calendarState:g,changeMonth:y,changeFocusedDay:w,isDateDisabled:x,onMonthSwitchingAnimationEnd:b,handleChangeMonth:v}},gan=t=>Ye("MuiPickersFadeTransitionGroup",t);qe("MuiPickersFadeTransitionGroup",["root"]);const man=t=>{const{classes:e}=t;return Xe({root:["root"]},gan,e)},van=be(PM,{name:"MuiPickersFadeTransitionGroup",slot:"Root",overridesResolver:(t,e)=>e.root})({display:"block",position:"relative"});function VWe(t){const e=An({props:t,name:"MuiPickersFadeTransitionGroup"}),{children:n,className:r,reduceAnimations:i,transKey:o}=e,s=man(e),a=Na();return i?n:C.jsx(van,{className:Oe(s.root,r),children:C.jsx(YC,{appear:!1,mountOnEnter:!0,unmountOnExit:!0,timeout:{appear:a.transitions.duration.enteringScreen,enter:a.transitions.duration.enteringScreen,exit:0},children:n},o)})}function yan(t){return Ye("MuiPickersDay",t)}const T0=qe("MuiPickersDay",["root","dayWithMargin","dayOutsideMonth","hiddenDaySpacingFiller","today","selected","disabled"]),xan=["autoFocus","className","day","disabled","disableHighlightToday","disableMargin","hidden","isAnimating","onClick","onDaySelect","onFocus","onBlur","onKeyDown","onMouseDown","onMouseEnter","outsideCurrentMonth","selected","showDaysOutsideCurrentMonth","children","today","isFirstVisibleCell","isLastVisibleCell"],ban=t=>{const{selected:e,disableMargin:n,disableHighlightToday:r,today:i,disabled:o,outsideCurrentMonth:s,showDaysOutsideCurrentMonth:a,classes:l}=t,c=s&&!a;return Xe({root:["root",e&&!c&&"selected",o&&"disabled",!n&&"dayWithMargin",!r&&i&&"today",s&&a&&"dayOutsideMonth",c&&"hiddenDaySpacingFiller"],hiddenDaySpacingFiller:["hiddenDaySpacingFiller"]},yan,l)},GWe=({theme:t})=>ve({},t.typography.caption,{width:iP,height:iP,borderRadius:"50%",padding:0,backgroundColor:"transparent",transition:t.transitions.create("background-color",{duration:t.transitions.duration.short}),color:(t.vars||t).palette.text.primary,"@media (pointer: fine)":{"&:hover":{backgroundColor:t.vars?`rgba(${t.vars.palette.primary.mainChannel} / ${t.vars.palette.action.hoverOpacity})`:Tt(t.palette.primary.main,t.palette.action.hoverOpacity)}},"&:focus":{backgroundColor:t.vars?`rgba(${t.vars.palette.primary.mainChannel} / ${t.vars.palette.action.focusOpacity})`:Tt(t.palette.primary.main,t.palette.action.focusOpacity),[`&.${T0.selected}`]:{willChange:"background-color",backgroundColor:(t.vars||t).palette.primary.dark}},[`&.${T0.selected}`]:{color:(t.vars||t).palette.primary.contrastText,backgroundColor:(t.vars||t).palette.primary.main,fontWeight:t.typography.fontWeightMedium,"&:hover":{willChange:"background-color",backgroundColor:(t.vars||t).palette.primary.dark}},[`&.${T0.disabled}:not(.${T0.selected})`]:{color:(t.vars||t).palette.text.disabled},[`&.${T0.disabled}&.${T0.selected}`]:{opacity:.6},variants:[{props:{disableMargin:!1},style:{margin:`0 ${_U}px`}},{props:{outsideCurrentMonth:!0,showDaysOutsideCurrentMonth:!0},style:{color:(t.vars||t).palette.text.secondary}},{props:{disableHighlightToday:!1,today:!0},style:{[`&:not(.${T0.selected})`]:{border:`1px solid ${(t.vars||t).palette.text.secondary}`}}}]}),HWe=(t,e)=>{const{ownerState:n}=t;return[e.root,!n.disableMargin&&e.dayWithMargin,!n.disableHighlightToday&&n.today&&e.today,!n.outsideCurrentMonth&&n.showDaysOutsideCurrentMonth&&e.dayOutsideMonth,n.outsideCurrentMonth&&!n.showDaysOutsideCurrentMonth&&e.hiddenDaySpacingFiller]},wan=be(Nf,{name:"MuiPickersDay",slot:"Root",overridesResolver:HWe})(GWe),_an=be("div",{name:"MuiPickersDay",slot:"Root",overridesResolver:HWe})(({theme:t})=>ve({},GWe({theme:t}),{opacity:0,pointerEvents:"none"})),b2=()=>{},San=D.forwardRef(function(e,n){const r=An({props:e,name:"MuiPickersDay"}),{autoFocus:i=!1,className:o,day:s,disabled:a=!1,disableHighlightToday:l=!1,disableMargin:c=!1,isAnimating:u,onClick:f,onDaySelect:d,onFocus:h=b2,onBlur:p=b2,onKeyDown:g=b2,onMouseDown:m=b2,onMouseEnter:v=b2,outsideCurrentMonth:y,selected:x=!1,showDaysOutsideCurrentMonth:b=!1,children:w,today:_=!1}=r,S=Dt(r,xan),O=ve({},r,{autoFocus:i,disabled:a,disableHighlightToday:l,disableMargin:c,selected:x,showDaysOutsideCurrentMonth:b,today:_}),k=ban(O),E=pr(),M=D.useRef(null),A=dn(M,n);Ei(()=>{i&&!a&&!u&&!y&&M.current.focus()},[i,a,u,y]);const P=R=>{m(R),y&&R.preventDefault()},T=R=>{a||d(s),y&&R.currentTarget.focus(),f&&f(R)};return y&&!b?C.jsx(_an,{className:Oe(k.root,k.hiddenDaySpacingFiller,o),ownerState:O,role:S.role}):C.jsx(wan,ve({className:Oe(k.root,o),ref:A,centerRipple:!0,disabled:a,tabIndex:x?0:-1,onKeyDown:R=>g(R,s),onFocus:R=>h(R,s),onBlur:R=>p(R,s),onMouseEnter:R=>v(R,s),onClick:T,onMouseDown:P},S,{ownerState:O,children:w||E.format(s,"dayOfMonth")}))}),Can=D.memo(San),Oan=t=>Ye("MuiPickersSlideTransition",t),Bc=qe("MuiPickersSlideTransition",["root","slideEnter-left","slideEnter-right","slideEnterActive","slideExit","slideExitActiveLeft-left","slideExitActiveLeft-right"]),Ean=["children","className","reduceAnimations","slideDirection","transKey","classes"],Tan=t=>{const{classes:e,slideDirection:n}=t,r={root:["root"],exit:["slideExit"],enterActive:["slideEnterActive"],enter:[`slideEnter-${n}`],exitActive:[`slideExitActiveLeft-${n}`]};return Xe(r,Oan,e)},kan=be(PM,{name:"MuiPickersSlideTransition",slot:"Root",overridesResolver:(t,e)=>[e.root,{[`.${Bc["slideEnter-left"]}`]:e["slideEnter-left"]},{[`.${Bc["slideEnter-right"]}`]:e["slideEnter-right"]},{[`.${Bc.slideEnterActive}`]:e.slideEnterActive},{[`.${Bc.slideExit}`]:e.slideExit},{[`.${Bc["slideExitActiveLeft-left"]}`]:e["slideExitActiveLeft-left"]},{[`.${Bc["slideExitActiveLeft-right"]}`]:e["slideExitActiveLeft-right"]}]})(({theme:t})=>{const e=t.transitions.create("transform",{duration:t.transitions.duration.complex,easing:"cubic-bezier(0.35, 0.8, 0.4, 1)"});return{display:"block",position:"relative",overflowX:"hidden","& > *":{position:"absolute",top:0,right:0,left:0},[`& .${Bc["slideEnter-left"]}`]:{willChange:"transform",transform:"translate(100%)",zIndex:1},[`& .${Bc["slideEnter-right"]}`]:{willChange:"transform",transform:"translate(-100%)",zIndex:1},[`& .${Bc.slideEnterActive}`]:{transform:"translate(0%)",transition:e},[`& .${Bc.slideExit}`]:{transform:"translate(0%)"},[`& .${Bc["slideExitActiveLeft-left"]}`]:{willChange:"transform",transform:"translate(-100%)",transition:e,zIndex:0},[`& .${Bc["slideExitActiveLeft-right"]}`]:{willChange:"transform",transform:"translate(100%)",transition:e,zIndex:0}}});function Aan(t){const e=An({props:t,name:"MuiPickersSlideTransition"}),{children:n,className:r,reduceAnimations:i,transKey:o}=e,s=Dt(e,Ean),a=Tan(e),l=Na();if(i)return C.jsx("div",{className:Oe(a.root,r),children:n});const c={exit:a.exit,enterActive:a.enterActive,enter:a.enter,exitActive:a.exitActive};return C.jsx(kan,{className:Oe(a.root,r),childFactory:u=>D.cloneElement(u,{classNames:c}),role:"presentation",children:C.jsx(hee,ve({mountOnEnter:!0,unmountOnExit:!0,timeout:l.transitions.duration.complex,classNames:c},s,{children:n}),o)})}const Pan=t=>Ye("MuiDayCalendar",t);qe("MuiDayCalendar",["root","header","weekDayLabel","loadingContainer","slideTransition","monthContainer","weekContainer","weekNumberLabel","weekNumber"]);const Man=["parentProps","day","focusableDay","selectedDays","isDateDisabled","currentMonthNumber","isViewFocused"],Ran=["ownerState"],Dan=t=>{const{classes:e}=t;return Xe({root:["root"],header:["header"],weekDayLabel:["weekDayLabel"],loadingContainer:["loadingContainer"],slideTransition:["slideTransition"],monthContainer:["monthContainer"],weekContainer:["weekContainer"],weekNumberLabel:["weekNumberLabel"],weekNumber:["weekNumber"]},Pan,e)},qWe=(iP+_U*2)*6,Ian=be("div",{name:"MuiDayCalendar",slot:"Root",overridesResolver:(t,e)=>e.root})({}),Lan=be("div",{name:"MuiDayCalendar",slot:"Header",overridesResolver:(t,e)=>e.header})({display:"flex",justifyContent:"center",alignItems:"center"}),$an=be(Jt,{name:"MuiDayCalendar",slot:"WeekDayLabel",overridesResolver:(t,e)=>e.weekDayLabel})(({theme:t})=>({width:36,height:40,margin:"0 2px",textAlign:"center",display:"flex",justifyContent:"center",alignItems:"center",color:(t.vars||t).palette.text.secondary})),Fan=be(Jt,{name:"MuiDayCalendar",slot:"WeekNumberLabel",overridesResolver:(t,e)=>e.weekNumberLabel})(({theme:t})=>({width:36,height:40,margin:"0 2px",textAlign:"center",display:"flex",justifyContent:"center",alignItems:"center",color:t.palette.text.disabled})),Nan=be(Jt,{name:"MuiDayCalendar",slot:"WeekNumber",overridesResolver:(t,e)=>e.weekNumber})(({theme:t})=>ve({},t.typography.caption,{width:iP,height:iP,padding:0,margin:`0 ${_U}px`,color:t.palette.text.disabled,fontSize:"0.75rem",alignItems:"center",justifyContent:"center",display:"inline-flex"})),zan=be("div",{name:"MuiDayCalendar",slot:"LoadingContainer",overridesResolver:(t,e)=>e.loadingContainer})({display:"flex",justifyContent:"center",alignItems:"center",minHeight:qWe}),jan=be(Aan,{name:"MuiDayCalendar",slot:"SlideTransition",overridesResolver:(t,e)=>e.slideTransition})({minHeight:qWe}),Ban=be("div",{name:"MuiDayCalendar",slot:"MonthContainer",overridesResolver:(t,e)=>e.monthContainer})({overflow:"hidden"}),Uan=be("div",{name:"MuiDayCalendar",slot:"WeekContainer",overridesResolver:(t,e)=>e.weekContainer})({margin:`${_U}px 0`,display:"flex",justifyContent:"center"});function Wan(t){let{parentProps:e,day:n,focusableDay:r,selectedDays:i,isDateDisabled:o,currentMonthNumber:s,isViewFocused:a}=t,l=Dt(t,Man);const{disabled:c,disableHighlightToday:u,isMonthSwitchingAnimating:f,showDaysOutsideCurrentMonth:d,slots:h,slotProps:p,timezone:g}=e,m=pr(),v=Ob(g),y=r!==null&&m.isSameDay(n,r),x=i.some(A=>m.isSameDay(A,n)),b=m.isSameDay(n,v),w=(h==null?void 0:h.day)??Can,_=Zt({elementType:w,externalSlotProps:p==null?void 0:p.day,additionalProps:ve({disableHighlightToday:u,showDaysOutsideCurrentMonth:d,role:"gridcell",isAnimating:f,"data-timestamp":m.toJsDate(n).valueOf()},l),ownerState:ve({},e,{day:n,selected:x})}),S=Dt(_,Ran),O=D.useMemo(()=>c||o(n),[c,o,n]),k=D.useMemo(()=>m.getMonth(n)!==s,[m,n,s]),E=D.useMemo(()=>{const A=m.startOfMonth(m.setMonth(n,s));return d?m.isSameDay(n,m.startOfWeek(A)):m.isSameDay(n,A)},[s,n,d,m]),M=D.useMemo(()=>{const A=m.endOfMonth(m.setMonth(n,s));return d?m.isSameDay(n,m.endOfWeek(A)):m.isSameDay(n,A)},[s,n,d,m]);return C.jsx(w,ve({},S,{day:n,disabled:O,autoFocus:a&&y,today:b,outsideCurrentMonth:k,isFirstVisibleCell:E,isLastVisibleCell:M,selected:x,tabIndex:y?0:-1,"aria-selected":x,"aria-current":b?"date":void 0}))}function Van(t){const e=An({props:t,name:"MuiDayCalendar"}),n=pr(),{onFocusedDayChange:r,className:i,currentMonth:o,selectedDays:s,focusedDay:a,loading:l,onSelectedDaysChange:c,onMonthSwitchingAnimationEnd:u,readOnly:f,reduceAnimations:d,renderLoading:h=()=>C.jsx("span",{children:"..."}),slideDirection:p,TransitionProps:g,disablePast:m,disableFuture:v,minDate:y,maxDate:x,shouldDisableDate:b,shouldDisableMonth:w,shouldDisableYear:_,dayOfWeekFormatter:S=ne=>n.format(ne,"weekdayShort").charAt(0).toUpperCase(),hasFocus:O,onFocusedViewChange:k,gridLabelId:E,displayWeekNumber:M,fixedWeekNumber:A,autoFocus:P,timezone:T}=e,R=Ob(T),I=Dan(e),B=Ho(),$=WWe({shouldDisableDate:b,shouldDisableMonth:w,shouldDisableYear:_,minDate:y,maxDate:x,disablePast:m,disableFuture:v,timezone:T}),z=Rl(),[L,j]=wc({name:"DayCalendar",state:"hasFocus",controlled:O,default:P??!1}),[N,F]=D.useState(()=>a||R),H=st(ne=>{f||c(ne)}),q=ne=>{$(ne)||(r(ne),F(ne),k==null||k(!0),j(!0))},Y=st((ne,V)=>{switch(ne.key){case"ArrowUp":q(n.addDays(V,-7)),ne.preventDefault();break;case"ArrowDown":q(n.addDays(V,7)),ne.preventDefault();break;case"ArrowLeft":{const X=n.addDays(V,B?1:-1),Z=n.addMonths(V,B?1:-1),he=Sk({utils:n,date:X,minDate:B?X:n.startOfMonth(Z),maxDate:B?n.endOfMonth(Z):X,isDateDisabled:$,timezone:T});q(he||X),ne.preventDefault();break}case"ArrowRight":{const X=n.addDays(V,B?-1:1),Z=n.addMonths(V,B?-1:1),he=Sk({utils:n,date:X,minDate:B?n.startOfMonth(Z):X,maxDate:B?X:n.endOfMonth(Z),isDateDisabled:$,timezone:T});q(he||X),ne.preventDefault();break}case"Home":q(n.startOfWeek(V)),ne.preventDefault();break;case"End":q(n.endOfWeek(V)),ne.preventDefault();break;case"PageUp":q(n.addMonths(V,1)),ne.preventDefault();break;case"PageDown":q(n.addMonths(V,-1)),ne.preventDefault();break}}),le=st((ne,V)=>q(V)),K=st((ne,V)=>{L&&n.isSameDay(N,V)&&(k==null||k(!1))}),ee=n.getMonth(o),re=n.getYear(o),me=D.useMemo(()=>s.filter(ne=>!!ne).map(ne=>n.startOfDay(ne)),[n,s]),te=`${re}-${ee}`,ae=D.useMemo(()=>D.createRef(),[te]),U=D.useMemo(()=>{const ne=n.startOfMonth(o),V=n.endOfMonth(o);return $(N)||n.isAfterDay(N,V)||n.isBeforeDay(N,ne)?Sk({utils:n,date:N,minDate:ne,maxDate:V,disablePast:m,disableFuture:v,isDateDisabled:$,timezone:T}):N},[o,v,m,N,$,n,T]),oe=D.useMemo(()=>{const ne=n.setTimezone(o,T),V=n.getWeekArray(ne);let X=n.addMonths(ne,1);for(;A&&V.length{V.lengthC.jsx($an,{variant:"caption",role:"columnheader","aria-label":n.format(ne,"weekday"),className:I.weekDayLabel,children:S(ne)},V.toString()))]}),l?C.jsx(zan,{className:I.loadingContainer,children:h()}):C.jsx(jan,ve({transKey:te,onExited:u,reduceAnimations:d,slideDirection:p,className:Oe(i,I.slideTransition)},g,{nodeRef:ae,children:C.jsx(Ban,{ref:ae,role:"rowgroup",className:I.monthContainer,children:oe.map((ne,V)=>C.jsxs(Uan,{role:"row",className:I.weekContainer,"aria-rowindex":V+1,children:[M&&C.jsx(Nan,{className:I.weekNumber,role:"rowheader","aria-label":z.calendarWeekNumberAriaLabelText(n.getWeekNumber(ne[0])),children:z.calendarWeekNumberText(n.getWeekNumber(ne[0]))}),ne.map((X,Z)=>C.jsx(Wan,{parentProps:e,day:X,selectedDays:me,focusableDay:U,onKeyDown:Y,onFocus:le,onBlur:K,onDaySelect:H,isDateDisabled:$,currentMonthNumber:ee,isViewFocused:L,"aria-colindex":Z+1},X.toString()))]},`week-${ne[0]}`))})}))]})}function Gan(t){return Ye("MuiPickersMonth",t)}const xL=qe("MuiPickersMonth",["root","monthButton","disabled","selected"]),Han=["autoFocus","className","children","disabled","selected","value","tabIndex","onClick","onKeyDown","onFocus","onBlur","aria-current","aria-label","monthsPerRow","slots","slotProps"],qan=t=>{const{disabled:e,selected:n,classes:r}=t;return Xe({root:["root"],monthButton:["monthButton",e&&"disabled",n&&"selected"]},Gan,r)},Xan=be("div",{name:"MuiPickersMonth",slot:"Root",overridesResolver:(t,e)=>[e.root]})({display:"flex",alignItems:"center",justifyContent:"center",flexBasis:"33.3%",variants:[{props:{monthsPerRow:4},style:{flexBasis:"25%"}}]}),Yan=be("button",{name:"MuiPickersMonth",slot:"MonthButton",overridesResolver:(t,e)=>[e.monthButton,{[`&.${xL.disabled}`]:e.disabled},{[`&.${xL.selected}`]:e.selected}]})(({theme:t})=>ve({color:"unset",backgroundColor:"transparent",border:0,outline:0},t.typography.subtitle1,{margin:"8px 0",height:36,width:72,borderRadius:18,cursor:"pointer","&:focus":{backgroundColor:t.vars?`rgba(${t.vars.palette.action.activeChannel} / ${t.vars.palette.action.hoverOpacity})`:Tt(t.palette.action.active,t.palette.action.hoverOpacity)},"&:hover":{backgroundColor:t.vars?`rgba(${t.vars.palette.action.activeChannel} / ${t.vars.palette.action.hoverOpacity})`:Tt(t.palette.action.active,t.palette.action.hoverOpacity)},"&:disabled":{cursor:"auto",pointerEvents:"none"},[`&.${xL.disabled}`]:{color:(t.vars||t).palette.text.secondary},[`&.${xL.selected}`]:{color:(t.vars||t).palette.primary.contrastText,backgroundColor:(t.vars||t).palette.primary.main,"&:focus, &:hover":{backgroundColor:(t.vars||t).palette.primary.dark}}})),Qan=D.memo(function(e){const n=An({props:e,name:"MuiPickersMonth"}),{autoFocus:r,className:i,children:o,disabled:s,selected:a,value:l,tabIndex:c,onClick:u,onKeyDown:f,onFocus:d,onBlur:h,"aria-current":p,"aria-label":g,slots:m,slotProps:v}=n,y=Dt(n,Han),x=D.useRef(null),b=qan(n);Ei(()=>{var S;r&&((S=x.current)==null||S.focus())},[r]);const w=(m==null?void 0:m.monthButton)??Yan,_=Zt({elementType:w,externalSlotProps:v==null?void 0:v.monthButton,additionalProps:{children:o,disabled:s,tabIndex:c,ref:x,type:"button",role:"radio","aria-current":p,"aria-checked":a,"aria-label":g,onClick:S=>u(S,l),onKeyDown:S=>f(S,l),onFocus:S=>d(S,l),onBlur:S=>h(S,l)},ownerState:n,className:b.monthButton});return C.jsx(Xan,ve({className:Oe(b.root,i),ownerState:n},y,{children:C.jsx(w,ve({},_))}))});function Kan(t){return Ye("MuiMonthCalendar",t)}qe("MuiMonthCalendar",["root"]);const Zan=["className","value","defaultValue","referenceDate","disabled","disableFuture","disablePast","maxDate","minDate","onChange","shouldDisableMonth","readOnly","disableHighlightToday","autoFocus","onMonthFocus","hasFocus","onFocusedViewChange","monthsPerRow","timezone","gridLabelId","slots","slotProps"],Jan=t=>{const{classes:e}=t;return Xe({root:["root"]},Kan,e)};function eln(t,e){const n=pr(),r=rD(),i=An({props:t,name:e});return ve({disableFuture:!1,disablePast:!1},i,{minDate:Du(n,i.minDate,r.minDate),maxDate:Du(n,i.maxDate,r.maxDate)})}const tln=be("div",{name:"MuiMonthCalendar",slot:"Root",overridesResolver:(t,e)=>e.root})({display:"flex",flexWrap:"wrap",alignContent:"stretch",padding:"0 4px",width:SU,boxSizing:"border-box"}),nln=D.forwardRef(function(e,n){const r=eln(e,"MuiMonthCalendar"),{className:i,value:o,defaultValue:s,referenceDate:a,disabled:l,disableFuture:c,disablePast:u,maxDate:f,minDate:d,onChange:h,shouldDisableMonth:p,readOnly:g,autoFocus:m=!1,onMonthFocus:v,hasFocus:y,onFocusedViewChange:x,monthsPerRow:b=3,timezone:w,gridLabelId:_,slots:S,slotProps:O}=r,k=Dt(r,Zan),{value:E,handleValueChange:M,timezone:A}=qO({name:"MonthCalendar",timezone:w,value:o,defaultValue:s,onChange:h,valueManager:ia}),P=Ob(A),T=Ho(),R=pr(),I=D.useMemo(()=>ia.getInitialReferenceValue({value:E,utils:R,props:r,timezone:A,referenceDate:a,granularity:bf.month}),[]),B=r,$=Jan(B),z=D.useMemo(()=>R.getMonth(P),[R,P]),L=D.useMemo(()=>E!=null?R.getMonth(E):null,[E,R]),[j,N]=D.useState(()=>L||R.getMonth(I)),[F,H]=wc({name:"MonthCalendar",state:"hasFocus",controlled:y,default:m??!1}),q=st(te=>{H(te),x&&x(te)}),Y=D.useCallback(te=>{const ae=R.startOfMonth(u&&R.isAfter(P,d)?P:d),U=R.startOfMonth(c&&R.isBefore(P,f)?P:f),oe=R.startOfMonth(te);return R.isBefore(oe,ae)||R.isAfter(oe,U)?!0:p?p(oe):!1},[c,u,f,d,P,p,R]),le=st((te,ae)=>{if(g)return;const U=R.setMonth(E??I,ae);M(U)}),K=st(te=>{Y(R.setMonth(E??I,te))||(N(te),q(!0),v&&v(te))});D.useEffect(()=>{N(te=>L!==null&&te!==L?L:te)},[L]);const ee=st((te,ae)=>{switch(te.key){case"ArrowUp":K((12+ae-3)%12),te.preventDefault();break;case"ArrowDown":K((12+ae+3)%12),te.preventDefault();break;case"ArrowLeft":K((12+ae+(T?1:-1))%12),te.preventDefault();break;case"ArrowRight":K((12+ae+(T?-1:1))%12),te.preventDefault();break}}),re=st((te,ae)=>{K(ae)}),me=st((te,ae)=>{j===ae&&q(!1)});return C.jsx(tln,ve({ref:n,className:Oe($.root,i),ownerState:B,role:"radiogroup","aria-labelledby":_},k,{children:nle(R,E??I).map(te=>{const ae=R.getMonth(te),U=R.format(te,"monthShort"),oe=R.format(te,"month"),ne=ae===L,V=l||Y(te);return C.jsx(Qan,{selected:ne,value:ae,onClick:le,onKeyDown:ee,autoFocus:F&&ae===j,disabled:V,tabIndex:ae===j&&!V?0:-1,onFocus:re,onBlur:me,"aria-current":z===ae?"date":void 0,"aria-label":oe,monthsPerRow:b,slots:S,slotProps:O,children:U},U)})}))});function rln(t){return Ye("MuiPickersYear",t)}const bL=qe("MuiPickersYear",["root","yearButton","selected","disabled"]),iln=["autoFocus","className","children","disabled","selected","value","tabIndex","onClick","onKeyDown","onFocus","onBlur","aria-current","yearsPerRow","slots","slotProps"],oln=t=>{const{disabled:e,selected:n,classes:r}=t;return Xe({root:["root"],yearButton:["yearButton",e&&"disabled",n&&"selected"]},rln,r)},sln=be("div",{name:"MuiPickersYear",slot:"Root",overridesResolver:(t,e)=>[e.root]})({display:"flex",alignItems:"center",justifyContent:"center",flexBasis:"33.3%",variants:[{props:{yearsPerRow:4},style:{flexBasis:"25%"}}]}),aln=be("button",{name:"MuiPickersYear",slot:"YearButton",overridesResolver:(t,e)=>[e.yearButton,{[`&.${bL.disabled}`]:e.disabled},{[`&.${bL.selected}`]:e.selected}]})(({theme:t})=>ve({color:"unset",backgroundColor:"transparent",border:0,outline:0},t.typography.subtitle1,{margin:"6px 0",height:36,width:72,borderRadius:18,cursor:"pointer","&:focus":{backgroundColor:t.vars?`rgba(${t.vars.palette.action.activeChannel} / ${t.vars.palette.action.focusOpacity})`:Tt(t.palette.action.active,t.palette.action.focusOpacity)},"&:hover":{backgroundColor:t.vars?`rgba(${t.vars.palette.action.activeChannel} / ${t.vars.palette.action.hoverOpacity})`:Tt(t.palette.action.active,t.palette.action.hoverOpacity)},"&:disabled":{cursor:"auto",pointerEvents:"none"},[`&.${bL.disabled}`]:{color:(t.vars||t).palette.text.secondary},[`&.${bL.selected}`]:{color:(t.vars||t).palette.primary.contrastText,backgroundColor:(t.vars||t).palette.primary.main,"&:focus, &:hover":{backgroundColor:(t.vars||t).palette.primary.dark}}})),lln=D.memo(function(e){const n=An({props:e,name:"MuiPickersYear"}),{autoFocus:r,className:i,children:o,disabled:s,selected:a,value:l,tabIndex:c,onClick:u,onKeyDown:f,onFocus:d,onBlur:h,"aria-current":p,slots:g,slotProps:m}=n,v=Dt(n,iln),y=D.useRef(null),x=oln(n);Ei(()=>{var _;r&&((_=y.current)==null||_.focus())},[r]);const b=(g==null?void 0:g.yearButton)??aln,w=Zt({elementType:b,externalSlotProps:m==null?void 0:m.yearButton,additionalProps:{children:o,disabled:s,tabIndex:c,ref:y,type:"button",role:"radio","aria-current":p,"aria-checked":a,onClick:_=>u(_,l),onKeyDown:_=>f(_,l),onFocus:_=>d(_,l),onBlur:_=>h(_,l)},ownerState:n,className:x.yearButton});return C.jsx(sln,ve({className:Oe(x.root,i),ownerState:n},v,{children:C.jsx(b,ve({},w))}))});function cln(t){return Ye("MuiYearCalendar",t)}qe("MuiYearCalendar",["root"]);const uln=["autoFocus","className","value","defaultValue","referenceDate","disabled","disableFuture","disablePast","maxDate","minDate","onChange","readOnly","shouldDisableYear","disableHighlightToday","onYearFocus","hasFocus","onFocusedViewChange","yearsOrder","yearsPerRow","timezone","gridLabelId","slots","slotProps"],fln=t=>{const{classes:e}=t;return Xe({root:["root"]},cln,e)};function dln(t,e){const n=pr(),r=rD(),i=An({props:t,name:e});return ve({disablePast:!1,disableFuture:!1},i,{yearsPerRow:i.yearsPerRow??3,minDate:Du(n,i.minDate,r.minDate),maxDate:Du(n,i.maxDate,r.maxDate)})}const hln=be("div",{name:"MuiYearCalendar",slot:"Root",overridesResolver:(t,e)=>e.root})({display:"flex",flexDirection:"row",flexWrap:"wrap",overflowY:"auto",height:"100%",padding:"0 4px",width:SU,maxHeight:ian,boxSizing:"border-box",position:"relative"}),pln=D.forwardRef(function(e,n){const r=dln(e,"MuiYearCalendar"),{autoFocus:i,className:o,value:s,defaultValue:a,referenceDate:l,disabled:c,disableFuture:u,disablePast:f,maxDate:d,minDate:h,onChange:p,readOnly:g,shouldDisableYear:m,onYearFocus:v,hasFocus:y,onFocusedViewChange:x,yearsOrder:b="asc",yearsPerRow:w,timezone:_,gridLabelId:S,slots:O,slotProps:k}=r,E=Dt(r,uln),{value:M,handleValueChange:A,timezone:P}=qO({name:"YearCalendar",timezone:_,value:s,defaultValue:a,onChange:p,valueManager:ia}),T=Ob(P),R=Ho(),I=pr(),B=D.useMemo(()=>ia.getInitialReferenceValue({value:M,utils:I,props:r,timezone:P,referenceDate:l,granularity:bf.year}),[]),$=r,z=fln($),L=D.useMemo(()=>I.getYear(T),[I,T]),j=D.useMemo(()=>M!=null?I.getYear(M):null,[M,I]),[N,F]=D.useState(()=>j||I.getYear(B)),[H,q]=wc({name:"YearCalendar",state:"hasFocus",controlled:y,default:i??!1}),Y=st(X=>{q(X),x&&x(X)}),le=D.useCallback(X=>{if(f&&I.isBeforeYear(X,T)||u&&I.isAfterYear(X,T)||h&&I.isBeforeYear(X,h)||d&&I.isAfterYear(X,d))return!0;if(!m)return!1;const Z=I.startOfYear(X);return m(Z)},[u,f,d,h,T,m,I]),K=st((X,Z)=>{if(g)return;const he=I.setYear(M??B,Z);A(he)}),ee=st(X=>{le(I.setYear(M??B,X))||(F(X),Y(!0),v==null||v(X))});D.useEffect(()=>{F(X=>j!==null&&X!==j?j:X)},[j]);const re=b!=="desc"?w*1:w*-1,me=R&&b==="asc"||!R&&b==="desc"?-1:1,te=st((X,Z)=>{switch(X.key){case"ArrowUp":ee(Z-re),X.preventDefault();break;case"ArrowDown":ee(Z+re),X.preventDefault();break;case"ArrowLeft":ee(Z-me),X.preventDefault();break;case"ArrowRight":ee(Z+me),X.preventDefault();break}}),ae=st((X,Z)=>{ee(Z)}),U=st((X,Z)=>{N===Z&&Y(!1)}),oe=D.useRef(null),ne=dn(n,oe);D.useEffect(()=>{if(i||oe.current===null)return;const X=oe.current.querySelector('[tabindex="0"]');if(!X)return;const Z=X.offsetHeight,he=X.offsetTop,xe=oe.current.clientHeight,G=oe.current.scrollTop,W=he+Z;Z>xe||he{const Z=I.getYear(X),he=Z===j,xe=c||le(X);return C.jsx(lln,{selected:he,value:Z,onClick:K,onKeyDown:te,autoFocus:H&&Z===N,disabled:xe,tabIndex:Z===N&&!xe?0:-1,onFocus:ae,onBlur:U,"aria-current":L===Z?"date":void 0,yearsPerRow:w,slots:O,slotProps:k,children:I.format(X,"year")},I.format(X,"year"))})}))});function iD({onChange:t,onViewChange:e,openTo:n,view:r,views:i,autoFocus:o,focusedView:s,onFocusedViewChange:a}){const l=D.useRef(n),c=D.useRef(i),u=D.useRef(i.includes(n)?n:i[0]),[f,d]=wc({name:"useViews",state:"view",controlled:r,default:u.current}),h=D.useRef(o?f:null),[p,g]=wc({name:"useViews",state:"focusedView",controlled:s,default:h.current});D.useEffect(()=>{(l.current&&l.current!==n||c.current&&c.current.some(S=>!i.includes(S)))&&(d(i.includes(n)?n:i[0]),c.current=i,l.current=n)},[n,d,f,i]);const m=i.indexOf(f),v=i[m-1]??null,y=i[m+1]??null,x=st((S,O)=>{g(O?S:k=>S===k?null:k),a==null||a(S,O)}),b=st(S=>{x(S,!0),S!==f&&(d(S),e&&e(S))}),w=st(()=>{y&&b(y)}),_=st((S,O,k)=>{const E=O==="finish",M=k?i.indexOf(k)Ye("MuiPickersCalendarHeader",t),mln=qe("MuiPickersCalendarHeader",["root","labelContainer","label","switchViewButton","switchViewIcon"]);function vln(t){return Ye("MuiPickersArrowSwitcher",t)}qe("MuiPickersArrowSwitcher",["root","spacer","button","previousIconButton","nextIconButton","leftArrowIcon","rightArrowIcon"]);const yln=["children","className","slots","slotProps","isNextDisabled","isNextHidden","onGoToNext","nextLabel","isPreviousDisabled","isPreviousHidden","onGoToPrevious","previousLabel","labelId"],xln=["ownerState"],bln=["ownerState"],wln=be("div",{name:"MuiPickersArrowSwitcher",slot:"Root",overridesResolver:(t,e)=>e.root})({display:"flex"}),_ln=be("div",{name:"MuiPickersArrowSwitcher",slot:"Spacer",overridesResolver:(t,e)=>e.spacer})(({theme:t})=>({width:t.spacing(3)})),i1e=be(Ht,{name:"MuiPickersArrowSwitcher",slot:"Button",overridesResolver:(t,e)=>e.button})({variants:[{props:{hidden:!0},style:{visibility:"hidden"}}]}),Sln=t=>{const{classes:e}=t;return Xe({root:["root"],spacer:["spacer"],button:["button"],previousIconButton:["previousIconButton"],nextIconButton:["nextIconButton"],leftArrowIcon:["leftArrowIcon"],rightArrowIcon:["rightArrowIcon"]},vln,e)},XWe=D.forwardRef(function(e,n){const r=Ho(),i=An({props:e,name:"MuiPickersArrowSwitcher"}),{children:o,className:s,slots:a,slotProps:l,isNextDisabled:c,isNextHidden:u,onGoToNext:f,nextLabel:d,isPreviousDisabled:h,isPreviousHidden:p,onGoToPrevious:g,previousLabel:m,labelId:v}=i,y=Dt(i,yln),x=i,b=Sln(x),w={isDisabled:c,isHidden:u,goTo:f,label:d},_={isDisabled:h,isHidden:p,goTo:g,label:m},S=(a==null?void 0:a.previousIconButton)??i1e,O=Zt({elementType:S,externalSlotProps:l==null?void 0:l.previousIconButton,additionalProps:{size:"medium",title:_.label,"aria-label":_.label,disabled:_.isDisabled,edge:"end",onClick:_.goTo},ownerState:ve({},x,{hidden:_.isHidden}),className:Oe(b.button,b.previousIconButton)}),k=(a==null?void 0:a.nextIconButton)??i1e,E=Zt({elementType:k,externalSlotProps:l==null?void 0:l.nextIconButton,additionalProps:{size:"medium",title:w.label,"aria-label":w.label,disabled:w.isDisabled,edge:"start",onClick:w.goTo},ownerState:ve({},x,{hidden:w.isHidden}),className:Oe(b.button,b.nextIconButton)}),M=(a==null?void 0:a.leftArrowIcon)??Ion,A=Zt({elementType:M,externalSlotProps:l==null?void 0:l.leftArrowIcon,additionalProps:{fontSize:"inherit"},ownerState:x,className:b.leftArrowIcon}),P=Dt(A,xln),T=(a==null?void 0:a.rightArrowIcon)??Lon,R=Zt({elementType:T,externalSlotProps:l==null?void 0:l.rightArrowIcon,additionalProps:{fontSize:"inherit"},ownerState:x,className:b.rightArrowIcon}),I=Dt(R,bln);return C.jsxs(wln,ve({ref:n,className:Oe(b.root,s),ownerState:x},y,{children:[C.jsx(S,ve({},O,{children:r?C.jsx(T,ve({},I)):C.jsx(M,ve({},P))})),o?C.jsx(Jt,{variant:"subtitle1",component:"span",id:v,children:o}):C.jsx(_ln,{className:b.spacer,ownerState:x}),C.jsx(k,ve({},E,{children:r?C.jsx(M,ve({},P)):C.jsx(T,ve({},I))}))]}))}),Cln=["slots","slotProps","currentMonth","disabled","disableFuture","disablePast","maxDate","minDate","onMonthChange","onViewChange","view","reduceAnimations","views","labelId","className","timezone","format"],Oln=["ownerState"],Eln=t=>{const{classes:e}=t;return Xe({root:["root"],labelContainer:["labelContainer"],label:["label"],switchViewButton:["switchViewButton"],switchViewIcon:["switchViewIcon"]},gln,e)},Tln=be("div",{name:"MuiPickersCalendarHeader",slot:"Root",overridesResolver:(t,e)=>e.root})({display:"flex",alignItems:"center",marginTop:12,marginBottom:4,paddingLeft:24,paddingRight:12,maxHeight:40,minHeight:40}),kln=be("div",{name:"MuiPickersCalendarHeader",slot:"LabelContainer",overridesResolver:(t,e)=>e.labelContainer})(({theme:t})=>ve({display:"flex",overflow:"hidden",alignItems:"center",cursor:"pointer",marginRight:"auto"},t.typography.body1,{fontWeight:t.typography.fontWeightMedium})),Aln=be("div",{name:"MuiPickersCalendarHeader",slot:"Label",overridesResolver:(t,e)=>e.label})({marginRight:6}),Pln=be(Ht,{name:"MuiPickersCalendarHeader",slot:"SwitchViewButton",overridesResolver:(t,e)=>e.switchViewButton})({marginRight:"auto",variants:[{props:{view:"year"},style:{[`.${mln.switchViewIcon}`]:{transform:"rotate(180deg)"}}}]}),Mln=be(Don,{name:"MuiPickersCalendarHeader",slot:"SwitchViewIcon",overridesResolver:(t,e)=>e.switchViewIcon})(({theme:t})=>({willChange:"transform",transition:t.transitions.create("transform"),transform:"rotate(0deg)"})),Rln=D.forwardRef(function(e,n){const r=Rl(),i=pr(),o=An({props:e,name:"MuiPickersCalendarHeader"}),{slots:s,slotProps:a,currentMonth:l,disabled:c,disableFuture:u,disablePast:f,maxDate:d,minDate:h,onMonthChange:p,onViewChange:g,view:m,reduceAnimations:v,views:y,labelId:x,className:b,timezone:w,format:_=`${i.formats.month} ${i.formats.year}`}=o,S=Dt(o,Cln),O=o,k=Eln(o),E=(s==null?void 0:s.switchViewButton)??Pln,M=Zt({elementType:E,externalSlotProps:a==null?void 0:a.switchViewButton,additionalProps:{size:"small","aria-label":r.calendarViewSwitchingButtonAriaLabel(m)},ownerState:O,className:k.switchViewButton}),A=(s==null?void 0:s.switchViewIcon)??Mln,P=Zt({elementType:A,externalSlotProps:a==null?void 0:a.switchViewIcon,ownerState:O,className:k.switchViewIcon}),T=Dt(P,Oln),R=()=>p(i.addMonths(l,1),"left"),I=()=>p(i.addMonths(l,-1),"right"),B=nan(l,{disableFuture:u,maxDate:d,timezone:w}),$=ran(l,{disablePast:f,minDate:h,timezone:w}),z=()=>{if(!(y.length===1||!g||c))if(y.length===2)g(y.find(j=>j!==m)||y[0]);else{const j=y.indexOf(m)!==0?0:1;g(y[j])}};if(y.length===1&&y[0]==="year")return null;const L=i.formatByString(l,_);return C.jsxs(Tln,ve({},S,{ownerState:O,className:Oe(k.root,b),ref:n,children:[C.jsxs(kln,{role:"presentation",onClick:z,ownerState:O,"aria-live":"polite",className:k.labelContainer,children:[C.jsx(VWe,{reduceAnimations:v,transKey:L,children:C.jsx(Aln,{id:x,ownerState:O,className:k.label,children:L})}),y.length>1&&!c&&C.jsx(E,ve({},M,{children:C.jsx(A,ve({},T))}))]}),C.jsx(YC,{in:m==="day",children:C.jsx(XWe,{slots:s,slotProps:a,onGoToPrevious:I,isPreviousDisabled:$,previousLabel:r.previousMonth,onGoToNext:R,isNextDisabled:B,nextLabel:r.nextMonth})})]}))}),OU=be("div")({overflow:"hidden",width:SU,maxHeight:CU,display:"flex",flexDirection:"column",margin:"0 auto"}),Dln="@media (prefers-reduced-motion: reduce)",q_=typeof navigator<"u"&&navigator.userAgent.match(/android\s(\d+)|OS\s(\d+)/i),o1e=q_&&q_[1]?parseInt(q_[1],10):null,s1e=q_&&q_[2]?parseInt(q_[2],10):null,Iln=o1e&&o1e<10||s1e&&s1e<13||!1,YWe=()=>Zke(Dln,{defaultMatches:!1})||Iln,Lln=t=>Ye("MuiDateCalendar",t);qe("MuiDateCalendar",["root","viewTransitionContainer"]);const $ln=["autoFocus","onViewChange","value","defaultValue","referenceDate","disableFuture","disablePast","onChange","onYearChange","onMonthChange","reduceAnimations","shouldDisableDate","shouldDisableMonth","shouldDisableYear","view","views","openTo","className","disabled","readOnly","minDate","maxDate","disableHighlightToday","focusedView","onFocusedViewChange","showDaysOutsideCurrentMonth","fixedWeekNumber","dayOfWeekFormatter","slots","slotProps","loading","renderLoading","displayWeekNumber","yearsOrder","yearsPerRow","monthsPerRow","timezone"],Fln=t=>{const{classes:e}=t;return Xe({root:["root"],viewTransitionContainer:["viewTransitionContainer"]},Lln,e)};function Nln(t,e){const n=pr(),r=rD(),i=YWe(),o=An({props:t,name:e});return ve({},o,{loading:o.loading??!1,disablePast:o.disablePast??!1,disableFuture:o.disableFuture??!1,openTo:o.openTo??"day",views:o.views??["year","day"],reduceAnimations:o.reduceAnimations??i,renderLoading:o.renderLoading??(()=>C.jsx("span",{children:"..."})),minDate:Du(n,o.minDate,r.minDate),maxDate:Du(n,o.maxDate,r.maxDate)})}const zln=be(OU,{name:"MuiDateCalendar",slot:"Root",overridesResolver:(t,e)=>e.root})({display:"flex",flexDirection:"column",height:CU}),jln=be(VWe,{name:"MuiDateCalendar",slot:"ViewTransitionContainer",overridesResolver:(t,e)=>e.viewTransitionContainer})({}),Bln=D.forwardRef(function(e,n){const r=pr(),i=Jf(),o=Nln(e,"MuiDateCalendar"),{autoFocus:s,onViewChange:a,value:l,defaultValue:c,referenceDate:u,disableFuture:f,disablePast:d,onChange:h,onYearChange:p,onMonthChange:g,reduceAnimations:m,shouldDisableDate:v,shouldDisableMonth:y,shouldDisableYear:x,view:b,views:w,openTo:_,className:S,disabled:O,readOnly:k,minDate:E,maxDate:M,disableHighlightToday:A,focusedView:P,onFocusedViewChange:T,showDaysOutsideCurrentMonth:R,fixedWeekNumber:I,dayOfWeekFormatter:B,slots:$,slotProps:z,loading:L,renderLoading:j,displayWeekNumber:N,yearsOrder:F,yearsPerRow:H,monthsPerRow:q,timezone:Y}=o,le=Dt(o,$ln),{value:K,handleValueChange:ee,timezone:re}=qO({name:"DateCalendar",timezone:Y,value:l,defaultValue:c,onChange:h,valueManager:ia}),{view:me,setView:te,focusedView:ae,setFocusedView:U,goToNextView:oe,setValueAndGoToNextView:ne}=iD({view:b,views:w,openTo:_,onChange:ee,onViewChange:a,autoFocus:s,focusedView:P,onFocusedViewChange:T}),{referenceDate:V,calendarState:X,changeFocusedDay:Z,changeMonth:he,handleChangeMonth:xe,isDateDisabled:G,onMonthSwitchingAnimationEnd:W}=pan({value:K,referenceDate:u,reduceAnimations:m,onMonthChange:g,minDate:E,maxDate:M,shouldDisableDate:v,disablePast:d,disableFuture:f,timezone:re}),J=O&&K||E,se=O&&K||M,ye=`${i}-grid-label`,ie=ae!==null,fe=($==null?void 0:$.calendarHeader)??Rln,Q=Zt({elementType:fe,externalSlotProps:z==null?void 0:z.calendarHeader,additionalProps:{views:w,view:me,currentMonth:X.currentMonth,onViewChange:te,onMonthChange:(Se,He)=>xe({newMonth:Se,direction:He}),minDate:J,maxDate:se,disabled:O,disablePast:d,disableFuture:f,reduceAnimations:m,timezone:re,labelId:ye},ownerState:o}),_e=st(Se=>{const He=r.startOfMonth(Se),tt=r.endOfMonth(Se),ut=G(Se)?Sk({utils:r,date:Se,minDate:r.isBefore(E,He)?He:E,maxDate:r.isAfter(M,tt)?tt:M,disablePast:d,disableFuture:f,isDateDisabled:G,timezone:re}):Se;ut?(ne(ut,"finish"),g==null||g(He)):(oe(),he(He)),Z(ut,!0)}),we=st(Se=>{const He=r.startOfYear(Se),tt=r.endOfYear(Se),ut=G(Se)?Sk({utils:r,date:Se,minDate:r.isBefore(E,He)?He:E,maxDate:r.isAfter(M,tt)?tt:M,disablePast:d,disableFuture:f,isDateDisabled:G,timezone:re}):Se;ut?(ne(ut,"finish"),p==null||p(ut)):(oe(),he(He)),Z(ut,!0)}),Ie=st(Se=>ee(Se&&J5(r,Se,K??V),"finish",me));D.useEffect(()=>{K!=null&&r.isValid(K)&&he(K)},[K]);const Pe=o,Me=Fln(Pe),Te={disablePast:d,disableFuture:f,maxDate:M,minDate:E},Le={disableHighlightToday:A,readOnly:k,disabled:O,timezone:re,gridLabelId:ye,slots:$,slotProps:z},ue=D.useRef(me);D.useEffect(()=>{ue.current!==me&&(ae===ue.current&&U(me,!0),ue.current=me)},[ae,U,me]);const $e=D.useMemo(()=>[K],[K]);return C.jsxs(zln,ve({ref:n,className:Oe(Me.root,S),ownerState:Pe},le,{children:[C.jsx(fe,ve({},Q,{slots:$,slotProps:z})),C.jsx(jln,{reduceAnimations:m,className:Me.viewTransitionContainer,transKey:me,ownerState:Pe,children:C.jsxs("div",{children:[me==="year"&&C.jsx(pln,ve({},Te,Le,{value:K,onChange:we,shouldDisableYear:x,hasFocus:ie,onFocusedViewChange:Se=>U("year",Se),yearsOrder:F,yearsPerRow:H,referenceDate:V})),me==="month"&&C.jsx(nln,ve({},Te,Le,{hasFocus:ie,className:S,value:K,onChange:_e,shouldDisableMonth:y,onFocusedViewChange:Se=>U("month",Se),monthsPerRow:q,referenceDate:V})),me==="day"&&C.jsx(Van,ve({},X,Te,Le,{onMonthSwitchingAnimationEnd:W,onFocusedDayChange:Z,reduceAnimations:m,selectedDays:$e,onSelectedDaysChange:Ie,shouldDisableDate:v,shouldDisableMonth:y,shouldDisableYear:x,hasFocus:ie,onFocusedViewChange:Se=>U("day",Se),showDaysOutsideCurrentMonth:R,fixedWeekNumber:I,dayOfWeekFormatter:B,displayWeekNumber:N,loading:L,renderLoading:j}))]})})]}))}),X_=({view:t,onViewChange:e,views:n,focusedView:r,onFocusedViewChange:i,value:o,defaultValue:s,referenceDate:a,onChange:l,className:c,classes:u,disableFuture:f,disablePast:d,minDate:h,maxDate:p,shouldDisableDate:g,shouldDisableMonth:m,shouldDisableYear:v,reduceAnimations:y,onMonthChange:x,monthsPerRow:b,onYearChange:w,yearsOrder:_,yearsPerRow:S,slots:O,slotProps:k,loading:E,renderLoading:M,disableHighlightToday:A,readOnly:P,disabled:T,showDaysOutsideCurrentMonth:R,dayOfWeekFormatter:I,sx:B,autoFocus:$,fixedWeekNumber:z,displayWeekNumber:L,timezone:j})=>C.jsx(Bln,{view:t,onViewChange:e,views:n.filter(hC),focusedView:r&&hC(r)?r:null,onFocusedViewChange:i,value:o,defaultValue:s,referenceDate:a,onChange:l,className:c,classes:u,disableFuture:f,disablePast:d,minDate:h,maxDate:p,shouldDisableDate:g,shouldDisableMonth:m,shouldDisableYear:v,reduceAnimations:y,onMonthChange:x,monthsPerRow:b,onYearChange:w,yearsOrder:_,yearsPerRow:S,slots:O,slotProps:k,loading:E,renderLoading:M,disableHighlightToday:A,readOnly:P,disabled:T,showDaysOutsideCurrentMonth:R,dayOfWeekFormatter:I,sx:B,autoFocus:$,fixedWeekNumber:z,displayWeekNumber:L,timezone:j});function Uln(t){return Ye("MuiPickersPopper",t)}qe("MuiPickersPopper",["root","paper"]);const Wln=["PaperComponent","popperPlacement","ownerState","children","paperSlotProps","paperClasses","onPaperClick","onPaperTouchStart"],Vln=t=>{const{classes:e}=t;return Xe({root:["root"],paper:["paper"]},Uln,e)},Gln=be(See,{name:"MuiPickersPopper",slot:"Root",overridesResolver:(t,e)=>e.root})(({theme:t})=>({zIndex:t.zIndex.modal})),Hln=be(Al,{name:"MuiPickersPopper",slot:"Paper",overridesResolver:(t,e)=>e.paper})({outline:0,transformOrigin:"top center",variants:[{props:({placement:t})=>["top","top-start","top-end"].includes(t),style:{transformOrigin:"bottom center"}}]});function qln(t,e){return e.documentElement.clientWidth{if(!t)return;function l(){o.current=!0}return document.addEventListener("mousedown",l,!0),document.addEventListener("touchstart",l,!0),()=>{document.removeEventListener("mousedown",l,!0),document.removeEventListener("touchstart",l,!0),o.current=!1}},[t]);const s=st(l=>{if(!o.current)return;const c=r.current;r.current=!1;const u=mi(i.current);if(!i.current||"clientX"in l&&qln(l,u))return;if(n.current){n.current=!1;return}let f;l.composedPath?f=l.composedPath().indexOf(i.current)>-1:f=!u.documentElement.contains(l.target)||i.current.contains(l.target),!f&&!c&&e(l)}),a=()=>{r.current=!0};return D.useEffect(()=>{if(t){const l=mi(i.current),c=()=>{n.current=!0};return l.addEventListener("touchstart",s),l.addEventListener("touchmove",c),()=>{l.removeEventListener("touchstart",s),l.removeEventListener("touchmove",c)}}},[t,s]),D.useEffect(()=>{if(t){const l=mi(i.current);return l.addEventListener("click",s),()=>{l.removeEventListener("click",s),r.current=!1}}},[t,s]),[i,a,a]}const Yln=D.forwardRef((t,e)=>{const{PaperComponent:n,popperPlacement:r,ownerState:i,children:o,paperSlotProps:s,paperClasses:a,onPaperClick:l,onPaperTouchStart:c}=t,u=Dt(t,Wln),f=ve({},i,{placement:r}),d=Zt({elementType:n,externalSlotProps:s,additionalProps:{tabIndex:-1,elevation:8,ref:e},className:a,ownerState:f});return C.jsx(n,ve({},u,d,{onClick:h=>{var p;l(h),(p=d.onClick)==null||p.call(d,h)},onTouchStart:h=>{var p;c(h),(p=d.onTouchStart)==null||p.call(d,h)},ownerState:f,children:o}))});function Qln(t){const e=An({props:t,name:"MuiPickersPopper"}),{anchorEl:n,children:r,containerRef:i=null,shouldRestoreFocus:o,onBlur:s,onDismiss:a,open:l,role:c,placement:u,slots:f,slotProps:d,reduceAnimations:h}=e;D.useEffect(()=>{function R(I){l&&I.key==="Escape"&&a()}return document.addEventListener("keydown",R),()=>{document.removeEventListener("keydown",R)}},[a,l]);const p=D.useRef(null);D.useEffect(()=>{c==="tooltip"||o&&!o()||(l?p.current=Za(document):p.current&&p.current instanceof HTMLElement&&setTimeout(()=>{p.current instanceof HTMLElement&&p.current.focus()}))},[l,c,o]);const[g,m,v]=Xln(l,s??a),y=D.useRef(null),x=dn(y,i),b=dn(x,g),w=e,_=Vln(w),S=YWe(),O=h??S,k=R=>{R.key==="Escape"&&(R.stopPropagation(),a())},E=(f==null?void 0:f.desktopTransition)??O?YC:n1,M=(f==null?void 0:f.desktopTrapFocus)??zAe,A=(f==null?void 0:f.desktopPaper)??Hln,P=(f==null?void 0:f.popper)??Gln,T=Zt({elementType:P,externalSlotProps:d==null?void 0:d.popper,additionalProps:{transition:!0,role:c,open:l,anchorEl:n,placement:u,onKeyDown:k},className:_.root,ownerState:e});return C.jsx(P,ve({},T,{children:({TransitionProps:R,placement:I})=>C.jsx(M,ve({open:l,disableAutoFocus:!0,disableRestoreFocus:!0,disableEnforceFocus:c==="tooltip",isEnabled:()=>!0},d==null?void 0:d.desktopTrapFocus,{children:C.jsx(E,ve({},R,d==null?void 0:d.desktopTransition,{children:C.jsx(Yln,{PaperComponent:A,ownerState:w,popperPlacement:I,ref:b,onPaperClick:m,onPaperTouchStart:v,paperClasses:_.paper,paperSlotProps:d==null?void 0:d.desktopPaper,children:r})}))}))}))}const Kln=({open:t,onOpen:e,onClose:n})=>{const r=D.useRef(typeof t=="boolean").current,[i,o]=D.useState(!1);D.useEffect(()=>{if(r){if(typeof t!="boolean")throw new Error("You must not mix controlling and uncontrolled mode for `open` prop");o(t)}},[r,t]);const s=D.useCallback(a=>{r||o(a),a&&e&&e(),!a&&n&&n()},[r,e,n]);return{isOpen:i,setIsOpen:s}},Zln=t=>{const{action:e,hasChanged:n,dateState:r,isControlled:i}=t,o=!i&&!r.hasBeenModifiedSinceMount;return e.name==="setValueFromField"?!0:e.name==="setValueFromAction"?o&&["accept","today","clear"].includes(e.pickerAction)?!0:n(r.lastPublishedValue):e.name==="setValueFromView"&&e.selectionState!=="shallow"||e.name==="setValueFromShortcut"?o?!0:n(r.lastPublishedValue):!1},Jln=t=>{const{action:e,hasChanged:n,dateState:r,isControlled:i,closeOnSelect:o}=t,s=!i&&!r.hasBeenModifiedSinceMount;return e.name==="setValueFromAction"?s&&["accept","today","clear"].includes(e.pickerAction)?!0:n(r.lastCommittedValue):e.name==="setValueFromView"&&e.selectionState==="finish"&&o?s?!0:n(r.lastCommittedValue):e.name==="setValueFromShortcut"?e.changeImportance==="accept"&&n(r.lastCommittedValue):!1},ecn=t=>{const{action:e,closeOnSelect:n}=t;return e.name==="setValueFromAction"?!0:e.name==="setValueFromView"?e.selectionState==="finish"&&n:e.name==="setValueFromShortcut"?e.changeImportance==="accept":!1},tcn=({props:t,valueManager:e,valueType:n,wrapperVariant:r,validator:i})=>{const{onAccept:o,onChange:s,value:a,defaultValue:l,closeOnSelect:c=r==="desktop",timezone:u}=t,{current:f}=D.useRef(l),{current:d}=D.useRef(a!==void 0),h=pr(),p=Cb(),{isOpen:g,setIsOpen:m}=Kln(t),{timezone:v,value:y,handleValueChange:x}=ale({timezone:u,value:a,defaultValue:f,onChange:s,valueManager:e}),[b,w]=D.useState(()=>{let q;return y!==void 0?q=y:f!==void 0?q=f:q=e.emptyValue,{draft:q,lastPublishedValue:q,lastCommittedValue:q,lastControlledValue:y,hasBeenModifiedSinceMount:!1}}),{getValidationErrorForNewValue:_}=AWe({props:t,validator:i,timezone:v,value:b.draft,onError:t.onError}),S=st(q=>{const Y={action:q,dateState:b,hasChanged:te=>!e.areValuesEqual(h,q.value,te),isControlled:d,closeOnSelect:c},le=Zln(Y),K=Jln(Y),ee=ecn(Y);w(te=>ve({},te,{draft:q.value,lastPublishedValue:le?q.value:te.lastPublishedValue,lastCommittedValue:K?q.value:te.lastCommittedValue,hasBeenModifiedSinceMount:!0}));let re=null;const me=()=>(re||(re={validationError:q.name==="setValueFromField"?q.context.validationError:_(q.value)},q.name==="setValueFromShortcut"&&(re.shortcut=q.shortcut)),re);le&&x(q.value,me()),K&&o&&o(q.value,me()),ee&&m(!1)});if(y!==void 0&&(b.lastControlledValue===void 0||!e.areValuesEqual(h,b.lastControlledValue,y))){const q=e.areValuesEqual(h,b.draft,y);w(Y=>ve({},Y,{lastControlledValue:y},q?{}:{lastCommittedValue:y,lastPublishedValue:y,draft:y,hasBeenModifiedSinceMount:!0}))}const O=st(()=>{S({value:e.emptyValue,name:"setValueFromAction",pickerAction:"clear"})}),k=st(()=>{S({value:b.lastPublishedValue,name:"setValueFromAction",pickerAction:"accept"})}),E=st(()=>{S({value:b.lastPublishedValue,name:"setValueFromAction",pickerAction:"dismiss"})}),M=st(()=>{S({value:b.lastCommittedValue,name:"setValueFromAction",pickerAction:"cancel"})}),A=st(()=>{S({value:e.getTodayValue(h,v,n),name:"setValueFromAction",pickerAction:"today"})}),P=st(q=>{q.preventDefault(),m(!0)}),T=st(q=>{q==null||q.preventDefault(),m(!1)}),R=st((q,Y="partial")=>S({name:"setValueFromView",value:q,selectionState:Y})),I=st((q,Y,le)=>S({name:"setValueFromShortcut",value:q,changeImportance:Y,shortcut:le})),B=st((q,Y)=>S({name:"setValueFromField",value:q,context:Y})),$={onClear:O,onAccept:k,onDismiss:E,onCancel:M,onSetToday:A,onOpen:P,onClose:T},z={value:b.draft,onChange:B},L=D.useMemo(()=>e.cleanValue(h,b.draft),[h,e,b.draft]),j={value:L,onChange:R,onClose:T,open:g},F=ve({},$,{value:L,onChange:R,onSelectShortcut:I,isValid:q=>{const Y=i({adapter:p,value:q,timezone:v,props:t});return!e.hasError(Y)}}),H=D.useMemo(()=>({onOpen:P,onClose:T,open:g}),[g,T,P]);return{open:g,fieldProps:z,viewProps:j,layoutProps:F,actions:$,contextValue:H}},ncn=["className","sx"],rcn=({props:t,propsFromPickerValue:e,additionalViewProps:n,autoFocusView:r,rendererInterceptor:i,fieldRef:o})=>{const{onChange:s,open:a,onClose:l}=e,{view:c,views:u,openTo:f,onViewChange:d,viewRenderers:h,timezone:p}=t,g=Dt(t,ncn),{view:m,setView:v,defaultView:y,focusedView:x,setFocusedView:b,setValueAndGoToNextView:w}=iD({view:c,views:u,openTo:f,onChange:s,onViewChange:d,autoFocus:r}),{hasUIView:_,viewModeLookup:S}=D.useMemo(()=>u.reduce((T,R)=>{let I;return h[R]!=null?I="UI":I="field",T.viewModeLookup[R]=I,I==="UI"&&(T.hasUIView=!0),T},{hasUIView:!1,viewModeLookup:{}}),[h,u]),O=D.useMemo(()=>u.reduce((T,R)=>h[R]!=null&&pC(R)?T+1:T,0),[h,u]),k=S[m],E=st(()=>k==="UI"),[M,A]=D.useState(k==="UI"?m:null);return M!==m&&S[m]==="UI"&&A(m),Ei(()=>{k==="field"&&a&&(l(),setTimeout(()=>{var T,R;(T=o==null?void 0:o.current)==null||T.setSelectedSections(m),(R=o==null?void 0:o.current)==null||R.focusField(m)}))},[m]),Ei(()=>{if(!a)return;let T=m;k==="field"&&M!=null&&(T=M),T!==y&&S[T]==="UI"&&S[y]==="UI"&&(T=y),T!==m&&v(T),b(T,!0)},[a]),{hasUIView:_,shouldRestoreFocus:E,layoutProps:{views:u,view:M,onViewChange:v},renderCurrentView:()=>{if(M==null)return null;const T=h[M];if(T==null)return null;const R=ve({},g,n,e,{views:u,timezone:p,onChange:w,view:M,onViewChange:v,focusedView:x,onFocusedViewChange:b,showViewSwitcher:O>1,timeViewsCount:O});return i?i(h,M,R):T(R)}}};function a1e(){return typeof window>"u"?"portrait":window.screen&&window.screen.orientation&&window.screen.orientation.angle?Math.abs(window.screen.orientation.angle)===90?"landscape":"portrait":window.orientation&&Math.abs(Number(window.orientation))===90?"landscape":"portrait"}const icn=(t,e)=>{const[n,r]=D.useState(a1e);return Ei(()=>{const o=()=>{r(a1e())};return window.addEventListener("orientationchange",o),()=>{window.removeEventListener("orientationchange",o)}},[]),Eon(t,["hours","minutes","seconds"])?!1:(e||n)==="landscape"},ocn=({props:t,propsFromPickerValue:e,propsFromPickerViews:n,wrapperVariant:r})=>{const{orientation:i}=t,o=icn(n.views,i),s=Ho();return{layoutProps:ve({},n,e,{isLandscape:o,isRtl:s,wrapperVariant:r,disabled:t.disabled,readOnly:t.readOnly})}};function scn(t){const{props:e,pickerValueResponse:n}=t;return D.useMemo(()=>({value:n.viewProps.value,open:n.open,disabled:e.disabled??!1,readOnly:e.readOnly??!1}),[n.viewProps.value,n.open,e.disabled,e.readOnly])}const QWe=({props:t,valueManager:e,valueType:n,wrapperVariant:r,additionalViewProps:i,validator:o,autoFocusView:s,rendererInterceptor:a,fieldRef:l})=>{const c=tcn({props:t,valueManager:e,valueType:n,wrapperVariant:r,validator:o}),u=rcn({props:t,additionalViewProps:i,autoFocusView:s,fieldRef:l,propsFromPickerValue:c.viewProps,rendererInterceptor:a}),f=ocn({props:t,wrapperVariant:r,propsFromPickerValue:c.layoutProps,propsFromPickerViews:u.layoutProps}),d=scn({props:t,pickerValueResponse:c});return{open:c.open,actions:c.actions,fieldProps:c.fieldProps,renderCurrentView:u.renderCurrentView,hasUIView:u.hasUIView,shouldRestoreFocus:u.shouldRestoreFocus,layoutProps:f.layoutProps,contextValue:c.contextValue,ownerState:d}};function KWe(t){return Ye("MuiPickersLayout",t)}const pf=qe("MuiPickersLayout",["root","landscape","contentWrapper","toolbar","actionBar","tabs","shortcuts"]),acn=["onAccept","onClear","onCancel","onSetToday","actions"];function lcn(t){const{onAccept:e,onClear:n,onCancel:r,onSetToday:i,actions:o}=t,s=Dt(t,acn),a=Rl();if(o==null||o.length===0)return null;const l=o==null?void 0:o.map(c=>{switch(c){case"clear":return C.jsx(Vr,{onClick:n,children:a.clearButtonLabel},c);case"cancel":return C.jsx(Vr,{onClick:r,children:a.cancelButtonLabel},c);case"accept":return C.jsx(Vr,{onClick:e,children:a.okButtonLabel},c);case"today":return C.jsx(Vr,{onClick:i,children:a.todayButtonLabel},c);default:return null}});return C.jsx(Q1,ve({},s,{children:l}))}const ccn=["items","changeImportance","isLandscape","onChange","isValid"],ucn=["getValue"];function fcn(t){const{items:e,changeImportance:n="accept",onChange:r,isValid:i}=t,o=Dt(t,ccn);if(e==null||e.length===0)return null;const s=e.map(a=>{let{getValue:l}=a,c=Dt(a,ucn);const u=l({isValid:i});return ve({},c,{label:c.label,onClick:()=>{r(u,n,c)},disabled:!i(u)})});return C.jsx(DM,ve({dense:!0,sx:[{maxHeight:CU,maxWidth:200,overflow:"auto"},...Array.isArray(o.sx)?o.sx:[o.sx]]},o,{children:s.map(a=>C.jsx(M_,{children:C.jsx(RAe,ve({},a))},a.id??a.label))}))}function dcn(t){return t.view!==null}const hcn=t=>{const{classes:e,isLandscape:n}=t;return Xe({root:["root",n&&"landscape"],contentWrapper:["contentWrapper"],toolbar:["toolbar"],actionBar:["actionBar"],tabs:["tabs"],landscape:["landscape"],shortcuts:["shortcuts"]},KWe,e)},ZWe=t=>{const{wrapperVariant:e,onAccept:n,onClear:r,onCancel:i,onSetToday:o,view:s,views:a,onViewChange:l,value:c,onChange:u,onSelectShortcut:f,isValid:d,isLandscape:h,disabled:p,readOnly:g,children:m,slots:v,slotProps:y}=t,x=hcn(t),b=(v==null?void 0:v.actionBar)??lcn,w=Zt({elementType:b,externalSlotProps:y==null?void 0:y.actionBar,additionalProps:{onAccept:n,onClear:r,onCancel:i,onSetToday:o,actions:e==="desktop"?[]:["cancel","accept"]},className:x.actionBar,ownerState:ve({},t,{wrapperVariant:e})}),_=C.jsx(b,ve({},w)),S=v==null?void 0:v.toolbar,O=Zt({elementType:S,externalSlotProps:y==null?void 0:y.toolbar,additionalProps:{isLandscape:h,onChange:u,value:c,view:s,onViewChange:l,views:a,disabled:p,readOnly:g},className:x.toolbar,ownerState:ve({},t,{wrapperVariant:e})}),k=dcn(O)&&S?C.jsx(S,ve({},O)):null,E=m,M=v==null?void 0:v.tabs,A=s&&M?C.jsx(M,ve({view:s,onViewChange:l,className:x.tabs},y==null?void 0:y.tabs)):null,P=(v==null?void 0:v.shortcuts)??fcn,T=Zt({elementType:P,externalSlotProps:y==null?void 0:y.shortcuts,additionalProps:{isValid:d,isLandscape:h,onChange:f},className:x.shortcuts,ownerState:{isValid:d,isLandscape:h,onChange:f,wrapperVariant:e}}),R=s&&P?C.jsx(P,ve({},T)):null;return{toolbar:k,content:E,tabs:A,actionBar:_,shortcuts:R}},pcn=t=>{const{isLandscape:e,classes:n}=t;return Xe({root:["root",e&&"landscape"],contentWrapper:["contentWrapper"]},KWe,n)},JWe=be("div",{name:"MuiPickersLayout",slot:"Root",overridesResolver:(t,e)=>e.root})({display:"grid",gridAutoColumns:"max-content auto max-content",gridAutoRows:"max-content auto max-content",[`& .${pf.actionBar}`]:{gridColumn:"1 / 4",gridRow:3},variants:[{props:{isLandscape:!0},style:{[`& .${pf.toolbar}`]:{gridColumn:1,gridRow:"2 / 3"},[`.${pf.shortcuts}`]:{gridColumn:"2 / 4",gridRow:1}}},{props:{isLandscape:!0,isRtl:!0},style:{[`& .${pf.toolbar}`]:{gridColumn:3}}},{props:{isLandscape:!1},style:{[`& .${pf.toolbar}`]:{gridColumn:"2 / 4",gridRow:1},[`& .${pf.shortcuts}`]:{gridColumn:1,gridRow:"2 / 3"}}},{props:{isLandscape:!1,isRtl:!0},style:{[`& .${pf.shortcuts}`]:{gridColumn:3}}}]}),eVe=be("div",{name:"MuiPickersLayout",slot:"ContentWrapper",overridesResolver:(t,e)=>e.contentWrapper})({gridColumn:2,gridRow:2,display:"flex",flexDirection:"column"}),tVe=D.forwardRef(function(e,n){const r=An({props:e,name:"MuiPickersLayout"}),{toolbar:i,content:o,tabs:s,actionBar:a,shortcuts:l}=ZWe(r),{sx:c,className:u,isLandscape:f,wrapperVariant:d}=r,h=pcn(r);return C.jsxs(JWe,{ref:n,sx:c,className:Oe(h.root,u),ownerState:r,children:[f?l:i,f?i:l,C.jsx(eVe,{className:h.contentWrapper,children:d==="desktop"?C.jsxs(D.Fragment,{children:[o,s]}):C.jsxs(D.Fragment,{children:[s,o]})}),a]})}),gcn=["props","getOpenDialogAriaText"],mcn=["ownerState"],vcn=["ownerState"],ycn=t=>{var oe;let{props:e,getOpenDialogAriaText:n}=t,r=Dt(t,gcn);const{slots:i,slotProps:o,className:s,sx:a,format:l,formatDensity:c,enableAccessibleFieldDOMStructure:u,selectedSections:f,onSelectedSectionsChange:d,timezone:h,name:p,label:g,inputRef:m,readOnly:v,disabled:y,autoFocus:x,localeText:b,reduceAnimations:w}=e,_=D.useRef(null),S=D.useRef(null),O=Jf(),k=((oe=o==null?void 0:o.toolbar)==null?void 0:oe.hidden)??!1,{open:E,actions:M,hasUIView:A,layoutProps:P,renderCurrentView:T,shouldRestoreFocus:R,fieldProps:I,contextValue:B,ownerState:$}=QWe(ve({},r,{props:e,fieldRef:S,autoFocusView:!0,additionalViewProps:{},wrapperVariant:"desktop"})),z=i.inputAdornment??WAe,L=Zt({elementType:z,externalSlotProps:o==null?void 0:o.inputAdornment,additionalProps:{position:"end"},ownerState:e}),j=Dt(L,mcn),N=i.openPickerButton??Ht,F=Zt({elementType:N,externalSlotProps:o==null?void 0:o.openPickerButton,additionalProps:{disabled:y||v,onClick:E?M.onClose:M.onOpen,"aria-label":n(I.value),edge:j.position},ownerState:e}),H=Dt(F,vcn),q=i.openPickerIcon,Y=Zt({elementType:q,externalSlotProps:o==null?void 0:o.openPickerIcon,ownerState:$}),le=i.field,K=Zt({elementType:le,externalSlotProps:o==null?void 0:o.field,additionalProps:ve({},I,k&&{id:O},{readOnly:v,disabled:y,className:s,sx:a,format:l,formatDensity:c,enableAccessibleFieldDOMStructure:u,selectedSections:f,onSelectedSectionsChange:d,timezone:h,label:g,name:p,autoFocus:x&&!e.open,focused:E?!0:void 0},m?{inputRef:m}:{}),ownerState:e});A&&(K.InputProps=ve({},K.InputProps,{ref:_},!e.disableOpenPicker&&{[`${j.position}Adornment`]:C.jsx(z,ve({},j,{children:C.jsx(N,ve({},H,{children:C.jsx(q,ve({},Y))}))}))}));const ee=ve({textField:i.textField,clearIcon:i.clearIcon,clearButton:i.clearButton},K.slots),re=i.layout??tVe;let me=O;k&&(g?me=`${O}-label`:me=void 0);const te=ve({},o,{toolbar:ve({},o==null?void 0:o.toolbar,{titleId:O}),popper:ve({"aria-labelledby":me},o==null?void 0:o.popper)}),ae=dn(S,K.unstableFieldRef);return{renderPicker:()=>C.jsxs(PWe,{contextValue:B,localeText:b,children:[C.jsx(le,ve({},K,{slots:ee,slotProps:te,unstableFieldRef:ae})),C.jsx(Qln,ve({role:"dialog",placement:"bottom-start",anchorEl:_.current},M,{open:E,slots:i,slotProps:te,shouldRestoreFocus:R,reduceAnimations:w,children:C.jsx(re,ve({},P,te==null?void 0:te.layout,{slots:i,slotProps:te,children:T()}))}))]})}},xcn=["views","format"],nVe=(t,e,n)=>{let{views:r,format:i}=e,o=Dt(e,xcn);if(i)return i;const s=[],a=[];if(r.forEach(u=>{pC(u)?a.push(u):hC(u)&&s.push(u)}),a.length===0)return qxe(t,ve({views:s},o));if(s.length===0)return Yxe(t,ve({views:a},o));const l=Yxe(t,ve({views:a},o));return`${qxe(t,ve({views:s},o))} ${l}`},bcn=(t,e,n)=>n?e.filter(r=>!TT(r)||r==="hours"):t?[...e,"meridiem"]:e,wcn=(t,e)=>24*60/((t.hours??1)*(t.minutes??5))<=e;function _cn({thresholdToRenderTimeInASingleColumn:t,ampm:e,timeSteps:n,views:r}){const i=t??24,o=ve({hours:1,minutes:5,seconds:5},n),s=wcn(o,i);return{thresholdToRenderTimeInASingleColumn:i,timeSteps:o,shouldRenderTimeInASingleColumn:s,views:bcn(e,r,s)}}function Scn(t){return Ye("MuiTimeClock",t)}qe("MuiTimeClock",["root","arrowSwitcher"]);const gC=220,hg=36,oP={x:gC/2,y:gC/2},rVe={x:oP.x,y:0},Ccn=rVe.x-oP.x,Ocn=rVe.y-oP.y,Ecn=t=>t*(180/Math.PI),iVe=(t,e,n)=>{const r=e-oP.x,i=n-oP.y,o=Math.atan2(Ccn,Ocn)-Math.atan2(r,i);let s=Ecn(o);s=Math.round(s/t)*t,s%=360;const a=Math.floor(s/t)||0,l=r**2+i**2,c=Math.sqrt(l);return{value:a,distance:c}},Tcn=(t,e,n=1)=>{const r=n*6;let{value:i}=iVe(r,t,e);return i=i*n%60,i},kcn=(t,e,n)=>{const{value:r,distance:i}=iVe(30,t,e);let o=r||12;return n?o%=12:i{const{classes:e}=t;return Xe({root:["root"],thumb:["thumb"]},Acn,e)},Rcn=be("div",{name:"MuiClockPointer",slot:"Root",overridesResolver:(t,e)=>e.root})(({theme:t})=>({width:2,backgroundColor:(t.vars||t).palette.primary.main,position:"absolute",left:"calc(50% - 1px)",bottom:"50%",transformOrigin:"center bottom 0px",variants:[{props:{shouldAnimate:!0},style:{transition:t.transitions.create(["transform","height"])}}]})),Dcn=be("div",{name:"MuiClockPointer",slot:"Thumb",overridesResolver:(t,e)=>e.thumb})(({theme:t})=>({width:4,height:4,backgroundColor:(t.vars||t).palette.primary.contrastText,borderRadius:"50%",position:"absolute",top:-21,left:`calc(50% - ${hg/2}px)`,border:`${(hg-4)/2}px solid ${(t.vars||t).palette.primary.main}`,boxSizing:"content-box",variants:[{props:{hasSelected:!0},style:{backgroundColor:(t.vars||t).palette.primary.main}}]}));function Icn(t){const e=An({props:t,name:"MuiClockPointer"}),{className:n,isInner:r,type:i,viewValue:o}=e,s=Dt(e,Pcn),a=D.useRef(i);D.useEffect(()=>{a.current=i},[i]);const l=ve({},e,{shouldAnimate:a.current!==i}),c=Mcn(l),u=()=>{let d=360/(i==="hours"?12:60)*o;return i==="hours"&&o>12&&(d-=360),{height:Math.round((r?.26:.4)*gC),transform:`rotateZ(${d}deg)`}};return C.jsx(Rcn,ve({style:u(),className:Oe(c.root,n),ownerState:l},s,{children:C.jsx(Dcn,{ownerState:l,className:c.thumb})}))}function Lcn(t){return Ye("MuiClock",t)}qe("MuiClock",["root","clock","wrapper","squareMask","pin","amButton","pmButton","meridiemText","selected"]);const $cn=t=>{const{classes:e,meridiemMode:n}=t;return Xe({root:["root"],clock:["clock"],wrapper:["wrapper"],squareMask:["squareMask"],pin:["pin"],amButton:["amButton",n==="am"&&"selected"],pmButton:["pmButton",n==="pm"&&"selected"],meridiemText:["meridiemText"]},Lcn,e)},Fcn=be("div",{name:"MuiClock",slot:"Root",overridesResolver:(t,e)=>e.root})(({theme:t})=>({display:"flex",justifyContent:"center",alignItems:"center",margin:t.spacing(2)})),Ncn=be("div",{name:"MuiClock",slot:"Clock",overridesResolver:(t,e)=>e.clock})({backgroundColor:"rgba(0,0,0,.07)",borderRadius:"50%",height:220,width:220,flexShrink:0,position:"relative",pointerEvents:"none"}),zcn=be("div",{name:"MuiClock",slot:"Wrapper",overridesResolver:(t,e)=>e.wrapper})({"&:focus":{outline:"none"}}),jcn=be("div",{name:"MuiClock",slot:"SquareMask",overridesResolver:(t,e)=>e.squareMask})({width:"100%",height:"100%",position:"absolute",pointerEvents:"auto",outline:0,touchAction:"none",userSelect:"none",variants:[{props:{disabled:!1},style:{"@media (pointer: fine)":{cursor:"pointer",borderRadius:"50%"},"&:active":{cursor:"move"}}}]}),Bcn=be("div",{name:"MuiClock",slot:"Pin",overridesResolver:(t,e)=>e.pin})(({theme:t})=>({width:6,height:6,borderRadius:"50%",backgroundColor:(t.vars||t).palette.primary.main,position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)"})),oVe=(t,e)=>({zIndex:1,bottom:8,paddingLeft:4,paddingRight:4,width:hg,variants:[{props:{meridiemMode:e},style:{backgroundColor:(t.vars||t).palette.primary.main,color:(t.vars||t).palette.primary.contrastText,"&:hover":{backgroundColor:(t.vars||t).palette.primary.light}}}]}),Ucn=be(Ht,{name:"MuiClock",slot:"AmButton",overridesResolver:(t,e)=>e.amButton})(({theme:t})=>ve({},oVe(t,"am"),{position:"absolute",left:8})),Wcn=be(Ht,{name:"MuiClock",slot:"PmButton",overridesResolver:(t,e)=>e.pmButton})(({theme:t})=>ve({},oVe(t,"pm"),{position:"absolute",right:8})),l1e=be(Jt,{name:"MuiClock",slot:"meridiemText",overridesResolver:(t,e)=>e.meridiemText})({overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"});function Vcn(t){const e=An({props:t,name:"MuiClock"}),{ampm:n,ampmInClock:r,autoFocus:i,children:o,value:s,handleMeridiemChange:a,isTimeDisabled:l,meridiemMode:c,minutesStep:u=1,onChange:f,selectedId:d,type:h,viewValue:p,disabled:g=!1,readOnly:m,className:v}=e,y=e,x=pr(),b=Rl(),w=D.useRef(!1),_=$cn(y),S=l(p,h),O=!n&&h==="hours"&&(p<1||p>12),k=(z,L)=>{g||m||l(z,h)||f(z,L)},E=(z,L)=>{let{offsetX:j,offsetY:N}=z;if(j===void 0){const H=z.target.getBoundingClientRect();j=z.changedTouches[0].clientX-H.left,N=z.changedTouches[0].clientY-H.top}const F=h==="seconds"||h==="minutes"?Tcn(j,N,u):kcn(j,N,!!n);k(F,L)},M=z=>{w.current=!0,E(z,"shallow")},A=z=>{w.current&&(E(z,"finish"),w.current=!1)},P=z=>{z.buttons>0&&E(z.nativeEvent,"shallow")},T=z=>{w.current&&(w.current=!1),E(z.nativeEvent,"finish")},R=D.useMemo(()=>h==="hours"?!0:p%5===0,[h,p]),I=h==="minutes"?u:1,B=D.useRef(null);Ei(()=>{i&&B.current.focus()},[i]);const $=z=>{if(!w.current)switch(z.key){case"Home":k(0,"partial"),z.preventDefault();break;case"End":k(h==="minutes"?59:23,"partial"),z.preventDefault();break;case"ArrowUp":k(p+I,"partial"),z.preventDefault();break;case"ArrowDown":k(p-I,"partial"),z.preventDefault();break;case"PageUp":k(p+5,"partial"),z.preventDefault();break;case"PageDown":k(p-5,"partial"),z.preventDefault();break;case"Enter":case" ":k(p,"finish"),z.preventDefault();break}};return C.jsxs(Fcn,{className:Oe(_.root,v),children:[C.jsxs(Ncn,{className:_.clock,children:[C.jsx(jcn,{onTouchMove:M,onTouchStart:M,onTouchEnd:A,onMouseUp:T,onMouseMove:P,ownerState:{disabled:g},className:_.squareMask}),!S&&C.jsxs(D.Fragment,{children:[C.jsx(Bcn,{className:_.pin}),s!=null&&C.jsx(Icn,{type:h,viewValue:p,isInner:O,hasSelected:R})]}),C.jsx(zcn,{"aria-activedescendant":d,"aria-label":b.clockLabelText(h,s,x,s==null?null:x.format(s,"fullTime")),ref:B,role:"listbox",onKeyDown:$,tabIndex:0,className:_.wrapper,children:o})]}),n&&r&&C.jsxs(D.Fragment,{children:[C.jsx(Ucn,{onClick:m?void 0:()=>a("am"),disabled:g||c===null,ownerState:y,className:_.amButton,title:Jp(x,"am"),children:C.jsx(l1e,{variant:"caption",className:_.meridiemText,children:Jp(x,"am")})}),C.jsx(Wcn,{disabled:g||c===null,onClick:m?void 0:()=>a("pm"),ownerState:y,className:_.pmButton,title:Jp(x,"pm"),children:C.jsx(l1e,{variant:"caption",className:_.meridiemText,children:Jp(x,"pm")})})]})]})}function Gcn(t){return Ye("MuiClockNumber",t)}const wL=qe("MuiClockNumber",["root","selected","disabled"]),Hcn=["className","disabled","index","inner","label","selected"],qcn=t=>{const{classes:e,selected:n,disabled:r}=t;return Xe({root:["root",n&&"selected",r&&"disabled"]},Gcn,e)},Xcn=be("span",{name:"MuiClockNumber",slot:"Root",overridesResolver:(t,e)=>[e.root,{[`&.${wL.disabled}`]:e.disabled},{[`&.${wL.selected}`]:e.selected}]})(({theme:t})=>({height:hg,width:hg,position:"absolute",left:`calc((100% - ${hg}px) / 2)`,display:"inline-flex",justifyContent:"center",alignItems:"center",borderRadius:"50%",color:(t.vars||t).palette.text.primary,fontFamily:t.typography.fontFamily,"&:focused":{backgroundColor:(t.vars||t).palette.background.paper},[`&.${wL.selected}`]:{color:(t.vars||t).palette.primary.contrastText},[`&.${wL.disabled}`]:{pointerEvents:"none",color:(t.vars||t).palette.text.disabled},variants:[{props:{inner:!0},style:ve({},t.typography.body2,{color:(t.vars||t).palette.text.secondary})}]}));function sVe(t){const e=An({props:t,name:"MuiClockNumber"}),{className:n,disabled:r,index:i,inner:o,label:s,selected:a}=e,l=Dt(e,Hcn),c=e,u=qcn(c),f=i%12/12*Math.PI*2-Math.PI/2,d=(gC-hg-2)/2*(o?.65:1),h=Math.round(Math.cos(f)*d),p=Math.round(Math.sin(f)*d);return C.jsx(Xcn,ve({className:Oe(u.root,n),"aria-disabled":r?!0:void 0,"aria-selected":a?!0:void 0,role:"option",style:{transform:`translate(${h}px, ${p+(gC-hg)/2}px`},ownerState:c},l,{children:s}))}const Ycn=({ampm:t,value:e,getClockNumberText:n,isDisabled:r,selectedId:i,utils:o})=>{const s=e?o.getHours(e):null,a=[],l=t?1:0,c=t?12:23,u=f=>s===null?!1:t?f===12?s===12||s===0:s===f||s-12===f:s===f;for(let f=l;f<=c;f+=1){let d=f.toString();f===0&&(d="00");const h=!t&&(f===0||f>12);d=o.formatNumber(d);const p=u(f);a.push(C.jsx(sVe,{id:p?i:void 0,index:f,inner:h,selected:p,disabled:r(f),label:d,"aria-label":n(d)},f))}return a},c1e=({utils:t,value:e,isDisabled:n,getClockNumberText:r,selectedId:i})=>{const o=t.formatNumber;return[[5,o("05")],[10,o("10")],[15,o("15")],[20,o("20")],[25,o("25")],[30,o("30")],[35,o("35")],[40,o("40")],[45,o("45")],[50,o("50")],[55,o("55")],[0,o("00")]].map(([s,a],l)=>{const c=s===e;return C.jsx(sVe,{label:a,id:c?i:void 0,index:l+1,inner:!1,disabled:n(s),selected:c,"aria-label":r(a)},s)})},fle=({value:t,referenceDate:e,utils:n,props:r,timezone:i})=>{const o=D.useMemo(()=>ia.getInitialReferenceValue({value:t,utils:n,props:r,referenceDate:e,granularity:bf.day,timezone:i,getTodayDate:()=>rle(n,i,"date")}),[]);return t??o},Qcn=["ampm","ampmInClock","autoFocus","slots","slotProps","value","defaultValue","referenceDate","disableIgnoringDatePartForTimeValidation","maxTime","minTime","disableFuture","disablePast","minutesStep","shouldDisableTime","showViewSwitcher","onChange","view","views","openTo","onViewChange","focusedView","onFocusedViewChange","className","disabled","readOnly","timezone"],Kcn=t=>{const{classes:e}=t;return Xe({root:["root"],arrowSwitcher:["arrowSwitcher"]},Scn,e)},Zcn=be(OU,{name:"MuiTimeClock",slot:"Root",overridesResolver:(t,e)=>e.root})({display:"flex",flexDirection:"column",position:"relative"}),Jcn=be(XWe,{name:"MuiTimeClock",slot:"ArrowSwitcher",overridesResolver:(t,e)=>e.arrowSwitcher})({position:"absolute",right:12,top:15}),eun=["hours","minutes"],tun=D.forwardRef(function(e,n){const r=pr(),i=An({props:e,name:"MuiTimeClock"}),{ampm:o=r.is12HourCycleInCurrentLocale(),ampmInClock:s=!1,autoFocus:a,slots:l,slotProps:c,value:u,defaultValue:f,referenceDate:d,disableIgnoringDatePartForTimeValidation:h=!1,maxTime:p,minTime:g,disableFuture:m,disablePast:v,minutesStep:y=1,shouldDisableTime:x,showViewSwitcher:b,onChange:w,view:_,views:S=eun,openTo:O,onViewChange:k,focusedView:E,onFocusedViewChange:M,className:A,disabled:P,readOnly:T,timezone:R}=i,I=Dt(i,Qcn),{value:B,handleValueChange:$,timezone:z}=qO({name:"TimeClock",timezone:R,value:u,defaultValue:f,onChange:w,valueManager:ia}),L=fle({value:B,referenceDate:d,utils:r,props:i,timezone:z}),j=Rl(),N=Ob(z),{view:F,setView:H,previousView:q,nextView:Y,setValueAndGoToNextView:le}=iD({view:_,views:S,openTo:O,onViewChange:k,onChange:$,focusedView:E,onFocusedViewChange:M}),{meridiemMode:K,handleMeridiemChange:ee}=ule(L,o,le),re=D.useCallback((oe,ne)=>{const V=nD(h,r),X=ne==="hours"||ne==="minutes"&&S.includes("seconds"),Z=({start:xe,end:G})=>!(g&&V(g,G)||p&&V(xe,p)||m&&V(xe,N)||v&&V(N,X?G:xe)),he=(xe,G=1)=>{if(xe%G!==0)return!1;if(x)switch(ne){case"hours":return!x(r.setHours(L,xe),"hours");case"minutes":return!x(r.setMinutes(L,xe),"minutes");case"seconds":return!x(r.setSeconds(L,xe),"seconds");default:return!1}return!0};switch(ne){case"hours":{const xe=rP(oe,K,o),G=r.setHours(L,xe),W=r.setSeconds(r.setMinutes(G,0),0),J=r.setSeconds(r.setMinutes(G,59),59);return!Z({start:W,end:J})||!he(xe)}case"minutes":{const xe=r.setMinutes(L,oe),G=r.setSeconds(xe,0),W=r.setSeconds(xe,59);return!Z({start:G,end:W})||!he(oe,y)}case"seconds":{const xe=r.setSeconds(L,oe);return!Z({start:xe,end:xe})||!he(oe)}default:throw new Error("not supported")}},[o,L,h,p,K,g,y,x,r,m,v,N,S]),me=Jf(),te=D.useMemo(()=>{switch(F){case"hours":{const oe=(ne,V)=>{const X=rP(ne,K,o);le(r.setHours(L,X),V,"hours")};return{onChange:oe,viewValue:r.getHours(L),children:Ycn({value:B,utils:r,ampm:o,onChange:oe,getClockNumberText:j.hoursClockNumberText,isDisabled:ne=>P||re(ne,"hours"),selectedId:me})}}case"minutes":{const oe=r.getMinutes(L),ne=(V,X)=>{le(r.setMinutes(L,V),X,"minutes")};return{viewValue:oe,onChange:ne,children:c1e({utils:r,value:oe,onChange:ne,getClockNumberText:j.minutesClockNumberText,isDisabled:V=>P||re(V,"minutes"),selectedId:me})}}case"seconds":{const oe=r.getSeconds(L),ne=(V,X)=>{le(r.setSeconds(L,V),X,"seconds")};return{viewValue:oe,onChange:ne,children:c1e({utils:r,value:oe,onChange:ne,getClockNumberText:j.secondsClockNumberText,isDisabled:V=>P||re(V,"seconds"),selectedId:me})}}default:throw new Error("You must provide the type for ClockView")}},[F,r,B,o,j.hoursClockNumberText,j.minutesClockNumberText,j.secondsClockNumberText,K,le,L,re,me,P]),ae=i,U=Kcn(ae);return C.jsxs(Zcn,ve({ref:n,className:Oe(U.root,A),ownerState:ae},I,{children:[C.jsx(Vcn,ve({autoFocus:a??!!E,ampmInClock:s&&S.includes("hours"),value:B,type:F,ampm:o,minutesStep:y,isTimeDisabled:re,meridiemMode:K,handleMeridiemChange:ee,selectedId:me,disabled:P,readOnly:T},te)),b&&C.jsx(Jcn,{className:U.arrowSwitcher,slots:l,slotProps:c,onGoToPrevious:()=>H(q),isPreviousDisabled:!q,previousLabel:j.openPreviousView,onGoToNext:()=>H(Y),isNextDisabled:!Y,nextLabel:j.openNextView,ownerState:ae})]}))});function nun(t){return Ye("MuiDigitalClock",t)}const run=qe("MuiDigitalClock",["root","list","item"]),iun=["ampm","timeStep","autoFocus","slots","slotProps","value","defaultValue","referenceDate","disableIgnoringDatePartForTimeValidation","maxTime","minTime","disableFuture","disablePast","minutesStep","shouldDisableTime","onChange","view","openTo","onViewChange","focusedView","onFocusedViewChange","className","disabled","readOnly","views","skipDisabled","timezone"],oun=t=>{const{classes:e}=t;return Xe({root:["root"],list:["list"],item:["item"]},nun,e)},sun=be(OU,{name:"MuiDigitalClock",slot:"Root",overridesResolver:(t,e)=>e.root})({overflowY:"auto",width:"100%","@media (prefers-reduced-motion: no-preference)":{scrollBehavior:"auto"},maxHeight:BWe,variants:[{props:{alreadyRendered:!0},style:{"@media (prefers-reduced-motion: no-preference)":{scrollBehavior:"smooth"}}}]}),aun=be(_4,{name:"MuiDigitalClock",slot:"List",overridesResolver:(t,e)=>e.list})({padding:0}),lun=be(_i,{name:"MuiDigitalClock",slot:"Item",overridesResolver:(t,e)=>e.item})(({theme:t})=>({padding:"8px 16px",margin:"2px 4px","&:first-of-type":{marginTop:4},"&:hover":{backgroundColor:t.vars?`rgba(${t.vars.palette.primary.mainChannel} / ${t.vars.palette.action.hoverOpacity})`:Tt(t.palette.primary.main,t.palette.action.hoverOpacity)},"&.Mui-selected":{backgroundColor:(t.vars||t).palette.primary.main,color:(t.vars||t).palette.primary.contrastText,"&:focus-visible, &:hover":{backgroundColor:(t.vars||t).palette.primary.dark}},"&.Mui-focusVisible":{backgroundColor:t.vars?`rgba(${t.vars.palette.primary.mainChannel} / ${t.vars.palette.action.focusOpacity})`:Tt(t.palette.primary.main,t.palette.action.focusOpacity)}})),cun=D.forwardRef(function(e,n){const r=pr(),i=D.useRef(null),o=dn(n,i),s=D.useRef(null),a=An({props:e,name:"MuiDigitalClock"}),{ampm:l=r.is12HourCycleInCurrentLocale(),timeStep:c=30,autoFocus:u,slots:f,slotProps:d,value:h,defaultValue:p,referenceDate:g,disableIgnoringDatePartForTimeValidation:m=!1,maxTime:v,minTime:y,disableFuture:x,disablePast:b,minutesStep:w=1,shouldDisableTime:_,onChange:S,view:O,openTo:k,onViewChange:E,focusedView:M,onFocusedViewChange:A,className:P,disabled:T,readOnly:R,views:I=["hours"],skipDisabled:B=!1,timezone:$}=a,z=Dt(a,iun),{value:L,handleValueChange:j,timezone:N}=qO({name:"DigitalClock",timezone:$,value:h,defaultValue:p,onChange:S,valueManager:ia}),F=Rl(),H=Ob(N),q=D.useMemo(()=>ve({},a,{alreadyRendered:!!i.current}),[a]),Y=oun(q),le=(f==null?void 0:f.digitalClockItem)??lun,K=Zt({elementType:le,externalSlotProps:d==null?void 0:d.digitalClockItem,ownerState:{},className:Y.item}),ee=fle({value:L,referenceDate:g,utils:r,props:a,timezone:N}),re=st(V=>j(V,"finish","hours")),{setValueAndGoToNextView:me}=iD({view:O,views:I,openTo:k,onViewChange:E,onChange:re,focusedView:M,onFocusedViewChange:A}),te=st(V=>{me(V,"finish")});D.useEffect(()=>{if(i.current===null)return;const V=i.current.querySelector('[role="listbox"] [role="option"][tabindex="0"], [role="listbox"] [role="option"][aria-selected="true"]');if(!V)return;const X=V.offsetTop;(u||M)&&V.focus(),i.current.scrollTop=X-4});const ae=D.useCallback(V=>{const X=nD(m,r),Z=()=>!(y&&X(y,V)||v&&X(V,v)||x&&X(V,H)||b&&X(H,V)),he=()=>r.getMinutes(V)%w!==0?!1:_?!_(V,"hours"):!0;return!Z()||!he()},[m,r,y,v,x,H,b,w,_]),U=D.useMemo(()=>{const V=r.startOfDay(ee);return[V,...Array.from({length:Math.ceil(24*60/c)-1},(X,Z)=>r.addMinutes(V,c*(Z+1)))]},[ee,c,r]),oe=U.findIndex(V=>r.isEqual(V,ee)),ne=V=>{switch(V.key){case"PageUp":{const X=ez(s.current)-5,Z=s.current.children,he=Math.max(0,X),xe=Z[he];xe&&xe.focus(),V.preventDefault();break}case"PageDown":{const X=ez(s.current)+5,Z=s.current.children,he=Math.min(Z.length-1,X),xe=Z[he];xe&&xe.focus(),V.preventDefault();break}}};return C.jsx(sun,ve({ref:o,className:Oe(Y.root,P),ownerState:q},z,{children:C.jsx(aun,{ref:s,role:"listbox","aria-label":F.timePickerToolbarTitle,className:Y.list,onKeyDown:ne,children:U.map((V,X)=>{if(B&&ae(V))return null;const Z=r.isEqual(V,L),he=r.format(V,l?"fullTime12h":"fullTime24h"),xe=oe===X||oe===-1&&X===0?0:-1;return C.jsx(le,ve({onClick:()=>!R&&te(V),selected:Z,disabled:T||ae(V),disableRipple:R,role:"option","aria-disabled":R,"aria-selected":Z,tabIndex:xe},K,{children:he}),he)})})}))});function uun(t){return Ye("MuiMultiSectionDigitalClock",t)}const u1e=qe("MuiMultiSectionDigitalClock",["root"]);function fun(t){return Ye("MuiMultiSectionDigitalClockSection",t)}const dun=qe("MuiMultiSectionDigitalClockSection",["root","item"]),hun=["autoFocus","onChange","className","disabled","readOnly","items","active","slots","slotProps","skipDisabled"],pun=t=>{const{classes:e}=t;return Xe({root:["root"],item:["item"]},fun,e)},gun=be(_4,{name:"MuiMultiSectionDigitalClockSection",slot:"Root",overridesResolver:(t,e)=>e.root})(({theme:t})=>({maxHeight:BWe,width:56,padding:0,overflow:"hidden","@media (prefers-reduced-motion: no-preference)":{scrollBehavior:"auto"},"@media (pointer: fine)":{"&:hover":{overflowY:"auto"}},"@media (pointer: none), (pointer: coarse)":{overflowY:"auto"},"&:not(:first-of-type)":{borderLeft:`1px solid ${(t.vars||t).palette.divider}`},"&::after":{display:"block",content:'""',height:"calc(100% - 40px - 6px)"},variants:[{props:{alreadyRendered:!0},style:{"@media (prefers-reduced-motion: no-preference)":{scrollBehavior:"smooth"}}}]})),mun=be(_i,{name:"MuiMultiSectionDigitalClockSection",slot:"Item",overridesResolver:(t,e)=>e.item})(({theme:t})=>({padding:8,margin:"2px 4px",width:kT,justifyContent:"center","&:first-of-type":{marginTop:4},"&:hover":{backgroundColor:t.vars?`rgba(${t.vars.palette.primary.mainChannel} / ${t.vars.palette.action.hoverOpacity})`:Tt(t.palette.primary.main,t.palette.action.hoverOpacity)},"&.Mui-selected":{backgroundColor:(t.vars||t).palette.primary.main,color:(t.vars||t).palette.primary.contrastText,"&:focus-visible, &:hover":{backgroundColor:(t.vars||t).palette.primary.dark}},"&.Mui-focusVisible":{backgroundColor:t.vars?`rgba(${t.vars.palette.primary.mainChannel} / ${t.vars.palette.action.focusOpacity})`:Tt(t.palette.primary.main,t.palette.action.focusOpacity)}})),vun=D.forwardRef(function(e,n){const r=D.useRef(null),i=dn(n,r),o=D.useRef(null),s=An({props:e,name:"MuiMultiSectionDigitalClockSection"}),{autoFocus:a,onChange:l,className:c,disabled:u,readOnly:f,items:d,active:h,slots:p,slotProps:g,skipDisabled:m}=s,v=Dt(s,hun),y=D.useMemo(()=>ve({},s,{alreadyRendered:!!r.current}),[s]),x=pun(y),b=(p==null?void 0:p.digitalClockSectionItem)??mun;D.useEffect(()=>{if(r.current===null)return;const S=r.current.querySelector('[role="option"][tabindex="0"], [role="option"][aria-selected="true"]');if(h&&a&&S&&S.focus(),!S||o.current===S)return;o.current=S;const O=S.offsetTop;r.current.scrollTop=O-4});const w=d.findIndex(S=>S.isFocused(S.value)),_=S=>{switch(S.key){case"PageUp":{const O=ez(r.current)-5,k=r.current.children,E=Math.max(0,O),M=k[E];M&&M.focus(),S.preventDefault();break}case"PageDown":{const O=ez(r.current)+5,k=r.current.children,E=Math.min(k.length-1,O),M=k[E];M&&M.focus(),S.preventDefault();break}}};return C.jsx(gun,ve({ref:i,className:Oe(x.root,c),ownerState:y,autoFocusItem:a&&h,role:"listbox",onKeyDown:_},v,{children:d.map((S,O)=>{var P;const k=(P=S.isDisabled)==null?void 0:P.call(S,S.value),E=u||k;if(m&&E)return null;const M=S.isSelected(S.value),A=w===O||w===-1&&O===0?0:-1;return C.jsx(b,ve({onClick:()=>!f&&l(S.value),selected:M,disabled:E,disableRipple:f,role:"option","aria-disabled":f||E||void 0,"aria-label":S.ariaLabel,"aria-selected":M,tabIndex:A,className:x.item},g==null?void 0:g.digitalClockSectionItem,{children:S.label}),S.label)})}))}),yun=({now:t,value:e,utils:n,ampm:r,isDisabled:i,resolveAriaLabel:o,timeStep:s,valueOrReferenceDate:a})=>{const l=e?n.getHours(e):null,c=[],u=(h,p)=>{const g=p??l;return g===null?!1:r?h===12?g===12||g===0:g===h||g-12===h:g===h},f=h=>u(h,n.getHours(a)),d=r?11:23;for(let h=0;h<=d;h+=s){let p=n.format(n.setHours(t,h),r?"hours12h":"hours24h");const g=o(parseInt(p,10).toString());p=n.formatNumber(p),c.push({value:h,label:p,isSelected:u,isDisabled:i,isFocused:f,ariaLabel:g})}return c},f1e=({value:t,utils:e,isDisabled:n,timeStep:r,resolveLabel:i,resolveAriaLabel:o,hasValue:s=!0})=>{const a=c=>t===null?!1:s&&t===c,l=c=>t===c;return[...Array.from({length:Math.ceil(60/r)},(c,u)=>{const f=r*u;return{value:f,label:e.formatNumber(i(f)),isDisabled:n,isSelected:a,isFocused:l,ariaLabel:o(f.toString())}})]},xun=["ampm","timeSteps","autoFocus","slots","slotProps","value","defaultValue","referenceDate","disableIgnoringDatePartForTimeValidation","maxTime","minTime","disableFuture","disablePast","minutesStep","shouldDisableTime","onChange","view","views","openTo","onViewChange","focusedView","onFocusedViewChange","className","disabled","readOnly","skipDisabled","timezone"],bun=t=>{const{classes:e}=t;return Xe({root:["root"]},uun,e)},wun=be(OU,{name:"MuiMultiSectionDigitalClock",slot:"Root",overridesResolver:(t,e)=>e.root})(({theme:t})=>({display:"flex",flexDirection:"row",width:"100%",borderBottom:`1px solid ${(t.vars||t).palette.divider}`})),_un=D.forwardRef(function(e,n){const r=pr(),i=Ho(),o=An({props:e,name:"MuiMultiSectionDigitalClock"}),{ampm:s=r.is12HourCycleInCurrentLocale(),timeSteps:a,autoFocus:l,slots:c,slotProps:u,value:f,defaultValue:d,referenceDate:h,disableIgnoringDatePartForTimeValidation:p=!1,maxTime:g,minTime:m,disableFuture:v,disablePast:y,minutesStep:x=1,shouldDisableTime:b,onChange:w,view:_,views:S=["hours","minutes"],openTo:O,onViewChange:k,focusedView:E,onFocusedViewChange:M,className:A,disabled:P,readOnly:T,skipDisabled:R=!1,timezone:I}=o,B=Dt(o,xun),{value:$,handleValueChange:z,timezone:L}=qO({name:"MultiSectionDigitalClock",timezone:I,value:f,defaultValue:d,onChange:w,valueManager:ia}),j=Rl(),N=Ob(L),F=D.useMemo(()=>ve({hours:1,minutes:5,seconds:5},a),[a]),H=fle({value:$,referenceDate:h,utils:r,props:o,timezone:L}),q=st((Z,he,xe)=>z(Z,he,xe)),Y=D.useMemo(()=>!s||!S.includes("hours")||S.includes("meridiem")?S:[...S,"meridiem"],[s,S]),{view:le,setValueAndGoToNextView:K,focusedView:ee}=iD({view:_,views:Y,openTo:O,onViewChange:k,onChange:q,focusedView:E,onFocusedViewChange:M}),re=st(Z=>{K(Z,"finish","meridiem")}),{meridiemMode:me,handleMeridiemChange:te}=ule(H,s,re,"finish"),ae=D.useCallback((Z,he)=>{const xe=nD(p,r),G=he==="hours"||he==="minutes"&&Y.includes("seconds"),W=({start:se,end:ye})=>!(m&&xe(m,ye)||g&&xe(se,g)||v&&xe(se,N)||y&&xe(N,G?ye:se)),J=(se,ye=1)=>{if(se%ye!==0)return!1;if(b)switch(he){case"hours":return!b(r.setHours(H,se),"hours");case"minutes":return!b(r.setMinutes(H,se),"minutes");case"seconds":return!b(r.setSeconds(H,se),"seconds");default:return!1}return!0};switch(he){case"hours":{const se=rP(Z,me,s),ye=r.setHours(H,se),ie=r.setSeconds(r.setMinutes(ye,0),0),fe=r.setSeconds(r.setMinutes(ye,59),59);return!W({start:ie,end:fe})||!J(se)}case"minutes":{const se=r.setMinutes(H,Z),ye=r.setSeconds(se,0),ie=r.setSeconds(se,59);return!W({start:ye,end:ie})||!J(Z,x)}case"seconds":{const se=r.setSeconds(H,Z);return!W({start:se,end:se})||!J(Z)}default:throw new Error("not supported")}},[s,H,p,g,me,m,x,b,r,v,y,N,Y]),U=D.useCallback(Z=>{switch(Z){case"hours":return{onChange:he=>{const xe=rP(he,me,s);K(r.setHours(H,xe),"finish","hours")},items:yun({now:N,value:$,ampm:s,utils:r,isDisabled:he=>ae(he,"hours"),timeStep:F.hours,resolveAriaLabel:j.hoursClockNumberText,valueOrReferenceDate:H})};case"minutes":return{onChange:he=>{K(r.setMinutes(H,he),"finish","minutes")},items:f1e({value:r.getMinutes(H),utils:r,isDisabled:he=>ae(he,"minutes"),resolveLabel:he=>r.format(r.setMinutes(N,he),"minutes"),timeStep:F.minutes,hasValue:!!$,resolveAriaLabel:j.minutesClockNumberText})};case"seconds":return{onChange:he=>{K(r.setSeconds(H,he),"finish","seconds")},items:f1e({value:r.getSeconds(H),utils:r,isDisabled:he=>ae(he,"seconds"),resolveLabel:he=>r.format(r.setSeconds(N,he),"seconds"),timeStep:F.seconds,hasValue:!!$,resolveAriaLabel:j.secondsClockNumberText})};case"meridiem":{const he=Jp(r,"am"),xe=Jp(r,"pm");return{onChange:te,items:[{value:"am",label:he,isSelected:()=>!!$&&me==="am",isFocused:()=>!!H&&me==="am",ariaLabel:he},{value:"pm",label:xe,isSelected:()=>!!$&&me==="pm",isFocused:()=>!!H&&me==="pm",ariaLabel:xe}]}}default:throw new Error(`Unknown view: ${Z} found.`)}},[N,$,s,r,F.hours,F.minutes,F.seconds,j.hoursClockNumberText,j.minutesClockNumberText,j.secondsClockNumberText,me,K,H,ae,te]),oe=D.useMemo(()=>{if(!i)return Y;const Z=Y.filter(he=>he!=="meridiem");return Z.reverse(),Y.includes("meridiem")&&Z.push("meridiem"),Z},[i,Y]),ne=D.useMemo(()=>Y.reduce((Z,he)=>ve({},Z,{[he]:U(he)}),{}),[Y,U]),V=o,X=bun(V);return C.jsx(wun,ve({ref:n,className:Oe(X.root,A),ownerState:V,role:"group"},B,{children:oe.map(Z=>C.jsx(vun,{items:ne[Z].items,onChange:ne[Z].onChange,active:le===Z,autoFocus:l??ee===Z,disabled:P,readOnly:T,slots:c,slotProps:u,skipDisabled:R,"aria-label":j.selectViewText(Z)},Z))}))}),I9=({view:t,onViewChange:e,focusedView:n,onFocusedViewChange:r,views:i,value:o,defaultValue:s,referenceDate:a,onChange:l,className:c,classes:u,disableFuture:f,disablePast:d,minTime:h,maxTime:p,shouldDisableTime:g,minutesStep:m,ampm:v,ampmInClock:y,slots:x,slotProps:b,readOnly:w,disabled:_,sx:S,autoFocus:O,showViewSwitcher:k,disableIgnoringDatePartForTimeValidation:E,timezone:M})=>C.jsx(tun,{view:t,onViewChange:e,focusedView:n&&pC(n)?n:null,onFocusedViewChange:r,views:i.filter(pC),value:o,defaultValue:s,referenceDate:a,onChange:l,className:c,classes:u,disableFuture:f,disablePast:d,minTime:h,maxTime:p,shouldDisableTime:g,minutesStep:m,ampm:v,ampmInClock:y,slots:x,slotProps:b,readOnly:w,disabled:_,sx:S,autoFocus:O,showViewSwitcher:k,disableIgnoringDatePartForTimeValidation:E,timezone:M}),Sun=({view:t,onViewChange:e,focusedView:n,onFocusedViewChange:r,views:i,value:o,defaultValue:s,referenceDate:a,onChange:l,className:c,classes:u,disableFuture:f,disablePast:d,minTime:h,maxTime:p,shouldDisableTime:g,minutesStep:m,ampm:v,slots:y,slotProps:x,readOnly:b,disabled:w,sx:_,autoFocus:S,disableIgnoringDatePartForTimeValidation:O,timeSteps:k,skipDisabled:E,timezone:M})=>C.jsx(cun,{view:t,onViewChange:e,focusedView:n,onFocusedViewChange:r,views:i.filter(pC),value:o,defaultValue:s,referenceDate:a,onChange:l,className:c,classes:u,disableFuture:f,disablePast:d,minTime:h,maxTime:p,shouldDisableTime:g,minutesStep:m,ampm:v,slots:y,slotProps:x,readOnly:b,disabled:w,sx:_,autoFocus:S,disableIgnoringDatePartForTimeValidation:O,timeStep:k==null?void 0:k.minutes,skipDisabled:E,timezone:M}),d1e=({view:t,onViewChange:e,focusedView:n,onFocusedViewChange:r,views:i,value:o,defaultValue:s,referenceDate:a,onChange:l,className:c,classes:u,disableFuture:f,disablePast:d,minTime:h,maxTime:p,shouldDisableTime:g,minutesStep:m,ampm:v,slots:y,slotProps:x,readOnly:b,disabled:w,sx:_,autoFocus:S,disableIgnoringDatePartForTimeValidation:O,timeSteps:k,skipDisabled:E,timezone:M})=>C.jsx(_un,{view:t,onViewChange:e,focusedView:n,onFocusedViewChange:r,views:i.filter(pC),value:o,defaultValue:s,referenceDate:a,onChange:l,className:c,classes:u,disableFuture:f,disablePast:d,minTime:h,maxTime:p,shouldDisableTime:g,minutesStep:m,ampm:v,slots:y,slotProps:x,readOnly:b,disabled:w,sx:_,autoFocus:S,disableIgnoringDatePartForTimeValidation:O,timeSteps:k,skipDisabled:E,timezone:M}),Cun=D.forwardRef(function(e,n){var g;const r=Ho(),{toolbar:i,tabs:o,content:s,actionBar:a,shortcuts:l}=ZWe(e),{sx:c,className:u,isLandscape:f,classes:d}=e,h=a&&(((g=a.props.actions)==null?void 0:g.length)??0)>0,p=ve({},e,{isRtl:r});return C.jsxs(JWe,{ref:n,className:Oe(pf.root,d==null?void 0:d.root,u),sx:[{[`& .${pf.tabs}`]:{gridRow:4,gridColumn:"1 / 4"},[`& .${pf.actionBar}`]:{gridRow:5}},...Array.isArray(c)?c:[c]],ownerState:p,children:[f?l:i,f?i:l,C.jsxs(eVe,{className:Oe(pf.contentWrapper,d==null?void 0:d.contentWrapper),sx:{display:"grid"},children:[s,o,h&&C.jsx(Oh,{sx:{gridRow:3,gridColumn:"1 / 4"}})]}),a]})}),Oun=["openTo","focusedView","timeViewsCount"],Eun=function(e,n,r){var u,f;const{openTo:i,focusedView:o,timeViewsCount:s}=r,a=Dt(r,Oun),l=ve({},a,{focusedView:null,sx:[{[`&.${u1e.root}`]:{borderBottom:0},[`&.${u1e.root}, .${dun.root}, &.${run.root}`]:{maxHeight:CU}}]}),c=TT(n);return C.jsxs(D.Fragment,{children:[(u=e[c?"day":n])==null?void 0:u.call(e,ve({},r,{view:c?"day":n,focusedView:o&&hC(o)?o:null,views:r.views.filter(hC),sx:[{gridColumn:1},...l.sx]})),s>0&&C.jsxs(D.Fragment,{children:[C.jsx(Oh,{orientation:"vertical",sx:{gridColumn:2}}),(f=e[c?n:"hours"])==null?void 0:f.call(e,ve({},l,{view:c?n:"hours",focusedView:o&&TT(o)?o:null,openTo:TT(i)?i:"hours",views:r.views.filter(TT),sx:[{gridColumn:3},...l.sx]}))]})]})},aVe=D.forwardRef(function(e,n){var y,x,b,w;const r=Rl(),i=pr(),o=UWe(e,"MuiDesktopDateTimePicker"),{shouldRenderTimeInASingleColumn:s,thresholdToRenderTimeInASingleColumn:a,views:l,timeSteps:c}=_cn(o),u=s?Sun:d1e,f=ve({day:X_,month:X_,year:X_,hours:u,minutes:u,seconds:u,meridiem:u},o.viewRenderers),d=o.ampmInClock??!0,p=((y=f.hours)==null?void 0:y.name)===d1e.name?l:l.filter(_=>_!=="meridiem"),g=s?[]:["accept"],m=ve({},o,{viewRenderers:f,format:nVe(i,o),views:p,yearsPerRow:o.yearsPerRow??4,ampmInClock:d,timeSteps:c,thresholdToRenderTimeInASingleColumn:a,shouldRenderTimeInASingleColumn:s,slots:ve({field:NWe,layout:Cun,openPickerIcon:$on},o.slots),slotProps:ve({},o.slotProps,{field:_=>{var S;return ve({},rA((S=o.slotProps)==null?void 0:S.field,_),EWe(o),{ref:n})},toolbar:ve({hidden:!0,ampmInClock:d,toolbarVariant:"desktop"},(x=o.slotProps)==null?void 0:x.toolbar),tabs:ve({hidden:!0},(b=o.slotProps)==null?void 0:b.tabs),actionBar:_=>{var S;return ve({actions:g},rA((S=o.slotProps)==null?void 0:S.actionBar,_))}})}),{renderPicker:v}=ycn({props:m,valueManager:ia,valueType:"date-time",getOpenDialogAriaText:TWe({utils:i,formatKey:"fullDate",contextTranslation:r.openDatePickerDialogue,propsTranslation:(w=m.localeText)==null?void 0:w.openDatePickerDialogue}),validator:bU,rendererInterceptor:Eun});return v()});aVe.propTypes={ampm:pe.bool,ampmInClock:pe.bool,autoFocus:pe.bool,className:pe.string,closeOnSelect:pe.bool,dayOfWeekFormatter:pe.func,defaultValue:pe.object,disabled:pe.bool,disableFuture:pe.bool,disableHighlightToday:pe.bool,disableIgnoringDatePartForTimeValidation:pe.bool,disableOpenPicker:pe.bool,disablePast:pe.bool,displayWeekNumber:pe.bool,enableAccessibleFieldDOMStructure:pe.any,fixedWeekNumber:pe.number,format:pe.string,formatDensity:pe.oneOf(["dense","spacious"]),inputRef:tAe,label:pe.node,loading:pe.bool,localeText:pe.object,maxDate:pe.object,maxDateTime:pe.object,maxTime:pe.object,minDate:pe.object,minDateTime:pe.object,minTime:pe.object,minutesStep:pe.number,monthsPerRow:pe.oneOf([3,4]),name:pe.string,onAccept:pe.func,onChange:pe.func,onClose:pe.func,onError:pe.func,onMonthChange:pe.func,onOpen:pe.func,onSelectedSectionsChange:pe.func,onViewChange:pe.func,onYearChange:pe.func,open:pe.bool,openTo:pe.oneOf(["day","hours","meridiem","minutes","month","seconds","year"]),orientation:pe.oneOf(["landscape","portrait"]),readOnly:pe.bool,reduceAnimations:pe.bool,referenceDate:pe.object,renderLoading:pe.func,selectedSections:pe.oneOfType([pe.oneOf(["all","day","empty","hours","meridiem","minutes","month","seconds","weekDay","year"]),pe.number]),shouldDisableDate:pe.func,shouldDisableMonth:pe.func,shouldDisableTime:pe.func,shouldDisableYear:pe.func,showDaysOutsideCurrentMonth:pe.bool,skipDisabled:pe.bool,slotProps:pe.object,slots:pe.object,sx:pe.oneOfType([pe.arrayOf(pe.oneOfType([pe.func,pe.object,pe.bool])),pe.func,pe.object]),thresholdToRenderTimeInASingleColumn:pe.number,timeSteps:pe.shape({hours:pe.number,minutes:pe.number,seconds:pe.number}),timezone:pe.string,value:pe.object,view:pe.oneOf(["day","hours","meridiem","minutes","month","seconds","year"]),viewRenderers:pe.shape({day:pe.func,hours:pe.func,meridiem:pe.func,minutes:pe.func,month:pe.func,seconds:pe.func,year:pe.func}),views:pe.arrayOf(pe.oneOf(["day","hours","minutes","month","seconds","year"]).isRequired),yearsOrder:pe.oneOf(["asc","desc"]),yearsPerRow:pe.oneOf([3,4])};const Tun=be(ed)({[`& .${ZT.container}`]:{outline:0},[`& .${ZT.paper}`]:{outline:0,minWidth:SU}}),kun=be(zf)({"&:first-of-type":{padding:0}});function Aun(t){const{children:e,onDismiss:n,open:r,slots:i,slotProps:o}=t,s=(i==null?void 0:i.dialog)??Tun,a=(i==null?void 0:i.mobileTransition)??YC;return C.jsx(s,ve({open:r,onClose:n},o==null?void 0:o.dialog,{TransitionComponent:a,TransitionProps:o==null?void 0:o.mobileTransition,PaperComponent:i==null?void 0:i.mobilePaper,PaperProps:o==null?void 0:o.mobilePaper,children:C.jsx(kun,{children:e})}))}const Pun=["props","getOpenDialogAriaText"],Mun=t=>{var j;let{props:e,getOpenDialogAriaText:n}=t,r=Dt(t,Pun);const{slots:i,slotProps:o,className:s,sx:a,format:l,formatDensity:c,enableAccessibleFieldDOMStructure:u,selectedSections:f,onSelectedSectionsChange:d,timezone:h,name:p,label:g,inputRef:m,readOnly:v,disabled:y,localeText:x}=e,b=D.useRef(null),w=Jf(),_=((j=o==null?void 0:o.toolbar)==null?void 0:j.hidden)??!1,{open:S,actions:O,layoutProps:k,renderCurrentView:E,fieldProps:M,contextValue:A}=QWe(ve({},r,{props:e,fieldRef:b,autoFocusView:!0,additionalViewProps:{},wrapperVariant:"mobile"})),P=i.field,T=Zt({elementType:P,externalSlotProps:o==null?void 0:o.field,additionalProps:ve({},M,_&&{id:w},!(y||v)&&{onClick:O.onOpen,onKeyDown:Ton(O.onOpen)},{readOnly:v??!0,disabled:y,className:s,sx:a,format:l,formatDensity:c,enableAccessibleFieldDOMStructure:u,selectedSections:f,onSelectedSectionsChange:d,timezone:h,label:g,name:p},m?{inputRef:m}:{}),ownerState:e});T.inputProps=ve({},T.inputProps,{"aria-label":n(M.value)});const R=ve({textField:i.textField},T.slots),I=i.layout??tVe;let B=w;_&&(g?B=`${w}-label`:B=void 0);const $=ve({},o,{toolbar:ve({},o==null?void 0:o.toolbar,{titleId:w}),mobilePaper:ve({"aria-labelledby":B},o==null?void 0:o.mobilePaper)}),z=dn(b,T.unstableFieldRef);return{renderPicker:()=>C.jsxs(PWe,{contextValue:A,localeText:x,children:[C.jsx(P,ve({},T,{slots:R,slotProps:$,unstableFieldRef:z})),C.jsx(Aun,ve({},O,{open:S,slots:i,slotProps:$,children:C.jsx(I,ve({},k,$==null?void 0:$.layout,{slots:i,slotProps:$,children:E()}))}))]})}},lVe=D.forwardRef(function(e,n){var u,f,d;const r=Rl(),i=pr(),o=UWe(e,"MuiMobileDateTimePicker"),s=ve({day:X_,month:X_,year:X_,hours:I9,minutes:I9,seconds:I9},o.viewRenderers),a=o.ampmInClock??!1,l=ve({},o,{viewRenderers:s,format:nVe(i,o),ampmInClock:a,slots:ve({field:NWe},o.slots),slotProps:ve({},o.slotProps,{field:h=>{var p;return ve({},rA((p=o.slotProps)==null?void 0:p.field,h),EWe(o),{ref:n})},toolbar:ve({hidden:!1,ampmInClock:a},(u=o.slotProps)==null?void 0:u.toolbar),tabs:ve({hidden:!1},(f=o.slotProps)==null?void 0:f.tabs)})}),{renderPicker:c}=Mun({props:l,valueManager:ia,valueType:"date-time",getOpenDialogAriaText:TWe({utils:i,formatKey:"fullDate",contextTranslation:r.openDatePickerDialogue,propsTranslation:(d=l.localeText)==null?void 0:d.openDatePickerDialogue}),validator:bU});return c()});lVe.propTypes={ampm:pe.bool,ampmInClock:pe.bool,autoFocus:pe.bool,className:pe.string,closeOnSelect:pe.bool,dayOfWeekFormatter:pe.func,defaultValue:pe.object,disabled:pe.bool,disableFuture:pe.bool,disableHighlightToday:pe.bool,disableIgnoringDatePartForTimeValidation:pe.bool,disableOpenPicker:pe.bool,disablePast:pe.bool,displayWeekNumber:pe.bool,enableAccessibleFieldDOMStructure:pe.any,fixedWeekNumber:pe.number,format:pe.string,formatDensity:pe.oneOf(["dense","spacious"]),inputRef:tAe,label:pe.node,loading:pe.bool,localeText:pe.object,maxDate:pe.object,maxDateTime:pe.object,maxTime:pe.object,minDate:pe.object,minDateTime:pe.object,minTime:pe.object,minutesStep:pe.number,monthsPerRow:pe.oneOf([3,4]),name:pe.string,onAccept:pe.func,onChange:pe.func,onClose:pe.func,onError:pe.func,onMonthChange:pe.func,onOpen:pe.func,onSelectedSectionsChange:pe.func,onViewChange:pe.func,onYearChange:pe.func,open:pe.bool,openTo:pe.oneOf(["day","hours","minutes","month","seconds","year"]),orientation:pe.oneOf(["landscape","portrait"]),readOnly:pe.bool,reduceAnimations:pe.bool,referenceDate:pe.object,renderLoading:pe.func,selectedSections:pe.oneOfType([pe.oneOf(["all","day","empty","hours","meridiem","minutes","month","seconds","weekDay","year"]),pe.number]),shouldDisableDate:pe.func,shouldDisableMonth:pe.func,shouldDisableTime:pe.func,shouldDisableYear:pe.func,showDaysOutsideCurrentMonth:pe.bool,slotProps:pe.object,slots:pe.object,sx:pe.oneOfType([pe.arrayOf(pe.oneOfType([pe.func,pe.object,pe.bool])),pe.func,pe.object]),timezone:pe.string,value:pe.object,view:pe.oneOf(["day","hours","minutes","month","seconds","year"]),viewRenderers:pe.shape({day:pe.func,hours:pe.func,minutes:pe.func,month:pe.func,seconds:pe.func,year:pe.func}),views:pe.arrayOf(pe.oneOf(["day","hours","minutes","month","seconds","year"]).isRequired),yearsOrder:pe.oneOf(["asc","desc"]),yearsPerRow:pe.oneOf([3,4])};const Run=["desktopModeMediaQuery"],Dun=D.forwardRef(function(e,n){const r=An({props:e,name:"MuiDateTimePicker"}),{desktopModeMediaQuery:i=kon}=r,o=Dt(r,Run);return Zke(i,{defaultMatches:!0})?C.jsx(aVe,ve({ref:n},o)):C.jsx(lVe,ve({ref:n},o))}),Iun=t=>({dateTimePicker:{marginTop:t.spacing(2)}}),Lun=({classes:t,hasTimeDimension:e,selectedTime:n,selectedTimeRange:r,selectTime:i})=>{const o=d=>{i(d!==null?abt(d):null)},s=C.jsx(Ly,{shrink:!0,htmlFor:"time-select",children:`${ge.get("Time")} (UTC)`}),l=typeof n=="number"?PW(n):null;let c,u;Array.isArray(r)&&(c=PW(r[0]),u=PW(r[1]));const f=C.jsx(pWe,{dateAdapter:Win,children:C.jsx(Dun,{disabled:!e,className:t.dateTimePicker,format:"yyyy-MM-dd hh:mm:ss",value:l,minDateTime:c,maxDateTime:u,onChange:o,ampm:!1,slotProps:{textField:{variant:"standard",size:"small"}},viewRenderers:{hours:null,minutes:null,seconds:null}})});return C.jsx(tP,{label:s,control:f})},$un=$in(Iun)(Lun),Fun=t=>({locale:t.controlState.locale,hasTimeDimension:!!hO(t),selectedTime:t.controlState.selectedTime,selectedTimeRange:t.controlState.selectedTimeRange}),Nun={selectTime:rU},zun=Rn(Fun,Nun)($un),h1e=5,jun={box:t=>({marginTop:t.spacing(1),marginLeft:t.spacing(h1e),marginRight:t.spacing(h1e),minWidth:200}),label:{color:"grey",fontSize:"1em"}};function Bun({hasTimeDimension:t,selectedTime:e,selectTime:n,selectedTimeRange:r}){const[i,o]=D.useState(e);if(D.useEffect(()=>{o(e||(r?r[0]:0))},[e,r]),!t)return null;const s=(f,d)=>{typeof d=="number"&&o(d)},a=(f,d)=>{n&&typeof d=="number"&&n(d)},l=Array.isArray(r);l||(r=[Date.now()-2*PRe.years,Date.now()]);const c=[{value:r[0],label:bA(r[0])},{value:r[1],label:bA(r[1])}];function u(f){return lO(f)}return C.jsx(ot,{sx:jun.box,children:C.jsx(Rt,{arrow:!0,title:ge.get("Select time in dataset"),children:C.jsx(QC,{disabled:!l,min:r[0],max:r[1],value:i||0,valueLabelDisplay:"off",valueLabelFormat:u,marks:c,onChange:s,onChangeCommitted:a,size:"small"})})})}const Uun=t=>({locale:t.controlState.locale,hasTimeDimension:!!hO(t),selectedTime:t.controlState.selectedTime,selectedTimeRange:t.controlState.selectedTimeRange}),Wun={selectTime:rU,selectTimeRange:IUe},Vun=Rn(Uun,Wun)(Bun),Gun=lt(C.jsx("path",{d:"M15.41 7.41 14 6l-6 6 6 6 1.41-1.41L10.83 12z"}),"ChevronLeft"),Hun=lt(C.jsx("path",{d:"M10 6 8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z"}),"ChevronRight"),qun=lt(C.jsx("path",{d:"M18.41 16.59 13.82 12l4.59-4.59L17 6l-6 6 6 6zM6 6h2v12H6z"}),"FirstPage"),Xun=lt(C.jsx("path",{d:"M5.59 7.41 10.18 12l-4.59 4.59L7 18l6-6-6-6zM16 6h2v12h-2z"}),"LastPage"),Yun=lt(C.jsx("path",{d:"M9 16h2V8H9zm3-14C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8m1-4h2V8h-2z"}),"PauseCircleOutline"),Qun=lt(C.jsx("path",{d:"m10 16.5 6-4.5-6-4.5zM12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8"}),"PlayCircleOutline"),lw={formControl:t=>({marginTop:t.spacing(2.5),marginLeft:t.spacing(1),marginRight:t.spacing(1)}),iconButton:{padding:"2px"}};function Kun({timeAnimationActive:t,timeAnimationInterval:e,updateTimeAnimation:n,selectedTime:r,selectedTimeRange:i,selectTime:o,incSelectedTime:s}){const a=D.useRef(null);D.useEffect(()=>(p(),m));const l=()=>{s(1)},c=()=>{n(!t,e)},u=()=>{s(1)},f=()=>{s(-1)},d=()=>{o(i?i[0]:null)},h=()=>{o(i?i[1]:null)},p=()=>{t?g():m()},g=()=>{m(),a.current=window.setInterval(l,e)},m=()=>{a.current!==null&&(window.clearInterval(a.current),a.current=null)},v=typeof r=="number",y=t?C.jsx(Yun,{}):C.jsx(Qun,{}),x=C.jsx(Ht,{disabled:!v,onClick:c,size:"small",sx:lw.iconButton,children:C.jsx(Rt,{arrow:!0,title:ge.get("Auto-step through times in the dataset"),children:y})}),b=C.jsx(Ht,{disabled:!v||t,onClick:d,size:"small",sx:lw.iconButton,children:C.jsx(Rt,{arrow:!0,title:ge.get("First time step"),children:C.jsx(qun,{})})}),w=C.jsx(Ht,{disabled:!v||t,onClick:f,size:"small",sx:lw.iconButton,children:C.jsx(Rt,{arrow:!0,title:ge.get("Previous time step"),children:C.jsx(Gun,{})})}),_=C.jsx(Ht,{disabled:!v||t,onClick:u,size:"small",sx:lw.iconButton,children:C.jsx(Rt,{arrow:!0,title:ge.get("Next time step"),children:C.jsx(Hun,{})})}),S=C.jsx(Ht,{disabled:!v||t,onClick:h,size:"small",sx:lw.iconButton,children:C.jsx(Rt,{arrow:!0,title:ge.get("Last time step"),children:C.jsx(Xun,{})})});return C.jsx(Gg,{sx:lw.formControl,variant:"standard",children:C.jsxs(ot,{children:[b,w,x,_,S]})})}const Zun=t=>({locale:t.controlState.locale,selectedTime:t.controlState.selectedTime,selectedTimeRange:t.controlState.selectedTimeRange,timeAnimationActive:t.controlState.timeAnimationActive,timeAnimationInterval:t.controlState.timeAnimationInterval}),Jun={selectTime:rU,incSelectedTime:gKt,updateTimeAnimation:vKt},efn=Rn(Zun,Jun)(Kun),tfn=lt(C.jsx("path",{d:"M16 20H2V4h14zm2-12h4V4h-4zm0 12h4v-4h-4zm0-6h4v-4h-4z"}),"ViewSidebar"),nfn=oa(Gg)(({theme:t})=>({marginTop:t.spacing(2),marginRight:t.spacing(.5),marginLeft:"auto"}));function rfn({visible:t,sidebarOpen:e,setSidebarOpen:n,openDialog:r,allowRefresh:i,updateResources:o,allowSharing:s,shareStatePermalink:a,compact:l}){if(!t)return null;const c=C.jsx(yr,{value:"sidebar",selected:e,onClick:()=>n(!e),size:"small",sx:ol.toggleButton,children:C.jsx(Rt,{arrow:!0,title:ge.get("Show or hide sidebar"),children:C.jsx(tfn,{})})});let u,f,d,h;return l&&(u=i&&C.jsx(Ht,{onClick:o,size:"small",children:C.jsx(Rt,{arrow:!0,title:ge.get("Refresh"),children:C.jsx(wPe,{})})}),f=s&&C.jsx(Ht,{onClick:a,size:"small",children:C.jsx(Rt,{arrow:!0,title:ge.get("Share"),children:C.jsx(_Pe,{})})}),d=wn.instance.branding.allowDownloads&&C.jsx(Ht,{onClick:()=>r("export"),size:"small",children:C.jsx(Rt,{arrow:!0,title:ge.get("Export data"),children:C.jsx(SPe,{})})}),h=C.jsx(Ht,{onClick:()=>r("settings"),size:"small",children:C.jsx(Rt,{arrow:!0,title:ge.get("Settings"),children:C.jsx(bPe,{})})})),C.jsx(nfn,{variant:"standard",children:C.jsxs(ot,{children:[u,f,d,h,c]})})}const ifn=t=>({locale:t.controlState.locale,visible:!!(t.controlState.selectedDatasetId||t.controlState.selectedPlaceId),sidebarOpen:t.controlState.sidebarOpen,compact:wn.instance.branding.compact,allowRefresh:wn.instance.branding.allowRefresh,allowSharing:wn.instance.branding.allowSharing}),ofn={setSidebarOpen:Fae,openDialog:_b,updateResources:Z6e,shareStatePermalink:K6e},sfn=Rn(ifn,ofn)(rfn),afn=t=>({locale:t.controlState.locale,show:t.dataState.datasets.length>0}),lfn={},cfn=({show:t})=>t?C.jsxs(Ztn,{children:[C.jsx(rnn,{}),C.jsx(dnn,{}),C.jsx(vnn,{}),C.jsx(Cnn,{}),C.jsx(Inn,{}),C.jsx(zun,{}),C.jsx(efn,{}),C.jsx(Vun,{}),C.jsx(sfn,{})]}):null,ufn=Rn(afn,lfn)(cfn);function cVe(t){const e=D.useRef(null),n=D.useRef(o=>{if(o.buttons===1&&e.current!==null){o.preventDefault();const{screenX:s,screenY:a}=o,[l,c]=e.current,u=[s-l,a-c];e.current=[s,a],t(u)}}),r=D.useRef(o=>{o.buttons===1&&(o.preventDefault(),document.body.addEventListener("mousemove",n.current),document.body.addEventListener("mouseup",i.current),document.body.addEventListener("onmouseleave",i.current),e.current=[o.screenX,o.screenY])}),i=D.useRef(o=>{e.current!==null&&(o.preventDefault(),e.current=null,document.body.removeEventListener("mousemove",n.current),document.body.removeEventListener("mouseup",i.current),document.body.removeEventListener("onmouseleave",i.current))});return r.current}const p1e={hor:t=>({flex:"none",border:"none",outline:"none",width:"8px",minHeight:"100%",maxHeight:"100%",cursor:"col-resize",backgroundColor:t.palette.mode==="dark"?"white":"black",opacity:0}),ver:t=>({flex:"none",border:"none",outline:"none",height:"8px",minWidth:"100%",maxWidth:"100%",cursor:"row-resize",backgroundColor:t.palette.mode==="dark"?"white":"black",opacity:0})};function ffn({dir:t,onChange:e}){const r=cVe(([i,o])=>{e(i)});return C.jsx(ot,{sx:t==="hor"?p1e.hor:p1e.ver,onMouseDown:r})}const _L={hor:{display:"flex",flexFlow:"row nowrap",flex:"auto"},ver:{height:"100%",display:"flex",flexFlow:"column nowrap",flex:"auto"},childHor:{flex:"none"},childVer:{flex:"none"}};function dfn({dir:t,splitPosition:e,setSplitPosition:n,children:r,style:i,child1Style:o,child2Style:s}){const a=D.useRef(null);if(!r||!Array.isArray(r)||r.length!==2)return null;const l=t==="hor"?_L.childHor:_L.childVer,c=t==="hor"?{width:e}:{height:e},u=f=>{a.current&&vr(a.current.clientWidth)&&n(a.current.clientWidth+f)};return C.jsxs("div",{id:"SplitPane",style:{...i,...t==="hor"?_L.hor:_L.ver},children:[C.jsx("div",{ref:a,id:"SplitPane-Child-1",style:{...l,...o,...c},children:r[0]}),C.jsx(ffn,{dir:t,onChange:u}),C.jsx("div",{id:"SplitPane-Child-2",style:{...l,...s},children:r[1]})]})}const hfn=({placeGroup:t,mapProjection:e,visible:n})=>{const r=D.useRef(new HM);return D.useEffect(()=>{const i=r.current,o=t.features;if(o.length===0)i.clear();else{const s=i.getFeatures(),a=new Set(s.map(f=>f.getId())),l=new Set(o.map(f=>f.id)),c=o.filter(f=>!a.has(f.id));s.filter(f=>!l.has(f.getId()+"")).forEach(f=>i.removeFeature(f)),c.forEach(f=>{const d=new rb().readFeature(f,{dataProjection:"EPSG:4326",featureProjection:e});d.getId()!==f.id&&d.setId(f.id);const h=(f.properties||{}).color||"red",p=(f.properties||{}).opacity,g=(f.properties||{}).source?"diamond":"circle";Eae(d,h,Iee(p),g),i.addFeature(d)})}},[t,e]),C.jsx(N4,{id:t.id,opacity:t.id===_f?1:.8,visible:n,zIndex:501,source:r.current})};class pfn extends aO{addMapObject(e){const n=new Xvt(this.getOptions());return e.addControl(n),n}updateMapObject(e,n,r){return n.setProperties(this.getOptions()),n}removeMapObject(e,n){e.removeControl(n)}}class L9 extends aO{addMapObject(e){const n=new Cyt(this.getOptions()),r=!!this.props.active;return n.setActive(r),e.addInteraction(n),r&&this.listen(n,this.props),n}updateMapObject(e,n,r){n.setProperties(this.getOptions());const i=!!this.props.active;return n.setActive(i),this.unlisten(n,r),i&&this.listen(n,this.props),n}removeMapObject(e,n){this.unlisten(n,this.props),e.removeInteraction(n)}getOptions(){const e=super.getOptions();delete e.layerId,delete e.active,delete e.onDrawStart,delete e.onDrawEnd;const n=this.props.layerId;if(n&&!e.source){const r=this.getMapObject(n);r&&(e.source=r.getSource())}return e}listen(e,n){const{onDrawStart:r,onDrawEnd:i}=n;r&&e.on("drawstart",r),i&&e.on("drawend",i)}unlisten(e,n){const{onDrawStart:r,onDrawEnd:i}=n;r&&e.un("drawstart",r),i&&e.un("drawend",i)}}class gfn extends aO{addMapObject(e){return this.updateView(e)}removeMapObject(e,n){}updateMapObject(e,n){return this.updateView(e)}updateView(e){const n=this.props.projection;let r=e.getView().getProjection();if(typeof n=="string"&&r&&(r=r.getCode()),n&&n!==r){const i=e.getView(),o=new jd({...this.props,center:T4(i.getCenter()||[0,0],r,n),minZoom:i.getMinZoom(),zoom:i.getZoom()});e.getLayers().forEach(s=>{s instanceof I4&&s.getSource().forEachFeature(a=>{var l;(l=a.getGeometry())==null||l.transform(r,n)})}),e.setView(o)}else e.getView().setProperties(this.props);return e.getView()}}function SL(t,e){const n=t.getLayers();for(let r=0;r{if(P){const j=O||null;if(j!==R&&Hs[$9]){const F=Hs[$9].getSource();if(F.clear(),j){const H=bfn(P,j);if(H){const q=H.clone();q.setId("select-"+H.getId()),q.setStyle(void 0),F.addFeature(q)}}I(j)}}},[P,O,R]),D.useEffect(()=>{P&&P.getLayers().forEach(j=>{j instanceof rRe?j.getSource().changed():j.changed()})},[P,E]),D.useEffect(()=>{if(P===null||!vr(M))return;const j=ee=>{m1e(P,ee,M,0)},N=ee=>{m1e(P,ee,M,1)},F=ee=>{ee.context.restore()},H=SL(P,"rgb2"),q=SL(P,"variable2"),Y=SL(P,"rgb"),le=SL(P,"variable"),K=[[H,j],[q,j],[Y,N],[le,N]];for(const[ee,re]of K)ee&&(ee.on("prerender",re),ee.on("postrender",F));return()=>{for(const[ee,re]of K)ee&&(ee.un("prerender",re),ee.un("postrender",F))}});const B=j=>{if(n==="Select"){const N=j.map;let F=null;const H=N.getFeaturesAtPixel(j.pixel);if(H){for(const q of H)if(typeof q.getId=="function"){F=q.getId()+"";break}}S&&S(F,k,!1)}},$=j=>{var N;if(P!==null&&y&&n!=="Select"){const F=j.feature;let H=F.getGeometry();if(!H)return;const q=Uf(tO+n.toLowerCase()+"-"),Y=P.getView().getProjection();if(H instanceof Ote){const te=hpt(H);F.setGeometry(te)}H=F.clone().getGeometry().transform(Y,sO);const le=new rb().writeGeometryObject(H);F.setId(q);let K=0;if(Hs[_f]){const te=Hs[_f],ae=(N=te==null?void 0:te.getSource())==null?void 0:N.getFeatures();ae&&(K=ae.length)}const ee=wfn(b,n),re=r1(K),me=sPe(re,t.palette.mode);Eae(F,me,Iee()),y(v,q,{label:ee,color:re},le,!0)}return!0};function z(j){A&&A(j),T(j)}const L=j=>{x&&j.forEach(N=>{const F=new FileReader;F.onloadend=()=>{typeof F.result=="string"&&x(F.result)},F.readAsText(N,"UTF-8")})};return C.jsx(yPe,{children:C.jsxs(h0t,{id:e,onClick:j=>B(j),onMapRef:z,mapObjects:Hs,isStale:!0,onDropFiles:L,children:[C.jsx(gfn,{id:"view",projection:r}),C.jsxs(nRe,{children:[i,o,s,a,l,f,c,C.jsx(N4,{id:$9,opacity:.7,zIndex:500,style:yfn,source:mfn}),C.jsx(C.Fragment,{children:b.map(j=>C.jsx(hfn,{placeGroup:j,mapProjection:r,visible:_&&w[j.id]},j.id))})]}),u,C.jsx(L9,{id:"drawPoint",layerId:_f,active:n==="Point",type:"Point",wrapX:!0,stopClick:!0,onDrawEnd:$}),C.jsx(L9,{id:"drawPolygon",layerId:_f,active:n==="Polygon",type:"Polygon",wrapX:!0,stopClick:!0,onDrawEnd:$}),C.jsx(L9,{id:"drawCircle",layerId:_f,active:n==="Circle",type:"Circle",wrapX:!0,stopClick:!0,onDrawEnd:$}),d,h,g,m,p,C.jsx(pfn,{bar:!1})]})})}function bfn(t,e){var n;for(const r of t.getLayers().getArray())if(r instanceof I4){const o=(n=r.getSource())==null?void 0:n.getFeatureById(e);if(o)return o}return null}function wfn(t,e){const n=ge.get(e),r=t.find(i=>i.id===_f);if(r)for(let i=1;;i++){const o=`${n} ${i}`;if(!!!r.features.find(a=>a.properties?a.properties.label===o:!1))return o}return`${n} 1`}function m1e(t,e,n,r){const i=t.getSize();if(!i)return;const o=i[0],s=i[1];let a,l,c,u;r===0?(a=hm(e,[0,0]),l=hm(e,[n,0]),c=hm(e,[0,s]),u=hm(e,[n,s])):(a=hm(e,[n,0]),l=hm(e,[o,0]),c=hm(e,[n,s]),u=hm(e,[o,s]));const f=e.context;f.save(),f.beginPath(),f.moveTo(a[0],a[1]),f.lineTo(c[0],c[1]),f.lineTo(u[0],u[1]),f.lineTo(l[0],l[1]),f.closePath(),f.clip()}const CL=1,sP=.2,XO=240,fVe=20,OL={container:{width:XO},itemContainer:{display:"flex",alignItems:"center",justifyContent:"flex-start"},itemLabelBox:{paddingLeft:1,fontSize:"small"},itemColorBox:t=>({width:"48px",height:"16px",borderStyle:"solid",borderColor:t.palette.mode==="dark"?"lightgray":"darkgray",borderWidth:1})};function _fn({categories:t,onOpenColorBarEditor:e}){return!t||t.length===0?null:C.jsx(ot,{sx:OL.container,children:t.map((n,r)=>C.jsxs(ot,{onClick:e,sx:OL.itemContainer,children:[C.jsx(ot,{sx:OL.itemColorBox,style:{backgroundColor:n.color}}),C.jsx(ot,{component:"span",sx:OL.itemLabelBox,children:`${n.label||`Category ${r+1}`} (${n.value})`})]},r))})}const v1e={nominal:{cursor:"pointer"},error:{cursor:"pointer",border:"0.5px solid red"}};function Sfn({colorBar:t,opacity:e,width:n,height:r,onClick:i}){const o=D.useRef(null);D.useEffect(()=>{const c=o.current;c!==null&&dwt(t,e,c)},[t,e]);const{baseName:s,imageData:a}=t,l=a?s:ge.get("Unknown color bar")+`: ${s}`;return C.jsx(Rt,{title:l,children:C.jsx("canvas",{ref:o,width:n||XO,height:r||fVe+4,onClick:i,style:a?v1e.nominal:v1e.error})})}function Cfn(t,e,n=5,r=!1,i=!1){return SQ(Efn(t,e,n,r),i)}function SQ(t,e=!1){return t.map(n=>by(n,void 0,e))}function by(t,e,n){if(e===void 0&&(e=n?2:Ofn(t)),n)return t.toExponential(e);const r=Math.round(t);if(r===t||Math.abs(r-t)<1e-8)return r+"";{let i=t.toFixed(e);if(i.includes("."))for(;i.endsWith("0")&&!i.endsWith(".0");)i=i.substring(0,i.length-1);return i}}function Ofn(t){if(t===0||t===Math.floor(t))return 0;const e=Math.floor(Math.log10(Math.abs(t)));return Math.min(16,Math.max(2,e<0?1-e:0))}function Efn(t,e,n,r){const i=new Array(n);if(r){const o=Math.log10(t),a=(Math.log10(e)-o)/(n-1);for(let l=1;lCfn(t,e,n,r),[t,e,n,r]);return C.jsx(ot,{sx:Tfn.container,onClick:i,children:o.map((s,a)=>C.jsx("span",{children:s},a))})}const Afn=lt(C.jsx("path",{d:"M8 19h3v3h2v-3h3l-4-4zm8-15h-3V1h-2v3H8l4 4zM4 9v2h16V9zm0 3h16v2H4z"}),"Compress"),y1e=t=>t,Pfn=t=>Math.pow(10,t),Mfn=Math.log10,x1e=(t,e)=>typeof t=="number"?e(t):t.map(e);class Rfn{constructor(e){gn(this,"_fn");gn(this,"_invFn");e?(this._fn=Mfn,this._invFn=Pfn):(this._fn=y1e,this._invFn=y1e)}scale(e){return x1e(e,this._fn)}scaleInv(e){return x1e(e,this._invFn)}}function Dfn({variableColorBarName:t,variableColorBarMinMax:e,variableColorBarNorm:n,variableOpacity:r,updateVariableColorBar:i,originalColorBarMinMax:o}){const s=D.useMemo(()=>new Rfn(n==="log"),[n]),[a,l]=D.useState(()=>s.scale(e));D.useEffect(()=>{l(s.scale(e))},[s,e]);const c=(k,E)=>{Array.isArray(E)&&l(E)},u=(k,E)=>{if(Array.isArray(E)){const A=SQ(s.scaleInv(E)).map(P=>Number.parseFloat(P));i(t,A,n,r)}},[f,d]=s.scale(o),h=f=2?v=Math.max(2,Math.round(m/2)):(v=4,m=8);const y=f({value:S[E],label:k}));return C.jsx(QC,{min:b,max:w,value:a,marks:O,step:_,valueLabelFormat:k=>by(s.scaleInv(k)),onChange:c,onChangeCommitted:u,valueLabelDisplay:"auto",size:"small"})}const F9=5,bm={container:t=>({marginTop:t.spacing(2),marginBottom:t.spacing(2),display:"flex",flexDirection:"column",gap:1}),header:{display:"flex",alignItems:"center",justifyContent:"space-between"},title:{paddingLeft:2,fontWeight:"bold"},sliderBox:t=>({marginTop:t.spacing(1),marginLeft:t.spacing(F9),marginRight:t.spacing(F9),minWidth:320,width:`calc(100% - ${t.spacing(2*(F9+1))}px)`}),logLabel:{margin:0,paddingRight:2,fontWeight:"bold"},minMaxBox:{display:"flex",justifyContent:"center"},minTextField:{maxWidth:"8em",marginRight:2},maxTextField:{maxWidth:"8em",marginLeft:2}};function Ifn({variableColorBar:t,variableColorBarName:e,variableColorBarMinMax:n,variableColorBarNorm:r,variableOpacity:i,updateVariableColorBar:o}){const[s,a]=D.useState(n),[l,c]=D.useState(n),[u,f]=D.useState(b1e(n)),[d,h]=D.useState([!1,!1]);D.useEffect(()=>{f(b1e(n))},[n]);const p=y=>{const x=y.target.value;f([x,u[1]]);const b=Number.parseFloat(x);let w=!1;if(!Number.isNaN(b)&&b{const x=y.target.value;f([u[0],x]);const b=Number.parseFloat(x);let w=!1;if(!Number.isNaN(b)&&b>s[0]){if(b!==s[1]){const _=[s[0],b];a(_),c(_),o(e,_,r,i)}}else w=!0;h([d[0],w])},m=()=>{const y=t.colorRecords,x=y[0].value,b=y[y.length-1].value,w=[x,b];a(w),c(w),o(e,w,r,i),h([!1,!1])},v=(y,x)=>{o(e,n,x?"log":"lin",i)};return C.jsxs(ot,{sx:bm.container,children:[C.jsxs(ot,{sx:bm.header,children:[C.jsx(Jt,{sx:bm.title,children:ge.get("Value Range")}),C.jsx("span",{style:{flexGrow:1}}),t.colorRecords&&C.jsx(lu,{sx:{marginRight:1},icon:C.jsx(Afn,{}),onClick:m,tooltipText:ge.get("Set min/max from color mapping values")}),C.jsx(Px,{sx:bm.logLabel,control:C.jsx(Rt,{title:ge.get("Logarithmic scaling"),children:C.jsx(ePe,{checked:r==="log",onChange:v,size:"small"})}),label:C.jsx(Jt,{variant:"body2",children:ge.get("Log-scaled")}),labelPlacement:"start"})]}),C.jsx(ot,{sx:bm.sliderBox,children:C.jsx(Dfn,{variableColorBarName:e,variableColorBarMinMax:n,variableColorBarNorm:r,updateVariableColorBar:o,originalColorBarMinMax:l,variableOpacity:i})}),C.jsxs(ot,{component:"form",sx:bm.minMaxBox,children:[C.jsx(ui,{sx:bm.minTextField,label:"Minimum",variant:"filled",size:"small",value:u[0],error:d[0],onChange:y=>p(y)}),C.jsx(ui,{sx:bm.maxTextField,label:"Maximum",variant:"filled",size:"small",value:u[1],error:d[1],onChange:y=>g(y)})]})]})}function b1e(t){return[t[0]+"",t[1]+""]}function Lfn({variableColorBar:t,variableColorBarName:e,variableColorBarMinMax:n,variableColorBarNorm:r,variableOpacity:i,updateVariableColorBar:o,onOpenColorBarEditor:s}){const[a,l]=D.useState(null),c=f=>{l(f.currentTarget)},u=()=>{l(null)};return C.jsxs(C.Fragment,{children:[C.jsx(Sfn,{colorBar:t,opacity:i,onClick:s}),C.jsx(kfn,{minValue:n[0],maxValue:n[1],numTicks:5,logScaled:r==="log",onClick:c}),C.jsx(K1,{anchorEl:a,open:!!a,onClose:u,anchorOrigin:{vertical:"bottom",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"center"},children:C.jsx(Ifn,{variableColorBar:t,variableColorBarName:e,variableColorBarMinMax:n,variableColorBarNorm:r,variableOpacity:i,updateVariableColorBar:o})})]})}const $fn=lt(C.jsx("path",{d:"M12 4.81V19c-3.31 0-6-2.63-6-5.87 0-1.56.62-3.03 1.75-4.14zM6.35 7.56C4.9 8.99 4 10.96 4 13.13 4 17.48 7.58 21 12 21s8-3.52 8-7.87c0-2.17-.9-4.14-2.35-5.57L12 2z"}),"InvertColors"),Ffn=lt(C.jsx("path",{d:"M17.66 8 12 2.35 6.34 8C4.78 9.56 4 11.64 4 13.64s.78 4.11 2.34 5.67 3.61 2.35 5.66 2.35 4.1-.79 5.66-2.35S20 15.64 20 13.64 19.22 9.56 17.66 8M6 14c.01-2 .62-3.27 1.76-4.4L12 5.27l4.24 4.38C17.38 10.77 17.99 12 18 14z"}),"Opacity"),w2={container:{display:"flex",alignItems:"center",justifyContent:"space-between"},settingsBar:{display:"flex",gap:"1px"},toggleButton:{paddingTop:"2px",paddingBottom:"2px"},opacityContainer:{display:"flex",alignItems:"center"},opacityLabel:t=>({color:t.palette.text.secondary}),opacitySlider:{flexGrow:"1px",marginLeft:"10px",marginRight:"10px"}};function Nfn({variableColorBarName:t,variableColorBarMinMax:e,variableColorBarNorm:n,variableColorBar:r,variableOpacity:i,updateVariableColorBar:o}){const s=()=>{const c=!r.isAlpha;t=dN({...r,isAlpha:c}),o(t,e,n,i)},a=()=>{const c=!r.isReversed;t=dN({...r,isReversed:c}),o(t,e,n,i)},l=(c,u)=>{o(t,e,n,u)};return C.jsxs(C.Fragment,{children:[C.jsx(ot,{sx:w2.container,children:C.jsxs(ot,{sx:w2.settingsBar,children:[C.jsx(Rt,{arrow:!0,title:ge.get("Hide small values"),children:C.jsx(yr,{value:"alpha",selected:r.isAlpha,onChange:s,size:"small",children:C.jsx(Ffn,{fontSize:"inherit"})})}),C.jsx(Rt,{arrow:!0,title:ge.get("Reverse"),children:C.jsx(yr,{value:"reverse",selected:r.isReversed,onChange:a,size:"small",children:C.jsx($fn,{fontSize:"inherit"})})})]})}),C.jsxs(ot,{component:"div",sx:w2.opacityContainer,children:[C.jsx(ot,{component:"span",fontSize:"small",sx:w2.opacityLabel,children:ge.get("Opacity")}),C.jsx(QC,{min:0,max:1,value:i,step:.01,sx:w2.opacitySlider,onChange:l,size:"small"})]})]})}const zfn={colorBarGroupTitle:t=>({marginTop:t.spacing(2*sP),fontSize:"small",color:t.palette.text.secondary})};function dVe({title:t,description:e}){return C.jsx(Rt,{arrow:!0,title:e,placement:"left",children:C.jsx(ot,{sx:zfn.colorBarGroupTitle,children:t})})}const w1e=t=>({marginTop:t.spacing(sP),height:20,borderWidth:1,borderStyle:"solid",cursor:"pointer"}),_1e={colorBarItem:t=>({...w1e(t),borderColor:t.palette.mode==="dark"?"lightgray":"darkgray"}),colorBarItemSelected:t=>({...w1e(t),borderColor:"blue"})};function dle({imageData:t,selected:e,onSelect:n,width:r,title:i}){let o=C.jsx("img",{src:t?`data:image/png;base64,${t}`:void 0,alt:t?"color bar":"error",width:"100%",height:"100%",onClick:n});return i&&(o=C.jsx(Rt,{arrow:!0,title:i,placement:"left",children:o})),C.jsx(ot,{width:r||XO,sx:e?_1e.colorBarItemSelected:_1e.colorBarItem,children:o})}function jfn({colorBarGroup:t,selectedColorBarName:e,onSelectColorBar:n,images:r}){return C.jsxs(C.Fragment,{children:[C.jsx(dVe,{title:t.title,description:t.description}),t.names.map(i=>C.jsx(dle,{title:i,imageData:r[i],selected:i===e,onSelect:()=>n(i)},i))]})}const EU=lt(C.jsx("path",{d:"M13 7h-2v4H7v2h4v4h2v-4h4v-2h-4zm-1-5C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8"}),"AddCircleOutline");function hVe(){const t=D.useRef(),e=D.useRef(()=>{t.current&&(t.current(),t.current=void 0)}),n=D.useRef(r=>{t.current=r});return D.useEffect(()=>e.current,[]),[e.current,n.current]}const Bfn=lt(C.jsx("path",{d:"M12 2C6.47 2 2 6.47 2 12s4.47 10 10 10 10-4.47 10-10S17.53 2 12 2m5 13.59L15.59 17 12 13.41 8.41 17 7 15.59 10.59 12 7 8.41 8.41 7 12 10.59 15.59 7 17 8.41 13.41 12z"}),"Cancel"),Ufn=lt(C.jsx("path",{d:"M9 16.2 4.8 12l-1.4 1.4L9 19 21 7l-1.4-1.4z"}),"Done");function Wfn({anchorEl:t,markdownText:e,open:n,onClose:r}){if(!e)return null;const i={code:o=>{const{node:s,...a}=o;return C.jsx("code",{...a,style:{color:"green"}})}};return C.jsx(K1,{anchorEl:t,open:n,onClose:r,children:C.jsx(Al,{sx:{width:"32em",overflowY:"auto",fontSize:"smaller",paddingLeft:2,paddingRight:2},children:C.jsx(mU,{children:e,components:i,linkTarget:"_blank"})})})}function pVe({size:t,helpUrl:e}){const[n,r]=D.useState(null),i=D.useRef(null),o=H8e(e),s=()=>{r(i.current)},a=()=>{r(null)};return C.jsxs(C.Fragment,{children:[C.jsx(Ht,{onClick:s,size:t,ref:i,children:C.jsx(xPe,{fontSize:"inherit"})}),C.jsx(Wfn,{anchorEl:n,open:!!n,onClose:a,markdownText:o})]})}const S1e={container:{display:"flex",justifyContent:"space-between",gap:.2},doneCancel:{display:"flex",gap:.2}};function oD({onDone:t,onCancel:e,doneDisabled:n,cancelDisabled:r,size:i,helpUrl:o}){return C.jsxs(ot,{sx:S1e.container,children:[C.jsx(ot,{children:o&&C.jsx(pVe,{size:i,helpUrl:o})}),C.jsxs(ot,{sx:S1e.doneCancel,children:[C.jsx(Ht,{onClick:t,color:"primary",disabled:n,size:i,children:C.jsx(Ufn,{fontSize:"inherit"})}),C.jsx(Ht,{onClick:e,color:"primary",disabled:r,size:i,children:C.jsx(Bfn,{fontSize:"inherit"})})]})]})}const N9={radioGroup:{marginLeft:1},radio:{padding:"4px"},label:{fontSize:"small"}},Vfn=[["continuous","Contin.","Continuous color assignment, where each value represents a support point of a color gradient"],["stepwise","Stepwise","Stepwise color mapping where values are bounds of value ranges mapped to the same single color"],["categorical","Categ.","Values represent unique categories or indexes that are mapped to a color"]];function Gfn({colorMapType:t,setColorMapType:e}){return C.jsx(kee,{row:!0,value:t,onChange:(n,r)=>{e(r)},sx:N9.radioGroup,children:Vfn.map(([n,r,i])=>C.jsx(Rt,{arrow:!0,title:ge.get(i),children:C.jsx(Px,{value:n,control:C.jsx(ek,{size:"small",sx:N9.radio}),label:C.jsx(ot,{component:"span",sx:N9.label,children:ge.get(r)})})},n))})}function Hfn({userColorBar:t,updateUserColorBar:e,selected:n,onSelect:r,onDone:i,onCancel:o}){const s=l=>{e({...t,code:l.currentTarget.value})},a=l=>{e({...t,type:l})};return C.jsxs(ot,{children:[C.jsx(dle,{imageData:t.imageData,title:t.errorMessage,selected:n,onSelect:r}),C.jsx(Gfn,{colorMapType:t.type,setColorMapType:a}),C.jsx(ui,{label:"Color mapping",placeholder:fMe,multiline:!0,fullWidth:!0,size:"small",minRows:3,sx:{marginTop:1,fontFamily:"monospace"},value:t.code,onChange:s,color:t.errorMessage?"error":"primary",inputProps:{style:{fontFamily:"monospace",fontSize:12}}}),C.jsx(oD,{onDone:i,onCancel:o,doneDisabled:!!t.errorMessage,size:"small",helpUrl:ge.get("docs/color-mappings.en.md")})]})}const qfn=lt(C.jsx("path",{d:"M6 10c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2m12 0c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2m-6 0c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2"}),"MoreHoriz"),Xfn={container:{display:"flex",alignItems:"center",width:XO,height:fVe,gap:sP,marginTop:sP}};function Yfn({imageData:t,title:e,selected:n,onEdit:r,onRemove:i,onSelect:o,disabled:s}){const[a,l]=D.useState(null),c=p=>{l(p.currentTarget)},u=()=>{l(null)},f=()=>{l(null),r()},d=()=>{l(null),i()},h=!!a;return C.jsxs(C.Fragment,{children:[C.jsxs(ot,{sx:Xfn.container,children:[C.jsx(dle,{imageData:t,selected:n,onSelect:o,width:XO-20,title:e}),C.jsx(Ht,{size:"small",onClick:c,children:C.jsx(qfn,{fontSize:"inherit"})})]}),C.jsx(K1,{anchorOrigin:{vertical:"center",horizontal:"center"},transformOrigin:{vertical:"center",horizontal:"center"},open:h,anchorEl:a,onClose:u,children:C.jsxs(ot,{children:[C.jsx(Ht,{onClick:f,size:"small",disabled:s,children:C.jsx(GO,{fontSize:"inherit"})}),C.jsx(Ht,{onClick:d,size:"small",disabled:s,children:C.jsx(vU,{fontSize:"inherit"})})]})})]})}const Qfn={container:{display:"flex",justifyContent:"space-between",alignItems:"center",gap:1}};function Kfn({colorBarGroup:t,selectedColorBarName:e,onSelectColorBar:n,userColorBars:r,addUserColorBar:i,removeUserColorBar:o,updateUserColorBar:s,updateUserColorBars:a,storeSettings:l}){const[c,u]=D.useState({}),[f,d]=hVe(),h=D.useMemo(()=>r.findIndex(x=>x.id===c.colorBarId),[r,c.colorBarId]),p=()=>{d(()=>a(r));const x=Uf("ucb");i(x),u({action:"add",colorBarId:x})},g=x=>{d(()=>a(r)),u({action:"edit",colorBarId:x})},m=x=>{d(void 0),o(x)},v=()=>{d(void 0),u({}),l()},y=()=>{f(),u({})};return C.jsxs(C.Fragment,{children:[C.jsxs(ot,{sx:Qfn.container,children:[C.jsx(dVe,{title:ge.get(t.title),description:ge.get(t.description)}),C.jsx(Ht,{onClick:p,size:"small",color:"primary",disabled:!!c.action,children:C.jsx(EU,{fontSize:"inherit"})})]}),r.map(x=>x.id===c.colorBarId&&h>=0?C.jsx(Hfn,{userColorBar:x,updateUserColorBar:s,selected:x.id===e,onSelect:()=>n(x.id),onDone:v,onCancel:y},x.id):C.jsx(Yfn,{imageData:x.imageData,title:x.errorMessage,disabled:!!c.action,selected:x.id===e,onSelect:()=>n(x.id),onEdit:()=>g(x.id),onRemove:()=>m(x.id)},x.id))]})}function Zfn({variableColorBarName:t,variableColorBarMinMax:e,variableColorBarNorm:n,variableColorBar:r,variableOpacity:i,updateVariableColorBar:o,colorBars:s,userColorBars:a,addUserColorBar:l,removeUserColorBar:c,updateUserColorBar:u,updateUserColorBars:f,storeSettings:d}){const h=p=>{t=dN({...r,baseName:p}),o(t,e,n,i)};return C.jsx(C.Fragment,{children:s.groups.map(p=>p.title===uMe?C.jsx(Kfn,{colorBarGroup:p,selectedColorBarName:r.baseName,onSelectColorBar:h,userColorBars:a,addUserColorBar:l,removeUserColorBar:c,updateUserColorBar:u,updateUserColorBars:f,storeSettings:d},p.title):C.jsx(jfn,{colorBarGroup:p,selectedColorBarName:r.baseName,onSelectColorBar:h,images:s.images},p.title))})}const Jfn={colorBarBox:t=>({marginTop:t.spacing(CL-2*sP),marginLeft:t.spacing(CL),marginRight:t.spacing(CL),marginBottom:t.spacing(CL)})};function edn(t){const{colorBars:e,userColorBars:n,addUserColorBar:r,removeUserColorBar:i,updateUserColorBar:o,updateUserColorBars:s,...a}=t;return C.jsxs(ot,{sx:Jfn.colorBarBox,children:[C.jsx(Nfn,{...a}),C.jsx(Zfn,{...a,colorBars:e,userColorBars:n,addUserColorBar:r,removeUserColorBar:i,updateUserColorBar:o,updateUserColorBars:s})]})}const C1e={container:t=>({position:"absolute",zIndex:1e3,top:10,borderRadius:"5px",borderWidth:"1px",borderStyle:"solid",borderColor:"#00000020",backgroundColor:"#FFFFFFAA",color:"black",maxWidth:`${XO+20}px`,paddingLeft:t.spacing(1.5),paddingRight:t.spacing(1.5),paddingBottom:t.spacing(.5),paddingTop:t.spacing(.5)}),title:t=>({fontSize:"small",fontWeight:"bold",width:"100%",display:"flex",wordBreak:"break-word",wordWrap:"break-word",justifyContent:"center",paddingBottom:t.spacing(.5)})};function gVe(t){const{variableName:e,variableTitle:n,variableUnits:r,variableColorBar:i,style:o}=t,s=D.useRef(null),[a,l]=D.useState(null),c=()=>{l(s.current)},u=()=>{l(null)};if(!e)return null;const f=i.type==="categorical"?n||e:`${n||e} (${r||"-"})`;return C.jsxs(ot,{sx:C1e.container,style:o,ref:s,children:[C.jsx(Jt,{sx:C1e.title,children:f}),i.type==="categorical"?C.jsx(_fn,{categories:i.colorRecords,onOpenColorBarEditor:c,...t}):C.jsx(Lfn,{onOpenColorBarEditor:c,...t}),C.jsx(K1,{anchorEl:a,open:!!a,onClose:u,anchorOrigin:{vertical:"bottom",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"left"},children:C.jsx(edn,{...t})})]})}const tdn=t=>({variableName:uO(t),variableTitle:Hwt(t),variableUnits:Xwt(t),variableColorBarName:B4(t),variableColorBarMinMax:rDe(t),variableColorBarNorm:sDe(t),variableColorBar:Bte(t),variableOpacity:dDe(t),userColorBars:ib(t),colorBars:W4(t),style:{right:10}}),ndn={updateVariableColorBar:YQt,addUserColorBar:t8e,removeUserColorBar:i8e,updateUserColorBar:o8e,updateUserColorBars:l8e,storeSettings:e8e},rdn=Rn(tdn,ndn)(gVe),idn=t=>{const e=t.controlState.variableSplitPos;return{variableName:e?YRe(t):null,variableTitle:qwt(t),variableUnits:Ywt(t),variableColorBarName:U4(t),variableColorBarMinMax:iDe(t),variableColorBarNorm:aDe(t),variableColorBar:cDe(t),variableOpacity:hDe(t),userColorBars:ib(t),colorBars:W4(t),style:{left:e?e-280:0}}},odn={updateVariableColorBar:QQt,addUserColorBar:t8e,removeUserColorBar:i8e,updateUserColorBar:o8e,updateUserColorBars:l8e,storeSettings:e8e},sdn=Rn(idn,odn)(gVe),adn={splitter:{position:"absolute",top:0,left:"50%",width:"6px",height:"100%",backgroundColor:"#ffffff60",zIndex:999,borderLeft:"0.5px solid #ffffffd0",borderRight:"0.5px solid #ffffffd0",cursor:"col-resize",boxShadow:"0px 0px 1px 0px black"}};function ldn({hidden:t,position:e,onPositionChange:n}){const r=D.useRef(null),i=D.useRef(([s,a])=>{r.current!==null&&n(r.current.offsetLeft+s)}),o=cVe(i.current);return D.useEffect(()=>{!t&&!vr(e)&&r.current!==null&&r.current.parentElement!==null&&n(Math.round(r.current.parentElement.clientWidth/2))},[t,e,n]),t?null:C.jsx(ot,{id:"MapSplitter",ref:r,sx:adn.splitter,style:{left:vr(e)?e:"50%"},onMouseDown:o})}const cdn=t=>({hidden:!t.controlState.variableCompareMode,position:t.controlState.variableSplitPos}),udn={onPositionChange:hKt},fdn=Rn(cdn,udn)(ldn);function ddn(t,e,n,r,i,o,s){const a=D.useRef(0),[l,c]=D.useState(),[u,f]=D.useState(),[d,h]=D.useState(),p=D.useCallback(async(v,y,x,b,w)=>{w({dataset:v,variable:y,result:{fetching:!0}});try{const _=await Ypt(e,v,y,x,b,s,null);console.info(y.name,"=",_),w({dataset:v,variable:y,result:{value:_.value}})}catch(_){w({dataset:v,variable:y,result:{error:_}})}},[e,s]),g=D.useCallback(v=>{const y=v.map;if(!t||!n||!r||!y){f(void 0),h(void 0);return}const x=v.pixel[0],b=v.pixel[1],w=T4(v.coordinate,y.getView().getProjection().getCode(),"EPSG:4326"),_=w[0],S=w[1];c({pixelX:x,pixelY:b,lon:_,lat:S});const O=new Date().getTime();O-a.current>=500&&(a.current=O,p(n,r,_,S,f).finally(()=>{i&&o&&p(i,o,_,S,h)}))},[p,t,n,r,i,o]),m=Hs.map;return D.useEffect(()=>{if(t&&m){const v=y=>{y.dragging?c(void 0):g(y)};return m.on("pointermove",v),()=>{m.un("pointermove",v)}}else c(void 0)},[t,m,g]),D.useMemo(()=>l&&u?{location:l,payload:u,payload2:d}:null,[l,u,d])}const hp={container:{display:"grid",gridTemplateColumns:"auto minmax(60px, auto)",gap:0,padding:1,fontSize:"small"},labelItem:{paddingRight:1},valueItem:{textAlign:"right",fontFamily:"monospace"}};function hdn({location:t,payload:e,payload2:n}){return C.jsxs(ot,{sx:hp.container,children:[C.jsx(ot,{sx:hp.labelItem,children:"Longitude"}),C.jsx(ot,{sx:hp.valueItem,children:by(t.lon,4)}),C.jsx(ot,{sx:hp.labelItem,children:"Latitude"}),C.jsx(ot,{sx:hp.valueItem,children:by(t.lat,4)}),C.jsx(ot,{sx:hp.labelItem,children:O1e(e)}),C.jsx(ot,{sx:hp.valueItem,children:E1e(e)}),n&&C.jsx(ot,{sx:hp.labelItem,children:O1e(n)}),n&&C.jsx(ot,{sx:hp.valueItem,children:E1e(n)})]})}function O1e(t){const e=t.variable;return e.title||e.name}function E1e(t){const e=t.result;return e.error?`${e.error}`:e.fetching?"...":vr(e.value)?by(e.value,4):"---"}const pdn={container:{position:"absolute",zIndex:1e3,backgroundColor:"#000000A0",color:"#fff",border:"1px solid #FFFFFF50",borderRadius:"4px",transform:"translateX(3%)",pointerEvents:"none"}};function gdn({enabled:t,serverUrl:e,dataset1:n,variable1:r,dataset2:i,variable2:o,time:s}){const a=ddn(t,e,n,r,i,o,s);if(!a)return null;const{pixelX:l,pixelY:c}=a.location;return C.jsx(ot,{sx:{...pdn.container,left:l,top:c},children:C.jsx(hdn,{...a})})}const mdn=t=>({enabled:t.controlState.mapPointInfoBoxEnabled,serverUrl:ji(t).url,dataset1:ho(t),variable1:ja(t),dataset2:jy(t),variable2:qg(t),time:pO(t)}),vdn={},ydn=Rn(mdn,vdn)(gdn),xdn=lt(C.jsx("path",{d:"M10 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h5v2h2V1h-2zm0 15H5l5-6zm9-15h-5v2h5v13l-5-6v9h5c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2"}),"Compare"),mVe=lt(C.jsx("path",{d:"m11.99 18.54-7.37-5.73L3 14.07l9 7 9-7-1.63-1.27zM12 16l7.36-5.73L21 9l-9-7-9 7 1.63 1.27z"}),"Layers"),bdn=lt(C.jsx("path",{d:"M20 2H4c-1.1 0-1.99.9-1.99 2L2 22l4-4h14c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2m-2 12H6v-2h12zm0-3H6V9h12zm0-3H6V6h12z"}),"Message"),T1e={position:"absolute",display:"flex",flexDirection:"column",zIndex:1e3};function wdn({style:t,sx:e,children:n}){return C.jsx(ot,{className:"ol-unselectable ol-control",sx:e,style:t?{...T1e,...t}:T1e,children:n})}const vVe={width:"1.375em",height:"1.375em"},_dn={...vVe,backgroundColor:"rgba(0,80,180,0.9)"},Sdn={tooltip:{sx:{backgroundColor:"#4A4A4A",border:"1px solid white",borderRadius:0}}};function z9({icon:t,tooltipTitle:e,onClick:n,selected:r,onSelect:i}){const o=s=>{i&&i(s,!r),n&&n(s)};return e&&(t=C.jsx(Rt,{title:e,componentsProps:Sdn,children:t})),C.jsx(Ht,{onClick:o,style:r?_dn:vVe,children:t})}const Cdn={left:"0.5em",top:65};function Odn({layerMenuOpen:t,setLayerMenuOpen:e,variableCompareMode:n,setVariableCompareMode:r,mapPointInfoBoxEnabled:i,setMapPointInfoBoxEnabled:o}){return C.jsxs(wdn,{style:Cdn,children:[C.jsx(z9,{icon:C.jsx(mVe,{fontSize:"small"}),tooltipTitle:ge.get("Show or hide layers panel"),selected:t,onSelect:(s,a)=>void e(a)}),C.jsx(z9,{icon:C.jsx(xdn,{fontSize:"small"}),tooltipTitle:ge.get("Turn layer split mode on or off"),selected:n,onSelect:(s,a)=>void r(a)}),C.jsx(z9,{icon:C.jsx(bdn,{fontSize:"small"}),tooltipTitle:ge.get("Turn info box on or off"),selected:i,onSelect:(s,a)=>void o(a)})]})}const Edn=t=>({layerMenuOpen:t.controlState.layerMenuOpen,variableCompareMode:t.controlState.variableCompareMode,mapPointInfoBoxEnabled:t.controlState.mapPointInfoBoxEnabled}),Tdn={setLayerMenuOpen:zUe,setVariableCompareMode:dKt,setMapPointInfoBoxEnabled:fKt},kdn=Rn(Edn,Tdn)(Odn),Adn=(t,e)=>({mapId:"map",locale:t.controlState.locale,variableLayer:x_t(t),variable2Layer:b_t(t),rgbLayer:w_t(t),rgb2Layer:__t(t),datasetBoundaryLayer:y_t(t),placeGroupLayers:E_t(t),colorBarLegend:C.jsx(rdn,{}),colorBarLegend2:C.jsx(sdn,{}),mapSplitter:C.jsx(fdn,{}),mapPointInfoBox:C.jsx(ydn,{}),mapControlActions:C.jsx(kdn,{}),userDrawnPlaceGroupName:t.controlState.userDrawnPlaceGroupName,userPlaceGroups:YM(t),userPlaceGroupsVisibility:t_t(t),showUserPlaces:QRe(t),mapInteraction:t.controlState.mapInteraction,mapProjection:zy(t),selectedPlaceId:t.controlState.selectedPlaceId,places:JM(t),baseMapLayer:P_t(t),overlayLayer:M_t(t),imageSmoothing:ZM(t),variableSplitPos:t.controlState.variableSplitPos,onMapRef:e.onMapRef}),Pdn={addDrawnUserPlace:TQt,importUserPlacesFromText:tUe,selectPlace:nU},k1e=Rn(Adn,Pdn)(xfn),yVe=lt(C.jsx("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m1 15h-2v-6h2zm0-8h-2V7h2z"}),"Info"),Mdn=lt(C.jsx("path",{d:"m2 19.99 7.5-7.51 4 4 7.09-7.97L22 9.92l-8.5 9.56-4-4-6 6.01zm1.5-4.5 6-6.01 4 4L22 3.92l-1.41-1.41-7.09 7.97-4-4L2 13.99z"}),"StackedLineChart"),Rdn=lt(C.jsx("path",{d:"M7.52 21.48C4.25 19.94 1.91 16.76 1.55 13H.05C.56 19.16 5.71 24 12 24l.66-.03-3.81-3.81zm.89-6.52c-.19 0-.37-.03-.52-.08-.16-.06-.29-.13-.4-.24-.11-.1-.2-.22-.26-.37-.06-.14-.09-.3-.09-.47h-1.3c0 .36.07.68.21.95s.33.5.56.69c.24.18.51.32.82.41q.45.15.96.15c.37 0 .72-.05 1.03-.15.32-.1.6-.25.83-.44s.42-.43.55-.72.2-.61.2-.97c0-.19-.02-.38-.07-.56s-.12-.35-.23-.51c-.1-.16-.24-.3-.4-.43-.17-.13-.37-.23-.61-.31.2-.09.37-.2.52-.33s.27-.27.37-.42.17-.3.22-.46.07-.32.07-.48q0-.54-.18-.96t-.51-.69c-.2-.19-.47-.33-.77-.43C9.1 8.05 8.76 8 8.39 8c-.36 0-.69.05-1 .16-.3.11-.57.26-.79.45-.21.19-.38.41-.51.67-.12.26-.18.54-.18.85h1.3q0-.255.09-.45c.09-.195.14-.25.25-.34s.23-.17.38-.22.3-.08.48-.08c.4 0 .7.1.89.31.19.2.29.49.29.86 0 .18-.03.34-.08.49s-.14.27-.25.37-.25.18-.41.24-.36.09-.58.09H7.5v1.03h.77c.22 0 .42.02.6.07s.33.13.45.23c.12.11.22.24.29.4s.1.35.1.57c0 .41-.12.72-.35.93-.23.23-.55.33-.95.33m8.55-5.92c-.32-.33-.7-.59-1.14-.77-.43-.18-.92-.27-1.46-.27H12v8h2.3c.55 0 1.06-.09 1.51-.27s.84-.43 1.16-.76.57-.73.74-1.19c.17-.47.26-.99.26-1.57v-.4c0-.58-.09-1.1-.26-1.57q-.27-.705-.75-1.2m-.39 3.16c0 .42-.05.79-.14 1.13-.1.33-.24.62-.43.85s-.43.41-.71.53q-.435.18-.99.18h-.91V9.12h.97c.72 0 1.27.23 1.64.69.38.46.57 1.12.57 1.99zM12 0l-.66.03 3.81 3.81 1.33-1.33c3.27 1.55 5.61 4.72 5.96 8.48h1.5C23.44 4.84 18.29 0 12 0"}),"ThreeDRotation"),Ddn=({contribution:t,panelIndex:e})=>{const n=t.componentResult;return n.status==="pending"?C.jsx(Y1,{},t.name):n.error?C.jsx("div",{children:C.jsx(Jt,{color:"error",children:n.error.message})},t.name):t.component?C.jsx(q6e,{...t.component,onChange:r=>{UYt("panels",e,r)}},t.name):null},Idn=lt(C.jsx("path",{d:"M4 7v2c0 .55-.45 1-1 1H2v4h1c.55 0 1 .45 1 1v2c0 1.65 1.35 3 3 3h3v-2H7c-.55 0-1-.45-1-1v-2c0-1.3-.84-2.42-2-2.83v-.34C5.16 11.42 6 10.3 6 9V7c0-.55.45-1 1-1h3V4H7C5.35 4 4 5.35 4 7m17 3c-.55 0-1-.45-1-1V7c0-1.65-1.35-3-3-3h-3v2h3c.55 0 1 .45 1 1v2c0 1.3.84 2.42 2 2.83v.34c-1.16.41-2 1.52-2 2.83v2c0 .55-.45 1-1 1h-3v2h3c1.65 0 3-1.35 3-3v-2c0-.55.45-1 1-1h1v-4z"}),"DataObject"),Ldn=lt(C.jsx("path",{d:"M19 5v14H5V5zm1.1-2H3.9c-.5 0-.9.4-.9.9v16.2c0 .4.4.9.9.9h16.2c.4 0 .9-.5.9-.9V3.9c0-.5-.5-.9-.9-.9M11 7h6v2h-6zm0 4h6v2h-6zm0 4h6v2h-6zM7 7h2v2H7zm0 4h2v2H7zm0 4h2v2H7z"}),"ListAlt"),$dn=lt(C.jsx("path",{d:"M12 2C8.13 2 5 5.13 5 9c0 5.25 7 13 7 13s7-7.75 7-13c0-3.87-3.13-7-7-7m0 9.5c-1.38 0-2.5-1.12-2.5-2.5s1.12-2.5 2.5-2.5 2.5 1.12 2.5 2.5-1.12 2.5-2.5 2.5"}),"Place"),Fdn=lt(C.jsx("path",{d:"M2.5 4v3h5v12h3V7h5V4zm19 5h-9v3h3v7h3v-7h3z"}),"TextFields"),Ndn=lt(C.jsx("path",{d:"M13 13v8h8v-8zM3 21h8v-8H3zM3 3v8h8V3zm13.66-1.31L11 7.34 16.66 13l5.66-5.66z"}),"Widgets");let ar=class xVe{lineAt(e){if(e<0||e>this.length)throw new RangeError(`Invalid position ${e} in document of length ${this.length}`);return this.lineInner(e,!1,1,0)}line(e){if(e<1||e>this.lines)throw new RangeError(`Invalid line number ${e} in ${this.lines}-line document`);return this.lineInner(e,!0,1,0)}replace(e,n,r){[e,n]=mC(this,e,n);let i=[];return this.decompose(0,e,i,2),r.length&&r.decompose(0,r.length,i,3),this.decompose(n,this.length,i,1),Xd.from(i,this.length-(n-e)+r.length)}append(e){return this.replace(this.length,this.length,e)}slice(e,n=this.length){[e,n]=mC(this,e,n);let r=[];return this.decompose(e,n,r,0),Xd.from(r,n-e)}eq(e){if(e==this)return!0;if(e.length!=this.length||e.lines!=this.lines)return!1;let n=this.scanIdentical(e,1),r=this.length-this.scanIdentical(e,-1),i=new Ck(this),o=new Ck(e);for(let s=n,a=n;;){if(i.next(s),o.next(s),s=0,i.lineBreak!=o.lineBreak||i.done!=o.done||i.value!=o.value)return!1;if(a+=i.value.length,i.done||a>=r)return!0}}iter(e=1){return new Ck(this,e)}iterRange(e,n=this.length){return new bVe(this,e,n)}iterLines(e,n){let r;if(e==null)r=this.iter();else{n==null&&(n=this.lines+1);let i=this.line(e).from;r=this.iterRange(i,Math.max(i,n==this.lines+1?this.length:n<=1?0:this.line(n-1).to))}return new wVe(r)}toString(){return this.sliceString(0)}toJSON(){let e=[];return this.flatten(e),e}constructor(){}static of(e){if(e.length==0)throw new RangeError("A document must have at least one line");return e.length==1&&!e[0]?xVe.empty:e.length<=32?new Vi(e):Xd.from(Vi.split(e,[]))}};class Vi extends ar{constructor(e,n=zdn(e)){super(),this.text=e,this.length=n}get lines(){return this.text.length}get children(){return null}lineInner(e,n,r,i){for(let o=0;;o++){let s=this.text[o],a=i+s.length;if((n?r:a)>=e)return new jdn(i,a,r,s);i=a+1,r++}}decompose(e,n,r,i){let o=e<=0&&n>=this.length?this:new Vi(A1e(this.text,e,n),Math.min(n,this.length)-Math.max(0,e));if(i&1){let s=r.pop(),a=B3(o.text,s.text.slice(),0,o.length);if(a.length<=32)r.push(new Vi(a,s.length+o.length));else{let l=a.length>>1;r.push(new Vi(a.slice(0,l)),new Vi(a.slice(l)))}}else r.push(o)}replace(e,n,r){if(!(r instanceof Vi))return super.replace(e,n,r);[e,n]=mC(this,e,n);let i=B3(this.text,B3(r.text,A1e(this.text,0,e)),n),o=this.length+r.length-(n-e);return i.length<=32?new Vi(i,o):Xd.from(Vi.split(i,[]),o)}sliceString(e,n=this.length,r=` -`){[e,n]=mC(this,e,n);let i="";for(let o=0,s=0;o<=n&&se&&s&&(i+=r),eo&&(i+=a.slice(Math.max(0,e-o),n-o)),o=l+1}return i}flatten(e){for(let n of this.text)e.push(n)}scanIdentical(){return 0}static split(e,n){let r=[],i=-1;for(let o of e)r.push(o),i+=o.length+1,r.length==32&&(n.push(new Vi(r,i)),r=[],i=-1);return i>-1&&n.push(new Vi(r,i)),n}}class Xd extends ar{constructor(e,n){super(),this.children=e,this.length=n,this.lines=0;for(let r of e)this.lines+=r.lines}lineInner(e,n,r,i){for(let o=0;;o++){let s=this.children[o],a=i+s.length,l=r+s.lines-1;if((n?l:a)>=e)return s.lineInner(e,n,r,i);i=a+1,r=l+1}}decompose(e,n,r,i){for(let o=0,s=0;s<=n&&o=s){let c=i&((s<=e?1:0)|(l>=n?2:0));s>=e&&l<=n&&!c?r.push(a):a.decompose(e-s,n-s,r,c)}s=l+1}}replace(e,n,r){if([e,n]=mC(this,e,n),r.lines=o&&n<=a){let l=s.replace(e-o,n-o,r),c=this.lines-s.lines+l.lines;if(l.lines>4&&l.lines>c>>6){let u=this.children.slice();return u[i]=l,new Xd(u,this.length-(n-e)+r.length)}return super.replace(o,a,l)}o=a+1}return super.replace(e,n,r)}sliceString(e,n=this.length,r=` -`){[e,n]=mC(this,e,n);let i="";for(let o=0,s=0;oe&&o&&(i+=r),es&&(i+=a.sliceString(e-s,n-s,r)),s=l+1}return i}flatten(e){for(let n of this.children)n.flatten(e)}scanIdentical(e,n){if(!(e instanceof Xd))return 0;let r=0,[i,o,s,a]=n>0?[0,0,this.children.length,e.children.length]:[this.children.length-1,e.children.length-1,-1,-1];for(;;i+=n,o+=n){if(i==s||o==a)return r;let l=this.children[i],c=e.children[o];if(l!=c)return r+l.scanIdentical(c,n);r+=l.length+1}}static from(e,n=e.reduce((r,i)=>r+i.length+1,-1)){let r=0;for(let h of e)r+=h.lines;if(r<32){let h=[];for(let p of e)p.flatten(h);return new Vi(h,n)}let i=Math.max(32,r>>5),o=i<<1,s=i>>1,a=[],l=0,c=-1,u=[];function f(h){let p;if(h.lines>o&&h instanceof Xd)for(let g of h.children)f(g);else h.lines>s&&(l>s||!l)?(d(),a.push(h)):h instanceof Vi&&l&&(p=u[u.length-1])instanceof Vi&&h.lines+p.lines<=32?(l+=h.lines,c+=h.length+1,u[u.length-1]=new Vi(p.text.concat(h.text),p.length+1+h.length)):(l+h.lines>i&&d(),l+=h.lines,c+=h.length+1,u.push(h))}function d(){l!=0&&(a.push(u.length==1?u[0]:Xd.from(u,c)),c=-1,l=u.length=0)}for(let h of e)f(h);return d(),a.length==1?a[0]:new Xd(a,n)}}ar.empty=new Vi([""],0);function zdn(t){let e=-1;for(let n of t)e+=n.length+1;return e}function B3(t,e,n=0,r=1e9){for(let i=0,o=0,s=!0;o=n&&(l>r&&(a=a.slice(0,r-i)),i0?1:(e instanceof Vi?e.text.length:e.children.length)<<1]}nextInner(e,n){for(this.done=this.lineBreak=!1;;){let r=this.nodes.length-1,i=this.nodes[r],o=this.offsets[r],s=o>>1,a=i instanceof Vi?i.text.length:i.children.length;if(s==(n>0?a:0)){if(r==0)return this.done=!0,this.value="",this;n>0&&this.offsets[r-1]++,this.nodes.pop(),this.offsets.pop()}else if((o&1)==(n>0?0:1)){if(this.offsets[r]+=n,e==0)return this.lineBreak=!0,this.value=` -`,this;e--}else if(i instanceof Vi){let l=i.text[s+(n<0?-1:0)];if(this.offsets[r]+=n,l.length>Math.max(0,e))return this.value=e==0?l:n>0?l.slice(e):l.slice(0,l.length-e),this;e-=l.length}else{let l=i.children[s+(n<0?-1:0)];e>l.length?(e-=l.length,this.offsets[r]+=n):(n<0&&this.offsets[r]--,this.nodes.push(l),this.offsets.push(n>0?1:(l instanceof Vi?l.text.length:l.children.length)<<1))}}}next(e=0){return e<0&&(this.nextInner(-e,-this.dir),e=this.value.length),this.nextInner(e,this.dir)}}class bVe{constructor(e,n,r){this.value="",this.done=!1,this.cursor=new Ck(e,n>r?-1:1),this.pos=n>r?e.length:0,this.from=Math.min(n,r),this.to=Math.max(n,r)}nextInner(e,n){if(n<0?this.pos<=this.from:this.pos>=this.to)return this.value="",this.done=!0,this;e+=Math.max(0,n<0?this.pos-this.to:this.from-this.pos);let r=n<0?this.pos-this.from:this.to-this.pos;e>r&&(e=r),r-=e;let{value:i}=this.cursor.next(e);return this.pos+=(i.length+e)*n,this.value=i.length<=r?i:n<0?i.slice(i.length-r):i.slice(0,r),this.done=!this.value,this}next(e=0){return e<0?e=Math.max(e,this.from-this.pos):e>0&&(e=Math.min(e,this.to-this.pos)),this.nextInner(e,this.cursor.dir)}get lineBreak(){return this.cursor.lineBreak&&this.value!=""}}class wVe{constructor(e){this.inner=e,this.afterBreak=!0,this.value="",this.done=!1}next(e=0){let{done:n,lineBreak:r,value:i}=this.inner.next(e);return n&&this.afterBreak?(this.value="",this.afterBreak=!1):n?(this.done=!0,this.value=""):r?this.afterBreak?this.value="":(this.afterBreak=!0,this.next()):(this.value=i,this.afterBreak=!1),this}get lineBreak(){return!1}}typeof Symbol<"u"&&(ar.prototype[Symbol.iterator]=function(){return this.iter()},Ck.prototype[Symbol.iterator]=bVe.prototype[Symbol.iterator]=wVe.prototype[Symbol.iterator]=function(){return this});let jdn=class{constructor(e,n,r,i){this.from=e,this.to=n,this.number=r,this.text=i}get length(){return this.to-this.from}};function mC(t,e,n){return e=Math.max(0,Math.min(t.length,e)),[e,Math.max(e,Math.min(t.length,n))]}let Y_="lc,34,7n,7,7b,19,,,,2,,2,,,20,b,1c,l,g,,2t,7,2,6,2,2,,4,z,,u,r,2j,b,1m,9,9,,o,4,,9,,3,,5,17,3,3b,f,,w,1j,,,,4,8,4,,3,7,a,2,t,,1m,,,,2,4,8,,9,,a,2,q,,2,2,1l,,4,2,4,2,2,3,3,,u,2,3,,b,2,1l,,4,5,,2,4,,k,2,m,6,,,1m,,,2,,4,8,,7,3,a,2,u,,1n,,,,c,,9,,14,,3,,1l,3,5,3,,4,7,2,b,2,t,,1m,,2,,2,,3,,5,2,7,2,b,2,s,2,1l,2,,,2,4,8,,9,,a,2,t,,20,,4,,2,3,,,8,,29,,2,7,c,8,2q,,2,9,b,6,22,2,r,,,,,,1j,e,,5,,2,5,b,,10,9,,2u,4,,6,,2,2,2,p,2,4,3,g,4,d,,2,2,6,,f,,jj,3,qa,3,t,3,t,2,u,2,1s,2,,7,8,,2,b,9,,19,3,3b,2,y,,3a,3,4,2,9,,6,3,63,2,2,,1m,,,7,,,,,2,8,6,a,2,,1c,h,1r,4,1c,7,,,5,,14,9,c,2,w,4,2,2,,3,1k,,,2,3,,,3,1m,8,2,2,48,3,,d,,7,4,,6,,3,2,5i,1m,,5,ek,,5f,x,2da,3,3x,,2o,w,fe,6,2x,2,n9w,4,,a,w,2,28,2,7k,,3,,4,,p,2,5,,47,2,q,i,d,,12,8,p,b,1a,3,1c,,2,4,2,2,13,,1v,6,2,2,2,2,c,,8,,1b,,1f,,,3,2,2,5,2,,,16,2,8,,6m,,2,,4,,fn4,,kh,g,g,g,a6,2,gt,,6a,,45,5,1ae,3,,2,5,4,14,3,4,,4l,2,fx,4,ar,2,49,b,4w,,1i,f,1k,3,1d,4,2,2,1x,3,10,5,,8,1q,,c,2,1g,9,a,4,2,,2n,3,2,,,2,6,,4g,,3,8,l,2,1l,2,,,,,m,,e,7,3,5,5f,8,2,3,,,n,,29,,2,6,,,2,,,2,,2,6j,,2,4,6,2,,2,r,2,2d,8,2,,,2,2y,,,,2,6,,,2t,3,2,4,,5,77,9,,2,6t,,a,2,,,4,,40,4,2,2,4,,w,a,14,6,2,4,8,,9,6,2,3,1a,d,,2,ba,7,,6,,,2a,m,2,7,,2,,2,3e,6,3,,,2,,7,,,20,2,3,,,,9n,2,f0b,5,1n,7,t4,,1r,4,29,,f5k,2,43q,,,3,4,5,8,8,2,7,u,4,44,3,1iz,1j,4,1e,8,,e,,m,5,,f,11s,7,,h,2,7,,2,,5,79,7,c5,4,15s,7,31,7,240,5,gx7k,2o,3k,6o".split(",").map(t=>t?parseInt(t,36):1);for(let t=1;tt)return Y_[e-1]<=t;return!1}function P1e(t){return t>=127462&&t<=127487}const M1e=8205;function gs(t,e,n=!0,r=!0){return(n?_Ve:Udn)(t,e,r)}function _Ve(t,e,n){if(e==t.length)return e;e&&SVe(t.charCodeAt(e))&&CVe(t.charCodeAt(e-1))&&e--;let r=ss(t,e);for(e+=Jc(r);e=0&&P1e(ss(t,s));)o++,s-=2;if(o%2==0)break;e+=2}else break}return e}function Udn(t,e,n){for(;e>0;){let r=_Ve(t,e-2,n);if(r=56320&&t<57344}function CVe(t){return t>=55296&&t<56320}function ss(t,e){let n=t.charCodeAt(e);if(!CVe(n)||e+1==t.length)return n;let r=t.charCodeAt(e+1);return SVe(r)?(n-55296<<10)+(r-56320)+65536:n}function hle(t){return t<=65535?String.fromCharCode(t):(t-=65536,String.fromCharCode((t>>10)+55296,(t&1023)+56320))}function Jc(t){return t<65536?1:2}const CQ=/\r\n?|\n/;var us=function(t){return t[t.Simple=0]="Simple",t[t.TrackDel=1]="TrackDel",t[t.TrackBefore=2]="TrackBefore",t[t.TrackAfter=3]="TrackAfter",t}(us||(us={}));class wh{constructor(e){this.sections=e}get length(){let e=0;for(let n=0;ne)return o+(e-i);o+=a}else{if(r!=us.Simple&&c>=e&&(r==us.TrackDel&&ie||r==us.TrackBefore&&ie))return null;if(c>e||c==e&&n<0&&!a)return e==i||n<0?o:o+l;o+=l}i=c}if(e>i)throw new RangeError(`Position ${e} is out of range for changeset of length ${i}`);return o}touchesRange(e,n=e){for(let r=0,i=0;r=0&&i<=n&&a>=e)return in?"cover":!0;i=a}return!1}toString(){let e="";for(let n=0;n=0?":"+i:"")}return e}toJSON(){return this.sections}static fromJSON(e){if(!Array.isArray(e)||e.length%2||e.some(n=>typeof n!="number"))throw new RangeError("Invalid JSON representation of ChangeDesc");return new wh(e)}static create(e){return new wh(e)}}class vo extends wh{constructor(e,n){super(e),this.inserted=n}apply(e){if(this.length!=e.length)throw new RangeError("Applying change set to a document with the wrong length");return OQ(this,(n,r,i,o,s)=>e=e.replace(i,i+(r-n),s),!1),e}mapDesc(e,n=!1){return EQ(this,e,n,!0)}invert(e){let n=this.sections.slice(),r=[];for(let i=0,o=0;i=0){n[i]=a,n[i+1]=s;let l=i>>1;for(;r.length0&&wv(r,n,o.text),o.forward(u),a+=u}let c=e[s++];for(;a>1].toJSON()))}return e}static of(e,n,r){let i=[],o=[],s=0,a=null;function l(u=!1){if(!u&&!i.length)return;sd||f<0||d>n)throw new RangeError(`Invalid change range ${f} to ${d} (in doc of length ${n})`);let p=h?typeof h=="string"?ar.of(h.split(r||CQ)):h:ar.empty,g=p.length;if(f==d&&g==0)return;fs&&Us(i,f-s,-1),Us(i,d-f,g),wv(o,i,p),s=d}}return c(e),l(!a),a}static empty(e){return new vo(e?[e,-1]:[],[])}static fromJSON(e){if(!Array.isArray(e))throw new RangeError("Invalid JSON representation of ChangeSet");let n=[],r=[];for(let i=0;ia&&typeof s!="string"))throw new RangeError("Invalid JSON representation of ChangeSet");if(o.length==1)n.push(o[0],0);else{for(;r.length=0&&n<=0&&n==t[i+1]?t[i]+=e:e==0&&t[i]==0?t[i+1]+=n:r?(t[i]+=e,t[i+1]+=n):t.push(e,n)}function wv(t,e,n){if(n.length==0)return;let r=e.length-2>>1;if(r>1])),!(n||s==t.sections.length||t.sections[s+1]<0);)a=t.sections[s++],l=t.sections[s++];e(i,c,o,u,f),i=c,o=u}}}function EQ(t,e,n,r=!1){let i=[],o=r?[]:null,s=new aP(t),a=new aP(e);for(let l=-1;;)if(s.ins==-1&&a.ins==-1){let c=Math.min(s.len,a.len);Us(i,c,-1),s.forward(c),a.forward(c)}else if(a.ins>=0&&(s.ins<0||l==s.i||s.off==0&&(a.len=0&&l=0){let c=0,u=s.len;for(;u;)if(a.ins==-1){let f=Math.min(u,a.len);c+=f,u-=f,a.forward(f)}else if(a.ins==0&&a.lenl||s.ins>=0&&s.len>l)&&(a||r.length>c),o.forward2(l),s.forward(l)}}}}class aP{constructor(e){this.set=e,this.i=0,this.next()}next(){let{sections:e}=this.set;this.i>1;return n>=e.length?ar.empty:e[n]}textBit(e){let{inserted:n}=this.set,r=this.i-2>>1;return r>=n.length&&!e?ar.empty:n[r].slice(this.off,e==null?void 0:this.off+e)}forward(e){e==this.len?this.next():(this.len-=e,this.off+=e)}forward2(e){this.ins==-1?this.forward(e):e==this.ins?this.next():(this.ins-=e,this.off+=e)}}class vx{constructor(e,n,r){this.from=e,this.to=n,this.flags=r}get anchor(){return this.flags&32?this.to:this.from}get head(){return this.flags&32?this.from:this.to}get empty(){return this.from==this.to}get assoc(){return this.flags&8?-1:this.flags&16?1:0}get bidiLevel(){let e=this.flags&7;return e==7?null:e}get goalColumn(){let e=this.flags>>6;return e==16777215?void 0:e}map(e,n=-1){let r,i;return this.empty?r=i=e.mapPos(this.from,n):(r=e.mapPos(this.from,1),i=e.mapPos(this.to,-1)),r==this.from&&i==this.to?this:new vx(r,i,this.flags)}extend(e,n=e){if(e<=this.anchor&&n>=this.anchor)return Ve.range(e,n);let r=Math.abs(e-this.anchor)>Math.abs(n-this.anchor)?e:n;return Ve.range(this.anchor,r)}eq(e,n=!1){return this.anchor==e.anchor&&this.head==e.head&&(!n||!this.empty||this.assoc==e.assoc)}toJSON(){return{anchor:this.anchor,head:this.head}}static fromJSON(e){if(!e||typeof e.anchor!="number"||typeof e.head!="number")throw new RangeError("Invalid JSON representation for SelectionRange");return Ve.range(e.anchor,e.head)}static create(e,n,r){return new vx(e,n,r)}}class Ve{constructor(e,n){this.ranges=e,this.mainIndex=n}map(e,n=-1){return e.empty?this:Ve.create(this.ranges.map(r=>r.map(e,n)),this.mainIndex)}eq(e,n=!1){if(this.ranges.length!=e.ranges.length||this.mainIndex!=e.mainIndex)return!1;for(let r=0;re.toJSON()),main:this.mainIndex}}static fromJSON(e){if(!e||!Array.isArray(e.ranges)||typeof e.main!="number"||e.main>=e.ranges.length)throw new RangeError("Invalid JSON representation for EditorSelection");return new Ve(e.ranges.map(n=>vx.fromJSON(n)),e.main)}static single(e,n=e){return new Ve([Ve.range(e,n)],0)}static create(e,n=0){if(e.length==0)throw new RangeError("A selection needs at least one range");for(let r=0,i=0;ie?8:0)|o)}static normalized(e,n=0){let r=e[n];e.sort((i,o)=>i.from-o.from),n=e.indexOf(r);for(let i=1;io.head?Ve.range(l,a):Ve.range(a,l))}}return new Ve(e,n)}}function EVe(t,e){for(let n of t.ranges)if(n.to>e)throw new RangeError("Selection points outside of document")}let ple=0;class _t{constructor(e,n,r,i,o){this.combine=e,this.compareInput=n,this.compare=r,this.isStatic=i,this.id=ple++,this.default=e([]),this.extensions=typeof o=="function"?o(this):o}get reader(){return this}static define(e={}){return new _t(e.combine||(n=>n),e.compareInput||((n,r)=>n===r),e.compare||(e.combine?(n,r)=>n===r:gle),!!e.static,e.enables)}of(e){return new U3([],this,0,e)}compute(e,n){if(this.isStatic)throw new Error("Can't compute a static facet");return new U3(e,this,1,n)}computeN(e,n){if(this.isStatic)throw new Error("Can't compute a static facet");return new U3(e,this,2,n)}from(e,n){return n||(n=r=>r),this.compute([e],r=>n(r.field(e)))}}function gle(t,e){return t==e||t.length==e.length&&t.every((n,r)=>n===e[r])}class U3{constructor(e,n,r,i){this.dependencies=e,this.facet=n,this.type=r,this.value=i,this.id=ple++}dynamicSlot(e){var n;let r=this.value,i=this.facet.compareInput,o=this.id,s=e[o]>>1,a=this.type==2,l=!1,c=!1,u=[];for(let f of this.dependencies)f=="doc"?l=!0:f=="selection"?c=!0:((n=e[f.id])!==null&&n!==void 0?n:1)&1||u.push(e[f.id]);return{create(f){return f.values[s]=r(f),1},update(f,d){if(l&&d.docChanged||c&&(d.docChanged||d.selection)||TQ(f,u)){let h=r(f);if(a?!R1e(h,f.values[s],i):!i(h,f.values[s]))return f.values[s]=h,1}return 0},reconfigure:(f,d)=>{let h,p=d.config.address[o];if(p!=null){let g=nz(d,p);if(this.dependencies.every(m=>m instanceof _t?d.facet(m)===f.facet(m):m instanceof Qo?d.field(m,!1)==f.field(m,!1):!0)||(a?R1e(h=r(f),g,i):i(h=r(f),g)))return f.values[s]=g,0}else h=r(f);return f.values[s]=h,1}}}}function R1e(t,e,n){if(t.length!=e.length)return!1;for(let r=0;rt[l.id]),i=n.map(l=>l.type),o=r.filter(l=>!(l&1)),s=t[e.id]>>1;function a(l){let c=[];for(let u=0;ur===i),e);return e.provide&&(n.provides=e.provide(n)),n}create(e){let n=e.facet(D1e).find(r=>r.field==this);return((n==null?void 0:n.create)||this.createF)(e)}slot(e){let n=e[this.id]>>1;return{create:r=>(r.values[n]=this.create(r),1),update:(r,i)=>{let o=r.values[n],s=this.updateF(o,i);return this.compareF(o,s)?0:(r.values[n]=s,1)},reconfigure:(r,i)=>i.config.address[this.id]!=null?(r.values[n]=i.field(this),0):(r.values[n]=this.create(r),1)}}init(e){return[this,D1e.of({field:this,create:e})]}get extension(){return this}}const nx={lowest:4,low:3,default:2,high:1,highest:0};function _2(t){return e=>new TVe(e,t)}const n0={highest:_2(nx.highest),high:_2(nx.high),default:_2(nx.default),low:_2(nx.low),lowest:_2(nx.lowest)};class TVe{constructor(e,n){this.inner=e,this.prec=n}}class TU{of(e){return new kQ(this,e)}reconfigure(e){return TU.reconfigure.of({compartment:this,extension:e})}get(e){return e.config.compartments.get(this)}}class kQ{constructor(e,n){this.compartment=e,this.inner=n}}class tz{constructor(e,n,r,i,o,s){for(this.base=e,this.compartments=n,this.dynamicSlots=r,this.address=i,this.staticValues=o,this.facets=s,this.statusTemplate=[];this.statusTemplate.length>1]}static resolve(e,n,r){let i=[],o=Object.create(null),s=new Map;for(let d of Vdn(e,n,s))d instanceof Qo?i.push(d):(o[d.facet.id]||(o[d.facet.id]=[])).push(d);let a=Object.create(null),l=[],c=[];for(let d of i)a[d.id]=c.length<<1,c.push(h=>d.slot(h));let u=r==null?void 0:r.config.facets;for(let d in o){let h=o[d],p=h[0].facet,g=u&&u[d]||[];if(h.every(m=>m.type==0))if(a[p.id]=l.length<<1|1,gle(g,h))l.push(r.facet(p));else{let m=p.combine(h.map(v=>v.value));l.push(r&&p.compare(m,r.facet(p))?r.facet(p):m)}else{for(let m of h)m.type==0?(a[m.id]=l.length<<1|1,l.push(m.value)):(a[m.id]=c.length<<1,c.push(v=>m.dynamicSlot(v)));a[p.id]=c.length<<1,c.push(m=>Wdn(m,p,h))}}let f=c.map(d=>d(a));return new tz(e,s,f,a,l,o)}}function Vdn(t,e,n){let r=[[],[],[],[],[]],i=new Map;function o(s,a){let l=i.get(s);if(l!=null){if(l<=a)return;let c=r[l].indexOf(s);c>-1&&r[l].splice(c,1),s instanceof kQ&&n.delete(s.compartment)}if(i.set(s,a),Array.isArray(s))for(let c of s)o(c,a);else if(s instanceof kQ){if(n.has(s.compartment))throw new RangeError("Duplicate use of compartment in extensions");let c=e.get(s.compartment)||s.inner;n.set(s.compartment,c),o(c,a)}else if(s instanceof TVe)o(s.inner,s.prec);else if(s instanceof Qo)r[a].push(s),s.provides&&o(s.provides,a);else if(s instanceof U3)r[a].push(s),s.facet.extensions&&o(s.facet.extensions,nx.default);else{let c=s.extension;if(!c)throw new Error(`Unrecognized extension value in extension set (${s}). This sometimes happens because multiple instances of @codemirror/state are loaded, breaking instanceof checks.`);o(c,a)}}return o(t,nx.default),r.reduce((s,a)=>s.concat(a))}function Ok(t,e){if(e&1)return 2;let n=e>>1,r=t.status[n];if(r==4)throw new Error("Cyclic dependency between fields and/or facets");if(r&2)return r;t.status[n]=4;let i=t.computeSlot(t,t.config.dynamicSlots[n]);return t.status[n]=2|i}function nz(t,e){return e&1?t.config.staticValues[e>>1]:t.values[e>>1]}const kVe=_t.define(),AQ=_t.define({combine:t=>t.some(e=>e),static:!0}),AVe=_t.define({combine:t=>t.length?t[0]:void 0,static:!0}),PVe=_t.define(),MVe=_t.define(),RVe=_t.define(),DVe=_t.define({combine:t=>t.length?t[0]:!1});class Jh{constructor(e,n){this.type=e,this.value=n}static define(){return new Gdn}}class Gdn{of(e){return new Jh(this,e)}}class Hdn{constructor(e){this.map=e}of(e){return new rn(this,e)}}class rn{constructor(e,n){this.type=e,this.value=n}map(e){let n=this.type.map(this.value,e);return n===void 0?void 0:n==this.value?this:new rn(this.type,n)}is(e){return this.type==e}static define(e={}){return new Hdn(e.map||(n=>n))}static mapEffects(e,n){if(!e.length)return e;let r=[];for(let i of e){let o=i.map(n);o&&r.push(o)}return r}}rn.reconfigure=rn.define();rn.appendConfig=rn.define();class lo{constructor(e,n,r,i,o,s){this.startState=e,this.changes=n,this.selection=r,this.effects=i,this.annotations=o,this.scrollIntoView=s,this._doc=null,this._state=null,r&&EVe(r,n.newLength),o.some(a=>a.type==lo.time)||(this.annotations=o.concat(lo.time.of(Date.now())))}static create(e,n,r,i,o,s){return new lo(e,n,r,i,o,s)}get newDoc(){return this._doc||(this._doc=this.changes.apply(this.startState.doc))}get newSelection(){return this.selection||this.startState.selection.map(this.changes)}get state(){return this._state||this.startState.applyTransaction(this),this._state}annotation(e){for(let n of this.annotations)if(n.type==e)return n.value}get docChanged(){return!this.changes.empty}get reconfigured(){return this.startState.config!=this.state.config}isUserEvent(e){let n=this.annotation(lo.userEvent);return!!(n&&(n==e||n.length>e.length&&n.slice(0,e.length)==e&&n[e.length]=="."))}}lo.time=Jh.define();lo.userEvent=Jh.define();lo.addToHistory=Jh.define();lo.remote=Jh.define();function qdn(t,e){let n=[];for(let r=0,i=0;;){let o,s;if(r=t[r]))o=t[r++],s=t[r++];else if(i=0;i--){let o=r[i](t);o instanceof lo?t=o:Array.isArray(o)&&o.length==1&&o[0]instanceof lo?t=o[0]:t=LVe(e,Q_(o),!1)}return t}function Ydn(t){let e=t.startState,n=e.facet(RVe),r=t;for(let i=n.length-1;i>=0;i--){let o=n[i](t);o&&Object.keys(o).length&&(r=IVe(r,PQ(e,o,t.changes.newLength),!0))}return r==t?t:lo.create(e,t.changes,t.selection,r.effects,r.annotations,r.scrollIntoView)}const Qdn=[];function Q_(t){return t==null?Qdn:Array.isArray(t)?t:[t]}var pi=function(t){return t[t.Word=0]="Word",t[t.Space=1]="Space",t[t.Other=2]="Other",t}(pi||(pi={}));const Kdn=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;let MQ;try{MQ=new RegExp("[\\p{Alphabetic}\\p{Number}_]","u")}catch{}function Zdn(t){if(MQ)return MQ.test(t);for(let e=0;e"€"&&(n.toUpperCase()!=n.toLowerCase()||Kdn.test(n)))return!0}return!1}function Jdn(t){return e=>{if(!/\S/.test(e))return pi.Space;if(Zdn(e))return pi.Word;for(let n=0;n-1)return pi.Word;return pi.Other}}class In{constructor(e,n,r,i,o,s){this.config=e,this.doc=n,this.selection=r,this.values=i,this.status=e.statusTemplate.slice(),this.computeSlot=o,s&&(s._state=this);for(let a=0;ai.set(c,l)),n=null),i.set(a.value.compartment,a.value.extension)):a.is(rn.reconfigure)?(n=null,r=a.value):a.is(rn.appendConfig)&&(n=null,r=Q_(r).concat(a.value));let o;n?o=e.startState.values.slice():(n=tz.resolve(r,i,this),o=new In(n,this.doc,this.selection,n.dynamicSlots.map(()=>null),(l,c)=>c.reconfigure(l,this),null).values);let s=e.startState.facet(AQ)?e.newSelection:e.newSelection.asSingle();new In(n,e.newDoc,s,o,(a,l)=>l.update(a,e),e)}replaceSelection(e){return typeof e=="string"&&(e=this.toText(e)),this.changeByRange(n=>({changes:{from:n.from,to:n.to,insert:e},range:Ve.cursor(n.from+e.length)}))}changeByRange(e){let n=this.selection,r=e(n.ranges[0]),i=this.changes(r.changes),o=[r.range],s=Q_(r.effects);for(let a=1;as.spec.fromJSON(a,l)))}}return In.create({doc:e.doc,selection:Ve.fromJSON(e.selection),extensions:n.extensions?i.concat([n.extensions]):i})}static create(e={}){let n=tz.resolve(e.extensions||[],new Map),r=e.doc instanceof ar?e.doc:ar.of((e.doc||"").split(n.staticFacet(In.lineSeparator)||CQ)),i=e.selection?e.selection instanceof Ve?e.selection:Ve.single(e.selection.anchor,e.selection.head):Ve.single(0);return EVe(i,r.length),n.staticFacet(AQ)||(i=i.asSingle()),new In(n,r,i,n.dynamicSlots.map(()=>null),(o,s)=>s.create(o),null)}get tabSize(){return this.facet(In.tabSize)}get lineBreak(){return this.facet(In.lineSeparator)||` -`}get readOnly(){return this.facet(DVe)}phrase(e,...n){for(let r of this.facet(In.phrases))if(Object.prototype.hasOwnProperty.call(r,e)){e=r[e];break}return n.length&&(e=e.replace(/\$(\$|\d*)/g,(r,i)=>{if(i=="$")return"$";let o=+(i||1);return!o||o>n.length?r:n[o-1]})),e}languageDataAt(e,n,r=-1){let i=[];for(let o of this.facet(kVe))for(let s of o(this,n,r))Object.prototype.hasOwnProperty.call(s,e)&&i.push(s[e]);return i}charCategorizer(e){return Jdn(this.languageDataAt("wordChars",e).join(""))}wordAt(e){let{text:n,from:r,length:i}=this.doc.lineAt(e),o=this.charCategorizer(e),s=e-r,a=e-r;for(;s>0;){let l=gs(n,s,!1);if(o(n.slice(l,s))!=pi.Word)break;s=l}for(;at.length?t[0]:4});In.lineSeparator=AVe;In.readOnly=DVe;In.phrases=_t.define({compare(t,e){let n=Object.keys(t),r=Object.keys(e);return n.length==r.length&&n.every(i=>t[i]==e[i])}});In.languageData=kVe;In.changeFilter=PVe;In.transactionFilter=MVe;In.transactionExtender=RVe;TU.reconfigure=rn.define();function ep(t,e,n={}){let r={};for(let i of t)for(let o of Object.keys(i)){let s=i[o],a=r[o];if(a===void 0)r[o]=s;else if(!(a===s||s===void 0))if(Object.hasOwnProperty.call(n,o))r[o]=n[o](a,s);else throw new Error("Config merge conflict for field "+o)}for(let i in e)r[i]===void 0&&(r[i]=e[i]);return r}class M1{eq(e){return this==e}range(e,n=e){return RQ.create(e,n,this)}}M1.prototype.startSide=M1.prototype.endSide=0;M1.prototype.point=!1;M1.prototype.mapMode=us.TrackDel;let RQ=class $Ve{constructor(e,n,r){this.from=e,this.to=n,this.value=r}static create(e,n,r){return new $Ve(e,n,r)}};function DQ(t,e){return t.from-e.from||t.value.startSide-e.value.startSide}class mle{constructor(e,n,r,i){this.from=e,this.to=n,this.value=r,this.maxPoint=i}get length(){return this.to[this.to.length-1]}findIndex(e,n,r,i=0){let o=r?this.to:this.from;for(let s=i,a=o.length;;){if(s==a)return s;let l=s+a>>1,c=o[l]-e||(r?this.value[l].endSide:this.value[l].startSide)-n;if(l==s)return c>=0?s:a;c>=0?a=l:s=l+1}}between(e,n,r,i){for(let o=this.findIndex(n,-1e9,!0),s=this.findIndex(r,1e9,!1,o);oh||d==h&&c.startSide>0&&c.endSide<=0)continue;(h-d||c.endSide-c.startSide)<0||(s<0&&(s=d),c.point&&(a=Math.max(a,h-d)),r.push(c),i.push(d-s),o.push(h-s))}return{mapped:r.length?new mle(i,o,r,a):null,pos:s}}}class Gn{constructor(e,n,r,i){this.chunkPos=e,this.chunk=n,this.nextLayer=r,this.maxPoint=i}static create(e,n,r,i){return new Gn(e,n,r,i)}get length(){let e=this.chunk.length-1;return e<0?0:Math.max(this.chunkEnd(e),this.nextLayer.length)}get size(){if(this.isEmpty)return 0;let e=this.nextLayer.size;for(let n of this.chunk)e+=n.value.length;return e}chunkEnd(e){return this.chunkPos[e]+this.chunk[e].length}update(e){let{add:n=[],sort:r=!1,filterFrom:i=0,filterTo:o=this.length}=e,s=e.filter;if(n.length==0&&!s)return this;if(r&&(n=n.slice().sort(DQ)),this.isEmpty)return n.length?Gn.of(n):this;let a=new FVe(this,null,-1).goto(0),l=0,c=[],u=new wy;for(;a.value||l=0){let f=n[l++];u.addInner(f.from,f.to,f.value)||c.push(f)}else a.rangeIndex==1&&a.chunkIndexthis.chunkEnd(a.chunkIndex)||oa.to||o=o&&e<=o+s.length&&s.between(o,e-o,n-o,r)===!1)return}this.nextLayer.between(e,n,r)}}iter(e=0){return lP.from([this]).goto(e)}get isEmpty(){return this.nextLayer==this}static iter(e,n=0){return lP.from(e).goto(n)}static compare(e,n,r,i,o=-1){let s=e.filter(f=>f.maxPoint>0||!f.isEmpty&&f.maxPoint>=o),a=n.filter(f=>f.maxPoint>0||!f.isEmpty&&f.maxPoint>=o),l=I1e(s,a,r),c=new S2(s,l,o),u=new S2(a,l,o);r.iterGaps((f,d,h)=>L1e(c,f,u,d,h,i)),r.empty&&r.length==0&&L1e(c,0,u,0,0,i)}static eq(e,n,r=0,i){i==null&&(i=999999999);let o=e.filter(u=>!u.isEmpty&&n.indexOf(u)<0),s=n.filter(u=>!u.isEmpty&&e.indexOf(u)<0);if(o.length!=s.length)return!1;if(!o.length)return!0;let a=I1e(o,s),l=new S2(o,a,0).goto(r),c=new S2(s,a,0).goto(r);for(;;){if(l.to!=c.to||!IQ(l.active,c.active)||l.point&&(!c.point||!l.point.eq(c.point)))return!1;if(l.to>i)return!0;l.next(),c.next()}}static spans(e,n,r,i,o=-1){let s=new S2(e,null,o).goto(n),a=n,l=s.openStart;for(;;){let c=Math.min(s.to,r);if(s.point){let u=s.activeForPoint(s.to),f=s.pointFroma&&(i.span(a,c,s.active,l),l=s.openEnd(c));if(s.to>r)return l+(s.point&&s.to>r?1:0);a=s.to,s.next()}}static of(e,n=!1){let r=new wy;for(let i of e instanceof RQ?[e]:n?ehn(e):e)r.add(i.from,i.to,i.value);return r.finish()}static join(e){if(!e.length)return Gn.empty;let n=e[e.length-1];for(let r=e.length-2;r>=0;r--)for(let i=e[r];i!=Gn.empty;i=i.nextLayer)n=new Gn(i.chunkPos,i.chunk,n,Math.max(i.maxPoint,n.maxPoint));return n}}Gn.empty=new Gn([],[],null,-1);function ehn(t){if(t.length>1)for(let e=t[0],n=1;n0)return t.slice().sort(DQ);e=r}return t}Gn.empty.nextLayer=Gn.empty;class wy{finishChunk(e){this.chunks.push(new mle(this.from,this.to,this.value,this.maxPoint)),this.chunkPos.push(this.chunkStart),this.chunkStart=-1,this.setMaxPoint=Math.max(this.setMaxPoint,this.maxPoint),this.maxPoint=-1,e&&(this.from=[],this.to=[],this.value=[])}constructor(){this.chunks=[],this.chunkPos=[],this.chunkStart=-1,this.last=null,this.lastFrom=-1e9,this.lastTo=-1e9,this.from=[],this.to=[],this.value=[],this.maxPoint=-1,this.setMaxPoint=-1,this.nextLayer=null}add(e,n,r){this.addInner(e,n,r)||(this.nextLayer||(this.nextLayer=new wy)).add(e,n,r)}addInner(e,n,r){let i=e-this.lastTo||r.startSide-this.last.endSide;if(i<=0&&(e-this.lastFrom||r.startSide-this.last.startSide)<0)throw new Error("Ranges must be added sorted by `from` position and `startSide`");return i<0?!1:(this.from.length==250&&this.finishChunk(!0),this.chunkStart<0&&(this.chunkStart=e),this.from.push(e-this.chunkStart),this.to.push(n-this.chunkStart),this.last=r,this.lastFrom=e,this.lastTo=n,this.value.push(r),r.point&&(this.maxPoint=Math.max(this.maxPoint,n-e)),!0)}addChunk(e,n){if((e-this.lastTo||n.value[0].startSide-this.last.endSide)<0)return!1;this.from.length&&this.finishChunk(!0),this.setMaxPoint=Math.max(this.setMaxPoint,n.maxPoint),this.chunks.push(n),this.chunkPos.push(e);let r=n.value.length-1;return this.last=n.value[r],this.lastFrom=n.from[r]+e,this.lastTo=n.to[r]+e,!0}finish(){return this.finishInner(Gn.empty)}finishInner(e){if(this.from.length&&this.finishChunk(!1),this.chunks.length==0)return e;let n=Gn.create(this.chunkPos,this.chunks,this.nextLayer?this.nextLayer.finishInner(e):e,this.setMaxPoint);return this.from=null,n}}function I1e(t,e,n){let r=new Map;for(let o of t)for(let s=0;s=this.minPoint)break}}setRangeIndex(e){if(e==this.layer.chunk[this.chunkIndex].value.length){if(this.chunkIndex++,this.skip)for(;this.chunkIndex=r&&i.push(new FVe(s,n,r,o));return i.length==1?i[0]:new lP(i)}get startSide(){return this.value?this.value.startSide:0}goto(e,n=-1e9){for(let r of this.heap)r.goto(e,n);for(let r=this.heap.length>>1;r>=0;r--)j9(this.heap,r);return this.next(),this}forward(e,n){for(let r of this.heap)r.forward(e,n);for(let r=this.heap.length>>1;r>=0;r--)j9(this.heap,r);(this.to-e||this.value.endSide-n)<0&&this.next()}next(){if(this.heap.length==0)this.from=this.to=1e9,this.value=null,this.rank=-1;else{let e=this.heap[0];this.from=e.from,this.to=e.to,this.value=e.value,this.rank=e.rank,e.value&&e.next(),j9(this.heap,0)}}}function j9(t,e){for(let n=t[e];;){let r=(e<<1)+1;if(r>=t.length)break;let i=t[r];if(r+1=0&&(i=t[r+1],r++),n.compare(i)<0)break;t[r]=n,t[e]=i,e=r}}class S2{constructor(e,n,r){this.minPoint=r,this.active=[],this.activeTo=[],this.activeRank=[],this.minActive=-1,this.point=null,this.pointFrom=0,this.pointRank=0,this.to=-1e9,this.endSide=0,this.openStart=-1,this.cursor=lP.from(e,n,r)}goto(e,n=-1e9){return this.cursor.goto(e,n),this.active.length=this.activeTo.length=this.activeRank.length=0,this.minActive=-1,this.to=e,this.endSide=n,this.openStart=-1,this.next(),this}forward(e,n){for(;this.minActive>-1&&(this.activeTo[this.minActive]-e||this.active[this.minActive].endSide-n)<0;)this.removeActive(this.minActive);this.cursor.forward(e,n)}removeActive(e){EL(this.active,e),EL(this.activeTo,e),EL(this.activeRank,e),this.minActive=$1e(this.active,this.activeTo)}addActive(e){let n=0,{value:r,to:i,rank:o}=this.cursor;for(;n0;)n++;TL(this.active,n,r),TL(this.activeTo,n,i),TL(this.activeRank,n,o),e&&TL(e,n,this.cursor.from),this.minActive=$1e(this.active,this.activeTo)}next(){let e=this.to,n=this.point;this.point=null;let r=this.openStart<0?[]:null;for(;;){let i=this.minActive;if(i>-1&&(this.activeTo[i]-this.cursor.from||this.active[i].endSide-this.cursor.startSide)<0){if(this.activeTo[i]>e){this.to=this.activeTo[i],this.endSide=this.active[i].endSide;break}this.removeActive(i),r&&EL(r,i)}else if(this.cursor.value)if(this.cursor.from>e){this.to=this.cursor.from,this.endSide=this.cursor.startSide;break}else{let o=this.cursor.value;if(!o.point)this.addActive(r),this.cursor.next();else if(n&&this.cursor.to==this.to&&this.cursor.from=0&&r[i]=0&&!(this.activeRank[r]e||this.activeTo[r]==e&&this.active[r].endSide>=this.point.endSide)&&n.push(this.active[r]);return n.reverse()}openEnd(e){let n=0;for(let r=this.activeTo.length-1;r>=0&&this.activeTo[r]>e;r--)n++;return n}}function L1e(t,e,n,r,i,o){t.goto(e),n.goto(r);let s=r+i,a=r,l=r-e;for(;;){let c=t.to+l-n.to||t.endSide-n.endSide,u=c<0?t.to+l:n.to,f=Math.min(u,s);if(t.point||n.point?t.point&&n.point&&(t.point==n.point||t.point.eq(n.point))&&IQ(t.activeForPoint(t.to),n.activeForPoint(n.to))||o.comparePoint(a,f,t.point,n.point):f>a&&!IQ(t.active,n.active)&&o.compareRange(a,f,t.active,n.active),u>s)break;a=u,c<=0&&t.next(),c>=0&&n.next()}}function IQ(t,e){if(t.length!=e.length)return!1;for(let n=0;n=e;r--)t[r+1]=t[r];t[e]=n}function $1e(t,e){let n=-1,r=1e9;for(let i=0;i=e)return i;if(i==t.length)break;o+=t.charCodeAt(i)==9?n-o%n:1,i=gs(t,i)}return r===!0?-1:t.length}const $Q="ͼ",F1e=typeof Symbol>"u"?"__"+$Q:Symbol.for($Q),FQ=typeof Symbol>"u"?"__styleSet"+Math.floor(Math.random()*1e8):Symbol("styleSet"),N1e=typeof globalThis<"u"?globalThis:typeof window<"u"?window:{};class _y{constructor(e,n){this.rules=[];let{finish:r}=n||{};function i(s){return/^@/.test(s)?[s]:s.split(/,\s*/)}function o(s,a,l,c){let u=[],f=/^@(\w+)\b/.exec(s[0]),d=f&&f[1]=="keyframes";if(f&&a==null)return l.push(s[0]+";");for(let h in a){let p=a[h];if(/&/.test(h))o(h.split(/,\s*/).map(g=>s.map(m=>g.replace(/&/,m))).reduce((g,m)=>g.concat(m)),p,l);else if(p&&typeof p=="object"){if(!f)throw new RangeError("The value of a property ("+h+") should be a primitive value.");o(i(h),p,u,d)}else p!=null&&u.push(h.replace(/_.*/,"").replace(/[A-Z]/g,g=>"-"+g.toLowerCase())+": "+p+";")}(u.length||d)&&l.push((r&&!f&&!c?s.map(r):s).join(", ")+" {"+u.join(" ")+"}")}for(let s in e)o(i(s),e[s],this.rules)}getRules(){return this.rules.join(` -`)}static newName(){let e=N1e[F1e]||1;return N1e[F1e]=e+1,$Q+e.toString(36)}static mount(e,n,r){let i=e[FQ],o=r&&r.nonce;i?o&&i.setNonce(o):i=new thn(e,o),i.mount(Array.isArray(n)?n:[n],e)}}let z1e=new Map;class thn{constructor(e,n){let r=e.ownerDocument||e,i=r.defaultView;if(!e.head&&e.adoptedStyleSheets&&i.CSSStyleSheet){let o=z1e.get(r);if(o)return e[FQ]=o;this.sheet=new i.CSSStyleSheet,z1e.set(r,this)}else this.styleTag=r.createElement("style"),n&&this.styleTag.setAttribute("nonce",n);this.modules=[],e[FQ]=this}mount(e,n){let r=this.sheet,i=0,o=0;for(let s=0;s-1&&(this.modules.splice(l,1),o--,l=-1),l==-1){if(this.modules.splice(o++,0,a),r)for(let c=0;c",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},nhn=typeof navigator<"u"&&/Mac/.test(navigator.platform),rhn=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);for(var as=0;as<10;as++)Sy[48+as]=Sy[96+as]=String(as);for(var as=1;as<=24;as++)Sy[as+111]="F"+as;for(var as=65;as<=90;as++)Sy[as]=String.fromCharCode(as+32),cP[as]=String.fromCharCode(as);for(var B9 in Sy)cP.hasOwnProperty(B9)||(cP[B9]=Sy[B9]);function ihn(t){var e=nhn&&t.metaKey&&t.shiftKey&&!t.ctrlKey&&!t.altKey||rhn&&t.shiftKey&&t.key&&t.key.length==1||t.key=="Unidentified",n=!e&&t.key||(t.shiftKey?cP:Sy)[t.keyCode]||t.key||"Unidentified";return n=="Esc"&&(n="Escape"),n=="Del"&&(n="Delete"),n=="Left"&&(n="ArrowLeft"),n=="Up"&&(n="ArrowUp"),n=="Right"&&(n="ArrowRight"),n=="Down"&&(n="ArrowDown"),n}function uP(t){let e;return t.nodeType==11?e=t.getSelection?t:t.ownerDocument:e=t,e.getSelection()}function NQ(t,e){return e?t==e||t.contains(e.nodeType!=1?e.parentNode:e):!1}function ohn(t){let e=t.activeElement;for(;e&&e.shadowRoot;)e=e.shadowRoot.activeElement;return e}function W3(t,e){if(!e.anchorNode)return!1;try{return NQ(t,e.anchorNode)}catch{return!1}}function vC(t){return t.nodeType==3?D1(t,0,t.nodeValue.length).getClientRects():t.nodeType==1?t.getClientRects():[]}function Ek(t,e,n,r){return n?j1e(t,e,n,r,-1)||j1e(t,e,n,r,1):!1}function R1(t){for(var e=0;;e++)if(t=t.previousSibling,!t)return e}function rz(t){return t.nodeType==1&&/^(DIV|P|LI|UL|OL|BLOCKQUOTE|DD|DT|H\d|SECTION|PRE)$/.test(t.nodeName)}function j1e(t,e,n,r,i){for(;;){if(t==n&&e==r)return!0;if(e==(i<0?0:jg(t))){if(t.nodeName=="DIV")return!1;let o=t.parentNode;if(!o||o.nodeType!=1)return!1;e=R1(t)+(i<0?0:1),t=o}else if(t.nodeType==1){if(t=t.childNodes[e+(i<0?-1:0)],t.nodeType==1&&t.contentEditable=="false")return!1;e=i<0?jg(t):0}else return!1}}function jg(t){return t.nodeType==3?t.nodeValue.length:t.childNodes.length}function sD(t,e){let n=e?t.left:t.right;return{left:n,right:n,top:t.top,bottom:t.bottom}}function shn(t){let e=t.visualViewport;return e?{left:0,right:e.width,top:0,bottom:e.height}:{left:0,right:t.innerWidth,top:0,bottom:t.innerHeight}}function NVe(t,e){let n=e.width/t.offsetWidth,r=e.height/t.offsetHeight;return(n>.995&&n<1.005||!isFinite(n)||Math.abs(e.width-t.offsetWidth)<1)&&(n=1),(r>.995&&r<1.005||!isFinite(r)||Math.abs(e.height-t.offsetHeight)<1)&&(r=1),{scaleX:n,scaleY:r}}function ahn(t,e,n,r,i,o,s,a){let l=t.ownerDocument,c=l.defaultView||window;for(let u=t,f=!1;u&&!f;)if(u.nodeType==1){let d,h=u==l.body,p=1,g=1;if(h)d=shn(c);else{if(/^(fixed|sticky)$/.test(getComputedStyle(u).position)&&(f=!0),u.scrollHeight<=u.clientHeight&&u.scrollWidth<=u.clientWidth){u=u.assignedSlot||u.parentNode;continue}let y=u.getBoundingClientRect();({scaleX:p,scaleY:g}=NVe(u,y)),d={left:y.left,right:y.left+u.clientWidth*p,top:y.top,bottom:y.top+u.clientHeight*g}}let m=0,v=0;if(i=="nearest")e.top0&&e.bottom>d.bottom+v&&(v=e.bottom-d.bottom+v+s)):e.bottom>d.bottom&&(v=e.bottom-d.bottom+s,n<0&&e.top-v0&&e.right>d.right+m&&(m=e.right-d.right+m+o)):e.right>d.right&&(m=e.right-d.right+o,n<0&&e.lefti.clientHeight&&(r=i),!n&&i.scrollWidth>i.clientWidth&&(n=i),i=i.assignedSlot||i.parentNode;else if(i.nodeType==11)i=i.host;else break;return{x:n,y:r}}class chn{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}eq(e){return this.anchorNode==e.anchorNode&&this.anchorOffset==e.anchorOffset&&this.focusNode==e.focusNode&&this.focusOffset==e.focusOffset}setRange(e){let{anchorNode:n,focusNode:r}=e;this.set(n,Math.min(e.anchorOffset,n?jg(n):0),r,Math.min(e.focusOffset,r?jg(r):0))}set(e,n,r,i){this.anchorNode=e,this.anchorOffset=n,this.focusNode=r,this.focusOffset=i}}let cw=null;function zVe(t){if(t.setActive)return t.setActive();if(cw)return t.focus(cw);let e=[];for(let n=t;n&&(e.push(n,n.scrollTop,n.scrollLeft),n!=n.ownerDocument);n=n.parentNode);if(t.focus(cw==null?{get preventScroll(){return cw={preventScroll:!0},!0}}:void 0),!cw){cw=!1;for(let n=0;nMath.max(1,t.scrollHeight-t.clientHeight-4)}function UVe(t,e){for(let n=t,r=e;;){if(n.nodeType==3&&r>0)return{node:n,offset:r};if(n.nodeType==1&&r>0){if(n.contentEditable=="false")return null;n=n.childNodes[r-1],r=jg(n)}else if(n.parentNode&&!rz(n))r=R1(n),n=n.parentNode;else return null}}function WVe(t,e){for(let n=t,r=e;;){if(n.nodeType==3&&rn)return f.domBoundsAround(e,n,c);if(d>=e&&i==-1&&(i=l,o=c),c>n&&f.dom.parentNode==this.dom){s=l,a=u;break}u=d,c=d+f.breakAfter}return{from:o,to:a<0?r+this.length:a,startDOM:(i?this.children[i-1].dom.nextSibling:null)||this.dom.firstChild,endDOM:s=0?this.children[s].dom:null}}markDirty(e=!1){this.flags|=2,this.markParentsDirty(e)}markParentsDirty(e){for(let n=this.parent;n;n=n.parent){if(e&&(n.flags|=2),n.flags&1)return;n.flags|=1,e=!1}}setParent(e){this.parent!=e&&(this.parent=e,this.flags&7&&this.markParentsDirty(!0))}setDOM(e){this.dom!=e&&(this.dom&&(this.dom.cmView=null),this.dom=e,e.cmView=this)}get rootView(){for(let e=this;;){let n=e.parent;if(!n)return e;e=n}}replaceChildren(e,n,r=vle){this.markDirty();for(let i=e;ithis.pos||e==this.pos&&(n>0||this.i==0||this.children[this.i-1].breakAfter))return this.off=e-this.pos,this;let r=this.children[--this.i];this.pos-=r.length+r.breakAfter}}}function GVe(t,e,n,r,i,o,s,a,l){let{children:c}=t,u=c.length?c[e]:null,f=o.length?o[o.length-1]:null,d=f?f.breakAfter:s;if(!(e==r&&u&&!s&&!d&&o.length<2&&u.merge(n,i,o.length?f:null,n==0,a,l))){if(r0&&(!s&&o.length&&u.merge(n,u.length,o[0],!1,a,0)?u.breakAfter=o.shift().breakAfter:(n2);var St={mac:G1e||/Mac/.test(Ja.platform),windows:/Win/.test(Ja.platform),linux:/Linux|X11/.test(Ja.platform),ie:kU,ie_version:qVe?zQ.documentMode||6:BQ?+BQ[1]:jQ?+jQ[1]:0,gecko:W1e,gecko_version:W1e?+(/Firefox\/(\d+)/.exec(Ja.userAgent)||[0,0])[1]:0,chrome:!!U9,chrome_version:U9?+U9[1]:0,ios:G1e,android:/Android\b/.test(Ja.userAgent),webkit:V1e,safari:XVe,webkit_version:V1e?+(/\bAppleWebKit\/(\d+)/.exec(Ja.userAgent)||[0,0])[1]:0,tabSize:zQ.documentElement.style.tabSize!=null?"tab-size":"-moz-tab-size"};const dhn=256;class Qf extends Dr{constructor(e){super(),this.text=e}get length(){return this.text.length}createDOM(e){this.setDOM(e||document.createTextNode(this.text))}sync(e,n){this.dom||this.createDOM(),this.dom.nodeValue!=this.text&&(n&&n.node==this.dom&&(n.written=!0),this.dom.nodeValue=this.text)}reuseDOM(e){e.nodeType==3&&this.createDOM(e)}merge(e,n,r){return this.flags&8||r&&(!(r instanceof Qf)||this.length-(n-e)+r.length>dhn||r.flags&8)?!1:(this.text=this.text.slice(0,e)+(r?r.text:"")+this.text.slice(n),this.markDirty(),!0)}split(e){let n=new Qf(this.text.slice(e));return this.text=this.text.slice(0,e),this.markDirty(),n.flags|=this.flags&8,n}localPosFromDOM(e,n){return e==this.dom?n:n?this.text.length:0}domAtPos(e){return new Xs(this.dom,e)}domBoundsAround(e,n,r){return{from:r,to:r+this.length,startDOM:this.dom,endDOM:this.dom.nextSibling}}coordsAt(e,n){return hhn(this.dom,e,n)}}class Bg extends Dr{constructor(e,n=[],r=0){super(),this.mark=e,this.children=n,this.length=r;for(let i of n)i.setParent(this)}setAttrs(e){if(jVe(e),this.mark.class&&(e.className=this.mark.class),this.mark.attrs)for(let n in this.mark.attrs)e.setAttribute(n,this.mark.attrs[n]);return e}canReuseDOM(e){return super.canReuseDOM(e)&&!((this.flags|e.flags)&8)}reuseDOM(e){e.nodeName==this.mark.tagName.toUpperCase()&&(this.setDOM(e),this.flags|=6)}sync(e,n){this.dom?this.flags&4&&this.setAttrs(this.dom):this.setDOM(this.setAttrs(document.createElement(this.mark.tagName))),super.sync(e,n)}merge(e,n,r,i,o,s){return r&&(!(r instanceof Bg&&r.mark.eq(this.mark))||e&&o<=0||ne&&n.push(r=e&&(i=o),r=l,o++}let s=this.length-e;return this.length=e,i>-1&&(this.children.length=i,this.markDirty()),new Bg(this.mark,n,s)}domAtPos(e){return YVe(this,e)}coordsAt(e,n){return KVe(this,e,n)}}function hhn(t,e,n){let r=t.nodeValue.length;e>r&&(e=r);let i=e,o=e,s=0;e==0&&n<0||e==r&&n>=0?St.chrome||St.gecko||(e?(i--,s=1):o=0)?0:a.length-1];return St.safari&&!s&&l.width==0&&(l=Array.prototype.find.call(a,c=>c.width)||l),s?sD(l,s<0):l||null}class _v extends Dr{static create(e,n,r){return new _v(e,n,r)}constructor(e,n,r){super(),this.widget=e,this.length=n,this.side=r,this.prevWidget=null}split(e){let n=_v.create(this.widget,this.length-e,this.side);return this.length-=e,n}sync(e){(!this.dom||!this.widget.updateDOM(this.dom,e))&&(this.dom&&this.prevWidget&&this.prevWidget.destroy(this.dom),this.prevWidget=null,this.setDOM(this.widget.toDOM(e)),this.widget.editable||(this.dom.contentEditable="false"))}getSide(){return this.side}merge(e,n,r,i,o,s){return r&&(!(r instanceof _v)||!this.widget.compare(r.widget)||e>0&&o<=0||n0)?Xs.before(this.dom):Xs.after(this.dom,e==this.length)}domBoundsAround(){return null}coordsAt(e,n){let r=this.widget.coordsAt(this.dom,e,n);if(r)return r;let i=this.dom.getClientRects(),o=null;if(!i.length)return null;let s=this.side?this.side<0:e>0;for(let a=s?i.length-1:0;o=i[a],!(e>0?a==0:a==i.length-1||o.top0?Xs.before(this.dom):Xs.after(this.dom)}localPosFromDOM(){return 0}domBoundsAround(){return null}coordsAt(e){return this.dom.getBoundingClientRect()}get overrideDOMText(){return ar.empty}get isHidden(){return!0}}Qf.prototype.children=_v.prototype.children=yC.prototype.children=vle;function YVe(t,e){let n=t.dom,{children:r}=t,i=0;for(let o=0;io&&e0;o--){let s=r[o-1];if(s.dom.parentNode==n)return s.domAtPos(s.length)}for(let o=i;o0&&e instanceof Bg&&i.length&&(r=i[i.length-1])instanceof Bg&&r.mark.eq(e.mark)?QVe(r,e.children[0],n-1):(i.push(e),e.setParent(t)),t.length+=e.length}function KVe(t,e,n){let r=null,i=-1,o=null,s=-1;function a(c,u){for(let f=0,d=0;f=u&&(h.children.length?a(h,u-d):(!o||o.isHidden&&n>0)&&(p>u||d==p&&h.getSide()>0)?(o=h,s=u-d):(d-1?1:0)!=i.length-(n&&i.indexOf(n)>-1?1:0))return!1;for(let o of r)if(o!=n&&(i.indexOf(o)==-1||t[o]!==e[o]))return!1;return!0}function WQ(t,e,n){let r=!1;if(e)for(let i in e)n&&i in n||(r=!0,i=="style"?t.style.cssText="":t.removeAttribute(i));if(n)for(let i in n)e&&e[i]==n[i]||(r=!0,i=="style"?t.style.cssText=n[i]:t.setAttribute(i,n[i]));return r}function ghn(t){let e=Object.create(null);for(let n=0;n0?3e8:-4e8:n>0?1e8:-1e8,new Cy(e,n,n,r,e.widget||null,!1)}static replace(e){let n=!!e.block,r,i;if(e.isBlockGap)r=-5e8,i=4e8;else{let{start:o,end:s}=ZVe(e,n);r=(o?n?-3e8:-1:5e8)-1,i=(s?n?2e8:1:-6e8)+1}return new Cy(e,r,i,n,e.widget||null,!0)}static line(e){return new lD(e)}static set(e,n=!1){return Gn.of(e,n)}hasHeight(){return this.widget?this.widget.estimatedHeight>-1:!1}}It.none=Gn.empty;class aD extends It{constructor(e){let{start:n,end:r}=ZVe(e);super(n?-1:5e8,r?1:-6e8,null,e),this.tagName=e.tagName||"span",this.class=e.class||"",this.attrs=e.attributes||null}eq(e){var n,r;return this==e||e instanceof aD&&this.tagName==e.tagName&&(this.class||((n=this.attrs)===null||n===void 0?void 0:n.class))==(e.class||((r=e.attrs)===null||r===void 0?void 0:r.class))&&iz(this.attrs,e.attrs,"class")}range(e,n=e){if(e>=n)throw new RangeError("Mark decorations may not be empty");return super.range(e,n)}}aD.prototype.point=!1;class lD extends It{constructor(e){super(-2e8,-2e8,null,e)}eq(e){return e instanceof lD&&this.spec.class==e.spec.class&&iz(this.spec.attributes,e.spec.attributes)}range(e,n=e){if(n!=e)throw new RangeError("Line decoration ranges must be zero-length");return super.range(e,n)}}lD.prototype.mapMode=us.TrackBefore;lD.prototype.point=!0;class Cy extends It{constructor(e,n,r,i,o,s){super(n,r,o,e),this.block=i,this.isReplace=s,this.mapMode=i?n<=0?us.TrackBefore:us.TrackAfter:us.TrackDel}get type(){return this.startSide!=this.endSide?ka.WidgetRange:this.startSide<=0?ka.WidgetBefore:ka.WidgetAfter}get heightRelevant(){return this.block||!!this.widget&&(this.widget.estimatedHeight>=5||this.widget.lineBreaks>0)}eq(e){return e instanceof Cy&&mhn(this.widget,e.widget)&&this.block==e.block&&this.startSide==e.startSide&&this.endSide==e.endSide}range(e,n=e){if(this.isReplace&&(e>n||e==n&&this.startSide>0&&this.endSide<=0))throw new RangeError("Invalid range for replacement decoration");if(!this.isReplace&&n!=e)throw new RangeError("Widget decorations can only have zero-length ranges");return super.range(e,n)}}Cy.prototype.point=!0;function ZVe(t,e=!1){let{inclusiveStart:n,inclusiveEnd:r}=t;return n==null&&(n=t.inclusive),r==null&&(r=t.inclusive),{start:n??e,end:r??e}}function mhn(t,e){return t==e||!!(t&&e&&t.compare(e))}function VQ(t,e,n,r=0){let i=n.length-1;i>=0&&n[i]+r>=t?n[i]=Math.max(n[i],e):n.push(t,e)}class ro extends Dr{constructor(){super(...arguments),this.children=[],this.length=0,this.prevAttrs=void 0,this.attrs=null,this.breakAfter=0}merge(e,n,r,i,o,s){if(r){if(!(r instanceof ro))return!1;this.dom||r.transferDOM(this)}return i&&this.setDeco(r?r.attrs:null),HVe(this,e,n,r?r.children.slice():[],o,s),!0}split(e){let n=new ro;if(n.breakAfter=this.breakAfter,this.length==0)return n;let{i:r,off:i}=this.childPos(e);i&&(n.append(this.children[r].split(i),0),this.children[r].merge(i,this.children[r].length,null,!1,0,0),r++);for(let o=r;o0&&this.children[r-1].length==0;)this.children[--r].destroy();return this.children.length=r,this.markDirty(),this.length=e,n}transferDOM(e){this.dom&&(this.markDirty(),e.setDOM(this.dom),e.prevAttrs=this.prevAttrs===void 0?this.attrs:this.prevAttrs,this.prevAttrs=void 0,this.dom=null)}setDeco(e){iz(this.attrs,e)||(this.dom&&(this.prevAttrs=this.attrs,this.markDirty()),this.attrs=e)}append(e,n){QVe(this,e,n)}addLineDeco(e){let n=e.spec.attributes,r=e.spec.class;n&&(this.attrs=UQ(n,this.attrs||{})),r&&(this.attrs=UQ({class:r},this.attrs||{}))}domAtPos(e){return YVe(this,e)}reuseDOM(e){e.nodeName=="DIV"&&(this.setDOM(e),this.flags|=6)}sync(e,n){var r;this.dom?this.flags&4&&(jVe(this.dom),this.dom.className="cm-line",this.prevAttrs=this.attrs?null:void 0):(this.setDOM(document.createElement("div")),this.dom.className="cm-line",this.prevAttrs=this.attrs?null:void 0),this.prevAttrs!==void 0&&(WQ(this.dom,this.prevAttrs,this.attrs),this.dom.classList.add("cm-line"),this.prevAttrs=void 0),super.sync(e,n);let i=this.dom.lastChild;for(;i&&Dr.get(i)instanceof Bg;)i=i.lastChild;if(!i||!this.length||i.nodeName!="BR"&&((r=Dr.get(i))===null||r===void 0?void 0:r.isEditable)==!1&&(!St.ios||!this.children.some(o=>o instanceof Qf))){let o=document.createElement("BR");o.cmIgnore=!0,this.dom.appendChild(o)}}measureTextSize(){if(this.children.length==0||this.length>20)return null;let e=0,n;for(let r of this.children){if(!(r instanceof Qf)||/[^ -~]/.test(r.text))return null;let i=vC(r.dom);if(i.length!=1)return null;e+=i[0].width,n=i[0].height}return e?{lineHeight:this.dom.getBoundingClientRect().height,charWidth:e/this.length,textHeight:n}:null}coordsAt(e,n){let r=KVe(this,e,n);if(!this.children.length&&r&&this.parent){let{heightOracle:i}=this.parent.view.viewState,o=r.bottom-r.top;if(Math.abs(o-i.lineHeight)<2&&i.textHeight=n){if(o instanceof ro)return o;if(s>n)break}i=s+o.breakAfter}return null}}class pg extends Dr{constructor(e,n,r){super(),this.widget=e,this.length=n,this.deco=r,this.breakAfter=0,this.prevWidget=null}merge(e,n,r,i,o,s){return r&&(!(r instanceof pg)||!this.widget.compare(r.widget)||e>0&&o<=0||n0}}class GQ extends tp{constructor(e){super(),this.height=e}toDOM(){let e=document.createElement("div");return e.className="cm-gap",this.updateDOM(e),e}eq(e){return e.height==this.height}updateDOM(e){return e.style.height=this.height+"px",!0}get editable(){return!0}get estimatedHeight(){return this.height}ignoreEvent(){return!1}}class Tk{constructor(e,n,r,i){this.doc=e,this.pos=n,this.end=r,this.disallowBlockEffectsFor=i,this.content=[],this.curLine=null,this.breakAtStart=0,this.pendingBuffer=0,this.bufferMarks=[],this.atCursorPos=!0,this.openStart=-1,this.openEnd=-1,this.text="",this.textOff=0,this.cursor=e.iter(),this.skip=n}posCovered(){if(this.content.length==0)return!this.breakAtStart&&this.doc.lineAt(this.pos).from!=this.pos;let e=this.content[this.content.length-1];return!(e.breakAfter||e instanceof pg&&e.deco.endSide<0)}getLine(){return this.curLine||(this.content.push(this.curLine=new ro),this.atCursorPos=!0),this.curLine}flushBuffer(e=this.bufferMarks){this.pendingBuffer&&(this.curLine.append(kL(new yC(-1),e),e.length),this.pendingBuffer=0)}addBlockWidget(e){this.flushBuffer(),this.curLine=null,this.content.push(e)}finish(e){this.pendingBuffer&&e<=this.bufferMarks.length?this.flushBuffer():this.pendingBuffer=0,!this.posCovered()&&!(e&&this.content.length&&this.content[this.content.length-1]instanceof pg)&&this.getLine()}buildText(e,n,r){for(;e>0;){if(this.textOff==this.text.length){let{value:o,lineBreak:s,done:a}=this.cursor.next(this.skip);if(this.skip=0,a)throw new Error("Ran out of text content when drawing inline views");if(s){this.posCovered()||this.getLine(),this.content.length?this.content[this.content.length-1].breakAfter=1:this.breakAtStart=1,this.flushBuffer(),this.curLine=null,this.atCursorPos=!0,e--;continue}else this.text=o,this.textOff=0}let i=Math.min(this.text.length-this.textOff,e,512);this.flushBuffer(n.slice(n.length-r)),this.getLine().append(kL(new Qf(this.text.slice(this.textOff,this.textOff+i)),n),r),this.atCursorPos=!0,this.textOff+=i,e-=i,r=0}}span(e,n,r,i){this.buildText(n-e,r,i),this.pos=n,this.openStart<0&&(this.openStart=i)}point(e,n,r,i,o,s){if(this.disallowBlockEffectsFor[s]&&r instanceof Cy){if(r.block)throw new RangeError("Block decorations may not be specified via plugins");if(n>this.doc.lineAt(this.pos).to)throw new RangeError("Decorations that replace line breaks may not be specified via plugins")}let a=n-e;if(r instanceof Cy)if(r.block)r.startSide>0&&!this.posCovered()&&this.getLine(),this.addBlockWidget(new pg(r.widget||xC.block,a,r));else{let l=_v.create(r.widget||xC.inline,a,a?0:r.startSide),c=this.atCursorPos&&!l.isEditable&&o<=i.length&&(e0),u=!l.isEditable&&(ei.length||r.startSide<=0),f=this.getLine();this.pendingBuffer==2&&!c&&!l.isEditable&&(this.pendingBuffer=0),this.flushBuffer(i),c&&(f.append(kL(new yC(1),i),o),o=i.length+Math.max(0,o-i.length)),f.append(kL(l,i),o),this.atCursorPos=u,this.pendingBuffer=u?ei.length?1:2:0,this.pendingBuffer&&(this.bufferMarks=i.slice())}else this.doc.lineAt(this.pos).from==this.pos&&this.getLine().addLineDeco(r);a&&(this.textOff+a<=this.text.length?this.textOff+=a:(this.skip+=a-(this.text.length-this.textOff),this.text="",this.textOff=0),this.pos=n),this.openStart<0&&(this.openStart=o)}static build(e,n,r,i,o){let s=new Tk(e,n,r,o);return s.openEnd=Gn.spans(i,n,r,s),s.openStart<0&&(s.openStart=s.openEnd),s.finish(s.openEnd),s}}function kL(t,e){for(let n of e)t=new Bg(n,[t],t.length);return t}class xC extends tp{constructor(e){super(),this.tag=e}eq(e){return e.tag==this.tag}toDOM(){return document.createElement(this.tag)}updateDOM(e){return e.nodeName.toLowerCase()==this.tag}get isHidden(){return!0}}xC.inline=new xC("span");xC.block=new xC("div");var ii=function(t){return t[t.LTR=0]="LTR",t[t.RTL=1]="RTL",t}(ii||(ii={}));const I1=ii.LTR,yle=ii.RTL;function JVe(t){let e=[];for(let n=0;n=n){if(a.level==r)return s;(o<0||(i!=0?i<0?a.fromn:e[o].level>a.level))&&(o=s)}}if(o<0)throw new RangeError("Index out of range");return o}}function t9e(t,e){if(t.length!=e.length)return!1;for(let n=0;n=0;g-=3)if(yd[g+1]==-h){let m=yd[g+2],v=m&2?i:m&4?m&1?o:i:0;v&&(Rr[f]=Rr[yd[g]]=v),a=g;break}}else{if(yd.length==189)break;yd[a++]=f,yd[a++]=d,yd[a++]=l}else if((p=Rr[f])==2||p==1){let g=p==i;l=g?0:1;for(let m=a-3;m>=0;m-=3){let v=yd[m+2];if(v&2)break;if(g)yd[m+2]|=2;else{if(v&4)break;yd[m+2]|=4}}}}}function _hn(t,e,n,r){for(let i=0,o=r;i<=n.length;i++){let s=i?n[i-1].to:t,a=il;)p==m&&(p=n[--g].from,m=g?n[g-1].to:t),Rr[--p]=h;l=u}else o=c,l++}}}function qQ(t,e,n,r,i,o,s){let a=r%2?2:1;if(r%2==i%2)for(let l=e,c=0;ll&&s.push(new Sv(l,g.from,h));let m=g.direction==I1!=!(h%2);XQ(t,m?r+1:r,i,g.inner,g.from,g.to,s),l=g.to}p=g.to}else{if(p==n||(u?Rr[p]!=a:Rr[p]==a))break;p++}d?qQ(t,l,p,r+1,i,d,s):le;){let u=!0,f=!1;if(!c||l>o[c-1].to){let g=Rr[l-1];g!=a&&(u=!1,f=g==16)}let d=!u&&a==1?[]:null,h=u?r:r+1,p=l;e:for(;;)if(c&&p==o[c-1].to){if(f)break e;let g=o[--c];if(!u)for(let m=g.from,v=c;;){if(m==e)break e;if(v&&o[v-1].to==m)m=o[--v].from;else{if(Rr[m-1]==a)break e;break}}if(d)d.push(g);else{g.toRr.length;)Rr[Rr.length]=256;let r=[],i=e==I1?0:1;return XQ(t,i,i,n,0,t.length,r),r}function n9e(t){return[new Sv(0,t,0)]}let r9e="";function Chn(t,e,n,r,i){var o;let s=r.head-t.from,a=Sv.find(e,s,(o=r.bidiLevel)!==null&&o!==void 0?o:-1,r.assoc),l=e[a],c=l.side(i,n);if(s==c){let d=a+=i?1:-1;if(d<0||d>=e.length)return null;l=e[a=d],s=l.side(!i,n),c=l.side(i,n)}let u=gs(t.text,s,l.forward(i,n));(ul.to)&&(u=c),r9e=t.text.slice(Math.min(s,u),Math.max(s,u));let f=a==(i?e.length-1:0)?null:e[a+(i?1:-1)];return f&&u==c&&f.level+(i?0:1)t.some(e=>e)}),f9e=_t.define({combine:t=>t.some(e=>e)}),d9e=_t.define();class Z_{constructor(e,n="nearest",r="nearest",i=5,o=5,s=!1){this.range=e,this.y=n,this.x=r,this.yMargin=i,this.xMargin=o,this.isSnapshot=s}map(e){return e.empty?this:new Z_(this.range.map(e),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot)}clip(e){return this.range.to<=e.doc.length?this:new Z_(Ve.cursor(e.doc.length),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot)}}const AL=rn.define({map:(t,e)=>t.map(e)}),h9e=rn.define();function ll(t,e,n){let r=t.facet(a9e);r.length?r[0](e):window.onerror?window.onerror(String(e),n,void 0,void 0,e):n?console.error(n+":",e):console.error(e)}const iv=_t.define({combine:t=>t.length?t[0]:!0});let Ehn=0;const AT=_t.define();class Qi{constructor(e,n,r,i,o){this.id=e,this.create=n,this.domEventHandlers=r,this.domEventObservers=i,this.extension=o(this)}static define(e,n){const{eventHandlers:r,eventObservers:i,provide:o,decorations:s}=n||{};return new Qi(Ehn++,e,r,i,a=>{let l=[AT.of(a)];return s&&l.push(fP.of(c=>{let u=c.plugin(a);return u?s(u):It.none})),o&&l.push(o(a)),l})}static fromClass(e,n){return Qi.define(r=>new e(r),n)}}class W9{constructor(e){this.spec=e,this.mustUpdate=null,this.value=null}update(e){if(this.value){if(this.mustUpdate){let n=this.mustUpdate;if(this.mustUpdate=null,this.value.update)try{this.value.update(n)}catch(r){if(ll(n.state,r,"CodeMirror plugin crashed"),this.value.destroy)try{this.value.destroy()}catch{}this.deactivate()}}}else if(this.spec)try{this.value=this.spec.create(e)}catch(n){ll(e.state,n,"CodeMirror plugin crashed"),this.deactivate()}return this}destroy(e){var n;if(!((n=this.value)===null||n===void 0)&&n.destroy)try{this.value.destroy()}catch(r){ll(e.state,r,"CodeMirror plugin crashed")}}deactivate(){this.spec=this.value=null}}const p9e=_t.define(),xle=_t.define(),fP=_t.define(),g9e=_t.define(),ble=_t.define(),m9e=_t.define();function q1e(t,e){let n=t.state.facet(m9e);if(!n.length)return n;let r=n.map(o=>o instanceof Function?o(t):o),i=[];return Gn.spans(r,e.from,e.to,{point(){},span(o,s,a,l){let c=o-e.from,u=s-e.from,f=i;for(let d=a.length-1;d>=0;d--,l--){let h=a[d].spec.bidiIsolate,p;if(h==null&&(h=Ohn(e.text,c,u)),l>0&&f.length&&(p=f[f.length-1]).to==c&&p.direction==h)p.to=u,f=p.inner;else{let g={from:c,to:u,direction:h,inner:[]};f.push(g),f=g.inner}}}}),i}const v9e=_t.define();function y9e(t){let e=0,n=0,r=0,i=0;for(let o of t.state.facet(v9e)){let s=o(t);s&&(s.left!=null&&(e=Math.max(e,s.left)),s.right!=null&&(n=Math.max(n,s.right)),s.top!=null&&(r=Math.max(r,s.top)),s.bottom!=null&&(i=Math.max(i,s.bottom)))}return{left:e,right:n,top:r,bottom:i}}const PT=_t.define();class mu{constructor(e,n,r,i){this.fromA=e,this.toA=n,this.fromB=r,this.toB=i}join(e){return new mu(Math.min(this.fromA,e.fromA),Math.max(this.toA,e.toA),Math.min(this.fromB,e.fromB),Math.max(this.toB,e.toB))}addToSet(e){let n=e.length,r=this;for(;n>0;n--){let i=e[n-1];if(!(i.fromA>r.toA)){if(i.toAu)break;o+=2}if(!l)return r;new mu(l.fromA,l.toA,l.fromB,l.toB).addToSet(r),s=l.toA,a=l.toB}}}class oz{constructor(e,n,r){this.view=e,this.state=n,this.transactions=r,this.flags=0,this.startState=e.state,this.changes=vo.empty(this.startState.doc.length);for(let o of r)this.changes=this.changes.compose(o.changes);let i=[];this.changes.iterChangedRanges((o,s,a,l)=>i.push(new mu(o,s,a,l))),this.changedRanges=i}static create(e,n,r){return new oz(e,n,r)}get viewportChanged(){return(this.flags&4)>0}get heightChanged(){return(this.flags&2)>0}get geometryChanged(){return this.docChanged||(this.flags&10)>0}get focusChanged(){return(this.flags&1)>0}get docChanged(){return!this.changes.empty}get selectionSet(){return this.transactions.some(e=>e.selection)}get empty(){return this.flags==0&&this.transactions.length==0}}class X1e extends Dr{get length(){return this.view.state.doc.length}constructor(e){super(),this.view=e,this.decorations=[],this.dynamicDecorationMap=[!1],this.domChanged=null,this.hasComposition=null,this.markedForComposition=new Set,this.editContextFormatting=It.none,this.lastCompositionAfterCursor=!1,this.minWidth=0,this.minWidthFrom=0,this.minWidthTo=0,this.impreciseAnchor=null,this.impreciseHead=null,this.forceSelection=!1,this.lastUpdate=Date.now(),this.setDOM(e.contentDOM),this.children=[new ro],this.children[0].setParent(this),this.updateDeco(),this.updateInner([new mu(0,0,0,e.state.doc.length)],0,null)}update(e){var n;let r=e.changedRanges;this.minWidth>0&&r.length&&(r.every(({fromA:c,toA:u})=>uthis.minWidthTo)?(this.minWidthFrom=e.changes.mapPos(this.minWidthFrom,1),this.minWidthTo=e.changes.mapPos(this.minWidthTo,1)):this.minWidth=this.minWidthFrom=this.minWidthTo=0),this.updateEditContextFormatting(e);let i=-1;this.view.inputState.composing>=0&&!this.view.observer.editContext&&(!((n=this.domChanged)===null||n===void 0)&&n.newSel?i=this.domChanged.newSel.head:!Dhn(e.changes,this.hasComposition)&&!e.selectionSet&&(i=e.state.selection.main.head));let o=i>-1?khn(this.view,e.changes,i):null;if(this.domChanged=null,this.hasComposition){this.markedForComposition.clear();let{from:c,to:u}=this.hasComposition;r=new mu(c,u,e.changes.mapPos(c,-1),e.changes.mapPos(u,1)).addToSet(r.slice())}this.hasComposition=o?{from:o.range.fromB,to:o.range.toB}:null,(St.ie||St.chrome)&&!o&&e&&e.state.doc.lines!=e.startState.doc.lines&&(this.forceSelection=!0);let s=this.decorations,a=this.updateDeco(),l=Mhn(s,a,e.changes);return r=mu.extendWithRanges(r,l),!(this.flags&7)&&r.length==0?!1:(this.updateInner(r,e.startState.doc.length,o),e.transactions.length&&(this.lastUpdate=Date.now()),!0)}updateInner(e,n,r){this.view.viewState.mustMeasureContent=!0,this.updateChildren(e,n,r);let{observer:i}=this.view;i.ignore(()=>{this.dom.style.height=this.view.viewState.contentHeight/this.view.scaleY+"px",this.dom.style.flexBasis=this.minWidth?this.minWidth+"px":"";let s=St.chrome||St.ios?{node:i.selectionRange.focusNode,written:!1}:void 0;this.sync(this.view,s),this.flags&=-8,s&&(s.written||i.selectionRange.focusNode!=s.node)&&(this.forceSelection=!0),this.dom.style.height=""}),this.markedForComposition.forEach(s=>s.flags&=-9);let o=[];if(this.view.viewport.from||this.view.viewport.to=0?i[s]:null;if(!a)break;let{fromA:l,toA:c,fromB:u,toB:f}=a,d,h,p,g;if(r&&r.range.fromBu){let b=Tk.build(this.view.state.doc,u,r.range.fromB,this.decorations,this.dynamicDecorationMap),w=Tk.build(this.view.state.doc,r.range.toB,f,this.decorations,this.dynamicDecorationMap);h=b.breakAtStart,p=b.openStart,g=w.openEnd;let _=this.compositionView(r);w.breakAtStart?_.breakAfter=1:w.content.length&&_.merge(_.length,_.length,w.content[0],!1,w.openStart,0)&&(_.breakAfter=w.content[0].breakAfter,w.content.shift()),b.content.length&&_.merge(0,0,b.content[b.content.length-1],!0,0,b.openEnd)&&b.content.pop(),d=b.content.concat(_).concat(w.content)}else({content:d,breakAtStart:h,openStart:p,openEnd:g}=Tk.build(this.view.state.doc,u,f,this.decorations,this.dynamicDecorationMap));let{i:m,off:v}=o.findPos(c,1),{i:y,off:x}=o.findPos(l,-1);GVe(this,y,x,m,v,d,h,p,g)}r&&this.fixCompositionDOM(r)}updateEditContextFormatting(e){this.editContextFormatting=this.editContextFormatting.map(e.changes);for(let n of e.transactions)for(let r of n.effects)r.is(h9e)&&(this.editContextFormatting=r.value)}compositionView(e){let n=new Qf(e.text.nodeValue);n.flags|=8;for(let{deco:i}of e.marks)n=new Bg(i,[n],n.length);let r=new ro;return r.append(n,0),r}fixCompositionDOM(e){let n=(o,s)=>{s.flags|=8|(s.children.some(l=>l.flags&7)?1:0),this.markedForComposition.add(s);let a=Dr.get(o);a&&a!=s&&(a.dom=null),s.setDOM(o)},r=this.childPos(e.range.fromB,1),i=this.children[r.i];n(e.line,i);for(let o=e.marks.length-1;o>=-1;o--)r=i.childPos(r.off,1),i=i.children[r.i],n(o>=0?e.marks[o].node:e.text,i)}updateSelection(e=!1,n=!1){(e||!this.view.observer.selectionRange.focusNode)&&this.view.observer.readSelectionRange();let r=this.view.root.activeElement,i=r==this.dom,o=!i&&W3(this.dom,this.view.observer.selectionRange)&&!(r&&this.dom.contains(r));if(!(i||n||o))return;let s=this.forceSelection;this.forceSelection=!1;let a=this.view.state.selection.main,l=this.moveToLine(this.domAtPos(a.anchor)),c=a.empty?l:this.moveToLine(this.domAtPos(a.head));if(St.gecko&&a.empty&&!this.hasComposition&&Thn(l)){let f=document.createTextNode("");this.view.observer.ignore(()=>l.node.insertBefore(f,l.node.childNodes[l.offset]||null)),l=c=new Xs(f,0),s=!0}let u=this.view.observer.selectionRange;(s||!u.focusNode||(!Ek(l.node,l.offset,u.anchorNode,u.anchorOffset)||!Ek(c.node,c.offset,u.focusNode,u.focusOffset))&&!this.suppressWidgetCursorChange(u,a))&&(this.view.observer.ignore(()=>{St.android&&St.chrome&&this.dom.contains(u.focusNode)&&Rhn(u.focusNode,this.dom)&&(this.dom.blur(),this.dom.focus({preventScroll:!0}));let f=uP(this.view.root);if(f)if(a.empty){if(St.gecko){let d=Ahn(l.node,l.offset);if(d&&d!=3){let h=(d==1?UVe:WVe)(l.node,l.offset);h&&(l=new Xs(h.node,h.offset))}}f.collapse(l.node,l.offset),a.bidiLevel!=null&&f.caretBidiLevel!==void 0&&(f.caretBidiLevel=a.bidiLevel)}else if(f.extend){f.collapse(l.node,l.offset);try{f.extend(c.node,c.offset)}catch{}}else{let d=document.createRange();a.anchor>a.head&&([l,c]=[c,l]),d.setEnd(c.node,c.offset),d.setStart(l.node,l.offset),f.removeAllRanges(),f.addRange(d)}o&&this.view.root.activeElement==this.dom&&(this.dom.blur(),r&&r.focus())}),this.view.observer.setSelectionRange(l,c)),this.impreciseAnchor=l.precise?null:new Xs(u.anchorNode,u.anchorOffset),this.impreciseHead=c.precise?null:new Xs(u.focusNode,u.focusOffset)}suppressWidgetCursorChange(e,n){return this.hasComposition&&n.empty&&Ek(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset)&&this.posFromDOM(e.focusNode,e.focusOffset)==n.head}enforceCursorAssoc(){if(this.hasComposition)return;let{view:e}=this,n=e.state.selection.main,r=uP(e.root),{anchorNode:i,anchorOffset:o}=e.observer.selectionRange;if(!r||!n.empty||!n.assoc||!r.modify)return;let s=ro.find(this,n.head);if(!s)return;let a=s.posAtStart;if(n.head==a||n.head==a+s.length)return;let l=this.coordsAt(n.head,-1),c=this.coordsAt(n.head,1);if(!l||!c||l.bottom>c.top)return;let u=this.domAtPos(n.head+n.assoc);r.collapse(u.node,u.offset),r.modify("move",n.assoc<0?"forward":"backward","lineboundary"),e.observer.readSelectionRange();let f=e.observer.selectionRange;e.docView.posFromDOM(f.anchorNode,f.anchorOffset)!=n.from&&r.collapse(i,o)}moveToLine(e){let n=this.dom,r;if(e.node!=n)return e;for(let i=e.offset;!r&&i=0;i--){let o=Dr.get(n.childNodes[i]);o instanceof ro&&(r=o.domAtPos(o.length))}return r?new Xs(r.node,r.offset,!0):e}nearest(e){for(let n=e;n;){let r=Dr.get(n);if(r&&r.rootView==this)return r;n=n.parentNode}return null}posFromDOM(e,n){let r=this.nearest(e);if(!r)throw new RangeError("Trying to find position for a DOM position outside of the document");return r.localPosFromDOM(e,n)+r.posAtStart}domAtPos(e){let{i:n,off:r}=this.childCursor().findPos(e,-1);for(;n=0;s--){let a=this.children[s],l=o-a.breakAfter,c=l-a.length;if(le||a.covers(1))&&(!r||a instanceof ro&&!(r instanceof ro&&n>=0)))r=a,i=c;else if(r&&c==e&&l==e&&a instanceof pg&&Math.abs(n)<2){if(a.deco.startSide<0)break;s&&(r=null)}o=c}return r?r.coordsAt(e-i,n):null}coordsForChar(e){let{i:n,off:r}=this.childPos(e,1),i=this.children[n];if(!(i instanceof ro))return null;for(;i.children.length;){let{i:a,off:l}=i.childPos(r,1);for(;;a++){if(a==i.children.length)return null;if((i=i.children[a]).length)break}r=l}if(!(i instanceof Qf))return null;let o=gs(i.text,r);if(o==r)return null;let s=D1(i.dom,r,o).getClientRects();for(let a=0;aMath.max(this.view.scrollDOM.clientWidth,this.minWidth)+1,a=-1,l=this.view.textDirection==ii.LTR;for(let c=0,u=0;ui)break;if(c>=r){let h=f.dom.getBoundingClientRect();if(n.push(h.height),s){let p=f.dom.lastChild,g=p?vC(p):[];if(g.length){let m=g[g.length-1],v=l?m.right-h.left:h.right-m.left;v>a&&(a=v,this.minWidth=o,this.minWidthFrom=c,this.minWidthTo=d)}}}c=d+f.breakAfter}return n}textDirectionAt(e){let{i:n}=this.childPos(e,1);return getComputedStyle(this.children[n].dom).direction=="rtl"?ii.RTL:ii.LTR}measureTextSize(){for(let o of this.children)if(o instanceof ro){let s=o.measureTextSize();if(s)return s}let e=document.createElement("div"),n,r,i;return e.className="cm-line",e.style.width="99999px",e.style.position="absolute",e.textContent="abc def ghi jkl mno pqr stu",this.view.observer.ignore(()=>{this.dom.appendChild(e);let o=vC(e.firstChild)[0];n=e.getBoundingClientRect().height,r=o?o.width/27:7,i=o?o.height:n,e.remove()}),{lineHeight:n,charWidth:r,textHeight:i}}childCursor(e=this.length){let n=this.children.length;return n&&(e-=this.children[--n].length),new VVe(this.children,e,n)}computeBlockGapDeco(){let e=[],n=this.view.viewState;for(let r=0,i=0;;i++){let o=i==n.viewports.length?null:n.viewports[i],s=o?o.from-1:this.length;if(s>r){let a=(n.lineBlockAt(s).bottom-n.lineBlockAt(r).top)/this.view.scaleY;e.push(It.replace({widget:new GQ(a),block:!0,inclusive:!0,isBlockGap:!0}).range(r,s))}if(!o)break;r=o.to+1}return It.set(e)}updateDeco(){let e=1,n=this.view.state.facet(fP).map(o=>(this.dynamicDecorationMap[e++]=typeof o=="function")?o(this.view):o),r=!1,i=this.view.state.facet(g9e).map((o,s)=>{let a=typeof o=="function";return a&&(r=!0),a?o(this.view):o});for(i.length&&(this.dynamicDecorationMap[e++]=r,n.push(Gn.join(i))),this.decorations=[this.editContextFormatting,...n,this.computeBlockGapDeco(),this.view.viewState.lineGapDeco];en.anchor?-1:1),i;if(!r)return;!n.empty&&(i=this.coordsAt(n.anchor,n.anchor>n.head?-1:1))&&(r={left:Math.min(r.left,i.left),top:Math.min(r.top,i.top),right:Math.max(r.right,i.right),bottom:Math.max(r.bottom,i.bottom)});let o=y9e(this.view),s={left:r.left-o.left,top:r.top-o.top,right:r.right+o.right,bottom:r.bottom+o.bottom},{offsetWidth:a,offsetHeight:l}=this.view.scrollDOM;ahn(this.view.scrollDOM,s,n.head{re.from&&(n=!0)}),n}function Ihn(t,e,n=1){let r=t.charCategorizer(e),i=t.doc.lineAt(e),o=e-i.from;if(i.length==0)return Ve.cursor(e);o==0?n=1:o==i.length&&(n=-1);let s=o,a=o;n<0?s=gs(i.text,o,!1):a=gs(i.text,o);let l=r(i.text.slice(s,a));for(;s>0;){let c=gs(i.text,s,!1);if(r(i.text.slice(c,s))!=l)break;s=c}for(;at?e.left-t:Math.max(0,t-e.right)}function $hn(t,e){return e.top>t?e.top-t:Math.max(0,t-e.bottom)}function V9(t,e){return t.tope.top+1}function Y1e(t,e){return et.bottom?{top:t.top,left:t.left,right:t.right,bottom:e}:t}function QQ(t,e,n){let r,i,o,s,a=!1,l,c,u,f;for(let p=t.firstChild;p;p=p.nextSibling){let g=vC(p);for(let m=0;mx||s==x&&o>y){r=p,i=v,o=y,s=x;let b=x?n0?m0)}y==0?n>v.bottom&&(!u||u.bottomv.top)&&(c=p,f=v):u&&V9(u,v)?u=Q1e(u,v.bottom):f&&V9(f,v)&&(f=Y1e(f,v.top))}}if(u&&u.bottom>=n?(r=l,i=u):f&&f.top<=n&&(r=c,i=f),!r)return{node:t,offset:0};let d=Math.max(i.left,Math.min(i.right,e));if(r.nodeType==3)return K1e(r,d,n);if(a&&r.contentEditable!="false")return QQ(r,d,n);let h=Array.prototype.indexOf.call(t.childNodes,r)+(e>=(i.left+i.right)/2?1:0);return{node:t,offset:h}}function K1e(t,e,n){let r=t.nodeValue.length,i=-1,o=1e9,s=0;for(let a=0;an?u.top-n:n-u.bottom)-1;if(u.left-1<=e&&u.right+1>=e&&f=(u.left+u.right)/2,h=d;if((St.chrome||St.gecko)&&D1(t,a).getBoundingClientRect().left==u.right&&(h=!d),f<=0)return{node:t,offset:a+(h?1:0)};i=a+(h?1:0),o=f}}}return{node:t,offset:i>-1?i:s>0?t.nodeValue.length:0}}function b9e(t,e,n,r=-1){var i,o;let s=t.contentDOM.getBoundingClientRect(),a=s.top+t.viewState.paddingTop,l,{docHeight:c}=t.viewState,{x:u,y:f}=e,d=f-a;if(d<0)return 0;if(d>c)return t.state.doc.length;for(let b=t.viewState.heightOracle.textHeight/2,w=!1;l=t.elementAtHeight(d),l.type!=ka.Text;)for(;d=r>0?l.bottom+b:l.top-b,!(d>=0&&d<=c);){if(w)return n?null:0;w=!0,r=-r}f=a+d;let h=l.from;if(ht.viewport.to)return t.viewport.to==t.state.doc.length?t.state.doc.length:n?null:Z1e(t,s,l,u,f);let p=t.dom.ownerDocument,g=t.root.elementFromPoint?t.root:p,m=g.elementFromPoint(u,f);m&&!t.contentDOM.contains(m)&&(m=null),m||(u=Math.max(s.left+1,Math.min(s.right-1,u)),m=g.elementFromPoint(u,f),m&&!t.contentDOM.contains(m)&&(m=null));let v,y=-1;if(m&&((i=t.docView.nearest(m))===null||i===void 0?void 0:i.isEditable)!=!1){if(p.caretPositionFromPoint){let b=p.caretPositionFromPoint(u,f);b&&({offsetNode:v,offset:y}=b)}else if(p.caretRangeFromPoint){let b=p.caretRangeFromPoint(u,f);b&&({startContainer:v,startOffset:y}=b,(!t.contentDOM.contains(v)||St.safari&&Fhn(v,y,u)||St.chrome&&Nhn(v,y,u))&&(v=void 0))}}if(!v||!t.docView.dom.contains(v)){let b=ro.find(t.docView,h);if(!b)return d>l.top+l.height/2?l.to:l.from;({node:v,offset:y}=QQ(b.dom,u,f))}let x=t.docView.nearest(v);if(!x)return null;if(x.isWidget&&((o=x.dom)===null||o===void 0?void 0:o.nodeType)==1){let b=x.dom.getBoundingClientRect();return e.yt.defaultLineHeight*1.5){let a=t.viewState.heightOracle.textHeight,l=Math.floor((i-n.top-(t.defaultLineHeight-a)*.5)/a);o+=l*t.viewState.heightOracle.lineLength}let s=t.state.sliceDoc(n.from,n.to);return n.from+LQ(s,o,t.state.tabSize)}function Fhn(t,e,n){let r;if(t.nodeType!=3||e!=(r=t.nodeValue.length))return!1;for(let i=t.nextSibling;i;i=i.nextSibling)if(i.nodeType!=1||i.nodeName!="BR")return!1;return D1(t,r-1,r).getBoundingClientRect().left>n}function Nhn(t,e,n){if(e!=0)return!1;for(let i=t;;){let o=i.parentNode;if(!o||o.nodeType!=1||o.firstChild!=i)return!1;if(o.classList.contains("cm-line"))break;i=o}let r=t.nodeType==1?t.getBoundingClientRect():D1(t,0,Math.max(t.nodeValue.length,1)).getBoundingClientRect();return n-r.left>5}function KQ(t,e){let n=t.lineBlockAt(e);if(Array.isArray(n.type)){for(let r of n.type)if(r.to>e||r.to==e&&(r.to==n.to||r.type==ka.Text))return r}return n}function zhn(t,e,n,r){let i=KQ(t,e.head),o=!r||i.type!=ka.Text||!(t.lineWrapping||i.widgetLineBreaks)?null:t.coordsAtPos(e.assoc<0&&e.head>i.from?e.head-1:e.head);if(o){let s=t.dom.getBoundingClientRect(),a=t.textDirectionAt(i.from),l=t.posAtCoords({x:n==(a==ii.LTR)?s.right-1:s.left+1,y:(o.top+o.bottom)/2});if(l!=null)return Ve.cursor(l,n?-1:1)}return Ve.cursor(n?i.to:i.from,n?-1:1)}function J1e(t,e,n,r){let i=t.state.doc.lineAt(e.head),o=t.bidiSpans(i),s=t.textDirectionAt(i.from);for(let a=e,l=null;;){let c=Chn(i,o,s,a,n),u=r9e;if(!c){if(i.number==(n?t.state.doc.lines:1))return a;u=` -`,i=t.state.doc.line(i.number+(n?1:-1)),o=t.bidiSpans(i),c=t.visualLineSide(i,!n)}if(l){if(!l(u))return a}else{if(!r)return c;l=r(u)}a=c}}function jhn(t,e,n){let r=t.state.charCategorizer(e),i=r(n);return o=>{let s=r(o);return i==pi.Space&&(i=s),i==s}}function Bhn(t,e,n,r){let i=e.head,o=n?1:-1;if(i==(n?t.state.doc.length:0))return Ve.cursor(i,e.assoc);let s=e.goalColumn,a,l=t.contentDOM.getBoundingClientRect(),c=t.coordsAtPos(i,e.assoc||-1),u=t.documentTop;if(c)s==null&&(s=c.left-l.left),a=o<0?c.top:c.bottom;else{let h=t.viewState.lineBlockAt(i);s==null&&(s=Math.min(l.right-l.left,t.defaultCharacterWidth*(i-h.from))),a=(o<0?h.top:h.bottom)+u}let f=l.left+s,d=r??t.viewState.heightOracle.textHeight>>1;for(let h=0;;h+=10){let p=a+(d+h)*o,g=b9e(t,{x:f,y:p},!1,o);if(pl.bottom||(o<0?gi)){let m=t.docView.coordsForChar(g),v=!m||p{if(e>o&&ei(t)),n.from,e.head>n.from?-1:1);return r==n.from?n:Ve.cursor(r,ro)&&this.lineBreak(),i=s}return this.findPointBefore(r,n),this}readTextNode(e){let n=e.nodeValue;for(let r of this.points)r.node==e&&(r.pos=this.text.length+Math.min(r.offset,n.length));for(let r=0,i=this.lineSeparator?null:/\r\n?|\n/g;;){let o=-1,s=1,a;if(this.lineSeparator?(o=n.indexOf(this.lineSeparator,r),s=this.lineSeparator.length):(a=i.exec(n))&&(o=a.index,s=a[0].length),this.append(n.slice(r,o<0?n.length:o)),o<0)break;if(this.lineBreak(),s>1)for(let l of this.points)l.node==e&&l.pos>this.text.length&&(l.pos-=s-1);r=o+s}}readNode(e){if(e.cmIgnore)return;let n=Dr.get(e),r=n&&n.overrideDOMText;if(r!=null){this.findPointInside(e,r.length);for(let i=r.iter();!i.next().done;)i.lineBreak?this.lineBreak():this.append(i.value)}else e.nodeType==3?this.readTextNode(e):e.nodeName=="BR"?e.nextSibling&&this.lineBreak():e.nodeType==1&&this.readRange(e.firstChild,null)}findPointBefore(e,n){for(let r of this.points)r.node==e&&e.childNodes[r.offset]==n&&(r.pos=this.text.length)}findPointInside(e,n){for(let r of this.points)(e.nodeType==3?r.node==e:e.contains(r.node))&&(r.pos=this.text.length+(Whn(e,r.node,r.offset)?n:0))}}function Whn(t,e,n){for(;;){if(!e||n-1;let{impreciseHead:o,impreciseAnchor:s}=e.docView;if(e.state.readOnly&&n>-1)this.newSel=null;else if(n>-1&&(this.bounds=e.docView.domBoundsAround(n,r,0))){let a=o||s?[]:qhn(e),l=new Uhn(a,e.state);l.readRange(this.bounds.startDOM,this.bounds.endDOM),this.text=l.text,this.newSel=Xhn(a,this.bounds.from)}else{let a=e.observer.selectionRange,l=o&&o.node==a.focusNode&&o.offset==a.focusOffset||!NQ(e.contentDOM,a.focusNode)?e.state.selection.main.head:e.docView.posFromDOM(a.focusNode,a.focusOffset),c=s&&s.node==a.anchorNode&&s.offset==a.anchorOffset||!NQ(e.contentDOM,a.anchorNode)?e.state.selection.main.anchor:e.docView.posFromDOM(a.anchorNode,a.anchorOffset),u=e.viewport;if((St.ios||St.chrome)&&e.state.selection.main.empty&&l!=c&&(u.from>0||u.toDate.now()-100?t.inputState.lastKeyCode:-1;if(e.bounds){let{from:s,to:a}=e.bounds,l=i.from,c=null;(o===8||St.android&&e.text.length=i.from&&n.to<=i.to&&(n.from!=i.from||n.to!=i.to)&&i.to-i.from-(n.to-n.from)<=4?n={from:i.from,to:i.to,insert:t.state.doc.slice(i.from,n.from).append(n.insert).append(t.state.doc.slice(n.to,i.to))}:(St.mac||St.android)&&n&&n.from==n.to&&n.from==i.head-1&&/^\. ?$/.test(n.insert.toString())&&t.contentDOM.getAttribute("autocorrect")=="off"?(r&&n.insert.length==2&&(r=Ve.single(r.main.anchor-1,r.main.head-1)),n={from:i.from,to:i.to,insert:ar.of([" "])}):St.chrome&&n&&n.from==n.to&&n.from==i.head&&n.insert.toString()==` - `&&t.lineWrapping&&(r&&(r=Ve.single(r.main.anchor-1,r.main.head-1)),n={from:i.from,to:i.to,insert:ar.of([" "])}),n)return wle(t,n,r,o);if(r&&!r.main.eq(i)){let s=!1,a="select";return t.inputState.lastSelectionTime>Date.now()-50&&(t.inputState.lastSelectionOrigin=="select"&&(s=!0),a=t.inputState.lastSelectionOrigin),t.dispatch({selection:r,scrollIntoView:s,userEvent:a}),!0}else return!1}function wle(t,e,n,r=-1){if(St.ios&&t.inputState.flushIOSKey(e))return!0;let i=t.state.selection.main;if(St.android&&(e.to==i.to&&(e.from==i.from||e.from==i.from-1&&t.state.sliceDoc(e.from,i.from)==" ")&&e.insert.length==1&&e.insert.lines==2&&K_(t.contentDOM,"Enter",13)||(e.from==i.from-1&&e.to==i.to&&e.insert.length==0||r==8&&e.insert.lengthi.head)&&K_(t.contentDOM,"Backspace",8)||e.from==i.from&&e.to==i.to+1&&e.insert.length==0&&K_(t.contentDOM,"Delete",46)))return!0;let o=e.insert.toString();t.inputState.composing>=0&&t.inputState.composing++;let s,a=()=>s||(s=Ghn(t,e,n));return t.state.facet(l9e).some(l=>l(t,e.from,e.to,o,a))||t.dispatch(a()),!0}function Ghn(t,e,n){let r,i=t.state,o=i.selection.main;if(e.from>=o.from&&e.to<=o.to&&e.to-e.from>=(o.to-o.from)/3&&(!n||n.main.empty&&n.main.from==e.from+e.insert.length)&&t.inputState.composing<0){let a=o.frome.to?i.sliceDoc(e.to,o.to):"";r=i.replaceSelection(t.state.toText(a+e.insert.sliceString(0,void 0,t.state.lineBreak)+l))}else{let a=i.changes(e),l=n&&n.main.to<=a.newLength?n.main:void 0;if(i.selection.ranges.length>1&&t.inputState.composing>=0&&e.to<=o.to&&e.to>=o.to-10){let c=t.state.sliceDoc(e.from,e.to),u,f=n&&x9e(t,n.main.head);if(f){let p=e.insert.length-(e.to-e.from);u={from:f.from,to:f.to-p}}else u=t.state.doc.lineAt(o.head);let d=o.to-e.to,h=o.to-o.from;r=i.changeByRange(p=>{if(p.from==o.from&&p.to==o.to)return{changes:a,range:l||p.map(a)};let g=p.to-d,m=g-c.length;if(p.to-p.from!=h||t.state.sliceDoc(m,g)!=c||p.to>=u.from&&p.from<=u.to)return{range:p};let v=i.changes({from:m,to:g,insert:e.insert}),y=p.to-o.to;return{changes:v,range:l?Ve.range(Math.max(0,l.anchor+y),Math.max(0,l.head+y)):p.map(v)}})}else r={changes:a,selection:l&&i.selection.replaceRange(l)}}let s="input.type";return(t.composing||t.inputState.compositionPendingChange&&t.inputState.compositionEndedAt>Date.now()-50)&&(t.inputState.compositionPendingChange=!1,s+=".compose",t.inputState.compositionFirstChange&&(s+=".start",t.inputState.compositionFirstChange=!1)),i.update(r,{userEvent:s,scrollIntoView:!0})}function Hhn(t,e,n,r){let i=Math.min(t.length,e.length),o=0;for(;o0&&a>0&&t.charCodeAt(s-1)==e.charCodeAt(a-1);)s--,a--;if(r=="end"){let l=Math.max(0,o-Math.min(s,a));n-=s+l-o}if(s=s?o-n:0;o-=l,a=o+(a-s),s=o}else if(a=a?o-n:0;o-=l,s=o+(s-a),a=o}return{from:o,toA:s,toB:a}}function qhn(t){let e=[];if(t.root.activeElement!=t.contentDOM)return e;let{anchorNode:n,anchorOffset:r,focusNode:i,focusOffset:o}=t.observer.selectionRange;return n&&(e.push(new ebe(n,r)),(i!=n||o!=r)&&e.push(new ebe(i,o))),e}function Xhn(t,e){if(t.length==0)return null;let n=t[0].pos,r=t.length==2?t[1].pos:n;return n>-1&&r>-1?Ve.single(n+e,r+e):null}class Yhn{setSelectionOrigin(e){this.lastSelectionOrigin=e,this.lastSelectionTime=Date.now()}constructor(e){this.view=e,this.lastKeyCode=0,this.lastKeyTime=0,this.lastTouchTime=0,this.lastFocusTime=0,this.lastScrollTop=0,this.lastScrollLeft=0,this.pendingIOSKey=void 0,this.tabFocusMode=-1,this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastContextMenu=0,this.scrollHandlers=[],this.handlers=Object.create(null),this.composing=-1,this.compositionFirstChange=null,this.compositionEndedAt=0,this.compositionPendingKey=!1,this.compositionPendingChange=!1,this.mouseSelection=null,this.draggedContent=null,this.handleEvent=this.handleEvent.bind(this),this.notifiedFocused=e.hasFocus,St.safari&&e.contentDOM.addEventListener("input",()=>null),St.gecko&&fpn(e.contentDOM.ownerDocument)}handleEvent(e){!rpn(this.view,e)||this.ignoreDuringComposition(e)||e.type=="keydown"&&this.keydown(e)||this.runHandlers(e.type,e)}runHandlers(e,n){let r=this.handlers[e];if(r){for(let i of r.observers)i(this.view,n);for(let i of r.handlers){if(n.defaultPrevented)break;if(i(this.view,n)){n.preventDefault();break}}}}ensureHandlers(e){let n=Qhn(e),r=this.handlers,i=this.view.contentDOM;for(let o in n)if(o!="scroll"){let s=!n[o].handlers.length,a=r[o];a&&s!=!a.handlers.length&&(i.removeEventListener(o,this.handleEvent),a=null),a||i.addEventListener(o,this.handleEvent,{passive:s})}for(let o in r)o!="scroll"&&!n[o]&&i.removeEventListener(o,this.handleEvent);this.handlers=n}keydown(e){if(this.lastKeyCode=e.keyCode,this.lastKeyTime=Date.now(),e.keyCode==9&&this.tabFocusMode>-1&&(!this.tabFocusMode||Date.now()<=this.tabFocusMode))return!0;if(this.tabFocusMode>0&&e.keyCode!=27&&S9e.indexOf(e.keyCode)<0&&(this.tabFocusMode=-1),St.android&&St.chrome&&!e.synthetic&&(e.keyCode==13||e.keyCode==8))return this.view.observer.delayAndroidKey(e.key,e.keyCode),!0;let n;return St.ios&&!e.synthetic&&!e.altKey&&!e.metaKey&&((n=_9e.find(r=>r.keyCode==e.keyCode))&&!e.ctrlKey||Khn.indexOf(e.key)>-1&&e.ctrlKey&&!e.shiftKey)?(this.pendingIOSKey=n||e,setTimeout(()=>this.flushIOSKey(),250),!0):(e.keyCode!=229&&this.view.observer.forceFlush(),!1)}flushIOSKey(e){let n=this.pendingIOSKey;return!n||n.key=="Enter"&&e&&e.from0?!0:St.safari&&!St.ios&&this.compositionPendingKey&&Date.now()-this.compositionEndedAt<100?(this.compositionPendingKey=!1,!0):!1:!1}startMouseSelection(e){this.mouseSelection&&this.mouseSelection.destroy(),this.mouseSelection=e}update(e){this.view.observer.update(e),this.mouseSelection&&this.mouseSelection.update(e),this.draggedContent&&e.docChanged&&(this.draggedContent=this.draggedContent.map(e.changes)),e.transactions.length&&(this.lastKeyCode=this.lastSelectionTime=0)}destroy(){this.mouseSelection&&this.mouseSelection.destroy()}}function tbe(t,e){return(n,r)=>{try{return e.call(t,r,n)}catch(i){ll(n.state,i)}}}function Qhn(t){let e=Object.create(null);function n(r){return e[r]||(e[r]={observers:[],handlers:[]})}for(let r of t){let i=r.spec;if(i&&i.domEventHandlers)for(let o in i.domEventHandlers){let s=i.domEventHandlers[o];s&&n(o).handlers.push(tbe(r.value,s))}if(i&&i.domEventObservers)for(let o in i.domEventObservers){let s=i.domEventObservers[o];s&&n(o).observers.push(tbe(r.value,s))}}for(let r in Kf)n(r).handlers.push(Kf[r]);for(let r in Iu)n(r).observers.push(Iu[r]);return e}const _9e=[{key:"Backspace",keyCode:8,inputType:"deleteContentBackward"},{key:"Enter",keyCode:13,inputType:"insertParagraph"},{key:"Enter",keyCode:13,inputType:"insertLineBreak"},{key:"Delete",keyCode:46,inputType:"deleteContentForward"}],Khn="dthko",S9e=[16,17,18,20,91,92,224,225],PL=6;function ML(t){return Math.max(0,t)*.7+8}function Zhn(t,e){return Math.max(Math.abs(t.clientX-e.clientX),Math.abs(t.clientY-e.clientY))}class Jhn{constructor(e,n,r,i){this.view=e,this.startEvent=n,this.style=r,this.mustSelect=i,this.scrollSpeed={x:0,y:0},this.scrolling=-1,this.lastEvent=n,this.scrollParents=lhn(e.contentDOM),this.atoms=e.state.facet(ble).map(s=>s(e));let o=e.contentDOM.ownerDocument;o.addEventListener("mousemove",this.move=this.move.bind(this)),o.addEventListener("mouseup",this.up=this.up.bind(this)),this.extend=n.shiftKey,this.multiple=e.state.facet(In.allowMultipleSelections)&&epn(e,n),this.dragging=npn(e,n)&&E9e(n)==1?null:!1}start(e){this.dragging===!1&&this.select(e)}move(e){if(e.buttons==0)return this.destroy();if(this.dragging||this.dragging==null&&Zhn(this.startEvent,e)<10)return;this.select(this.lastEvent=e);let n=0,r=0,i=0,o=0,s=this.view.win.innerWidth,a=this.view.win.innerHeight;this.scrollParents.x&&({left:i,right:s}=this.scrollParents.x.getBoundingClientRect()),this.scrollParents.y&&({top:o,bottom:a}=this.scrollParents.y.getBoundingClientRect());let l=y9e(this.view);e.clientX-l.left<=i+PL?n=-ML(i-e.clientX):e.clientX+l.right>=s-PL&&(n=ML(e.clientX-s)),e.clientY-l.top<=o+PL?r=-ML(o-e.clientY):e.clientY+l.bottom>=a-PL&&(r=ML(e.clientY-a)),this.setScrollSpeed(n,r)}up(e){this.dragging==null&&this.select(this.lastEvent),this.dragging||e.preventDefault(),this.destroy()}destroy(){this.setScrollSpeed(0,0);let e=this.view.contentDOM.ownerDocument;e.removeEventListener("mousemove",this.move),e.removeEventListener("mouseup",this.up),this.view.inputState.mouseSelection=this.view.inputState.draggedContent=null}setScrollSpeed(e,n){this.scrollSpeed={x:e,y:n},e||n?this.scrolling<0&&(this.scrolling=setInterval(()=>this.scroll(),50)):this.scrolling>-1&&(clearInterval(this.scrolling),this.scrolling=-1)}scroll(){let{x:e,y:n}=this.scrollSpeed;e&&this.scrollParents.x&&(this.scrollParents.x.scrollLeft+=e,e=0),n&&this.scrollParents.y&&(this.scrollParents.y.scrollTop+=n,n=0),(e||n)&&this.view.win.scrollBy(e,n),this.dragging===!1&&this.select(this.lastEvent)}skipAtoms(e){let n=null;for(let r=0;rn.isUserEvent("input.type"))?this.destroy():this.style.update(e)&&setTimeout(()=>this.select(this.lastEvent),20)}}function epn(t,e){let n=t.state.facet(i9e);return n.length?n[0](e):St.mac?e.metaKey:e.ctrlKey}function tpn(t,e){let n=t.state.facet(o9e);return n.length?n[0](e):St.mac?!e.altKey:!e.ctrlKey}function npn(t,e){let{main:n}=t.state.selection;if(n.empty)return!1;let r=uP(t.root);if(!r||r.rangeCount==0)return!0;let i=r.getRangeAt(0).getClientRects();for(let o=0;o=e.clientX&&s.top<=e.clientY&&s.bottom>=e.clientY)return!0}return!1}function rpn(t,e){if(!e.bubbles)return!0;if(e.defaultPrevented)return!1;for(let n=e.target,r;n!=t.contentDOM;n=n.parentNode)if(!n||n.nodeType==11||(r=Dr.get(n))&&r.ignoreEvent(e))return!1;return!0}const Kf=Object.create(null),Iu=Object.create(null),C9e=St.ie&&St.ie_version<15||St.ios&&St.webkit_version<604;function ipn(t){let e=t.dom.parentNode;if(!e)return;let n=e.appendChild(document.createElement("textarea"));n.style.cssText="position: fixed; left: -10000px; top: 10px",n.focus(),setTimeout(()=>{t.focus(),n.remove(),O9e(t,n.value)},50)}function O9e(t,e){let{state:n}=t,r,i=1,o=n.toText(e),s=o.lines==n.selection.ranges.length;if(ZQ!=null&&n.selection.ranges.every(l=>l.empty)&&ZQ==o.toString()){let l=-1;r=n.changeByRange(c=>{let u=n.doc.lineAt(c.from);if(u.from==l)return{range:c};l=u.from;let f=n.toText((s?o.line(i++).text:e)+n.lineBreak);return{changes:{from:u.from,insert:f},range:Ve.cursor(c.from+f.length)}})}else s?r=n.changeByRange(l=>{let c=o.line(i++);return{changes:{from:l.from,to:l.to,insert:c.text},range:Ve.cursor(l.from+c.length)}}):r=n.replaceSelection(o);t.dispatch(r,{userEvent:"input.paste",scrollIntoView:!0})}Iu.scroll=t=>{t.inputState.lastScrollTop=t.scrollDOM.scrollTop,t.inputState.lastScrollLeft=t.scrollDOM.scrollLeft};Kf.keydown=(t,e)=>(t.inputState.setSelectionOrigin("select"),e.keyCode==27&&t.inputState.tabFocusMode!=0&&(t.inputState.tabFocusMode=Date.now()+2e3),!1);Iu.touchstart=(t,e)=>{t.inputState.lastTouchTime=Date.now(),t.inputState.setSelectionOrigin("select.pointer")};Iu.touchmove=t=>{t.inputState.setSelectionOrigin("select.pointer")};Kf.mousedown=(t,e)=>{if(t.observer.flush(),t.inputState.lastTouchTime>Date.now()-2e3)return!1;let n=null;for(let r of t.state.facet(s9e))if(n=r(t,e),n)break;if(!n&&e.button==0&&(n=apn(t,e)),n){let r=!t.hasFocus;t.inputState.startMouseSelection(new Jhn(t,e,n,r)),r&&t.observer.ignore(()=>{zVe(t.contentDOM);let o=t.root.activeElement;o&&!o.contains(t.contentDOM)&&o.blur()});let i=t.inputState.mouseSelection;if(i)return i.start(e),i.dragging===!1}return!1};function nbe(t,e,n,r){if(r==1)return Ve.cursor(e,n);if(r==2)return Ihn(t.state,e,n);{let i=ro.find(t.docView,e),o=t.state.doc.lineAt(i?i.posAtEnd:e),s=i?i.posAtStart:o.from,a=i?i.posAtEnd:o.to;return ae>=n.top&&e<=n.bottom&&t>=n.left&&t<=n.right;function opn(t,e,n,r){let i=ro.find(t.docView,e);if(!i)return 1;let o=e-i.posAtStart;if(o==0)return 1;if(o==i.length)return-1;let s=i.coordsAt(o,-1);if(s&&rbe(n,r,s))return-1;let a=i.coordsAt(o,1);return a&&rbe(n,r,a)?1:s&&s.bottom>=r?-1:1}function ibe(t,e){let n=t.posAtCoords({x:e.clientX,y:e.clientY},!1);return{pos:n,bias:opn(t,n,e.clientX,e.clientY)}}const spn=St.ie&&St.ie_version<=11;let obe=null,sbe=0,abe=0;function E9e(t){if(!spn)return t.detail;let e=obe,n=abe;return obe=t,abe=Date.now(),sbe=!e||n>Date.now()-400&&Math.abs(e.clientX-t.clientX)<2&&Math.abs(e.clientY-t.clientY)<2?(sbe+1)%3:1}function apn(t,e){let n=ibe(t,e),r=E9e(e),i=t.state.selection;return{update(o){o.docChanged&&(n.pos=o.changes.mapPos(n.pos),i=i.map(o.changes))},get(o,s,a){let l=ibe(t,o),c,u=nbe(t,l.pos,l.bias,r);if(n.pos!=l.pos&&!s){let f=nbe(t,n.pos,n.bias,r),d=Math.min(f.from,u.from),h=Math.max(f.to,u.to);u=d1&&(c=lpn(i,l.pos))?c:a?i.addRange(u):Ve.create([u])}}}function lpn(t,e){for(let n=0;n=e)return Ve.create(t.ranges.slice(0,n).concat(t.ranges.slice(n+1)),t.mainIndex==n?0:t.mainIndex-(t.mainIndex>n?1:0))}return null}Kf.dragstart=(t,e)=>{let{selection:{main:n}}=t.state;if(e.target.draggable){let i=t.docView.nearest(e.target);if(i&&i.isWidget){let o=i.posAtStart,s=o+i.length;(o>=n.to||s<=n.from)&&(n=Ve.range(o,s))}}let{inputState:r}=t;return r.mouseSelection&&(r.mouseSelection.dragging=!0),r.draggedContent=n,e.dataTransfer&&(e.dataTransfer.setData("Text",t.state.sliceDoc(n.from,n.to)),e.dataTransfer.effectAllowed="copyMove"),!1};Kf.dragend=t=>(t.inputState.draggedContent=null,!1);function lbe(t,e,n,r){if(!n)return;let i=t.posAtCoords({x:e.clientX,y:e.clientY},!1),{draggedContent:o}=t.inputState,s=r&&o&&tpn(t,e)?{from:o.from,to:o.to}:null,a={from:i,insert:n},l=t.state.changes(s?[s,a]:a);t.focus(),t.dispatch({changes:l,selection:{anchor:l.mapPos(i,-1),head:l.mapPos(i,1)},userEvent:s?"move.drop":"input.drop"}),t.inputState.draggedContent=null}Kf.drop=(t,e)=>{if(!e.dataTransfer)return!1;if(t.state.readOnly)return!0;let n=e.dataTransfer.files;if(n&&n.length){let r=Array(n.length),i=0,o=()=>{++i==n.length&&lbe(t,e,r.filter(s=>s!=null).join(t.state.lineBreak),!1)};for(let s=0;s{/[\x00-\x08\x0e-\x1f]{2}/.test(a.result)||(r[s]=a.result),o()},a.readAsText(n[s])}return!0}else{let r=e.dataTransfer.getData("Text");if(r)return lbe(t,e,r,!0),!0}return!1};Kf.paste=(t,e)=>{if(t.state.readOnly)return!0;t.observer.flush();let n=C9e?null:e.clipboardData;return n?(O9e(t,n.getData("text/plain")||n.getData("text/uri-list")),!0):(ipn(t),!1)};function cpn(t,e){let n=t.dom.parentNode;if(!n)return;let r=n.appendChild(document.createElement("textarea"));r.style.cssText="position: fixed; left: -10000px; top: 10px",r.value=e,r.focus(),r.selectionEnd=e.length,r.selectionStart=0,setTimeout(()=>{r.remove(),t.focus()},50)}function upn(t){let e=[],n=[],r=!1;for(let i of t.selection.ranges)i.empty||(e.push(t.sliceDoc(i.from,i.to)),n.push(i));if(!e.length){let i=-1;for(let{from:o}of t.selection.ranges){let s=t.doc.lineAt(o);s.number>i&&(e.push(s.text),n.push({from:s.from,to:Math.min(t.doc.length,s.to+1)})),i=s.number}r=!0}return{text:e.join(t.lineBreak),ranges:n,linewise:r}}let ZQ=null;Kf.copy=Kf.cut=(t,e)=>{let{text:n,ranges:r,linewise:i}=upn(t.state);if(!n&&!i)return!1;ZQ=i?n:null,e.type=="cut"&&!t.state.readOnly&&t.dispatch({changes:r,scrollIntoView:!0,userEvent:"delete.cut"});let o=C9e?null:e.clipboardData;return o?(o.clearData(),o.setData("text/plain",n),!0):(cpn(t,n),!1)};const T9e=Jh.define();function k9e(t,e){let n=[];for(let r of t.facet(c9e)){let i=r(t,e);i&&n.push(i)}return n?t.update({effects:n,annotations:T9e.of(!0)}):null}function A9e(t){setTimeout(()=>{let e=t.hasFocus;if(e!=t.inputState.notifiedFocused){let n=k9e(t.state,e);n?t.dispatch(n):t.update([])}},10)}Iu.focus=t=>{t.inputState.lastFocusTime=Date.now(),!t.scrollDOM.scrollTop&&(t.inputState.lastScrollTop||t.inputState.lastScrollLeft)&&(t.scrollDOM.scrollTop=t.inputState.lastScrollTop,t.scrollDOM.scrollLeft=t.inputState.lastScrollLeft),A9e(t)};Iu.blur=t=>{t.observer.clearSelectionRange(),A9e(t)};Iu.compositionstart=Iu.compositionupdate=t=>{t.observer.editContext||(t.inputState.compositionFirstChange==null&&(t.inputState.compositionFirstChange=!0),t.inputState.composing<0&&(t.inputState.composing=0))};Iu.compositionend=t=>{t.observer.editContext||(t.inputState.composing=-1,t.inputState.compositionEndedAt=Date.now(),t.inputState.compositionPendingKey=!0,t.inputState.compositionPendingChange=t.observer.pendingRecords().length>0,t.inputState.compositionFirstChange=null,St.chrome&&St.android?t.observer.flushSoon():t.inputState.compositionPendingChange?Promise.resolve().then(()=>t.observer.flush()):setTimeout(()=>{t.inputState.composing<0&&t.docView.hasComposition&&t.update([])},50))};Iu.contextmenu=t=>{t.inputState.lastContextMenu=Date.now()};Kf.beforeinput=(t,e)=>{var n,r;if(e.inputType=="insertReplacementText"&&t.observer.editContext){let o=(n=e.dataTransfer)===null||n===void 0?void 0:n.getData("text/plain"),s=e.getTargetRanges();if(o&&s.length){let a=s[0],l=t.posAtDOM(a.startContainer,a.startOffset),c=t.posAtDOM(a.endContainer,a.endOffset);return wle(t,{from:l,to:c,insert:t.state.toText(o)},null),!0}}let i;if(St.chrome&&St.android&&(i=_9e.find(o=>o.inputType==e.inputType))&&(t.observer.delayAndroidKey(i.key,i.keyCode),i.key=="Backspace"||i.key=="Delete")){let o=((r=window.visualViewport)===null||r===void 0?void 0:r.height)||0;setTimeout(()=>{var s;(((s=window.visualViewport)===null||s===void 0?void 0:s.height)||0)>o+10&&t.hasFocus&&(t.contentDOM.blur(),t.focus())},100)}return St.ios&&e.inputType=="deleteContentForward"&&t.observer.flushSoon(),St.safari&&e.inputType=="insertText"&&t.inputState.composing>=0&&setTimeout(()=>Iu.compositionend(t,e),20),!1};const cbe=new Set;function fpn(t){cbe.has(t)||(cbe.add(t),t.addEventListener("copy",()=>{}),t.addEventListener("cut",()=>{}))}const ube=["pre-wrap","normal","pre-line","break-spaces"];let bC=!1;function fbe(){bC=!1}class dpn{constructor(e){this.lineWrapping=e,this.doc=ar.empty,this.heightSamples={},this.lineHeight=14,this.charWidth=7,this.textHeight=14,this.lineLength=30}heightForGap(e,n){let r=this.doc.lineAt(n).number-this.doc.lineAt(e).number+1;return this.lineWrapping&&(r+=Math.max(0,Math.ceil((n-e-r*this.lineLength*.5)/this.lineLength))),this.lineHeight*r}heightForLine(e){return this.lineWrapping?(1+Math.max(0,Math.ceil((e-this.lineLength)/(this.lineLength-5))))*this.lineHeight:this.lineHeight}setDoc(e){return this.doc=e,this}mustRefreshForWrapping(e){return ube.indexOf(e)>-1!=this.lineWrapping}mustRefreshForHeights(e){let n=!1;for(let r=0;r-1,l=Math.round(n)!=Math.round(this.lineHeight)||this.lineWrapping!=a;if(this.lineWrapping=a,this.lineHeight=n,this.charWidth=r,this.textHeight=i,this.lineLength=o,l){this.heightSamples={};for(let c=0;c0}set outdated(e){this.flags=(e?2:0)|this.flags&-3}setHeight(e){this.height!=e&&(Math.abs(this.height-e)>G3&&(bC=!0),this.height=e)}replace(e,n,r){return Aa.of(r)}decomposeLeft(e,n){n.push(this)}decomposeRight(e,n){n.push(this)}applyChanges(e,n,r,i){let o=this,s=r.doc;for(let a=i.length-1;a>=0;a--){let{fromA:l,toA:c,fromB:u,toB:f}=i[a],d=o.lineAt(l,Yr.ByPosNoHeight,r.setDoc(n),0,0),h=d.to>=c?d:o.lineAt(c,Yr.ByPosNoHeight,r,0,0);for(f+=h.to-c,c=h.to;a>0&&d.from<=i[a-1].toA;)l=i[a-1].fromA,u=i[a-1].fromB,a--,lo*2){let a=e[n-1];a.break?e.splice(--n,1,a.left,null,a.right):e.splice(--n,1,a.left,a.right),r+=1+a.break,i-=a.size}else if(o>i*2){let a=e[r];a.break?e.splice(r,1,a.left,null,a.right):e.splice(r,1,a.left,a.right),r+=2+a.break,o-=a.size}else break;else if(i=o&&s(this.blockAt(0,r,i,o))}updateHeight(e,n=0,r=!1,i){return i&&i.from<=n&&i.more&&this.setHeight(i.heights[i.index++]),this.outdated=!1,this}toString(){return`block(${this.length})`}}class Ql extends P9e{constructor(e,n){super(e,n,null),this.collapsed=0,this.widgetHeight=0,this.breaks=0}blockAt(e,n,r,i){return new Yd(i,this.length,r,this.height,this.breaks)}replace(e,n,r){let i=r[0];return r.length==1&&(i instanceof Ql||i instanceof ts&&i.flags&4)&&Math.abs(this.length-i.length)<10?(i instanceof ts?i=new Ql(i.length,this.height):i.height=this.height,this.outdated||(i.outdated=!1),i):Aa.of(r)}updateHeight(e,n=0,r=!1,i){return i&&i.from<=n&&i.more?this.setHeight(i.heights[i.index++]):(r||this.outdated)&&this.setHeight(Math.max(this.widgetHeight,e.heightForLine(this.length-this.collapsed))+this.breaks*e.lineHeight),this.outdated=!1,this}toString(){return`line(${this.length}${this.collapsed?-this.collapsed:""}${this.widgetHeight?":"+this.widgetHeight:""})`}}class ts extends Aa{constructor(e){super(e,0)}heightMetrics(e,n){let r=e.doc.lineAt(n).number,i=e.doc.lineAt(n+this.length).number,o=i-r+1,s,a=0;if(e.lineWrapping){let l=Math.min(this.height,e.lineHeight*o);s=l/o,this.length>o+1&&(a=(this.height-l)/(this.length-o-1))}else s=this.height/o;return{firstLine:r,lastLine:i,perLine:s,perChar:a}}blockAt(e,n,r,i){let{firstLine:o,lastLine:s,perLine:a,perChar:l}=this.heightMetrics(n,i);if(n.lineWrapping){let c=i+(e0){let o=r[r.length-1];o instanceof ts?r[r.length-1]=new ts(o.length+i):r.push(null,new ts(i-1))}if(e>0){let o=r[0];o instanceof ts?r[0]=new ts(e+o.length):r.unshift(new ts(e-1),null)}return Aa.of(r)}decomposeLeft(e,n){n.push(new ts(e-1),null)}decomposeRight(e,n){n.push(null,new ts(this.length-e-1))}updateHeight(e,n=0,r=!1,i){let o=n+this.length;if(i&&i.from<=n+this.length&&i.more){let s=[],a=Math.max(n,i.from),l=-1;for(i.from>n&&s.push(new ts(i.from-n-1).updateHeight(e,n));a<=o&&i.more;){let u=e.doc.lineAt(a).length;s.length&&s.push(null);let f=i.heights[i.index++];l==-1?l=f:Math.abs(f-l)>=G3&&(l=-2);let d=new Ql(u,f);d.outdated=!1,s.push(d),a+=u+1}a<=o&&s.push(null,new ts(o-a).updateHeight(e,a));let c=Aa.of(s);return(l<0||Math.abs(c.height-this.height)>=G3||Math.abs(l-this.heightMetrics(e,n).perLine)>=G3)&&(bC=!0),sz(this,c)}else(r||this.outdated)&&(this.setHeight(e.heightForGap(n,n+this.length)),this.outdated=!1);return this}toString(){return`gap(${this.length})`}}class ppn extends Aa{constructor(e,n,r){super(e.length+n+r.length,e.height+r.height,n|(e.outdated||r.outdated?2:0)),this.left=e,this.right=r,this.size=e.size+r.size}get break(){return this.flags&1}blockAt(e,n,r,i){let o=r+this.left.height;return ea))return c;let u=n==Yr.ByPosNoHeight?Yr.ByPosNoHeight:Yr.ByPos;return l?c.join(this.right.lineAt(a,u,r,s,a)):this.left.lineAt(a,u,r,i,o).join(c)}forEachLine(e,n,r,i,o,s){let a=i+this.left.height,l=o+this.left.length+this.break;if(this.break)e=l&&this.right.forEachLine(e,n,r,a,l,s);else{let c=this.lineAt(l,Yr.ByPos,r,i,o);e=e&&c.from<=n&&s(c),n>c.to&&this.right.forEachLine(c.to+1,n,r,a,l,s)}}replace(e,n,r){let i=this.left.length+this.break;if(nthis.left.length)return this.balanced(this.left,this.right.replace(e-i,n-i,r));let o=[];e>0&&this.decomposeLeft(e,o);let s=o.length;for(let a of r)o.push(a);if(e>0&&dbe(o,s-1),n=r&&n.push(null)),e>r&&this.right.decomposeLeft(e-r,n)}decomposeRight(e,n){let r=this.left.length,i=r+this.break;if(e>=i)return this.right.decomposeRight(e-i,n);e2*n.size||n.size>2*e.size?Aa.of(this.break?[e,null,n]:[e,n]):(this.left=sz(this.left,e),this.right=sz(this.right,n),this.setHeight(e.height+n.height),this.outdated=e.outdated||n.outdated,this.size=e.size+n.size,this.length=e.length+this.break+n.length,this)}updateHeight(e,n=0,r=!1,i){let{left:o,right:s}=this,a=n+o.length+this.break,l=null;return i&&i.from<=n+o.length&&i.more?l=o=o.updateHeight(e,n,r,i):o.updateHeight(e,n,r),i&&i.from<=a+s.length&&i.more?l=s=s.updateHeight(e,a,r,i):s.updateHeight(e,a,r),l?this.balanced(o,s):(this.height=this.left.height+this.right.height,this.outdated=!1,this)}toString(){return this.left+(this.break?" ":"-")+this.right}}function dbe(t,e){let n,r;t[e]==null&&(n=t[e-1])instanceof ts&&(r=t[e+1])instanceof ts&&t.splice(e-1,3,new ts(n.length+1+r.length))}const gpn=5;class _le{constructor(e,n){this.pos=e,this.oracle=n,this.nodes=[],this.lineStart=-1,this.lineEnd=-1,this.covering=null,this.writtenTo=e}get isCovered(){return this.covering&&this.nodes[this.nodes.length-1]==this.covering}span(e,n){if(this.lineStart>-1){let r=Math.min(n,this.lineEnd),i=this.nodes[this.nodes.length-1];i instanceof Ql?i.length+=r-this.pos:(r>this.pos||!this.isCovered)&&this.nodes.push(new Ql(r-this.pos,-1)),this.writtenTo=r,n>r&&(this.nodes.push(null),this.writtenTo++,this.lineStart=-1)}this.pos=n}point(e,n,r){if(e=gpn)&&this.addLineDeco(i,o,s)}else n>e&&this.span(e,n);this.lineEnd>-1&&this.lineEnd-1)return;let{from:e,to:n}=this.oracle.doc.lineAt(this.pos);this.lineStart=e,this.lineEnd=n,this.writtenToe&&this.nodes.push(new Ql(this.pos-e,-1)),this.writtenTo=this.pos}blankContent(e,n){let r=new ts(n-e);return this.oracle.doc.lineAt(e).to==n&&(r.flags|=4),r}ensureLine(){this.enterLine();let e=this.nodes.length?this.nodes[this.nodes.length-1]:null;if(e instanceof Ql)return e;let n=new Ql(0,-1);return this.nodes.push(n),n}addBlock(e){this.enterLine();let n=e.deco;n&&n.startSide>0&&!this.isCovered&&this.ensureLine(),this.nodes.push(e),this.writtenTo=this.pos=this.pos+e.length,n&&n.endSide>0&&(this.covering=e)}addLineDeco(e,n,r){let i=this.ensureLine();i.length+=r,i.collapsed+=r,i.widgetHeight=Math.max(i.widgetHeight,e),i.breaks+=n,this.writtenTo=this.pos=this.pos+r}finish(e){let n=this.nodes.length==0?null:this.nodes[this.nodes.length-1];this.lineStart>-1&&!(n instanceof Ql)&&!this.isCovered?this.nodes.push(new Ql(0,-1)):(this.writtenTou.clientHeight||u.scrollWidth>u.clientWidth)&&f.overflow!="visible"){let d=u.getBoundingClientRect();o=Math.max(o,d.left),s=Math.min(s,d.right),a=Math.max(a,d.top),l=Math.min(c==t.parentNode?i.innerHeight:l,d.bottom)}c=f.position=="absolute"||f.position=="fixed"?u.offsetParent:u.parentNode}else if(c.nodeType==11)c=c.host;else break;return{left:o-n.left,right:Math.max(o,s)-n.left,top:a-(n.top+e),bottom:Math.max(a,l)-(n.top+e)}}function xpn(t,e){let n=t.getBoundingClientRect();return{left:0,right:n.right-n.left,top:e,bottom:n.bottom-(n.top+e)}}class H9{constructor(e,n,r){this.from=e,this.to=n,this.size=r}static same(e,n){if(e.length!=n.length)return!1;for(let r=0;rtypeof r!="function"&&r.class=="cm-lineWrapping");this.heightOracle=new dpn(n),this.stateDeco=e.facet(fP).filter(r=>typeof r!="function"),this.heightMap=Aa.empty().applyChanges(this.stateDeco,ar.empty,this.heightOracle.setDoc(e.doc),[new mu(0,0,0,e.doc.length)]);for(let r=0;r<2&&(this.viewport=this.getViewport(0,null),!!this.updateForViewport());r++);this.updateViewportLines(),this.lineGaps=this.ensureLineGaps([]),this.lineGapDeco=It.set(this.lineGaps.map(r=>r.draw(this,!1))),this.computeVisibleRanges()}updateForViewport(){let e=[this.viewport],{main:n}=this.state.selection;for(let r=0;r<=1;r++){let i=r?n.head:n.anchor;if(!e.some(({from:o,to:s})=>i>=o&&i<=s)){let{from:o,to:s}=this.lineBlockAt(i);e.push(new RL(o,s))}}return this.viewports=e.sort((r,i)=>r.from-i.from),this.updateScaler()}updateScaler(){let e=this.scaler;return this.scaler=this.heightMap.height<=7e6?pbe:new Sle(this.heightOracle,this.heightMap,this.viewports),e.eq(this.scaler)?0:2}updateViewportLines(){this.viewportLines=[],this.heightMap.forEachLine(this.viewport.from,this.viewport.to,this.heightOracle.setDoc(this.state.doc),0,0,e=>{this.viewportLines.push(RT(e,this.scaler))})}update(e,n=null){this.state=e.state;let r=this.stateDeco;this.stateDeco=this.state.facet(fP).filter(u=>typeof u!="function");let i=e.changedRanges,o=mu.extendWithRanges(i,mpn(r,this.stateDeco,e?e.changes:vo.empty(this.state.doc.length))),s=this.heightMap.height,a=this.scrolledToBottom?null:this.scrollAnchorAt(this.scrollTop);fbe(),this.heightMap=this.heightMap.applyChanges(this.stateDeco,e.startState.doc,this.heightOracle.setDoc(this.state.doc),o),(this.heightMap.height!=s||bC)&&(e.flags|=2),a?(this.scrollAnchorPos=e.changes.mapPos(a.from,-1),this.scrollAnchorHeight=a.top):(this.scrollAnchorPos=-1,this.scrollAnchorHeight=this.heightMap.height);let l=o.length?this.mapViewport(this.viewport,e.changes):this.viewport;(n&&(n.range.headl.to)||!this.viewportIsAppropriate(l))&&(l=this.getViewport(0,n));let c=l.from!=this.viewport.from||l.to!=this.viewport.to;this.viewport=l,e.flags|=this.updateForViewport(),(c||!e.changes.empty||e.flags&2)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(this.mapLineGaps(this.lineGaps,e.changes))),e.flags|=this.computeVisibleRanges(),n&&(this.scrollTarget=n),!this.mustEnforceCursorAssoc&&e.selectionSet&&e.view.lineWrapping&&e.state.selection.main.empty&&e.state.selection.main.assoc&&!e.state.facet(f9e)&&(this.mustEnforceCursorAssoc=!0)}measure(e){let n=e.contentDOM,r=window.getComputedStyle(n),i=this.heightOracle,o=r.whiteSpace;this.defaultTextDirection=r.direction=="rtl"?ii.RTL:ii.LTR;let s=this.heightOracle.mustRefreshForWrapping(o),a=n.getBoundingClientRect(),l=s||this.mustMeasureContent||this.contentDOMHeight!=a.height;this.contentDOMHeight=a.height,this.mustMeasureContent=!1;let c=0,u=0;if(a.width&&a.height){let{scaleX:b,scaleY:w}=NVe(n,a);(b>.005&&Math.abs(this.scaleX-b)>.005||w>.005&&Math.abs(this.scaleY-w)>.005)&&(this.scaleX=b,this.scaleY=w,c|=8,s=l=!0)}let f=(parseInt(r.paddingTop)||0)*this.scaleY,d=(parseInt(r.paddingBottom)||0)*this.scaleY;(this.paddingTop!=f||this.paddingBottom!=d)&&(this.paddingTop=f,this.paddingBottom=d,c|=10),this.editorWidth!=e.scrollDOM.clientWidth&&(i.lineWrapping&&(l=!0),this.editorWidth=e.scrollDOM.clientWidth,c|=8);let h=e.scrollDOM.scrollTop*this.scaleY;this.scrollTop!=h&&(this.scrollAnchorHeight=-1,this.scrollTop=h),this.scrolledToBottom=BVe(e.scrollDOM);let p=(this.printing?xpn:ypn)(n,this.paddingTop),g=p.top-this.pixelViewport.top,m=p.bottom-this.pixelViewport.bottom;this.pixelViewport=p;let v=this.pixelViewport.bottom>this.pixelViewport.top&&this.pixelViewport.right>this.pixelViewport.left;if(v!=this.inView&&(this.inView=v,v&&(l=!0)),!this.inView&&!this.scrollTarget)return 0;let y=a.width;if((this.contentDOMWidth!=y||this.editorHeight!=e.scrollDOM.clientHeight)&&(this.contentDOMWidth=a.width,this.editorHeight=e.scrollDOM.clientHeight,c|=8),l){let b=e.docView.measureVisibleLineHeights(this.viewport);if(i.mustRefreshForHeights(b)&&(s=!0),s||i.lineWrapping&&Math.abs(y-this.contentDOMWidth)>i.charWidth){let{lineHeight:w,charWidth:_,textHeight:S}=e.docView.measureTextSize();s=w>0&&i.refresh(o,w,_,S,y/_,b),s&&(e.docView.minWidth=0,c|=8)}g>0&&m>0?u=Math.max(g,m):g<0&&m<0&&(u=Math.min(g,m)),fbe();for(let w of this.viewports){let _=w.from==this.viewport.from?b:e.docView.measureVisibleLineHeights(w);this.heightMap=(s?Aa.empty().applyChanges(this.stateDeco,ar.empty,this.heightOracle,[new mu(0,0,0,e.state.doc.length)]):this.heightMap).updateHeight(i,0,s,new hpn(w.from,_))}bC&&(c|=2)}let x=!this.viewportIsAppropriate(this.viewport,u)||this.scrollTarget&&(this.scrollTarget.range.headthis.viewport.to);return x&&(c&2&&(c|=this.updateScaler()),this.viewport=this.getViewport(u,this.scrollTarget),c|=this.updateForViewport()),(c&2||x)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(s?[]:this.lineGaps,e)),c|=this.computeVisibleRanges(),this.mustEnforceCursorAssoc&&(this.mustEnforceCursorAssoc=!1,e.docView.enforceCursorAssoc()),c}get visibleTop(){return this.scaler.fromDOM(this.pixelViewport.top)}get visibleBottom(){return this.scaler.fromDOM(this.pixelViewport.bottom)}getViewport(e,n){let r=.5-Math.max(-.5,Math.min(.5,e/1e3/2)),i=this.heightMap,o=this.heightOracle,{visibleTop:s,visibleBottom:a}=this,l=new RL(i.lineAt(s-r*1e3,Yr.ByHeight,o,0,0).from,i.lineAt(a+(1-r)*1e3,Yr.ByHeight,o,0,0).to);if(n){let{head:c}=n.range;if(cl.to){let u=Math.min(this.editorHeight,this.pixelViewport.bottom-this.pixelViewport.top),f=i.lineAt(c,Yr.ByPos,o,0,0),d;n.y=="center"?d=(f.top+f.bottom)/2-u/2:n.y=="start"||n.y=="nearest"&&c=a+Math.max(10,Math.min(r,250)))&&i>s-2*1e3&&o>1,s=i<<1;if(this.defaultTextDirection!=ii.LTR&&!r)return[];let a=[],l=(u,f,d,h)=>{if(f-uu&&vv.from>=d.from&&v.to<=d.to&&Math.abs(v.from-u)v.fromy));if(!m){if(fv.from<=f&&v.to>=f)){let v=n.moveToLineBoundary(Ve.cursor(f),!1,!0).head;v>u&&(f=v)}m=new H9(u,f,this.gapSize(d,u,f,h))}a.push(m)},c=u=>{if(u.lengthu.from&&l(u.from,h,u,f),pn.draw(this,this.heightOracle.lineWrapping))))}computeVisibleRanges(){let e=this.stateDeco;this.lineGaps.length&&(e=e.concat(this.lineGapDeco));let n=[];Gn.spans(e,this.viewport.from,this.viewport.to,{span(i,o){n.push({from:i,to:o})},point(){}},20);let r=n.length!=this.visibleRanges.length||this.visibleRanges.some((i,o)=>i.from!=n[o].from||i.to!=n[o].to);return this.visibleRanges=n,r?4:0}lineBlockAt(e){return e>=this.viewport.from&&e<=this.viewport.to&&this.viewportLines.find(n=>n.from<=e&&n.to>=e)||RT(this.heightMap.lineAt(e,Yr.ByPos,this.heightOracle,0,0),this.scaler)}lineBlockAtHeight(e){return e>=this.viewportLines[0].top&&e<=this.viewportLines[this.viewportLines.length-1].bottom&&this.viewportLines.find(n=>n.top<=e&&n.bottom>=e)||RT(this.heightMap.lineAt(this.scaler.fromDOM(e),Yr.ByHeight,this.heightOracle,0,0),this.scaler)}scrollAnchorAt(e){let n=this.lineBlockAtHeight(e+8);return n.from>=this.viewport.from||this.viewportLines[0].top-e>200?n:this.viewportLines[0]}elementAtHeight(e){return RT(this.heightMap.blockAt(this.scaler.fromDOM(e),this.heightOracle,0,0),this.scaler)}get docHeight(){return this.scaler.toDOM(this.heightMap.height)}get contentHeight(){return this.docHeight+this.paddingTop+this.paddingBottom}}class RL{constructor(e,n){this.from=e,this.to=n}}function wpn(t,e,n){let r=[],i=t,o=0;return Gn.spans(n,t,e,{span(){},point(s,a){s>i&&(r.push({from:i,to:s}),o+=s-i),i=a}},20),i=1)return e[e.length-1].to;let r=Math.floor(t*n);for(let i=0;;i++){let{from:o,to:s}=e[i],a=s-o;if(r<=a)return o+r;r-=a}}function IL(t,e){let n=0;for(let{from:r,to:i}of t.ranges){if(e<=i){n+=e-r;break}n+=i-r}return n/t.total}function _pn(t,e){for(let n of t)if(e(n))return n}const pbe={toDOM(t){return t},fromDOM(t){return t},scale:1,eq(t){return t==this}};class Sle{constructor(e,n,r){let i=0,o=0,s=0;this.viewports=r.map(({from:a,to:l})=>{let c=n.lineAt(a,Yr.ByPos,e,0,0).top,u=n.lineAt(l,Yr.ByPos,e,0,0).bottom;return i+=u-c,{from:a,to:l,top:c,bottom:u,domTop:0,domBottom:0}}),this.scale=(7e6-i)/(n.height-i);for(let a of this.viewports)a.domTop=s+(a.top-o)*this.scale,s=a.domBottom=a.domTop+(a.bottom-a.top),o=a.bottom}toDOM(e){for(let n=0,r=0,i=0;;n++){let o=nn.from==e.viewports[r].from&&n.to==e.viewports[r].to):!1}}function RT(t,e){if(e.scale==1)return t;let n=e.toDOM(t.top),r=e.toDOM(t.bottom);return new Yd(t.from,t.length,n,r-n,Array.isArray(t._content)?t._content.map(i=>RT(i,e)):t._content)}const LL=_t.define({combine:t=>t.join(" ")}),JQ=_t.define({combine:t=>t.indexOf(!0)>-1}),eK=_y.newName(),M9e=_y.newName(),R9e=_y.newName(),D9e={"&light":"."+M9e,"&dark":"."+R9e};function tK(t,e,n){return new _y(e,{finish(r){return/&/.test(r)?r.replace(/&\w*/,i=>{if(i=="&")return t;if(!n||!n[i])throw new RangeError(`Unsupported selector: ${i}`);return n[i]}):t+" "+r}})}const Spn=tK("."+eK,{"&":{position:"relative !important",boxSizing:"border-box","&.cm-focused":{outline:"1px dotted #212121"},display:"flex !important",flexDirection:"column"},".cm-scroller":{display:"flex !important",alignItems:"flex-start !important",fontFamily:"monospace",lineHeight:1.4,height:"100%",overflowX:"auto",position:"relative",zIndex:0,overflowAnchor:"none"},".cm-content":{margin:0,flexGrow:2,flexShrink:0,display:"block",whiteSpace:"pre",wordWrap:"normal",boxSizing:"border-box",minHeight:"100%",padding:"4px 0",outline:"none","&[contenteditable=true]":{WebkitUserModify:"read-write-plaintext-only"}},".cm-lineWrapping":{whiteSpace_fallback:"pre-wrap",whiteSpace:"break-spaces",wordBreak:"break-word",overflowWrap:"anywhere",flexShrink:1},"&light .cm-content":{caretColor:"black"},"&dark .cm-content":{caretColor:"white"},".cm-line":{display:"block",padding:"0 2px 0 6px"},".cm-layer":{position:"absolute",left:0,top:0,contain:"size style","& > *":{position:"absolute"}},"&light .cm-selectionBackground":{background:"#d9d9d9"},"&dark .cm-selectionBackground":{background:"#222"},"&light.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground":{background:"#d7d4f0"},"&dark.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground":{background:"#233"},".cm-cursorLayer":{pointerEvents:"none"},"&.cm-focused > .cm-scroller > .cm-cursorLayer":{animation:"steps(1) cm-blink 1.2s infinite"},"@keyframes cm-blink":{"0%":{},"50%":{opacity:0},"100%":{}},"@keyframes cm-blink2":{"0%":{},"50%":{opacity:0},"100%":{}},".cm-cursor, .cm-dropCursor":{borderLeft:"1.2px solid black",marginLeft:"-0.6px",pointerEvents:"none"},".cm-cursor":{display:"none"},"&dark .cm-cursor":{borderLeftColor:"#444"},".cm-dropCursor":{position:"absolute"},"&.cm-focused > .cm-scroller > .cm-cursorLayer .cm-cursor":{display:"block"},".cm-iso":{unicodeBidi:"isolate"},".cm-announced":{position:"fixed",top:"-10000px"},"@media print":{".cm-announced":{display:"none"}},"&light .cm-activeLine":{backgroundColor:"#cceeff44"},"&dark .cm-activeLine":{backgroundColor:"#99eeff33"},"&light .cm-specialChar":{color:"red"},"&dark .cm-specialChar":{color:"#f78"},".cm-gutters":{flexShrink:0,display:"flex",height:"100%",boxSizing:"border-box",insetInlineStart:0,zIndex:200},"&light .cm-gutters":{backgroundColor:"#f5f5f5",color:"#6c6c6c",borderRight:"1px solid #ddd"},"&dark .cm-gutters":{backgroundColor:"#333338",color:"#ccc"},".cm-gutter":{display:"flex !important",flexDirection:"column",flexShrink:0,boxSizing:"border-box",minHeight:"100%",overflow:"hidden"},".cm-gutterElement":{boxSizing:"border-box"},".cm-lineNumbers .cm-gutterElement":{padding:"0 3px 0 5px",minWidth:"20px",textAlign:"right",whiteSpace:"nowrap"},"&light .cm-activeLineGutter":{backgroundColor:"#e2f2ff"},"&dark .cm-activeLineGutter":{backgroundColor:"#222227"},".cm-panels":{boxSizing:"border-box",position:"sticky",left:0,right:0,zIndex:300},"&light .cm-panels":{backgroundColor:"#f5f5f5",color:"black"},"&light .cm-panels-top":{borderBottom:"1px solid #ddd"},"&light .cm-panels-bottom":{borderTop:"1px solid #ddd"},"&dark .cm-panels":{backgroundColor:"#333338",color:"white"},".cm-tab":{display:"inline-block",overflow:"hidden",verticalAlign:"bottom"},".cm-widgetBuffer":{verticalAlign:"text-top",height:"1em",width:0,display:"inline"},".cm-placeholder":{color:"#888",display:"inline-block",verticalAlign:"top"},".cm-highlightSpace:before":{content:"attr(data-display)",position:"absolute",pointerEvents:"none",color:"#888"},".cm-highlightTab":{backgroundImage:`url('data:image/svg+xml,')`,backgroundSize:"auto 100%",backgroundPosition:"right 90%",backgroundRepeat:"no-repeat"},".cm-trailingSpace":{backgroundColor:"#ff332255"},".cm-button":{verticalAlign:"middle",color:"inherit",fontSize:"70%",padding:".2em 1em",borderRadius:"1px"},"&light .cm-button":{backgroundImage:"linear-gradient(#eff1f5, #d9d9df)",border:"1px solid #888","&:active":{backgroundImage:"linear-gradient(#b4b4b4, #d0d3d6)"}},"&dark .cm-button":{backgroundImage:"linear-gradient(#393939, #111)",border:"1px solid #888","&:active":{backgroundImage:"linear-gradient(#111, #333)"}},".cm-textfield":{verticalAlign:"middle",color:"inherit",fontSize:"70%",border:"1px solid silver",padding:".2em .5em"},"&light .cm-textfield":{backgroundColor:"white"},"&dark .cm-textfield":{border:"1px solid #555",backgroundColor:"inherit"}},D9e),Cpn={childList:!0,characterData:!0,subtree:!0,attributes:!0,characterDataOldValue:!0},q9=St.ie&&St.ie_version<=11;class Opn{constructor(e){this.view=e,this.active=!1,this.editContext=null,this.selectionRange=new chn,this.selectionChanged=!1,this.delayedFlush=-1,this.resizeTimeout=-1,this.queue=[],this.delayedAndroidKey=null,this.flushingAndroidKey=-1,this.lastChange=0,this.scrollTargets=[],this.intersection=null,this.resizeScroll=null,this.intersecting=!1,this.gapIntersection=null,this.gaps=[],this.printQuery=null,this.parentCheck=-1,this.dom=e.contentDOM,this.observer=new MutationObserver(n=>{for(let r of n)this.queue.push(r);(St.ie&&St.ie_version<=11||St.ios&&e.composing)&&n.some(r=>r.type=="childList"&&r.removedNodes.length||r.type=="characterData"&&r.oldValue.length>r.target.nodeValue.length)?this.flushSoon():this.flush()}),window.EditContext&&e.constructor.EDIT_CONTEXT!==!1&&!(St.chrome&&St.chrome_version<126)&&(this.editContext=new Tpn(e),e.state.facet(iv)&&(e.contentDOM.editContext=this.editContext.editContext)),q9&&(this.onCharData=n=>{this.queue.push({target:n.target,type:"characterData",oldValue:n.prevValue}),this.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this),this.onResize=this.onResize.bind(this),this.onPrint=this.onPrint.bind(this),this.onScroll=this.onScroll.bind(this),window.matchMedia&&(this.printQuery=window.matchMedia("print")),typeof ResizeObserver=="function"&&(this.resizeScroll=new ResizeObserver(()=>{var n;((n=this.view.docView)===null||n===void 0?void 0:n.lastUpdate){this.parentCheck<0&&(this.parentCheck=setTimeout(this.listenForScroll.bind(this),1e3)),n.length>0&&n[n.length-1].intersectionRatio>0!=this.intersecting&&(this.intersecting=!this.intersecting,this.intersecting!=this.view.inView&&this.onScrollChanged(document.createEvent("Event")))},{threshold:[0,.001]}),this.intersection.observe(this.dom),this.gapIntersection=new IntersectionObserver(n=>{n.length>0&&n[n.length-1].intersectionRatio>0&&this.onScrollChanged(document.createEvent("Event"))},{})),this.listenForScroll(),this.readSelectionRange()}onScrollChanged(e){this.view.inputState.runHandlers("scroll",e),this.intersecting&&this.view.measure()}onScroll(e){this.intersecting&&this.flush(!1),this.editContext&&this.view.requestMeasure(this.editContext.measureReq),this.onScrollChanged(e)}onResize(){this.resizeTimeout<0&&(this.resizeTimeout=setTimeout(()=>{this.resizeTimeout=-1,this.view.requestMeasure()},50))}onPrint(e){(e.type=="change"||!e.type)&&!e.matches||(this.view.viewState.printing=!0,this.view.measure(),setTimeout(()=>{this.view.viewState.printing=!1,this.view.requestMeasure()},500))}updateGaps(e){if(this.gapIntersection&&(e.length!=this.gaps.length||this.gaps.some((n,r)=>n!=e[r]))){this.gapIntersection.disconnect();for(let n of e)this.gapIntersection.observe(n);this.gaps=e}}onSelectionChange(e){let n=this.selectionChanged;if(!this.readSelectionRange()||this.delayedAndroidKey)return;let{view:r}=this,i=this.selectionRange;if(r.state.facet(iv)?r.root.activeElement!=this.dom:!W3(r.dom,i))return;let o=i.anchorNode&&r.docView.nearest(i.anchorNode);if(o&&o.ignoreEvent(e)){n||(this.selectionChanged=!1);return}(St.ie&&St.ie_version<=11||St.android&&St.chrome)&&!r.state.selection.main.empty&&i.focusNode&&Ek(i.focusNode,i.focusOffset,i.anchorNode,i.anchorOffset)?this.flushSoon():this.flush(!1)}readSelectionRange(){let{view:e}=this,n=uP(e.root);if(!n)return!1;let r=St.safari&&e.root.nodeType==11&&ohn(this.dom.ownerDocument)==this.dom&&Epn(this.view,n)||n;if(!r||this.selectionRange.eq(r))return!1;let i=W3(this.dom,r);return i&&!this.selectionChanged&&e.inputState.lastFocusTime>Date.now()-200&&e.inputState.lastTouchTime{let o=this.delayedAndroidKey;o&&(this.clearDelayedAndroidKey(),this.view.inputState.lastKeyCode=o.keyCode,this.view.inputState.lastKeyTime=Date.now(),!this.flush()&&o.force&&K_(this.dom,o.key,o.keyCode))};this.flushingAndroidKey=this.view.win.requestAnimationFrame(i)}(!this.delayedAndroidKey||e=="Enter")&&(this.delayedAndroidKey={key:e,keyCode:n,force:this.lastChange{this.delayedFlush=-1,this.flush()}))}forceFlush(){this.delayedFlush>=0&&(this.view.win.cancelAnimationFrame(this.delayedFlush),this.delayedFlush=-1),this.flush()}pendingRecords(){for(let e of this.observer.takeRecords())this.queue.push(e);return this.queue}processRecords(){let e=this.pendingRecords();e.length&&(this.queue=[]);let n=-1,r=-1,i=!1;for(let o of e){let s=this.readMutation(o);s&&(s.typeOver&&(i=!0),n==-1?{from:n,to:r}=s:(n=Math.min(s.from,n),r=Math.max(s.to,r)))}return{from:n,to:r,typeOver:i}}readChange(){let{from:e,to:n,typeOver:r}=this.processRecords(),i=this.selectionChanged&&W3(this.dom,this.selectionRange);if(e<0&&!i)return null;e>-1&&(this.lastChange=Date.now()),this.view.inputState.lastFocusTime=0,this.selectionChanged=!1;let o=new Vhn(this.view,e,n,r);return this.view.docView.domChanged={newSel:o.newSel?o.newSel.main:null},o}flush(e=!0){if(this.delayedFlush>=0||this.delayedAndroidKey)return!1;e&&this.readSelectionRange();let n=this.readChange();if(!n)return this.view.requestMeasure(),!1;let r=this.view.state,i=w9e(this.view,n);return this.view.state==r&&(n.domChanged||n.newSel&&!n.newSel.main.eq(this.view.state.selection.main))&&this.view.update([]),i}readMutation(e){let n=this.view.docView.nearest(e.target);if(!n||n.ignoreMutation(e))return null;if(n.markDirty(e.type=="attributes"),e.type=="attributes"&&(n.flags|=4),e.type=="childList"){let r=gbe(n,e.previousSibling||e.target.previousSibling,-1),i=gbe(n,e.nextSibling||e.target.nextSibling,1);return{from:r?n.posAfter(r):n.posAtStart,to:i?n.posBefore(i):n.posAtEnd,typeOver:!1}}else return e.type=="characterData"?{from:n.posAtStart,to:n.posAtEnd,typeOver:e.target.nodeValue==e.oldValue}:null}setWindow(e){e!=this.win&&(this.removeWindowListeners(this.win),this.win=e,this.addWindowListeners(this.win))}addWindowListeners(e){e.addEventListener("resize",this.onResize),this.printQuery?this.printQuery.addEventListener?this.printQuery.addEventListener("change",this.onPrint):this.printQuery.addListener(this.onPrint):e.addEventListener("beforeprint",this.onPrint),e.addEventListener("scroll",this.onScroll),e.document.addEventListener("selectionchange",this.onSelectionChange)}removeWindowListeners(e){e.removeEventListener("scroll",this.onScroll),e.removeEventListener("resize",this.onResize),this.printQuery?this.printQuery.removeEventListener?this.printQuery.removeEventListener("change",this.onPrint):this.printQuery.removeListener(this.onPrint):e.removeEventListener("beforeprint",this.onPrint),e.document.removeEventListener("selectionchange",this.onSelectionChange)}update(e){this.editContext&&(this.editContext.update(e),e.startState.facet(iv)!=e.state.facet(iv)&&(e.view.contentDOM.editContext=e.state.facet(iv)?this.editContext.editContext:null))}destroy(){var e,n,r;this.stop(),(e=this.intersection)===null||e===void 0||e.disconnect(),(n=this.gapIntersection)===null||n===void 0||n.disconnect(),(r=this.resizeScroll)===null||r===void 0||r.disconnect();for(let i of this.scrollTargets)i.removeEventListener("scroll",this.onScroll);this.removeWindowListeners(this.win),clearTimeout(this.parentCheck),clearTimeout(this.resizeTimeout),this.win.cancelAnimationFrame(this.delayedFlush),this.win.cancelAnimationFrame(this.flushingAndroidKey),this.editContext&&(this.view.contentDOM.editContext=null,this.editContext.destroy())}}function gbe(t,e,n){for(;e;){let r=Dr.get(e);if(r&&r.parent==t)return r;let i=e.parentNode;e=i!=t.dom?i:n>0?e.nextSibling:e.previousSibling}return null}function mbe(t,e){let n=e.startContainer,r=e.startOffset,i=e.endContainer,o=e.endOffset,s=t.docView.domAtPos(t.state.selection.main.anchor);return Ek(s.node,s.offset,i,o)&&([n,r,i,o]=[i,o,n,r]),{anchorNode:n,anchorOffset:r,focusNode:i,focusOffset:o}}function Epn(t,e){if(e.getComposedRanges){let i=e.getComposedRanges(t.root)[0];if(i)return mbe(t,i)}let n=null;function r(i){i.preventDefault(),i.stopImmediatePropagation(),n=i.getTargetRanges()[0]}return t.contentDOM.addEventListener("beforeinput",r,!0),t.dom.ownerDocument.execCommand("indent"),t.contentDOM.removeEventListener("beforeinput",r,!0),n?mbe(t,n):null}class Tpn{constructor(e){this.from=0,this.to=0,this.pendingContextChange=null,this.handlers=Object.create(null),this.resetRange(e.state);let n=this.editContext=new window.EditContext({text:e.state.doc.sliceString(this.from,this.to),selectionStart:this.toContextPos(Math.max(this.from,Math.min(this.to,e.state.selection.main.anchor))),selectionEnd:this.toContextPos(e.state.selection.main.head)});this.handlers.textupdate=r=>{let{anchor:i}=e.state.selection.main,o={from:this.toEditorPos(r.updateRangeStart),to:this.toEditorPos(r.updateRangeEnd),insert:ar.of(r.text.split(` -`))};o.from==this.from&&ithis.to&&(o.to=i),!(o.from==o.to&&!o.insert.length)&&(this.pendingContextChange=o,e.state.readOnly||wle(e,o,Ve.single(this.toEditorPos(r.selectionStart),this.toEditorPos(r.selectionEnd))),this.pendingContextChange&&(this.revertPending(e.state),this.setSelection(e.state)))},this.handlers.characterboundsupdate=r=>{let i=[],o=null;for(let s=this.toEditorPos(r.rangeStart),a=this.toEditorPos(r.rangeEnd);s{let i=[];for(let o of r.getTextFormats()){let s=o.underlineStyle,a=o.underlineThickness;if(s!="None"&&a!="None"){let l=`text-decoration: underline ${s=="Dashed"?"dashed ":s=="Squiggle"?"wavy ":""}${a=="Thin"?1:2}px`;i.push(It.mark({attributes:{style:l}}).range(this.toEditorPos(o.rangeStart),this.toEditorPos(o.rangeEnd)))}}e.dispatch({effects:h9e.of(It.set(i))})},this.handlers.compositionstart=()=>{e.inputState.composing<0&&(e.inputState.composing=0,e.inputState.compositionFirstChange=!0)},this.handlers.compositionend=()=>{e.inputState.composing=-1,e.inputState.compositionFirstChange=null};for(let r in this.handlers)n.addEventListener(r,this.handlers[r]);this.measureReq={read:r=>{this.editContext.updateControlBounds(r.contentDOM.getBoundingClientRect());let i=uP(r.root);i&&i.rangeCount&&this.editContext.updateSelectionBounds(i.getRangeAt(0).getBoundingClientRect())}}}applyEdits(e){let n=0,r=!1,i=this.pendingContextChange;return e.changes.iterChanges((o,s,a,l,c)=>{if(r)return;let u=c.length-(s-o);if(i&&s>=i.to)if(i.from==o&&i.to==s&&i.insert.eq(c)){i=this.pendingContextChange=null,n+=u,this.to+=u;return}else i=null,this.revertPending(e.state);if(o+=n,s+=n,s<=this.from)this.from+=u,this.to+=u;else if(othis.to||this.to-this.from+c.length>3e4){r=!0;return}this.editContext.updateText(this.toContextPos(o),this.toContextPos(s),c.toString()),this.to+=u}n+=u}),i&&!r&&this.revertPending(e.state),!r}update(e){let n=this.pendingContextChange;!this.applyEdits(e)||!this.rangeIsValid(e.state)?(this.pendingContextChange=null,this.resetRange(e.state),this.editContext.updateText(0,this.editContext.text.length,e.state.doc.sliceString(this.from,this.to)),this.setSelection(e.state)):(e.docChanged||e.selectionSet||n)&&this.setSelection(e.state),(e.geometryChanged||e.docChanged||e.selectionSet)&&e.view.requestMeasure(this.measureReq)}resetRange(e){let{head:n}=e.selection.main;this.from=Math.max(0,n-1e4),this.to=Math.min(e.doc.length,n+1e4)}revertPending(e){let n=this.pendingContextChange;this.pendingContextChange=null,this.editContext.updateText(this.toContextPos(n.from),this.toContextPos(n.from+n.insert.length),e.doc.sliceString(n.from,n.to))}setSelection(e){let{main:n}=e.selection,r=this.toContextPos(Math.max(this.from,Math.min(this.to,n.anchor))),i=this.toContextPos(n.head);(this.editContext.selectionStart!=r||this.editContext.selectionEnd!=i)&&this.editContext.updateSelection(r,i)}rangeIsValid(e){let{head:n}=e.selection.main;return!(this.from>0&&n-this.from<500||this.to1e4*3)}toEditorPos(e){return e+this.from}toContextPos(e){return e-this.from}destroy(){for(let e in this.handlers)this.editContext.removeEventListener(e,this.handlers[e])}}class mt{get state(){return this.viewState.state}get viewport(){return this.viewState.viewport}get visibleRanges(){return this.viewState.visibleRanges}get inView(){return this.viewState.inView}get composing(){return this.inputState.composing>0}get compositionStarted(){return this.inputState.composing>=0}get root(){return this._root}get win(){return this.dom.ownerDocument.defaultView||window}constructor(e={}){var n;this.plugins=[],this.pluginMap=new Map,this.editorAttrs={},this.contentAttrs={},this.bidiCache=[],this.destroyed=!1,this.updateState=2,this.measureScheduled=-1,this.measureRequests=[],this.contentDOM=document.createElement("div"),this.scrollDOM=document.createElement("div"),this.scrollDOM.tabIndex=-1,this.scrollDOM.className="cm-scroller",this.scrollDOM.appendChild(this.contentDOM),this.announceDOM=document.createElement("div"),this.announceDOM.className="cm-announced",this.announceDOM.setAttribute("aria-live","polite"),this.dom=document.createElement("div"),this.dom.appendChild(this.announceDOM),this.dom.appendChild(this.scrollDOM),e.parent&&e.parent.appendChild(this.dom);let{dispatch:r}=e;this.dispatchTransactions=e.dispatchTransactions||r&&(i=>i.forEach(o=>r(o,this)))||(i=>this.update(i)),this.dispatch=this.dispatch.bind(this),this._root=e.root||uhn(e.parent)||document,this.viewState=new hbe(e.state||In.create(e)),e.scrollTo&&e.scrollTo.is(AL)&&(this.viewState.scrollTarget=e.scrollTo.value.clip(this.viewState.state)),this.plugins=this.state.facet(AT).map(i=>new W9(i));for(let i of this.plugins)i.update(this);this.observer=new Opn(this),this.inputState=new Yhn(this),this.inputState.ensureHandlers(this.plugins),this.docView=new X1e(this),this.mountStyles(),this.updateAttrs(),this.updateState=0,this.requestMeasure(),!((n=document.fonts)===null||n===void 0)&&n.ready&&document.fonts.ready.then(()=>this.requestMeasure())}dispatch(...e){let n=e.length==1&&e[0]instanceof lo?e:e.length==1&&Array.isArray(e[0])?e[0]:[this.state.update(...e)];this.dispatchTransactions(n,this)}update(e){if(this.updateState!=0)throw new Error("Calls to EditorView.update are not allowed while an update is in progress");let n=!1,r=!1,i,o=this.state;for(let d of e){if(d.startState!=o)throw new RangeError("Trying to update state with a transaction that doesn't start from the previous state.");o=d.state}if(this.destroyed){this.viewState.state=o;return}let s=this.hasFocus,a=0,l=null;e.some(d=>d.annotation(T9e))?(this.inputState.notifiedFocused=s,a=1):s!=this.inputState.notifiedFocused&&(this.inputState.notifiedFocused=s,l=k9e(o,s),l||(a=1));let c=this.observer.delayedAndroidKey,u=null;if(c?(this.observer.clearDelayedAndroidKey(),u=this.observer.readChange(),(u&&!this.state.doc.eq(o.doc)||!this.state.selection.eq(o.selection))&&(u=null)):this.observer.clear(),o.facet(In.phrases)!=this.state.facet(In.phrases))return this.setState(o);i=oz.create(this,o,e),i.flags|=a;let f=this.viewState.scrollTarget;try{this.updateState=2;for(let d of e){if(f&&(f=f.map(d.changes)),d.scrollIntoView){let{main:h}=d.state.selection;f=new Z_(h.empty?h:Ve.cursor(h.head,h.head>h.anchor?-1:1))}for(let h of d.effects)h.is(AL)&&(f=h.value.clip(this.state))}this.viewState.update(i,f),this.bidiCache=az.update(this.bidiCache,i.changes),i.empty||(this.updatePlugins(i),this.inputState.update(i)),n=this.docView.update(i),this.state.facet(PT)!=this.styleModules&&this.mountStyles(),r=this.updateAttrs(),this.showAnnouncements(e),this.docView.updateSelection(n,e.some(d=>d.isUserEvent("select.pointer")))}finally{this.updateState=0}if(i.startState.facet(LL)!=i.state.facet(LL)&&(this.viewState.mustMeasureContent=!0),(n||r||f||this.viewState.mustEnforceCursorAssoc||this.viewState.mustMeasureContent)&&this.requestMeasure(),n&&this.docViewUpdate(),!i.empty)for(let d of this.state.facet(YQ))try{d(i)}catch(h){ll(this.state,h,"update listener")}(l||u)&&Promise.resolve().then(()=>{l&&this.state==l.startState&&this.dispatch(l),u&&!w9e(this,u)&&c.force&&K_(this.contentDOM,c.key,c.keyCode)})}setState(e){if(this.updateState!=0)throw new Error("Calls to EditorView.setState are not allowed while an update is in progress");if(this.destroyed){this.viewState.state=e;return}this.updateState=2;let n=this.hasFocus;try{for(let r of this.plugins)r.destroy(this);this.viewState=new hbe(e),this.plugins=e.facet(AT).map(r=>new W9(r)),this.pluginMap.clear();for(let r of this.plugins)r.update(this);this.docView.destroy(),this.docView=new X1e(this),this.inputState.ensureHandlers(this.plugins),this.mountStyles(),this.updateAttrs(),this.bidiCache=[]}finally{this.updateState=0}n&&this.focus(),this.requestMeasure()}updatePlugins(e){let n=e.startState.facet(AT),r=e.state.facet(AT);if(n!=r){let i=[];for(let o of r){let s=n.indexOf(o);if(s<0)i.push(new W9(o));else{let a=this.plugins[s];a.mustUpdate=e,i.push(a)}}for(let o of this.plugins)o.mustUpdate!=e&&o.destroy(this);this.plugins=i,this.pluginMap.clear()}else for(let i of this.plugins)i.mustUpdate=e;for(let i=0;i-1&&this.win.cancelAnimationFrame(this.measureScheduled),this.observer.delayedAndroidKey){this.measureScheduled=-1,this.requestMeasure();return}this.measureScheduled=0,e&&this.observer.forceFlush();let n=null,r=this.scrollDOM,i=r.scrollTop*this.scaleY,{scrollAnchorPos:o,scrollAnchorHeight:s}=this.viewState;Math.abs(i-this.viewState.scrollTop)>1&&(s=-1),this.viewState.scrollAnchorHeight=-1;try{for(let a=0;;a++){if(s<0)if(BVe(r))o=-1,s=this.viewState.heightMap.height;else{let h=this.viewState.scrollAnchorAt(i);o=h.from,s=h.top}this.updateState=1;let l=this.viewState.measure(this);if(!l&&!this.measureRequests.length&&this.viewState.scrollTarget==null)break;if(a>5){console.warn(this.measureRequests.length?"Measure loop restarted more than 5 times":"Viewport failed to stabilize");break}let c=[];l&4||([this.measureRequests,c]=[c,this.measureRequests]);let u=c.map(h=>{try{return h.read(this)}catch(p){return ll(this.state,p),vbe}}),f=oz.create(this,this.state,[]),d=!1;f.flags|=l,n?n.flags|=l:n=f,this.updateState=2,f.empty||(this.updatePlugins(f),this.inputState.update(f),this.updateAttrs(),d=this.docView.update(f),d&&this.docViewUpdate());for(let h=0;h1||p<-1){i=i+p,r.scrollTop=i/this.scaleY,s=-1;continue}}break}}}finally{this.updateState=0,this.measureScheduled=-1}if(n&&!n.empty)for(let a of this.state.facet(YQ))a(n)}get themeClasses(){return eK+" "+(this.state.facet(JQ)?R9e:M9e)+" "+this.state.facet(LL)}updateAttrs(){let e=ybe(this,p9e,{class:"cm-editor"+(this.hasFocus?" cm-focused ":" ")+this.themeClasses}),n={spellcheck:"false",autocorrect:"off",autocapitalize:"off",translate:"no",contenteditable:this.state.facet(iv)?"true":"false",class:"cm-content",style:`${St.tabSize}: ${this.state.tabSize}`,role:"textbox","aria-multiline":"true"};this.state.readOnly&&(n["aria-readonly"]="true"),ybe(this,xle,n);let r=this.observer.ignore(()=>{let i=WQ(this.contentDOM,this.contentAttrs,n),o=WQ(this.dom,this.editorAttrs,e);return i||o});return this.editorAttrs=e,this.contentAttrs=n,r}showAnnouncements(e){let n=!0;for(let r of e)for(let i of r.effects)if(i.is(mt.announce)){n&&(this.announceDOM.textContent=""),n=!1;let o=this.announceDOM.appendChild(document.createElement("div"));o.textContent=i.value}}mountStyles(){this.styleModules=this.state.facet(PT);let e=this.state.facet(mt.cspNonce);_y.mount(this.root,this.styleModules.concat(Spn).reverse(),e?{nonce:e}:void 0)}readMeasured(){if(this.updateState==2)throw new Error("Reading the editor layout isn't allowed during an update");this.updateState==0&&this.measureScheduled>-1&&this.measure(!1)}requestMeasure(e){if(this.measureScheduled<0&&(this.measureScheduled=this.win.requestAnimationFrame(()=>this.measure())),e){if(this.measureRequests.indexOf(e)>-1)return;if(e.key!=null){for(let n=0;nr.spec==e)||null),n&&n.update(this).value}get documentTop(){return this.contentDOM.getBoundingClientRect().top+this.viewState.paddingTop}get documentPadding(){return{top:this.viewState.paddingTop,bottom:this.viewState.paddingBottom}}get scaleX(){return this.viewState.scaleX}get scaleY(){return this.viewState.scaleY}elementAtHeight(e){return this.readMeasured(),this.viewState.elementAtHeight(e)}lineBlockAtHeight(e){return this.readMeasured(),this.viewState.lineBlockAtHeight(e)}get viewportLineBlocks(){return this.viewState.viewportLines}lineBlockAt(e){return this.viewState.lineBlockAt(e)}get contentHeight(){return this.viewState.contentHeight}moveByChar(e,n,r){return G9(this,e,J1e(this,e,n,r))}moveByGroup(e,n){return G9(this,e,J1e(this,e,n,r=>jhn(this,e.head,r)))}visualLineSide(e,n){let r=this.bidiSpans(e),i=this.textDirectionAt(e.from),o=r[n?r.length-1:0];return Ve.cursor(o.side(n,i)+e.from,o.forward(!n,i)?1:-1)}moveToLineBoundary(e,n,r=!0){return zhn(this,e,n,r)}moveVertically(e,n,r){return G9(this,e,Bhn(this,e,n,r))}domAtPos(e){return this.docView.domAtPos(e)}posAtDOM(e,n=0){return this.docView.posFromDOM(e,n)}posAtCoords(e,n=!0){return this.readMeasured(),b9e(this,e,n)}coordsAtPos(e,n=1){this.readMeasured();let r=this.docView.coordsAt(e,n);if(!r||r.left==r.right)return r;let i=this.state.doc.lineAt(e),o=this.bidiSpans(i),s=o[Sv.find(o,e-i.from,-1,n)];return sD(r,s.dir==ii.LTR==n>0)}coordsForChar(e){return this.readMeasured(),this.docView.coordsForChar(e)}get defaultCharacterWidth(){return this.viewState.heightOracle.charWidth}get defaultLineHeight(){return this.viewState.heightOracle.lineHeight}get textDirection(){return this.viewState.defaultTextDirection}textDirectionAt(e){return!this.state.facet(u9e)||ethis.viewport.to?this.textDirection:(this.readMeasured(),this.docView.textDirectionAt(e))}get lineWrapping(){return this.viewState.heightOracle.lineWrapping}bidiSpans(e){if(e.length>kpn)return n9e(e.length);let n=this.textDirectionAt(e.from),r;for(let o of this.bidiCache)if(o.from==e.from&&o.dir==n&&(o.fresh||t9e(o.isolates,r=q1e(this,e))))return o.order;r||(r=q1e(this,e));let i=Shn(e.text,n,r);return this.bidiCache.push(new az(e.from,e.to,n,r,!0,i)),i}get hasFocus(){var e;return(this.dom.ownerDocument.hasFocus()||St.safari&&((e=this.inputState)===null||e===void 0?void 0:e.lastContextMenu)>Date.now()-3e4)&&this.root.activeElement==this.contentDOM}focus(){this.observer.ignore(()=>{zVe(this.contentDOM),this.docView.updateSelection()})}setRoot(e){this._root!=e&&(this._root=e,this.observer.setWindow((e.nodeType==9?e:e.ownerDocument).defaultView||window),this.mountStyles())}destroy(){this.root.activeElement==this.contentDOM&&this.contentDOM.blur();for(let e of this.plugins)e.destroy(this);this.plugins=[],this.inputState.destroy(),this.docView.destroy(),this.dom.remove(),this.observer.destroy(),this.measureScheduled>-1&&this.win.cancelAnimationFrame(this.measureScheduled),this.destroyed=!0}static scrollIntoView(e,n={}){return AL.of(new Z_(typeof e=="number"?Ve.cursor(e):e,n.y,n.x,n.yMargin,n.xMargin))}scrollSnapshot(){let{scrollTop:e,scrollLeft:n}=this.scrollDOM,r=this.viewState.scrollAnchorAt(e);return AL.of(new Z_(Ve.cursor(r.from),"start","start",r.top-e,n,!0))}setTabFocusMode(e){e==null?this.inputState.tabFocusMode=this.inputState.tabFocusMode<0?0:-1:typeof e=="boolean"?this.inputState.tabFocusMode=e?0:-1:this.inputState.tabFocusMode!=0&&(this.inputState.tabFocusMode=Date.now()+e)}static domEventHandlers(e){return Qi.define(()=>({}),{eventHandlers:e})}static domEventObservers(e){return Qi.define(()=>({}),{eventObservers:e})}static theme(e,n){let r=_y.newName(),i=[LL.of(r),PT.of(tK(`.${r}`,e))];return n&&n.dark&&i.push(JQ.of(!0)),i}static baseTheme(e){return n0.lowest(PT.of(tK("."+eK,e,D9e)))}static findFromDOM(e){var n;let r=e.querySelector(".cm-content"),i=r&&Dr.get(r)||Dr.get(e);return((n=i==null?void 0:i.rootView)===null||n===void 0?void 0:n.view)||null}}mt.styleModule=PT;mt.inputHandler=l9e;mt.scrollHandler=d9e;mt.focusChangeEffect=c9e;mt.perLineTextDirection=u9e;mt.exceptionSink=a9e;mt.updateListener=YQ;mt.editable=iv;mt.mouseSelectionStyle=s9e;mt.dragMovesSelection=o9e;mt.clickAddsSelectionRange=i9e;mt.decorations=fP;mt.outerDecorations=g9e;mt.atomicRanges=ble;mt.bidiIsolatedRanges=m9e;mt.scrollMargins=v9e;mt.darkTheme=JQ;mt.cspNonce=_t.define({combine:t=>t.length?t[0]:""});mt.contentAttributes=xle;mt.editorAttributes=p9e;mt.lineWrapping=mt.contentAttributes.of({class:"cm-lineWrapping"});mt.announce=rn.define();const kpn=4096,vbe={};class az{constructor(e,n,r,i,o,s){this.from=e,this.to=n,this.dir=r,this.isolates=i,this.fresh=o,this.order=s}static update(e,n){if(n.empty&&!e.some(o=>o.fresh))return e;let r=[],i=e.length?e[e.length-1].dir:ii.LTR;for(let o=Math.max(0,e.length-10);o=0;i--){let o=r[i],s=typeof o=="function"?o(t):o;s&&UQ(s,n)}return n}const Apn=St.mac?"mac":St.windows?"win":St.linux?"linux":"key";function Ppn(t,e){const n=t.split(/-(?!$)/);let r=n[n.length-1];r=="Space"&&(r=" ");let i,o,s,a;for(let l=0;lr.concat(i),[]))),n}function Rpn(t,e,n){return L9e(I9e(t.state),e,t,n)}let ov=null;const Dpn=4e3;function Ipn(t,e=Apn){let n=Object.create(null),r=Object.create(null),i=(s,a)=>{let l=r[s];if(l==null)r[s]=a;else if(l!=a)throw new Error("Key binding "+s+" is used both as a regular binding and as a multi-stroke prefix")},o=(s,a,l,c,u)=>{var f,d;let h=n[s]||(n[s]=Object.create(null)),p=a.split(/ (?!$)/).map(v=>Ppn(v,e));for(let v=1;v{let b=ov={view:x,prefix:y,scope:s};return setTimeout(()=>{ov==b&&(ov=null)},Dpn),!0}]})}let g=p.join(" ");i(g,!1);let m=h[g]||(h[g]={preventDefault:!1,stopPropagation:!1,run:((d=(f=h._any)===null||f===void 0?void 0:f.run)===null||d===void 0?void 0:d.slice())||[]});l&&m.run.push(l),c&&(m.preventDefault=!0),u&&(m.stopPropagation=!0)};for(let s of t){let a=s.scope?s.scope.split(" "):["editor"];if(s.any)for(let c of a){let u=n[c]||(n[c]=Object.create(null));u._any||(u._any={preventDefault:!1,stopPropagation:!1,run:[]});let{any:f}=s;for(let d in u)u[d].run.push(h=>f(h,nK))}let l=s[e]||s.key;if(l)for(let c of a)o(c,l,s.run,s.preventDefault,s.stopPropagation),s.shift&&o(c,"Shift-"+l,s.shift,s.preventDefault,s.stopPropagation)}return n}let nK=null;function L9e(t,e,n,r){nK=e;let i=ihn(e),o=ss(i,0),s=Jc(o)==i.length&&i!=" ",a="",l=!1,c=!1,u=!1;ov&&ov.view==n&&ov.scope==r&&(a=ov.prefix+" ",S9e.indexOf(e.keyCode)<0&&(c=!0,ov=null));let f=new Set,d=m=>{if(m){for(let v of m.run)if(!f.has(v)&&(f.add(v),v(n)))return m.stopPropagation&&(u=!0),!0;m.preventDefault&&(m.stopPropagation&&(u=!0),c=!0)}return!1},h=t[r],p,g;return h&&(d(h[a+$L(i,e,!s)])?l=!0:s&&(e.altKey||e.metaKey||e.ctrlKey)&&!(St.windows&&e.ctrlKey&&e.altKey)&&(p=Sy[e.keyCode])&&p!=i?(d(h[a+$L(p,e,!0)])||e.shiftKey&&(g=cP[e.keyCode])!=i&&g!=p&&d(h[a+$L(g,e,!1)]))&&(l=!0):s&&e.shiftKey&&d(h[a+$L(i,e,!0)])&&(l=!0),!l&&d(h._any)&&(l=!0)),c&&(l=!0),l&&u&&e.stopPropagation(),nK=null,l}class uD{constructor(e,n,r,i,o){this.className=e,this.left=n,this.top=r,this.width=i,this.height=o}draw(){let e=document.createElement("div");return e.className=this.className,this.adjust(e),e}update(e,n){return n.className!=this.className?!1:(this.adjust(e),!0)}adjust(e){e.style.left=this.left+"px",e.style.top=this.top+"px",this.width!=null&&(e.style.width=this.width+"px"),e.style.height=this.height+"px"}eq(e){return this.left==e.left&&this.top==e.top&&this.width==e.width&&this.height==e.height&&this.className==e.className}static forRange(e,n,r){if(r.empty){let i=e.coordsAtPos(r.head,r.assoc||1);if(!i)return[];let o=$9e(e);return[new uD(n,i.left-o.left,i.top-o.top,null,i.bottom-i.top)]}else return Lpn(e,n,r)}}function $9e(t){let e=t.scrollDOM.getBoundingClientRect();return{left:(t.textDirection==ii.LTR?e.left:e.right-t.scrollDOM.clientWidth*t.scaleX)-t.scrollDOM.scrollLeft*t.scaleX,top:e.top-t.scrollDOM.scrollTop*t.scaleY}}function bbe(t,e,n,r){let i=t.coordsAtPos(e,n*2);if(!i)return r;let o=t.dom.getBoundingClientRect(),s=(i.top+i.bottom)/2,a=t.posAtCoords({x:o.left+1,y:s}),l=t.posAtCoords({x:o.right-1,y:s});return a==null||l==null?r:{from:Math.max(r.from,Math.min(a,l)),to:Math.min(r.to,Math.max(a,l))}}function Lpn(t,e,n){if(n.to<=t.viewport.from||n.from>=t.viewport.to)return[];let r=Math.max(n.from,t.viewport.from),i=Math.min(n.to,t.viewport.to),o=t.textDirection==ii.LTR,s=t.contentDOM,a=s.getBoundingClientRect(),l=$9e(t),c=s.querySelector(".cm-line"),u=c&&window.getComputedStyle(c),f=a.left+(u?parseInt(u.paddingLeft)+Math.min(0,parseInt(u.textIndent)):0),d=a.right-(u?parseInt(u.paddingRight):0),h=KQ(t,r),p=KQ(t,i),g=h.type==ka.Text?h:null,m=p.type==ka.Text?p:null;if(g&&(t.lineWrapping||h.widgetLineBreaks)&&(g=bbe(t,r,1,g)),m&&(t.lineWrapping||p.widgetLineBreaks)&&(m=bbe(t,i,-1,m)),g&&m&&g.from==m.from&&g.to==m.to)return y(x(n.from,n.to,g));{let w=g?x(n.from,null,g):b(h,!1),_=m?x(null,n.to,m):b(p,!0),S=[];return(g||h).to<(m||p).from-(g&&m?1:0)||h.widgetLineBreaks>1&&w.bottom+t.defaultLineHeight/2<_.top?S.push(v(f,w.bottom,d,_.top)):w.bottom<_.top&&t.elementAtHeight((w.bottom+_.top)/2).type==ka.Text&&(w.bottom=_.top=(w.bottom+_.top)/2),y(w).concat(S).concat(y(_))}function v(w,_,S,O){return new uD(e,w-l.left,_-l.top-.01,S-w,O-_+.01)}function y({top:w,bottom:_,horizontal:S}){let O=[];for(let k=0;kA&&T.from=I)break;L>R&&M(Math.max(z,R),w==null&&z<=A,Math.min(L,I),_==null&&L>=P,$.dir)}if(R=B.to+1,R>=I)break}return E.length==0&&M(A,w==null,P,_==null,t.textDirection),{top:O,bottom:k,horizontal:E}}function b(w,_){let S=a.top+(_?w.top:w.bottom);return{top:S,bottom:S,horizontal:[]}}}function $pn(t,e){return t.constructor==e.constructor&&t.eq(e)}class Fpn{constructor(e,n){this.view=e,this.layer=n,this.drawn=[],this.scaleX=1,this.scaleY=1,this.measureReq={read:this.measure.bind(this),write:this.draw.bind(this)},this.dom=e.scrollDOM.appendChild(document.createElement("div")),this.dom.classList.add("cm-layer"),n.above&&this.dom.classList.add("cm-layer-above"),n.class&&this.dom.classList.add(n.class),this.scale(),this.dom.setAttribute("aria-hidden","true"),this.setOrder(e.state),e.requestMeasure(this.measureReq),n.mount&&n.mount(this.dom,e)}update(e){e.startState.facet(H3)!=e.state.facet(H3)&&this.setOrder(e.state),(this.layer.update(e,this.dom)||e.geometryChanged)&&(this.scale(),e.view.requestMeasure(this.measureReq))}docViewUpdate(e){this.layer.updateOnDocViewUpdate!==!1&&e.requestMeasure(this.measureReq)}setOrder(e){let n=0,r=e.facet(H3);for(;n!$pn(n,this.drawn[r]))){let n=this.dom.firstChild,r=0;for(let i of e)i.update&&n&&i.constructor&&this.drawn[r].constructor&&i.update(n,this.drawn[r])?(n=n.nextSibling,r++):this.dom.insertBefore(i.draw(),n);for(;n;){let i=n.nextSibling;n.remove(),n=i}this.drawn=e}}destroy(){this.layer.destroy&&this.layer.destroy(this.dom,this.view),this.dom.remove()}}const H3=_t.define();function F9e(t){return[Qi.define(e=>new Fpn(e,t)),H3.of(t)]}const N9e=!St.ios,dP=_t.define({combine(t){return ep(t,{cursorBlinkRate:1200,drawRangeCursor:!0},{cursorBlinkRate:(e,n)=>Math.min(e,n),drawRangeCursor:(e,n)=>e||n})}});function Npn(t={}){return[dP.of(t),zpn,jpn,Bpn,f9e.of(!0)]}function z9e(t){return t.startState.facet(dP)!=t.state.facet(dP)}const zpn=F9e({above:!0,markers(t){let{state:e}=t,n=e.facet(dP),r=[];for(let i of e.selection.ranges){let o=i==e.selection.main;if(i.empty?!o||N9e:n.drawRangeCursor){let s=o?"cm-cursor cm-cursor-primary":"cm-cursor cm-cursor-secondary",a=i.empty?i:Ve.cursor(i.head,i.head>i.anchor?-1:1);for(let l of uD.forRange(t,s,a))r.push(l)}}return r},update(t,e){t.transactions.some(r=>r.selection)&&(e.style.animationName=e.style.animationName=="cm-blink"?"cm-blink2":"cm-blink");let n=z9e(t);return n&&wbe(t.state,e),t.docChanged||t.selectionSet||n},mount(t,e){wbe(e.state,t)},class:"cm-cursorLayer"});function wbe(t,e){e.style.animationDuration=t.facet(dP).cursorBlinkRate+"ms"}const jpn=F9e({above:!1,markers(t){return t.state.selection.ranges.map(e=>e.empty?[]:uD.forRange(t,"cm-selectionBackground",e)).reduce((e,n)=>e.concat(n))},update(t,e){return t.docChanged||t.selectionSet||t.viewportChanged||z9e(t)},class:"cm-selectionLayer"}),rK={".cm-line":{"& ::selection, &::selection":{backgroundColor:"transparent !important"}},".cm-content":{"& :focus":{caretColor:"initial !important","&::selection, & ::selection":{backgroundColor:"Highlight !important"}}}};N9e&&(rK[".cm-line"].caretColor=rK[".cm-content"].caretColor="transparent !important");const Bpn=n0.highest(mt.theme(rK)),j9e=rn.define({map(t,e){return t==null?null:e.mapPos(t)}}),DT=Qo.define({create(){return null},update(t,e){return t!=null&&(t=e.changes.mapPos(t)),e.effects.reduce((n,r)=>r.is(j9e)?r.value:n,t)}}),Upn=Qi.fromClass(class{constructor(t){this.view=t,this.cursor=null,this.measureReq={read:this.readPos.bind(this),write:this.drawCursor.bind(this)}}update(t){var e;let n=t.state.field(DT);n==null?this.cursor!=null&&((e=this.cursor)===null||e===void 0||e.remove(),this.cursor=null):(this.cursor||(this.cursor=this.view.scrollDOM.appendChild(document.createElement("div")),this.cursor.className="cm-dropCursor"),(t.startState.field(DT)!=n||t.docChanged||t.geometryChanged)&&this.view.requestMeasure(this.measureReq))}readPos(){let{view:t}=this,e=t.state.field(DT),n=e!=null&&t.coordsAtPos(e);if(!n)return null;let r=t.scrollDOM.getBoundingClientRect();return{left:n.left-r.left+t.scrollDOM.scrollLeft*t.scaleX,top:n.top-r.top+t.scrollDOM.scrollTop*t.scaleY,height:n.bottom-n.top}}drawCursor(t){if(this.cursor){let{scaleX:e,scaleY:n}=this.view;t?(this.cursor.style.left=t.left/e+"px",this.cursor.style.top=t.top/n+"px",this.cursor.style.height=t.height/n+"px"):this.cursor.style.left="-100000px"}}destroy(){this.cursor&&this.cursor.remove()}setDropPos(t){this.view.state.field(DT)!=t&&this.view.dispatch({effects:j9e.of(t)})}},{eventObservers:{dragover(t){this.setDropPos(this.view.posAtCoords({x:t.clientX,y:t.clientY}))},dragleave(t){(t.target==this.view.contentDOM||!this.view.contentDOM.contains(t.relatedTarget))&&this.setDropPos(null)},dragend(){this.setDropPos(null)},drop(){this.setDropPos(null)}}});function Wpn(){return[DT,Upn]}function _be(t,e,n,r,i){e.lastIndex=0;for(let o=t.iterRange(n,r),s=n,a;!o.next().done;s+=o.value.length)if(!o.lineBreak)for(;a=e.exec(o.value);)i(s+a.index,a)}function Vpn(t,e){let n=t.visibleRanges;if(n.length==1&&n[0].from==t.viewport.from&&n[0].to==t.viewport.to)return n;let r=[];for(let{from:i,to:o}of n)i=Math.max(t.state.doc.lineAt(i).from,i-e),o=Math.min(t.state.doc.lineAt(o).to,o+e),r.length&&r[r.length-1].to>=i?r[r.length-1].to=o:r.push({from:i,to:o});return r}class Gpn{constructor(e){const{regexp:n,decoration:r,decorate:i,boundary:o,maxLength:s=1e3}=e;if(!n.global)throw new RangeError("The regular expression given to MatchDecorator should have its 'g' flag set");if(this.regexp=n,i)this.addMatch=(a,l,c,u)=>i(u,c,c+a[0].length,a,l);else if(typeof r=="function")this.addMatch=(a,l,c,u)=>{let f=r(a,l,c);f&&u(c,c+a[0].length,f)};else if(r)this.addMatch=(a,l,c,u)=>u(c,c+a[0].length,r);else throw new RangeError("Either 'decorate' or 'decoration' should be provided to MatchDecorator");this.boundary=o,this.maxLength=s}createDeco(e){let n=new wy,r=n.add.bind(n);for(let{from:i,to:o}of Vpn(e,this.maxLength))_be(e.state.doc,this.regexp,i,o,(s,a)=>this.addMatch(a,e,s,r));return n.finish()}updateDeco(e,n){let r=1e9,i=-1;return e.docChanged&&e.changes.iterChanges((o,s,a,l)=>{l>e.view.viewport.from&&a1e3?this.createDeco(e.view):i>-1?this.updateRange(e.view,n.map(e.changes),r,i):n}updateRange(e,n,r,i){for(let o of e.visibleRanges){let s=Math.max(o.from,r),a=Math.min(o.to,i);if(a>s){let l=e.state.doc.lineAt(s),c=l.tol.from;s--)if(this.boundary.test(l.text[s-1-l.from])){u=s;break}for(;ad.push(v.range(g,m));if(l==c)for(this.regexp.lastIndex=u-l.from;(h=this.regexp.exec(l.text))&&h.indexthis.addMatch(m,e,g,p));n=n.update({filterFrom:u,filterTo:f,filter:(g,m)=>gf,add:d})}}return n}}const iK=/x/.unicode!=null?"gu":"g",Hpn=new RegExp(`[\0-\b ---Ÿ­؜​‎‏\u2028\u2029‭‮⁦⁧⁩\uFEFF-]`,iK),qpn={0:"null",7:"bell",8:"backspace",10:"newline",11:"vertical tab",13:"carriage return",27:"escape",8203:"zero width space",8204:"zero width non-joiner",8205:"zero width joiner",8206:"left-to-right mark",8207:"right-to-left mark",8232:"line separator",8237:"left-to-right override",8238:"right-to-left override",8294:"left-to-right isolate",8295:"right-to-left isolate",8297:"pop directional isolate",8233:"paragraph separator",65279:"zero width no-break space",65532:"object replacement"};let X9=null;function Xpn(){var t;if(X9==null&&typeof document<"u"&&document.body){let e=document.body.style;X9=((t=e.tabSize)!==null&&t!==void 0?t:e.MozTabSize)!=null}return X9||!1}const q3=_t.define({combine(t){let e=ep(t,{render:null,specialChars:Hpn,addSpecialChars:null});return(e.replaceTabs=!Xpn())&&(e.specialChars=new RegExp(" |"+e.specialChars.source,iK)),e.addSpecialChars&&(e.specialChars=new RegExp(e.specialChars.source+"|"+e.addSpecialChars.source,iK)),e}});function Ypn(t={}){return[q3.of(t),Qpn()]}let Sbe=null;function Qpn(){return Sbe||(Sbe=Qi.fromClass(class{constructor(t){this.view=t,this.decorations=It.none,this.decorationCache=Object.create(null),this.decorator=this.makeDecorator(t.state.facet(q3)),this.decorations=this.decorator.createDeco(t)}makeDecorator(t){return new Gpn({regexp:t.specialChars,decoration:(e,n,r)=>{let{doc:i}=n.state,o=ss(e[0],0);if(o==9){let s=i.lineAt(r),a=n.state.tabSize,l=YO(s.text,a,r-s.from);return It.replace({widget:new egn((a-l%a)*this.view.defaultCharacterWidth/this.view.scaleX)})}return this.decorationCache[o]||(this.decorationCache[o]=It.replace({widget:new Jpn(t,o)}))},boundary:t.replaceTabs?void 0:/[^]/})}update(t){let e=t.state.facet(q3);t.startState.facet(q3)!=e?(this.decorator=this.makeDecorator(e),this.decorations=this.decorator.createDeco(t.view)):this.decorations=this.decorator.updateDeco(t,this.decorations)}},{decorations:t=>t.decorations}))}const Kpn="•";function Zpn(t){return t>=32?Kpn:t==10?"␤":String.fromCharCode(9216+t)}class Jpn extends tp{constructor(e,n){super(),this.options=e,this.code=n}eq(e){return e.code==this.code}toDOM(e){let n=Zpn(this.code),r=e.state.phrase("Control character")+" "+(qpn[this.code]||"0x"+this.code.toString(16)),i=this.options.render&&this.options.render(this.code,r,n);if(i)return i;let o=document.createElement("span");return o.textContent=n,o.title=r,o.setAttribute("aria-label",r),o.className="cm-specialChar",o}ignoreEvent(){return!1}}class egn extends tp{constructor(e){super(),this.width=e}eq(e){return e.width==this.width}toDOM(){let e=document.createElement("span");return e.textContent=" ",e.className="cm-tab",e.style.width=this.width+"px",e}ignoreEvent(){return!1}}function tgn(){return rgn}const ngn=It.line({class:"cm-activeLine"}),rgn=Qi.fromClass(class{constructor(t){this.decorations=this.getDeco(t)}update(t){(t.docChanged||t.selectionSet)&&(this.decorations=this.getDeco(t.view))}getDeco(t){let e=-1,n=[];for(let r of t.state.selection.ranges){let i=t.lineBlockAt(r.head);i.from>e&&(n.push(ngn.range(i.from)),e=i.from)}return It.set(n)}},{decorations:t=>t.decorations});class ign extends tp{constructor(e){super(),this.content=e}toDOM(){let e=document.createElement("span");return e.className="cm-placeholder",e.style.pointerEvents="none",e.appendChild(typeof this.content=="string"?document.createTextNode(this.content):this.content),typeof this.content=="string"?e.setAttribute("aria-label","placeholder "+this.content):e.setAttribute("aria-hidden","true"),e}coordsAt(e){let n=e.firstChild?vC(e.firstChild):[];if(!n.length)return null;let r=window.getComputedStyle(e.parentNode),i=sD(n[0],r.direction!="rtl"),o=parseInt(r.lineHeight);return i.bottom-i.top>o*1.5?{left:i.left,right:i.right,top:i.top,bottom:i.top+o}:i}ignoreEvent(){return!1}}function ogn(t){return Qi.fromClass(class{constructor(e){this.view=e,this.placeholder=t?It.set([It.widget({widget:new ign(t),side:1}).range(0)]):It.none}get decorations(){return this.view.state.doc.length?It.none:this.placeholder}},{decorations:e=>e.decorations})}const oK=2e3;function sgn(t,e,n){let r=Math.min(e.line,n.line),i=Math.max(e.line,n.line),o=[];if(e.off>oK||n.off>oK||e.col<0||n.col<0){let s=Math.min(e.off,n.off),a=Math.max(e.off,n.off);for(let l=r;l<=i;l++){let c=t.doc.line(l);c.length<=a&&o.push(Ve.range(c.from+s,c.to+a))}}else{let s=Math.min(e.col,n.col),a=Math.max(e.col,n.col);for(let l=r;l<=i;l++){let c=t.doc.line(l),u=LQ(c.text,s,t.tabSize,!0);if(u<0)o.push(Ve.cursor(c.to));else{let f=LQ(c.text,a,t.tabSize);o.push(Ve.range(c.from+u,c.from+f))}}}return o}function agn(t,e){let n=t.coordsAtPos(t.viewport.from);return n?Math.round(Math.abs((n.left-e)/t.defaultCharacterWidth)):-1}function Cbe(t,e){let n=t.posAtCoords({x:e.clientX,y:e.clientY},!1),r=t.state.doc.lineAt(n),i=n-r.from,o=i>oK?-1:i==r.length?agn(t,e.clientX):YO(r.text,t.state.tabSize,n-r.from);return{line:r.number,col:o,off:i}}function lgn(t,e){let n=Cbe(t,e),r=t.state.selection;return n?{update(i){if(i.docChanged){let o=i.changes.mapPos(i.startState.doc.line(n.line).from),s=i.state.doc.lineAt(o);n={line:s.number,col:n.col,off:Math.min(n.off,s.length)},r=r.map(i.changes)}},get(i,o,s){let a=Cbe(t,i);if(!a)return r;let l=sgn(t.state,n,a);return l.length?s?Ve.create(l.concat(r.ranges)):Ve.create(l):r}}:null}function cgn(t){let e=n=>n.altKey&&n.button==0;return mt.mouseSelectionStyle.of((n,r)=>e(r)?lgn(n,r):null)}const ugn={Alt:[18,t=>!!t.altKey],Control:[17,t=>!!t.ctrlKey],Shift:[16,t=>!!t.shiftKey],Meta:[91,t=>!!t.metaKey]},fgn={style:"cursor: crosshair"};function dgn(t={}){let[e,n]=ugn[t.key||"Alt"],r=Qi.fromClass(class{constructor(i){this.view=i,this.isDown=!1}set(i){this.isDown!=i&&(this.isDown=i,this.view.update([]))}},{eventObservers:{keydown(i){this.set(i.keyCode==e||n(i))},keyup(i){(i.keyCode==e||!n(i))&&this.set(!1)},mousemove(i){this.set(n(i))}}});return[r,mt.contentAttributes.of(i=>{var o;return!((o=i.plugin(r))===null||o===void 0)&&o.isDown?fgn:null})]}const C2="-10000px";class B9e{constructor(e,n,r,i){this.facet=n,this.createTooltipView=r,this.removeTooltipView=i,this.input=e.state.facet(n),this.tooltips=this.input.filter(s=>s);let o=null;this.tooltipViews=this.tooltips.map(s=>o=r(s,o))}update(e,n){var r;let i=e.state.facet(this.facet),o=i.filter(l=>l);if(i===this.input){for(let l of this.tooltipViews)l.update&&l.update(e);return!1}let s=[],a=n?[]:null;for(let l=0;ln[c]=l),n.length=a.length),this.input=i,this.tooltips=o,this.tooltipViews=s,!0}}function hgn(t){let{win:e}=t;return{top:0,left:0,bottom:e.innerHeight,right:e.innerWidth}}const Y9=_t.define({combine:t=>{var e,n,r;return{position:St.ios?"absolute":((e=t.find(i=>i.position))===null||e===void 0?void 0:e.position)||"fixed",parent:((n=t.find(i=>i.parent))===null||n===void 0?void 0:n.parent)||null,tooltipSpace:((r=t.find(i=>i.tooltipSpace))===null||r===void 0?void 0:r.tooltipSpace)||hgn}}}),Obe=new WeakMap,Cle=Qi.fromClass(class{constructor(t){this.view=t,this.above=[],this.inView=!0,this.madeAbsolute=!1,this.lastTransaction=0,this.measureTimeout=-1;let e=t.state.facet(Y9);this.position=e.position,this.parent=e.parent,this.classes=t.themeClasses,this.createContainer(),this.measureReq={read:this.readMeasure.bind(this),write:this.writeMeasure.bind(this),key:this},this.resizeObserver=typeof ResizeObserver=="function"?new ResizeObserver(()=>this.measureSoon()):null,this.manager=new B9e(t,Ole,(n,r)=>this.createTooltip(n,r),n=>{this.resizeObserver&&this.resizeObserver.unobserve(n.dom),n.dom.remove()}),this.above=this.manager.tooltips.map(n=>!!n.above),this.intersectionObserver=typeof IntersectionObserver=="function"?new IntersectionObserver(n=>{Date.now()>this.lastTransaction-50&&n.length>0&&n[n.length-1].intersectionRatio<1&&this.measureSoon()},{threshold:[1]}):null,this.observeIntersection(),t.win.addEventListener("resize",this.measureSoon=this.measureSoon.bind(this)),this.maybeMeasure()}createContainer(){this.parent?(this.container=document.createElement("div"),this.container.style.position="relative",this.container.className=this.view.themeClasses,this.parent.appendChild(this.container)):this.container=this.view.dom}observeIntersection(){if(this.intersectionObserver){this.intersectionObserver.disconnect();for(let t of this.manager.tooltipViews)this.intersectionObserver.observe(t.dom)}}measureSoon(){this.measureTimeout<0&&(this.measureTimeout=setTimeout(()=>{this.measureTimeout=-1,this.maybeMeasure()},50))}update(t){t.transactions.length&&(this.lastTransaction=Date.now());let e=this.manager.update(t,this.above);e&&this.observeIntersection();let n=e||t.geometryChanged,r=t.state.facet(Y9);if(r.position!=this.position&&!this.madeAbsolute){this.position=r.position;for(let i of this.manager.tooltipViews)i.dom.style.position=this.position;n=!0}if(r.parent!=this.parent){this.parent&&this.container.remove(),this.parent=r.parent,this.createContainer();for(let i of this.manager.tooltipViews)this.container.appendChild(i.dom);n=!0}else this.parent&&this.view.themeClasses!=this.classes&&(this.classes=this.container.className=this.view.themeClasses);n&&this.maybeMeasure()}createTooltip(t,e){let n=t.create(this.view),r=e?e.dom:null;if(n.dom.classList.add("cm-tooltip"),t.arrow&&!n.dom.querySelector(".cm-tooltip > .cm-tooltip-arrow")){let i=document.createElement("div");i.className="cm-tooltip-arrow",n.dom.appendChild(i)}return n.dom.style.position=this.position,n.dom.style.top=C2,n.dom.style.left="0px",this.container.insertBefore(n.dom,r),n.mount&&n.mount(this.view),this.resizeObserver&&this.resizeObserver.observe(n.dom),n}destroy(){var t,e,n;this.view.win.removeEventListener("resize",this.measureSoon);for(let r of this.manager.tooltipViews)r.dom.remove(),(t=r.destroy)===null||t===void 0||t.call(r);this.parent&&this.container.remove(),(e=this.resizeObserver)===null||e===void 0||e.disconnect(),(n=this.intersectionObserver)===null||n===void 0||n.disconnect(),clearTimeout(this.measureTimeout)}readMeasure(){let t=this.view.dom.getBoundingClientRect(),e=1,n=1,r=!1;if(this.position=="fixed"&&this.manager.tooltipViews.length){let{dom:i}=this.manager.tooltipViews[0];if(St.gecko)r=i.offsetParent!=this.container.ownerDocument.body;else if(i.style.top==C2&&i.style.left=="0px"){let o=i.getBoundingClientRect();r=Math.abs(o.top+1e4)>1||Math.abs(o.left)>1}}if(r||this.position=="absolute")if(this.parent){let i=this.parent.getBoundingClientRect();i.width&&i.height&&(e=i.width/this.parent.offsetWidth,n=i.height/this.parent.offsetHeight)}else({scaleX:e,scaleY:n}=this.view.viewState);return{editor:t,parent:this.parent?this.container.getBoundingClientRect():t,pos:this.manager.tooltips.map((i,o)=>{let s=this.manager.tooltipViews[o];return s.getCoords?s.getCoords(i.pos):this.view.coordsAtPos(i.pos)}),size:this.manager.tooltipViews.map(({dom:i})=>i.getBoundingClientRect()),space:this.view.state.facet(Y9).tooltipSpace(this.view),scaleX:e,scaleY:n,makeAbsolute:r}}writeMeasure(t){var e;if(t.makeAbsolute){this.madeAbsolute=!0,this.position="absolute";for(let a of this.manager.tooltipViews)a.dom.style.position="absolute"}let{editor:n,space:r,scaleX:i,scaleY:o}=t,s=[];for(let a=0;a=Math.min(n.bottom,r.bottom)||f.rightMath.min(n.right,r.right)+.1){u.style.top=C2;continue}let h=l.arrow?c.dom.querySelector(".cm-tooltip-arrow"):null,p=h?7:0,g=d.right-d.left,m=(e=Obe.get(c))!==null&&e!==void 0?e:d.bottom-d.top,v=c.offset||ggn,y=this.view.textDirection==ii.LTR,x=d.width>r.right-r.left?y?r.left:r.right-d.width:y?Math.max(r.left,Math.min(f.left-(h?14:0)+v.x,r.right-g)):Math.min(Math.max(r.left,f.left-g+(h?14:0)-v.x),r.right-g),b=this.above[a];!l.strictSide&&(b?f.top-(d.bottom-d.top)-v.yr.bottom)&&b==r.bottom-f.bottom>f.top-r.top&&(b=this.above[a]=!b);let w=(b?f.top-r.top:r.bottom-f.bottom)-p;if(wx&&O.top<_+m&&O.bottom>_&&(_=b?O.top-m-2-p:O.bottom+p+2);if(this.position=="absolute"?(u.style.top=(_-t.parent.top)/o+"px",u.style.left=(x-t.parent.left)/i+"px"):(u.style.top=_/o+"px",u.style.left=x/i+"px"),h){let O=f.left+(y?v.x:-v.x)-(x+14-7);h.style.left=O/i+"px"}c.overlap!==!0&&s.push({left:x,top:_,right:S,bottom:_+m}),u.classList.toggle("cm-tooltip-above",b),u.classList.toggle("cm-tooltip-below",!b),c.positioned&&c.positioned(t.space)}}maybeMeasure(){if(this.manager.tooltips.length&&(this.view.inView&&this.view.requestMeasure(this.measureReq),this.inView!=this.view.inView&&(this.inView=this.view.inView,!this.inView)))for(let t of this.manager.tooltipViews)t.dom.style.top=C2}},{eventObservers:{scroll(){this.maybeMeasure()}}}),pgn=mt.baseTheme({".cm-tooltip":{zIndex:100,boxSizing:"border-box"},"&light .cm-tooltip":{border:"1px solid #bbb",backgroundColor:"#f5f5f5"},"&light .cm-tooltip-section:not(:first-child)":{borderTop:"1px solid #bbb"},"&dark .cm-tooltip":{backgroundColor:"#333338",color:"white"},".cm-tooltip-arrow":{height:"7px",width:`${7*2}px`,position:"absolute",zIndex:-1,overflow:"hidden","&:before, &:after":{content:"''",position:"absolute",width:0,height:0,borderLeft:"7px solid transparent",borderRight:"7px solid transparent"},".cm-tooltip-above &":{bottom:"-7px","&:before":{borderTop:"7px solid #bbb"},"&:after":{borderTop:"7px solid #f5f5f5",bottom:"1px"}},".cm-tooltip-below &":{top:"-7px","&:before":{borderBottom:"7px solid #bbb"},"&:after":{borderBottom:"7px solid #f5f5f5",top:"1px"}}},"&dark .cm-tooltip .cm-tooltip-arrow":{"&:before":{borderTopColor:"#333338",borderBottomColor:"#333338"},"&:after":{borderTopColor:"transparent",borderBottomColor:"transparent"}}}),ggn={x:0,y:0},Ole=_t.define({enables:[Cle,pgn]}),lz=_t.define({combine:t=>t.reduce((e,n)=>e.concat(n),[])});class AU{static create(e){return new AU(e)}constructor(e){this.view=e,this.mounted=!1,this.dom=document.createElement("div"),this.dom.classList.add("cm-tooltip-hover"),this.manager=new B9e(e,lz,(n,r)=>this.createHostedView(n,r),n=>n.dom.remove())}createHostedView(e,n){let r=e.create(this.view);return r.dom.classList.add("cm-tooltip-section"),this.dom.insertBefore(r.dom,n?n.dom.nextSibling:this.dom.firstChild),this.mounted&&r.mount&&r.mount(this.view),r}mount(e){for(let n of this.manager.tooltipViews)n.mount&&n.mount(e);this.mounted=!0}positioned(e){for(let n of this.manager.tooltipViews)n.positioned&&n.positioned(e)}update(e){this.manager.update(e)}destroy(){var e;for(let n of this.manager.tooltipViews)(e=n.destroy)===null||e===void 0||e.call(n)}passProp(e){let n;for(let r of this.manager.tooltipViews){let i=r[e];if(i!==void 0){if(n===void 0)n=i;else if(n!==i)return}}return n}get offset(){return this.passProp("offset")}get getCoords(){return this.passProp("getCoords")}get overlap(){return this.passProp("overlap")}get resize(){return this.passProp("resize")}}const mgn=Ole.compute([lz],t=>{let e=t.facet(lz);return e.length===0?null:{pos:Math.min(...e.map(n=>n.pos)),end:Math.max(...e.map(n=>{var r;return(r=n.end)!==null&&r!==void 0?r:n.pos})),create:AU.create,above:e[0].above,arrow:e.some(n=>n.arrow)}});class vgn{constructor(e,n,r,i,o){this.view=e,this.source=n,this.field=r,this.setHover=i,this.hoverTime=o,this.hoverTimeout=-1,this.restartTimeout=-1,this.pending=null,this.lastMove={x:0,y:0,target:e.dom,time:0},this.checkHover=this.checkHover.bind(this),e.dom.addEventListener("mouseleave",this.mouseleave=this.mouseleave.bind(this)),e.dom.addEventListener("mousemove",this.mousemove=this.mousemove.bind(this))}update(){this.pending&&(this.pending=null,clearTimeout(this.restartTimeout),this.restartTimeout=setTimeout(()=>this.startHover(),20))}get active(){return this.view.state.field(this.field)}checkHover(){if(this.hoverTimeout=-1,this.active.length)return;let e=Date.now()-this.lastMove.time;ea.bottom||n.xa.right+e.defaultCharacterWidth)return;let l=e.bidiSpans(e.state.doc.lineAt(i)).find(u=>u.from<=i&&u.to>=i),c=l&&l.dir==ii.RTL?-1:1;o=n.x{this.pending==a&&(this.pending=null,l&&!(Array.isArray(l)&&!l.length)&&e.dispatch({effects:this.setHover.of(Array.isArray(l)?l:[l])}))},l=>ll(e.state,l,"hover tooltip"))}else s&&!(Array.isArray(s)&&!s.length)&&e.dispatch({effects:this.setHover.of(Array.isArray(s)?s:[s])})}get tooltip(){let e=this.view.plugin(Cle),n=e?e.manager.tooltips.findIndex(r=>r.create==AU.create):-1;return n>-1?e.manager.tooltipViews[n]:null}mousemove(e){var n,r;this.lastMove={x:e.clientX,y:e.clientY,target:e.target,time:Date.now()},this.hoverTimeout<0&&(this.hoverTimeout=setTimeout(this.checkHover,this.hoverTime));let{active:i,tooltip:o}=this;if(i.length&&o&&!ygn(o.dom,e)||this.pending){let{pos:s}=i[0]||this.pending,a=(r=(n=i[0])===null||n===void 0?void 0:n.end)!==null&&r!==void 0?r:s;(s==a?this.view.posAtCoords(this.lastMove)!=s:!xgn(this.view,s,a,e.clientX,e.clientY))&&(this.view.dispatch({effects:this.setHover.of([])}),this.pending=null)}}mouseleave(e){clearTimeout(this.hoverTimeout),this.hoverTimeout=-1;let{active:n}=this;if(n.length){let{tooltip:r}=this;r&&r.dom.contains(e.relatedTarget)?this.watchTooltipLeave(r.dom):this.view.dispatch({effects:this.setHover.of([])})}}watchTooltipLeave(e){let n=r=>{e.removeEventListener("mouseleave",n),this.active.length&&!this.view.dom.contains(r.relatedTarget)&&this.view.dispatch({effects:this.setHover.of([])})};e.addEventListener("mouseleave",n)}destroy(){clearTimeout(this.hoverTimeout),this.view.dom.removeEventListener("mouseleave",this.mouseleave),this.view.dom.removeEventListener("mousemove",this.mousemove)}}const FL=4;function ygn(t,e){let n=t.getBoundingClientRect();return e.clientX>=n.left-FL&&e.clientX<=n.right+FL&&e.clientY>=n.top-FL&&e.clientY<=n.bottom+FL}function xgn(t,e,n,r,i,o){let s=t.scrollDOM.getBoundingClientRect(),a=t.documentTop+t.documentPadding.top+t.contentHeight;if(s.left>r||s.righti||Math.min(s.bottom,a)=e&&l<=n}function bgn(t,e={}){let n=rn.define(),r=Qo.define({create(){return[]},update(i,o){if(i.length&&(e.hideOnChange&&(o.docChanged||o.selection)?i=[]:e.hideOn&&(i=i.filter(s=>!e.hideOn(o,s))),o.docChanged)){let s=[];for(let a of i){let l=o.changes.mapPos(a.pos,-1,us.TrackDel);if(l!=null){let c=Object.assign(Object.create(null),a);c.pos=l,c.end!=null&&(c.end=o.changes.mapPos(c.end)),s.push(c)}}i=s}for(let s of o.effects)s.is(n)&&(i=s.value),s.is(wgn)&&(i=[]);return i},provide:i=>lz.from(i)});return{active:r,extension:[r,Qi.define(i=>new vgn(i,t,r,n,e.hoverTime||300)),mgn]}}function U9e(t,e){let n=t.plugin(Cle);if(!n)return null;let r=n.manager.tooltips.indexOf(e);return r<0?null:n.manager.tooltipViews[r]}const wgn=rn.define(),Ebe=_t.define({combine(t){let e,n;for(let r of t)e=e||r.topContainer,n=n||r.bottomContainer;return{topContainer:e,bottomContainer:n}}});function hP(t,e){let n=t.plugin(W9e),r=n?n.specs.indexOf(e):-1;return r>-1?n.panels[r]:null}const W9e=Qi.fromClass(class{constructor(t){this.input=t.state.facet(pP),this.specs=this.input.filter(n=>n),this.panels=this.specs.map(n=>n(t));let e=t.state.facet(Ebe);this.top=new NL(t,!0,e.topContainer),this.bottom=new NL(t,!1,e.bottomContainer),this.top.sync(this.panels.filter(n=>n.top)),this.bottom.sync(this.panels.filter(n=>!n.top));for(let n of this.panels)n.dom.classList.add("cm-panel"),n.mount&&n.mount()}update(t){let e=t.state.facet(Ebe);this.top.container!=e.topContainer&&(this.top.sync([]),this.top=new NL(t.view,!0,e.topContainer)),this.bottom.container!=e.bottomContainer&&(this.bottom.sync([]),this.bottom=new NL(t.view,!1,e.bottomContainer)),this.top.syncClasses(),this.bottom.syncClasses();let n=t.state.facet(pP);if(n!=this.input){let r=n.filter(l=>l),i=[],o=[],s=[],a=[];for(let l of r){let c=this.specs.indexOf(l),u;c<0?(u=l(t.view),a.push(u)):(u=this.panels[c],u.update&&u.update(t)),i.push(u),(u.top?o:s).push(u)}this.specs=r,this.panels=i,this.top.sync(o),this.bottom.sync(s);for(let l of a)l.dom.classList.add("cm-panel"),l.mount&&l.mount()}else for(let r of this.panels)r.update&&r.update(t)}destroy(){this.top.sync([]),this.bottom.sync([])}},{provide:t=>mt.scrollMargins.of(e=>{let n=e.plugin(t);return n&&{top:n.top.scrollMargin(),bottom:n.bottom.scrollMargin()}})});class NL{constructor(e,n,r){this.view=e,this.top=n,this.container=r,this.dom=void 0,this.classes="",this.panels=[],this.syncClasses()}sync(e){for(let n of this.panels)n.destroy&&e.indexOf(n)<0&&n.destroy();this.panels=e,this.syncDOM()}syncDOM(){if(this.panels.length==0){this.dom&&(this.dom.remove(),this.dom=void 0);return}if(!this.dom){this.dom=document.createElement("div"),this.dom.className=this.top?"cm-panels cm-panels-top":"cm-panels cm-panels-bottom",this.dom.style[this.top?"top":"bottom"]="0";let n=this.container||this.view.dom;n.insertBefore(this.dom,this.top?n.firstChild:null)}let e=this.dom.firstChild;for(let n of this.panels)if(n.dom.parentNode==this.dom){for(;e!=n.dom;)e=Tbe(e);e=e.nextSibling}else this.dom.insertBefore(n.dom,e);for(;e;)e=Tbe(e)}scrollMargin(){return!this.dom||this.container?0:Math.max(0,this.top?this.dom.getBoundingClientRect().bottom-Math.max(0,this.view.scrollDOM.getBoundingClientRect().top):Math.min(innerHeight,this.view.scrollDOM.getBoundingClientRect().bottom)-this.dom.getBoundingClientRect().top)}syncClasses(){if(!(!this.container||this.classes==this.view.themeClasses)){for(let e of this.classes.split(" "))e&&this.container.classList.remove(e);for(let e of(this.classes=this.view.themeClasses).split(" "))e&&this.container.classList.add(e)}}}function Tbe(t){let e=t.nextSibling;return t.remove(),e}const pP=_t.define({enables:W9e});class Ug extends M1{compare(e){return this==e||this.constructor==e.constructor&&this.eq(e)}eq(e){return!1}destroy(e){}}Ug.prototype.elementClass="";Ug.prototype.toDOM=void 0;Ug.prototype.mapMode=us.TrackBefore;Ug.prototype.startSide=Ug.prototype.endSide=-1;Ug.prototype.point=!0;const X3=_t.define(),_gn=_t.define(),Sgn={class:"",renderEmptyElements:!1,elementStyle:"",markers:()=>Gn.empty,lineMarker:()=>null,widgetMarker:()=>null,lineMarkerChange:null,initialSpacer:null,updateSpacer:null,domEventHandlers:{}},kk=_t.define();function Cgn(t){return[V9e(),kk.of(Object.assign(Object.assign({},Sgn),t))]}const kbe=_t.define({combine:t=>t.some(e=>e)});function V9e(t){return[Ogn]}const Ogn=Qi.fromClass(class{constructor(t){this.view=t,this.prevViewport=t.viewport,this.dom=document.createElement("div"),this.dom.className="cm-gutters",this.dom.setAttribute("aria-hidden","true"),this.dom.style.minHeight=this.view.contentHeight/this.view.scaleY+"px",this.gutters=t.state.facet(kk).map(e=>new Pbe(t,e));for(let e of this.gutters)this.dom.appendChild(e.dom);this.fixed=!t.state.facet(kbe),this.fixed&&(this.dom.style.position="sticky"),this.syncGutters(!1),t.scrollDOM.insertBefore(this.dom,t.contentDOM)}update(t){if(this.updateGutters(t)){let e=this.prevViewport,n=t.view.viewport,r=Math.min(e.to,n.to)-Math.max(e.from,n.from);this.syncGutters(r<(n.to-n.from)*.8)}t.geometryChanged&&(this.dom.style.minHeight=this.view.contentHeight/this.view.scaleY+"px"),this.view.state.facet(kbe)!=!this.fixed&&(this.fixed=!this.fixed,this.dom.style.position=this.fixed?"sticky":""),this.prevViewport=t.view.viewport}syncGutters(t){let e=this.dom.nextSibling;t&&this.dom.remove();let n=Gn.iter(this.view.state.facet(X3),this.view.viewport.from),r=[],i=this.gutters.map(o=>new Egn(o,this.view.viewport,-this.view.documentPadding.top));for(let o of this.view.viewportLineBlocks)if(r.length&&(r=[]),Array.isArray(o.type)){let s=!0;for(let a of o.type)if(a.type==ka.Text&&s){sK(n,r,a.from);for(let l of i)l.line(this.view,a,r);s=!1}else if(a.widget)for(let l of i)l.widget(this.view,a)}else if(o.type==ka.Text){sK(n,r,o.from);for(let s of i)s.line(this.view,o,r)}else if(o.widget)for(let s of i)s.widget(this.view,o);for(let o of i)o.finish();t&&this.view.scrollDOM.insertBefore(this.dom,e)}updateGutters(t){let e=t.startState.facet(kk),n=t.state.facet(kk),r=t.docChanged||t.heightChanged||t.viewportChanged||!Gn.eq(t.startState.facet(X3),t.state.facet(X3),t.view.viewport.from,t.view.viewport.to);if(e==n)for(let i of this.gutters)i.update(t)&&(r=!0);else{r=!0;let i=[];for(let o of n){let s=e.indexOf(o);s<0?i.push(new Pbe(this.view,o)):(this.gutters[s].update(t),i.push(this.gutters[s]))}for(let o of this.gutters)o.dom.remove(),i.indexOf(o)<0&&o.destroy();for(let o of i)this.dom.appendChild(o.dom);this.gutters=i}return r}destroy(){for(let t of this.gutters)t.destroy();this.dom.remove()}},{provide:t=>mt.scrollMargins.of(e=>{let n=e.plugin(t);return!n||n.gutters.length==0||!n.fixed?null:e.textDirection==ii.LTR?{left:n.dom.offsetWidth*e.scaleX}:{right:n.dom.offsetWidth*e.scaleX}})});function Abe(t){return Array.isArray(t)?t:[t]}function sK(t,e,n){for(;t.value&&t.from<=n;)t.from==n&&e.push(t.value),t.next()}class Egn{constructor(e,n,r){this.gutter=e,this.height=r,this.i=0,this.cursor=Gn.iter(e.markers,n.from)}addElement(e,n,r){let{gutter:i}=this,o=(n.top-this.height)/e.scaleY,s=n.height/e.scaleY;if(this.i==i.elements.length){let a=new G9e(e,s,o,r);i.elements.push(a),i.dom.appendChild(a.dom)}else i.elements[this.i].update(e,s,o,r);this.height=n.bottom,this.i++}line(e,n,r){let i=[];sK(this.cursor,i,n.from),r.length&&(i=i.concat(r));let o=this.gutter.config.lineMarker(e,n,i);o&&i.unshift(o);let s=this.gutter;i.length==0&&!s.config.renderEmptyElements||this.addElement(e,n,i)}widget(e,n){let r=this.gutter.config.widgetMarker(e,n.widget,n),i=r?[r]:null;for(let o of e.state.facet(_gn)){let s=o(e,n.widget,n);s&&(i||(i=[])).push(s)}i&&this.addElement(e,n,i)}finish(){let e=this.gutter;for(;e.elements.length>this.i;){let n=e.elements.pop();e.dom.removeChild(n.dom),n.destroy()}}}class Pbe{constructor(e,n){this.view=e,this.config=n,this.elements=[],this.spacer=null,this.dom=document.createElement("div"),this.dom.className="cm-gutter"+(this.config.class?" "+this.config.class:"");for(let r in n.domEventHandlers)this.dom.addEventListener(r,i=>{let o=i.target,s;if(o!=this.dom&&this.dom.contains(o)){for(;o.parentNode!=this.dom;)o=o.parentNode;let l=o.getBoundingClientRect();s=(l.top+l.bottom)/2}else s=i.clientY;let a=e.lineBlockAtHeight(s-e.documentTop);n.domEventHandlers[r](e,a,i)&&i.preventDefault()});this.markers=Abe(n.markers(e)),n.initialSpacer&&(this.spacer=new G9e(e,0,0,[n.initialSpacer(e)]),this.dom.appendChild(this.spacer.dom),this.spacer.dom.style.cssText+="visibility: hidden; pointer-events: none")}update(e){let n=this.markers;if(this.markers=Abe(this.config.markers(e.view)),this.spacer&&this.config.updateSpacer){let i=this.config.updateSpacer(this.spacer.markers[0],e);i!=this.spacer.markers[0]&&this.spacer.update(e.view,0,0,[i])}let r=e.view.viewport;return!Gn.eq(this.markers,n,r.from,r.to)||(this.config.lineMarkerChange?this.config.lineMarkerChange(e):!1)}destroy(){for(let e of this.elements)e.destroy()}}class G9e{constructor(e,n,r,i){this.height=-1,this.above=0,this.markers=[],this.dom=document.createElement("div"),this.dom.className="cm-gutterElement",this.update(e,n,r,i)}update(e,n,r,i){this.height!=n&&(this.height=n,this.dom.style.height=n+"px"),this.above!=r&&(this.dom.style.marginTop=(this.above=r)?r+"px":""),Tgn(this.markers,i)||this.setMarkers(e,i)}setMarkers(e,n){let r="cm-gutterElement",i=this.dom.firstChild;for(let o=0,s=0;;){let a=s,l=oo(a,l,c)||s(a,l,c):s}return r}})}});class Q9 extends Ug{constructor(e){super(),this.number=e}eq(e){return this.number==e.number}toDOM(){return document.createTextNode(this.number)}}function K9(t,e){return t.state.facet(g_).formatNumber(e,t.state)}const Pgn=kk.compute([g_],t=>({class:"cm-lineNumbers",renderEmptyElements:!1,markers(e){return e.state.facet(kgn)},lineMarker(e,n,r){return r.some(i=>i.toDOM)?null:new Q9(K9(e,e.state.doc.lineAt(n.from).number))},widgetMarker:(e,n,r)=>{for(let i of e.state.facet(Agn)){let o=i(e,n,r);if(o)return o}return null},lineMarkerChange:e=>e.startState.facet(g_)!=e.state.facet(g_),initialSpacer(e){return new Q9(K9(e,Mbe(e.state.doc.lines)))},updateSpacer(e,n){let r=K9(n.view,Mbe(n.view.state.doc.lines));return r==e.number?e:new Q9(r)},domEventHandlers:t.facet(g_).domEventHandlers}));function Mgn(t={}){return[g_.of(t),V9e(),Pgn]}function Mbe(t){let e=9;for(;e{let e=[],n=-1;for(let r of t.selection.ranges){let i=t.doc.lineAt(r.head).from;i>n&&(n=i,e.push(Rgn.range(i)))}return Gn.of(e)});function Ign(){return Dgn}const H9e=1024;let Lgn=0;class Z9{constructor(e,n){this.from=e,this.to=n}}class Sn{constructor(e={}){this.id=Lgn++,this.perNode=!!e.perNode,this.deserialize=e.deserialize||(()=>{throw new Error("This node type doesn't define a deserialize function")})}add(e){if(this.perNode)throw new RangeError("Can't add per-node props to node types");return typeof e!="function"&&(e=kl.match(e)),n=>{let r=e(n);return r===void 0?null:[this,r]}}}Sn.closedBy=new Sn({deserialize:t=>t.split(" ")});Sn.openedBy=new Sn({deserialize:t=>t.split(" ")});Sn.group=new Sn({deserialize:t=>t.split(" ")});Sn.isolate=new Sn({deserialize:t=>{if(t&&t!="rtl"&&t!="ltr"&&t!="auto")throw new RangeError("Invalid value for isolate: "+t);return t||"auto"}});Sn.contextHash=new Sn({perNode:!0});Sn.lookAhead=new Sn({perNode:!0});Sn.mounted=new Sn({perNode:!0});class cz{constructor(e,n,r){this.tree=e,this.overlay=n,this.parser=r}static get(e){return e&&e.props&&e.props[Sn.mounted.id]}}const $gn=Object.create(null);class kl{constructor(e,n,r,i=0){this.name=e,this.props=n,this.id=r,this.flags=i}static define(e){let n=e.props&&e.props.length?Object.create(null):$gn,r=(e.top?1:0)|(e.skipped?2:0)|(e.error?4:0)|(e.name==null?8:0),i=new kl(e.name||"",n,e.id,r);if(e.props){for(let o of e.props)if(Array.isArray(o)||(o=o(i)),o){if(o[0].perNode)throw new RangeError("Can't store a per-node prop on a node type");n[o[0].id]=o[1]}}return i}prop(e){return this.props[e.id]}get isTop(){return(this.flags&1)>0}get isSkipped(){return(this.flags&2)>0}get isError(){return(this.flags&4)>0}get isAnonymous(){return(this.flags&8)>0}is(e){if(typeof e=="string"){if(this.name==e)return!0;let n=this.prop(Sn.group);return n?n.indexOf(e)>-1:!1}return this.id==e}static match(e){let n=Object.create(null);for(let r in e)for(let i of r.split(" "))n[i]=e[r];return r=>{for(let i=r.prop(Sn.group),o=-1;o<(i?i.length:0);o++){let s=n[o<0?r.name:i[o]];if(s)return s}}}}kl.none=new kl("",Object.create(null),0,8);class Ele{constructor(e){this.types=e;for(let n=0;n0;for(let l=this.cursor(s|xo.IncludeAnonymous);;){let c=!1;if(l.from<=o&&l.to>=i&&(!a&&l.type.isAnonymous||n(l)!==!1)){if(l.firstChild())continue;c=!0}for(;c&&r&&(a||!l.type.isAnonymous)&&r(l),!l.nextSibling();){if(!l.parent())return;c=!0}}}prop(e){return e.perNode?this.props?this.props[e.id]:void 0:this.type.prop(e)}get propValues(){let e=[];if(this.props)for(let n in this.props)e.push([+n,this.props[n]]);return e}balance(e={}){return this.children.length<=8?this:Ale(kl.none,this.children,this.positions,0,this.children.length,0,this.length,(n,r,i)=>new co(this.type,n,r,i,this.propValues),e.makeTree||((n,r,i)=>new co(kl.none,n,r,i)))}static build(e){return jgn(e)}}co.empty=new co(kl.none,[],[],0);class Tle{constructor(e,n){this.buffer=e,this.index=n}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}get pos(){return this.index}next(){this.index-=4}fork(){return new Tle(this.buffer,this.index)}}class Oy{constructor(e,n,r){this.buffer=e,this.length=n,this.set=r}get type(){return kl.none}toString(){let e=[];for(let n=0;n0));l=s[l+3]);return a}slice(e,n,r){let i=this.buffer,o=new Uint16Array(n-e),s=0;for(let a=e,l=0;a=e&&ne;case 1:return n<=e&&r>e;case 2:return r>e;case 4:return!0}}function gP(t,e,n,r){for(var i;t.from==t.to||(n<1?t.from>=e:t.from>e)||(n>-1?t.to<=e:t.to0?a.length:-1;e!=c;e+=n){let u=a[e],f=l[e]+s.from;if(q9e(i,r,f,f+u.length)){if(u instanceof Oy){if(o&xo.ExcludeBuffers)continue;let d=u.findChild(0,u.buffer.length,n,r-f,i);if(d>-1)return new th(new Fgn(s,u,e,f),null,d)}else if(o&xo.IncludeAnonymous||!u.type.isAnonymous||kle(u)){let d;if(!(o&xo.IgnoreMounts)&&(d=cz.get(u))&&!d.overlay)return new yl(d.tree,f,e,s);let h=new yl(u,f,e,s);return o&xo.IncludeAnonymous||!h.type.isAnonymous?h:h.nextChild(n<0?u.children.length-1:0,n,r,i)}}}if(o&xo.IncludeAnonymous||!s.type.isAnonymous||(s.index>=0?e=s.index+n:e=n<0?-1:s._parent._tree.children.length,s=s._parent,!s))return null}}get firstChild(){return this.nextChild(0,1,0,4)}get lastChild(){return this.nextChild(this._tree.children.length-1,-1,0,4)}childAfter(e){return this.nextChild(0,1,e,2)}childBefore(e){return this.nextChild(this._tree.children.length-1,-1,e,-2)}enter(e,n,r=0){let i;if(!(r&xo.IgnoreOverlays)&&(i=cz.get(this._tree))&&i.overlay){let o=e-this.from;for(let{from:s,to:a}of i.overlay)if((n>0?s<=o:s=o:a>o))return new yl(i.tree,i.overlay[0].from+this.from,-1,this)}return this.nextChild(0,1,e,n,r)}nextSignificantParent(){let e=this;for(;e.type.isAnonymous&&e._parent;)e=e._parent;return e}get parent(){return this._parent?this._parent.nextSignificantParent():null}get nextSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index+1,1,0,4):null}get prevSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index-1,-1,0,4):null}get tree(){return this._tree}toTree(){return this._tree}toString(){return this._tree.toString()}}function Dbe(t,e,n,r){let i=t.cursor(),o=[];if(!i.firstChild())return o;if(n!=null){for(let s=!1;!s;)if(s=i.type.is(n),!i.nextSibling())return o}for(;;){if(r!=null&&i.type.is(r))return o;if(i.type.is(e)&&o.push(i.node),!i.nextSibling())return r==null?o:[]}}function aK(t,e,n=e.length-1){for(let r=t.parent;n>=0;r=r.parent){if(!r)return!1;if(!r.type.isAnonymous){if(e[n]&&e[n]!=r.name)return!1;n--}}return!0}class Fgn{constructor(e,n,r,i){this.parent=e,this.buffer=n,this.index=r,this.start=i}}class th extends X9e{get name(){return this.type.name}get from(){return this.context.start+this.context.buffer.buffer[this.index+1]}get to(){return this.context.start+this.context.buffer.buffer[this.index+2]}constructor(e,n,r){super(),this.context=e,this._parent=n,this.index=r,this.type=e.buffer.set.types[e.buffer.buffer[r]]}child(e,n,r){let{buffer:i}=this.context,o=i.findChild(this.index+4,i.buffer[this.index+3],e,n-this.context.start,r);return o<0?null:new th(this.context,this,o)}get firstChild(){return this.child(1,0,4)}get lastChild(){return this.child(-1,0,4)}childAfter(e){return this.child(1,e,2)}childBefore(e){return this.child(-1,e,-2)}enter(e,n,r=0){if(r&xo.ExcludeBuffers)return null;let{buffer:i}=this.context,o=i.findChild(this.index+4,i.buffer[this.index+3],n>0?1:-1,e-this.context.start,n);return o<0?null:new th(this.context,this,o)}get parent(){return this._parent||this.context.parent.nextSignificantParent()}externalSibling(e){return this._parent?null:this.context.parent.nextChild(this.context.index+e,e,0,4)}get nextSibling(){let{buffer:e}=this.context,n=e.buffer[this.index+3];return n<(this._parent?e.buffer[this._parent.index+3]:e.buffer.length)?new th(this.context,this._parent,n):this.externalSibling(1)}get prevSibling(){let{buffer:e}=this.context,n=this._parent?this._parent.index+4:0;return this.index==n?this.externalSibling(-1):new th(this.context,this._parent,e.findChild(n,this.index,-1,0,4))}get tree(){return null}toTree(){let e=[],n=[],{buffer:r}=this.context,i=this.index+4,o=r.buffer[this.index+3];if(o>i){let s=r.buffer[this.index+1];e.push(r.slice(i,o,s)),n.push(0)}return new co(this.type,e,n,this.to-this.from)}toString(){return this.context.buffer.childString(this.index)}}function Y9e(t){if(!t.length)return null;let e=0,n=t[0];for(let o=1;on.from||s.to=e){let a=new yl(s.tree,s.overlay[0].from+o.from,-1,o);(i||(i=[r])).push(gP(a,e,n,!1))}}return i?Y9e(i):r}class lK{get name(){return this.type.name}constructor(e,n=0){if(this.mode=n,this.buffer=null,this.stack=[],this.index=0,this.bufferNode=null,e instanceof yl)this.yieldNode(e);else{this._tree=e.context.parent,this.buffer=e.context;for(let r=e._parent;r;r=r._parent)this.stack.unshift(r.index);this.bufferNode=e,this.yieldBuf(e.index)}}yieldNode(e){return e?(this._tree=e,this.type=e.type,this.from=e.from,this.to=e.to,!0):!1}yieldBuf(e,n){this.index=e;let{start:r,buffer:i}=this.buffer;return this.type=n||i.set.types[i.buffer[e]],this.from=r+i.buffer[e+1],this.to=r+i.buffer[e+2],!0}yield(e){return e?e instanceof yl?(this.buffer=null,this.yieldNode(e)):(this.buffer=e.context,this.yieldBuf(e.index,e.type)):!1}toString(){return this.buffer?this.buffer.buffer.childString(this.index):this._tree.toString()}enterChild(e,n,r){if(!this.buffer)return this.yield(this._tree.nextChild(e<0?this._tree._tree.children.length-1:0,e,n,r,this.mode));let{buffer:i}=this.buffer,o=i.findChild(this.index+4,i.buffer[this.index+3],e,n-this.buffer.start,r);return o<0?!1:(this.stack.push(this.index),this.yieldBuf(o))}firstChild(){return this.enterChild(1,0,4)}lastChild(){return this.enterChild(-1,0,4)}childAfter(e){return this.enterChild(1,e,2)}childBefore(e){return this.enterChild(-1,e,-2)}enter(e,n,r=this.mode){return this.buffer?r&xo.ExcludeBuffers?!1:this.enterChild(1,e,n):this.yield(this._tree.enter(e,n,r))}parent(){if(!this.buffer)return this.yieldNode(this.mode&xo.IncludeAnonymous?this._tree._parent:this._tree.parent);if(this.stack.length)return this.yieldBuf(this.stack.pop());let e=this.mode&xo.IncludeAnonymous?this.buffer.parent:this.buffer.parent.nextSignificantParent();return this.buffer=null,this.yieldNode(e)}sibling(e){if(!this.buffer)return this._tree._parent?this.yield(this._tree.index<0?null:this._tree._parent.nextChild(this._tree.index+e,e,0,4,this.mode)):!1;let{buffer:n}=this.buffer,r=this.stack.length-1;if(e<0){let i=r<0?0:this.stack[r]+4;if(this.index!=i)return this.yieldBuf(n.findChild(i,this.index,-1,0,4))}else{let i=n.buffer[this.index+3];if(i<(r<0?n.buffer.length:n.buffer[this.stack[r]+3]))return this.yieldBuf(i)}return r<0?this.yield(this.buffer.parent.nextChild(this.buffer.index+e,e,0,4,this.mode)):!1}nextSibling(){return this.sibling(1)}prevSibling(){return this.sibling(-1)}atLastNode(e){let n,r,{buffer:i}=this;if(i){if(e>0){if(this.index-1)for(let o=n+e,s=e<0?-1:r._tree.children.length;o!=s;o+=e){let a=r._tree.children[o];if(this.mode&xo.IncludeAnonymous||a instanceof Oy||!a.type.isAnonymous||kle(a))return!1}return!0}move(e,n){if(n&&this.enterChild(e,0,4))return!0;for(;;){if(this.sibling(e))return!0;if(this.atLastNode(e)||!this.parent())return!1}}next(e=!0){return this.move(1,e)}prev(e=!0){return this.move(-1,e)}moveTo(e,n=0){for(;(this.from==this.to||(n<1?this.from>=e:this.from>e)||(n>-1?this.to<=e:this.to=0;){for(let s=e;s;s=s._parent)if(s.index==i){if(i==this.index)return s;n=s,r=o+1;break e}i=this.stack[--o]}for(let i=r;i=0;o--){if(o<0)return aK(this.node,e,i);let s=r[n.buffer[this.stack[o]]];if(!s.isAnonymous){if(e[i]&&e[i]!=s.name)return!1;i--}}return!0}}function kle(t){return t.children.some(e=>e instanceof Oy||!e.type.isAnonymous||kle(e))}function jgn(t){var e;let{buffer:n,nodeSet:r,maxBufferLength:i=H9e,reused:o=[],minRepeatType:s=r.types.length}=t,a=Array.isArray(n)?new Tle(n,n.length):n,l=r.types,c=0,u=0;function f(w,_,S,O,k,E){let{id:M,start:A,end:P,size:T}=a,R=u;for(;T<0;)if(a.next(),T==-1){let L=o[M];S.push(L),O.push(A-w);return}else if(T==-3){c=M;return}else if(T==-4){u=M;return}else throw new RangeError(`Unrecognized record size: ${T}`);let I=l[M],B,$,z=A-w;if(P-A<=i&&($=m(a.pos-_,k))){let L=new Uint16Array($.size-$.skip),j=a.pos-$.size,N=L.length;for(;a.pos>j;)N=v($.start,L,N);B=new Oy(L,P-$.start,r),z=$.start-w}else{let L=a.pos-T;a.next();let j=[],N=[],F=M>=s?M:-1,H=0,q=P;for(;a.pos>L;)F>=0&&a.id==F&&a.size>=0?(a.end<=q-i&&(p(j,N,A,H,a.end,q,F,R),H=j.length,q=a.end),a.next()):E>2500?d(A,L,j,N):f(A,L,j,N,F,E+1);if(F>=0&&H>0&&H-1&&H>0){let Y=h(I);B=Ale(I,j,N,0,j.length,0,P-A,Y,Y)}else B=g(I,j,N,P-A,R-P)}S.push(B),O.push(z)}function d(w,_,S,O){let k=[],E=0,M=-1;for(;a.pos>_;){let{id:A,start:P,end:T,size:R}=a;if(R>4)a.next();else{if(M>-1&&P=0;T-=3)A[R++]=k[T],A[R++]=k[T+1]-P,A[R++]=k[T+2]-P,A[R++]=R;S.push(new Oy(A,k[2]-P,r)),O.push(P-w)}}function h(w){return(_,S,O)=>{let k=0,E=_.length-1,M,A;if(E>=0&&(M=_[E])instanceof co){if(!E&&M.type==w&&M.length==O)return M;(A=M.prop(Sn.lookAhead))&&(k=S[E]+M.length+A)}return g(w,_,S,O,k)}}function p(w,_,S,O,k,E,M,A){let P=[],T=[];for(;w.length>O;)P.push(w.pop()),T.push(_.pop()+S-k);w.push(g(r.types[M],P,T,E-k,A-E)),_.push(k-S)}function g(w,_,S,O,k=0,E){if(c){let M=[Sn.contextHash,c];E=E?[M].concat(E):[M]}if(k>25){let M=[Sn.lookAhead,k];E=E?[M].concat(E):[M]}return new co(w,_,S,O,E)}function m(w,_){let S=a.fork(),O=0,k=0,E=0,M=S.end-i,A={size:0,start:0,skip:0};e:for(let P=S.pos-w;S.pos>P;){let T=S.size;if(S.id==_&&T>=0){A.size=O,A.start=k,A.skip=E,E+=4,O+=4,S.next();continue}let R=S.pos-T;if(T<0||R=s?4:0,B=S.start;for(S.next();S.pos>R;){if(S.size<0)if(S.size==-3)I+=4;else break e;else S.id>=s&&(I+=4);S.next()}k=B,O+=T,E+=I}return(_<0||O==w)&&(A.size=O,A.start=k,A.skip=E),A.size>4?A:void 0}function v(w,_,S){let{id:O,start:k,end:E,size:M}=a;if(a.next(),M>=0&&O4){let P=a.pos-(M-4);for(;a.pos>P;)S=v(w,_,S)}_[--S]=A,_[--S]=E-w,_[--S]=k-w,_[--S]=O}else M==-3?c=O:M==-4&&(u=O);return S}let y=[],x=[];for(;a.pos>0;)f(t.start||0,t.bufferStart||0,y,x,-1,0);let b=(e=t.length)!==null&&e!==void 0?e:y.length?x[0]+y[0].length:0;return new co(l[t.topID],y.reverse(),x.reverse(),b)}const Ibe=new WeakMap;function Y3(t,e){if(!t.isAnonymous||e instanceof Oy||e.type!=t)return 1;let n=Ibe.get(e);if(n==null){n=1;for(let r of e.children){if(r.type!=t||!(r instanceof co)){n=1;break}n+=Y3(t,r)}Ibe.set(e,n)}return n}function Ale(t,e,n,r,i,o,s,a,l){let c=0;for(let p=r;p=u)break;_+=S}if(x==b+1){if(_>u){let S=p[b];h(S.children,S.positions,0,S.children.length,g[b]+y);continue}f.push(p[b])}else{let S=g[x-1]+p[x-1].length-w;f.push(Ale(t,p,g,b,x,w,S,null,l))}d.push(w+y-o)}}return h(e,n,r,i,0),(a||l)(f,d,s)}class Bgn{constructor(){this.map=new WeakMap}setBuffer(e,n,r){let i=this.map.get(e);i||this.map.set(e,i=new Map),i.set(n,r)}getBuffer(e,n){let r=this.map.get(e);return r&&r.get(n)}set(e,n){e instanceof th?this.setBuffer(e.context.buffer,e.index,n):e instanceof yl&&this.map.set(e.tree,n)}get(e){return e instanceof th?this.getBuffer(e.context.buffer,e.index):e instanceof yl?this.map.get(e.tree):void 0}cursorSet(e,n){e.buffer?this.setBuffer(e.buffer.buffer,e.index,n):this.map.set(e.tree,n)}cursorGet(e){return e.buffer?this.getBuffer(e.buffer.buffer,e.index):this.map.get(e.tree)}}class Hx{constructor(e,n,r,i,o=!1,s=!1){this.from=e,this.to=n,this.tree=r,this.offset=i,this.open=(o?1:0)|(s?2:0)}get openStart(){return(this.open&1)>0}get openEnd(){return(this.open&2)>0}static addTree(e,n=[],r=!1){let i=[new Hx(0,e.length,e,0,!1,r)];for(let o of n)o.to>e.length&&i.push(o);return i}static applyChanges(e,n,r=128){if(!n.length)return e;let i=[],o=1,s=e.length?e[0]:null;for(let a=0,l=0,c=0;;a++){let u=a=r)for(;s&&s.from=d.from||f<=d.to||c){let h=Math.max(d.from,l)-c,p=Math.min(d.to,f)-c;d=h>=p?null:new Hx(h,p,d.tree,d.offset+c,a>0,!!u)}if(d&&i.push(d),s.to>f)break;s=onew Z9(i.from,i.to)):[new Z9(0,0)]:[new Z9(0,e.length)],this.createParse(e,n||[],r)}parse(e,n,r){let i=this.startParse(e,n,r);for(;;){let o=i.advance();if(o)return o}}}class Ugn{constructor(e){this.string=e}get length(){return this.string.length}chunk(e){return this.string.slice(e)}get lineChunks(){return!1}read(e,n){return this.string.slice(e,n)}}new Sn({perNode:!0});let Wgn=0;class Qc{constructor(e,n,r,i){this.name=e,this.set=n,this.base=r,this.modified=i,this.id=Wgn++}toString(){let{name:e}=this;for(let n of this.modified)n.name&&(e=`${n.name}(${e})`);return e}static define(e,n){let r=typeof e=="string"?e:"?";if(e instanceof Qc&&(n=e),n!=null&&n.base)throw new Error("Can not derive from a modified tag");let i=new Qc(r,[],null,[]);if(i.set.push(i),n)for(let o of n.set)i.set.push(o);return i}static defineModifier(e){let n=new uz(e);return r=>r.modified.indexOf(n)>-1?r:uz.get(r.base||r,r.modified.concat(n).sort((i,o)=>i.id-o.id))}}let Vgn=0;class uz{constructor(e){this.name=e,this.instances=[],this.id=Vgn++}static get(e,n){if(!n.length)return e;let r=n[0].instances.find(a=>a.base==e&&Ggn(n,a.modified));if(r)return r;let i=[],o=new Qc(e.name,i,e,n);for(let a of n)a.instances.push(o);let s=Hgn(n);for(let a of e.set)if(!a.modified.length)for(let l of s)i.push(uz.get(a,l));return o}}function Ggn(t,e){return t.length==e.length&&t.every((n,r)=>n==e[r])}function Hgn(t){let e=[[]];for(let n=0;nr.length-n.length)}function Ple(t){let e=Object.create(null);for(let n in t){let r=t[n];Array.isArray(r)||(r=[r]);for(let i of n.split(" "))if(i){let o=[],s=2,a=i;for(let f=0;;){if(a=="..."&&f>0&&f+3==i.length){s=1;break}let d=/^"(?:[^"\\]|\\.)*?"|[^\/!]+/.exec(a);if(!d)throw new RangeError("Invalid path: "+i);if(o.push(d[0]=="*"?"":d[0][0]=='"'?JSON.parse(d[0]):d[0]),f+=d[0].length,f==i.length)break;let h=i[f++];if(f==i.length&&h=="!"){s=0;break}if(h!="/")throw new RangeError("Invalid path: "+i);a=i.slice(f)}let l=o.length-1,c=o[l];if(!c)throw new RangeError("Invalid path: "+i);let u=new fz(r,s,l>0?o.slice(0,l):null);e[c]=u.sort(e[c])}}return K9e.add(e)}const K9e=new Sn;class fz{constructor(e,n,r,i){this.tags=e,this.mode=n,this.context=r,this.next=i}get opaque(){return this.mode==0}get inherit(){return this.mode==1}sort(e){return!e||e.depth{let s=i;for(let a of o)for(let l of a.set){let c=n[l.id];if(c){s=s?s+" "+c:c;break}}return s},scope:r}}function qgn(t,e){let n=null;for(let r of t){let i=r.style(e);i&&(n=n?n+" "+i:i)}return n}function Xgn(t,e,n,r=0,i=t.length){let o=new Ygn(r,Array.isArray(e)?e:[e],n);o.highlightRange(t.cursor(),r,i,"",o.highlighters),o.flush(i)}class Ygn{constructor(e,n,r){this.at=e,this.highlighters=n,this.span=r,this.class=""}startSpan(e,n){n!=this.class&&(this.flush(e),e>this.at&&(this.at=e),this.class=n)}flush(e){e>this.at&&this.class&&this.span(this.at,e,this.class)}highlightRange(e,n,r,i,o){let{type:s,from:a,to:l}=e;if(a>=r||l<=n)return;s.isTop&&(o=this.highlighters.filter(h=>!h.scope||h.scope(s)));let c=i,u=Qgn(e)||fz.empty,f=qgn(o,u.tags);if(f&&(c&&(c+=" "),c+=f,u.mode==1&&(i+=(i?" ":"")+f)),this.startSpan(Math.max(n,a),c),u.opaque)return;let d=e.tree&&e.tree.prop(Sn.mounted);if(d&&d.overlay){let h=e.node.enter(d.overlay[0].from+a,1),p=this.highlighters.filter(m=>!m.scope||m.scope(d.tree.type)),g=e.firstChild();for(let m=0,v=a;;m++){let y=m=x||!e.nextSibling())););if(!y||x>r)break;v=y.to+a,v>n&&(this.highlightRange(h.cursor(),Math.max(n,y.from+a),Math.min(r,v),"",p),this.startSpan(Math.min(r,v),c))}g&&e.parent()}else if(e.firstChild()){d&&(i="");do if(!(e.to<=n)){if(e.from>=r)break;this.highlightRange(e,n,r,i,o),this.startSpan(Math.min(r,e.to),c)}while(e.nextSibling());e.parent()}}}function Qgn(t){let e=t.type.prop(K9e);for(;e&&e.context&&!t.matchContext(e.context);)e=e.next;return e||null}const dt=Qc.define,jL=dt(),Zm=dt(),Lbe=dt(Zm),$be=dt(Zm),Jm=dt(),BL=dt(Jm),J9=dt(Jm),Sd=dt(),k0=dt(Sd),xd=dt(),bd=dt(),cK=dt(),O2=dt(cK),UL=dt(),Ee={comment:jL,lineComment:dt(jL),blockComment:dt(jL),docComment:dt(jL),name:Zm,variableName:dt(Zm),typeName:Lbe,tagName:dt(Lbe),propertyName:$be,attributeName:dt($be),className:dt(Zm),labelName:dt(Zm),namespace:dt(Zm),macroName:dt(Zm),literal:Jm,string:BL,docString:dt(BL),character:dt(BL),attributeValue:dt(BL),number:J9,integer:dt(J9),float:dt(J9),bool:dt(Jm),regexp:dt(Jm),escape:dt(Jm),color:dt(Jm),url:dt(Jm),keyword:xd,self:dt(xd),null:dt(xd),atom:dt(xd),unit:dt(xd),modifier:dt(xd),operatorKeyword:dt(xd),controlKeyword:dt(xd),definitionKeyword:dt(xd),moduleKeyword:dt(xd),operator:bd,derefOperator:dt(bd),arithmeticOperator:dt(bd),logicOperator:dt(bd),bitwiseOperator:dt(bd),compareOperator:dt(bd),updateOperator:dt(bd),definitionOperator:dt(bd),typeOperator:dt(bd),controlOperator:dt(bd),punctuation:cK,separator:dt(cK),bracket:O2,angleBracket:dt(O2),squareBracket:dt(O2),paren:dt(O2),brace:dt(O2),content:Sd,heading:k0,heading1:dt(k0),heading2:dt(k0),heading3:dt(k0),heading4:dt(k0),heading5:dt(k0),heading6:dt(k0),contentSeparator:dt(Sd),list:dt(Sd),quote:dt(Sd),emphasis:dt(Sd),strong:dt(Sd),link:dt(Sd),monospace:dt(Sd),strikethrough:dt(Sd),inserted:dt(),deleted:dt(),changed:dt(),invalid:dt(),meta:UL,documentMeta:dt(UL),annotation:dt(UL),processingInstruction:dt(UL),definition:Qc.defineModifier("definition"),constant:Qc.defineModifier("constant"),function:Qc.defineModifier("function"),standard:Qc.defineModifier("standard"),local:Qc.defineModifier("local"),special:Qc.defineModifier("special")};for(let t in Ee){let e=Ee[t];e instanceof Qc&&(e.name=t)}Z9e([{tag:Ee.link,class:"tok-link"},{tag:Ee.heading,class:"tok-heading"},{tag:Ee.emphasis,class:"tok-emphasis"},{tag:Ee.strong,class:"tok-strong"},{tag:Ee.keyword,class:"tok-keyword"},{tag:Ee.atom,class:"tok-atom"},{tag:Ee.bool,class:"tok-bool"},{tag:Ee.url,class:"tok-url"},{tag:Ee.labelName,class:"tok-labelName"},{tag:Ee.inserted,class:"tok-inserted"},{tag:Ee.deleted,class:"tok-deleted"},{tag:Ee.literal,class:"tok-literal"},{tag:Ee.string,class:"tok-string"},{tag:Ee.number,class:"tok-number"},{tag:[Ee.regexp,Ee.escape,Ee.special(Ee.string)],class:"tok-string2"},{tag:Ee.variableName,class:"tok-variableName"},{tag:Ee.local(Ee.variableName),class:"tok-variableName tok-local"},{tag:Ee.definition(Ee.variableName),class:"tok-variableName tok-definition"},{tag:Ee.special(Ee.variableName),class:"tok-variableName2"},{tag:Ee.definition(Ee.propertyName),class:"tok-propertyName tok-definition"},{tag:Ee.typeName,class:"tok-typeName"},{tag:Ee.namespace,class:"tok-namespace"},{tag:Ee.className,class:"tok-className"},{tag:Ee.macroName,class:"tok-macroName"},{tag:Ee.propertyName,class:"tok-propertyName"},{tag:Ee.operator,class:"tok-operator"},{tag:Ee.comment,class:"tok-comment"},{tag:Ee.meta,class:"tok-meta"},{tag:Ee.invalid,class:"tok-invalid"},{tag:Ee.punctuation,class:"tok-punctuation"}]);var e7;const m_=new Sn;function Kgn(t){return _t.define({combine:t?e=>e.concat(t):void 0})}const Zgn=new Sn;class Af{constructor(e,n,r=[],i=""){this.data=e,this.name=i,In.prototype.hasOwnProperty("tree")||Object.defineProperty(In.prototype,"tree",{get(){return Vo(this)}}),this.parser=n,this.extension=[Ey.of(this),In.languageData.of((o,s,a)=>{let l=Fbe(o,s,a),c=l.type.prop(m_);if(!c)return[];let u=o.facet(c),f=l.type.prop(Zgn);if(f){let d=l.resolve(s-l.from,a);for(let h of f)if(h.test(d,o)){let p=o.facet(h.facet);return h.type=="replace"?p:p.concat(u)}}return u})].concat(r)}isActiveAt(e,n,r=-1){return Fbe(e,n,r).type.prop(m_)==this.data}findRegions(e){let n=e.facet(Ey);if((n==null?void 0:n.data)==this.data)return[{from:0,to:e.doc.length}];if(!n||!n.allowsNesting)return[];let r=[],i=(o,s)=>{if(o.prop(m_)==this.data){r.push({from:s,to:s+o.length});return}let a=o.prop(Sn.mounted);if(a){if(a.tree.prop(m_)==this.data){if(a.overlay)for(let l of a.overlay)r.push({from:l.from+s,to:l.to+s});else r.push({from:s,to:s+o.length});return}else if(a.overlay){let l=r.length;if(i(a.tree,a.overlay[0].from+s),r.length>l)return}}for(let l=0;lr.isTop?n:void 0)]}),e.name)}configure(e,n){return new mP(this.data,this.parser.configure(e),n||this.name)}get allowsNesting(){return this.parser.hasWrappers()}}function Vo(t){let e=t.field(Af.state,!1);return e?e.tree:co.empty}class Jgn{constructor(e){this.doc=e,this.cursorPos=0,this.string="",this.cursor=e.iter()}get length(){return this.doc.length}syncTo(e){return this.string=this.cursor.next(e-this.cursorPos).value,this.cursorPos=e+this.string.length,this.cursorPos-this.string.length}chunk(e){return this.syncTo(e),this.string}get lineChunks(){return!0}read(e,n){let r=this.cursorPos-this.string.length;return e=this.cursorPos?this.doc.sliceString(e,n):this.string.slice(e-r,n-r)}}let E2=null;class dz{constructor(e,n,r=[],i,o,s,a,l){this.parser=e,this.state=n,this.fragments=r,this.tree=i,this.treeLen=o,this.viewport=s,this.skipped=a,this.scheduleOn=l,this.parse=null,this.tempSkipped=[]}static create(e,n,r){return new dz(e,n,[],co.empty,0,r,[],null)}startParse(){return this.parser.startParse(new Jgn(this.state.doc),this.fragments)}work(e,n){return n!=null&&n>=this.state.doc.length&&(n=void 0),this.tree!=co.empty&&this.isDone(n??this.state.doc.length)?(this.takeTree(),!0):this.withContext(()=>{var r;if(typeof e=="number"){let i=Date.now()+e;e=()=>Date.now()>i}for(this.parse||(this.parse=this.startParse()),n!=null&&(this.parse.stoppedAt==null||this.parse.stoppedAt>n)&&n=this.treeLen&&((this.parse.stoppedAt==null||this.parse.stoppedAt>e)&&this.parse.stopAt(e),this.withContext(()=>{for(;!(n=this.parse.advance()););}),this.treeLen=e,this.tree=n,this.fragments=this.withoutTempSkipped(Hx.addTree(this.tree,this.fragments,!0)),this.parse=null)}withContext(e){let n=E2;E2=this;try{return e()}finally{E2=n}}withoutTempSkipped(e){for(let n;n=this.tempSkipped.pop();)e=Nbe(e,n.from,n.to);return e}changes(e,n){let{fragments:r,tree:i,treeLen:o,viewport:s,skipped:a}=this;if(this.takeTree(),!e.empty){let l=[];if(e.iterChangedRanges((c,u,f,d)=>l.push({fromA:c,toA:u,fromB:f,toB:d})),r=Hx.applyChanges(r,l),i=co.empty,o=0,s={from:e.mapPos(s.from,-1),to:e.mapPos(s.to,1)},this.skipped.length){a=[];for(let c of this.skipped){let u=e.mapPos(c.from,1),f=e.mapPos(c.to,-1);ue.from&&(this.fragments=Nbe(this.fragments,i,o),this.skipped.splice(r--,1))}return this.skipped.length>=n?!1:(this.reset(),!0)}reset(){this.parse&&(this.takeTree(),this.parse=null)}skipUntilInView(e,n){this.skipped.push({from:e,to:n})}static getSkippingParser(e){return new class extends Q9e{createParse(n,r,i){let o=i[0].from,s=i[i.length-1].to;return{parsedPos:o,advance(){let l=E2;if(l){for(let c of i)l.tempSkipped.push(c);e&&(l.scheduleOn=l.scheduleOn?Promise.all([l.scheduleOn,e]):e)}return this.parsedPos=s,new co(kl.none,[],[],s-o)},stoppedAt:null,stopAt(){}}}}}isDone(e){e=Math.min(e,this.state.doc.length);let n=this.fragments;return this.treeLen>=e&&n.length&&n[0].from==0&&n[0].to>=e}static get(){return E2}}function Nbe(t,e,n){return Hx.applyChanges(t,[{fromA:e,toA:n,fromB:e,toB:n}])}class wC{constructor(e){this.context=e,this.tree=e.tree}apply(e){if(!e.docChanged&&this.tree==this.context.tree)return this;let n=this.context.changes(e.changes,e.state),r=this.context.treeLen==e.startState.doc.length?void 0:Math.max(e.changes.mapPos(this.context.treeLen),n.viewport.to);return n.work(20,r)||n.takeTree(),new wC(n)}static init(e){let n=Math.min(3e3,e.doc.length),r=dz.create(e.facet(Ey).parser,e,{from:0,to:n});return r.work(20,n)||r.takeTree(),new wC(r)}}Af.state=Qo.define({create:wC.init,update(t,e){for(let n of e.effects)if(n.is(Af.setState))return n.value;return e.startState.facet(Ey)!=e.state.facet(Ey)?wC.init(e.state):t.apply(e)}});let J9e=t=>{let e=setTimeout(()=>t(),500);return()=>clearTimeout(e)};typeof requestIdleCallback<"u"&&(J9e=t=>{let e=-1,n=setTimeout(()=>{e=requestIdleCallback(t,{timeout:400})},100);return()=>e<0?clearTimeout(n):cancelIdleCallback(e)});const t7=typeof navigator<"u"&&(!((e7=navigator.scheduling)===null||e7===void 0)&&e7.isInputPending)?()=>navigator.scheduling.isInputPending():null,emn=Qi.fromClass(class{constructor(e){this.view=e,this.working=null,this.workScheduled=0,this.chunkEnd=-1,this.chunkBudget=-1,this.work=this.work.bind(this),this.scheduleWork()}update(e){let n=this.view.state.field(Af.state).context;(n.updateViewport(e.view.viewport)||this.view.viewport.to>n.treeLen)&&this.scheduleWork(),(e.docChanged||e.selectionSet)&&(this.view.hasFocus&&(this.chunkBudget+=50),this.scheduleWork()),this.checkAsyncSchedule(n)}scheduleWork(){if(this.working)return;let{state:e}=this.view,n=e.field(Af.state);(n.tree!=n.context.tree||!n.context.isDone(e.doc.length))&&(this.working=J9e(this.work))}work(e){this.working=null;let n=Date.now();if(this.chunkEndi+1e3,l=o.context.work(()=>t7&&t7()||Date.now()>s,i+(a?0:1e5));this.chunkBudget-=Date.now()-n,(l||this.chunkBudget<=0)&&(o.context.takeTree(),this.view.dispatch({effects:Af.setState.of(new wC(o.context))})),this.chunkBudget>0&&!(l&&!a)&&this.scheduleWork(),this.checkAsyncSchedule(o.context)}checkAsyncSchedule(e){e.scheduleOn&&(this.workScheduled++,e.scheduleOn.then(()=>this.scheduleWork()).catch(n=>ll(this.view.state,n)).then(()=>this.workScheduled--),e.scheduleOn=null)}destroy(){this.working&&this.working()}isWorking(){return!!(this.working||this.workScheduled>0)}},{eventHandlers:{focus(){this.scheduleWork()}}}),Ey=_t.define({combine(t){return t.length?t[0]:null},enables:t=>[Af.state,emn,mt.contentAttributes.compute([t],e=>{let n=e.facet(t);return n&&n.name?{"data-language":n.name}:{}})]});class e7e{constructor(e,n=[]){this.language=e,this.support=n,this.extension=[e,n]}}const tmn=_t.define(),fD=_t.define({combine:t=>{if(!t.length)return" ";let e=t[0];if(!e||/\S/.test(e)||Array.from(e).some(n=>n!=e[0]))throw new Error("Invalid indent unit: "+JSON.stringify(t[0]));return e}});function hz(t){let e=t.facet(fD);return e.charCodeAt(0)==9?t.tabSize*e.length:e.length}function vP(t,e){let n="",r=t.tabSize,i=t.facet(fD)[0];if(i==" "){for(;e>=r;)n+=" ",e-=r;i=" "}for(let o=0;o=e?nmn(t,n,e):null}class PU{constructor(e,n={}){this.state=e,this.options=n,this.unit=hz(e)}lineAt(e,n=1){let r=this.state.doc.lineAt(e),{simulateBreak:i,simulateDoubleBreak:o}=this.options;return i!=null&&i>=r.from&&i<=r.to?o&&i==e?{text:"",from:e}:(n<0?i-1&&(o+=s-this.countColumn(r,r.search(/\S|$/))),o}countColumn(e,n=e.length){return YO(e,this.state.tabSize,n)}lineIndent(e,n=1){let{text:r,from:i}=this.lineAt(e,n),o=this.options.overrideIndentation;if(o){let s=o(i);if(s>-1)return s}return this.countColumn(r,r.search(/\S|$/))}get simulatedBreak(){return this.options.simulateBreak||null}}const Rle=new Sn;function nmn(t,e,n){let r=e.resolveStack(n),i=r.node.enterUnfinishedNodesBefore(n);if(i!=r.node){let o=[];for(let s=i;s!=r.node;s=s.parent)o.push(s);for(let s=o.length-1;s>=0;s--)r={node:o[s],next:r}}return t7e(r,t,n)}function t7e(t,e,n){for(let r=t;r;r=r.next){let i=imn(r.node);if(i)return i(Dle.create(e,n,r))}return 0}function rmn(t){return t.pos==t.options.simulateBreak&&t.options.simulateDoubleBreak}function imn(t){let e=t.type.prop(Rle);if(e)return e;let n=t.firstChild,r;if(n&&(r=n.type.prop(Sn.closedBy))){let i=t.lastChild,o=i&&r.indexOf(i.name)>-1;return s=>n7e(s,!0,1,void 0,o&&!rmn(s)?i.from:void 0)}return t.parent==null?omn:null}function omn(){return 0}class Dle extends PU{constructor(e,n,r){super(e.state,e.options),this.base=e,this.pos=n,this.context=r}get node(){return this.context.node}static create(e,n,r){return new Dle(e,n,r)}get textAfter(){return this.textAfterPos(this.pos)}get baseIndent(){return this.baseIndentFor(this.node)}baseIndentFor(e){let n=this.state.doc.lineAt(e.from);for(;;){let r=e.resolve(n.from);for(;r.parent&&r.parent.from==r.from;)r=r.parent;if(smn(r,e))break;n=this.state.doc.lineAt(r.from)}return this.lineIndent(n.from)}continue(){return t7e(this.context.next,this.base,this.pos)}}function smn(t,e){for(let n=e;n;n=n.parent)if(t==n)return!0;return!1}function amn(t){let e=t.node,n=e.childAfter(e.from),r=e.lastChild;if(!n)return null;let i=t.options.simulateBreak,o=t.state.doc.lineAt(n.from),s=i==null||i<=o.from?o.to:Math.min(o.to,i);for(let a=n.to;;){let l=e.childAfter(a);if(!l||l==r)return null;if(!l.type.isSkipped)return l.fromn7e(r,e,n,t)}function n7e(t,e,n,r,i){let o=t.textAfter,s=o.match(/^\s*/)[0].length,a=r&&o.slice(s,s+r.length)==r||i==t.pos+s,l=e?amn(t):null;return l?a?t.column(l.from):t.column(l.to):t.baseIndent+(a?0:t.unit*n)}function zbe({except:t,units:e=1}={}){return n=>{let r=t&&t.test(n.textAfter);return n.baseIndent+(r?0:e*n.unit)}}const lmn=200;function cmn(){return In.transactionFilter.of(t=>{if(!t.docChanged||!t.isUserEvent("input.type")&&!t.isUserEvent("input.complete"))return t;let e=t.startState.languageDataAt("indentOnInput",t.startState.selection.main.head);if(!e.length)return t;let n=t.newDoc,{head:r}=t.newSelection.main,i=n.lineAt(r);if(r>i.from+lmn)return t;let o=n.sliceString(i.from,r);if(!e.some(c=>c.test(o)))return t;let{state:s}=t,a=-1,l=[];for(let{head:c}of s.selection.ranges){let u=s.doc.lineAt(c);if(u.from==a)continue;a=u.from;let f=Mle(s,u.from);if(f==null)continue;let d=/^\s*/.exec(u.text)[0],h=vP(s,f);d!=h&&l.push({from:u.from,to:u.from+d.length,insert:h})}return l.length?[t,{changes:l,sequential:!0}]:t})}const umn=_t.define(),Ile=new Sn;function r7e(t){let e=t.firstChild,n=t.lastChild;return e&&e.ton)continue;if(o&&a.from=e&&c.to>n&&(o=c)}}return o}function dmn(t){let e=t.lastChild;return e&&e.to==t.to&&e.type.isError}function pz(t,e,n){for(let r of t.facet(umn)){let i=r(t,e,n);if(i)return i}return fmn(t,e,n)}function i7e(t,e){let n=e.mapPos(t.from,1),r=e.mapPos(t.to,-1);return n>=r?void 0:{from:n,to:r}}const MU=rn.define({map:i7e}),dD=rn.define({map:i7e});function o7e(t){let e=[];for(let{head:n}of t.state.selection.ranges)e.some(r=>r.from<=n&&r.to>=n)||e.push(t.lineBlockAt(n));return e}const L1=Qo.define({create(){return It.none},update(t,e){t=t.map(e.changes);for(let n of e.effects)if(n.is(MU)&&!hmn(t,n.value.from,n.value.to)){let{preparePlaceholder:r}=e.state.facet(l7e),i=r?It.replace({widget:new bmn(r(e.state,n.value))}):jbe;t=t.update({add:[i.range(n.value.from,n.value.to)]})}else n.is(dD)&&(t=t.update({filter:(r,i)=>n.value.from!=r||n.value.to!=i,filterFrom:n.value.from,filterTo:n.value.to}));if(e.selection){let n=!1,{head:r}=e.selection.main;t.between(r,r,(i,o)=>{ir&&(n=!0)}),n&&(t=t.update({filterFrom:r,filterTo:r,filter:(i,o)=>o<=r||i>=r}))}return t},provide:t=>mt.decorations.from(t),toJSON(t,e){let n=[];return t.between(0,e.doc.length,(r,i)=>{n.push(r,i)}),n},fromJSON(t){if(!Array.isArray(t)||t.length%2)throw new RangeError("Invalid JSON for fold state");let e=[];for(let n=0;n{(!i||i.from>o)&&(i={from:o,to:s})}),i}function hmn(t,e,n){let r=!1;return t.between(e,e,(i,o)=>{i==e&&o==n&&(r=!0)}),r}function s7e(t,e){return t.field(L1,!1)?e:e.concat(rn.appendConfig.of(c7e()))}const pmn=t=>{for(let e of o7e(t)){let n=pz(t.state,e.from,e.to);if(n)return t.dispatch({effects:s7e(t.state,[MU.of(n),a7e(t,n)])}),!0}return!1},gmn=t=>{if(!t.state.field(L1,!1))return!1;let e=[];for(let n of o7e(t)){let r=gz(t.state,n.from,n.to);r&&e.push(dD.of(r),a7e(t,r,!1))}return e.length&&t.dispatch({effects:e}),e.length>0};function a7e(t,e,n=!0){let r=t.state.doc.lineAt(e.from).number,i=t.state.doc.lineAt(e.to).number;return mt.announce.of(`${t.state.phrase(n?"Folded lines":"Unfolded lines")} ${r} ${t.state.phrase("to")} ${i}.`)}const mmn=t=>{let{state:e}=t,n=[];for(let r=0;r{let e=t.state.field(L1,!1);if(!e||!e.size)return!1;let n=[];return e.between(0,t.state.doc.length,(r,i)=>{n.push(dD.of({from:r,to:i}))}),t.dispatch({effects:n}),!0},ymn=[{key:"Ctrl-Shift-[",mac:"Cmd-Alt-[",run:pmn},{key:"Ctrl-Shift-]",mac:"Cmd-Alt-]",run:gmn},{key:"Ctrl-Alt-[",run:mmn},{key:"Ctrl-Alt-]",run:vmn}],xmn={placeholderDOM:null,preparePlaceholder:null,placeholderText:"…"},l7e=_t.define({combine(t){return ep(t,xmn)}});function c7e(t){return[L1,Smn]}function u7e(t,e){let{state:n}=t,r=n.facet(l7e),i=s=>{let a=t.lineBlockAt(t.posAtDOM(s.target)),l=gz(t.state,a.from,a.to);l&&t.dispatch({effects:dD.of(l)}),s.preventDefault()};if(r.placeholderDOM)return r.placeholderDOM(t,i,e);let o=document.createElement("span");return o.textContent=r.placeholderText,o.setAttribute("aria-label",n.phrase("folded code")),o.title=n.phrase("unfold"),o.className="cm-foldPlaceholder",o.onclick=i,o}const jbe=It.replace({widget:new class extends tp{toDOM(t){return u7e(t,null)}}});class bmn extends tp{constructor(e){super(),this.value=e}eq(e){return this.value==e.value}toDOM(e){return u7e(e,this.value)}}const wmn={openText:"⌄",closedText:"›",markerDOM:null,domEventHandlers:{},foldingChanged:()=>!1};class r7 extends Ug{constructor(e,n){super(),this.config=e,this.open=n}eq(e){return this.config==e.config&&this.open==e.open}toDOM(e){if(this.config.markerDOM)return this.config.markerDOM(this.open);let n=document.createElement("span");return n.textContent=this.open?this.config.openText:this.config.closedText,n.title=e.state.phrase(this.open?"Fold line":"Unfold line"),n}}function _mn(t={}){let e=Object.assign(Object.assign({},wmn),t),n=new r7(e,!0),r=new r7(e,!1),i=Qi.fromClass(class{constructor(s){this.from=s.viewport.from,this.markers=this.buildMarkers(s)}update(s){(s.docChanged||s.viewportChanged||s.startState.facet(Ey)!=s.state.facet(Ey)||s.startState.field(L1,!1)!=s.state.field(L1,!1)||Vo(s.startState)!=Vo(s.state)||e.foldingChanged(s))&&(this.markers=this.buildMarkers(s.view))}buildMarkers(s){let a=new wy;for(let l of s.viewportLineBlocks){let c=gz(s.state,l.from,l.to)?r:pz(s.state,l.from,l.to)?n:null;c&&a.add(l.from,l.from,c)}return a.finish()}}),{domEventHandlers:o}=e;return[i,Cgn({class:"cm-foldGutter",markers(s){var a;return((a=s.plugin(i))===null||a===void 0?void 0:a.markers)||Gn.empty},initialSpacer(){return new r7(e,!1)},domEventHandlers:Object.assign(Object.assign({},o),{click:(s,a,l)=>{if(o.click&&o.click(s,a,l))return!0;let c=gz(s.state,a.from,a.to);if(c)return s.dispatch({effects:dD.of(c)}),!0;let u=pz(s.state,a.from,a.to);return u?(s.dispatch({effects:MU.of(u)}),!0):!1}})}),c7e()]}const Smn=mt.baseTheme({".cm-foldPlaceholder":{backgroundColor:"#eee",border:"1px solid #ddd",color:"#888",borderRadius:".2em",margin:"0 1px",padding:"0 1px",cursor:"pointer"},".cm-foldGutter span":{padding:"0 1px",cursor:"pointer"}});class hD{constructor(e,n){this.specs=e;let r;function i(a){let l=_y.newName();return(r||(r=Object.create(null)))["."+l]=a,l}const o=typeof n.all=="string"?n.all:n.all?i(n.all):void 0,s=n.scope;this.scope=s instanceof Af?a=>a.prop(m_)==s.data:s?a=>a==s:void 0,this.style=Z9e(e.map(a=>({tag:a.tag,class:a.class||i(Object.assign({},a,{tag:null}))})),{all:o}).style,this.module=r?new _y(r):null,this.themeType=n.themeType}static define(e,n){return new hD(e,n||{})}}const uK=_t.define(),f7e=_t.define({combine(t){return t.length?[t[0]]:null}});function i7(t){let e=t.facet(uK);return e.length?e:t.facet(f7e)}function d7e(t,e){let n=[Omn],r;return t instanceof hD&&(t.module&&n.push(mt.styleModule.of(t.module)),r=t.themeType),e!=null&&e.fallback?n.push(f7e.of(t)):r?n.push(uK.computeN([mt.darkTheme],i=>i.facet(mt.darkTheme)==(r=="dark")?[t]:[])):n.push(uK.of(t)),n}class Cmn{constructor(e){this.markCache=Object.create(null),this.tree=Vo(e.state),this.decorations=this.buildDeco(e,i7(e.state)),this.decoratedTo=e.viewport.to}update(e){let n=Vo(e.state),r=i7(e.state),i=r!=i7(e.startState),{viewport:o}=e.view,s=e.changes.mapPos(this.decoratedTo,1);n.length=o.to?(this.decorations=this.decorations.map(e.changes),this.decoratedTo=s):(n!=this.tree||e.viewportChanged||i)&&(this.tree=n,this.decorations=this.buildDeco(e.view,r),this.decoratedTo=o.to)}buildDeco(e,n){if(!n||!this.tree.length)return It.none;let r=new wy;for(let{from:i,to:o}of e.visibleRanges)Xgn(this.tree,n,(s,a,l)=>{r.add(s,a,this.markCache[l]||(this.markCache[l]=It.mark({class:l})))},i,o);return r.finish()}}const Omn=n0.high(Qi.fromClass(Cmn,{decorations:t=>t.decorations})),Emn=hD.define([{tag:Ee.meta,color:"#404740"},{tag:Ee.link,textDecoration:"underline"},{tag:Ee.heading,textDecoration:"underline",fontWeight:"bold"},{tag:Ee.emphasis,fontStyle:"italic"},{tag:Ee.strong,fontWeight:"bold"},{tag:Ee.strikethrough,textDecoration:"line-through"},{tag:Ee.keyword,color:"#708"},{tag:[Ee.atom,Ee.bool,Ee.url,Ee.contentSeparator,Ee.labelName],color:"#219"},{tag:[Ee.literal,Ee.inserted],color:"#164"},{tag:[Ee.string,Ee.deleted],color:"#a11"},{tag:[Ee.regexp,Ee.escape,Ee.special(Ee.string)],color:"#e40"},{tag:Ee.definition(Ee.variableName),color:"#00f"},{tag:Ee.local(Ee.variableName),color:"#30a"},{tag:[Ee.typeName,Ee.namespace],color:"#085"},{tag:Ee.className,color:"#167"},{tag:[Ee.special(Ee.variableName),Ee.macroName],color:"#256"},{tag:Ee.definition(Ee.propertyName),color:"#00c"},{tag:Ee.comment,color:"#940"},{tag:Ee.invalid,color:"#f00"}]),Tmn=mt.baseTheme({"&.cm-focused .cm-matchingBracket":{backgroundColor:"#328c8252"},"&.cm-focused .cm-nonmatchingBracket":{backgroundColor:"#bb555544"}}),h7e=1e4,p7e="()[]{}",g7e=_t.define({combine(t){return ep(t,{afterCursor:!0,brackets:p7e,maxScanDistance:h7e,renderMatch:Pmn})}}),kmn=It.mark({class:"cm-matchingBracket"}),Amn=It.mark({class:"cm-nonmatchingBracket"});function Pmn(t){let e=[],n=t.matched?kmn:Amn;return e.push(n.range(t.start.from,t.start.to)),t.end&&e.push(n.range(t.end.from,t.end.to)),e}const Mmn=Qo.define({create(){return It.none},update(t,e){if(!e.docChanged&&!e.selection)return t;let n=[],r=e.state.facet(g7e);for(let i of e.state.selection.ranges){if(!i.empty)continue;let o=nh(e.state,i.head,-1,r)||i.head>0&&nh(e.state,i.head-1,1,r)||r.afterCursor&&(nh(e.state,i.head,1,r)||i.headmt.decorations.from(t)}),Rmn=[Mmn,Tmn];function Dmn(t={}){return[g7e.of(t),Rmn]}const Imn=new Sn;function fK(t,e,n){let r=t.prop(e<0?Sn.openedBy:Sn.closedBy);if(r)return r;if(t.name.length==1){let i=n.indexOf(t.name);if(i>-1&&i%2==(e<0?1:0))return[n[i+e]]}return null}function dK(t){let e=t.type.prop(Imn);return e?e(t.node):t}function nh(t,e,n,r={}){let i=r.maxScanDistance||h7e,o=r.brackets||p7e,s=Vo(t),a=s.resolveInner(e,n);for(let l=a;l;l=l.parent){let c=fK(l.type,n,o);if(c&&l.from0?e>=u.from&&eu.from&&e<=u.to))return Lmn(t,e,n,l,u,c,o)}}return $mn(t,e,n,s,a.type,i,o)}function Lmn(t,e,n,r,i,o,s){let a=r.parent,l={from:i.from,to:i.to},c=0,u=a==null?void 0:a.cursor();if(u&&(n<0?u.childBefore(r.from):u.childAfter(r.to)))do if(n<0?u.to<=r.from:u.from>=r.to){if(c==0&&o.indexOf(u.type.name)>-1&&u.from0)return null;let c={from:n<0?e-1:e,to:n>0?e+1:e},u=t.doc.iterRange(e,n>0?t.doc.length:0),f=0;for(let d=0;!u.next().done&&d<=o;){let h=u.value;n<0&&(d+=h.length);let p=e+d*n;for(let g=n>0?0:h.length-1,m=n>0?h.length:-1;g!=m;g+=n){let v=s.indexOf(h[g]);if(!(v<0||r.resolveInner(p+g,1).type!=i))if(v%2==0==n>0)f++;else{if(f==1)return{start:c,end:{from:p+g,to:p+g+1},matched:v>>1==l>>1};f--}}n>0&&(d+=h.length)}return u.done?{start:c,matched:!1}:null}const Fmn=Object.create(null),Bbe=[kl.none],Ube=[],Wbe=Object.create(null),Nmn=Object.create(null);for(let[t,e]of[["variable","variableName"],["variable-2","variableName.special"],["string-2","string.special"],["def","variableName.definition"],["tag","tagName"],["attribute","attributeName"],["type","typeName"],["builtin","variableName.standard"],["qualifier","modifier"],["error","invalid"],["header","heading"],["property","propertyName"]])Nmn[t]=zmn(Fmn,e);function o7(t,e){Ube.indexOf(t)>-1||(Ube.push(t),console.warn(e))}function zmn(t,e){let n=[];for(let a of e.split(" ")){let l=[];for(let c of a.split(".")){let u=t[c]||Ee[c];u?typeof u=="function"?l.length?l=l.map(u):o7(c,`Modifier ${c} used at start of tag`):l.length?o7(c,`Tag ${c} used as modifier`):l=Array.isArray(u)?u:[u]:o7(c,`Unknown highlighting tag ${c}`)}for(let c of l)n.push(c)}if(!n.length)return 0;let r=e.replace(/ /g,"_"),i=r+" "+n.map(a=>a.id),o=Wbe[i];if(o)return o.id;let s=Wbe[i]=kl.define({id:Bbe.length,name:r,props:[Ple({[r]:n})]});return Bbe.push(s),s.id}ii.RTL,ii.LTR;const jmn=t=>{let{state:e}=t,n=e.doc.lineAt(e.selection.main.from),r=$le(t.state,n.from);return r.line?Bmn(t):r.block?Wmn(t):!1};function Lle(t,e){return({state:n,dispatch:r})=>{if(n.readOnly)return!1;let i=t(e,n);return i?(r(n.update(i)),!0):!1}}const Bmn=Lle(Hmn,0),Umn=Lle(m7e,0),Wmn=Lle((t,e)=>m7e(t,e,Gmn(e)),0);function $le(t,e){let n=t.languageDataAt("commentTokens",e);return n.length?n[0]:{}}const T2=50;function Vmn(t,{open:e,close:n},r,i){let o=t.sliceDoc(r-T2,r),s=t.sliceDoc(i,i+T2),a=/\s*$/.exec(o)[0].length,l=/^\s*/.exec(s)[0].length,c=o.length-a;if(o.slice(c-e.length,c)==e&&s.slice(l,l+n.length)==n)return{open:{pos:r-a,margin:a&&1},close:{pos:i+l,margin:l&&1}};let u,f;i-r<=2*T2?u=f=t.sliceDoc(r,i):(u=t.sliceDoc(r,r+T2),f=t.sliceDoc(i-T2,i));let d=/^\s*/.exec(u)[0].length,h=/\s*$/.exec(f)[0].length,p=f.length-h-n.length;return u.slice(d,d+e.length)==e&&f.slice(p,p+n.length)==n?{open:{pos:r+d+e.length,margin:/\s/.test(u.charAt(d+e.length))?1:0},close:{pos:i-h-n.length,margin:/\s/.test(f.charAt(p-1))?1:0}}:null}function Gmn(t){let e=[];for(let n of t.selection.ranges){let r=t.doc.lineAt(n.from),i=n.to<=r.to?r:t.doc.lineAt(n.to),o=e.length-1;o>=0&&e[o].to>r.from?e[o].to=i.to:e.push({from:r.from+/^\s*/.exec(r.text)[0].length,to:i.to})}return e}function m7e(t,e,n=e.selection.ranges){let r=n.map(o=>$le(e,o.from).block);if(!r.every(o=>o))return null;let i=n.map((o,s)=>Vmn(e,r[s],o.from,o.to));if(t!=2&&!i.every(o=>o))return{changes:e.changes(n.map((o,s)=>i[s]?[]:[{from:o.from,insert:r[s].open+" "},{from:o.to,insert:" "+r[s].close}]))};if(t!=1&&i.some(o=>o)){let o=[];for(let s=0,a;si&&(o==s||s>f.from)){i=f.from;let d=/^\s*/.exec(f.text)[0].length,h=d==f.length,p=f.text.slice(d,d+c.length)==c?d:-1;do.comment<0&&(!o.empty||o.single))){let o=[];for(let{line:a,token:l,indent:c,empty:u,single:f}of r)(f||!u)&&o.push({from:a.from+c,insert:l+" "});let s=e.changes(o);return{changes:s,selection:e.selection.map(s,1)}}else if(t!=1&&r.some(o=>o.comment>=0)){let o=[];for(let{line:s,comment:a,token:l}of r)if(a>=0){let c=s.from+a,u=c+l.length;s.text[u-s.from]==" "&&u++,o.push({from:c,to:u})}return{changes:o}}return null}const hK=Jh.define(),qmn=Jh.define(),Xmn=_t.define(),v7e=_t.define({combine(t){return ep(t,{minDepth:100,newGroupDelay:500,joinToEvent:(e,n)=>n},{minDepth:Math.max,newGroupDelay:Math.min,joinToEvent:(e,n)=>(r,i)=>e(r,i)||n(r,i)})}}),y7e=Qo.define({create(){return rh.empty},update(t,e){let n=e.state.facet(v7e),r=e.annotation(hK);if(r){let l=cl.fromTransaction(e,r.selection),c=r.side,u=c==0?t.undone:t.done;return l?u=mz(u,u.length,n.minDepth,l):u=w7e(u,e.startState.selection),new rh(c==0?r.rest:u,c==0?u:r.rest)}let i=e.annotation(qmn);if((i=="full"||i=="before")&&(t=t.isolate()),e.annotation(lo.addToHistory)===!1)return e.changes.empty?t:t.addMapping(e.changes.desc);let o=cl.fromTransaction(e),s=e.annotation(lo.time),a=e.annotation(lo.userEvent);return o?t=t.addChanges(o,s,a,n,e):e.selection&&(t=t.addSelection(e.startState.selection,s,a,n.newGroupDelay)),(i=="full"||i=="after")&&(t=t.isolate()),t},toJSON(t){return{done:t.done.map(e=>e.toJSON()),undone:t.undone.map(e=>e.toJSON())}},fromJSON(t){return new rh(t.done.map(cl.fromJSON),t.undone.map(cl.fromJSON))}});function Ymn(t={}){return[y7e,v7e.of(t),mt.domEventHandlers({beforeinput(e,n){let r=e.inputType=="historyUndo"?x7e:e.inputType=="historyRedo"?pK:null;return r?(e.preventDefault(),r(n)):!1}})]}function RU(t,e){return function({state:n,dispatch:r}){if(!e&&n.readOnly)return!1;let i=n.field(y7e,!1);if(!i)return!1;let o=i.pop(t,n,e);return o?(r(o),!0):!1}}const x7e=RU(0,!1),pK=RU(1,!1),Qmn=RU(0,!0),Kmn=RU(1,!0);class cl{constructor(e,n,r,i,o){this.changes=e,this.effects=n,this.mapped=r,this.startSelection=i,this.selectionsAfter=o}setSelAfter(e){return new cl(this.changes,this.effects,this.mapped,this.startSelection,e)}toJSON(){var e,n,r;return{changes:(e=this.changes)===null||e===void 0?void 0:e.toJSON(),mapped:(n=this.mapped)===null||n===void 0?void 0:n.toJSON(),startSelection:(r=this.startSelection)===null||r===void 0?void 0:r.toJSON(),selectionsAfter:this.selectionsAfter.map(i=>i.toJSON())}}static fromJSON(e){return new cl(e.changes&&vo.fromJSON(e.changes),[],e.mapped&&wh.fromJSON(e.mapped),e.startSelection&&Ve.fromJSON(e.startSelection),e.selectionsAfter.map(Ve.fromJSON))}static fromTransaction(e,n){let r=cu;for(let i of e.startState.facet(Xmn)){let o=i(e);o.length&&(r=r.concat(o))}return!r.length&&e.changes.empty?null:new cl(e.changes.invert(e.startState.doc),r,void 0,n||e.startState.selection,cu)}static selection(e){return new cl(void 0,cu,void 0,void 0,e)}}function mz(t,e,n,r){let i=e+1>n+20?e-n-1:0,o=t.slice(i,e);return o.push(r),o}function Zmn(t,e){let n=[],r=!1;return t.iterChangedRanges((i,o)=>n.push(i,o)),e.iterChangedRanges((i,o,s,a)=>{for(let l=0;l=c&&s<=u&&(r=!0)}}),r}function Jmn(t,e){return t.ranges.length==e.ranges.length&&t.ranges.filter((n,r)=>n.empty!=e.ranges[r].empty).length===0}function b7e(t,e){return t.length?e.length?t.concat(e):t:e}const cu=[],evn=200;function w7e(t,e){if(t.length){let n=t[t.length-1],r=n.selectionsAfter.slice(Math.max(0,n.selectionsAfter.length-evn));return r.length&&r[r.length-1].eq(e)?t:(r.push(e),mz(t,t.length-1,1e9,n.setSelAfter(r)))}else return[cl.selection([e])]}function tvn(t){let e=t[t.length-1],n=t.slice();return n[t.length-1]=e.setSelAfter(e.selectionsAfter.slice(0,e.selectionsAfter.length-1)),n}function s7(t,e){if(!t.length)return t;let n=t.length,r=cu;for(;n;){let i=nvn(t[n-1],e,r);if(i.changes&&!i.changes.empty||i.effects.length){let o=t.slice(0,n);return o[n-1]=i,o}else e=i.mapped,n--,r=i.selectionsAfter}return r.length?[cl.selection(r)]:cu}function nvn(t,e,n){let r=b7e(t.selectionsAfter.length?t.selectionsAfter.map(a=>a.map(e)):cu,n);if(!t.changes)return cl.selection(r);let i=t.changes.map(e),o=e.mapDesc(t.changes,!0),s=t.mapped?t.mapped.composeDesc(o):o;return new cl(i,rn.mapEffects(t.effects,e),s,t.startSelection.map(o),r)}const rvn=/^(input\.type|delete)($|\.)/;class rh{constructor(e,n,r=0,i=void 0){this.done=e,this.undone=n,this.prevTime=r,this.prevUserEvent=i}isolate(){return this.prevTime?new rh(this.done,this.undone):this}addChanges(e,n,r,i,o){let s=this.done,a=s[s.length-1];return a&&a.changes&&!a.changes.empty&&e.changes&&(!r||rvn.test(r))&&(!a.selectionsAfter.length&&n-this.prevTime0&&n-this.prevTimen.empty?t.moveByChar(n,e):DU(n,e))}function sa(t){return t.textDirectionAt(t.state.selection.main.head)==ii.LTR}const S7e=t=>_7e(t,!sa(t)),C7e=t=>_7e(t,sa(t));function O7e(t,e){return ud(t,n=>n.empty?t.moveByGroup(n,e):DU(n,e))}const ovn=t=>O7e(t,!sa(t)),svn=t=>O7e(t,sa(t));function avn(t,e,n){if(e.type.prop(n))return!0;let r=e.to-e.from;return r&&(r>2||/[^\s,.;:]/.test(t.sliceDoc(e.from,e.to)))||e.firstChild}function IU(t,e,n){let r=Vo(t).resolveInner(e.head),i=n?Sn.closedBy:Sn.openedBy;for(let l=e.head;;){let c=n?r.childAfter(l):r.childBefore(l);if(!c)break;avn(t,c,i)?r=c:l=n?c.to:c.from}let o=r.type.prop(i),s,a;return o&&(s=n?nh(t,r.from,1):nh(t,r.to,-1))&&s.matched?a=n?s.end.to:s.end.from:a=n?r.to:r.from,Ve.cursor(a,n?-1:1)}const lvn=t=>ud(t,e=>IU(t.state,e,!sa(t))),cvn=t=>ud(t,e=>IU(t.state,e,sa(t)));function E7e(t,e){return ud(t,n=>{if(!n.empty)return DU(n,e);let r=t.moveVertically(n,e);return r.head!=n.head?r:t.moveToLineBoundary(n,e)})}const T7e=t=>E7e(t,!1),k7e=t=>E7e(t,!0);function A7e(t){let e=t.scrollDOM.clientHeights.empty?t.moveVertically(s,e,n.height):DU(s,e));if(i.eq(r.selection))return!1;let o;if(n.selfScroll){let s=t.coordsAtPos(r.selection.main.head),a=t.scrollDOM.getBoundingClientRect(),l=a.top+n.marginTop,c=a.bottom-n.marginBottom;s&&s.top>l&&s.bottomP7e(t,!1),gK=t=>P7e(t,!0);function r0(t,e,n){let r=t.lineBlockAt(e.head),i=t.moveToLineBoundary(e,n);if(i.head==e.head&&i.head!=(n?r.to:r.from)&&(i=t.moveToLineBoundary(e,n,!1)),!n&&i.head==r.from&&r.length){let o=/^\s*/.exec(t.state.sliceDoc(r.from,Math.min(r.from+100,r.to)))[0].length;o&&e.head!=r.from+o&&(i=Ve.cursor(r.from+o))}return i}const uvn=t=>ud(t,e=>r0(t,e,!0)),fvn=t=>ud(t,e=>r0(t,e,!1)),dvn=t=>ud(t,e=>r0(t,e,!sa(t))),hvn=t=>ud(t,e=>r0(t,e,sa(t))),pvn=t=>ud(t,e=>Ve.cursor(t.lineBlockAt(e.head).from,1)),gvn=t=>ud(t,e=>Ve.cursor(t.lineBlockAt(e.head).to,-1));function mvn(t,e,n){let r=!1,i=QO(t.selection,o=>{let s=nh(t,o.head,-1)||nh(t,o.head,1)||o.head>0&&nh(t,o.head-1,1)||o.headmvn(t,e);function Gu(t,e){let n=QO(t.state.selection,r=>{let i=e(r);return Ve.range(r.anchor,i.head,i.goalColumn,i.bidiLevel||void 0)});return n.eq(t.state.selection)?!1:(t.dispatch(np(t.state,n)),!0)}function M7e(t,e){return Gu(t,n=>t.moveByChar(n,e))}const R7e=t=>M7e(t,!sa(t)),D7e=t=>M7e(t,sa(t));function I7e(t,e){return Gu(t,n=>t.moveByGroup(n,e))}const yvn=t=>I7e(t,!sa(t)),xvn=t=>I7e(t,sa(t)),bvn=t=>Gu(t,e=>IU(t.state,e,!sa(t))),wvn=t=>Gu(t,e=>IU(t.state,e,sa(t)));function L7e(t,e){return Gu(t,n=>t.moveVertically(n,e))}const $7e=t=>L7e(t,!1),F7e=t=>L7e(t,!0);function N7e(t,e){return Gu(t,n=>t.moveVertically(n,e,A7e(t).height))}const Gbe=t=>N7e(t,!1),Hbe=t=>N7e(t,!0),_vn=t=>Gu(t,e=>r0(t,e,!0)),Svn=t=>Gu(t,e=>r0(t,e,!1)),Cvn=t=>Gu(t,e=>r0(t,e,!sa(t))),Ovn=t=>Gu(t,e=>r0(t,e,sa(t))),Evn=t=>Gu(t,e=>Ve.cursor(t.lineBlockAt(e.head).from)),Tvn=t=>Gu(t,e=>Ve.cursor(t.lineBlockAt(e.head).to)),qbe=({state:t,dispatch:e})=>(e(np(t,{anchor:0})),!0),Xbe=({state:t,dispatch:e})=>(e(np(t,{anchor:t.doc.length})),!0),Ybe=({state:t,dispatch:e})=>(e(np(t,{anchor:t.selection.main.anchor,head:0})),!0),Qbe=({state:t,dispatch:e})=>(e(np(t,{anchor:t.selection.main.anchor,head:t.doc.length})),!0),kvn=({state:t,dispatch:e})=>(e(t.update({selection:{anchor:0,head:t.doc.length},userEvent:"select"})),!0),Avn=({state:t,dispatch:e})=>{let n=LU(t).map(({from:r,to:i})=>Ve.range(r,Math.min(i+1,t.doc.length)));return e(t.update({selection:Ve.create(n),userEvent:"select"})),!0},Pvn=({state:t,dispatch:e})=>{let n=QO(t.selection,r=>{var i;let o=Vo(t).resolveStack(r.from,1);for(let s=o;s;s=s.next){let{node:a}=s;if((a.from=r.to||a.to>r.to&&a.from<=r.from)&&(!((i=a.parent)===null||i===void 0)&&i.parent))return Ve.range(a.to,a.from)}return r});return e(np(t,n)),!0},Mvn=({state:t,dispatch:e})=>{let n=t.selection,r=null;return n.ranges.length>1?r=Ve.create([n.main]):n.main.empty||(r=Ve.create([Ve.cursor(n.main.head)])),r?(e(np(t,r)),!0):!1};function pD(t,e){if(t.state.readOnly)return!1;let n="delete.selection",{state:r}=t,i=r.changeByRange(o=>{let{from:s,to:a}=o;if(s==a){let l=e(o);ls&&(n="delete.forward",l=WL(t,l,!0)),s=Math.min(s,l),a=Math.max(a,l)}else s=WL(t,s,!1),a=WL(t,a,!0);return s==a?{range:o}:{changes:{from:s,to:a},range:Ve.cursor(s,si(t)))r.between(e,e,(i,o)=>{ie&&(e=n?o:i)});return e}const z7e=(t,e,n)=>pD(t,r=>{let i=r.from,{state:o}=t,s=o.doc.lineAt(i),a,l;if(n&&!e&&i>s.from&&iz7e(t,!1,!0),j7e=t=>z7e(t,!0,!1),B7e=(t,e)=>pD(t,n=>{let r=n.head,{state:i}=t,o=i.doc.lineAt(r),s=i.charCategorizer(r);for(let a=null;;){if(r==(e?o.to:o.from)){r==n.head&&o.number!=(e?i.doc.lines:1)&&(r+=e?1:-1);break}let l=gs(o.text,r-o.from,e)+o.from,c=o.text.slice(Math.min(r,l)-o.from,Math.max(r,l)-o.from),u=s(c);if(a!=null&&u!=a)break;(c!=" "||r!=n.head)&&(a=u),r=l}return r}),U7e=t=>B7e(t,!1),Rvn=t=>B7e(t,!0),Dvn=t=>pD(t,e=>{let n=t.lineBlockAt(e.head).to;return e.headpD(t,e=>{let n=t.moveToLineBoundary(e,!1).head;return e.head>n?n:Math.max(0,e.head-1)}),Lvn=t=>pD(t,e=>{let n=t.moveToLineBoundary(e,!0).head;return e.head{if(t.readOnly)return!1;let n=t.changeByRange(r=>({changes:{from:r.from,to:r.to,insert:ar.of(["",""])},range:Ve.cursor(r.from)}));return e(t.update(n,{scrollIntoView:!0,userEvent:"input"})),!0},Fvn=({state:t,dispatch:e})=>{if(t.readOnly)return!1;let n=t.changeByRange(r=>{if(!r.empty||r.from==0||r.from==t.doc.length)return{range:r};let i=r.from,o=t.doc.lineAt(i),s=i==o.from?i-1:gs(o.text,i-o.from,!1)+o.from,a=i==o.to?i+1:gs(o.text,i-o.from,!0)+o.from;return{changes:{from:s,to:a,insert:t.doc.slice(i,a).append(t.doc.slice(s,i))},range:Ve.cursor(a)}});return n.changes.empty?!1:(e(t.update(n,{scrollIntoView:!0,userEvent:"move.character"})),!0)};function LU(t){let e=[],n=-1;for(let r of t.selection.ranges){let i=t.doc.lineAt(r.from),o=t.doc.lineAt(r.to);if(!r.empty&&r.to==o.from&&(o=t.doc.lineAt(r.to-1)),n>=i.number){let s=e[e.length-1];s.to=o.to,s.ranges.push(r)}else e.push({from:i.from,to:o.to,ranges:[r]});n=o.number+1}return e}function W7e(t,e,n){if(t.readOnly)return!1;let r=[],i=[];for(let o of LU(t)){if(n?o.to==t.doc.length:o.from==0)continue;let s=t.doc.lineAt(n?o.to+1:o.from-1),a=s.length+1;if(n){r.push({from:o.to,to:s.to},{from:o.from,insert:s.text+t.lineBreak});for(let l of o.ranges)i.push(Ve.range(Math.min(t.doc.length,l.anchor+a),Math.min(t.doc.length,l.head+a)))}else{r.push({from:s.from,to:o.from},{from:o.to,insert:t.lineBreak+s.text});for(let l of o.ranges)i.push(Ve.range(l.anchor-a,l.head-a))}}return r.length?(e(t.update({changes:r,scrollIntoView:!0,selection:Ve.create(i,t.selection.mainIndex),userEvent:"move.line"})),!0):!1}const Nvn=({state:t,dispatch:e})=>W7e(t,e,!1),zvn=({state:t,dispatch:e})=>W7e(t,e,!0);function V7e(t,e,n){if(t.readOnly)return!1;let r=[];for(let i of LU(t))n?r.push({from:i.from,insert:t.doc.slice(i.from,i.to)+t.lineBreak}):r.push({from:i.to,insert:t.lineBreak+t.doc.slice(i.from,i.to)});return e(t.update({changes:r,scrollIntoView:!0,userEvent:"input.copyline"})),!0}const jvn=({state:t,dispatch:e})=>V7e(t,e,!1),Bvn=({state:t,dispatch:e})=>V7e(t,e,!0),Uvn=t=>{if(t.state.readOnly)return!1;let{state:e}=t,n=e.changes(LU(e).map(({from:i,to:o})=>(i>0?i--:o{let o;if(t.lineWrapping){let s=t.lineBlockAt(i.head),a=t.coordsAtPos(i.head,i.assoc||1);a&&(o=s.bottom+t.documentTop-a.bottom+t.defaultLineHeight/2)}return t.moveVertically(i,!0,o)}).map(n);return t.dispatch({changes:n,selection:r,scrollIntoView:!0,userEvent:"delete.line"}),!0};function Wvn(t,e){if(/\(\)|\[\]|\{\}/.test(t.sliceDoc(e-1,e+1)))return{from:e,to:e};let n=Vo(t).resolveInner(e),r=n.childBefore(e),i=n.childAfter(e),o;return r&&i&&r.to<=e&&i.from>=e&&(o=r.type.prop(Sn.closedBy))&&o.indexOf(i.name)>-1&&t.doc.lineAt(r.to).from==t.doc.lineAt(i.from).from&&!/\S/.test(t.sliceDoc(r.to,i.from))?{from:r.to,to:i.from}:null}const Vvn=G7e(!1),Gvn=G7e(!0);function G7e(t){return({state:e,dispatch:n})=>{if(e.readOnly)return!1;let r=e.changeByRange(i=>{let{from:o,to:s}=i,a=e.doc.lineAt(o),l=!t&&o==s&&Wvn(e,o);t&&(o=s=(s<=a.to?a:e.doc.lineAt(s)).to);let c=new PU(e,{simulateBreak:o,simulateDoubleBreak:!!l}),u=Mle(c,o);for(u==null&&(u=YO(/^\s*/.exec(e.doc.lineAt(o).text)[0],e.tabSize));sa.from&&o{let i=[];for(let s=r.from;s<=r.to;){let a=t.doc.lineAt(s);a.number>n&&(r.empty||r.to>a.from)&&(e(a,i,r),n=a.number),s=a.to+1}let o=t.changes(i);return{changes:i,range:Ve.range(o.mapPos(r.anchor,1),o.mapPos(r.head,1))}})}const Hvn=({state:t,dispatch:e})=>{if(t.readOnly)return!1;let n=Object.create(null),r=new PU(t,{overrideIndentation:o=>{let s=n[o];return s??-1}}),i=Fle(t,(o,s,a)=>{let l=Mle(r,o.from);if(l==null)return;/\S/.test(o.text)||(l=0);let c=/^\s*/.exec(o.text)[0],u=vP(t,l);(c!=u||a.fromt.readOnly?!1:(e(t.update(Fle(t,(n,r)=>{r.push({from:n.from,insert:t.facet(fD)})}),{userEvent:"input.indent"})),!0),q7e=({state:t,dispatch:e})=>t.readOnly?!1:(e(t.update(Fle(t,(n,r)=>{let i=/^\s*/.exec(n.text)[0];if(!i)return;let o=YO(i,t.tabSize),s=0,a=vP(t,Math.max(0,o-hz(t)));for(;s(t.setTabFocusMode(),!0),Xvn=[{key:"Ctrl-b",run:S7e,shift:R7e,preventDefault:!0},{key:"Ctrl-f",run:C7e,shift:D7e},{key:"Ctrl-p",run:T7e,shift:$7e},{key:"Ctrl-n",run:k7e,shift:F7e},{key:"Ctrl-a",run:pvn,shift:Evn},{key:"Ctrl-e",run:gvn,shift:Tvn},{key:"Ctrl-d",run:j7e},{key:"Ctrl-h",run:mK},{key:"Ctrl-k",run:Dvn},{key:"Ctrl-Alt-h",run:U7e},{key:"Ctrl-o",run:$vn},{key:"Ctrl-t",run:Fvn},{key:"Ctrl-v",run:gK}],Yvn=[{key:"ArrowLeft",run:S7e,shift:R7e,preventDefault:!0},{key:"Mod-ArrowLeft",mac:"Alt-ArrowLeft",run:ovn,shift:yvn,preventDefault:!0},{mac:"Cmd-ArrowLeft",run:dvn,shift:Cvn,preventDefault:!0},{key:"ArrowRight",run:C7e,shift:D7e,preventDefault:!0},{key:"Mod-ArrowRight",mac:"Alt-ArrowRight",run:svn,shift:xvn,preventDefault:!0},{mac:"Cmd-ArrowRight",run:hvn,shift:Ovn,preventDefault:!0},{key:"ArrowUp",run:T7e,shift:$7e,preventDefault:!0},{mac:"Cmd-ArrowUp",run:qbe,shift:Ybe},{mac:"Ctrl-ArrowUp",run:Vbe,shift:Gbe},{key:"ArrowDown",run:k7e,shift:F7e,preventDefault:!0},{mac:"Cmd-ArrowDown",run:Xbe,shift:Qbe},{mac:"Ctrl-ArrowDown",run:gK,shift:Hbe},{key:"PageUp",run:Vbe,shift:Gbe},{key:"PageDown",run:gK,shift:Hbe},{key:"Home",run:fvn,shift:Svn,preventDefault:!0},{key:"Mod-Home",run:qbe,shift:Ybe},{key:"End",run:uvn,shift:_vn,preventDefault:!0},{key:"Mod-End",run:Xbe,shift:Qbe},{key:"Enter",run:Vvn},{key:"Mod-a",run:kvn},{key:"Backspace",run:mK,shift:mK},{key:"Delete",run:j7e},{key:"Mod-Backspace",mac:"Alt-Backspace",run:U7e},{key:"Mod-Delete",mac:"Alt-Delete",run:Rvn},{mac:"Mod-Backspace",run:Ivn},{mac:"Mod-Delete",run:Lvn}].concat(Xvn.map(t=>({mac:t.key,run:t.run,shift:t.shift}))),Qvn=[{key:"Alt-ArrowLeft",mac:"Ctrl-ArrowLeft",run:lvn,shift:bvn},{key:"Alt-ArrowRight",mac:"Ctrl-ArrowRight",run:cvn,shift:wvn},{key:"Alt-ArrowUp",run:Nvn},{key:"Shift-Alt-ArrowUp",run:jvn},{key:"Alt-ArrowDown",run:zvn},{key:"Shift-Alt-ArrowDown",run:Bvn},{key:"Escape",run:Mvn},{key:"Mod-Enter",run:Gvn},{key:"Alt-l",mac:"Ctrl-l",run:Avn},{key:"Mod-i",run:Pvn,preventDefault:!0},{key:"Mod-[",run:q7e},{key:"Mod-]",run:H7e},{key:"Mod-Alt-\\",run:Hvn},{key:"Shift-Mod-k",run:Uvn},{key:"Shift-Mod-\\",run:vvn},{key:"Mod-/",run:jmn},{key:"Alt-A",run:Umn},{key:"Ctrl-m",mac:"Shift-Alt-m",run:qvn}].concat(Yvn),Kvn={key:"Tab",run:H7e,shift:q7e};function Nr(){var t=arguments[0];typeof t=="string"&&(t=document.createElement(t));var e=1,n=arguments[1];if(n&&typeof n=="object"&&n.nodeType==null&&!Array.isArray(n)){for(var r in n)if(Object.prototype.hasOwnProperty.call(n,r)){var i=n[r];typeof i=="string"?t.setAttribute(r,i):i!=null&&(t[r]=i)}e++}for(;et.normalize("NFKD"):t=>t;class _C{constructor(e,n,r=0,i=e.length,o,s){this.test=s,this.value={from:0,to:0},this.done=!1,this.matches=[],this.buffer="",this.bufferPos=0,this.iter=e.iterRange(r,i),this.bufferStart=r,this.normalize=o?a=>o(Kbe(a)):Kbe,this.query=this.normalize(n)}peek(){if(this.bufferPos==this.buffer.length){if(this.bufferStart+=this.buffer.length,this.iter.next(),this.iter.done)return-1;this.bufferPos=0,this.buffer=this.iter.value}return ss(this.buffer,this.bufferPos)}next(){for(;this.matches.length;)this.matches.pop();return this.nextOverlapping()}nextOverlapping(){for(;;){let e=this.peek();if(e<0)return this.done=!0,this;let n=hle(e),r=this.bufferStart+this.bufferPos;this.bufferPos+=Jc(e);let i=this.normalize(n);for(let o=0,s=r;;o++){let a=i.charCodeAt(o),l=this.match(a,s,this.bufferPos+this.bufferStart);if(o==i.length-1){if(l)return this.value=l,this;break}s==r&&othis.to&&(this.curLine=this.curLine.slice(0,this.to-this.curLineStart)),this.iter.next())}nextLine(){this.curLineStart=this.curLineStart+this.curLine.length+1,this.curLineStart>this.to?this.curLine="":this.getLine(0)}next(){for(let e=this.matchPos-this.curLineStart;;){this.re.lastIndex=e;let n=this.matchPos<=this.to&&this.re.exec(this.curLine);if(n){let r=this.curLineStart+n.index,i=r+n[0].length;if(this.matchPos=vz(this.text,i+(r==i?1:0)),r==this.curLineStart+this.curLine.length&&this.nextLine(),(rthis.value.to)&&(!this.test||this.test(r,i,n)))return this.value={from:r,to:i,match:n},this;e=this.matchPos-this.curLineStart}else if(this.curLineStart+this.curLine.length=r||i.to<=n){let a=new J_(n,e.sliceString(n,r));return a7.set(e,a),a}if(i.from==n&&i.to==r)return i;let{text:o,from:s}=i;return s>n&&(o=e.sliceString(n,s)+o,s=n),i.to=this.to?this.to:this.text.lineAt(e).to}next(){for(;;){let e=this.re.lastIndex=this.matchPos-this.flat.from,n=this.re.exec(this.flat.text);if(n&&!n[0]&&n.index==e&&(this.re.lastIndex=e+1,n=this.re.exec(this.flat.text)),n){let r=this.flat.from+n.index,i=r+n[0].length;if((this.flat.to>=this.to||n.index+n[0].length<=this.flat.text.length-10)&&(!this.test||this.test(r,i,n)))return this.value={from:r,to:i,match:n},this.matchPos=vz(this.text,i+(r==i?1:0)),this}if(this.flat.to==this.to)return this.done=!0,this;this.flat=J_.get(this.text,this.flat.from,this.chunkEnd(this.flat.from+this.flat.text.length*2))}}}typeof Symbol<"u"&&(Q7e.prototype[Symbol.iterator]=K7e.prototype[Symbol.iterator]=function(){return this});function Zvn(t){try{return new RegExp(t,Nle),!0}catch{return!1}}function vz(t,e){if(e>=t.length)return e;let n=t.lineAt(e),r;for(;e=56320&&r<57344;)e++;return e}function vK(t){let e=String(t.state.doc.lineAt(t.state.selection.main.head).number),n=Nr("input",{class:"cm-textfield",name:"line",value:e}),r=Nr("form",{class:"cm-gotoLine",onkeydown:o=>{o.keyCode==27?(o.preventDefault(),t.dispatch({effects:yz.of(!1)}),t.focus()):o.keyCode==13&&(o.preventDefault(),i())},onsubmit:o=>{o.preventDefault(),i()}},Nr("label",t.state.phrase("Go to line"),": ",n)," ",Nr("button",{class:"cm-button",type:"submit"},t.state.phrase("go")));function i(){let o=/^([+-])?(\d+)?(:\d+)?(%)?$/.exec(n.value);if(!o)return;let{state:s}=t,a=s.doc.lineAt(s.selection.main.head),[,l,c,u,f]=o,d=u?+u.slice(1):0,h=c?+c:a.number;if(c&&f){let m=h/100;l&&(m=m*(l=="-"?-1:1)+a.number/s.doc.lines),h=Math.round(s.doc.lines*m)}else c&&l&&(h=h*(l=="-"?-1:1)+a.number);let p=s.doc.line(Math.max(1,Math.min(s.doc.lines,h))),g=Ve.cursor(p.from+Math.max(0,Math.min(d,p.length)));t.dispatch({effects:[yz.of(!1),mt.scrollIntoView(g.from,{y:"center"})],selection:g}),t.focus()}return{dom:r}}const yz=rn.define(),Zbe=Qo.define({create(){return!0},update(t,e){for(let n of e.effects)n.is(yz)&&(t=n.value);return t},provide:t=>pP.from(t,e=>e?vK:null)}),Jvn=t=>{let e=hP(t,vK);if(!e){let n=[yz.of(!0)];t.state.field(Zbe,!1)==null&&n.push(rn.appendConfig.of([Zbe,eyn])),t.dispatch({effects:n}),e=hP(t,vK)}return e&&e.dom.querySelector("input").select(),!0},eyn=mt.baseTheme({".cm-panel.cm-gotoLine":{padding:"2px 6px 4px","& label":{fontSize:"80%"}}}),tyn={highlightWordAroundCursor:!1,minSelectionLength:1,maxMatches:100,wholeWords:!1},nyn=_t.define({combine(t){return ep(t,tyn,{highlightWordAroundCursor:(e,n)=>e||n,minSelectionLength:Math.min,maxMatches:Math.min})}});function ryn(t){return[lyn,ayn]}const iyn=It.mark({class:"cm-selectionMatch"}),oyn=It.mark({class:"cm-selectionMatch cm-selectionMatch-main"});function Jbe(t,e,n,r){return(n==0||t(e.sliceDoc(n-1,n))!=pi.Word)&&(r==e.doc.length||t(e.sliceDoc(r,r+1))!=pi.Word)}function syn(t,e,n,r){return t(e.sliceDoc(n,n+1))==pi.Word&&t(e.sliceDoc(r-1,r))==pi.Word}const ayn=Qi.fromClass(class{constructor(t){this.decorations=this.getDeco(t)}update(t){(t.selectionSet||t.docChanged||t.viewportChanged)&&(this.decorations=this.getDeco(t.view))}getDeco(t){let e=t.state.facet(nyn),{state:n}=t,r=n.selection;if(r.ranges.length>1)return It.none;let i=r.main,o,s=null;if(i.empty){if(!e.highlightWordAroundCursor)return It.none;let l=n.wordAt(i.head);if(!l)return It.none;s=n.charCategorizer(i.head),o=n.sliceDoc(l.from,l.to)}else{let l=i.to-i.from;if(l200)return It.none;if(e.wholeWords){if(o=n.sliceDoc(i.from,i.to),s=n.charCategorizer(i.head),!(Jbe(s,n,i.from,i.to)&&syn(s,n,i.from,i.to)))return It.none}else if(o=n.sliceDoc(i.from,i.to),!o)return It.none}let a=[];for(let l of t.visibleRanges){let c=new _C(n.doc,o,l.from,l.to);for(;!c.next().done;){let{from:u,to:f}=c.value;if((!s||Jbe(s,n,u,f))&&(i.empty&&u<=i.from&&f>=i.to?a.push(oyn.range(u,f)):(u>=i.to||f<=i.from)&&a.push(iyn.range(u,f)),a.length>e.maxMatches))return It.none}}return It.set(a)}},{decorations:t=>t.decorations}),lyn=mt.baseTheme({".cm-selectionMatch":{backgroundColor:"#99ff7780"},".cm-searchMatch .cm-selectionMatch":{backgroundColor:"transparent"}}),cyn=({state:t,dispatch:e})=>{let{selection:n}=t,r=Ve.create(n.ranges.map(i=>t.wordAt(i.head)||Ve.cursor(i.head)),n.mainIndex);return r.eq(n)?!1:(e(t.update({selection:r})),!0)};function uyn(t,e){let{main:n,ranges:r}=t.selection,i=t.wordAt(n.head),o=i&&i.from==n.from&&i.to==n.to;for(let s=!1,a=new _C(t.doc,e,r[r.length-1].to);;)if(a.next(),a.done){if(s)return null;a=new _C(t.doc,e,0,Math.max(0,r[r.length-1].from-1)),s=!0}else{if(s&&r.some(l=>l.from==a.value.from))continue;if(o){let l=t.wordAt(a.value.from);if(!l||l.from!=a.value.from||l.to!=a.value.to)continue}return a.value}}const fyn=({state:t,dispatch:e})=>{let{ranges:n}=t.selection;if(n.some(o=>o.from===o.to))return cyn({state:t,dispatch:e});let r=t.sliceDoc(n[0].from,n[0].to);if(t.selection.ranges.some(o=>t.sliceDoc(o.from,o.to)!=r))return!1;let i=uyn(t,r);return i?(e(t.update({selection:t.selection.addRange(Ve.range(i.from,i.to),!1),effects:mt.scrollIntoView(i.to)})),!0):!1},KO=_t.define({combine(t){return ep(t,{top:!1,caseSensitive:!1,literal:!1,regexp:!1,wholeWord:!1,createPanel:e=>new Syn(e),scrollToMatch:e=>mt.scrollIntoView(e)})}});class Z7e{constructor(e){this.search=e.search,this.caseSensitive=!!e.caseSensitive,this.literal=!!e.literal,this.regexp=!!e.regexp,this.replace=e.replace||"",this.valid=!!this.search&&(!this.regexp||Zvn(this.search)),this.unquoted=this.unquote(this.search),this.wholeWord=!!e.wholeWord}unquote(e){return this.literal?e:e.replace(/\\([nrt\\])/g,(n,r)=>r=="n"?` -`:r=="r"?"\r":r=="t"?" ":"\\")}eq(e){return this.search==e.search&&this.replace==e.replace&&this.caseSensitive==e.caseSensitive&&this.regexp==e.regexp&&this.wholeWord==e.wholeWord}create(){return this.regexp?new gyn(this):new hyn(this)}getCursor(e,n=0,r){let i=e.doc?e:In.create({doc:e});return r==null&&(r=i.doc.length),this.regexp?jw(this,i,n,r):zw(this,i,n,r)}}class J7e{constructor(e){this.spec=e}}function zw(t,e,n,r){return new _C(e.doc,t.unquoted,n,r,t.caseSensitive?void 0:i=>i.toLowerCase(),t.wholeWord?dyn(e.doc,e.charCategorizer(e.selection.main.head)):void 0)}function dyn(t,e){return(n,r,i,o)=>((o>n||o+i.length=n)return null;i.push(r.value)}return i}highlight(e,n,r,i){let o=zw(this.spec,e,Math.max(0,n-this.spec.unquoted.length),Math.min(r+this.spec.unquoted.length,e.doc.length));for(;!o.next().done;)i(o.value.from,o.value.to)}}function jw(t,e,n,r){return new Q7e(e.doc,t.search,{ignoreCase:!t.caseSensitive,test:t.wholeWord?pyn(e.charCategorizer(e.selection.main.head)):void 0},n,r)}function xz(t,e){return t.slice(gs(t,e,!1),e)}function bz(t,e){return t.slice(e,gs(t,e))}function pyn(t){return(e,n,r)=>!r[0].length||(t(xz(r.input,r.index))!=pi.Word||t(bz(r.input,r.index))!=pi.Word)&&(t(bz(r.input,r.index+r[0].length))!=pi.Word||t(xz(r.input,r.index+r[0].length))!=pi.Word)}class gyn extends J7e{nextMatch(e,n,r){let i=jw(this.spec,e,r,e.doc.length).next();return i.done&&(i=jw(this.spec,e,0,n).next()),i.done?null:i.value}prevMatchInRange(e,n,r){for(let i=1;;i++){let o=Math.max(n,r-i*1e4),s=jw(this.spec,e,o,r),a=null;for(;!s.next().done;)a=s.value;if(a&&(o==n||a.from>o+10))return a;if(o==n)return null}}prevMatch(e,n,r){return this.prevMatchInRange(e,0,n)||this.prevMatchInRange(e,r,e.doc.length)}getReplacement(e){return this.spec.unquote(this.spec.replace).replace(/\$([$&\d+])/g,(n,r)=>r=="$"?"$":r=="&"?e.match[0]:r!="0"&&+r=n)return null;i.push(r.value)}return i}highlight(e,n,r,i){let o=jw(this.spec,e,Math.max(0,n-250),Math.min(r+250,e.doc.length));for(;!o.next().done;)i(o.value.from,o.value.to)}}const yP=rn.define(),zle=rn.define(),Gv=Qo.define({create(t){return new l7(yK(t).create(),null)},update(t,e){for(let n of e.effects)n.is(yP)?t=new l7(n.value.create(),t.panel):n.is(zle)&&(t=new l7(t.query,n.value?jle:null));return t},provide:t=>pP.from(t,e=>e.panel)});class l7{constructor(e,n){this.query=e,this.panel=n}}const myn=It.mark({class:"cm-searchMatch"}),vyn=It.mark({class:"cm-searchMatch cm-searchMatch-selected"}),yyn=Qi.fromClass(class{constructor(t){this.view=t,this.decorations=this.highlight(t.state.field(Gv))}update(t){let e=t.state.field(Gv);(e!=t.startState.field(Gv)||t.docChanged||t.selectionSet||t.viewportChanged)&&(this.decorations=this.highlight(e))}highlight({query:t,panel:e}){if(!e||!t.spec.valid)return It.none;let{view:n}=this,r=new wy;for(let i=0,o=n.visibleRanges,s=o.length;io[i+1].from-2*250;)l=o[++i].to;t.highlight(n.state,a,l,(c,u)=>{let f=n.state.selection.ranges.some(d=>d.from==c&&d.to==u);r.add(c,u,f?vyn:myn)})}return r.finish()}},{decorations:t=>t.decorations});function gD(t){return e=>{let n=e.state.field(Gv,!1);return n&&n.query.spec.valid?t(e,n):nGe(e)}}const wz=gD((t,{query:e})=>{let{to:n}=t.state.selection.main,r=e.nextMatch(t.state,n,n);if(!r)return!1;let i=Ve.single(r.from,r.to),o=t.state.facet(KO);return t.dispatch({selection:i,effects:[Ble(t,r),o.scrollToMatch(i.main,t)],userEvent:"select.search"}),tGe(t),!0}),_z=gD((t,{query:e})=>{let{state:n}=t,{from:r}=n.selection.main,i=e.prevMatch(n,r,r);if(!i)return!1;let o=Ve.single(i.from,i.to),s=t.state.facet(KO);return t.dispatch({selection:o,effects:[Ble(t,i),s.scrollToMatch(o.main,t)],userEvent:"select.search"}),tGe(t),!0}),xyn=gD((t,{query:e})=>{let n=e.matchAll(t.state,1e3);return!n||!n.length?!1:(t.dispatch({selection:Ve.create(n.map(r=>Ve.range(r.from,r.to))),userEvent:"select.search.matches"}),!0)}),byn=({state:t,dispatch:e})=>{let n=t.selection;if(n.ranges.length>1||n.main.empty)return!1;let{from:r,to:i}=n.main,o=[],s=0;for(let a=new _C(t.doc,t.sliceDoc(r,i));!a.next().done;){if(o.length>1e3)return!1;a.value.from==r&&(s=o.length),o.push(Ve.range(a.value.from,a.value.to))}return e(t.update({selection:Ve.create(o,s),userEvent:"select.search.matches"})),!0},ewe=gD((t,{query:e})=>{let{state:n}=t,{from:r,to:i}=n.selection.main;if(n.readOnly)return!1;let o=e.nextMatch(n,r,r);if(!o)return!1;let s=[],a,l,c=[];if(o.from==r&&o.to==i&&(l=n.toText(e.getReplacement(o)),s.push({from:o.from,to:o.to,insert:l}),o=e.nextMatch(n,o.from,o.to),c.push(mt.announce.of(n.phrase("replaced match on line $",n.doc.lineAt(r).number)+"."))),o){let u=s.length==0||s[0].from>=o.to?0:o.to-o.from-l.length;a=Ve.single(o.from-u,o.to-u),c.push(Ble(t,o)),c.push(n.facet(KO).scrollToMatch(a.main,t))}return t.dispatch({changes:s,selection:a,effects:c,userEvent:"input.replace"}),!0}),wyn=gD((t,{query:e})=>{if(t.state.readOnly)return!1;let n=e.matchAll(t.state,1e9).map(i=>{let{from:o,to:s}=i;return{from:o,to:s,insert:e.getReplacement(i)}});if(!n.length)return!1;let r=t.state.phrase("replaced $ matches",n.length)+".";return t.dispatch({changes:n,effects:mt.announce.of(r),userEvent:"input.replace.all"}),!0});function jle(t){return t.state.facet(KO).createPanel(t)}function yK(t,e){var n,r,i,o,s;let a=t.selection.main,l=a.empty||a.to>a.from+100?"":t.sliceDoc(a.from,a.to);if(e&&!l)return e;let c=t.facet(KO);return new Z7e({search:((n=e==null?void 0:e.literal)!==null&&n!==void 0?n:c.literal)?l:l.replace(/\n/g,"\\n"),caseSensitive:(r=e==null?void 0:e.caseSensitive)!==null&&r!==void 0?r:c.caseSensitive,literal:(i=e==null?void 0:e.literal)!==null&&i!==void 0?i:c.literal,regexp:(o=e==null?void 0:e.regexp)!==null&&o!==void 0?o:c.regexp,wholeWord:(s=e==null?void 0:e.wholeWord)!==null&&s!==void 0?s:c.wholeWord})}function eGe(t){let e=hP(t,jle);return e&&e.dom.querySelector("[main-field]")}function tGe(t){let e=eGe(t);e&&e==t.root.activeElement&&e.select()}const nGe=t=>{let e=t.state.field(Gv,!1);if(e&&e.panel){let n=eGe(t);if(n&&n!=t.root.activeElement){let r=yK(t.state,e.query.spec);r.valid&&t.dispatch({effects:yP.of(r)}),n.focus(),n.select()}}else t.dispatch({effects:[zle.of(!0),e?yP.of(yK(t.state,e.query.spec)):rn.appendConfig.of(Oyn)]});return!0},rGe=t=>{let e=t.state.field(Gv,!1);if(!e||!e.panel)return!1;let n=hP(t,jle);return n&&n.dom.contains(t.root.activeElement)&&t.focus(),t.dispatch({effects:zle.of(!1)}),!0},_yn=[{key:"Mod-f",run:nGe,scope:"editor search-panel"},{key:"F3",run:wz,shift:_z,scope:"editor search-panel",preventDefault:!0},{key:"Mod-g",run:wz,shift:_z,scope:"editor search-panel",preventDefault:!0},{key:"Escape",run:rGe,scope:"editor search-panel"},{key:"Mod-Shift-l",run:byn},{key:"Mod-Alt-g",run:Jvn},{key:"Mod-d",run:fyn,preventDefault:!0}];class Syn{constructor(e){this.view=e;let n=this.query=e.state.field(Gv).query.spec;this.commit=this.commit.bind(this),this.searchField=Nr("input",{value:n.search,placeholder:Ll(e,"Find"),"aria-label":Ll(e,"Find"),class:"cm-textfield",name:"search",form:"","main-field":"true",onchange:this.commit,onkeyup:this.commit}),this.replaceField=Nr("input",{value:n.replace,placeholder:Ll(e,"Replace"),"aria-label":Ll(e,"Replace"),class:"cm-textfield",name:"replace",form:"",onchange:this.commit,onkeyup:this.commit}),this.caseField=Nr("input",{type:"checkbox",name:"case",form:"",checked:n.caseSensitive,onchange:this.commit}),this.reField=Nr("input",{type:"checkbox",name:"re",form:"",checked:n.regexp,onchange:this.commit}),this.wordField=Nr("input",{type:"checkbox",name:"word",form:"",checked:n.wholeWord,onchange:this.commit});function r(i,o,s){return Nr("button",{class:"cm-button",name:i,onclick:o,type:"button"},s)}this.dom=Nr("div",{onkeydown:i=>this.keydown(i),class:"cm-search"},[this.searchField,r("next",()=>wz(e),[Ll(e,"next")]),r("prev",()=>_z(e),[Ll(e,"previous")]),r("select",()=>xyn(e),[Ll(e,"all")]),Nr("label",null,[this.caseField,Ll(e,"match case")]),Nr("label",null,[this.reField,Ll(e,"regexp")]),Nr("label",null,[this.wordField,Ll(e,"by word")]),...e.state.readOnly?[]:[Nr("br"),this.replaceField,r("replace",()=>ewe(e),[Ll(e,"replace")]),r("replaceAll",()=>wyn(e),[Ll(e,"replace all")])],Nr("button",{name:"close",onclick:()=>rGe(e),"aria-label":Ll(e,"close"),type:"button"},["×"])])}commit(){let e=new Z7e({search:this.searchField.value,caseSensitive:this.caseField.checked,regexp:this.reField.checked,wholeWord:this.wordField.checked,replace:this.replaceField.value});e.eq(this.query)||(this.query=e,this.view.dispatch({effects:yP.of(e)}))}keydown(e){Rpn(this.view,e,"search-panel")?e.preventDefault():e.keyCode==13&&e.target==this.searchField?(e.preventDefault(),(e.shiftKey?_z:wz)(this.view)):e.keyCode==13&&e.target==this.replaceField&&(e.preventDefault(),ewe(this.view))}update(e){for(let n of e.transactions)for(let r of n.effects)r.is(yP)&&!r.value.eq(this.query)&&this.setQuery(r.value)}setQuery(e){this.query=e,this.searchField.value=e.search,this.replaceField.value=e.replace,this.caseField.checked=e.caseSensitive,this.reField.checked=e.regexp,this.wordField.checked=e.wholeWord}mount(){this.searchField.select()}get pos(){return 80}get top(){return this.view.state.facet(KO).top}}function Ll(t,e){return t.state.phrase(e)}const VL=30,GL=/[\s\.,:;?!]/;function Ble(t,{from:e,to:n}){let r=t.state.doc.lineAt(e),i=t.state.doc.lineAt(n).to,o=Math.max(r.from,e-VL),s=Math.min(i,n+VL),a=t.state.sliceDoc(o,s);if(o!=r.from){for(let l=0;la.length-VL;l--)if(!GL.test(a[l-1])&&GL.test(a[l])){a=a.slice(0,l);break}}return mt.announce.of(`${t.state.phrase("current match")}. ${a} ${t.state.phrase("on line")} ${r.number}.`)}const Cyn=mt.baseTheme({".cm-panel.cm-search":{padding:"2px 6px 4px",position:"relative","& [name=close]":{position:"absolute",top:"0",right:"4px",backgroundColor:"inherit",border:"none",font:"inherit",padding:0,margin:0},"& input, & button, & label":{margin:".2em .6em .2em 0"},"& input[type=checkbox]":{marginRight:".2em"},"& label":{fontSize:"80%",whiteSpace:"pre"}},"&light .cm-searchMatch":{backgroundColor:"#ffff0054"},"&dark .cm-searchMatch":{backgroundColor:"#00ffff8a"},"&light .cm-searchMatch-selected":{backgroundColor:"#ff6a0054"},"&dark .cm-searchMatch-selected":{backgroundColor:"#ff00ff8a"}}),Oyn=[Gv,n0.low(yyn),Cyn];class iGe{constructor(e,n,r,i){this.state=e,this.pos=n,this.explicit=r,this.view=i,this.abortListeners=[],this.abortOnDocChange=!1}tokenBefore(e){let n=Vo(this.state).resolveInner(this.pos,-1);for(;n&&e.indexOf(n.name)<0;)n=n.parent;return n?{from:n.from,to:this.pos,text:this.state.sliceDoc(n.from,this.pos),type:n.type}:null}matchBefore(e){let n=this.state.doc.lineAt(this.pos),r=Math.max(n.from,this.pos-250),i=n.text.slice(r-n.from,this.pos-n.from),o=i.search(sGe(e,!1));return o<0?null:{from:r+o,to:this.pos,text:i.slice(o)}}get aborted(){return this.abortListeners==null}addEventListener(e,n,r){e=="abort"&&this.abortListeners&&(this.abortListeners.push(n),r&&r.onDocChange&&(this.abortOnDocChange=!0))}}function twe(t){let e=Object.keys(t).join(""),n=/\w/.test(e);return n&&(e=e.replace(/\w/g,"")),`[${n?"\\w":""}${e.replace(/[^\w\s]/g,"\\$&")}]`}function Eyn(t){let e=Object.create(null),n=Object.create(null);for(let{label:i}of t){e[i[0]]=!0;for(let o=1;otypeof i=="string"?{label:i}:i),[n,r]=e.every(i=>/^\w+$/.test(i.label))?[/\w*$/,/\w+$/]:Eyn(e);return i=>{let o=i.matchBefore(r);return o||i.explicit?{from:o?o.from:i.pos,options:e,validFor:n}:null}}function Tyn(t,e){return n=>{for(let r=Vo(n.state).resolveInner(n.pos,-1);r;r=r.parent){if(t.indexOf(r.name)>-1)return null;if(r.type.isTop)break}return e(n)}}class nwe{constructor(e,n,r,i){this.completion=e,this.source=n,this.match=r,this.score=i}}function Hv(t){return t.selection.main.from}function sGe(t,e){var n;let{source:r}=t,i=e&&r[0]!="^",o=r[r.length-1]!="$";return!i&&!o?t:new RegExp(`${i?"^":""}(?:${r})${o?"$":""}`,(n=t.flags)!==null&&n!==void 0?n:t.ignoreCase?"i":"")}const Ule=Jh.define();function kyn(t,e,n,r){let{main:i}=t.selection,o=n-i.from,s=r-i.from;return Object.assign(Object.assign({},t.changeByRange(a=>a!=i&&n!=r&&t.sliceDoc(a.from+o,a.from+s)!=t.sliceDoc(n,r)?{range:a}:{changes:{from:a.from+o,to:r==i.from?a.to:a.from+s,insert:e},range:Ve.cursor(a.from+o+e.length)})),{scrollIntoView:!0,userEvent:"input.complete"})}const rwe=new WeakMap;function Ayn(t){if(!Array.isArray(t))return t;let e=rwe.get(t);return e||rwe.set(t,e=oGe(t)),e}const Sz=rn.define(),xP=rn.define();class Pyn{constructor(e){this.pattern=e,this.chars=[],this.folded=[],this.any=[],this.precise=[],this.byWord=[],this.score=0,this.matched=[];for(let n=0;n=48&&w<=57||w>=97&&w<=122?2:w>=65&&w<=90?1:0:(_=hle(w))!=_.toLowerCase()?1:_!=_.toUpperCase()?2:0;(!y||S==1&&m||b==0&&S!=0)&&(n[f]==w||r[f]==w&&(d=!0)?s[f++]=y:s.length&&(v=!1)),b=S,y+=Jc(w)}return f==l&&s[0]==0&&v?this.result(-100+(d?-200:0),s,e):h==l&&p==0?this.ret(-200-e.length+(g==e.length?0:-100),[0,g]):a>-1?this.ret(-700-e.length,[a,a+this.pattern.length]):h==l?this.ret(-900-e.length,[p,g]):f==l?this.result(-100+(d?-200:0)+-700+(v?0:-1100),s,e):n.length==2?null:this.result((i[0]?-700:0)+-200+-1100,i,e)}result(e,n,r){let i=[],o=0;for(let s of n){let a=s+(this.astral?Jc(ss(r,s)):1);o&&i[o-1]==s?i[o-1]=a:(i[o++]=s,i[o++]=a)}return this.ret(e-r.length,i)}}class Myn{constructor(e){this.pattern=e,this.matched=[],this.score=0,this.folded=e.toLowerCase()}match(e){if(e.length!1,activateOnTypingDelay:100,selectOnOpen:!0,override:null,closeOnBlur:!0,maxRenderedOptions:100,defaultKeymap:!0,tooltipClass:()=>"",optionClass:()=>"",aboveCursor:!1,icons:!0,addToOptions:[],positionInfo:Ryn,filterStrict:!1,compareCompletions:(e,n)=>e.label.localeCompare(n.label),interactionDelay:75,updateSyncTime:100},{defaultKeymap:(e,n)=>e&&n,closeOnBlur:(e,n)=>e&&n,icons:(e,n)=>e&&n,tooltipClass:(e,n)=>r=>iwe(e(r),n(r)),optionClass:(e,n)=>r=>iwe(e(r),n(r)),addToOptions:(e,n)=>e.concat(n),filterStrict:(e,n)=>e||n})}});function iwe(t,e){return t?e?t+" "+e:t:e}function Ryn(t,e,n,r,i,o){let s=t.textDirection==ii.RTL,a=s,l=!1,c="top",u,f,d=e.left-i.left,h=i.right-e.right,p=r.right-r.left,g=r.bottom-r.top;if(a&&d=g||y>e.top?u=n.bottom-e.top:(c="bottom",u=e.bottom-n.top)}let m=(e.bottom-e.top)/o.offsetHeight,v=(e.right-e.left)/o.offsetWidth;return{style:`${c}: ${u/m}px; max-width: ${f/v}px`,class:"cm-completionInfo-"+(l?s?"left-narrow":"right-narrow":a?"left":"right")}}function Dyn(t){let e=t.addToOptions.slice();return t.icons&&e.push({render(n){let r=document.createElement("div");return r.classList.add("cm-completionIcon"),n.type&&r.classList.add(...n.type.split(/\s+/g).map(i=>"cm-completionIcon-"+i)),r.setAttribute("aria-hidden","true"),r},position:20}),e.push({render(n,r,i,o){let s=document.createElement("span");s.className="cm-completionLabel";let a=n.displayLabel||n.label,l=0;for(let c=0;cl&&s.appendChild(document.createTextNode(a.slice(l,u)));let d=s.appendChild(document.createElement("span"));d.appendChild(document.createTextNode(a.slice(u,f))),d.className="cm-completionMatchedText",l=f}return ln.position-r.position).map(n=>n.render)}function c7(t,e,n){if(t<=n)return{from:0,to:t};if(e<0&&(e=0),e<=t>>1){let i=Math.floor(e/n);return{from:i*n,to:(i+1)*n}}let r=Math.floor((t-e)/n);return{from:t-(r+1)*n,to:t-r*n}}class Iyn{constructor(e,n,r){this.view=e,this.stateField=n,this.applyCompletion=r,this.info=null,this.infoDestroy=null,this.placeInfoReq={read:()=>this.measureInfo(),write:l=>this.placeInfo(l),key:this},this.space=null,this.currentClass="";let i=e.state.field(n),{options:o,selected:s}=i.open,a=e.state.facet(fs);this.optionContent=Dyn(a),this.optionClass=a.optionClass,this.tooltipClass=a.tooltipClass,this.range=c7(o.length,s,a.maxRenderedOptions),this.dom=document.createElement("div"),this.dom.className="cm-tooltip-autocomplete",this.updateTooltipClass(e.state),this.dom.addEventListener("mousedown",l=>{let{options:c}=e.state.field(n).open;for(let u=l.target,f;u&&u!=this.dom;u=u.parentNode)if(u.nodeName=="LI"&&(f=/-(\d+)$/.exec(u.id))&&+f[1]{let c=e.state.field(this.stateField,!1);c&&c.tooltip&&e.state.facet(fs).closeOnBlur&&l.relatedTarget!=e.contentDOM&&e.dispatch({effects:xP.of(null)})}),this.showOptions(o,i.id)}mount(){this.updateSel()}showOptions(e,n){this.list&&this.list.remove(),this.list=this.dom.appendChild(this.createListBox(e,n,this.range)),this.list.addEventListener("scroll",()=>{this.info&&this.view.requestMeasure(this.placeInfoReq)})}update(e){var n;let r=e.state.field(this.stateField),i=e.startState.field(this.stateField);if(this.updateTooltipClass(e.state),r!=i){let{options:o,selected:s,disabled:a}=r.open;(!i.open||i.open.options!=o)&&(this.range=c7(o.length,s,e.state.facet(fs).maxRenderedOptions),this.showOptions(o,r.id)),this.updateSel(),a!=((n=i.open)===null||n===void 0?void 0:n.disabled)&&this.dom.classList.toggle("cm-tooltip-autocomplete-disabled",!!a)}}updateTooltipClass(e){let n=this.tooltipClass(e);if(n!=this.currentClass){for(let r of this.currentClass.split(" "))r&&this.dom.classList.remove(r);for(let r of n.split(" "))r&&this.dom.classList.add(r);this.currentClass=n}}positioned(e){this.space=e,this.info&&this.view.requestMeasure(this.placeInfoReq)}updateSel(){let e=this.view.state.field(this.stateField),n=e.open;if((n.selected>-1&&n.selected=this.range.to)&&(this.range=c7(n.options.length,n.selected,this.view.state.facet(fs).maxRenderedOptions),this.showOptions(n.options,e.id)),this.updateSelectedOption(n.selected)){this.destroyInfo();let{completion:r}=n.options[n.selected],{info:i}=r;if(!i)return;let o=typeof i=="string"?document.createTextNode(i):i(r);if(!o)return;"then"in o?o.then(s=>{s&&this.view.state.field(this.stateField,!1)==e&&this.addInfoPane(s,r)}).catch(s=>ll(this.view.state,s,"completion info")):this.addInfoPane(o,r)}}addInfoPane(e,n){this.destroyInfo();let r=this.info=document.createElement("div");if(r.className="cm-tooltip cm-completionInfo",e.nodeType!=null)r.appendChild(e),this.infoDestroy=null;else{let{dom:i,destroy:o}=e;r.appendChild(i),this.infoDestroy=o||null}this.dom.appendChild(r),this.view.requestMeasure(this.placeInfoReq)}updateSelectedOption(e){let n=null;for(let r=this.list.firstChild,i=this.range.from;r;r=r.nextSibling,i++)r.nodeName!="LI"||!r.id?i--:i==e?r.hasAttribute("aria-selected")||(r.setAttribute("aria-selected","true"),n=r):r.hasAttribute("aria-selected")&&r.removeAttribute("aria-selected");return n&&$yn(this.list,n),n}measureInfo(){let e=this.dom.querySelector("[aria-selected]");if(!e||!this.info)return null;let n=this.dom.getBoundingClientRect(),r=this.info.getBoundingClientRect(),i=e.getBoundingClientRect(),o=this.space;if(!o){let s=this.dom.ownerDocument.defaultView||window;o={left:0,top:0,right:s.innerWidth,bottom:s.innerHeight}}return i.top>Math.min(o.bottom,n.bottom)-10||i.bottomr.from||r.from==0))if(o=d,typeof c!="string"&&c.header)i.appendChild(c.header(c));else{let h=i.appendChild(document.createElement("completion-section"));h.textContent=d}}const u=i.appendChild(document.createElement("li"));u.id=n+"-"+s,u.setAttribute("role","option");let f=this.optionClass(a);f&&(u.className=f);for(let d of this.optionContent){let h=d(a,this.view.state,this.view,l);h&&u.appendChild(h)}}return r.from&&i.classList.add("cm-completionListIncompleteTop"),r.tonew Iyn(n,t,e)}function $yn(t,e){let n=t.getBoundingClientRect(),r=e.getBoundingClientRect(),i=n.height/t.offsetHeight;r.topn.bottom&&(t.scrollTop+=(r.bottom-n.bottom)/i)}function owe(t){return(t.boost||0)*100+(t.apply?10:0)+(t.info?5:0)+(t.type?1:0)}function Fyn(t,e){let n=[],r=null,i=c=>{n.push(c);let{section:u}=c.completion;if(u){r||(r=[]);let f=typeof u=="string"?u:u.name;r.some(d=>d.name==f)||r.push(typeof u=="string"?{name:f}:u)}},o=e.facet(fs);for(let c of t)if(c.hasResult()){let u=c.result.getMatch;if(c.result.filter===!1)for(let f of c.result.options)i(new nwe(f,c.source,u?u(f):[],1e9-n.length));else{let f=e.sliceDoc(c.from,c.to),d,h=o.filterStrict?new Myn(f):new Pyn(f);for(let p of c.result.options)if(d=h.match(p.label)){let g=p.displayLabel?u?u(p,d.matched):[]:d.matched;i(new nwe(p,c.source,g,d.score+(p.boost||0)))}}}if(r){let c=Object.create(null),u=0,f=(d,h)=>{var p,g;return((p=d.rank)!==null&&p!==void 0?p:1e9)-((g=h.rank)!==null&&g!==void 0?g:1e9)||(d.namef.score-u.score||l(u.completion,f.completion))){let u=c.completion;!a||a.label!=u.label||a.detail!=u.detail||a.type!=null&&u.type!=null&&a.type!=u.type||a.apply!=u.apply||a.boost!=u.boost?s.push(c):owe(c.completion)>owe(a)&&(s[s.length-1]=c),a=c.completion}return s}class v_{constructor(e,n,r,i,o,s){this.options=e,this.attrs=n,this.tooltip=r,this.timestamp=i,this.selected=o,this.disabled=s}setSelected(e,n){return e==this.selected||e>=this.options.length?this:new v_(this.options,swe(n,e),this.tooltip,this.timestamp,e,this.disabled)}static build(e,n,r,i,o){let s=Fyn(e,n);if(!s.length)return i&&e.some(l=>l.state==1)?new v_(i.options,i.attrs,i.tooltip,i.timestamp,i.selected,!0):null;let a=n.facet(fs).selectOnOpen?0:-1;if(i&&i.selected!=a&&i.selected!=-1){let l=i.options[i.selected].completion;for(let c=0;cc.hasResult()?Math.min(l,c.from):l,1e8),create:Wyn,above:o.aboveCursor},i?i.timestamp:Date.now(),a,!1)}map(e){return new v_(this.options,this.attrs,Object.assign(Object.assign({},this.tooltip),{pos:e.mapPos(this.tooltip.pos)}),this.timestamp,this.selected,this.disabled)}}class Cz{constructor(e,n,r){this.active=e,this.id=n,this.open=r}static start(){return new Cz(Byn,"cm-ac-"+Math.floor(Math.random()*2e6).toString(36),null)}update(e){let{state:n}=e,r=n.facet(fs),o=(r.override||n.languageDataAt("autocomplete",Hv(n)).map(Ayn)).map(a=>(this.active.find(c=>c.source==a)||new rc(a,this.active.some(c=>c.state!=0)?1:0)).update(e,r));o.length==this.active.length&&o.every((a,l)=>a==this.active[l])&&(o=this.active);let s=this.open;s&&e.docChanged&&(s=s.map(e.changes)),e.selection||o.some(a=>a.hasResult()&&e.changes.touchesRange(a.from,a.to))||!Nyn(o,this.active)?s=v_.build(o,n,this.id,s,r):s&&s.disabled&&!o.some(a=>a.state==1)&&(s=null),!s&&o.every(a=>a.state!=1)&&o.some(a=>a.hasResult())&&(o=o.map(a=>a.hasResult()?new rc(a.source,0):a));for(let a of e.effects)a.is(cGe)&&(s=s&&s.setSelected(a.value,this.id));return o==this.active&&s==this.open?this:new Cz(o,this.id,s)}get tooltip(){return this.open?this.open.tooltip:null}get attrs(){return this.open?this.open.attrs:this.active.length?zyn:jyn}}function Nyn(t,e){if(t==e)return!0;for(let n=0,r=0;;){for(;n-1&&(n["aria-activedescendant"]=t+"-"+e),n}const Byn=[];function aGe(t,e){if(t.isUserEvent("input.complete")){let r=t.annotation(Ule);if(r&&e.activateOnCompletion(r))return 12}let n=t.isUserEvent("input.type");return n&&e.activateOnTyping?5:n?1:t.isUserEvent("delete.backward")?2:t.selection?8:t.docChanged?16:0}class rc{constructor(e,n,r=-1){this.source=e,this.state=n,this.explicitPos=r}hasResult(){return!1}update(e,n){let r=aGe(e,n),i=this;(r&8||r&16&&this.touches(e))&&(i=new rc(i.source,0)),r&4&&i.state==0&&(i=new rc(this.source,1)),i=i.updateFor(e,r);for(let o of e.effects)if(o.is(Sz))i=new rc(i.source,1,o.value?Hv(e.state):-1);else if(o.is(xP))i=new rc(i.source,0);else if(o.is(lGe))for(let s of o.value)s.source==i.source&&(i=s);return i}updateFor(e,n){return this.map(e.changes)}map(e){return e.empty||this.explicitPos<0?this:new rc(this.source,this.state,e.mapPos(this.explicitPos))}touches(e){return e.changes.touchesRange(Hv(e.state))}}class eS extends rc{constructor(e,n,r,i,o){super(e,2,n),this.result=r,this.from=i,this.to=o}hasResult(){return!0}updateFor(e,n){var r;if(!(n&3))return this.map(e.changes);let i=this.result;i.map&&!e.changes.empty&&(i=i.map(i,e.changes));let o=e.changes.mapPos(this.from),s=e.changes.mapPos(this.to,1),a=Hv(e.state);if((this.explicitPos<0?a<=o:as||!i||n&2&&Hv(e.startState)==this.from)return new rc(this.source,n&4?1:0);let l=this.explicitPos<0?-1:e.changes.mapPos(this.explicitPos);return Uyn(i.validFor,e.state,o,s)?new eS(this.source,l,i,o,s):i.update&&(i=i.update(i,o,s,new iGe(e.state,a,l>=0)))?new eS(this.source,l,i,i.from,(r=i.to)!==null&&r!==void 0?r:Hv(e.state)):new rc(this.source,1,l)}map(e){return e.empty?this:(this.result.map?this.result.map(this.result,e):this.result)?new eS(this.source,this.explicitPos<0?-1:e.mapPos(this.explicitPos),this.result,e.mapPos(this.from),e.mapPos(this.to,1)):new rc(this.source,0)}touches(e){return e.changes.touchesRange(this.from,this.to)}}function Uyn(t,e,n,r){if(!t)return!1;let i=e.sliceDoc(n,r);return typeof t=="function"?t(i,n,r,e):sGe(t,!0).test(i)}const lGe=rn.define({map(t,e){return t.map(n=>n.map(e))}}),cGe=rn.define(),el=Qo.define({create(){return Cz.start()},update(t,e){return t.update(e)},provide:t=>[Ole.from(t,e=>e.tooltip),mt.contentAttributes.from(t,e=>e.attrs)]});function Wle(t,e){const n=e.completion.apply||e.completion.label;let r=t.state.field(el).active.find(i=>i.source==e.source);return r instanceof eS?(typeof n=="string"?t.dispatch(Object.assign(Object.assign({},kyn(t.state,n,r.from,r.to)),{annotations:Ule.of(e.completion)})):n(t,e.completion,r.from,r.to),!0):!1}const Wyn=Lyn(el,Wle);function HL(t,e="option"){return n=>{let r=n.state.field(el,!1);if(!r||!r.open||r.open.disabled||Date.now()-r.open.timestamp-1?r.open.selected+i*(t?1:-1):t?0:s-1;return a<0?a=e=="page"?0:s-1:a>=s&&(a=e=="page"?s-1:0),n.dispatch({effects:cGe.of(a)}),!0}}const Vyn=t=>{let e=t.state.field(el,!1);return t.state.readOnly||!e||!e.open||e.open.selected<0||e.open.disabled||Date.now()-e.open.timestampt.state.field(el,!1)?(t.dispatch({effects:Sz.of(!0)}),!0):!1,Hyn=t=>{let e=t.state.field(el,!1);return!e||!e.active.some(n=>n.state!=0)?!1:(t.dispatch({effects:xP.of(null)}),!0)};class qyn{constructor(e,n){this.active=e,this.context=n,this.time=Date.now(),this.updates=[],this.done=void 0}}const Xyn=50,Yyn=1e3,Qyn=Qi.fromClass(class{constructor(t){this.view=t,this.debounceUpdate=-1,this.running=[],this.debounceAccept=-1,this.pendingStart=!1,this.composing=0;for(let e of t.state.field(el).active)e.state==1&&this.startQuery(e)}update(t){let e=t.state.field(el),n=t.state.facet(fs);if(!t.selectionSet&&!t.docChanged&&t.startState.field(el)==e)return;let r=t.transactions.some(o=>{let s=aGe(o,n);return s&8||(o.selection||o.docChanged)&&!(s&3)});for(let o=0;oXyn&&Date.now()-s.time>Yyn){for(let a of s.context.abortListeners)try{a()}catch(l){ll(this.view.state,l)}s.context.abortListeners=null,this.running.splice(o--,1)}else s.updates.push(...t.transactions)}this.debounceUpdate>-1&&clearTimeout(this.debounceUpdate),t.transactions.some(o=>o.effects.some(s=>s.is(Sz)))&&(this.pendingStart=!0);let i=this.pendingStart?50:n.activateOnTypingDelay;if(this.debounceUpdate=e.active.some(o=>o.state==1&&!this.running.some(s=>s.active.source==o.source))?setTimeout(()=>this.startUpdate(),i):-1,this.composing!=0)for(let o of t.transactions)o.isUserEvent("input.type")?this.composing=2:this.composing==2&&o.selection&&(this.composing=3)}startUpdate(){this.debounceUpdate=-1,this.pendingStart=!1;let{state:t}=this.view,e=t.field(el);for(let n of e.active)n.state==1&&!this.running.some(r=>r.active.source==n.source)&&this.startQuery(n)}startQuery(t){let{state:e}=this.view,n=Hv(e),r=new iGe(e,n,t.explicitPos==n,this.view),i=new qyn(t,r);this.running.push(i),Promise.resolve(t.source(r)).then(o=>{i.context.aborted||(i.done=o||null,this.scheduleAccept())},o=>{this.view.dispatch({effects:xP.of(null)}),ll(this.view.state,o)})}scheduleAccept(){this.running.every(t=>t.done!==void 0)?this.accept():this.debounceAccept<0&&(this.debounceAccept=setTimeout(()=>this.accept(),this.view.state.facet(fs).updateSyncTime))}accept(){var t;this.debounceAccept>-1&&clearTimeout(this.debounceAccept),this.debounceAccept=-1;let e=[],n=this.view.state.facet(fs);for(let r=0;rs.source==i.active.source);if(o&&o.state==1)if(i.done==null){let s=new rc(i.active.source,0);for(let a of i.updates)s=s.update(a,n);s.state!=1&&e.push(s)}else this.startQuery(o)}e.length&&this.view.dispatch({effects:lGe.of(e)})}},{eventHandlers:{blur(t){let e=this.view.state.field(el,!1);if(e&&e.tooltip&&this.view.state.facet(fs).closeOnBlur){let n=e.open&&U9e(this.view,e.open.tooltip);(!n||!n.dom.contains(t.relatedTarget))&&setTimeout(()=>this.view.dispatch({effects:xP.of(null)}),10)}},compositionstart(){this.composing=1},compositionend(){this.composing==3&&setTimeout(()=>this.view.dispatch({effects:Sz.of(!1)}),20),this.composing=0}}}),Kyn=typeof navigator=="object"&&/Win/.test(navigator.platform),Zyn=n0.highest(mt.domEventHandlers({keydown(t,e){let n=e.state.field(el,!1);if(!n||!n.open||n.open.disabled||n.open.selected<0||t.key.length>1||t.ctrlKey&&!(Kyn&&t.altKey)||t.metaKey)return!1;let r=n.open.options[n.open.selected],i=n.active.find(s=>s.source==r.source),o=r.completion.commitCharacters||i.result.commitCharacters;return o&&o.indexOf(t.key)>-1&&Wle(e,r),!1}})),uGe=mt.baseTheme({".cm-tooltip.cm-tooltip-autocomplete":{"& > ul":{fontFamily:"monospace",whiteSpace:"nowrap",overflow:"hidden auto",maxWidth_fallback:"700px",maxWidth:"min(700px, 95vw)",minWidth:"250px",maxHeight:"10em",height:"100%",listStyle:"none",margin:0,padding:0,"& > li, & > completion-section":{padding:"1px 3px",lineHeight:1.2},"& > li":{overflowX:"hidden",textOverflow:"ellipsis",cursor:"pointer"},"& > completion-section":{display:"list-item",borderBottom:"1px solid silver",paddingLeft:"0.5em",opacity:.7}}},"&light .cm-tooltip-autocomplete ul li[aria-selected]":{background:"#17c",color:"white"},"&light .cm-tooltip-autocomplete-disabled ul li[aria-selected]":{background:"#777"},"&dark .cm-tooltip-autocomplete ul li[aria-selected]":{background:"#347",color:"white"},"&dark .cm-tooltip-autocomplete-disabled ul li[aria-selected]":{background:"#444"},".cm-completionListIncompleteTop:before, .cm-completionListIncompleteBottom:after":{content:'"···"',opacity:.5,display:"block",textAlign:"center"},".cm-tooltip.cm-completionInfo":{position:"absolute",padding:"3px 9px",width:"max-content",maxWidth:"400px",boxSizing:"border-box",whiteSpace:"pre-line"},".cm-completionInfo.cm-completionInfo-left":{right:"100%"},".cm-completionInfo.cm-completionInfo-right":{left:"100%"},".cm-completionInfo.cm-completionInfo-left-narrow":{right:"30px"},".cm-completionInfo.cm-completionInfo-right-narrow":{left:"30px"},"&light .cm-snippetField":{backgroundColor:"#00000022"},"&dark .cm-snippetField":{backgroundColor:"#ffffff22"},".cm-snippetFieldPosition":{verticalAlign:"text-top",width:0,height:"1.15em",display:"inline-block",margin:"0 -0.7px -.7em",borderLeft:"1.4px dotted #888"},".cm-completionMatchedText":{textDecoration:"underline"},".cm-completionDetail":{marginLeft:"0.5em",fontStyle:"italic"},".cm-completionIcon":{fontSize:"90%",width:".8em",display:"inline-block",textAlign:"center",paddingRight:".6em",opacity:"0.6",boxSizing:"content-box"},".cm-completionIcon-function, .cm-completionIcon-method":{"&:after":{content:"'ƒ'"}},".cm-completionIcon-class":{"&:after":{content:"'○'"}},".cm-completionIcon-interface":{"&:after":{content:"'◌'"}},".cm-completionIcon-variable":{"&:after":{content:"'𝑥'"}},".cm-completionIcon-constant":{"&:after":{content:"'𝐶'"}},".cm-completionIcon-type":{"&:after":{content:"'𝑡'"}},".cm-completionIcon-enum":{"&:after":{content:"'∪'"}},".cm-completionIcon-property":{"&:after":{content:"'□'"}},".cm-completionIcon-keyword":{"&:after":{content:"'🔑︎'"}},".cm-completionIcon-namespace":{"&:after":{content:"'▢'"}},".cm-completionIcon-text":{"&:after":{content:"'abc'",fontSize:"50%",verticalAlign:"middle"}}});class Jyn{constructor(e,n,r,i){this.field=e,this.line=n,this.from=r,this.to=i}}class Vle{constructor(e,n,r){this.field=e,this.from=n,this.to=r}map(e){let n=e.mapPos(this.from,-1,us.TrackDel),r=e.mapPos(this.to,1,us.TrackDel);return n==null||r==null?null:new Vle(this.field,n,r)}}class Gle{constructor(e,n){this.lines=e,this.fieldPositions=n}instantiate(e,n){let r=[],i=[n],o=e.doc.lineAt(n),s=/^\s*/.exec(o.text)[0];for(let l of this.lines){if(r.length){let c=s,u=/^\t*/.exec(l)[0].length;for(let f=0;fnew Vle(l.field,i[l.line]+l.from,i[l.line]+l.to));return{text:r,ranges:a}}static parse(e){let n=[],r=[],i=[],o;for(let s of e.split(/\r\n?|\n/)){for(;o=/[#$]\{(?:(\d+)(?::([^}]*))?|((?:\\[{}]|[^}])*))\}/.exec(s);){let a=o[1]?+o[1]:null,l=o[2]||o[3]||"",c=-1,u=l.replace(/\\[{}]/g,f=>f[1]);for(let f=0;f=c&&d.field++}i.push(new Jyn(c,r.length,o.index,o.index+u.length)),s=s.slice(0,o.index)+l+s.slice(o.index+o[0].length)}s=s.replace(/\\([{}])/g,(a,l,c)=>{for(let u of i)u.line==r.length&&u.from>c&&(u.from--,u.to--);return l}),r.push(s)}return new Gle(r,i)}}let e0n=It.widget({widget:new class extends tp{toDOM(){let t=document.createElement("span");return t.className="cm-snippetFieldPosition",t}ignoreEvent(){return!1}}}),t0n=It.mark({class:"cm-snippetField"});class ZO{constructor(e,n){this.ranges=e,this.active=n,this.deco=It.set(e.map(r=>(r.from==r.to?e0n:t0n).range(r.from,r.to)))}map(e){let n=[];for(let r of this.ranges){let i=r.map(e);if(!i)return null;n.push(i)}return new ZO(n,this.active)}selectionInsideField(e){return e.ranges.every(n=>this.ranges.some(r=>r.field==this.active&&r.from<=n.from&&r.to>=n.to))}}const mD=rn.define({map(t,e){return t&&t.map(e)}}),n0n=rn.define(),bP=Qo.define({create(){return null},update(t,e){for(let n of e.effects){if(n.is(mD))return n.value;if(n.is(n0n)&&t)return new ZO(t.ranges,n.value)}return t&&e.docChanged&&(t=t.map(e.changes)),t&&e.selection&&!t.selectionInsideField(e.selection)&&(t=null),t},provide:t=>mt.decorations.from(t,e=>e?e.deco:It.none)});function Hle(t,e){return Ve.create(t.filter(n=>n.field==e).map(n=>Ve.range(n.from,n.to)))}function r0n(t){let e=Gle.parse(t);return(n,r,i,o)=>{let{text:s,ranges:a}=e.instantiate(n.state,i),l={changes:{from:i,to:o,insert:ar.of(s)},scrollIntoView:!0,annotations:r?[Ule.of(r),lo.userEvent.of("input.complete")]:void 0};if(a.length&&(l.selection=Hle(a,0)),a.some(c=>c.field>0)){let c=new ZO(a,0),u=l.effects=[mD.of(c)];n.state.field(bP,!1)===void 0&&u.push(rn.appendConfig.of([bP,l0n,c0n,uGe]))}n.dispatch(n.state.update(l))}}function fGe(t){return({state:e,dispatch:n})=>{let r=e.field(bP,!1);if(!r||t<0&&r.active==0)return!1;let i=r.active+t,o=t>0&&!r.ranges.some(s=>s.field==i+t);return n(e.update({selection:Hle(r.ranges,i),effects:mD.of(o?null:new ZO(r.ranges,i)),scrollIntoView:!0})),!0}}const i0n=({state:t,dispatch:e})=>t.field(bP,!1)?(e(t.update({effects:mD.of(null)})),!0):!1,o0n=fGe(1),s0n=fGe(-1),a0n=[{key:"Tab",run:o0n,shift:s0n},{key:"Escape",run:i0n}],awe=_t.define({combine(t){return t.length?t[0]:a0n}}),l0n=n0.highest(cD.compute([awe],t=>t.facet(awe)));function pp(t,e){return Object.assign(Object.assign({},e),{apply:r0n(t)})}const c0n=mt.domEventHandlers({mousedown(t,e){let n=e.state.field(bP,!1),r;if(!n||(r=e.posAtCoords({x:t.clientX,y:t.clientY}))==null)return!1;let i=n.ranges.find(o=>o.from<=r&&o.to>=r);return!i||i.field==n.active?!1:(e.dispatch({selection:Hle(n.ranges,i.field),effects:mD.of(n.ranges.some(o=>o.field>i.field)?new ZO(n.ranges,i.field):null),scrollIntoView:!0}),!0)}}),wP={brackets:["(","[","{","'",'"'],before:")]}:;>",stringPrefixes:[]},yx=rn.define({map(t,e){let n=e.mapPos(t,-1,us.TrackAfter);return n??void 0}}),qle=new class extends M1{};qle.startSide=1;qle.endSide=-1;const dGe=Qo.define({create(){return Gn.empty},update(t,e){if(t=t.map(e.changes),e.selection){let n=e.state.doc.lineAt(e.selection.main.head);t=t.update({filter:r=>r>=n.from&&r<=n.to})}for(let n of e.effects)n.is(yx)&&(t=t.update({add:[qle.range(n.value,n.value+1)]}));return t}});function u0n(){return[d0n,dGe]}const u7="()[]{}<>";function hGe(t){for(let e=0;e{if((f0n?t.composing:t.compositionStarted)||t.state.readOnly)return!1;let i=t.state.selection.main;if(r.length>2||r.length==2&&Jc(ss(r,0))==1||e!=i.from||n!=i.to)return!1;let o=g0n(t.state,r);return o?(t.dispatch(o),!0):!1}),h0n=({state:t,dispatch:e})=>{if(t.readOnly)return!1;let r=pGe(t,t.selection.main.head).brackets||wP.brackets,i=null,o=t.changeByRange(s=>{if(s.empty){let a=m0n(t.doc,s.head);for(let l of r)if(l==a&&$U(t.doc,s.head)==hGe(ss(l,0)))return{changes:{from:s.head-l.length,to:s.head+l.length},range:Ve.cursor(s.head-l.length)}}return{range:i=s}});return i||e(t.update(o,{scrollIntoView:!0,userEvent:"delete.backward"})),!i},p0n=[{key:"Backspace",run:h0n}];function g0n(t,e){let n=pGe(t,t.selection.main.head),r=n.brackets||wP.brackets;for(let i of r){let o=hGe(ss(i,0));if(e==i)return o==i?x0n(t,i,r.indexOf(i+i+i)>-1,n):v0n(t,i,o,n.before||wP.before);if(e==o&&gGe(t,t.selection.main.from))return y0n(t,i,o)}return null}function gGe(t,e){let n=!1;return t.field(dGe).between(0,t.doc.length,r=>{r==e&&(n=!0)}),n}function $U(t,e){let n=t.sliceString(e,e+2);return n.slice(0,Jc(ss(n,0)))}function m0n(t,e){let n=t.sliceString(e-2,e);return Jc(ss(n,0))==n.length?n:n.slice(1)}function v0n(t,e,n,r){let i=null,o=t.changeByRange(s=>{if(!s.empty)return{changes:[{insert:e,from:s.from},{insert:n,from:s.to}],effects:yx.of(s.to+e.length),range:Ve.range(s.anchor+e.length,s.head+e.length)};let a=$U(t.doc,s.head);return!a||/\s/.test(a)||r.indexOf(a)>-1?{changes:{insert:e+n,from:s.head},effects:yx.of(s.head+e.length),range:Ve.cursor(s.head+e.length)}:{range:i=s}});return i?null:t.update(o,{scrollIntoView:!0,userEvent:"input.type"})}function y0n(t,e,n){let r=null,i=t.changeByRange(o=>o.empty&&$U(t.doc,o.head)==n?{changes:{from:o.head,to:o.head+n.length,insert:n},range:Ve.cursor(o.head+n.length)}:r={range:o});return r?null:t.update(i,{scrollIntoView:!0,userEvent:"input.type"})}function x0n(t,e,n,r){let i=r.stringPrefixes||wP.stringPrefixes,o=null,s=t.changeByRange(a=>{if(!a.empty)return{changes:[{insert:e,from:a.from},{insert:e,from:a.to}],effects:yx.of(a.to+e.length),range:Ve.range(a.anchor+e.length,a.head+e.length)};let l=a.head,c=$U(t.doc,l),u;if(c==e){if(lwe(t,l))return{changes:{insert:e+e,from:l},effects:yx.of(l+e.length),range:Ve.cursor(l+e.length)};if(gGe(t,l)){let d=n&&t.sliceDoc(l,l+e.length*3)==e+e+e?e+e+e:e;return{changes:{from:l,to:l+d.length,insert:d},range:Ve.cursor(l+d.length)}}}else{if(n&&t.sliceDoc(l-2*e.length,l)==e+e&&(u=cwe(t,l-2*e.length,i))>-1&&lwe(t,u))return{changes:{insert:e+e+e+e,from:l},effects:yx.of(l+e.length),range:Ve.cursor(l+e.length)};if(t.charCategorizer(l)(c)!=pi.Word&&cwe(t,l,i)>-1&&!b0n(t,l,e,i))return{changes:{insert:e+e,from:l},effects:yx.of(l+e.length),range:Ve.cursor(l+e.length)}}return{range:o=a}});return o?null:t.update(s,{scrollIntoView:!0,userEvent:"input.type"})}function lwe(t,e){let n=Vo(t).resolveInner(e+1);return n.parent&&n.from==e}function b0n(t,e,n,r){let i=Vo(t).resolveInner(e,-1),o=r.reduce((s,a)=>Math.max(s,a.length),0);for(let s=0;s<5;s++){let a=t.sliceDoc(i.from,Math.min(i.to,i.from+n.length+o)),l=a.indexOf(n);if(!l||l>-1&&r.indexOf(a.slice(0,l))>-1){let u=i.firstChild;for(;u&&u.from==i.from&&u.to-u.from>n.length+l;){if(t.sliceDoc(u.to-n.length,u.to)==n)return!1;u=u.firstChild}return!0}let c=i.to==e&&i.parent;if(!c)break;i=c}return!1}function cwe(t,e,n){let r=t.charCategorizer(e);if(r(t.sliceDoc(e-1,e))!=pi.Word)return e;for(let i of n){let o=e-i.length;if(t.sliceDoc(o,e)==i&&r(t.sliceDoc(o-1,o))!=pi.Word)return o}return-1}function mGe(t={}){return[Zyn,el,fs.of(t),Qyn,w0n,uGe]}const vGe=[{key:"Ctrl-Space",run:Gyn},{key:"Escape",run:Hyn},{key:"ArrowDown",run:HL(!0)},{key:"ArrowUp",run:HL(!1)},{key:"PageDown",run:HL(!0,"page")},{key:"PageUp",run:HL(!1,"page")},{key:"Enter",run:Vyn}],w0n=n0.highest(cD.computeN([fs],t=>t.facet(fs).defaultKeymap?[vGe]:[]));class _0n{constructor(e,n,r){this.from=e,this.to=n,this.diagnostic=r}}class rx{constructor(e,n,r){this.diagnostics=e,this.panel=n,this.selected=r}static init(e,n,r){let i=e,o=r.facet(_P).markerFilter;o&&(i=o(i,r));let s=It.set(i.map(a=>a.from==a.to||a.from==a.to-1&&r.doc.lineAt(a.from).to==a.from?It.widget({widget:new M0n(a),diagnostic:a}).range(a.from):It.mark({attributes:{class:"cm-lintRange cm-lintRange-"+a.severity+(a.markClass?" "+a.markClass:"")},diagnostic:a}).range(a.from,a.to)),!0);return new rx(s,n,SC(s))}}function SC(t,e=null,n=0){let r=null;return t.between(n,1e9,(i,o,{spec:s})=>{if(!(e&&s.diagnostic!=e))return r=new _0n(i,o,s.diagnostic),!1}),r}function S0n(t,e){let n=e.pos,r=e.end||n,i=t.state.facet(_P).hideOn(t,n,r);if(i!=null)return i;let o=t.startState.doc.lineAt(e.pos);return!!(t.effects.some(s=>s.is(yGe))||t.changes.touchesRange(o.from,Math.max(o.to,r)))}function C0n(t,e){return t.field(uc,!1)?e:e.concat(rn.appendConfig.of(I0n))}const yGe=rn.define(),Xle=rn.define(),xGe=rn.define(),uc=Qo.define({create(){return new rx(It.none,null,null)},update(t,e){if(e.docChanged&&t.diagnostics.size){let n=t.diagnostics.map(e.changes),r=null,i=t.panel;if(t.selected){let o=e.changes.mapPos(t.selected.from,1);r=SC(n,t.selected.diagnostic,o)||SC(n,null,o)}!n.size&&i&&e.state.facet(_P).autoPanel&&(i=null),t=new rx(n,i,r)}for(let n of e.effects)if(n.is(yGe)){let r=e.state.facet(_P).autoPanel?n.value.length?SP.open:null:t.panel;t=rx.init(n.value,r,e.state)}else n.is(Xle)?t=new rx(t.diagnostics,n.value?SP.open:null,t.selected):n.is(xGe)&&(t=new rx(t.diagnostics,t.panel,n.value));return t},provide:t=>[pP.from(t,e=>e.panel),mt.decorations.from(t,e=>e.diagnostics)]}),O0n=It.mark({class:"cm-lintRange cm-lintRange-active"});function E0n(t,e,n){let{diagnostics:r}=t.state.field(uc),i=[],o=2e8,s=0;r.between(e-(n<0?1:0),e+(n>0?1:0),(l,c,{spec:u})=>{e>=l&&e<=c&&(l==c||(e>l||n>0)&&(ewGe(t,n,!1)))}const k0n=t=>{let e=t.state.field(uc,!1);(!e||!e.panel)&&t.dispatch({effects:C0n(t.state,[Xle.of(!0)])});let n=hP(t,SP.open);return n&&n.dom.querySelector(".cm-panel-lint ul").focus(),!0},uwe=t=>{let e=t.state.field(uc,!1);return!e||!e.panel?!1:(t.dispatch({effects:Xle.of(!1)}),!0)},A0n=t=>{let e=t.state.field(uc,!1);if(!e)return!1;let n=t.state.selection.main,r=e.diagnostics.iter(n.to+1);return!r.value&&(r=e.diagnostics.iter(0),!r.value||r.from==n.from&&r.to==n.to)?!1:(t.dispatch({selection:{anchor:r.from,head:r.to},scrollIntoView:!0}),!0)},P0n=[{key:"Mod-Shift-m",run:k0n,preventDefault:!0},{key:"F8",run:A0n}],_P=_t.define({combine(t){return Object.assign({sources:t.map(e=>e.source).filter(e=>e!=null)},ep(t.map(e=>e.config),{delay:750,markerFilter:null,tooltipFilter:null,needsRefresh:null,hideOn:()=>null},{needsRefresh:(e,n)=>e?n?r=>e(r)||n(r):e:n}))}});function bGe(t){let e=[];if(t)e:for(let{name:n}of t){for(let r=0;ro.toLowerCase()==i.toLowerCase())){e.push(i);continue e}}e.push("")}return e}function wGe(t,e,n){var r;let i=n?bGe(e.actions):[];return Nr("li",{class:"cm-diagnostic cm-diagnostic-"+e.severity},Nr("span",{class:"cm-diagnosticText"},e.renderMessage?e.renderMessage(t):e.message),(r=e.actions)===null||r===void 0?void 0:r.map((o,s)=>{let a=!1,l=d=>{if(d.preventDefault(),a)return;a=!0;let h=SC(t.state.field(uc).diagnostics,e);h&&o.apply(t,h.from,h.to)},{name:c}=o,u=i[s]?c.indexOf(i[s]):-1,f=u<0?c:[c.slice(0,u),Nr("u",c.slice(u,u+1)),c.slice(u+1)];return Nr("button",{type:"button",class:"cm-diagnosticAction",onclick:l,onmousedown:l,"aria-label":` Action: ${c}${u<0?"":` (access key "${i[s]})"`}.`},f)}),e.source&&Nr("div",{class:"cm-diagnosticSource"},e.source))}class M0n extends tp{constructor(e){super(),this.diagnostic=e}eq(e){return e.diagnostic==this.diagnostic}toDOM(){return Nr("span",{class:"cm-lintPoint cm-lintPoint-"+this.diagnostic.severity})}}class fwe{constructor(e,n){this.diagnostic=n,this.id="item_"+Math.floor(Math.random()*4294967295).toString(16),this.dom=wGe(e,n,!0),this.dom.id=this.id,this.dom.setAttribute("role","option")}}class SP{constructor(e){this.view=e,this.items=[];let n=i=>{if(i.keyCode==27)uwe(this.view),this.view.focus();else if(i.keyCode==38||i.keyCode==33)this.moveSelection((this.selectedIndex-1+this.items.length)%this.items.length);else if(i.keyCode==40||i.keyCode==34)this.moveSelection((this.selectedIndex+1)%this.items.length);else if(i.keyCode==36)this.moveSelection(0);else if(i.keyCode==35)this.moveSelection(this.items.length-1);else if(i.keyCode==13)this.view.focus();else if(i.keyCode>=65&&i.keyCode<=90&&this.selectedIndex>=0){let{diagnostic:o}=this.items[this.selectedIndex],s=bGe(o.actions);for(let a=0;a{for(let o=0;ouwe(this.view)},"×")),this.update()}get selectedIndex(){let e=this.view.state.field(uc).selected;if(!e)return-1;for(let n=0;n{let c=-1,u;for(let f=r;fr&&(this.items.splice(r,c-r),i=!0)),n&&u.diagnostic==n.diagnostic?u.dom.hasAttribute("aria-selected")||(u.dom.setAttribute("aria-selected","true"),o=u):u.dom.hasAttribute("aria-selected")&&u.dom.removeAttribute("aria-selected"),r++});r({sel:o.dom.getBoundingClientRect(),panel:this.list.getBoundingClientRect()}),write:({sel:s,panel:a})=>{let l=a.height/this.list.offsetHeight;s.topa.bottom&&(this.list.scrollTop+=(s.bottom-a.bottom)/l)}})):this.selectedIndex<0&&this.list.removeAttribute("aria-activedescendant"),i&&this.sync()}sync(){let e=this.list.firstChild;function n(){let r=e;e=r.nextSibling,r.remove()}for(let r of this.items)if(r.dom.parentNode==this.list){for(;e!=r.dom;)n();e=r.dom.nextSibling}else this.list.insertBefore(r.dom,e);for(;e;)n()}moveSelection(e){if(this.selectedIndex<0)return;let n=this.view.state.field(uc),r=SC(n.diagnostics,this.items[e].diagnostic);r&&this.view.dispatch({selection:{anchor:r.from,head:r.to},scrollIntoView:!0,effects:xGe.of(r)})}static open(e){return new SP(e)}}function R0n(t,e='viewBox="0 0 40 40"'){return`url('data:image/svg+xml,${encodeURIComponent(t)}')`}function qL(t){return R0n(``,'width="6" height="3"')}const D0n=mt.baseTheme({".cm-diagnostic":{padding:"3px 6px 3px 8px",marginLeft:"-1px",display:"block",whiteSpace:"pre-wrap"},".cm-diagnostic-error":{borderLeft:"5px solid #d11"},".cm-diagnostic-warning":{borderLeft:"5px solid orange"},".cm-diagnostic-info":{borderLeft:"5px solid #999"},".cm-diagnostic-hint":{borderLeft:"5px solid #66d"},".cm-diagnosticAction":{font:"inherit",border:"none",padding:"2px 4px",backgroundColor:"#444",color:"white",borderRadius:"3px",marginLeft:"8px",cursor:"pointer"},".cm-diagnosticSource":{fontSize:"70%",opacity:.7},".cm-lintRange":{backgroundPosition:"left bottom",backgroundRepeat:"repeat-x",paddingBottom:"0.7px"},".cm-lintRange-error":{backgroundImage:qL("#d11")},".cm-lintRange-warning":{backgroundImage:qL("orange")},".cm-lintRange-info":{backgroundImage:qL("#999")},".cm-lintRange-hint":{backgroundImage:qL("#66d")},".cm-lintRange-active":{backgroundColor:"#ffdd9980"},".cm-tooltip-lint":{padding:0,margin:0},".cm-lintPoint":{position:"relative","&:after":{content:'""',position:"absolute",bottom:0,left:"-2px",borderLeft:"3px solid transparent",borderRight:"3px solid transparent",borderBottom:"4px solid #d11"}},".cm-lintPoint-warning":{"&:after":{borderBottomColor:"orange"}},".cm-lintPoint-info":{"&:after":{borderBottomColor:"#999"}},".cm-lintPoint-hint":{"&:after":{borderBottomColor:"#66d"}},".cm-panel.cm-panel-lint":{position:"relative","& ul":{maxHeight:"100px",overflowY:"auto","& [aria-selected]":{backgroundColor:"#ddd","& u":{textDecoration:"underline"}},"&:focus [aria-selected]":{background_fallback:"#bdf",backgroundColor:"Highlight",color_fallback:"white",color:"HighlightText"},"& u":{textDecoration:"none"},padding:0,margin:0},"& [name=close]":{position:"absolute",top:"0",right:"2px",background:"inherit",border:"none",font:"inherit",padding:0,margin:0}}}),I0n=[uc,mt.decorations.compute([uc],t=>{let{selected:e,panel:n}=t.field(uc);return!e||!n||e.from==e.to?It.none:It.set([O0n.range(e.from,e.to)])}),bgn(E0n,{hideOn:S0n}),D0n];var dwe=function(e){e===void 0&&(e={});var n=[];e.closeBracketsKeymap!==!1&&(n=n.concat(p0n)),e.defaultKeymap!==!1&&(n=n.concat(Qvn)),e.searchKeymap!==!1&&(n=n.concat(_yn)),e.historyKeymap!==!1&&(n=n.concat(ivn)),e.foldKeymap!==!1&&(n=n.concat(ymn)),e.completionKeymap!==!1&&(n=n.concat(vGe)),e.lintKeymap!==!1&&(n=n.concat(P0n));var r=[];return e.lineNumbers!==!1&&r.push(Mgn()),e.highlightActiveLineGutter!==!1&&r.push(Ign()),e.highlightSpecialChars!==!1&&r.push(Ypn()),e.history!==!1&&r.push(Ymn()),e.foldGutter!==!1&&r.push(_mn()),e.drawSelection!==!1&&r.push(Npn()),e.dropCursor!==!1&&r.push(Wpn()),e.allowMultipleSelections!==!1&&r.push(In.allowMultipleSelections.of(!0)),e.indentOnInput!==!1&&r.push(cmn()),e.syntaxHighlighting!==!1&&r.push(d7e(Emn,{fallback:!0})),e.bracketMatching!==!1&&r.push(Dmn()),e.closeBrackets!==!1&&r.push(u0n()),e.autocompletion!==!1&&r.push(mGe()),e.rectangularSelection!==!1&&r.push(cgn()),e.crosshairCursor!==!1&&r.push(dgn()),e.highlightActiveLine!==!1&&r.push(tgn()),e.highlightSelectionMatches!==!1&&r.push(ryn()),e.tabSize&&typeof e.tabSize=="number"&&r.push(fD.of(" ".repeat(e.tabSize))),r.concat([cD.of(n.flat())]).filter(Boolean)};const L0n="#e5c07b",hwe="#e06c75",$0n="#56b6c2",F0n="#ffffff",Q3="#abb2bf",xK="#7d8799",N0n="#61afef",z0n="#98c379",pwe="#d19a66",j0n="#c678dd",B0n="#21252b",gwe="#2c313a",mwe="#282c34",f7="#353a42",U0n="#3E4451",vwe="#528bff",W0n=mt.theme({"&":{color:Q3,backgroundColor:mwe},".cm-content":{caretColor:vwe},".cm-cursor, .cm-dropCursor":{borderLeftColor:vwe},"&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection":{backgroundColor:U0n},".cm-panels":{backgroundColor:B0n,color:Q3},".cm-panels.cm-panels-top":{borderBottom:"2px solid black"},".cm-panels.cm-panels-bottom":{borderTop:"2px solid black"},".cm-searchMatch":{backgroundColor:"#72a1ff59",outline:"1px solid #457dff"},".cm-searchMatch.cm-searchMatch-selected":{backgroundColor:"#6199ff2f"},".cm-activeLine":{backgroundColor:"#6699ff0b"},".cm-selectionMatch":{backgroundColor:"#aafe661a"},"&.cm-focused .cm-matchingBracket, &.cm-focused .cm-nonmatchingBracket":{backgroundColor:"#bad0f847"},".cm-gutters":{backgroundColor:mwe,color:xK,border:"none"},".cm-activeLineGutter":{backgroundColor:gwe},".cm-foldPlaceholder":{backgroundColor:"transparent",border:"none",color:"#ddd"},".cm-tooltip":{border:"none",backgroundColor:f7},".cm-tooltip .cm-tooltip-arrow:before":{borderTopColor:"transparent",borderBottomColor:"transparent"},".cm-tooltip .cm-tooltip-arrow:after":{borderTopColor:f7,borderBottomColor:f7},".cm-tooltip-autocomplete":{"& > ul > li[aria-selected]":{backgroundColor:gwe,color:Q3}}},{dark:!0}),V0n=hD.define([{tag:Ee.keyword,color:j0n},{tag:[Ee.name,Ee.deleted,Ee.character,Ee.propertyName,Ee.macroName],color:hwe},{tag:[Ee.function(Ee.variableName),Ee.labelName],color:N0n},{tag:[Ee.color,Ee.constant(Ee.name),Ee.standard(Ee.name)],color:pwe},{tag:[Ee.definition(Ee.name),Ee.separator],color:Q3},{tag:[Ee.typeName,Ee.className,Ee.number,Ee.changed,Ee.annotation,Ee.modifier,Ee.self,Ee.namespace],color:L0n},{tag:[Ee.operator,Ee.operatorKeyword,Ee.url,Ee.escape,Ee.regexp,Ee.link,Ee.special(Ee.string)],color:$0n},{tag:[Ee.meta,Ee.comment],color:xK},{tag:Ee.strong,fontWeight:"bold"},{tag:Ee.emphasis,fontStyle:"italic"},{tag:Ee.strikethrough,textDecoration:"line-through"},{tag:Ee.link,color:xK,textDecoration:"underline"},{tag:Ee.heading,fontWeight:"bold",color:hwe},{tag:[Ee.atom,Ee.bool,Ee.special(Ee.variableName)],color:pwe},{tag:[Ee.processingInstruction,Ee.string,Ee.inserted],color:z0n},{tag:Ee.invalid,color:F0n}]),G0n=[W0n,d7e(V0n)];var H0n=mt.theme({"&":{backgroundColor:"#fff"}},{dark:!1}),q0n=function(e){e===void 0&&(e={});var{indentWithTab:n=!0,editable:r=!0,readOnly:i=!1,theme:o="light",placeholder:s="",basicSetup:a=!0}=e,l=[];switch(n&&l.unshift(cD.of([Kvn])),a&&(typeof a=="boolean"?l.unshift(dwe()):l.unshift(dwe(a))),s&&l.unshift(ogn(s)),o){case"light":l.push(H0n);break;case"dark":l.push(G0n);break;case"none":break;default:l.push(o);break}return r===!1&&l.push(mt.editable.of(!1)),i&&l.push(In.readOnly.of(!0)),[...l]},X0n=t=>({line:t.state.doc.lineAt(t.state.selection.main.from),lineCount:t.state.doc.lines,lineBreak:t.state.lineBreak,length:t.state.doc.length,readOnly:t.state.readOnly,tabSize:t.state.tabSize,selection:t.state.selection,selectionAsSingle:t.state.selection.asSingle().main,ranges:t.state.selection.ranges,selectionCode:t.state.sliceDoc(t.state.selection.main.from,t.state.selection.main.to),selections:t.state.selection.ranges.map(e=>t.state.sliceDoc(e.from,e.to)),selectedText:t.state.selection.ranges.some(e=>!e.empty)}),ywe=Jh.define(),Y0n=[];function Q0n(t){var{value:e,selection:n,onChange:r,onStatistics:i,onCreateEditor:o,onUpdate:s,extensions:a=Y0n,autoFocus:l,theme:c="light",height:u="",minHeight:f="",maxHeight:d="",placeholder:h="",width:p="",minWidth:g="",maxWidth:m="",editable:v=!0,readOnly:y=!1,indentWithTab:x=!0,basicSetup:b=!0,root:w,initialState:_}=t,[S,O]=D.useState(),[k,E]=D.useState(),[M,A]=D.useState(),P=mt.theme({"&":{height:u,minHeight:f,maxHeight:d,width:p,minWidth:g,maxWidth:m},"& .cm-scroller":{height:"100% !important"}}),T=mt.updateListener.of(B=>{if(B.docChanged&&typeof r=="function"&&!B.transactions.some(L=>L.annotation(ywe))){var $=B.state.doc,z=$.toString();r(z,B)}i&&i(X0n(B))}),R=q0n({theme:c,editable:v,readOnly:y,placeholder:h,indentWithTab:x,basicSetup:b}),I=[T,P,...R];return s&&typeof s=="function"&&I.push(mt.updateListener.of(s)),I=I.concat(a),D.useEffect(()=>{if(S&&!M){var B={doc:e,selection:n,extensions:I},$=_?In.fromJSON(_.json,B,_.fields):In.create(B);if(A($),!k){var z=new mt({state:$,parent:S,root:w});E(z),o&&o(z,$)}}return()=>{k&&(A(void 0),E(void 0))}},[S,M]),D.useEffect(()=>O(t.container),[t.container]),D.useEffect(()=>()=>{k&&(k.destroy(),E(void 0))},[k]),D.useEffect(()=>{l&&k&&k.focus()},[l,k]),D.useEffect(()=>{k&&k.dispatch({effects:rn.reconfigure.of(I)})},[c,a,u,f,d,p,g,m,h,v,y,x,b,r,s]),D.useEffect(()=>{if(e!==void 0){var B=k?k.state.doc.toString():"";k&&e!==B&&k.dispatch({changes:{from:0,to:B.length,insert:e||""},annotations:[ywe.of(!0)]})}},[e,k]),{state:M,setState:A,view:k,setView:E,container:S,setContainer:O}}var K0n=["className","value","selection","extensions","onChange","onStatistics","onCreateEditor","onUpdate","autoFocus","theme","height","minHeight","maxHeight","width","minWidth","maxWidth","basicSetup","placeholder","indentWithTab","editable","readOnly","root","initialState"],FU=D.forwardRef((t,e)=>{var{className:n,value:r="",selection:i,extensions:o=[],onChange:s,onStatistics:a,onCreateEditor:l,onUpdate:c,autoFocus:u,theme:f="light",height:d,minHeight:h,maxHeight:p,width:g,minWidth:m,maxWidth:v,basicSetup:y,placeholder:x,indentWithTab:b,editable:w,readOnly:_,root:S,initialState:O}=t,k=Dt(t,K0n),E=D.useRef(null),{state:M,view:A,container:P}=Q0n({container:E.current,root:S,value:r,autoFocus:u,theme:f,height:d,minHeight:h,maxHeight:p,width:g,minWidth:m,maxWidth:v,basicSetup:y,placeholder:x,indentWithTab:b,editable:w,readOnly:_,selection:i,onChange:s,onStatistics:a,onCreateEditor:l,onUpdate:c,extensions:o,initialState:O});if(D.useImperativeHandle(e,()=>({editor:E.current,state:M,view:A}),[E,P,M,A]),typeof r!="string")throw new Error("value must be typeof string but got "+typeof r);var T=typeof f=="string"?"cm-theme-"+f:"cm-theme";return C.jsx("div",ve({ref:E,className:""+T+(n?" "+n:"")},k))});FU.displayName="CodeMirror";var xwe={};let Z0n=class bK{constructor(e,n,r,i,o,s,a,l,c,u=0,f){this.p=e,this.stack=n,this.state=r,this.reducePos=i,this.pos=o,this.score=s,this.buffer=a,this.bufferBase=l,this.curContext=c,this.lookAhead=u,this.parent=f}toString(){return`[${this.stack.filter((e,n)=>n%3==0).concat(this.state)}]@${this.pos}${this.score?"!"+this.score:""}`}static start(e,n,r=0){let i=e.parser.context;return new bK(e,[],n,r,r,0,[],0,i?new bwe(i,i.start):null,0,null)}get context(){return this.curContext?this.curContext.context:null}pushState(e,n){this.stack.push(this.state,n,this.bufferBase+this.buffer.length),this.state=e}reduce(e){var n;let r=e>>19,i=e&65535,{parser:o}=this.p,s=this.reducePos=2e3&&!(!((n=this.p.parser.nodeSet.types[i])===null||n===void 0)&&n.isAnonymous)&&(c==this.p.lastBigReductionStart?(this.p.bigReductionCount++,this.p.lastBigReductionSize=u):this.p.lastBigReductionSizel;)this.stack.pop();this.reduceContext(i,c)}storeNode(e,n,r,i=4,o=!1){if(e==0&&(!this.stack.length||this.stack[this.stack.length-1]0&&s.buffer[a-4]==0&&s.buffer[a-1]>-1){if(n==r)return;if(s.buffer[a-2]>=n){s.buffer[a-2]=r;return}}}if(!o||this.pos==r)this.buffer.push(e,n,r,i);else{let s=this.buffer.length;if(s>0&&this.buffer[s-4]!=0){let a=!1;for(let l=s;l>0&&this.buffer[l-2]>r;l-=4)if(this.buffer[l-1]>=0){a=!0;break}if(a)for(;s>0&&this.buffer[s-2]>r;)this.buffer[s]=this.buffer[s-4],this.buffer[s+1]=this.buffer[s-3],this.buffer[s+2]=this.buffer[s-2],this.buffer[s+3]=this.buffer[s-1],s-=4,i>4&&(i-=4)}this.buffer[s]=e,this.buffer[s+1]=n,this.buffer[s+2]=r,this.buffer[s+3]=i}}shift(e,n,r,i){if(e&131072)this.pushState(e&65535,this.pos);else if(e&262144)this.pos=i,this.shiftContext(n,r),n<=this.p.parser.maxNode&&this.buffer.push(n,r,i,4);else{let o=e,{parser:s}=this.p;(i>this.pos||n<=s.maxNode)&&(this.pos=i,s.stateFlag(o,1)||(this.reducePos=i)),this.pushState(o,r),this.shiftContext(n,r),n<=s.maxNode&&this.buffer.push(n,r,i,4)}}apply(e,n,r,i){e&65536?this.reduce(e):this.shift(e,n,r,i)}useNode(e,n){let r=this.p.reused.length-1;(r<0||this.p.reused[r]!=e)&&(this.p.reused.push(e),r++);let i=this.pos;this.reducePos=this.pos=i+e.length,this.pushState(n,i),this.buffer.push(r,i,this.reducePos,-1),this.curContext&&this.updateContext(this.curContext.tracker.reuse(this.curContext.context,e,this,this.p.stream.reset(this.pos-e.length)))}split(){let e=this,n=e.buffer.length;for(;n>0&&e.buffer[n-2]>e.reducePos;)n-=4;let r=e.buffer.slice(n),i=e.bufferBase+n;for(;e&&i==e.bufferBase;)e=e.parent;return new bK(this.p,this.stack.slice(),this.state,this.reducePos,this.pos,this.score,r,i,this.curContext,this.lookAhead,e)}recoverByDelete(e,n){let r=e<=this.p.parser.maxNode;r&&this.storeNode(e,this.pos,n,4),this.storeNode(0,this.pos,n,r?8:4),this.pos=this.reducePos=n,this.score-=190}canShift(e){for(let n=new J0n(this);;){let r=this.p.parser.stateSlot(n.state,4)||this.p.parser.hasAction(n.state,e);if(r==0)return!1;if(!(r&65536))return!0;n.reduce(r)}}recoverByInsert(e){if(this.stack.length>=300)return[];let n=this.p.parser.nextStates(this.state);if(n.length>8||this.stack.length>=120){let i=[];for(let o=0,s;ol&1&&a==s)||i.push(n[o],s)}n=i}let r=[];for(let i=0;i>19,i=n&65535,o=this.stack.length-r*3;if(o<0||e.getGoto(this.stack[o],i,!1)<0){let s=this.findForcedReduction();if(s==null)return!1;n=s}this.storeNode(0,this.pos,this.pos,4,!0),this.score-=100}return this.reducePos=this.pos,this.reduce(n),!0}findForcedReduction(){let{parser:e}=this.p,n=[],r=(i,o)=>{if(!n.includes(i))return n.push(i),e.allActions(i,s=>{if(!(s&393216))if(s&65536){let a=(s>>19)-o;if(a>1){let l=s&65535,c=this.stack.length-a*3;if(c>=0&&e.getGoto(this.stack[c],l,!1)>=0)return a<<19|65536|l}}else{let a=r(s,o+1);if(a!=null)return a}})};return r(this.state,0)}forceAll(){for(;!this.p.parser.stateFlag(this.state,2);)if(!this.forceReduce()){this.storeNode(0,this.pos,this.pos,4,!0);break}return this}get deadEnd(){if(this.stack.length!=3)return!1;let{parser:e}=this.p;return e.data[e.stateSlot(this.state,1)]==65535&&!e.stateSlot(this.state,4)}restart(){this.storeNode(0,this.pos,this.pos,4,!0),this.state=this.stack[0],this.stack.length=0}sameState(e){if(this.state!=e.state||this.stack.length!=e.stack.length)return!1;for(let n=0;nthis.lookAhead&&(this.emitLookAhead(),this.lookAhead=e)}close(){this.curContext&&this.curContext.tracker.strict&&this.emitContext(),this.lookAhead>0&&this.emitLookAhead()}};class bwe{constructor(e,n){this.tracker=e,this.context=n,this.hash=e.strict?e.hash(n):0}}class J0n{constructor(e){this.start=e,this.state=e.state,this.stack=e.stack,this.base=this.stack.length}reduce(e){let n=e&65535,r=e>>19;r==0?(this.stack==this.start.stack&&(this.stack=this.stack.slice()),this.stack.push(this.state,0,0),this.base+=3):this.base-=(r-1)*3;let i=this.start.p.parser.getGoto(this.stack[this.base-3],n,!0);this.state=i}}class Oz{constructor(e,n,r){this.stack=e,this.pos=n,this.index=r,this.buffer=e.buffer,this.index==0&&this.maybeNext()}static create(e,n=e.bufferBase+e.buffer.length){return new Oz(e,n,n-e.bufferBase)}maybeNext(){let e=this.stack.parent;e!=null&&(this.index=this.stack.bufferBase-e.bufferBase,this.stack=e,this.buffer=e.buffer)}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}next(){this.index-=4,this.pos-=4,this.index==0&&this.maybeNext()}fork(){return new Oz(this.stack,this.pos,this.index)}}function XL(t,e=Uint16Array){if(typeof t!="string")return t;let n=null;for(let r=0,i=0;r=92&&s--,s>=34&&s--;let l=s-32;if(l>=46&&(l-=46,a=!0),o+=l,a)break;o*=46}n?n[i++]=o:n=new e(o)}return n}class K3{constructor(){this.start=-1,this.value=-1,this.end=-1,this.extended=-1,this.lookAhead=0,this.mask=0,this.context=0}}const wwe=new K3;class exn{constructor(e,n){this.input=e,this.ranges=n,this.chunk="",this.chunkOff=0,this.chunk2="",this.chunk2Pos=0,this.next=-1,this.token=wwe,this.rangeIndex=0,this.pos=this.chunkPos=n[0].from,this.range=n[0],this.end=n[n.length-1].to,this.readNext()}resolveOffset(e,n){let r=this.range,i=this.rangeIndex,o=this.pos+e;for(;or.to:o>=r.to;){if(i==this.ranges.length-1)return null;let s=this.ranges[++i];o+=s.from-r.to,r=s}return o}clipPos(e){if(e>=this.range.from&&ee)return Math.max(e,n.from);return this.end}peek(e){let n=this.chunkOff+e,r,i;if(n>=0&&n=this.chunk2Pos&&ra.to&&(this.chunk2=this.chunk2.slice(0,a.to-r)),i=this.chunk2.charCodeAt(0)}}return r>=this.token.lookAhead&&(this.token.lookAhead=r+1),i}acceptToken(e,n=0){let r=n?this.resolveOffset(n,-1):this.pos;if(r==null||r=this.chunk2Pos&&this.posthis.range.to?e.slice(0,this.range.to-this.pos):e,this.chunkPos=this.pos,this.chunkOff=0}}readNext(){return this.chunkOff>=this.chunk.length&&(this.getChunk(),this.chunkOff==this.chunk.length)?this.next=-1:this.next=this.chunk.charCodeAt(this.chunkOff)}advance(e=1){for(this.chunkOff+=e;this.pos+e>=this.range.to;){if(this.rangeIndex==this.ranges.length-1)return this.setDone();e-=this.range.to-this.pos,this.range=this.ranges[++this.rangeIndex],this.pos=this.range.from}return this.pos+=e,this.pos>=this.token.lookAhead&&(this.token.lookAhead=this.pos+1),this.readNext()}setDone(){return this.pos=this.chunkPos=this.end,this.range=this.ranges[this.rangeIndex=this.ranges.length-1],this.chunk="",this.next=-1}reset(e,n){if(n?(this.token=n,n.start=e,n.lookAhead=e+1,n.value=n.extended=-1):this.token=wwe,this.pos!=e){if(this.pos=e,e==this.end)return this.setDone(),this;for(;e=this.range.to;)this.range=this.ranges[++this.rangeIndex];e>=this.chunkPos&&e=this.chunkPos&&n<=this.chunkPos+this.chunk.length)return this.chunk.slice(e-this.chunkPos,n-this.chunkPos);if(e>=this.chunk2Pos&&n<=this.chunk2Pos+this.chunk2.length)return this.chunk2.slice(e-this.chunk2Pos,n-this.chunk2Pos);if(e>=this.range.from&&n<=this.range.to)return this.input.read(e,n);let r="";for(let i of this.ranges){if(i.from>=n)break;i.to>e&&(r+=this.input.read(Math.max(i.from,e),Math.min(i.to,n)))}return r}}class tS{constructor(e,n){this.data=e,this.id=n}token(e,n){let{parser:r}=n.p;txn(this.data,e,n,this.id,r.data,r.tokenPrecTable)}}tS.prototype.contextual=tS.prototype.fallback=tS.prototype.extend=!1;tS.prototype.fallback=tS.prototype.extend=!1;class NU{constructor(e,n={}){this.token=e,this.contextual=!!n.contextual,this.fallback=!!n.fallback,this.extend=!!n.extend}}function txn(t,e,n,r,i,o){let s=0,a=1<0){let p=t[h];if(l.allows(p)&&(e.token.value==-1||e.token.value==p||nxn(p,e.token.value,i,o))){e.acceptToken(p);break}}let u=e.next,f=0,d=t[s+2];if(e.next<0&&d>f&&t[c+d*3-3]==65535){s=t[c+d*3-1];continue e}for(;f>1,p=c+h+(h<<1),g=t[p],m=t[p+1]||65536;if(u=m)f=h+1;else{s=t[p+2],e.advance();continue e}}break}}function _we(t,e,n){for(let r=e,i;(i=t[r])!=65535;r++)if(i==n)return r-e;return-1}function nxn(t,e,n,r){let i=_we(n,r,e);return i<0||_we(n,r,t)e)&&!r.type.isError)return n<0?Math.max(0,Math.min(r.to-1,e-25)):Math.min(t.length,Math.max(r.from+1,e+25));if(n<0?r.prevSibling():r.nextSibling())break;if(!r.parent())return n<0?0:t.length}}class rxn{constructor(e,n){this.fragments=e,this.nodeSet=n,this.i=0,this.fragment=null,this.safeFrom=-1,this.safeTo=-1,this.trees=[],this.start=[],this.index=[],this.nextFragment()}nextFragment(){let e=this.fragment=this.i==this.fragments.length?null:this.fragments[this.i++];if(e){for(this.safeFrom=e.openStart?Swe(e.tree,e.from+e.offset,1)-e.offset:e.from,this.safeTo=e.openEnd?Swe(e.tree,e.to+e.offset,-1)-e.offset:e.to;this.trees.length;)this.trees.pop(),this.start.pop(),this.index.pop();this.trees.push(e.tree),this.start.push(-e.offset),this.index.push(0),this.nextStart=this.safeFrom}else this.nextStart=1e9}nodeAt(e){if(ee)return this.nextStart=s,null;if(o instanceof co){if(s==e){if(s=Math.max(this.safeFrom,e)&&(this.trees.push(o),this.start.push(s),this.index.push(0))}else this.index[n]++,this.nextStart=s+o.length}}}class ixn{constructor(e,n){this.stream=n,this.tokens=[],this.mainToken=null,this.actions=[],this.tokens=e.tokenizers.map(r=>new K3)}getActions(e){let n=0,r=null,{parser:i}=e.p,{tokenizers:o}=i,s=i.stateSlot(e.state,3),a=e.curContext?e.curContext.hash:0,l=0;for(let c=0;cf.end+25&&(l=Math.max(f.lookAhead,l)),f.value!=0)){let d=n;if(f.extended>-1&&(n=this.addActions(e,f.extended,f.end,n)),n=this.addActions(e,f.value,f.end,n),!u.extend&&(r=f,n>d))break}}for(;this.actions.length>n;)this.actions.pop();return l&&e.setLookAhead(l),!r&&e.pos==this.stream.end&&(r=new K3,r.value=e.p.parser.eofTerm,r.start=r.end=e.pos,n=this.addActions(e,r.value,r.end,n)),this.mainToken=r,this.actions}getMainToken(e){if(this.mainToken)return this.mainToken;let n=new K3,{pos:r,p:i}=e;return n.start=r,n.end=Math.min(r+1,i.stream.end),n.value=r==i.stream.end?i.parser.eofTerm:0,n}updateCachedToken(e,n,r){let i=this.stream.clipPos(r.pos);if(n.token(this.stream.reset(i,e),r),e.value>-1){let{parser:o}=r.p;for(let s=0;s=0&&r.p.parser.dialect.allows(a>>1)){a&1?e.extended=a>>1:e.value=a>>1;break}}}else e.value=0,e.end=this.stream.clipPos(i+1)}putAction(e,n,r,i){for(let o=0;oe.bufferLength*4?new rxn(r,e.nodeSet):null}get parsedPos(){return this.minStackPos}advance(){let e=this.stacks,n=this.minStackPos,r=this.stacks=[],i,o;if(this.bigReductionCount>300&&e.length==1){let[s]=e;for(;s.forceReduce()&&s.stack.length&&s.stack[s.stack.length-2]>=this.lastBigReductionStart;);this.bigReductionCount=this.lastBigReductionSize=0}for(let s=0;sn)r.push(a);else{if(this.advanceStack(a,r,e))continue;{i||(i=[],o=[]),i.push(a);let l=this.tokens.getMainToken(a);o.push(l.value,l.end)}}break}}if(!r.length){let s=i&&lxn(i);if(s)return $l&&console.log("Finish with "+this.stackID(s)),this.stackToTree(s);if(this.parser.strict)throw $l&&i&&console.log("Stuck with token "+(this.tokens.mainToken?this.parser.getName(this.tokens.mainToken.value):"none")),new SyntaxError("No parse at "+n);this.recovering||(this.recovering=5)}if(this.recovering&&i){let s=this.stoppedAt!=null&&i[0].pos>this.stoppedAt?i[0]:this.runRecovery(i,o,r);if(s)return $l&&console.log("Force-finish "+this.stackID(s)),this.stackToTree(s.forceAll())}if(this.recovering){let s=this.recovering==1?1:this.recovering*3;if(r.length>s)for(r.sort((a,l)=>l.score-a.score);r.length>s;)r.pop();r.some(a=>a.reducePos>n)&&this.recovering--}else if(r.length>1){e:for(let s=0;s500&&c.buffer.length>500)if((a.score-c.score||a.buffer.length-c.buffer.length)>0)r.splice(l--,1);else{r.splice(s--,1);continue e}}}r.length>12&&r.splice(12,r.length-12)}this.minStackPos=r[0].pos;for(let s=1;s ":"";if(this.stoppedAt!=null&&i>this.stoppedAt)return e.forceReduce()?e:null;if(this.fragments){let c=e.curContext&&e.curContext.tracker.strict,u=c?e.curContext.hash:0;for(let f=this.fragments.nodeAt(i);f;){let d=this.parser.nodeSet.types[f.type.id]==f.type?o.getGoto(e.state,f.type.id):-1;if(d>-1&&f.length&&(!c||(f.prop(Sn.contextHash)||0)==u))return e.useNode(f,d),$l&&console.log(s+this.stackID(e)+` (via reuse of ${o.getName(f.type.id)})`),!0;if(!(f instanceof co)||f.children.length==0||f.positions[0]>0)break;let h=f.children[0];if(h instanceof co&&f.positions[0]==0)f=h;else break}}let a=o.stateSlot(e.state,4);if(a>0)return e.reduce(a),$l&&console.log(s+this.stackID(e)+` (via always-reduce ${o.getName(a&65535)})`),!0;if(e.stack.length>=8400)for(;e.stack.length>6e3&&e.forceReduce(););let l=this.tokens.getActions(e);for(let c=0;ci?n.push(p):r.push(p)}return!1}advanceFully(e,n){let r=e.pos;for(;;){if(!this.advanceStack(e,null,null))return!1;if(e.pos>r)return Cwe(e,n),!0}}runRecovery(e,n,r){let i=null,o=!1;for(let s=0;s ":"";if(a.deadEnd&&(o||(o=!0,a.restart(),$l&&console.log(u+this.stackID(a)+" (restarted)"),this.advanceFully(a,r))))continue;let f=a.split(),d=u;for(let h=0;f.forceReduce()&&h<10&&($l&&console.log(d+this.stackID(f)+" (via force-reduce)"),!this.advanceFully(f,r));h++)$l&&(d=this.stackID(f)+" -> ");for(let h of a.recoverByInsert(l))$l&&console.log(u+this.stackID(h)+" (via recover-insert)"),this.advanceFully(h,r);this.stream.end>a.pos?(c==a.pos&&(c++,l=0),a.recoverByDelete(l,c),$l&&console.log(u+this.stackID(a)+` (via recover-delete ${this.parser.getName(l)})`),Cwe(a,r)):(!i||i.scoret;class axn{constructor(e){this.start=e.start,this.shift=e.shift||h7,this.reduce=e.reduce||h7,this.reuse=e.reuse||h7,this.hash=e.hash||(()=>0),this.strict=e.strict!==!1}}class CP extends Q9e{constructor(e){if(super(),this.wrappers=[],e.version!=14)throw new RangeError(`Parser version (${e.version}) doesn't match runtime version (14)`);let n=e.nodeNames.split(" ");this.minRepeatTerm=n.length;for(let a=0;ae.topRules[a][1]),i=[];for(let a=0;a=0)o(u,l,a[c++]);else{let f=a[c+-u];for(let d=-u;d>0;d--)o(a[c++],l,f);c++}}}this.nodeSet=new Ele(n.map((a,l)=>kl.define({name:l>=this.minRepeatTerm?void 0:a,id:l,props:i[l],top:r.indexOf(l)>-1,error:l==0,skipped:e.skippedNodes&&e.skippedNodes.indexOf(l)>-1}))),e.propSources&&(this.nodeSet=this.nodeSet.extend(...e.propSources)),this.strict=!1,this.bufferLength=H9e;let s=XL(e.tokenData);this.context=e.context,this.specializerSpecs=e.specialized||[],this.specialized=new Uint16Array(this.specializerSpecs.length);for(let a=0;atypeof a=="number"?new tS(s,a):a),this.topRules=e.topRules,this.dialects=e.dialects||{},this.dynamicPrecedences=e.dynamicPrecedences||null,this.tokenPrecTable=e.tokenPrec,this.termNames=e.termNames||null,this.maxNode=this.nodeSet.types.length-1,this.dialect=this.parseDialect(),this.top=this.topRules[Object.keys(this.topRules)[0]]}createParse(e,n,r){let i=new oxn(this,e,n,r);for(let o of this.wrappers)i=o(i,e,n,r);return i}getGoto(e,n,r=!1){let i=this.goto;if(n>=i[0])return-1;for(let o=i[n+1];;){let s=i[o++],a=s&1,l=i[o++];if(a&&r)return l;for(let c=o+(s>>1);o0}validAction(e,n){return!!this.allActions(e,r=>r==n?!0:null)}allActions(e,n){let r=this.stateSlot(e,4),i=r?n(r):void 0;for(let o=this.stateSlot(e,1);i==null;o+=3){if(this.data[o]==65535)if(this.data[o+1]==1)o=Np(this.data,o+2);else break;i=n(Np(this.data,o+1))}return i}nextStates(e){let n=[];for(let r=this.stateSlot(e,1);;r+=3){if(this.data[r]==65535)if(this.data[r+1]==1)r=Np(this.data,r+2);else break;if(!(this.data[r+2]&1)){let i=this.data[r+1];n.some((o,s)=>s&1&&o==i)||n.push(this.data[r],i)}}return n}configure(e){let n=Object.assign(Object.create(CP.prototype),this);if(e.props&&(n.nodeSet=this.nodeSet.extend(...e.props)),e.top){let r=this.topRules[e.top];if(!r)throw new RangeError(`Invalid top rule name ${e.top}`);n.top=r}return e.tokenizers&&(n.tokenizers=this.tokenizers.map(r=>{let i=e.tokenizers.find(o=>o.from==r);return i?i.to:r})),e.specializers&&(n.specializers=this.specializers.slice(),n.specializerSpecs=this.specializerSpecs.map((r,i)=>{let o=e.specializers.find(a=>a.from==r.external);if(!o)return r;let s=Object.assign(Object.assign({},r),{external:o.to});return n.specializers[i]=Owe(s),s})),e.contextTracker&&(n.context=e.contextTracker),e.dialect&&(n.dialect=this.parseDialect(e.dialect)),e.strict!=null&&(n.strict=e.strict),e.wrap&&(n.wrappers=n.wrappers.concat(e.wrap)),e.bufferLength!=null&&(n.bufferLength=e.bufferLength),n}hasWrappers(){return this.wrappers.length>0}getName(e){return this.termNames?this.termNames[e]:String(e<=this.maxNode&&this.nodeSet.types[e].name||e)}get eofTerm(){return this.maxNode+1}get topNode(){return this.nodeSet.types[this.top[1]]}dynamicPrecedence(e){let n=this.dynamicPrecedences;return n==null?0:n[e]||0}parseDialect(e){let n=Object.keys(this.dialects),r=n.map(()=>!1);if(e)for(let o of e.split(" ")){let s=n.indexOf(o);s>=0&&(r[s]=!0)}let i=null;for(let o=0;or)&&n.p.parser.stateFlag(n.state,2)&&(!e||e.scoret.external(n,r)<<1|e}return t.get}const cxn=Ple({String:Ee.string,Number:Ee.number,"True False":Ee.bool,PropertyName:Ee.propertyName,Null:Ee.null,",":Ee.separator,"[ ]":Ee.squareBracket,"{ }":Ee.brace}),uxn=CP.deserialize({version:14,states:"$bOVQPOOOOQO'#Cb'#CbOnQPO'#CeOvQPO'#CjOOQO'#Cp'#CpQOQPOOOOQO'#Cg'#CgO}QPO'#CfO!SQPO'#CrOOQO,59P,59PO![QPO,59PO!aQPO'#CuOOQO,59U,59UO!iQPO,59UOVQPO,59QOqQPO'#CkO!nQPO,59^OOQO1G.k1G.kOVQPO'#ClO!vQPO,59aOOQO1G.p1G.pOOQO1G.l1G.lOOQO,59V,59VOOQO-E6i-E6iOOQO,59W,59WOOQO-E6j-E6j",stateData:"#O~OcOS~OQSORSOSSOTSOWQO]ROePO~OVXOeUO~O[[O~PVOg^O~Oh_OVfX~OVaO~OhbO[iX~O[dO~Oh_OVfa~OhbO[ia~O",goto:"!kjPPPPPPkPPkqwPPk{!RPPP!XP!ePP!hXSOR^bQWQRf_TVQ_Q`WRg`QcZRicQTOQZRQe^RhbRYQR]R",nodeNames:"⚠ JsonText True False Null Number String } { Object Property PropertyName ] [ Array",maxTerm:25,nodeProps:[["isolate",-2,6,11,""],["openedBy",7,"{",12,"["],["closedBy",8,"}",13,"]"]],propSources:[cxn],skippedNodes:[0],repeatNodeCount:2,tokenData:"(|~RaXY!WYZ!W]^!Wpq!Wrs!]|}$u}!O$z!Q!R%T!R![&c![!]&t!}#O&y#P#Q'O#Y#Z'T#b#c'r#h#i(Z#o#p(r#q#r(w~!]Oc~~!`Wpq!]qr!]rs!xs#O!]#O#P!}#P;'S!];'S;=`$o<%lO!]~!}Oe~~#QXrs!]!P!Q!]#O#P!]#U#V!]#Y#Z!]#b#c!]#f#g!]#h#i!]#i#j#m~#pR!Q![#y!c!i#y#T#Z#y~#|R!Q![$V!c!i$V#T#Z$V~$YR!Q![$c!c!i$c#T#Z$c~$fR!Q![!]!c!i!]#T#Z!]~$rP;=`<%l!]~$zOh~~$}Q!Q!R%T!R![&c~%YRT~!O!P%c!g!h%w#X#Y%w~%fP!Q![%i~%nRT~!Q![%i!g!h%w#X#Y%w~%zR{|&T}!O&T!Q![&Z~&WP!Q![&Z~&`PT~!Q![&Z~&hST~!O!P%c!Q![&c!g!h%w#X#Y%w~&yOg~~'OO]~~'TO[~~'WP#T#U'Z~'^P#`#a'a~'dP#g#h'g~'jP#X#Y'm~'rOR~~'uP#i#j'x~'{P#`#a(O~(RP#`#a(U~(ZOS~~(^P#f#g(a~(dP#i#j(g~(jP#X#Y(m~(rOQ~~(wOW~~(|OV~",tokenizers:[0],topRules:{JsonText:[0,1]},tokenPrec:0}),fxn=mP.define({name:"json",parser:uxn.configure({props:[Rle.add({Object:zbe({except:/^\s*\}/}),Array:zbe({except:/^\s*\]/})}),Ile.add({"Object Array":r7e})]}),languageData:{closeBrackets:{brackets:["[","{",'"']},indentOnInput:/^\s*[\}\]]$/}});function _Ge(){return new e7e(fxn)}const dxn=1,SGe=194,CGe=195,hxn=196,Ewe=197,pxn=198,gxn=199,mxn=200,vxn=2,OGe=3,Twe=201,yxn=24,xxn=25,bxn=49,wxn=50,_xn=55,Sxn=56,Cxn=57,Oxn=59,Exn=60,Txn=61,kxn=62,Axn=63,Pxn=65,Mxn=238,Rxn=71,Dxn=241,Ixn=242,Lxn=243,$xn=244,Fxn=245,Nxn=246,zxn=247,jxn=248,EGe=72,Bxn=249,Uxn=250,Wxn=251,Vxn=252,Gxn=253,Hxn=254,qxn=255,Xxn=256,Yxn=73,Qxn=77,Kxn=263,Zxn=112,Jxn=130,e1n=151,t1n=152,n1n=155,$1=10,OP=13,Yle=32,zU=9,Qle=35,r1n=40,i1n=46,wK=123,kwe=125,TGe=39,kGe=34,o1n=92,s1n=111,a1n=120,l1n=78,c1n=117,u1n=85,f1n=new Set([xxn,bxn,wxn,Kxn,Pxn,Jxn,Sxn,Cxn,Mxn,kxn,Axn,EGe,Yxn,Qxn,Exn,Txn,e1n,t1n,n1n,Zxn]);function p7(t){return t==$1||t==OP}function g7(t){return t>=48&&t<=57||t>=65&&t<=70||t>=97&&t<=102}const d1n=new NU((t,e)=>{let n;if(t.next<0)t.acceptToken(gxn);else if(e.context.flags&Z3)p7(t.next)&&t.acceptToken(pxn,1);else if(((n=t.peek(-1))<0||p7(n))&&e.canShift(Ewe)){let r=0;for(;t.next==Yle||t.next==zU;)t.advance(),r++;(t.next==$1||t.next==OP||t.next==Qle)&&t.acceptToken(Ewe,-r)}else p7(t.next)&&t.acceptToken(hxn,1)},{contextual:!0}),h1n=new NU((t,e)=>{let n=e.context;if(n.flags)return;let r=t.peek(-1);if(r==$1||r==OP){let i=0,o=0;for(;;){if(t.next==Yle)i++;else if(t.next==zU)i+=8-i%8;else break;t.advance(),o++}i!=n.indent&&t.next!=$1&&t.next!=OP&&t.next!=Qle&&(i[t,e|AGe])),m1n=new axn({start:p1n,reduce(t,e,n,r){return t.flags&Z3&&f1n.has(e)||(e==Rxn||e==EGe)&&t.flags&AGe?t.parent:t},shift(t,e,n,r){return e==SGe?new J3(t,g1n(r.read(r.pos,n.pos)),0):e==CGe?t.parent:e==yxn||e==_xn||e==Oxn||e==OGe?new J3(t,0,Z3):Awe.has(e)?new J3(t,0,Awe.get(e)|t.flags&Z3):t},hash(t){return t.hash}}),v1n=new NU(t=>{for(let e=0;e<5;e++){if(t.next!="print".charCodeAt(e))return;t.advance()}if(!/\w/.test(String.fromCharCode(t.next)))for(let e=0;;e++){let n=t.peek(e);if(!(n==Yle||n==zU)){n!=r1n&&n!=i1n&&n!=$1&&n!=OP&&n!=Qle&&t.acceptToken(dxn);return}}}),y1n=new NU((t,e)=>{let{flags:n}=e.context,r=n&Sp?kGe:TGe,i=(n&Cp)>0,o=!(n&Op),s=(n&Ep)>0,a=t.pos;for(;!(t.next<0);)if(s&&t.next==wK)if(t.peek(1)==wK)t.advance(2);else{if(t.pos==a){t.acceptToken(OGe,1);return}break}else if(o&&t.next==o1n){if(t.pos==a){t.advance();let l=t.next;l>=0&&(t.advance(),x1n(t,l)),t.acceptToken(vxn);return}break}else if(t.next==r&&(!i||t.peek(1)==r&&t.peek(2)==r)){if(t.pos==a){t.acceptToken(Twe,i?3:1);return}break}else if(t.next==$1){if(i)t.advance();else if(t.pos==a){t.acceptToken(Twe);return}break}else t.advance();t.pos>a&&t.acceptToken(mxn)});function x1n(t,e){if(e==s1n)for(let n=0;n<2&&t.next>=48&&t.next<=55;n++)t.advance();else if(e==a1n)for(let n=0;n<2&&g7(t.next);n++)t.advance();else if(e==c1n)for(let n=0;n<4&&g7(t.next);n++)t.advance();else if(e==u1n)for(let n=0;n<8&&g7(t.next);n++)t.advance();else if(e==l1n&&t.next==wK){for(t.advance();t.next>=0&&t.next!=kwe&&t.next!=TGe&&t.next!=kGe&&t.next!=$1;)t.advance();t.next==kwe&&t.advance()}}const b1n=Ple({'async "*" "**" FormatConversion FormatSpec':Ee.modifier,"for while if elif else try except finally return raise break continue with pass assert await yield match case":Ee.controlKeyword,"in not and or is del":Ee.operatorKeyword,"from def class global nonlocal lambda":Ee.definitionKeyword,import:Ee.moduleKeyword,"with as print":Ee.keyword,Boolean:Ee.bool,None:Ee.null,VariableName:Ee.variableName,"CallExpression/VariableName":Ee.function(Ee.variableName),"FunctionDefinition/VariableName":Ee.function(Ee.definition(Ee.variableName)),"ClassDefinition/VariableName":Ee.definition(Ee.className),PropertyName:Ee.propertyName,"CallExpression/MemberExpression/PropertyName":Ee.function(Ee.propertyName),Comment:Ee.lineComment,Number:Ee.number,String:Ee.string,FormatString:Ee.special(Ee.string),Escape:Ee.escape,UpdateOp:Ee.updateOperator,"ArithOp!":Ee.arithmeticOperator,BitOp:Ee.bitwiseOperator,CompareOp:Ee.compareOperator,AssignOp:Ee.definitionOperator,Ellipsis:Ee.punctuation,At:Ee.meta,"( )":Ee.paren,"[ ]":Ee.squareBracket,"{ }":Ee.brace,".":Ee.derefOperator,", ;":Ee.separator}),w1n={__proto__:null,await:44,or:54,and:56,in:60,not:62,is:64,if:70,else:72,lambda:76,yield:94,from:96,async:102,for:104,None:162,True:164,False:164,del:178,pass:182,break:186,continue:190,return:194,raise:202,import:206,as:208,global:212,nonlocal:214,assert:218,type:223,elif:236,while:240,try:246,except:248,finally:250,with:254,def:258,class:268,match:279,case:285},_1n=CP.deserialize({version:14,states:"##jO`QeOOP$}OSOOO&WQtO'#HUOOQS'#Co'#CoOOQS'#Cp'#CpO'vQdO'#CnO*UQtO'#HTOOQS'#HU'#HUOOQS'#DU'#DUOOQS'#HT'#HTO*rQdO'#D_O+VQdO'#DfO+gQdO'#DjO+zOWO'#DuO,VOWO'#DvO.[QtO'#GuOOQS'#Gu'#GuO'vQdO'#GtO0ZQtO'#GtOOQS'#Eb'#EbO0rQdO'#EcOOQS'#Gs'#GsO0|QdO'#GrOOQV'#Gr'#GrO1XQdO'#FYOOQS'#G^'#G^O1^QdO'#FXOOQV'#IS'#ISOOQV'#Gq'#GqOOQV'#Fq'#FqQ`QeOOO'vQdO'#CqO1lQdO'#C}O1sQdO'#DRO2RQdO'#HYO2cQtO'#EVO'vQdO'#EWOOQS'#EY'#EYOOQS'#E['#E[OOQS'#E^'#E^O2wQdO'#E`O3_QdO'#EdO3rQdO'#EfO3zQtO'#EfO1XQdO'#EiO0rQdO'#ElO1XQdO'#EnO0rQdO'#EtO0rQdO'#EwO4VQdO'#EyO4^QdO'#FOO4iQdO'#EzO0rQdO'#FOO1XQdO'#FQO1XQdO'#FVO4nQdO'#F[P4uOdO'#GpPOOO)CBd)CBdOOQS'#Ce'#CeOOQS'#Cf'#CfOOQS'#Cg'#CgOOQS'#Ch'#ChOOQS'#Ci'#CiOOQS'#Cj'#CjOOQS'#Cl'#ClO'vQdO,59OO'vQdO,59OO'vQdO,59OO'vQdO,59OO'vQdO,59OO'vQdO,59OO5QQdO'#DoOOQS,5:Y,5:YO5eQdO'#HdOOQS,5:],5:]O5rQ!fO,5:]O5wQtO,59YO1lQdO,59bO1lQdO,59bO1lQdO,59bO8gQdO,59bO8lQdO,59bO8sQdO,59jO8zQdO'#HTO:QQdO'#HSOOQS'#HS'#HSOOQS'#D['#D[O:iQdO,59aO'vQdO,59aO:wQdO,59aOOQS,59y,59yO:|QdO,5:RO'vQdO,5:ROOQS,5:Q,5:QO;[QdO,5:QO;aQdO,5:XO'vQdO,5:XO'vQdO,5:VOOQS,5:U,5:UO;rQdO,5:UO;wQdO,5:WOOOW'#Fy'#FyO;|OWO,5:aOOQS,5:a,5:aOOOOQS'#Ds'#DsOOQS1G/w1G/wOOQS1G.|1G.|O!/RQtO1G.|O!/YQtO1G.|O1lQdO1G.|O!/uQdO1G/UOOQS'#DZ'#DZO0rQdO,59tOOQS1G.{1G.{O!/|QdO1G/eO!0^QdO1G/eO!0fQdO1G/fO'vQdO'#H[O!0kQdO'#H[O!0pQtO1G.{O!1QQdO,59iO!2WQdO,5=zO!2hQdO,5=zO!2pQdO1G/mO!2uQtO1G/mOOQS1G/l1G/lO!3VQdO,5=uO!3|QdO,5=uO0rQdO1G/qO!4kQdO1G/sO!4pQtO1G/sO!5QQtO1G/qOOQS1G/p1G/pOOQS1G/r1G/rOOOW-E9w-E9wOOQS1G/{1G/{O!5bQdO'#HxO0rQdO'#HxO!5sQdO,5>cOOOW-E9x-E9xOOQS1G/|1G/|OOQS-E9{-E9{O!6RQ#xO1G2zO!6rQtO1G2zO'vQdO,5kOOQS1G1`1G1`O!7xQdO1G1`OOQS'#DV'#DVO0rQdO,5=qOOQS,5=q,5=qO!7}QdO'#FrO!8YQdO,59oO!8bQdO1G/XO!8lQtO,5=uOOQS1G3`1G3`OOQS,5:m,5:mO!9]QdO'#GtOOQS,5jO!;QQdO,5>jO1XQdO,5>jO!;cQdO,5>iOOQS-E:R-E:RO!;hQdO1G0lO!;sQdO1G0lO!;xQdO,5>lO!lO!hO!<|QdO,5>hO!=_QdO'#EpO0rQdO1G0tO!=jQdO1G0tO!=oQgO1G0zO!AmQgO1G0}O!EhQdO,5>oO!ErQdO,5>oO!EzQtO,5>oO0rQdO1G1PO!FUQdO1G1PO4iQdO1G1UO!!sQdO1G1WOOQV,5;a,5;aO!FZQfO,5;aO!F`QgO1G1QO!JaQdO'#GZO4iQdO1G1QO4iQdO1G1QO!JqQdO,5>pO!KOQdO,5>pO1XQdO,5>pOOQV1G1U1G1UO!KWQdO'#FSO!KiQ!fO1G1WO!KqQdO1G1WOOQV1G1]1G1]O4iQdO1G1]O!KvQdO1G1]O!LOQdO'#F^OOQV1G1b1G1bO!#WQtO1G1bPOOO1G2v1G2vP!LTOSO1G2vOOQS,5=},5=}OOQS'#Dp'#DpO0rQdO,5=}O!LYQdO,5=|O!LmQdO,5=|OOQS1G/u1G/uO!LuQdO,5>PO!MVQdO,5>PO!M_QdO,5>PO!MrQdO,5>PO!NSQdO,5>POOQS1G3j1G3jOOQS7+$h7+$hO!8bQdO7+$pO# uQdO1G.|O# |QdO1G.|OOQS1G/`1G/`OOQS,5<`,5<`O'vQdO,5<`OOQS7+%P7+%PO#!TQdO7+%POOQS-E9r-E9rOOQS7+%Q7+%QO#!eQdO,5=vO'vQdO,5=vOOQS7+$g7+$gO#!jQdO7+%PO#!rQdO7+%QO#!wQdO1G3fOOQS7+%X7+%XO##XQdO1G3fO##aQdO7+%XOOQS,5<_,5<_O'vQdO,5<_O##fQdO1G3aOOQS-E9q-E9qO#$]QdO7+%]OOQS7+%_7+%_O#$kQdO1G3aO#%YQdO7+%_O#%_QdO1G3gO#%oQdO1G3gO#%wQdO7+%]O#%|QdO,5>dO#&gQdO,5>dO#&gQdO,5>dOOQS'#Dx'#DxO#&xO&jO'#DzO#'TO`O'#HyOOOW1G3}1G3}O#'YQdO1G3}O#'bQdO1G3}O#'mQ#xO7+(fO#(^QtO1G2UP#(wQdO'#GOOOQS,5bQdO,5gQdO1G4OOOQS-E9y-E9yO#?QQdO1G4OOe,5>eOOOW7+)i7+)iO#?nQdO7+)iO#?vQdO1G2zO#@aQdO1G2zP'vQdO'#FuO0rQdO<mO#AtQdO,5>mOOQS1G0v1G0vOOQS<rO#KZQdO,5>rOOQS,5>r,5>rO#KfQdO,5>qO#KwQdO,5>qOOQS1G1Y1G1YOOQS,5;p,5;pOOQV<VAN>VO$ WQdO<cAN>cO0rQdO1G1|O$ hQtO1G1|P$ rQdO'#FvOOQS1G2R1G2RP$!PQdO'#F{O$!^QdO7+)jO$!wQdO,5>gOOOO-E9z-E9zOOOW<tO$4dQdO,5>tO1XQdO,5vO$)VQdO,5>vOOQS1G1p1G1pO$8[QtO,5<[OOQU7+'P7+'PO$+cQdO1G/iO$)VQdO,5wO$8jQdO,5>wOOQS1G1s1G1sOOQS7+'S7+'SP$)VQdO'#GdO$8rQdO1G4bO$8|QdO1G4bO$9UQdO1G4bOOQS7+%T7+%TO$9dQdO1G1tO$9rQtO'#FaO$9yQdO,5<}OOQS,5<},5<}O$:XQdO1G4cOOQS-E:a-E:aO$)VQdO,5<|O$:`QdO,5<|O$:eQdO7+)|OOQS-E:`-E:`O$:oQdO7+)|O$)VQdO,5m>pPP'Z'ZPP?PPP'Z'ZPP'Z'Z'Z'Z'Z?T?}'ZP@QP@WD_G{HPPHSH^Hb'ZPPPHeHn'RP'R'RP'RP'RP'RP'RP'R'R'RP'RPP'RPP'RP'RPHtIQIYPIaIgPIaPIaIaPPPIaPKuPLOLYL`KuPIaLiPIaPLpLvPLzM`M}NhLzLzNnN{LzLzLzLz! a! g! j! o! r! |!!S!!`!!r!!x!#S!#Y!#v!#|!$S!$^!$d!$j!$|!%W!%^!%d!%n!%t!%z!&Q!&W!&^!&h!&n!&x!'O!'X!'_!'n!'v!(Q!(XPPPPPPPPPPP!(_!(b!(h!(q!({!)WPPPPPPPPPPPP!-z!/`!3`!6pPP!6x!7X!7b!8Z!8Q!8d!8j!8m!8p!8s!8{!9lPPPPPPPPPPPPPPPPP!9o!9s!9yP!:_!:c!:o!:x!;U!;l!;o!;r!;x!_![!]Do!]!^Es!^!_FZ!_!`Gk!`!aHX!a!b%T!b!cIf!c!dJU!d!eK^!e!hJU!h!i!#f!i!tJU!t!u!,|!u!wJU!w!x!.t!x!}JU!}#O!0S#O#P&o#P#Q!0j#Q#R!1Q#R#SJU#S#T%T#T#UJU#U#VK^#V#YJU#Y#Z!#f#Z#fJU#f#g!,|#g#iJU#i#j!.t#j#oJU#o#p!1n#p#q!1s#q#r!2a#r#s!2f#s$g%T$g;'SJU;'S;=`KW<%lOJU`%YT&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%T`%lP;=`<%l%To%v]&n`%c_OX%TXY%oY[%T[]%o]p%Tpq%oq#O%T#O#P&o#P#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%To&tX&n`OY%TYZ%oZ]%T]^%o^#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tc'f[&n`O!_%T!_!`([!`#T%T#T#U(r#U#f%T#f#g(r#g#h(r#h#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tc(cTmR&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tc(yT!mR&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk)aV&n`&[ZOr%Trs)vs#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk){V&n`Or%Trs*bs#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk*iT&n`&^ZO#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%To+PZS_&n`OY*xYZ%TZ]*x]^%T^#o*x#o#p+r#p#q*x#q#r+r#r;'S*x;'S;=`,^<%lO*x_+wTS_OY+rZ]+r^;'S+r;'S;=`,W<%lO+r_,ZP;=`<%l+ro,aP;=`<%l*xj,kV%rQ&n`O!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tj-XT!xY&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tj-oV%lQ&n`O!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk.]V&n`&ZZOw%Twx.rx#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk.wV&n`Ow%Twx/^x#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk/eT&n`&]ZO#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk/{ThZ&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tc0cTgR&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk0yXVZ&n`Oz%Tz{1f{!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk1mVaR&n`O!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk2ZV%oZ&n`O!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tc2wTzR&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%To3_W%pZ&n`O!_%T!_!`-Q!`!a3w!a#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Td4OT&{S&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk4fX!fQ&n`O!O%T!O!P5R!P!Q%T!Q![6T![#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk5WV&n`O!O%T!O!P5m!P#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk5tT!rZ&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Ti6[a!hX&n`O!Q%T!Q![6T![!g%T!g!h7a!h!l%T!l!m9s!m#R%T#R#S6T#S#X%T#X#Y7a#Y#^%T#^#_9s#_#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Ti7fZ&n`O{%T{|8X|}%T}!O8X!O!Q%T!Q![8s![#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Ti8^V&n`O!Q%T!Q![8s![#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Ti8z]!hX&n`O!Q%T!Q![8s![!l%T!l!m9s!m#R%T#R#S8s#S#^%T#^#_9s#_#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Ti9zT!hX&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk:bX%qR&n`O!P%T!P!Q:}!Q!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tj;UV%sQ&n`O!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Ti;ro!hX&n`O!O%T!O!P=s!P!Q%T!Q![>_![!d%T!d!e?q!e!g%T!g!h7a!h!l%T!l!m9s!m!q%T!q!rA]!r!z%T!z!{Bq!{#R%T#R#S>_#S#U%T#U#V?q#V#X%T#X#Y7a#Y#^%T#^#_9s#_#c%T#c#dA]#d#l%T#l#mBq#m#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Ti=xV&n`O!Q%T!Q![6T![#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Ti>fc!hX&n`O!O%T!O!P=s!P!Q%T!Q![>_![!g%T!g!h7a!h!l%T!l!m9s!m#R%T#R#S>_#S#X%T#X#Y7a#Y#^%T#^#_9s#_#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Ti?vY&n`O!Q%T!Q!R@f!R!S@f!S#R%T#R#S@f#S#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Ti@mY!hX&n`O!Q%T!Q!R@f!R!S@f!S#R%T#R#S@f#S#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TiAbX&n`O!Q%T!Q!YA}!Y#R%T#R#SA}#S#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TiBUX!hX&n`O!Q%T!Q!YA}!Y#R%T#R#SA}#S#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TiBv]&n`O!Q%T!Q![Co![!c%T!c!iCo!i#R%T#R#SCo#S#T%T#T#ZCo#Z#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TiCv]!hX&n`O!Q%T!Q![Co![!c%T!c!iCo!i#R%T#R#SCo#S#T%T#T#ZCo#Z#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%ToDvV{_&n`O!_%T!_!`E]!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TcEdT%{R&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TkEzT#gZ&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TkFbXmR&n`O!^%T!^!_F}!_!`([!`!a([!a#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TjGUV%mQ&n`O!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TkGrV%zZ&n`O!_%T!_!`([!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TkH`WmR&n`O!_%T!_!`([!`!aHx!a#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TjIPV%nQ&n`O!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TkIoV_Q#}P&n`O!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%ToJ_]&n`&YS%uZO!Q%T!Q![JU![!c%T!c!}JU!}#R%T#R#SJU#S#T%T#T#oJU#p#q%T#r$g%T$g;'SJU;'S;=`KW<%lOJUoKZP;=`<%lJUoKge&n`&YS%uZOr%Trs)Ysw%Twx.Ux!Q%T!Q![JU![!c%T!c!tJU!t!uLx!u!}JU!}#R%T#R#SJU#S#T%T#T#fJU#f#gLx#g#oJU#p#q%T#r$g%T$g;'SJU;'S;=`KW<%lOJUoMRa&n`&YS%uZOr%TrsNWsw%Twx! vx!Q%T!Q![JU![!c%T!c!}JU!}#R%T#R#SJU#S#T%T#T#oJU#p#q%T#r$g%T$g;'SJU;'S;=`KW<%lOJUkN_V&n`&`ZOr%TrsNts#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TkNyV&n`Or%Trs! `s#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk! gT&n`&bZO#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk! }V&n`&_ZOw%Twx!!dx#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!!iV&n`Ow%Twx!#Ox#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!#VT&n`&aZO#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%To!#oe&n`&YS%uZOr%Trs!%Qsw%Twx!&px!Q%T!Q![JU![!c%T!c!tJU!t!u!(`!u!}JU!}#R%T#R#SJU#S#T%T#T#fJU#f#g!(`#g#oJU#p#q%T#r$g%T$g;'SJU;'S;=`KW<%lOJUk!%XV&n`&dZOr%Trs!%ns#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!%sV&n`Or%Trs!&Ys#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!&aT&n`&fZO#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!&wV&n`&cZOw%Twx!'^x#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!'cV&n`Ow%Twx!'xx#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!(PT&n`&eZO#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%To!(ia&n`&YS%uZOr%Trs!)nsw%Twx!+^x!Q%T!Q![JU![!c%T!c!}JU!}#R%T#R#SJU#S#T%T#T#oJU#p#q%T#r$g%T$g;'SJU;'S;=`KW<%lOJUk!)uV&n`&hZOr%Trs!*[s#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!*aV&n`Or%Trs!*vs#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!*}T&n`&jZO#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!+eV&n`&gZOw%Twx!+zx#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!,PV&n`Ow%Twx!,fx#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!,mT&n`&iZO#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%To!-Vi&n`&YS%uZOr%TrsNWsw%Twx! vx!Q%T!Q![JU![!c%T!c!dJU!d!eLx!e!hJU!h!i!(`!i!}JU!}#R%T#R#SJU#S#T%T#T#UJU#U#VLx#V#YJU#Y#Z!(`#Z#oJU#p#q%T#r$g%T$g;'SJU;'S;=`KW<%lOJUo!.}a&n`&YS%uZOr%Trs)Ysw%Twx.Ux!Q%T!Q![JU![!c%T!c!}JU!}#R%T#R#SJU#S#T%T#T#oJU#p#q%T#r$g%T$g;'SJU;'S;=`KW<%lOJUk!0ZT!XZ&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tc!0qT!WR&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tj!1XV%kQ&n`O!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%T~!1sO!]~k!1zV%jR&n`O!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%T~!2fO![~i!2mT%tX&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%T",tokenizers:[v1n,h1n,d1n,y1n,0,1,2,3,4],topRules:{Script:[0,5]},specialized:[{term:221,get:t=>w1n[t]||-1}],tokenPrec:7652}),Pwe=new Bgn,PGe=new Set(["Script","Body","FunctionDefinition","ClassDefinition","LambdaExpression","ForStatement","MatchClause"]);function YL(t){return(e,n,r)=>{if(r)return!1;let i=e.node.getChild("VariableName");return i&&n(i,t),!0}}const S1n={FunctionDefinition:YL("function"),ClassDefinition:YL("class"),ForStatement(t,e,n){if(n){for(let r=t.node.firstChild;r;r=r.nextSibling)if(r.name=="VariableName")e(r,"variable");else if(r.name=="in")break}},ImportStatement(t,e){var n,r;let{node:i}=t,o=((n=i.firstChild)===null||n===void 0?void 0:n.name)=="from";for(let s=i.getChild("import");s;s=s.nextSibling)s.name=="VariableName"&&((r=s.nextSibling)===null||r===void 0?void 0:r.name)!="as"&&e(s,o?"variable":"namespace")},AssignStatement(t,e){for(let n=t.node.firstChild;n;n=n.nextSibling)if(n.name=="VariableName")e(n,"variable");else if(n.name==":"||n.name=="AssignOp")break},ParamList(t,e){for(let n=null,r=t.node.firstChild;r;r=r.nextSibling)r.name=="VariableName"&&(!n||!/\*|AssignOp/.test(n.name))&&e(r,"variable"),n=r},CapturePattern:YL("variable"),AsPattern:YL("variable"),__proto__:null};function MGe(t,e){let n=Pwe.get(e);if(n)return n;let r=[],i=!0;function o(s,a){let l=t.sliceString(s.from,s.to);r.push({label:l,type:a})}return e.cursor(xo.IncludeAnonymous).iterate(s=>{if(s.name){let a=S1n[s.name];if(a&&a(s,o,i)||!i&&PGe.has(s.name))return!1;i=!1}else if(s.to-s.from>8192){for(let a of MGe(t,s.node))r.push(a);return!1}}),Pwe.set(e,r),r}const Mwe=/^[\w\xa1-\uffff][\w\d\xa1-\uffff]*$/,RGe=["String","FormatString","Comment","PropertyName"];function C1n(t){let e=Vo(t.state).resolveInner(t.pos,-1);if(RGe.indexOf(e.name)>-1)return null;let n=e.name=="VariableName"||e.to-e.from<20&&Mwe.test(t.state.sliceDoc(e.from,e.to));if(!n&&!t.explicit)return null;let r=[];for(let i=e;i;i=i.parent)PGe.has(i.name)&&(r=r.concat(MGe(t.state.doc,i)));return{options:r,from:n?e.from:t.pos,validFor:Mwe}}const O1n=["__annotations__","__builtins__","__debug__","__doc__","__import__","__name__","__loader__","__package__","__spec__","False","None","True"].map(t=>({label:t,type:"constant"})).concat(["ArithmeticError","AssertionError","AttributeError","BaseException","BlockingIOError","BrokenPipeError","BufferError","BytesWarning","ChildProcessError","ConnectionAbortedError","ConnectionError","ConnectionRefusedError","ConnectionResetError","DeprecationWarning","EOFError","Ellipsis","EncodingWarning","EnvironmentError","Exception","FileExistsError","FileNotFoundError","FloatingPointError","FutureWarning","GeneratorExit","IOError","ImportError","ImportWarning","IndentationError","IndexError","InterruptedError","IsADirectoryError","KeyError","KeyboardInterrupt","LookupError","MemoryError","ModuleNotFoundError","NameError","NotADirectoryError","NotImplemented","NotImplementedError","OSError","OverflowError","PendingDeprecationWarning","PermissionError","ProcessLookupError","RecursionError","ReferenceError","ResourceWarning","RuntimeError","RuntimeWarning","StopAsyncIteration","StopIteration","SyntaxError","SyntaxWarning","SystemError","SystemExit","TabError","TimeoutError","TypeError","UnboundLocalError","UnicodeDecodeError","UnicodeEncodeError","UnicodeError","UnicodeTranslateError","UnicodeWarning","UserWarning","ValueError","Warning","ZeroDivisionError"].map(t=>({label:t,type:"type"}))).concat(["bool","bytearray","bytes","classmethod","complex","float","frozenset","int","list","map","memoryview","object","range","set","staticmethod","str","super","tuple","type"].map(t=>({label:t,type:"class"}))).concat(["abs","aiter","all","anext","any","ascii","bin","breakpoint","callable","chr","compile","delattr","dict","dir","divmod","enumerate","eval","exec","exit","filter","format","getattr","globals","hasattr","hash","help","hex","id","input","isinstance","issubclass","iter","len","license","locals","max","min","next","oct","open","ord","pow","print","property","quit","repr","reversed","round","setattr","slice","sorted","sum","vars","zip"].map(t=>({label:t,type:"function"}))),E1n=[pp("def ${name}(${params}):\n ${}",{label:"def",detail:"function",type:"keyword"}),pp("for ${name} in ${collection}:\n ${}",{label:"for",detail:"loop",type:"keyword"}),pp("while ${}:\n ${}",{label:"while",detail:"loop",type:"keyword"}),pp("try:\n ${}\nexcept ${error}:\n ${}",{label:"try",detail:"/ except block",type:"keyword"}),pp(`if \${}: +`));const e=D.useMemo(()=>ve({},uon,t.localeText),[t.localeText]);return D.useMemo(()=>ve({},t,{localeText:e}),[t,e])},pr=()=>C1().utils,eD=()=>C1().defaultDates,O1=t=>{const e=pr(),n=D.useRef();return n.current===void 0&&(n.current=e.date(void 0,t)),n.current};function nVe(t){const{props:e,validator:n,value:r,timezone:i,onError:o}=t,s=C1(),a=D.useRef(n.valueManager.defaultErrorState),l=n({adapter:s,value:r,timezone:i,props:e}),c=n.valueManager.hasError(l);D.useEffect(()=>{o&&!n.valueManager.isSameError(l,a.current)&&o(l,r),a.current=l},[n,o,l,r]);const u=st(f=>n({adapter:s,value:f,timezone:i,props:e}));return{validationError:l,hasValidationError:c,getValidationErrorForNewValue:u}}const Pl=()=>C1().localeText,fon=({utils:t,format:e})=>{let n=10,r=e,i=t.expandFormat(e);for(;i!==r;)if(r=i,i=t.expandFormat(r),n-=1,n<0)throw new Error("MUI X: The format expansion seems to be in an infinite loop. Please open an issue with the format passed to the picker component.");return i},don=({utils:t,expandedFormat:e})=>{const n=[],{start:r,end:i}=t.escapedCharacters,o=new RegExp(`(\\${r}[^\\${i}]*\\${i})+`,"g");let s=null;for(;s=o.exec(e);)n.push({start:s.index,end:o.lastIndex-1});return n},hon=(t,e,n,r)=>{switch(n.type){case"year":return e.fieldYearPlaceholder({digitAmount:t.formatByString(t.date(void 0,"default"),r).length,format:r});case"month":return e.fieldMonthPlaceholder({contentType:n.contentType,format:r});case"day":return e.fieldDayPlaceholder({format:r});case"weekDay":return e.fieldWeekDayPlaceholder({contentType:n.contentType,format:r});case"hours":return e.fieldHoursPlaceholder({format:r});case"minutes":return e.fieldMinutesPlaceholder({format:r});case"seconds":return e.fieldSecondsPlaceholder({format:r});case"meridiem":return e.fieldMeridiemPlaceholder({format:r});default:return r}},pon=({utils:t,date:e,shouldRespectLeadingZeros:n,localeText:r,localizedDigits:i,now:o,token:s,startSeparator:a})=>{if(s==="")throw new Error("MUI X: Should not call `commitToken` with an empty token");const l=WWe(t,s),c=XWe(t,l.contentType,l.type,s),u=n?c:l.contentType==="digit",f=e!=null&&t.isValid(e);let d=f?t.formatByString(e,s):"",h=null;if(u)if(c)h=d===""?t.formatByString(o,s).length:d.length;else{if(l.maxLength==null)throw new Error(`MUI X: The token ${s} should have a 'maxDigitNumber' property on it's adapter`);h=l.maxLength,f&&(d=_le(GWe(Pb(d,i),h),i))}return ve({},l,{format:s,maxLength:h,value:d,placeholder:hon(t,r,l,s),hasLeadingZerosInFormat:c,hasLeadingZerosInInput:u,startSeparator:a,endSeparator:"",modified:!1})},gon=t=>{var h;const{utils:e,expandedFormat:n,escapedParts:r}=t,i=e.date(void 0),o=[];let s="";const a=Object.keys(e.formatTokenMap).sort((p,g)=>g.length-p.length),l=/^([a-zA-Z]+)/,c=new RegExp(`^(${a.join("|")})*$`),u=new RegExp(`^(${a.join("|")})`),f=p=>r.find(g=>g.start<=p&&g.end>=p);let d=0;for(;d0;){const y=u.exec(v)[1];v=v.slice(y.length),o.push(pon(ve({},t,{now:i,token:y,startSeparator:s}))),s=""}d+=m.length}else{const v=n[d];g&&(p==null?void 0:p.start)===d||(p==null?void 0:p.end)===d||(o.length===0?s+=v:o[o.length-1].endSeparator+=v),d+=1}}return o.length===0&&s.length>0&&o.push({type:"empty",contentType:"letter",maxLength:null,format:"",value:"",placeholder:"",hasLeadingZerosInFormat:!1,hasLeadingZerosInInput:!1,startSeparator:s,endSeparator:"",modified:!1}),o},mon=({isRtl:t,formatDensity:e,sections:n})=>n.map(r=>{const i=o=>{let s=o;return t&&s!==null&&s.includes(" ")&&(s=`⁩${s}⁦`),e==="spacious"&&["/",".","-"].includes(s)&&(s=` ${s} `),s};return r.startSeparator=i(r.startSeparator),r.endSeparator=i(r.endSeparator),r}),kbe=t=>{let e=fon(t);t.isRtl&&t.enableAccessibleFieldDOMStructure&&(e=e.split(" ").reverse().join(" "));const n=don(ve({},t,{expandedFormat:e})),r=gon(ve({},t,{expandedFormat:e,escapedParts:n}));return mon(ve({},t,{sections:r}))},Ole=({timezone:t,value:e,defaultValue:n,onChange:r,valueManager:i})=>{const o=pr(),s=D.useRef(n),a=e??s.current??i.emptyValue,l=D.useMemo(()=>i.getTimezone(o,a),[o,i,a]),c=st(h=>l==null?h:i.setTimezone(o,l,h)),u=t??l??"default",f=D.useMemo(()=>i.setTimezone(o,u,a),[i,o,u,a]),d=st((h,...p)=>{const g=c(h);r==null||r(g,...p)});return{value:f,handleValueChange:d,timezone:u}},HO=({name:t,timezone:e,value:n,defaultValue:r,onChange:i,valueManager:o})=>{const[s,a]=bc({name:t,state:"value",controlled:n,default:r??o.emptyValue}),l=st((c,...u)=>{a(c),i==null||i(c,...u)});return Ole({timezone:e,value:s,defaultValue:void 0,onChange:l,valueManager:o})},von=t=>{const e=pr(),n=Pl(),r=C1(),i=Ho(),{valueManager:o,fieldValueManager:s,valueType:a,validator:l,internalProps:c,internalProps:{value:u,defaultValue:f,referenceDate:d,onChange:h,format:p,formatDensity:g="dense",selectedSections:m,onSelectedSectionsChange:v,shouldRespectLeadingZeros:y=!1,timezone:x,enableAccessibleFieldDOMStructure:b=!1}}=t,{timezone:w,value:_,handleValueChange:S}=Ole({timezone:x,value:u,defaultValue:f,onChange:h,valueManager:o}),O=D.useMemo(()=>Yin(e),[e]),k=D.useMemo(()=>eon(e,O,w),[e,O,w]),E=D.useCallback((G,Y=null)=>s.getSectionsFromValue(e,G,Y,le=>kbe({utils:e,localeText:n,localizedDigits:O,format:p,date:le,formatDensity:g,shouldRespectLeadingZeros:y,enableAccessibleFieldDOMStructure:b,isRtl:i})),[s,p,n,O,i,y,e,g,b]),[P,A]=D.useState(()=>{const G=E(_),Y={sections:G,value:_,referenceValue:o.emptyValue,tempValueStrAndroid:null},le=Gin(G),K=o.getInitialReferenceValue({referenceDate:d,value:_,utils:e,props:c,granularity:le,timezone:w});return ve({},Y,{referenceValue:K})}),[R,T]=bc({controlled:m,default:null,name:"useField",state:"selectedSections"}),M=G=>{T(G),v==null||v(G)},I=D.useMemo(()=>FQ(R,P.sections),[R,P.sections]),j=I==="all"?0:I,N=({value:G,referenceValue:Y,sections:le})=>{if(A(ee=>ve({},ee,{sections:le,value:G,referenceValue:Y,tempValueStrAndroid:null})),o.areValuesEqual(e,P.value,G))return;const K={validationError:l({adapter:r,value:G,timezone:w,props:c})};S(G,K)},z=(G,Y)=>{const le=[...P.sections];return le[G]=ve({},le[G],{value:Y,modified:!0}),le},L=()=>{N({value:o.emptyValue,referenceValue:P.referenceValue,sections:E(o.emptyValue)})},B=()=>{if(j==null)return;const G=P.sections[j],Y=s.getActiveDateManager(e,P,G),K=Y.getSections(P.sections).filter(te=>te.value!=="").length===(G.value===""?0:1),ee=z(j,""),re=K?null:e.getInvalidDate(),ge=Y.getNewValuesFromNewActiveDate(re);N(ve({},ge,{sections:ee}))},F=G=>{const Y=(ee,re)=>{const ge=e.parse(ee,p);if(ge==null||!e.isValid(ge))return null;const te=kbe({utils:e,localeText:n,localizedDigits:O,format:p,date:ge,formatDensity:g,shouldRespectLeadingZeros:y,enableAccessibleFieldDOMStructure:b,isRtl:i});return Tbe(e,ge,te,re,!1)},le=s.parseValueStr(G,P.referenceValue,Y),K=s.updateReferenceValue(e,le,P.referenceValue);N({value:le,referenceValue:K,sections:E(le,P.sections)})},$=({activeSection:G,newSectionValue:Y,shouldGoToNextSection:le})=>{le&&jve({},U,te,{sections:ee,tempValueStrAndroid:null}))},q=G=>A(Y=>ve({},Y,{tempValueStrAndroid:G}));return D.useEffect(()=>{const G=E(P.value);A(Y=>ve({},Y,{sections:G}))},[p,e.locale,i]),D.useEffect(()=>{let G;o.areValuesEqual(e,P.value,_)?G=o.getTimezone(e,P.value)!==o.getTimezone(e,_):G=!0,G&&A(Y=>ve({},Y,{value:_,referenceValue:s.updateReferenceValue(e,_,Y.referenceValue),sections:E(_)}))},[_]),{state:P,activeSectionIndex:j,parsedSelectedSections:I,setSelectedSections:M,clearValue:L,clearActiveSection:B,updateSectionValue:$,updateValueFromValueStr:F,setTempAndroidValueStr:q,getSectionsFromValue:E,sectionsValueBoundaries:k,localizedDigits:O,timezone:w}},yon=5e3,sw=t=>t.saveQuery!=null,xon=({sections:t,updateSectionValue:e,sectionsValueBoundaries:n,localizedDigits:r,setTempAndroidValueStr:i,timezone:o})=>{const s=pr(),[a,l]=D.useState(null),c=st(()=>l(null));D.useEffect(()=>{var p;a!=null&&((p=t[a.sectionIndex])==null?void 0:p.type)!==a.sectionType&&c()},[t,a,c]),D.useEffect(()=>{if(a!=null){const p=setTimeout(()=>c(),yon);return()=>{clearTimeout(p)}}return()=>{}},[a,c]);const u=({keyPressed:p,sectionIndex:g},m,v)=>{const y=p.toLowerCase(),x=t[g];if(a!=null&&(!v||v(a.value))&&a.sectionIndex===g){const w=`${a.value}${y}`,_=m(w,x);if(!sw(_))return l({sectionIndex:g,value:w,sectionType:x.type}),_}const b=m(y,x);return sw(b)&&!b.saveQuery?(c(),null):(l({sectionIndex:g,value:y,sectionType:x.type}),sw(b)?null:b)},f=p=>{const g=(y,x,b)=>{const w=x.filter(_=>_.toLowerCase().startsWith(b));return w.length===0?{saveQuery:!1}:{sectionValue:w[0],shouldGoToNextSection:w.length===1}},m=(y,x,b,w)=>{const _=S=>VWe(s,o,x.type,S);if(x.contentType==="letter")return g(x.format,_(x.format),y);if(b&&w!=null&&WWe(s,b).contentType==="letter"){const S=_(b),O=g(b,S,y);return sw(O)?{saveQuery:!1}:ve({},O,{sectionValue:w(O.sectionValue,S)})}return{saveQuery:!1}};return u(p,(y,x)=>{switch(x.type){case"month":{const b=w=>Obe(s,w,s.formats.month,x.format);return m(y,x,s.formats.month,b)}case"weekDay":{const b=(w,_)=>_.indexOf(w).toString();return m(y,x,s.formats.weekday,b)}case"meridiem":return m(y,x);default:return{saveQuery:!1}}})},d=p=>{const g=(v,y)=>{const x=Pb(v,r),b=Number(x),w=n[y.type]({currentDate:null,format:y.format,contentType:y.contentType});if(b>w.maximum)return{saveQuery:!1};if(bw.maximum||x.length===w.maximum.toString().length;return{sectionValue:HWe(s,b,w,r,y),shouldGoToNextSection:_}};return u(p,(v,y)=>{if(y.contentType==="digit"||y.contentType==="digit-with-letter")return g(v,y);if(y.type==="month"){const x=XWe(s,"digit","month","MM"),b=g(v,{type:y.type,format:"MM",hasLeadingZerosInFormat:x,hasLeadingZerosInInput:!0,contentType:"digit",maxLength:2});if(sw(b))return b;const w=Obe(s,b.sectionValue,"MM",y.format);return ve({},b,{sectionValue:w})}if(y.type==="weekDay"){const x=g(v,y);if(sw(x))return x;const b=xU(s,y.format)[Number(x.sectionValue)-1];return ve({},x,{sectionValue:b})}return{saveQuery:!1}},v=>Cbe(v,r))};return{applyCharacterEditing:st(p=>{const g=t[p.sectionIndex],v=Cbe(p.keyPressed,r)?d(ve({},p,{keyPressed:_le(p.keyPressed,r)})):f(p);if(v==null){i(null);return}e({activeSection:g,newSectionValue:v.sectionValue,shouldGoToNextSection:v.shouldGoToNextSection})}),resetCharacterQuery:c}};function bon(t,e){return Array.isArray(e)?e.every(n=>t.indexOf(n)!==-1):t.indexOf(e)!==-1}const won=(t,e)=>n=>{(n.key==="Enter"||n.key===" ")&&(t(n),n.preventDefault(),n.stopPropagation())},Qa=(t=document)=>{const e=t.activeElement;return e?e.shadowRoot?Qa(e.shadowRoot):e:null},Q5=t=>Array.from(t.children).indexOf(Qa(document)),_on="@media (pointer: fine)",Son=t=>{const{internalProps:{disabled:e,readOnly:n=!1},forwardedProps:{sectionListRef:r,onBlur:i,onClick:o,onFocus:s,onInput:a,onPaste:l,focused:c,autoFocus:u=!1},fieldValueManager:f,applyCharacterEditing:d,resetCharacterQuery:h,setSelectedSections:p,parsedSelectedSections:g,state:m,clearActiveSection:v,clearValue:y,updateSectionValue:x,updateValueFromValueStr:b,sectionOrder:w,areAllSectionsEmpty:_,sectionsValueBoundaries:S}=t,O=D.useRef(null),k=dn(r,O),E=Pl(),P=pr(),A=Jf(),[R,T]=D.useState(!1),M=D.useMemo(()=>({syncSelectionToDOM:()=>{if(!O.current)return;const ae=document.getSelection();if(!ae)return;if(g==null){ae.rangeCount>0&&O.current.getRoot().contains(ae.getRangeAt(0).startContainer)&&ae.removeAllRanges(),R&&O.current.getRoot().blur();return}if(!O.current.getRoot().contains(Qa(document)))return;const U=new window.Range;let oe;g==="all"?oe=O.current.getRoot():m.sections[g].type==="empty"?oe=O.current.getSectionContainer(g):oe=O.current.getSectionContent(g),U.selectNodeContents(oe),oe.focus(),ae.removeAllRanges(),ae.addRange(U)},getActiveSectionIndexFromDOM:()=>{const ae=Qa(document);return!ae||!O.current||!O.current.getRoot().contains(ae)?null:O.current.getSectionIndexFromDOMElement(ae)},focusField:(ae=0)=>{if(!O.current)return;const U=FQ(ae,m.sections);T(!0),O.current.getSectionContent(U).focus()},setSelectedSections:ae=>{if(!O.current)return;const U=FQ(ae,m.sections);T((U==="all"?0:U)!==null),p(ae)},isFieldFocused:()=>{const ae=Qa(document);return!!O.current&&O.current.getRoot().contains(ae)}}),[g,p,m.sections,R]),I=st(ae=>{if(!O.current)return;const U=m.sections[ae];O.current.getSectionContent(ae).innerHTML=U.value||U.placeholder,M.syncSelectionToDOM()}),j=st((ae,...U)=>{ae.isDefaultPrevented()||!O.current||(T(!0),o==null||o(ae,...U),g==="all"?setTimeout(()=>{const oe=document.getSelection().getRangeAt(0).startOffset;if(oe===0){p(w.startIndex);return}let ne=0,V=0;for(;V{if(a==null||a(ae),!O.current||g!=="all")return;const oe=ae.target.textContent??"";O.current.getRoot().innerHTML=m.sections.map(ne=>`${ne.startSeparator}${ne.value||ne.placeholder}${ne.endSeparator}`).join(""),M.syncSelectionToDOM(),oe.length===0||oe.charCodeAt(0)===10?(h(),y(),p("all")):oe.length>1?b(oe):d({keyPressed:oe,sectionIndex:0})}),z=st(ae=>{if(l==null||l(ae),n||g!=="all"){ae.preventDefault();return}const U=ae.clipboardData.getData("text");ae.preventDefault(),h(),b(U)}),L=st((...ae)=>{if(s==null||s(...ae),R||!O.current)return;T(!0),O.current.getSectionIndexFromDOMElement(Qa(document))!=null||p(w.startIndex)}),B=st((...ae)=>{i==null||i(...ae),setTimeout(()=>{if(!O.current)return;const U=Qa(document);!O.current.getRoot().contains(U)&&(T(!1),p(null))})}),F=st(ae=>U=>{U.isDefaultPrevented()||p(ae)}),$=st(ae=>{ae.preventDefault()}),q=st(ae=>()=>{p(ae)}),G=st(ae=>{if(ae.preventDefault(),n||e||typeof g!="number")return;const U=m.sections[g],oe=ae.clipboardData.getData("text"),ne=/^[a-zA-Z]+$/.test(oe),V=/^[0-9]+$/.test(oe),X=/^(([a-zA-Z]+)|)([0-9]+)(([a-zA-Z]+)|)$/.test(oe);U.contentType==="letter"&&ne||U.contentType==="digit"&&V||U.contentType==="digit-with-letter"&&X?(h(),x({activeSection:U,newSectionValue:oe,shouldGoToNextSection:!0})):!ne&&!V&&(h(),b(oe))}),Y=st(ae=>{ae.preventDefault(),ae.dataTransfer.dropEffect="none"}),le=st(ae=>{if(!O.current)return;const U=ae.target,oe=U.textContent??"",ne=O.current.getSectionIndexFromDOMElement(U),V=m.sections[ne];if(n||!O.current){I(ne);return}if(oe.length===0){if(V.value===""){I(ne);return}const X=ae.nativeEvent.inputType;if(X==="insertParagraph"||X==="insertLineBreak"){I(ne);return}h(),v();return}d({keyPressed:oe,sectionIndex:ne}),I(ne)});Ti(()=>{if(!(!R||!O.current)){if(g==="all")O.current.getRoot().focus();else if(typeof g=="number"){const ae=O.current.getSectionContent(g);ae&&ae.focus()}}},[g,R]);const K=D.useMemo(()=>m.sections.reduce((ae,U)=>(ae[U.type]=S[U.type]({currentDate:null,contentType:U.contentType,format:U.format}),ae),{}),[S,m.sections]),ee=g==="all",re=D.useMemo(()=>m.sections.map((ae,U)=>{const oe=!ee&&!e&&!n;return{container:{"data-sectionindex":U,onClick:F(U)},content:{tabIndex:ee||U>0?-1:0,contentEditable:!ee&&!e&&!n,role:"spinbutton",id:`${A}-${ae.type}`,"aria-labelledby":`${A}-${ae.type}`,"aria-readonly":n,"aria-valuenow":oon(ae,P),"aria-valuemin":K[ae.type].minimum,"aria-valuemax":K[ae.type].maximum,"aria-valuetext":ae.value?ion(ae,P):E.empty,"aria-label":E[ae.type],"aria-disabled":e,spellCheck:oe?!1:void 0,autoCapitalize:oe?"off":void 0,autoCorrect:oe?"off":void 0,[parseInt(D.version,10)>=17?"enterKeyHint":"enterkeyhint"]:oe?"next":void 0,children:ae.value||ae.placeholder,onInput:le,onPaste:G,onFocus:q(U),onDragOver:Y,onMouseUp:$,inputMode:ae.contentType==="letter"?"text":"numeric"},before:{children:ae.startSeparator},after:{children:ae.endSeparator}}}),[m.sections,q,G,Y,le,F,$,e,n,ee,E,P,K,A]),ge=st(ae=>{b(ae.target.value)}),te=D.useMemo(()=>_?"":f.getV7HiddenInputValueFromSections(m.sections),[_,m.sections,f]);return D.useEffect(()=>{if(O.current==null)throw new Error(["MUI X: The `sectionListRef` prop has not been initialized by `PickersSectionList`","You probably tried to pass a component to the `textField` slot that contains an `` element instead of a `PickersSectionList`.","","If you want to keep using an `` HTML element for the editing, please remove the `enableAccessibleFieldDOMStructure` prop from your picker or field component:","","","","Learn more about the field accessible DOM structure on the MUI documentation: https://mui.com/x/react-date-pickers/fields/#fields-to-edit-a-single-element"].join(` +`));u&&O.current&&O.current.getSectionContent(w.startIndex).focus()},[]),{interactions:M,returnedValue:{autoFocus:u,readOnly:n,focused:c??R,sectionListRef:k,onBlur:B,onClick:j,onFocus:L,onInput:N,onPaste:z,enableAccessibleFieldDOMStructure:!0,elements:re,tabIndex:g===0?-1:0,contentEditable:ee,value:te,onChange:ge,areAllSectionsEmpty:_}}},h_=t=>t.replace(/[\u2066\u2067\u2068\u2069]/g,""),Con=(t,e,n)=>{let r=0,i=n?1:0;const o=[];for(let s=0;s{const e=Ho(),n=D.useRef(),r=D.useRef(),{forwardedProps:{onFocus:i,onClick:o,onPaste:s,onBlur:a,inputRef:l,placeholder:c},internalProps:{readOnly:u=!1,disabled:f=!1},parsedSelectedSections:d,activeSectionIndex:h,state:p,fieldValueManager:g,valueManager:m,applyCharacterEditing:v,resetCharacterQuery:y,updateSectionValue:x,updateValueFromValueStr:b,clearActiveSection:w,clearValue:_,setTempAndroidValueStr:S,setSelectedSections:O,getSectionsFromValue:k,areAllSectionsEmpty:E,localizedDigits:P}=t,A=D.useRef(null),R=dn(l,A),T=D.useMemo(()=>Con(p.sections,P,e),[p.sections,P,e]),M=D.useMemo(()=>({syncSelectionToDOM:()=>{if(!A.current)return;if(d==null){A.current.scrollLeft&&(A.current.scrollLeft=0);return}if(A.current!==Qa(document))return;const le=A.current.scrollTop;if(d==="all")A.current.select();else{const K=T[d],ee=K.type==="empty"?K.startInInput-K.startSeparator.length:K.startInInput,re=K.type==="empty"?K.endInInput+K.endSeparator.length:K.endInInput;(ee!==A.current.selectionStart||re!==A.current.selectionEnd)&&A.current===Qa(document)&&A.current.setSelectionRange(ee,re),clearTimeout(r.current),r.current=setTimeout(()=>{A.current&&A.current===Qa(document)&&A.current.selectionStart===A.current.selectionEnd&&(A.current.selectionStart!==ee||A.current.selectionEnd!==re)&&M.syncSelectionToDOM()})}A.current.scrollTop=le},getActiveSectionIndexFromDOM:()=>{const le=A.current.selectionStart??0,K=A.current.selectionEnd??0;if(le===0&&K===0)return null;const ee=le<=T[0].startInInput?1:T.findIndex(re=>re.startInInput-re.startSeparator.length>le);return ee===-1?T.length-1:ee-1},focusField:(le=0)=>{var K;(K=A.current)==null||K.focus(),O(le)},setSelectedSections:le=>O(le),isFieldFocused:()=>A.current===Qa(document)}),[A,d,T,O]),I=()=>{const le=A.current.selectionStart??0;let K;le<=T[0].startInInput||le>=T[T.length-1].endInInput?K=1:K=T.findIndex(re=>re.startInInput-re.startSeparator.length>le);const ee=K===-1?T.length-1:K-1;O(ee)},j=st((...le)=>{i==null||i(...le);const K=A.current;clearTimeout(n.current),n.current=setTimeout(()=>{!K||K!==A.current||h==null&&(K.value.length&&Number(K.selectionEnd)-Number(K.selectionStart)===K.value.length?O("all"):I())})}),N=st((le,...K)=>{le.isDefaultPrevented()||(o==null||o(le,...K),I())}),z=st(le=>{if(s==null||s(le),le.preventDefault(),u||f)return;const K=le.clipboardData.getData("text");if(typeof d=="number"){const ee=p.sections[d],re=/^[a-zA-Z]+$/.test(K),ge=/^[0-9]+$/.test(K),te=/^(([a-zA-Z]+)|)([0-9]+)(([a-zA-Z]+)|)$/.test(K);if(ee.contentType==="letter"&&re||ee.contentType==="digit"&&ge||ee.contentType==="digit-with-letter"&&te){y(),x({activeSection:ee,newSectionValue:K,shouldGoToNextSection:!0});return}if(re||ge)return}y(),b(K)}),L=st((...le)=>{a==null||a(...le),O(null)}),B=st(le=>{if(u)return;const K=le.target.value;if(K===""){y(),_();return}const ee=le.nativeEvent.data,re=ee&&ee.length>1,ge=re?ee:K,te=h_(ge);if(h==null||re){b(re?ee:te);return}let ae;if(d==="all"&&te.length===1)ae=te;else{const U=h_(g.getV6InputValueFromSections(T,P,e));let oe=-1,ne=-1;for(let he=0;heV.end)return;const Z=te.length-U.length+V.end-h_(V.endSeparator||"").length;ae=te.slice(V.start+h_(V.startSeparator||"").length,Z)}if(ae.length===0){non()&&S(ge),y(),w();return}v({keyPressed:ae,sectionIndex:h})}),F=D.useMemo(()=>c!==void 0?c:g.getV6InputValueFromSections(k(m.emptyValue),P,e),[c,g,k,m.emptyValue,P,e]),$=D.useMemo(()=>p.tempValueStrAndroid??g.getV6InputValueFromSections(p.sections,P,e),[p.sections,g,p.tempValueStrAndroid,P,e]);D.useEffect(()=>(A.current&&A.current===Qa(document)&&O("all"),()=>{clearTimeout(n.current),clearTimeout(r.current)}),[]);const q=D.useMemo(()=>h==null||p.sections[h].contentType==="letter"?"text":"numeric",[h,p.sections]),Y=!(A.current&&A.current===Qa(document))&&E;return{interactions:M,returnedValue:{readOnly:u,onBlur:L,onClick:N,onFocus:j,onPaste:z,inputRef:R,enableAccessibleFieldDOMStructure:!1,placeholder:F,inputMode:q,autoComplete:"off",value:Y?"":$,onChange:B}}},Eon=t=>{const e=pr(),{internalProps:n,internalProps:{unstableFieldRef:r,minutesStep:i,enableAccessibleFieldDOMStructure:o=!1,disabled:s=!1,readOnly:a=!1},forwardedProps:{onKeyDown:l,error:c,clearable:u,onClear:f},fieldValueManager:d,valueManager:h,validator:p}=t,g=Ho(),m=von(t),{state:v,activeSectionIndex:y,parsedSelectedSections:x,setSelectedSections:b,clearValue:w,clearActiveSection:_,updateSectionValue:S,setTempAndroidValueStr:O,sectionsValueBoundaries:k,localizedDigits:E,timezone:P}=m,A=xon({sections:v.sections,updateSectionValue:S,sectionsValueBoundaries:k,localizedDigits:E,setTempAndroidValueStr:O,timezone:P}),{resetCharacterQuery:R}=A,T=h.areValuesEqual(e,v.value,h.emptyValue),M=o?Son:Oon,I=D.useMemo(()=>ron(v.sections,g&&!o),[v.sections,g,o]),{returnedValue:j,interactions:N}=M(ve({},t,m,A,{areAllSectionsEmpty:T,sectionOrder:I})),z=st(G=>{if(l==null||l(G),!s)switch(!0){case((G.ctrlKey||G.metaKey)&&String.fromCharCode(G.keyCode)==="A"&&!G.shiftKey&&!G.altKey):{G.preventDefault(),b("all");break}case G.key==="ArrowRight":{if(G.preventDefault(),x==null)b(I.startIndex);else if(x==="all")b(I.endIndex);else{const Y=I.neighbors[x].rightIndex;Y!==null&&b(Y)}break}case G.key==="ArrowLeft":{if(G.preventDefault(),x==null)b(I.endIndex);else if(x==="all")b(I.startIndex);else{const Y=I.neighbors[x].leftIndex;Y!==null&&b(Y)}break}case G.key==="Delete":{if(G.preventDefault(),a)break;x==null||x==="all"?w():_(),R();break}case["ArrowUp","ArrowDown","Home","End","PageUp","PageDown"].includes(G.key):{if(G.preventDefault(),a||y==null)break;const Y=v.sections[y],le=d.getActiveDateManager(e,v,Y),K=Qin(e,P,Y,G.key,k,E,le.date,{minutesStep:i});S({activeSection:Y,newSectionValue:K,shouldGoToNextSection:!1});break}}});Ti(()=>{N.syncSelectionToDOM()});const{hasValidationError:L}=nVe({props:n,validator:p,timezone:P,value:v.value,onError:n.onError}),B=D.useMemo(()=>c!==void 0?c:L,[L,c]);D.useEffect(()=>{!B&&y==null&&R()},[v.referenceValue,y,B]),D.useEffect(()=>{v.tempValueStrAndroid!=null&&y!=null&&(R(),_())},[v.sections]),D.useImperativeHandle(r,()=>({getSections:()=>v.sections,getActiveSectionIndex:N.getActiveSectionIndexFromDOM,setSelectedSections:N.setSelectedSections,focusField:N.focusField,isFieldFocused:N.isFieldFocused}));const F=st((G,...Y)=>{G.preventDefault(),f==null||f(G,...Y),w(),N.isFieldFocused()?b(I.startIndex):N.focusField(0)}),$={onKeyDown:z,onClear:F,error:B,clearable:!!(u&&!T&&!a&&!s)},q={disabled:s,readOnly:a};return ve({},t.forwardedProps,$,q,j)},Ton=ct(C.jsx("path",{d:"M7 10l5 5 5-5z"}),"ArrowDropDown"),kon=ct(C.jsx("path",{d:"M15.41 16.59L10.83 12l4.58-4.59L14 6l-6 6 6 6 1.41-1.41z"}),"ArrowLeft"),Aon=ct(C.jsx("path",{d:"M8.59 16.59L13.17 12 8.59 7.41 10 6l6 6-6 6-1.41-1.41z"}),"ArrowRight"),Pon=ct(C.jsx("path",{d:"M17 12h-5v5h5v-5zM16 1v2H8V1H6v2H5c-1.11 0-1.99.9-1.99 2L3 19c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2h-1V1h-2zm3 18H5V8h14v11z"}),"Calendar");ct(C.jsxs(D.Fragment,{children:[C.jsx("path",{d:"M11.99 2C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2zM12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z"}),C.jsx("path",{d:"M12.5 7H11v6l5.25 3.15.75-1.23-4.5-2.67z"})]}),"Clock");const Mon=ct(C.jsx("path",{d:"M9 11H7v2h2v-2zm4 0h-2v2h2v-2zm4 0h-2v2h2v-2zm2-7h-1V2h-2v2H8V2H6v2H5c-1.11 0-1.99.9-1.99 2L3 20c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm0 16H5V9h14v11z"}),"DateRange"),Ron=ct(C.jsxs(D.Fragment,{children:[C.jsx("path",{d:"M11.99 2C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2zM12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z"}),C.jsx("path",{d:"M12.5 7H11v6l5.25 3.15.75-1.23-4.5-2.67z"})]}),"Time"),Don=ct(C.jsx("path",{d:"M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"}),"Clear"),Ion=["clearable","onClear","InputProps","sx","slots","slotProps"],Lon=["ownerState"],$on=t=>{const e=Pl(),{clearable:n,onClear:r,InputProps:i,sx:o,slots:s,slotProps:a}=t,l=Rt(t,Ion),c=(s==null?void 0:s.clearButton)??Ht,u=Zt({elementType:c,externalSlotProps:a==null?void 0:a.clearButton,ownerState:{},className:"clearButton",additionalProps:{title:e.fieldClearLabel}}),f=Rt(u,Lon),d=(s==null?void 0:s.clearIcon)??Don,h=Zt({elementType:d,externalSlotProps:a==null?void 0:a.clearIcon,ownerState:{}});return ve({},l,{InputProps:ve({},i,{endAdornment:C.jsxs(D.Fragment,{children:[n&&C.jsx(mPe,{position:"end",sx:{marginRight:i!=null&&i.endAdornment?-1:-1.5},children:C.jsx(c,ve({},f,{onClick:r,children:C.jsx(d,ve({fontSize:"small"},h))}))}),i==null?void 0:i.endAdornment]})}),sx:[{"& .clearButton":{opacity:1},"@media (pointer: fine)":{"& .clearButton":{opacity:0},"&:hover, &:focus-within":{".clearButton":{opacity:1}}}},...Array.isArray(o)?o:[o]]})},Fon=["value","defaultValue","referenceDate","format","formatDensity","onChange","timezone","onError","shouldRespectLeadingZeros","selectedSections","onSelectedSectionsChange","unstableFieldRef","enableAccessibleFieldDOMStructure","disabled","readOnly","dateSeparator"],Non=(t,e)=>D.useMemo(()=>{const n=ve({},t),r={},i=o=>{n.hasOwnProperty(o)&&(r[o]=n[o],delete n[o])};return Fon.forEach(i),QWe.forEach(i),KWe.forEach(i),ZWe.forEach(i),{forwardedProps:n,internalProps:r}},[t,e]),zon=D.createContext(null);function rVe(t){const{contextValue:e,localeText:n,children:r}=t;return C.jsx(zon.Provider,{value:e,children:C.jsx(BWe,{localeText:n,children:r})})}const jon=t=>{const e=pr(),n=eD(),i=t.ampm??e.is12HourCycleInCurrentLocale()?e.formats.keyboardDateTime12h:e.formats.keyboardDateTime24h;return ve({},t,{disablePast:t.disablePast??!1,disableFuture:t.disableFuture??!1,format:t.format??i,disableIgnoringDatePartForTimeValidation:!!(t.minDateTime||t.maxDateTime),minDate:Du(e,t.minDateTime??t.minDate,n.minDate),maxDate:Du(e,t.maxDateTime??t.maxDate,n.maxDate),minTime:t.minDateTime??t.minTime,maxTime:t.maxDateTime??t.maxTime})},Bon=t=>{const e=jon(t),{forwardedProps:n,internalProps:r}=Non(e,"date-time");return Eon({forwardedProps:n,internalProps:r,valueManager:na,fieldValueManager:aon,validator:bU,valueType:"date-time"})};function Uon(t){return Ye("MuiPickersTextField",t)}He("MuiPickersTextField",["root","focused","disabled","error","required"]);function Won(t){return Ye("MuiPickersInputBase",t)}const H_=He("MuiPickersInputBase",["root","focused","disabled","error","notchedOutline","sectionContent","sectionBefore","sectionAfter","adornedStart","adornedEnd","input"]);function Von(t){return Ye("MuiPickersSectionList",t)}const v2=He("MuiPickersSectionList",["root","section","sectionContent"]),Gon=["slots","slotProps","elements","sectionListRef"],iVe=be("div",{name:"MuiPickersSectionList",slot:"Root",overridesResolver:(t,e)=>e.root})({direction:"ltr /*! @noflip */",outline:"none"}),oVe=be("span",{name:"MuiPickersSectionList",slot:"Section",overridesResolver:(t,e)=>e.section})({}),sVe=be("span",{name:"MuiPickersSectionList",slot:"SectionSeparator",overridesResolver:(t,e)=>e.sectionSeparator})({whiteSpace:"pre"}),aVe=be("span",{name:"MuiPickersSectionList",slot:"SectionContent",overridesResolver:(t,e)=>e.sectionContent})({outline:"none"}),Hon=t=>{const{classes:e}=t;return qe({root:["root"],section:["section"],sectionContent:["sectionContent"]},Von,e)};function qon(t){const{slots:e,slotProps:n,element:r,classes:i}=t,o=(e==null?void 0:e.section)??oVe,s=Zt({elementType:o,externalSlotProps:n==null?void 0:n.section,externalForwardedProps:r.container,className:i.section,ownerState:{}}),a=(e==null?void 0:e.sectionContent)??aVe,l=Zt({elementType:a,externalSlotProps:n==null?void 0:n.sectionContent,externalForwardedProps:r.content,additionalProps:{suppressContentEditableWarning:!0},className:i.sectionContent,ownerState:{}}),c=(e==null?void 0:e.sectionSeparator)??sVe,u=Zt({elementType:c,externalSlotProps:n==null?void 0:n.sectionSeparator,externalForwardedProps:r.before,ownerState:{position:"before"}}),f=Zt({elementType:c,externalSlotProps:n==null?void 0:n.sectionSeparator,externalForwardedProps:r.after,ownerState:{position:"after"}});return C.jsxs(o,ve({},s,{children:[C.jsx(c,ve({},u)),C.jsx(a,ve({},l)),C.jsx(c,ve({},f))]}))}const Xon=D.forwardRef(function(e,n){const r=kn({props:e,name:"MuiPickersSectionList"}),{slots:i,slotProps:o,elements:s,sectionListRef:a}=r,l=Rt(r,Gon),c=Hon(r),u=D.useRef(null),f=dn(n,u),d=g=>{if(!u.current)throw new Error(`MUI X: Cannot call sectionListRef.${g} before the mount of the component.`);return u.current};D.useImperativeHandle(a,()=>({getRoot(){return d("getRoot")},getSectionContainer(g){return d("getSectionContainer").querySelector(`.${v2.section}[data-sectionindex="${g}"]`)},getSectionContent(g){return d("getSectionContent").querySelector(`.${v2.section}[data-sectionindex="${g}"] .${v2.sectionContent}`)},getSectionIndexFromDOMElement(g){const m=d("getSectionIndexFromDOMElement");if(g==null||!m.contains(g))return null;let v=null;return g.classList.contains(v2.section)?v=g:g.classList.contains(v2.sectionContent)&&(v=g.parentElement),v==null?null:Number(v.dataset.sectionindex)}}));const h=(i==null?void 0:i.root)??iVe,p=Zt({elementType:h,externalSlotProps:o==null?void 0:o.root,externalForwardedProps:l,additionalProps:{ref:f,suppressContentEditableWarning:!0},className:c.root,ownerState:{}});return C.jsx(h,ve({},p,{children:p.contentEditable?s.map(({content:g,before:m,after:v})=>`${m.children}${g.children}${v.children}`).join(""):C.jsx(D.Fragment,{children:s.map((g,m)=>C.jsx(qon,{slots:i,slotProps:o,element:g,classes:c},m))})}))}),Yon=["elements","areAllSectionsEmpty","defaultValue","label","value","onChange","id","autoFocus","endAdornment","startAdornment","renderSuffix","slots","slotProps","contentEditable","tabIndex","onInput","onPaste","onKeyDown","fullWidth","name","readOnly","inputProps","inputRef","sectionListRef"],Qon=t=>Math.round(t*1e5)/1e5,wU=be("div",{name:"MuiPickersInputBase",slot:"Root",overridesResolver:(t,e)=>e.root})(({theme:t})=>ve({},t.typography.body1,{color:(t.vars||t).palette.text.primary,cursor:"text",padding:0,display:"flex",justifyContent:"flex-start",alignItems:"center",position:"relative",boxSizing:"border-box",letterSpacing:`${Qon(.15/16)}em`,variants:[{props:{fullWidth:!0},style:{width:"100%"}}]})),Ele=be(iVe,{name:"MuiPickersInputBase",slot:"SectionsContainer",overridesResolver:(t,e)=>e.sectionsContainer})(({theme:t})=>({padding:"4px 0 5px",fontFamily:t.typography.fontFamily,fontSize:"inherit",lineHeight:"1.4375em",flexGrow:1,outline:"none",display:"flex",flexWrap:"nowrap",overflow:"hidden",letterSpacing:"inherit",width:"182px",variants:[{props:{isRtl:!0},style:{textAlign:"right /*! @noflip */"}},{props:{size:"small"},style:{paddingTop:1}},{props:{adornedStart:!1,focused:!1,filled:!1},style:{color:"currentColor",opacity:0}},{props:({adornedStart:e,focused:n,filled:r,label:i})=>!e&&!n&&!r&&i==null,style:t.vars?{opacity:t.vars.opacity.inputPlaceholder}:{opacity:t.palette.mode==="light"?.42:.5}}]})),Kon=be(oVe,{name:"MuiPickersInputBase",slot:"Section",overridesResolver:(t,e)=>e.section})(({theme:t})=>({fontFamily:t.typography.fontFamily,fontSize:"inherit",letterSpacing:"inherit",lineHeight:"1.4375em",display:"flex"})),Zon=be(aVe,{name:"MuiPickersInputBase",slot:"SectionContent",overridesResolver:(t,e)=>e.content})(({theme:t})=>({fontFamily:t.typography.fontFamily,lineHeight:"1.4375em",letterSpacing:"inherit",width:"fit-content",outline:"none"})),Jon=be(sVe,{name:"MuiPickersInputBase",slot:"Separator",overridesResolver:(t,e)=>e.separator})(()=>({whiteSpace:"pre",letterSpacing:"inherit"})),esn=be("input",{name:"MuiPickersInputBase",slot:"Input",overridesResolver:(t,e)=>e.hiddenInput})(ve({},MAe)),tsn=t=>{const{focused:e,disabled:n,error:r,classes:i,fullWidth:o,readOnly:s,color:a,size:l,endAdornment:c,startAdornment:u}=t,f={root:["root",e&&!n&&"focused",n&&"disabled",s&&"readOnly",r&&"error",o&&"fullWidth",`color${Re(a)}`,l==="small"&&"inputSizeSmall",!!u&&"adornedStart",!!c&&"adornedEnd"],notchedOutline:["notchedOutline"],input:["input"],sectionsContainer:["sectionsContainer"],sectionContent:["sectionContent"],sectionBefore:["sectionBefore"],sectionAfter:["sectionAfter"]};return qe(f,Won,i)},Tle=D.forwardRef(function(e,n){const r=kn({props:e,name:"MuiPickersInputBase"}),{elements:i,areAllSectionsEmpty:o,value:s,onChange:a,id:l,endAdornment:c,startAdornment:u,renderSuffix:f,slots:d,slotProps:h,contentEditable:p,tabIndex:g,onInput:m,onPaste:v,onKeyDown:y,name:x,readOnly:b,inputProps:w,inputRef:_,sectionListRef:S}=r,O=Rt(r,Yon),k=D.useRef(null),E=dn(n,k),P=dn(w==null?void 0:w.ref,_),A=Ho(),R=Fa();if(!R)throw new Error("MUI X: PickersInputBase should always be used inside a PickersTextField component");const T=L=>{var B;if(R.disabled){L.stopPropagation();return}(B=R.onFocus)==null||B.call(R,L)};D.useEffect(()=>{R&&R.setAdornedStart(!!u)},[R,u]),D.useEffect(()=>{R&&(o?R.onEmpty():R.onFilled())},[R,o]);const M=ve({},r,R,{isRtl:A}),I=tsn(M),j=(d==null?void 0:d.root)||wU,N=Zt({elementType:j,externalSlotProps:h==null?void 0:h.root,externalForwardedProps:O,additionalProps:{"aria-invalid":R.error,ref:E},className:I.root,ownerState:M}),z=(d==null?void 0:d.input)||Ele;return C.jsxs(j,ve({},N,{children:[u,C.jsx(Xon,{sectionListRef:S,elements:i,contentEditable:p,tabIndex:g,className:I.sectionsContainer,onFocus:T,onBlur:R.onBlur,onInput:m,onPaste:v,onKeyDown:y,slots:{root:z,section:Kon,sectionContent:Zon,sectionSeparator:Jon},slotProps:{root:{ownerState:M},sectionContent:{className:H_.sectionContent},sectionSeparator:({position:L})=>({className:L==="before"?H_.sectionBefore:H_.sectionAfter})}}),c,f?f(ve({},R)):null,C.jsx(esn,ve({name:x,className:I.input,value:s,onChange:a,id:l,"aria-hidden":"true",tabIndex:-1,readOnly:b,required:R.required,disabled:R.disabled},w,{ref:P}))]}))});function nsn(t){return Ye("MuiPickersOutlinedInput",t)}const Qu=ve({},H_,He("MuiPickersOutlinedInput",["root","notchedOutline","input"])),rsn=["children","className","label","notched","shrink"],isn=be("fieldset",{name:"MuiPickersOutlinedInput",slot:"NotchedOutline",overridesResolver:(t,e)=>e.notchedOutline})(({theme:t})=>{const e=t.palette.mode==="light"?"rgba(0, 0, 0, 0.23)":"rgba(255, 255, 255, 0.23)";return{textAlign:"left",position:"absolute",bottom:0,right:0,top:-5,left:0,margin:0,padding:"0 8px",pointerEvents:"none",borderRadius:"inherit",borderStyle:"solid",borderWidth:1,overflow:"hidden",minWidth:"0%",borderColor:t.vars?`rgba(${t.vars.palette.common.onBackgroundChannel} / 0.23)`:e}}),Abe=be("span")(({theme:t})=>({fontFamily:t.typography.fontFamily,fontSize:"inherit"})),osn=be("legend")(({theme:t})=>({float:"unset",width:"auto",overflow:"hidden",variants:[{props:{withLabel:!1},style:{padding:0,lineHeight:"11px",transition:t.transitions.create("width",{duration:150,easing:t.transitions.easing.easeOut})}},{props:{withLabel:!0},style:{display:"block",padding:0,height:11,fontSize:"0.75em",visibility:"hidden",maxWidth:.01,transition:t.transitions.create("max-width",{duration:50,easing:t.transitions.easing.easeOut}),whiteSpace:"nowrap","& > span":{paddingLeft:5,paddingRight:5,display:"inline-block",opacity:0,visibility:"visible"}}},{props:{withLabel:!0,notched:!0},style:{maxWidth:"100%",transition:t.transitions.create("max-width",{duration:100,easing:t.transitions.easing.easeOut,delay:50})}}]}));function ssn(t){const{className:e,label:n}=t,r=Rt(t,rsn),i=n!=null&&n!=="",o=ve({},t,{withLabel:i});return C.jsx(isn,ve({"aria-hidden":!0,className:e},r,{ownerState:o,children:C.jsx(osn,{ownerState:o,children:i?C.jsx(Abe,{children:n}):C.jsx(Abe,{className:"notranslate",children:"​"})})}))}const asn=["label","autoFocus","ownerState","notched"],lsn=be(wU,{name:"MuiPickersOutlinedInput",slot:"Root",overridesResolver:(t,e)=>e.root})(({theme:t})=>{const e=t.palette.mode==="light"?"rgba(0, 0, 0, 0.23)":"rgba(255, 255, 255, 0.23)";return{padding:"0 14px",borderRadius:(t.vars||t).shape.borderRadius,[`&:hover .${Qu.notchedOutline}`]:{borderColor:(t.vars||t).palette.text.primary},"@media (hover: none)":{[`&:hover .${Qu.notchedOutline}`]:{borderColor:t.vars?`rgba(${t.vars.palette.common.onBackgroundChannel} / 0.23)`:e}},[`&.${Qu.focused} .${Qu.notchedOutline}`]:{borderStyle:"solid",borderWidth:2},[`&.${Qu.disabled}`]:{[`& .${Qu.notchedOutline}`]:{borderColor:(t.vars||t).palette.action.disabled},"*":{color:(t.vars||t).palette.action.disabled}},[`&.${Qu.error} .${Qu.notchedOutline}`]:{borderColor:(t.vars||t).palette.error.main},variants:Object.keys((t.vars??t).palette).filter(n=>{var r;return((r=(t.vars??t).palette[n])==null?void 0:r.main)??!1}).map(n=>({props:{color:n},style:{[`&.${Qu.focused}:not(.${Qu.error}) .${Qu.notchedOutline}`]:{borderColor:(t.vars||t).palette[n].main}}}))}}),csn=be(Ele,{name:"MuiPickersOutlinedInput",slot:"SectionsContainer",overridesResolver:(t,e)=>e.sectionsContainer})({padding:"16.5px 0",variants:[{props:{size:"small"},style:{padding:"8.5px 0"}}]}),usn=t=>{const{classes:e}=t,r=qe({root:["root"],notchedOutline:["notchedOutline"],input:["input"]},nsn,e);return ve({},e,r)},lVe=D.forwardRef(function(e,n){const r=kn({props:e,name:"MuiPickersOutlinedInput"}),{label:i,ownerState:o,notched:s}=r,a=Rt(r,asn),l=Fa(),c=ve({},r,o,l,{color:(l==null?void 0:l.color)||"primary"}),u=usn(c);return C.jsx(Tle,ve({slots:{root:lsn,input:csn},renderSuffix:f=>C.jsx(ssn,{shrink:!!(s||f.adornedStart||f.focused||f.filled),notched:!!(s||f.adornedStart||f.focused||f.filled),className:u.notchedOutline,label:i!=null&&i!==""&&(l!=null&&l.required)?C.jsxs(D.Fragment,{children:[i," ","*"]}):i,ownerState:c})},a,{label:i,classes:u,ref:n}))});lVe.muiName="Input";function fsn(t){return Ye("MuiPickersFilledInput",t)}const E0=ve({},H_,He("MuiPickersFilledInput",["root","underline","input"])),dsn=["label","autoFocus","disableUnderline","ownerState"],hsn=be(wU,{name:"MuiPickersFilledInput",slot:"Root",overridesResolver:(t,e)=>e.root,shouldForwardProp:t=>e3(t)&&t!=="disableUnderline"})(({theme:t})=>{const e=t.palette.mode==="light",n=e?"rgba(0, 0, 0, 0.42)":"rgba(255, 255, 255, 0.7)",r=e?"rgba(0, 0, 0, 0.06)":"rgba(255, 255, 255, 0.09)",i=e?"rgba(0, 0, 0, 0.09)":"rgba(255, 255, 255, 0.13)",o=e?"rgba(0, 0, 0, 0.12)":"rgba(255, 255, 255, 0.12)";return{backgroundColor:t.vars?t.vars.palette.FilledInput.bg:r,borderTopLeftRadius:(t.vars||t).shape.borderRadius,borderTopRightRadius:(t.vars||t).shape.borderRadius,transition:t.transitions.create("background-color",{duration:t.transitions.duration.shorter,easing:t.transitions.easing.easeOut}),"&:hover":{backgroundColor:t.vars?t.vars.palette.FilledInput.hoverBg:i,"@media (hover: none)":{backgroundColor:t.vars?t.vars.palette.FilledInput.bg:r}},[`&.${E0.focused}`]:{backgroundColor:t.vars?t.vars.palette.FilledInput.bg:r},[`&.${E0.disabled}`]:{backgroundColor:t.vars?t.vars.palette.FilledInput.disabledBg:o},variants:[...Object.keys((t.vars??t).palette).filter(s=>(t.vars??t).palette[s].main).map(s=>{var a;return{props:{color:s,disableUnderline:!1},style:{"&::after":{borderBottom:`2px solid ${(a=(t.vars||t).palette[s])==null?void 0:a.main}`}}}}),{props:{disableUnderline:!1},style:{"&::after":{left:0,bottom:0,content:'""',position:"absolute",right:0,transform:"scaleX(0)",transition:t.transitions.create("transform",{duration:t.transitions.duration.shorter,easing:t.transitions.easing.easeOut}),pointerEvents:"none"},[`&.${E0.focused}:after`]:{transform:"scaleX(1) translateX(0)"},[`&.${E0.error}`]:{"&:before, &:after":{borderBottomColor:(t.vars||t).palette.error.main}},"&::before":{borderBottom:`1px solid ${t.vars?`rgba(${t.vars.palette.common.onBackgroundChannel} / ${t.vars.opacity.inputUnderline})`:n}`,left:0,bottom:0,content:'"\\00a0"',position:"absolute",right:0,transition:t.transitions.create("border-bottom-color",{duration:t.transitions.duration.shorter}),pointerEvents:"none"},[`&:hover:not(.${E0.disabled}, .${E0.error}):before`]:{borderBottom:`1px solid ${(t.vars||t).palette.text.primary}`},[`&.${E0.disabled}:before`]:{borderBottomStyle:"dotted"}}},{props:({startAdornment:s})=>!!s,style:{paddingLeft:12}},{props:({endAdornment:s})=>!!s,style:{paddingRight:12}}]}}),psn=be(Ele,{name:"MuiPickersFilledInput",slot:"sectionsContainer",overridesResolver:(t,e)=>e.sectionsContainer})({paddingTop:25,paddingRight:12,paddingBottom:8,paddingLeft:12,variants:[{props:{size:"small"},style:{paddingTop:21,paddingBottom:4}},{props:({startAdornment:t})=>!!t,style:{paddingLeft:0}},{props:({endAdornment:t})=>!!t,style:{paddingRight:0}},{props:{hiddenLabel:!0},style:{paddingTop:16,paddingBottom:17}},{props:{hiddenLabel:!0,size:"small"},style:{paddingTop:8,paddingBottom:9}}]}),gsn=t=>{const{classes:e,disableUnderline:n}=t,i=qe({root:["root",!n&&"underline"],input:["input"]},fsn,e);return ve({},e,i)},cVe=D.forwardRef(function(e,n){const r=kn({props:e,name:"MuiPickersFilledInput"}),{label:i,disableUnderline:o=!1,ownerState:s}=r,a=Rt(r,dsn),l=Fa(),c=ve({},r,s,l,{color:(l==null?void 0:l.color)||"primary"}),u=gsn(c);return C.jsx(Tle,ve({slots:{root:hsn,input:psn},slotProps:{root:{disableUnderline:o}}},a,{label:i,classes:u,ref:n}))});cVe.muiName="Input";function msn(t){return Ye("MuiPickersFilledInput",t)}const y2=ve({},H_,He("MuiPickersInput",["root","input"])),vsn=["label","autoFocus","disableUnderline","ownerState"],ysn=be(wU,{name:"MuiPickersInput",slot:"Root",overridesResolver:(t,e)=>e.root})(({theme:t})=>{let n=t.palette.mode==="light"?"rgba(0, 0, 0, 0.42)":"rgba(255, 255, 255, 0.7)";return t.vars&&(n=`rgba(${t.vars.palette.common.onBackgroundChannel} / ${t.vars.opacity.inputUnderline})`),{"label + &":{marginTop:16},variants:[...Object.keys((t.vars??t).palette).filter(r=>(t.vars??t).palette[r].main).map(r=>({props:{color:r},style:{"&::after":{borderBottom:`2px solid ${(t.vars||t).palette[r].main}`}}})),{props:{disableUnderline:!1},style:{"&::after":{background:"red",left:0,bottom:0,content:'""',position:"absolute",right:0,transform:"scaleX(0)",transition:t.transitions.create("transform",{duration:t.transitions.duration.shorter,easing:t.transitions.easing.easeOut}),pointerEvents:"none"},[`&.${y2.focused}:after`]:{transform:"scaleX(1) translateX(0)"},[`&.${y2.error}`]:{"&:before, &:after":{borderBottomColor:(t.vars||t).palette.error.main}},"&::before":{borderBottom:`1px solid ${n}`,left:0,bottom:0,content:'"\\00a0"',position:"absolute",right:0,transition:t.transitions.create("border-bottom-color",{duration:t.transitions.duration.shorter}),pointerEvents:"none"},[`&:hover:not(.${y2.disabled}, .${y2.error}):before`]:{borderBottom:`2px solid ${(t.vars||t).palette.text.primary}`,"@media (hover: none)":{borderBottom:`1px solid ${n}`}},[`&.${y2.disabled}:before`]:{borderBottomStyle:"dotted"}}}]}}),xsn=t=>{const{classes:e,disableUnderline:n}=t,i=qe({root:["root",!n&&"underline"],input:["input"]},msn,e);return ve({},e,i)},uVe=D.forwardRef(function(e,n){const r=kn({props:e,name:"MuiPickersInput"}),{label:i,disableUnderline:o=!1,ownerState:s}=r,a=Rt(r,vsn),l=Fa(),c=ve({},r,s,l,{disableUnderline:o,color:(l==null?void 0:l.color)||"primary"}),u=xsn(c);return C.jsx(Tle,ve({slots:{root:ysn}},a,{label:i,classes:u,ref:n}))});uVe.muiName="Input";const bsn=["onFocus","onBlur","className","color","disabled","error","variant","required","InputProps","inputProps","inputRef","sectionListRef","elements","areAllSectionsEmpty","onClick","onKeyDown","onKeyUp","onPaste","onInput","endAdornment","startAdornment","tabIndex","contentEditable","focused","value","onChange","fullWidth","id","name","helperText","FormHelperTextProps","label","InputLabelProps"],wsn={standard:uVe,filled:cVe,outlined:lVe},_sn=be(Ug,{name:"MuiPickersTextField",slot:"Root",overridesResolver:(t,e)=>e.root})({}),Ssn=t=>{const{focused:e,disabled:n,classes:r,required:i}=t;return qe({root:["root",e&&!n&&"focused",n&&"disabled",i&&"required"]},Uon,r)},Csn=D.forwardRef(function(e,n){const r=kn({props:e,name:"MuiPickersTextField"}),{onFocus:i,onBlur:o,className:s,color:a="primary",disabled:l=!1,error:c=!1,variant:u="outlined",required:f=!1,InputProps:d,inputProps:h,inputRef:p,sectionListRef:g,elements:m,areAllSectionsEmpty:v,onClick:y,onKeyDown:x,onKeyUp:b,onPaste:w,onInput:_,endAdornment:S,startAdornment:O,tabIndex:k,contentEditable:E,focused:P,value:A,onChange:R,fullWidth:T,id:M,name:I,helperText:j,FormHelperTextProps:N,label:z,InputLabelProps:L}=r,B=Rt(r,bsn),F=D.useRef(null),$=dn(n,F),q=Jf(M),G=j&&q?`${q}-helper-text`:void 0,Y=z&&q?`${q}-label`:void 0,le=ve({},r,{color:a,disabled:l,error:c,focused:P,required:f,variant:u}),K=Ssn(le),ee=wsn[u];return C.jsxs(_sn,ve({className:Oe(K.root,s),ref:$,focused:P,onFocus:i,onBlur:o,disabled:l,variant:u,error:c,color:a,fullWidth:T,required:f,ownerState:le},B,{children:[C.jsx(Ly,ve({htmlFor:q,id:Y},L,{children:z})),C.jsx(ee,ve({elements:m,areAllSectionsEmpty:v,onClick:y,onKeyDown:x,onKeyUp:b,onInput:_,onPaste:w,endAdornment:S,startAdornment:O,tabIndex:k,contentEditable:E,value:A,onChange:R,id:q,fullWidth:T,inputProps:h,inputRef:p,sectionListRef:g,label:z,name:I,role:"group","aria-labelledby":Y},d)),j&&C.jsx(Uee,ve({id:G},N,{children:j}))]}))}),Osn=["enableAccessibleFieldDOMStructure"],Esn=["InputProps","readOnly"],Tsn=["onPaste","onKeyDown","inputMode","readOnly","InputProps","inputProps","inputRef"],ksn=t=>{let{enableAccessibleFieldDOMStructure:e}=t,n=Rt(t,Osn);if(e){const{InputProps:f,readOnly:d}=n,h=Rt(n,Esn);return ve({},h,{InputProps:ve({},f??{},{readOnly:d})})}const{onPaste:r,onKeyDown:i,inputMode:o,readOnly:s,InputProps:a,inputProps:l,inputRef:c}=n,u=Rt(n,Tsn);return ve({},u,{InputProps:ve({},a??{},{readOnly:s}),inputProps:ve({},l??{},{inputMode:o,onPaste:r,onKeyDown:i,ref:c})})},Asn=["slots","slotProps","InputProps","inputProps"],fVe=D.forwardRef(function(e,n){const r=kn({props:e,name:"MuiDateTimeField"}),{slots:i,slotProps:o,InputProps:s,inputProps:a}=r,l=Rt(r,Asn),c=r,u=(i==null?void 0:i.textField)??(e.enableAccessibleFieldDOMStructure?Csn:di),f=Zt({elementType:u,externalSlotProps:o==null?void 0:o.textField,externalForwardedProps:l,ownerState:c,additionalProps:{ref:n}});f.inputProps=ve({},a,f.inputProps),f.InputProps=ve({},s,f.InputProps);const d=Bon(f),h=ksn(d),p=$on(ve({},h,{slots:i,slotProps:o}));return C.jsx(u,ve({},p))});function Psn(t){return Ye("MuiDateTimePickerTabs",t)}He("MuiDateTimePickerTabs",["root"]);const Msn=t=>dC(t)?"date":"time",Rsn=t=>t==="date"?"day":"hours",Dsn=t=>{const{classes:e}=t;return qe({root:["root"]},Psn,e)},Isn=be(Xee,{name:"MuiDateTimePickerTabs",slot:"Root",overridesResolver:(t,e)=>e.root})(({theme:t})=>({boxShadow:`0 -1px 0 0 inset ${(t.vars||t).palette.divider}`,"&:last-child":{boxShadow:`0 1px 0 0 inset ${(t.vars||t).palette.divider}`,[`& .${o3.indicator}`]:{bottom:"auto",top:0}}})),Lsn=function(e){const n=kn({props:e,name:"MuiDateTimePickerTabs"}),{dateIcon:r=C.jsx(Mon,{}),onViewChange:i,timeIcon:o=C.jsx(Ron,{}),view:s,hidden:a=typeof window>"u"||window.innerHeight<667,className:l,sx:c}=n,u=Pl(),f=Dsn(n),d=(h,p)=>{i(Rsn(p))};return a?null:C.jsxs(Isn,{ownerState:n,variant:"fullWidth",value:Msn(s),onChange:d,className:Oe(l,f.root),sx:c,children:[C.jsx(SS,{value:"date","aria-label":u.dateTableLabel,icon:C.jsx(D.Fragment,{children:r})}),C.jsx(SS,{value:"time","aria-label":u.timeTableLabel,icon:C.jsx(D.Fragment,{children:o})})]})};function $sn(t){return Ye("MuiPickersToolbarText",t)}const NQ=He("MuiPickersToolbarText",["root","selected"]),Fsn=["className","selected","value"],Nsn=t=>{const{classes:e,selected:n}=t;return qe({root:["root",n&&"selected"]},$sn,e)},zsn=be(Jt,{name:"MuiPickersToolbarText",slot:"Root",overridesResolver:(t,e)=>[e.root,{[`&.${NQ.selected}`]:e.selected}]})(({theme:t})=>({transition:t.transitions.create("color"),color:(t.vars||t).palette.text.secondary,[`&.${NQ.selected}`]:{color:(t.vars||t).palette.text.primary}})),dVe=D.forwardRef(function(e,n){const r=kn({props:e,name:"MuiPickersToolbarText"}),{className:i,value:o}=r,s=Rt(r,Fsn),a=Nsn(r);return C.jsx(zsn,ve({ref:n,className:Oe(a.root,i),component:"span"},s,{children:o}))});function hVe(t){return Ye("MuiPickersToolbar",t)}const jsn=He("MuiPickersToolbar",["root","content"]),Bsn=["children","className","toolbarTitle","hidden","titleId","isLandscape","classes","landscapeDirection"],Usn=t=>{const{classes:e,isLandscape:n}=t;return qe({root:["root"],content:["content"],penIconButton:["penIconButton",n&&"penIconButtonLandscape"]},hVe,e)},Wsn=be("div",{name:"MuiPickersToolbar",slot:"Root",overridesResolver:(t,e)=>e.root})(({theme:t})=>({display:"flex",flexDirection:"column",alignItems:"flex-start",justifyContent:"space-between",padding:t.spacing(2,3),variants:[{props:{isLandscape:!0},style:{height:"auto",maxWidth:160,padding:16,justifyContent:"flex-start",flexWrap:"wrap"}}]})),Vsn=be("div",{name:"MuiPickersToolbar",slot:"Content",overridesResolver:(t,e)=>e.content})({display:"flex",flexWrap:"wrap",width:"100%",flex:1,justifyContent:"space-between",alignItems:"center",flexDirection:"row",variants:[{props:{isLandscape:!0},style:{justifyContent:"flex-start",alignItems:"flex-start",flexDirection:"column"}},{props:{isLandscape:!0,landscapeDirection:"row"},style:{flexDirection:"row"}}]}),Gsn=D.forwardRef(function(e,n){const r=kn({props:e,name:"MuiPickersToolbar"}),{children:i,className:o,toolbarTitle:s,hidden:a,titleId:l}=r,c=Rt(r,Bsn),u=r,f=Usn(u);return a?null:C.jsxs(Wsn,ve({ref:n,className:Oe(f.root,o),ownerState:u},c,{children:[C.jsx(Jt,{color:"text.secondary",variant:"overline",id:l,children:s}),C.jsx(Vsn,{className:f.content,ownerState:u,children:i})]}))}),Hsn=["align","className","selected","typographyClassName","value","variant","width"],qsn=t=>{const{classes:e}=t;return qe({root:["root"]},hVe,e)},Xsn=be(Vr,{name:"MuiPickersToolbarButton",slot:"Root",overridesResolver:(t,e)=>e.root})({padding:0,minWidth:16,textTransform:"none"}),vm=D.forwardRef(function(e,n){const r=kn({props:e,name:"MuiPickersToolbarButton"}),{align:i,className:o,selected:s,typographyClassName:a,value:l,variant:c,width:u}=r,f=Rt(r,Hsn),d=qsn(r);return C.jsx(Xsn,ve({variant:"text",ref:n,className:Oe(d.root,o)},u?{sx:{width:u}}:{},f,{children:C.jsx(dVe,{align:i,className:a,variant:c,value:l,selected:s})}))});function Ysn(t){return Ye("MuiDateTimePickerToolbar",t)}const X9=He("MuiDateTimePickerToolbar",["root","dateContainer","timeContainer","timeDigitsContainer","separator","timeLabelReverse","ampmSelection","ampmLandscape","ampmLabel"]);function Qsn(t,{disableFuture:e,maxDate:n,timezone:r}){const i=pr();return D.useMemo(()=>{const o=i.date(void 0,r),s=i.startOfMonth(e&&i.isBefore(o,n)?o:n);return!i.isAfter(s,t)},[e,n,t,i,r])}function Ksn(t,{disablePast:e,minDate:n,timezone:r}){const i=pr();return D.useMemo(()=>{const o=i.date(void 0,r),s=i.startOfMonth(e&&i.isAfter(o,n)?o:n);return!i.isBefore(s,t)},[e,n,t,i,r])}function kle(t,e,n,r){const i=pr(),o=Win(t,i),s=D.useCallback(a=>{const l=t==null?null:Vin(t,a,!!e,i);n(l,r??"partial")},[e,t,n,r,i]);return{meridiemMode:o,handleMeridiemChange:s}}const iP=36,_U=2,SU=320,Zsn=280,CU=336,pVe=232,TT=48,Jsn=["ampm","ampmInClock","value","onChange","view","isLandscape","onViewChange","toolbarFormat","toolbarPlaceholder","views","disabled","readOnly","toolbarVariant","toolbarTitle","className"],ean=t=>{const{classes:e,isLandscape:n,isRtl:r}=t;return qe({root:["root"],dateContainer:["dateContainer"],timeContainer:["timeContainer",r&&"timeLabelReverse"],timeDigitsContainer:["timeDigitsContainer",r&&"timeLabelReverse"],separator:["separator"],ampmSelection:["ampmSelection",n&&"ampmLandscape"],ampmLabel:["ampmLabel"]},Ysn,e)},tan=be(Gsn,{name:"MuiDateTimePickerToolbar",slot:"Root",overridesResolver:(t,e)=>e.root})(({theme:t})=>({paddingLeft:16,paddingRight:16,justifyContent:"space-around",position:"relative",variants:[{props:{toolbarVariant:"desktop"},style:{borderBottom:`1px solid ${(t.vars||t).palette.divider}`,[`& .${jsn.content} .${NQ.selected}`]:{color:(t.vars||t).palette.primary.main,fontWeight:t.typography.fontWeightBold}}},{props:{toolbarVariant:"desktop",isLandscape:!0},style:{borderRight:`1px solid ${(t.vars||t).palette.divider}`}},{props:{toolbarVariant:"desktop",isLandscape:!1},style:{paddingLeft:24,paddingRight:0}}]})),nan=be("div",{name:"MuiDateTimePickerToolbar",slot:"DateContainer",overridesResolver:(t,e)=>e.dateContainer})({display:"flex",flexDirection:"column",alignItems:"flex-start"}),ran=be("div",{name:"MuiDateTimePickerToolbar",slot:"TimeContainer",overridesResolver:(t,e)=>e.timeContainer})({display:"flex",flexDirection:"row",variants:[{props:{isRtl:!0},style:{flexDirection:"row-reverse"}},{props:{toolbarVariant:"desktop",isLandscape:!1},style:{gap:9,marginRight:4,alignSelf:"flex-end"}},{props:({isLandscape:t,toolbarVariant:e})=>t&&e!=="desktop",style:{flexDirection:"column"}},{props:({isLandscape:t,toolbarVariant:e,isRtl:n})=>t&&e!=="desktop"&&n,style:{flexDirection:"column-reverse"}}]}),ian=be("div",{name:"MuiDateTimePickerToolbar",slot:"TimeDigitsContainer",overridesResolver:(t,e)=>e.timeDigitsContainer})({display:"flex",variants:[{props:{isRtl:!0},style:{flexDirection:"row-reverse"}},{props:{toolbarVariant:"desktop"},style:{gap:1.5}}]}),Pbe=be(dVe,{name:"MuiDateTimePickerToolbar",slot:"Separator",overridesResolver:(t,e)=>e.separator})({margin:"0 4px 0 2px",cursor:"default",variants:[{props:{toolbarVariant:"desktop"},style:{margin:0}}]}),oan=be("div",{name:"MuiDateTimePickerToolbar",slot:"AmPmSelection",overridesResolver:(t,e)=>[{[`.${X9.ampmLabel}`]:e.ampmLabel},{[`&.${X9.ampmLandscape}`]:e.ampmLandscape},e.ampmSelection]})({display:"flex",flexDirection:"column",marginRight:"auto",marginLeft:12,[`& .${X9.ampmLabel}`]:{fontSize:17},variants:[{props:{isLandscape:!0},style:{margin:"4px 0 auto",flexDirection:"row",justifyContent:"space-around",width:"100%"}}]});function san(t){const e=kn({props:t,name:"MuiDateTimePickerToolbar"}),{ampm:n,ampmInClock:r,value:i,onChange:o,view:s,isLandscape:a,onViewChange:l,toolbarFormat:c,toolbarPlaceholder:u="––",views:f,disabled:d,readOnly:h,toolbarVariant:p="mobile",toolbarTitle:g,className:m}=e,v=Rt(e,Jsn),y=Ho(),x=ve({},e,{isRtl:y}),b=pr(),{meridiemMode:w,handleMeridiemChange:_}=kle(i,n,o),S=!!(n&&!r),O=p==="desktop",k=Pl(),E=ean(x),P=g??k.dateTimePickerToolbarTitle,A=T=>n?b.format(T,"hours12h"):b.format(T,"hours24h"),R=D.useMemo(()=>i?c?b.formatByString(i,c):b.format(i,"shortDate"):u,[i,c,u,b]);return C.jsxs(tan,ve({isLandscape:a,className:Oe(E.root,m),toolbarTitle:P},v,{ownerState:x,children:[C.jsxs(nan,{className:E.dateContainer,ownerState:x,children:[f.includes("year")&&C.jsx(vm,{tabIndex:-1,variant:"subtitle1",onClick:()=>l("year"),selected:s==="year",value:i?b.format(i,"year"):"–"}),f.includes("day")&&C.jsx(vm,{tabIndex:-1,variant:O?"h5":"h4",onClick:()=>l("day"),selected:s==="day",value:R})]}),C.jsxs(ran,{className:E.timeContainer,ownerState:x,children:[C.jsxs(ian,{className:E.timeDigitsContainer,ownerState:x,children:[f.includes("hours")&&C.jsxs(D.Fragment,{children:[C.jsx(vm,{variant:O?"h5":"h3",width:O&&!a?TT:void 0,onClick:()=>l("hours"),selected:s==="hours",value:i?A(i):"--"}),C.jsx(Pbe,{variant:O?"h5":"h3",value:":",className:E.separator,ownerState:x}),C.jsx(vm,{variant:O?"h5":"h3",width:O&&!a?TT:void 0,onClick:()=>l("minutes"),selected:s==="minutes"||!f.includes("minutes")&&s==="hours",value:i?b.format(i,"minutes"):"--",disabled:!f.includes("minutes")})]}),f.includes("seconds")&&C.jsxs(D.Fragment,{children:[C.jsx(Pbe,{variant:O?"h5":"h3",value:":",className:E.separator,ownerState:x}),C.jsx(vm,{variant:O?"h5":"h3",width:O&&!a?TT:void 0,onClick:()=>l("seconds"),selected:s==="seconds",value:i?b.format(i,"seconds"):"--"})]})]}),S&&!O&&C.jsxs(oan,{className:E.ampmSelection,ownerState:x,children:[C.jsx(vm,{variant:"subtitle2",selected:w==="am",typographyClassName:E.ampmLabel,value:Qp(b,"am"),onClick:h?void 0:()=>_("am"),disabled:d}),C.jsx(vm,{variant:"subtitle2",selected:w==="pm",typographyClassName:E.ampmLabel,value:Qp(b,"pm"),onClick:h?void 0:()=>_("pm"),disabled:d})]}),n&&O&&C.jsx(vm,{variant:"h5",onClick:()=>l("meridiem"),selected:s==="meridiem",value:i&&w?Qp(b,w):"--",width:TT})]})]}))}function gVe(t,e){var a;const n=pr(),r=eD(),i=kn({props:t,name:e}),o=i.ampm??n.is12HourCycleInCurrentLocale(),s=D.useMemo(()=>{var l;return((l=i.localeText)==null?void 0:l.toolbarTitle)==null?i.localeText:ve({},i.localeText,{dateTimePickerToolbarTitle:i.localeText.toolbarTitle})},[i.localeText]);return ve({},i,Nin({views:i.views,openTo:i.openTo,defaultViews:["year","day","hours","minutes"],defaultOpenTo:"day"}),{ampm:o,localeText:s,orientation:i.orientation??"portrait",disableIgnoringDatePartForTimeValidation:i.disableIgnoringDatePartForTimeValidation??!!(i.minDateTime||i.maxDateTime||i.disablePast||i.disableFuture),disableFuture:i.disableFuture??!1,disablePast:i.disablePast??!1,minDate:Du(n,i.minDateTime??i.minDate,r.minDate),maxDate:Du(n,i.maxDateTime??i.maxDate,r.maxDate),minTime:i.minDateTime??i.minTime,maxTime:i.maxDateTime??i.maxTime,slots:ve({toolbar:san,tabs:Lsn},i.slots),slotProps:ve({},i.slotProps,{toolbar:ve({ampm:o},(a=i.slotProps)==null?void 0:a.toolbar)})})}const mVe=({shouldDisableDate:t,shouldDisableMonth:e,shouldDisableYear:n,minDate:r,maxDate:i,disableFuture:o,disablePast:s,timezone:a})=>{const l=C1();return D.useCallback(c=>Cle({adapter:l,value:c,timezone:a,props:{shouldDisableDate:t,shouldDisableMonth:e,shouldDisableYear:n,minDate:r,maxDate:i,disableFuture:o,disablePast:s}})!==null,[l,t,e,n,r,i,o,s,a])},aan=(t,e,n)=>(r,i)=>{switch(i.type){case"changeMonth":return ve({},r,{slideDirection:i.direction,currentMonth:i.newMonth,isMonthSwitchingAnimating:!t});case"finishMonthSwitchingAnimation":return ve({},r,{isMonthSwitchingAnimating:!1});case"changeFocusedDay":{if(r.focusedDay!=null&&i.focusedDay!=null&&n.isSameDay(i.focusedDay,r.focusedDay))return r;const o=i.focusedDay!=null&&!e&&!n.isSameMonth(r.currentMonth,i.focusedDay);return ve({},r,{focusedDay:i.focusedDay,isMonthSwitchingAnimating:o&&!t&&!i.withoutMonthSwitchingAnimation,currentMonth:o?n.startOfMonth(i.focusedDay):r.currentMonth,slideDirection:i.focusedDay!=null&&n.isAfterDay(i.focusedDay,r.currentMonth)?"left":"right"})}default:throw new Error("missing support")}},lan=t=>{const{value:e,referenceDate:n,disableFuture:r,disablePast:i,disableSwitchToMonthOnDayFocus:o=!1,maxDate:s,minDate:a,onMonthChange:l,reduceAnimations:c,shouldDisableDate:u,timezone:f}=t,d=pr(),h=D.useRef(aan(!!c,o,d)).current,p=D.useMemo(()=>na.getInitialReferenceValue({value:e,utils:d,timezone:f,props:t,referenceDate:n,granularity:bf.day}),[]),[g,m]=D.useReducer(h,{isMonthSwitchingAnimating:!1,focusedDay:p,currentMonth:d.startOfMonth(p),slideDirection:"left"}),v=D.useCallback(_=>{m(ve({type:"changeMonth"},_)),l&&l(_.newMonth)},[l]),y=D.useCallback(_=>{const S=_;d.isSameMonth(S,g.currentMonth)||v({newMonth:d.startOfMonth(S),direction:d.isAfterDay(S,g.currentMonth)?"left":"right"})},[g.currentMonth,v,d]),x=mVe({shouldDisableDate:u,minDate:a,maxDate:s,disableFuture:r,disablePast:i,timezone:f}),b=D.useCallback(()=>{m({type:"finishMonthSwitchingAnimation"})},[]),w=st((_,S)=>{x(_)||m({type:"changeFocusedDay",focusedDay:_,withoutMonthSwitchingAnimation:S})});return{referenceDate:p,calendarState:g,changeMonth:y,changeFocusedDay:w,isDateDisabled:x,onMonthSwitchingAnimationEnd:b,handleChangeMonth:v}},can=t=>Ye("MuiPickersFadeTransitionGroup",t);He("MuiPickersFadeTransitionGroup",["root"]);const uan=t=>{const{classes:e}=t;return qe({root:["root"]},can,e)},fan=be(PM,{name:"MuiPickersFadeTransitionGroup",slot:"Root",overridesResolver:(t,e)=>e.root})({display:"block",position:"relative"});function vVe(t){const e=kn({props:t,name:"MuiPickersFadeTransitionGroup"}),{children:n,className:r,reduceAnimations:i,transKey:o}=e,s=uan(e),a=$a();return i?n:C.jsx(fan,{className:Oe(s.root,r),children:C.jsx(XC,{appear:!1,mountOnEnter:!0,unmountOnExit:!0,timeout:{appear:a.transitions.duration.enteringScreen,enter:a.transitions.duration.enteringScreen,exit:0},children:n},o)})}function dan(t){return Ye("MuiPickersDay",t)}const T0=He("MuiPickersDay",["root","dayWithMargin","dayOutsideMonth","hiddenDaySpacingFiller","today","selected","disabled"]),han=["autoFocus","className","day","disabled","disableHighlightToday","disableMargin","hidden","isAnimating","onClick","onDaySelect","onFocus","onBlur","onKeyDown","onMouseDown","onMouseEnter","outsideCurrentMonth","selected","showDaysOutsideCurrentMonth","children","today","isFirstVisibleCell","isLastVisibleCell"],pan=t=>{const{selected:e,disableMargin:n,disableHighlightToday:r,today:i,disabled:o,outsideCurrentMonth:s,showDaysOutsideCurrentMonth:a,classes:l}=t,c=s&&!a;return qe({root:["root",e&&!c&&"selected",o&&"disabled",!n&&"dayWithMargin",!r&&i&&"today",s&&a&&"dayOutsideMonth",c&&"hiddenDaySpacingFiller"],hiddenDaySpacingFiller:["hiddenDaySpacingFiller"]},dan,l)},yVe=({theme:t})=>ve({},t.typography.caption,{width:iP,height:iP,borderRadius:"50%",padding:0,backgroundColor:"transparent",transition:t.transitions.create("background-color",{duration:t.transitions.duration.short}),color:(t.vars||t).palette.text.primary,"@media (pointer: fine)":{"&:hover":{backgroundColor:t.vars?`rgba(${t.vars.palette.primary.mainChannel} / ${t.vars.palette.action.hoverOpacity})`:kt(t.palette.primary.main,t.palette.action.hoverOpacity)}},"&:focus":{backgroundColor:t.vars?`rgba(${t.vars.palette.primary.mainChannel} / ${t.vars.palette.action.focusOpacity})`:kt(t.palette.primary.main,t.palette.action.focusOpacity),[`&.${T0.selected}`]:{willChange:"background-color",backgroundColor:(t.vars||t).palette.primary.dark}},[`&.${T0.selected}`]:{color:(t.vars||t).palette.primary.contrastText,backgroundColor:(t.vars||t).palette.primary.main,fontWeight:t.typography.fontWeightMedium,"&:hover":{willChange:"background-color",backgroundColor:(t.vars||t).palette.primary.dark}},[`&.${T0.disabled}:not(.${T0.selected})`]:{color:(t.vars||t).palette.text.disabled},[`&.${T0.disabled}&.${T0.selected}`]:{opacity:.6},variants:[{props:{disableMargin:!1},style:{margin:`0 ${_U}px`}},{props:{outsideCurrentMonth:!0,showDaysOutsideCurrentMonth:!0},style:{color:(t.vars||t).palette.text.secondary}},{props:{disableHighlightToday:!1,today:!0},style:{[`&:not(.${T0.selected})`]:{border:`1px solid ${(t.vars||t).palette.text.secondary}`}}}]}),xVe=(t,e)=>{const{ownerState:n}=t;return[e.root,!n.disableMargin&&e.dayWithMargin,!n.disableHighlightToday&&n.today&&e.today,!n.outsideCurrentMonth&&n.showDaysOutsideCurrentMonth&&e.dayOutsideMonth,n.outsideCurrentMonth&&!n.showDaysOutsideCurrentMonth&&e.hiddenDaySpacingFiller]},gan=be(Nf,{name:"MuiPickersDay",slot:"Root",overridesResolver:xVe})(yVe),man=be("div",{name:"MuiPickersDay",slot:"Root",overridesResolver:xVe})(({theme:t})=>ve({},yVe({theme:t}),{opacity:0,pointerEvents:"none"})),x2=()=>{},van=D.forwardRef(function(e,n){const r=kn({props:e,name:"MuiPickersDay"}),{autoFocus:i=!1,className:o,day:s,disabled:a=!1,disableHighlightToday:l=!1,disableMargin:c=!1,isAnimating:u,onClick:f,onDaySelect:d,onFocus:h=x2,onBlur:p=x2,onKeyDown:g=x2,onMouseDown:m=x2,onMouseEnter:v=x2,outsideCurrentMonth:y,selected:x=!1,showDaysOutsideCurrentMonth:b=!1,children:w,today:_=!1}=r,S=Rt(r,han),O=ve({},r,{autoFocus:i,disabled:a,disableHighlightToday:l,disableMargin:c,selected:x,showDaysOutsideCurrentMonth:b,today:_}),k=pan(O),E=pr(),P=D.useRef(null),A=dn(P,n);Ti(()=>{i&&!a&&!u&&!y&&P.current.focus()},[i,a,u,y]);const R=M=>{m(M),y&&M.preventDefault()},T=M=>{a||d(s),y&&M.currentTarget.focus(),f&&f(M)};return y&&!b?C.jsx(man,{className:Oe(k.root,k.hiddenDaySpacingFiller,o),ownerState:O,role:S.role}):C.jsx(gan,ve({className:Oe(k.root,o),ref:A,centerRipple:!0,disabled:a,tabIndex:x?0:-1,onKeyDown:M=>g(M,s),onFocus:M=>h(M,s),onBlur:M=>p(M,s),onMouseEnter:M=>v(M,s),onClick:T,onMouseDown:R},S,{ownerState:O,children:w||E.format(s,"dayOfMonth")}))}),yan=D.memo(van),xan=t=>Ye("MuiPickersSlideTransition",t),jc=He("MuiPickersSlideTransition",["root","slideEnter-left","slideEnter-right","slideEnterActive","slideExit","slideExitActiveLeft-left","slideExitActiveLeft-right"]),ban=["children","className","reduceAnimations","slideDirection","transKey","classes"],wan=t=>{const{classes:e,slideDirection:n}=t,r={root:["root"],exit:["slideExit"],enterActive:["slideEnterActive"],enter:[`slideEnter-${n}`],exitActive:[`slideExitActiveLeft-${n}`]};return qe(r,xan,e)},_an=be(PM,{name:"MuiPickersSlideTransition",slot:"Root",overridesResolver:(t,e)=>[e.root,{[`.${jc["slideEnter-left"]}`]:e["slideEnter-left"]},{[`.${jc["slideEnter-right"]}`]:e["slideEnter-right"]},{[`.${jc.slideEnterActive}`]:e.slideEnterActive},{[`.${jc.slideExit}`]:e.slideExit},{[`.${jc["slideExitActiveLeft-left"]}`]:e["slideExitActiveLeft-left"]},{[`.${jc["slideExitActiveLeft-right"]}`]:e["slideExitActiveLeft-right"]}]})(({theme:t})=>{const e=t.transitions.create("transform",{duration:t.transitions.duration.complex,easing:"cubic-bezier(0.35, 0.8, 0.4, 1)"});return{display:"block",position:"relative",overflowX:"hidden","& > *":{position:"absolute",top:0,right:0,left:0},[`& .${jc["slideEnter-left"]}`]:{willChange:"transform",transform:"translate(100%)",zIndex:1},[`& .${jc["slideEnter-right"]}`]:{willChange:"transform",transform:"translate(-100%)",zIndex:1},[`& .${jc.slideEnterActive}`]:{transform:"translate(0%)",transition:e},[`& .${jc.slideExit}`]:{transform:"translate(0%)"},[`& .${jc["slideExitActiveLeft-left"]}`]:{willChange:"transform",transform:"translate(-100%)",transition:e,zIndex:0},[`& .${jc["slideExitActiveLeft-right"]}`]:{willChange:"transform",transform:"translate(100%)",transition:e,zIndex:0}}});function San(t){const e=kn({props:t,name:"MuiPickersSlideTransition"}),{children:n,className:r,reduceAnimations:i,transKey:o}=e,s=Rt(e,ban),a=wan(e),l=$a();if(i)return C.jsx("div",{className:Oe(a.root,r),children:n});const c={exit:a.exit,enterActive:a.enterActive,enter:a.enter,exitActive:a.exitActive};return C.jsx(_an,{className:Oe(a.root,r),childFactory:u=>D.cloneElement(u,{classNames:c}),role:"presentation",children:C.jsx(Aee,ve({mountOnEnter:!0,unmountOnExit:!0,timeout:l.transitions.duration.complex,classNames:c},s,{children:n}),o)})}const Can=t=>Ye("MuiDayCalendar",t);He("MuiDayCalendar",["root","header","weekDayLabel","loadingContainer","slideTransition","monthContainer","weekContainer","weekNumberLabel","weekNumber"]);const Oan=["parentProps","day","focusableDay","selectedDays","isDateDisabled","currentMonthNumber","isViewFocused"],Ean=["ownerState"],Tan=t=>{const{classes:e}=t;return qe({root:["root"],header:["header"],weekDayLabel:["weekDayLabel"],loadingContainer:["loadingContainer"],slideTransition:["slideTransition"],monthContainer:["monthContainer"],weekContainer:["weekContainer"],weekNumberLabel:["weekNumberLabel"],weekNumber:["weekNumber"]},Can,e)},bVe=(iP+_U*2)*6,kan=be("div",{name:"MuiDayCalendar",slot:"Root",overridesResolver:(t,e)=>e.root})({}),Aan=be("div",{name:"MuiDayCalendar",slot:"Header",overridesResolver:(t,e)=>e.header})({display:"flex",justifyContent:"center",alignItems:"center"}),Pan=be(Jt,{name:"MuiDayCalendar",slot:"WeekDayLabel",overridesResolver:(t,e)=>e.weekDayLabel})(({theme:t})=>({width:36,height:40,margin:"0 2px",textAlign:"center",display:"flex",justifyContent:"center",alignItems:"center",color:(t.vars||t).palette.text.secondary})),Man=be(Jt,{name:"MuiDayCalendar",slot:"WeekNumberLabel",overridesResolver:(t,e)=>e.weekNumberLabel})(({theme:t})=>({width:36,height:40,margin:"0 2px",textAlign:"center",display:"flex",justifyContent:"center",alignItems:"center",color:t.palette.text.disabled})),Ran=be(Jt,{name:"MuiDayCalendar",slot:"WeekNumber",overridesResolver:(t,e)=>e.weekNumber})(({theme:t})=>ve({},t.typography.caption,{width:iP,height:iP,padding:0,margin:`0 ${_U}px`,color:t.palette.text.disabled,fontSize:"0.75rem",alignItems:"center",justifyContent:"center",display:"inline-flex"})),Dan=be("div",{name:"MuiDayCalendar",slot:"LoadingContainer",overridesResolver:(t,e)=>e.loadingContainer})({display:"flex",justifyContent:"center",alignItems:"center",minHeight:bVe}),Ian=be(San,{name:"MuiDayCalendar",slot:"SlideTransition",overridesResolver:(t,e)=>e.slideTransition})({minHeight:bVe}),Lan=be("div",{name:"MuiDayCalendar",slot:"MonthContainer",overridesResolver:(t,e)=>e.monthContainer})({overflow:"hidden"}),$an=be("div",{name:"MuiDayCalendar",slot:"WeekContainer",overridesResolver:(t,e)=>e.weekContainer})({margin:`${_U}px 0`,display:"flex",justifyContent:"center"});function Fan(t){let{parentProps:e,day:n,focusableDay:r,selectedDays:i,isDateDisabled:o,currentMonthNumber:s,isViewFocused:a}=t,l=Rt(t,Oan);const{disabled:c,disableHighlightToday:u,isMonthSwitchingAnimating:f,showDaysOutsideCurrentMonth:d,slots:h,slotProps:p,timezone:g}=e,m=pr(),v=O1(g),y=r!==null&&m.isSameDay(n,r),x=i.some(A=>m.isSameDay(A,n)),b=m.isSameDay(n,v),w=(h==null?void 0:h.day)??yan,_=Zt({elementType:w,externalSlotProps:p==null?void 0:p.day,additionalProps:ve({disableHighlightToday:u,showDaysOutsideCurrentMonth:d,role:"gridcell",isAnimating:f,"data-timestamp":m.toJsDate(n).valueOf()},l),ownerState:ve({},e,{day:n,selected:x})}),S=Rt(_,Ean),O=D.useMemo(()=>c||o(n),[c,o,n]),k=D.useMemo(()=>m.getMonth(n)!==s,[m,n,s]),E=D.useMemo(()=>{const A=m.startOfMonth(m.setMonth(n,s));return d?m.isSameDay(n,m.startOfWeek(A)):m.isSameDay(n,A)},[s,n,d,m]),P=D.useMemo(()=>{const A=m.endOfMonth(m.setMonth(n,s));return d?m.isSameDay(n,m.endOfWeek(A)):m.isSameDay(n,A)},[s,n,d,m]);return C.jsx(w,ve({},S,{day:n,disabled:O,autoFocus:a&&y,today:b,outsideCurrentMonth:k,isFirstVisibleCell:E,isLastVisibleCell:P,selected:x,tabIndex:y?0:-1,"aria-selected":x,"aria-current":b?"date":void 0}))}function Nan(t){const e=kn({props:t,name:"MuiDayCalendar"}),n=pr(),{onFocusedDayChange:r,className:i,currentMonth:o,selectedDays:s,focusedDay:a,loading:l,onSelectedDaysChange:c,onMonthSwitchingAnimationEnd:u,readOnly:f,reduceAnimations:d,renderLoading:h=()=>C.jsx("span",{children:"..."}),slideDirection:p,TransitionProps:g,disablePast:m,disableFuture:v,minDate:y,maxDate:x,shouldDisableDate:b,shouldDisableMonth:w,shouldDisableYear:_,dayOfWeekFormatter:S=ne=>n.format(ne,"weekdayShort").charAt(0).toUpperCase(),hasFocus:O,onFocusedViewChange:k,gridLabelId:E,displayWeekNumber:P,fixedWeekNumber:A,autoFocus:R,timezone:T}=e,M=O1(T),I=Tan(e),j=Ho(),N=mVe({shouldDisableDate:b,shouldDisableMonth:w,shouldDisableYear:_,minDate:y,maxDate:x,disablePast:m,disableFuture:v,timezone:T}),z=Pl(),[L,B]=bc({name:"DayCalendar",state:"hasFocus",controlled:O,default:R??!1}),[F,$]=D.useState(()=>a||M),q=st(ne=>{f||c(ne)}),G=ne=>{N(ne)||(r(ne),$(ne),k==null||k(!0),B(!0))},Y=st((ne,V)=>{switch(ne.key){case"ArrowUp":G(n.addDays(V,-7)),ne.preventDefault();break;case"ArrowDown":G(n.addDays(V,7)),ne.preventDefault();break;case"ArrowLeft":{const X=n.addDays(V,j?1:-1),Z=n.addMonths(V,j?1:-1),he=_k({utils:n,date:X,minDate:j?X:n.startOfMonth(Z),maxDate:j?n.endOfMonth(Z):X,isDateDisabled:N,timezone:T});G(he||X),ne.preventDefault();break}case"ArrowRight":{const X=n.addDays(V,j?-1:1),Z=n.addMonths(V,j?-1:1),he=_k({utils:n,date:X,minDate:j?n.startOfMonth(Z):X,maxDate:j?X:n.endOfMonth(Z),isDateDisabled:N,timezone:T});G(he||X),ne.preventDefault();break}case"Home":G(n.startOfWeek(V)),ne.preventDefault();break;case"End":G(n.endOfWeek(V)),ne.preventDefault();break;case"PageUp":G(n.addMonths(V,1)),ne.preventDefault();break;case"PageDown":G(n.addMonths(V,-1)),ne.preventDefault();break}}),le=st((ne,V)=>G(V)),K=st((ne,V)=>{L&&n.isSameDay(F,V)&&(k==null||k(!1))}),ee=n.getMonth(o),re=n.getYear(o),ge=D.useMemo(()=>s.filter(ne=>!!ne).map(ne=>n.startOfDay(ne)),[n,s]),te=`${re}-${ee}`,ae=D.useMemo(()=>D.createRef(),[te]),U=D.useMemo(()=>{const ne=n.startOfMonth(o),V=n.endOfMonth(o);return N(F)||n.isAfterDay(F,V)||n.isBeforeDay(F,ne)?_k({utils:n,date:F,minDate:ne,maxDate:V,disablePast:m,disableFuture:v,isDateDisabled:N,timezone:T}):F},[o,v,m,F,N,n,T]),oe=D.useMemo(()=>{const ne=n.setTimezone(o,T),V=n.getWeekArray(ne);let X=n.addMonths(ne,1);for(;A&&V.length{V.lengthC.jsx(Pan,{variant:"caption",role:"columnheader","aria-label":n.format(ne,"weekday"),className:I.weekDayLabel,children:S(ne)},V.toString()))]}),l?C.jsx(Dan,{className:I.loadingContainer,children:h()}):C.jsx(Ian,ve({transKey:te,onExited:u,reduceAnimations:d,slideDirection:p,className:Oe(i,I.slideTransition)},g,{nodeRef:ae,children:C.jsx(Lan,{ref:ae,role:"rowgroup",className:I.monthContainer,children:oe.map((ne,V)=>C.jsxs($an,{role:"row",className:I.weekContainer,"aria-rowindex":V+1,children:[P&&C.jsx(Ran,{className:I.weekNumber,role:"rowheader","aria-label":z.calendarWeekNumberAriaLabelText(n.getWeekNumber(ne[0])),children:z.calendarWeekNumberText(n.getWeekNumber(ne[0]))}),ne.map((X,Z)=>C.jsx(Fan,{parentProps:e,day:X,selectedDays:ge,focusableDay:U,onKeyDown:Y,onFocus:le,onBlur:K,onDaySelect:q,isDateDisabled:N,currentMonthNumber:ee,isViewFocused:L,"aria-colindex":Z+1},X.toString()))]},`week-${ne[0]}`))})}))]})}function zan(t){return Ye("MuiPickersMonth",t)}const gL=He("MuiPickersMonth",["root","monthButton","disabled","selected"]),jan=["autoFocus","className","children","disabled","selected","value","tabIndex","onClick","onKeyDown","onFocus","onBlur","aria-current","aria-label","monthsPerRow","slots","slotProps"],Ban=t=>{const{disabled:e,selected:n,classes:r}=t;return qe({root:["root"],monthButton:["monthButton",e&&"disabled",n&&"selected"]},zan,r)},Uan=be("div",{name:"MuiPickersMonth",slot:"Root",overridesResolver:(t,e)=>[e.root]})({display:"flex",alignItems:"center",justifyContent:"center",flexBasis:"33.3%",variants:[{props:{monthsPerRow:4},style:{flexBasis:"25%"}}]}),Wan=be("button",{name:"MuiPickersMonth",slot:"MonthButton",overridesResolver:(t,e)=>[e.monthButton,{[`&.${gL.disabled}`]:e.disabled},{[`&.${gL.selected}`]:e.selected}]})(({theme:t})=>ve({color:"unset",backgroundColor:"transparent",border:0,outline:0},t.typography.subtitle1,{margin:"8px 0",height:36,width:72,borderRadius:18,cursor:"pointer","&:focus":{backgroundColor:t.vars?`rgba(${t.vars.palette.action.activeChannel} / ${t.vars.palette.action.hoverOpacity})`:kt(t.palette.action.active,t.palette.action.hoverOpacity)},"&:hover":{backgroundColor:t.vars?`rgba(${t.vars.palette.action.activeChannel} / ${t.vars.palette.action.hoverOpacity})`:kt(t.palette.action.active,t.palette.action.hoverOpacity)},"&:disabled":{cursor:"auto",pointerEvents:"none"},[`&.${gL.disabled}`]:{color:(t.vars||t).palette.text.secondary},[`&.${gL.selected}`]:{color:(t.vars||t).palette.primary.contrastText,backgroundColor:(t.vars||t).palette.primary.main,"&:focus, &:hover":{backgroundColor:(t.vars||t).palette.primary.dark}}})),Van=D.memo(function(e){const n=kn({props:e,name:"MuiPickersMonth"}),{autoFocus:r,className:i,children:o,disabled:s,selected:a,value:l,tabIndex:c,onClick:u,onKeyDown:f,onFocus:d,onBlur:h,"aria-current":p,"aria-label":g,slots:m,slotProps:v}=n,y=Rt(n,jan),x=D.useRef(null),b=Ban(n);Ti(()=>{var S;r&&((S=x.current)==null||S.focus())},[r]);const w=(m==null?void 0:m.monthButton)??Wan,_=Zt({elementType:w,externalSlotProps:v==null?void 0:v.monthButton,additionalProps:{children:o,disabled:s,tabIndex:c,ref:x,type:"button",role:"radio","aria-current":p,"aria-checked":a,"aria-label":g,onClick:S=>u(S,l),onKeyDown:S=>f(S,l),onFocus:S=>d(S,l),onBlur:S=>h(S,l)},ownerState:n,className:b.monthButton});return C.jsx(Uan,ve({className:Oe(b.root,i),ownerState:n},y,{children:C.jsx(w,ve({},_))}))});function Gan(t){return Ye("MuiMonthCalendar",t)}He("MuiMonthCalendar",["root"]);const Han=["className","value","defaultValue","referenceDate","disabled","disableFuture","disablePast","maxDate","minDate","onChange","shouldDisableMonth","readOnly","disableHighlightToday","autoFocus","onMonthFocus","hasFocus","onFocusedViewChange","monthsPerRow","timezone","gridLabelId","slots","slotProps"],qan=t=>{const{classes:e}=t;return qe({root:["root"]},Gan,e)};function Xan(t,e){const n=pr(),r=eD(),i=kn({props:t,name:e});return ve({disableFuture:!1,disablePast:!1},i,{minDate:Du(n,i.minDate,r.minDate),maxDate:Du(n,i.maxDate,r.maxDate)})}const Yan=be("div",{name:"MuiMonthCalendar",slot:"Root",overridesResolver:(t,e)=>e.root})({display:"flex",flexWrap:"wrap",alignContent:"stretch",padding:"0 4px",width:SU,boxSizing:"border-box"}),Qan=D.forwardRef(function(e,n){const r=Xan(e,"MuiMonthCalendar"),{className:i,value:o,defaultValue:s,referenceDate:a,disabled:l,disableFuture:c,disablePast:u,maxDate:f,minDate:d,onChange:h,shouldDisableMonth:p,readOnly:g,autoFocus:m=!1,onMonthFocus:v,hasFocus:y,onFocusedViewChange:x,monthsPerRow:b=3,timezone:w,gridLabelId:_,slots:S,slotProps:O}=r,k=Rt(r,Han),{value:E,handleValueChange:P,timezone:A}=HO({name:"MonthCalendar",timezone:w,value:o,defaultValue:s,onChange:h,valueManager:na}),R=O1(A),T=Ho(),M=pr(),I=D.useMemo(()=>na.getInitialReferenceValue({value:E,utils:M,props:r,timezone:A,referenceDate:a,granularity:bf.month}),[]),j=r,N=qan(j),z=D.useMemo(()=>M.getMonth(R),[M,R]),L=D.useMemo(()=>E!=null?M.getMonth(E):null,[E,M]),[B,F]=D.useState(()=>L||M.getMonth(I)),[$,q]=bc({name:"MonthCalendar",state:"hasFocus",controlled:y,default:m??!1}),G=st(te=>{q(te),x&&x(te)}),Y=D.useCallback(te=>{const ae=M.startOfMonth(u&&M.isAfter(R,d)?R:d),U=M.startOfMonth(c&&M.isBefore(R,f)?R:f),oe=M.startOfMonth(te);return M.isBefore(oe,ae)||M.isAfter(oe,U)?!0:p?p(oe):!1},[c,u,f,d,R,p,M]),le=st((te,ae)=>{if(g)return;const U=M.setMonth(E??I,ae);P(U)}),K=st(te=>{Y(M.setMonth(E??I,te))||(F(te),G(!0),v&&v(te))});D.useEffect(()=>{F(te=>L!==null&&te!==L?L:te)},[L]);const ee=st((te,ae)=>{switch(te.key){case"ArrowUp":K((12+ae-3)%12),te.preventDefault();break;case"ArrowDown":K((12+ae+3)%12),te.preventDefault();break;case"ArrowLeft":K((12+ae+(T?1:-1))%12),te.preventDefault();break;case"ArrowRight":K((12+ae+(T?-1:1))%12),te.preventDefault();break}}),re=st((te,ae)=>{K(ae)}),ge=st((te,ae)=>{B===ae&&G(!1)});return C.jsx(Yan,ve({ref:n,className:Oe(N.root,i),ownerState:j,role:"radiogroup","aria-labelledby":_},k,{children:ble(M,E??I).map(te=>{const ae=M.getMonth(te),U=M.format(te,"monthShort"),oe=M.format(te,"month"),ne=ae===L,V=l||Y(te);return C.jsx(Van,{selected:ne,value:ae,onClick:le,onKeyDown:ee,autoFocus:$&&ae===B,disabled:V,tabIndex:ae===B&&!V?0:-1,onFocus:re,onBlur:ge,"aria-current":z===ae?"date":void 0,"aria-label":oe,monthsPerRow:b,slots:S,slotProps:O,children:U},U)})}))});function Kan(t){return Ye("MuiPickersYear",t)}const mL=He("MuiPickersYear",["root","yearButton","selected","disabled"]),Zan=["autoFocus","className","children","disabled","selected","value","tabIndex","onClick","onKeyDown","onFocus","onBlur","aria-current","yearsPerRow","slots","slotProps"],Jan=t=>{const{disabled:e,selected:n,classes:r}=t;return qe({root:["root"],yearButton:["yearButton",e&&"disabled",n&&"selected"]},Kan,r)},eln=be("div",{name:"MuiPickersYear",slot:"Root",overridesResolver:(t,e)=>[e.root]})({display:"flex",alignItems:"center",justifyContent:"center",flexBasis:"33.3%",variants:[{props:{yearsPerRow:4},style:{flexBasis:"25%"}}]}),tln=be("button",{name:"MuiPickersYear",slot:"YearButton",overridesResolver:(t,e)=>[e.yearButton,{[`&.${mL.disabled}`]:e.disabled},{[`&.${mL.selected}`]:e.selected}]})(({theme:t})=>ve({color:"unset",backgroundColor:"transparent",border:0,outline:0},t.typography.subtitle1,{margin:"6px 0",height:36,width:72,borderRadius:18,cursor:"pointer","&:focus":{backgroundColor:t.vars?`rgba(${t.vars.palette.action.activeChannel} / ${t.vars.palette.action.focusOpacity})`:kt(t.palette.action.active,t.palette.action.focusOpacity)},"&:hover":{backgroundColor:t.vars?`rgba(${t.vars.palette.action.activeChannel} / ${t.vars.palette.action.hoverOpacity})`:kt(t.palette.action.active,t.palette.action.hoverOpacity)},"&:disabled":{cursor:"auto",pointerEvents:"none"},[`&.${mL.disabled}`]:{color:(t.vars||t).palette.text.secondary},[`&.${mL.selected}`]:{color:(t.vars||t).palette.primary.contrastText,backgroundColor:(t.vars||t).palette.primary.main,"&:focus, &:hover":{backgroundColor:(t.vars||t).palette.primary.dark}}})),nln=D.memo(function(e){const n=kn({props:e,name:"MuiPickersYear"}),{autoFocus:r,className:i,children:o,disabled:s,selected:a,value:l,tabIndex:c,onClick:u,onKeyDown:f,onFocus:d,onBlur:h,"aria-current":p,slots:g,slotProps:m}=n,v=Rt(n,Zan),y=D.useRef(null),x=Jan(n);Ti(()=>{var _;r&&((_=y.current)==null||_.focus())},[r]);const b=(g==null?void 0:g.yearButton)??tln,w=Zt({elementType:b,externalSlotProps:m==null?void 0:m.yearButton,additionalProps:{children:o,disabled:s,tabIndex:c,ref:y,type:"button",role:"radio","aria-current":p,"aria-checked":a,onClick:_=>u(_,l),onKeyDown:_=>f(_,l),onFocus:_=>d(_,l),onBlur:_=>h(_,l)},ownerState:n,className:x.yearButton});return C.jsx(eln,ve({className:Oe(x.root,i),ownerState:n},v,{children:C.jsx(b,ve({},w))}))});function rln(t){return Ye("MuiYearCalendar",t)}He("MuiYearCalendar",["root"]);const iln=["autoFocus","className","value","defaultValue","referenceDate","disabled","disableFuture","disablePast","maxDate","minDate","onChange","readOnly","shouldDisableYear","disableHighlightToday","onYearFocus","hasFocus","onFocusedViewChange","yearsOrder","yearsPerRow","timezone","gridLabelId","slots","slotProps"],oln=t=>{const{classes:e}=t;return qe({root:["root"]},rln,e)};function sln(t,e){const n=pr(),r=eD(),i=kn({props:t,name:e});return ve({disablePast:!1,disableFuture:!1},i,{yearsPerRow:i.yearsPerRow??3,minDate:Du(n,i.minDate,r.minDate),maxDate:Du(n,i.maxDate,r.maxDate)})}const aln=be("div",{name:"MuiYearCalendar",slot:"Root",overridesResolver:(t,e)=>e.root})({display:"flex",flexDirection:"row",flexWrap:"wrap",overflowY:"auto",height:"100%",padding:"0 4px",width:SU,maxHeight:Zsn,boxSizing:"border-box",position:"relative"}),lln=D.forwardRef(function(e,n){const r=sln(e,"MuiYearCalendar"),{autoFocus:i,className:o,value:s,defaultValue:a,referenceDate:l,disabled:c,disableFuture:u,disablePast:f,maxDate:d,minDate:h,onChange:p,readOnly:g,shouldDisableYear:m,onYearFocus:v,hasFocus:y,onFocusedViewChange:x,yearsOrder:b="asc",yearsPerRow:w,timezone:_,gridLabelId:S,slots:O,slotProps:k}=r,E=Rt(r,iln),{value:P,handleValueChange:A,timezone:R}=HO({name:"YearCalendar",timezone:_,value:s,defaultValue:a,onChange:p,valueManager:na}),T=O1(R),M=Ho(),I=pr(),j=D.useMemo(()=>na.getInitialReferenceValue({value:P,utils:I,props:r,timezone:R,referenceDate:l,granularity:bf.year}),[]),N=r,z=oln(N),L=D.useMemo(()=>I.getYear(T),[I,T]),B=D.useMemo(()=>P!=null?I.getYear(P):null,[P,I]),[F,$]=D.useState(()=>B||I.getYear(j)),[q,G]=bc({name:"YearCalendar",state:"hasFocus",controlled:y,default:i??!1}),Y=st(X=>{G(X),x&&x(X)}),le=D.useCallback(X=>{if(f&&I.isBeforeYear(X,T)||u&&I.isAfterYear(X,T)||h&&I.isBeforeYear(X,h)||d&&I.isAfterYear(X,d))return!0;if(!m)return!1;const Z=I.startOfYear(X);return m(Z)},[u,f,d,h,T,m,I]),K=st((X,Z)=>{if(g)return;const he=I.setYear(P??j,Z);A(he)}),ee=st(X=>{le(I.setYear(P??j,X))||($(X),Y(!0),v==null||v(X))});D.useEffect(()=>{$(X=>B!==null&&X!==B?B:X)},[B]);const re=b!=="desc"?w*1:w*-1,ge=M&&b==="asc"||!M&&b==="desc"?-1:1,te=st((X,Z)=>{switch(X.key){case"ArrowUp":ee(Z-re),X.preventDefault();break;case"ArrowDown":ee(Z+re),X.preventDefault();break;case"ArrowLeft":ee(Z-ge),X.preventDefault();break;case"ArrowRight":ee(Z+ge),X.preventDefault();break}}),ae=st((X,Z)=>{ee(Z)}),U=st((X,Z)=>{F===Z&&Y(!1)}),oe=D.useRef(null),ne=dn(n,oe);D.useEffect(()=>{if(i||oe.current===null)return;const X=oe.current.querySelector('[tabindex="0"]');if(!X)return;const Z=X.offsetHeight,he=X.offsetTop,xe=oe.current.clientHeight,H=oe.current.scrollTop,W=he+Z;Z>xe||he{const Z=I.getYear(X),he=Z===B,xe=c||le(X);return C.jsx(nln,{selected:he,value:Z,onClick:K,onKeyDown:te,autoFocus:q&&Z===F,disabled:xe,tabIndex:Z===F&&!xe?0:-1,onFocus:ae,onBlur:U,"aria-current":L===Z?"date":void 0,yearsPerRow:w,slots:O,slotProps:k,children:I.format(X,"year")},I.format(X,"year"))})}))});function tD({onChange:t,onViewChange:e,openTo:n,view:r,views:i,autoFocus:o,focusedView:s,onFocusedViewChange:a}){const l=D.useRef(n),c=D.useRef(i),u=D.useRef(i.includes(n)?n:i[0]),[f,d]=bc({name:"useViews",state:"view",controlled:r,default:u.current}),h=D.useRef(o?f:null),[p,g]=bc({name:"useViews",state:"focusedView",controlled:s,default:h.current});D.useEffect(()=>{(l.current&&l.current!==n||c.current&&c.current.some(S=>!i.includes(S)))&&(d(i.includes(n)?n:i[0]),c.current=i,l.current=n)},[n,d,f,i]);const m=i.indexOf(f),v=i[m-1]??null,y=i[m+1]??null,x=st((S,O)=>{g(O?S:k=>S===k?null:k),a==null||a(S,O)}),b=st(S=>{x(S,!0),S!==f&&(d(S),e&&e(S))}),w=st(()=>{y&&b(y)}),_=st((S,O,k)=>{const E=O==="finish",P=k?i.indexOf(k)Ye("MuiPickersCalendarHeader",t),uln=He("MuiPickersCalendarHeader",["root","labelContainer","label","switchViewButton","switchViewIcon"]);function fln(t){return Ye("MuiPickersArrowSwitcher",t)}He("MuiPickersArrowSwitcher",["root","spacer","button","previousIconButton","nextIconButton","leftArrowIcon","rightArrowIcon"]);const dln=["children","className","slots","slotProps","isNextDisabled","isNextHidden","onGoToNext","nextLabel","isPreviousDisabled","isPreviousHidden","onGoToPrevious","previousLabel","labelId"],hln=["ownerState"],pln=["ownerState"],gln=be("div",{name:"MuiPickersArrowSwitcher",slot:"Root",overridesResolver:(t,e)=>e.root})({display:"flex"}),mln=be("div",{name:"MuiPickersArrowSwitcher",slot:"Spacer",overridesResolver:(t,e)=>e.spacer})(({theme:t})=>({width:t.spacing(3)})),Mbe=be(Ht,{name:"MuiPickersArrowSwitcher",slot:"Button",overridesResolver:(t,e)=>e.button})({variants:[{props:{hidden:!0},style:{visibility:"hidden"}}]}),vln=t=>{const{classes:e}=t;return qe({root:["root"],spacer:["spacer"],button:["button"],previousIconButton:["previousIconButton"],nextIconButton:["nextIconButton"],leftArrowIcon:["leftArrowIcon"],rightArrowIcon:["rightArrowIcon"]},fln,e)},wVe=D.forwardRef(function(e,n){const r=Ho(),i=kn({props:e,name:"MuiPickersArrowSwitcher"}),{children:o,className:s,slots:a,slotProps:l,isNextDisabled:c,isNextHidden:u,onGoToNext:f,nextLabel:d,isPreviousDisabled:h,isPreviousHidden:p,onGoToPrevious:g,previousLabel:m,labelId:v}=i,y=Rt(i,dln),x=i,b=vln(x),w={isDisabled:c,isHidden:u,goTo:f,label:d},_={isDisabled:h,isHidden:p,goTo:g,label:m},S=(a==null?void 0:a.previousIconButton)??Mbe,O=Zt({elementType:S,externalSlotProps:l==null?void 0:l.previousIconButton,additionalProps:{size:"medium",title:_.label,"aria-label":_.label,disabled:_.isDisabled,edge:"end",onClick:_.goTo},ownerState:ve({},x,{hidden:_.isHidden}),className:Oe(b.button,b.previousIconButton)}),k=(a==null?void 0:a.nextIconButton)??Mbe,E=Zt({elementType:k,externalSlotProps:l==null?void 0:l.nextIconButton,additionalProps:{size:"medium",title:w.label,"aria-label":w.label,disabled:w.isDisabled,edge:"start",onClick:w.goTo},ownerState:ve({},x,{hidden:w.isHidden}),className:Oe(b.button,b.nextIconButton)}),P=(a==null?void 0:a.leftArrowIcon)??kon,A=Zt({elementType:P,externalSlotProps:l==null?void 0:l.leftArrowIcon,additionalProps:{fontSize:"inherit"},ownerState:x,className:b.leftArrowIcon}),R=Rt(A,hln),T=(a==null?void 0:a.rightArrowIcon)??Aon,M=Zt({elementType:T,externalSlotProps:l==null?void 0:l.rightArrowIcon,additionalProps:{fontSize:"inherit"},ownerState:x,className:b.rightArrowIcon}),I=Rt(M,pln);return C.jsxs(gln,ve({ref:n,className:Oe(b.root,s),ownerState:x},y,{children:[C.jsx(S,ve({},O,{children:r?C.jsx(T,ve({},I)):C.jsx(P,ve({},R))})),o?C.jsx(Jt,{variant:"subtitle1",component:"span",id:v,children:o}):C.jsx(mln,{className:b.spacer,ownerState:x}),C.jsx(k,ve({},E,{children:r?C.jsx(P,ve({},R)):C.jsx(T,ve({},I))}))]}))}),yln=["slots","slotProps","currentMonth","disabled","disableFuture","disablePast","maxDate","minDate","onMonthChange","onViewChange","view","reduceAnimations","views","labelId","className","timezone","format"],xln=["ownerState"],bln=t=>{const{classes:e}=t;return qe({root:["root"],labelContainer:["labelContainer"],label:["label"],switchViewButton:["switchViewButton"],switchViewIcon:["switchViewIcon"]},cln,e)},wln=be("div",{name:"MuiPickersCalendarHeader",slot:"Root",overridesResolver:(t,e)=>e.root})({display:"flex",alignItems:"center",marginTop:12,marginBottom:4,paddingLeft:24,paddingRight:12,maxHeight:40,minHeight:40}),_ln=be("div",{name:"MuiPickersCalendarHeader",slot:"LabelContainer",overridesResolver:(t,e)=>e.labelContainer})(({theme:t})=>ve({display:"flex",overflow:"hidden",alignItems:"center",cursor:"pointer",marginRight:"auto"},t.typography.body1,{fontWeight:t.typography.fontWeightMedium})),Sln=be("div",{name:"MuiPickersCalendarHeader",slot:"Label",overridesResolver:(t,e)=>e.label})({marginRight:6}),Cln=be(Ht,{name:"MuiPickersCalendarHeader",slot:"SwitchViewButton",overridesResolver:(t,e)=>e.switchViewButton})({marginRight:"auto",variants:[{props:{view:"year"},style:{[`.${uln.switchViewIcon}`]:{transform:"rotate(180deg)"}}}]}),Oln=be(Ton,{name:"MuiPickersCalendarHeader",slot:"SwitchViewIcon",overridesResolver:(t,e)=>e.switchViewIcon})(({theme:t})=>({willChange:"transform",transition:t.transitions.create("transform"),transform:"rotate(0deg)"})),Eln=D.forwardRef(function(e,n){const r=Pl(),i=pr(),o=kn({props:e,name:"MuiPickersCalendarHeader"}),{slots:s,slotProps:a,currentMonth:l,disabled:c,disableFuture:u,disablePast:f,maxDate:d,minDate:h,onMonthChange:p,onViewChange:g,view:m,reduceAnimations:v,views:y,labelId:x,className:b,timezone:w,format:_=`${i.formats.month} ${i.formats.year}`}=o,S=Rt(o,yln),O=o,k=bln(o),E=(s==null?void 0:s.switchViewButton)??Cln,P=Zt({elementType:E,externalSlotProps:a==null?void 0:a.switchViewButton,additionalProps:{size:"small","aria-label":r.calendarViewSwitchingButtonAriaLabel(m)},ownerState:O,className:k.switchViewButton}),A=(s==null?void 0:s.switchViewIcon)??Oln,R=Zt({elementType:A,externalSlotProps:a==null?void 0:a.switchViewIcon,ownerState:O,className:k.switchViewIcon}),T=Rt(R,xln),M=()=>p(i.addMonths(l,1),"left"),I=()=>p(i.addMonths(l,-1),"right"),j=Qsn(l,{disableFuture:u,maxDate:d,timezone:w}),N=Ksn(l,{disablePast:f,minDate:h,timezone:w}),z=()=>{if(!(y.length===1||!g||c))if(y.length===2)g(y.find(B=>B!==m)||y[0]);else{const B=y.indexOf(m)!==0?0:1;g(y[B])}};if(y.length===1&&y[0]==="year")return null;const L=i.formatByString(l,_);return C.jsxs(wln,ve({},S,{ownerState:O,className:Oe(k.root,b),ref:n,children:[C.jsxs(_ln,{role:"presentation",onClick:z,ownerState:O,"aria-live":"polite",className:k.labelContainer,children:[C.jsx(vVe,{reduceAnimations:v,transKey:L,children:C.jsx(Sln,{id:x,ownerState:O,className:k.label,children:L})}),y.length>1&&!c&&C.jsx(E,ve({},P,{children:C.jsx(A,ve({},T))}))]}),C.jsx(XC,{in:m==="day",children:C.jsx(wVe,{slots:s,slotProps:a,onGoToPrevious:I,isPreviousDisabled:N,previousLabel:r.previousMonth,onGoToNext:M,isNextDisabled:j,nextLabel:r.nextMonth})})]}))}),OU=be("div")({overflow:"hidden",width:SU,maxHeight:CU,display:"flex",flexDirection:"column",margin:"0 auto"}),Tln="@media (prefers-reduced-motion: reduce)",q_=typeof navigator<"u"&&navigator.userAgent.match(/android\s(\d+)|OS\s(\d+)/i),Rbe=q_&&q_[1]?parseInt(q_[1],10):null,Dbe=q_&&q_[2]?parseInt(q_[2],10):null,kln=Rbe&&Rbe<10||Dbe&&Dbe<13||!1,_Ve=()=>OAe(Tln,{defaultMatches:!1})||kln,Aln=t=>Ye("MuiDateCalendar",t);He("MuiDateCalendar",["root","viewTransitionContainer"]);const Pln=["autoFocus","onViewChange","value","defaultValue","referenceDate","disableFuture","disablePast","onChange","onYearChange","onMonthChange","reduceAnimations","shouldDisableDate","shouldDisableMonth","shouldDisableYear","view","views","openTo","className","disabled","readOnly","minDate","maxDate","disableHighlightToday","focusedView","onFocusedViewChange","showDaysOutsideCurrentMonth","fixedWeekNumber","dayOfWeekFormatter","slots","slotProps","loading","renderLoading","displayWeekNumber","yearsOrder","yearsPerRow","monthsPerRow","timezone"],Mln=t=>{const{classes:e}=t;return qe({root:["root"],viewTransitionContainer:["viewTransitionContainer"]},Aln,e)};function Rln(t,e){const n=pr(),r=eD(),i=_Ve(),o=kn({props:t,name:e});return ve({},o,{loading:o.loading??!1,disablePast:o.disablePast??!1,disableFuture:o.disableFuture??!1,openTo:o.openTo??"day",views:o.views??["year","day"],reduceAnimations:o.reduceAnimations??i,renderLoading:o.renderLoading??(()=>C.jsx("span",{children:"..."})),minDate:Du(n,o.minDate,r.minDate),maxDate:Du(n,o.maxDate,r.maxDate)})}const Dln=be(OU,{name:"MuiDateCalendar",slot:"Root",overridesResolver:(t,e)=>e.root})({display:"flex",flexDirection:"column",height:CU}),Iln=be(vVe,{name:"MuiDateCalendar",slot:"ViewTransitionContainer",overridesResolver:(t,e)=>e.viewTransitionContainer})({}),Lln=D.forwardRef(function(e,n){const r=pr(),i=Jf(),o=Rln(e,"MuiDateCalendar"),{autoFocus:s,onViewChange:a,value:l,defaultValue:c,referenceDate:u,disableFuture:f,disablePast:d,onChange:h,onYearChange:p,onMonthChange:g,reduceAnimations:m,shouldDisableDate:v,shouldDisableMonth:y,shouldDisableYear:x,view:b,views:w,openTo:_,className:S,disabled:O,readOnly:k,minDate:E,maxDate:P,disableHighlightToday:A,focusedView:R,onFocusedViewChange:T,showDaysOutsideCurrentMonth:M,fixedWeekNumber:I,dayOfWeekFormatter:j,slots:N,slotProps:z,loading:L,renderLoading:B,displayWeekNumber:F,yearsOrder:$,yearsPerRow:q,monthsPerRow:G,timezone:Y}=o,le=Rt(o,Pln),{value:K,handleValueChange:ee,timezone:re}=HO({name:"DateCalendar",timezone:Y,value:l,defaultValue:c,onChange:h,valueManager:na}),{view:ge,setView:te,focusedView:ae,setFocusedView:U,goToNextView:oe,setValueAndGoToNextView:ne}=tD({view:b,views:w,openTo:_,onChange:ee,onViewChange:a,autoFocus:s,focusedView:R,onFocusedViewChange:T}),{referenceDate:V,calendarState:X,changeFocusedDay:Z,changeMonth:he,handleChangeMonth:xe,isDateDisabled:H,onMonthSwitchingAnimationEnd:W}=lan({value:K,referenceDate:u,reduceAnimations:m,onMonthChange:g,minDate:E,maxDate:P,shouldDisableDate:v,disablePast:d,disableFuture:f,timezone:re}),J=O&&K||E,se=O&&K||P,ye=`${i}-grid-label`,ie=ae!==null,fe=(N==null?void 0:N.calendarHeader)??Eln,Q=Zt({elementType:fe,externalSlotProps:z==null?void 0:z.calendarHeader,additionalProps:{views:w,view:ge,currentMonth:X.currentMonth,onViewChange:te,onMonthChange:(Se,Xe)=>xe({newMonth:Se,direction:Xe}),minDate:J,maxDate:se,disabled:O,disablePast:d,disableFuture:f,reduceAnimations:m,timezone:re,labelId:ye},ownerState:o}),_e=st(Se=>{const Xe=r.startOfMonth(Se),tt=r.endOfMonth(Se),ut=H(Se)?_k({utils:r,date:Se,minDate:r.isBefore(E,Xe)?Xe:E,maxDate:r.isAfter(P,tt)?tt:P,disablePast:d,disableFuture:f,isDateDisabled:H,timezone:re}):Se;ut?(ne(ut,"finish"),g==null||g(Xe)):(oe(),he(Xe)),Z(ut,!0)}),we=st(Se=>{const Xe=r.startOfYear(Se),tt=r.endOfYear(Se),ut=H(Se)?_k({utils:r,date:Se,minDate:r.isBefore(E,Xe)?Xe:E,maxDate:r.isAfter(P,tt)?tt:P,disablePast:d,disableFuture:f,isDateDisabled:H,timezone:re}):Se;ut?(ne(ut,"finish"),p==null||p(ut)):(oe(),he(Xe)),Z(ut,!0)}),Ie=st(Se=>ee(Se&&Y5(r,Se,K??V),"finish",ge));D.useEffect(()=>{K!=null&&r.isValid(K)&&he(K)},[K]);const Pe=o,Me=Mln(Pe),Te={disablePast:d,disableFuture:f,maxDate:P,minDate:E},Le={disableHighlightToday:A,readOnly:k,disabled:O,timezone:re,gridLabelId:ye,slots:N,slotProps:z},ue=D.useRef(ge);D.useEffect(()=>{ue.current!==ge&&(ae===ue.current&&U(ge,!0),ue.current=ge)},[ae,U,ge]);const $e=D.useMemo(()=>[K],[K]);return C.jsxs(Dln,ve({ref:n,className:Oe(Me.root,S),ownerState:Pe},le,{children:[C.jsx(fe,ve({},Q,{slots:N,slotProps:z})),C.jsx(Iln,{reduceAnimations:m,className:Me.viewTransitionContainer,transKey:ge,ownerState:Pe,children:C.jsxs("div",{children:[ge==="year"&&C.jsx(lln,ve({},Te,Le,{value:K,onChange:we,shouldDisableYear:x,hasFocus:ie,onFocusedViewChange:Se=>U("year",Se),yearsOrder:$,yearsPerRow:q,referenceDate:V})),ge==="month"&&C.jsx(Qan,ve({},Te,Le,{hasFocus:ie,className:S,value:K,onChange:_e,shouldDisableMonth:y,onFocusedViewChange:Se=>U("month",Se),monthsPerRow:G,referenceDate:V})),ge==="day"&&C.jsx(Nan,ve({},X,Te,Le,{onMonthSwitchingAnimationEnd:W,onFocusedDayChange:Z,reduceAnimations:m,selectedDays:$e,onSelectedDaysChange:Ie,shouldDisableDate:v,shouldDisableMonth:y,shouldDisableYear:x,hasFocus:ie,onFocusedViewChange:Se=>U("day",Se),showDaysOutsideCurrentMonth:M,fixedWeekNumber:I,dayOfWeekFormatter:j,displayWeekNumber:F,loading:L,renderLoading:B}))]})})]}))}),X_=({view:t,onViewChange:e,views:n,focusedView:r,onFocusedViewChange:i,value:o,defaultValue:s,referenceDate:a,onChange:l,className:c,classes:u,disableFuture:f,disablePast:d,minDate:h,maxDate:p,shouldDisableDate:g,shouldDisableMonth:m,shouldDisableYear:v,reduceAnimations:y,onMonthChange:x,monthsPerRow:b,onYearChange:w,yearsOrder:_,yearsPerRow:S,slots:O,slotProps:k,loading:E,renderLoading:P,disableHighlightToday:A,readOnly:R,disabled:T,showDaysOutsideCurrentMonth:M,dayOfWeekFormatter:I,sx:j,autoFocus:N,fixedWeekNumber:z,displayWeekNumber:L,timezone:B})=>C.jsx(Lln,{view:t,onViewChange:e,views:n.filter(dC),focusedView:r&&dC(r)?r:null,onFocusedViewChange:i,value:o,defaultValue:s,referenceDate:a,onChange:l,className:c,classes:u,disableFuture:f,disablePast:d,minDate:h,maxDate:p,shouldDisableDate:g,shouldDisableMonth:m,shouldDisableYear:v,reduceAnimations:y,onMonthChange:x,monthsPerRow:b,onYearChange:w,yearsOrder:_,yearsPerRow:S,slots:O,slotProps:k,loading:E,renderLoading:P,disableHighlightToday:A,readOnly:R,disabled:T,showDaysOutsideCurrentMonth:M,dayOfWeekFormatter:I,sx:j,autoFocus:N,fixedWeekNumber:z,displayWeekNumber:L,timezone:B});function $ln(t){return Ye("MuiPickersPopper",t)}He("MuiPickersPopper",["root","paper"]);const Fln=["PaperComponent","popperPlacement","ownerState","children","paperSlotProps","paperClasses","onPaperClick","onPaperTouchStart"],Nln=t=>{const{classes:e}=t;return qe({root:["root"],paper:["paper"]},$ln,e)},zln=be(zee,{name:"MuiPickersPopper",slot:"Root",overridesResolver:(t,e)=>e.root})(({theme:t})=>({zIndex:t.zIndex.modal})),jln=be(Tl,{name:"MuiPickersPopper",slot:"Paper",overridesResolver:(t,e)=>e.paper})({outline:0,transformOrigin:"top center",variants:[{props:({placement:t})=>["top","top-start","top-end"].includes(t),style:{transformOrigin:"bottom center"}}]});function Bln(t,e){return e.documentElement.clientWidth{if(!t)return;function l(){o.current=!0}return document.addEventListener("mousedown",l,!0),document.addEventListener("touchstart",l,!0),()=>{document.removeEventListener("mousedown",l,!0),document.removeEventListener("touchstart",l,!0),o.current=!1}},[t]);const s=st(l=>{if(!o.current)return;const c=r.current;r.current=!1;const u=vi(i.current);if(!i.current||"clientX"in l&&Bln(l,u))return;if(n.current){n.current=!1;return}let f;l.composedPath?f=l.composedPath().indexOf(i.current)>-1:f=!u.documentElement.contains(l.target)||i.current.contains(l.target),!f&&!c&&e(l)}),a=()=>{r.current=!0};return D.useEffect(()=>{if(t){const l=vi(i.current),c=()=>{n.current=!0};return l.addEventListener("touchstart",s),l.addEventListener("touchmove",c),()=>{l.removeEventListener("touchstart",s),l.removeEventListener("touchmove",c)}}},[t,s]),D.useEffect(()=>{if(t){const l=vi(i.current);return l.addEventListener("click",s),()=>{l.removeEventListener("click",s),r.current=!1}}},[t,s]),[i,a,a]}const Wln=D.forwardRef((t,e)=>{const{PaperComponent:n,popperPlacement:r,ownerState:i,children:o,paperSlotProps:s,paperClasses:a,onPaperClick:l,onPaperTouchStart:c}=t,u=Rt(t,Fln),f=ve({},i,{placement:r}),d=Zt({elementType:n,externalSlotProps:s,additionalProps:{tabIndex:-1,elevation:8,ref:e},className:a,ownerState:f});return C.jsx(n,ve({},u,d,{onClick:h=>{var p;l(h),(p=d.onClick)==null||p.call(d,h)},onTouchStart:h=>{var p;c(h),(p=d.onTouchStart)==null||p.call(d,h)},ownerState:f,children:o}))});function Vln(t){const e=kn({props:t,name:"MuiPickersPopper"}),{anchorEl:n,children:r,containerRef:i=null,shouldRestoreFocus:o,onBlur:s,onDismiss:a,open:l,role:c,placement:u,slots:f,slotProps:d,reduceAnimations:h}=e;D.useEffect(()=>{function M(I){l&&I.key==="Escape"&&a()}return document.addEventListener("keydown",M),()=>{document.removeEventListener("keydown",M)}},[a,l]);const p=D.useRef(null);D.useEffect(()=>{c==="tooltip"||o&&!o()||(l?p.current=Qa(document):p.current&&p.current instanceof HTMLElement&&setTimeout(()=>{p.current instanceof HTMLElement&&p.current.focus()}))},[l,c,o]);const[g,m,v]=Uln(l,s??a),y=D.useRef(null),x=dn(y,i),b=dn(x,g),w=e,_=Nln(w),S=_Ve(),O=h??S,k=M=>{M.key==="Escape"&&(M.stopPropagation(),a())},E=(f==null?void 0:f.desktopTransition)??O?XC:nb,P=(f==null?void 0:f.desktopTrapFocus)??dPe,A=(f==null?void 0:f.desktopPaper)??jln,R=(f==null?void 0:f.popper)??zln,T=Zt({elementType:R,externalSlotProps:d==null?void 0:d.popper,additionalProps:{transition:!0,role:c,open:l,anchorEl:n,placement:u,onKeyDown:k},className:_.root,ownerState:e});return C.jsx(R,ve({},T,{children:({TransitionProps:M,placement:I})=>C.jsx(P,ve({open:l,disableAutoFocus:!0,disableRestoreFocus:!0,disableEnforceFocus:c==="tooltip",isEnabled:()=>!0},d==null?void 0:d.desktopTrapFocus,{children:C.jsx(E,ve({},M,d==null?void 0:d.desktopTransition,{children:C.jsx(Wln,{PaperComponent:A,ownerState:w,popperPlacement:I,ref:b,onPaperClick:m,onPaperTouchStart:v,paperClasses:_.paper,paperSlotProps:d==null?void 0:d.desktopPaper,children:r})}))}))}))}const Gln=({open:t,onOpen:e,onClose:n})=>{const r=D.useRef(typeof t=="boolean").current,[i,o]=D.useState(!1);D.useEffect(()=>{if(r){if(typeof t!="boolean")throw new Error("You must not mix controlling and uncontrolled mode for `open` prop");o(t)}},[r,t]);const s=D.useCallback(a=>{r||o(a),a&&e&&e(),!a&&n&&n()},[r,e,n]);return{isOpen:i,setIsOpen:s}},Hln=t=>{const{action:e,hasChanged:n,dateState:r,isControlled:i}=t,o=!i&&!r.hasBeenModifiedSinceMount;return e.name==="setValueFromField"?!0:e.name==="setValueFromAction"?o&&["accept","today","clear"].includes(e.pickerAction)?!0:n(r.lastPublishedValue):e.name==="setValueFromView"&&e.selectionState!=="shallow"||e.name==="setValueFromShortcut"?o?!0:n(r.lastPublishedValue):!1},qln=t=>{const{action:e,hasChanged:n,dateState:r,isControlled:i,closeOnSelect:o}=t,s=!i&&!r.hasBeenModifiedSinceMount;return e.name==="setValueFromAction"?s&&["accept","today","clear"].includes(e.pickerAction)?!0:n(r.lastCommittedValue):e.name==="setValueFromView"&&e.selectionState==="finish"&&o?s?!0:n(r.lastCommittedValue):e.name==="setValueFromShortcut"?e.changeImportance==="accept"&&n(r.lastCommittedValue):!1},Xln=t=>{const{action:e,closeOnSelect:n}=t;return e.name==="setValueFromAction"?!0:e.name==="setValueFromView"?e.selectionState==="finish"&&n:e.name==="setValueFromShortcut"?e.changeImportance==="accept":!1},Yln=({props:t,valueManager:e,valueType:n,wrapperVariant:r,validator:i})=>{const{onAccept:o,onChange:s,value:a,defaultValue:l,closeOnSelect:c=r==="desktop",timezone:u}=t,{current:f}=D.useRef(l),{current:d}=D.useRef(a!==void 0),h=pr(),p=C1(),{isOpen:g,setIsOpen:m}=Gln(t),{timezone:v,value:y,handleValueChange:x}=Ole({timezone:u,value:a,defaultValue:f,onChange:s,valueManager:e}),[b,w]=D.useState(()=>{let G;return y!==void 0?G=y:f!==void 0?G=f:G=e.emptyValue,{draft:G,lastPublishedValue:G,lastCommittedValue:G,lastControlledValue:y,hasBeenModifiedSinceMount:!1}}),{getValidationErrorForNewValue:_}=nVe({props:t,validator:i,timezone:v,value:b.draft,onError:t.onError}),S=st(G=>{const Y={action:G,dateState:b,hasChanged:te=>!e.areValuesEqual(h,G.value,te),isControlled:d,closeOnSelect:c},le=Hln(Y),K=qln(Y),ee=Xln(Y);w(te=>ve({},te,{draft:G.value,lastPublishedValue:le?G.value:te.lastPublishedValue,lastCommittedValue:K?G.value:te.lastCommittedValue,hasBeenModifiedSinceMount:!0}));let re=null;const ge=()=>(re||(re={validationError:G.name==="setValueFromField"?G.context.validationError:_(G.value)},G.name==="setValueFromShortcut"&&(re.shortcut=G.shortcut)),re);le&&x(G.value,ge()),K&&o&&o(G.value,ge()),ee&&m(!1)});if(y!==void 0&&(b.lastControlledValue===void 0||!e.areValuesEqual(h,b.lastControlledValue,y))){const G=e.areValuesEqual(h,b.draft,y);w(Y=>ve({},Y,{lastControlledValue:y},G?{}:{lastCommittedValue:y,lastPublishedValue:y,draft:y,hasBeenModifiedSinceMount:!0}))}const O=st(()=>{S({value:e.emptyValue,name:"setValueFromAction",pickerAction:"clear"})}),k=st(()=>{S({value:b.lastPublishedValue,name:"setValueFromAction",pickerAction:"accept"})}),E=st(()=>{S({value:b.lastPublishedValue,name:"setValueFromAction",pickerAction:"dismiss"})}),P=st(()=>{S({value:b.lastCommittedValue,name:"setValueFromAction",pickerAction:"cancel"})}),A=st(()=>{S({value:e.getTodayValue(h,v,n),name:"setValueFromAction",pickerAction:"today"})}),R=st(G=>{G.preventDefault(),m(!0)}),T=st(G=>{G==null||G.preventDefault(),m(!1)}),M=st((G,Y="partial")=>S({name:"setValueFromView",value:G,selectionState:Y})),I=st((G,Y,le)=>S({name:"setValueFromShortcut",value:G,changeImportance:Y,shortcut:le})),j=st((G,Y)=>S({name:"setValueFromField",value:G,context:Y})),N={onClear:O,onAccept:k,onDismiss:E,onCancel:P,onSetToday:A,onOpen:R,onClose:T},z={value:b.draft,onChange:j},L=D.useMemo(()=>e.cleanValue(h,b.draft),[h,e,b.draft]),B={value:L,onChange:M,onClose:T,open:g},$=ve({},N,{value:L,onChange:M,onSelectShortcut:I,isValid:G=>{const Y=i({adapter:p,value:G,timezone:v,props:t});return!e.hasError(Y)}}),q=D.useMemo(()=>({onOpen:R,onClose:T,open:g}),[g,T,R]);return{open:g,fieldProps:z,viewProps:B,layoutProps:$,actions:N,contextValue:q}},Qln=["className","sx"],Kln=({props:t,propsFromPickerValue:e,additionalViewProps:n,autoFocusView:r,rendererInterceptor:i,fieldRef:o})=>{const{onChange:s,open:a,onClose:l}=e,{view:c,views:u,openTo:f,onViewChange:d,viewRenderers:h,timezone:p}=t,g=Rt(t,Qln),{view:m,setView:v,defaultView:y,focusedView:x,setFocusedView:b,setValueAndGoToNextView:w}=tD({view:c,views:u,openTo:f,onChange:s,onViewChange:d,autoFocus:r}),{hasUIView:_,viewModeLookup:S}=D.useMemo(()=>u.reduce((T,M)=>{let I;return h[M]!=null?I="UI":I="field",T.viewModeLookup[M]=I,I==="UI"&&(T.hasUIView=!0),T},{hasUIView:!1,viewModeLookup:{}}),[h,u]),O=D.useMemo(()=>u.reduce((T,M)=>h[M]!=null&&hC(M)?T+1:T,0),[h,u]),k=S[m],E=st(()=>k==="UI"),[P,A]=D.useState(k==="UI"?m:null);return P!==m&&S[m]==="UI"&&A(m),Ti(()=>{k==="field"&&a&&(l(),setTimeout(()=>{var T,M;(T=o==null?void 0:o.current)==null||T.setSelectedSections(m),(M=o==null?void 0:o.current)==null||M.focusField(m)}))},[m]),Ti(()=>{if(!a)return;let T=m;k==="field"&&P!=null&&(T=P),T!==y&&S[T]==="UI"&&S[y]==="UI"&&(T=y),T!==m&&v(T),b(T,!0)},[a]),{hasUIView:_,shouldRestoreFocus:E,layoutProps:{views:u,view:P,onViewChange:v},renderCurrentView:()=>{if(P==null)return null;const T=h[P];if(T==null)return null;const M=ve({},g,n,e,{views:u,timezone:p,onChange:w,view:P,onViewChange:v,focusedView:x,onFocusedViewChange:b,showViewSwitcher:O>1,timeViewsCount:O});return i?i(h,P,M):T(M)}}};function Ibe(){return typeof window>"u"?"portrait":window.screen&&window.screen.orientation&&window.screen.orientation.angle?Math.abs(window.screen.orientation.angle)===90?"landscape":"portrait":window.orientation&&Math.abs(Number(window.orientation))===90?"landscape":"portrait"}const Zln=(t,e)=>{const[n,r]=D.useState(Ibe);return Ti(()=>{const o=()=>{r(Ibe())};return window.addEventListener("orientationchange",o),()=>{window.removeEventListener("orientationchange",o)}},[]),bon(t,["hours","minutes","seconds"])?!1:(e||n)==="landscape"},Jln=({props:t,propsFromPickerValue:e,propsFromPickerViews:n,wrapperVariant:r})=>{const{orientation:i}=t,o=Zln(n.views,i),s=Ho();return{layoutProps:ve({},n,e,{isLandscape:o,isRtl:s,wrapperVariant:r,disabled:t.disabled,readOnly:t.readOnly})}};function ecn(t){const{props:e,pickerValueResponse:n}=t;return D.useMemo(()=>({value:n.viewProps.value,open:n.open,disabled:e.disabled??!1,readOnly:e.readOnly??!1}),[n.viewProps.value,n.open,e.disabled,e.readOnly])}const SVe=({props:t,valueManager:e,valueType:n,wrapperVariant:r,additionalViewProps:i,validator:o,autoFocusView:s,rendererInterceptor:a,fieldRef:l})=>{const c=Yln({props:t,valueManager:e,valueType:n,wrapperVariant:r,validator:o}),u=Kln({props:t,additionalViewProps:i,autoFocusView:s,fieldRef:l,propsFromPickerValue:c.viewProps,rendererInterceptor:a}),f=Jln({props:t,wrapperVariant:r,propsFromPickerValue:c.layoutProps,propsFromPickerViews:u.layoutProps}),d=ecn({props:t,pickerValueResponse:c});return{open:c.open,actions:c.actions,fieldProps:c.fieldProps,renderCurrentView:u.renderCurrentView,hasUIView:u.hasUIView,shouldRestoreFocus:u.shouldRestoreFocus,layoutProps:f.layoutProps,contextValue:c.contextValue,ownerState:d}};function CVe(t){return Ye("MuiPickersLayout",t)}const pf=He("MuiPickersLayout",["root","landscape","contentWrapper","toolbar","actionBar","tabs","shortcuts"]),tcn=["onAccept","onClear","onCancel","onSetToday","actions"];function ncn(t){const{onAccept:e,onClear:n,onCancel:r,onSetToday:i,actions:o}=t,s=Rt(t,tcn),a=Pl();if(o==null||o.length===0)return null;const l=o==null?void 0:o.map(c=>{switch(c){case"clear":return C.jsx(Vr,{onClick:n,children:a.clearButtonLabel},c);case"cancel":return C.jsx(Vr,{onClick:r,children:a.cancelButtonLabel},c);case"accept":return C.jsx(Vr,{onClick:e,children:a.okButtonLabel},c);case"today":return C.jsx(Vr,{onClick:i,children:a.todayButtonLabel},c);default:return null}});return C.jsx(Yb,ve({},s,{children:l}))}const rcn=["items","changeImportance","isLandscape","onChange","isValid"],icn=["getValue"];function ocn(t){const{items:e,changeImportance:n="accept",onChange:r,isValid:i}=t,o=Rt(t,rcn);if(e==null||e.length===0)return null;const s=e.map(a=>{let{getValue:l}=a,c=Rt(a,icn);const u=l({isValid:i});return ve({},c,{label:c.label,onClick:()=>{r(u,n,c)},disabled:!i(u)})});return C.jsx(DM,ve({dense:!0,sx:[{maxHeight:CU,maxWidth:200,overflow:"auto"},...Array.isArray(o.sx)?o.sx:[o.sx]]},o,{children:s.map(a=>C.jsx(P_,{children:C.jsx(oPe,ve({},a))},a.id??a.label))}))}function scn(t){return t.view!==null}const acn=t=>{const{classes:e,isLandscape:n}=t;return qe({root:["root",n&&"landscape"],contentWrapper:["contentWrapper"],toolbar:["toolbar"],actionBar:["actionBar"],tabs:["tabs"],landscape:["landscape"],shortcuts:["shortcuts"]},CVe,e)},OVe=t=>{const{wrapperVariant:e,onAccept:n,onClear:r,onCancel:i,onSetToday:o,view:s,views:a,onViewChange:l,value:c,onChange:u,onSelectShortcut:f,isValid:d,isLandscape:h,disabled:p,readOnly:g,children:m,slots:v,slotProps:y}=t,x=acn(t),b=(v==null?void 0:v.actionBar)??ncn,w=Zt({elementType:b,externalSlotProps:y==null?void 0:y.actionBar,additionalProps:{onAccept:n,onClear:r,onCancel:i,onSetToday:o,actions:e==="desktop"?[]:["cancel","accept"]},className:x.actionBar,ownerState:ve({},t,{wrapperVariant:e})}),_=C.jsx(b,ve({},w)),S=v==null?void 0:v.toolbar,O=Zt({elementType:S,externalSlotProps:y==null?void 0:y.toolbar,additionalProps:{isLandscape:h,onChange:u,value:c,view:s,onViewChange:l,views:a,disabled:p,readOnly:g},className:x.toolbar,ownerState:ve({},t,{wrapperVariant:e})}),k=scn(O)&&S?C.jsx(S,ve({},O)):null,E=m,P=v==null?void 0:v.tabs,A=s&&P?C.jsx(P,ve({view:s,onViewChange:l,className:x.tabs},y==null?void 0:y.tabs)):null,R=(v==null?void 0:v.shortcuts)??ocn,T=Zt({elementType:R,externalSlotProps:y==null?void 0:y.shortcuts,additionalProps:{isValid:d,isLandscape:h,onChange:f},className:x.shortcuts,ownerState:{isValid:d,isLandscape:h,onChange:f,wrapperVariant:e}}),M=s&&R?C.jsx(R,ve({},T)):null;return{toolbar:k,content:E,tabs:A,actionBar:_,shortcuts:M}},lcn=t=>{const{isLandscape:e,classes:n}=t;return qe({root:["root",e&&"landscape"],contentWrapper:["contentWrapper"]},CVe,n)},EVe=be("div",{name:"MuiPickersLayout",slot:"Root",overridesResolver:(t,e)=>e.root})({display:"grid",gridAutoColumns:"max-content auto max-content",gridAutoRows:"max-content auto max-content",[`& .${pf.actionBar}`]:{gridColumn:"1 / 4",gridRow:3},variants:[{props:{isLandscape:!0},style:{[`& .${pf.toolbar}`]:{gridColumn:1,gridRow:"2 / 3"},[`.${pf.shortcuts}`]:{gridColumn:"2 / 4",gridRow:1}}},{props:{isLandscape:!0,isRtl:!0},style:{[`& .${pf.toolbar}`]:{gridColumn:3}}},{props:{isLandscape:!1},style:{[`& .${pf.toolbar}`]:{gridColumn:"2 / 4",gridRow:1},[`& .${pf.shortcuts}`]:{gridColumn:1,gridRow:"2 / 3"}}},{props:{isLandscape:!1,isRtl:!0},style:{[`& .${pf.shortcuts}`]:{gridColumn:3}}}]}),TVe=be("div",{name:"MuiPickersLayout",slot:"ContentWrapper",overridesResolver:(t,e)=>e.contentWrapper})({gridColumn:2,gridRow:2,display:"flex",flexDirection:"column"}),kVe=D.forwardRef(function(e,n){const r=kn({props:e,name:"MuiPickersLayout"}),{toolbar:i,content:o,tabs:s,actionBar:a,shortcuts:l}=OVe(r),{sx:c,className:u,isLandscape:f,wrapperVariant:d}=r,h=lcn(r);return C.jsxs(EVe,{ref:n,sx:c,className:Oe(h.root,u),ownerState:r,children:[f?l:i,f?i:l,C.jsx(TVe,{className:h.contentWrapper,children:d==="desktop"?C.jsxs(D.Fragment,{children:[o,s]}):C.jsxs(D.Fragment,{children:[s,o]})}),a]})}),ccn=["props","getOpenDialogAriaText"],ucn=["ownerState"],fcn=["ownerState"],dcn=t=>{var oe;let{props:e,getOpenDialogAriaText:n}=t,r=Rt(t,ccn);const{slots:i,slotProps:o,className:s,sx:a,format:l,formatDensity:c,enableAccessibleFieldDOMStructure:u,selectedSections:f,onSelectedSectionsChange:d,timezone:h,name:p,label:g,inputRef:m,readOnly:v,disabled:y,autoFocus:x,localeText:b,reduceAnimations:w}=e,_=D.useRef(null),S=D.useRef(null),O=Jf(),k=((oe=o==null?void 0:o.toolbar)==null?void 0:oe.hidden)??!1,{open:E,actions:P,hasUIView:A,layoutProps:R,renderCurrentView:T,shouldRestoreFocus:M,fieldProps:I,contextValue:j,ownerState:N}=SVe(ve({},r,{props:e,fieldRef:S,autoFocusView:!0,additionalViewProps:{},wrapperVariant:"desktop"})),z=i.inputAdornment??mPe,L=Zt({elementType:z,externalSlotProps:o==null?void 0:o.inputAdornment,additionalProps:{position:"end"},ownerState:e}),B=Rt(L,ucn),F=i.openPickerButton??Ht,$=Zt({elementType:F,externalSlotProps:o==null?void 0:o.openPickerButton,additionalProps:{disabled:y||v,onClick:E?P.onClose:P.onOpen,"aria-label":n(I.value),edge:B.position},ownerState:e}),q=Rt($,fcn),G=i.openPickerIcon,Y=Zt({elementType:G,externalSlotProps:o==null?void 0:o.openPickerIcon,ownerState:N}),le=i.field,K=Zt({elementType:le,externalSlotProps:o==null?void 0:o.field,additionalProps:ve({},I,k&&{id:O},{readOnly:v,disabled:y,className:s,sx:a,format:l,formatDensity:c,enableAccessibleFieldDOMStructure:u,selectedSections:f,onSelectedSectionsChange:d,timezone:h,label:g,name:p,autoFocus:x&&!e.open,focused:E?!0:void 0},m?{inputRef:m}:{}),ownerState:e});A&&(K.InputProps=ve({},K.InputProps,{ref:_},!e.disableOpenPicker&&{[`${B.position}Adornment`]:C.jsx(z,ve({},B,{children:C.jsx(F,ve({},q,{children:C.jsx(G,ve({},Y))}))}))}));const ee=ve({textField:i.textField,clearIcon:i.clearIcon,clearButton:i.clearButton},K.slots),re=i.layout??kVe;let ge=O;k&&(g?ge=`${O}-label`:ge=void 0);const te=ve({},o,{toolbar:ve({},o==null?void 0:o.toolbar,{titleId:O}),popper:ve({"aria-labelledby":ge},o==null?void 0:o.popper)}),ae=dn(S,K.unstableFieldRef);return{renderPicker:()=>C.jsxs(rVe,{contextValue:j,localeText:b,children:[C.jsx(le,ve({},K,{slots:ee,slotProps:te,unstableFieldRef:ae})),C.jsx(Vln,ve({role:"dialog",placement:"bottom-start",anchorEl:_.current},P,{open:E,slots:i,slotProps:te,shouldRestoreFocus:M,reduceAnimations:w,children:C.jsx(re,ve({},R,te==null?void 0:te.layout,{slots:i,slotProps:te,children:T()}))}))]})}},hcn=["views","format"],AVe=(t,e,n)=>{let{views:r,format:i}=e,o=Rt(e,hcn);if(i)return i;const s=[],a=[];if(r.forEach(u=>{hC(u)?a.push(u):dC(u)&&s.push(u)}),a.length===0)return bbe(t,ve({views:s},o));if(s.length===0)return _be(t,ve({views:a},o));const l=_be(t,ve({views:a},o));return`${bbe(t,ve({views:s},o))} ${l}`},pcn=(t,e,n)=>n?e.filter(r=>!ET(r)||r==="hours"):t?[...e,"meridiem"]:e,gcn=(t,e)=>24*60/((t.hours??1)*(t.minutes??5))<=e;function mcn({thresholdToRenderTimeInASingleColumn:t,ampm:e,timeSteps:n,views:r}){const i=t??24,o=ve({hours:1,minutes:5,seconds:5},n),s=gcn(o,i);return{thresholdToRenderTimeInASingleColumn:i,timeSteps:o,shouldRenderTimeInASingleColumn:s,views:pcn(e,r,s)}}function vcn(t){return Ye("MuiTimeClock",t)}He("MuiTimeClock",["root","arrowSwitcher"]);const pC=220,ug=36,oP={x:pC/2,y:pC/2},PVe={x:oP.x,y:0},ycn=PVe.x-oP.x,xcn=PVe.y-oP.y,bcn=t=>t*(180/Math.PI),MVe=(t,e,n)=>{const r=e-oP.x,i=n-oP.y,o=Math.atan2(ycn,xcn)-Math.atan2(r,i);let s=bcn(o);s=Math.round(s/t)*t,s%=360;const a=Math.floor(s/t)||0,l=r**2+i**2,c=Math.sqrt(l);return{value:a,distance:c}},wcn=(t,e,n=1)=>{const r=n*6;let{value:i}=MVe(r,t,e);return i=i*n%60,i},_cn=(t,e,n)=>{const{value:r,distance:i}=MVe(30,t,e);let o=r||12;return n?o%=12:i{const{classes:e}=t;return qe({root:["root"],thumb:["thumb"]},Scn,e)},Ecn=be("div",{name:"MuiClockPointer",slot:"Root",overridesResolver:(t,e)=>e.root})(({theme:t})=>({width:2,backgroundColor:(t.vars||t).palette.primary.main,position:"absolute",left:"calc(50% - 1px)",bottom:"50%",transformOrigin:"center bottom 0px",variants:[{props:{shouldAnimate:!0},style:{transition:t.transitions.create(["transform","height"])}}]})),Tcn=be("div",{name:"MuiClockPointer",slot:"Thumb",overridesResolver:(t,e)=>e.thumb})(({theme:t})=>({width:4,height:4,backgroundColor:(t.vars||t).palette.primary.contrastText,borderRadius:"50%",position:"absolute",top:-21,left:`calc(50% - ${ug/2}px)`,border:`${(ug-4)/2}px solid ${(t.vars||t).palette.primary.main}`,boxSizing:"content-box",variants:[{props:{hasSelected:!0},style:{backgroundColor:(t.vars||t).palette.primary.main}}]}));function kcn(t){const e=kn({props:t,name:"MuiClockPointer"}),{className:n,isInner:r,type:i,viewValue:o}=e,s=Rt(e,Ccn),a=D.useRef(i);D.useEffect(()=>{a.current=i},[i]);const l=ve({},e,{shouldAnimate:a.current!==i}),c=Ocn(l),u=()=>{let d=360/(i==="hours"?12:60)*o;return i==="hours"&&o>12&&(d-=360),{height:Math.round((r?.26:.4)*pC),transform:`rotateZ(${d}deg)`}};return C.jsx(Ecn,ve({style:u(),className:Oe(c.root,n),ownerState:l},s,{children:C.jsx(Tcn,{ownerState:l,className:c.thumb})}))}function Acn(t){return Ye("MuiClock",t)}He("MuiClock",["root","clock","wrapper","squareMask","pin","amButton","pmButton","meridiemText","selected"]);const Pcn=t=>{const{classes:e,meridiemMode:n}=t;return qe({root:["root"],clock:["clock"],wrapper:["wrapper"],squareMask:["squareMask"],pin:["pin"],amButton:["amButton",n==="am"&&"selected"],pmButton:["pmButton",n==="pm"&&"selected"],meridiemText:["meridiemText"]},Acn,e)},Mcn=be("div",{name:"MuiClock",slot:"Root",overridesResolver:(t,e)=>e.root})(({theme:t})=>({display:"flex",justifyContent:"center",alignItems:"center",margin:t.spacing(2)})),Rcn=be("div",{name:"MuiClock",slot:"Clock",overridesResolver:(t,e)=>e.clock})({backgroundColor:"rgba(0,0,0,.07)",borderRadius:"50%",height:220,width:220,flexShrink:0,position:"relative",pointerEvents:"none"}),Dcn=be("div",{name:"MuiClock",slot:"Wrapper",overridesResolver:(t,e)=>e.wrapper})({"&:focus":{outline:"none"}}),Icn=be("div",{name:"MuiClock",slot:"SquareMask",overridesResolver:(t,e)=>e.squareMask})({width:"100%",height:"100%",position:"absolute",pointerEvents:"auto",outline:0,touchAction:"none",userSelect:"none",variants:[{props:{disabled:!1},style:{"@media (pointer: fine)":{cursor:"pointer",borderRadius:"50%"},"&:active":{cursor:"move"}}}]}),Lcn=be("div",{name:"MuiClock",slot:"Pin",overridesResolver:(t,e)=>e.pin})(({theme:t})=>({width:6,height:6,borderRadius:"50%",backgroundColor:(t.vars||t).palette.primary.main,position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)"})),RVe=(t,e)=>({zIndex:1,bottom:8,paddingLeft:4,paddingRight:4,width:ug,variants:[{props:{meridiemMode:e},style:{backgroundColor:(t.vars||t).palette.primary.main,color:(t.vars||t).palette.primary.contrastText,"&:hover":{backgroundColor:(t.vars||t).palette.primary.light}}}]}),$cn=be(Ht,{name:"MuiClock",slot:"AmButton",overridesResolver:(t,e)=>e.amButton})(({theme:t})=>ve({},RVe(t,"am"),{position:"absolute",left:8})),Fcn=be(Ht,{name:"MuiClock",slot:"PmButton",overridesResolver:(t,e)=>e.pmButton})(({theme:t})=>ve({},RVe(t,"pm"),{position:"absolute",right:8})),Lbe=be(Jt,{name:"MuiClock",slot:"meridiemText",overridesResolver:(t,e)=>e.meridiemText})({overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"});function Ncn(t){const e=kn({props:t,name:"MuiClock"}),{ampm:n,ampmInClock:r,autoFocus:i,children:o,value:s,handleMeridiemChange:a,isTimeDisabled:l,meridiemMode:c,minutesStep:u=1,onChange:f,selectedId:d,type:h,viewValue:p,disabled:g=!1,readOnly:m,className:v}=e,y=e,x=pr(),b=Pl(),w=D.useRef(!1),_=Pcn(y),S=l(p,h),O=!n&&h==="hours"&&(p<1||p>12),k=(z,L)=>{g||m||l(z,h)||f(z,L)},E=(z,L)=>{let{offsetX:B,offsetY:F}=z;if(B===void 0){const q=z.target.getBoundingClientRect();B=z.changedTouches[0].clientX-q.left,F=z.changedTouches[0].clientY-q.top}const $=h==="seconds"||h==="minutes"?wcn(B,F,u):_cn(B,F,!!n);k($,L)},P=z=>{w.current=!0,E(z,"shallow")},A=z=>{w.current&&(E(z,"finish"),w.current=!1)},R=z=>{z.buttons>0&&E(z.nativeEvent,"shallow")},T=z=>{w.current&&(w.current=!1),E(z.nativeEvent,"finish")},M=D.useMemo(()=>h==="hours"?!0:p%5===0,[h,p]),I=h==="minutes"?u:1,j=D.useRef(null);Ti(()=>{i&&j.current.focus()},[i]);const N=z=>{if(!w.current)switch(z.key){case"Home":k(0,"partial"),z.preventDefault();break;case"End":k(h==="minutes"?59:23,"partial"),z.preventDefault();break;case"ArrowUp":k(p+I,"partial"),z.preventDefault();break;case"ArrowDown":k(p-I,"partial"),z.preventDefault();break;case"PageUp":k(p+5,"partial"),z.preventDefault();break;case"PageDown":k(p-5,"partial"),z.preventDefault();break;case"Enter":case" ":k(p,"finish"),z.preventDefault();break}};return C.jsxs(Mcn,{className:Oe(_.root,v),children:[C.jsxs(Rcn,{className:_.clock,children:[C.jsx(Icn,{onTouchMove:P,onTouchStart:P,onTouchEnd:A,onMouseUp:T,onMouseMove:R,ownerState:{disabled:g},className:_.squareMask}),!S&&C.jsxs(D.Fragment,{children:[C.jsx(Lcn,{className:_.pin}),s!=null&&C.jsx(kcn,{type:h,viewValue:p,isInner:O,hasSelected:M})]}),C.jsx(Dcn,{"aria-activedescendant":d,"aria-label":b.clockLabelText(h,s,x,s==null?null:x.format(s,"fullTime")),ref:j,role:"listbox",onKeyDown:N,tabIndex:0,className:_.wrapper,children:o})]}),n&&r&&C.jsxs(D.Fragment,{children:[C.jsx($cn,{onClick:m?void 0:()=>a("am"),disabled:g||c===null,ownerState:y,className:_.amButton,title:Qp(x,"am"),children:C.jsx(Lbe,{variant:"caption",className:_.meridiemText,children:Qp(x,"am")})}),C.jsx(Fcn,{disabled:g||c===null,onClick:m?void 0:()=>a("pm"),ownerState:y,className:_.pmButton,title:Qp(x,"pm"),children:C.jsx(Lbe,{variant:"caption",className:_.meridiemText,children:Qp(x,"pm")})})]})]})}function zcn(t){return Ye("MuiClockNumber",t)}const vL=He("MuiClockNumber",["root","selected","disabled"]),jcn=["className","disabled","index","inner","label","selected"],Bcn=t=>{const{classes:e,selected:n,disabled:r}=t;return qe({root:["root",n&&"selected",r&&"disabled"]},zcn,e)},Ucn=be("span",{name:"MuiClockNumber",slot:"Root",overridesResolver:(t,e)=>[e.root,{[`&.${vL.disabled}`]:e.disabled},{[`&.${vL.selected}`]:e.selected}]})(({theme:t})=>({height:ug,width:ug,position:"absolute",left:`calc((100% - ${ug}px) / 2)`,display:"inline-flex",justifyContent:"center",alignItems:"center",borderRadius:"50%",color:(t.vars||t).palette.text.primary,fontFamily:t.typography.fontFamily,"&:focused":{backgroundColor:(t.vars||t).palette.background.paper},[`&.${vL.selected}`]:{color:(t.vars||t).palette.primary.contrastText},[`&.${vL.disabled}`]:{pointerEvents:"none",color:(t.vars||t).palette.text.disabled},variants:[{props:{inner:!0},style:ve({},t.typography.body2,{color:(t.vars||t).palette.text.secondary})}]}));function DVe(t){const e=kn({props:t,name:"MuiClockNumber"}),{className:n,disabled:r,index:i,inner:o,label:s,selected:a}=e,l=Rt(e,jcn),c=e,u=Bcn(c),f=i%12/12*Math.PI*2-Math.PI/2,d=(pC-ug-2)/2*(o?.65:1),h=Math.round(Math.cos(f)*d),p=Math.round(Math.sin(f)*d);return C.jsx(Ucn,ve({className:Oe(u.root,n),"aria-disabled":r?!0:void 0,"aria-selected":a?!0:void 0,role:"option",style:{transform:`translate(${h}px, ${p+(pC-ug)/2}px`},ownerState:c},l,{children:s}))}const Wcn=({ampm:t,value:e,getClockNumberText:n,isDisabled:r,selectedId:i,utils:o})=>{const s=e?o.getHours(e):null,a=[],l=t?1:0,c=t?12:23,u=f=>s===null?!1:t?f===12?s===12||s===0:s===f||s-12===f:s===f;for(let f=l;f<=c;f+=1){let d=f.toString();f===0&&(d="00");const h=!t&&(f===0||f>12);d=o.formatNumber(d);const p=u(f);a.push(C.jsx(DVe,{id:p?i:void 0,index:f,inner:h,selected:p,disabled:r(f),label:d,"aria-label":n(d)},f))}return a},$be=({utils:t,value:e,isDisabled:n,getClockNumberText:r,selectedId:i})=>{const o=t.formatNumber;return[[5,o("05")],[10,o("10")],[15,o("15")],[20,o("20")],[25,o("25")],[30,o("30")],[35,o("35")],[40,o("40")],[45,o("45")],[50,o("50")],[55,o("55")],[0,o("00")]].map(([s,a],l)=>{const c=s===e;return C.jsx(DVe,{label:a,id:c?i:void 0,index:l+1,inner:!1,disabled:n(s),selected:c,"aria-label":r(a)},s)})},Ale=({value:t,referenceDate:e,utils:n,props:r,timezone:i})=>{const o=D.useMemo(()=>na.getInitialReferenceValue({value:t,utils:n,props:r,referenceDate:e,granularity:bf.day,timezone:i,getTodayDate:()=>wle(n,i,"date")}),[]);return t??o},Vcn=["ampm","ampmInClock","autoFocus","slots","slotProps","value","defaultValue","referenceDate","disableIgnoringDatePartForTimeValidation","maxTime","minTime","disableFuture","disablePast","minutesStep","shouldDisableTime","showViewSwitcher","onChange","view","views","openTo","onViewChange","focusedView","onFocusedViewChange","className","disabled","readOnly","timezone"],Gcn=t=>{const{classes:e}=t;return qe({root:["root"],arrowSwitcher:["arrowSwitcher"]},vcn,e)},Hcn=be(OU,{name:"MuiTimeClock",slot:"Root",overridesResolver:(t,e)=>e.root})({display:"flex",flexDirection:"column",position:"relative"}),qcn=be(wVe,{name:"MuiTimeClock",slot:"ArrowSwitcher",overridesResolver:(t,e)=>e.arrowSwitcher})({position:"absolute",right:12,top:15}),Xcn=["hours","minutes"],Ycn=D.forwardRef(function(e,n){const r=pr(),i=kn({props:e,name:"MuiTimeClock"}),{ampm:o=r.is12HourCycleInCurrentLocale(),ampmInClock:s=!1,autoFocus:a,slots:l,slotProps:c,value:u,defaultValue:f,referenceDate:d,disableIgnoringDatePartForTimeValidation:h=!1,maxTime:p,minTime:g,disableFuture:m,disablePast:v,minutesStep:y=1,shouldDisableTime:x,showViewSwitcher:b,onChange:w,view:_,views:S=Xcn,openTo:O,onViewChange:k,focusedView:E,onFocusedViewChange:P,className:A,disabled:R,readOnly:T,timezone:M}=i,I=Rt(i,Vcn),{value:j,handleValueChange:N,timezone:z}=HO({name:"TimeClock",timezone:M,value:u,defaultValue:f,onChange:w,valueManager:na}),L=Ale({value:j,referenceDate:d,utils:r,props:i,timezone:z}),B=Pl(),F=O1(z),{view:$,setView:q,previousView:G,nextView:Y,setValueAndGoToNextView:le}=tD({view:_,views:S,openTo:O,onViewChange:k,onChange:N,focusedView:E,onFocusedViewChange:P}),{meridiemMode:K,handleMeridiemChange:ee}=kle(L,o,le),re=D.useCallback((oe,ne)=>{const V=JR(h,r),X=ne==="hours"||ne==="minutes"&&S.includes("seconds"),Z=({start:xe,end:H})=>!(g&&V(g,H)||p&&V(xe,p)||m&&V(xe,F)||v&&V(F,X?H:xe)),he=(xe,H=1)=>{if(xe%H!==0)return!1;if(x)switch(ne){case"hours":return!x(r.setHours(L,xe),"hours");case"minutes":return!x(r.setMinutes(L,xe),"minutes");case"seconds":return!x(r.setSeconds(L,xe),"seconds");default:return!1}return!0};switch(ne){case"hours":{const xe=rP(oe,K,o),H=r.setHours(L,xe),W=r.setSeconds(r.setMinutes(H,0),0),J=r.setSeconds(r.setMinutes(H,59),59);return!Z({start:W,end:J})||!he(xe)}case"minutes":{const xe=r.setMinutes(L,oe),H=r.setSeconds(xe,0),W=r.setSeconds(xe,59);return!Z({start:H,end:W})||!he(oe,y)}case"seconds":{const xe=r.setSeconds(L,oe);return!Z({start:xe,end:xe})||!he(oe)}default:throw new Error("not supported")}},[o,L,h,p,K,g,y,x,r,m,v,F,S]),ge=Jf(),te=D.useMemo(()=>{switch($){case"hours":{const oe=(ne,V)=>{const X=rP(ne,K,o);le(r.setHours(L,X),V,"hours")};return{onChange:oe,viewValue:r.getHours(L),children:Wcn({value:j,utils:r,ampm:o,onChange:oe,getClockNumberText:B.hoursClockNumberText,isDisabled:ne=>R||re(ne,"hours"),selectedId:ge})}}case"minutes":{const oe=r.getMinutes(L),ne=(V,X)=>{le(r.setMinutes(L,V),X,"minutes")};return{viewValue:oe,onChange:ne,children:$be({utils:r,value:oe,onChange:ne,getClockNumberText:B.minutesClockNumberText,isDisabled:V=>R||re(V,"minutes"),selectedId:ge})}}case"seconds":{const oe=r.getSeconds(L),ne=(V,X)=>{le(r.setSeconds(L,V),X,"seconds")};return{viewValue:oe,onChange:ne,children:$be({utils:r,value:oe,onChange:ne,getClockNumberText:B.secondsClockNumberText,isDisabled:V=>R||re(V,"seconds"),selectedId:ge})}}default:throw new Error("You must provide the type for ClockView")}},[$,r,j,o,B.hoursClockNumberText,B.minutesClockNumberText,B.secondsClockNumberText,K,le,L,re,ge,R]),ae=i,U=Gcn(ae);return C.jsxs(Hcn,ve({ref:n,className:Oe(U.root,A),ownerState:ae},I,{children:[C.jsx(Ncn,ve({autoFocus:a??!!E,ampmInClock:s&&S.includes("hours"),value:j,type:$,ampm:o,minutesStep:y,isTimeDisabled:re,meridiemMode:K,handleMeridiemChange:ee,selectedId:ge,disabled:R,readOnly:T},te)),b&&C.jsx(qcn,{className:U.arrowSwitcher,slots:l,slotProps:c,onGoToPrevious:()=>q(G),isPreviousDisabled:!G,previousLabel:B.openPreviousView,onGoToNext:()=>q(Y),isNextDisabled:!Y,nextLabel:B.openNextView,ownerState:ae})]}))});function Qcn(t){return Ye("MuiDigitalClock",t)}const Kcn=He("MuiDigitalClock",["root","list","item"]),Zcn=["ampm","timeStep","autoFocus","slots","slotProps","value","defaultValue","referenceDate","disableIgnoringDatePartForTimeValidation","maxTime","minTime","disableFuture","disablePast","minutesStep","shouldDisableTime","onChange","view","openTo","onViewChange","focusedView","onFocusedViewChange","className","disabled","readOnly","views","skipDisabled","timezone"],Jcn=t=>{const{classes:e}=t;return qe({root:["root"],list:["list"],item:["item"]},Qcn,e)},eun=be(OU,{name:"MuiDigitalClock",slot:"Root",overridesResolver:(t,e)=>e.root})({overflowY:"auto",width:"100%","@media (prefers-reduced-motion: no-preference)":{scrollBehavior:"auto"},maxHeight:pVe,variants:[{props:{alreadyRendered:!0},style:{"@media (prefers-reduced-motion: no-preference)":{scrollBehavior:"smooth"}}}]}),tun=be(y4,{name:"MuiDigitalClock",slot:"List",overridesResolver:(t,e)=>e.list})({padding:0}),nun=be(ti,{name:"MuiDigitalClock",slot:"Item",overridesResolver:(t,e)=>e.item})(({theme:t})=>({padding:"8px 16px",margin:"2px 4px","&:first-of-type":{marginTop:4},"&:hover":{backgroundColor:t.vars?`rgba(${t.vars.palette.primary.mainChannel} / ${t.vars.palette.action.hoverOpacity})`:kt(t.palette.primary.main,t.palette.action.hoverOpacity)},"&.Mui-selected":{backgroundColor:(t.vars||t).palette.primary.main,color:(t.vars||t).palette.primary.contrastText,"&:focus-visible, &:hover":{backgroundColor:(t.vars||t).palette.primary.dark}},"&.Mui-focusVisible":{backgroundColor:t.vars?`rgba(${t.vars.palette.primary.mainChannel} / ${t.vars.palette.action.focusOpacity})`:kt(t.palette.primary.main,t.palette.action.focusOpacity)}})),run=D.forwardRef(function(e,n){const r=pr(),i=D.useRef(null),o=dn(n,i),s=D.useRef(null),a=kn({props:e,name:"MuiDigitalClock"}),{ampm:l=r.is12HourCycleInCurrentLocale(),timeStep:c=30,autoFocus:u,slots:f,slotProps:d,value:h,defaultValue:p,referenceDate:g,disableIgnoringDatePartForTimeValidation:m=!1,maxTime:v,minTime:y,disableFuture:x,disablePast:b,minutesStep:w=1,shouldDisableTime:_,onChange:S,view:O,openTo:k,onViewChange:E,focusedView:P,onFocusedViewChange:A,className:R,disabled:T,readOnly:M,views:I=["hours"],skipDisabled:j=!1,timezone:N}=a,z=Rt(a,Zcn),{value:L,handleValueChange:B,timezone:F}=HO({name:"DigitalClock",timezone:N,value:h,defaultValue:p,onChange:S,valueManager:na}),$=Pl(),q=O1(F),G=D.useMemo(()=>ve({},a,{alreadyRendered:!!i.current}),[a]),Y=Jcn(G),le=(f==null?void 0:f.digitalClockItem)??nun,K=Zt({elementType:le,externalSlotProps:d==null?void 0:d.digitalClockItem,ownerState:{},className:Y.item}),ee=Ale({value:L,referenceDate:g,utils:r,props:a,timezone:F}),re=st(V=>B(V,"finish","hours")),{setValueAndGoToNextView:ge}=tD({view:O,views:I,openTo:k,onViewChange:E,onChange:re,focusedView:P,onFocusedViewChange:A}),te=st(V=>{ge(V,"finish")});D.useEffect(()=>{if(i.current===null)return;const V=i.current.querySelector('[role="listbox"] [role="option"][tabindex="0"], [role="listbox"] [role="option"][aria-selected="true"]');if(!V)return;const X=V.offsetTop;(u||P)&&V.focus(),i.current.scrollTop=X-4});const ae=D.useCallback(V=>{const X=JR(m,r),Z=()=>!(y&&X(y,V)||v&&X(V,v)||x&&X(V,q)||b&&X(q,V)),he=()=>r.getMinutes(V)%w!==0?!1:_?!_(V,"hours"):!0;return!Z()||!he()},[m,r,y,v,x,q,b,w,_]),U=D.useMemo(()=>{const V=r.startOfDay(ee);return[V,...Array.from({length:Math.ceil(24*60/c)-1},(X,Z)=>r.addMinutes(V,c*(Z+1)))]},[ee,c,r]),oe=U.findIndex(V=>r.isEqual(V,ee)),ne=V=>{switch(V.key){case"PageUp":{const X=Q5(s.current)-5,Z=s.current.children,he=Math.max(0,X),xe=Z[he];xe&&xe.focus(),V.preventDefault();break}case"PageDown":{const X=Q5(s.current)+5,Z=s.current.children,he=Math.min(Z.length-1,X),xe=Z[he];xe&&xe.focus(),V.preventDefault();break}}};return C.jsx(eun,ve({ref:o,className:Oe(Y.root,R),ownerState:G},z,{children:C.jsx(tun,{ref:s,role:"listbox","aria-label":$.timePickerToolbarTitle,className:Y.list,onKeyDown:ne,children:U.map((V,X)=>{if(j&&ae(V))return null;const Z=r.isEqual(V,L),he=r.format(V,l?"fullTime12h":"fullTime24h"),xe=oe===X||oe===-1&&X===0?0:-1;return C.jsx(le,ve({onClick:()=>!M&&te(V),selected:Z,disabled:T||ae(V),disableRipple:M,role:"option","aria-disabled":M,"aria-selected":Z,tabIndex:xe},K,{children:he}),he)})})}))});function iun(t){return Ye("MuiMultiSectionDigitalClock",t)}const Fbe=He("MuiMultiSectionDigitalClock",["root"]);function oun(t){return Ye("MuiMultiSectionDigitalClockSection",t)}const sun=He("MuiMultiSectionDigitalClockSection",["root","item"]),aun=["autoFocus","onChange","className","disabled","readOnly","items","active","slots","slotProps","skipDisabled"],lun=t=>{const{classes:e}=t;return qe({root:["root"],item:["item"]},oun,e)},cun=be(y4,{name:"MuiMultiSectionDigitalClockSection",slot:"Root",overridesResolver:(t,e)=>e.root})(({theme:t})=>({maxHeight:pVe,width:56,padding:0,overflow:"hidden","@media (prefers-reduced-motion: no-preference)":{scrollBehavior:"auto"},"@media (pointer: fine)":{"&:hover":{overflowY:"auto"}},"@media (pointer: none), (pointer: coarse)":{overflowY:"auto"},"&:not(:first-of-type)":{borderLeft:`1px solid ${(t.vars||t).palette.divider}`},"&::after":{display:"block",content:'""',height:"calc(100% - 40px - 6px)"},variants:[{props:{alreadyRendered:!0},style:{"@media (prefers-reduced-motion: no-preference)":{scrollBehavior:"smooth"}}}]})),uun=be(ti,{name:"MuiMultiSectionDigitalClockSection",slot:"Item",overridesResolver:(t,e)=>e.item})(({theme:t})=>({padding:8,margin:"2px 4px",width:TT,justifyContent:"center","&:first-of-type":{marginTop:4},"&:hover":{backgroundColor:t.vars?`rgba(${t.vars.palette.primary.mainChannel} / ${t.vars.palette.action.hoverOpacity})`:kt(t.palette.primary.main,t.palette.action.hoverOpacity)},"&.Mui-selected":{backgroundColor:(t.vars||t).palette.primary.main,color:(t.vars||t).palette.primary.contrastText,"&:focus-visible, &:hover":{backgroundColor:(t.vars||t).palette.primary.dark}},"&.Mui-focusVisible":{backgroundColor:t.vars?`rgba(${t.vars.palette.primary.mainChannel} / ${t.vars.palette.action.focusOpacity})`:kt(t.palette.primary.main,t.palette.action.focusOpacity)}})),fun=D.forwardRef(function(e,n){const r=D.useRef(null),i=dn(n,r),o=D.useRef(null),s=kn({props:e,name:"MuiMultiSectionDigitalClockSection"}),{autoFocus:a,onChange:l,className:c,disabled:u,readOnly:f,items:d,active:h,slots:p,slotProps:g,skipDisabled:m}=s,v=Rt(s,aun),y=D.useMemo(()=>ve({},s,{alreadyRendered:!!r.current}),[s]),x=lun(y),b=(p==null?void 0:p.digitalClockSectionItem)??uun;D.useEffect(()=>{if(r.current===null)return;const S=r.current.querySelector('[role="option"][tabindex="0"], [role="option"][aria-selected="true"]');if(h&&a&&S&&S.focus(),!S||o.current===S)return;o.current=S;const O=S.offsetTop;r.current.scrollTop=O-4});const w=d.findIndex(S=>S.isFocused(S.value)),_=S=>{switch(S.key){case"PageUp":{const O=Q5(r.current)-5,k=r.current.children,E=Math.max(0,O),P=k[E];P&&P.focus(),S.preventDefault();break}case"PageDown":{const O=Q5(r.current)+5,k=r.current.children,E=Math.min(k.length-1,O),P=k[E];P&&P.focus(),S.preventDefault();break}}};return C.jsx(cun,ve({ref:i,className:Oe(x.root,c),ownerState:y,autoFocusItem:a&&h,role:"listbox",onKeyDown:_},v,{children:d.map((S,O)=>{var R;const k=(R=S.isDisabled)==null?void 0:R.call(S,S.value),E=u||k;if(m&&E)return null;const P=S.isSelected(S.value),A=w===O||w===-1&&O===0?0:-1;return C.jsx(b,ve({onClick:()=>!f&&l(S.value),selected:P,disabled:E,disableRipple:f,role:"option","aria-disabled":f||E||void 0,"aria-label":S.ariaLabel,"aria-selected":P,tabIndex:A,className:x.item},g==null?void 0:g.digitalClockSectionItem,{children:S.label}),S.label)})}))}),dun=({now:t,value:e,utils:n,ampm:r,isDisabled:i,resolveAriaLabel:o,timeStep:s,valueOrReferenceDate:a})=>{const l=e?n.getHours(e):null,c=[],u=(h,p)=>{const g=p??l;return g===null?!1:r?h===12?g===12||g===0:g===h||g-12===h:g===h},f=h=>u(h,n.getHours(a)),d=r?11:23;for(let h=0;h<=d;h+=s){let p=n.format(n.setHours(t,h),r?"hours12h":"hours24h");const g=o(parseInt(p,10).toString());p=n.formatNumber(p),c.push({value:h,label:p,isSelected:u,isDisabled:i,isFocused:f,ariaLabel:g})}return c},Nbe=({value:t,utils:e,isDisabled:n,timeStep:r,resolveLabel:i,resolveAriaLabel:o,hasValue:s=!0})=>{const a=c=>t===null?!1:s&&t===c,l=c=>t===c;return[...Array.from({length:Math.ceil(60/r)},(c,u)=>{const f=r*u;return{value:f,label:e.formatNumber(i(f)),isDisabled:n,isSelected:a,isFocused:l,ariaLabel:o(f.toString())}})]},hun=["ampm","timeSteps","autoFocus","slots","slotProps","value","defaultValue","referenceDate","disableIgnoringDatePartForTimeValidation","maxTime","minTime","disableFuture","disablePast","minutesStep","shouldDisableTime","onChange","view","views","openTo","onViewChange","focusedView","onFocusedViewChange","className","disabled","readOnly","skipDisabled","timezone"],pun=t=>{const{classes:e}=t;return qe({root:["root"]},iun,e)},gun=be(OU,{name:"MuiMultiSectionDigitalClock",slot:"Root",overridesResolver:(t,e)=>e.root})(({theme:t})=>({display:"flex",flexDirection:"row",width:"100%",borderBottom:`1px solid ${(t.vars||t).palette.divider}`})),mun=D.forwardRef(function(e,n){const r=pr(),i=Ho(),o=kn({props:e,name:"MuiMultiSectionDigitalClock"}),{ampm:s=r.is12HourCycleInCurrentLocale(),timeSteps:a,autoFocus:l,slots:c,slotProps:u,value:f,defaultValue:d,referenceDate:h,disableIgnoringDatePartForTimeValidation:p=!1,maxTime:g,minTime:m,disableFuture:v,disablePast:y,minutesStep:x=1,shouldDisableTime:b,onChange:w,view:_,views:S=["hours","minutes"],openTo:O,onViewChange:k,focusedView:E,onFocusedViewChange:P,className:A,disabled:R,readOnly:T,skipDisabled:M=!1,timezone:I}=o,j=Rt(o,hun),{value:N,handleValueChange:z,timezone:L}=HO({name:"MultiSectionDigitalClock",timezone:I,value:f,defaultValue:d,onChange:w,valueManager:na}),B=Pl(),F=O1(L),$=D.useMemo(()=>ve({hours:1,minutes:5,seconds:5},a),[a]),q=Ale({value:N,referenceDate:h,utils:r,props:o,timezone:L}),G=st((Z,he,xe)=>z(Z,he,xe)),Y=D.useMemo(()=>!s||!S.includes("hours")||S.includes("meridiem")?S:[...S,"meridiem"],[s,S]),{view:le,setValueAndGoToNextView:K,focusedView:ee}=tD({view:_,views:Y,openTo:O,onViewChange:k,onChange:G,focusedView:E,onFocusedViewChange:P}),re=st(Z=>{K(Z,"finish","meridiem")}),{meridiemMode:ge,handleMeridiemChange:te}=kle(q,s,re,"finish"),ae=D.useCallback((Z,he)=>{const xe=JR(p,r),H=he==="hours"||he==="minutes"&&Y.includes("seconds"),W=({start:se,end:ye})=>!(m&&xe(m,ye)||g&&xe(se,g)||v&&xe(se,F)||y&&xe(F,H?ye:se)),J=(se,ye=1)=>{if(se%ye!==0)return!1;if(b)switch(he){case"hours":return!b(r.setHours(q,se),"hours");case"minutes":return!b(r.setMinutes(q,se),"minutes");case"seconds":return!b(r.setSeconds(q,se),"seconds");default:return!1}return!0};switch(he){case"hours":{const se=rP(Z,ge,s),ye=r.setHours(q,se),ie=r.setSeconds(r.setMinutes(ye,0),0),fe=r.setSeconds(r.setMinutes(ye,59),59);return!W({start:ie,end:fe})||!J(se)}case"minutes":{const se=r.setMinutes(q,Z),ye=r.setSeconds(se,0),ie=r.setSeconds(se,59);return!W({start:ye,end:ie})||!J(Z,x)}case"seconds":{const se=r.setSeconds(q,Z);return!W({start:se,end:se})||!J(Z)}default:throw new Error("not supported")}},[s,q,p,g,ge,m,x,b,r,v,y,F,Y]),U=D.useCallback(Z=>{switch(Z){case"hours":return{onChange:he=>{const xe=rP(he,ge,s);K(r.setHours(q,xe),"finish","hours")},items:dun({now:F,value:N,ampm:s,utils:r,isDisabled:he=>ae(he,"hours"),timeStep:$.hours,resolveAriaLabel:B.hoursClockNumberText,valueOrReferenceDate:q})};case"minutes":return{onChange:he=>{K(r.setMinutes(q,he),"finish","minutes")},items:Nbe({value:r.getMinutes(q),utils:r,isDisabled:he=>ae(he,"minutes"),resolveLabel:he=>r.format(r.setMinutes(F,he),"minutes"),timeStep:$.minutes,hasValue:!!N,resolveAriaLabel:B.minutesClockNumberText})};case"seconds":return{onChange:he=>{K(r.setSeconds(q,he),"finish","seconds")},items:Nbe({value:r.getSeconds(q),utils:r,isDisabled:he=>ae(he,"seconds"),resolveLabel:he=>r.format(r.setSeconds(F,he),"seconds"),timeStep:$.seconds,hasValue:!!N,resolveAriaLabel:B.secondsClockNumberText})};case"meridiem":{const he=Qp(r,"am"),xe=Qp(r,"pm");return{onChange:te,items:[{value:"am",label:he,isSelected:()=>!!N&&ge==="am",isFocused:()=>!!q&&ge==="am",ariaLabel:he},{value:"pm",label:xe,isSelected:()=>!!N&&ge==="pm",isFocused:()=>!!q&&ge==="pm",ariaLabel:xe}]}}default:throw new Error(`Unknown view: ${Z} found.`)}},[F,N,s,r,$.hours,$.minutes,$.seconds,B.hoursClockNumberText,B.minutesClockNumberText,B.secondsClockNumberText,ge,K,q,ae,te]),oe=D.useMemo(()=>{if(!i)return Y;const Z=Y.filter(he=>he!=="meridiem");return Z.reverse(),Y.includes("meridiem")&&Z.push("meridiem"),Z},[i,Y]),ne=D.useMemo(()=>Y.reduce((Z,he)=>ve({},Z,{[he]:U(he)}),{}),[Y,U]),V=o,X=pun(V);return C.jsx(gun,ve({ref:n,className:Oe(X.root,A),ownerState:V,role:"group"},j,{children:oe.map(Z=>C.jsx(fun,{items:ne[Z].items,onChange:ne[Z].onChange,active:le===Z,autoFocus:l??ee===Z,disabled:R,readOnly:T,slots:c,slotProps:u,skipDisabled:M,"aria-label":B.selectViewText(Z)},Z))}))}),Y9=({view:t,onViewChange:e,focusedView:n,onFocusedViewChange:r,views:i,value:o,defaultValue:s,referenceDate:a,onChange:l,className:c,classes:u,disableFuture:f,disablePast:d,minTime:h,maxTime:p,shouldDisableTime:g,minutesStep:m,ampm:v,ampmInClock:y,slots:x,slotProps:b,readOnly:w,disabled:_,sx:S,autoFocus:O,showViewSwitcher:k,disableIgnoringDatePartForTimeValidation:E,timezone:P})=>C.jsx(Ycn,{view:t,onViewChange:e,focusedView:n&&hC(n)?n:null,onFocusedViewChange:r,views:i.filter(hC),value:o,defaultValue:s,referenceDate:a,onChange:l,className:c,classes:u,disableFuture:f,disablePast:d,minTime:h,maxTime:p,shouldDisableTime:g,minutesStep:m,ampm:v,ampmInClock:y,slots:x,slotProps:b,readOnly:w,disabled:_,sx:S,autoFocus:O,showViewSwitcher:k,disableIgnoringDatePartForTimeValidation:E,timezone:P}),vun=({view:t,onViewChange:e,focusedView:n,onFocusedViewChange:r,views:i,value:o,defaultValue:s,referenceDate:a,onChange:l,className:c,classes:u,disableFuture:f,disablePast:d,minTime:h,maxTime:p,shouldDisableTime:g,minutesStep:m,ampm:v,slots:y,slotProps:x,readOnly:b,disabled:w,sx:_,autoFocus:S,disableIgnoringDatePartForTimeValidation:O,timeSteps:k,skipDisabled:E,timezone:P})=>C.jsx(run,{view:t,onViewChange:e,focusedView:n,onFocusedViewChange:r,views:i.filter(hC),value:o,defaultValue:s,referenceDate:a,onChange:l,className:c,classes:u,disableFuture:f,disablePast:d,minTime:h,maxTime:p,shouldDisableTime:g,minutesStep:m,ampm:v,slots:y,slotProps:x,readOnly:b,disabled:w,sx:_,autoFocus:S,disableIgnoringDatePartForTimeValidation:O,timeStep:k==null?void 0:k.minutes,skipDisabled:E,timezone:P}),zbe=({view:t,onViewChange:e,focusedView:n,onFocusedViewChange:r,views:i,value:o,defaultValue:s,referenceDate:a,onChange:l,className:c,classes:u,disableFuture:f,disablePast:d,minTime:h,maxTime:p,shouldDisableTime:g,minutesStep:m,ampm:v,slots:y,slotProps:x,readOnly:b,disabled:w,sx:_,autoFocus:S,disableIgnoringDatePartForTimeValidation:O,timeSteps:k,skipDisabled:E,timezone:P})=>C.jsx(mun,{view:t,onViewChange:e,focusedView:n,onFocusedViewChange:r,views:i.filter(hC),value:o,defaultValue:s,referenceDate:a,onChange:l,className:c,classes:u,disableFuture:f,disablePast:d,minTime:h,maxTime:p,shouldDisableTime:g,minutesStep:m,ampm:v,slots:y,slotProps:x,readOnly:b,disabled:w,sx:_,autoFocus:S,disableIgnoringDatePartForTimeValidation:O,timeSteps:k,skipDisabled:E,timezone:P}),yun=D.forwardRef(function(e,n){var g;const r=Ho(),{toolbar:i,tabs:o,content:s,actionBar:a,shortcuts:l}=OVe(e),{sx:c,className:u,isLandscape:f,classes:d}=e,h=a&&(((g=a.props.actions)==null?void 0:g.length)??0)>0,p=ve({},e,{isRtl:r});return C.jsxs(EVe,{ref:n,className:Oe(pf.root,d==null?void 0:d.root,u),sx:[{[`& .${pf.tabs}`]:{gridRow:4,gridColumn:"1 / 4"},[`& .${pf.actionBar}`]:{gridRow:5}},...Array.isArray(c)?c:[c]],ownerState:p,children:[f?l:i,f?i:l,C.jsxs(TVe,{className:Oe(pf.contentWrapper,d==null?void 0:d.contentWrapper),sx:{display:"grid"},children:[s,o,h&&C.jsx(_h,{sx:{gridRow:3,gridColumn:"1 / 4"}})]}),a]})}),xun=["openTo","focusedView","timeViewsCount"],bun=function(e,n,r){var u,f;const{openTo:i,focusedView:o,timeViewsCount:s}=r,a=Rt(r,xun),l=ve({},a,{focusedView:null,sx:[{[`&.${Fbe.root}`]:{borderBottom:0},[`&.${Fbe.root}, .${sun.root}, &.${Kcn.root}`]:{maxHeight:CU}}]}),c=ET(n);return C.jsxs(D.Fragment,{children:[(u=e[c?"day":n])==null?void 0:u.call(e,ve({},r,{view:c?"day":n,focusedView:o&&dC(o)?o:null,views:r.views.filter(dC),sx:[{gridColumn:1},...l.sx]})),s>0&&C.jsxs(D.Fragment,{children:[C.jsx(_h,{orientation:"vertical",sx:{gridColumn:2}}),(f=e[c?n:"hours"])==null?void 0:f.call(e,ve({},l,{view:c?n:"hours",focusedView:o&&ET(o)?o:null,openTo:ET(i)?i:"hours",views:r.views.filter(ET),sx:[{gridColumn:3},...l.sx]}))]})]})},IVe=D.forwardRef(function(e,n){var y,x,b,w;const r=Pl(),i=pr(),o=gVe(e,"MuiDesktopDateTimePicker"),{shouldRenderTimeInASingleColumn:s,thresholdToRenderTimeInASingleColumn:a,views:l,timeSteps:c}=mcn(o),u=s?vun:zbe,f=ve({day:X_,month:X_,year:X_,hours:u,minutes:u,seconds:u,meridiem:u},o.viewRenderers),d=o.ampmInClock??!0,p=((y=f.hours)==null?void 0:y.name)===zbe.name?l:l.filter(_=>_!=="meridiem"),g=s?[]:["accept"],m=ve({},o,{viewRenderers:f,format:AVe(i,o),views:p,yearsPerRow:o.yearsPerRow??4,ampmInClock:d,timeSteps:c,thresholdToRenderTimeInASingleColumn:a,shouldRenderTimeInASingleColumn:s,slots:ve({field:fVe,layout:yun,openPickerIcon:Pon},o.slots),slotProps:ve({},o.slotProps,{field:_=>{var S;return ve({},nA((S=o.slotProps)==null?void 0:S.field,_),JWe(o),{ref:n})},toolbar:ve({hidden:!0,ampmInClock:d,toolbarVariant:"desktop"},(x=o.slotProps)==null?void 0:x.toolbar),tabs:ve({hidden:!0},(b=o.slotProps)==null?void 0:b.tabs),actionBar:_=>{var S;return ve({actions:g},nA((S=o.slotProps)==null?void 0:S.actionBar,_))}})}),{renderPicker:v}=dcn({props:m,valueManager:na,valueType:"date-time",getOpenDialogAriaText:eVe({utils:i,formatKey:"fullDate",contextTranslation:r.openDatePickerDialogue,propsTranslation:(w=m.localeText)==null?void 0:w.openDatePickerDialogue}),validator:bU,rendererInterceptor:bun});return v()});IVe.propTypes={ampm:pe.bool,ampmInClock:pe.bool,autoFocus:pe.bool,className:pe.string,closeOnSelect:pe.bool,dayOfWeekFormatter:pe.func,defaultValue:pe.object,disabled:pe.bool,disableFuture:pe.bool,disableHighlightToday:pe.bool,disableIgnoringDatePartForTimeValidation:pe.bool,disableOpenPicker:pe.bool,disablePast:pe.bool,displayWeekNumber:pe.bool,enableAccessibleFieldDOMStructure:pe.any,fixedWeekNumber:pe.number,format:pe.string,formatDensity:pe.oneOf(["dense","spacious"]),inputRef:kAe,label:pe.node,loading:pe.bool,localeText:pe.object,maxDate:pe.object,maxDateTime:pe.object,maxTime:pe.object,minDate:pe.object,minDateTime:pe.object,minTime:pe.object,minutesStep:pe.number,monthsPerRow:pe.oneOf([3,4]),name:pe.string,onAccept:pe.func,onChange:pe.func,onClose:pe.func,onError:pe.func,onMonthChange:pe.func,onOpen:pe.func,onSelectedSectionsChange:pe.func,onViewChange:pe.func,onYearChange:pe.func,open:pe.bool,openTo:pe.oneOf(["day","hours","meridiem","minutes","month","seconds","year"]),orientation:pe.oneOf(["landscape","portrait"]),readOnly:pe.bool,reduceAnimations:pe.bool,referenceDate:pe.object,renderLoading:pe.func,selectedSections:pe.oneOfType([pe.oneOf(["all","day","empty","hours","meridiem","minutes","month","seconds","weekDay","year"]),pe.number]),shouldDisableDate:pe.func,shouldDisableMonth:pe.func,shouldDisableTime:pe.func,shouldDisableYear:pe.func,showDaysOutsideCurrentMonth:pe.bool,skipDisabled:pe.bool,slotProps:pe.object,slots:pe.object,sx:pe.oneOfType([pe.arrayOf(pe.oneOfType([pe.func,pe.object,pe.bool])),pe.func,pe.object]),thresholdToRenderTimeInASingleColumn:pe.number,timeSteps:pe.shape({hours:pe.number,minutes:pe.number,seconds:pe.number}),timezone:pe.string,value:pe.object,view:pe.oneOf(["day","hours","meridiem","minutes","month","seconds","year"]),viewRenderers:pe.shape({day:pe.func,hours:pe.func,meridiem:pe.func,minutes:pe.func,month:pe.func,seconds:pe.func,year:pe.func}),views:pe.arrayOf(pe.oneOf(["day","hours","minutes","month","seconds","year"]).isRequired),yearsOrder:pe.oneOf(["asc","desc"]),yearsPerRow:pe.oneOf([3,4])};const wun=be(ed)({[`& .${KT.container}`]:{outline:0},[`& .${KT.paper}`]:{outline:0,minWidth:SU}}),_un=be(zf)({"&:first-of-type":{padding:0}});function Sun(t){const{children:e,onDismiss:n,open:r,slots:i,slotProps:o}=t,s=(i==null?void 0:i.dialog)??wun,a=(i==null?void 0:i.mobileTransition)??XC;return C.jsx(s,ve({open:r,onClose:n},o==null?void 0:o.dialog,{TransitionComponent:a,TransitionProps:o==null?void 0:o.mobileTransition,PaperComponent:i==null?void 0:i.mobilePaper,PaperProps:o==null?void 0:o.mobilePaper,children:C.jsx(_un,{children:e})}))}const Cun=["props","getOpenDialogAriaText"],Oun=t=>{var B;let{props:e,getOpenDialogAriaText:n}=t,r=Rt(t,Cun);const{slots:i,slotProps:o,className:s,sx:a,format:l,formatDensity:c,enableAccessibleFieldDOMStructure:u,selectedSections:f,onSelectedSectionsChange:d,timezone:h,name:p,label:g,inputRef:m,readOnly:v,disabled:y,localeText:x}=e,b=D.useRef(null),w=Jf(),_=((B=o==null?void 0:o.toolbar)==null?void 0:B.hidden)??!1,{open:S,actions:O,layoutProps:k,renderCurrentView:E,fieldProps:P,contextValue:A}=SVe(ve({},r,{props:e,fieldRef:b,autoFocusView:!0,additionalViewProps:{},wrapperVariant:"mobile"})),R=i.field,T=Zt({elementType:R,externalSlotProps:o==null?void 0:o.field,additionalProps:ve({},P,_&&{id:w},!(y||v)&&{onClick:O.onOpen,onKeyDown:won(O.onOpen)},{readOnly:v??!0,disabled:y,className:s,sx:a,format:l,formatDensity:c,enableAccessibleFieldDOMStructure:u,selectedSections:f,onSelectedSectionsChange:d,timezone:h,label:g,name:p},m?{inputRef:m}:{}),ownerState:e});T.inputProps=ve({},T.inputProps,{"aria-label":n(P.value)});const M=ve({textField:i.textField},T.slots),I=i.layout??kVe;let j=w;_&&(g?j=`${w}-label`:j=void 0);const N=ve({},o,{toolbar:ve({},o==null?void 0:o.toolbar,{titleId:w}),mobilePaper:ve({"aria-labelledby":j},o==null?void 0:o.mobilePaper)}),z=dn(b,T.unstableFieldRef);return{renderPicker:()=>C.jsxs(rVe,{contextValue:A,localeText:x,children:[C.jsx(R,ve({},T,{slots:M,slotProps:N,unstableFieldRef:z})),C.jsx(Sun,ve({},O,{open:S,slots:i,slotProps:N,children:C.jsx(I,ve({},k,N==null?void 0:N.layout,{slots:i,slotProps:N,children:E()}))}))]})}},LVe=D.forwardRef(function(e,n){var u,f,d;const r=Pl(),i=pr(),o=gVe(e,"MuiMobileDateTimePicker"),s=ve({day:X_,month:X_,year:X_,hours:Y9,minutes:Y9,seconds:Y9},o.viewRenderers),a=o.ampmInClock??!1,l=ve({},o,{viewRenderers:s,format:AVe(i,o),ampmInClock:a,slots:ve({field:fVe},o.slots),slotProps:ve({},o.slotProps,{field:h=>{var p;return ve({},nA((p=o.slotProps)==null?void 0:p.field,h),JWe(o),{ref:n})},toolbar:ve({hidden:!1,ampmInClock:a},(u=o.slotProps)==null?void 0:u.toolbar),tabs:ve({hidden:!1},(f=o.slotProps)==null?void 0:f.tabs)})}),{renderPicker:c}=Oun({props:l,valueManager:na,valueType:"date-time",getOpenDialogAriaText:eVe({utils:i,formatKey:"fullDate",contextTranslation:r.openDatePickerDialogue,propsTranslation:(d=l.localeText)==null?void 0:d.openDatePickerDialogue}),validator:bU});return c()});LVe.propTypes={ampm:pe.bool,ampmInClock:pe.bool,autoFocus:pe.bool,className:pe.string,closeOnSelect:pe.bool,dayOfWeekFormatter:pe.func,defaultValue:pe.object,disabled:pe.bool,disableFuture:pe.bool,disableHighlightToday:pe.bool,disableIgnoringDatePartForTimeValidation:pe.bool,disableOpenPicker:pe.bool,disablePast:pe.bool,displayWeekNumber:pe.bool,enableAccessibleFieldDOMStructure:pe.any,fixedWeekNumber:pe.number,format:pe.string,formatDensity:pe.oneOf(["dense","spacious"]),inputRef:kAe,label:pe.node,loading:pe.bool,localeText:pe.object,maxDate:pe.object,maxDateTime:pe.object,maxTime:pe.object,minDate:pe.object,minDateTime:pe.object,minTime:pe.object,minutesStep:pe.number,monthsPerRow:pe.oneOf([3,4]),name:pe.string,onAccept:pe.func,onChange:pe.func,onClose:pe.func,onError:pe.func,onMonthChange:pe.func,onOpen:pe.func,onSelectedSectionsChange:pe.func,onViewChange:pe.func,onYearChange:pe.func,open:pe.bool,openTo:pe.oneOf(["day","hours","minutes","month","seconds","year"]),orientation:pe.oneOf(["landscape","portrait"]),readOnly:pe.bool,reduceAnimations:pe.bool,referenceDate:pe.object,renderLoading:pe.func,selectedSections:pe.oneOfType([pe.oneOf(["all","day","empty","hours","meridiem","minutes","month","seconds","weekDay","year"]),pe.number]),shouldDisableDate:pe.func,shouldDisableMonth:pe.func,shouldDisableTime:pe.func,shouldDisableYear:pe.func,showDaysOutsideCurrentMonth:pe.bool,slotProps:pe.object,slots:pe.object,sx:pe.oneOfType([pe.arrayOf(pe.oneOfType([pe.func,pe.object,pe.bool])),pe.func,pe.object]),timezone:pe.string,value:pe.object,view:pe.oneOf(["day","hours","minutes","month","seconds","year"]),viewRenderers:pe.shape({day:pe.func,hours:pe.func,minutes:pe.func,month:pe.func,seconds:pe.func,year:pe.func}),views:pe.arrayOf(pe.oneOf(["day","hours","minutes","month","seconds","year"]).isRequired),yearsOrder:pe.oneOf(["asc","desc"]),yearsPerRow:pe.oneOf([3,4])};const Eun=["desktopModeMediaQuery"],Tun=D.forwardRef(function(e,n){const r=kn({props:e,name:"MuiDateTimePicker"}),{desktopModeMediaQuery:i=_on}=r,o=Rt(r,Eun);return OAe(i,{defaultMatches:!0})?C.jsx(IVe,ve({ref:n},o)):C.jsx(LVe,ve({ref:n},o))}),kun=t=>({dateTimePicker:{marginTop:t.spacing(2)}}),Aun=({classes:t,hasTimeDimension:e,selectedTime:n,selectedTimeRange:r,selectTime:i})=>{const o=d=>{i(d!==null?d1t(d):null)},s=C.jsx(Ly,{shrink:!0,htmlFor:"time-select",children:`${me.get("Time")} (UTC)`}),l=typeof n=="number"?PW(n):null;let c,u;Array.isArray(r)&&(c=PW(r[0]),u=PW(r[1]));const f=C.jsx(BWe,{dateAdapter:Fin,children:C.jsx(Tun,{disabled:!e,className:t.dateTimePicker,format:"yyyy-MM-dd hh:mm:ss",value:l,minDateTime:c,maxDateTime:u,onChange:o,ampm:!1,slotProps:{textField:{variant:"standard",size:"small"}},viewRenderers:{hours:null,minutes:null,seconds:null}})});return C.jsx(tP,{label:s,control:f})},Pun=Pin(kun)(Aun),Mun=t=>({locale:t.controlState.locale,hasTimeDimension:!!hO(t),selectedTime:t.controlState.selectedTime,selectedTimeRange:t.controlState.selectedTimeRange}),Run={selectTime:tU},Dun=Rn(Mun,Run)(Pun),jbe=5,Iun={box:t=>({marginTop:t.spacing(1),marginLeft:t.spacing(jbe),marginRight:t.spacing(jbe),minWidth:200}),label:{color:"grey",fontSize:"1em"}};function Lun({hasTimeDimension:t,selectedTime:e,selectTime:n,selectedTimeRange:r}){const[i,o]=D.useState(e);if(D.useEffect(()=>{o(e||(r?r[0]:0))},[e,r]),!t)return null;const s=(f,d)=>{typeof d=="number"&&o(d)},a=(f,d)=>{n&&typeof d=="number"&&n(d)},l=Array.isArray(r);l||(r=[Date.now()-2*XRe.years,Date.now()]);const c=[{value:r[0],label:bA(r[0])},{value:r[1],label:bA(r[1])}];function u(f){return oO(f)}return C.jsx(ot,{sx:Iun.box,children:C.jsx(Lt,{arrow:!0,title:me.get("Select time in dataset"),children:C.jsx(YC,{disabled:!l,min:r[0],max:r[1],value:i||0,valueLabelDisplay:"off",valueLabelFormat:u,marks:c,onChange:s,onChangeCommitted:a,size:"small"})})})}const $un=t=>({locale:t.controlState.locale,hasTimeDimension:!!hO(t),selectedTime:t.controlState.selectedTime,selectedTimeRange:t.controlState.selectedTimeRange}),Fun={selectTime:tU,selectTimeRange:a8e},Nun=Rn($un,Fun)(Lun),zun=ct(C.jsx("path",{d:"M15.41 7.41 14 6l-6 6 6 6 1.41-1.41L10.83 12z"}),"ChevronLeft"),jun=ct(C.jsx("path",{d:"M10 6 8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z"}),"ChevronRight"),Bun=ct(C.jsx("path",{d:"M18.41 16.59 13.82 12l4.59-4.59L17 6l-6 6 6 6zM6 6h2v12H6z"}),"FirstPage"),Uun=ct(C.jsx("path",{d:"M5.59 7.41 10.18 12l-4.59 4.59L7 18l6-6-6-6zM16 6h2v12h-2z"}),"LastPage"),Wun=ct(C.jsx("path",{d:"M9 16h2V8H9zm3-14C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8m1-4h2V8h-2z"}),"PauseCircleOutline"),Vun=ct(C.jsx("path",{d:"m10 16.5 6-4.5-6-4.5zM12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8"}),"PlayCircleOutline"),aw={formControl:t=>({marginTop:t.spacing(2.5),marginLeft:t.spacing(1),marginRight:t.spacing(1)}),iconButton:{padding:"2px"}};function Gun({timeAnimationActive:t,timeAnimationInterval:e,updateTimeAnimation:n,selectedTime:r,selectedTimeRange:i,selectTime:o,incSelectedTime:s}){const a=D.useRef(null);D.useEffect(()=>(p(),m));const l=()=>{s(1)},c=()=>{n(!t,e)},u=()=>{s(1)},f=()=>{s(-1)},d=()=>{o(i?i[0]:null)},h=()=>{o(i?i[1]:null)},p=()=>{t?g():m()},g=()=>{m(),a.current=window.setInterval(l,e)},m=()=>{a.current!==null&&(window.clearInterval(a.current),a.current=null)},v=typeof r=="number",y=t?C.jsx(Wun,{}):C.jsx(Vun,{}),x=C.jsx(Ht,{disabled:!v,onClick:c,size:"small",sx:aw.iconButton,children:C.jsx(Lt,{arrow:!0,title:me.get("Auto-step through times in the dataset"),children:y})}),b=C.jsx(Ht,{disabled:!v||t,onClick:d,size:"small",sx:aw.iconButton,children:C.jsx(Lt,{arrow:!0,title:me.get("First time step"),children:C.jsx(Bun,{})})}),w=C.jsx(Ht,{disabled:!v||t,onClick:f,size:"small",sx:aw.iconButton,children:C.jsx(Lt,{arrow:!0,title:me.get("Previous time step"),children:C.jsx(zun,{})})}),_=C.jsx(Ht,{disabled:!v||t,onClick:u,size:"small",sx:aw.iconButton,children:C.jsx(Lt,{arrow:!0,title:me.get("Next time step"),children:C.jsx(jun,{})})}),S=C.jsx(Ht,{disabled:!v||t,onClick:h,size:"small",sx:aw.iconButton,children:C.jsx(Lt,{arrow:!0,title:me.get("Last time step"),children:C.jsx(Uun,{})})});return C.jsx(Ug,{sx:aw.formControl,variant:"standard",children:C.jsxs(ot,{children:[b,w,x,_,S]})})}const Hun=t=>({locale:t.controlState.locale,selectedTime:t.controlState.selectedTime,selectedTimeRange:t.controlState.selectedTimeRange,timeAnimationActive:t.controlState.timeAnimationActive,timeAnimationInterval:t.controlState.timeAnimationInterval}),qun={selectTime:tU,incSelectedTime:uKt,updateTimeAnimation:dKt},Xun=Rn(Hun,qun)(Gun),Yun=ct(C.jsx("path",{d:"M16 20H2V4h14zm2-12h4V4h-4zm0 12h4v-4h-4zm0-6h4v-4h-4z"}),"ViewSidebar"),Qun=ra(Ug)(({theme:t})=>({marginTop:t.spacing(2),marginRight:t.spacing(.5),marginLeft:"auto"}));function Kun({visible:t,sidebarOpen:e,setSidebarOpen:n,openDialog:r,allowRefresh:i,updateResources:o,compact:s}){if(!t)return null;const a=C.jsx(yr,{value:"sidebar",selected:e,onClick:()=>n(!e),size:"small",sx:rl.toggleButton,children:C.jsx(Lt,{arrow:!0,title:me.get("Show or hide sidebar"),children:C.jsx(Yun,{})})});let l,c,u;return s&&(l=i&&C.jsx(Ht,{onClick:o,size:"small",children:C.jsx(Lt,{arrow:!0,title:me.get("Refresh"),children:C.jsx(XPe,{})})}),c=Pn.instance.branding.allowDownloads&&C.jsx(Ht,{onClick:()=>r("export"),size:"small",children:C.jsx(Lt,{arrow:!0,title:me.get("Export data"),children:C.jsx(YPe,{})})}),u=C.jsx(Ht,{onClick:()=>r("settings"),size:"small",children:C.jsx(Lt,{arrow:!0,title:me.get("Settings"),children:C.jsx(qPe,{})})})),C.jsx(Qun,{variant:"standard",children:C.jsxs(ot,{children:[l,c,u,a]})})}const Zun=t=>({locale:t.controlState.locale,visible:!!(t.controlState.selectedDatasetId||t.controlState.selectedPlaceId),sidebarOpen:t.controlState.sidebarOpen,compact:Pn.instance.branding.compact,allowRefresh:Pn.instance.branding.allowRefresh}),Jun={setSidebarOpen:tle,openDialog:_1,updateResources:OUe},efn=Rn(Zun,Jun)(Kun),tfn=t=>({locale:t.controlState.locale,show:t.dataState.datasets.length>0}),nfn={},rfn=({show:t})=>t?C.jsxs(Htn,{children:[C.jsx(Ktn,{}),C.jsx(snn,{}),C.jsx(fnn,{}),C.jsx(ynn,{}),C.jsx(knn,{}),C.jsx(Dun,{}),C.jsx(Xun,{}),C.jsx(Nun,{}),C.jsx(efn,{})]}):null,ifn=Rn(tfn,nfn)(rfn);function $Ve(t){const e=D.useRef(null),n=D.useRef(o=>{if(o.buttons===1&&e.current!==null){o.preventDefault();const{screenX:s,screenY:a}=o,[l,c]=e.current,u=[s-l,a-c];e.current=[s,a],t(u)}}),r=D.useRef(o=>{o.buttons===1&&(o.preventDefault(),document.body.addEventListener("mousemove",n.current),document.body.addEventListener("mouseup",i.current),document.body.addEventListener("onmouseleave",i.current),e.current=[o.screenX,o.screenY])}),i=D.useRef(o=>{e.current!==null&&(o.preventDefault(),e.current=null,document.body.removeEventListener("mousemove",n.current),document.body.removeEventListener("mouseup",i.current),document.body.removeEventListener("onmouseleave",i.current))});return r.current}const Bbe={hor:t=>({flex:"none",border:"none",outline:"none",width:"8px",minHeight:"100%",maxHeight:"100%",cursor:"col-resize",backgroundColor:t.palette.mode==="dark"?"white":"black",opacity:0}),ver:t=>({flex:"none",border:"none",outline:"none",height:"8px",minWidth:"100%",maxWidth:"100%",cursor:"row-resize",backgroundColor:t.palette.mode==="dark"?"white":"black",opacity:0})};function ofn({dir:t,onChange:e}){const r=$Ve(([i,o])=>{e(i)});return C.jsx(ot,{sx:t==="hor"?Bbe.hor:Bbe.ver,onMouseDown:r})}const yL={hor:{display:"flex",flexFlow:"row nowrap",flex:"auto"},ver:{height:"100%",display:"flex",flexFlow:"column nowrap",flex:"auto"},childHor:{flex:"none"},childVer:{flex:"none"}};function sfn({dir:t,splitPosition:e,setSplitPosition:n,children:r,style:i,child1Style:o,child2Style:s}){const a=D.useRef(null);if(!r||!Array.isArray(r)||r.length!==2)return null;const l=t==="hor"?yL.childHor:yL.childVer,c=t==="hor"?{width:e}:{height:e},u=f=>{a.current&&vr(a.current.clientWidth)&&n(a.current.clientWidth+f)};return C.jsxs("div",{id:"SplitPane",style:{...i,...t==="hor"?yL.hor:yL.ver},children:[C.jsx("div",{ref:a,id:"SplitPane-Child-1",style:{...l,...o,...c},children:r[0]}),C.jsx(ofn,{dir:t,onChange:u}),C.jsx("div",{id:"SplitPane-Child-2",style:{...l,...s},children:r[1]})]})}const afn=({placeGroup:t,mapProjection:e,visible:n})=>{const r=D.useRef(new WM);return D.useEffect(()=>{const i=r.current,o=t.features;if(o.length===0)i.clear();else{const s=i.getFeatures(),a=new Set(s.map(f=>f.getId())),l=new Set(o.map(f=>f.id)),c=o.filter(f=>!a.has(f.id));s.filter(f=>!l.has(f.getId()+"")).forEach(f=>i.removeFeature(f)),c.forEach(f=>{const d=new t1().readFeature(f,{dataProjection:"EPSG:4326",featureProjection:e});d.getId()!==f.id&&d.setId(f.id);const h=(f.properties||{}).color||"red",p=(f.properties||{}).opacity,g=(f.properties||{}).source?"diamond":"circle";Gae(d,h,Qee(p),g),i.addFeature(d)})}},[t,e]),C.jsx(I4,{id:t.id,opacity:t.id===_f?1:.8,visible:n,zIndex:501,source:r.current})};class lfn extends nO{addMapObject(e){const n=new yvt(this.getOptions());return e.addControl(n),n}updateMapObject(e,n,r){return n.setProperties(this.getOptions()),n}removeMapObject(e,n){e.removeControl(n)}}class Q9 extends nO{addMapObject(e){const n=new Zvt(this.getOptions()),r=!!this.props.active;return n.setActive(r),e.addInteraction(n),r&&this.listen(n,this.props),n}updateMapObject(e,n,r){n.setProperties(this.getOptions());const i=!!this.props.active;return n.setActive(i),this.unlisten(n,r),i&&this.listen(n,this.props),n}removeMapObject(e,n){this.unlisten(n,this.props),e.removeInteraction(n)}getOptions(){const e=super.getOptions();delete e.layerId,delete e.active,delete e.onDrawStart,delete e.onDrawEnd;const n=this.props.layerId;if(n&&!e.source){const r=this.getMapObject(n);r&&(e.source=r.getSource())}return e}listen(e,n){const{onDrawStart:r,onDrawEnd:i}=n;r&&e.on("drawstart",r),i&&e.on("drawend",i)}unlisten(e,n){const{onDrawStart:r,onDrawEnd:i}=n;r&&e.un("drawstart",r),i&&e.un("drawend",i)}}class cfn extends nO{addMapObject(e){return this.updateView(e)}removeMapObject(e,n){}updateMapObject(e,n){return this.updateView(e)}updateView(e){const n=this.props.projection;let r=e.getView().getProjection();if(typeof n=="string"&&r&&(r=r.getCode()),n&&n!==r){const i=e.getView(),o=new Np({...this.props,center:O4(i.getCenter()||[0,0],r,n),minZoom:i.getMinZoom(),zoom:i.getZoom()});e.getLayers().forEach(s=>{s instanceof A4&&s.getSource().forEachFeature(a=>{var l;(l=a.getGeometry())==null||l.transform(r,n)})}),e.setView(o)}else e.getView().setProperties(this.props);return e.getView()}}function xL(t,e){const n=t.getLayers();for(let r=0;r{if(R){const B=O||null;if(B!==M&&Kc[K9]){const $=Kc[K9].getSource();if($.clear(),B){const q=pfn(R,B);if(q){const G=q.clone();G.setId("select-"+q.getId()),G.setStyle(void 0),$.addFeature(G)}}I(B)}}},[R,O,M]),D.useEffect(()=>{R&&R.getLayers().forEach(B=>{B instanceof yRe?B.getSource().changed():B.changed()})},[R,E]),D.useEffect(()=>{if(R===null||!vr(P))return;const B=ee=>{Wbe(R,ee,P,0)},F=ee=>{Wbe(R,ee,P,1)},$=ee=>{ee.context.restore()},q=xL(R,"rgb2"),G=xL(R,"variable2"),Y=xL(R,"rgb"),le=xL(R,"variable"),K=[[q,B],[G,B],[Y,F],[le,F]];for(const[ee,re]of K)ee&&(ee.on("prerender",re),ee.on("postrender",$));return()=>{for(const[ee,re]of K)ee&&(ee.un("prerender",re),ee.un("postrender",$))}});const j=B=>{if(n==="Select"){const F=B.map;let $=null;const q=F.getFeaturesAtPixel(B.pixel);if(q){for(const G of q)if(typeof G.getId=="function"){$=G.getId()+"";break}}S&&S($,k,!1)}},N=B=>{var F;if(R!==null&&y&&n!=="Select"){const $=B.feature;let q=$.getGeometry();if(!q)return;const G=Uf(rO+n.toLowerCase()+"-"),Y=R.getView().getProjection();if(q instanceof Ite){const te=Kpt(q);$.setGeometry(te)}q=$.clone().getGeometry().transform(Y,tO);const le=new t1().writeGeometryObject(q);$.setId(G);let K=0;if(Kc[_f]){const te=Kc[_f],ae=(F=te==null?void 0:te.getSource())==null?void 0:F.getFeatures();ae&&(K=ae.length)}const ee=gfn(b,n),re=rb(K),ge=DPe(re,t.palette.mode);Gae($,ge,Qee()),y(v,G,{label:ee,color:re},le,!0)}return!0};function z(B){A&&A(B),T(B)}const L=B=>{x&&B.forEach(F=>{const $=new FileReader;$.onloadend=()=>{typeof $.result=="string"&&x($.result)},$.readAsText(F,"UTF-8")})};return C.jsx(GPe,{children:C.jsxs(o0t,{id:e,onClick:B=>j(B),onMapRef:z,mapObjects:Kc,isStale:!0,onDropFiles:L,children:[C.jsx(cfn,{id:"view",projection:r}),C.jsxs(vRe,{children:[i,o,s,a,l,f,c,C.jsx(I4,{id:K9,opacity:.7,zIndex:500,style:dfn,source:ufn}),C.jsx(C.Fragment,{children:b.map(B=>C.jsx(afn,{placeGroup:B,mapProjection:r,visible:_&&w[B.id]},B.id))})]}),u,C.jsx(Q9,{id:"drawPoint",layerId:_f,active:n==="Point",type:"Point",wrapX:!0,stopClick:!0,onDrawEnd:N}),C.jsx(Q9,{id:"drawPolygon",layerId:_f,active:n==="Polygon",type:"Polygon",wrapX:!0,stopClick:!0,onDrawEnd:N}),C.jsx(Q9,{id:"drawCircle",layerId:_f,active:n==="Circle",type:"Circle",wrapX:!0,stopClick:!0,onDrawEnd:N}),d,h,g,m,p,C.jsx(lfn,{bar:!1})]})})}function pfn(t,e){var n;for(const r of t.getLayers().getArray())if(r instanceof A4){const o=(n=r.getSource())==null?void 0:n.getFeatureById(e);if(o)return o}return null}function gfn(t,e){const n=me.get(e),r=t.find(i=>i.id===_f);if(r)for(let i=1;;i++){const o=`${n} ${i}`;if(!!!r.features.find(a=>a.properties?a.properties.label===o:!1))return o}return`${n} 1`}function Wbe(t,e,n,r){const i=t.getSize();if(!i)return;const o=i[0],s=i[1];let a,l,c,u;r===0?(a=dm(e,[0,0]),l=dm(e,[n,0]),c=dm(e,[0,s]),u=dm(e,[n,s])):(a=dm(e,[n,0]),l=dm(e,[o,0]),c=dm(e,[n,s]),u=dm(e,[o,s]));const f=e.context;f.save(),f.beginPath(),f.moveTo(a[0],a[1]),f.lineTo(c[0],c[1]),f.lineTo(u[0],u[1]),f.lineTo(l[0],l[1]),f.closePath(),f.clip()}const bL=1,sP=.2,qO=240,NVe=20,wL={container:{width:qO},itemContainer:{display:"flex",alignItems:"center",justifyContent:"flex-start"},itemLabelBox:{paddingLeft:1,fontSize:"small"},itemColorBox:t=>({width:"48px",height:"16px",borderStyle:"solid",borderColor:t.palette.mode==="dark"?"lightgray":"darkgray",borderWidth:1})};function mfn({categories:t,onOpenColorBarEditor:e}){return!t||t.length===0?null:C.jsx(ot,{sx:wL.container,children:t.map((n,r)=>C.jsxs(ot,{onClick:e,sx:wL.itemContainer,children:[C.jsx(ot,{sx:wL.itemColorBox,style:{backgroundColor:n.color}}),C.jsx(ot,{component:"span",sx:wL.itemLabelBox,children:`${n.label||`Category ${r+1}`} (${n.value})`})]},r))})}const Vbe={nominal:{cursor:"pointer"},error:{cursor:"pointer",border:"0.5px solid red"}};function vfn({colorBar:t,opacity:e,width:n,height:r,onClick:i}){const o=D.useRef(null);D.useEffect(()=>{const c=o.current;c!==null&&vwt(t,e,c)},[t,e]);const{baseName:s,imageData:a}=t,l=a?s:me.get("Unknown color bar")+`: ${s}`;return C.jsx(Lt,{title:l,children:C.jsx("canvas",{ref:o,width:n||qO,height:r||NVe+4,onClick:i,style:a?Vbe.nominal:Vbe.error})})}function yfn(t,e,n=5,r=!1,i=!1){return zQ(bfn(t,e,n,r),i)}function zQ(t,e=!1){return t.map(n=>xy(n,void 0,e))}function xy(t,e,n){if(e===void 0&&(e=n?2:xfn(t)),n)return t.toExponential(e);const r=Math.round(t);if(r===t||Math.abs(r-t)<1e-8)return r+"";{let i=t.toFixed(e);if(i.includes("."))for(;i.endsWith("0")&&!i.endsWith(".0");)i=i.substring(0,i.length-1);return i}}function xfn(t){if(t===0||t===Math.floor(t))return 0;const e=Math.floor(Math.log10(Math.abs(t)));return Math.min(16,Math.max(2,e<0?1-e:0))}function bfn(t,e,n,r){const i=new Array(n);if(r){const o=Math.log10(t),a=(Math.log10(e)-o)/(n-1);for(let l=1;lyfn(t,e,n,r),[t,e,n,r]);return C.jsx(ot,{sx:wfn.container,onClick:i,children:o.map((s,a)=>C.jsx("span",{children:s},a))})}const Sfn=ct(C.jsx("path",{d:"M8 19h3v3h2v-3h3l-4-4zm8-15h-3V1h-2v3H8l4 4zM4 9v2h16V9zm0 3h16v2H4z"}),"Compress"),Gbe=t=>t,Cfn=t=>Math.pow(10,t),Ofn=Math.log10,Hbe=(t,e)=>typeof t=="number"?e(t):t.map(e);class Efn{constructor(e){gn(this,"_fn");gn(this,"_invFn");e?(this._fn=Ofn,this._invFn=Cfn):(this._fn=Gbe,this._invFn=Gbe)}scale(e){return Hbe(e,this._fn)}scaleInv(e){return Hbe(e,this._invFn)}}function Tfn({variableColorBarName:t,variableColorBarMinMax:e,variableColorBarNorm:n,variableOpacity:r,updateVariableColorBar:i,originalColorBarMinMax:o}){const s=D.useMemo(()=>new Efn(n==="log"),[n]),[a,l]=D.useState(()=>s.scale(e));D.useEffect(()=>{l(s.scale(e))},[s,e]);const c=(k,E)=>{Array.isArray(E)&&l(E)},u=(k,E)=>{if(Array.isArray(E)){const A=zQ(s.scaleInv(E)).map(R=>Number.parseFloat(R));i(t,A,n,r)}},[f,d]=s.scale(o),h=f=2?v=Math.max(2,Math.round(m/2)):(v=4,m=8);const y=f({value:S[E],label:k}));return C.jsx(YC,{min:b,max:w,value:a,marks:O,step:_,valueLabelFormat:k=>xy(s.scaleInv(k)),onChange:c,onChangeCommitted:u,valueLabelDisplay:"auto",size:"small"})}const Z9=5,ym={container:t=>({marginTop:t.spacing(2),marginBottom:t.spacing(2),display:"flex",flexDirection:"column",gap:1}),header:{display:"flex",alignItems:"center",justifyContent:"space-between"},title:{paddingLeft:2,fontWeight:"bold"},sliderBox:t=>({marginTop:t.spacing(1),marginLeft:t.spacing(Z9),marginRight:t.spacing(Z9),minWidth:320,width:`calc(100% - ${t.spacing(2*(Z9+1))}px)`}),logLabel:{margin:0,paddingRight:2,fontWeight:"bold"},minMaxBox:{display:"flex",justifyContent:"center"},minTextField:{maxWidth:"8em",marginRight:2},maxTextField:{maxWidth:"8em",marginLeft:2}};function kfn({variableColorBar:t,variableColorBarName:e,variableColorBarMinMax:n,variableColorBarNorm:r,variableOpacity:i,updateVariableColorBar:o}){const[s,a]=D.useState(n),[l,c]=D.useState(n),[u,f]=D.useState(qbe(n)),[d,h]=D.useState([!1,!1]);D.useEffect(()=>{f(qbe(n))},[n]);const p=y=>{const x=y.target.value;f([x,u[1]]);const b=Number.parseFloat(x);let w=!1;if(!Number.isNaN(b)&&b{const x=y.target.value;f([u[0],x]);const b=Number.parseFloat(x);let w=!1;if(!Number.isNaN(b)&&b>s[0]){if(b!==s[1]){const _=[s[0],b];a(_),c(_),o(e,_,r,i)}}else w=!0;h([d[0],w])},m=()=>{const y=t.colorRecords,x=y[0].value,b=y[y.length-1].value,w=[x,b];a(w),c(w),o(e,w,r,i),h([!1,!1])},v=(y,x)=>{o(e,n,x?"log":"lin",i)};return C.jsxs(ot,{sx:ym.container,children:[C.jsxs(ot,{sx:ym.header,children:[C.jsx(Jt,{sx:ym.title,children:me.get("Value Range")}),C.jsx("span",{style:{flexGrow:1}}),t.colorRecords&&C.jsx(lu,{sx:{marginRight:1},icon:C.jsx(Sfn,{}),onClick:m,tooltipText:me.get("Set min/max from color mapping values")}),C.jsx(Px,{sx:ym.logLabel,control:C.jsx(Lt,{title:me.get("Logarithmic scaling"),children:C.jsx(TPe,{checked:r==="log",onChange:v,size:"small"})}),label:C.jsx(Jt,{variant:"body2",children:me.get("Log-scaled")}),labelPlacement:"start"})]}),C.jsx(ot,{sx:ym.sliderBox,children:C.jsx(Tfn,{variableColorBarName:e,variableColorBarMinMax:n,variableColorBarNorm:r,updateVariableColorBar:o,originalColorBarMinMax:l,variableOpacity:i})}),C.jsxs(ot,{component:"form",sx:ym.minMaxBox,children:[C.jsx(di,{sx:ym.minTextField,label:"Minimum",variant:"filled",size:"small",value:u[0],error:d[0],onChange:y=>p(y)}),C.jsx(di,{sx:ym.maxTextField,label:"Maximum",variant:"filled",size:"small",value:u[1],error:d[1],onChange:y=>g(y)})]})]})}function qbe(t){return[t[0]+"",t[1]+""]}function Afn({variableColorBar:t,variableColorBarName:e,variableColorBarMinMax:n,variableColorBarNorm:r,variableOpacity:i,updateVariableColorBar:o,onOpenColorBarEditor:s}){const[a,l]=D.useState(null),c=f=>{l(f.currentTarget)},u=()=>{l(null)};return C.jsxs(C.Fragment,{children:[C.jsx(vfn,{colorBar:t,opacity:i,onClick:s}),C.jsx(_fn,{minValue:n[0],maxValue:n[1],numTicks:5,logScaled:r==="log",onClick:c}),C.jsx(Qb,{anchorEl:a,open:!!a,onClose:u,anchorOrigin:{vertical:"bottom",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"center"},children:C.jsx(kfn,{variableColorBar:t,variableColorBarName:e,variableColorBarMinMax:n,variableColorBarNorm:r,variableOpacity:i,updateVariableColorBar:o})})]})}const Pfn=ct(C.jsx("path",{d:"M12 4.81V19c-3.31 0-6-2.63-6-5.87 0-1.56.62-3.03 1.75-4.14zM6.35 7.56C4.9 8.99 4 10.96 4 13.13 4 17.48 7.58 21 12 21s8-3.52 8-7.87c0-2.17-.9-4.14-2.35-5.57L12 2z"}),"InvertColors"),Mfn=ct(C.jsx("path",{d:"M17.66 8 12 2.35 6.34 8C4.78 9.56 4 11.64 4 13.64s.78 4.11 2.34 5.67 3.61 2.35 5.66 2.35 4.1-.79 5.66-2.35S20 15.64 20 13.64 19.22 9.56 17.66 8M6 14c.01-2 .62-3.27 1.76-4.4L12 5.27l4.24 4.38C17.38 10.77 17.99 12 18 14z"}),"Opacity"),b2={container:{display:"flex",alignItems:"center",justifyContent:"space-between"},settingsBar:{display:"flex",gap:"1px"},toggleButton:{paddingTop:"2px",paddingBottom:"2px"},opacityContainer:{display:"flex",alignItems:"center"},opacityLabel:t=>({color:t.palette.text.secondary}),opacitySlider:{flexGrow:"1px",marginLeft:"10px",marginRight:"10px"}};function Rfn({variableColorBarName:t,variableColorBarMinMax:e,variableColorBarNorm:n,variableColorBar:r,variableOpacity:i,updateVariableColorBar:o}){const s=()=>{const c=!r.isAlpha;t=lN({...r,isAlpha:c}),o(t,e,n,i)},a=()=>{const c=!r.isReversed;t=lN({...r,isReversed:c}),o(t,e,n,i)},l=(c,u)=>{o(t,e,n,u)};return C.jsxs(C.Fragment,{children:[C.jsx(ot,{sx:b2.container,children:C.jsxs(ot,{sx:b2.settingsBar,children:[C.jsx(Lt,{arrow:!0,title:me.get("Hide small values"),children:C.jsx(yr,{value:"alpha",selected:r.isAlpha,onChange:s,size:"small",children:C.jsx(Mfn,{fontSize:"inherit"})})}),C.jsx(Lt,{arrow:!0,title:me.get("Reverse"),children:C.jsx(yr,{value:"reverse",selected:r.isReversed,onChange:a,size:"small",children:C.jsx(Pfn,{fontSize:"inherit"})})})]})}),C.jsxs(ot,{component:"div",sx:b2.opacityContainer,children:[C.jsx(ot,{component:"span",fontSize:"small",sx:b2.opacityLabel,children:me.get("Opacity")}),C.jsx(YC,{min:0,max:1,value:i,step:.01,sx:b2.opacitySlider,onChange:l,size:"small"})]})]})}const Dfn={colorBarGroupTitle:t=>({marginTop:t.spacing(2*sP),fontSize:"small",color:t.palette.text.secondary})};function zVe({title:t,description:e}){return C.jsx(Lt,{arrow:!0,title:e,placement:"left",children:C.jsx(ot,{sx:Dfn.colorBarGroupTitle,children:t})})}const Xbe=t=>({marginTop:t.spacing(sP),height:20,borderWidth:1,borderStyle:"solid",cursor:"pointer"}),Ybe={colorBarItem:t=>({...Xbe(t),borderColor:t.palette.mode==="dark"?"lightgray":"darkgray"}),colorBarItemSelected:t=>({...Xbe(t),borderColor:"blue"})};function Ple({imageData:t,selected:e,onSelect:n,width:r,title:i}){let o=C.jsx("img",{src:t?`data:image/png;base64,${t}`:void 0,alt:t?"color bar":"error",width:"100%",height:"100%",onClick:n});return i&&(o=C.jsx(Lt,{arrow:!0,title:i,placement:"left",children:o})),C.jsx(ot,{width:r||qO,sx:e?Ybe.colorBarItemSelected:Ybe.colorBarItem,children:o})}function Ifn({colorBarGroup:t,selectedColorBarName:e,onSelectColorBar:n,images:r}){return C.jsxs(C.Fragment,{children:[C.jsx(zVe,{title:t.title,description:t.description}),t.names.map(i=>C.jsx(Ple,{title:i,imageData:r[i],selected:i===e,onSelect:()=>n(i)},i))]})}const EU=ct(C.jsx("path",{d:"M13 7h-2v4H7v2h4v4h2v-4h4v-2h-4zm-1-5C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8"}),"AddCircleOutline");function jVe(){const t=D.useRef(),e=D.useRef(()=>{t.current&&(t.current(),t.current=void 0)}),n=D.useRef(r=>{t.current=r});return D.useEffect(()=>e.current,[]),[e.current,n.current]}const Lfn=ct(C.jsx("path",{d:"M12 2C6.47 2 2 6.47 2 12s4.47 10 10 10 10-4.47 10-10S17.53 2 12 2m5 13.59L15.59 17 12 13.41 8.41 17 7 15.59 10.59 12 7 8.41 8.41 7 12 10.59 15.59 7 17 8.41 13.41 12z"}),"Cancel"),$fn=ct(C.jsx("path",{d:"M9 16.2 4.8 12l-1.4 1.4L9 19 21 7l-1.4-1.4z"}),"Done");function Ffn({anchorEl:t,markdownText:e,open:n,onClose:r}){if(!e)return null;const i={code:o=>{const{node:s,...a}=o;return C.jsx("code",{...a,style:{color:"green"}})}};return C.jsx(Qb,{anchorEl:t,open:n,onClose:r,children:C.jsx(Tl,{sx:{width:"32em",overflowY:"auto",fontSize:"smaller",paddingLeft:2,paddingRight:2},children:C.jsx(mU,{children:e,components:i,linkTarget:"_blank"})})})}function BVe({size:t,helpUrl:e}){const[n,r]=D.useState(null),i=D.useRef(null),o=xWe(e),s=()=>{r(i.current)},a=()=>{r(null)};return C.jsxs(C.Fragment,{children:[C.jsx(Ht,{onClick:s,size:t,ref:i,children:C.jsx(HPe,{fontSize:"inherit"})}),C.jsx(Ffn,{anchorEl:n,open:!!n,onClose:a,markdownText:o})]})}const Qbe={container:{display:"flex",justifyContent:"space-between",gap:.2},doneCancel:{display:"flex",gap:.2}};function nD({onDone:t,onCancel:e,doneDisabled:n,cancelDisabled:r,size:i,helpUrl:o}){return C.jsxs(ot,{sx:Qbe.container,children:[C.jsx(ot,{children:o&&C.jsx(BVe,{size:i,helpUrl:o})}),C.jsxs(ot,{sx:Qbe.doneCancel,children:[C.jsx(Ht,{onClick:t,color:"primary",disabled:n,size:i,children:C.jsx($fn,{fontSize:"inherit"})}),C.jsx(Ht,{onClick:e,color:"primary",disabled:r,size:i,children:C.jsx(Lfn,{fontSize:"inherit"})})]})]})}const J9={radioGroup:{marginLeft:1},radio:{padding:"4px"},label:{fontSize:"small"}},Nfn=[["continuous","Contin.","Continuous color assignment, where each value represents a support point of a color gradient"],["stepwise","Stepwise","Stepwise color mapping where values are bounds of value ranges mapped to the same single color"],["categorical","Categ.","Values represent unique categories or indexes that are mapped to a color"]];function zfn({colorMapType:t,setColorMapType:e}){return C.jsx(Vee,{row:!0,value:t,onChange:(n,r)=>{e(r)},sx:J9.radioGroup,children:Nfn.map(([n,r,i])=>C.jsx(Lt,{arrow:!0,title:me.get(i),children:C.jsx(Px,{value:n,control:C.jsx(JT,{size:"small",sx:J9.radio}),label:C.jsx(ot,{component:"span",sx:J9.label,children:me.get(r)})})},n))})}function jfn({userColorBar:t,updateUserColorBar:e,selected:n,onSelect:r,onDone:i,onCancel:o}){const s=l=>{e({...t,code:l.currentTarget.value})},a=l=>{e({...t,type:l})};return C.jsxs(ot,{children:[C.jsx(Ple,{imageData:t.imageData,title:t.errorMessage,selected:n,onSelect:r}),C.jsx(zfn,{colorMapType:t.type,setColorMapType:a}),C.jsx(di,{label:"Color mapping",placeholder:yDe,multiline:!0,fullWidth:!0,size:"small",minRows:3,sx:{marginTop:1,fontFamily:"monospace"},value:t.code,onChange:s,color:t.errorMessage?"error":"primary",inputProps:{style:{fontFamily:"monospace",fontSize:12}}}),C.jsx(nD,{onDone:i,onCancel:o,doneDisabled:!!t.errorMessage,size:"small",helpUrl:me.get("docs/color-mappings.en.md")})]})}const Bfn=ct(C.jsx("path",{d:"M6 10c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2m12 0c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2m-6 0c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2"}),"MoreHoriz"),Ufn={container:{display:"flex",alignItems:"center",width:qO,height:NVe,gap:sP,marginTop:sP}};function Wfn({imageData:t,title:e,selected:n,onEdit:r,onRemove:i,onSelect:o,disabled:s}){const[a,l]=D.useState(null),c=p=>{l(p.currentTarget)},u=()=>{l(null)},f=()=>{l(null),r()},d=()=>{l(null),i()},h=!!a;return C.jsxs(C.Fragment,{children:[C.jsxs(ot,{sx:Ufn.container,children:[C.jsx(Ple,{imageData:t,selected:n,onSelect:o,width:qO-20,title:e}),C.jsx(Ht,{size:"small",onClick:c,children:C.jsx(Bfn,{fontSize:"inherit"})})]}),C.jsx(Qb,{anchorOrigin:{vertical:"center",horizontal:"center"},transformOrigin:{vertical:"center",horizontal:"center"},open:h,anchorEl:a,onClose:u,children:C.jsxs(ot,{children:[C.jsx(Ht,{onClick:f,size:"small",disabled:s,children:C.jsx(VO,{fontSize:"inherit"})}),C.jsx(Ht,{onClick:d,size:"small",disabled:s,children:C.jsx(vU,{fontSize:"inherit"})})]})})]})}const Vfn={container:{display:"flex",justifyContent:"space-between",alignItems:"center",gap:1}};function Gfn({colorBarGroup:t,selectedColorBarName:e,onSelectColorBar:n,userColorBars:r,addUserColorBar:i,removeUserColorBar:o,updateUserColorBar:s,updateUserColorBars:a,storeSettings:l}){const[c,u]=D.useState({}),[f,d]=jVe(),h=D.useMemo(()=>r.findIndex(x=>x.id===c.colorBarId),[r,c.colorBarId]),p=()=>{d(()=>a(r));const x=Uf("ucb");i(x),u({action:"add",colorBarId:x})},g=x=>{d(()=>a(r)),u({action:"edit",colorBarId:x})},m=x=>{d(void 0),o(x)},v=()=>{d(void 0),u({}),l()},y=()=>{f(),u({})};return C.jsxs(C.Fragment,{children:[C.jsxs(ot,{sx:Vfn.container,children:[C.jsx(zVe,{title:me.get(t.title),description:me.get(t.description)}),C.jsx(Ht,{onClick:p,size:"small",color:"primary",disabled:!!c.action,children:C.jsx(EU,{fontSize:"inherit"})})]}),r.map(x=>x.id===c.colorBarId&&h>=0?C.jsx(jfn,{userColorBar:x,updateUserColorBar:s,selected:x.id===e,onSelect:()=>n(x.id),onDone:v,onCancel:y},x.id):C.jsx(Wfn,{imageData:x.imageData,title:x.errorMessage,disabled:!!c.action,selected:x.id===e,onSelect:()=>n(x.id),onEdit:()=>g(x.id),onRemove:()=>m(x.id)},x.id))]})}function Hfn({variableColorBarName:t,variableColorBarMinMax:e,variableColorBarNorm:n,variableColorBar:r,variableOpacity:i,updateVariableColorBar:o,colorBars:s,userColorBars:a,addUserColorBar:l,removeUserColorBar:c,updateUserColorBar:u,updateUserColorBars:f,storeSettings:d}){const h=p=>{t=lN({...r,baseName:p}),o(t,e,n,i)};return C.jsx(C.Fragment,{children:s.groups.map(p=>p.title===vDe?C.jsx(Gfn,{colorBarGroup:p,selectedColorBarName:r.baseName,onSelectColorBar:h,userColorBars:a,addUserColorBar:l,removeUserColorBar:c,updateUserColorBar:u,updateUserColorBars:f,storeSettings:d},p.title):C.jsx(Ifn,{colorBarGroup:p,selectedColorBarName:r.baseName,onSelectColorBar:h,images:s.images},p.title))})}const qfn={colorBarBox:t=>({marginTop:t.spacing(bL-2*sP),marginLeft:t.spacing(bL),marginRight:t.spacing(bL),marginBottom:t.spacing(bL)})};function Xfn(t){const{colorBars:e,userColorBars:n,addUserColorBar:r,removeUserColorBar:i,updateUserColorBar:o,updateUserColorBars:s,...a}=t;return C.jsxs(ot,{sx:qfn.colorBarBox,children:[C.jsx(Rfn,{...a}),C.jsx(Hfn,{...a,colorBars:e,userColorBars:n,addUserColorBar:r,removeUserColorBar:i,updateUserColorBar:o,updateUserColorBars:s})]})}const Kbe={container:t=>({position:"absolute",zIndex:1e3,top:10,borderRadius:"5px",borderWidth:"1px",borderStyle:"solid",borderColor:"#00000020",backgroundColor:"#FFFFFFAA",color:"black",maxWidth:`${qO+20}px`,paddingLeft:t.spacing(1.5),paddingRight:t.spacing(1.5),paddingBottom:t.spacing(.5),paddingTop:t.spacing(.5)}),title:t=>({fontSize:"small",fontWeight:"bold",width:"100%",display:"flex",wordBreak:"break-word",wordWrap:"break-word",justifyContent:"center",paddingBottom:t.spacing(.5)})};function UVe(t){const{variableName:e,variableTitle:n,variableUnits:r,variableColorBar:i,style:o}=t,s=D.useRef(null),[a,l]=D.useState(null),c=()=>{l(s.current)},u=()=>{l(null)};if(!e)return null;const f=i.type==="categorical"?n||e:`${n||e} (${r||"-"})`;return C.jsxs(ot,{sx:Kbe.container,style:o,ref:s,children:[C.jsx(Jt,{sx:Kbe.title,children:f}),i.type==="categorical"?C.jsx(mfn,{categories:i.colorRecords,onOpenColorBarEditor:c,...t}):C.jsx(Afn,{onOpenColorBarEditor:c,...t}),C.jsx(Qb,{anchorEl:a,open:!!a,onClose:u,anchorOrigin:{vertical:"bottom",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"left"},children:C.jsx(Xfn,{...t})})]})}const Yfn=t=>({variableName:n1(t),variableTitle:o_t(t),variableUnits:a_t(t),variableColorBarName:N4(t),variableColorBarMinMax:ADe(t),variableColorBarNorm:RDe(t),variableColorBar:ine(t),variableOpacity:NDe(t),userColorBars:r1(t),colorBars:j4(t),style:{right:10}}),Qfn={updateVariableColorBar:VQt,addUserColorBar:k8e,removeUserColorBar:M8e,updateUserColorBar:R8e,updateUserColorBars:L8e,storeSettings:T8e},Kfn=Rn(Yfn,Qfn)(UVe),Zfn=t=>{const e=t.controlState.variableSplitPos;return{variableName:e?ene(t):null,variableTitle:s_t(t),variableUnits:l_t(t),variableColorBarName:z4(t),variableColorBarMinMax:PDe(t),variableColorBarNorm:DDe(t),variableColorBar:LDe(t),variableOpacity:zDe(t),userColorBars:r1(t),colorBars:j4(t),style:{left:e?e-280:0}}},Jfn={updateVariableColorBar:GQt,addUserColorBar:k8e,removeUserColorBar:M8e,updateUserColorBar:R8e,updateUserColorBars:L8e,storeSettings:T8e},edn=Rn(Zfn,Jfn)(UVe),tdn={splitter:{position:"absolute",top:0,left:"50%",width:"6px",height:"100%",backgroundColor:"#ffffff60",zIndex:999,borderLeft:"0.5px solid #ffffffd0",borderRight:"0.5px solid #ffffffd0",cursor:"col-resize",boxShadow:"0px 0px 1px 0px black"}};function ndn({hidden:t,position:e,onPositionChange:n}){const r=D.useRef(null),i=D.useRef(([s,a])=>{r.current!==null&&n(r.current.offsetLeft+s)}),o=$Ve(i.current);return D.useEffect(()=>{!t&&!vr(e)&&r.current!==null&&r.current.parentElement!==null&&n(Math.round(r.current.parentElement.clientWidth/2))},[t,e,n]),t?null:C.jsx(ot,{id:"MapSplitter",ref:r,sx:tdn.splitter,style:{left:vr(e)?e:"50%"},onMouseDown:o})}const rdn=t=>({hidden:!t.controlState.variableCompareMode,position:t.controlState.variableSplitPos}),idn={onPositionChange:lKt},odn=Rn(rdn,idn)(ndn);function sdn(t,e,n,r,i,o,s){const a=D.useRef(0),[l,c]=D.useState(),[u,f]=D.useState(),[d,h]=D.useState(),p=D.useCallback(async(v,y,x,b,w)=>{w({dataset:v,variable:y,result:{fetching:!0}});try{const _=await cSt(e,v,y,x,b,s,null);console.info(y.name,"=",_),w({dataset:v,variable:y,result:{value:_.value}})}catch(_){w({dataset:v,variable:y,result:{error:_}})}},[e,s]),g=D.useCallback(v=>{const y=v.map;if(!t||!n||!r||!y){f(void 0),h(void 0);return}const x=v.pixel[0],b=v.pixel[1],w=O4(v.coordinate,y.getView().getProjection().getCode(),"EPSG:4326"),_=w[0],S=w[1];c({pixelX:x,pixelY:b,lon:_,lat:S});const O=new Date().getTime();O-a.current>=500&&(a.current=O,p(n,r,_,S,f).finally(()=>{i&&o&&p(i,o,_,S,h)}))},[p,t,n,r,i,o]),m=Kc.map;return D.useEffect(()=>{if(t&&m){const v=y=>{y.dragging?c(void 0):g(y)};return m.on("pointermove",v),()=>{m.un("pointermove",v)}}else c(void 0)},[t,m,g]),D.useMemo(()=>l&&u?{location:l,payload:u,payload2:d}:null,[l,u,d])}const up={container:{display:"grid",gridTemplateColumns:"auto minmax(60px, auto)",gap:0,padding:1,fontSize:"small"},labelItem:{paddingRight:1},valueItem:{textAlign:"right",fontFamily:"monospace"}};function adn({location:t,payload:e,payload2:n}){return C.jsxs(ot,{sx:up.container,children:[C.jsx(ot,{sx:up.labelItem,children:"Longitude"}),C.jsx(ot,{sx:up.valueItem,children:xy(t.lon,4)}),C.jsx(ot,{sx:up.labelItem,children:"Latitude"}),C.jsx(ot,{sx:up.valueItem,children:xy(t.lat,4)}),C.jsx(ot,{sx:up.labelItem,children:Zbe(e)}),C.jsx(ot,{sx:up.valueItem,children:Jbe(e)}),n&&C.jsx(ot,{sx:up.labelItem,children:Zbe(n)}),n&&C.jsx(ot,{sx:up.valueItem,children:Jbe(n)})]})}function Zbe(t){const e=t.variable;return e.title||e.name}function Jbe(t){const e=t.result;return e.error?`${e.error}`:e.fetching?"...":vr(e.value)?xy(e.value,4):"---"}const ldn={container:{position:"absolute",zIndex:1e3,backgroundColor:"#000000A0",color:"#fff",border:"1px solid #FFFFFF50",borderRadius:"4px",transform:"translateX(3%)",pointerEvents:"none"}};function cdn({enabled:t,serverUrl:e,dataset1:n,variable1:r,dataset2:i,variable2:o,time:s}){const a=sdn(t,e,n,r,i,o,s);if(!a)return null;const{pixelX:l,pixelY:c}=a.location;return C.jsx(ot,{sx:{...ldn.container,left:l,top:c},children:C.jsx(adn,{...a})})}const udn=t=>({enabled:t.controlState.mapPointInfoBoxEnabled,serverUrl:Oo(t).url,dataset1:fo(t),variable1:Na(t),dataset2:zy(t),variable2:Gg(t),time:i1(t)}),fdn={},ddn=Rn(udn,fdn)(cdn),hdn=ct(C.jsx("path",{d:"M10 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h5v2h2V1h-2zm0 15H5l5-6zm9-15h-5v2h5v13l-5-6v9h5c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2"}),"Compare"),WVe=ct(C.jsx("path",{d:"m11.99 18.54-7.37-5.73L3 14.07l9 7 9-7-1.63-1.27zM12 16l7.36-5.73L21 9l-9-7-9 7 1.63 1.27z"}),"Layers"),pdn=ct(C.jsx("path",{d:"M20 2H4c-1.1 0-1.99.9-1.99 2L2 22l4-4h14c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2m-2 12H6v-2h12zm0-3H6V9h12zm0-3H6V6h12z"}),"Message"),e1e={position:"absolute",display:"flex",flexDirection:"column",zIndex:1e3};function gdn({style:t,sx:e,children:n}){return C.jsx(ot,{className:"ol-unselectable ol-control",sx:e,style:t?{...e1e,...t}:e1e,children:n})}const VVe={width:"1.375em",height:"1.375em"},mdn={...VVe,backgroundColor:"rgba(0,80,180,0.9)"},vdn={tooltip:{sx:{backgroundColor:"#4A4A4A",border:"1px solid white",borderRadius:0}}};function e7({icon:t,tooltipTitle:e,onClick:n,selected:r,onSelect:i}){const o=s=>{i&&i(s,!r),n&&n(s)};return e&&(t=C.jsx(Lt,{title:e,componentsProps:vdn,children:t})),C.jsx(Ht,{onClick:o,style:r?mdn:VVe,children:t})}const ydn={left:"0.5em",top:65};function xdn({layerMenuOpen:t,setLayerMenuOpen:e,variableCompareMode:n,setVariableCompareMode:r,mapPointInfoBoxEnabled:i,setMapPointInfoBoxEnabled:o}){return C.jsxs(gdn,{style:ydn,children:[C.jsx(e7,{icon:C.jsx(WVe,{fontSize:"small"}),tooltipTitle:me.get("Show or hide layers panel"),selected:t,onSelect:(s,a)=>void e(a)}),C.jsx(e7,{icon:C.jsx(hdn,{fontSize:"small"}),tooltipTitle:me.get("Turn layer split mode on or off"),selected:n,onSelect:(s,a)=>void r(a)}),C.jsx(e7,{icon:C.jsx(pdn,{fontSize:"small"}),tooltipTitle:me.get("Turn info box on or off"),selected:i,onSelect:(s,a)=>void o(a)})]})}const bdn=t=>({layerMenuOpen:t.controlState.layerMenuOpen,variableCompareMode:t.controlState.variableCompareMode,mapPointInfoBoxEnabled:t.controlState.mapPointInfoBoxEnabled}),wdn={setLayerMenuOpen:d8e,setVariableCompareMode:aKt,setMapPointInfoBoxEnabled:sKt},_dn=Rn(bdn,wdn)(xdn),Sdn=(t,e)=>({mapId:"map",locale:t.controlState.locale,variableLayer:D_t(t),variable2Layer:I_t(t),rgbLayer:L_t(t),rgb2Layer:$_t(t),datasetBoundaryLayer:R_t(t),placeGroupLayers:j_t(t),colorBarLegend:C.jsx(Kfn,{}),colorBarLegend2:C.jsx(edn,{}),mapSplitter:C.jsx(odn,{}),mapPointInfoBox:C.jsx(ddn,{}),mapControlActions:C.jsx(_dn,{}),userDrawnPlaceGroupName:t.controlState.userDrawnPlaceGroupName,userPlaceGroups:qM(t),userPlaceGroupsVisibility:p_t(t),showUserPlaces:_De(t),mapInteraction:t.controlState.mapInteraction,mapProjection:Ny(t),selectedPlaceId:t.controlState.selectedPlaceId,places:ZM(t),baseMapLayer:V_t(t),overlayLayer:G_t(t),imageSmoothing:KM(t),variableSplitPos:t.controlState.variableSplitPos,onMapRef:e.onMapRef}),Cdn={addDrawnUserPlace:SQt,importUserPlacesFromText:kUe,selectPlace:eU},t1e=Rn(Sdn,Cdn)(hfn),GVe=ct(C.jsx("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m1 15h-2v-6h2zm0-8h-2V7h2z"}),"Info"),Odn=ct(C.jsx("path",{d:"m2 19.99 7.5-7.51 4 4 7.09-7.97L22 9.92l-8.5 9.56-4-4-6 6.01zm1.5-4.5 6-6.01 4 4L22 3.92l-1.41-1.41-7.09 7.97-4-4L2 13.99z"}),"StackedLineChart"),Edn=ct(C.jsx("path",{d:"M7.52 21.48C4.25 19.94 1.91 16.76 1.55 13H.05C.56 19.16 5.71 24 12 24l.66-.03-3.81-3.81zm.89-6.52c-.19 0-.37-.03-.52-.08-.16-.06-.29-.13-.4-.24-.11-.1-.2-.22-.26-.37-.06-.14-.09-.3-.09-.47h-1.3c0 .36.07.68.21.95s.33.5.56.69c.24.18.51.32.82.41q.45.15.96.15c.37 0 .72-.05 1.03-.15.32-.1.6-.25.83-.44s.42-.43.55-.72.2-.61.2-.97c0-.19-.02-.38-.07-.56s-.12-.35-.23-.51c-.1-.16-.24-.3-.4-.43-.17-.13-.37-.23-.61-.31.2-.09.37-.2.52-.33s.27-.27.37-.42.17-.3.22-.46.07-.32.07-.48q0-.54-.18-.96t-.51-.69c-.2-.19-.47-.33-.77-.43C9.1 8.05 8.76 8 8.39 8c-.36 0-.69.05-1 .16-.3.11-.57.26-.79.45-.21.19-.38.41-.51.67-.12.26-.18.54-.18.85h1.3q0-.255.09-.45c.09-.195.14-.25.25-.34s.23-.17.38-.22.3-.08.48-.08c.4 0 .7.1.89.31.19.2.29.49.29.86 0 .18-.03.34-.08.49s-.14.27-.25.37-.25.18-.41.24-.36.09-.58.09H7.5v1.03h.77c.22 0 .42.02.6.07s.33.13.45.23c.12.11.22.24.29.4s.1.35.1.57c0 .41-.12.72-.35.93-.23.23-.55.33-.95.33m8.55-5.92c-.32-.33-.7-.59-1.14-.77-.43-.18-.92-.27-1.46-.27H12v8h2.3c.55 0 1.06-.09 1.51-.27s.84-.43 1.16-.76.57-.73.74-1.19c.17-.47.26-.99.26-1.57v-.4c0-.58-.09-1.1-.26-1.57q-.27-.705-.75-1.2m-.39 3.16c0 .42-.05.79-.14 1.13-.1.33-.24.62-.43.85s-.43.41-.71.53q-.435.18-.99.18h-.91V9.12h.97c.72 0 1.27.23 1.64.69.38.46.57 1.12.57 1.99zM12 0l-.66.03 3.81 3.81 1.33-1.33c3.27 1.55 5.61 4.72 5.96 8.48h1.5C23.44 4.84 18.29 0 12 0"}),"ThreeDRotation"),Tdn=({contribution:t,panelIndex:e})=>{const n=t.componentResult;return n.status==="pending"?C.jsx(Dy,{},t.name):n.error?C.jsx("div",{children:C.jsx(Jt,{color:"error",children:n.error.message})},t.name):t.component?C.jsx(wUe,{...t.component,onChange:r=>{BYt("panels",e,r)}},t.name):null},kdn=ct(C.jsx("path",{d:"M4 7v2c0 .55-.45 1-1 1H2v4h1c.55 0 1 .45 1 1v2c0 1.65 1.35 3 3 3h3v-2H7c-.55 0-1-.45-1-1v-2c0-1.3-.84-2.42-2-2.83v-.34C5.16 11.42 6 10.3 6 9V7c0-.55.45-1 1-1h3V4H7C5.35 4 4 5.35 4 7m17 3c-.55 0-1-.45-1-1V7c0-1.65-1.35-3-3-3h-3v2h3c.55 0 1 .45 1 1v2c0 1.3.84 2.42 2 2.83v.34c-1.16.41-2 1.52-2 2.83v2c0 .55-.45 1-1 1h-3v2h3c1.65 0 3-1.35 3-3v-2c0-.55.45-1 1-1h1v-4z"}),"DataObject"),Adn=ct(C.jsx("path",{d:"M19 5v14H5V5zm1.1-2H3.9c-.5 0-.9.4-.9.9v16.2c0 .4.4.9.9.9h16.2c.4 0 .9-.5.9-.9V3.9c0-.5-.5-.9-.9-.9M11 7h6v2h-6zm0 4h6v2h-6zm0 4h6v2h-6zM7 7h2v2H7zm0 4h2v2H7zm0 4h2v2H7z"}),"ListAlt"),Pdn=ct(C.jsx("path",{d:"M12 2C8.13 2 5 5.13 5 9c0 5.25 7 13 7 13s7-7.75 7-13c0-3.87-3.13-7-7-7m0 9.5c-1.38 0-2.5-1.12-2.5-2.5s1.12-2.5 2.5-2.5 2.5 1.12 2.5 2.5-1.12 2.5-2.5 2.5"}),"Place"),Mdn=ct(C.jsx("path",{d:"M2.5 4v3h5v12h3V7h5V4zm19 5h-9v3h3v7h3v-7h3z"}),"TextFields"),Rdn=ct(C.jsx("path",{d:"M13 13v8h8v-8zM3 21h8v-8H3zM3 3v8h8V3zm13.66-1.31L11 7.34 16.66 13l5.66-5.66z"}),"Widgets");let ar=class HVe{lineAt(e){if(e<0||e>this.length)throw new RangeError(`Invalid position ${e} in document of length ${this.length}`);return this.lineInner(e,!1,1,0)}line(e){if(e<1||e>this.lines)throw new RangeError(`Invalid line number ${e} in ${this.lines}-line document`);return this.lineInner(e,!0,1,0)}replace(e,n,r){[e,n]=gC(this,e,n);let i=[];return this.decompose(0,e,i,2),r.length&&r.decompose(0,r.length,i,3),this.decompose(n,this.length,i,1),Gd.from(i,this.length-(n-e)+r.length)}append(e){return this.replace(this.length,this.length,e)}slice(e,n=this.length){[e,n]=gC(this,e,n);let r=[];return this.decompose(e,n,r,0),Gd.from(r,n-e)}eq(e){if(e==this)return!0;if(e.length!=this.length||e.lines!=this.lines)return!1;let n=this.scanIdentical(e,1),r=this.length-this.scanIdentical(e,-1),i=new Sk(this),o=new Sk(e);for(let s=n,a=n;;){if(i.next(s),o.next(s),s=0,i.lineBreak!=o.lineBreak||i.done!=o.done||i.value!=o.value)return!1;if(a+=i.value.length,i.done||a>=r)return!0}}iter(e=1){return new Sk(this,e)}iterRange(e,n=this.length){return new qVe(this,e,n)}iterLines(e,n){let r;if(e==null)r=this.iter();else{n==null&&(n=this.lines+1);let i=this.line(e).from;r=this.iterRange(i,Math.max(i,n==this.lines+1?this.length:n<=1?0:this.line(n-1).to))}return new XVe(r)}toString(){return this.sliceString(0)}toJSON(){let e=[];return this.flatten(e),e}constructor(){}static of(e){if(e.length==0)throw new RangeError("A document must have at least one line");return e.length==1&&!e[0]?HVe.empty:e.length<=32?new Wi(e):Gd.from(Wi.split(e,[]))}};class Wi extends ar{constructor(e,n=Ddn(e)){super(),this.text=e,this.length=n}get lines(){return this.text.length}get children(){return null}lineInner(e,n,r,i){for(let o=0;;o++){let s=this.text[o],a=i+s.length;if((n?r:a)>=e)return new Idn(i,a,r,s);i=a+1,r++}}decompose(e,n,r,i){let o=e<=0&&n>=this.length?this:new Wi(n1e(this.text,e,n),Math.min(n,this.length)-Math.max(0,e));if(i&1){let s=r.pop(),a=F3(o.text,s.text.slice(),0,o.length);if(a.length<=32)r.push(new Wi(a,s.length+o.length));else{let l=a.length>>1;r.push(new Wi(a.slice(0,l)),new Wi(a.slice(l)))}}else r.push(o)}replace(e,n,r){if(!(r instanceof Wi))return super.replace(e,n,r);[e,n]=gC(this,e,n);let i=F3(this.text,F3(r.text,n1e(this.text,0,e)),n),o=this.length+r.length-(n-e);return i.length<=32?new Wi(i,o):Gd.from(Wi.split(i,[]),o)}sliceString(e,n=this.length,r=` +`){[e,n]=gC(this,e,n);let i="";for(let o=0,s=0;o<=n&&se&&s&&(i+=r),eo&&(i+=a.slice(Math.max(0,e-o),n-o)),o=l+1}return i}flatten(e){for(let n of this.text)e.push(n)}scanIdentical(){return 0}static split(e,n){let r=[],i=-1;for(let o of e)r.push(o),i+=o.length+1,r.length==32&&(n.push(new Wi(r,i)),r=[],i=-1);return i>-1&&n.push(new Wi(r,i)),n}}class Gd extends ar{constructor(e,n){super(),this.children=e,this.length=n,this.lines=0;for(let r of e)this.lines+=r.lines}lineInner(e,n,r,i){for(let o=0;;o++){let s=this.children[o],a=i+s.length,l=r+s.lines-1;if((n?l:a)>=e)return s.lineInner(e,n,r,i);i=a+1,r=l+1}}decompose(e,n,r,i){for(let o=0,s=0;s<=n&&o=s){let c=i&((s<=e?1:0)|(l>=n?2:0));s>=e&&l<=n&&!c?r.push(a):a.decompose(e-s,n-s,r,c)}s=l+1}}replace(e,n,r){if([e,n]=gC(this,e,n),r.lines=o&&n<=a){let l=s.replace(e-o,n-o,r),c=this.lines-s.lines+l.lines;if(l.lines>4&&l.lines>c>>6){let u=this.children.slice();return u[i]=l,new Gd(u,this.length-(n-e)+r.length)}return super.replace(o,a,l)}o=a+1}return super.replace(e,n,r)}sliceString(e,n=this.length,r=` +`){[e,n]=gC(this,e,n);let i="";for(let o=0,s=0;oe&&o&&(i+=r),es&&(i+=a.sliceString(e-s,n-s,r)),s=l+1}return i}flatten(e){for(let n of this.children)n.flatten(e)}scanIdentical(e,n){if(!(e instanceof Gd))return 0;let r=0,[i,o,s,a]=n>0?[0,0,this.children.length,e.children.length]:[this.children.length-1,e.children.length-1,-1,-1];for(;;i+=n,o+=n){if(i==s||o==a)return r;let l=this.children[i],c=e.children[o];if(l!=c)return r+l.scanIdentical(c,n);r+=l.length+1}}static from(e,n=e.reduce((r,i)=>r+i.length+1,-1)){let r=0;for(let h of e)r+=h.lines;if(r<32){let h=[];for(let p of e)p.flatten(h);return new Wi(h,n)}let i=Math.max(32,r>>5),o=i<<1,s=i>>1,a=[],l=0,c=-1,u=[];function f(h){let p;if(h.lines>o&&h instanceof Gd)for(let g of h.children)f(g);else h.lines>s&&(l>s||!l)?(d(),a.push(h)):h instanceof Wi&&l&&(p=u[u.length-1])instanceof Wi&&h.lines+p.lines<=32?(l+=h.lines,c+=h.length+1,u[u.length-1]=new Wi(p.text.concat(h.text),p.length+1+h.length)):(l+h.lines>i&&d(),l+=h.lines,c+=h.length+1,u.push(h))}function d(){l!=0&&(a.push(u.length==1?u[0]:Gd.from(u,c)),c=-1,l=u.length=0)}for(let h of e)f(h);return d(),a.length==1?a[0]:new Gd(a,n)}}ar.empty=new Wi([""],0);function Ddn(t){let e=-1;for(let n of t)e+=n.length+1;return e}function F3(t,e,n=0,r=1e9){for(let i=0,o=0,s=!0;o=n&&(l>r&&(a=a.slice(0,r-i)),i0?1:(e instanceof Wi?e.text.length:e.children.length)<<1]}nextInner(e,n){for(this.done=this.lineBreak=!1;;){let r=this.nodes.length-1,i=this.nodes[r],o=this.offsets[r],s=o>>1,a=i instanceof Wi?i.text.length:i.children.length;if(s==(n>0?a:0)){if(r==0)return this.done=!0,this.value="",this;n>0&&this.offsets[r-1]++,this.nodes.pop(),this.offsets.pop()}else if((o&1)==(n>0?0:1)){if(this.offsets[r]+=n,e==0)return this.lineBreak=!0,this.value=` +`,this;e--}else if(i instanceof Wi){let l=i.text[s+(n<0?-1:0)];if(this.offsets[r]+=n,l.length>Math.max(0,e))return this.value=e==0?l:n>0?l.slice(e):l.slice(0,l.length-e),this;e-=l.length}else{let l=i.children[s+(n<0?-1:0)];e>l.length?(e-=l.length,this.offsets[r]+=n):(n<0&&this.offsets[r]--,this.nodes.push(l),this.offsets.push(n>0?1:(l instanceof Wi?l.text.length:l.children.length)<<1))}}}next(e=0){return e<0&&(this.nextInner(-e,-this.dir),e=this.value.length),this.nextInner(e,this.dir)}}class qVe{constructor(e,n,r){this.value="",this.done=!1,this.cursor=new Sk(e,n>r?-1:1),this.pos=n>r?e.length:0,this.from=Math.min(n,r),this.to=Math.max(n,r)}nextInner(e,n){if(n<0?this.pos<=this.from:this.pos>=this.to)return this.value="",this.done=!0,this;e+=Math.max(0,n<0?this.pos-this.to:this.from-this.pos);let r=n<0?this.pos-this.from:this.to-this.pos;e>r&&(e=r),r-=e;let{value:i}=this.cursor.next(e);return this.pos+=(i.length+e)*n,this.value=i.length<=r?i:n<0?i.slice(i.length-r):i.slice(0,r),this.done=!this.value,this}next(e=0){return e<0?e=Math.max(e,this.from-this.pos):e>0&&(e=Math.min(e,this.to-this.pos)),this.nextInner(e,this.cursor.dir)}get lineBreak(){return this.cursor.lineBreak&&this.value!=""}}class XVe{constructor(e){this.inner=e,this.afterBreak=!0,this.value="",this.done=!1}next(e=0){let{done:n,lineBreak:r,value:i}=this.inner.next(e);return n&&this.afterBreak?(this.value="",this.afterBreak=!1):n?(this.done=!0,this.value=""):r?this.afterBreak?this.value="":(this.afterBreak=!0,this.next()):(this.value=i,this.afterBreak=!1),this}get lineBreak(){return!1}}typeof Symbol<"u"&&(ar.prototype[Symbol.iterator]=function(){return this.iter()},Sk.prototype[Symbol.iterator]=qVe.prototype[Symbol.iterator]=XVe.prototype[Symbol.iterator]=function(){return this});let Idn=class{constructor(e,n,r,i){this.from=e,this.to=n,this.number=r,this.text=i}get length(){return this.to-this.from}};function gC(t,e,n){return e=Math.max(0,Math.min(t.length,e)),[e,Math.max(e,Math.min(t.length,n))]}let Y_="lc,34,7n,7,7b,19,,,,2,,2,,,20,b,1c,l,g,,2t,7,2,6,2,2,,4,z,,u,r,2j,b,1m,9,9,,o,4,,9,,3,,5,17,3,3b,f,,w,1j,,,,4,8,4,,3,7,a,2,t,,1m,,,,2,4,8,,9,,a,2,q,,2,2,1l,,4,2,4,2,2,3,3,,u,2,3,,b,2,1l,,4,5,,2,4,,k,2,m,6,,,1m,,,2,,4,8,,7,3,a,2,u,,1n,,,,c,,9,,14,,3,,1l,3,5,3,,4,7,2,b,2,t,,1m,,2,,2,,3,,5,2,7,2,b,2,s,2,1l,2,,,2,4,8,,9,,a,2,t,,20,,4,,2,3,,,8,,29,,2,7,c,8,2q,,2,9,b,6,22,2,r,,,,,,1j,e,,5,,2,5,b,,10,9,,2u,4,,6,,2,2,2,p,2,4,3,g,4,d,,2,2,6,,f,,jj,3,qa,3,t,3,t,2,u,2,1s,2,,7,8,,2,b,9,,19,3,3b,2,y,,3a,3,4,2,9,,6,3,63,2,2,,1m,,,7,,,,,2,8,6,a,2,,1c,h,1r,4,1c,7,,,5,,14,9,c,2,w,4,2,2,,3,1k,,,2,3,,,3,1m,8,2,2,48,3,,d,,7,4,,6,,3,2,5i,1m,,5,ek,,5f,x,2da,3,3x,,2o,w,fe,6,2x,2,n9w,4,,a,w,2,28,2,7k,,3,,4,,p,2,5,,47,2,q,i,d,,12,8,p,b,1a,3,1c,,2,4,2,2,13,,1v,6,2,2,2,2,c,,8,,1b,,1f,,,3,2,2,5,2,,,16,2,8,,6m,,2,,4,,fn4,,kh,g,g,g,a6,2,gt,,6a,,45,5,1ae,3,,2,5,4,14,3,4,,4l,2,fx,4,ar,2,49,b,4w,,1i,f,1k,3,1d,4,2,2,1x,3,10,5,,8,1q,,c,2,1g,9,a,4,2,,2n,3,2,,,2,6,,4g,,3,8,l,2,1l,2,,,,,m,,e,7,3,5,5f,8,2,3,,,n,,29,,2,6,,,2,,,2,,2,6j,,2,4,6,2,,2,r,2,2d,8,2,,,2,2y,,,,2,6,,,2t,3,2,4,,5,77,9,,2,6t,,a,2,,,4,,40,4,2,2,4,,w,a,14,6,2,4,8,,9,6,2,3,1a,d,,2,ba,7,,6,,,2a,m,2,7,,2,,2,3e,6,3,,,2,,7,,,20,2,3,,,,9n,2,f0b,5,1n,7,t4,,1r,4,29,,f5k,2,43q,,,3,4,5,8,8,2,7,u,4,44,3,1iz,1j,4,1e,8,,e,,m,5,,f,11s,7,,h,2,7,,2,,5,79,7,c5,4,15s,7,31,7,240,5,gx7k,2o,3k,6o".split(",").map(t=>t?parseInt(t,36):1);for(let t=1;tt)return Y_[e-1]<=t;return!1}function r1e(t){return t>=127462&&t<=127487}const i1e=8205;function gs(t,e,n=!0,r=!0){return(n?YVe:$dn)(t,e,r)}function YVe(t,e,n){if(e==t.length)return e;e&&QVe(t.charCodeAt(e))&&KVe(t.charCodeAt(e-1))&&e--;let r=ss(t,e);for(e+=Jc(r);e=0&&r1e(ss(t,s));)o++,s-=2;if(o%2==0)break;e+=2}else break}return e}function $dn(t,e,n){for(;e>0;){let r=YVe(t,e-2,n);if(r=56320&&t<57344}function KVe(t){return t>=55296&&t<56320}function ss(t,e){let n=t.charCodeAt(e);if(!KVe(n)||e+1==t.length)return n;let r=t.charCodeAt(e+1);return QVe(r)?(n-55296<<10)+(r-56320)+65536:n}function Mle(t){return t<=65535?String.fromCharCode(t):(t-=65536,String.fromCharCode((t>>10)+55296,(t&1023)+56320))}function Jc(t){return t<65536?1:2}const jQ=/\r\n?|\n/;var us=function(t){return t[t.Simple=0]="Simple",t[t.TrackDel=1]="TrackDel",t[t.TrackBefore=2]="TrackBefore",t[t.TrackAfter=3]="TrackAfter",t}(us||(us={}));class yh{constructor(e){this.sections=e}get length(){let e=0;for(let n=0;ne)return o+(e-i);o+=a}else{if(r!=us.Simple&&c>=e&&(r==us.TrackDel&&ie||r==us.TrackBefore&&ie))return null;if(c>e||c==e&&n<0&&!a)return e==i||n<0?o:o+l;o+=l}i=c}if(e>i)throw new RangeError(`Position ${e} is out of range for changeset of length ${i}`);return o}touchesRange(e,n=e){for(let r=0,i=0;r=0&&i<=n&&a>=e)return in?"cover":!0;i=a}return!1}toString(){let e="";for(let n=0;n=0?":"+i:"")}return e}toJSON(){return this.sections}static fromJSON(e){if(!Array.isArray(e)||e.length%2||e.some(n=>typeof n!="number"))throw new RangeError("Invalid JSON representation of ChangeDesc");return new yh(e)}static create(e){return new yh(e)}}class mo extends yh{constructor(e,n){super(e),this.inserted=n}apply(e){if(this.length!=e.length)throw new RangeError("Applying change set to a document with the wrong length");return BQ(this,(n,r,i,o,s)=>e=e.replace(i,i+(r-n),s),!1),e}mapDesc(e,n=!1){return UQ(this,e,n,!0)}invert(e){let n=this.sections.slice(),r=[];for(let i=0,o=0;i=0){n[i]=a,n[i+1]=s;let l=i>>1;for(;r.length0&&bv(r,n,o.text),o.forward(u),a+=u}let c=e[s++];for(;a>1].toJSON()))}return e}static of(e,n,r){let i=[],o=[],s=0,a=null;function l(u=!1){if(!u&&!i.length)return;sd||f<0||d>n)throw new RangeError(`Invalid change range ${f} to ${d} (in doc of length ${n})`);let p=h?typeof h=="string"?ar.of(h.split(r||jQ)):h:ar.empty,g=p.length;if(f==d&&g==0)return;fs&&Bs(i,f-s,-1),Bs(i,d-f,g),bv(o,i,p),s=d}}return c(e),l(!a),a}static empty(e){return new mo(e?[e,-1]:[],[])}static fromJSON(e){if(!Array.isArray(e))throw new RangeError("Invalid JSON representation of ChangeSet");let n=[],r=[];for(let i=0;ia&&typeof s!="string"))throw new RangeError("Invalid JSON representation of ChangeSet");if(o.length==1)n.push(o[0],0);else{for(;r.length=0&&n<=0&&n==t[i+1]?t[i]+=e:e==0&&t[i]==0?t[i+1]+=n:r?(t[i]+=e,t[i+1]+=n):t.push(e,n)}function bv(t,e,n){if(n.length==0)return;let r=e.length-2>>1;if(r>1])),!(n||s==t.sections.length||t.sections[s+1]<0);)a=t.sections[s++],l=t.sections[s++];e(i,c,o,u,f),i=c,o=u}}}function UQ(t,e,n,r=!1){let i=[],o=r?[]:null,s=new aP(t),a=new aP(e);for(let l=-1;;)if(s.ins==-1&&a.ins==-1){let c=Math.min(s.len,a.len);Bs(i,c,-1),s.forward(c),a.forward(c)}else if(a.ins>=0&&(s.ins<0||l==s.i||s.off==0&&(a.len=0&&l=0){let c=0,u=s.len;for(;u;)if(a.ins==-1){let f=Math.min(u,a.len);c+=f,u-=f,a.forward(f)}else if(a.ins==0&&a.lenl||s.ins>=0&&s.len>l)&&(a||r.length>c),o.forward2(l),s.forward(l)}}}}class aP{constructor(e){this.set=e,this.i=0,this.next()}next(){let{sections:e}=this.set;this.i>1;return n>=e.length?ar.empty:e[n]}textBit(e){let{inserted:n}=this.set,r=this.i-2>>1;return r>=n.length&&!e?ar.empty:n[r].slice(this.off,e==null?void 0:this.off+e)}forward(e){e==this.len?this.next():(this.len-=e,this.off+=e)}forward2(e){this.ins==-1?this.forward(e):e==this.ins?this.next():(this.ins-=e,this.off+=e)}}class vx{constructor(e,n,r){this.from=e,this.to=n,this.flags=r}get anchor(){return this.flags&32?this.to:this.from}get head(){return this.flags&32?this.from:this.to}get empty(){return this.from==this.to}get assoc(){return this.flags&8?-1:this.flags&16?1:0}get bidiLevel(){let e=this.flags&7;return e==7?null:e}get goalColumn(){let e=this.flags>>6;return e==16777215?void 0:e}map(e,n=-1){let r,i;return this.empty?r=i=e.mapPos(this.from,n):(r=e.mapPos(this.from,1),i=e.mapPos(this.to,-1)),r==this.from&&i==this.to?this:new vx(r,i,this.flags)}extend(e,n=e){if(e<=this.anchor&&n>=this.anchor)return Ve.range(e,n);let r=Math.abs(e-this.anchor)>Math.abs(n-this.anchor)?e:n;return Ve.range(this.anchor,r)}eq(e,n=!1){return this.anchor==e.anchor&&this.head==e.head&&(!n||!this.empty||this.assoc==e.assoc)}toJSON(){return{anchor:this.anchor,head:this.head}}static fromJSON(e){if(!e||typeof e.anchor!="number"||typeof e.head!="number")throw new RangeError("Invalid JSON representation for SelectionRange");return Ve.range(e.anchor,e.head)}static create(e,n,r){return new vx(e,n,r)}}class Ve{constructor(e,n){this.ranges=e,this.mainIndex=n}map(e,n=-1){return e.empty?this:Ve.create(this.ranges.map(r=>r.map(e,n)),this.mainIndex)}eq(e,n=!1){if(this.ranges.length!=e.ranges.length||this.mainIndex!=e.mainIndex)return!1;for(let r=0;re.toJSON()),main:this.mainIndex}}static fromJSON(e){if(!e||!Array.isArray(e.ranges)||typeof e.main!="number"||e.main>=e.ranges.length)throw new RangeError("Invalid JSON representation for EditorSelection");return new Ve(e.ranges.map(n=>vx.fromJSON(n)),e.main)}static single(e,n=e){return new Ve([Ve.range(e,n)],0)}static create(e,n=0){if(e.length==0)throw new RangeError("A selection needs at least one range");for(let r=0,i=0;ie?8:0)|o)}static normalized(e,n=0){let r=e[n];e.sort((i,o)=>i.from-o.from),n=e.indexOf(r);for(let i=1;io.head?Ve.range(l,a):Ve.range(a,l))}}return new Ve(e,n)}}function JVe(t,e){for(let n of t.ranges)if(n.to>e)throw new RangeError("Selection points outside of document")}let Rle=0;class _t{constructor(e,n,r,i,o){this.combine=e,this.compareInput=n,this.compare=r,this.isStatic=i,this.id=Rle++,this.default=e([]),this.extensions=typeof o=="function"?o(this):o}get reader(){return this}static define(e={}){return new _t(e.combine||(n=>n),e.compareInput||((n,r)=>n===r),e.compare||(e.combine?(n,r)=>n===r:Dle),!!e.static,e.enables)}of(e){return new N3([],this,0,e)}compute(e,n){if(this.isStatic)throw new Error("Can't compute a static facet");return new N3(e,this,1,n)}computeN(e,n){if(this.isStatic)throw new Error("Can't compute a static facet");return new N3(e,this,2,n)}from(e,n){return n||(n=r=>r),this.compute([e],r=>n(r.field(e)))}}function Dle(t,e){return t==e||t.length==e.length&&t.every((n,r)=>n===e[r])}class N3{constructor(e,n,r,i){this.dependencies=e,this.facet=n,this.type=r,this.value=i,this.id=Rle++}dynamicSlot(e){var n;let r=this.value,i=this.facet.compareInput,o=this.id,s=e[o]>>1,a=this.type==2,l=!1,c=!1,u=[];for(let f of this.dependencies)f=="doc"?l=!0:f=="selection"?c=!0:((n=e[f.id])!==null&&n!==void 0?n:1)&1||u.push(e[f.id]);return{create(f){return f.values[s]=r(f),1},update(f,d){if(l&&d.docChanged||c&&(d.docChanged||d.selection)||WQ(f,u)){let h=r(f);if(a?!o1e(h,f.values[s],i):!i(h,f.values[s]))return f.values[s]=h,1}return 0},reconfigure:(f,d)=>{let h,p=d.config.address[o];if(p!=null){let g=Z5(d,p);if(this.dependencies.every(m=>m instanceof _t?d.facet(m)===f.facet(m):m instanceof Qo?d.field(m,!1)==f.field(m,!1):!0)||(a?o1e(h=r(f),g,i):i(h=r(f),g)))return f.values[s]=g,0}else h=r(f);return f.values[s]=h,1}}}}function o1e(t,e,n){if(t.length!=e.length)return!1;for(let r=0;rt[l.id]),i=n.map(l=>l.type),o=r.filter(l=>!(l&1)),s=t[e.id]>>1;function a(l){let c=[];for(let u=0;ur===i),e);return e.provide&&(n.provides=e.provide(n)),n}create(e){let n=e.facet(s1e).find(r=>r.field==this);return((n==null?void 0:n.create)||this.createF)(e)}slot(e){let n=e[this.id]>>1;return{create:r=>(r.values[n]=this.create(r),1),update:(r,i)=>{let o=r.values[n],s=this.updateF(o,i);return this.compareF(o,s)?0:(r.values[n]=s,1)},reconfigure:(r,i)=>i.config.address[this.id]!=null?(r.values[n]=i.field(this),0):(r.values[n]=this.create(r),1)}}init(e){return[this,s1e.of({field:this,create:e})]}get extension(){return this}}const nx={lowest:4,low:3,default:2,high:1,highest:0};function w2(t){return e=>new e9e(e,t)}const t0={highest:w2(nx.highest),high:w2(nx.high),default:w2(nx.default),low:w2(nx.low),lowest:w2(nx.lowest)};class e9e{constructor(e,n){this.inner=e,this.prec=n}}class TU{of(e){return new VQ(this,e)}reconfigure(e){return TU.reconfigure.of({compartment:this,extension:e})}get(e){return e.config.compartments.get(this)}}class VQ{constructor(e,n){this.compartment=e,this.inner=n}}class K5{constructor(e,n,r,i,o,s){for(this.base=e,this.compartments=n,this.dynamicSlots=r,this.address=i,this.staticValues=o,this.facets=s,this.statusTemplate=[];this.statusTemplate.length>1]}static resolve(e,n,r){let i=[],o=Object.create(null),s=new Map;for(let d of Ndn(e,n,s))d instanceof Qo?i.push(d):(o[d.facet.id]||(o[d.facet.id]=[])).push(d);let a=Object.create(null),l=[],c=[];for(let d of i)a[d.id]=c.length<<1,c.push(h=>d.slot(h));let u=r==null?void 0:r.config.facets;for(let d in o){let h=o[d],p=h[0].facet,g=u&&u[d]||[];if(h.every(m=>m.type==0))if(a[p.id]=l.length<<1|1,Dle(g,h))l.push(r.facet(p));else{let m=p.combine(h.map(v=>v.value));l.push(r&&p.compare(m,r.facet(p))?r.facet(p):m)}else{for(let m of h)m.type==0?(a[m.id]=l.length<<1|1,l.push(m.value)):(a[m.id]=c.length<<1,c.push(v=>m.dynamicSlot(v)));a[p.id]=c.length<<1,c.push(m=>Fdn(m,p,h))}}let f=c.map(d=>d(a));return new K5(e,s,f,a,l,o)}}function Ndn(t,e,n){let r=[[],[],[],[],[]],i=new Map;function o(s,a){let l=i.get(s);if(l!=null){if(l<=a)return;let c=r[l].indexOf(s);c>-1&&r[l].splice(c,1),s instanceof VQ&&n.delete(s.compartment)}if(i.set(s,a),Array.isArray(s))for(let c of s)o(c,a);else if(s instanceof VQ){if(n.has(s.compartment))throw new RangeError("Duplicate use of compartment in extensions");let c=e.get(s.compartment)||s.inner;n.set(s.compartment,c),o(c,a)}else if(s instanceof e9e)o(s.inner,s.prec);else if(s instanceof Qo)r[a].push(s),s.provides&&o(s.provides,a);else if(s instanceof N3)r[a].push(s),s.facet.extensions&&o(s.facet.extensions,nx.default);else{let c=s.extension;if(!c)throw new Error(`Unrecognized extension value in extension set (${s}). This sometimes happens because multiple instances of @codemirror/state are loaded, breaking instanceof checks.`);o(c,a)}}return o(t,nx.default),r.reduce((s,a)=>s.concat(a))}function Ck(t,e){if(e&1)return 2;let n=e>>1,r=t.status[n];if(r==4)throw new Error("Cyclic dependency between fields and/or facets");if(r&2)return r;t.status[n]=4;let i=t.computeSlot(t,t.config.dynamicSlots[n]);return t.status[n]=2|i}function Z5(t,e){return e&1?t.config.staticValues[e>>1]:t.values[e>>1]}const t9e=_t.define(),GQ=_t.define({combine:t=>t.some(e=>e),static:!0}),n9e=_t.define({combine:t=>t.length?t[0]:void 0,static:!0}),r9e=_t.define(),i9e=_t.define(),o9e=_t.define(),s9e=_t.define({combine:t=>t.length?t[0]:!1});class Qh{constructor(e,n){this.type=e,this.value=n}static define(){return new zdn}}class zdn{of(e){return new Qh(this,e)}}class jdn{constructor(e){this.map=e}of(e){return new rn(this,e)}}class rn{constructor(e,n){this.type=e,this.value=n}map(e){let n=this.type.map(this.value,e);return n===void 0?void 0:n==this.value?this:new rn(this.type,n)}is(e){return this.type==e}static define(e={}){return new jdn(e.map||(n=>n))}static mapEffects(e,n){if(!e.length)return e;let r=[];for(let i of e){let o=i.map(n);o&&r.push(o)}return r}}rn.reconfigure=rn.define();rn.appendConfig=rn.define();class ao{constructor(e,n,r,i,o,s){this.startState=e,this.changes=n,this.selection=r,this.effects=i,this.annotations=o,this.scrollIntoView=s,this._doc=null,this._state=null,r&&JVe(r,n.newLength),o.some(a=>a.type==ao.time)||(this.annotations=o.concat(ao.time.of(Date.now())))}static create(e,n,r,i,o,s){return new ao(e,n,r,i,o,s)}get newDoc(){return this._doc||(this._doc=this.changes.apply(this.startState.doc))}get newSelection(){return this.selection||this.startState.selection.map(this.changes)}get state(){return this._state||this.startState.applyTransaction(this),this._state}annotation(e){for(let n of this.annotations)if(n.type==e)return n.value}get docChanged(){return!this.changes.empty}get reconfigured(){return this.startState.config!=this.state.config}isUserEvent(e){let n=this.annotation(ao.userEvent);return!!(n&&(n==e||n.length>e.length&&n.slice(0,e.length)==e&&n[e.length]=="."))}}ao.time=Qh.define();ao.userEvent=Qh.define();ao.addToHistory=Qh.define();ao.remote=Qh.define();function Bdn(t,e){let n=[];for(let r=0,i=0;;){let o,s;if(r=t[r]))o=t[r++],s=t[r++];else if(i=0;i--){let o=r[i](t);o instanceof ao?t=o:Array.isArray(o)&&o.length==1&&o[0]instanceof ao?t=o[0]:t=l9e(e,Q_(o),!1)}return t}function Wdn(t){let e=t.startState,n=e.facet(o9e),r=t;for(let i=n.length-1;i>=0;i--){let o=n[i](t);o&&Object.keys(o).length&&(r=a9e(r,HQ(e,o,t.changes.newLength),!0))}return r==t?t:ao.create(e,t.changes,t.selection,r.effects,r.annotations,r.scrollIntoView)}const Vdn=[];function Q_(t){return t==null?Vdn:Array.isArray(t)?t:[t]}var gi=function(t){return t[t.Word=0]="Word",t[t.Space=1]="Space",t[t.Other=2]="Other",t}(gi||(gi={}));const Gdn=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;let qQ;try{qQ=new RegExp("[\\p{Alphabetic}\\p{Number}_]","u")}catch{}function Hdn(t){if(qQ)return qQ.test(t);for(let e=0;e"€"&&(n.toUpperCase()!=n.toLowerCase()||Gdn.test(n)))return!0}return!1}function qdn(t){return e=>{if(!/\S/.test(e))return gi.Space;if(Hdn(e))return gi.Word;for(let n=0;n-1)return gi.Word;return gi.Other}}class In{constructor(e,n,r,i,o,s){this.config=e,this.doc=n,this.selection=r,this.values=i,this.status=e.statusTemplate.slice(),this.computeSlot=o,s&&(s._state=this);for(let a=0;ai.set(c,l)),n=null),i.set(a.value.compartment,a.value.extension)):a.is(rn.reconfigure)?(n=null,r=a.value):a.is(rn.appendConfig)&&(n=null,r=Q_(r).concat(a.value));let o;n?o=e.startState.values.slice():(n=K5.resolve(r,i,this),o=new In(n,this.doc,this.selection,n.dynamicSlots.map(()=>null),(l,c)=>c.reconfigure(l,this),null).values);let s=e.startState.facet(GQ)?e.newSelection:e.newSelection.asSingle();new In(n,e.newDoc,s,o,(a,l)=>l.update(a,e),e)}replaceSelection(e){return typeof e=="string"&&(e=this.toText(e)),this.changeByRange(n=>({changes:{from:n.from,to:n.to,insert:e},range:Ve.cursor(n.from+e.length)}))}changeByRange(e){let n=this.selection,r=e(n.ranges[0]),i=this.changes(r.changes),o=[r.range],s=Q_(r.effects);for(let a=1;as.spec.fromJSON(a,l)))}}return In.create({doc:e.doc,selection:Ve.fromJSON(e.selection),extensions:n.extensions?i.concat([n.extensions]):i})}static create(e={}){let n=K5.resolve(e.extensions||[],new Map),r=e.doc instanceof ar?e.doc:ar.of((e.doc||"").split(n.staticFacet(In.lineSeparator)||jQ)),i=e.selection?e.selection instanceof Ve?e.selection:Ve.single(e.selection.anchor,e.selection.head):Ve.single(0);return JVe(i,r.length),n.staticFacet(GQ)||(i=i.asSingle()),new In(n,r,i,n.dynamicSlots.map(()=>null),(o,s)=>s.create(o),null)}get tabSize(){return this.facet(In.tabSize)}get lineBreak(){return this.facet(In.lineSeparator)||` +`}get readOnly(){return this.facet(s9e)}phrase(e,...n){for(let r of this.facet(In.phrases))if(Object.prototype.hasOwnProperty.call(r,e)){e=r[e];break}return n.length&&(e=e.replace(/\$(\$|\d*)/g,(r,i)=>{if(i=="$")return"$";let o=+(i||1);return!o||o>n.length?r:n[o-1]})),e}languageDataAt(e,n,r=-1){let i=[];for(let o of this.facet(t9e))for(let s of o(this,n,r))Object.prototype.hasOwnProperty.call(s,e)&&i.push(s[e]);return i}charCategorizer(e){return qdn(this.languageDataAt("wordChars",e).join(""))}wordAt(e){let{text:n,from:r,length:i}=this.doc.lineAt(e),o=this.charCategorizer(e),s=e-r,a=e-r;for(;s>0;){let l=gs(n,s,!1);if(o(n.slice(l,s))!=gi.Word)break;s=l}for(;at.length?t[0]:4});In.lineSeparator=n9e;In.readOnly=s9e;In.phrases=_t.define({compare(t,e){let n=Object.keys(t),r=Object.keys(e);return n.length==r.length&&n.every(i=>t[i]==e[i])}});In.languageData=t9e;In.changeFilter=r9e;In.transactionFilter=i9e;In.transactionExtender=o9e;TU.reconfigure=rn.define();function Kh(t,e,n={}){let r={};for(let i of t)for(let o of Object.keys(i)){let s=i[o],a=r[o];if(a===void 0)r[o]=s;else if(!(a===s||s===void 0))if(Object.hasOwnProperty.call(n,o))r[o]=n[o](a,s);else throw new Error("Config merge conflict for field "+o)}for(let i in e)r[i]===void 0&&(r[i]=e[i]);return r}class Mb{eq(e){return this==e}range(e,n=e){return XQ.create(e,n,this)}}Mb.prototype.startSide=Mb.prototype.endSide=0;Mb.prototype.point=!1;Mb.prototype.mapMode=us.TrackDel;let XQ=class c9e{constructor(e,n,r){this.from=e,this.to=n,this.value=r}static create(e,n,r){return new c9e(e,n,r)}};function YQ(t,e){return t.from-e.from||t.value.startSide-e.value.startSide}class Ile{constructor(e,n,r,i){this.from=e,this.to=n,this.value=r,this.maxPoint=i}get length(){return this.to[this.to.length-1]}findIndex(e,n,r,i=0){let o=r?this.to:this.from;for(let s=i,a=o.length;;){if(s==a)return s;let l=s+a>>1,c=o[l]-e||(r?this.value[l].endSide:this.value[l].startSide)-n;if(l==s)return c>=0?s:a;c>=0?a=l:s=l+1}}between(e,n,r,i){for(let o=this.findIndex(n,-1e9,!0),s=this.findIndex(r,1e9,!1,o);oh||d==h&&c.startSide>0&&c.endSide<=0)continue;(h-d||c.endSide-c.startSide)<0||(s<0&&(s=d),c.point&&(a=Math.max(a,h-d)),r.push(c),i.push(d-s),o.push(h-s))}return{mapped:r.length?new Ile(i,o,r,a):null,pos:s}}}class Gn{constructor(e,n,r,i){this.chunkPos=e,this.chunk=n,this.nextLayer=r,this.maxPoint=i}static create(e,n,r,i){return new Gn(e,n,r,i)}get length(){let e=this.chunk.length-1;return e<0?0:Math.max(this.chunkEnd(e),this.nextLayer.length)}get size(){if(this.isEmpty)return 0;let e=this.nextLayer.size;for(let n of this.chunk)e+=n.value.length;return e}chunkEnd(e){return this.chunkPos[e]+this.chunk[e].length}update(e){let{add:n=[],sort:r=!1,filterFrom:i=0,filterTo:o=this.length}=e,s=e.filter;if(n.length==0&&!s)return this;if(r&&(n=n.slice().sort(YQ)),this.isEmpty)return n.length?Gn.of(n):this;let a=new u9e(this,null,-1).goto(0),l=0,c=[],u=new by;for(;a.value||l=0){let f=n[l++];u.addInner(f.from,f.to,f.value)||c.push(f)}else a.rangeIndex==1&&a.chunkIndexthis.chunkEnd(a.chunkIndex)||oa.to||o=o&&e<=o+s.length&&s.between(o,e-o,n-o,r)===!1)return}this.nextLayer.between(e,n,r)}}iter(e=0){return lP.from([this]).goto(e)}get isEmpty(){return this.nextLayer==this}static iter(e,n=0){return lP.from(e).goto(n)}static compare(e,n,r,i,o=-1){let s=e.filter(f=>f.maxPoint>0||!f.isEmpty&&f.maxPoint>=o),a=n.filter(f=>f.maxPoint>0||!f.isEmpty&&f.maxPoint>=o),l=a1e(s,a,r),c=new _2(s,l,o),u=new _2(a,l,o);r.iterGaps((f,d,h)=>l1e(c,f,u,d,h,i)),r.empty&&r.length==0&&l1e(c,0,u,0,0,i)}static eq(e,n,r=0,i){i==null&&(i=999999999);let o=e.filter(u=>!u.isEmpty&&n.indexOf(u)<0),s=n.filter(u=>!u.isEmpty&&e.indexOf(u)<0);if(o.length!=s.length)return!1;if(!o.length)return!0;let a=a1e(o,s),l=new _2(o,a,0).goto(r),c=new _2(s,a,0).goto(r);for(;;){if(l.to!=c.to||!QQ(l.active,c.active)||l.point&&(!c.point||!l.point.eq(c.point)))return!1;if(l.to>i)return!0;l.next(),c.next()}}static spans(e,n,r,i,o=-1){let s=new _2(e,null,o).goto(n),a=n,l=s.openStart;for(;;){let c=Math.min(s.to,r);if(s.point){let u=s.activeForPoint(s.to),f=s.pointFroma&&(i.span(a,c,s.active,l),l=s.openEnd(c));if(s.to>r)return l+(s.point&&s.to>r?1:0);a=s.to,s.next()}}static of(e,n=!1){let r=new by;for(let i of e instanceof XQ?[e]:n?Xdn(e):e)r.add(i.from,i.to,i.value);return r.finish()}static join(e){if(!e.length)return Gn.empty;let n=e[e.length-1];for(let r=e.length-2;r>=0;r--)for(let i=e[r];i!=Gn.empty;i=i.nextLayer)n=new Gn(i.chunkPos,i.chunk,n,Math.max(i.maxPoint,n.maxPoint));return n}}Gn.empty=new Gn([],[],null,-1);function Xdn(t){if(t.length>1)for(let e=t[0],n=1;n0)return t.slice().sort(YQ);e=r}return t}Gn.empty.nextLayer=Gn.empty;class by{finishChunk(e){this.chunks.push(new Ile(this.from,this.to,this.value,this.maxPoint)),this.chunkPos.push(this.chunkStart),this.chunkStart=-1,this.setMaxPoint=Math.max(this.setMaxPoint,this.maxPoint),this.maxPoint=-1,e&&(this.from=[],this.to=[],this.value=[])}constructor(){this.chunks=[],this.chunkPos=[],this.chunkStart=-1,this.last=null,this.lastFrom=-1e9,this.lastTo=-1e9,this.from=[],this.to=[],this.value=[],this.maxPoint=-1,this.setMaxPoint=-1,this.nextLayer=null}add(e,n,r){this.addInner(e,n,r)||(this.nextLayer||(this.nextLayer=new by)).add(e,n,r)}addInner(e,n,r){let i=e-this.lastTo||r.startSide-this.last.endSide;if(i<=0&&(e-this.lastFrom||r.startSide-this.last.startSide)<0)throw new Error("Ranges must be added sorted by `from` position and `startSide`");return i<0?!1:(this.from.length==250&&this.finishChunk(!0),this.chunkStart<0&&(this.chunkStart=e),this.from.push(e-this.chunkStart),this.to.push(n-this.chunkStart),this.last=r,this.lastFrom=e,this.lastTo=n,this.value.push(r),r.point&&(this.maxPoint=Math.max(this.maxPoint,n-e)),!0)}addChunk(e,n){if((e-this.lastTo||n.value[0].startSide-this.last.endSide)<0)return!1;this.from.length&&this.finishChunk(!0),this.setMaxPoint=Math.max(this.setMaxPoint,n.maxPoint),this.chunks.push(n),this.chunkPos.push(e);let r=n.value.length-1;return this.last=n.value[r],this.lastFrom=n.from[r]+e,this.lastTo=n.to[r]+e,!0}finish(){return this.finishInner(Gn.empty)}finishInner(e){if(this.from.length&&this.finishChunk(!1),this.chunks.length==0)return e;let n=Gn.create(this.chunkPos,this.chunks,this.nextLayer?this.nextLayer.finishInner(e):e,this.setMaxPoint);return this.from=null,n}}function a1e(t,e,n){let r=new Map;for(let o of t)for(let s=0;s=this.minPoint)break}}setRangeIndex(e){if(e==this.layer.chunk[this.chunkIndex].value.length){if(this.chunkIndex++,this.skip)for(;this.chunkIndex=r&&i.push(new u9e(s,n,r,o));return i.length==1?i[0]:new lP(i)}get startSide(){return this.value?this.value.startSide:0}goto(e,n=-1e9){for(let r of this.heap)r.goto(e,n);for(let r=this.heap.length>>1;r>=0;r--)t7(this.heap,r);return this.next(),this}forward(e,n){for(let r of this.heap)r.forward(e,n);for(let r=this.heap.length>>1;r>=0;r--)t7(this.heap,r);(this.to-e||this.value.endSide-n)<0&&this.next()}next(){if(this.heap.length==0)this.from=this.to=1e9,this.value=null,this.rank=-1;else{let e=this.heap[0];this.from=e.from,this.to=e.to,this.value=e.value,this.rank=e.rank,e.value&&e.next(),t7(this.heap,0)}}}function t7(t,e){for(let n=t[e];;){let r=(e<<1)+1;if(r>=t.length)break;let i=t[r];if(r+1=0&&(i=t[r+1],r++),n.compare(i)<0)break;t[r]=n,t[e]=i,e=r}}class _2{constructor(e,n,r){this.minPoint=r,this.active=[],this.activeTo=[],this.activeRank=[],this.minActive=-1,this.point=null,this.pointFrom=0,this.pointRank=0,this.to=-1e9,this.endSide=0,this.openStart=-1,this.cursor=lP.from(e,n,r)}goto(e,n=-1e9){return this.cursor.goto(e,n),this.active.length=this.activeTo.length=this.activeRank.length=0,this.minActive=-1,this.to=e,this.endSide=n,this.openStart=-1,this.next(),this}forward(e,n){for(;this.minActive>-1&&(this.activeTo[this.minActive]-e||this.active[this.minActive].endSide-n)<0;)this.removeActive(this.minActive);this.cursor.forward(e,n)}removeActive(e){_L(this.active,e),_L(this.activeTo,e),_L(this.activeRank,e),this.minActive=c1e(this.active,this.activeTo)}addActive(e){let n=0,{value:r,to:i,rank:o}=this.cursor;for(;n0;)n++;SL(this.active,n,r),SL(this.activeTo,n,i),SL(this.activeRank,n,o),e&&SL(e,n,this.cursor.from),this.minActive=c1e(this.active,this.activeTo)}next(){let e=this.to,n=this.point;this.point=null;let r=this.openStart<0?[]:null;for(;;){let i=this.minActive;if(i>-1&&(this.activeTo[i]-this.cursor.from||this.active[i].endSide-this.cursor.startSide)<0){if(this.activeTo[i]>e){this.to=this.activeTo[i],this.endSide=this.active[i].endSide;break}this.removeActive(i),r&&_L(r,i)}else if(this.cursor.value)if(this.cursor.from>e){this.to=this.cursor.from,this.endSide=this.cursor.startSide;break}else{let o=this.cursor.value;if(!o.point)this.addActive(r),this.cursor.next();else if(n&&this.cursor.to==this.to&&this.cursor.from=0&&r[i]=0&&!(this.activeRank[r]e||this.activeTo[r]==e&&this.active[r].endSide>=this.point.endSide)&&n.push(this.active[r]);return n.reverse()}openEnd(e){let n=0;for(let r=this.activeTo.length-1;r>=0&&this.activeTo[r]>e;r--)n++;return n}}function l1e(t,e,n,r,i,o){t.goto(e),n.goto(r);let s=r+i,a=r,l=r-e;for(;;){let c=t.to+l-n.to||t.endSide-n.endSide,u=c<0?t.to+l:n.to,f=Math.min(u,s);if(t.point||n.point?t.point&&n.point&&(t.point==n.point||t.point.eq(n.point))&&QQ(t.activeForPoint(t.to),n.activeForPoint(n.to))||o.comparePoint(a,f,t.point,n.point):f>a&&!QQ(t.active,n.active)&&o.compareRange(a,f,t.active,n.active),u>s)break;a=u,c<=0&&t.next(),c>=0&&n.next()}}function QQ(t,e){if(t.length!=e.length)return!1;for(let n=0;n=e;r--)t[r+1]=t[r];t[e]=n}function c1e(t,e){let n=-1,r=1e9;for(let i=0;i=e)return i;if(i==t.length)break;o+=t.charCodeAt(i)==9?n-o%n:1,i=gs(t,i)}return r===!0?-1:t.length}const ZQ="ͼ",u1e=typeof Symbol>"u"?"__"+ZQ:Symbol.for(ZQ),JQ=typeof Symbol>"u"?"__styleSet"+Math.floor(Math.random()*1e8):Symbol("styleSet"),f1e=typeof globalThis<"u"?globalThis:typeof window<"u"?window:{};class wy{constructor(e,n){this.rules=[];let{finish:r}=n||{};function i(s){return/^@/.test(s)?[s]:s.split(/,\s*/)}function o(s,a,l,c){let u=[],f=/^@(\w+)\b/.exec(s[0]),d=f&&f[1]=="keyframes";if(f&&a==null)return l.push(s[0]+";");for(let h in a){let p=a[h];if(/&/.test(h))o(h.split(/,\s*/).map(g=>s.map(m=>g.replace(/&/,m))).reduce((g,m)=>g.concat(m)),p,l);else if(p&&typeof p=="object"){if(!f)throw new RangeError("The value of a property ("+h+") should be a primitive value.");o(i(h),p,u,d)}else p!=null&&u.push(h.replace(/_.*/,"").replace(/[A-Z]/g,g=>"-"+g.toLowerCase())+": "+p+";")}(u.length||d)&&l.push((r&&!f&&!c?s.map(r):s).join(", ")+" {"+u.join(" ")+"}")}for(let s in e)o(i(s),e[s],this.rules)}getRules(){return this.rules.join(` +`)}static newName(){let e=f1e[u1e]||1;return f1e[u1e]=e+1,ZQ+e.toString(36)}static mount(e,n,r){let i=e[JQ],o=r&&r.nonce;i?o&&i.setNonce(o):i=new Ydn(e,o),i.mount(Array.isArray(n)?n:[n],e)}}let d1e=new Map;class Ydn{constructor(e,n){let r=e.ownerDocument||e,i=r.defaultView;if(!e.head&&e.adoptedStyleSheets&&i.CSSStyleSheet){let o=d1e.get(r);if(o)return e[JQ]=o;this.sheet=new i.CSSStyleSheet,d1e.set(r,this)}else this.styleTag=r.createElement("style"),n&&this.styleTag.setAttribute("nonce",n);this.modules=[],e[JQ]=this}mount(e,n){let r=this.sheet,i=0,o=0;for(let s=0;s-1&&(this.modules.splice(l,1),o--,l=-1),l==-1){if(this.modules.splice(o++,0,a),r)for(let c=0;c",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},Qdn=typeof navigator<"u"&&/Mac/.test(navigator.platform),Kdn=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);for(var as=0;as<10;as++)_y[48+as]=_y[96+as]=String(as);for(var as=1;as<=24;as++)_y[as+111]="F"+as;for(var as=65;as<=90;as++)_y[as]=String.fromCharCode(as+32),cP[as]=String.fromCharCode(as);for(var n7 in _y)cP.hasOwnProperty(n7)||(cP[n7]=_y[n7]);function Zdn(t){var e=Qdn&&t.metaKey&&t.shiftKey&&!t.ctrlKey&&!t.altKey||Kdn&&t.shiftKey&&t.key&&t.key.length==1||t.key=="Unidentified",n=!e&&t.key||(t.shiftKey?cP:_y)[t.keyCode]||t.key||"Unidentified";return n=="Esc"&&(n="Escape"),n=="Del"&&(n="Delete"),n=="Left"&&(n="ArrowLeft"),n=="Up"&&(n="ArrowUp"),n=="Right"&&(n="ArrowRight"),n=="Down"&&(n="ArrowDown"),n}function uP(t){let e;return t.nodeType==11?e=t.getSelection?t:t.ownerDocument:e=t,e.getSelection()}function eK(t,e){return e?t==e||t.contains(e.nodeType!=1?e.parentNode:e):!1}function Jdn(t){let e=t.activeElement;for(;e&&e.shadowRoot;)e=e.shadowRoot.activeElement;return e}function z3(t,e){if(!e.anchorNode)return!1;try{return eK(t,e.anchorNode)}catch{return!1}}function mC(t){return t.nodeType==3?Db(t,0,t.nodeValue.length).getClientRects():t.nodeType==1?t.getClientRects():[]}function Ok(t,e,n,r){return n?h1e(t,e,n,r,-1)||h1e(t,e,n,r,1):!1}function Rb(t){for(var e=0;;e++)if(t=t.previousSibling,!t)return e}function J5(t){return t.nodeType==1&&/^(DIV|P|LI|UL|OL|BLOCKQUOTE|DD|DT|H\d|SECTION|PRE)$/.test(t.nodeName)}function h1e(t,e,n,r,i){for(;;){if(t==n&&e==r)return!0;if(e==(i<0?0:Fg(t))){if(t.nodeName=="DIV")return!1;let o=t.parentNode;if(!o||o.nodeType!=1)return!1;e=Rb(t)+(i<0?0:1),t=o}else if(t.nodeType==1){if(t=t.childNodes[e+(i<0?-1:0)],t.nodeType==1&&t.contentEditable=="false")return!1;e=i<0?Fg(t):0}else return!1}}function Fg(t){return t.nodeType==3?t.nodeValue.length:t.childNodes.length}function rD(t,e){let n=e?t.left:t.right;return{left:n,right:n,top:t.top,bottom:t.bottom}}function ehn(t){let e=t.visualViewport;return e?{left:0,right:e.width,top:0,bottom:e.height}:{left:0,right:t.innerWidth,top:0,bottom:t.innerHeight}}function f9e(t,e){let n=e.width/t.offsetWidth,r=e.height/t.offsetHeight;return(n>.995&&n<1.005||!isFinite(n)||Math.abs(e.width-t.offsetWidth)<1)&&(n=1),(r>.995&&r<1.005||!isFinite(r)||Math.abs(e.height-t.offsetHeight)<1)&&(r=1),{scaleX:n,scaleY:r}}function thn(t,e,n,r,i,o,s,a){let l=t.ownerDocument,c=l.defaultView||window;for(let u=t,f=!1;u&&!f;)if(u.nodeType==1){let d,h=u==l.body,p=1,g=1;if(h)d=ehn(c);else{if(/^(fixed|sticky)$/.test(getComputedStyle(u).position)&&(f=!0),u.scrollHeight<=u.clientHeight&&u.scrollWidth<=u.clientWidth){u=u.assignedSlot||u.parentNode;continue}let y=u.getBoundingClientRect();({scaleX:p,scaleY:g}=f9e(u,y)),d={left:y.left,right:y.left+u.clientWidth*p,top:y.top,bottom:y.top+u.clientHeight*g}}let m=0,v=0;if(i=="nearest")e.top0&&e.bottom>d.bottom+v&&(v=e.bottom-d.bottom+v+s)):e.bottom>d.bottom&&(v=e.bottom-d.bottom+s,n<0&&e.top-v0&&e.right>d.right+m&&(m=e.right-d.right+m+o)):e.right>d.right&&(m=e.right-d.right+o,n<0&&e.lefti.clientHeight&&(r=i),!n&&i.scrollWidth>i.clientWidth&&(n=i),i=i.assignedSlot||i.parentNode;else if(i.nodeType==11)i=i.host;else break;return{x:n,y:r}}class rhn{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}eq(e){return this.anchorNode==e.anchorNode&&this.anchorOffset==e.anchorOffset&&this.focusNode==e.focusNode&&this.focusOffset==e.focusOffset}setRange(e){let{anchorNode:n,focusNode:r}=e;this.set(n,Math.min(e.anchorOffset,n?Fg(n):0),r,Math.min(e.focusOffset,r?Fg(r):0))}set(e,n,r,i){this.anchorNode=e,this.anchorOffset=n,this.focusNode=r,this.focusOffset=i}}let lw=null;function d9e(t){if(t.setActive)return t.setActive();if(lw)return t.focus(lw);let e=[];for(let n=t;n&&(e.push(n,n.scrollTop,n.scrollLeft),n!=n.ownerDocument);n=n.parentNode);if(t.focus(lw==null?{get preventScroll(){return lw={preventScroll:!0},!0}}:void 0),!lw){lw=!1;for(let n=0;nMath.max(1,t.scrollHeight-t.clientHeight-4)}function g9e(t,e){for(let n=t,r=e;;){if(n.nodeType==3&&r>0)return{node:n,offset:r};if(n.nodeType==1&&r>0){if(n.contentEditable=="false")return null;n=n.childNodes[r-1],r=Fg(n)}else if(n.parentNode&&!J5(n))r=Rb(n),n=n.parentNode;else return null}}function m9e(t,e){for(let n=t,r=e;;){if(n.nodeType==3&&rn)return f.domBoundsAround(e,n,c);if(d>=e&&i==-1&&(i=l,o=c),c>n&&f.dom.parentNode==this.dom){s=l,a=u;break}u=d,c=d+f.breakAfter}return{from:o,to:a<0?r+this.length:a,startDOM:(i?this.children[i-1].dom.nextSibling:null)||this.dom.firstChild,endDOM:s=0?this.children[s].dom:null}}markDirty(e=!1){this.flags|=2,this.markParentsDirty(e)}markParentsDirty(e){for(let n=this.parent;n;n=n.parent){if(e&&(n.flags|=2),n.flags&1)return;n.flags|=1,e=!1}}setParent(e){this.parent!=e&&(this.parent=e,this.flags&7&&this.markParentsDirty(!0))}setDOM(e){this.dom!=e&&(this.dom&&(this.dom.cmView=null),this.dom=e,e.cmView=this)}get rootView(){for(let e=this;;){let n=e.parent;if(!n)return e;e=n}}replaceChildren(e,n,r=Lle){this.markDirty();for(let i=e;ithis.pos||e==this.pos&&(n>0||this.i==0||this.children[this.i-1].breakAfter))return this.off=e-this.pos,this;let r=this.children[--this.i];this.pos-=r.length+r.breakAfter}}}function y9e(t,e,n,r,i,o,s,a,l){let{children:c}=t,u=c.length?c[e]:null,f=o.length?o[o.length-1]:null,d=f?f.breakAfter:s;if(!(e==r&&u&&!s&&!d&&o.length<2&&u.merge(n,i,o.length?f:null,n==0,a,l))){if(r0&&(!s&&o.length&&u.merge(n,u.length,o[0],!1,a,0)?u.breakAfter=o.shift().breakAfter:(n2);var St={mac:y1e||/Mac/.test(Ka.platform),windows:/Win/.test(Ka.platform),linux:/Linux|X11/.test(Ka.platform),ie:kU,ie_version:b9e?tK.documentMode||6:rK?+rK[1]:nK?+nK[1]:0,gecko:m1e,gecko_version:m1e?+(/Firefox\/(\d+)/.exec(Ka.userAgent)||[0,0])[1]:0,chrome:!!r7,chrome_version:r7?+r7[1]:0,ios:y1e,android:/Android\b/.test(Ka.userAgent),webkit:v1e,safari:w9e,webkit_version:v1e?+(/\bAppleWebKit\/(\d+)/.exec(Ka.userAgent)||[0,0])[1]:0,tabSize:tK.documentElement.style.tabSize!=null?"tab-size":"-moz-tab-size"};const shn=256;class Qf extends Dr{constructor(e){super(),this.text=e}get length(){return this.text.length}createDOM(e){this.setDOM(e||document.createTextNode(this.text))}sync(e,n){this.dom||this.createDOM(),this.dom.nodeValue!=this.text&&(n&&n.node==this.dom&&(n.written=!0),this.dom.nodeValue=this.text)}reuseDOM(e){e.nodeType==3&&this.createDOM(e)}merge(e,n,r){return this.flags&8||r&&(!(r instanceof Qf)||this.length-(n-e)+r.length>shn||r.flags&8)?!1:(this.text=this.text.slice(0,e)+(r?r.text:"")+this.text.slice(n),this.markDirty(),!0)}split(e){let n=new Qf(this.text.slice(e));return this.text=this.text.slice(0,e),this.markDirty(),n.flags|=this.flags&8,n}localPosFromDOM(e,n){return e==this.dom?n:n?this.text.length:0}domAtPos(e){return new Hs(this.dom,e)}domBoundsAround(e,n,r){return{from:r,to:r+this.length,startDOM:this.dom,endDOM:this.dom.nextSibling}}coordsAt(e,n){return ahn(this.dom,e,n)}}class Ng extends Dr{constructor(e,n=[],r=0){super(),this.mark=e,this.children=n,this.length=r;for(let i of n)i.setParent(this)}setAttrs(e){if(h9e(e),this.mark.class&&(e.className=this.mark.class),this.mark.attrs)for(let n in this.mark.attrs)e.setAttribute(n,this.mark.attrs[n]);return e}canReuseDOM(e){return super.canReuseDOM(e)&&!((this.flags|e.flags)&8)}reuseDOM(e){e.nodeName==this.mark.tagName.toUpperCase()&&(this.setDOM(e),this.flags|=6)}sync(e,n){this.dom?this.flags&4&&this.setAttrs(this.dom):this.setDOM(this.setAttrs(document.createElement(this.mark.tagName))),super.sync(e,n)}merge(e,n,r,i,o,s){return r&&(!(r instanceof Ng&&r.mark.eq(this.mark))||e&&o<=0||ne&&n.push(r=e&&(i=o),r=l,o++}let s=this.length-e;return this.length=e,i>-1&&(this.children.length=i,this.markDirty()),new Ng(this.mark,n,s)}domAtPos(e){return _9e(this,e)}coordsAt(e,n){return C9e(this,e,n)}}function ahn(t,e,n){let r=t.nodeValue.length;e>r&&(e=r);let i=e,o=e,s=0;e==0&&n<0||e==r&&n>=0?St.chrome||St.gecko||(e?(i--,s=1):o=0)?0:a.length-1];return St.safari&&!s&&l.width==0&&(l=Array.prototype.find.call(a,c=>c.width)||l),s?rD(l,s<0):l||null}class wv extends Dr{static create(e,n,r){return new wv(e,n,r)}constructor(e,n,r){super(),this.widget=e,this.length=n,this.side=r,this.prevWidget=null}split(e){let n=wv.create(this.widget,this.length-e,this.side);return this.length-=e,n}sync(e){(!this.dom||!this.widget.updateDOM(this.dom,e))&&(this.dom&&this.prevWidget&&this.prevWidget.destroy(this.dom),this.prevWidget=null,this.setDOM(this.widget.toDOM(e)),this.widget.editable||(this.dom.contentEditable="false"))}getSide(){return this.side}merge(e,n,r,i,o,s){return r&&(!(r instanceof wv)||!this.widget.compare(r.widget)||e>0&&o<=0||n0)?Hs.before(this.dom):Hs.after(this.dom,e==this.length)}domBoundsAround(){return null}coordsAt(e,n){let r=this.widget.coordsAt(this.dom,e,n);if(r)return r;let i=this.dom.getClientRects(),o=null;if(!i.length)return null;let s=this.side?this.side<0:e>0;for(let a=s?i.length-1:0;o=i[a],!(e>0?a==0:a==i.length-1||o.top0?Hs.before(this.dom):Hs.after(this.dom)}localPosFromDOM(){return 0}domBoundsAround(){return null}coordsAt(e){return this.dom.getBoundingClientRect()}get overrideDOMText(){return ar.empty}get isHidden(){return!0}}Qf.prototype.children=wv.prototype.children=vC.prototype.children=Lle;function _9e(t,e){let n=t.dom,{children:r}=t,i=0;for(let o=0;io&&e0;o--){let s=r[o-1];if(s.dom.parentNode==n)return s.domAtPos(s.length)}for(let o=i;o0&&e instanceof Ng&&i.length&&(r=i[i.length-1])instanceof Ng&&r.mark.eq(e.mark)?S9e(r,e.children[0],n-1):(i.push(e),e.setParent(t)),t.length+=e.length}function C9e(t,e,n){let r=null,i=-1,o=null,s=-1;function a(c,u){for(let f=0,d=0;f=u&&(h.children.length?a(h,u-d):(!o||o.isHidden&&n>0)&&(p>u||d==p&&h.getSide()>0)?(o=h,s=u-d):(d-1?1:0)!=i.length-(n&&i.indexOf(n)>-1?1:0))return!1;for(let o of r)if(o!=n&&(i.indexOf(o)==-1||t[o]!==e[o]))return!1;return!0}function oK(t,e,n){let r=!1;if(e)for(let i in e)n&&i in n||(r=!0,i=="style"?t.style.cssText="":t.removeAttribute(i));if(n)for(let i in n)e&&e[i]==n[i]||(r=!0,i=="style"?t.style.cssText=n[i]:t.setAttribute(i,n[i]));return r}function chn(t){let e=Object.create(null);for(let n=0;n0?3e8:-4e8:n>0?1e8:-1e8,new Sy(e,n,n,r,e.widget||null,!1)}static replace(e){let n=!!e.block,r,i;if(e.isBlockGap)r=-5e8,i=4e8;else{let{start:o,end:s}=O9e(e,n);r=(o?n?-3e8:-1:5e8)-1,i=(s?n?2e8:1:-6e8)+1}return new Sy(e,r,i,n,e.widget||null,!0)}static line(e){return new oD(e)}static set(e,n=!1){return Gn.of(e,n)}hasHeight(){return this.widget?this.widget.estimatedHeight>-1:!1}}Dt.none=Gn.empty;class iD extends Dt{constructor(e){let{start:n,end:r}=O9e(e);super(n?-1:5e8,r?1:-6e8,null,e),this.tagName=e.tagName||"span",this.class=e.class||"",this.attrs=e.attributes||null}eq(e){var n,r;return this==e||e instanceof iD&&this.tagName==e.tagName&&(this.class||((n=this.attrs)===null||n===void 0?void 0:n.class))==(e.class||((r=e.attrs)===null||r===void 0?void 0:r.class))&&ez(this.attrs,e.attrs,"class")}range(e,n=e){if(e>=n)throw new RangeError("Mark decorations may not be empty");return super.range(e,n)}}iD.prototype.point=!1;class oD extends Dt{constructor(e){super(-2e8,-2e8,null,e)}eq(e){return e instanceof oD&&this.spec.class==e.spec.class&&ez(this.spec.attributes,e.spec.attributes)}range(e,n=e){if(n!=e)throw new RangeError("Line decoration ranges must be zero-length");return super.range(e,n)}}oD.prototype.mapMode=us.TrackBefore;oD.prototype.point=!0;class Sy extends Dt{constructor(e,n,r,i,o,s){super(n,r,o,e),this.block=i,this.isReplace=s,this.mapMode=i?n<=0?us.TrackBefore:us.TrackAfter:us.TrackDel}get type(){return this.startSide!=this.endSide?Ea.WidgetRange:this.startSide<=0?Ea.WidgetBefore:Ea.WidgetAfter}get heightRelevant(){return this.block||!!this.widget&&(this.widget.estimatedHeight>=5||this.widget.lineBreaks>0)}eq(e){return e instanceof Sy&&uhn(this.widget,e.widget)&&this.block==e.block&&this.startSide==e.startSide&&this.endSide==e.endSide}range(e,n=e){if(this.isReplace&&(e>n||e==n&&this.startSide>0&&this.endSide<=0))throw new RangeError("Invalid range for replacement decoration");if(!this.isReplace&&n!=e)throw new RangeError("Widget decorations can only have zero-length ranges");return super.range(e,n)}}Sy.prototype.point=!0;function O9e(t,e=!1){let{inclusiveStart:n,inclusiveEnd:r}=t;return n==null&&(n=t.inclusive),r==null&&(r=t.inclusive),{start:n??e,end:r??e}}function uhn(t,e){return t==e||!!(t&&e&&t.compare(e))}function sK(t,e,n,r=0){let i=n.length-1;i>=0&&n[i]+r>=t?n[i]=Math.max(n[i],e):n.push(t,e)}class no extends Dr{constructor(){super(...arguments),this.children=[],this.length=0,this.prevAttrs=void 0,this.attrs=null,this.breakAfter=0}merge(e,n,r,i,o,s){if(r){if(!(r instanceof no))return!1;this.dom||r.transferDOM(this)}return i&&this.setDeco(r?r.attrs:null),x9e(this,e,n,r?r.children.slice():[],o,s),!0}split(e){let n=new no;if(n.breakAfter=this.breakAfter,this.length==0)return n;let{i:r,off:i}=this.childPos(e);i&&(n.append(this.children[r].split(i),0),this.children[r].merge(i,this.children[r].length,null,!1,0,0),r++);for(let o=r;o0&&this.children[r-1].length==0;)this.children[--r].destroy();return this.children.length=r,this.markDirty(),this.length=e,n}transferDOM(e){this.dom&&(this.markDirty(),e.setDOM(this.dom),e.prevAttrs=this.prevAttrs===void 0?this.attrs:this.prevAttrs,this.prevAttrs=void 0,this.dom=null)}setDeco(e){ez(this.attrs,e)||(this.dom&&(this.prevAttrs=this.attrs,this.markDirty()),this.attrs=e)}append(e,n){S9e(this,e,n)}addLineDeco(e){let n=e.spec.attributes,r=e.spec.class;n&&(this.attrs=iK(n,this.attrs||{})),r&&(this.attrs=iK({class:r},this.attrs||{}))}domAtPos(e){return _9e(this,e)}reuseDOM(e){e.nodeName=="DIV"&&(this.setDOM(e),this.flags|=6)}sync(e,n){var r;this.dom?this.flags&4&&(h9e(this.dom),this.dom.className="cm-line",this.prevAttrs=this.attrs?null:void 0):(this.setDOM(document.createElement("div")),this.dom.className="cm-line",this.prevAttrs=this.attrs?null:void 0),this.prevAttrs!==void 0&&(oK(this.dom,this.prevAttrs,this.attrs),this.dom.classList.add("cm-line"),this.prevAttrs=void 0),super.sync(e,n);let i=this.dom.lastChild;for(;i&&Dr.get(i)instanceof Ng;)i=i.lastChild;if(!i||!this.length||i.nodeName!="BR"&&((r=Dr.get(i))===null||r===void 0?void 0:r.isEditable)==!1&&(!St.ios||!this.children.some(o=>o instanceof Qf))){let o=document.createElement("BR");o.cmIgnore=!0,this.dom.appendChild(o)}}measureTextSize(){if(this.children.length==0||this.length>20)return null;let e=0,n;for(let r of this.children){if(!(r instanceof Qf)||/[^ -~]/.test(r.text))return null;let i=mC(r.dom);if(i.length!=1)return null;e+=i[0].width,n=i[0].height}return e?{lineHeight:this.dom.getBoundingClientRect().height,charWidth:e/this.length,textHeight:n}:null}coordsAt(e,n){let r=C9e(this,e,n);if(!this.children.length&&r&&this.parent){let{heightOracle:i}=this.parent.view.viewState,o=r.bottom-r.top;if(Math.abs(o-i.lineHeight)<2&&i.textHeight=n){if(o instanceof no)return o;if(s>n)break}i=s+o.breakAfter}return null}}class fg extends Dr{constructor(e,n,r){super(),this.widget=e,this.length=n,this.deco=r,this.breakAfter=0,this.prevWidget=null}merge(e,n,r,i,o,s){return r&&(!(r instanceof fg)||!this.widget.compare(r.widget)||e>0&&o<=0||n0}}class aK extends Zh{constructor(e){super(),this.height=e}toDOM(){let e=document.createElement("div");return e.className="cm-gap",this.updateDOM(e),e}eq(e){return e.height==this.height}updateDOM(e){return e.style.height=this.height+"px",!0}get editable(){return!0}get estimatedHeight(){return this.height}ignoreEvent(){return!1}}class Ek{constructor(e,n,r,i){this.doc=e,this.pos=n,this.end=r,this.disallowBlockEffectsFor=i,this.content=[],this.curLine=null,this.breakAtStart=0,this.pendingBuffer=0,this.bufferMarks=[],this.atCursorPos=!0,this.openStart=-1,this.openEnd=-1,this.text="",this.textOff=0,this.cursor=e.iter(),this.skip=n}posCovered(){if(this.content.length==0)return!this.breakAtStart&&this.doc.lineAt(this.pos).from!=this.pos;let e=this.content[this.content.length-1];return!(e.breakAfter||e instanceof fg&&e.deco.endSide<0)}getLine(){return this.curLine||(this.content.push(this.curLine=new no),this.atCursorPos=!0),this.curLine}flushBuffer(e=this.bufferMarks){this.pendingBuffer&&(this.curLine.append(CL(new vC(-1),e),e.length),this.pendingBuffer=0)}addBlockWidget(e){this.flushBuffer(),this.curLine=null,this.content.push(e)}finish(e){this.pendingBuffer&&e<=this.bufferMarks.length?this.flushBuffer():this.pendingBuffer=0,!this.posCovered()&&!(e&&this.content.length&&this.content[this.content.length-1]instanceof fg)&&this.getLine()}buildText(e,n,r){for(;e>0;){if(this.textOff==this.text.length){let{value:o,lineBreak:s,done:a}=this.cursor.next(this.skip);if(this.skip=0,a)throw new Error("Ran out of text content when drawing inline views");if(s){this.posCovered()||this.getLine(),this.content.length?this.content[this.content.length-1].breakAfter=1:this.breakAtStart=1,this.flushBuffer(),this.curLine=null,this.atCursorPos=!0,e--;continue}else this.text=o,this.textOff=0}let i=Math.min(this.text.length-this.textOff,e,512);this.flushBuffer(n.slice(n.length-r)),this.getLine().append(CL(new Qf(this.text.slice(this.textOff,this.textOff+i)),n),r),this.atCursorPos=!0,this.textOff+=i,e-=i,r=0}}span(e,n,r,i){this.buildText(n-e,r,i),this.pos=n,this.openStart<0&&(this.openStart=i)}point(e,n,r,i,o,s){if(this.disallowBlockEffectsFor[s]&&r instanceof Sy){if(r.block)throw new RangeError("Block decorations may not be specified via plugins");if(n>this.doc.lineAt(this.pos).to)throw new RangeError("Decorations that replace line breaks may not be specified via plugins")}let a=n-e;if(r instanceof Sy)if(r.block)r.startSide>0&&!this.posCovered()&&this.getLine(),this.addBlockWidget(new fg(r.widget||yC.block,a,r));else{let l=wv.create(r.widget||yC.inline,a,a?0:r.startSide),c=this.atCursorPos&&!l.isEditable&&o<=i.length&&(e0),u=!l.isEditable&&(ei.length||r.startSide<=0),f=this.getLine();this.pendingBuffer==2&&!c&&!l.isEditable&&(this.pendingBuffer=0),this.flushBuffer(i),c&&(f.append(CL(new vC(1),i),o),o=i.length+Math.max(0,o-i.length)),f.append(CL(l,i),o),this.atCursorPos=u,this.pendingBuffer=u?ei.length?1:2:0,this.pendingBuffer&&(this.bufferMarks=i.slice())}else this.doc.lineAt(this.pos).from==this.pos&&this.getLine().addLineDeco(r);a&&(this.textOff+a<=this.text.length?this.textOff+=a:(this.skip+=a-(this.text.length-this.textOff),this.text="",this.textOff=0),this.pos=n),this.openStart<0&&(this.openStart=o)}static build(e,n,r,i,o){let s=new Ek(e,n,r,o);return s.openEnd=Gn.spans(i,n,r,s),s.openStart<0&&(s.openStart=s.openEnd),s.finish(s.openEnd),s}}function CL(t,e){for(let n of e)t=new Ng(n,[t],t.length);return t}class yC extends Zh{constructor(e){super(),this.tag=e}eq(e){return e.tag==this.tag}toDOM(){return document.createElement(this.tag)}updateDOM(e){return e.nodeName.toLowerCase()==this.tag}get isHidden(){return!0}}yC.inline=new yC("span");yC.block=new yC("div");var si=function(t){return t[t.LTR=0]="LTR",t[t.RTL=1]="RTL",t}(si||(si={}));const Ib=si.LTR,$le=si.RTL;function E9e(t){let e=[];for(let n=0;n=n){if(a.level==r)return s;(o<0||(i!=0?i<0?a.fromn:e[o].level>a.level))&&(o=s)}}if(o<0)throw new RangeError("Index out of range");return o}}function k9e(t,e){if(t.length!=e.length)return!1;for(let n=0;n=0;g-=3)if(vd[g+1]==-h){let m=vd[g+2],v=m&2?i:m&4?m&1?o:i:0;v&&(Rr[f]=Rr[vd[g]]=v),a=g;break}}else{if(vd.length==189)break;vd[a++]=f,vd[a++]=d,vd[a++]=l}else if((p=Rr[f])==2||p==1){let g=p==i;l=g?0:1;for(let m=a-3;m>=0;m-=3){let v=vd[m+2];if(v&2)break;if(g)vd[m+2]|=2;else{if(v&4)break;vd[m+2]|=4}}}}}function mhn(t,e,n,r){for(let i=0,o=r;i<=n.length;i++){let s=i?n[i-1].to:t,a=il;)p==m&&(p=n[--g].from,m=g?n[g-1].to:t),Rr[--p]=h;l=u}else o=c,l++}}}function cK(t,e,n,r,i,o,s){let a=r%2?2:1;if(r%2==i%2)for(let l=e,c=0;ll&&s.push(new _v(l,g.from,h));let m=g.direction==Ib!=!(h%2);uK(t,m?r+1:r,i,g.inner,g.from,g.to,s),l=g.to}p=g.to}else{if(p==n||(u?Rr[p]!=a:Rr[p]==a))break;p++}d?cK(t,l,p,r+1,i,d,s):le;){let u=!0,f=!1;if(!c||l>o[c-1].to){let g=Rr[l-1];g!=a&&(u=!1,f=g==16)}let d=!u&&a==1?[]:null,h=u?r:r+1,p=l;e:for(;;)if(c&&p==o[c-1].to){if(f)break e;let g=o[--c];if(!u)for(let m=g.from,v=c;;){if(m==e)break e;if(v&&o[v-1].to==m)m=o[--v].from;else{if(Rr[m-1]==a)break e;break}}if(d)d.push(g);else{g.toRr.length;)Rr[Rr.length]=256;let r=[],i=e==Ib?0:1;return uK(t,i,i,n,0,t.length,r),r}function A9e(t){return[new _v(0,t,0)]}let P9e="";function yhn(t,e,n,r,i){var o;let s=r.head-t.from,a=_v.find(e,s,(o=r.bidiLevel)!==null&&o!==void 0?o:-1,r.assoc),l=e[a],c=l.side(i,n);if(s==c){let d=a+=i?1:-1;if(d<0||d>=e.length)return null;l=e[a=d],s=l.side(!i,n),c=l.side(i,n)}let u=gs(t.text,s,l.forward(i,n));(ul.to)&&(u=c),P9e=t.text.slice(Math.min(s,u),Math.max(s,u));let f=a==(i?e.length-1:0)?null:e[a+(i?1:-1)];return f&&u==c&&f.level+(i?0:1)t.some(e=>e)}),N9e=_t.define({combine:t=>t.some(e=>e)}),z9e=_t.define();class Z_{constructor(e,n="nearest",r="nearest",i=5,o=5,s=!1){this.range=e,this.y=n,this.x=r,this.yMargin=i,this.xMargin=o,this.isSnapshot=s}map(e){return e.empty?this:new Z_(this.range.map(e),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot)}clip(e){return this.range.to<=e.doc.length?this:new Z_(Ve.cursor(e.doc.length),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot)}}const OL=rn.define({map:(t,e)=>t.map(e)}),j9e=rn.define();function sl(t,e,n){let r=t.facet(I9e);r.length?r[0](e):window.onerror?window.onerror(String(e),n,void 0,void 0,e):n?console.error(n+":",e):console.error(e)}const rv=_t.define({combine:t=>t.length?t[0]:!0});let bhn=0;const kT=_t.define();class Yi{constructor(e,n,r,i,o){this.id=e,this.create=n,this.domEventHandlers=r,this.domEventObservers=i,this.extension=o(this)}static define(e,n){const{eventHandlers:r,eventObservers:i,provide:o,decorations:s}=n||{};return new Yi(bhn++,e,r,i,a=>{let l=[kT.of(a)];return s&&l.push(fP.of(c=>{let u=c.plugin(a);return u?s(u):Dt.none})),o&&l.push(o(a)),l})}static fromClass(e,n){return Yi.define(r=>new e(r),n)}}class i7{constructor(e){this.spec=e,this.mustUpdate=null,this.value=null}update(e){if(this.value){if(this.mustUpdate){let n=this.mustUpdate;if(this.mustUpdate=null,this.value.update)try{this.value.update(n)}catch(r){if(sl(n.state,r,"CodeMirror plugin crashed"),this.value.destroy)try{this.value.destroy()}catch{}this.deactivate()}}}else if(this.spec)try{this.value=this.spec.create(e)}catch(n){sl(e.state,n,"CodeMirror plugin crashed"),this.deactivate()}return this}destroy(e){var n;if(!((n=this.value)===null||n===void 0)&&n.destroy)try{this.value.destroy()}catch(r){sl(e.state,r,"CodeMirror plugin crashed")}}deactivate(){this.spec=this.value=null}}const B9e=_t.define(),Fle=_t.define(),fP=_t.define(),U9e=_t.define(),Nle=_t.define(),W9e=_t.define();function b1e(t,e){let n=t.state.facet(W9e);if(!n.length)return n;let r=n.map(o=>o instanceof Function?o(t):o),i=[];return Gn.spans(r,e.from,e.to,{point(){},span(o,s,a,l){let c=o-e.from,u=s-e.from,f=i;for(let d=a.length-1;d>=0;d--,l--){let h=a[d].spec.bidiIsolate,p;if(h==null&&(h=xhn(e.text,c,u)),l>0&&f.length&&(p=f[f.length-1]).to==c&&p.direction==h)p.to=u,f=p.inner;else{let g={from:c,to:u,direction:h,inner:[]};f.push(g),f=g.inner}}}}),i}const V9e=_t.define();function G9e(t){let e=0,n=0,r=0,i=0;for(let o of t.state.facet(V9e)){let s=o(t);s&&(s.left!=null&&(e=Math.max(e,s.left)),s.right!=null&&(n=Math.max(n,s.right)),s.top!=null&&(r=Math.max(r,s.top)),s.bottom!=null&&(i=Math.max(i,s.bottom)))}return{left:e,right:n,top:r,bottom:i}}const AT=_t.define();class mu{constructor(e,n,r,i){this.fromA=e,this.toA=n,this.fromB=r,this.toB=i}join(e){return new mu(Math.min(this.fromA,e.fromA),Math.max(this.toA,e.toA),Math.min(this.fromB,e.fromB),Math.max(this.toB,e.toB))}addToSet(e){let n=e.length,r=this;for(;n>0;n--){let i=e[n-1];if(!(i.fromA>r.toA)){if(i.toAu)break;o+=2}if(!l)return r;new mu(l.fromA,l.toA,l.fromB,l.toB).addToSet(r),s=l.toA,a=l.toB}}}class tz{constructor(e,n,r){this.view=e,this.state=n,this.transactions=r,this.flags=0,this.startState=e.state,this.changes=mo.empty(this.startState.doc.length);for(let o of r)this.changes=this.changes.compose(o.changes);let i=[];this.changes.iterChangedRanges((o,s,a,l)=>i.push(new mu(o,s,a,l))),this.changedRanges=i}static create(e,n,r){return new tz(e,n,r)}get viewportChanged(){return(this.flags&4)>0}get heightChanged(){return(this.flags&2)>0}get geometryChanged(){return this.docChanged||(this.flags&10)>0}get focusChanged(){return(this.flags&1)>0}get docChanged(){return!this.changes.empty}get selectionSet(){return this.transactions.some(e=>e.selection)}get empty(){return this.flags==0&&this.transactions.length==0}}class w1e extends Dr{get length(){return this.view.state.doc.length}constructor(e){super(),this.view=e,this.decorations=[],this.dynamicDecorationMap=[!1],this.domChanged=null,this.hasComposition=null,this.markedForComposition=new Set,this.editContextFormatting=Dt.none,this.lastCompositionAfterCursor=!1,this.minWidth=0,this.minWidthFrom=0,this.minWidthTo=0,this.impreciseAnchor=null,this.impreciseHead=null,this.forceSelection=!1,this.lastUpdate=Date.now(),this.setDOM(e.contentDOM),this.children=[new no],this.children[0].setParent(this),this.updateDeco(),this.updateInner([new mu(0,0,0,e.state.doc.length)],0,null)}update(e){var n;let r=e.changedRanges;this.minWidth>0&&r.length&&(r.every(({fromA:c,toA:u})=>uthis.minWidthTo)?(this.minWidthFrom=e.changes.mapPos(this.minWidthFrom,1),this.minWidthTo=e.changes.mapPos(this.minWidthTo,1)):this.minWidth=this.minWidthFrom=this.minWidthTo=0),this.updateEditContextFormatting(e);let i=-1;this.view.inputState.composing>=0&&!this.view.observer.editContext&&(!((n=this.domChanged)===null||n===void 0)&&n.newSel?i=this.domChanged.newSel.head:!Thn(e.changes,this.hasComposition)&&!e.selectionSet&&(i=e.state.selection.main.head));let o=i>-1?_hn(this.view,e.changes,i):null;if(this.domChanged=null,this.hasComposition){this.markedForComposition.clear();let{from:c,to:u}=this.hasComposition;r=new mu(c,u,e.changes.mapPos(c,-1),e.changes.mapPos(u,1)).addToSet(r.slice())}this.hasComposition=o?{from:o.range.fromB,to:o.range.toB}:null,(St.ie||St.chrome)&&!o&&e&&e.state.doc.lines!=e.startState.doc.lines&&(this.forceSelection=!0);let s=this.decorations,a=this.updateDeco(),l=Ohn(s,a,e.changes);return r=mu.extendWithRanges(r,l),!(this.flags&7)&&r.length==0?!1:(this.updateInner(r,e.startState.doc.length,o),e.transactions.length&&(this.lastUpdate=Date.now()),!0)}updateInner(e,n,r){this.view.viewState.mustMeasureContent=!0,this.updateChildren(e,n,r);let{observer:i}=this.view;i.ignore(()=>{this.dom.style.height=this.view.viewState.contentHeight/this.view.scaleY+"px",this.dom.style.flexBasis=this.minWidth?this.minWidth+"px":"";let s=St.chrome||St.ios?{node:i.selectionRange.focusNode,written:!1}:void 0;this.sync(this.view,s),this.flags&=-8,s&&(s.written||i.selectionRange.focusNode!=s.node)&&(this.forceSelection=!0),this.dom.style.height=""}),this.markedForComposition.forEach(s=>s.flags&=-9);let o=[];if(this.view.viewport.from||this.view.viewport.to=0?i[s]:null;if(!a)break;let{fromA:l,toA:c,fromB:u,toB:f}=a,d,h,p,g;if(r&&r.range.fromBu){let b=Ek.build(this.view.state.doc,u,r.range.fromB,this.decorations,this.dynamicDecorationMap),w=Ek.build(this.view.state.doc,r.range.toB,f,this.decorations,this.dynamicDecorationMap);h=b.breakAtStart,p=b.openStart,g=w.openEnd;let _=this.compositionView(r);w.breakAtStart?_.breakAfter=1:w.content.length&&_.merge(_.length,_.length,w.content[0],!1,w.openStart,0)&&(_.breakAfter=w.content[0].breakAfter,w.content.shift()),b.content.length&&_.merge(0,0,b.content[b.content.length-1],!0,0,b.openEnd)&&b.content.pop(),d=b.content.concat(_).concat(w.content)}else({content:d,breakAtStart:h,openStart:p,openEnd:g}=Ek.build(this.view.state.doc,u,f,this.decorations,this.dynamicDecorationMap));let{i:m,off:v}=o.findPos(c,1),{i:y,off:x}=o.findPos(l,-1);y9e(this,y,x,m,v,d,h,p,g)}r&&this.fixCompositionDOM(r)}updateEditContextFormatting(e){this.editContextFormatting=this.editContextFormatting.map(e.changes);for(let n of e.transactions)for(let r of n.effects)r.is(j9e)&&(this.editContextFormatting=r.value)}compositionView(e){let n=new Qf(e.text.nodeValue);n.flags|=8;for(let{deco:i}of e.marks)n=new Ng(i,[n],n.length);let r=new no;return r.append(n,0),r}fixCompositionDOM(e){let n=(o,s)=>{s.flags|=8|(s.children.some(l=>l.flags&7)?1:0),this.markedForComposition.add(s);let a=Dr.get(o);a&&a!=s&&(a.dom=null),s.setDOM(o)},r=this.childPos(e.range.fromB,1),i=this.children[r.i];n(e.line,i);for(let o=e.marks.length-1;o>=-1;o--)r=i.childPos(r.off,1),i=i.children[r.i],n(o>=0?e.marks[o].node:e.text,i)}updateSelection(e=!1,n=!1){(e||!this.view.observer.selectionRange.focusNode)&&this.view.observer.readSelectionRange();let r=this.view.root.activeElement,i=r==this.dom,o=!i&&z3(this.dom,this.view.observer.selectionRange)&&!(r&&this.dom.contains(r));if(!(i||n||o))return;let s=this.forceSelection;this.forceSelection=!1;let a=this.view.state.selection.main,l=this.moveToLine(this.domAtPos(a.anchor)),c=a.empty?l:this.moveToLine(this.domAtPos(a.head));if(St.gecko&&a.empty&&!this.hasComposition&&whn(l)){let f=document.createTextNode("");this.view.observer.ignore(()=>l.node.insertBefore(f,l.node.childNodes[l.offset]||null)),l=c=new Hs(f,0),s=!0}let u=this.view.observer.selectionRange;(s||!u.focusNode||(!Ok(l.node,l.offset,u.anchorNode,u.anchorOffset)||!Ok(c.node,c.offset,u.focusNode,u.focusOffset))&&!this.suppressWidgetCursorChange(u,a))&&(this.view.observer.ignore(()=>{St.android&&St.chrome&&this.dom.contains(u.focusNode)&&Ehn(u.focusNode,this.dom)&&(this.dom.blur(),this.dom.focus({preventScroll:!0}));let f=uP(this.view.root);if(f)if(a.empty){if(St.gecko){let d=Shn(l.node,l.offset);if(d&&d!=3){let h=(d==1?g9e:m9e)(l.node,l.offset);h&&(l=new Hs(h.node,h.offset))}}f.collapse(l.node,l.offset),a.bidiLevel!=null&&f.caretBidiLevel!==void 0&&(f.caretBidiLevel=a.bidiLevel)}else if(f.extend){f.collapse(l.node,l.offset);try{f.extend(c.node,c.offset)}catch{}}else{let d=document.createRange();a.anchor>a.head&&([l,c]=[c,l]),d.setEnd(c.node,c.offset),d.setStart(l.node,l.offset),f.removeAllRanges(),f.addRange(d)}o&&this.view.root.activeElement==this.dom&&(this.dom.blur(),r&&r.focus())}),this.view.observer.setSelectionRange(l,c)),this.impreciseAnchor=l.precise?null:new Hs(u.anchorNode,u.anchorOffset),this.impreciseHead=c.precise?null:new Hs(u.focusNode,u.focusOffset)}suppressWidgetCursorChange(e,n){return this.hasComposition&&n.empty&&Ok(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset)&&this.posFromDOM(e.focusNode,e.focusOffset)==n.head}enforceCursorAssoc(){if(this.hasComposition)return;let{view:e}=this,n=e.state.selection.main,r=uP(e.root),{anchorNode:i,anchorOffset:o}=e.observer.selectionRange;if(!r||!n.empty||!n.assoc||!r.modify)return;let s=no.find(this,n.head);if(!s)return;let a=s.posAtStart;if(n.head==a||n.head==a+s.length)return;let l=this.coordsAt(n.head,-1),c=this.coordsAt(n.head,1);if(!l||!c||l.bottom>c.top)return;let u=this.domAtPos(n.head+n.assoc);r.collapse(u.node,u.offset),r.modify("move",n.assoc<0?"forward":"backward","lineboundary"),e.observer.readSelectionRange();let f=e.observer.selectionRange;e.docView.posFromDOM(f.anchorNode,f.anchorOffset)!=n.from&&r.collapse(i,o)}moveToLine(e){let n=this.dom,r;if(e.node!=n)return e;for(let i=e.offset;!r&&i=0;i--){let o=Dr.get(n.childNodes[i]);o instanceof no&&(r=o.domAtPos(o.length))}return r?new Hs(r.node,r.offset,!0):e}nearest(e){for(let n=e;n;){let r=Dr.get(n);if(r&&r.rootView==this)return r;n=n.parentNode}return null}posFromDOM(e,n){let r=this.nearest(e);if(!r)throw new RangeError("Trying to find position for a DOM position outside of the document");return r.localPosFromDOM(e,n)+r.posAtStart}domAtPos(e){let{i:n,off:r}=this.childCursor().findPos(e,-1);for(;n=0;s--){let a=this.children[s],l=o-a.breakAfter,c=l-a.length;if(le||a.covers(1))&&(!r||a instanceof no&&!(r instanceof no&&n>=0)))r=a,i=c;else if(r&&c==e&&l==e&&a instanceof fg&&Math.abs(n)<2){if(a.deco.startSide<0)break;s&&(r=null)}o=c}return r?r.coordsAt(e-i,n):null}coordsForChar(e){let{i:n,off:r}=this.childPos(e,1),i=this.children[n];if(!(i instanceof no))return null;for(;i.children.length;){let{i:a,off:l}=i.childPos(r,1);for(;;a++){if(a==i.children.length)return null;if((i=i.children[a]).length)break}r=l}if(!(i instanceof Qf))return null;let o=gs(i.text,r);if(o==r)return null;let s=Db(i.dom,r,o).getClientRects();for(let a=0;aMath.max(this.view.scrollDOM.clientWidth,this.minWidth)+1,a=-1,l=this.view.textDirection==si.LTR;for(let c=0,u=0;ui)break;if(c>=r){let h=f.dom.getBoundingClientRect();if(n.push(h.height),s){let p=f.dom.lastChild,g=p?mC(p):[];if(g.length){let m=g[g.length-1],v=l?m.right-h.left:h.right-m.left;v>a&&(a=v,this.minWidth=o,this.minWidthFrom=c,this.minWidthTo=d)}}}c=d+f.breakAfter}return n}textDirectionAt(e){let{i:n}=this.childPos(e,1);return getComputedStyle(this.children[n].dom).direction=="rtl"?si.RTL:si.LTR}measureTextSize(){for(let o of this.children)if(o instanceof no){let s=o.measureTextSize();if(s)return s}let e=document.createElement("div"),n,r,i;return e.className="cm-line",e.style.width="99999px",e.style.position="absolute",e.textContent="abc def ghi jkl mno pqr stu",this.view.observer.ignore(()=>{this.dom.appendChild(e);let o=mC(e.firstChild)[0];n=e.getBoundingClientRect().height,r=o?o.width/27:7,i=o?o.height:n,e.remove()}),{lineHeight:n,charWidth:r,textHeight:i}}childCursor(e=this.length){let n=this.children.length;return n&&(e-=this.children[--n].length),new v9e(this.children,e,n)}computeBlockGapDeco(){let e=[],n=this.view.viewState;for(let r=0,i=0;;i++){let o=i==n.viewports.length?null:n.viewports[i],s=o?o.from-1:this.length;if(s>r){let a=(n.lineBlockAt(s).bottom-n.lineBlockAt(r).top)/this.view.scaleY;e.push(Dt.replace({widget:new aK(a),block:!0,inclusive:!0,isBlockGap:!0}).range(r,s))}if(!o)break;r=o.to+1}return Dt.set(e)}updateDeco(){let e=1,n=this.view.state.facet(fP).map(o=>(this.dynamicDecorationMap[e++]=typeof o=="function")?o(this.view):o),r=!1,i=this.view.state.facet(U9e).map((o,s)=>{let a=typeof o=="function";return a&&(r=!0),a?o(this.view):o});for(i.length&&(this.dynamicDecorationMap[e++]=r,n.push(Gn.join(i))),this.decorations=[this.editContextFormatting,...n,this.computeBlockGapDeco(),this.view.viewState.lineGapDeco];en.anchor?-1:1),i;if(!r)return;!n.empty&&(i=this.coordsAt(n.anchor,n.anchor>n.head?-1:1))&&(r={left:Math.min(r.left,i.left),top:Math.min(r.top,i.top),right:Math.max(r.right,i.right),bottom:Math.max(r.bottom,i.bottom)});let o=G9e(this.view),s={left:r.left-o.left,top:r.top-o.top,right:r.right+o.right,bottom:r.bottom+o.bottom},{offsetWidth:a,offsetHeight:l}=this.view.scrollDOM;thn(this.view.scrollDOM,s,n.head{re.from&&(n=!0)}),n}function khn(t,e,n=1){let r=t.charCategorizer(e),i=t.doc.lineAt(e),o=e-i.from;if(i.length==0)return Ve.cursor(e);o==0?n=1:o==i.length&&(n=-1);let s=o,a=o;n<0?s=gs(i.text,o,!1):a=gs(i.text,o);let l=r(i.text.slice(s,a));for(;s>0;){let c=gs(i.text,s,!1);if(r(i.text.slice(c,s))!=l)break;s=c}for(;at?e.left-t:Math.max(0,t-e.right)}function Phn(t,e){return e.top>t?e.top-t:Math.max(0,t-e.bottom)}function o7(t,e){return t.tope.top+1}function _1e(t,e){return et.bottom?{top:t.top,left:t.left,right:t.right,bottom:e}:t}function dK(t,e,n){let r,i,o,s,a=!1,l,c,u,f;for(let p=t.firstChild;p;p=p.nextSibling){let g=mC(p);for(let m=0;mx||s==x&&o>y){r=p,i=v,o=y,s=x;let b=x?n0?m0)}y==0?n>v.bottom&&(!u||u.bottomv.top)&&(c=p,f=v):u&&o7(u,v)?u=S1e(u,v.bottom):f&&o7(f,v)&&(f=_1e(f,v.top))}}if(u&&u.bottom>=n?(r=l,i=u):f&&f.top<=n&&(r=c,i=f),!r)return{node:t,offset:0};let d=Math.max(i.left,Math.min(i.right,e));if(r.nodeType==3)return C1e(r,d,n);if(a&&r.contentEditable!="false")return dK(r,d,n);let h=Array.prototype.indexOf.call(t.childNodes,r)+(e>=(i.left+i.right)/2?1:0);return{node:t,offset:h}}function C1e(t,e,n){let r=t.nodeValue.length,i=-1,o=1e9,s=0;for(let a=0;an?u.top-n:n-u.bottom)-1;if(u.left-1<=e&&u.right+1>=e&&f=(u.left+u.right)/2,h=d;if((St.chrome||St.gecko)&&Db(t,a).getBoundingClientRect().left==u.right&&(h=!d),f<=0)return{node:t,offset:a+(h?1:0)};i=a+(h?1:0),o=f}}}return{node:t,offset:i>-1?i:s>0?t.nodeValue.length:0}}function q9e(t,e,n,r=-1){var i,o;let s=t.contentDOM.getBoundingClientRect(),a=s.top+t.viewState.paddingTop,l,{docHeight:c}=t.viewState,{x:u,y:f}=e,d=f-a;if(d<0)return 0;if(d>c)return t.state.doc.length;for(let b=t.viewState.heightOracle.textHeight/2,w=!1;l=t.elementAtHeight(d),l.type!=Ea.Text;)for(;d=r>0?l.bottom+b:l.top-b,!(d>=0&&d<=c);){if(w)return n?null:0;w=!0,r=-r}f=a+d;let h=l.from;if(ht.viewport.to)return t.viewport.to==t.state.doc.length?t.state.doc.length:n?null:O1e(t,s,l,u,f);let p=t.dom.ownerDocument,g=t.root.elementFromPoint?t.root:p,m=g.elementFromPoint(u,f);m&&!t.contentDOM.contains(m)&&(m=null),m||(u=Math.max(s.left+1,Math.min(s.right-1,u)),m=g.elementFromPoint(u,f),m&&!t.contentDOM.contains(m)&&(m=null));let v,y=-1;if(m&&((i=t.docView.nearest(m))===null||i===void 0?void 0:i.isEditable)!=!1){if(p.caretPositionFromPoint){let b=p.caretPositionFromPoint(u,f);b&&({offsetNode:v,offset:y}=b)}else if(p.caretRangeFromPoint){let b=p.caretRangeFromPoint(u,f);b&&({startContainer:v,startOffset:y}=b,(!t.contentDOM.contains(v)||St.safari&&Mhn(v,y,u)||St.chrome&&Rhn(v,y,u))&&(v=void 0))}}if(!v||!t.docView.dom.contains(v)){let b=no.find(t.docView,h);if(!b)return d>l.top+l.height/2?l.to:l.from;({node:v,offset:y}=dK(b.dom,u,f))}let x=t.docView.nearest(v);if(!x)return null;if(x.isWidget&&((o=x.dom)===null||o===void 0?void 0:o.nodeType)==1){let b=x.dom.getBoundingClientRect();return e.yt.defaultLineHeight*1.5){let a=t.viewState.heightOracle.textHeight,l=Math.floor((i-n.top-(t.defaultLineHeight-a)*.5)/a);o+=l*t.viewState.heightOracle.lineLength}let s=t.state.sliceDoc(n.from,n.to);return n.from+KQ(s,o,t.state.tabSize)}function Mhn(t,e,n){let r;if(t.nodeType!=3||e!=(r=t.nodeValue.length))return!1;for(let i=t.nextSibling;i;i=i.nextSibling)if(i.nodeType!=1||i.nodeName!="BR")return!1;return Db(t,r-1,r).getBoundingClientRect().left>n}function Rhn(t,e,n){if(e!=0)return!1;for(let i=t;;){let o=i.parentNode;if(!o||o.nodeType!=1||o.firstChild!=i)return!1;if(o.classList.contains("cm-line"))break;i=o}let r=t.nodeType==1?t.getBoundingClientRect():Db(t,0,Math.max(t.nodeValue.length,1)).getBoundingClientRect();return n-r.left>5}function hK(t,e){let n=t.lineBlockAt(e);if(Array.isArray(n.type)){for(let r of n.type)if(r.to>e||r.to==e&&(r.to==n.to||r.type==Ea.Text))return r}return n}function Dhn(t,e,n,r){let i=hK(t,e.head),o=!r||i.type!=Ea.Text||!(t.lineWrapping||i.widgetLineBreaks)?null:t.coordsAtPos(e.assoc<0&&e.head>i.from?e.head-1:e.head);if(o){let s=t.dom.getBoundingClientRect(),a=t.textDirectionAt(i.from),l=t.posAtCoords({x:n==(a==si.LTR)?s.right-1:s.left+1,y:(o.top+o.bottom)/2});if(l!=null)return Ve.cursor(l,n?-1:1)}return Ve.cursor(n?i.to:i.from,n?-1:1)}function E1e(t,e,n,r){let i=t.state.doc.lineAt(e.head),o=t.bidiSpans(i),s=t.textDirectionAt(i.from);for(let a=e,l=null;;){let c=yhn(i,o,s,a,n),u=P9e;if(!c){if(i.number==(n?t.state.doc.lines:1))return a;u=` +`,i=t.state.doc.line(i.number+(n?1:-1)),o=t.bidiSpans(i),c=t.visualLineSide(i,!n)}if(l){if(!l(u))return a}else{if(!r)return c;l=r(u)}a=c}}function Ihn(t,e,n){let r=t.state.charCategorizer(e),i=r(n);return o=>{let s=r(o);return i==gi.Space&&(i=s),i==s}}function Lhn(t,e,n,r){let i=e.head,o=n?1:-1;if(i==(n?t.state.doc.length:0))return Ve.cursor(i,e.assoc);let s=e.goalColumn,a,l=t.contentDOM.getBoundingClientRect(),c=t.coordsAtPos(i,e.assoc||-1),u=t.documentTop;if(c)s==null&&(s=c.left-l.left),a=o<0?c.top:c.bottom;else{let h=t.viewState.lineBlockAt(i);s==null&&(s=Math.min(l.right-l.left,t.defaultCharacterWidth*(i-h.from))),a=(o<0?h.top:h.bottom)+u}let f=l.left+s,d=r??t.viewState.heightOracle.textHeight>>1;for(let h=0;;h+=10){let p=a+(d+h)*o,g=q9e(t,{x:f,y:p},!1,o);if(pl.bottom||(o<0?gi)){let m=t.docView.coordsForChar(g),v=!m||p{if(e>o&&ei(t)),n.from,e.head>n.from?-1:1);return r==n.from?n:Ve.cursor(r,ro)&&this.lineBreak(),i=s}return this.findPointBefore(r,n),this}readTextNode(e){let n=e.nodeValue;for(let r of this.points)r.node==e&&(r.pos=this.text.length+Math.min(r.offset,n.length));for(let r=0,i=this.lineSeparator?null:/\r\n?|\n/g;;){let o=-1,s=1,a;if(this.lineSeparator?(o=n.indexOf(this.lineSeparator,r),s=this.lineSeparator.length):(a=i.exec(n))&&(o=a.index,s=a[0].length),this.append(n.slice(r,o<0?n.length:o)),o<0)break;if(this.lineBreak(),s>1)for(let l of this.points)l.node==e&&l.pos>this.text.length&&(l.pos-=s-1);r=o+s}}readNode(e){if(e.cmIgnore)return;let n=Dr.get(e),r=n&&n.overrideDOMText;if(r!=null){this.findPointInside(e,r.length);for(let i=r.iter();!i.next().done;)i.lineBreak?this.lineBreak():this.append(i.value)}else e.nodeType==3?this.readTextNode(e):e.nodeName=="BR"?e.nextSibling&&this.lineBreak():e.nodeType==1&&this.readRange(e.firstChild,null)}findPointBefore(e,n){for(let r of this.points)r.node==e&&e.childNodes[r.offset]==n&&(r.pos=this.text.length)}findPointInside(e,n){for(let r of this.points)(e.nodeType==3?r.node==e:e.contains(r.node))&&(r.pos=this.text.length+(Fhn(e,r.node,r.offset)?n:0))}}function Fhn(t,e,n){for(;;){if(!e||n-1;let{impreciseHead:o,impreciseAnchor:s}=e.docView;if(e.state.readOnly&&n>-1)this.newSel=null;else if(n>-1&&(this.bounds=e.docView.domBoundsAround(n,r,0))){let a=o||s?[]:Bhn(e),l=new $hn(a,e.state);l.readRange(this.bounds.startDOM,this.bounds.endDOM),this.text=l.text,this.newSel=Uhn(a,this.bounds.from)}else{let a=e.observer.selectionRange,l=o&&o.node==a.focusNode&&o.offset==a.focusOffset||!eK(e.contentDOM,a.focusNode)?e.state.selection.main.head:e.docView.posFromDOM(a.focusNode,a.focusOffset),c=s&&s.node==a.anchorNode&&s.offset==a.anchorOffset||!eK(e.contentDOM,a.anchorNode)?e.state.selection.main.anchor:e.docView.posFromDOM(a.anchorNode,a.anchorOffset),u=e.viewport;if((St.ios||St.chrome)&&e.state.selection.main.empty&&l!=c&&(u.from>0||u.toDate.now()-100?t.inputState.lastKeyCode:-1;if(e.bounds){let{from:s,to:a}=e.bounds,l=i.from,c=null;(o===8||St.android&&e.text.length=i.from&&n.to<=i.to&&(n.from!=i.from||n.to!=i.to)&&i.to-i.from-(n.to-n.from)<=4?n={from:i.from,to:i.to,insert:t.state.doc.slice(i.from,n.from).append(n.insert).append(t.state.doc.slice(n.to,i.to))}:(St.mac||St.android)&&n&&n.from==n.to&&n.from==i.head-1&&/^\. ?$/.test(n.insert.toString())&&t.contentDOM.getAttribute("autocorrect")=="off"?(r&&n.insert.length==2&&(r=Ve.single(r.main.anchor-1,r.main.head-1)),n={from:i.from,to:i.to,insert:ar.of([" "])}):St.chrome&&n&&n.from==n.to&&n.from==i.head&&n.insert.toString()==` + `&&t.lineWrapping&&(r&&(r=Ve.single(r.main.anchor-1,r.main.head-1)),n={from:i.from,to:i.to,insert:ar.of([" "])}),n)return zle(t,n,r,o);if(r&&!r.main.eq(i)){let s=!1,a="select";return t.inputState.lastSelectionTime>Date.now()-50&&(t.inputState.lastSelectionOrigin=="select"&&(s=!0),a=t.inputState.lastSelectionOrigin),t.dispatch({selection:r,scrollIntoView:s,userEvent:a}),!0}else return!1}function zle(t,e,n,r=-1){if(St.ios&&t.inputState.flushIOSKey(e))return!0;let i=t.state.selection.main;if(St.android&&(e.to==i.to&&(e.from==i.from||e.from==i.from-1&&t.state.sliceDoc(e.from,i.from)==" ")&&e.insert.length==1&&e.insert.lines==2&&K_(t.contentDOM,"Enter",13)||(e.from==i.from-1&&e.to==i.to&&e.insert.length==0||r==8&&e.insert.lengthi.head)&&K_(t.contentDOM,"Backspace",8)||e.from==i.from&&e.to==i.to+1&&e.insert.length==0&&K_(t.contentDOM,"Delete",46)))return!0;let o=e.insert.toString();t.inputState.composing>=0&&t.inputState.composing++;let s,a=()=>s||(s=zhn(t,e,n));return t.state.facet(L9e).some(l=>l(t,e.from,e.to,o,a))||t.dispatch(a()),!0}function zhn(t,e,n){let r,i=t.state,o=i.selection.main;if(e.from>=o.from&&e.to<=o.to&&e.to-e.from>=(o.to-o.from)/3&&(!n||n.main.empty&&n.main.from==e.from+e.insert.length)&&t.inputState.composing<0){let a=o.frome.to?i.sliceDoc(e.to,o.to):"";r=i.replaceSelection(t.state.toText(a+e.insert.sliceString(0,void 0,t.state.lineBreak)+l))}else{let a=i.changes(e),l=n&&n.main.to<=a.newLength?n.main:void 0;if(i.selection.ranges.length>1&&t.inputState.composing>=0&&e.to<=o.to&&e.to>=o.to-10){let c=t.state.sliceDoc(e.from,e.to),u,f=n&&H9e(t,n.main.head);if(f){let p=e.insert.length-(e.to-e.from);u={from:f.from,to:f.to-p}}else u=t.state.doc.lineAt(o.head);let d=o.to-e.to,h=o.to-o.from;r=i.changeByRange(p=>{if(p.from==o.from&&p.to==o.to)return{changes:a,range:l||p.map(a)};let g=p.to-d,m=g-c.length;if(p.to-p.from!=h||t.state.sliceDoc(m,g)!=c||p.to>=u.from&&p.from<=u.to)return{range:p};let v=i.changes({from:m,to:g,insert:e.insert}),y=p.to-o.to;return{changes:v,range:l?Ve.range(Math.max(0,l.anchor+y),Math.max(0,l.head+y)):p.map(v)}})}else r={changes:a,selection:l&&i.selection.replaceRange(l)}}let s="input.type";return(t.composing||t.inputState.compositionPendingChange&&t.inputState.compositionEndedAt>Date.now()-50)&&(t.inputState.compositionPendingChange=!1,s+=".compose",t.inputState.compositionFirstChange&&(s+=".start",t.inputState.compositionFirstChange=!1)),i.update(r,{userEvent:s,scrollIntoView:!0})}function jhn(t,e,n,r){let i=Math.min(t.length,e.length),o=0;for(;o0&&a>0&&t.charCodeAt(s-1)==e.charCodeAt(a-1);)s--,a--;if(r=="end"){let l=Math.max(0,o-Math.min(s,a));n-=s+l-o}if(s=s?o-n:0;o-=l,a=o+(a-s),s=o}else if(a=a?o-n:0;o-=l,s=o+(s-a),a=o}return{from:o,toA:s,toB:a}}function Bhn(t){let e=[];if(t.root.activeElement!=t.contentDOM)return e;let{anchorNode:n,anchorOffset:r,focusNode:i,focusOffset:o}=t.observer.selectionRange;return n&&(e.push(new T1e(n,r)),(i!=n||o!=r)&&e.push(new T1e(i,o))),e}function Uhn(t,e){if(t.length==0)return null;let n=t[0].pos,r=t.length==2?t[1].pos:n;return n>-1&&r>-1?Ve.single(n+e,r+e):null}class Whn{setSelectionOrigin(e){this.lastSelectionOrigin=e,this.lastSelectionTime=Date.now()}constructor(e){this.view=e,this.lastKeyCode=0,this.lastKeyTime=0,this.lastTouchTime=0,this.lastFocusTime=0,this.lastScrollTop=0,this.lastScrollLeft=0,this.pendingIOSKey=void 0,this.tabFocusMode=-1,this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastContextMenu=0,this.scrollHandlers=[],this.handlers=Object.create(null),this.composing=-1,this.compositionFirstChange=null,this.compositionEndedAt=0,this.compositionPendingKey=!1,this.compositionPendingChange=!1,this.mouseSelection=null,this.draggedContent=null,this.handleEvent=this.handleEvent.bind(this),this.notifiedFocused=e.hasFocus,St.safari&&e.contentDOM.addEventListener("input",()=>null),St.gecko&&opn(e.contentDOM.ownerDocument)}handleEvent(e){!Khn(this.view,e)||this.ignoreDuringComposition(e)||e.type=="keydown"&&this.keydown(e)||this.runHandlers(e.type,e)}runHandlers(e,n){let r=this.handlers[e];if(r){for(let i of r.observers)i(this.view,n);for(let i of r.handlers){if(n.defaultPrevented)break;if(i(this.view,n)){n.preventDefault();break}}}}ensureHandlers(e){let n=Vhn(e),r=this.handlers,i=this.view.contentDOM;for(let o in n)if(o!="scroll"){let s=!n[o].handlers.length,a=r[o];a&&s!=!a.handlers.length&&(i.removeEventListener(o,this.handleEvent),a=null),a||i.addEventListener(o,this.handleEvent,{passive:s})}for(let o in r)o!="scroll"&&!n[o]&&i.removeEventListener(o,this.handleEvent);this.handlers=n}keydown(e){if(this.lastKeyCode=e.keyCode,this.lastKeyTime=Date.now(),e.keyCode==9&&this.tabFocusMode>-1&&(!this.tabFocusMode||Date.now()<=this.tabFocusMode))return!0;if(this.tabFocusMode>0&&e.keyCode!=27&&Q9e.indexOf(e.keyCode)<0&&(this.tabFocusMode=-1),St.android&&St.chrome&&!e.synthetic&&(e.keyCode==13||e.keyCode==8))return this.view.observer.delayAndroidKey(e.key,e.keyCode),!0;let n;return St.ios&&!e.synthetic&&!e.altKey&&!e.metaKey&&((n=Y9e.find(r=>r.keyCode==e.keyCode))&&!e.ctrlKey||Ghn.indexOf(e.key)>-1&&e.ctrlKey&&!e.shiftKey)?(this.pendingIOSKey=n||e,setTimeout(()=>this.flushIOSKey(),250),!0):(e.keyCode!=229&&this.view.observer.forceFlush(),!1)}flushIOSKey(e){let n=this.pendingIOSKey;return!n||n.key=="Enter"&&e&&e.from0?!0:St.safari&&!St.ios&&this.compositionPendingKey&&Date.now()-this.compositionEndedAt<100?(this.compositionPendingKey=!1,!0):!1:!1}startMouseSelection(e){this.mouseSelection&&this.mouseSelection.destroy(),this.mouseSelection=e}update(e){this.view.observer.update(e),this.mouseSelection&&this.mouseSelection.update(e),this.draggedContent&&e.docChanged&&(this.draggedContent=this.draggedContent.map(e.changes)),e.transactions.length&&(this.lastKeyCode=this.lastSelectionTime=0)}destroy(){this.mouseSelection&&this.mouseSelection.destroy()}}function k1e(t,e){return(n,r)=>{try{return e.call(t,r,n)}catch(i){sl(n.state,i)}}}function Vhn(t){let e=Object.create(null);function n(r){return e[r]||(e[r]={observers:[],handlers:[]})}for(let r of t){let i=r.spec;if(i&&i.domEventHandlers)for(let o in i.domEventHandlers){let s=i.domEventHandlers[o];s&&n(o).handlers.push(k1e(r.value,s))}if(i&&i.domEventObservers)for(let o in i.domEventObservers){let s=i.domEventObservers[o];s&&n(o).observers.push(k1e(r.value,s))}}for(let r in Kf)n(r).handlers.push(Kf[r]);for(let r in Iu)n(r).observers.push(Iu[r]);return e}const Y9e=[{key:"Backspace",keyCode:8,inputType:"deleteContentBackward"},{key:"Enter",keyCode:13,inputType:"insertParagraph"},{key:"Enter",keyCode:13,inputType:"insertLineBreak"},{key:"Delete",keyCode:46,inputType:"deleteContentForward"}],Ghn="dthko",Q9e=[16,17,18,20,91,92,224,225],EL=6;function TL(t){return Math.max(0,t)*.7+8}function Hhn(t,e){return Math.max(Math.abs(t.clientX-e.clientX),Math.abs(t.clientY-e.clientY))}class qhn{constructor(e,n,r,i){this.view=e,this.startEvent=n,this.style=r,this.mustSelect=i,this.scrollSpeed={x:0,y:0},this.scrolling=-1,this.lastEvent=n,this.scrollParents=nhn(e.contentDOM),this.atoms=e.state.facet(Nle).map(s=>s(e));let o=e.contentDOM.ownerDocument;o.addEventListener("mousemove",this.move=this.move.bind(this)),o.addEventListener("mouseup",this.up=this.up.bind(this)),this.extend=n.shiftKey,this.multiple=e.state.facet(In.allowMultipleSelections)&&Xhn(e,n),this.dragging=Qhn(e,n)&&J9e(n)==1?null:!1}start(e){this.dragging===!1&&this.select(e)}move(e){if(e.buttons==0)return this.destroy();if(this.dragging||this.dragging==null&&Hhn(this.startEvent,e)<10)return;this.select(this.lastEvent=e);let n=0,r=0,i=0,o=0,s=this.view.win.innerWidth,a=this.view.win.innerHeight;this.scrollParents.x&&({left:i,right:s}=this.scrollParents.x.getBoundingClientRect()),this.scrollParents.y&&({top:o,bottom:a}=this.scrollParents.y.getBoundingClientRect());let l=G9e(this.view);e.clientX-l.left<=i+EL?n=-TL(i-e.clientX):e.clientX+l.right>=s-EL&&(n=TL(e.clientX-s)),e.clientY-l.top<=o+EL?r=-TL(o-e.clientY):e.clientY+l.bottom>=a-EL&&(r=TL(e.clientY-a)),this.setScrollSpeed(n,r)}up(e){this.dragging==null&&this.select(this.lastEvent),this.dragging||e.preventDefault(),this.destroy()}destroy(){this.setScrollSpeed(0,0);let e=this.view.contentDOM.ownerDocument;e.removeEventListener("mousemove",this.move),e.removeEventListener("mouseup",this.up),this.view.inputState.mouseSelection=this.view.inputState.draggedContent=null}setScrollSpeed(e,n){this.scrollSpeed={x:e,y:n},e||n?this.scrolling<0&&(this.scrolling=setInterval(()=>this.scroll(),50)):this.scrolling>-1&&(clearInterval(this.scrolling),this.scrolling=-1)}scroll(){let{x:e,y:n}=this.scrollSpeed;e&&this.scrollParents.x&&(this.scrollParents.x.scrollLeft+=e,e=0),n&&this.scrollParents.y&&(this.scrollParents.y.scrollTop+=n,n=0),(e||n)&&this.view.win.scrollBy(e,n),this.dragging===!1&&this.select(this.lastEvent)}skipAtoms(e){let n=null;for(let r=0;rn.isUserEvent("input.type"))?this.destroy():this.style.update(e)&&setTimeout(()=>this.select(this.lastEvent),20)}}function Xhn(t,e){let n=t.state.facet(M9e);return n.length?n[0](e):St.mac?e.metaKey:e.ctrlKey}function Yhn(t,e){let n=t.state.facet(R9e);return n.length?n[0](e):St.mac?!e.altKey:!e.ctrlKey}function Qhn(t,e){let{main:n}=t.state.selection;if(n.empty)return!1;let r=uP(t.root);if(!r||r.rangeCount==0)return!0;let i=r.getRangeAt(0).getClientRects();for(let o=0;o=e.clientX&&s.top<=e.clientY&&s.bottom>=e.clientY)return!0}return!1}function Khn(t,e){if(!e.bubbles)return!0;if(e.defaultPrevented)return!1;for(let n=e.target,r;n!=t.contentDOM;n=n.parentNode)if(!n||n.nodeType==11||(r=Dr.get(n))&&r.ignoreEvent(e))return!1;return!0}const Kf=Object.create(null),Iu=Object.create(null),K9e=St.ie&&St.ie_version<15||St.ios&&St.webkit_version<604;function Zhn(t){let e=t.dom.parentNode;if(!e)return;let n=e.appendChild(document.createElement("textarea"));n.style.cssText="position: fixed; left: -10000px; top: 10px",n.focus(),setTimeout(()=>{t.focus(),n.remove(),Z9e(t,n.value)},50)}function Z9e(t,e){let{state:n}=t,r,i=1,o=n.toText(e),s=o.lines==n.selection.ranges.length;if(pK!=null&&n.selection.ranges.every(l=>l.empty)&&pK==o.toString()){let l=-1;r=n.changeByRange(c=>{let u=n.doc.lineAt(c.from);if(u.from==l)return{range:c};l=u.from;let f=n.toText((s?o.line(i++).text:e)+n.lineBreak);return{changes:{from:u.from,insert:f},range:Ve.cursor(c.from+f.length)}})}else s?r=n.changeByRange(l=>{let c=o.line(i++);return{changes:{from:l.from,to:l.to,insert:c.text},range:Ve.cursor(l.from+c.length)}}):r=n.replaceSelection(o);t.dispatch(r,{userEvent:"input.paste",scrollIntoView:!0})}Iu.scroll=t=>{t.inputState.lastScrollTop=t.scrollDOM.scrollTop,t.inputState.lastScrollLeft=t.scrollDOM.scrollLeft};Kf.keydown=(t,e)=>(t.inputState.setSelectionOrigin("select"),e.keyCode==27&&t.inputState.tabFocusMode!=0&&(t.inputState.tabFocusMode=Date.now()+2e3),!1);Iu.touchstart=(t,e)=>{t.inputState.lastTouchTime=Date.now(),t.inputState.setSelectionOrigin("select.pointer")};Iu.touchmove=t=>{t.inputState.setSelectionOrigin("select.pointer")};Kf.mousedown=(t,e)=>{if(t.observer.flush(),t.inputState.lastTouchTime>Date.now()-2e3)return!1;let n=null;for(let r of t.state.facet(D9e))if(n=r(t,e),n)break;if(!n&&e.button==0&&(n=tpn(t,e)),n){let r=!t.hasFocus;t.inputState.startMouseSelection(new qhn(t,e,n,r)),r&&t.observer.ignore(()=>{d9e(t.contentDOM);let o=t.root.activeElement;o&&!o.contains(t.contentDOM)&&o.blur()});let i=t.inputState.mouseSelection;if(i)return i.start(e),i.dragging===!1}return!1};function A1e(t,e,n,r){if(r==1)return Ve.cursor(e,n);if(r==2)return khn(t.state,e,n);{let i=no.find(t.docView,e),o=t.state.doc.lineAt(i?i.posAtEnd:e),s=i?i.posAtStart:o.from,a=i?i.posAtEnd:o.to;return ae>=n.top&&e<=n.bottom&&t>=n.left&&t<=n.right;function Jhn(t,e,n,r){let i=no.find(t.docView,e);if(!i)return 1;let o=e-i.posAtStart;if(o==0)return 1;if(o==i.length)return-1;let s=i.coordsAt(o,-1);if(s&&P1e(n,r,s))return-1;let a=i.coordsAt(o,1);return a&&P1e(n,r,a)?1:s&&s.bottom>=r?-1:1}function M1e(t,e){let n=t.posAtCoords({x:e.clientX,y:e.clientY},!1);return{pos:n,bias:Jhn(t,n,e.clientX,e.clientY)}}const epn=St.ie&&St.ie_version<=11;let R1e=null,D1e=0,I1e=0;function J9e(t){if(!epn)return t.detail;let e=R1e,n=I1e;return R1e=t,I1e=Date.now(),D1e=!e||n>Date.now()-400&&Math.abs(e.clientX-t.clientX)<2&&Math.abs(e.clientY-t.clientY)<2?(D1e+1)%3:1}function tpn(t,e){let n=M1e(t,e),r=J9e(e),i=t.state.selection;return{update(o){o.docChanged&&(n.pos=o.changes.mapPos(n.pos),i=i.map(o.changes))},get(o,s,a){let l=M1e(t,o),c,u=A1e(t,l.pos,l.bias,r);if(n.pos!=l.pos&&!s){let f=A1e(t,n.pos,n.bias,r),d=Math.min(f.from,u.from),h=Math.max(f.to,u.to);u=d1&&(c=npn(i,l.pos))?c:a?i.addRange(u):Ve.create([u])}}}function npn(t,e){for(let n=0;n=e)return Ve.create(t.ranges.slice(0,n).concat(t.ranges.slice(n+1)),t.mainIndex==n?0:t.mainIndex-(t.mainIndex>n?1:0))}return null}Kf.dragstart=(t,e)=>{let{selection:{main:n}}=t.state;if(e.target.draggable){let i=t.docView.nearest(e.target);if(i&&i.isWidget){let o=i.posAtStart,s=o+i.length;(o>=n.to||s<=n.from)&&(n=Ve.range(o,s))}}let{inputState:r}=t;return r.mouseSelection&&(r.mouseSelection.dragging=!0),r.draggedContent=n,e.dataTransfer&&(e.dataTransfer.setData("Text",t.state.sliceDoc(n.from,n.to)),e.dataTransfer.effectAllowed="copyMove"),!1};Kf.dragend=t=>(t.inputState.draggedContent=null,!1);function L1e(t,e,n,r){if(!n)return;let i=t.posAtCoords({x:e.clientX,y:e.clientY},!1),{draggedContent:o}=t.inputState,s=r&&o&&Yhn(t,e)?{from:o.from,to:o.to}:null,a={from:i,insert:n},l=t.state.changes(s?[s,a]:a);t.focus(),t.dispatch({changes:l,selection:{anchor:l.mapPos(i,-1),head:l.mapPos(i,1)},userEvent:s?"move.drop":"input.drop"}),t.inputState.draggedContent=null}Kf.drop=(t,e)=>{if(!e.dataTransfer)return!1;if(t.state.readOnly)return!0;let n=e.dataTransfer.files;if(n&&n.length){let r=Array(n.length),i=0,o=()=>{++i==n.length&&L1e(t,e,r.filter(s=>s!=null).join(t.state.lineBreak),!1)};for(let s=0;s{/[\x00-\x08\x0e-\x1f]{2}/.test(a.result)||(r[s]=a.result),o()},a.readAsText(n[s])}return!0}else{let r=e.dataTransfer.getData("Text");if(r)return L1e(t,e,r,!0),!0}return!1};Kf.paste=(t,e)=>{if(t.state.readOnly)return!0;t.observer.flush();let n=K9e?null:e.clipboardData;return n?(Z9e(t,n.getData("text/plain")||n.getData("text/uri-list")),!0):(Zhn(t),!1)};function rpn(t,e){let n=t.dom.parentNode;if(!n)return;let r=n.appendChild(document.createElement("textarea"));r.style.cssText="position: fixed; left: -10000px; top: 10px",r.value=e,r.focus(),r.selectionEnd=e.length,r.selectionStart=0,setTimeout(()=>{r.remove(),t.focus()},50)}function ipn(t){let e=[],n=[],r=!1;for(let i of t.selection.ranges)i.empty||(e.push(t.sliceDoc(i.from,i.to)),n.push(i));if(!e.length){let i=-1;for(let{from:o}of t.selection.ranges){let s=t.doc.lineAt(o);s.number>i&&(e.push(s.text),n.push({from:s.from,to:Math.min(t.doc.length,s.to+1)})),i=s.number}r=!0}return{text:e.join(t.lineBreak),ranges:n,linewise:r}}let pK=null;Kf.copy=Kf.cut=(t,e)=>{let{text:n,ranges:r,linewise:i}=ipn(t.state);if(!n&&!i)return!1;pK=i?n:null,e.type=="cut"&&!t.state.readOnly&&t.dispatch({changes:r,scrollIntoView:!0,userEvent:"delete.cut"});let o=K9e?null:e.clipboardData;return o?(o.clearData(),o.setData("text/plain",n),!0):(rpn(t,n),!1)};const e7e=Qh.define();function t7e(t,e){let n=[];for(let r of t.facet($9e)){let i=r(t,e);i&&n.push(i)}return n?t.update({effects:n,annotations:e7e.of(!0)}):null}function n7e(t){setTimeout(()=>{let e=t.hasFocus;if(e!=t.inputState.notifiedFocused){let n=t7e(t.state,e);n?t.dispatch(n):t.update([])}},10)}Iu.focus=t=>{t.inputState.lastFocusTime=Date.now(),!t.scrollDOM.scrollTop&&(t.inputState.lastScrollTop||t.inputState.lastScrollLeft)&&(t.scrollDOM.scrollTop=t.inputState.lastScrollTop,t.scrollDOM.scrollLeft=t.inputState.lastScrollLeft),n7e(t)};Iu.blur=t=>{t.observer.clearSelectionRange(),n7e(t)};Iu.compositionstart=Iu.compositionupdate=t=>{t.observer.editContext||(t.inputState.compositionFirstChange==null&&(t.inputState.compositionFirstChange=!0),t.inputState.composing<0&&(t.inputState.composing=0))};Iu.compositionend=t=>{t.observer.editContext||(t.inputState.composing=-1,t.inputState.compositionEndedAt=Date.now(),t.inputState.compositionPendingKey=!0,t.inputState.compositionPendingChange=t.observer.pendingRecords().length>0,t.inputState.compositionFirstChange=null,St.chrome&&St.android?t.observer.flushSoon():t.inputState.compositionPendingChange?Promise.resolve().then(()=>t.observer.flush()):setTimeout(()=>{t.inputState.composing<0&&t.docView.hasComposition&&t.update([])},50))};Iu.contextmenu=t=>{t.inputState.lastContextMenu=Date.now()};Kf.beforeinput=(t,e)=>{var n,r;if(e.inputType=="insertReplacementText"&&t.observer.editContext){let o=(n=e.dataTransfer)===null||n===void 0?void 0:n.getData("text/plain"),s=e.getTargetRanges();if(o&&s.length){let a=s[0],l=t.posAtDOM(a.startContainer,a.startOffset),c=t.posAtDOM(a.endContainer,a.endOffset);return zle(t,{from:l,to:c,insert:t.state.toText(o)},null),!0}}let i;if(St.chrome&&St.android&&(i=Y9e.find(o=>o.inputType==e.inputType))&&(t.observer.delayAndroidKey(i.key,i.keyCode),i.key=="Backspace"||i.key=="Delete")){let o=((r=window.visualViewport)===null||r===void 0?void 0:r.height)||0;setTimeout(()=>{var s;(((s=window.visualViewport)===null||s===void 0?void 0:s.height)||0)>o+10&&t.hasFocus&&(t.contentDOM.blur(),t.focus())},100)}return St.ios&&e.inputType=="deleteContentForward"&&t.observer.flushSoon(),St.safari&&e.inputType=="insertText"&&t.inputState.composing>=0&&setTimeout(()=>Iu.compositionend(t,e),20),!1};const $1e=new Set;function opn(t){$1e.has(t)||($1e.add(t),t.addEventListener("copy",()=>{}),t.addEventListener("cut",()=>{}))}const F1e=["pre-wrap","normal","pre-line","break-spaces"];let xC=!1;function N1e(){xC=!1}class spn{constructor(e){this.lineWrapping=e,this.doc=ar.empty,this.heightSamples={},this.lineHeight=14,this.charWidth=7,this.textHeight=14,this.lineLength=30}heightForGap(e,n){let r=this.doc.lineAt(n).number-this.doc.lineAt(e).number+1;return this.lineWrapping&&(r+=Math.max(0,Math.ceil((n-e-r*this.lineLength*.5)/this.lineLength))),this.lineHeight*r}heightForLine(e){return this.lineWrapping?(1+Math.max(0,Math.ceil((e-this.lineLength)/(this.lineLength-5))))*this.lineHeight:this.lineHeight}setDoc(e){return this.doc=e,this}mustRefreshForWrapping(e){return F1e.indexOf(e)>-1!=this.lineWrapping}mustRefreshForHeights(e){let n=!1;for(let r=0;r-1,l=Math.round(n)!=Math.round(this.lineHeight)||this.lineWrapping!=a;if(this.lineWrapping=a,this.lineHeight=n,this.charWidth=r,this.textHeight=i,this.lineLength=o,l){this.heightSamples={};for(let c=0;c0}set outdated(e){this.flags=(e?2:0)|this.flags&-3}setHeight(e){this.height!=e&&(Math.abs(this.height-e)>B3&&(xC=!0),this.height=e)}replace(e,n,r){return Ta.of(r)}decomposeLeft(e,n){n.push(this)}decomposeRight(e,n){n.push(this)}applyChanges(e,n,r,i){let o=this,s=r.doc;for(let a=i.length-1;a>=0;a--){let{fromA:l,toA:c,fromB:u,toB:f}=i[a],d=o.lineAt(l,Yr.ByPosNoHeight,r.setDoc(n),0,0),h=d.to>=c?d:o.lineAt(c,Yr.ByPosNoHeight,r,0,0);for(f+=h.to-c,c=h.to;a>0&&d.from<=i[a-1].toA;)l=i[a-1].fromA,u=i[a-1].fromB,a--,lo*2){let a=e[n-1];a.break?e.splice(--n,1,a.left,null,a.right):e.splice(--n,1,a.left,a.right),r+=1+a.break,i-=a.size}else if(o>i*2){let a=e[r];a.break?e.splice(r,1,a.left,null,a.right):e.splice(r,1,a.left,a.right),r+=2+a.break,o-=a.size}else break;else if(i=o&&s(this.blockAt(0,r,i,o))}updateHeight(e,n=0,r=!1,i){return i&&i.from<=n&&i.more&&this.setHeight(i.heights[i.index++]),this.outdated=!1,this}toString(){return`block(${this.length})`}}class Xl extends r7e{constructor(e,n){super(e,n,null),this.collapsed=0,this.widgetHeight=0,this.breaks=0}blockAt(e,n,r,i){return new Hd(i,this.length,r,this.height,this.breaks)}replace(e,n,r){let i=r[0];return r.length==1&&(i instanceof Xl||i instanceof ts&&i.flags&4)&&Math.abs(this.length-i.length)<10?(i instanceof ts?i=new Xl(i.length,this.height):i.height=this.height,this.outdated||(i.outdated=!1),i):Ta.of(r)}updateHeight(e,n=0,r=!1,i){return i&&i.from<=n&&i.more?this.setHeight(i.heights[i.index++]):(r||this.outdated)&&this.setHeight(Math.max(this.widgetHeight,e.heightForLine(this.length-this.collapsed))+this.breaks*e.lineHeight),this.outdated=!1,this}toString(){return`line(${this.length}${this.collapsed?-this.collapsed:""}${this.widgetHeight?":"+this.widgetHeight:""})`}}class ts extends Ta{constructor(e){super(e,0)}heightMetrics(e,n){let r=e.doc.lineAt(n).number,i=e.doc.lineAt(n+this.length).number,o=i-r+1,s,a=0;if(e.lineWrapping){let l=Math.min(this.height,e.lineHeight*o);s=l/o,this.length>o+1&&(a=(this.height-l)/(this.length-o-1))}else s=this.height/o;return{firstLine:r,lastLine:i,perLine:s,perChar:a}}blockAt(e,n,r,i){let{firstLine:o,lastLine:s,perLine:a,perChar:l}=this.heightMetrics(n,i);if(n.lineWrapping){let c=i+(e0){let o=r[r.length-1];o instanceof ts?r[r.length-1]=new ts(o.length+i):r.push(null,new ts(i-1))}if(e>0){let o=r[0];o instanceof ts?r[0]=new ts(e+o.length):r.unshift(new ts(e-1),null)}return Ta.of(r)}decomposeLeft(e,n){n.push(new ts(e-1),null)}decomposeRight(e,n){n.push(null,new ts(this.length-e-1))}updateHeight(e,n=0,r=!1,i){let o=n+this.length;if(i&&i.from<=n+this.length&&i.more){let s=[],a=Math.max(n,i.from),l=-1;for(i.from>n&&s.push(new ts(i.from-n-1).updateHeight(e,n));a<=o&&i.more;){let u=e.doc.lineAt(a).length;s.length&&s.push(null);let f=i.heights[i.index++];l==-1?l=f:Math.abs(f-l)>=B3&&(l=-2);let d=new Xl(u,f);d.outdated=!1,s.push(d),a+=u+1}a<=o&&s.push(null,new ts(o-a).updateHeight(e,a));let c=Ta.of(s);return(l<0||Math.abs(c.height-this.height)>=B3||Math.abs(l-this.heightMetrics(e,n).perLine)>=B3)&&(xC=!0),nz(this,c)}else(r||this.outdated)&&(this.setHeight(e.heightForGap(n,n+this.length)),this.outdated=!1);return this}toString(){return`gap(${this.length})`}}class lpn extends Ta{constructor(e,n,r){super(e.length+n+r.length,e.height+r.height,n|(e.outdated||r.outdated?2:0)),this.left=e,this.right=r,this.size=e.size+r.size}get break(){return this.flags&1}blockAt(e,n,r,i){let o=r+this.left.height;return ea))return c;let u=n==Yr.ByPosNoHeight?Yr.ByPosNoHeight:Yr.ByPos;return l?c.join(this.right.lineAt(a,u,r,s,a)):this.left.lineAt(a,u,r,i,o).join(c)}forEachLine(e,n,r,i,o,s){let a=i+this.left.height,l=o+this.left.length+this.break;if(this.break)e=l&&this.right.forEachLine(e,n,r,a,l,s);else{let c=this.lineAt(l,Yr.ByPos,r,i,o);e=e&&c.from<=n&&s(c),n>c.to&&this.right.forEachLine(c.to+1,n,r,a,l,s)}}replace(e,n,r){let i=this.left.length+this.break;if(nthis.left.length)return this.balanced(this.left,this.right.replace(e-i,n-i,r));let o=[];e>0&&this.decomposeLeft(e,o);let s=o.length;for(let a of r)o.push(a);if(e>0&&z1e(o,s-1),n=r&&n.push(null)),e>r&&this.right.decomposeLeft(e-r,n)}decomposeRight(e,n){let r=this.left.length,i=r+this.break;if(e>=i)return this.right.decomposeRight(e-i,n);e2*n.size||n.size>2*e.size?Ta.of(this.break?[e,null,n]:[e,n]):(this.left=nz(this.left,e),this.right=nz(this.right,n),this.setHeight(e.height+n.height),this.outdated=e.outdated||n.outdated,this.size=e.size+n.size,this.length=e.length+this.break+n.length,this)}updateHeight(e,n=0,r=!1,i){let{left:o,right:s}=this,a=n+o.length+this.break,l=null;return i&&i.from<=n+o.length&&i.more?l=o=o.updateHeight(e,n,r,i):o.updateHeight(e,n,r),i&&i.from<=a+s.length&&i.more?l=s=s.updateHeight(e,a,r,i):s.updateHeight(e,a,r),l?this.balanced(o,s):(this.height=this.left.height+this.right.height,this.outdated=!1,this)}toString(){return this.left+(this.break?" ":"-")+this.right}}function z1e(t,e){let n,r;t[e]==null&&(n=t[e-1])instanceof ts&&(r=t[e+1])instanceof ts&&t.splice(e-1,3,new ts(n.length+1+r.length))}const cpn=5;class jle{constructor(e,n){this.pos=e,this.oracle=n,this.nodes=[],this.lineStart=-1,this.lineEnd=-1,this.covering=null,this.writtenTo=e}get isCovered(){return this.covering&&this.nodes[this.nodes.length-1]==this.covering}span(e,n){if(this.lineStart>-1){let r=Math.min(n,this.lineEnd),i=this.nodes[this.nodes.length-1];i instanceof Xl?i.length+=r-this.pos:(r>this.pos||!this.isCovered)&&this.nodes.push(new Xl(r-this.pos,-1)),this.writtenTo=r,n>r&&(this.nodes.push(null),this.writtenTo++,this.lineStart=-1)}this.pos=n}point(e,n,r){if(e=cpn)&&this.addLineDeco(i,o,s)}else n>e&&this.span(e,n);this.lineEnd>-1&&this.lineEnd-1)return;let{from:e,to:n}=this.oracle.doc.lineAt(this.pos);this.lineStart=e,this.lineEnd=n,this.writtenToe&&this.nodes.push(new Xl(this.pos-e,-1)),this.writtenTo=this.pos}blankContent(e,n){let r=new ts(n-e);return this.oracle.doc.lineAt(e).to==n&&(r.flags|=4),r}ensureLine(){this.enterLine();let e=this.nodes.length?this.nodes[this.nodes.length-1]:null;if(e instanceof Xl)return e;let n=new Xl(0,-1);return this.nodes.push(n),n}addBlock(e){this.enterLine();let n=e.deco;n&&n.startSide>0&&!this.isCovered&&this.ensureLine(),this.nodes.push(e),this.writtenTo=this.pos=this.pos+e.length,n&&n.endSide>0&&(this.covering=e)}addLineDeco(e,n,r){let i=this.ensureLine();i.length+=r,i.collapsed+=r,i.widgetHeight=Math.max(i.widgetHeight,e),i.breaks+=n,this.writtenTo=this.pos=this.pos+r}finish(e){let n=this.nodes.length==0?null:this.nodes[this.nodes.length-1];this.lineStart>-1&&!(n instanceof Xl)&&!this.isCovered?this.nodes.push(new Xl(0,-1)):(this.writtenTou.clientHeight||u.scrollWidth>u.clientWidth)&&f.overflow!="visible"){let d=u.getBoundingClientRect();o=Math.max(o,d.left),s=Math.min(s,d.right),a=Math.max(a,d.top),l=Math.min(c==t.parentNode?i.innerHeight:l,d.bottom)}c=f.position=="absolute"||f.position=="fixed"?u.offsetParent:u.parentNode}else if(c.nodeType==11)c=c.host;else break;return{left:o-n.left,right:Math.max(o,s)-n.left,top:a-(n.top+e),bottom:Math.max(a,l)-(n.top+e)}}function hpn(t,e){let n=t.getBoundingClientRect();return{left:0,right:n.right-n.left,top:e,bottom:n.bottom-(n.top+e)}}class a7{constructor(e,n,r){this.from=e,this.to=n,this.size=r}static same(e,n){if(e.length!=n.length)return!1;for(let r=0;rtypeof r!="function"&&r.class=="cm-lineWrapping");this.heightOracle=new spn(n),this.stateDeco=e.facet(fP).filter(r=>typeof r!="function"),this.heightMap=Ta.empty().applyChanges(this.stateDeco,ar.empty,this.heightOracle.setDoc(e.doc),[new mu(0,0,0,e.doc.length)]);for(let r=0;r<2&&(this.viewport=this.getViewport(0,null),!!this.updateForViewport());r++);this.updateViewportLines(),this.lineGaps=this.ensureLineGaps([]),this.lineGapDeco=Dt.set(this.lineGaps.map(r=>r.draw(this,!1))),this.computeVisibleRanges()}updateForViewport(){let e=[this.viewport],{main:n}=this.state.selection;for(let r=0;r<=1;r++){let i=r?n.head:n.anchor;if(!e.some(({from:o,to:s})=>i>=o&&i<=s)){let{from:o,to:s}=this.lineBlockAt(i);e.push(new kL(o,s))}}return this.viewports=e.sort((r,i)=>r.from-i.from),this.updateScaler()}updateScaler(){let e=this.scaler;return this.scaler=this.heightMap.height<=7e6?B1e:new Ble(this.heightOracle,this.heightMap,this.viewports),e.eq(this.scaler)?0:2}updateViewportLines(){this.viewportLines=[],this.heightMap.forEachLine(this.viewport.from,this.viewport.to,this.heightOracle.setDoc(this.state.doc),0,0,e=>{this.viewportLines.push(MT(e,this.scaler))})}update(e,n=null){this.state=e.state;let r=this.stateDeco;this.stateDeco=this.state.facet(fP).filter(u=>typeof u!="function");let i=e.changedRanges,o=mu.extendWithRanges(i,upn(r,this.stateDeco,e?e.changes:mo.empty(this.state.doc.length))),s=this.heightMap.height,a=this.scrolledToBottom?null:this.scrollAnchorAt(this.scrollTop);N1e(),this.heightMap=this.heightMap.applyChanges(this.stateDeco,e.startState.doc,this.heightOracle.setDoc(this.state.doc),o),(this.heightMap.height!=s||xC)&&(e.flags|=2),a?(this.scrollAnchorPos=e.changes.mapPos(a.from,-1),this.scrollAnchorHeight=a.top):(this.scrollAnchorPos=-1,this.scrollAnchorHeight=this.heightMap.height);let l=o.length?this.mapViewport(this.viewport,e.changes):this.viewport;(n&&(n.range.headl.to)||!this.viewportIsAppropriate(l))&&(l=this.getViewport(0,n));let c=l.from!=this.viewport.from||l.to!=this.viewport.to;this.viewport=l,e.flags|=this.updateForViewport(),(c||!e.changes.empty||e.flags&2)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(this.mapLineGaps(this.lineGaps,e.changes))),e.flags|=this.computeVisibleRanges(),n&&(this.scrollTarget=n),!this.mustEnforceCursorAssoc&&e.selectionSet&&e.view.lineWrapping&&e.state.selection.main.empty&&e.state.selection.main.assoc&&!e.state.facet(N9e)&&(this.mustEnforceCursorAssoc=!0)}measure(e){let n=e.contentDOM,r=window.getComputedStyle(n),i=this.heightOracle,o=r.whiteSpace;this.defaultTextDirection=r.direction=="rtl"?si.RTL:si.LTR;let s=this.heightOracle.mustRefreshForWrapping(o),a=n.getBoundingClientRect(),l=s||this.mustMeasureContent||this.contentDOMHeight!=a.height;this.contentDOMHeight=a.height,this.mustMeasureContent=!1;let c=0,u=0;if(a.width&&a.height){let{scaleX:b,scaleY:w}=f9e(n,a);(b>.005&&Math.abs(this.scaleX-b)>.005||w>.005&&Math.abs(this.scaleY-w)>.005)&&(this.scaleX=b,this.scaleY=w,c|=8,s=l=!0)}let f=(parseInt(r.paddingTop)||0)*this.scaleY,d=(parseInt(r.paddingBottom)||0)*this.scaleY;(this.paddingTop!=f||this.paddingBottom!=d)&&(this.paddingTop=f,this.paddingBottom=d,c|=10),this.editorWidth!=e.scrollDOM.clientWidth&&(i.lineWrapping&&(l=!0),this.editorWidth=e.scrollDOM.clientWidth,c|=8);let h=e.scrollDOM.scrollTop*this.scaleY;this.scrollTop!=h&&(this.scrollAnchorHeight=-1,this.scrollTop=h),this.scrolledToBottom=p9e(e.scrollDOM);let p=(this.printing?hpn:dpn)(n,this.paddingTop),g=p.top-this.pixelViewport.top,m=p.bottom-this.pixelViewport.bottom;this.pixelViewport=p;let v=this.pixelViewport.bottom>this.pixelViewport.top&&this.pixelViewport.right>this.pixelViewport.left;if(v!=this.inView&&(this.inView=v,v&&(l=!0)),!this.inView&&!this.scrollTarget)return 0;let y=a.width;if((this.contentDOMWidth!=y||this.editorHeight!=e.scrollDOM.clientHeight)&&(this.contentDOMWidth=a.width,this.editorHeight=e.scrollDOM.clientHeight,c|=8),l){let b=e.docView.measureVisibleLineHeights(this.viewport);if(i.mustRefreshForHeights(b)&&(s=!0),s||i.lineWrapping&&Math.abs(y-this.contentDOMWidth)>i.charWidth){let{lineHeight:w,charWidth:_,textHeight:S}=e.docView.measureTextSize();s=w>0&&i.refresh(o,w,_,S,y/_,b),s&&(e.docView.minWidth=0,c|=8)}g>0&&m>0?u=Math.max(g,m):g<0&&m<0&&(u=Math.min(g,m)),N1e();for(let w of this.viewports){let _=w.from==this.viewport.from?b:e.docView.measureVisibleLineHeights(w);this.heightMap=(s?Ta.empty().applyChanges(this.stateDeco,ar.empty,this.heightOracle,[new mu(0,0,0,e.state.doc.length)]):this.heightMap).updateHeight(i,0,s,new apn(w.from,_))}xC&&(c|=2)}let x=!this.viewportIsAppropriate(this.viewport,u)||this.scrollTarget&&(this.scrollTarget.range.headthis.viewport.to);return x&&(c&2&&(c|=this.updateScaler()),this.viewport=this.getViewport(u,this.scrollTarget),c|=this.updateForViewport()),(c&2||x)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(s?[]:this.lineGaps,e)),c|=this.computeVisibleRanges(),this.mustEnforceCursorAssoc&&(this.mustEnforceCursorAssoc=!1,e.docView.enforceCursorAssoc()),c}get visibleTop(){return this.scaler.fromDOM(this.pixelViewport.top)}get visibleBottom(){return this.scaler.fromDOM(this.pixelViewport.bottom)}getViewport(e,n){let r=.5-Math.max(-.5,Math.min(.5,e/1e3/2)),i=this.heightMap,o=this.heightOracle,{visibleTop:s,visibleBottom:a}=this,l=new kL(i.lineAt(s-r*1e3,Yr.ByHeight,o,0,0).from,i.lineAt(a+(1-r)*1e3,Yr.ByHeight,o,0,0).to);if(n){let{head:c}=n.range;if(cl.to){let u=Math.min(this.editorHeight,this.pixelViewport.bottom-this.pixelViewport.top),f=i.lineAt(c,Yr.ByPos,o,0,0),d;n.y=="center"?d=(f.top+f.bottom)/2-u/2:n.y=="start"||n.y=="nearest"&&c=a+Math.max(10,Math.min(r,250)))&&i>s-2*1e3&&o>1,s=i<<1;if(this.defaultTextDirection!=si.LTR&&!r)return[];let a=[],l=(u,f,d,h)=>{if(f-uu&&vv.from>=d.from&&v.to<=d.to&&Math.abs(v.from-u)v.fromy));if(!m){if(fv.from<=f&&v.to>=f)){let v=n.moveToLineBoundary(Ve.cursor(f),!1,!0).head;v>u&&(f=v)}m=new a7(u,f,this.gapSize(d,u,f,h))}a.push(m)},c=u=>{if(u.lengthu.from&&l(u.from,h,u,f),pn.draw(this,this.heightOracle.lineWrapping))))}computeVisibleRanges(){let e=this.stateDeco;this.lineGaps.length&&(e=e.concat(this.lineGapDeco));let n=[];Gn.spans(e,this.viewport.from,this.viewport.to,{span(i,o){n.push({from:i,to:o})},point(){}},20);let r=n.length!=this.visibleRanges.length||this.visibleRanges.some((i,o)=>i.from!=n[o].from||i.to!=n[o].to);return this.visibleRanges=n,r?4:0}lineBlockAt(e){return e>=this.viewport.from&&e<=this.viewport.to&&this.viewportLines.find(n=>n.from<=e&&n.to>=e)||MT(this.heightMap.lineAt(e,Yr.ByPos,this.heightOracle,0,0),this.scaler)}lineBlockAtHeight(e){return e>=this.viewportLines[0].top&&e<=this.viewportLines[this.viewportLines.length-1].bottom&&this.viewportLines.find(n=>n.top<=e&&n.bottom>=e)||MT(this.heightMap.lineAt(this.scaler.fromDOM(e),Yr.ByHeight,this.heightOracle,0,0),this.scaler)}scrollAnchorAt(e){let n=this.lineBlockAtHeight(e+8);return n.from>=this.viewport.from||this.viewportLines[0].top-e>200?n:this.viewportLines[0]}elementAtHeight(e){return MT(this.heightMap.blockAt(this.scaler.fromDOM(e),this.heightOracle,0,0),this.scaler)}get docHeight(){return this.scaler.toDOM(this.heightMap.height)}get contentHeight(){return this.docHeight+this.paddingTop+this.paddingBottom}}class kL{constructor(e,n){this.from=e,this.to=n}}function gpn(t,e,n){let r=[],i=t,o=0;return Gn.spans(n,t,e,{span(){},point(s,a){s>i&&(r.push({from:i,to:s}),o+=s-i),i=a}},20),i=1)return e[e.length-1].to;let r=Math.floor(t*n);for(let i=0;;i++){let{from:o,to:s}=e[i],a=s-o;if(r<=a)return o+r;r-=a}}function PL(t,e){let n=0;for(let{from:r,to:i}of t.ranges){if(e<=i){n+=e-r;break}n+=i-r}return n/t.total}function mpn(t,e){for(let n of t)if(e(n))return n}const B1e={toDOM(t){return t},fromDOM(t){return t},scale:1,eq(t){return t==this}};class Ble{constructor(e,n,r){let i=0,o=0,s=0;this.viewports=r.map(({from:a,to:l})=>{let c=n.lineAt(a,Yr.ByPos,e,0,0).top,u=n.lineAt(l,Yr.ByPos,e,0,0).bottom;return i+=u-c,{from:a,to:l,top:c,bottom:u,domTop:0,domBottom:0}}),this.scale=(7e6-i)/(n.height-i);for(let a of this.viewports)a.domTop=s+(a.top-o)*this.scale,s=a.domBottom=a.domTop+(a.bottom-a.top),o=a.bottom}toDOM(e){for(let n=0,r=0,i=0;;n++){let o=nn.from==e.viewports[r].from&&n.to==e.viewports[r].to):!1}}function MT(t,e){if(e.scale==1)return t;let n=e.toDOM(t.top),r=e.toDOM(t.bottom);return new Hd(t.from,t.length,n,r-n,Array.isArray(t._content)?t._content.map(i=>MT(i,e)):t._content)}const ML=_t.define({combine:t=>t.join(" ")}),gK=_t.define({combine:t=>t.indexOf(!0)>-1}),mK=wy.newName(),i7e=wy.newName(),o7e=wy.newName(),s7e={"&light":"."+i7e,"&dark":"."+o7e};function vK(t,e,n){return new wy(e,{finish(r){return/&/.test(r)?r.replace(/&\w*/,i=>{if(i=="&")return t;if(!n||!n[i])throw new RangeError(`Unsupported selector: ${i}`);return n[i]}):t+" "+r}})}const vpn=vK("."+mK,{"&":{position:"relative !important",boxSizing:"border-box","&.cm-focused":{outline:"1px dotted #212121"},display:"flex !important",flexDirection:"column"},".cm-scroller":{display:"flex !important",alignItems:"flex-start !important",fontFamily:"monospace",lineHeight:1.4,height:"100%",overflowX:"auto",position:"relative",zIndex:0,overflowAnchor:"none"},".cm-content":{margin:0,flexGrow:2,flexShrink:0,display:"block",whiteSpace:"pre",wordWrap:"normal",boxSizing:"border-box",minHeight:"100%",padding:"4px 0",outline:"none","&[contenteditable=true]":{WebkitUserModify:"read-write-plaintext-only"}},".cm-lineWrapping":{whiteSpace_fallback:"pre-wrap",whiteSpace:"break-spaces",wordBreak:"break-word",overflowWrap:"anywhere",flexShrink:1},"&light .cm-content":{caretColor:"black"},"&dark .cm-content":{caretColor:"white"},".cm-line":{display:"block",padding:"0 2px 0 6px"},".cm-layer":{position:"absolute",left:0,top:0,contain:"size style","& > *":{position:"absolute"}},"&light .cm-selectionBackground":{background:"#d9d9d9"},"&dark .cm-selectionBackground":{background:"#222"},"&light.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground":{background:"#d7d4f0"},"&dark.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground":{background:"#233"},".cm-cursorLayer":{pointerEvents:"none"},"&.cm-focused > .cm-scroller > .cm-cursorLayer":{animation:"steps(1) cm-blink 1.2s infinite"},"@keyframes cm-blink":{"0%":{},"50%":{opacity:0},"100%":{}},"@keyframes cm-blink2":{"0%":{},"50%":{opacity:0},"100%":{}},".cm-cursor, .cm-dropCursor":{borderLeft:"1.2px solid black",marginLeft:"-0.6px",pointerEvents:"none"},".cm-cursor":{display:"none"},"&dark .cm-cursor":{borderLeftColor:"#444"},".cm-dropCursor":{position:"absolute"},"&.cm-focused > .cm-scroller > .cm-cursorLayer .cm-cursor":{display:"block"},".cm-iso":{unicodeBidi:"isolate"},".cm-announced":{position:"fixed",top:"-10000px"},"@media print":{".cm-announced":{display:"none"}},"&light .cm-activeLine":{backgroundColor:"#cceeff44"},"&dark .cm-activeLine":{backgroundColor:"#99eeff33"},"&light .cm-specialChar":{color:"red"},"&dark .cm-specialChar":{color:"#f78"},".cm-gutters":{flexShrink:0,display:"flex",height:"100%",boxSizing:"border-box",insetInlineStart:0,zIndex:200},"&light .cm-gutters":{backgroundColor:"#f5f5f5",color:"#6c6c6c",borderRight:"1px solid #ddd"},"&dark .cm-gutters":{backgroundColor:"#333338",color:"#ccc"},".cm-gutter":{display:"flex !important",flexDirection:"column",flexShrink:0,boxSizing:"border-box",minHeight:"100%",overflow:"hidden"},".cm-gutterElement":{boxSizing:"border-box"},".cm-lineNumbers .cm-gutterElement":{padding:"0 3px 0 5px",minWidth:"20px",textAlign:"right",whiteSpace:"nowrap"},"&light .cm-activeLineGutter":{backgroundColor:"#e2f2ff"},"&dark .cm-activeLineGutter":{backgroundColor:"#222227"},".cm-panels":{boxSizing:"border-box",position:"sticky",left:0,right:0,zIndex:300},"&light .cm-panels":{backgroundColor:"#f5f5f5",color:"black"},"&light .cm-panels-top":{borderBottom:"1px solid #ddd"},"&light .cm-panels-bottom":{borderTop:"1px solid #ddd"},"&dark .cm-panels":{backgroundColor:"#333338",color:"white"},".cm-tab":{display:"inline-block",overflow:"hidden",verticalAlign:"bottom"},".cm-widgetBuffer":{verticalAlign:"text-top",height:"1em",width:0,display:"inline"},".cm-placeholder":{color:"#888",display:"inline-block",verticalAlign:"top"},".cm-highlightSpace:before":{content:"attr(data-display)",position:"absolute",pointerEvents:"none",color:"#888"},".cm-highlightTab":{backgroundImage:`url('data:image/svg+xml,')`,backgroundSize:"auto 100%",backgroundPosition:"right 90%",backgroundRepeat:"no-repeat"},".cm-trailingSpace":{backgroundColor:"#ff332255"},".cm-button":{verticalAlign:"middle",color:"inherit",fontSize:"70%",padding:".2em 1em",borderRadius:"1px"},"&light .cm-button":{backgroundImage:"linear-gradient(#eff1f5, #d9d9df)",border:"1px solid #888","&:active":{backgroundImage:"linear-gradient(#b4b4b4, #d0d3d6)"}},"&dark .cm-button":{backgroundImage:"linear-gradient(#393939, #111)",border:"1px solid #888","&:active":{backgroundImage:"linear-gradient(#111, #333)"}},".cm-textfield":{verticalAlign:"middle",color:"inherit",fontSize:"70%",border:"1px solid silver",padding:".2em .5em"},"&light .cm-textfield":{backgroundColor:"white"},"&dark .cm-textfield":{border:"1px solid #555",backgroundColor:"inherit"}},s7e),ypn={childList:!0,characterData:!0,subtree:!0,attributes:!0,characterDataOldValue:!0},l7=St.ie&&St.ie_version<=11;class xpn{constructor(e){this.view=e,this.active=!1,this.editContext=null,this.selectionRange=new rhn,this.selectionChanged=!1,this.delayedFlush=-1,this.resizeTimeout=-1,this.queue=[],this.delayedAndroidKey=null,this.flushingAndroidKey=-1,this.lastChange=0,this.scrollTargets=[],this.intersection=null,this.resizeScroll=null,this.intersecting=!1,this.gapIntersection=null,this.gaps=[],this.printQuery=null,this.parentCheck=-1,this.dom=e.contentDOM,this.observer=new MutationObserver(n=>{for(let r of n)this.queue.push(r);(St.ie&&St.ie_version<=11||St.ios&&e.composing)&&n.some(r=>r.type=="childList"&&r.removedNodes.length||r.type=="characterData"&&r.oldValue.length>r.target.nodeValue.length)?this.flushSoon():this.flush()}),window.EditContext&&e.constructor.EDIT_CONTEXT!==!1&&!(St.chrome&&St.chrome_version<126)&&(this.editContext=new wpn(e),e.state.facet(rv)&&(e.contentDOM.editContext=this.editContext.editContext)),l7&&(this.onCharData=n=>{this.queue.push({target:n.target,type:"characterData",oldValue:n.prevValue}),this.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this),this.onResize=this.onResize.bind(this),this.onPrint=this.onPrint.bind(this),this.onScroll=this.onScroll.bind(this),window.matchMedia&&(this.printQuery=window.matchMedia("print")),typeof ResizeObserver=="function"&&(this.resizeScroll=new ResizeObserver(()=>{var n;((n=this.view.docView)===null||n===void 0?void 0:n.lastUpdate){this.parentCheck<0&&(this.parentCheck=setTimeout(this.listenForScroll.bind(this),1e3)),n.length>0&&n[n.length-1].intersectionRatio>0!=this.intersecting&&(this.intersecting=!this.intersecting,this.intersecting!=this.view.inView&&this.onScrollChanged(document.createEvent("Event")))},{threshold:[0,.001]}),this.intersection.observe(this.dom),this.gapIntersection=new IntersectionObserver(n=>{n.length>0&&n[n.length-1].intersectionRatio>0&&this.onScrollChanged(document.createEvent("Event"))},{})),this.listenForScroll(),this.readSelectionRange()}onScrollChanged(e){this.view.inputState.runHandlers("scroll",e),this.intersecting&&this.view.measure()}onScroll(e){this.intersecting&&this.flush(!1),this.editContext&&this.view.requestMeasure(this.editContext.measureReq),this.onScrollChanged(e)}onResize(){this.resizeTimeout<0&&(this.resizeTimeout=setTimeout(()=>{this.resizeTimeout=-1,this.view.requestMeasure()},50))}onPrint(e){(e.type=="change"||!e.type)&&!e.matches||(this.view.viewState.printing=!0,this.view.measure(),setTimeout(()=>{this.view.viewState.printing=!1,this.view.requestMeasure()},500))}updateGaps(e){if(this.gapIntersection&&(e.length!=this.gaps.length||this.gaps.some((n,r)=>n!=e[r]))){this.gapIntersection.disconnect();for(let n of e)this.gapIntersection.observe(n);this.gaps=e}}onSelectionChange(e){let n=this.selectionChanged;if(!this.readSelectionRange()||this.delayedAndroidKey)return;let{view:r}=this,i=this.selectionRange;if(r.state.facet(rv)?r.root.activeElement!=this.dom:!z3(r.dom,i))return;let o=i.anchorNode&&r.docView.nearest(i.anchorNode);if(o&&o.ignoreEvent(e)){n||(this.selectionChanged=!1);return}(St.ie&&St.ie_version<=11||St.android&&St.chrome)&&!r.state.selection.main.empty&&i.focusNode&&Ok(i.focusNode,i.focusOffset,i.anchorNode,i.anchorOffset)?this.flushSoon():this.flush(!1)}readSelectionRange(){let{view:e}=this,n=uP(e.root);if(!n)return!1;let r=St.safari&&e.root.nodeType==11&&Jdn(this.dom.ownerDocument)==this.dom&&bpn(this.view,n)||n;if(!r||this.selectionRange.eq(r))return!1;let i=z3(this.dom,r);return i&&!this.selectionChanged&&e.inputState.lastFocusTime>Date.now()-200&&e.inputState.lastTouchTime{let o=this.delayedAndroidKey;o&&(this.clearDelayedAndroidKey(),this.view.inputState.lastKeyCode=o.keyCode,this.view.inputState.lastKeyTime=Date.now(),!this.flush()&&o.force&&K_(this.dom,o.key,o.keyCode))};this.flushingAndroidKey=this.view.win.requestAnimationFrame(i)}(!this.delayedAndroidKey||e=="Enter")&&(this.delayedAndroidKey={key:e,keyCode:n,force:this.lastChange{this.delayedFlush=-1,this.flush()}))}forceFlush(){this.delayedFlush>=0&&(this.view.win.cancelAnimationFrame(this.delayedFlush),this.delayedFlush=-1),this.flush()}pendingRecords(){for(let e of this.observer.takeRecords())this.queue.push(e);return this.queue}processRecords(){let e=this.pendingRecords();e.length&&(this.queue=[]);let n=-1,r=-1,i=!1;for(let o of e){let s=this.readMutation(o);s&&(s.typeOver&&(i=!0),n==-1?{from:n,to:r}=s:(n=Math.min(s.from,n),r=Math.max(s.to,r)))}return{from:n,to:r,typeOver:i}}readChange(){let{from:e,to:n,typeOver:r}=this.processRecords(),i=this.selectionChanged&&z3(this.dom,this.selectionRange);if(e<0&&!i)return null;e>-1&&(this.lastChange=Date.now()),this.view.inputState.lastFocusTime=0,this.selectionChanged=!1;let o=new Nhn(this.view,e,n,r);return this.view.docView.domChanged={newSel:o.newSel?o.newSel.main:null},o}flush(e=!0){if(this.delayedFlush>=0||this.delayedAndroidKey)return!1;e&&this.readSelectionRange();let n=this.readChange();if(!n)return this.view.requestMeasure(),!1;let r=this.view.state,i=X9e(this.view,n);return this.view.state==r&&(n.domChanged||n.newSel&&!n.newSel.main.eq(this.view.state.selection.main))&&this.view.update([]),i}readMutation(e){let n=this.view.docView.nearest(e.target);if(!n||n.ignoreMutation(e))return null;if(n.markDirty(e.type=="attributes"),e.type=="attributes"&&(n.flags|=4),e.type=="childList"){let r=U1e(n,e.previousSibling||e.target.previousSibling,-1),i=U1e(n,e.nextSibling||e.target.nextSibling,1);return{from:r?n.posAfter(r):n.posAtStart,to:i?n.posBefore(i):n.posAtEnd,typeOver:!1}}else return e.type=="characterData"?{from:n.posAtStart,to:n.posAtEnd,typeOver:e.target.nodeValue==e.oldValue}:null}setWindow(e){e!=this.win&&(this.removeWindowListeners(this.win),this.win=e,this.addWindowListeners(this.win))}addWindowListeners(e){e.addEventListener("resize",this.onResize),this.printQuery?this.printQuery.addEventListener?this.printQuery.addEventListener("change",this.onPrint):this.printQuery.addListener(this.onPrint):e.addEventListener("beforeprint",this.onPrint),e.addEventListener("scroll",this.onScroll),e.document.addEventListener("selectionchange",this.onSelectionChange)}removeWindowListeners(e){e.removeEventListener("scroll",this.onScroll),e.removeEventListener("resize",this.onResize),this.printQuery?this.printQuery.removeEventListener?this.printQuery.removeEventListener("change",this.onPrint):this.printQuery.removeListener(this.onPrint):e.removeEventListener("beforeprint",this.onPrint),e.document.removeEventListener("selectionchange",this.onSelectionChange)}update(e){this.editContext&&(this.editContext.update(e),e.startState.facet(rv)!=e.state.facet(rv)&&(e.view.contentDOM.editContext=e.state.facet(rv)?this.editContext.editContext:null))}destroy(){var e,n,r;this.stop(),(e=this.intersection)===null||e===void 0||e.disconnect(),(n=this.gapIntersection)===null||n===void 0||n.disconnect(),(r=this.resizeScroll)===null||r===void 0||r.disconnect();for(let i of this.scrollTargets)i.removeEventListener("scroll",this.onScroll);this.removeWindowListeners(this.win),clearTimeout(this.parentCheck),clearTimeout(this.resizeTimeout),this.win.cancelAnimationFrame(this.delayedFlush),this.win.cancelAnimationFrame(this.flushingAndroidKey),this.editContext&&(this.view.contentDOM.editContext=null,this.editContext.destroy())}}function U1e(t,e,n){for(;e;){let r=Dr.get(e);if(r&&r.parent==t)return r;let i=e.parentNode;e=i!=t.dom?i:n>0?e.nextSibling:e.previousSibling}return null}function W1e(t,e){let n=e.startContainer,r=e.startOffset,i=e.endContainer,o=e.endOffset,s=t.docView.domAtPos(t.state.selection.main.anchor);return Ok(s.node,s.offset,i,o)&&([n,r,i,o]=[i,o,n,r]),{anchorNode:n,anchorOffset:r,focusNode:i,focusOffset:o}}function bpn(t,e){if(e.getComposedRanges){let i=e.getComposedRanges(t.root)[0];if(i)return W1e(t,i)}let n=null;function r(i){i.preventDefault(),i.stopImmediatePropagation(),n=i.getTargetRanges()[0]}return t.contentDOM.addEventListener("beforeinput",r,!0),t.dom.ownerDocument.execCommand("indent"),t.contentDOM.removeEventListener("beforeinput",r,!0),n?W1e(t,n):null}class wpn{constructor(e){this.from=0,this.to=0,this.pendingContextChange=null,this.handlers=Object.create(null),this.resetRange(e.state);let n=this.editContext=new window.EditContext({text:e.state.doc.sliceString(this.from,this.to),selectionStart:this.toContextPos(Math.max(this.from,Math.min(this.to,e.state.selection.main.anchor))),selectionEnd:this.toContextPos(e.state.selection.main.head)});this.handlers.textupdate=r=>{let{anchor:i}=e.state.selection.main,o={from:this.toEditorPos(r.updateRangeStart),to:this.toEditorPos(r.updateRangeEnd),insert:ar.of(r.text.split(` +`))};o.from==this.from&&ithis.to&&(o.to=i),!(o.from==o.to&&!o.insert.length)&&(this.pendingContextChange=o,e.state.readOnly||zle(e,o,Ve.single(this.toEditorPos(r.selectionStart),this.toEditorPos(r.selectionEnd))),this.pendingContextChange&&(this.revertPending(e.state),this.setSelection(e.state)))},this.handlers.characterboundsupdate=r=>{let i=[],o=null;for(let s=this.toEditorPos(r.rangeStart),a=this.toEditorPos(r.rangeEnd);s{let i=[];for(let o of r.getTextFormats()){let s=o.underlineStyle,a=o.underlineThickness;if(s!="None"&&a!="None"){let l=`text-decoration: underline ${s=="Dashed"?"dashed ":s=="Squiggle"?"wavy ":""}${a=="Thin"?1:2}px`;i.push(Dt.mark({attributes:{style:l}}).range(this.toEditorPos(o.rangeStart),this.toEditorPos(o.rangeEnd)))}}e.dispatch({effects:j9e.of(Dt.set(i))})},this.handlers.compositionstart=()=>{e.inputState.composing<0&&(e.inputState.composing=0,e.inputState.compositionFirstChange=!0)},this.handlers.compositionend=()=>{e.inputState.composing=-1,e.inputState.compositionFirstChange=null};for(let r in this.handlers)n.addEventListener(r,this.handlers[r]);this.measureReq={read:r=>{this.editContext.updateControlBounds(r.contentDOM.getBoundingClientRect());let i=uP(r.root);i&&i.rangeCount&&this.editContext.updateSelectionBounds(i.getRangeAt(0).getBoundingClientRect())}}}applyEdits(e){let n=0,r=!1,i=this.pendingContextChange;return e.changes.iterChanges((o,s,a,l,c)=>{if(r)return;let u=c.length-(s-o);if(i&&s>=i.to)if(i.from==o&&i.to==s&&i.insert.eq(c)){i=this.pendingContextChange=null,n+=u,this.to+=u;return}else i=null,this.revertPending(e.state);if(o+=n,s+=n,s<=this.from)this.from+=u,this.to+=u;else if(othis.to||this.to-this.from+c.length>3e4){r=!0;return}this.editContext.updateText(this.toContextPos(o),this.toContextPos(s),c.toString()),this.to+=u}n+=u}),i&&!r&&this.revertPending(e.state),!r}update(e){let n=this.pendingContextChange;!this.applyEdits(e)||!this.rangeIsValid(e.state)?(this.pendingContextChange=null,this.resetRange(e.state),this.editContext.updateText(0,this.editContext.text.length,e.state.doc.sliceString(this.from,this.to)),this.setSelection(e.state)):(e.docChanged||e.selectionSet||n)&&this.setSelection(e.state),(e.geometryChanged||e.docChanged||e.selectionSet)&&e.view.requestMeasure(this.measureReq)}resetRange(e){let{head:n}=e.selection.main;this.from=Math.max(0,n-1e4),this.to=Math.min(e.doc.length,n+1e4)}revertPending(e){let n=this.pendingContextChange;this.pendingContextChange=null,this.editContext.updateText(this.toContextPos(n.from),this.toContextPos(n.from+n.insert.length),e.doc.sliceString(n.from,n.to))}setSelection(e){let{main:n}=e.selection,r=this.toContextPos(Math.max(this.from,Math.min(this.to,n.anchor))),i=this.toContextPos(n.head);(this.editContext.selectionStart!=r||this.editContext.selectionEnd!=i)&&this.editContext.updateSelection(r,i)}rangeIsValid(e){let{head:n}=e.selection.main;return!(this.from>0&&n-this.from<500||this.to1e4*3)}toEditorPos(e){return e+this.from}toContextPos(e){return e-this.from}destroy(){for(let e in this.handlers)this.editContext.removeEventListener(e,this.handlers[e])}}class mt{get state(){return this.viewState.state}get viewport(){return this.viewState.viewport}get visibleRanges(){return this.viewState.visibleRanges}get inView(){return this.viewState.inView}get composing(){return this.inputState.composing>0}get compositionStarted(){return this.inputState.composing>=0}get root(){return this._root}get win(){return this.dom.ownerDocument.defaultView||window}constructor(e={}){var n;this.plugins=[],this.pluginMap=new Map,this.editorAttrs={},this.contentAttrs={},this.bidiCache=[],this.destroyed=!1,this.updateState=2,this.measureScheduled=-1,this.measureRequests=[],this.contentDOM=document.createElement("div"),this.scrollDOM=document.createElement("div"),this.scrollDOM.tabIndex=-1,this.scrollDOM.className="cm-scroller",this.scrollDOM.appendChild(this.contentDOM),this.announceDOM=document.createElement("div"),this.announceDOM.className="cm-announced",this.announceDOM.setAttribute("aria-live","polite"),this.dom=document.createElement("div"),this.dom.appendChild(this.announceDOM),this.dom.appendChild(this.scrollDOM),e.parent&&e.parent.appendChild(this.dom);let{dispatch:r}=e;this.dispatchTransactions=e.dispatchTransactions||r&&(i=>i.forEach(o=>r(o,this)))||(i=>this.update(i)),this.dispatch=this.dispatch.bind(this),this._root=e.root||ihn(e.parent)||document,this.viewState=new j1e(e.state||In.create(e)),e.scrollTo&&e.scrollTo.is(OL)&&(this.viewState.scrollTarget=e.scrollTo.value.clip(this.viewState.state)),this.plugins=this.state.facet(kT).map(i=>new i7(i));for(let i of this.plugins)i.update(this);this.observer=new xpn(this),this.inputState=new Whn(this),this.inputState.ensureHandlers(this.plugins),this.docView=new w1e(this),this.mountStyles(),this.updateAttrs(),this.updateState=0,this.requestMeasure(),!((n=document.fonts)===null||n===void 0)&&n.ready&&document.fonts.ready.then(()=>this.requestMeasure())}dispatch(...e){let n=e.length==1&&e[0]instanceof ao?e:e.length==1&&Array.isArray(e[0])?e[0]:[this.state.update(...e)];this.dispatchTransactions(n,this)}update(e){if(this.updateState!=0)throw new Error("Calls to EditorView.update are not allowed while an update is in progress");let n=!1,r=!1,i,o=this.state;for(let d of e){if(d.startState!=o)throw new RangeError("Trying to update state with a transaction that doesn't start from the previous state.");o=d.state}if(this.destroyed){this.viewState.state=o;return}let s=this.hasFocus,a=0,l=null;e.some(d=>d.annotation(e7e))?(this.inputState.notifiedFocused=s,a=1):s!=this.inputState.notifiedFocused&&(this.inputState.notifiedFocused=s,l=t7e(o,s),l||(a=1));let c=this.observer.delayedAndroidKey,u=null;if(c?(this.observer.clearDelayedAndroidKey(),u=this.observer.readChange(),(u&&!this.state.doc.eq(o.doc)||!this.state.selection.eq(o.selection))&&(u=null)):this.observer.clear(),o.facet(In.phrases)!=this.state.facet(In.phrases))return this.setState(o);i=tz.create(this,o,e),i.flags|=a;let f=this.viewState.scrollTarget;try{this.updateState=2;for(let d of e){if(f&&(f=f.map(d.changes)),d.scrollIntoView){let{main:h}=d.state.selection;f=new Z_(h.empty?h:Ve.cursor(h.head,h.head>h.anchor?-1:1))}for(let h of d.effects)h.is(OL)&&(f=h.value.clip(this.state))}this.viewState.update(i,f),this.bidiCache=rz.update(this.bidiCache,i.changes),i.empty||(this.updatePlugins(i),this.inputState.update(i)),n=this.docView.update(i),this.state.facet(AT)!=this.styleModules&&this.mountStyles(),r=this.updateAttrs(),this.showAnnouncements(e),this.docView.updateSelection(n,e.some(d=>d.isUserEvent("select.pointer")))}finally{this.updateState=0}if(i.startState.facet(ML)!=i.state.facet(ML)&&(this.viewState.mustMeasureContent=!0),(n||r||f||this.viewState.mustEnforceCursorAssoc||this.viewState.mustMeasureContent)&&this.requestMeasure(),n&&this.docViewUpdate(),!i.empty)for(let d of this.state.facet(fK))try{d(i)}catch(h){sl(this.state,h,"update listener")}(l||u)&&Promise.resolve().then(()=>{l&&this.state==l.startState&&this.dispatch(l),u&&!X9e(this,u)&&c.force&&K_(this.contentDOM,c.key,c.keyCode)})}setState(e){if(this.updateState!=0)throw new Error("Calls to EditorView.setState are not allowed while an update is in progress");if(this.destroyed){this.viewState.state=e;return}this.updateState=2;let n=this.hasFocus;try{for(let r of this.plugins)r.destroy(this);this.viewState=new j1e(e),this.plugins=e.facet(kT).map(r=>new i7(r)),this.pluginMap.clear();for(let r of this.plugins)r.update(this);this.docView.destroy(),this.docView=new w1e(this),this.inputState.ensureHandlers(this.plugins),this.mountStyles(),this.updateAttrs(),this.bidiCache=[]}finally{this.updateState=0}n&&this.focus(),this.requestMeasure()}updatePlugins(e){let n=e.startState.facet(kT),r=e.state.facet(kT);if(n!=r){let i=[];for(let o of r){let s=n.indexOf(o);if(s<0)i.push(new i7(o));else{let a=this.plugins[s];a.mustUpdate=e,i.push(a)}}for(let o of this.plugins)o.mustUpdate!=e&&o.destroy(this);this.plugins=i,this.pluginMap.clear()}else for(let i of this.plugins)i.mustUpdate=e;for(let i=0;i-1&&this.win.cancelAnimationFrame(this.measureScheduled),this.observer.delayedAndroidKey){this.measureScheduled=-1,this.requestMeasure();return}this.measureScheduled=0,e&&this.observer.forceFlush();let n=null,r=this.scrollDOM,i=r.scrollTop*this.scaleY,{scrollAnchorPos:o,scrollAnchorHeight:s}=this.viewState;Math.abs(i-this.viewState.scrollTop)>1&&(s=-1),this.viewState.scrollAnchorHeight=-1;try{for(let a=0;;a++){if(s<0)if(p9e(r))o=-1,s=this.viewState.heightMap.height;else{let h=this.viewState.scrollAnchorAt(i);o=h.from,s=h.top}this.updateState=1;let l=this.viewState.measure(this);if(!l&&!this.measureRequests.length&&this.viewState.scrollTarget==null)break;if(a>5){console.warn(this.measureRequests.length?"Measure loop restarted more than 5 times":"Viewport failed to stabilize");break}let c=[];l&4||([this.measureRequests,c]=[c,this.measureRequests]);let u=c.map(h=>{try{return h.read(this)}catch(p){return sl(this.state,p),V1e}}),f=tz.create(this,this.state,[]),d=!1;f.flags|=l,n?n.flags|=l:n=f,this.updateState=2,f.empty||(this.updatePlugins(f),this.inputState.update(f),this.updateAttrs(),d=this.docView.update(f),d&&this.docViewUpdate());for(let h=0;h1||p<-1){i=i+p,r.scrollTop=i/this.scaleY,s=-1;continue}}break}}}finally{this.updateState=0,this.measureScheduled=-1}if(n&&!n.empty)for(let a of this.state.facet(fK))a(n)}get themeClasses(){return mK+" "+(this.state.facet(gK)?o7e:i7e)+" "+this.state.facet(ML)}updateAttrs(){let e=G1e(this,B9e,{class:"cm-editor"+(this.hasFocus?" cm-focused ":" ")+this.themeClasses}),n={spellcheck:"false",autocorrect:"off",autocapitalize:"off",translate:"no",contenteditable:this.state.facet(rv)?"true":"false",class:"cm-content",style:`${St.tabSize}: ${this.state.tabSize}`,role:"textbox","aria-multiline":"true"};this.state.readOnly&&(n["aria-readonly"]="true"),G1e(this,Fle,n);let r=this.observer.ignore(()=>{let i=oK(this.contentDOM,this.contentAttrs,n),o=oK(this.dom,this.editorAttrs,e);return i||o});return this.editorAttrs=e,this.contentAttrs=n,r}showAnnouncements(e){let n=!0;for(let r of e)for(let i of r.effects)if(i.is(mt.announce)){n&&(this.announceDOM.textContent=""),n=!1;let o=this.announceDOM.appendChild(document.createElement("div"));o.textContent=i.value}}mountStyles(){this.styleModules=this.state.facet(AT);let e=this.state.facet(mt.cspNonce);wy.mount(this.root,this.styleModules.concat(vpn).reverse(),e?{nonce:e}:void 0)}readMeasured(){if(this.updateState==2)throw new Error("Reading the editor layout isn't allowed during an update");this.updateState==0&&this.measureScheduled>-1&&this.measure(!1)}requestMeasure(e){if(this.measureScheduled<0&&(this.measureScheduled=this.win.requestAnimationFrame(()=>this.measure())),e){if(this.measureRequests.indexOf(e)>-1)return;if(e.key!=null){for(let n=0;nr.spec==e)||null),n&&n.update(this).value}get documentTop(){return this.contentDOM.getBoundingClientRect().top+this.viewState.paddingTop}get documentPadding(){return{top:this.viewState.paddingTop,bottom:this.viewState.paddingBottom}}get scaleX(){return this.viewState.scaleX}get scaleY(){return this.viewState.scaleY}elementAtHeight(e){return this.readMeasured(),this.viewState.elementAtHeight(e)}lineBlockAtHeight(e){return this.readMeasured(),this.viewState.lineBlockAtHeight(e)}get viewportLineBlocks(){return this.viewState.viewportLines}lineBlockAt(e){return this.viewState.lineBlockAt(e)}get contentHeight(){return this.viewState.contentHeight}moveByChar(e,n,r){return s7(this,e,E1e(this,e,n,r))}moveByGroup(e,n){return s7(this,e,E1e(this,e,n,r=>Ihn(this,e.head,r)))}visualLineSide(e,n){let r=this.bidiSpans(e),i=this.textDirectionAt(e.from),o=r[n?r.length-1:0];return Ve.cursor(o.side(n,i)+e.from,o.forward(!n,i)?1:-1)}moveToLineBoundary(e,n,r=!0){return Dhn(this,e,n,r)}moveVertically(e,n,r){return s7(this,e,Lhn(this,e,n,r))}domAtPos(e){return this.docView.domAtPos(e)}posAtDOM(e,n=0){return this.docView.posFromDOM(e,n)}posAtCoords(e,n=!0){return this.readMeasured(),q9e(this,e,n)}coordsAtPos(e,n=1){this.readMeasured();let r=this.docView.coordsAt(e,n);if(!r||r.left==r.right)return r;let i=this.state.doc.lineAt(e),o=this.bidiSpans(i),s=o[_v.find(o,e-i.from,-1,n)];return rD(r,s.dir==si.LTR==n>0)}coordsForChar(e){return this.readMeasured(),this.docView.coordsForChar(e)}get defaultCharacterWidth(){return this.viewState.heightOracle.charWidth}get defaultLineHeight(){return this.viewState.heightOracle.lineHeight}get textDirection(){return this.viewState.defaultTextDirection}textDirectionAt(e){return!this.state.facet(F9e)||ethis.viewport.to?this.textDirection:(this.readMeasured(),this.docView.textDirectionAt(e))}get lineWrapping(){return this.viewState.heightOracle.lineWrapping}bidiSpans(e){if(e.length>_pn)return A9e(e.length);let n=this.textDirectionAt(e.from),r;for(let o of this.bidiCache)if(o.from==e.from&&o.dir==n&&(o.fresh||k9e(o.isolates,r=b1e(this,e))))return o.order;r||(r=b1e(this,e));let i=vhn(e.text,n,r);return this.bidiCache.push(new rz(e.from,e.to,n,r,!0,i)),i}get hasFocus(){var e;return(this.dom.ownerDocument.hasFocus()||St.safari&&((e=this.inputState)===null||e===void 0?void 0:e.lastContextMenu)>Date.now()-3e4)&&this.root.activeElement==this.contentDOM}focus(){this.observer.ignore(()=>{d9e(this.contentDOM),this.docView.updateSelection()})}setRoot(e){this._root!=e&&(this._root=e,this.observer.setWindow((e.nodeType==9?e:e.ownerDocument).defaultView||window),this.mountStyles())}destroy(){this.root.activeElement==this.contentDOM&&this.contentDOM.blur();for(let e of this.plugins)e.destroy(this);this.plugins=[],this.inputState.destroy(),this.docView.destroy(),this.dom.remove(),this.observer.destroy(),this.measureScheduled>-1&&this.win.cancelAnimationFrame(this.measureScheduled),this.destroyed=!0}static scrollIntoView(e,n={}){return OL.of(new Z_(typeof e=="number"?Ve.cursor(e):e,n.y,n.x,n.yMargin,n.xMargin))}scrollSnapshot(){let{scrollTop:e,scrollLeft:n}=this.scrollDOM,r=this.viewState.scrollAnchorAt(e);return OL.of(new Z_(Ve.cursor(r.from),"start","start",r.top-e,n,!0))}setTabFocusMode(e){e==null?this.inputState.tabFocusMode=this.inputState.tabFocusMode<0?0:-1:typeof e=="boolean"?this.inputState.tabFocusMode=e?0:-1:this.inputState.tabFocusMode!=0&&(this.inputState.tabFocusMode=Date.now()+e)}static domEventHandlers(e){return Yi.define(()=>({}),{eventHandlers:e})}static domEventObservers(e){return Yi.define(()=>({}),{eventObservers:e})}static theme(e,n){let r=wy.newName(),i=[ML.of(r),AT.of(vK(`.${r}`,e))];return n&&n.dark&&i.push(gK.of(!0)),i}static baseTheme(e){return t0.lowest(AT.of(vK("."+mK,e,s7e)))}static findFromDOM(e){var n;let r=e.querySelector(".cm-content"),i=r&&Dr.get(r)||Dr.get(e);return((n=i==null?void 0:i.rootView)===null||n===void 0?void 0:n.view)||null}}mt.styleModule=AT;mt.inputHandler=L9e;mt.scrollHandler=z9e;mt.focusChangeEffect=$9e;mt.perLineTextDirection=F9e;mt.exceptionSink=I9e;mt.updateListener=fK;mt.editable=rv;mt.mouseSelectionStyle=D9e;mt.dragMovesSelection=R9e;mt.clickAddsSelectionRange=M9e;mt.decorations=fP;mt.outerDecorations=U9e;mt.atomicRanges=Nle;mt.bidiIsolatedRanges=W9e;mt.scrollMargins=V9e;mt.darkTheme=gK;mt.cspNonce=_t.define({combine:t=>t.length?t[0]:""});mt.contentAttributes=Fle;mt.editorAttributes=B9e;mt.lineWrapping=mt.contentAttributes.of({class:"cm-lineWrapping"});mt.announce=rn.define();const _pn=4096,V1e={};class rz{constructor(e,n,r,i,o,s){this.from=e,this.to=n,this.dir=r,this.isolates=i,this.fresh=o,this.order=s}static update(e,n){if(n.empty&&!e.some(o=>o.fresh))return e;let r=[],i=e.length?e[e.length-1].dir:si.LTR;for(let o=Math.max(0,e.length-10);o=0;i--){let o=r[i],s=typeof o=="function"?o(t):o;s&&iK(s,n)}return n}const Spn=St.mac?"mac":St.windows?"win":St.linux?"linux":"key";function Cpn(t,e){const n=t.split(/-(?!$)/);let r=n[n.length-1];r=="Space"&&(r=" ");let i,o,s,a;for(let l=0;lr.concat(i),[]))),n}function Epn(t,e,n){return l7e(a7e(t.state),e,t,n)}let iv=null;const Tpn=4e3;function kpn(t,e=Spn){let n=Object.create(null),r=Object.create(null),i=(s,a)=>{let l=r[s];if(l==null)r[s]=a;else if(l!=a)throw new Error("Key binding "+s+" is used both as a regular binding and as a multi-stroke prefix")},o=(s,a,l,c,u)=>{var f,d;let h=n[s]||(n[s]=Object.create(null)),p=a.split(/ (?!$)/).map(v=>Cpn(v,e));for(let v=1;v{let b=iv={view:x,prefix:y,scope:s};return setTimeout(()=>{iv==b&&(iv=null)},Tpn),!0}]})}let g=p.join(" ");i(g,!1);let m=h[g]||(h[g]={preventDefault:!1,stopPropagation:!1,run:((d=(f=h._any)===null||f===void 0?void 0:f.run)===null||d===void 0?void 0:d.slice())||[]});l&&m.run.push(l),c&&(m.preventDefault=!0),u&&(m.stopPropagation=!0)};for(let s of t){let a=s.scope?s.scope.split(" "):["editor"];if(s.any)for(let c of a){let u=n[c]||(n[c]=Object.create(null));u._any||(u._any={preventDefault:!1,stopPropagation:!1,run:[]});let{any:f}=s;for(let d in u)u[d].run.push(h=>f(h,yK))}let l=s[e]||s.key;if(l)for(let c of a)o(c,l,s.run,s.preventDefault,s.stopPropagation),s.shift&&o(c,"Shift-"+l,s.shift,s.preventDefault,s.stopPropagation)}return n}let yK=null;function l7e(t,e,n,r){yK=e;let i=Zdn(e),o=ss(i,0),s=Jc(o)==i.length&&i!=" ",a="",l=!1,c=!1,u=!1;iv&&iv.view==n&&iv.scope==r&&(a=iv.prefix+" ",Q9e.indexOf(e.keyCode)<0&&(c=!0,iv=null));let f=new Set,d=m=>{if(m){for(let v of m.run)if(!f.has(v)&&(f.add(v),v(n)))return m.stopPropagation&&(u=!0),!0;m.preventDefault&&(m.stopPropagation&&(u=!0),c=!0)}return!1},h=t[r],p,g;return h&&(d(h[a+RL(i,e,!s)])?l=!0:s&&(e.altKey||e.metaKey||e.ctrlKey)&&!(St.windows&&e.ctrlKey&&e.altKey)&&(p=_y[e.keyCode])&&p!=i?(d(h[a+RL(p,e,!0)])||e.shiftKey&&(g=cP[e.keyCode])!=i&&g!=p&&d(h[a+RL(g,e,!1)]))&&(l=!0):s&&e.shiftKey&&d(h[a+RL(i,e,!0)])&&(l=!0),!l&&d(h._any)&&(l=!0)),c&&(l=!0),l&&u&&e.stopPropagation(),yK=null,l}class aD{constructor(e,n,r,i,o){this.className=e,this.left=n,this.top=r,this.width=i,this.height=o}draw(){let e=document.createElement("div");return e.className=this.className,this.adjust(e),e}update(e,n){return n.className!=this.className?!1:(this.adjust(e),!0)}adjust(e){e.style.left=this.left+"px",e.style.top=this.top+"px",this.width!=null&&(e.style.width=this.width+"px"),e.style.height=this.height+"px"}eq(e){return this.left==e.left&&this.top==e.top&&this.width==e.width&&this.height==e.height&&this.className==e.className}static forRange(e,n,r){if(r.empty){let i=e.coordsAtPos(r.head,r.assoc||1);if(!i)return[];let o=c7e(e);return[new aD(n,i.left-o.left,i.top-o.top,null,i.bottom-i.top)]}else return Apn(e,n,r)}}function c7e(t){let e=t.scrollDOM.getBoundingClientRect();return{left:(t.textDirection==si.LTR?e.left:e.right-t.scrollDOM.clientWidth*t.scaleX)-t.scrollDOM.scrollLeft*t.scaleX,top:e.top-t.scrollDOM.scrollTop*t.scaleY}}function q1e(t,e,n,r){let i=t.coordsAtPos(e,n*2);if(!i)return r;let o=t.dom.getBoundingClientRect(),s=(i.top+i.bottom)/2,a=t.posAtCoords({x:o.left+1,y:s}),l=t.posAtCoords({x:o.right-1,y:s});return a==null||l==null?r:{from:Math.max(r.from,Math.min(a,l)),to:Math.min(r.to,Math.max(a,l))}}function Apn(t,e,n){if(n.to<=t.viewport.from||n.from>=t.viewport.to)return[];let r=Math.max(n.from,t.viewport.from),i=Math.min(n.to,t.viewport.to),o=t.textDirection==si.LTR,s=t.contentDOM,a=s.getBoundingClientRect(),l=c7e(t),c=s.querySelector(".cm-line"),u=c&&window.getComputedStyle(c),f=a.left+(u?parseInt(u.paddingLeft)+Math.min(0,parseInt(u.textIndent)):0),d=a.right-(u?parseInt(u.paddingRight):0),h=hK(t,r),p=hK(t,i),g=h.type==Ea.Text?h:null,m=p.type==Ea.Text?p:null;if(g&&(t.lineWrapping||h.widgetLineBreaks)&&(g=q1e(t,r,1,g)),m&&(t.lineWrapping||p.widgetLineBreaks)&&(m=q1e(t,i,-1,m)),g&&m&&g.from==m.from&&g.to==m.to)return y(x(n.from,n.to,g));{let w=g?x(n.from,null,g):b(h,!1),_=m?x(null,n.to,m):b(p,!0),S=[];return(g||h).to<(m||p).from-(g&&m?1:0)||h.widgetLineBreaks>1&&w.bottom+t.defaultLineHeight/2<_.top?S.push(v(f,w.bottom,d,_.top)):w.bottom<_.top&&t.elementAtHeight((w.bottom+_.top)/2).type==Ea.Text&&(w.bottom=_.top=(w.bottom+_.top)/2),y(w).concat(S).concat(y(_))}function v(w,_,S,O){return new aD(e,w-l.left,_-l.top-.01,S-w,O-_+.01)}function y({top:w,bottom:_,horizontal:S}){let O=[];for(let k=0;kA&&T.from=I)break;L>M&&P(Math.max(z,M),w==null&&z<=A,Math.min(L,I),_==null&&L>=R,N.dir)}if(M=j.to+1,M>=I)break}return E.length==0&&P(A,w==null,R,_==null,t.textDirection),{top:O,bottom:k,horizontal:E}}function b(w,_){let S=a.top+(_?w.top:w.bottom);return{top:S,bottom:S,horizontal:[]}}}function Ppn(t,e){return t.constructor==e.constructor&&t.eq(e)}class Mpn{constructor(e,n){this.view=e,this.layer=n,this.drawn=[],this.scaleX=1,this.scaleY=1,this.measureReq={read:this.measure.bind(this),write:this.draw.bind(this)},this.dom=e.scrollDOM.appendChild(document.createElement("div")),this.dom.classList.add("cm-layer"),n.above&&this.dom.classList.add("cm-layer-above"),n.class&&this.dom.classList.add(n.class),this.scale(),this.dom.setAttribute("aria-hidden","true"),this.setOrder(e.state),e.requestMeasure(this.measureReq),n.mount&&n.mount(this.dom,e)}update(e){e.startState.facet(U3)!=e.state.facet(U3)&&this.setOrder(e.state),(this.layer.update(e,this.dom)||e.geometryChanged)&&(this.scale(),e.view.requestMeasure(this.measureReq))}docViewUpdate(e){this.layer.updateOnDocViewUpdate!==!1&&e.requestMeasure(this.measureReq)}setOrder(e){let n=0,r=e.facet(U3);for(;n!Ppn(n,this.drawn[r]))){let n=this.dom.firstChild,r=0;for(let i of e)i.update&&n&&i.constructor&&this.drawn[r].constructor&&i.update(n,this.drawn[r])?(n=n.nextSibling,r++):this.dom.insertBefore(i.draw(),n);for(;n;){let i=n.nextSibling;n.remove(),n=i}this.drawn=e}}destroy(){this.layer.destroy&&this.layer.destroy(this.dom,this.view),this.dom.remove()}}const U3=_t.define();function u7e(t){return[Yi.define(e=>new Mpn(e,t)),U3.of(t)]}const f7e=!St.ios,dP=_t.define({combine(t){return Kh(t,{cursorBlinkRate:1200,drawRangeCursor:!0},{cursorBlinkRate:(e,n)=>Math.min(e,n),drawRangeCursor:(e,n)=>e||n})}});function Rpn(t={}){return[dP.of(t),Dpn,Ipn,Lpn,N9e.of(!0)]}function d7e(t){return t.startState.facet(dP)!=t.state.facet(dP)}const Dpn=u7e({above:!0,markers(t){let{state:e}=t,n=e.facet(dP),r=[];for(let i of e.selection.ranges){let o=i==e.selection.main;if(i.empty?!o||f7e:n.drawRangeCursor){let s=o?"cm-cursor cm-cursor-primary":"cm-cursor cm-cursor-secondary",a=i.empty?i:Ve.cursor(i.head,i.head>i.anchor?-1:1);for(let l of aD.forRange(t,s,a))r.push(l)}}return r},update(t,e){t.transactions.some(r=>r.selection)&&(e.style.animationName=e.style.animationName=="cm-blink"?"cm-blink2":"cm-blink");let n=d7e(t);return n&&X1e(t.state,e),t.docChanged||t.selectionSet||n},mount(t,e){X1e(e.state,t)},class:"cm-cursorLayer"});function X1e(t,e){e.style.animationDuration=t.facet(dP).cursorBlinkRate+"ms"}const Ipn=u7e({above:!1,markers(t){return t.state.selection.ranges.map(e=>e.empty?[]:aD.forRange(t,"cm-selectionBackground",e)).reduce((e,n)=>e.concat(n))},update(t,e){return t.docChanged||t.selectionSet||t.viewportChanged||d7e(t)},class:"cm-selectionLayer"}),xK={".cm-line":{"& ::selection, &::selection":{backgroundColor:"transparent !important"}},".cm-content":{"& :focus":{caretColor:"initial !important","&::selection, & ::selection":{backgroundColor:"Highlight !important"}}}};f7e&&(xK[".cm-line"].caretColor=xK[".cm-content"].caretColor="transparent !important");const Lpn=t0.highest(mt.theme(xK)),h7e=rn.define({map(t,e){return t==null?null:e.mapPos(t)}}),RT=Qo.define({create(){return null},update(t,e){return t!=null&&(t=e.changes.mapPos(t)),e.effects.reduce((n,r)=>r.is(h7e)?r.value:n,t)}}),$pn=Yi.fromClass(class{constructor(t){this.view=t,this.cursor=null,this.measureReq={read:this.readPos.bind(this),write:this.drawCursor.bind(this)}}update(t){var e;let n=t.state.field(RT);n==null?this.cursor!=null&&((e=this.cursor)===null||e===void 0||e.remove(),this.cursor=null):(this.cursor||(this.cursor=this.view.scrollDOM.appendChild(document.createElement("div")),this.cursor.className="cm-dropCursor"),(t.startState.field(RT)!=n||t.docChanged||t.geometryChanged)&&this.view.requestMeasure(this.measureReq))}readPos(){let{view:t}=this,e=t.state.field(RT),n=e!=null&&t.coordsAtPos(e);if(!n)return null;let r=t.scrollDOM.getBoundingClientRect();return{left:n.left-r.left+t.scrollDOM.scrollLeft*t.scaleX,top:n.top-r.top+t.scrollDOM.scrollTop*t.scaleY,height:n.bottom-n.top}}drawCursor(t){if(this.cursor){let{scaleX:e,scaleY:n}=this.view;t?(this.cursor.style.left=t.left/e+"px",this.cursor.style.top=t.top/n+"px",this.cursor.style.height=t.height/n+"px"):this.cursor.style.left="-100000px"}}destroy(){this.cursor&&this.cursor.remove()}setDropPos(t){this.view.state.field(RT)!=t&&this.view.dispatch({effects:h7e.of(t)})}},{eventObservers:{dragover(t){this.setDropPos(this.view.posAtCoords({x:t.clientX,y:t.clientY}))},dragleave(t){(t.target==this.view.contentDOM||!this.view.contentDOM.contains(t.relatedTarget))&&this.setDropPos(null)},dragend(){this.setDropPos(null)},drop(){this.setDropPos(null)}}});function Fpn(){return[RT,$pn]}function Y1e(t,e,n,r,i){e.lastIndex=0;for(let o=t.iterRange(n,r),s=n,a;!o.next().done;s+=o.value.length)if(!o.lineBreak)for(;a=e.exec(o.value);)i(s+a.index,a)}function Npn(t,e){let n=t.visibleRanges;if(n.length==1&&n[0].from==t.viewport.from&&n[0].to==t.viewport.to)return n;let r=[];for(let{from:i,to:o}of n)i=Math.max(t.state.doc.lineAt(i).from,i-e),o=Math.min(t.state.doc.lineAt(o).to,o+e),r.length&&r[r.length-1].to>=i?r[r.length-1].to=o:r.push({from:i,to:o});return r}class zpn{constructor(e){const{regexp:n,decoration:r,decorate:i,boundary:o,maxLength:s=1e3}=e;if(!n.global)throw new RangeError("The regular expression given to MatchDecorator should have its 'g' flag set");if(this.regexp=n,i)this.addMatch=(a,l,c,u)=>i(u,c,c+a[0].length,a,l);else if(typeof r=="function")this.addMatch=(a,l,c,u)=>{let f=r(a,l,c);f&&u(c,c+a[0].length,f)};else if(r)this.addMatch=(a,l,c,u)=>u(c,c+a[0].length,r);else throw new RangeError("Either 'decorate' or 'decoration' should be provided to MatchDecorator");this.boundary=o,this.maxLength=s}createDeco(e){let n=new by,r=n.add.bind(n);for(let{from:i,to:o}of Npn(e,this.maxLength))Y1e(e.state.doc,this.regexp,i,o,(s,a)=>this.addMatch(a,e,s,r));return n.finish()}updateDeco(e,n){let r=1e9,i=-1;return e.docChanged&&e.changes.iterChanges((o,s,a,l)=>{l>e.view.viewport.from&&a1e3?this.createDeco(e.view):i>-1?this.updateRange(e.view,n.map(e.changes),r,i):n}updateRange(e,n,r,i){for(let o of e.visibleRanges){let s=Math.max(o.from,r),a=Math.min(o.to,i);if(a>s){let l=e.state.doc.lineAt(s),c=l.tol.from;s--)if(this.boundary.test(l.text[s-1-l.from])){u=s;break}for(;ad.push(v.range(g,m));if(l==c)for(this.regexp.lastIndex=u-l.from;(h=this.regexp.exec(l.text))&&h.indexthis.addMatch(m,e,g,p));n=n.update({filterFrom:u,filterTo:f,filter:(g,m)=>gf,add:d})}}return n}}const bK=/x/.unicode!=null?"gu":"g",jpn=new RegExp(`[\0-\b +--Ÿ­؜​‎‏\u2028\u2029‭‮⁦⁧⁩\uFEFF-]`,bK),Bpn={0:"null",7:"bell",8:"backspace",10:"newline",11:"vertical tab",13:"carriage return",27:"escape",8203:"zero width space",8204:"zero width non-joiner",8205:"zero width joiner",8206:"left-to-right mark",8207:"right-to-left mark",8232:"line separator",8237:"left-to-right override",8238:"right-to-left override",8294:"left-to-right isolate",8295:"right-to-left isolate",8297:"pop directional isolate",8233:"paragraph separator",65279:"zero width no-break space",65532:"object replacement"};let c7=null;function Upn(){var t;if(c7==null&&typeof document<"u"&&document.body){let e=document.body.style;c7=((t=e.tabSize)!==null&&t!==void 0?t:e.MozTabSize)!=null}return c7||!1}const W3=_t.define({combine(t){let e=Kh(t,{render:null,specialChars:jpn,addSpecialChars:null});return(e.replaceTabs=!Upn())&&(e.specialChars=new RegExp(" |"+e.specialChars.source,bK)),e.addSpecialChars&&(e.specialChars=new RegExp(e.specialChars.source+"|"+e.addSpecialChars.source,bK)),e}});function Wpn(t={}){return[W3.of(t),Vpn()]}let Q1e=null;function Vpn(){return Q1e||(Q1e=Yi.fromClass(class{constructor(t){this.view=t,this.decorations=Dt.none,this.decorationCache=Object.create(null),this.decorator=this.makeDecorator(t.state.facet(W3)),this.decorations=this.decorator.createDeco(t)}makeDecorator(t){return new zpn({regexp:t.specialChars,decoration:(e,n,r)=>{let{doc:i}=n.state,o=ss(e[0],0);if(o==9){let s=i.lineAt(r),a=n.state.tabSize,l=XO(s.text,a,r-s.from);return Dt.replace({widget:new Xpn((a-l%a)*this.view.defaultCharacterWidth/this.view.scaleX)})}return this.decorationCache[o]||(this.decorationCache[o]=Dt.replace({widget:new qpn(t,o)}))},boundary:t.replaceTabs?void 0:/[^]/})}update(t){let e=t.state.facet(W3);t.startState.facet(W3)!=e?(this.decorator=this.makeDecorator(e),this.decorations=this.decorator.createDeco(t.view)):this.decorations=this.decorator.updateDeco(t,this.decorations)}},{decorations:t=>t.decorations}))}const Gpn="•";function Hpn(t){return t>=32?Gpn:t==10?"␤":String.fromCharCode(9216+t)}class qpn extends Zh{constructor(e,n){super(),this.options=e,this.code=n}eq(e){return e.code==this.code}toDOM(e){let n=Hpn(this.code),r=e.state.phrase("Control character")+" "+(Bpn[this.code]||"0x"+this.code.toString(16)),i=this.options.render&&this.options.render(this.code,r,n);if(i)return i;let o=document.createElement("span");return o.textContent=n,o.title=r,o.setAttribute("aria-label",r),o.className="cm-specialChar",o}ignoreEvent(){return!1}}class Xpn extends Zh{constructor(e){super(),this.width=e}eq(e){return e.width==this.width}toDOM(){let e=document.createElement("span");return e.textContent=" ",e.className="cm-tab",e.style.width=this.width+"px",e}ignoreEvent(){return!1}}function Ypn(){return Kpn}const Qpn=Dt.line({class:"cm-activeLine"}),Kpn=Yi.fromClass(class{constructor(t){this.decorations=this.getDeco(t)}update(t){(t.docChanged||t.selectionSet)&&(this.decorations=this.getDeco(t.view))}getDeco(t){let e=-1,n=[];for(let r of t.state.selection.ranges){let i=t.lineBlockAt(r.head);i.from>e&&(n.push(Qpn.range(i.from)),e=i.from)}return Dt.set(n)}},{decorations:t=>t.decorations});class Zpn extends Zh{constructor(e){super(),this.content=e}toDOM(){let e=document.createElement("span");return e.className="cm-placeholder",e.style.pointerEvents="none",e.appendChild(typeof this.content=="string"?document.createTextNode(this.content):this.content),typeof this.content=="string"?e.setAttribute("aria-label","placeholder "+this.content):e.setAttribute("aria-hidden","true"),e}coordsAt(e){let n=e.firstChild?mC(e.firstChild):[];if(!n.length)return null;let r=window.getComputedStyle(e.parentNode),i=rD(n[0],r.direction!="rtl"),o=parseInt(r.lineHeight);return i.bottom-i.top>o*1.5?{left:i.left,right:i.right,top:i.top,bottom:i.top+o}:i}ignoreEvent(){return!1}}function Jpn(t){return Yi.fromClass(class{constructor(e){this.view=e,this.placeholder=t?Dt.set([Dt.widget({widget:new Zpn(t),side:1}).range(0)]):Dt.none}get decorations(){return this.view.state.doc.length?Dt.none:this.placeholder}},{decorations:e=>e.decorations})}const wK=2e3;function egn(t,e,n){let r=Math.min(e.line,n.line),i=Math.max(e.line,n.line),o=[];if(e.off>wK||n.off>wK||e.col<0||n.col<0){let s=Math.min(e.off,n.off),a=Math.max(e.off,n.off);for(let l=r;l<=i;l++){let c=t.doc.line(l);c.length<=a&&o.push(Ve.range(c.from+s,c.to+a))}}else{let s=Math.min(e.col,n.col),a=Math.max(e.col,n.col);for(let l=r;l<=i;l++){let c=t.doc.line(l),u=KQ(c.text,s,t.tabSize,!0);if(u<0)o.push(Ve.cursor(c.to));else{let f=KQ(c.text,a,t.tabSize);o.push(Ve.range(c.from+u,c.from+f))}}}return o}function tgn(t,e){let n=t.coordsAtPos(t.viewport.from);return n?Math.round(Math.abs((n.left-e)/t.defaultCharacterWidth)):-1}function K1e(t,e){let n=t.posAtCoords({x:e.clientX,y:e.clientY},!1),r=t.state.doc.lineAt(n),i=n-r.from,o=i>wK?-1:i==r.length?tgn(t,e.clientX):XO(r.text,t.state.tabSize,n-r.from);return{line:r.number,col:o,off:i}}function ngn(t,e){let n=K1e(t,e),r=t.state.selection;return n?{update(i){if(i.docChanged){let o=i.changes.mapPos(i.startState.doc.line(n.line).from),s=i.state.doc.lineAt(o);n={line:s.number,col:n.col,off:Math.min(n.off,s.length)},r=r.map(i.changes)}},get(i,o,s){let a=K1e(t,i);if(!a)return r;let l=egn(t.state,n,a);return l.length?s?Ve.create(l.concat(r.ranges)):Ve.create(l):r}}:null}function rgn(t){let e=n=>n.altKey&&n.button==0;return mt.mouseSelectionStyle.of((n,r)=>e(r)?ngn(n,r):null)}const ign={Alt:[18,t=>!!t.altKey],Control:[17,t=>!!t.ctrlKey],Shift:[16,t=>!!t.shiftKey],Meta:[91,t=>!!t.metaKey]},ogn={style:"cursor: crosshair"};function sgn(t={}){let[e,n]=ign[t.key||"Alt"],r=Yi.fromClass(class{constructor(i){this.view=i,this.isDown=!1}set(i){this.isDown!=i&&(this.isDown=i,this.view.update([]))}},{eventObservers:{keydown(i){this.set(i.keyCode==e||n(i))},keyup(i){(i.keyCode==e||!n(i))&&this.set(!1)},mousemove(i){this.set(n(i))}}});return[r,mt.contentAttributes.of(i=>{var o;return!((o=i.plugin(r))===null||o===void 0)&&o.isDown?ogn:null})]}const S2="-10000px";class p7e{constructor(e,n,r,i){this.facet=n,this.createTooltipView=r,this.removeTooltipView=i,this.input=e.state.facet(n),this.tooltips=this.input.filter(s=>s);let o=null;this.tooltipViews=this.tooltips.map(s=>o=r(s,o))}update(e,n){var r;let i=e.state.facet(this.facet),o=i.filter(l=>l);if(i===this.input){for(let l of this.tooltipViews)l.update&&l.update(e);return!1}let s=[],a=n?[]:null;for(let l=0;ln[c]=l),n.length=a.length),this.input=i,this.tooltips=o,this.tooltipViews=s,!0}}function agn(t){let{win:e}=t;return{top:0,left:0,bottom:e.innerHeight,right:e.innerWidth}}const u7=_t.define({combine:t=>{var e,n,r;return{position:St.ios?"absolute":((e=t.find(i=>i.position))===null||e===void 0?void 0:e.position)||"fixed",parent:((n=t.find(i=>i.parent))===null||n===void 0?void 0:n.parent)||null,tooltipSpace:((r=t.find(i=>i.tooltipSpace))===null||r===void 0?void 0:r.tooltipSpace)||agn}}}),Z1e=new WeakMap,Ule=Yi.fromClass(class{constructor(t){this.view=t,this.above=[],this.inView=!0,this.madeAbsolute=!1,this.lastTransaction=0,this.measureTimeout=-1;let e=t.state.facet(u7);this.position=e.position,this.parent=e.parent,this.classes=t.themeClasses,this.createContainer(),this.measureReq={read:this.readMeasure.bind(this),write:this.writeMeasure.bind(this),key:this},this.resizeObserver=typeof ResizeObserver=="function"?new ResizeObserver(()=>this.measureSoon()):null,this.manager=new p7e(t,Wle,(n,r)=>this.createTooltip(n,r),n=>{this.resizeObserver&&this.resizeObserver.unobserve(n.dom),n.dom.remove()}),this.above=this.manager.tooltips.map(n=>!!n.above),this.intersectionObserver=typeof IntersectionObserver=="function"?new IntersectionObserver(n=>{Date.now()>this.lastTransaction-50&&n.length>0&&n[n.length-1].intersectionRatio<1&&this.measureSoon()},{threshold:[1]}):null,this.observeIntersection(),t.win.addEventListener("resize",this.measureSoon=this.measureSoon.bind(this)),this.maybeMeasure()}createContainer(){this.parent?(this.container=document.createElement("div"),this.container.style.position="relative",this.container.className=this.view.themeClasses,this.parent.appendChild(this.container)):this.container=this.view.dom}observeIntersection(){if(this.intersectionObserver){this.intersectionObserver.disconnect();for(let t of this.manager.tooltipViews)this.intersectionObserver.observe(t.dom)}}measureSoon(){this.measureTimeout<0&&(this.measureTimeout=setTimeout(()=>{this.measureTimeout=-1,this.maybeMeasure()},50))}update(t){t.transactions.length&&(this.lastTransaction=Date.now());let e=this.manager.update(t,this.above);e&&this.observeIntersection();let n=e||t.geometryChanged,r=t.state.facet(u7);if(r.position!=this.position&&!this.madeAbsolute){this.position=r.position;for(let i of this.manager.tooltipViews)i.dom.style.position=this.position;n=!0}if(r.parent!=this.parent){this.parent&&this.container.remove(),this.parent=r.parent,this.createContainer();for(let i of this.manager.tooltipViews)this.container.appendChild(i.dom);n=!0}else this.parent&&this.view.themeClasses!=this.classes&&(this.classes=this.container.className=this.view.themeClasses);n&&this.maybeMeasure()}createTooltip(t,e){let n=t.create(this.view),r=e?e.dom:null;if(n.dom.classList.add("cm-tooltip"),t.arrow&&!n.dom.querySelector(".cm-tooltip > .cm-tooltip-arrow")){let i=document.createElement("div");i.className="cm-tooltip-arrow",n.dom.appendChild(i)}return n.dom.style.position=this.position,n.dom.style.top=S2,n.dom.style.left="0px",this.container.insertBefore(n.dom,r),n.mount&&n.mount(this.view),this.resizeObserver&&this.resizeObserver.observe(n.dom),n}destroy(){var t,e,n;this.view.win.removeEventListener("resize",this.measureSoon);for(let r of this.manager.tooltipViews)r.dom.remove(),(t=r.destroy)===null||t===void 0||t.call(r);this.parent&&this.container.remove(),(e=this.resizeObserver)===null||e===void 0||e.disconnect(),(n=this.intersectionObserver)===null||n===void 0||n.disconnect(),clearTimeout(this.measureTimeout)}readMeasure(){let t=this.view.dom.getBoundingClientRect(),e=1,n=1,r=!1;if(this.position=="fixed"&&this.manager.tooltipViews.length){let{dom:i}=this.manager.tooltipViews[0];if(St.gecko)r=i.offsetParent!=this.container.ownerDocument.body;else if(i.style.top==S2&&i.style.left=="0px"){let o=i.getBoundingClientRect();r=Math.abs(o.top+1e4)>1||Math.abs(o.left)>1}}if(r||this.position=="absolute")if(this.parent){let i=this.parent.getBoundingClientRect();i.width&&i.height&&(e=i.width/this.parent.offsetWidth,n=i.height/this.parent.offsetHeight)}else({scaleX:e,scaleY:n}=this.view.viewState);return{editor:t,parent:this.parent?this.container.getBoundingClientRect():t,pos:this.manager.tooltips.map((i,o)=>{let s=this.manager.tooltipViews[o];return s.getCoords?s.getCoords(i.pos):this.view.coordsAtPos(i.pos)}),size:this.manager.tooltipViews.map(({dom:i})=>i.getBoundingClientRect()),space:this.view.state.facet(u7).tooltipSpace(this.view),scaleX:e,scaleY:n,makeAbsolute:r}}writeMeasure(t){var e;if(t.makeAbsolute){this.madeAbsolute=!0,this.position="absolute";for(let a of this.manager.tooltipViews)a.dom.style.position="absolute"}let{editor:n,space:r,scaleX:i,scaleY:o}=t,s=[];for(let a=0;a=Math.min(n.bottom,r.bottom)||f.rightMath.min(n.right,r.right)+.1){u.style.top=S2;continue}let h=l.arrow?c.dom.querySelector(".cm-tooltip-arrow"):null,p=h?7:0,g=d.right-d.left,m=(e=Z1e.get(c))!==null&&e!==void 0?e:d.bottom-d.top,v=c.offset||cgn,y=this.view.textDirection==si.LTR,x=d.width>r.right-r.left?y?r.left:r.right-d.width:y?Math.max(r.left,Math.min(f.left-(h?14:0)+v.x,r.right-g)):Math.min(Math.max(r.left,f.left-g+(h?14:0)-v.x),r.right-g),b=this.above[a];!l.strictSide&&(b?f.top-(d.bottom-d.top)-v.yr.bottom)&&b==r.bottom-f.bottom>f.top-r.top&&(b=this.above[a]=!b);let w=(b?f.top-r.top:r.bottom-f.bottom)-p;if(wx&&O.top<_+m&&O.bottom>_&&(_=b?O.top-m-2-p:O.bottom+p+2);if(this.position=="absolute"?(u.style.top=(_-t.parent.top)/o+"px",u.style.left=(x-t.parent.left)/i+"px"):(u.style.top=_/o+"px",u.style.left=x/i+"px"),h){let O=f.left+(y?v.x:-v.x)-(x+14-7);h.style.left=O/i+"px"}c.overlap!==!0&&s.push({left:x,top:_,right:S,bottom:_+m}),u.classList.toggle("cm-tooltip-above",b),u.classList.toggle("cm-tooltip-below",!b),c.positioned&&c.positioned(t.space)}}maybeMeasure(){if(this.manager.tooltips.length&&(this.view.inView&&this.view.requestMeasure(this.measureReq),this.inView!=this.view.inView&&(this.inView=this.view.inView,!this.inView)))for(let t of this.manager.tooltipViews)t.dom.style.top=S2}},{eventObservers:{scroll(){this.maybeMeasure()}}}),lgn=mt.baseTheme({".cm-tooltip":{zIndex:100,boxSizing:"border-box"},"&light .cm-tooltip":{border:"1px solid #bbb",backgroundColor:"#f5f5f5"},"&light .cm-tooltip-section:not(:first-child)":{borderTop:"1px solid #bbb"},"&dark .cm-tooltip":{backgroundColor:"#333338",color:"white"},".cm-tooltip-arrow":{height:"7px",width:`${7*2}px`,position:"absolute",zIndex:-1,overflow:"hidden","&:before, &:after":{content:"''",position:"absolute",width:0,height:0,borderLeft:"7px solid transparent",borderRight:"7px solid transparent"},".cm-tooltip-above &":{bottom:"-7px","&:before":{borderTop:"7px solid #bbb"},"&:after":{borderTop:"7px solid #f5f5f5",bottom:"1px"}},".cm-tooltip-below &":{top:"-7px","&:before":{borderBottom:"7px solid #bbb"},"&:after":{borderBottom:"7px solid #f5f5f5",top:"1px"}}},"&dark .cm-tooltip .cm-tooltip-arrow":{"&:before":{borderTopColor:"#333338",borderBottomColor:"#333338"},"&:after":{borderTopColor:"transparent",borderBottomColor:"transparent"}}}),cgn={x:0,y:0},Wle=_t.define({enables:[Ule,lgn]}),iz=_t.define({combine:t=>t.reduce((e,n)=>e.concat(n),[])});class AU{static create(e){return new AU(e)}constructor(e){this.view=e,this.mounted=!1,this.dom=document.createElement("div"),this.dom.classList.add("cm-tooltip-hover"),this.manager=new p7e(e,iz,(n,r)=>this.createHostedView(n,r),n=>n.dom.remove())}createHostedView(e,n){let r=e.create(this.view);return r.dom.classList.add("cm-tooltip-section"),this.dom.insertBefore(r.dom,n?n.dom.nextSibling:this.dom.firstChild),this.mounted&&r.mount&&r.mount(this.view),r}mount(e){for(let n of this.manager.tooltipViews)n.mount&&n.mount(e);this.mounted=!0}positioned(e){for(let n of this.manager.tooltipViews)n.positioned&&n.positioned(e)}update(e){this.manager.update(e)}destroy(){var e;for(let n of this.manager.tooltipViews)(e=n.destroy)===null||e===void 0||e.call(n)}passProp(e){let n;for(let r of this.manager.tooltipViews){let i=r[e];if(i!==void 0){if(n===void 0)n=i;else if(n!==i)return}}return n}get offset(){return this.passProp("offset")}get getCoords(){return this.passProp("getCoords")}get overlap(){return this.passProp("overlap")}get resize(){return this.passProp("resize")}}const ugn=Wle.compute([iz],t=>{let e=t.facet(iz);return e.length===0?null:{pos:Math.min(...e.map(n=>n.pos)),end:Math.max(...e.map(n=>{var r;return(r=n.end)!==null&&r!==void 0?r:n.pos})),create:AU.create,above:e[0].above,arrow:e.some(n=>n.arrow)}});class fgn{constructor(e,n,r,i,o){this.view=e,this.source=n,this.field=r,this.setHover=i,this.hoverTime=o,this.hoverTimeout=-1,this.restartTimeout=-1,this.pending=null,this.lastMove={x:0,y:0,target:e.dom,time:0},this.checkHover=this.checkHover.bind(this),e.dom.addEventListener("mouseleave",this.mouseleave=this.mouseleave.bind(this)),e.dom.addEventListener("mousemove",this.mousemove=this.mousemove.bind(this))}update(){this.pending&&(this.pending=null,clearTimeout(this.restartTimeout),this.restartTimeout=setTimeout(()=>this.startHover(),20))}get active(){return this.view.state.field(this.field)}checkHover(){if(this.hoverTimeout=-1,this.active.length)return;let e=Date.now()-this.lastMove.time;ea.bottom||n.xa.right+e.defaultCharacterWidth)return;let l=e.bidiSpans(e.state.doc.lineAt(i)).find(u=>u.from<=i&&u.to>=i),c=l&&l.dir==si.RTL?-1:1;o=n.x{this.pending==a&&(this.pending=null,l&&!(Array.isArray(l)&&!l.length)&&e.dispatch({effects:this.setHover.of(Array.isArray(l)?l:[l])}))},l=>sl(e.state,l,"hover tooltip"))}else s&&!(Array.isArray(s)&&!s.length)&&e.dispatch({effects:this.setHover.of(Array.isArray(s)?s:[s])})}get tooltip(){let e=this.view.plugin(Ule),n=e?e.manager.tooltips.findIndex(r=>r.create==AU.create):-1;return n>-1?e.manager.tooltipViews[n]:null}mousemove(e){var n,r;this.lastMove={x:e.clientX,y:e.clientY,target:e.target,time:Date.now()},this.hoverTimeout<0&&(this.hoverTimeout=setTimeout(this.checkHover,this.hoverTime));let{active:i,tooltip:o}=this;if(i.length&&o&&!dgn(o.dom,e)||this.pending){let{pos:s}=i[0]||this.pending,a=(r=(n=i[0])===null||n===void 0?void 0:n.end)!==null&&r!==void 0?r:s;(s==a?this.view.posAtCoords(this.lastMove)!=s:!hgn(this.view,s,a,e.clientX,e.clientY))&&(this.view.dispatch({effects:this.setHover.of([])}),this.pending=null)}}mouseleave(e){clearTimeout(this.hoverTimeout),this.hoverTimeout=-1;let{active:n}=this;if(n.length){let{tooltip:r}=this;r&&r.dom.contains(e.relatedTarget)?this.watchTooltipLeave(r.dom):this.view.dispatch({effects:this.setHover.of([])})}}watchTooltipLeave(e){let n=r=>{e.removeEventListener("mouseleave",n),this.active.length&&!this.view.dom.contains(r.relatedTarget)&&this.view.dispatch({effects:this.setHover.of([])})};e.addEventListener("mouseleave",n)}destroy(){clearTimeout(this.hoverTimeout),this.view.dom.removeEventListener("mouseleave",this.mouseleave),this.view.dom.removeEventListener("mousemove",this.mousemove)}}const DL=4;function dgn(t,e){let n=t.getBoundingClientRect();return e.clientX>=n.left-DL&&e.clientX<=n.right+DL&&e.clientY>=n.top-DL&&e.clientY<=n.bottom+DL}function hgn(t,e,n,r,i,o){let s=t.scrollDOM.getBoundingClientRect(),a=t.documentTop+t.documentPadding.top+t.contentHeight;if(s.left>r||s.righti||Math.min(s.bottom,a)=e&&l<=n}function pgn(t,e={}){let n=rn.define(),r=Qo.define({create(){return[]},update(i,o){if(i.length&&(e.hideOnChange&&(o.docChanged||o.selection)?i=[]:e.hideOn&&(i=i.filter(s=>!e.hideOn(o,s))),o.docChanged)){let s=[];for(let a of i){let l=o.changes.mapPos(a.pos,-1,us.TrackDel);if(l!=null){let c=Object.assign(Object.create(null),a);c.pos=l,c.end!=null&&(c.end=o.changes.mapPos(c.end)),s.push(c)}}i=s}for(let s of o.effects)s.is(n)&&(i=s.value),s.is(ggn)&&(i=[]);return i},provide:i=>iz.from(i)});return{active:r,extension:[r,Yi.define(i=>new fgn(i,t,r,n,e.hoverTime||300)),ugn]}}function g7e(t,e){let n=t.plugin(Ule);if(!n)return null;let r=n.manager.tooltips.indexOf(e);return r<0?null:n.manager.tooltipViews[r]}const ggn=rn.define(),J1e=_t.define({combine(t){let e,n;for(let r of t)e=e||r.topContainer,n=n||r.bottomContainer;return{topContainer:e,bottomContainer:n}}});function hP(t,e){let n=t.plugin(m7e),r=n?n.specs.indexOf(e):-1;return r>-1?n.panels[r]:null}const m7e=Yi.fromClass(class{constructor(t){this.input=t.state.facet(pP),this.specs=this.input.filter(n=>n),this.panels=this.specs.map(n=>n(t));let e=t.state.facet(J1e);this.top=new IL(t,!0,e.topContainer),this.bottom=new IL(t,!1,e.bottomContainer),this.top.sync(this.panels.filter(n=>n.top)),this.bottom.sync(this.panels.filter(n=>!n.top));for(let n of this.panels)n.dom.classList.add("cm-panel"),n.mount&&n.mount()}update(t){let e=t.state.facet(J1e);this.top.container!=e.topContainer&&(this.top.sync([]),this.top=new IL(t.view,!0,e.topContainer)),this.bottom.container!=e.bottomContainer&&(this.bottom.sync([]),this.bottom=new IL(t.view,!1,e.bottomContainer)),this.top.syncClasses(),this.bottom.syncClasses();let n=t.state.facet(pP);if(n!=this.input){let r=n.filter(l=>l),i=[],o=[],s=[],a=[];for(let l of r){let c=this.specs.indexOf(l),u;c<0?(u=l(t.view),a.push(u)):(u=this.panels[c],u.update&&u.update(t)),i.push(u),(u.top?o:s).push(u)}this.specs=r,this.panels=i,this.top.sync(o),this.bottom.sync(s);for(let l of a)l.dom.classList.add("cm-panel"),l.mount&&l.mount()}else for(let r of this.panels)r.update&&r.update(t)}destroy(){this.top.sync([]),this.bottom.sync([])}},{provide:t=>mt.scrollMargins.of(e=>{let n=e.plugin(t);return n&&{top:n.top.scrollMargin(),bottom:n.bottom.scrollMargin()}})});class IL{constructor(e,n,r){this.view=e,this.top=n,this.container=r,this.dom=void 0,this.classes="",this.panels=[],this.syncClasses()}sync(e){for(let n of this.panels)n.destroy&&e.indexOf(n)<0&&n.destroy();this.panels=e,this.syncDOM()}syncDOM(){if(this.panels.length==0){this.dom&&(this.dom.remove(),this.dom=void 0);return}if(!this.dom){this.dom=document.createElement("div"),this.dom.className=this.top?"cm-panels cm-panels-top":"cm-panels cm-panels-bottom",this.dom.style[this.top?"top":"bottom"]="0";let n=this.container||this.view.dom;n.insertBefore(this.dom,this.top?n.firstChild:null)}let e=this.dom.firstChild;for(let n of this.panels)if(n.dom.parentNode==this.dom){for(;e!=n.dom;)e=ewe(e);e=e.nextSibling}else this.dom.insertBefore(n.dom,e);for(;e;)e=ewe(e)}scrollMargin(){return!this.dom||this.container?0:Math.max(0,this.top?this.dom.getBoundingClientRect().bottom-Math.max(0,this.view.scrollDOM.getBoundingClientRect().top):Math.min(innerHeight,this.view.scrollDOM.getBoundingClientRect().bottom)-this.dom.getBoundingClientRect().top)}syncClasses(){if(!(!this.container||this.classes==this.view.themeClasses)){for(let e of this.classes.split(" "))e&&this.container.classList.remove(e);for(let e of(this.classes=this.view.themeClasses).split(" "))e&&this.container.classList.add(e)}}}function ewe(t){let e=t.nextSibling;return t.remove(),e}const pP=_t.define({enables:m7e});class zg extends Mb{compare(e){return this==e||this.constructor==e.constructor&&this.eq(e)}eq(e){return!1}destroy(e){}}zg.prototype.elementClass="";zg.prototype.toDOM=void 0;zg.prototype.mapMode=us.TrackBefore;zg.prototype.startSide=zg.prototype.endSide=-1;zg.prototype.point=!0;const V3=_t.define(),mgn=_t.define(),vgn={class:"",renderEmptyElements:!1,elementStyle:"",markers:()=>Gn.empty,lineMarker:()=>null,widgetMarker:()=>null,lineMarkerChange:null,initialSpacer:null,updateSpacer:null,domEventHandlers:{}},Tk=_t.define();function ygn(t){return[v7e(),Tk.of(Object.assign(Object.assign({},vgn),t))]}const twe=_t.define({combine:t=>t.some(e=>e)});function v7e(t){return[xgn]}const xgn=Yi.fromClass(class{constructor(t){this.view=t,this.prevViewport=t.viewport,this.dom=document.createElement("div"),this.dom.className="cm-gutters",this.dom.setAttribute("aria-hidden","true"),this.dom.style.minHeight=this.view.contentHeight/this.view.scaleY+"px",this.gutters=t.state.facet(Tk).map(e=>new rwe(t,e));for(let e of this.gutters)this.dom.appendChild(e.dom);this.fixed=!t.state.facet(twe),this.fixed&&(this.dom.style.position="sticky"),this.syncGutters(!1),t.scrollDOM.insertBefore(this.dom,t.contentDOM)}update(t){if(this.updateGutters(t)){let e=this.prevViewport,n=t.view.viewport,r=Math.min(e.to,n.to)-Math.max(e.from,n.from);this.syncGutters(r<(n.to-n.from)*.8)}t.geometryChanged&&(this.dom.style.minHeight=this.view.contentHeight/this.view.scaleY+"px"),this.view.state.facet(twe)!=!this.fixed&&(this.fixed=!this.fixed,this.dom.style.position=this.fixed?"sticky":""),this.prevViewport=t.view.viewport}syncGutters(t){let e=this.dom.nextSibling;t&&this.dom.remove();let n=Gn.iter(this.view.state.facet(V3),this.view.viewport.from),r=[],i=this.gutters.map(o=>new bgn(o,this.view.viewport,-this.view.documentPadding.top));for(let o of this.view.viewportLineBlocks)if(r.length&&(r=[]),Array.isArray(o.type)){let s=!0;for(let a of o.type)if(a.type==Ea.Text&&s){_K(n,r,a.from);for(let l of i)l.line(this.view,a,r);s=!1}else if(a.widget)for(let l of i)l.widget(this.view,a)}else if(o.type==Ea.Text){_K(n,r,o.from);for(let s of i)s.line(this.view,o,r)}else if(o.widget)for(let s of i)s.widget(this.view,o);for(let o of i)o.finish();t&&this.view.scrollDOM.insertBefore(this.dom,e)}updateGutters(t){let e=t.startState.facet(Tk),n=t.state.facet(Tk),r=t.docChanged||t.heightChanged||t.viewportChanged||!Gn.eq(t.startState.facet(V3),t.state.facet(V3),t.view.viewport.from,t.view.viewport.to);if(e==n)for(let i of this.gutters)i.update(t)&&(r=!0);else{r=!0;let i=[];for(let o of n){let s=e.indexOf(o);s<0?i.push(new rwe(this.view,o)):(this.gutters[s].update(t),i.push(this.gutters[s]))}for(let o of this.gutters)o.dom.remove(),i.indexOf(o)<0&&o.destroy();for(let o of i)this.dom.appendChild(o.dom);this.gutters=i}return r}destroy(){for(let t of this.gutters)t.destroy();this.dom.remove()}},{provide:t=>mt.scrollMargins.of(e=>{let n=e.plugin(t);return!n||n.gutters.length==0||!n.fixed?null:e.textDirection==si.LTR?{left:n.dom.offsetWidth*e.scaleX}:{right:n.dom.offsetWidth*e.scaleX}})});function nwe(t){return Array.isArray(t)?t:[t]}function _K(t,e,n){for(;t.value&&t.from<=n;)t.from==n&&e.push(t.value),t.next()}class bgn{constructor(e,n,r){this.gutter=e,this.height=r,this.i=0,this.cursor=Gn.iter(e.markers,n.from)}addElement(e,n,r){let{gutter:i}=this,o=(n.top-this.height)/e.scaleY,s=n.height/e.scaleY;if(this.i==i.elements.length){let a=new y7e(e,s,o,r);i.elements.push(a),i.dom.appendChild(a.dom)}else i.elements[this.i].update(e,s,o,r);this.height=n.bottom,this.i++}line(e,n,r){let i=[];_K(this.cursor,i,n.from),r.length&&(i=i.concat(r));let o=this.gutter.config.lineMarker(e,n,i);o&&i.unshift(o);let s=this.gutter;i.length==0&&!s.config.renderEmptyElements||this.addElement(e,n,i)}widget(e,n){let r=this.gutter.config.widgetMarker(e,n.widget,n),i=r?[r]:null;for(let o of e.state.facet(mgn)){let s=o(e,n.widget,n);s&&(i||(i=[])).push(s)}i&&this.addElement(e,n,i)}finish(){let e=this.gutter;for(;e.elements.length>this.i;){let n=e.elements.pop();e.dom.removeChild(n.dom),n.destroy()}}}class rwe{constructor(e,n){this.view=e,this.config=n,this.elements=[],this.spacer=null,this.dom=document.createElement("div"),this.dom.className="cm-gutter"+(this.config.class?" "+this.config.class:"");for(let r in n.domEventHandlers)this.dom.addEventListener(r,i=>{let o=i.target,s;if(o!=this.dom&&this.dom.contains(o)){for(;o.parentNode!=this.dom;)o=o.parentNode;let l=o.getBoundingClientRect();s=(l.top+l.bottom)/2}else s=i.clientY;let a=e.lineBlockAtHeight(s-e.documentTop);n.domEventHandlers[r](e,a,i)&&i.preventDefault()});this.markers=nwe(n.markers(e)),n.initialSpacer&&(this.spacer=new y7e(e,0,0,[n.initialSpacer(e)]),this.dom.appendChild(this.spacer.dom),this.spacer.dom.style.cssText+="visibility: hidden; pointer-events: none")}update(e){let n=this.markers;if(this.markers=nwe(this.config.markers(e.view)),this.spacer&&this.config.updateSpacer){let i=this.config.updateSpacer(this.spacer.markers[0],e);i!=this.spacer.markers[0]&&this.spacer.update(e.view,0,0,[i])}let r=e.view.viewport;return!Gn.eq(this.markers,n,r.from,r.to)||(this.config.lineMarkerChange?this.config.lineMarkerChange(e):!1)}destroy(){for(let e of this.elements)e.destroy()}}class y7e{constructor(e,n,r,i){this.height=-1,this.above=0,this.markers=[],this.dom=document.createElement("div"),this.dom.className="cm-gutterElement",this.update(e,n,r,i)}update(e,n,r,i){this.height!=n&&(this.height=n,this.dom.style.height=n+"px"),this.above!=r&&(this.dom.style.marginTop=(this.above=r)?r+"px":""),wgn(this.markers,i)||this.setMarkers(e,i)}setMarkers(e,n){let r="cm-gutterElement",i=this.dom.firstChild;for(let o=0,s=0;;){let a=s,l=oo(a,l,c)||s(a,l,c):s}return r}})}});class f7 extends zg{constructor(e){super(),this.number=e}eq(e){return this.number==e.number}toDOM(){return document.createTextNode(this.number)}}function d7(t,e){return t.state.facet(p_).formatNumber(e,t.state)}const Cgn=Tk.compute([p_],t=>({class:"cm-lineNumbers",renderEmptyElements:!1,markers(e){return e.state.facet(_gn)},lineMarker(e,n,r){return r.some(i=>i.toDOM)?null:new f7(d7(e,e.state.doc.lineAt(n.from).number))},widgetMarker:(e,n,r)=>{for(let i of e.state.facet(Sgn)){let o=i(e,n,r);if(o)return o}return null},lineMarkerChange:e=>e.startState.facet(p_)!=e.state.facet(p_),initialSpacer(e){return new f7(d7(e,iwe(e.state.doc.lines)))},updateSpacer(e,n){let r=d7(n.view,iwe(n.view.state.doc.lines));return r==e.number?e:new f7(r)},domEventHandlers:t.facet(p_).domEventHandlers}));function Ogn(t={}){return[p_.of(t),v7e(),Cgn]}function iwe(t){let e=9;for(;e{let e=[],n=-1;for(let r of t.selection.ranges){let i=t.doc.lineAt(r.head).from;i>n&&(n=i,e.push(Egn.range(i)))}return Gn.of(e)});function kgn(){return Tgn}const x7e=1024;let Agn=0;class h7{constructor(e,n){this.from=e,this.to=n}}class _n{constructor(e={}){this.id=Agn++,this.perNode=!!e.perNode,this.deserialize=e.deserialize||(()=>{throw new Error("This node type doesn't define a deserialize function")})}add(e){if(this.perNode)throw new RangeError("Can't add per-node props to node types");return typeof e!="function"&&(e=El.match(e)),n=>{let r=e(n);return r===void 0?null:[this,r]}}}_n.closedBy=new _n({deserialize:t=>t.split(" ")});_n.openedBy=new _n({deserialize:t=>t.split(" ")});_n.group=new _n({deserialize:t=>t.split(" ")});_n.isolate=new _n({deserialize:t=>{if(t&&t!="rtl"&&t!="ltr"&&t!="auto")throw new RangeError("Invalid value for isolate: "+t);return t||"auto"}});_n.contextHash=new _n({perNode:!0});_n.lookAhead=new _n({perNode:!0});_n.mounted=new _n({perNode:!0});class oz{constructor(e,n,r){this.tree=e,this.overlay=n,this.parser=r}static get(e){return e&&e.props&&e.props[_n.mounted.id]}}const Pgn=Object.create(null);class El{constructor(e,n,r,i=0){this.name=e,this.props=n,this.id=r,this.flags=i}static define(e){let n=e.props&&e.props.length?Object.create(null):Pgn,r=(e.top?1:0)|(e.skipped?2:0)|(e.error?4:0)|(e.name==null?8:0),i=new El(e.name||"",n,e.id,r);if(e.props){for(let o of e.props)if(Array.isArray(o)||(o=o(i)),o){if(o[0].perNode)throw new RangeError("Can't store a per-node prop on a node type");n[o[0].id]=o[1]}}return i}prop(e){return this.props[e.id]}get isTop(){return(this.flags&1)>0}get isSkipped(){return(this.flags&2)>0}get isError(){return(this.flags&4)>0}get isAnonymous(){return(this.flags&8)>0}is(e){if(typeof e=="string"){if(this.name==e)return!0;let n=this.prop(_n.group);return n?n.indexOf(e)>-1:!1}return this.id==e}static match(e){let n=Object.create(null);for(let r in e)for(let i of r.split(" "))n[i]=e[r];return r=>{for(let i=r.prop(_n.group),o=-1;o<(i?i.length:0);o++){let s=n[o<0?r.name:i[o]];if(s)return s}}}}El.none=new El("",Object.create(null),0,8);class Vle{constructor(e){this.types=e;for(let n=0;n0;for(let l=this.cursor(s|yo.IncludeAnonymous);;){let c=!1;if(l.from<=o&&l.to>=i&&(!a&&l.type.isAnonymous||n(l)!==!1)){if(l.firstChild())continue;c=!0}for(;c&&r&&(a||!l.type.isAnonymous)&&r(l),!l.nextSibling();){if(!l.parent())return;c=!0}}}prop(e){return e.perNode?this.props?this.props[e.id]:void 0:this.type.prop(e)}get propValues(){let e=[];if(this.props)for(let n in this.props)e.push([+n,this.props[n]]);return e}balance(e={}){return this.children.length<=8?this:qle(El.none,this.children,this.positions,0,this.children.length,0,this.length,(n,r,i)=>new lo(this.type,n,r,i,this.propValues),e.makeTree||((n,r,i)=>new lo(El.none,n,r,i)))}static build(e){return Ign(e)}}lo.empty=new lo(El.none,[],[],0);class Gle{constructor(e,n){this.buffer=e,this.index=n}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}get pos(){return this.index}next(){this.index-=4}fork(){return new Gle(this.buffer,this.index)}}class Cy{constructor(e,n,r){this.buffer=e,this.length=n,this.set=r}get type(){return El.none}toString(){let e=[];for(let n=0;n0));l=s[l+3]);return a}slice(e,n,r){let i=this.buffer,o=new Uint16Array(n-e),s=0;for(let a=e,l=0;a=e&&ne;case 1:return n<=e&&r>e;case 2:return r>e;case 4:return!0}}function gP(t,e,n,r){for(var i;t.from==t.to||(n<1?t.from>=e:t.from>e)||(n>-1?t.to<=e:t.to0?a.length:-1;e!=c;e+=n){let u=a[e],f=l[e]+s.from;if(b7e(i,r,f,f+u.length)){if(u instanceof Cy){if(o&yo.ExcludeBuffers)continue;let d=u.findChild(0,u.buffer.length,n,r-f,i);if(d>-1)return new Zd(new Mgn(s,u,e,f),null,d)}else if(o&yo.IncludeAnonymous||!u.type.isAnonymous||Hle(u)){let d;if(!(o&yo.IgnoreMounts)&&(d=oz.get(u))&&!d.overlay)return new ml(d.tree,f,e,s);let h=new ml(u,f,e,s);return o&yo.IncludeAnonymous||!h.type.isAnonymous?h:h.nextChild(n<0?u.children.length-1:0,n,r,i)}}}if(o&yo.IncludeAnonymous||!s.type.isAnonymous||(s.index>=0?e=s.index+n:e=n<0?-1:s._parent._tree.children.length,s=s._parent,!s))return null}}get firstChild(){return this.nextChild(0,1,0,4)}get lastChild(){return this.nextChild(this._tree.children.length-1,-1,0,4)}childAfter(e){return this.nextChild(0,1,e,2)}childBefore(e){return this.nextChild(this._tree.children.length-1,-1,e,-2)}enter(e,n,r=0){let i;if(!(r&yo.IgnoreOverlays)&&(i=oz.get(this._tree))&&i.overlay){let o=e-this.from;for(let{from:s,to:a}of i.overlay)if((n>0?s<=o:s=o:a>o))return new ml(i.tree,i.overlay[0].from+this.from,-1,this)}return this.nextChild(0,1,e,n,r)}nextSignificantParent(){let e=this;for(;e.type.isAnonymous&&e._parent;)e=e._parent;return e}get parent(){return this._parent?this._parent.nextSignificantParent():null}get nextSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index+1,1,0,4):null}get prevSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index-1,-1,0,4):null}get tree(){return this._tree}toTree(){return this._tree}toString(){return this._tree.toString()}}function swe(t,e,n,r){let i=t.cursor(),o=[];if(!i.firstChild())return o;if(n!=null){for(let s=!1;!s;)if(s=i.type.is(n),!i.nextSibling())return o}for(;;){if(r!=null&&i.type.is(r))return o;if(i.type.is(e)&&o.push(i.node),!i.nextSibling())return r==null?o:[]}}function SK(t,e,n=e.length-1){for(let r=t.parent;n>=0;r=r.parent){if(!r)return!1;if(!r.type.isAnonymous){if(e[n]&&e[n]!=r.name)return!1;n--}}return!0}class Mgn{constructor(e,n,r,i){this.parent=e,this.buffer=n,this.index=r,this.start=i}}class Zd extends w7e{get name(){return this.type.name}get from(){return this.context.start+this.context.buffer.buffer[this.index+1]}get to(){return this.context.start+this.context.buffer.buffer[this.index+2]}constructor(e,n,r){super(),this.context=e,this._parent=n,this.index=r,this.type=e.buffer.set.types[e.buffer.buffer[r]]}child(e,n,r){let{buffer:i}=this.context,o=i.findChild(this.index+4,i.buffer[this.index+3],e,n-this.context.start,r);return o<0?null:new Zd(this.context,this,o)}get firstChild(){return this.child(1,0,4)}get lastChild(){return this.child(-1,0,4)}childAfter(e){return this.child(1,e,2)}childBefore(e){return this.child(-1,e,-2)}enter(e,n,r=0){if(r&yo.ExcludeBuffers)return null;let{buffer:i}=this.context,o=i.findChild(this.index+4,i.buffer[this.index+3],n>0?1:-1,e-this.context.start,n);return o<0?null:new Zd(this.context,this,o)}get parent(){return this._parent||this.context.parent.nextSignificantParent()}externalSibling(e){return this._parent?null:this.context.parent.nextChild(this.context.index+e,e,0,4)}get nextSibling(){let{buffer:e}=this.context,n=e.buffer[this.index+3];return n<(this._parent?e.buffer[this._parent.index+3]:e.buffer.length)?new Zd(this.context,this._parent,n):this.externalSibling(1)}get prevSibling(){let{buffer:e}=this.context,n=this._parent?this._parent.index+4:0;return this.index==n?this.externalSibling(-1):new Zd(this.context,this._parent,e.findChild(n,this.index,-1,0,4))}get tree(){return null}toTree(){let e=[],n=[],{buffer:r}=this.context,i=this.index+4,o=r.buffer[this.index+3];if(o>i){let s=r.buffer[this.index+1];e.push(r.slice(i,o,s)),n.push(0)}return new lo(this.type,e,n,this.to-this.from)}toString(){return this.context.buffer.childString(this.index)}}function _7e(t){if(!t.length)return null;let e=0,n=t[0];for(let o=1;on.from||s.to=e){let a=new ml(s.tree,s.overlay[0].from+o.from,-1,o);(i||(i=[r])).push(gP(a,e,n,!1))}}return i?_7e(i):r}class CK{get name(){return this.type.name}constructor(e,n=0){if(this.mode=n,this.buffer=null,this.stack=[],this.index=0,this.bufferNode=null,e instanceof ml)this.yieldNode(e);else{this._tree=e.context.parent,this.buffer=e.context;for(let r=e._parent;r;r=r._parent)this.stack.unshift(r.index);this.bufferNode=e,this.yieldBuf(e.index)}}yieldNode(e){return e?(this._tree=e,this.type=e.type,this.from=e.from,this.to=e.to,!0):!1}yieldBuf(e,n){this.index=e;let{start:r,buffer:i}=this.buffer;return this.type=n||i.set.types[i.buffer[e]],this.from=r+i.buffer[e+1],this.to=r+i.buffer[e+2],!0}yield(e){return e?e instanceof ml?(this.buffer=null,this.yieldNode(e)):(this.buffer=e.context,this.yieldBuf(e.index,e.type)):!1}toString(){return this.buffer?this.buffer.buffer.childString(this.index):this._tree.toString()}enterChild(e,n,r){if(!this.buffer)return this.yield(this._tree.nextChild(e<0?this._tree._tree.children.length-1:0,e,n,r,this.mode));let{buffer:i}=this.buffer,o=i.findChild(this.index+4,i.buffer[this.index+3],e,n-this.buffer.start,r);return o<0?!1:(this.stack.push(this.index),this.yieldBuf(o))}firstChild(){return this.enterChild(1,0,4)}lastChild(){return this.enterChild(-1,0,4)}childAfter(e){return this.enterChild(1,e,2)}childBefore(e){return this.enterChild(-1,e,-2)}enter(e,n,r=this.mode){return this.buffer?r&yo.ExcludeBuffers?!1:this.enterChild(1,e,n):this.yield(this._tree.enter(e,n,r))}parent(){if(!this.buffer)return this.yieldNode(this.mode&yo.IncludeAnonymous?this._tree._parent:this._tree.parent);if(this.stack.length)return this.yieldBuf(this.stack.pop());let e=this.mode&yo.IncludeAnonymous?this.buffer.parent:this.buffer.parent.nextSignificantParent();return this.buffer=null,this.yieldNode(e)}sibling(e){if(!this.buffer)return this._tree._parent?this.yield(this._tree.index<0?null:this._tree._parent.nextChild(this._tree.index+e,e,0,4,this.mode)):!1;let{buffer:n}=this.buffer,r=this.stack.length-1;if(e<0){let i=r<0?0:this.stack[r]+4;if(this.index!=i)return this.yieldBuf(n.findChild(i,this.index,-1,0,4))}else{let i=n.buffer[this.index+3];if(i<(r<0?n.buffer.length:n.buffer[this.stack[r]+3]))return this.yieldBuf(i)}return r<0?this.yield(this.buffer.parent.nextChild(this.buffer.index+e,e,0,4,this.mode)):!1}nextSibling(){return this.sibling(1)}prevSibling(){return this.sibling(-1)}atLastNode(e){let n,r,{buffer:i}=this;if(i){if(e>0){if(this.index-1)for(let o=n+e,s=e<0?-1:r._tree.children.length;o!=s;o+=e){let a=r._tree.children[o];if(this.mode&yo.IncludeAnonymous||a instanceof Cy||!a.type.isAnonymous||Hle(a))return!1}return!0}move(e,n){if(n&&this.enterChild(e,0,4))return!0;for(;;){if(this.sibling(e))return!0;if(this.atLastNode(e)||!this.parent())return!1}}next(e=!0){return this.move(1,e)}prev(e=!0){return this.move(-1,e)}moveTo(e,n=0){for(;(this.from==this.to||(n<1?this.from>=e:this.from>e)||(n>-1?this.to<=e:this.to=0;){for(let s=e;s;s=s._parent)if(s.index==i){if(i==this.index)return s;n=s,r=o+1;break e}i=this.stack[--o]}for(let i=r;i=0;o--){if(o<0)return SK(this.node,e,i);let s=r[n.buffer[this.stack[o]]];if(!s.isAnonymous){if(e[i]&&e[i]!=s.name)return!1;i--}}return!0}}function Hle(t){return t.children.some(e=>e instanceof Cy||!e.type.isAnonymous||Hle(e))}function Ign(t){var e;let{buffer:n,nodeSet:r,maxBufferLength:i=x7e,reused:o=[],minRepeatType:s=r.types.length}=t,a=Array.isArray(n)?new Gle(n,n.length):n,l=r.types,c=0,u=0;function f(w,_,S,O,k,E){let{id:P,start:A,end:R,size:T}=a,M=u;for(;T<0;)if(a.next(),T==-1){let L=o[P];S.push(L),O.push(A-w);return}else if(T==-3){c=P;return}else if(T==-4){u=P;return}else throw new RangeError(`Unrecognized record size: ${T}`);let I=l[P],j,N,z=A-w;if(R-A<=i&&(N=m(a.pos-_,k))){let L=new Uint16Array(N.size-N.skip),B=a.pos-N.size,F=L.length;for(;a.pos>B;)F=v(N.start,L,F);j=new Cy(L,R-N.start,r),z=N.start-w}else{let L=a.pos-T;a.next();let B=[],F=[],$=P>=s?P:-1,q=0,G=R;for(;a.pos>L;)$>=0&&a.id==$&&a.size>=0?(a.end<=G-i&&(p(B,F,A,q,a.end,G,$,M),q=B.length,G=a.end),a.next()):E>2500?d(A,L,B,F):f(A,L,B,F,$,E+1);if($>=0&&q>0&&q-1&&q>0){let Y=h(I);j=qle(I,B,F,0,B.length,0,R-A,Y,Y)}else j=g(I,B,F,R-A,M-R)}S.push(j),O.push(z)}function d(w,_,S,O){let k=[],E=0,P=-1;for(;a.pos>_;){let{id:A,start:R,end:T,size:M}=a;if(M>4)a.next();else{if(P>-1&&R=0;T-=3)A[M++]=k[T],A[M++]=k[T+1]-R,A[M++]=k[T+2]-R,A[M++]=M;S.push(new Cy(A,k[2]-R,r)),O.push(R-w)}}function h(w){return(_,S,O)=>{let k=0,E=_.length-1,P,A;if(E>=0&&(P=_[E])instanceof lo){if(!E&&P.type==w&&P.length==O)return P;(A=P.prop(_n.lookAhead))&&(k=S[E]+P.length+A)}return g(w,_,S,O,k)}}function p(w,_,S,O,k,E,P,A){let R=[],T=[];for(;w.length>O;)R.push(w.pop()),T.push(_.pop()+S-k);w.push(g(r.types[P],R,T,E-k,A-E)),_.push(k-S)}function g(w,_,S,O,k=0,E){if(c){let P=[_n.contextHash,c];E=E?[P].concat(E):[P]}if(k>25){let P=[_n.lookAhead,k];E=E?[P].concat(E):[P]}return new lo(w,_,S,O,E)}function m(w,_){let S=a.fork(),O=0,k=0,E=0,P=S.end-i,A={size:0,start:0,skip:0};e:for(let R=S.pos-w;S.pos>R;){let T=S.size;if(S.id==_&&T>=0){A.size=O,A.start=k,A.skip=E,E+=4,O+=4,S.next();continue}let M=S.pos-T;if(T<0||M=s?4:0,j=S.start;for(S.next();S.pos>M;){if(S.size<0)if(S.size==-3)I+=4;else break e;else S.id>=s&&(I+=4);S.next()}k=j,O+=T,E+=I}return(_<0||O==w)&&(A.size=O,A.start=k,A.skip=E),A.size>4?A:void 0}function v(w,_,S){let{id:O,start:k,end:E,size:P}=a;if(a.next(),P>=0&&O4){let R=a.pos-(P-4);for(;a.pos>R;)S=v(w,_,S)}_[--S]=A,_[--S]=E-w,_[--S]=k-w,_[--S]=O}else P==-3?c=O:P==-4&&(u=O);return S}let y=[],x=[];for(;a.pos>0;)f(t.start||0,t.bufferStart||0,y,x,-1,0);let b=(e=t.length)!==null&&e!==void 0?e:y.length?x[0]+y[0].length:0;return new lo(l[t.topID],y.reverse(),x.reverse(),b)}const awe=new WeakMap;function G3(t,e){if(!t.isAnonymous||e instanceof Cy||e.type!=t)return 1;let n=awe.get(e);if(n==null){n=1;for(let r of e.children){if(r.type!=t||!(r instanceof lo)){n=1;break}n+=G3(t,r)}awe.set(e,n)}return n}function qle(t,e,n,r,i,o,s,a,l){let c=0;for(let p=r;p=u)break;_+=S}if(x==b+1){if(_>u){let S=p[b];h(S.children,S.positions,0,S.children.length,g[b]+y);continue}f.push(p[b])}else{let S=g[x-1]+p[x-1].length-w;f.push(qle(t,p,g,b,x,w,S,null,l))}d.push(w+y-o)}}return h(e,n,r,i,0),(a||l)(f,d,s)}class Lgn{constructor(){this.map=new WeakMap}setBuffer(e,n,r){let i=this.map.get(e);i||this.map.set(e,i=new Map),i.set(n,r)}getBuffer(e,n){let r=this.map.get(e);return r&&r.get(n)}set(e,n){e instanceof Zd?this.setBuffer(e.context.buffer,e.index,n):e instanceof ml&&this.map.set(e.tree,n)}get(e){return e instanceof Zd?this.getBuffer(e.context.buffer,e.index):e instanceof ml?this.map.get(e.tree):void 0}cursorSet(e,n){e.buffer?this.setBuffer(e.buffer.buffer,e.index,n):this.map.set(e.tree,n)}cursorGet(e){return e.buffer?this.getBuffer(e.buffer.buffer,e.index):this.map.get(e.tree)}}class Hx{constructor(e,n,r,i,o=!1,s=!1){this.from=e,this.to=n,this.tree=r,this.offset=i,this.open=(o?1:0)|(s?2:0)}get openStart(){return(this.open&1)>0}get openEnd(){return(this.open&2)>0}static addTree(e,n=[],r=!1){let i=[new Hx(0,e.length,e,0,!1,r)];for(let o of n)o.to>e.length&&i.push(o);return i}static applyChanges(e,n,r=128){if(!n.length)return e;let i=[],o=1,s=e.length?e[0]:null;for(let a=0,l=0,c=0;;a++){let u=a=r)for(;s&&s.from=d.from||f<=d.to||c){let h=Math.max(d.from,l)-c,p=Math.min(d.to,f)-c;d=h>=p?null:new Hx(h,p,d.tree,d.offset+c,a>0,!!u)}if(d&&i.push(d),s.to>f)break;s=onew h7(i.from,i.to)):[new h7(0,0)]:[new h7(0,e.length)],this.createParse(e,n||[],r)}parse(e,n,r){let i=this.startParse(e,n,r);for(;;){let o=i.advance();if(o)return o}}}class $gn{constructor(e){this.string=e}get length(){return this.string.length}chunk(e){return this.string.slice(e)}get lineChunks(){return!1}read(e,n){return this.string.slice(e,n)}}new _n({perNode:!0});let Fgn=0;class Yc{constructor(e,n,r,i){this.name=e,this.set=n,this.base=r,this.modified=i,this.id=Fgn++}toString(){let{name:e}=this;for(let n of this.modified)n.name&&(e=`${n.name}(${e})`);return e}static define(e,n){let r=typeof e=="string"?e:"?";if(e instanceof Yc&&(n=e),n!=null&&n.base)throw new Error("Can not derive from a modified tag");let i=new Yc(r,[],null,[]);if(i.set.push(i),n)for(let o of n.set)i.set.push(o);return i}static defineModifier(e){let n=new sz(e);return r=>r.modified.indexOf(n)>-1?r:sz.get(r.base||r,r.modified.concat(n).sort((i,o)=>i.id-o.id))}}let Ngn=0;class sz{constructor(e){this.name=e,this.instances=[],this.id=Ngn++}static get(e,n){if(!n.length)return e;let r=n[0].instances.find(a=>a.base==e&&zgn(n,a.modified));if(r)return r;let i=[],o=new Yc(e.name,i,e,n);for(let a of n)a.instances.push(o);let s=jgn(n);for(let a of e.set)if(!a.modified.length)for(let l of s)i.push(sz.get(a,l));return o}}function zgn(t,e){return t.length==e.length&&t.every((n,r)=>n==e[r])}function jgn(t){let e=[[]];for(let n=0;nr.length-n.length)}function Xle(t){let e=Object.create(null);for(let n in t){let r=t[n];Array.isArray(r)||(r=[r]);for(let i of n.split(" "))if(i){let o=[],s=2,a=i;for(let f=0;;){if(a=="..."&&f>0&&f+3==i.length){s=1;break}let d=/^"(?:[^"\\]|\\.)*?"|[^\/!]+/.exec(a);if(!d)throw new RangeError("Invalid path: "+i);if(o.push(d[0]=="*"?"":d[0][0]=='"'?JSON.parse(d[0]):d[0]),f+=d[0].length,f==i.length)break;let h=i[f++];if(f==i.length&&h=="!"){s=0;break}if(h!="/")throw new RangeError("Invalid path: "+i);a=i.slice(f)}let l=o.length-1,c=o[l];if(!c)throw new RangeError("Invalid path: "+i);let u=new az(r,s,l>0?o.slice(0,l):null);e[c]=u.sort(e[c])}}return C7e.add(e)}const C7e=new _n;class az{constructor(e,n,r,i){this.tags=e,this.mode=n,this.context=r,this.next=i}get opaque(){return this.mode==0}get inherit(){return this.mode==1}sort(e){return!e||e.depth{let s=i;for(let a of o)for(let l of a.set){let c=n[l.id];if(c){s=s?s+" "+c:c;break}}return s},scope:r}}function Bgn(t,e){let n=null;for(let r of t){let i=r.style(e);i&&(n=n?n+" "+i:i)}return n}function Ugn(t,e,n,r=0,i=t.length){let o=new Wgn(r,Array.isArray(e)?e:[e],n);o.highlightRange(t.cursor(),r,i,"",o.highlighters),o.flush(i)}class Wgn{constructor(e,n,r){this.at=e,this.highlighters=n,this.span=r,this.class=""}startSpan(e,n){n!=this.class&&(this.flush(e),e>this.at&&(this.at=e),this.class=n)}flush(e){e>this.at&&this.class&&this.span(this.at,e,this.class)}highlightRange(e,n,r,i,o){let{type:s,from:a,to:l}=e;if(a>=r||l<=n)return;s.isTop&&(o=this.highlighters.filter(h=>!h.scope||h.scope(s)));let c=i,u=Vgn(e)||az.empty,f=Bgn(o,u.tags);if(f&&(c&&(c+=" "),c+=f,u.mode==1&&(i+=(i?" ":"")+f)),this.startSpan(Math.max(n,a),c),u.opaque)return;let d=e.tree&&e.tree.prop(_n.mounted);if(d&&d.overlay){let h=e.node.enter(d.overlay[0].from+a,1),p=this.highlighters.filter(m=>!m.scope||m.scope(d.tree.type)),g=e.firstChild();for(let m=0,v=a;;m++){let y=m=x||!e.nextSibling())););if(!y||x>r)break;v=y.to+a,v>n&&(this.highlightRange(h.cursor(),Math.max(n,y.from+a),Math.min(r,v),"",p),this.startSpan(Math.min(r,v),c))}g&&e.parent()}else if(e.firstChild()){d&&(i="");do if(!(e.to<=n)){if(e.from>=r)break;this.highlightRange(e,n,r,i,o),this.startSpan(Math.min(r,e.to),c)}while(e.nextSibling());e.parent()}}}function Vgn(t){let e=t.type.prop(C7e);for(;e&&e.context&&!t.matchContext(e.context);)e=e.next;return e||null}const dt=Yc.define,$L=dt(),Qm=dt(),lwe=dt(Qm),cwe=dt(Qm),Km=dt(),FL=dt(Km),p7=dt(Km),wd=dt(),k0=dt(wd),yd=dt(),xd=dt(),OK=dt(),C2=dt(OK),NL=dt(),Ee={comment:$L,lineComment:dt($L),blockComment:dt($L),docComment:dt($L),name:Qm,variableName:dt(Qm),typeName:lwe,tagName:dt(lwe),propertyName:cwe,attributeName:dt(cwe),className:dt(Qm),labelName:dt(Qm),namespace:dt(Qm),macroName:dt(Qm),literal:Km,string:FL,docString:dt(FL),character:dt(FL),attributeValue:dt(FL),number:p7,integer:dt(p7),float:dt(p7),bool:dt(Km),regexp:dt(Km),escape:dt(Km),color:dt(Km),url:dt(Km),keyword:yd,self:dt(yd),null:dt(yd),atom:dt(yd),unit:dt(yd),modifier:dt(yd),operatorKeyword:dt(yd),controlKeyword:dt(yd),definitionKeyword:dt(yd),moduleKeyword:dt(yd),operator:xd,derefOperator:dt(xd),arithmeticOperator:dt(xd),logicOperator:dt(xd),bitwiseOperator:dt(xd),compareOperator:dt(xd),updateOperator:dt(xd),definitionOperator:dt(xd),typeOperator:dt(xd),controlOperator:dt(xd),punctuation:OK,separator:dt(OK),bracket:C2,angleBracket:dt(C2),squareBracket:dt(C2),paren:dt(C2),brace:dt(C2),content:wd,heading:k0,heading1:dt(k0),heading2:dt(k0),heading3:dt(k0),heading4:dt(k0),heading5:dt(k0),heading6:dt(k0),contentSeparator:dt(wd),list:dt(wd),quote:dt(wd),emphasis:dt(wd),strong:dt(wd),link:dt(wd),monospace:dt(wd),strikethrough:dt(wd),inserted:dt(),deleted:dt(),changed:dt(),invalid:dt(),meta:NL,documentMeta:dt(NL),annotation:dt(NL),processingInstruction:dt(NL),definition:Yc.defineModifier("definition"),constant:Yc.defineModifier("constant"),function:Yc.defineModifier("function"),standard:Yc.defineModifier("standard"),local:Yc.defineModifier("local"),special:Yc.defineModifier("special")};for(let t in Ee){let e=Ee[t];e instanceof Yc&&(e.name=t)}O7e([{tag:Ee.link,class:"tok-link"},{tag:Ee.heading,class:"tok-heading"},{tag:Ee.emphasis,class:"tok-emphasis"},{tag:Ee.strong,class:"tok-strong"},{tag:Ee.keyword,class:"tok-keyword"},{tag:Ee.atom,class:"tok-atom"},{tag:Ee.bool,class:"tok-bool"},{tag:Ee.url,class:"tok-url"},{tag:Ee.labelName,class:"tok-labelName"},{tag:Ee.inserted,class:"tok-inserted"},{tag:Ee.deleted,class:"tok-deleted"},{tag:Ee.literal,class:"tok-literal"},{tag:Ee.string,class:"tok-string"},{tag:Ee.number,class:"tok-number"},{tag:[Ee.regexp,Ee.escape,Ee.special(Ee.string)],class:"tok-string2"},{tag:Ee.variableName,class:"tok-variableName"},{tag:Ee.local(Ee.variableName),class:"tok-variableName tok-local"},{tag:Ee.definition(Ee.variableName),class:"tok-variableName tok-definition"},{tag:Ee.special(Ee.variableName),class:"tok-variableName2"},{tag:Ee.definition(Ee.propertyName),class:"tok-propertyName tok-definition"},{tag:Ee.typeName,class:"tok-typeName"},{tag:Ee.namespace,class:"tok-namespace"},{tag:Ee.className,class:"tok-className"},{tag:Ee.macroName,class:"tok-macroName"},{tag:Ee.propertyName,class:"tok-propertyName"},{tag:Ee.operator,class:"tok-operator"},{tag:Ee.comment,class:"tok-comment"},{tag:Ee.meta,class:"tok-meta"},{tag:Ee.invalid,class:"tok-invalid"},{tag:Ee.punctuation,class:"tok-punctuation"}]);var g7;const g_=new _n;function Ggn(t){return _t.define({combine:t?e=>e.concat(t):void 0})}const Hgn=new _n;class Af{constructor(e,n,r=[],i=""){this.data=e,this.name=i,In.prototype.hasOwnProperty("tree")||Object.defineProperty(In.prototype,"tree",{get(){return Vo(this)}}),this.parser=n,this.extension=[Oy.of(this),In.languageData.of((o,s,a)=>{let l=uwe(o,s,a),c=l.type.prop(g_);if(!c)return[];let u=o.facet(c),f=l.type.prop(Hgn);if(f){let d=l.resolve(s-l.from,a);for(let h of f)if(h.test(d,o)){let p=o.facet(h.facet);return h.type=="replace"?p:p.concat(u)}}return u})].concat(r)}isActiveAt(e,n,r=-1){return uwe(e,n,r).type.prop(g_)==this.data}findRegions(e){let n=e.facet(Oy);if((n==null?void 0:n.data)==this.data)return[{from:0,to:e.doc.length}];if(!n||!n.allowsNesting)return[];let r=[],i=(o,s)=>{if(o.prop(g_)==this.data){r.push({from:s,to:s+o.length});return}let a=o.prop(_n.mounted);if(a){if(a.tree.prop(g_)==this.data){if(a.overlay)for(let l of a.overlay)r.push({from:l.from+s,to:l.to+s});else r.push({from:s,to:s+o.length});return}else if(a.overlay){let l=r.length;if(i(a.tree,a.overlay[0].from+s),r.length>l)return}}for(let l=0;lr.isTop?n:void 0)]}),e.name)}configure(e,n){return new mP(this.data,this.parser.configure(e),n||this.name)}get allowsNesting(){return this.parser.hasWrappers()}}function Vo(t){let e=t.field(Af.state,!1);return e?e.tree:lo.empty}class qgn{constructor(e){this.doc=e,this.cursorPos=0,this.string="",this.cursor=e.iter()}get length(){return this.doc.length}syncTo(e){return this.string=this.cursor.next(e-this.cursorPos).value,this.cursorPos=e+this.string.length,this.cursorPos-this.string.length}chunk(e){return this.syncTo(e),this.string}get lineChunks(){return!0}read(e,n){let r=this.cursorPos-this.string.length;return e=this.cursorPos?this.doc.sliceString(e,n):this.string.slice(e-r,n-r)}}let O2=null;class lz{constructor(e,n,r=[],i,o,s,a,l){this.parser=e,this.state=n,this.fragments=r,this.tree=i,this.treeLen=o,this.viewport=s,this.skipped=a,this.scheduleOn=l,this.parse=null,this.tempSkipped=[]}static create(e,n,r){return new lz(e,n,[],lo.empty,0,r,[],null)}startParse(){return this.parser.startParse(new qgn(this.state.doc),this.fragments)}work(e,n){return n!=null&&n>=this.state.doc.length&&(n=void 0),this.tree!=lo.empty&&this.isDone(n??this.state.doc.length)?(this.takeTree(),!0):this.withContext(()=>{var r;if(typeof e=="number"){let i=Date.now()+e;e=()=>Date.now()>i}for(this.parse||(this.parse=this.startParse()),n!=null&&(this.parse.stoppedAt==null||this.parse.stoppedAt>n)&&n=this.treeLen&&((this.parse.stoppedAt==null||this.parse.stoppedAt>e)&&this.parse.stopAt(e),this.withContext(()=>{for(;!(n=this.parse.advance()););}),this.treeLen=e,this.tree=n,this.fragments=this.withoutTempSkipped(Hx.addTree(this.tree,this.fragments,!0)),this.parse=null)}withContext(e){let n=O2;O2=this;try{return e()}finally{O2=n}}withoutTempSkipped(e){for(let n;n=this.tempSkipped.pop();)e=fwe(e,n.from,n.to);return e}changes(e,n){let{fragments:r,tree:i,treeLen:o,viewport:s,skipped:a}=this;if(this.takeTree(),!e.empty){let l=[];if(e.iterChangedRanges((c,u,f,d)=>l.push({fromA:c,toA:u,fromB:f,toB:d})),r=Hx.applyChanges(r,l),i=lo.empty,o=0,s={from:e.mapPos(s.from,-1),to:e.mapPos(s.to,1)},this.skipped.length){a=[];for(let c of this.skipped){let u=e.mapPos(c.from,1),f=e.mapPos(c.to,-1);ue.from&&(this.fragments=fwe(this.fragments,i,o),this.skipped.splice(r--,1))}return this.skipped.length>=n?!1:(this.reset(),!0)}reset(){this.parse&&(this.takeTree(),this.parse=null)}skipUntilInView(e,n){this.skipped.push({from:e,to:n})}static getSkippingParser(e){return new class extends S7e{createParse(n,r,i){let o=i[0].from,s=i[i.length-1].to;return{parsedPos:o,advance(){let l=O2;if(l){for(let c of i)l.tempSkipped.push(c);e&&(l.scheduleOn=l.scheduleOn?Promise.all([l.scheduleOn,e]):e)}return this.parsedPos=s,new lo(El.none,[],[],s-o)},stoppedAt:null,stopAt(){}}}}}isDone(e){e=Math.min(e,this.state.doc.length);let n=this.fragments;return this.treeLen>=e&&n.length&&n[0].from==0&&n[0].to>=e}static get(){return O2}}function fwe(t,e,n){return Hx.applyChanges(t,[{fromA:e,toA:n,fromB:e,toB:n}])}class bC{constructor(e){this.context=e,this.tree=e.tree}apply(e){if(!e.docChanged&&this.tree==this.context.tree)return this;let n=this.context.changes(e.changes,e.state),r=this.context.treeLen==e.startState.doc.length?void 0:Math.max(e.changes.mapPos(this.context.treeLen),n.viewport.to);return n.work(20,r)||n.takeTree(),new bC(n)}static init(e){let n=Math.min(3e3,e.doc.length),r=lz.create(e.facet(Oy).parser,e,{from:0,to:n});return r.work(20,n)||r.takeTree(),new bC(r)}}Af.state=Qo.define({create:bC.init,update(t,e){for(let n of e.effects)if(n.is(Af.setState))return n.value;return e.startState.facet(Oy)!=e.state.facet(Oy)?bC.init(e.state):t.apply(e)}});let E7e=t=>{let e=setTimeout(()=>t(),500);return()=>clearTimeout(e)};typeof requestIdleCallback<"u"&&(E7e=t=>{let e=-1,n=setTimeout(()=>{e=requestIdleCallback(t,{timeout:400})},100);return()=>e<0?clearTimeout(n):cancelIdleCallback(e)});const m7=typeof navigator<"u"&&(!((g7=navigator.scheduling)===null||g7===void 0)&&g7.isInputPending)?()=>navigator.scheduling.isInputPending():null,Xgn=Yi.fromClass(class{constructor(e){this.view=e,this.working=null,this.workScheduled=0,this.chunkEnd=-1,this.chunkBudget=-1,this.work=this.work.bind(this),this.scheduleWork()}update(e){let n=this.view.state.field(Af.state).context;(n.updateViewport(e.view.viewport)||this.view.viewport.to>n.treeLen)&&this.scheduleWork(),(e.docChanged||e.selectionSet)&&(this.view.hasFocus&&(this.chunkBudget+=50),this.scheduleWork()),this.checkAsyncSchedule(n)}scheduleWork(){if(this.working)return;let{state:e}=this.view,n=e.field(Af.state);(n.tree!=n.context.tree||!n.context.isDone(e.doc.length))&&(this.working=E7e(this.work))}work(e){this.working=null;let n=Date.now();if(this.chunkEndi+1e3,l=o.context.work(()=>m7&&m7()||Date.now()>s,i+(a?0:1e5));this.chunkBudget-=Date.now()-n,(l||this.chunkBudget<=0)&&(o.context.takeTree(),this.view.dispatch({effects:Af.setState.of(new bC(o.context))})),this.chunkBudget>0&&!(l&&!a)&&this.scheduleWork(),this.checkAsyncSchedule(o.context)}checkAsyncSchedule(e){e.scheduleOn&&(this.workScheduled++,e.scheduleOn.then(()=>this.scheduleWork()).catch(n=>sl(this.view.state,n)).then(()=>this.workScheduled--),e.scheduleOn=null)}destroy(){this.working&&this.working()}isWorking(){return!!(this.working||this.workScheduled>0)}},{eventHandlers:{focus(){this.scheduleWork()}}}),Oy=_t.define({combine(t){return t.length?t[0]:null},enables:t=>[Af.state,Xgn,mt.contentAttributes.compute([t],e=>{let n=e.facet(t);return n&&n.name?{"data-language":n.name}:{}})]});class T7e{constructor(e,n=[]){this.language=e,this.support=n,this.extension=[e,n]}}const Ygn=_t.define(),lD=_t.define({combine:t=>{if(!t.length)return" ";let e=t[0];if(!e||/\S/.test(e)||Array.from(e).some(n=>n!=e[0]))throw new Error("Invalid indent unit: "+JSON.stringify(t[0]));return e}});function cz(t){let e=t.facet(lD);return e.charCodeAt(0)==9?t.tabSize*e.length:e.length}function vP(t,e){let n="",r=t.tabSize,i=t.facet(lD)[0];if(i==" "){for(;e>=r;)n+=" ",e-=r;i=" "}for(let o=0;o=e?Qgn(t,n,e):null}class PU{constructor(e,n={}){this.state=e,this.options=n,this.unit=cz(e)}lineAt(e,n=1){let r=this.state.doc.lineAt(e),{simulateBreak:i,simulateDoubleBreak:o}=this.options;return i!=null&&i>=r.from&&i<=r.to?o&&i==e?{text:"",from:e}:(n<0?i-1&&(o+=s-this.countColumn(r,r.search(/\S|$/))),o}countColumn(e,n=e.length){return XO(e,this.state.tabSize,n)}lineIndent(e,n=1){let{text:r,from:i}=this.lineAt(e,n),o=this.options.overrideIndentation;if(o){let s=o(i);if(s>-1)return s}return this.countColumn(r,r.search(/\S|$/))}get simulatedBreak(){return this.options.simulateBreak||null}}const Qle=new _n;function Qgn(t,e,n){let r=e.resolveStack(n),i=r.node.enterUnfinishedNodesBefore(n);if(i!=r.node){let o=[];for(let s=i;s!=r.node;s=s.parent)o.push(s);for(let s=o.length-1;s>=0;s--)r={node:o[s],next:r}}return k7e(r,t,n)}function k7e(t,e,n){for(let r=t;r;r=r.next){let i=Zgn(r.node);if(i)return i(Kle.create(e,n,r))}return 0}function Kgn(t){return t.pos==t.options.simulateBreak&&t.options.simulateDoubleBreak}function Zgn(t){let e=t.type.prop(Qle);if(e)return e;let n=t.firstChild,r;if(n&&(r=n.type.prop(_n.closedBy))){let i=t.lastChild,o=i&&r.indexOf(i.name)>-1;return s=>A7e(s,!0,1,void 0,o&&!Kgn(s)?i.from:void 0)}return t.parent==null?Jgn:null}function Jgn(){return 0}class Kle extends PU{constructor(e,n,r){super(e.state,e.options),this.base=e,this.pos=n,this.context=r}get node(){return this.context.node}static create(e,n,r){return new Kle(e,n,r)}get textAfter(){return this.textAfterPos(this.pos)}get baseIndent(){return this.baseIndentFor(this.node)}baseIndentFor(e){let n=this.state.doc.lineAt(e.from);for(;;){let r=e.resolve(n.from);for(;r.parent&&r.parent.from==r.from;)r=r.parent;if(emn(r,e))break;n=this.state.doc.lineAt(r.from)}return this.lineIndent(n.from)}continue(){return k7e(this.context.next,this.base,this.pos)}}function emn(t,e){for(let n=e;n;n=n.parent)if(t==n)return!0;return!1}function tmn(t){let e=t.node,n=e.childAfter(e.from),r=e.lastChild;if(!n)return null;let i=t.options.simulateBreak,o=t.state.doc.lineAt(n.from),s=i==null||i<=o.from?o.to:Math.min(o.to,i);for(let a=n.to;;){let l=e.childAfter(a);if(!l||l==r)return null;if(!l.type.isSkipped)return l.fromA7e(r,e,n,t)}function A7e(t,e,n,r,i){let o=t.textAfter,s=o.match(/^\s*/)[0].length,a=r&&o.slice(s,s+r.length)==r||i==t.pos+s,l=e?tmn(t):null;return l?a?t.column(l.from):t.column(l.to):t.baseIndent+(a?0:t.unit*n)}function dwe({except:t,units:e=1}={}){return n=>{let r=t&&t.test(n.textAfter);return n.baseIndent+(r?0:e*n.unit)}}const nmn=200;function rmn(){return In.transactionFilter.of(t=>{if(!t.docChanged||!t.isUserEvent("input.type")&&!t.isUserEvent("input.complete"))return t;let e=t.startState.languageDataAt("indentOnInput",t.startState.selection.main.head);if(!e.length)return t;let n=t.newDoc,{head:r}=t.newSelection.main,i=n.lineAt(r);if(r>i.from+nmn)return t;let o=n.sliceString(i.from,r);if(!e.some(c=>c.test(o)))return t;let{state:s}=t,a=-1,l=[];for(let{head:c}of s.selection.ranges){let u=s.doc.lineAt(c);if(u.from==a)continue;a=u.from;let f=Yle(s,u.from);if(f==null)continue;let d=/^\s*/.exec(u.text)[0],h=vP(s,f);d!=h&&l.push({from:u.from,to:u.from+d.length,insert:h})}return l.length?[t,{changes:l,sequential:!0}]:t})}const imn=_t.define(),Zle=new _n;function P7e(t){let e=t.firstChild,n=t.lastChild;return e&&e.ton)continue;if(o&&a.from=e&&c.to>n&&(o=c)}}return o}function smn(t){let e=t.lastChild;return e&&e.to==t.to&&e.type.isError}function uz(t,e,n){for(let r of t.facet(imn)){let i=r(t,e,n);if(i)return i}return omn(t,e,n)}function M7e(t,e){let n=e.mapPos(t.from,1),r=e.mapPos(t.to,-1);return n>=r?void 0:{from:n,to:r}}const MU=rn.define({map:M7e}),cD=rn.define({map:M7e});function R7e(t){let e=[];for(let{head:n}of t.state.selection.ranges)e.some(r=>r.from<=n&&r.to>=n)||e.push(t.lineBlockAt(n));return e}const Lb=Qo.define({create(){return Dt.none},update(t,e){t=t.map(e.changes);for(let n of e.effects)if(n.is(MU)&&!amn(t,n.value.from,n.value.to)){let{preparePlaceholder:r}=e.state.facet(L7e),i=r?Dt.replace({widget:new pmn(r(e.state,n.value))}):hwe;t=t.update({add:[i.range(n.value.from,n.value.to)]})}else n.is(cD)&&(t=t.update({filter:(r,i)=>n.value.from!=r||n.value.to!=i,filterFrom:n.value.from,filterTo:n.value.to}));if(e.selection){let n=!1,{head:r}=e.selection.main;t.between(r,r,(i,o)=>{ir&&(n=!0)}),n&&(t=t.update({filterFrom:r,filterTo:r,filter:(i,o)=>o<=r||i>=r}))}return t},provide:t=>mt.decorations.from(t),toJSON(t,e){let n=[];return t.between(0,e.doc.length,(r,i)=>{n.push(r,i)}),n},fromJSON(t){if(!Array.isArray(t)||t.length%2)throw new RangeError("Invalid JSON for fold state");let e=[];for(let n=0;n{(!i||i.from>o)&&(i={from:o,to:s})}),i}function amn(t,e,n){let r=!1;return t.between(e,e,(i,o)=>{i==e&&o==n&&(r=!0)}),r}function D7e(t,e){return t.field(Lb,!1)?e:e.concat(rn.appendConfig.of($7e()))}const lmn=t=>{for(let e of R7e(t)){let n=uz(t.state,e.from,e.to);if(n)return t.dispatch({effects:D7e(t.state,[MU.of(n),I7e(t,n)])}),!0}return!1},cmn=t=>{if(!t.state.field(Lb,!1))return!1;let e=[];for(let n of R7e(t)){let r=fz(t.state,n.from,n.to);r&&e.push(cD.of(r),I7e(t,r,!1))}return e.length&&t.dispatch({effects:e}),e.length>0};function I7e(t,e,n=!0){let r=t.state.doc.lineAt(e.from).number,i=t.state.doc.lineAt(e.to).number;return mt.announce.of(`${t.state.phrase(n?"Folded lines":"Unfolded lines")} ${r} ${t.state.phrase("to")} ${i}.`)}const umn=t=>{let{state:e}=t,n=[];for(let r=0;r{let e=t.state.field(Lb,!1);if(!e||!e.size)return!1;let n=[];return e.between(0,t.state.doc.length,(r,i)=>{n.push(cD.of({from:r,to:i}))}),t.dispatch({effects:n}),!0},dmn=[{key:"Ctrl-Shift-[",mac:"Cmd-Alt-[",run:lmn},{key:"Ctrl-Shift-]",mac:"Cmd-Alt-]",run:cmn},{key:"Ctrl-Alt-[",run:umn},{key:"Ctrl-Alt-]",run:fmn}],hmn={placeholderDOM:null,preparePlaceholder:null,placeholderText:"…"},L7e=_t.define({combine(t){return Kh(t,hmn)}});function $7e(t){return[Lb,vmn]}function F7e(t,e){let{state:n}=t,r=n.facet(L7e),i=s=>{let a=t.lineBlockAt(t.posAtDOM(s.target)),l=fz(t.state,a.from,a.to);l&&t.dispatch({effects:cD.of(l)}),s.preventDefault()};if(r.placeholderDOM)return r.placeholderDOM(t,i,e);let o=document.createElement("span");return o.textContent=r.placeholderText,o.setAttribute("aria-label",n.phrase("folded code")),o.title=n.phrase("unfold"),o.className="cm-foldPlaceholder",o.onclick=i,o}const hwe=Dt.replace({widget:new class extends Zh{toDOM(t){return F7e(t,null)}}});class pmn extends Zh{constructor(e){super(),this.value=e}eq(e){return this.value==e.value}toDOM(e){return F7e(e,this.value)}}const gmn={openText:"⌄",closedText:"›",markerDOM:null,domEventHandlers:{},foldingChanged:()=>!1};class y7 extends zg{constructor(e,n){super(),this.config=e,this.open=n}eq(e){return this.config==e.config&&this.open==e.open}toDOM(e){if(this.config.markerDOM)return this.config.markerDOM(this.open);let n=document.createElement("span");return n.textContent=this.open?this.config.openText:this.config.closedText,n.title=e.state.phrase(this.open?"Fold line":"Unfold line"),n}}function mmn(t={}){let e=Object.assign(Object.assign({},gmn),t),n=new y7(e,!0),r=new y7(e,!1),i=Yi.fromClass(class{constructor(s){this.from=s.viewport.from,this.markers=this.buildMarkers(s)}update(s){(s.docChanged||s.viewportChanged||s.startState.facet(Oy)!=s.state.facet(Oy)||s.startState.field(Lb,!1)!=s.state.field(Lb,!1)||Vo(s.startState)!=Vo(s.state)||e.foldingChanged(s))&&(this.markers=this.buildMarkers(s.view))}buildMarkers(s){let a=new by;for(let l of s.viewportLineBlocks){let c=fz(s.state,l.from,l.to)?r:uz(s.state,l.from,l.to)?n:null;c&&a.add(l.from,l.from,c)}return a.finish()}}),{domEventHandlers:o}=e;return[i,ygn({class:"cm-foldGutter",markers(s){var a;return((a=s.plugin(i))===null||a===void 0?void 0:a.markers)||Gn.empty},initialSpacer(){return new y7(e,!1)},domEventHandlers:Object.assign(Object.assign({},o),{click:(s,a,l)=>{if(o.click&&o.click(s,a,l))return!0;let c=fz(s.state,a.from,a.to);if(c)return s.dispatch({effects:cD.of(c)}),!0;let u=uz(s.state,a.from,a.to);return u?(s.dispatch({effects:MU.of(u)}),!0):!1}})}),$7e()]}const vmn=mt.baseTheme({".cm-foldPlaceholder":{backgroundColor:"#eee",border:"1px solid #ddd",color:"#888",borderRadius:".2em",margin:"0 1px",padding:"0 1px",cursor:"pointer"},".cm-foldGutter span":{padding:"0 1px",cursor:"pointer"}});class uD{constructor(e,n){this.specs=e;let r;function i(a){let l=wy.newName();return(r||(r=Object.create(null)))["."+l]=a,l}const o=typeof n.all=="string"?n.all:n.all?i(n.all):void 0,s=n.scope;this.scope=s instanceof Af?a=>a.prop(g_)==s.data:s?a=>a==s:void 0,this.style=O7e(e.map(a=>({tag:a.tag,class:a.class||i(Object.assign({},a,{tag:null}))})),{all:o}).style,this.module=r?new wy(r):null,this.themeType=n.themeType}static define(e,n){return new uD(e,n||{})}}const EK=_t.define(),N7e=_t.define({combine(t){return t.length?[t[0]]:null}});function x7(t){let e=t.facet(EK);return e.length?e:t.facet(N7e)}function z7e(t,e){let n=[xmn],r;return t instanceof uD&&(t.module&&n.push(mt.styleModule.of(t.module)),r=t.themeType),e!=null&&e.fallback?n.push(N7e.of(t)):r?n.push(EK.computeN([mt.darkTheme],i=>i.facet(mt.darkTheme)==(r=="dark")?[t]:[])):n.push(EK.of(t)),n}class ymn{constructor(e){this.markCache=Object.create(null),this.tree=Vo(e.state),this.decorations=this.buildDeco(e,x7(e.state)),this.decoratedTo=e.viewport.to}update(e){let n=Vo(e.state),r=x7(e.state),i=r!=x7(e.startState),{viewport:o}=e.view,s=e.changes.mapPos(this.decoratedTo,1);n.length=o.to?(this.decorations=this.decorations.map(e.changes),this.decoratedTo=s):(n!=this.tree||e.viewportChanged||i)&&(this.tree=n,this.decorations=this.buildDeco(e.view,r),this.decoratedTo=o.to)}buildDeco(e,n){if(!n||!this.tree.length)return Dt.none;let r=new by;for(let{from:i,to:o}of e.visibleRanges)Ugn(this.tree,n,(s,a,l)=>{r.add(s,a,this.markCache[l]||(this.markCache[l]=Dt.mark({class:l})))},i,o);return r.finish()}}const xmn=t0.high(Yi.fromClass(ymn,{decorations:t=>t.decorations})),bmn=uD.define([{tag:Ee.meta,color:"#404740"},{tag:Ee.link,textDecoration:"underline"},{tag:Ee.heading,textDecoration:"underline",fontWeight:"bold"},{tag:Ee.emphasis,fontStyle:"italic"},{tag:Ee.strong,fontWeight:"bold"},{tag:Ee.strikethrough,textDecoration:"line-through"},{tag:Ee.keyword,color:"#708"},{tag:[Ee.atom,Ee.bool,Ee.url,Ee.contentSeparator,Ee.labelName],color:"#219"},{tag:[Ee.literal,Ee.inserted],color:"#164"},{tag:[Ee.string,Ee.deleted],color:"#a11"},{tag:[Ee.regexp,Ee.escape,Ee.special(Ee.string)],color:"#e40"},{tag:Ee.definition(Ee.variableName),color:"#00f"},{tag:Ee.local(Ee.variableName),color:"#30a"},{tag:[Ee.typeName,Ee.namespace],color:"#085"},{tag:Ee.className,color:"#167"},{tag:[Ee.special(Ee.variableName),Ee.macroName],color:"#256"},{tag:Ee.definition(Ee.propertyName),color:"#00c"},{tag:Ee.comment,color:"#940"},{tag:Ee.invalid,color:"#f00"}]),wmn=mt.baseTheme({"&.cm-focused .cm-matchingBracket":{backgroundColor:"#328c8252"},"&.cm-focused .cm-nonmatchingBracket":{backgroundColor:"#bb555544"}}),j7e=1e4,B7e="()[]{}",U7e=_t.define({combine(t){return Kh(t,{afterCursor:!0,brackets:B7e,maxScanDistance:j7e,renderMatch:Cmn})}}),_mn=Dt.mark({class:"cm-matchingBracket"}),Smn=Dt.mark({class:"cm-nonmatchingBracket"});function Cmn(t){let e=[],n=t.matched?_mn:Smn;return e.push(n.range(t.start.from,t.start.to)),t.end&&e.push(n.range(t.end.from,t.end.to)),e}const Omn=Qo.define({create(){return Dt.none},update(t,e){if(!e.docChanged&&!e.selection)return t;let n=[],r=e.state.facet(U7e);for(let i of e.state.selection.ranges){if(!i.empty)continue;let o=Jd(e.state,i.head,-1,r)||i.head>0&&Jd(e.state,i.head-1,1,r)||r.afterCursor&&(Jd(e.state,i.head,1,r)||i.headmt.decorations.from(t)}),Emn=[Omn,wmn];function Tmn(t={}){return[U7e.of(t),Emn]}const kmn=new _n;function TK(t,e,n){let r=t.prop(e<0?_n.openedBy:_n.closedBy);if(r)return r;if(t.name.length==1){let i=n.indexOf(t.name);if(i>-1&&i%2==(e<0?1:0))return[n[i+e]]}return null}function kK(t){let e=t.type.prop(kmn);return e?e(t.node):t}function Jd(t,e,n,r={}){let i=r.maxScanDistance||j7e,o=r.brackets||B7e,s=Vo(t),a=s.resolveInner(e,n);for(let l=a;l;l=l.parent){let c=TK(l.type,n,o);if(c&&l.from0?e>=u.from&&eu.from&&e<=u.to))return Amn(t,e,n,l,u,c,o)}}return Pmn(t,e,n,s,a.type,i,o)}function Amn(t,e,n,r,i,o,s){let a=r.parent,l={from:i.from,to:i.to},c=0,u=a==null?void 0:a.cursor();if(u&&(n<0?u.childBefore(r.from):u.childAfter(r.to)))do if(n<0?u.to<=r.from:u.from>=r.to){if(c==0&&o.indexOf(u.type.name)>-1&&u.from0)return null;let c={from:n<0?e-1:e,to:n>0?e+1:e},u=t.doc.iterRange(e,n>0?t.doc.length:0),f=0;for(let d=0;!u.next().done&&d<=o;){let h=u.value;n<0&&(d+=h.length);let p=e+d*n;for(let g=n>0?0:h.length-1,m=n>0?h.length:-1;g!=m;g+=n){let v=s.indexOf(h[g]);if(!(v<0||r.resolveInner(p+g,1).type!=i))if(v%2==0==n>0)f++;else{if(f==1)return{start:c,end:{from:p+g,to:p+g+1},matched:v>>1==l>>1};f--}}n>0&&(d+=h.length)}return u.done?{start:c,matched:!1}:null}const Mmn=Object.create(null),pwe=[El.none],gwe=[],mwe=Object.create(null),Rmn=Object.create(null);for(let[t,e]of[["variable","variableName"],["variable-2","variableName.special"],["string-2","string.special"],["def","variableName.definition"],["tag","tagName"],["attribute","attributeName"],["type","typeName"],["builtin","variableName.standard"],["qualifier","modifier"],["error","invalid"],["header","heading"],["property","propertyName"]])Rmn[t]=Dmn(Mmn,e);function b7(t,e){gwe.indexOf(t)>-1||(gwe.push(t),console.warn(e))}function Dmn(t,e){let n=[];for(let a of e.split(" ")){let l=[];for(let c of a.split(".")){let u=t[c]||Ee[c];u?typeof u=="function"?l.length?l=l.map(u):b7(c,`Modifier ${c} used at start of tag`):l.length?b7(c,`Tag ${c} used as modifier`):l=Array.isArray(u)?u:[u]:b7(c,`Unknown highlighting tag ${c}`)}for(let c of l)n.push(c)}if(!n.length)return 0;let r=e.replace(/ /g,"_"),i=r+" "+n.map(a=>a.id),o=mwe[i];if(o)return o.id;let s=mwe[i]=El.define({id:pwe.length,name:r,props:[Xle({[r]:n})]});return pwe.push(s),s.id}si.RTL,si.LTR;const Imn=t=>{let{state:e}=t,n=e.doc.lineAt(e.selection.main.from),r=ece(t.state,n.from);return r.line?Lmn(t):r.block?Fmn(t):!1};function Jle(t,e){return({state:n,dispatch:r})=>{if(n.readOnly)return!1;let i=t(e,n);return i?(r(n.update(i)),!0):!1}}const Lmn=Jle(jmn,0),$mn=Jle(W7e,0),Fmn=Jle((t,e)=>W7e(t,e,zmn(e)),0);function ece(t,e){let n=t.languageDataAt("commentTokens",e);return n.length?n[0]:{}}const E2=50;function Nmn(t,{open:e,close:n},r,i){let o=t.sliceDoc(r-E2,r),s=t.sliceDoc(i,i+E2),a=/\s*$/.exec(o)[0].length,l=/^\s*/.exec(s)[0].length,c=o.length-a;if(o.slice(c-e.length,c)==e&&s.slice(l,l+n.length)==n)return{open:{pos:r-a,margin:a&&1},close:{pos:i+l,margin:l&&1}};let u,f;i-r<=2*E2?u=f=t.sliceDoc(r,i):(u=t.sliceDoc(r,r+E2),f=t.sliceDoc(i-E2,i));let d=/^\s*/.exec(u)[0].length,h=/\s*$/.exec(f)[0].length,p=f.length-h-n.length;return u.slice(d,d+e.length)==e&&f.slice(p,p+n.length)==n?{open:{pos:r+d+e.length,margin:/\s/.test(u.charAt(d+e.length))?1:0},close:{pos:i-h-n.length,margin:/\s/.test(f.charAt(p-1))?1:0}}:null}function zmn(t){let e=[];for(let n of t.selection.ranges){let r=t.doc.lineAt(n.from),i=n.to<=r.to?r:t.doc.lineAt(n.to),o=e.length-1;o>=0&&e[o].to>r.from?e[o].to=i.to:e.push({from:r.from+/^\s*/.exec(r.text)[0].length,to:i.to})}return e}function W7e(t,e,n=e.selection.ranges){let r=n.map(o=>ece(e,o.from).block);if(!r.every(o=>o))return null;let i=n.map((o,s)=>Nmn(e,r[s],o.from,o.to));if(t!=2&&!i.every(o=>o))return{changes:e.changes(n.map((o,s)=>i[s]?[]:[{from:o.from,insert:r[s].open+" "},{from:o.to,insert:" "+r[s].close}]))};if(t!=1&&i.some(o=>o)){let o=[];for(let s=0,a;si&&(o==s||s>f.from)){i=f.from;let d=/^\s*/.exec(f.text)[0].length,h=d==f.length,p=f.text.slice(d,d+c.length)==c?d:-1;do.comment<0&&(!o.empty||o.single))){let o=[];for(let{line:a,token:l,indent:c,empty:u,single:f}of r)(f||!u)&&o.push({from:a.from+c,insert:l+" "});let s=e.changes(o);return{changes:s,selection:e.selection.map(s,1)}}else if(t!=1&&r.some(o=>o.comment>=0)){let o=[];for(let{line:s,comment:a,token:l}of r)if(a>=0){let c=s.from+a,u=c+l.length;s.text[u-s.from]==" "&&u++,o.push({from:c,to:u})}return{changes:o}}return null}const AK=Qh.define(),Bmn=Qh.define(),Umn=_t.define(),V7e=_t.define({combine(t){return Kh(t,{minDepth:100,newGroupDelay:500,joinToEvent:(e,n)=>n},{minDepth:Math.max,newGroupDelay:Math.min,joinToEvent:(e,n)=>(r,i)=>e(r,i)||n(r,i)})}}),G7e=Qo.define({create(){return eh.empty},update(t,e){let n=e.state.facet(V7e),r=e.annotation(AK);if(r){let l=al.fromTransaction(e,r.selection),c=r.side,u=c==0?t.undone:t.done;return l?u=dz(u,u.length,n.minDepth,l):u=X7e(u,e.startState.selection),new eh(c==0?r.rest:u,c==0?u:r.rest)}let i=e.annotation(Bmn);if((i=="full"||i=="before")&&(t=t.isolate()),e.annotation(ao.addToHistory)===!1)return e.changes.empty?t:t.addMapping(e.changes.desc);let o=al.fromTransaction(e),s=e.annotation(ao.time),a=e.annotation(ao.userEvent);return o?t=t.addChanges(o,s,a,n,e):e.selection&&(t=t.addSelection(e.startState.selection,s,a,n.newGroupDelay)),(i=="full"||i=="after")&&(t=t.isolate()),t},toJSON(t){return{done:t.done.map(e=>e.toJSON()),undone:t.undone.map(e=>e.toJSON())}},fromJSON(t){return new eh(t.done.map(al.fromJSON),t.undone.map(al.fromJSON))}});function Wmn(t={}){return[G7e,V7e.of(t),mt.domEventHandlers({beforeinput(e,n){let r=e.inputType=="historyUndo"?H7e:e.inputType=="historyRedo"?PK:null;return r?(e.preventDefault(),r(n)):!1}})]}function RU(t,e){return function({state:n,dispatch:r}){if(!e&&n.readOnly)return!1;let i=n.field(G7e,!1);if(!i)return!1;let o=i.pop(t,n,e);return o?(r(o),!0):!1}}const H7e=RU(0,!1),PK=RU(1,!1),Vmn=RU(0,!0),Gmn=RU(1,!0);class al{constructor(e,n,r,i,o){this.changes=e,this.effects=n,this.mapped=r,this.startSelection=i,this.selectionsAfter=o}setSelAfter(e){return new al(this.changes,this.effects,this.mapped,this.startSelection,e)}toJSON(){var e,n,r;return{changes:(e=this.changes)===null||e===void 0?void 0:e.toJSON(),mapped:(n=this.mapped)===null||n===void 0?void 0:n.toJSON(),startSelection:(r=this.startSelection)===null||r===void 0?void 0:r.toJSON(),selectionsAfter:this.selectionsAfter.map(i=>i.toJSON())}}static fromJSON(e){return new al(e.changes&&mo.fromJSON(e.changes),[],e.mapped&&yh.fromJSON(e.mapped),e.startSelection&&Ve.fromJSON(e.startSelection),e.selectionsAfter.map(Ve.fromJSON))}static fromTransaction(e,n){let r=cu;for(let i of e.startState.facet(Umn)){let o=i(e);o.length&&(r=r.concat(o))}return!r.length&&e.changes.empty?null:new al(e.changes.invert(e.startState.doc),r,void 0,n||e.startState.selection,cu)}static selection(e){return new al(void 0,cu,void 0,void 0,e)}}function dz(t,e,n,r){let i=e+1>n+20?e-n-1:0,o=t.slice(i,e);return o.push(r),o}function Hmn(t,e){let n=[],r=!1;return t.iterChangedRanges((i,o)=>n.push(i,o)),e.iterChangedRanges((i,o,s,a)=>{for(let l=0;l=c&&s<=u&&(r=!0)}}),r}function qmn(t,e){return t.ranges.length==e.ranges.length&&t.ranges.filter((n,r)=>n.empty!=e.ranges[r].empty).length===0}function q7e(t,e){return t.length?e.length?t.concat(e):t:e}const cu=[],Xmn=200;function X7e(t,e){if(t.length){let n=t[t.length-1],r=n.selectionsAfter.slice(Math.max(0,n.selectionsAfter.length-Xmn));return r.length&&r[r.length-1].eq(e)?t:(r.push(e),dz(t,t.length-1,1e9,n.setSelAfter(r)))}else return[al.selection([e])]}function Ymn(t){let e=t[t.length-1],n=t.slice();return n[t.length-1]=e.setSelAfter(e.selectionsAfter.slice(0,e.selectionsAfter.length-1)),n}function w7(t,e){if(!t.length)return t;let n=t.length,r=cu;for(;n;){let i=Qmn(t[n-1],e,r);if(i.changes&&!i.changes.empty||i.effects.length){let o=t.slice(0,n);return o[n-1]=i,o}else e=i.mapped,n--,r=i.selectionsAfter}return r.length?[al.selection(r)]:cu}function Qmn(t,e,n){let r=q7e(t.selectionsAfter.length?t.selectionsAfter.map(a=>a.map(e)):cu,n);if(!t.changes)return al.selection(r);let i=t.changes.map(e),o=e.mapDesc(t.changes,!0),s=t.mapped?t.mapped.composeDesc(o):o;return new al(i,rn.mapEffects(t.effects,e),s,t.startSelection.map(o),r)}const Kmn=/^(input\.type|delete)($|\.)/;class eh{constructor(e,n,r=0,i=void 0){this.done=e,this.undone=n,this.prevTime=r,this.prevUserEvent=i}isolate(){return this.prevTime?new eh(this.done,this.undone):this}addChanges(e,n,r,i,o){let s=this.done,a=s[s.length-1];return a&&a.changes&&!a.changes.empty&&e.changes&&(!r||Kmn.test(r))&&(!a.selectionsAfter.length&&n-this.prevTime0&&n-this.prevTimen.empty?t.moveByChar(n,e):DU(n,e))}function ia(t){return t.textDirectionAt(t.state.selection.main.head)==si.LTR}const Q7e=t=>Y7e(t,!ia(t)),K7e=t=>Y7e(t,ia(t));function Z7e(t,e){return cd(t,n=>n.empty?t.moveByGroup(n,e):DU(n,e))}const Jmn=t=>Z7e(t,!ia(t)),evn=t=>Z7e(t,ia(t));function tvn(t,e,n){if(e.type.prop(n))return!0;let r=e.to-e.from;return r&&(r>2||/[^\s,.;:]/.test(t.sliceDoc(e.from,e.to)))||e.firstChild}function IU(t,e,n){let r=Vo(t).resolveInner(e.head),i=n?_n.closedBy:_n.openedBy;for(let l=e.head;;){let c=n?r.childAfter(l):r.childBefore(l);if(!c)break;tvn(t,c,i)?r=c:l=n?c.to:c.from}let o=r.type.prop(i),s,a;return o&&(s=n?Jd(t,r.from,1):Jd(t,r.to,-1))&&s.matched?a=n?s.end.to:s.end.from:a=n?r.to:r.from,Ve.cursor(a,n?-1:1)}const nvn=t=>cd(t,e=>IU(t.state,e,!ia(t))),rvn=t=>cd(t,e=>IU(t.state,e,ia(t)));function J7e(t,e){return cd(t,n=>{if(!n.empty)return DU(n,e);let r=t.moveVertically(n,e);return r.head!=n.head?r:t.moveToLineBoundary(n,e)})}const eGe=t=>J7e(t,!1),tGe=t=>J7e(t,!0);function nGe(t){let e=t.scrollDOM.clientHeights.empty?t.moveVertically(s,e,n.height):DU(s,e));if(i.eq(r.selection))return!1;let o;if(n.selfScroll){let s=t.coordsAtPos(r.selection.main.head),a=t.scrollDOM.getBoundingClientRect(),l=a.top+n.marginTop,c=a.bottom-n.marginBottom;s&&s.top>l&&s.bottomrGe(t,!1),MK=t=>rGe(t,!0);function n0(t,e,n){let r=t.lineBlockAt(e.head),i=t.moveToLineBoundary(e,n);if(i.head==e.head&&i.head!=(n?r.to:r.from)&&(i=t.moveToLineBoundary(e,n,!1)),!n&&i.head==r.from&&r.length){let o=/^\s*/.exec(t.state.sliceDoc(r.from,Math.min(r.from+100,r.to)))[0].length;o&&e.head!=r.from+o&&(i=Ve.cursor(r.from+o))}return i}const ivn=t=>cd(t,e=>n0(t,e,!0)),ovn=t=>cd(t,e=>n0(t,e,!1)),svn=t=>cd(t,e=>n0(t,e,!ia(t))),avn=t=>cd(t,e=>n0(t,e,ia(t))),lvn=t=>cd(t,e=>Ve.cursor(t.lineBlockAt(e.head).from,1)),cvn=t=>cd(t,e=>Ve.cursor(t.lineBlockAt(e.head).to,-1));function uvn(t,e,n){let r=!1,i=YO(t.selection,o=>{let s=Jd(t,o.head,-1)||Jd(t,o.head,1)||o.head>0&&Jd(t,o.head-1,1)||o.headuvn(t,e);function Gu(t,e){let n=YO(t.state.selection,r=>{let i=e(r);return Ve.range(r.anchor,i.head,i.goalColumn,i.bidiLevel||void 0)});return n.eq(t.state.selection)?!1:(t.dispatch(Jh(t.state,n)),!0)}function iGe(t,e){return Gu(t,n=>t.moveByChar(n,e))}const oGe=t=>iGe(t,!ia(t)),sGe=t=>iGe(t,ia(t));function aGe(t,e){return Gu(t,n=>t.moveByGroup(n,e))}const dvn=t=>aGe(t,!ia(t)),hvn=t=>aGe(t,ia(t)),pvn=t=>Gu(t,e=>IU(t.state,e,!ia(t))),gvn=t=>Gu(t,e=>IU(t.state,e,ia(t)));function lGe(t,e){return Gu(t,n=>t.moveVertically(n,e))}const cGe=t=>lGe(t,!1),uGe=t=>lGe(t,!0);function fGe(t,e){return Gu(t,n=>t.moveVertically(n,e,nGe(t).height))}const ywe=t=>fGe(t,!1),xwe=t=>fGe(t,!0),mvn=t=>Gu(t,e=>n0(t,e,!0)),vvn=t=>Gu(t,e=>n0(t,e,!1)),yvn=t=>Gu(t,e=>n0(t,e,!ia(t))),xvn=t=>Gu(t,e=>n0(t,e,ia(t))),bvn=t=>Gu(t,e=>Ve.cursor(t.lineBlockAt(e.head).from)),wvn=t=>Gu(t,e=>Ve.cursor(t.lineBlockAt(e.head).to)),bwe=({state:t,dispatch:e})=>(e(Jh(t,{anchor:0})),!0),wwe=({state:t,dispatch:e})=>(e(Jh(t,{anchor:t.doc.length})),!0),_we=({state:t,dispatch:e})=>(e(Jh(t,{anchor:t.selection.main.anchor,head:0})),!0),Swe=({state:t,dispatch:e})=>(e(Jh(t,{anchor:t.selection.main.anchor,head:t.doc.length})),!0),_vn=({state:t,dispatch:e})=>(e(t.update({selection:{anchor:0,head:t.doc.length},userEvent:"select"})),!0),Svn=({state:t,dispatch:e})=>{let n=LU(t).map(({from:r,to:i})=>Ve.range(r,Math.min(i+1,t.doc.length)));return e(t.update({selection:Ve.create(n),userEvent:"select"})),!0},Cvn=({state:t,dispatch:e})=>{let n=YO(t.selection,r=>{var i;let o=Vo(t).resolveStack(r.from,1);for(let s=o;s;s=s.next){let{node:a}=s;if((a.from=r.to||a.to>r.to&&a.from<=r.from)&&(!((i=a.parent)===null||i===void 0)&&i.parent))return Ve.range(a.to,a.from)}return r});return e(Jh(t,n)),!0},Ovn=({state:t,dispatch:e})=>{let n=t.selection,r=null;return n.ranges.length>1?r=Ve.create([n.main]):n.main.empty||(r=Ve.create([Ve.cursor(n.main.head)])),r?(e(Jh(t,r)),!0):!1};function fD(t,e){if(t.state.readOnly)return!1;let n="delete.selection",{state:r}=t,i=r.changeByRange(o=>{let{from:s,to:a}=o;if(s==a){let l=e(o);ls&&(n="delete.forward",l=zL(t,l,!0)),s=Math.min(s,l),a=Math.max(a,l)}else s=zL(t,s,!1),a=zL(t,a,!0);return s==a?{range:o}:{changes:{from:s,to:a},range:Ve.cursor(s,si(t)))r.between(e,e,(i,o)=>{ie&&(e=n?o:i)});return e}const dGe=(t,e,n)=>fD(t,r=>{let i=r.from,{state:o}=t,s=o.doc.lineAt(i),a,l;if(n&&!e&&i>s.from&&idGe(t,!1,!0),hGe=t=>dGe(t,!0,!1),pGe=(t,e)=>fD(t,n=>{let r=n.head,{state:i}=t,o=i.doc.lineAt(r),s=i.charCategorizer(r);for(let a=null;;){if(r==(e?o.to:o.from)){r==n.head&&o.number!=(e?i.doc.lines:1)&&(r+=e?1:-1);break}let l=gs(o.text,r-o.from,e)+o.from,c=o.text.slice(Math.min(r,l)-o.from,Math.max(r,l)-o.from),u=s(c);if(a!=null&&u!=a)break;(c!=" "||r!=n.head)&&(a=u),r=l}return r}),gGe=t=>pGe(t,!1),Evn=t=>pGe(t,!0),Tvn=t=>fD(t,e=>{let n=t.lineBlockAt(e.head).to;return e.headfD(t,e=>{let n=t.moveToLineBoundary(e,!1).head;return e.head>n?n:Math.max(0,e.head-1)}),Avn=t=>fD(t,e=>{let n=t.moveToLineBoundary(e,!0).head;return e.head{if(t.readOnly)return!1;let n=t.changeByRange(r=>({changes:{from:r.from,to:r.to,insert:ar.of(["",""])},range:Ve.cursor(r.from)}));return e(t.update(n,{scrollIntoView:!0,userEvent:"input"})),!0},Mvn=({state:t,dispatch:e})=>{if(t.readOnly)return!1;let n=t.changeByRange(r=>{if(!r.empty||r.from==0||r.from==t.doc.length)return{range:r};let i=r.from,o=t.doc.lineAt(i),s=i==o.from?i-1:gs(o.text,i-o.from,!1)+o.from,a=i==o.to?i+1:gs(o.text,i-o.from,!0)+o.from;return{changes:{from:s,to:a,insert:t.doc.slice(i,a).append(t.doc.slice(s,i))},range:Ve.cursor(a)}});return n.changes.empty?!1:(e(t.update(n,{scrollIntoView:!0,userEvent:"move.character"})),!0)};function LU(t){let e=[],n=-1;for(let r of t.selection.ranges){let i=t.doc.lineAt(r.from),o=t.doc.lineAt(r.to);if(!r.empty&&r.to==o.from&&(o=t.doc.lineAt(r.to-1)),n>=i.number){let s=e[e.length-1];s.to=o.to,s.ranges.push(r)}else e.push({from:i.from,to:o.to,ranges:[r]});n=o.number+1}return e}function mGe(t,e,n){if(t.readOnly)return!1;let r=[],i=[];for(let o of LU(t)){if(n?o.to==t.doc.length:o.from==0)continue;let s=t.doc.lineAt(n?o.to+1:o.from-1),a=s.length+1;if(n){r.push({from:o.to,to:s.to},{from:o.from,insert:s.text+t.lineBreak});for(let l of o.ranges)i.push(Ve.range(Math.min(t.doc.length,l.anchor+a),Math.min(t.doc.length,l.head+a)))}else{r.push({from:s.from,to:o.from},{from:o.to,insert:t.lineBreak+s.text});for(let l of o.ranges)i.push(Ve.range(l.anchor-a,l.head-a))}}return r.length?(e(t.update({changes:r,scrollIntoView:!0,selection:Ve.create(i,t.selection.mainIndex),userEvent:"move.line"})),!0):!1}const Rvn=({state:t,dispatch:e})=>mGe(t,e,!1),Dvn=({state:t,dispatch:e})=>mGe(t,e,!0);function vGe(t,e,n){if(t.readOnly)return!1;let r=[];for(let i of LU(t))n?r.push({from:i.from,insert:t.doc.slice(i.from,i.to)+t.lineBreak}):r.push({from:i.to,insert:t.lineBreak+t.doc.slice(i.from,i.to)});return e(t.update({changes:r,scrollIntoView:!0,userEvent:"input.copyline"})),!0}const Ivn=({state:t,dispatch:e})=>vGe(t,e,!1),Lvn=({state:t,dispatch:e})=>vGe(t,e,!0),$vn=t=>{if(t.state.readOnly)return!1;let{state:e}=t,n=e.changes(LU(e).map(({from:i,to:o})=>(i>0?i--:o{let o;if(t.lineWrapping){let s=t.lineBlockAt(i.head),a=t.coordsAtPos(i.head,i.assoc||1);a&&(o=s.bottom+t.documentTop-a.bottom+t.defaultLineHeight/2)}return t.moveVertically(i,!0,o)}).map(n);return t.dispatch({changes:n,selection:r,scrollIntoView:!0,userEvent:"delete.line"}),!0};function Fvn(t,e){if(/\(\)|\[\]|\{\}/.test(t.sliceDoc(e-1,e+1)))return{from:e,to:e};let n=Vo(t).resolveInner(e),r=n.childBefore(e),i=n.childAfter(e),o;return r&&i&&r.to<=e&&i.from>=e&&(o=r.type.prop(_n.closedBy))&&o.indexOf(i.name)>-1&&t.doc.lineAt(r.to).from==t.doc.lineAt(i.from).from&&!/\S/.test(t.sliceDoc(r.to,i.from))?{from:r.to,to:i.from}:null}const Nvn=yGe(!1),zvn=yGe(!0);function yGe(t){return({state:e,dispatch:n})=>{if(e.readOnly)return!1;let r=e.changeByRange(i=>{let{from:o,to:s}=i,a=e.doc.lineAt(o),l=!t&&o==s&&Fvn(e,o);t&&(o=s=(s<=a.to?a:e.doc.lineAt(s)).to);let c=new PU(e,{simulateBreak:o,simulateDoubleBreak:!!l}),u=Yle(c,o);for(u==null&&(u=XO(/^\s*/.exec(e.doc.lineAt(o).text)[0],e.tabSize));sa.from&&o{let i=[];for(let s=r.from;s<=r.to;){let a=t.doc.lineAt(s);a.number>n&&(r.empty||r.to>a.from)&&(e(a,i,r),n=a.number),s=a.to+1}let o=t.changes(i);return{changes:i,range:Ve.range(o.mapPos(r.anchor,1),o.mapPos(r.head,1))}})}const jvn=({state:t,dispatch:e})=>{if(t.readOnly)return!1;let n=Object.create(null),r=new PU(t,{overrideIndentation:o=>{let s=n[o];return s??-1}}),i=tce(t,(o,s,a)=>{let l=Yle(r,o.from);if(l==null)return;/\S/.test(o.text)||(l=0);let c=/^\s*/.exec(o.text)[0],u=vP(t,l);(c!=u||a.fromt.readOnly?!1:(e(t.update(tce(t,(n,r)=>{r.push({from:n.from,insert:t.facet(lD)})}),{userEvent:"input.indent"})),!0),bGe=({state:t,dispatch:e})=>t.readOnly?!1:(e(t.update(tce(t,(n,r)=>{let i=/^\s*/.exec(n.text)[0];if(!i)return;let o=XO(i,t.tabSize),s=0,a=vP(t,Math.max(0,o-cz(t)));for(;s(t.setTabFocusMode(),!0),Uvn=[{key:"Ctrl-b",run:Q7e,shift:oGe,preventDefault:!0},{key:"Ctrl-f",run:K7e,shift:sGe},{key:"Ctrl-p",run:eGe,shift:cGe},{key:"Ctrl-n",run:tGe,shift:uGe},{key:"Ctrl-a",run:lvn,shift:bvn},{key:"Ctrl-e",run:cvn,shift:wvn},{key:"Ctrl-d",run:hGe},{key:"Ctrl-h",run:RK},{key:"Ctrl-k",run:Tvn},{key:"Ctrl-Alt-h",run:gGe},{key:"Ctrl-o",run:Pvn},{key:"Ctrl-t",run:Mvn},{key:"Ctrl-v",run:MK}],Wvn=[{key:"ArrowLeft",run:Q7e,shift:oGe,preventDefault:!0},{key:"Mod-ArrowLeft",mac:"Alt-ArrowLeft",run:Jmn,shift:dvn,preventDefault:!0},{mac:"Cmd-ArrowLeft",run:svn,shift:yvn,preventDefault:!0},{key:"ArrowRight",run:K7e,shift:sGe,preventDefault:!0},{key:"Mod-ArrowRight",mac:"Alt-ArrowRight",run:evn,shift:hvn,preventDefault:!0},{mac:"Cmd-ArrowRight",run:avn,shift:xvn,preventDefault:!0},{key:"ArrowUp",run:eGe,shift:cGe,preventDefault:!0},{mac:"Cmd-ArrowUp",run:bwe,shift:_we},{mac:"Ctrl-ArrowUp",run:vwe,shift:ywe},{key:"ArrowDown",run:tGe,shift:uGe,preventDefault:!0},{mac:"Cmd-ArrowDown",run:wwe,shift:Swe},{mac:"Ctrl-ArrowDown",run:MK,shift:xwe},{key:"PageUp",run:vwe,shift:ywe},{key:"PageDown",run:MK,shift:xwe},{key:"Home",run:ovn,shift:vvn,preventDefault:!0},{key:"Mod-Home",run:bwe,shift:_we},{key:"End",run:ivn,shift:mvn,preventDefault:!0},{key:"Mod-End",run:wwe,shift:Swe},{key:"Enter",run:Nvn},{key:"Mod-a",run:_vn},{key:"Backspace",run:RK,shift:RK},{key:"Delete",run:hGe},{key:"Mod-Backspace",mac:"Alt-Backspace",run:gGe},{key:"Mod-Delete",mac:"Alt-Delete",run:Evn},{mac:"Mod-Backspace",run:kvn},{mac:"Mod-Delete",run:Avn}].concat(Uvn.map(t=>({mac:t.key,run:t.run,shift:t.shift}))),Vvn=[{key:"Alt-ArrowLeft",mac:"Ctrl-ArrowLeft",run:nvn,shift:pvn},{key:"Alt-ArrowRight",mac:"Ctrl-ArrowRight",run:rvn,shift:gvn},{key:"Alt-ArrowUp",run:Rvn},{key:"Shift-Alt-ArrowUp",run:Ivn},{key:"Alt-ArrowDown",run:Dvn},{key:"Shift-Alt-ArrowDown",run:Lvn},{key:"Escape",run:Ovn},{key:"Mod-Enter",run:zvn},{key:"Alt-l",mac:"Ctrl-l",run:Svn},{key:"Mod-i",run:Cvn,preventDefault:!0},{key:"Mod-[",run:bGe},{key:"Mod-]",run:xGe},{key:"Mod-Alt-\\",run:jvn},{key:"Shift-Mod-k",run:$vn},{key:"Shift-Mod-\\",run:fvn},{key:"Mod-/",run:Imn},{key:"Alt-A",run:$mn},{key:"Ctrl-m",mac:"Shift-Alt-m",run:Bvn}].concat(Wvn),Gvn={key:"Tab",run:xGe,shift:bGe};function Nr(){var t=arguments[0];typeof t=="string"&&(t=document.createElement(t));var e=1,n=arguments[1];if(n&&typeof n=="object"&&n.nodeType==null&&!Array.isArray(n)){for(var r in n)if(Object.prototype.hasOwnProperty.call(n,r)){var i=n[r];typeof i=="string"?t.setAttribute(r,i):i!=null&&(t[r]=i)}e++}for(;et.normalize("NFKD"):t=>t;class wC{constructor(e,n,r=0,i=e.length,o,s){this.test=s,this.value={from:0,to:0},this.done=!1,this.matches=[],this.buffer="",this.bufferPos=0,this.iter=e.iterRange(r,i),this.bufferStart=r,this.normalize=o?a=>o(Cwe(a)):Cwe,this.query=this.normalize(n)}peek(){if(this.bufferPos==this.buffer.length){if(this.bufferStart+=this.buffer.length,this.iter.next(),this.iter.done)return-1;this.bufferPos=0,this.buffer=this.iter.value}return ss(this.buffer,this.bufferPos)}next(){for(;this.matches.length;)this.matches.pop();return this.nextOverlapping()}nextOverlapping(){for(;;){let e=this.peek();if(e<0)return this.done=!0,this;let n=Mle(e),r=this.bufferStart+this.bufferPos;this.bufferPos+=Jc(e);let i=this.normalize(n);for(let o=0,s=r;;o++){let a=i.charCodeAt(o),l=this.match(a,s,this.bufferPos+this.bufferStart);if(o==i.length-1){if(l)return this.value=l,this;break}s==r&&othis.to&&(this.curLine=this.curLine.slice(0,this.to-this.curLineStart)),this.iter.next())}nextLine(){this.curLineStart=this.curLineStart+this.curLine.length+1,this.curLineStart>this.to?this.curLine="":this.getLine(0)}next(){for(let e=this.matchPos-this.curLineStart;;){this.re.lastIndex=e;let n=this.matchPos<=this.to&&this.re.exec(this.curLine);if(n){let r=this.curLineStart+n.index,i=r+n[0].length;if(this.matchPos=hz(this.text,i+(r==i?1:0)),r==this.curLineStart+this.curLine.length&&this.nextLine(),(rthis.value.to)&&(!this.test||this.test(r,i,n)))return this.value={from:r,to:i,match:n},this;e=this.matchPos-this.curLineStart}else if(this.curLineStart+this.curLine.length=r||i.to<=n){let a=new J_(n,e.sliceString(n,r));return _7.set(e,a),a}if(i.from==n&&i.to==r)return i;let{text:o,from:s}=i;return s>n&&(o=e.sliceString(n,s)+o,s=n),i.to=this.to?this.to:this.text.lineAt(e).to}next(){for(;;){let e=this.re.lastIndex=this.matchPos-this.flat.from,n=this.re.exec(this.flat.text);if(n&&!n[0]&&n.index==e&&(this.re.lastIndex=e+1,n=this.re.exec(this.flat.text)),n){let r=this.flat.from+n.index,i=r+n[0].length;if((this.flat.to>=this.to||n.index+n[0].length<=this.flat.text.length-10)&&(!this.test||this.test(r,i,n)))return this.value={from:r,to:i,match:n},this.matchPos=hz(this.text,i+(r==i?1:0)),this}if(this.flat.to==this.to)return this.done=!0,this;this.flat=J_.get(this.text,this.flat.from,this.chunkEnd(this.flat.from+this.flat.text.length*2))}}}typeof Symbol<"u"&&(SGe.prototype[Symbol.iterator]=CGe.prototype[Symbol.iterator]=function(){return this});function Hvn(t){try{return new RegExp(t,nce),!0}catch{return!1}}function hz(t,e){if(e>=t.length)return e;let n=t.lineAt(e),r;for(;e=56320&&r<57344;)e++;return e}function DK(t){let e=String(t.state.doc.lineAt(t.state.selection.main.head).number),n=Nr("input",{class:"cm-textfield",name:"line",value:e}),r=Nr("form",{class:"cm-gotoLine",onkeydown:o=>{o.keyCode==27?(o.preventDefault(),t.dispatch({effects:pz.of(!1)}),t.focus()):o.keyCode==13&&(o.preventDefault(),i())},onsubmit:o=>{o.preventDefault(),i()}},Nr("label",t.state.phrase("Go to line"),": ",n)," ",Nr("button",{class:"cm-button",type:"submit"},t.state.phrase("go")));function i(){let o=/^([+-])?(\d+)?(:\d+)?(%)?$/.exec(n.value);if(!o)return;let{state:s}=t,a=s.doc.lineAt(s.selection.main.head),[,l,c,u,f]=o,d=u?+u.slice(1):0,h=c?+c:a.number;if(c&&f){let m=h/100;l&&(m=m*(l=="-"?-1:1)+a.number/s.doc.lines),h=Math.round(s.doc.lines*m)}else c&&l&&(h=h*(l=="-"?-1:1)+a.number);let p=s.doc.line(Math.max(1,Math.min(s.doc.lines,h))),g=Ve.cursor(p.from+Math.max(0,Math.min(d,p.length)));t.dispatch({effects:[pz.of(!1),mt.scrollIntoView(g.from,{y:"center"})],selection:g}),t.focus()}return{dom:r}}const pz=rn.define(),Owe=Qo.define({create(){return!0},update(t,e){for(let n of e.effects)n.is(pz)&&(t=n.value);return t},provide:t=>pP.from(t,e=>e?DK:null)}),qvn=t=>{let e=hP(t,DK);if(!e){let n=[pz.of(!0)];t.state.field(Owe,!1)==null&&n.push(rn.appendConfig.of([Owe,Xvn])),t.dispatch({effects:n}),e=hP(t,DK)}return e&&e.dom.querySelector("input").select(),!0},Xvn=mt.baseTheme({".cm-panel.cm-gotoLine":{padding:"2px 6px 4px","& label":{fontSize:"80%"}}}),Yvn={highlightWordAroundCursor:!1,minSelectionLength:1,maxMatches:100,wholeWords:!1},Qvn=_t.define({combine(t){return Kh(t,Yvn,{highlightWordAroundCursor:(e,n)=>e||n,minSelectionLength:Math.min,maxMatches:Math.min})}});function Kvn(t){return[nyn,tyn]}const Zvn=Dt.mark({class:"cm-selectionMatch"}),Jvn=Dt.mark({class:"cm-selectionMatch cm-selectionMatch-main"});function Ewe(t,e,n,r){return(n==0||t(e.sliceDoc(n-1,n))!=gi.Word)&&(r==e.doc.length||t(e.sliceDoc(r,r+1))!=gi.Word)}function eyn(t,e,n,r){return t(e.sliceDoc(n,n+1))==gi.Word&&t(e.sliceDoc(r-1,r))==gi.Word}const tyn=Yi.fromClass(class{constructor(t){this.decorations=this.getDeco(t)}update(t){(t.selectionSet||t.docChanged||t.viewportChanged)&&(this.decorations=this.getDeco(t.view))}getDeco(t){let e=t.state.facet(Qvn),{state:n}=t,r=n.selection;if(r.ranges.length>1)return Dt.none;let i=r.main,o,s=null;if(i.empty){if(!e.highlightWordAroundCursor)return Dt.none;let l=n.wordAt(i.head);if(!l)return Dt.none;s=n.charCategorizer(i.head),o=n.sliceDoc(l.from,l.to)}else{let l=i.to-i.from;if(l200)return Dt.none;if(e.wholeWords){if(o=n.sliceDoc(i.from,i.to),s=n.charCategorizer(i.head),!(Ewe(s,n,i.from,i.to)&&eyn(s,n,i.from,i.to)))return Dt.none}else if(o=n.sliceDoc(i.from,i.to),!o)return Dt.none}let a=[];for(let l of t.visibleRanges){let c=new wC(n.doc,o,l.from,l.to);for(;!c.next().done;){let{from:u,to:f}=c.value;if((!s||Ewe(s,n,u,f))&&(i.empty&&u<=i.from&&f>=i.to?a.push(Jvn.range(u,f)):(u>=i.to||f<=i.from)&&a.push(Zvn.range(u,f)),a.length>e.maxMatches))return Dt.none}}return Dt.set(a)}},{decorations:t=>t.decorations}),nyn=mt.baseTheme({".cm-selectionMatch":{backgroundColor:"#99ff7780"},".cm-searchMatch .cm-selectionMatch":{backgroundColor:"transparent"}}),ryn=({state:t,dispatch:e})=>{let{selection:n}=t,r=Ve.create(n.ranges.map(i=>t.wordAt(i.head)||Ve.cursor(i.head)),n.mainIndex);return r.eq(n)?!1:(e(t.update({selection:r})),!0)};function iyn(t,e){let{main:n,ranges:r}=t.selection,i=t.wordAt(n.head),o=i&&i.from==n.from&&i.to==n.to;for(let s=!1,a=new wC(t.doc,e,r[r.length-1].to);;)if(a.next(),a.done){if(s)return null;a=new wC(t.doc,e,0,Math.max(0,r[r.length-1].from-1)),s=!0}else{if(s&&r.some(l=>l.from==a.value.from))continue;if(o){let l=t.wordAt(a.value.from);if(!l||l.from!=a.value.from||l.to!=a.value.to)continue}return a.value}}const oyn=({state:t,dispatch:e})=>{let{ranges:n}=t.selection;if(n.some(o=>o.from===o.to))return ryn({state:t,dispatch:e});let r=t.sliceDoc(n[0].from,n[0].to);if(t.selection.ranges.some(o=>t.sliceDoc(o.from,o.to)!=r))return!1;let i=iyn(t,r);return i?(e(t.update({selection:t.selection.addRange(Ve.range(i.from,i.to),!1),effects:mt.scrollIntoView(i.to)})),!0):!1},QO=_t.define({combine(t){return Kh(t,{top:!1,caseSensitive:!1,literal:!1,regexp:!1,wholeWord:!1,createPanel:e=>new vyn(e),scrollToMatch:e=>mt.scrollIntoView(e)})}});class OGe{constructor(e){this.search=e.search,this.caseSensitive=!!e.caseSensitive,this.literal=!!e.literal,this.regexp=!!e.regexp,this.replace=e.replace||"",this.valid=!!this.search&&(!this.regexp||Hvn(this.search)),this.unquoted=this.unquote(this.search),this.wholeWord=!!e.wholeWord}unquote(e){return this.literal?e:e.replace(/\\([nrt\\])/g,(n,r)=>r=="n"?` +`:r=="r"?"\r":r=="t"?" ":"\\")}eq(e){return this.search==e.search&&this.replace==e.replace&&this.caseSensitive==e.caseSensitive&&this.regexp==e.regexp&&this.wholeWord==e.wholeWord}create(){return this.regexp?new cyn(this):new ayn(this)}getCursor(e,n=0,r){let i=e.doc?e:In.create({doc:e});return r==null&&(r=i.doc.length),this.regexp?zw(this,i,n,r):Nw(this,i,n,r)}}class EGe{constructor(e){this.spec=e}}function Nw(t,e,n,r){return new wC(e.doc,t.unquoted,n,r,t.caseSensitive?void 0:i=>i.toLowerCase(),t.wholeWord?syn(e.doc,e.charCategorizer(e.selection.main.head)):void 0)}function syn(t,e){return(n,r,i,o)=>((o>n||o+i.length=n)return null;i.push(r.value)}return i}highlight(e,n,r,i){let o=Nw(this.spec,e,Math.max(0,n-this.spec.unquoted.length),Math.min(r+this.spec.unquoted.length,e.doc.length));for(;!o.next().done;)i(o.value.from,o.value.to)}}function zw(t,e,n,r){return new SGe(e.doc,t.search,{ignoreCase:!t.caseSensitive,test:t.wholeWord?lyn(e.charCategorizer(e.selection.main.head)):void 0},n,r)}function gz(t,e){return t.slice(gs(t,e,!1),e)}function mz(t,e){return t.slice(e,gs(t,e))}function lyn(t){return(e,n,r)=>!r[0].length||(t(gz(r.input,r.index))!=gi.Word||t(mz(r.input,r.index))!=gi.Word)&&(t(mz(r.input,r.index+r[0].length))!=gi.Word||t(gz(r.input,r.index+r[0].length))!=gi.Word)}class cyn extends EGe{nextMatch(e,n,r){let i=zw(this.spec,e,r,e.doc.length).next();return i.done&&(i=zw(this.spec,e,0,n).next()),i.done?null:i.value}prevMatchInRange(e,n,r){for(let i=1;;i++){let o=Math.max(n,r-i*1e4),s=zw(this.spec,e,o,r),a=null;for(;!s.next().done;)a=s.value;if(a&&(o==n||a.from>o+10))return a;if(o==n)return null}}prevMatch(e,n,r){return this.prevMatchInRange(e,0,n)||this.prevMatchInRange(e,r,e.doc.length)}getReplacement(e){return this.spec.unquote(this.spec.replace).replace(/\$([$&\d+])/g,(n,r)=>r=="$"?"$":r=="&"?e.match[0]:r!="0"&&+r=n)return null;i.push(r.value)}return i}highlight(e,n,r,i){let o=zw(this.spec,e,Math.max(0,n-250),Math.min(r+250,e.doc.length));for(;!o.next().done;)i(o.value.from,o.value.to)}}const yP=rn.define(),rce=rn.define(),Vv=Qo.define({create(t){return new S7(IK(t).create(),null)},update(t,e){for(let n of e.effects)n.is(yP)?t=new S7(n.value.create(),t.panel):n.is(rce)&&(t=new S7(t.query,n.value?ice:null));return t},provide:t=>pP.from(t,e=>e.panel)});class S7{constructor(e,n){this.query=e,this.panel=n}}const uyn=Dt.mark({class:"cm-searchMatch"}),fyn=Dt.mark({class:"cm-searchMatch cm-searchMatch-selected"}),dyn=Yi.fromClass(class{constructor(t){this.view=t,this.decorations=this.highlight(t.state.field(Vv))}update(t){let e=t.state.field(Vv);(e!=t.startState.field(Vv)||t.docChanged||t.selectionSet||t.viewportChanged)&&(this.decorations=this.highlight(e))}highlight({query:t,panel:e}){if(!e||!t.spec.valid)return Dt.none;let{view:n}=this,r=new by;for(let i=0,o=n.visibleRanges,s=o.length;io[i+1].from-2*250;)l=o[++i].to;t.highlight(n.state,a,l,(c,u)=>{let f=n.state.selection.ranges.some(d=>d.from==c&&d.to==u);r.add(c,u,f?fyn:uyn)})}return r.finish()}},{decorations:t=>t.decorations});function dD(t){return e=>{let n=e.state.field(Vv,!1);return n&&n.query.spec.valid?t(e,n):AGe(e)}}const vz=dD((t,{query:e})=>{let{to:n}=t.state.selection.main,r=e.nextMatch(t.state,n,n);if(!r)return!1;let i=Ve.single(r.from,r.to),o=t.state.facet(QO);return t.dispatch({selection:i,effects:[oce(t,r),o.scrollToMatch(i.main,t)],userEvent:"select.search"}),kGe(t),!0}),yz=dD((t,{query:e})=>{let{state:n}=t,{from:r}=n.selection.main,i=e.prevMatch(n,r,r);if(!i)return!1;let o=Ve.single(i.from,i.to),s=t.state.facet(QO);return t.dispatch({selection:o,effects:[oce(t,i),s.scrollToMatch(o.main,t)],userEvent:"select.search"}),kGe(t),!0}),hyn=dD((t,{query:e})=>{let n=e.matchAll(t.state,1e3);return!n||!n.length?!1:(t.dispatch({selection:Ve.create(n.map(r=>Ve.range(r.from,r.to))),userEvent:"select.search.matches"}),!0)}),pyn=({state:t,dispatch:e})=>{let n=t.selection;if(n.ranges.length>1||n.main.empty)return!1;let{from:r,to:i}=n.main,o=[],s=0;for(let a=new wC(t.doc,t.sliceDoc(r,i));!a.next().done;){if(o.length>1e3)return!1;a.value.from==r&&(s=o.length),o.push(Ve.range(a.value.from,a.value.to))}return e(t.update({selection:Ve.create(o,s),userEvent:"select.search.matches"})),!0},Twe=dD((t,{query:e})=>{let{state:n}=t,{from:r,to:i}=n.selection.main;if(n.readOnly)return!1;let o=e.nextMatch(n,r,r);if(!o)return!1;let s=[],a,l,c=[];if(o.from==r&&o.to==i&&(l=n.toText(e.getReplacement(o)),s.push({from:o.from,to:o.to,insert:l}),o=e.nextMatch(n,o.from,o.to),c.push(mt.announce.of(n.phrase("replaced match on line $",n.doc.lineAt(r).number)+"."))),o){let u=s.length==0||s[0].from>=o.to?0:o.to-o.from-l.length;a=Ve.single(o.from-u,o.to-u),c.push(oce(t,o)),c.push(n.facet(QO).scrollToMatch(a.main,t))}return t.dispatch({changes:s,selection:a,effects:c,userEvent:"input.replace"}),!0}),gyn=dD((t,{query:e})=>{if(t.state.readOnly)return!1;let n=e.matchAll(t.state,1e9).map(i=>{let{from:o,to:s}=i;return{from:o,to:s,insert:e.getReplacement(i)}});if(!n.length)return!1;let r=t.state.phrase("replaced $ matches",n.length)+".";return t.dispatch({changes:n,effects:mt.announce.of(r),userEvent:"input.replace.all"}),!0});function ice(t){return t.state.facet(QO).createPanel(t)}function IK(t,e){var n,r,i,o,s;let a=t.selection.main,l=a.empty||a.to>a.from+100?"":t.sliceDoc(a.from,a.to);if(e&&!l)return e;let c=t.facet(QO);return new OGe({search:((n=e==null?void 0:e.literal)!==null&&n!==void 0?n:c.literal)?l:l.replace(/\n/g,"\\n"),caseSensitive:(r=e==null?void 0:e.caseSensitive)!==null&&r!==void 0?r:c.caseSensitive,literal:(i=e==null?void 0:e.literal)!==null&&i!==void 0?i:c.literal,regexp:(o=e==null?void 0:e.regexp)!==null&&o!==void 0?o:c.regexp,wholeWord:(s=e==null?void 0:e.wholeWord)!==null&&s!==void 0?s:c.wholeWord})}function TGe(t){let e=hP(t,ice);return e&&e.dom.querySelector("[main-field]")}function kGe(t){let e=TGe(t);e&&e==t.root.activeElement&&e.select()}const AGe=t=>{let e=t.state.field(Vv,!1);if(e&&e.panel){let n=TGe(t);if(n&&n!=t.root.activeElement){let r=IK(t.state,e.query.spec);r.valid&&t.dispatch({effects:yP.of(r)}),n.focus(),n.select()}}else t.dispatch({effects:[rce.of(!0),e?yP.of(IK(t.state,e.query.spec)):rn.appendConfig.of(xyn)]});return!0},PGe=t=>{let e=t.state.field(Vv,!1);if(!e||!e.panel)return!1;let n=hP(t,ice);return n&&n.dom.contains(t.root.activeElement)&&t.focus(),t.dispatch({effects:rce.of(!1)}),!0},myn=[{key:"Mod-f",run:AGe,scope:"editor search-panel"},{key:"F3",run:vz,shift:yz,scope:"editor search-panel",preventDefault:!0},{key:"Mod-g",run:vz,shift:yz,scope:"editor search-panel",preventDefault:!0},{key:"Escape",run:PGe,scope:"editor search-panel"},{key:"Mod-Shift-l",run:pyn},{key:"Mod-Alt-g",run:qvn},{key:"Mod-d",run:oyn,preventDefault:!0}];class vyn{constructor(e){this.view=e;let n=this.query=e.state.field(Vv).query.spec;this.commit=this.commit.bind(this),this.searchField=Nr("input",{value:n.search,placeholder:Dl(e,"Find"),"aria-label":Dl(e,"Find"),class:"cm-textfield",name:"search",form:"","main-field":"true",onchange:this.commit,onkeyup:this.commit}),this.replaceField=Nr("input",{value:n.replace,placeholder:Dl(e,"Replace"),"aria-label":Dl(e,"Replace"),class:"cm-textfield",name:"replace",form:"",onchange:this.commit,onkeyup:this.commit}),this.caseField=Nr("input",{type:"checkbox",name:"case",form:"",checked:n.caseSensitive,onchange:this.commit}),this.reField=Nr("input",{type:"checkbox",name:"re",form:"",checked:n.regexp,onchange:this.commit}),this.wordField=Nr("input",{type:"checkbox",name:"word",form:"",checked:n.wholeWord,onchange:this.commit});function r(i,o,s){return Nr("button",{class:"cm-button",name:i,onclick:o,type:"button"},s)}this.dom=Nr("div",{onkeydown:i=>this.keydown(i),class:"cm-search"},[this.searchField,r("next",()=>vz(e),[Dl(e,"next")]),r("prev",()=>yz(e),[Dl(e,"previous")]),r("select",()=>hyn(e),[Dl(e,"all")]),Nr("label",null,[this.caseField,Dl(e,"match case")]),Nr("label",null,[this.reField,Dl(e,"regexp")]),Nr("label",null,[this.wordField,Dl(e,"by word")]),...e.state.readOnly?[]:[Nr("br"),this.replaceField,r("replace",()=>Twe(e),[Dl(e,"replace")]),r("replaceAll",()=>gyn(e),[Dl(e,"replace all")])],Nr("button",{name:"close",onclick:()=>PGe(e),"aria-label":Dl(e,"close"),type:"button"},["×"])])}commit(){let e=new OGe({search:this.searchField.value,caseSensitive:this.caseField.checked,regexp:this.reField.checked,wholeWord:this.wordField.checked,replace:this.replaceField.value});e.eq(this.query)||(this.query=e,this.view.dispatch({effects:yP.of(e)}))}keydown(e){Epn(this.view,e,"search-panel")?e.preventDefault():e.keyCode==13&&e.target==this.searchField?(e.preventDefault(),(e.shiftKey?yz:vz)(this.view)):e.keyCode==13&&e.target==this.replaceField&&(e.preventDefault(),Twe(this.view))}update(e){for(let n of e.transactions)for(let r of n.effects)r.is(yP)&&!r.value.eq(this.query)&&this.setQuery(r.value)}setQuery(e){this.query=e,this.searchField.value=e.search,this.replaceField.value=e.replace,this.caseField.checked=e.caseSensitive,this.reField.checked=e.regexp,this.wordField.checked=e.wholeWord}mount(){this.searchField.select()}get pos(){return 80}get top(){return this.view.state.facet(QO).top}}function Dl(t,e){return t.state.phrase(e)}const jL=30,BL=/[\s\.,:;?!]/;function oce(t,{from:e,to:n}){let r=t.state.doc.lineAt(e),i=t.state.doc.lineAt(n).to,o=Math.max(r.from,e-jL),s=Math.min(i,n+jL),a=t.state.sliceDoc(o,s);if(o!=r.from){for(let l=0;la.length-jL;l--)if(!BL.test(a[l-1])&&BL.test(a[l])){a=a.slice(0,l);break}}return mt.announce.of(`${t.state.phrase("current match")}. ${a} ${t.state.phrase("on line")} ${r.number}.`)}const yyn=mt.baseTheme({".cm-panel.cm-search":{padding:"2px 6px 4px",position:"relative","& [name=close]":{position:"absolute",top:"0",right:"4px",backgroundColor:"inherit",border:"none",font:"inherit",padding:0,margin:0},"& input, & button, & label":{margin:".2em .6em .2em 0"},"& input[type=checkbox]":{marginRight:".2em"},"& label":{fontSize:"80%",whiteSpace:"pre"}},"&light .cm-searchMatch":{backgroundColor:"#ffff0054"},"&dark .cm-searchMatch":{backgroundColor:"#00ffff8a"},"&light .cm-searchMatch-selected":{backgroundColor:"#ff6a0054"},"&dark .cm-searchMatch-selected":{backgroundColor:"#ff00ff8a"}}),xyn=[Vv,t0.low(dyn),yyn];class MGe{constructor(e,n,r,i){this.state=e,this.pos=n,this.explicit=r,this.view=i,this.abortListeners=[],this.abortOnDocChange=!1}tokenBefore(e){let n=Vo(this.state).resolveInner(this.pos,-1);for(;n&&e.indexOf(n.name)<0;)n=n.parent;return n?{from:n.from,to:this.pos,text:this.state.sliceDoc(n.from,this.pos),type:n.type}:null}matchBefore(e){let n=this.state.doc.lineAt(this.pos),r=Math.max(n.from,this.pos-250),i=n.text.slice(r-n.from,this.pos-n.from),o=i.search(DGe(e,!1));return o<0?null:{from:r+o,to:this.pos,text:i.slice(o)}}get aborted(){return this.abortListeners==null}addEventListener(e,n,r){e=="abort"&&this.abortListeners&&(this.abortListeners.push(n),r&&r.onDocChange&&(this.abortOnDocChange=!0))}}function kwe(t){let e=Object.keys(t).join(""),n=/\w/.test(e);return n&&(e=e.replace(/\w/g,"")),`[${n?"\\w":""}${e.replace(/[^\w\s]/g,"\\$&")}]`}function byn(t){let e=Object.create(null),n=Object.create(null);for(let{label:i}of t){e[i[0]]=!0;for(let o=1;otypeof i=="string"?{label:i}:i),[n,r]=e.every(i=>/^\w+$/.test(i.label))?[/\w*$/,/\w+$/]:byn(e);return i=>{let o=i.matchBefore(r);return o||i.explicit?{from:o?o.from:i.pos,options:e,validFor:n}:null}}function wyn(t,e){return n=>{for(let r=Vo(n.state).resolveInner(n.pos,-1);r;r=r.parent){if(t.indexOf(r.name)>-1)return null;if(r.type.isTop)break}return e(n)}}class Awe{constructor(e,n,r,i){this.completion=e,this.source=n,this.match=r,this.score=i}}function Gv(t){return t.selection.main.from}function DGe(t,e){var n;let{source:r}=t,i=e&&r[0]!="^",o=r[r.length-1]!="$";return!i&&!o?t:new RegExp(`${i?"^":""}(?:${r})${o?"$":""}`,(n=t.flags)!==null&&n!==void 0?n:t.ignoreCase?"i":"")}const sce=Qh.define();function _yn(t,e,n,r){let{main:i}=t.selection,o=n-i.from,s=r-i.from;return Object.assign(Object.assign({},t.changeByRange(a=>a!=i&&n!=r&&t.sliceDoc(a.from+o,a.from+s)!=t.sliceDoc(n,r)?{range:a}:{changes:{from:a.from+o,to:r==i.from?a.to:a.from+s,insert:e},range:Ve.cursor(a.from+o+e.length)})),{scrollIntoView:!0,userEvent:"input.complete"})}const Pwe=new WeakMap;function Syn(t){if(!Array.isArray(t))return t;let e=Pwe.get(t);return e||Pwe.set(t,e=RGe(t)),e}const xz=rn.define(),xP=rn.define();class Cyn{constructor(e){this.pattern=e,this.chars=[],this.folded=[],this.any=[],this.precise=[],this.byWord=[],this.score=0,this.matched=[];for(let n=0;n=48&&w<=57||w>=97&&w<=122?2:w>=65&&w<=90?1:0:(_=Mle(w))!=_.toLowerCase()?1:_!=_.toUpperCase()?2:0;(!y||S==1&&m||b==0&&S!=0)&&(n[f]==w||r[f]==w&&(d=!0)?s[f++]=y:s.length&&(v=!1)),b=S,y+=Jc(w)}return f==l&&s[0]==0&&v?this.result(-100+(d?-200:0),s,e):h==l&&p==0?this.ret(-200-e.length+(g==e.length?0:-100),[0,g]):a>-1?this.ret(-700-e.length,[a,a+this.pattern.length]):h==l?this.ret(-900-e.length,[p,g]):f==l?this.result(-100+(d?-200:0)+-700+(v?0:-1100),s,e):n.length==2?null:this.result((i[0]?-700:0)+-200+-1100,i,e)}result(e,n,r){let i=[],o=0;for(let s of n){let a=s+(this.astral?Jc(ss(r,s)):1);o&&i[o-1]==s?i[o-1]=a:(i[o++]=s,i[o++]=a)}return this.ret(e-r.length,i)}}class Oyn{constructor(e){this.pattern=e,this.matched=[],this.score=0,this.folded=e.toLowerCase()}match(e){if(e.length!1,activateOnTypingDelay:100,selectOnOpen:!0,override:null,closeOnBlur:!0,maxRenderedOptions:100,defaultKeymap:!0,tooltipClass:()=>"",optionClass:()=>"",aboveCursor:!1,icons:!0,addToOptions:[],positionInfo:Eyn,filterStrict:!1,compareCompletions:(e,n)=>e.label.localeCompare(n.label),interactionDelay:75,updateSyncTime:100},{defaultKeymap:(e,n)=>e&&n,closeOnBlur:(e,n)=>e&&n,icons:(e,n)=>e&&n,tooltipClass:(e,n)=>r=>Mwe(e(r),n(r)),optionClass:(e,n)=>r=>Mwe(e(r),n(r)),addToOptions:(e,n)=>e.concat(n),filterStrict:(e,n)=>e||n})}});function Mwe(t,e){return t?e?t+" "+e:t:e}function Eyn(t,e,n,r,i,o){let s=t.textDirection==si.RTL,a=s,l=!1,c="top",u,f,d=e.left-i.left,h=i.right-e.right,p=r.right-r.left,g=r.bottom-r.top;if(a&&d=g||y>e.top?u=n.bottom-e.top:(c="bottom",u=e.bottom-n.top)}let m=(e.bottom-e.top)/o.offsetHeight,v=(e.right-e.left)/o.offsetWidth;return{style:`${c}: ${u/m}px; max-width: ${f/v}px`,class:"cm-completionInfo-"+(l?s?"left-narrow":"right-narrow":a?"left":"right")}}function Tyn(t){let e=t.addToOptions.slice();return t.icons&&e.push({render(n){let r=document.createElement("div");return r.classList.add("cm-completionIcon"),n.type&&r.classList.add(...n.type.split(/\s+/g).map(i=>"cm-completionIcon-"+i)),r.setAttribute("aria-hidden","true"),r},position:20}),e.push({render(n,r,i,o){let s=document.createElement("span");s.className="cm-completionLabel";let a=n.displayLabel||n.label,l=0;for(let c=0;cl&&s.appendChild(document.createTextNode(a.slice(l,u)));let d=s.appendChild(document.createElement("span"));d.appendChild(document.createTextNode(a.slice(u,f))),d.className="cm-completionMatchedText",l=f}return ln.position-r.position).map(n=>n.render)}function C7(t,e,n){if(t<=n)return{from:0,to:t};if(e<0&&(e=0),e<=t>>1){let i=Math.floor(e/n);return{from:i*n,to:(i+1)*n}}let r=Math.floor((t-e)/n);return{from:t-(r+1)*n,to:t-r*n}}class kyn{constructor(e,n,r){this.view=e,this.stateField=n,this.applyCompletion=r,this.info=null,this.infoDestroy=null,this.placeInfoReq={read:()=>this.measureInfo(),write:l=>this.placeInfo(l),key:this},this.space=null,this.currentClass="";let i=e.state.field(n),{options:o,selected:s}=i.open,a=e.state.facet(fs);this.optionContent=Tyn(a),this.optionClass=a.optionClass,this.tooltipClass=a.tooltipClass,this.range=C7(o.length,s,a.maxRenderedOptions),this.dom=document.createElement("div"),this.dom.className="cm-tooltip-autocomplete",this.updateTooltipClass(e.state),this.dom.addEventListener("mousedown",l=>{let{options:c}=e.state.field(n).open;for(let u=l.target,f;u&&u!=this.dom;u=u.parentNode)if(u.nodeName=="LI"&&(f=/-(\d+)$/.exec(u.id))&&+f[1]{let c=e.state.field(this.stateField,!1);c&&c.tooltip&&e.state.facet(fs).closeOnBlur&&l.relatedTarget!=e.contentDOM&&e.dispatch({effects:xP.of(null)})}),this.showOptions(o,i.id)}mount(){this.updateSel()}showOptions(e,n){this.list&&this.list.remove(),this.list=this.dom.appendChild(this.createListBox(e,n,this.range)),this.list.addEventListener("scroll",()=>{this.info&&this.view.requestMeasure(this.placeInfoReq)})}update(e){var n;let r=e.state.field(this.stateField),i=e.startState.field(this.stateField);if(this.updateTooltipClass(e.state),r!=i){let{options:o,selected:s,disabled:a}=r.open;(!i.open||i.open.options!=o)&&(this.range=C7(o.length,s,e.state.facet(fs).maxRenderedOptions),this.showOptions(o,r.id)),this.updateSel(),a!=((n=i.open)===null||n===void 0?void 0:n.disabled)&&this.dom.classList.toggle("cm-tooltip-autocomplete-disabled",!!a)}}updateTooltipClass(e){let n=this.tooltipClass(e);if(n!=this.currentClass){for(let r of this.currentClass.split(" "))r&&this.dom.classList.remove(r);for(let r of n.split(" "))r&&this.dom.classList.add(r);this.currentClass=n}}positioned(e){this.space=e,this.info&&this.view.requestMeasure(this.placeInfoReq)}updateSel(){let e=this.view.state.field(this.stateField),n=e.open;if((n.selected>-1&&n.selected=this.range.to)&&(this.range=C7(n.options.length,n.selected,this.view.state.facet(fs).maxRenderedOptions),this.showOptions(n.options,e.id)),this.updateSelectedOption(n.selected)){this.destroyInfo();let{completion:r}=n.options[n.selected],{info:i}=r;if(!i)return;let o=typeof i=="string"?document.createTextNode(i):i(r);if(!o)return;"then"in o?o.then(s=>{s&&this.view.state.field(this.stateField,!1)==e&&this.addInfoPane(s,r)}).catch(s=>sl(this.view.state,s,"completion info")):this.addInfoPane(o,r)}}addInfoPane(e,n){this.destroyInfo();let r=this.info=document.createElement("div");if(r.className="cm-tooltip cm-completionInfo",e.nodeType!=null)r.appendChild(e),this.infoDestroy=null;else{let{dom:i,destroy:o}=e;r.appendChild(i),this.infoDestroy=o||null}this.dom.appendChild(r),this.view.requestMeasure(this.placeInfoReq)}updateSelectedOption(e){let n=null;for(let r=this.list.firstChild,i=this.range.from;r;r=r.nextSibling,i++)r.nodeName!="LI"||!r.id?i--:i==e?r.hasAttribute("aria-selected")||(r.setAttribute("aria-selected","true"),n=r):r.hasAttribute("aria-selected")&&r.removeAttribute("aria-selected");return n&&Pyn(this.list,n),n}measureInfo(){let e=this.dom.querySelector("[aria-selected]");if(!e||!this.info)return null;let n=this.dom.getBoundingClientRect(),r=this.info.getBoundingClientRect(),i=e.getBoundingClientRect(),o=this.space;if(!o){let s=this.dom.ownerDocument.defaultView||window;o={left:0,top:0,right:s.innerWidth,bottom:s.innerHeight}}return i.top>Math.min(o.bottom,n.bottom)-10||i.bottomr.from||r.from==0))if(o=d,typeof c!="string"&&c.header)i.appendChild(c.header(c));else{let h=i.appendChild(document.createElement("completion-section"));h.textContent=d}}const u=i.appendChild(document.createElement("li"));u.id=n+"-"+s,u.setAttribute("role","option");let f=this.optionClass(a);f&&(u.className=f);for(let d of this.optionContent){let h=d(a,this.view.state,this.view,l);h&&u.appendChild(h)}}return r.from&&i.classList.add("cm-completionListIncompleteTop"),r.tonew kyn(n,t,e)}function Pyn(t,e){let n=t.getBoundingClientRect(),r=e.getBoundingClientRect(),i=n.height/t.offsetHeight;r.topn.bottom&&(t.scrollTop+=(r.bottom-n.bottom)/i)}function Rwe(t){return(t.boost||0)*100+(t.apply?10:0)+(t.info?5:0)+(t.type?1:0)}function Myn(t,e){let n=[],r=null,i=c=>{n.push(c);let{section:u}=c.completion;if(u){r||(r=[]);let f=typeof u=="string"?u:u.name;r.some(d=>d.name==f)||r.push(typeof u=="string"?{name:f}:u)}},o=e.facet(fs);for(let c of t)if(c.hasResult()){let u=c.result.getMatch;if(c.result.filter===!1)for(let f of c.result.options)i(new Awe(f,c.source,u?u(f):[],1e9-n.length));else{let f=e.sliceDoc(c.from,c.to),d,h=o.filterStrict?new Oyn(f):new Cyn(f);for(let p of c.result.options)if(d=h.match(p.label)){let g=p.displayLabel?u?u(p,d.matched):[]:d.matched;i(new Awe(p,c.source,g,d.score+(p.boost||0)))}}}if(r){let c=Object.create(null),u=0,f=(d,h)=>{var p,g;return((p=d.rank)!==null&&p!==void 0?p:1e9)-((g=h.rank)!==null&&g!==void 0?g:1e9)||(d.namef.score-u.score||l(u.completion,f.completion))){let u=c.completion;!a||a.label!=u.label||a.detail!=u.detail||a.type!=null&&u.type!=null&&a.type!=u.type||a.apply!=u.apply||a.boost!=u.boost?s.push(c):Rwe(c.completion)>Rwe(a)&&(s[s.length-1]=c),a=c.completion}return s}class m_{constructor(e,n,r,i,o,s){this.options=e,this.attrs=n,this.tooltip=r,this.timestamp=i,this.selected=o,this.disabled=s}setSelected(e,n){return e==this.selected||e>=this.options.length?this:new m_(this.options,Dwe(n,e),this.tooltip,this.timestamp,e,this.disabled)}static build(e,n,r,i,o){let s=Myn(e,n);if(!s.length)return i&&e.some(l=>l.state==1)?new m_(i.options,i.attrs,i.tooltip,i.timestamp,i.selected,!0):null;let a=n.facet(fs).selectOnOpen?0:-1;if(i&&i.selected!=a&&i.selected!=-1){let l=i.options[i.selected].completion;for(let c=0;cc.hasResult()?Math.min(l,c.from):l,1e8),create:Fyn,above:o.aboveCursor},i?i.timestamp:Date.now(),a,!1)}map(e){return new m_(this.options,this.attrs,Object.assign(Object.assign({},this.tooltip),{pos:e.mapPos(this.tooltip.pos)}),this.timestamp,this.selected,this.disabled)}}class bz{constructor(e,n,r){this.active=e,this.id=n,this.open=r}static start(){return new bz(Lyn,"cm-ac-"+Math.floor(Math.random()*2e6).toString(36),null)}update(e){let{state:n}=e,r=n.facet(fs),o=(r.override||n.languageDataAt("autocomplete",Gv(n)).map(Syn)).map(a=>(this.active.find(c=>c.source==a)||new tc(a,this.active.some(c=>c.state!=0)?1:0)).update(e,r));o.length==this.active.length&&o.every((a,l)=>a==this.active[l])&&(o=this.active);let s=this.open;s&&e.docChanged&&(s=s.map(e.changes)),e.selection||o.some(a=>a.hasResult()&&e.changes.touchesRange(a.from,a.to))||!Ryn(o,this.active)?s=m_.build(o,n,this.id,s,r):s&&s.disabled&&!o.some(a=>a.state==1)&&(s=null),!s&&o.every(a=>a.state!=1)&&o.some(a=>a.hasResult())&&(o=o.map(a=>a.hasResult()?new tc(a.source,0):a));for(let a of e.effects)a.is($Ge)&&(s=s&&s.setSelected(a.value,this.id));return o==this.active&&s==this.open?this:new bz(o,this.id,s)}get tooltip(){return this.open?this.open.tooltip:null}get attrs(){return this.open?this.open.attrs:this.active.length?Dyn:Iyn}}function Ryn(t,e){if(t==e)return!0;for(let n=0,r=0;;){for(;n-1&&(n["aria-activedescendant"]=t+"-"+e),n}const Lyn=[];function IGe(t,e){if(t.isUserEvent("input.complete")){let r=t.annotation(sce);if(r&&e.activateOnCompletion(r))return 12}let n=t.isUserEvent("input.type");return n&&e.activateOnTyping?5:n?1:t.isUserEvent("delete.backward")?2:t.selection?8:t.docChanged?16:0}class tc{constructor(e,n,r=-1){this.source=e,this.state=n,this.explicitPos=r}hasResult(){return!1}update(e,n){let r=IGe(e,n),i=this;(r&8||r&16&&this.touches(e))&&(i=new tc(i.source,0)),r&4&&i.state==0&&(i=new tc(this.source,1)),i=i.updateFor(e,r);for(let o of e.effects)if(o.is(xz))i=new tc(i.source,1,o.value?Gv(e.state):-1);else if(o.is(xP))i=new tc(i.source,0);else if(o.is(LGe))for(let s of o.value)s.source==i.source&&(i=s);return i}updateFor(e,n){return this.map(e.changes)}map(e){return e.empty||this.explicitPos<0?this:new tc(this.source,this.state,e.mapPos(this.explicitPos))}touches(e){return e.changes.touchesRange(Gv(e.state))}}class eS extends tc{constructor(e,n,r,i,o){super(e,2,n),this.result=r,this.from=i,this.to=o}hasResult(){return!0}updateFor(e,n){var r;if(!(n&3))return this.map(e.changes);let i=this.result;i.map&&!e.changes.empty&&(i=i.map(i,e.changes));let o=e.changes.mapPos(this.from),s=e.changes.mapPos(this.to,1),a=Gv(e.state);if((this.explicitPos<0?a<=o:as||!i||n&2&&Gv(e.startState)==this.from)return new tc(this.source,n&4?1:0);let l=this.explicitPos<0?-1:e.changes.mapPos(this.explicitPos);return $yn(i.validFor,e.state,o,s)?new eS(this.source,l,i,o,s):i.update&&(i=i.update(i,o,s,new MGe(e.state,a,l>=0)))?new eS(this.source,l,i,i.from,(r=i.to)!==null&&r!==void 0?r:Gv(e.state)):new tc(this.source,1,l)}map(e){return e.empty?this:(this.result.map?this.result.map(this.result,e):this.result)?new eS(this.source,this.explicitPos<0?-1:e.mapPos(this.explicitPos),this.result,e.mapPos(this.from),e.mapPos(this.to,1)):new tc(this.source,0)}touches(e){return e.changes.touchesRange(this.from,this.to)}}function $yn(t,e,n,r){if(!t)return!1;let i=e.sliceDoc(n,r);return typeof t=="function"?t(i,n,r,e):DGe(t,!0).test(i)}const LGe=rn.define({map(t,e){return t.map(n=>n.map(e))}}),$Ge=rn.define(),Za=Qo.define({create(){return bz.start()},update(t,e){return t.update(e)},provide:t=>[Wle.from(t,e=>e.tooltip),mt.contentAttributes.from(t,e=>e.attrs)]});function ace(t,e){const n=e.completion.apply||e.completion.label;let r=t.state.field(Za).active.find(i=>i.source==e.source);return r instanceof eS?(typeof n=="string"?t.dispatch(Object.assign(Object.assign({},_yn(t.state,n,r.from,r.to)),{annotations:sce.of(e.completion)})):n(t,e.completion,r.from,r.to),!0):!1}const Fyn=Ayn(Za,ace);function UL(t,e="option"){return n=>{let r=n.state.field(Za,!1);if(!r||!r.open||r.open.disabled||Date.now()-r.open.timestamp-1?r.open.selected+i*(t?1:-1):t?0:s-1;return a<0?a=e=="page"?0:s-1:a>=s&&(a=e=="page"?s-1:0),n.dispatch({effects:$Ge.of(a)}),!0}}const Nyn=t=>{let e=t.state.field(Za,!1);return t.state.readOnly||!e||!e.open||e.open.selected<0||e.open.disabled||Date.now()-e.open.timestampt.state.field(Za,!1)?(t.dispatch({effects:xz.of(!0)}),!0):!1,jyn=t=>{let e=t.state.field(Za,!1);return!e||!e.active.some(n=>n.state!=0)?!1:(t.dispatch({effects:xP.of(null)}),!0)};class Byn{constructor(e,n){this.active=e,this.context=n,this.time=Date.now(),this.updates=[],this.done=void 0}}const Uyn=50,Wyn=1e3,Vyn=Yi.fromClass(class{constructor(t){this.view=t,this.debounceUpdate=-1,this.running=[],this.debounceAccept=-1,this.pendingStart=!1,this.composing=0;for(let e of t.state.field(Za).active)e.state==1&&this.startQuery(e)}update(t){let e=t.state.field(Za),n=t.state.facet(fs);if(!t.selectionSet&&!t.docChanged&&t.startState.field(Za)==e)return;let r=t.transactions.some(o=>{let s=IGe(o,n);return s&8||(o.selection||o.docChanged)&&!(s&3)});for(let o=0;oUyn&&Date.now()-s.time>Wyn){for(let a of s.context.abortListeners)try{a()}catch(l){sl(this.view.state,l)}s.context.abortListeners=null,this.running.splice(o--,1)}else s.updates.push(...t.transactions)}this.debounceUpdate>-1&&clearTimeout(this.debounceUpdate),t.transactions.some(o=>o.effects.some(s=>s.is(xz)))&&(this.pendingStart=!0);let i=this.pendingStart?50:n.activateOnTypingDelay;if(this.debounceUpdate=e.active.some(o=>o.state==1&&!this.running.some(s=>s.active.source==o.source))?setTimeout(()=>this.startUpdate(),i):-1,this.composing!=0)for(let o of t.transactions)o.isUserEvent("input.type")?this.composing=2:this.composing==2&&o.selection&&(this.composing=3)}startUpdate(){this.debounceUpdate=-1,this.pendingStart=!1;let{state:t}=this.view,e=t.field(Za);for(let n of e.active)n.state==1&&!this.running.some(r=>r.active.source==n.source)&&this.startQuery(n)}startQuery(t){let{state:e}=this.view,n=Gv(e),r=new MGe(e,n,t.explicitPos==n,this.view),i=new Byn(t,r);this.running.push(i),Promise.resolve(t.source(r)).then(o=>{i.context.aborted||(i.done=o||null,this.scheduleAccept())},o=>{this.view.dispatch({effects:xP.of(null)}),sl(this.view.state,o)})}scheduleAccept(){this.running.every(t=>t.done!==void 0)?this.accept():this.debounceAccept<0&&(this.debounceAccept=setTimeout(()=>this.accept(),this.view.state.facet(fs).updateSyncTime))}accept(){var t;this.debounceAccept>-1&&clearTimeout(this.debounceAccept),this.debounceAccept=-1;let e=[],n=this.view.state.facet(fs);for(let r=0;rs.source==i.active.source);if(o&&o.state==1)if(i.done==null){let s=new tc(i.active.source,0);for(let a of i.updates)s=s.update(a,n);s.state!=1&&e.push(s)}else this.startQuery(o)}e.length&&this.view.dispatch({effects:LGe.of(e)})}},{eventHandlers:{blur(t){let e=this.view.state.field(Za,!1);if(e&&e.tooltip&&this.view.state.facet(fs).closeOnBlur){let n=e.open&&g7e(this.view,e.open.tooltip);(!n||!n.dom.contains(t.relatedTarget))&&setTimeout(()=>this.view.dispatch({effects:xP.of(null)}),10)}},compositionstart(){this.composing=1},compositionend(){this.composing==3&&setTimeout(()=>this.view.dispatch({effects:xz.of(!1)}),20),this.composing=0}}}),Gyn=typeof navigator=="object"&&/Win/.test(navigator.platform),Hyn=t0.highest(mt.domEventHandlers({keydown(t,e){let n=e.state.field(Za,!1);if(!n||!n.open||n.open.disabled||n.open.selected<0||t.key.length>1||t.ctrlKey&&!(Gyn&&t.altKey)||t.metaKey)return!1;let r=n.open.options[n.open.selected],i=n.active.find(s=>s.source==r.source),o=r.completion.commitCharacters||i.result.commitCharacters;return o&&o.indexOf(t.key)>-1&&ace(e,r),!1}})),FGe=mt.baseTheme({".cm-tooltip.cm-tooltip-autocomplete":{"& > ul":{fontFamily:"monospace",whiteSpace:"nowrap",overflow:"hidden auto",maxWidth_fallback:"700px",maxWidth:"min(700px, 95vw)",minWidth:"250px",maxHeight:"10em",height:"100%",listStyle:"none",margin:0,padding:0,"& > li, & > completion-section":{padding:"1px 3px",lineHeight:1.2},"& > li":{overflowX:"hidden",textOverflow:"ellipsis",cursor:"pointer"},"& > completion-section":{display:"list-item",borderBottom:"1px solid silver",paddingLeft:"0.5em",opacity:.7}}},"&light .cm-tooltip-autocomplete ul li[aria-selected]":{background:"#17c",color:"white"},"&light .cm-tooltip-autocomplete-disabled ul li[aria-selected]":{background:"#777"},"&dark .cm-tooltip-autocomplete ul li[aria-selected]":{background:"#347",color:"white"},"&dark .cm-tooltip-autocomplete-disabled ul li[aria-selected]":{background:"#444"},".cm-completionListIncompleteTop:before, .cm-completionListIncompleteBottom:after":{content:'"···"',opacity:.5,display:"block",textAlign:"center"},".cm-tooltip.cm-completionInfo":{position:"absolute",padding:"3px 9px",width:"max-content",maxWidth:"400px",boxSizing:"border-box",whiteSpace:"pre-line"},".cm-completionInfo.cm-completionInfo-left":{right:"100%"},".cm-completionInfo.cm-completionInfo-right":{left:"100%"},".cm-completionInfo.cm-completionInfo-left-narrow":{right:"30px"},".cm-completionInfo.cm-completionInfo-right-narrow":{left:"30px"},"&light .cm-snippetField":{backgroundColor:"#00000022"},"&dark .cm-snippetField":{backgroundColor:"#ffffff22"},".cm-snippetFieldPosition":{verticalAlign:"text-top",width:0,height:"1.15em",display:"inline-block",margin:"0 -0.7px -.7em",borderLeft:"1.4px dotted #888"},".cm-completionMatchedText":{textDecoration:"underline"},".cm-completionDetail":{marginLeft:"0.5em",fontStyle:"italic"},".cm-completionIcon":{fontSize:"90%",width:".8em",display:"inline-block",textAlign:"center",paddingRight:".6em",opacity:"0.6",boxSizing:"content-box"},".cm-completionIcon-function, .cm-completionIcon-method":{"&:after":{content:"'ƒ'"}},".cm-completionIcon-class":{"&:after":{content:"'○'"}},".cm-completionIcon-interface":{"&:after":{content:"'◌'"}},".cm-completionIcon-variable":{"&:after":{content:"'𝑥'"}},".cm-completionIcon-constant":{"&:after":{content:"'𝐶'"}},".cm-completionIcon-type":{"&:after":{content:"'𝑡'"}},".cm-completionIcon-enum":{"&:after":{content:"'∪'"}},".cm-completionIcon-property":{"&:after":{content:"'□'"}},".cm-completionIcon-keyword":{"&:after":{content:"'🔑︎'"}},".cm-completionIcon-namespace":{"&:after":{content:"'▢'"}},".cm-completionIcon-text":{"&:after":{content:"'abc'",fontSize:"50%",verticalAlign:"middle"}}});class qyn{constructor(e,n,r,i){this.field=e,this.line=n,this.from=r,this.to=i}}class lce{constructor(e,n,r){this.field=e,this.from=n,this.to=r}map(e){let n=e.mapPos(this.from,-1,us.TrackDel),r=e.mapPos(this.to,1,us.TrackDel);return n==null||r==null?null:new lce(this.field,n,r)}}class cce{constructor(e,n){this.lines=e,this.fieldPositions=n}instantiate(e,n){let r=[],i=[n],o=e.doc.lineAt(n),s=/^\s*/.exec(o.text)[0];for(let l of this.lines){if(r.length){let c=s,u=/^\t*/.exec(l)[0].length;for(let f=0;fnew lce(l.field,i[l.line]+l.from,i[l.line]+l.to));return{text:r,ranges:a}}static parse(e){let n=[],r=[],i=[],o;for(let s of e.split(/\r\n?|\n/)){for(;o=/[#$]\{(?:(\d+)(?::([^}]*))?|((?:\\[{}]|[^}])*))\}/.exec(s);){let a=o[1]?+o[1]:null,l=o[2]||o[3]||"",c=-1,u=l.replace(/\\[{}]/g,f=>f[1]);for(let f=0;f=c&&d.field++}i.push(new qyn(c,r.length,o.index,o.index+u.length)),s=s.slice(0,o.index)+l+s.slice(o.index+o[0].length)}s=s.replace(/\\([{}])/g,(a,l,c)=>{for(let u of i)u.line==r.length&&u.from>c&&(u.from--,u.to--);return l}),r.push(s)}return new cce(r,i)}}let Xyn=Dt.widget({widget:new class extends Zh{toDOM(){let t=document.createElement("span");return t.className="cm-snippetFieldPosition",t}ignoreEvent(){return!1}}}),Yyn=Dt.mark({class:"cm-snippetField"});class KO{constructor(e,n){this.ranges=e,this.active=n,this.deco=Dt.set(e.map(r=>(r.from==r.to?Xyn:Yyn).range(r.from,r.to)))}map(e){let n=[];for(let r of this.ranges){let i=r.map(e);if(!i)return null;n.push(i)}return new KO(n,this.active)}selectionInsideField(e){return e.ranges.every(n=>this.ranges.some(r=>r.field==this.active&&r.from<=n.from&&r.to>=n.to))}}const hD=rn.define({map(t,e){return t&&t.map(e)}}),Qyn=rn.define(),bP=Qo.define({create(){return null},update(t,e){for(let n of e.effects){if(n.is(hD))return n.value;if(n.is(Qyn)&&t)return new KO(t.ranges,n.value)}return t&&e.docChanged&&(t=t.map(e.changes)),t&&e.selection&&!t.selectionInsideField(e.selection)&&(t=null),t},provide:t=>mt.decorations.from(t,e=>e?e.deco:Dt.none)});function uce(t,e){return Ve.create(t.filter(n=>n.field==e).map(n=>Ve.range(n.from,n.to)))}function Kyn(t){let e=cce.parse(t);return(n,r,i,o)=>{let{text:s,ranges:a}=e.instantiate(n.state,i),l={changes:{from:i,to:o,insert:ar.of(s)},scrollIntoView:!0,annotations:r?[sce.of(r),ao.userEvent.of("input.complete")]:void 0};if(a.length&&(l.selection=uce(a,0)),a.some(c=>c.field>0)){let c=new KO(a,0),u=l.effects=[hD.of(c)];n.state.field(bP,!1)===void 0&&u.push(rn.appendConfig.of([bP,n0n,r0n,FGe]))}n.dispatch(n.state.update(l))}}function NGe(t){return({state:e,dispatch:n})=>{let r=e.field(bP,!1);if(!r||t<0&&r.active==0)return!1;let i=r.active+t,o=t>0&&!r.ranges.some(s=>s.field==i+t);return n(e.update({selection:uce(r.ranges,i),effects:hD.of(o?null:new KO(r.ranges,i)),scrollIntoView:!0})),!0}}const Zyn=({state:t,dispatch:e})=>t.field(bP,!1)?(e(t.update({effects:hD.of(null)})),!0):!1,Jyn=NGe(1),e0n=NGe(-1),t0n=[{key:"Tab",run:Jyn,shift:e0n},{key:"Escape",run:Zyn}],Iwe=_t.define({combine(t){return t.length?t[0]:t0n}}),n0n=t0.highest(sD.compute([Iwe],t=>t.facet(Iwe)));function fp(t,e){return Object.assign(Object.assign({},e),{apply:Kyn(t)})}const r0n=mt.domEventHandlers({mousedown(t,e){let n=e.state.field(bP,!1),r;if(!n||(r=e.posAtCoords({x:t.clientX,y:t.clientY}))==null)return!1;let i=n.ranges.find(o=>o.from<=r&&o.to>=r);return!i||i.field==n.active?!1:(e.dispatch({selection:uce(n.ranges,i.field),effects:hD.of(n.ranges.some(o=>o.field>i.field)?new KO(n.ranges,i.field):null),scrollIntoView:!0}),!0)}}),wP={brackets:["(","[","{","'",'"'],before:")]}:;>",stringPrefixes:[]},yx=rn.define({map(t,e){let n=e.mapPos(t,-1,us.TrackAfter);return n??void 0}}),fce=new class extends Mb{};fce.startSide=1;fce.endSide=-1;const zGe=Qo.define({create(){return Gn.empty},update(t,e){if(t=t.map(e.changes),e.selection){let n=e.state.doc.lineAt(e.selection.main.head);t=t.update({filter:r=>r>=n.from&&r<=n.to})}for(let n of e.effects)n.is(yx)&&(t=t.update({add:[fce.range(n.value,n.value+1)]}));return t}});function i0n(){return[s0n,zGe]}const O7="()[]{}<>";function jGe(t){for(let e=0;e{if((o0n?t.composing:t.compositionStarted)||t.state.readOnly)return!1;let i=t.state.selection.main;if(r.length>2||r.length==2&&Jc(ss(r,0))==1||e!=i.from||n!=i.to)return!1;let o=c0n(t.state,r);return o?(t.dispatch(o),!0):!1}),a0n=({state:t,dispatch:e})=>{if(t.readOnly)return!1;let r=BGe(t,t.selection.main.head).brackets||wP.brackets,i=null,o=t.changeByRange(s=>{if(s.empty){let a=u0n(t.doc,s.head);for(let l of r)if(l==a&&$U(t.doc,s.head)==jGe(ss(l,0)))return{changes:{from:s.head-l.length,to:s.head+l.length},range:Ve.cursor(s.head-l.length)}}return{range:i=s}});return i||e(t.update(o,{scrollIntoView:!0,userEvent:"delete.backward"})),!i},l0n=[{key:"Backspace",run:a0n}];function c0n(t,e){let n=BGe(t,t.selection.main.head),r=n.brackets||wP.brackets;for(let i of r){let o=jGe(ss(i,0));if(e==i)return o==i?h0n(t,i,r.indexOf(i+i+i)>-1,n):f0n(t,i,o,n.before||wP.before);if(e==o&&UGe(t,t.selection.main.from))return d0n(t,i,o)}return null}function UGe(t,e){let n=!1;return t.field(zGe).between(0,t.doc.length,r=>{r==e&&(n=!0)}),n}function $U(t,e){let n=t.sliceString(e,e+2);return n.slice(0,Jc(ss(n,0)))}function u0n(t,e){let n=t.sliceString(e-2,e);return Jc(ss(n,0))==n.length?n:n.slice(1)}function f0n(t,e,n,r){let i=null,o=t.changeByRange(s=>{if(!s.empty)return{changes:[{insert:e,from:s.from},{insert:n,from:s.to}],effects:yx.of(s.to+e.length),range:Ve.range(s.anchor+e.length,s.head+e.length)};let a=$U(t.doc,s.head);return!a||/\s/.test(a)||r.indexOf(a)>-1?{changes:{insert:e+n,from:s.head},effects:yx.of(s.head+e.length),range:Ve.cursor(s.head+e.length)}:{range:i=s}});return i?null:t.update(o,{scrollIntoView:!0,userEvent:"input.type"})}function d0n(t,e,n){let r=null,i=t.changeByRange(o=>o.empty&&$U(t.doc,o.head)==n?{changes:{from:o.head,to:o.head+n.length,insert:n},range:Ve.cursor(o.head+n.length)}:r={range:o});return r?null:t.update(i,{scrollIntoView:!0,userEvent:"input.type"})}function h0n(t,e,n,r){let i=r.stringPrefixes||wP.stringPrefixes,o=null,s=t.changeByRange(a=>{if(!a.empty)return{changes:[{insert:e,from:a.from},{insert:e,from:a.to}],effects:yx.of(a.to+e.length),range:Ve.range(a.anchor+e.length,a.head+e.length)};let l=a.head,c=$U(t.doc,l),u;if(c==e){if(Lwe(t,l))return{changes:{insert:e+e,from:l},effects:yx.of(l+e.length),range:Ve.cursor(l+e.length)};if(UGe(t,l)){let d=n&&t.sliceDoc(l,l+e.length*3)==e+e+e?e+e+e:e;return{changes:{from:l,to:l+d.length,insert:d},range:Ve.cursor(l+d.length)}}}else{if(n&&t.sliceDoc(l-2*e.length,l)==e+e&&(u=$we(t,l-2*e.length,i))>-1&&Lwe(t,u))return{changes:{insert:e+e+e+e,from:l},effects:yx.of(l+e.length),range:Ve.cursor(l+e.length)};if(t.charCategorizer(l)(c)!=gi.Word&&$we(t,l,i)>-1&&!p0n(t,l,e,i))return{changes:{insert:e+e,from:l},effects:yx.of(l+e.length),range:Ve.cursor(l+e.length)}}return{range:o=a}});return o?null:t.update(s,{scrollIntoView:!0,userEvent:"input.type"})}function Lwe(t,e){let n=Vo(t).resolveInner(e+1);return n.parent&&n.from==e}function p0n(t,e,n,r){let i=Vo(t).resolveInner(e,-1),o=r.reduce((s,a)=>Math.max(s,a.length),0);for(let s=0;s<5;s++){let a=t.sliceDoc(i.from,Math.min(i.to,i.from+n.length+o)),l=a.indexOf(n);if(!l||l>-1&&r.indexOf(a.slice(0,l))>-1){let u=i.firstChild;for(;u&&u.from==i.from&&u.to-u.from>n.length+l;){if(t.sliceDoc(u.to-n.length,u.to)==n)return!1;u=u.firstChild}return!0}let c=i.to==e&&i.parent;if(!c)break;i=c}return!1}function $we(t,e,n){let r=t.charCategorizer(e);if(r(t.sliceDoc(e-1,e))!=gi.Word)return e;for(let i of n){let o=e-i.length;if(t.sliceDoc(o,e)==i&&r(t.sliceDoc(o-1,o))!=gi.Word)return o}return-1}function WGe(t={}){return[Hyn,Za,fs.of(t),Vyn,g0n,FGe]}const VGe=[{key:"Ctrl-Space",run:zyn},{key:"Escape",run:jyn},{key:"ArrowDown",run:UL(!0)},{key:"ArrowUp",run:UL(!1)},{key:"PageDown",run:UL(!0,"page")},{key:"PageUp",run:UL(!1,"page")},{key:"Enter",run:Nyn}],g0n=t0.highest(sD.computeN([fs],t=>t.facet(fs).defaultKeymap?[VGe]:[]));class m0n{constructor(e,n,r){this.from=e,this.to=n,this.diagnostic=r}}class rx{constructor(e,n,r){this.diagnostics=e,this.panel=n,this.selected=r}static init(e,n,r){let i=e,o=r.facet(_P).markerFilter;o&&(i=o(i,r));let s=Dt.set(i.map(a=>a.from==a.to||a.from==a.to-1&&r.doc.lineAt(a.from).to==a.from?Dt.widget({widget:new O0n(a),diagnostic:a}).range(a.from):Dt.mark({attributes:{class:"cm-lintRange cm-lintRange-"+a.severity+(a.markClass?" "+a.markClass:"")},diagnostic:a}).range(a.from,a.to)),!0);return new rx(s,n,_C(s))}}function _C(t,e=null,n=0){let r=null;return t.between(n,1e9,(i,o,{spec:s})=>{if(!(e&&s.diagnostic!=e))return r=new m0n(i,o,s.diagnostic),!1}),r}function v0n(t,e){let n=e.pos,r=e.end||n,i=t.state.facet(_P).hideOn(t,n,r);if(i!=null)return i;let o=t.startState.doc.lineAt(e.pos);return!!(t.effects.some(s=>s.is(GGe))||t.changes.touchesRange(o.from,Math.max(o.to,r)))}function y0n(t,e){return t.field(lc,!1)?e:e.concat(rn.appendConfig.of(k0n))}const GGe=rn.define(),dce=rn.define(),HGe=rn.define(),lc=Qo.define({create(){return new rx(Dt.none,null,null)},update(t,e){if(e.docChanged&&t.diagnostics.size){let n=t.diagnostics.map(e.changes),r=null,i=t.panel;if(t.selected){let o=e.changes.mapPos(t.selected.from,1);r=_C(n,t.selected.diagnostic,o)||_C(n,null,o)}!n.size&&i&&e.state.facet(_P).autoPanel&&(i=null),t=new rx(n,i,r)}for(let n of e.effects)if(n.is(GGe)){let r=e.state.facet(_P).autoPanel?n.value.length?SP.open:null:t.panel;t=rx.init(n.value,r,e.state)}else n.is(dce)?t=new rx(t.diagnostics,n.value?SP.open:null,t.selected):n.is(HGe)&&(t=new rx(t.diagnostics,t.panel,n.value));return t},provide:t=>[pP.from(t,e=>e.panel),mt.decorations.from(t,e=>e.diagnostics)]}),x0n=Dt.mark({class:"cm-lintRange cm-lintRange-active"});function b0n(t,e,n){let{diagnostics:r}=t.state.field(lc),i=[],o=2e8,s=0;r.between(e-(n<0?1:0),e+(n>0?1:0),(l,c,{spec:u})=>{e>=l&&e<=c&&(l==c||(e>l||n>0)&&(eXGe(t,n,!1)))}const _0n=t=>{let e=t.state.field(lc,!1);(!e||!e.panel)&&t.dispatch({effects:y0n(t.state,[dce.of(!0)])});let n=hP(t,SP.open);return n&&n.dom.querySelector(".cm-panel-lint ul").focus(),!0},Fwe=t=>{let e=t.state.field(lc,!1);return!e||!e.panel?!1:(t.dispatch({effects:dce.of(!1)}),!0)},S0n=t=>{let e=t.state.field(lc,!1);if(!e)return!1;let n=t.state.selection.main,r=e.diagnostics.iter(n.to+1);return!r.value&&(r=e.diagnostics.iter(0),!r.value||r.from==n.from&&r.to==n.to)?!1:(t.dispatch({selection:{anchor:r.from,head:r.to},scrollIntoView:!0}),!0)},C0n=[{key:"Mod-Shift-m",run:_0n,preventDefault:!0},{key:"F8",run:S0n}],_P=_t.define({combine(t){return Object.assign({sources:t.map(e=>e.source).filter(e=>e!=null)},Kh(t.map(e=>e.config),{delay:750,markerFilter:null,tooltipFilter:null,needsRefresh:null,hideOn:()=>null},{needsRefresh:(e,n)=>e?n?r=>e(r)||n(r):e:n}))}});function qGe(t){let e=[];if(t)e:for(let{name:n}of t){for(let r=0;ro.toLowerCase()==i.toLowerCase())){e.push(i);continue e}}e.push("")}return e}function XGe(t,e,n){var r;let i=n?qGe(e.actions):[];return Nr("li",{class:"cm-diagnostic cm-diagnostic-"+e.severity},Nr("span",{class:"cm-diagnosticText"},e.renderMessage?e.renderMessage(t):e.message),(r=e.actions)===null||r===void 0?void 0:r.map((o,s)=>{let a=!1,l=d=>{if(d.preventDefault(),a)return;a=!0;let h=_C(t.state.field(lc).diagnostics,e);h&&o.apply(t,h.from,h.to)},{name:c}=o,u=i[s]?c.indexOf(i[s]):-1,f=u<0?c:[c.slice(0,u),Nr("u",c.slice(u,u+1)),c.slice(u+1)];return Nr("button",{type:"button",class:"cm-diagnosticAction",onclick:l,onmousedown:l,"aria-label":` Action: ${c}${u<0?"":` (access key "${i[s]})"`}.`},f)}),e.source&&Nr("div",{class:"cm-diagnosticSource"},e.source))}class O0n extends Zh{constructor(e){super(),this.diagnostic=e}eq(e){return e.diagnostic==this.diagnostic}toDOM(){return Nr("span",{class:"cm-lintPoint cm-lintPoint-"+this.diagnostic.severity})}}class Nwe{constructor(e,n){this.diagnostic=n,this.id="item_"+Math.floor(Math.random()*4294967295).toString(16),this.dom=XGe(e,n,!0),this.dom.id=this.id,this.dom.setAttribute("role","option")}}class SP{constructor(e){this.view=e,this.items=[];let n=i=>{if(i.keyCode==27)Fwe(this.view),this.view.focus();else if(i.keyCode==38||i.keyCode==33)this.moveSelection((this.selectedIndex-1+this.items.length)%this.items.length);else if(i.keyCode==40||i.keyCode==34)this.moveSelection((this.selectedIndex+1)%this.items.length);else if(i.keyCode==36)this.moveSelection(0);else if(i.keyCode==35)this.moveSelection(this.items.length-1);else if(i.keyCode==13)this.view.focus();else if(i.keyCode>=65&&i.keyCode<=90&&this.selectedIndex>=0){let{diagnostic:o}=this.items[this.selectedIndex],s=qGe(o.actions);for(let a=0;a{for(let o=0;oFwe(this.view)},"×")),this.update()}get selectedIndex(){let e=this.view.state.field(lc).selected;if(!e)return-1;for(let n=0;n{let c=-1,u;for(let f=r;fr&&(this.items.splice(r,c-r),i=!0)),n&&u.diagnostic==n.diagnostic?u.dom.hasAttribute("aria-selected")||(u.dom.setAttribute("aria-selected","true"),o=u):u.dom.hasAttribute("aria-selected")&&u.dom.removeAttribute("aria-selected"),r++});r({sel:o.dom.getBoundingClientRect(),panel:this.list.getBoundingClientRect()}),write:({sel:s,panel:a})=>{let l=a.height/this.list.offsetHeight;s.topa.bottom&&(this.list.scrollTop+=(s.bottom-a.bottom)/l)}})):this.selectedIndex<0&&this.list.removeAttribute("aria-activedescendant"),i&&this.sync()}sync(){let e=this.list.firstChild;function n(){let r=e;e=r.nextSibling,r.remove()}for(let r of this.items)if(r.dom.parentNode==this.list){for(;e!=r.dom;)n();e=r.dom.nextSibling}else this.list.insertBefore(r.dom,e);for(;e;)n()}moveSelection(e){if(this.selectedIndex<0)return;let n=this.view.state.field(lc),r=_C(n.diagnostics,this.items[e].diagnostic);r&&this.view.dispatch({selection:{anchor:r.from,head:r.to},scrollIntoView:!0,effects:HGe.of(r)})}static open(e){return new SP(e)}}function E0n(t,e='viewBox="0 0 40 40"'){return`url('data:image/svg+xml,${encodeURIComponent(t)}')`}function WL(t){return E0n(``,'width="6" height="3"')}const T0n=mt.baseTheme({".cm-diagnostic":{padding:"3px 6px 3px 8px",marginLeft:"-1px",display:"block",whiteSpace:"pre-wrap"},".cm-diagnostic-error":{borderLeft:"5px solid #d11"},".cm-diagnostic-warning":{borderLeft:"5px solid orange"},".cm-diagnostic-info":{borderLeft:"5px solid #999"},".cm-diagnostic-hint":{borderLeft:"5px solid #66d"},".cm-diagnosticAction":{font:"inherit",border:"none",padding:"2px 4px",backgroundColor:"#444",color:"white",borderRadius:"3px",marginLeft:"8px",cursor:"pointer"},".cm-diagnosticSource":{fontSize:"70%",opacity:.7},".cm-lintRange":{backgroundPosition:"left bottom",backgroundRepeat:"repeat-x",paddingBottom:"0.7px"},".cm-lintRange-error":{backgroundImage:WL("#d11")},".cm-lintRange-warning":{backgroundImage:WL("orange")},".cm-lintRange-info":{backgroundImage:WL("#999")},".cm-lintRange-hint":{backgroundImage:WL("#66d")},".cm-lintRange-active":{backgroundColor:"#ffdd9980"},".cm-tooltip-lint":{padding:0,margin:0},".cm-lintPoint":{position:"relative","&:after":{content:'""',position:"absolute",bottom:0,left:"-2px",borderLeft:"3px solid transparent",borderRight:"3px solid transparent",borderBottom:"4px solid #d11"}},".cm-lintPoint-warning":{"&:after":{borderBottomColor:"orange"}},".cm-lintPoint-info":{"&:after":{borderBottomColor:"#999"}},".cm-lintPoint-hint":{"&:after":{borderBottomColor:"#66d"}},".cm-panel.cm-panel-lint":{position:"relative","& ul":{maxHeight:"100px",overflowY:"auto","& [aria-selected]":{backgroundColor:"#ddd","& u":{textDecoration:"underline"}},"&:focus [aria-selected]":{background_fallback:"#bdf",backgroundColor:"Highlight",color_fallback:"white",color:"HighlightText"},"& u":{textDecoration:"none"},padding:0,margin:0},"& [name=close]":{position:"absolute",top:"0",right:"2px",background:"inherit",border:"none",font:"inherit",padding:0,margin:0}}}),k0n=[lc,mt.decorations.compute([lc],t=>{let{selected:e,panel:n}=t.field(lc);return!e||!n||e.from==e.to?Dt.none:Dt.set([x0n.range(e.from,e.to)])}),pgn(b0n,{hideOn:v0n}),T0n];var zwe=function(e){e===void 0&&(e={});var n=[];e.closeBracketsKeymap!==!1&&(n=n.concat(l0n)),e.defaultKeymap!==!1&&(n=n.concat(Vvn)),e.searchKeymap!==!1&&(n=n.concat(myn)),e.historyKeymap!==!1&&(n=n.concat(Zmn)),e.foldKeymap!==!1&&(n=n.concat(dmn)),e.completionKeymap!==!1&&(n=n.concat(VGe)),e.lintKeymap!==!1&&(n=n.concat(C0n));var r=[];return e.lineNumbers!==!1&&r.push(Ogn()),e.highlightActiveLineGutter!==!1&&r.push(kgn()),e.highlightSpecialChars!==!1&&r.push(Wpn()),e.history!==!1&&r.push(Wmn()),e.foldGutter!==!1&&r.push(mmn()),e.drawSelection!==!1&&r.push(Rpn()),e.dropCursor!==!1&&r.push(Fpn()),e.allowMultipleSelections!==!1&&r.push(In.allowMultipleSelections.of(!0)),e.indentOnInput!==!1&&r.push(rmn()),e.syntaxHighlighting!==!1&&r.push(z7e(bmn,{fallback:!0})),e.bracketMatching!==!1&&r.push(Tmn()),e.closeBrackets!==!1&&r.push(i0n()),e.autocompletion!==!1&&r.push(WGe()),e.rectangularSelection!==!1&&r.push(rgn()),e.crosshairCursor!==!1&&r.push(sgn()),e.highlightActiveLine!==!1&&r.push(Ypn()),e.highlightSelectionMatches!==!1&&r.push(Kvn()),e.tabSize&&typeof e.tabSize=="number"&&r.push(lD.of(" ".repeat(e.tabSize))),r.concat([sD.of(n.flat())]).filter(Boolean)};const A0n="#e5c07b",jwe="#e06c75",P0n="#56b6c2",M0n="#ffffff",H3="#abb2bf",LK="#7d8799",R0n="#61afef",D0n="#98c379",Bwe="#d19a66",I0n="#c678dd",L0n="#21252b",Uwe="#2c313a",Wwe="#282c34",E7="#353a42",$0n="#3E4451",Vwe="#528bff",F0n=mt.theme({"&":{color:H3,backgroundColor:Wwe},".cm-content":{caretColor:Vwe},".cm-cursor, .cm-dropCursor":{borderLeftColor:Vwe},"&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection":{backgroundColor:$0n},".cm-panels":{backgroundColor:L0n,color:H3},".cm-panels.cm-panels-top":{borderBottom:"2px solid black"},".cm-panels.cm-panels-bottom":{borderTop:"2px solid black"},".cm-searchMatch":{backgroundColor:"#72a1ff59",outline:"1px solid #457dff"},".cm-searchMatch.cm-searchMatch-selected":{backgroundColor:"#6199ff2f"},".cm-activeLine":{backgroundColor:"#6699ff0b"},".cm-selectionMatch":{backgroundColor:"#aafe661a"},"&.cm-focused .cm-matchingBracket, &.cm-focused .cm-nonmatchingBracket":{backgroundColor:"#bad0f847"},".cm-gutters":{backgroundColor:Wwe,color:LK,border:"none"},".cm-activeLineGutter":{backgroundColor:Uwe},".cm-foldPlaceholder":{backgroundColor:"transparent",border:"none",color:"#ddd"},".cm-tooltip":{border:"none",backgroundColor:E7},".cm-tooltip .cm-tooltip-arrow:before":{borderTopColor:"transparent",borderBottomColor:"transparent"},".cm-tooltip .cm-tooltip-arrow:after":{borderTopColor:E7,borderBottomColor:E7},".cm-tooltip-autocomplete":{"& > ul > li[aria-selected]":{backgroundColor:Uwe,color:H3}}},{dark:!0}),N0n=uD.define([{tag:Ee.keyword,color:I0n},{tag:[Ee.name,Ee.deleted,Ee.character,Ee.propertyName,Ee.macroName],color:jwe},{tag:[Ee.function(Ee.variableName),Ee.labelName],color:R0n},{tag:[Ee.color,Ee.constant(Ee.name),Ee.standard(Ee.name)],color:Bwe},{tag:[Ee.definition(Ee.name),Ee.separator],color:H3},{tag:[Ee.typeName,Ee.className,Ee.number,Ee.changed,Ee.annotation,Ee.modifier,Ee.self,Ee.namespace],color:A0n},{tag:[Ee.operator,Ee.operatorKeyword,Ee.url,Ee.escape,Ee.regexp,Ee.link,Ee.special(Ee.string)],color:P0n},{tag:[Ee.meta,Ee.comment],color:LK},{tag:Ee.strong,fontWeight:"bold"},{tag:Ee.emphasis,fontStyle:"italic"},{tag:Ee.strikethrough,textDecoration:"line-through"},{tag:Ee.link,color:LK,textDecoration:"underline"},{tag:Ee.heading,fontWeight:"bold",color:jwe},{tag:[Ee.atom,Ee.bool,Ee.special(Ee.variableName)],color:Bwe},{tag:[Ee.processingInstruction,Ee.string,Ee.inserted],color:D0n},{tag:Ee.invalid,color:M0n}]),z0n=[F0n,z7e(N0n)];var j0n=mt.theme({"&":{backgroundColor:"#fff"}},{dark:!1}),B0n=function(e){e===void 0&&(e={});var{indentWithTab:n=!0,editable:r=!0,readOnly:i=!1,theme:o="light",placeholder:s="",basicSetup:a=!0}=e,l=[];switch(n&&l.unshift(sD.of([Gvn])),a&&(typeof a=="boolean"?l.unshift(zwe()):l.unshift(zwe(a))),s&&l.unshift(Jpn(s)),o){case"light":l.push(j0n);break;case"dark":l.push(z0n);break;case"none":break;default:l.push(o);break}return r===!1&&l.push(mt.editable.of(!1)),i&&l.push(In.readOnly.of(!0)),[...l]},U0n=t=>({line:t.state.doc.lineAt(t.state.selection.main.from),lineCount:t.state.doc.lines,lineBreak:t.state.lineBreak,length:t.state.doc.length,readOnly:t.state.readOnly,tabSize:t.state.tabSize,selection:t.state.selection,selectionAsSingle:t.state.selection.asSingle().main,ranges:t.state.selection.ranges,selectionCode:t.state.sliceDoc(t.state.selection.main.from,t.state.selection.main.to),selections:t.state.selection.ranges.map(e=>t.state.sliceDoc(e.from,e.to)),selectedText:t.state.selection.ranges.some(e=>!e.empty)}),Gwe=Qh.define(),W0n=[];function V0n(t){var{value:e,selection:n,onChange:r,onStatistics:i,onCreateEditor:o,onUpdate:s,extensions:a=W0n,autoFocus:l,theme:c="light",height:u="",minHeight:f="",maxHeight:d="",placeholder:h="",width:p="",minWidth:g="",maxWidth:m="",editable:v=!0,readOnly:y=!1,indentWithTab:x=!0,basicSetup:b=!0,root:w,initialState:_}=t,[S,O]=D.useState(),[k,E]=D.useState(),[P,A]=D.useState(),R=mt.theme({"&":{height:u,minHeight:f,maxHeight:d,width:p,minWidth:g,maxWidth:m},"& .cm-scroller":{height:"100% !important"}}),T=mt.updateListener.of(j=>{if(j.docChanged&&typeof r=="function"&&!j.transactions.some(L=>L.annotation(Gwe))){var N=j.state.doc,z=N.toString();r(z,j)}i&&i(U0n(j))}),M=B0n({theme:c,editable:v,readOnly:y,placeholder:h,indentWithTab:x,basicSetup:b}),I=[T,R,...M];return s&&typeof s=="function"&&I.push(mt.updateListener.of(s)),I=I.concat(a),D.useEffect(()=>{if(S&&!P){var j={doc:e,selection:n,extensions:I},N=_?In.fromJSON(_.json,j,_.fields):In.create(j);if(A(N),!k){var z=new mt({state:N,parent:S,root:w});E(z),o&&o(z,N)}}return()=>{k&&(A(void 0),E(void 0))}},[S,P]),D.useEffect(()=>O(t.container),[t.container]),D.useEffect(()=>()=>{k&&(k.destroy(),E(void 0))},[k]),D.useEffect(()=>{l&&k&&k.focus()},[l,k]),D.useEffect(()=>{k&&k.dispatch({effects:rn.reconfigure.of(I)})},[c,a,u,f,d,p,g,m,h,v,y,x,b,r,s]),D.useEffect(()=>{if(e!==void 0){var j=k?k.state.doc.toString():"";k&&e!==j&&k.dispatch({changes:{from:0,to:j.length,insert:e||""},annotations:[Gwe.of(!0)]})}},[e,k]),{state:P,setState:A,view:k,setView:E,container:S,setContainer:O}}var G0n=["className","value","selection","extensions","onChange","onStatistics","onCreateEditor","onUpdate","autoFocus","theme","height","minHeight","maxHeight","width","minWidth","maxWidth","basicSetup","placeholder","indentWithTab","editable","readOnly","root","initialState"],FU=D.forwardRef((t,e)=>{var{className:n,value:r="",selection:i,extensions:o=[],onChange:s,onStatistics:a,onCreateEditor:l,onUpdate:c,autoFocus:u,theme:f="light",height:d,minHeight:h,maxHeight:p,width:g,minWidth:m,maxWidth:v,basicSetup:y,placeholder:x,indentWithTab:b,editable:w,readOnly:_,root:S,initialState:O}=t,k=Rt(t,G0n),E=D.useRef(null),{state:P,view:A,container:R}=V0n({container:E.current,root:S,value:r,autoFocus:u,theme:f,height:d,minHeight:h,maxHeight:p,width:g,minWidth:m,maxWidth:v,basicSetup:y,placeholder:x,indentWithTab:b,editable:w,readOnly:_,selection:i,onChange:s,onStatistics:a,onCreateEditor:l,onUpdate:c,extensions:o,initialState:O});if(D.useImperativeHandle(e,()=>({editor:E.current,state:P,view:A}),[E,R,P,A]),typeof r!="string")throw new Error("value must be typeof string but got "+typeof r);var T=typeof f=="string"?"cm-theme-"+f:"cm-theme";return C.jsx("div",ve({ref:E,className:""+T+(n?" "+n:"")},k))});FU.displayName="CodeMirror";var Hwe={};let H0n=class $K{constructor(e,n,r,i,o,s,a,l,c,u=0,f){this.p=e,this.stack=n,this.state=r,this.reducePos=i,this.pos=o,this.score=s,this.buffer=a,this.bufferBase=l,this.curContext=c,this.lookAhead=u,this.parent=f}toString(){return`[${this.stack.filter((e,n)=>n%3==0).concat(this.state)}]@${this.pos}${this.score?"!"+this.score:""}`}static start(e,n,r=0){let i=e.parser.context;return new $K(e,[],n,r,r,0,[],0,i?new qwe(i,i.start):null,0,null)}get context(){return this.curContext?this.curContext.context:null}pushState(e,n){this.stack.push(this.state,n,this.bufferBase+this.buffer.length),this.state=e}reduce(e){var n;let r=e>>19,i=e&65535,{parser:o}=this.p,s=this.reducePos=2e3&&!(!((n=this.p.parser.nodeSet.types[i])===null||n===void 0)&&n.isAnonymous)&&(c==this.p.lastBigReductionStart?(this.p.bigReductionCount++,this.p.lastBigReductionSize=u):this.p.lastBigReductionSizel;)this.stack.pop();this.reduceContext(i,c)}storeNode(e,n,r,i=4,o=!1){if(e==0&&(!this.stack.length||this.stack[this.stack.length-1]0&&s.buffer[a-4]==0&&s.buffer[a-1]>-1){if(n==r)return;if(s.buffer[a-2]>=n){s.buffer[a-2]=r;return}}}if(!o||this.pos==r)this.buffer.push(e,n,r,i);else{let s=this.buffer.length;if(s>0&&this.buffer[s-4]!=0){let a=!1;for(let l=s;l>0&&this.buffer[l-2]>r;l-=4)if(this.buffer[l-1]>=0){a=!0;break}if(a)for(;s>0&&this.buffer[s-2]>r;)this.buffer[s]=this.buffer[s-4],this.buffer[s+1]=this.buffer[s-3],this.buffer[s+2]=this.buffer[s-2],this.buffer[s+3]=this.buffer[s-1],s-=4,i>4&&(i-=4)}this.buffer[s]=e,this.buffer[s+1]=n,this.buffer[s+2]=r,this.buffer[s+3]=i}}shift(e,n,r,i){if(e&131072)this.pushState(e&65535,this.pos);else if(e&262144)this.pos=i,this.shiftContext(n,r),n<=this.p.parser.maxNode&&this.buffer.push(n,r,i,4);else{let o=e,{parser:s}=this.p;(i>this.pos||n<=s.maxNode)&&(this.pos=i,s.stateFlag(o,1)||(this.reducePos=i)),this.pushState(o,r),this.shiftContext(n,r),n<=s.maxNode&&this.buffer.push(n,r,i,4)}}apply(e,n,r,i){e&65536?this.reduce(e):this.shift(e,n,r,i)}useNode(e,n){let r=this.p.reused.length-1;(r<0||this.p.reused[r]!=e)&&(this.p.reused.push(e),r++);let i=this.pos;this.reducePos=this.pos=i+e.length,this.pushState(n,i),this.buffer.push(r,i,this.reducePos,-1),this.curContext&&this.updateContext(this.curContext.tracker.reuse(this.curContext.context,e,this,this.p.stream.reset(this.pos-e.length)))}split(){let e=this,n=e.buffer.length;for(;n>0&&e.buffer[n-2]>e.reducePos;)n-=4;let r=e.buffer.slice(n),i=e.bufferBase+n;for(;e&&i==e.bufferBase;)e=e.parent;return new $K(this.p,this.stack.slice(),this.state,this.reducePos,this.pos,this.score,r,i,this.curContext,this.lookAhead,e)}recoverByDelete(e,n){let r=e<=this.p.parser.maxNode;r&&this.storeNode(e,this.pos,n,4),this.storeNode(0,this.pos,n,r?8:4),this.pos=this.reducePos=n,this.score-=190}canShift(e){for(let n=new q0n(this);;){let r=this.p.parser.stateSlot(n.state,4)||this.p.parser.hasAction(n.state,e);if(r==0)return!1;if(!(r&65536))return!0;n.reduce(r)}}recoverByInsert(e){if(this.stack.length>=300)return[];let n=this.p.parser.nextStates(this.state);if(n.length>8||this.stack.length>=120){let i=[];for(let o=0,s;ol&1&&a==s)||i.push(n[o],s)}n=i}let r=[];for(let i=0;i>19,i=n&65535,o=this.stack.length-r*3;if(o<0||e.getGoto(this.stack[o],i,!1)<0){let s=this.findForcedReduction();if(s==null)return!1;n=s}this.storeNode(0,this.pos,this.pos,4,!0),this.score-=100}return this.reducePos=this.pos,this.reduce(n),!0}findForcedReduction(){let{parser:e}=this.p,n=[],r=(i,o)=>{if(!n.includes(i))return n.push(i),e.allActions(i,s=>{if(!(s&393216))if(s&65536){let a=(s>>19)-o;if(a>1){let l=s&65535,c=this.stack.length-a*3;if(c>=0&&e.getGoto(this.stack[c],l,!1)>=0)return a<<19|65536|l}}else{let a=r(s,o+1);if(a!=null)return a}})};return r(this.state,0)}forceAll(){for(;!this.p.parser.stateFlag(this.state,2);)if(!this.forceReduce()){this.storeNode(0,this.pos,this.pos,4,!0);break}return this}get deadEnd(){if(this.stack.length!=3)return!1;let{parser:e}=this.p;return e.data[e.stateSlot(this.state,1)]==65535&&!e.stateSlot(this.state,4)}restart(){this.storeNode(0,this.pos,this.pos,4,!0),this.state=this.stack[0],this.stack.length=0}sameState(e){if(this.state!=e.state||this.stack.length!=e.stack.length)return!1;for(let n=0;nthis.lookAhead&&(this.emitLookAhead(),this.lookAhead=e)}close(){this.curContext&&this.curContext.tracker.strict&&this.emitContext(),this.lookAhead>0&&this.emitLookAhead()}};class qwe{constructor(e,n){this.tracker=e,this.context=n,this.hash=e.strict?e.hash(n):0}}class q0n{constructor(e){this.start=e,this.state=e.state,this.stack=e.stack,this.base=this.stack.length}reduce(e){let n=e&65535,r=e>>19;r==0?(this.stack==this.start.stack&&(this.stack=this.stack.slice()),this.stack.push(this.state,0,0),this.base+=3):this.base-=(r-1)*3;let i=this.start.p.parser.getGoto(this.stack[this.base-3],n,!0);this.state=i}}class wz{constructor(e,n,r){this.stack=e,this.pos=n,this.index=r,this.buffer=e.buffer,this.index==0&&this.maybeNext()}static create(e,n=e.bufferBase+e.buffer.length){return new wz(e,n,n-e.bufferBase)}maybeNext(){let e=this.stack.parent;e!=null&&(this.index=this.stack.bufferBase-e.bufferBase,this.stack=e,this.buffer=e.buffer)}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}next(){this.index-=4,this.pos-=4,this.index==0&&this.maybeNext()}fork(){return new wz(this.stack,this.pos,this.index)}}function VL(t,e=Uint16Array){if(typeof t!="string")return t;let n=null;for(let r=0,i=0;r=92&&s--,s>=34&&s--;let l=s-32;if(l>=46&&(l-=46,a=!0),o+=l,a)break;o*=46}n?n[i++]=o:n=new e(o)}return n}class q3{constructor(){this.start=-1,this.value=-1,this.end=-1,this.extended=-1,this.lookAhead=0,this.mask=0,this.context=0}}const Xwe=new q3;class X0n{constructor(e,n){this.input=e,this.ranges=n,this.chunk="",this.chunkOff=0,this.chunk2="",this.chunk2Pos=0,this.next=-1,this.token=Xwe,this.rangeIndex=0,this.pos=this.chunkPos=n[0].from,this.range=n[0],this.end=n[n.length-1].to,this.readNext()}resolveOffset(e,n){let r=this.range,i=this.rangeIndex,o=this.pos+e;for(;or.to:o>=r.to;){if(i==this.ranges.length-1)return null;let s=this.ranges[++i];o+=s.from-r.to,r=s}return o}clipPos(e){if(e>=this.range.from&&ee)return Math.max(e,n.from);return this.end}peek(e){let n=this.chunkOff+e,r,i;if(n>=0&&n=this.chunk2Pos&&ra.to&&(this.chunk2=this.chunk2.slice(0,a.to-r)),i=this.chunk2.charCodeAt(0)}}return r>=this.token.lookAhead&&(this.token.lookAhead=r+1),i}acceptToken(e,n=0){let r=n?this.resolveOffset(n,-1):this.pos;if(r==null||r=this.chunk2Pos&&this.posthis.range.to?e.slice(0,this.range.to-this.pos):e,this.chunkPos=this.pos,this.chunkOff=0}}readNext(){return this.chunkOff>=this.chunk.length&&(this.getChunk(),this.chunkOff==this.chunk.length)?this.next=-1:this.next=this.chunk.charCodeAt(this.chunkOff)}advance(e=1){for(this.chunkOff+=e;this.pos+e>=this.range.to;){if(this.rangeIndex==this.ranges.length-1)return this.setDone();e-=this.range.to-this.pos,this.range=this.ranges[++this.rangeIndex],this.pos=this.range.from}return this.pos+=e,this.pos>=this.token.lookAhead&&(this.token.lookAhead=this.pos+1),this.readNext()}setDone(){return this.pos=this.chunkPos=this.end,this.range=this.ranges[this.rangeIndex=this.ranges.length-1],this.chunk="",this.next=-1}reset(e,n){if(n?(this.token=n,n.start=e,n.lookAhead=e+1,n.value=n.extended=-1):this.token=Xwe,this.pos!=e){if(this.pos=e,e==this.end)return this.setDone(),this;for(;e=this.range.to;)this.range=this.ranges[++this.rangeIndex];e>=this.chunkPos&&e=this.chunkPos&&n<=this.chunkPos+this.chunk.length)return this.chunk.slice(e-this.chunkPos,n-this.chunkPos);if(e>=this.chunk2Pos&&n<=this.chunk2Pos+this.chunk2.length)return this.chunk2.slice(e-this.chunk2Pos,n-this.chunk2Pos);if(e>=this.range.from&&n<=this.range.to)return this.input.read(e,n);let r="";for(let i of this.ranges){if(i.from>=n)break;i.to>e&&(r+=this.input.read(Math.max(i.from,e),Math.min(i.to,n)))}return r}}class tS{constructor(e,n){this.data=e,this.id=n}token(e,n){let{parser:r}=n.p;Y0n(this.data,e,n,this.id,r.data,r.tokenPrecTable)}}tS.prototype.contextual=tS.prototype.fallback=tS.prototype.extend=!1;tS.prototype.fallback=tS.prototype.extend=!1;class NU{constructor(e,n={}){this.token=e,this.contextual=!!n.contextual,this.fallback=!!n.fallback,this.extend=!!n.extend}}function Y0n(t,e,n,r,i,o){let s=0,a=1<0){let p=t[h];if(l.allows(p)&&(e.token.value==-1||e.token.value==p||Q0n(p,e.token.value,i,o))){e.acceptToken(p);break}}let u=e.next,f=0,d=t[s+2];if(e.next<0&&d>f&&t[c+d*3-3]==65535){s=t[c+d*3-1];continue e}for(;f>1,p=c+h+(h<<1),g=t[p],m=t[p+1]||65536;if(u=m)f=h+1;else{s=t[p+2],e.advance();continue e}}break}}function Ywe(t,e,n){for(let r=e,i;(i=t[r])!=65535;r++)if(i==n)return r-e;return-1}function Q0n(t,e,n,r){let i=Ywe(n,r,e);return i<0||Ywe(n,r,t)e)&&!r.type.isError)return n<0?Math.max(0,Math.min(r.to-1,e-25)):Math.min(t.length,Math.max(r.from+1,e+25));if(n<0?r.prevSibling():r.nextSibling())break;if(!r.parent())return n<0?0:t.length}}class K0n{constructor(e,n){this.fragments=e,this.nodeSet=n,this.i=0,this.fragment=null,this.safeFrom=-1,this.safeTo=-1,this.trees=[],this.start=[],this.index=[],this.nextFragment()}nextFragment(){let e=this.fragment=this.i==this.fragments.length?null:this.fragments[this.i++];if(e){for(this.safeFrom=e.openStart?Qwe(e.tree,e.from+e.offset,1)-e.offset:e.from,this.safeTo=e.openEnd?Qwe(e.tree,e.to+e.offset,-1)-e.offset:e.to;this.trees.length;)this.trees.pop(),this.start.pop(),this.index.pop();this.trees.push(e.tree),this.start.push(-e.offset),this.index.push(0),this.nextStart=this.safeFrom}else this.nextStart=1e9}nodeAt(e){if(ee)return this.nextStart=s,null;if(o instanceof lo){if(s==e){if(s=Math.max(this.safeFrom,e)&&(this.trees.push(o),this.start.push(s),this.index.push(0))}else this.index[n]++,this.nextStart=s+o.length}}}class Z0n{constructor(e,n){this.stream=n,this.tokens=[],this.mainToken=null,this.actions=[],this.tokens=e.tokenizers.map(r=>new q3)}getActions(e){let n=0,r=null,{parser:i}=e.p,{tokenizers:o}=i,s=i.stateSlot(e.state,3),a=e.curContext?e.curContext.hash:0,l=0;for(let c=0;cf.end+25&&(l=Math.max(f.lookAhead,l)),f.value!=0)){let d=n;if(f.extended>-1&&(n=this.addActions(e,f.extended,f.end,n)),n=this.addActions(e,f.value,f.end,n),!u.extend&&(r=f,n>d))break}}for(;this.actions.length>n;)this.actions.pop();return l&&e.setLookAhead(l),!r&&e.pos==this.stream.end&&(r=new q3,r.value=e.p.parser.eofTerm,r.start=r.end=e.pos,n=this.addActions(e,r.value,r.end,n)),this.mainToken=r,this.actions}getMainToken(e){if(this.mainToken)return this.mainToken;let n=new q3,{pos:r,p:i}=e;return n.start=r,n.end=Math.min(r+1,i.stream.end),n.value=r==i.stream.end?i.parser.eofTerm:0,n}updateCachedToken(e,n,r){let i=this.stream.clipPos(r.pos);if(n.token(this.stream.reset(i,e),r),e.value>-1){let{parser:o}=r.p;for(let s=0;s=0&&r.p.parser.dialect.allows(a>>1)){a&1?e.extended=a>>1:e.value=a>>1;break}}}else e.value=0,e.end=this.stream.clipPos(i+1)}putAction(e,n,r,i){for(let o=0;oe.bufferLength*4?new K0n(r,e.nodeSet):null}get parsedPos(){return this.minStackPos}advance(){let e=this.stacks,n=this.minStackPos,r=this.stacks=[],i,o;if(this.bigReductionCount>300&&e.length==1){let[s]=e;for(;s.forceReduce()&&s.stack.length&&s.stack[s.stack.length-2]>=this.lastBigReductionStart;);this.bigReductionCount=this.lastBigReductionSize=0}for(let s=0;sn)r.push(a);else{if(this.advanceStack(a,r,e))continue;{i||(i=[],o=[]),i.push(a);let l=this.tokens.getMainToken(a);o.push(l.value,l.end)}}break}}if(!r.length){let s=i&&nxn(i);if(s)return Il&&console.log("Finish with "+this.stackID(s)),this.stackToTree(s);if(this.parser.strict)throw Il&&i&&console.log("Stuck with token "+(this.tokens.mainToken?this.parser.getName(this.tokens.mainToken.value):"none")),new SyntaxError("No parse at "+n);this.recovering||(this.recovering=5)}if(this.recovering&&i){let s=this.stoppedAt!=null&&i[0].pos>this.stoppedAt?i[0]:this.runRecovery(i,o,r);if(s)return Il&&console.log("Force-finish "+this.stackID(s)),this.stackToTree(s.forceAll())}if(this.recovering){let s=this.recovering==1?1:this.recovering*3;if(r.length>s)for(r.sort((a,l)=>l.score-a.score);r.length>s;)r.pop();r.some(a=>a.reducePos>n)&&this.recovering--}else if(r.length>1){e:for(let s=0;s500&&c.buffer.length>500)if((a.score-c.score||a.buffer.length-c.buffer.length)>0)r.splice(l--,1);else{r.splice(s--,1);continue e}}}r.length>12&&r.splice(12,r.length-12)}this.minStackPos=r[0].pos;for(let s=1;s ":"";if(this.stoppedAt!=null&&i>this.stoppedAt)return e.forceReduce()?e:null;if(this.fragments){let c=e.curContext&&e.curContext.tracker.strict,u=c?e.curContext.hash:0;for(let f=this.fragments.nodeAt(i);f;){let d=this.parser.nodeSet.types[f.type.id]==f.type?o.getGoto(e.state,f.type.id):-1;if(d>-1&&f.length&&(!c||(f.prop(_n.contextHash)||0)==u))return e.useNode(f,d),Il&&console.log(s+this.stackID(e)+` (via reuse of ${o.getName(f.type.id)})`),!0;if(!(f instanceof lo)||f.children.length==0||f.positions[0]>0)break;let h=f.children[0];if(h instanceof lo&&f.positions[0]==0)f=h;else break}}let a=o.stateSlot(e.state,4);if(a>0)return e.reduce(a),Il&&console.log(s+this.stackID(e)+` (via always-reduce ${o.getName(a&65535)})`),!0;if(e.stack.length>=8400)for(;e.stack.length>6e3&&e.forceReduce(););let l=this.tokens.getActions(e);for(let c=0;ci?n.push(p):r.push(p)}return!1}advanceFully(e,n){let r=e.pos;for(;;){if(!this.advanceStack(e,null,null))return!1;if(e.pos>r)return Kwe(e,n),!0}}runRecovery(e,n,r){let i=null,o=!1;for(let s=0;s ":"";if(a.deadEnd&&(o||(o=!0,a.restart(),Il&&console.log(u+this.stackID(a)+" (restarted)"),this.advanceFully(a,r))))continue;let f=a.split(),d=u;for(let h=0;f.forceReduce()&&h<10&&(Il&&console.log(d+this.stackID(f)+" (via force-reduce)"),!this.advanceFully(f,r));h++)Il&&(d=this.stackID(f)+" -> ");for(let h of a.recoverByInsert(l))Il&&console.log(u+this.stackID(h)+" (via recover-insert)"),this.advanceFully(h,r);this.stream.end>a.pos?(c==a.pos&&(c++,l=0),a.recoverByDelete(l,c),Il&&console.log(u+this.stackID(a)+` (via recover-delete ${this.parser.getName(l)})`),Kwe(a,r)):(!i||i.scoret;class txn{constructor(e){this.start=e.start,this.shift=e.shift||k7,this.reduce=e.reduce||k7,this.reuse=e.reuse||k7,this.hash=e.hash||(()=>0),this.strict=e.strict!==!1}}class CP extends S7e{constructor(e){if(super(),this.wrappers=[],e.version!=14)throw new RangeError(`Parser version (${e.version}) doesn't match runtime version (14)`);let n=e.nodeNames.split(" ");this.minRepeatTerm=n.length;for(let a=0;ae.topRules[a][1]),i=[];for(let a=0;a=0)o(u,l,a[c++]);else{let f=a[c+-u];for(let d=-u;d>0;d--)o(a[c++],l,f);c++}}}this.nodeSet=new Vle(n.map((a,l)=>El.define({name:l>=this.minRepeatTerm?void 0:a,id:l,props:i[l],top:r.indexOf(l)>-1,error:l==0,skipped:e.skippedNodes&&e.skippedNodes.indexOf(l)>-1}))),e.propSources&&(this.nodeSet=this.nodeSet.extend(...e.propSources)),this.strict=!1,this.bufferLength=x7e;let s=VL(e.tokenData);this.context=e.context,this.specializerSpecs=e.specialized||[],this.specialized=new Uint16Array(this.specializerSpecs.length);for(let a=0;atypeof a=="number"?new tS(s,a):a),this.topRules=e.topRules,this.dialects=e.dialects||{},this.dynamicPrecedences=e.dynamicPrecedences||null,this.tokenPrecTable=e.tokenPrec,this.termNames=e.termNames||null,this.maxNode=this.nodeSet.types.length-1,this.dialect=this.parseDialect(),this.top=this.topRules[Object.keys(this.topRules)[0]]}createParse(e,n,r){let i=new J0n(this,e,n,r);for(let o of this.wrappers)i=o(i,e,n,r);return i}getGoto(e,n,r=!1){let i=this.goto;if(n>=i[0])return-1;for(let o=i[n+1];;){let s=i[o++],a=s&1,l=i[o++];if(a&&r)return l;for(let c=o+(s>>1);o0}validAction(e,n){return!!this.allActions(e,r=>r==n?!0:null)}allActions(e,n){let r=this.stateSlot(e,4),i=r?n(r):void 0;for(let o=this.stateSlot(e,1);i==null;o+=3){if(this.data[o]==65535)if(this.data[o+1]==1)o=Lp(this.data,o+2);else break;i=n(Lp(this.data,o+1))}return i}nextStates(e){let n=[];for(let r=this.stateSlot(e,1);;r+=3){if(this.data[r]==65535)if(this.data[r+1]==1)r=Lp(this.data,r+2);else break;if(!(this.data[r+2]&1)){let i=this.data[r+1];n.some((o,s)=>s&1&&o==i)||n.push(this.data[r],i)}}return n}configure(e){let n=Object.assign(Object.create(CP.prototype),this);if(e.props&&(n.nodeSet=this.nodeSet.extend(...e.props)),e.top){let r=this.topRules[e.top];if(!r)throw new RangeError(`Invalid top rule name ${e.top}`);n.top=r}return e.tokenizers&&(n.tokenizers=this.tokenizers.map(r=>{let i=e.tokenizers.find(o=>o.from==r);return i?i.to:r})),e.specializers&&(n.specializers=this.specializers.slice(),n.specializerSpecs=this.specializerSpecs.map((r,i)=>{let o=e.specializers.find(a=>a.from==r.external);if(!o)return r;let s=Object.assign(Object.assign({},r),{external:o.to});return n.specializers[i]=Zwe(s),s})),e.contextTracker&&(n.context=e.contextTracker),e.dialect&&(n.dialect=this.parseDialect(e.dialect)),e.strict!=null&&(n.strict=e.strict),e.wrap&&(n.wrappers=n.wrappers.concat(e.wrap)),e.bufferLength!=null&&(n.bufferLength=e.bufferLength),n}hasWrappers(){return this.wrappers.length>0}getName(e){return this.termNames?this.termNames[e]:String(e<=this.maxNode&&this.nodeSet.types[e].name||e)}get eofTerm(){return this.maxNode+1}get topNode(){return this.nodeSet.types[this.top[1]]}dynamicPrecedence(e){let n=this.dynamicPrecedences;return n==null?0:n[e]||0}parseDialect(e){let n=Object.keys(this.dialects),r=n.map(()=>!1);if(e)for(let o of e.split(" ")){let s=n.indexOf(o);s>=0&&(r[s]=!0)}let i=null;for(let o=0;or)&&n.p.parser.stateFlag(n.state,2)&&(!e||e.scoret.external(n,r)<<1|e}return t.get}const rxn=Xle({String:Ee.string,Number:Ee.number,"True False":Ee.bool,PropertyName:Ee.propertyName,Null:Ee.null,",":Ee.separator,"[ ]":Ee.squareBracket,"{ }":Ee.brace}),ixn=CP.deserialize({version:14,states:"$bOVQPOOOOQO'#Cb'#CbOnQPO'#CeOvQPO'#CjOOQO'#Cp'#CpQOQPOOOOQO'#Cg'#CgO}QPO'#CfO!SQPO'#CrOOQO,59P,59PO![QPO,59PO!aQPO'#CuOOQO,59U,59UO!iQPO,59UOVQPO,59QOqQPO'#CkO!nQPO,59^OOQO1G.k1G.kOVQPO'#ClO!vQPO,59aOOQO1G.p1G.pOOQO1G.l1G.lOOQO,59V,59VOOQO-E6i-E6iOOQO,59W,59WOOQO-E6j-E6j",stateData:"#O~OcOS~OQSORSOSSOTSOWQO]ROePO~OVXOeUO~O[[O~PVOg^O~Oh_OVfX~OVaO~OhbO[iX~O[dO~Oh_OVfa~OhbO[ia~O",goto:"!kjPPPPPPkPPkqwPPk{!RPPP!XP!ePP!hXSOR^bQWQRf_TVQ_Q`WRg`QcZRicQTOQZRQe^RhbRYQR]R",nodeNames:"⚠ JsonText True False Null Number String } { Object Property PropertyName ] [ Array",maxTerm:25,nodeProps:[["isolate",-2,6,11,""],["openedBy",7,"{",12,"["],["closedBy",8,"}",13,"]"]],propSources:[rxn],skippedNodes:[0],repeatNodeCount:2,tokenData:"(|~RaXY!WYZ!W]^!Wpq!Wrs!]|}$u}!O$z!Q!R%T!R![&c![!]&t!}#O&y#P#Q'O#Y#Z'T#b#c'r#h#i(Z#o#p(r#q#r(w~!]Oc~~!`Wpq!]qr!]rs!xs#O!]#O#P!}#P;'S!];'S;=`$o<%lO!]~!}Oe~~#QXrs!]!P!Q!]#O#P!]#U#V!]#Y#Z!]#b#c!]#f#g!]#h#i!]#i#j#m~#pR!Q![#y!c!i#y#T#Z#y~#|R!Q![$V!c!i$V#T#Z$V~$YR!Q![$c!c!i$c#T#Z$c~$fR!Q![!]!c!i!]#T#Z!]~$rP;=`<%l!]~$zOh~~$}Q!Q!R%T!R![&c~%YRT~!O!P%c!g!h%w#X#Y%w~%fP!Q![%i~%nRT~!Q![%i!g!h%w#X#Y%w~%zR{|&T}!O&T!Q![&Z~&WP!Q![&Z~&`PT~!Q![&Z~&hST~!O!P%c!Q![&c!g!h%w#X#Y%w~&yOg~~'OO]~~'TO[~~'WP#T#U'Z~'^P#`#a'a~'dP#g#h'g~'jP#X#Y'm~'rOR~~'uP#i#j'x~'{P#`#a(O~(RP#`#a(U~(ZOS~~(^P#f#g(a~(dP#i#j(g~(jP#X#Y(m~(rOQ~~(wOW~~(|OV~",tokenizers:[0],topRules:{JsonText:[0,1]},tokenPrec:0}),oxn=mP.define({name:"json",parser:ixn.configure({props:[Qle.add({Object:dwe({except:/^\s*\}/}),Array:dwe({except:/^\s*\]/})}),Zle.add({"Object Array":P7e})]}),languageData:{closeBrackets:{brackets:["[","{",'"']},indentOnInput:/^\s*[\}\]]$/}});function YGe(){return new T7e(oxn)}const sxn=1,QGe=194,KGe=195,axn=196,Jwe=197,lxn=198,cxn=199,uxn=200,fxn=2,ZGe=3,e_e=201,dxn=24,hxn=25,pxn=49,gxn=50,mxn=55,vxn=56,yxn=57,xxn=59,bxn=60,wxn=61,_xn=62,Sxn=63,Cxn=65,Oxn=238,Exn=71,Txn=241,kxn=242,Axn=243,Pxn=244,Mxn=245,Rxn=246,Dxn=247,Ixn=248,JGe=72,Lxn=249,$xn=250,Fxn=251,Nxn=252,zxn=253,jxn=254,Bxn=255,Uxn=256,Wxn=73,Vxn=77,Gxn=263,Hxn=112,qxn=130,Xxn=151,Yxn=152,Qxn=155,$b=10,OP=13,hce=32,zU=9,pce=35,Kxn=40,Zxn=46,FK=123,t_e=125,eHe=39,tHe=34,Jxn=92,ebn=111,tbn=120,nbn=78,rbn=117,ibn=85,obn=new Set([hxn,pxn,gxn,Gxn,Cxn,qxn,vxn,yxn,Oxn,_xn,Sxn,JGe,Wxn,Vxn,bxn,wxn,Xxn,Yxn,Qxn,Hxn]);function A7(t){return t==$b||t==OP}function P7(t){return t>=48&&t<=57||t>=65&&t<=70||t>=97&&t<=102}const sbn=new NU((t,e)=>{let n;if(t.next<0)t.acceptToken(cxn);else if(e.context.flags&X3)A7(t.next)&&t.acceptToken(lxn,1);else if(((n=t.peek(-1))<0||A7(n))&&e.canShift(Jwe)){let r=0;for(;t.next==hce||t.next==zU;)t.advance(),r++;(t.next==$b||t.next==OP||t.next==pce)&&t.acceptToken(Jwe,-r)}else A7(t.next)&&t.acceptToken(axn,1)},{contextual:!0}),abn=new NU((t,e)=>{let n=e.context;if(n.flags)return;let r=t.peek(-1);if(r==$b||r==OP){let i=0,o=0;for(;;){if(t.next==hce)i++;else if(t.next==zU)i+=8-i%8;else break;t.advance(),o++}i!=n.indent&&t.next!=$b&&t.next!=OP&&t.next!=pce&&(i[t,e|nHe])),ubn=new txn({start:lbn,reduce(t,e,n,r){return t.flags&X3&&obn.has(e)||(e==Exn||e==JGe)&&t.flags&nHe?t.parent:t},shift(t,e,n,r){return e==QGe?new Y3(t,cbn(r.read(r.pos,n.pos)),0):e==KGe?t.parent:e==dxn||e==mxn||e==xxn||e==ZGe?new Y3(t,0,X3):n_e.has(e)?new Y3(t,0,n_e.get(e)|t.flags&X3):t},hash(t){return t.hash}}),fbn=new NU(t=>{for(let e=0;e<5;e++){if(t.next!="print".charCodeAt(e))return;t.advance()}if(!/\w/.test(String.fromCharCode(t.next)))for(let e=0;;e++){let n=t.peek(e);if(!(n==hce||n==zU)){n!=Kxn&&n!=Zxn&&n!=$b&&n!=OP&&n!=pce&&t.acceptToken(sxn);return}}}),dbn=new NU((t,e)=>{let{flags:n}=e.context,r=n&bp?tHe:eHe,i=(n&wp)>0,o=!(n&_p),s=(n&Sp)>0,a=t.pos;for(;!(t.next<0);)if(s&&t.next==FK)if(t.peek(1)==FK)t.advance(2);else{if(t.pos==a){t.acceptToken(ZGe,1);return}break}else if(o&&t.next==Jxn){if(t.pos==a){t.advance();let l=t.next;l>=0&&(t.advance(),hbn(t,l)),t.acceptToken(fxn);return}break}else if(t.next==r&&(!i||t.peek(1)==r&&t.peek(2)==r)){if(t.pos==a){t.acceptToken(e_e,i?3:1);return}break}else if(t.next==$b){if(i)t.advance();else if(t.pos==a){t.acceptToken(e_e);return}break}else t.advance();t.pos>a&&t.acceptToken(uxn)});function hbn(t,e){if(e==ebn)for(let n=0;n<2&&t.next>=48&&t.next<=55;n++)t.advance();else if(e==tbn)for(let n=0;n<2&&P7(t.next);n++)t.advance();else if(e==rbn)for(let n=0;n<4&&P7(t.next);n++)t.advance();else if(e==ibn)for(let n=0;n<8&&P7(t.next);n++)t.advance();else if(e==nbn&&t.next==FK){for(t.advance();t.next>=0&&t.next!=t_e&&t.next!=eHe&&t.next!=tHe&&t.next!=$b;)t.advance();t.next==t_e&&t.advance()}}const pbn=Xle({'async "*" "**" FormatConversion FormatSpec':Ee.modifier,"for while if elif else try except finally return raise break continue with pass assert await yield match case":Ee.controlKeyword,"in not and or is del":Ee.operatorKeyword,"from def class global nonlocal lambda":Ee.definitionKeyword,import:Ee.moduleKeyword,"with as print":Ee.keyword,Boolean:Ee.bool,None:Ee.null,VariableName:Ee.variableName,"CallExpression/VariableName":Ee.function(Ee.variableName),"FunctionDefinition/VariableName":Ee.function(Ee.definition(Ee.variableName)),"ClassDefinition/VariableName":Ee.definition(Ee.className),PropertyName:Ee.propertyName,"CallExpression/MemberExpression/PropertyName":Ee.function(Ee.propertyName),Comment:Ee.lineComment,Number:Ee.number,String:Ee.string,FormatString:Ee.special(Ee.string),Escape:Ee.escape,UpdateOp:Ee.updateOperator,"ArithOp!":Ee.arithmeticOperator,BitOp:Ee.bitwiseOperator,CompareOp:Ee.compareOperator,AssignOp:Ee.definitionOperator,Ellipsis:Ee.punctuation,At:Ee.meta,"( )":Ee.paren,"[ ]":Ee.squareBracket,"{ }":Ee.brace,".":Ee.derefOperator,", ;":Ee.separator}),gbn={__proto__:null,await:44,or:54,and:56,in:60,not:62,is:64,if:70,else:72,lambda:76,yield:94,from:96,async:102,for:104,None:162,True:164,False:164,del:178,pass:182,break:186,continue:190,return:194,raise:202,import:206,as:208,global:212,nonlocal:214,assert:218,type:223,elif:236,while:240,try:246,except:248,finally:250,with:254,def:258,class:268,match:279,case:285},mbn=CP.deserialize({version:14,states:"##jO`QeOOP$}OSOOO&WQtO'#HUOOQS'#Co'#CoOOQS'#Cp'#CpO'vQdO'#CnO*UQtO'#HTOOQS'#HU'#HUOOQS'#DU'#DUOOQS'#HT'#HTO*rQdO'#D_O+VQdO'#DfO+gQdO'#DjO+zOWO'#DuO,VOWO'#DvO.[QtO'#GuOOQS'#Gu'#GuO'vQdO'#GtO0ZQtO'#GtOOQS'#Eb'#EbO0rQdO'#EcOOQS'#Gs'#GsO0|QdO'#GrOOQV'#Gr'#GrO1XQdO'#FYOOQS'#G^'#G^O1^QdO'#FXOOQV'#IS'#ISOOQV'#Gq'#GqOOQV'#Fq'#FqQ`QeOOO'vQdO'#CqO1lQdO'#C}O1sQdO'#DRO2RQdO'#HYO2cQtO'#EVO'vQdO'#EWOOQS'#EY'#EYOOQS'#E['#E[OOQS'#E^'#E^O2wQdO'#E`O3_QdO'#EdO3rQdO'#EfO3zQtO'#EfO1XQdO'#EiO0rQdO'#ElO1XQdO'#EnO0rQdO'#EtO0rQdO'#EwO4VQdO'#EyO4^QdO'#FOO4iQdO'#EzO0rQdO'#FOO1XQdO'#FQO1XQdO'#FVO4nQdO'#F[P4uOdO'#GpPOOO)CBd)CBdOOQS'#Ce'#CeOOQS'#Cf'#CfOOQS'#Cg'#CgOOQS'#Ch'#ChOOQS'#Ci'#CiOOQS'#Cj'#CjOOQS'#Cl'#ClO'vQdO,59OO'vQdO,59OO'vQdO,59OO'vQdO,59OO'vQdO,59OO'vQdO,59OO5QQdO'#DoOOQS,5:Y,5:YO5eQdO'#HdOOQS,5:],5:]O5rQ!fO,5:]O5wQtO,59YO1lQdO,59bO1lQdO,59bO1lQdO,59bO8gQdO,59bO8lQdO,59bO8sQdO,59jO8zQdO'#HTO:QQdO'#HSOOQS'#HS'#HSOOQS'#D['#D[O:iQdO,59aO'vQdO,59aO:wQdO,59aOOQS,59y,59yO:|QdO,5:RO'vQdO,5:ROOQS,5:Q,5:QO;[QdO,5:QO;aQdO,5:XO'vQdO,5:XO'vQdO,5:VOOQS,5:U,5:UO;rQdO,5:UO;wQdO,5:WOOOW'#Fy'#FyO;|OWO,5:aOOQS,5:a,5:aOOOOQS'#Ds'#DsOOQS1G/w1G/wOOQS1G.|1G.|O!/RQtO1G.|O!/YQtO1G.|O1lQdO1G.|O!/uQdO1G/UOOQS'#DZ'#DZO0rQdO,59tOOQS1G.{1G.{O!/|QdO1G/eO!0^QdO1G/eO!0fQdO1G/fO'vQdO'#H[O!0kQdO'#H[O!0pQtO1G.{O!1QQdO,59iO!2WQdO,5=zO!2hQdO,5=zO!2pQdO1G/mO!2uQtO1G/mOOQS1G/l1G/lO!3VQdO,5=uO!3|QdO,5=uO0rQdO1G/qO!4kQdO1G/sO!4pQtO1G/sO!5QQtO1G/qOOQS1G/p1G/pOOQS1G/r1G/rOOOW-E9w-E9wOOQS1G/{1G/{O!5bQdO'#HxO0rQdO'#HxO!5sQdO,5>cOOOW-E9x-E9xOOQS1G/|1G/|OOQS-E9{-E9{O!6RQ#xO1G2zO!6rQtO1G2zO'vQdO,5kOOQS1G1`1G1`O!7xQdO1G1`OOQS'#DV'#DVO0rQdO,5=qOOQS,5=q,5=qO!7}QdO'#FrO!8YQdO,59oO!8bQdO1G/XO!8lQtO,5=uOOQS1G3`1G3`OOQS,5:m,5:mO!9]QdO'#GtOOQS,5jO!;QQdO,5>jO1XQdO,5>jO!;cQdO,5>iOOQS-E:R-E:RO!;hQdO1G0lO!;sQdO1G0lO!;xQdO,5>lO!lO!hO!<|QdO,5>hO!=_QdO'#EpO0rQdO1G0tO!=jQdO1G0tO!=oQgO1G0zO!AmQgO1G0}O!EhQdO,5>oO!ErQdO,5>oO!EzQtO,5>oO0rQdO1G1PO!FUQdO1G1PO4iQdO1G1UO!!sQdO1G1WOOQV,5;a,5;aO!FZQfO,5;aO!F`QgO1G1QO!JaQdO'#GZO4iQdO1G1QO4iQdO1G1QO!JqQdO,5>pO!KOQdO,5>pO1XQdO,5>pOOQV1G1U1G1UO!KWQdO'#FSO!KiQ!fO1G1WO!KqQdO1G1WOOQV1G1]1G1]O4iQdO1G1]O!KvQdO1G1]O!LOQdO'#F^OOQV1G1b1G1bO!#WQtO1G1bPOOO1G2v1G2vP!LTOSO1G2vOOQS,5=},5=}OOQS'#Dp'#DpO0rQdO,5=}O!LYQdO,5=|O!LmQdO,5=|OOQS1G/u1G/uO!LuQdO,5>PO!MVQdO,5>PO!M_QdO,5>PO!MrQdO,5>PO!NSQdO,5>POOQS1G3j1G3jOOQS7+$h7+$hO!8bQdO7+$pO# uQdO1G.|O# |QdO1G.|OOQS1G/`1G/`OOQS,5<`,5<`O'vQdO,5<`OOQS7+%P7+%PO#!TQdO7+%POOQS-E9r-E9rOOQS7+%Q7+%QO#!eQdO,5=vO'vQdO,5=vOOQS7+$g7+$gO#!jQdO7+%PO#!rQdO7+%QO#!wQdO1G3fOOQS7+%X7+%XO##XQdO1G3fO##aQdO7+%XOOQS,5<_,5<_O'vQdO,5<_O##fQdO1G3aOOQS-E9q-E9qO#$]QdO7+%]OOQS7+%_7+%_O#$kQdO1G3aO#%YQdO7+%_O#%_QdO1G3gO#%oQdO1G3gO#%wQdO7+%]O#%|QdO,5>dO#&gQdO,5>dO#&gQdO,5>dOOQS'#Dx'#DxO#&xO&jO'#DzO#'TO`O'#HyOOOW1G3}1G3}O#'YQdO1G3}O#'bQdO1G3}O#'mQ#xO7+(fO#(^QtO1G2UP#(wQdO'#GOOOQS,5bQdO,5gQdO1G4OOOQS-E9y-E9yO#?QQdO1G4OOe,5>eOOOW7+)i7+)iO#?nQdO7+)iO#?vQdO1G2zO#@aQdO1G2zP'vQdO'#FuO0rQdO<mO#AtQdO,5>mOOQS1G0v1G0vOOQS<rO#KZQdO,5>rOOQS,5>r,5>rO#KfQdO,5>qO#KwQdO,5>qOOQS1G1Y1G1YOOQS,5;p,5;pOOQV<VAN>VO$ WQdO<cAN>cO0rQdO1G1|O$ hQtO1G1|P$ rQdO'#FvOOQS1G2R1G2RP$!PQdO'#F{O$!^QdO7+)jO$!wQdO,5>gOOOO-E9z-E9zOOOW<tO$4dQdO,5>tO1XQdO,5vO$)VQdO,5>vOOQS1G1p1G1pO$8[QtO,5<[OOQU7+'P7+'PO$+cQdO1G/iO$)VQdO,5wO$8jQdO,5>wOOQS1G1s1G1sOOQS7+'S7+'SP$)VQdO'#GdO$8rQdO1G4bO$8|QdO1G4bO$9UQdO1G4bOOQS7+%T7+%TO$9dQdO1G1tO$9rQtO'#FaO$9yQdO,5<}OOQS,5<},5<}O$:XQdO1G4cOOQS-E:a-E:aO$)VQdO,5<|O$:`QdO,5<|O$:eQdO7+)|OOQS-E:`-E:`O$:oQdO7+)|O$)VQdO,5m>pPP'Z'ZPP?PPP'Z'ZPP'Z'Z'Z'Z'Z?T?}'ZP@QP@WD_G{HPPHSH^Hb'ZPPPHeHn'RP'R'RP'RP'RP'RP'RP'R'R'RP'RPP'RPP'RP'RPHtIQIYPIaIgPIaPIaIaPPPIaPKuPLOLYL`KuPIaLiPIaPLpLvPLzM`M}NhLzLzNnN{LzLzLzLz! a! g! j! o! r! |!!S!!`!!r!!x!#S!#Y!#v!#|!$S!$^!$d!$j!$|!%W!%^!%d!%n!%t!%z!&Q!&W!&^!&h!&n!&x!'O!'X!'_!'n!'v!(Q!(XPPPPPPPPPPP!(_!(b!(h!(q!({!)WPPPPPPPPPPPP!-z!/`!3`!6pPP!6x!7X!7b!8Z!8Q!8d!8j!8m!8p!8s!8{!9lPPPPPPPPPPPPPPPPP!9o!9s!9yP!:_!:c!:o!:x!;U!;l!;o!;r!;x!_![!]Do!]!^Es!^!_FZ!_!`Gk!`!aHX!a!b%T!b!cIf!c!dJU!d!eK^!e!hJU!h!i!#f!i!tJU!t!u!,|!u!wJU!w!x!.t!x!}JU!}#O!0S#O#P&o#P#Q!0j#Q#R!1Q#R#SJU#S#T%T#T#UJU#U#VK^#V#YJU#Y#Z!#f#Z#fJU#f#g!,|#g#iJU#i#j!.t#j#oJU#o#p!1n#p#q!1s#q#r!2a#r#s!2f#s$g%T$g;'SJU;'S;=`KW<%lOJU`%YT&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%T`%lP;=`<%l%To%v]&n`%c_OX%TXY%oY[%T[]%o]p%Tpq%oq#O%T#O#P&o#P#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%To&tX&n`OY%TYZ%oZ]%T]^%o^#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tc'f[&n`O!_%T!_!`([!`#T%T#T#U(r#U#f%T#f#g(r#g#h(r#h#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tc(cTmR&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tc(yT!mR&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk)aV&n`&[ZOr%Trs)vs#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk){V&n`Or%Trs*bs#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk*iT&n`&^ZO#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%To+PZS_&n`OY*xYZ%TZ]*x]^%T^#o*x#o#p+r#p#q*x#q#r+r#r;'S*x;'S;=`,^<%lO*x_+wTS_OY+rZ]+r^;'S+r;'S;=`,W<%lO+r_,ZP;=`<%l+ro,aP;=`<%l*xj,kV%rQ&n`O!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tj-XT!xY&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tj-oV%lQ&n`O!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk.]V&n`&ZZOw%Twx.rx#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk.wV&n`Ow%Twx/^x#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk/eT&n`&]ZO#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk/{ThZ&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tc0cTgR&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk0yXVZ&n`Oz%Tz{1f{!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk1mVaR&n`O!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk2ZV%oZ&n`O!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tc2wTzR&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%To3_W%pZ&n`O!_%T!_!`-Q!`!a3w!a#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Td4OT&{S&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk4fX!fQ&n`O!O%T!O!P5R!P!Q%T!Q![6T![#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk5WV&n`O!O%T!O!P5m!P#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk5tT!rZ&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Ti6[a!hX&n`O!Q%T!Q![6T![!g%T!g!h7a!h!l%T!l!m9s!m#R%T#R#S6T#S#X%T#X#Y7a#Y#^%T#^#_9s#_#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Ti7fZ&n`O{%T{|8X|}%T}!O8X!O!Q%T!Q![8s![#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Ti8^V&n`O!Q%T!Q![8s![#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Ti8z]!hX&n`O!Q%T!Q![8s![!l%T!l!m9s!m#R%T#R#S8s#S#^%T#^#_9s#_#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Ti9zT!hX&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk:bX%qR&n`O!P%T!P!Q:}!Q!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tj;UV%sQ&n`O!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Ti;ro!hX&n`O!O%T!O!P=s!P!Q%T!Q![>_![!d%T!d!e?q!e!g%T!g!h7a!h!l%T!l!m9s!m!q%T!q!rA]!r!z%T!z!{Bq!{#R%T#R#S>_#S#U%T#U#V?q#V#X%T#X#Y7a#Y#^%T#^#_9s#_#c%T#c#dA]#d#l%T#l#mBq#m#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Ti=xV&n`O!Q%T!Q![6T![#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Ti>fc!hX&n`O!O%T!O!P=s!P!Q%T!Q![>_![!g%T!g!h7a!h!l%T!l!m9s!m#R%T#R#S>_#S#X%T#X#Y7a#Y#^%T#^#_9s#_#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Ti?vY&n`O!Q%T!Q!R@f!R!S@f!S#R%T#R#S@f#S#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Ti@mY!hX&n`O!Q%T!Q!R@f!R!S@f!S#R%T#R#S@f#S#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TiAbX&n`O!Q%T!Q!YA}!Y#R%T#R#SA}#S#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TiBUX!hX&n`O!Q%T!Q!YA}!Y#R%T#R#SA}#S#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TiBv]&n`O!Q%T!Q![Co![!c%T!c!iCo!i#R%T#R#SCo#S#T%T#T#ZCo#Z#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TiCv]!hX&n`O!Q%T!Q![Co![!c%T!c!iCo!i#R%T#R#SCo#S#T%T#T#ZCo#Z#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%ToDvV{_&n`O!_%T!_!`E]!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TcEdT%{R&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TkEzT#gZ&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TkFbXmR&n`O!^%T!^!_F}!_!`([!`!a([!a#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TjGUV%mQ&n`O!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TkGrV%zZ&n`O!_%T!_!`([!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TkH`WmR&n`O!_%T!_!`([!`!aHx!a#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TjIPV%nQ&n`O!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TkIoV_Q#}P&n`O!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%ToJ_]&n`&YS%uZO!Q%T!Q![JU![!c%T!c!}JU!}#R%T#R#SJU#S#T%T#T#oJU#p#q%T#r$g%T$g;'SJU;'S;=`KW<%lOJUoKZP;=`<%lJUoKge&n`&YS%uZOr%Trs)Ysw%Twx.Ux!Q%T!Q![JU![!c%T!c!tJU!t!uLx!u!}JU!}#R%T#R#SJU#S#T%T#T#fJU#f#gLx#g#oJU#p#q%T#r$g%T$g;'SJU;'S;=`KW<%lOJUoMRa&n`&YS%uZOr%TrsNWsw%Twx! vx!Q%T!Q![JU![!c%T!c!}JU!}#R%T#R#SJU#S#T%T#T#oJU#p#q%T#r$g%T$g;'SJU;'S;=`KW<%lOJUkN_V&n`&`ZOr%TrsNts#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TkNyV&n`Or%Trs! `s#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk! gT&n`&bZO#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk! }V&n`&_ZOw%Twx!!dx#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!!iV&n`Ow%Twx!#Ox#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!#VT&n`&aZO#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%To!#oe&n`&YS%uZOr%Trs!%Qsw%Twx!&px!Q%T!Q![JU![!c%T!c!tJU!t!u!(`!u!}JU!}#R%T#R#SJU#S#T%T#T#fJU#f#g!(`#g#oJU#p#q%T#r$g%T$g;'SJU;'S;=`KW<%lOJUk!%XV&n`&dZOr%Trs!%ns#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!%sV&n`Or%Trs!&Ys#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!&aT&n`&fZO#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!&wV&n`&cZOw%Twx!'^x#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!'cV&n`Ow%Twx!'xx#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!(PT&n`&eZO#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%To!(ia&n`&YS%uZOr%Trs!)nsw%Twx!+^x!Q%T!Q![JU![!c%T!c!}JU!}#R%T#R#SJU#S#T%T#T#oJU#p#q%T#r$g%T$g;'SJU;'S;=`KW<%lOJUk!)uV&n`&hZOr%Trs!*[s#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!*aV&n`Or%Trs!*vs#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!*}T&n`&jZO#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!+eV&n`&gZOw%Twx!+zx#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!,PV&n`Ow%Twx!,fx#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!,mT&n`&iZO#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%To!-Vi&n`&YS%uZOr%TrsNWsw%Twx! vx!Q%T!Q![JU![!c%T!c!dJU!d!eLx!e!hJU!h!i!(`!i!}JU!}#R%T#R#SJU#S#T%T#T#UJU#U#VLx#V#YJU#Y#Z!(`#Z#oJU#p#q%T#r$g%T$g;'SJU;'S;=`KW<%lOJUo!.}a&n`&YS%uZOr%Trs)Ysw%Twx.Ux!Q%T!Q![JU![!c%T!c!}JU!}#R%T#R#SJU#S#T%T#T#oJU#p#q%T#r$g%T$g;'SJU;'S;=`KW<%lOJUk!0ZT!XZ&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tc!0qT!WR&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tj!1XV%kQ&n`O!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%T~!1sO!]~k!1zV%jR&n`O!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%T~!2fO![~i!2mT%tX&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%T",tokenizers:[fbn,abn,sbn,dbn,0,1,2,3,4],topRules:{Script:[0,5]},specialized:[{term:221,get:t=>gbn[t]||-1}],tokenPrec:7652}),r_e=new Lgn,rHe=new Set(["Script","Body","FunctionDefinition","ClassDefinition","LambdaExpression","ForStatement","MatchClause"]);function GL(t){return(e,n,r)=>{if(r)return!1;let i=e.node.getChild("VariableName");return i&&n(i,t),!0}}const vbn={FunctionDefinition:GL("function"),ClassDefinition:GL("class"),ForStatement(t,e,n){if(n){for(let r=t.node.firstChild;r;r=r.nextSibling)if(r.name=="VariableName")e(r,"variable");else if(r.name=="in")break}},ImportStatement(t,e){var n,r;let{node:i}=t,o=((n=i.firstChild)===null||n===void 0?void 0:n.name)=="from";for(let s=i.getChild("import");s;s=s.nextSibling)s.name=="VariableName"&&((r=s.nextSibling)===null||r===void 0?void 0:r.name)!="as"&&e(s,o?"variable":"namespace")},AssignStatement(t,e){for(let n=t.node.firstChild;n;n=n.nextSibling)if(n.name=="VariableName")e(n,"variable");else if(n.name==":"||n.name=="AssignOp")break},ParamList(t,e){for(let n=null,r=t.node.firstChild;r;r=r.nextSibling)r.name=="VariableName"&&(!n||!/\*|AssignOp/.test(n.name))&&e(r,"variable"),n=r},CapturePattern:GL("variable"),AsPattern:GL("variable"),__proto__:null};function iHe(t,e){let n=r_e.get(e);if(n)return n;let r=[],i=!0;function o(s,a){let l=t.sliceString(s.from,s.to);r.push({label:l,type:a})}return e.cursor(yo.IncludeAnonymous).iterate(s=>{if(s.name){let a=vbn[s.name];if(a&&a(s,o,i)||!i&&rHe.has(s.name))return!1;i=!1}else if(s.to-s.from>8192){for(let a of iHe(t,s.node))r.push(a);return!1}}),r_e.set(e,r),r}const i_e=/^[\w\xa1-\uffff][\w\d\xa1-\uffff]*$/,oHe=["String","FormatString","Comment","PropertyName"];function ybn(t){let e=Vo(t.state).resolveInner(t.pos,-1);if(oHe.indexOf(e.name)>-1)return null;let n=e.name=="VariableName"||e.to-e.from<20&&i_e.test(t.state.sliceDoc(e.from,e.to));if(!n&&!t.explicit)return null;let r=[];for(let i=e;i;i=i.parent)rHe.has(i.name)&&(r=r.concat(iHe(t.state.doc,i)));return{options:r,from:n?e.from:t.pos,validFor:i_e}}const xbn=["__annotations__","__builtins__","__debug__","__doc__","__import__","__name__","__loader__","__package__","__spec__","False","None","True"].map(t=>({label:t,type:"constant"})).concat(["ArithmeticError","AssertionError","AttributeError","BaseException","BlockingIOError","BrokenPipeError","BufferError","BytesWarning","ChildProcessError","ConnectionAbortedError","ConnectionError","ConnectionRefusedError","ConnectionResetError","DeprecationWarning","EOFError","Ellipsis","EncodingWarning","EnvironmentError","Exception","FileExistsError","FileNotFoundError","FloatingPointError","FutureWarning","GeneratorExit","IOError","ImportError","ImportWarning","IndentationError","IndexError","InterruptedError","IsADirectoryError","KeyError","KeyboardInterrupt","LookupError","MemoryError","ModuleNotFoundError","NameError","NotADirectoryError","NotImplemented","NotImplementedError","OSError","OverflowError","PendingDeprecationWarning","PermissionError","ProcessLookupError","RecursionError","ReferenceError","ResourceWarning","RuntimeError","RuntimeWarning","StopAsyncIteration","StopIteration","SyntaxError","SyntaxWarning","SystemError","SystemExit","TabError","TimeoutError","TypeError","UnboundLocalError","UnicodeDecodeError","UnicodeEncodeError","UnicodeError","UnicodeTranslateError","UnicodeWarning","UserWarning","ValueError","Warning","ZeroDivisionError"].map(t=>({label:t,type:"type"}))).concat(["bool","bytearray","bytes","classmethod","complex","float","frozenset","int","list","map","memoryview","object","range","set","staticmethod","str","super","tuple","type"].map(t=>({label:t,type:"class"}))).concat(["abs","aiter","all","anext","any","ascii","bin","breakpoint","callable","chr","compile","delattr","dict","dir","divmod","enumerate","eval","exec","exit","filter","format","getattr","globals","hasattr","hash","help","hex","id","input","isinstance","issubclass","iter","len","license","locals","max","min","next","oct","open","ord","pow","print","property","quit","repr","reversed","round","setattr","slice","sorted","sum","vars","zip"].map(t=>({label:t,type:"function"}))),bbn=[fp("def ${name}(${params}):\n ${}",{label:"def",detail:"function",type:"keyword"}),fp("for ${name} in ${collection}:\n ${}",{label:"for",detail:"loop",type:"keyword"}),fp("while ${}:\n ${}",{label:"while",detail:"loop",type:"keyword"}),fp("try:\n ${}\nexcept ${error}:\n ${}",{label:"try",detail:"/ except block",type:"keyword"}),fp(`if \${}: -`,{label:"if",detail:"block",type:"keyword"}),pp("if ${}:\n ${}\nelse:\n ${}",{label:"if",detail:"/ else block",type:"keyword"}),pp("class ${name}:\n def __init__(self, ${params}):\n ${}",{label:"class",detail:"definition",type:"keyword"}),pp("import ${module}",{label:"import",detail:"statement",type:"keyword"}),pp("from ${module} import ${names}",{label:"from",detail:"import",type:"keyword"})],T1n=Tyn(RGe,oGe(O1n.concat(E1n)));function Rwe(t,e){let n=t.baseIndentFor(e),r=t.lineAt(t.pos,-1),i=r.from+r.text.length;return/^\s*($|#)/.test(r.text)&&t.node.ton?null:n+t.unit}const m7=mP.define({name:"python",parser:_1n.configure({props:[Rle.add({Body:t=>{var e;return(e=Rwe(t,t.node))!==null&&e!==void 0?e:t.continue()},IfStatement:t=>/^\s*(else:|elif )/.test(t.textAfter)?t.baseIndent:t.continue(),TryStatement:t=>/^\s*(except |finally:|else:)/.test(t.textAfter)?t.baseIndent:t.continue(),"TupleExpression ComprehensionExpression ParamList ArgList ParenthesizedExpression":n7({closing:")"}),"DictionaryExpression DictionaryComprehensionExpression SetExpression SetComprehensionExpression":n7({closing:"}"}),"ArrayExpression ArrayComprehensionExpression":n7({closing:"]"}),"String FormatString":()=>null,Script:t=>{if(t.pos+/\s*/.exec(t.textAfter)[0].length>=t.node.to){let e=null;for(let n=t.node,r=n.to;n=n.lastChild,!(!n||n.to!=r);)n.type.name=="Body"&&(e=n);if(e){let n=Rwe(t,e);if(n!=null)return n}}return t.continue()}}),Ile.add({"ArrayExpression DictionaryExpression SetExpression TupleExpression":r7e,Body:(t,e)=>({from:t.from+1,to:t.to-(t.to==e.doc.length?0:1)})})]}),languageData:{closeBrackets:{brackets:["(","[","{","'",'"',"'''",'"""'],stringPrefixes:["f","fr","rf","r","u","b","br","rb","F","FR","RF","R","U","B","BR","RB"]},commentTokens:{line:"#"},indentOnInput:/^\s*([\}\]\)]|else:|elif |except |finally:)$/}});function k1n(){return new e7e(m7,[m7.data.of({autocomplete:C1n}),m7.data.of({autocomplete:T1n})])}const A1n=""+new URL("python-bw-BV0FRHt1.png",import.meta.url).href,CC={card:t=>({maxWidth:"100%",marginBottom:t.spacing(1),marginRight:t.spacing(1)}),info:t=>({marginRight:t.spacing(1)}),close:{marginLeft:"auto"},table:{},keyValueTableContainer:t=>({background:t.palette.divider}),variableHtmlReprContainer:t=>({background:t.palette.divider,padding:t.spacing(1),marginTop:t.spacing(1),marginBottom:t.spacing(1)}),media:{height:200},cardContent:{padding:"8px"},code:{fontFamily:"Monospace"}},P1n=({visibleInfoCardElements:t,setVisibleInfoCardElements:e,infoCardElementViewModes:n,updateInfoCardElementViewMode:r,selectedDataset:i,selectedVariable:o,selectedPlaceInfo:s,selectedTime:a,serverConfig:l,allowViewModePython:c})=>{const u=(p,g)=>{e(g)};let f,d,h;if(i){const p="dataset",g=n[p],m=y=>r(p,y),v=t.includes(p);f=C.jsx(M1n,{isIn:v,viewMode:g,setViewMode:m,dataset:i,serverConfig:l,hasPython:c})}if(i&&o){const p="variable",g=n[p],m=y=>r(p,y),v=t.includes(p);d=C.jsx(R1n,{isIn:v,viewMode:g,setViewMode:m,variable:o,time:a,serverConfig:l,hasPython:c})}if(s){const p="place",g=n[p],m=y=>r(p,y),v=t.includes(p);h=C.jsx(D1n,{isIn:v,viewMode:g,setViewMode:m,placeInfo:s})}return C.jsxs(LAe,{sx:CC.card,children:[C.jsx($Ae,{disableSpacing:!0,children:C.jsxs(KC,{size:"small",value:t,onChange:u,children:[C.jsx(yr,{value:"dataset",disabled:i===null,size:"small",sx:ol.toggleButton,children:C.jsx(Rt,{arrow:!0,title:ge.get("Dataset information"),children:C.jsx(Ndn,{})})},0),C.jsx(yr,{value:"variable",disabled:o===null,size:"small",sx:ol.toggleButton,children:C.jsx(Rt,{arrow:!0,title:ge.get("Variable information"),children:C.jsx(mVe,{})})},1),C.jsx(yr,{value:"place",disabled:s===null,size:"small",sx:ol.toggleButton,children:C.jsx(Rt,{arrow:!0,title:ge.get("Place information"),children:C.jsx($dn,{})})},2)]},0)}),f,d,h]})},M1n=({isIn:t,viewMode:e,setViewMode:n,dataset:r,serverConfig:i,hasPython:o})=>{let s;if(e==="code"){const a=r.dimensions.map(c=>_K(c,["name","size","dtype"])),l=_K(r,["id","title","bbox","attrs"]);l.dimensions=a,s=C.jsx(Zle,{code:JSON.stringify(l,null,2)})}else if(e==="list")s=C.jsx(gg,{children:C.jsx(EP,{data:Object.getOwnPropertyNames(r.attrs||{}).map(a=>[a,r.attrs[a]])})});else if(e==="text"){const a=[[ge.get("Dimension names"),r.dimensions.map(l=>l.name).join(", ")],[ge.get("Dimension data types"),r.dimensions.map(l=>l.dtype).join(", ")],[ge.get("Dimension lengths"),r.dimensions.map(l=>l.size).join(", ")],[ge.get("Geographical extent")+" (x1, y1, x2, y2)",r.bbox.map(l=>l+"").join(", ")],[ge.get("Spatial reference system"),r.spatialRef]];s=C.jsx(gg,{children:C.jsx(EP,{data:a})})}else e==="python"&&(s=C.jsx(IGe,{code:I1n(i,r)}));return C.jsx(Kle,{title:r.title||"?",subheader:r.title&&`ID: ${r.id}`,isIn:t,viewMode:e,setViewMode:n,hasPython:o,children:s})},R1n=({isIn:t,viewMode:e,setViewMode:n,variable:r,time:i,serverConfig:o,hasPython:s})=>{let a,l;if(e==="code"){const c=_K(r,["id","name","title","units","expression","shape","dtype","shape","timeChunkSize","colorBarMin","colorBarMax","colorBarName","attrs"]);a=C.jsx(Zle,{code:JSON.stringify(c,null,2)})}else if(e==="list"){if(a=C.jsx(gg,{children:C.jsx(EP,{data:Object.getOwnPropertyNames(r.attrs||{}).map(c=>[c,r.attrs[c]])})}),r.htmlRepr){const c=u=>{u&&r.htmlRepr&&(u.innerHTML=r.htmlRepr)};l=C.jsx(gg,{children:C.jsx(Al,{ref:c,sx:CC.variableHtmlReprContainer})})}}else if(e==="text"){let c=[[ge.get("Name"),r.name],[ge.get("Title"),r.title],[ge.get("Units"),r.units]];jM(r)?c.push([ge.get("Expression"),r.expression]):c=[...c,[ge.get("Data type"),r.dtype],[ge.get("Dimension names"),r.dims.join(", ")],[ge.get("Dimension lengths"),r.shape.map(u=>u+"").join(", ")],[ge.get("Time chunk size"),r.timeChunkSize]],a=C.jsx(gg,{children:C.jsx(EP,{data:c})})}else e==="python"&&(a=C.jsx(IGe,{code:L1n(o,r,i)}));return C.jsxs(Kle,{title:r.title||r.name,subheader:`${ge.get("Name")}: ${r.name}`,isIn:t,viewMode:e,setViewMode:n,hasPython:s,children:[l,a]})},D1n=({isIn:t,viewMode:e,setViewMode:n,placeInfo:r})=>{const i=r.place;let o,s,a;if(e==="code")o=C.jsx(Zle,{code:JSON.stringify(i,null,2)});else if(e==="list")if(i.properties){const l=Object.getOwnPropertyNames(i.properties).map(c=>[c,i.properties[c]]);o=C.jsx(gg,{children:C.jsx(EP,{data:l})})}else o=C.jsx(gg,{children:C.jsx(Jt,{children:ge.get("There is no information available for this location.")})});else r.image&&r.image.startsWith("http")&&(s=C.jsx(Got,{sx:CC.media,image:r.image,title:r.label})),r.description&&(a=C.jsx(gg,{children:C.jsx(Jt,{children:r.description})}));return C.jsxs(Kle,{title:r.label,subheader:`${ge.get("Geometry type")}: ${ge.get(i.geometry.type)}`,isIn:t,viewMode:e,setViewMode:n,children:[s,a,o]})},Kle=({isIn:t,title:e,subheader:n,viewMode:r,setViewMode:i,hasPython:o,children:s})=>{const a=(l,c)=>{i(c)};return C.jsxs(DF,{in:t,timeout:"auto",unmountOnExit:!0,children:[C.jsx(zot,{title:e,subheader:n,titleTypographyProps:{fontSize:"1.1em"},action:C.jsxs(KC,{size:"small",value:r,exclusive:!0,onChange:a,children:[C.jsx(yr,{value:"text",size:"small",sx:ol.toggleButton,children:C.jsx(Rt,{arrow:!0,title:ge.get("Textual format"),children:C.jsx(Fdn,{})})},0),C.jsx(yr,{value:"list",size:"small",sx:ol.toggleButton,children:C.jsx(Rt,{arrow:!0,title:ge.get("Tabular format"),children:C.jsx(Ldn,{})})},1),C.jsx(yr,{value:"code",size:"small",sx:ol.toggleButton,children:C.jsx(Rt,{arrow:!0,title:ge.get("JSON format"),children:C.jsx(Idn,{})})},2),o&&C.jsx(yr,{value:"python",size:"small",sx:{...ol.toggleButton,width:"30px"},children:C.jsx("img",{src:A1n,width:16,alt:"python logo"})},3)]},0)}),s]})},EP=({data:t})=>C.jsx(nPe,{component:Al,sx:CC.keyValueTableContainer,children:C.jsx(Pee,{sx:CC.table,size:"small",children:C.jsx(Mee,{children:t.map((e,n)=>{const[r,i]=e;let o=i;return typeof i=="string"&&(i.startsWith("http://")||i.startsWith("https://"))?o=C.jsx(slt,{href:i,target:"_blank",rel:"noreferrer",children:i}):Array.isArray(i)&&(o="["+i.map(s=>s+"").join(", ")+"]"),C.jsxs(Ad,{children:[C.jsx(si,{children:r}),C.jsx(si,{align:"right",children:o})]},n)})})})}),gg=({children:t})=>C.jsx(FAe,{sx:CC.cardContent,children:t}),DGe=({code:t,extension:e})=>C.jsx(gg,{children:C.jsx(FU,{theme:wn.instance.branding.themeName||"light",height:"320px",extensions:[e],value:t,readOnly:!0})}),Zle=({code:t})=>C.jsx(DGe,{code:t,extension:_Ge()}),IGe=({code:t})=>C.jsx(DGe,{code:t,extension:k1n()});function _K(t,e){const n={};for(const r of e)r in t&&(n[r]=t[r]);return n}function I1n(t,e){const n=$1n(e.id);return["from xcube.core.store import new_data_store","","store = new_data_store(",' "s3",',' root="datasets", # can also use "pyramids" here'," storage_options={",' "anon": True,',' "client_kwargs": {',` "endpoint_url": "${t.url}/s3"`," }"," }",")","# store.list_data_ids()",`dataset = store.open_data(data_id="${n}")`].join(` -`)}function L1n(t,e,n){const r=e.name,i=e.colorBarMin,o=e.colorBarMax,s=e.colorBarName;let a="";n!==null&&(a=`sel(time="${lO(n)}", method="nearest")`);const l=[];if(jM(e)){const c=e.expression;l.push("from xcube.util.expression import compute_array_expr"),l.push("from xcube.util.expression import new_dataset_namespace"),l.push(""),l.push("namespace = new_dataset_namespace(dataset)"),l.push(`${r} = compute_array_expr("${c}", namespace`),a&&l.push(`${r} = ${r}.${a}`)}else a?l.push(`${r} = dataset.${r}.${a}`):l.push(`${r} = dataset.${r}`);return l.push(`${r}.plot.imshow(vmin=${i}, vmax=${o}, cmap="${s}")`),l.join(` -`)}function $1n(t){return F1n(t)[0]+".zarr"}function F1n(t){const e=t.lastIndexOf(".");return e>=0?[t.substring(0,e),t.substring(e)]:[t,""]}const N1n=t=>({locale:t.controlState.locale,visibleInfoCardElements:T_t(t),infoCardElementViewModes:k_t(t),selectedDataset:ho(t),selectedVariable:ja(t),selectedPlaceInfo:eR(t),selectedTime:KM(t),serverConfig:ji(t),allowViewModePython:!!wn.instance.branding.allowViewModePython}),z1n={setVisibleInfoCardElements:wKt,updateInfoCardElementViewMode:_Kt},j1n=Rn(N1n,z1n)(P1n),v7=5,B1n={container:t=>({marginTop:t.spacing(1),marginLeft:t.spacing(v7),marginRight:t.spacing(v7),width:`calc(100% - ${t.spacing(3*(v7+1))})`,height:"5em",display:"flex",alignItems:"flex-end"})};function U1n({dataTimeRange:t,selectedTimeRange:e,selectTimeRange:n}){const[r,i]=D.useState(e);D.useEffect(()=>{i(e)},[e]);const o=(u,f)=>{Array.isArray(f)&&i([f[0],f[1]])},s=(u,f)=>{n&&Array.isArray(f)&&n([f[0],f[1]])};function a(u){return lO(u)}const l=Array.isArray(t);l||(t=[Date.now()-2*PRe.years,Date.now()]);const c=[{value:t[0],label:bA(t[0])},{value:t[1],label:bA(t[1])}];return C.jsx(ot,{sx:B1n.container,children:C.jsx(QC,{disabled:!l,min:t[0],max:t[1],value:r,marks:c,onChange:o,onChangeCommitted:s,size:"small",valueLabelDisplay:"on",valueLabelFormat:a})})}var W1n=Array.isArray,Dl=W1n,V1n=typeof ei=="object"&&ei&&ei.Object===Object&&ei,LGe=V1n,G1n=LGe,H1n=typeof self=="object"&&self&&self.Object===Object&&self,q1n=G1n||H1n||Function("return this")(),rp=q1n,X1n=rp,Y1n=X1n.Symbol,vD=Y1n,Dwe=vD,$Ge=Object.prototype,Q1n=$Ge.hasOwnProperty,K1n=$Ge.toString,k2=Dwe?Dwe.toStringTag:void 0;function Z1n(t){var e=Q1n.call(t,k2),n=t[k2];try{t[k2]=void 0;var r=!0}catch{}var i=K1n.call(t);return r&&(e?t[k2]=n:delete t[k2]),i}var J1n=Z1n,ebn=Object.prototype,tbn=ebn.toString;function nbn(t){return tbn.call(t)}var rbn=nbn,Iwe=vD,ibn=J1n,obn=rbn,sbn="[object Null]",abn="[object Undefined]",Lwe=Iwe?Iwe.toStringTag:void 0;function lbn(t){return t==null?t===void 0?abn:sbn:Lwe&&Lwe in Object(t)?ibn(t):obn(t)}var im=lbn;function cbn(t){return t!=null&&typeof t=="object"}var om=cbn,ubn=im,fbn=om,dbn="[object Symbol]";function hbn(t){return typeof t=="symbol"||fbn(t)&&ubn(t)==dbn}var JO=hbn,pbn=Dl,gbn=JO,mbn=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,vbn=/^\w*$/;function ybn(t,e){if(pbn(t))return!1;var n=typeof t;return n=="number"||n=="symbol"||n=="boolean"||t==null||gbn(t)?!0:vbn.test(t)||!mbn.test(t)||e!=null&&t in Object(e)}var Jle=ybn;function xbn(t){var e=typeof t;return t!=null&&(e=="object"||e=="function")}var i0=xbn;const eE=on(i0);var bbn=im,wbn=i0,_bn="[object AsyncFunction]",Sbn="[object Function]",Cbn="[object GeneratorFunction]",Obn="[object Proxy]";function Ebn(t){if(!wbn(t))return!1;var e=bbn(t);return e==Sbn||e==Cbn||e==_bn||e==Obn}var ece=Ebn;const mn=on(ece);var Tbn=rp,kbn=Tbn["__core-js_shared__"],Abn=kbn,y7=Abn,$we=function(){var t=/[^.]+$/.exec(y7&&y7.keys&&y7.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}();function Pbn(t){return!!$we&&$we in t}var Mbn=Pbn,Rbn=Function.prototype,Dbn=Rbn.toString;function Ibn(t){if(t!=null){try{return Dbn.call(t)}catch{}try{return t+""}catch{}}return""}var FGe=Ibn,Lbn=ece,$bn=Mbn,Fbn=i0,Nbn=FGe,zbn=/[\\^$.*+?()[\]{}|]/g,jbn=/^\[object .+?Constructor\]$/,Bbn=Function.prototype,Ubn=Object.prototype,Wbn=Bbn.toString,Vbn=Ubn.hasOwnProperty,Gbn=RegExp("^"+Wbn.call(Vbn).replace(zbn,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function Hbn(t){if(!Fbn(t)||$bn(t))return!1;var e=Lbn(t)?Gbn:jbn;return e.test(Nbn(t))}var qbn=Hbn;function Xbn(t,e){return t==null?void 0:t[e]}var Ybn=Xbn,Qbn=qbn,Kbn=Ybn;function Zbn(t,e){var n=Kbn(t,e);return Qbn(n)?n:void 0}var Eb=Zbn,Jbn=Eb,ewn=Jbn(Object,"create"),jU=ewn,Fwe=jU;function twn(){this.__data__=Fwe?Fwe(null):{},this.size=0}var nwn=twn;function rwn(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}var iwn=rwn,own=jU,swn="__lodash_hash_undefined__",awn=Object.prototype,lwn=awn.hasOwnProperty;function cwn(t){var e=this.__data__;if(own){var n=e[t];return n===swn?void 0:n}return lwn.call(e,t)?e[t]:void 0}var uwn=cwn,fwn=jU,dwn=Object.prototype,hwn=dwn.hasOwnProperty;function pwn(t){var e=this.__data__;return fwn?e[t]!==void 0:hwn.call(e,t)}var gwn=pwn,mwn=jU,vwn="__lodash_hash_undefined__";function ywn(t,e){var n=this.__data__;return this.size+=this.has(t)?0:1,n[t]=mwn&&e===void 0?vwn:e,this}var xwn=ywn,bwn=nwn,wwn=iwn,_wn=uwn,Swn=gwn,Cwn=xwn;function tE(t){var e=-1,n=t==null?0:t.length;for(this.clear();++e-1}var Bwn=jwn,Uwn=BU;function Wwn(t,e){var n=this.__data__,r=Uwn(n,t);return r<0?(++this.size,n.push([t,e])):n[r][1]=e,this}var Vwn=Wwn,Gwn=Twn,Hwn=Lwn,qwn=Nwn,Xwn=Bwn,Ywn=Vwn;function nE(t){var e=-1,n=t==null?0:t.length;for(this.clear();++e0?1:-1},xx=function(e){return yD(e)&&e.indexOf("%")===e.length-1},at=function(e){return pSn(e)&&!iE(e)},Co=function(e){return at(e)||yD(e)},ySn=0,oE=function(e){var n=++ySn;return"".concat(e||"").concat(n)},F1=function(e,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(!at(e)&&!yD(e))return r;var o;if(xx(e)){var s=e.indexOf("%");o=n*parseFloat(e.slice(0,s))/100}else o=+e;return iE(o)&&(o=r),i&&o>n&&(o=n),o},sv=function(e){if(!e)return null;var n=Object.keys(e);return n&&n.length?e[n[0]]:null},xSn=function(e){if(!Array.isArray(e))return!1;for(var n=e.length,r={},i=0;i=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function OSn(t,e){if(t==null)return{};var n={},r=Object.keys(t),i,o;for(o=0;o=0)&&(n[i]=t[i]);return n}function CK(t){"@babel/helpers - typeof";return CK=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},CK(t)}var Vwe={click:"onClick",mousedown:"onMouseDown",mouseup:"onMouseUp",mouseover:"onMouseOver",mousemove:"onMouseMove",mouseout:"onMouseOut",mouseenter:"onMouseEnter",mouseleave:"onMouseLeave",touchcancel:"onTouchCancel",touchend:"onTouchEnd",touchmove:"onTouchMove",touchstart:"onTouchStart"},mg=function(e){return typeof e=="string"?e:e?e.displayName||e.name||"Component":""},Gwe=null,b7=null,lce=function t(e){if(e===Gwe&&Array.isArray(b7))return b7;var n=[];return D.Children.forEach(e,function(r){_n(r)||(TF.isFragment(r)?n=n.concat(t(r.props.children)):n.push(r))}),b7=n,Gwe=e,n};function yu(t,e){var n=[],r=[];return Array.isArray(e)?r=e.map(function(i){return mg(i)}):r=[mg(e)],lce(t).forEach(function(i){var o=vu(i,"type.displayName")||vu(i,"type.name");r.indexOf(o)!==-1&&n.push(i)}),n}function Kl(t,e){var n=yu(t,e);return n&&n[0]}var Hwe=function(e){if(!e||!e.props)return!1;var n=e.props,r=n.width,i=n.height;return!(!at(r)||r<=0||!at(i)||i<=0)},ESn=["a","altGlyph","altGlyphDef","altGlyphItem","animate","animateColor","animateMotion","animateTransform","circle","clipPath","color-profile","cursor","defs","desc","ellipse","feBlend","feColormatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","filter","font","font-face","font-face-format","font-face-name","font-face-url","foreignObject","g","glyph","glyphRef","hkern","image","line","lineGradient","marker","mask","metadata","missing-glyph","mpath","path","pattern","polygon","polyline","radialGradient","rect","script","set","stop","style","svg","switch","symbol","text","textPath","title","tref","tspan","use","view","vkern"],TSn=function(e){return e&&e.type&&yD(e.type)&&ESn.indexOf(e.type)>=0},GGe=function(e){return e&&CK(e)==="object"&&"cx"in e&&"cy"in e&&"r"in e},kSn=function(e,n,r,i){var o,s=(o=x7==null?void 0:x7[i])!==null&&o!==void 0?o:[];return!mn(e)&&(i&&s.includes(n)||wSn.includes(n))||r&&ace.includes(n)},pn=function(e,n,r){if(!e||typeof e=="function"||typeof e=="boolean")return null;var i=e;if(D.isValidElement(e)&&(i=e.props),!eE(i))return null;var o={};return Object.keys(i).forEach(function(s){var a;kSn((a=i)===null||a===void 0?void 0:a[s],s,n,r)&&(o[s]=i[s])}),o},OK=function t(e,n){if(e===n)return!0;var r=D.Children.count(e);if(r!==D.Children.count(n))return!1;if(r===0)return!0;if(r===1)return qwe(Array.isArray(e)?e[0]:e,Array.isArray(n)?n[0]:n);for(var i=0;i=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function DSn(t,e){if(t==null)return{};var n={},r=Object.keys(t),i,o;for(o=0;o=0)&&(n[i]=t[i]);return n}function TK(t){var e=t.children,n=t.width,r=t.height,i=t.viewBox,o=t.className,s=t.style,a=t.title,l=t.desc,c=RSn(t,MSn),u=i||{width:n,height:r,x:0,y:0},f=Oe("recharts-surface",o);return de.createElement("svg",EK({},pn(c,!0,"svg"),{className:f,width:n,height:r,style:s,viewBox:"".concat(u.x," ").concat(u.y," ").concat(u.width," ").concat(u.height)}),de.createElement("title",null,a),de.createElement("desc",null,l),e)}var ISn=["children","className"];function kK(){return kK=Object.assign?Object.assign.bind():function(t){for(var e=1;e=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function $Sn(t,e){if(t==null)return{};var n={},r=Object.keys(t),i,o;for(o=0;o=0)&&(n[i]=t[i]);return n}var Ur=de.forwardRef(function(t,e){var n=t.children,r=t.className,i=LSn(t,ISn),o=Oe("recharts-layer",r);return de.createElement("g",kK({className:o},pn(i,!0),{ref:e}),n)}),vg=function(e,n){for(var r=arguments.length,i=new Array(r>2?r-2:0),o=2;oi?0:i+e),n=n>i?i:n,n<0&&(n+=i),i=e>n?0:n-e>>>0,e>>>=0;for(var o=Array(i);++r=r?t:zSn(t,e,n)}var BSn=jSn,USn="\\ud800-\\udfff",WSn="\\u0300-\\u036f",VSn="\\ufe20-\\ufe2f",GSn="\\u20d0-\\u20ff",HSn=WSn+VSn+GSn,qSn="\\ufe0e\\ufe0f",XSn="\\u200d",YSn=RegExp("["+XSn+USn+HSn+qSn+"]");function QSn(t){return YSn.test(t)}var HGe=QSn;function KSn(t){return t.split("")}var ZSn=KSn,qGe="\\ud800-\\udfff",JSn="\\u0300-\\u036f",eCn="\\ufe20-\\ufe2f",tCn="\\u20d0-\\u20ff",nCn=JSn+eCn+tCn,rCn="\\ufe0e\\ufe0f",iCn="["+qGe+"]",AK="["+nCn+"]",PK="\\ud83c[\\udffb-\\udfff]",oCn="(?:"+AK+"|"+PK+")",XGe="[^"+qGe+"]",YGe="(?:\\ud83c[\\udde6-\\uddff]){2}",QGe="[\\ud800-\\udbff][\\udc00-\\udfff]",sCn="\\u200d",KGe=oCn+"?",ZGe="["+rCn+"]?",aCn="(?:"+sCn+"(?:"+[XGe,YGe,QGe].join("|")+")"+ZGe+KGe+")*",lCn=ZGe+KGe+aCn,cCn="(?:"+[XGe+AK+"?",AK,YGe,QGe,iCn].join("|")+")",uCn=RegExp(PK+"(?="+PK+")|"+cCn+lCn,"g");function fCn(t){return t.match(uCn)||[]}var dCn=fCn,hCn=ZSn,pCn=HGe,gCn=dCn;function mCn(t){return pCn(t)?gCn(t):hCn(t)}var vCn=mCn,yCn=BSn,xCn=HGe,bCn=vCn,wCn=BGe;function _Cn(t){return function(e){e=wCn(e);var n=xCn(e)?bCn(e):void 0,r=n?n[0]:e.charAt(0),i=n?yCn(n,1).join(""):e.slice(1);return r[t]()+i}}var SCn=_Cn,CCn=SCn,OCn=CCn("toUpperCase"),ECn=OCn;const GU=on(ECn);function TP(t){"@babel/helpers - typeof";return TP=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},TP(t)}var TCn=["type","size","sizeType"];function MK(){return MK=Object.assign?Object.assign.bind():function(t){for(var e=1;e=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function RCn(t,e){if(t==null)return{};var n={},r=Object.keys(t),i,o;for(o=0;o=0)&&(n[i]=t[i]);return n}var JGe={symbolCircle:fre,symbolCross:N2t,symbolDiamond:j2t,symbolSquare:B2t,symbolStar:G2t,symbolTriangle:H2t,symbolWye:X2t},DCn=Math.PI/180,ICn=function(e){var n="symbol".concat(GU(e));return JGe[n]||fre},LCn=function(e,n,r){if(n==="area")return e;switch(r){case"cross":return 5*e*e/9;case"diamond":return .5*e*e/Math.sqrt(3);case"square":return e*e;case"star":{var i=18*DCn;return 1.25*e*e*(Math.tan(i)-Math.tan(i*2)*Math.pow(Math.tan(i),2))}case"triangle":return Math.sqrt(3)*e*e/4;case"wye":return(21-10*Math.sqrt(3))*e*e/8;default:return Math.PI*e*e/4}},$Cn=function(e,n){JGe["symbol".concat(GU(e))]=n},cce=function(e){var n=e.type,r=n===void 0?"circle":n,i=e.size,o=i===void 0?64:i,s=e.sizeType,a=s===void 0?"area":s,l=MCn(e,TCn),c=Qwe(Qwe({},l),{},{type:r,size:o,sizeType:a}),u=function(){var m=ICn(r),v=v$e().type(m).size(LCn(o,a,r));return v()},f=c.className,d=c.cx,h=c.cy,p=pn(c,!0);return d===+d&&h===+h&&o===+o?de.createElement("path",MK({},p,{className:Oe("recharts-symbols",f),transform:"translate(".concat(d,", ").concat(h,")"),d:u()})):null};cce.registerSymbol=$Cn;function OC(t){"@babel/helpers - typeof";return OC=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},OC(t)}function RK(){return RK=Object.assign?Object.assign.bind():function(t){for(var e=1;en?null:n+t.unit}const M7=mP.define({name:"python",parser:mbn.configure({props:[Qle.add({Body:t=>{var e;return(e=o_e(t,t.node))!==null&&e!==void 0?e:t.continue()},IfStatement:t=>/^\s*(else:|elif )/.test(t.textAfter)?t.baseIndent:t.continue(),TryStatement:t=>/^\s*(except |finally:|else:)/.test(t.textAfter)?t.baseIndent:t.continue(),"TupleExpression ComprehensionExpression ParamList ArgList ParenthesizedExpression":v7({closing:")"}),"DictionaryExpression DictionaryComprehensionExpression SetExpression SetComprehensionExpression":v7({closing:"}"}),"ArrayExpression ArrayComprehensionExpression":v7({closing:"]"}),"String FormatString":()=>null,Script:t=>{if(t.pos+/\s*/.exec(t.textAfter)[0].length>=t.node.to){let e=null;for(let n=t.node,r=n.to;n=n.lastChild,!(!n||n.to!=r);)n.type.name=="Body"&&(e=n);if(e){let n=o_e(t,e);if(n!=null)return n}}return t.continue()}}),Zle.add({"ArrayExpression DictionaryExpression SetExpression TupleExpression":P7e,Body:(t,e)=>({from:t.from+1,to:t.to-(t.to==e.doc.length?0:1)})})]}),languageData:{closeBrackets:{brackets:["(","[","{","'",'"',"'''",'"""'],stringPrefixes:["f","fr","rf","r","u","b","br","rb","F","FR","RF","R","U","B","BR","RB"]},commentTokens:{line:"#"},indentOnInput:/^\s*([\}\]\)]|else:|elif |except |finally:)$/}});function _bn(){return new T7e(M7,[M7.data.of({autocomplete:ybn}),M7.data.of({autocomplete:wbn})])}const Sbn=""+new URL("python-bw-BV0FRHt1.png",import.meta.url).href,SC={card:t=>({maxWidth:"100%",marginBottom:t.spacing(1),marginRight:t.spacing(1)}),info:t=>({marginRight:t.spacing(1)}),close:{marginLeft:"auto"},table:{},keyValueTableContainer:t=>({background:t.palette.divider}),variableHtmlReprContainer:t=>({background:t.palette.divider,padding:t.spacing(1),marginTop:t.spacing(1),marginBottom:t.spacing(1)}),media:{height:200},cardContent:{padding:"8px"},code:{fontFamily:"Monospace"}},Cbn=({visibleInfoCardElements:t,setVisibleInfoCardElements:e,infoCardElementViewModes:n,updateInfoCardElementViewMode:r,selectedDataset:i,selectedVariable:o,selectedPlaceInfo:s,selectedTime:a,serverConfig:l,allowViewModePython:c})=>{const u=(p,g)=>{e(g)};let f,d,h;if(i){const p="dataset",g=n[p],m=y=>r(p,y),v=t.includes(p);f=C.jsx(Obn,{isIn:v,viewMode:g,setViewMode:m,dataset:i,serverConfig:l,hasPython:c})}if(i&&o){const p="variable",g=n[p],m=y=>r(p,y),v=t.includes(p);d=C.jsx(Ebn,{isIn:v,viewMode:g,setViewMode:m,variable:o,time:a,serverConfig:l,hasPython:c})}if(s){const p="place",g=n[p],m=y=>r(p,y),v=t.includes(p);h=C.jsx(Tbn,{isIn:v,viewMode:g,setViewMode:m,placeInfo:s})}return C.jsxs(lPe,{sx:SC.card,children:[C.jsx(cPe,{disableSpacing:!0,children:C.jsxs(QC,{size:"small",value:t,onChange:u,children:[C.jsx(yr,{value:"dataset",disabled:i===null,size:"small",sx:rl.toggleButton,children:C.jsx(Lt,{arrow:!0,title:me.get("Dataset information"),children:C.jsx(Rdn,{})})},0),C.jsx(yr,{value:"variable",disabled:o===null,size:"small",sx:rl.toggleButton,children:C.jsx(Lt,{arrow:!0,title:me.get("Variable information"),children:C.jsx(WVe,{})})},1),C.jsx(yr,{value:"place",disabled:s===null,size:"small",sx:rl.toggleButton,children:C.jsx(Lt,{arrow:!0,title:me.get("Place information"),children:C.jsx(Pdn,{})})},2)]},0)}),f,d,h]})},Obn=({isIn:t,viewMode:e,setViewMode:n,dataset:r,serverConfig:i,hasPython:o})=>{let s;if(e==="code"){const a=r.dimensions.map(c=>NK(c,["name","size","dtype"])),l=NK(r,["id","title","bbox","attrs"]);l.dimensions=a,s=C.jsx(mce,{code:JSON.stringify(l,null,2)})}else if(e==="list")s=C.jsx(dg,{children:C.jsx(EP,{data:Object.getOwnPropertyNames(r.attrs||{}).map(a=>[a,r.attrs[a]])})});else if(e==="text"){const a=[[me.get("Dimension names"),r.dimensions.map(l=>l.name).join(", ")],[me.get("Dimension data types"),r.dimensions.map(l=>l.dtype).join(", ")],[me.get("Dimension lengths"),r.dimensions.map(l=>l.size).join(", ")],[me.get("Geographical extent")+" (x1, y1, x2, y2)",r.bbox.map(l=>l+"").join(", ")],[me.get("Spatial reference system"),r.spatialRef]];s=C.jsx(dg,{children:C.jsx(EP,{data:a})})}else e==="python"&&(s=C.jsx(aHe,{code:kbn(i,r)}));return C.jsx(gce,{title:r.title||"?",subheader:r.title&&`ID: ${r.id}`,isIn:t,viewMode:e,setViewMode:n,hasPython:o,children:s})},Ebn=({isIn:t,viewMode:e,setViewMode:n,variable:r,time:i,serverConfig:o,hasPython:s})=>{let a,l;if(e==="code"){const c=NK(r,["id","name","title","units","expression","shape","dtype","shape","timeChunkSize","colorBarMin","colorBarMax","colorBarName","attrs"]);a=C.jsx(mce,{code:JSON.stringify(c,null,2)})}else if(e==="list"){if(a=C.jsx(dg,{children:C.jsx(EP,{data:Object.getOwnPropertyNames(r.attrs||{}).map(c=>[c,r.attrs[c]])})}),r.htmlRepr){const c=u=>{u&&r.htmlRepr&&(u.innerHTML=r.htmlRepr)};l=C.jsx(dg,{children:C.jsx(Tl,{ref:c,sx:SC.variableHtmlReprContainer})})}}else if(e==="text"){let c=[[me.get("Name"),r.name],[me.get("Title"),r.title],[me.get("Units"),r.units]];XM(r)?c.push([me.get("Expression"),r.expression]):c=[...c,[me.get("Data type"),r.dtype],[me.get("Dimension names"),r.dims.join(", ")],[me.get("Dimension lengths"),r.shape.map(u=>u+"").join(", ")],[me.get("Time chunk size"),r.timeChunkSize]],a=C.jsx(dg,{children:C.jsx(EP,{data:c})})}else e==="python"&&(a=C.jsx(aHe,{code:Abn(o,r,i)}));return C.jsxs(gce,{title:r.title||r.name,subheader:`${me.get("Name")}: ${r.name}`,isIn:t,viewMode:e,setViewMode:n,hasPython:s,children:[l,a]})},Tbn=({isIn:t,viewMode:e,setViewMode:n,placeInfo:r})=>{const i=r.place;let o,s,a;if(e==="code")o=C.jsx(mce,{code:JSON.stringify(i,null,2)});else if(e==="list")if(i.properties){const l=Object.getOwnPropertyNames(i.properties).map(c=>[c,i.properties[c]]);o=C.jsx(dg,{children:C.jsx(EP,{data:l})})}else o=C.jsx(dg,{children:C.jsx(Jt,{children:me.get("There is no information available for this location.")})});else r.image&&r.image.startsWith("http")&&(s=C.jsx(yst,{sx:SC.media,image:r.image,title:r.label})),r.description&&(a=C.jsx(dg,{children:C.jsx(Jt,{children:r.description})}));return C.jsxs(gce,{title:r.label,subheader:`${me.get("Geometry type")}: ${me.get(i.geometry.type)}`,isIn:t,viewMode:e,setViewMode:n,children:[s,a,o]})},gce=({isIn:t,title:e,subheader:n,viewMode:r,setViewMode:i,hasPython:o,children:s})=>{const a=(l,c)=>{i(c)};return C.jsxs(AF,{in:t,timeout:"auto",unmountOnExit:!0,children:[C.jsx(dst,{title:e,subheader:n,titleTypographyProps:{fontSize:"1.1em"},action:C.jsxs(QC,{size:"small",value:r,exclusive:!0,onChange:a,children:[C.jsx(yr,{value:"text",size:"small",sx:rl.toggleButton,children:C.jsx(Lt,{arrow:!0,title:me.get("Textual format"),children:C.jsx(Mdn,{})})},0),C.jsx(yr,{value:"list",size:"small",sx:rl.toggleButton,children:C.jsx(Lt,{arrow:!0,title:me.get("Tabular format"),children:C.jsx(Adn,{})})},1),C.jsx(yr,{value:"code",size:"small",sx:rl.toggleButton,children:C.jsx(Lt,{arrow:!0,title:me.get("JSON format"),children:C.jsx(kdn,{})})},2),o&&C.jsx(yr,{value:"python",size:"small",sx:{...rl.toggleButton,width:"30px"},children:C.jsx("img",{src:Sbn,width:16,alt:"python logo"})},3)]},0)}),s]})},EP=({data:t})=>C.jsx(APe,{component:Tl,sx:SC.keyValueTableContainer,children:C.jsx(Hee,{sx:SC.table,size:"small",children:C.jsx(qee,{children:t.map((e,n)=>{const[r,i]=e;let o=i;return typeof i=="string"&&(i.startsWith("http://")||i.startsWith("https://"))?o=C.jsx($lt,{href:i,target:"_blank",rel:"noreferrer",children:i}):Array.isArray(i)&&(o="["+i.map(s=>s+"").join(", ")+"]"),C.jsxs(Td,{children:[C.jsx(li,{children:r}),C.jsx(li,{align:"right",children:o})]},n)})})})}),dg=({children:t})=>C.jsx(uPe,{sx:SC.cardContent,children:t}),sHe=({code:t,extension:e})=>C.jsx(dg,{children:C.jsx(FU,{theme:Pn.instance.branding.themeName||"light",height:"320px",extensions:[e],value:t,readOnly:!0})}),mce=({code:t})=>C.jsx(sHe,{code:t,extension:YGe()}),aHe=({code:t})=>C.jsx(sHe,{code:t,extension:_bn()});function NK(t,e){const n={};for(const r of e)r in t&&(n[r]=t[r]);return n}function kbn(t,e){const n=Pbn(e.id);return["from xcube.core.store import new_data_store","","store = new_data_store(",' "s3",',' root="datasets", # can also use "pyramids" here'," storage_options={",' "anon": True,',' "client_kwargs": {',` "endpoint_url": "${t.url}/s3"`," }"," }",")","# store.list_data_ids()",`dataset = store.open_data(data_id="${n}")`].join(` +`)}function Abn(t,e,n){const r=e.name,i=e.colorBarMin,o=e.colorBarMax,s=e.colorBarName;let a="";n!==null&&(a=`sel(time="${oO(n)}", method="nearest")`);const l=[];if(XM(e)){const c=e.expression;l.push("from xcube.util.expression import compute_array_expr"),l.push("from xcube.util.expression import new_dataset_namespace"),l.push(""),l.push("namespace = new_dataset_namespace(dataset)"),l.push(`${r} = compute_array_expr("${c}", namespace`),a&&l.push(`${r} = ${r}.${a}`)}else a?l.push(`${r} = dataset.${r}.${a}`):l.push(`${r} = dataset.${r}`);return l.push(`${r}.plot.imshow(vmin=${i}, vmax=${o}, cmap="${s}")`),l.join(` +`)}function Pbn(t){return Mbn(t)[0]+".zarr"}function Mbn(t){const e=t.lastIndexOf(".");return e>=0?[t.substring(0,e),t.substring(e)]:[t,""]}const Rbn=t=>({locale:t.controlState.locale,visibleInfoCardElements:B_t(t),infoCardElementViewModes:U_t(t),selectedDataset:fo(t),selectedVariable:Na(t),selectedPlaceInfo:JM(t),selectedTime:QM(t),serverConfig:Oo(t),allowViewModePython:!!Pn.instance.branding.allowViewModePython}),Dbn={setVisibleInfoCardElements:mKt,updateInfoCardElementViewMode:vKt},Ibn=Rn(Rbn,Dbn)(Cbn),R7=5,Lbn={container:t=>({marginTop:t.spacing(1),marginLeft:t.spacing(R7),marginRight:t.spacing(R7),width:`calc(100% - ${t.spacing(3*(R7+1))})`,height:"5em",display:"flex",alignItems:"flex-end"})};function $bn({dataTimeRange:t,selectedTimeRange:e,selectTimeRange:n}){const[r,i]=D.useState(e);D.useEffect(()=>{i(e)},[e]);const o=(u,f)=>{Array.isArray(f)&&i([f[0],f[1]])},s=(u,f)=>{n&&Array.isArray(f)&&n([f[0],f[1]])};function a(u){return oO(u)}const l=Array.isArray(t);l||(t=[Date.now()-2*XRe.years,Date.now()]);const c=[{value:t[0],label:bA(t[0])},{value:t[1],label:bA(t[1])}];return C.jsx(ot,{sx:Lbn.container,children:C.jsx(YC,{disabled:!l,min:t[0],max:t[1],value:r,marks:c,onChange:o,onChangeCommitted:s,size:"small",valueLabelDisplay:"on",valueLabelFormat:a})})}var Fbn=Array.isArray,Ml=Fbn,Nbn=typeof ei=="object"&&ei&&ei.Object===Object&&ei,lHe=Nbn,zbn=lHe,jbn=typeof self=="object"&&self&&self.Object===Object&&self,Bbn=zbn||jbn||Function("return this")(),ep=Bbn,Ubn=ep,Wbn=Ubn.Symbol,pD=Wbn,s_e=pD,cHe=Object.prototype,Vbn=cHe.hasOwnProperty,Gbn=cHe.toString,T2=s_e?s_e.toStringTag:void 0;function Hbn(t){var e=Vbn.call(t,T2),n=t[T2];try{t[T2]=void 0;var r=!0}catch{}var i=Gbn.call(t);return r&&(e?t[T2]=n:delete t[T2]),i}var qbn=Hbn,Xbn=Object.prototype,Ybn=Xbn.toString;function Qbn(t){return Ybn.call(t)}var Kbn=Qbn,a_e=pD,Zbn=qbn,Jbn=Kbn,e1n="[object Null]",t1n="[object Undefined]",l_e=a_e?a_e.toStringTag:void 0;function n1n(t){return t==null?t===void 0?t1n:e1n:l_e&&l_e in Object(t)?Zbn(t):Jbn(t)}var rm=n1n;function r1n(t){return t!=null&&typeof t=="object"}var im=r1n,i1n=rm,o1n=im,s1n="[object Symbol]";function a1n(t){return typeof t=="symbol"||o1n(t)&&i1n(t)==s1n}var ZO=a1n,l1n=Ml,c1n=ZO,u1n=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,f1n=/^\w*$/;function d1n(t,e){if(l1n(t))return!1;var n=typeof t;return n=="number"||n=="symbol"||n=="boolean"||t==null||c1n(t)?!0:f1n.test(t)||!u1n.test(t)||e!=null&&t in Object(e)}var vce=d1n;function h1n(t){var e=typeof t;return t!=null&&(e=="object"||e=="function")}var r0=h1n;const JO=sn(r0);var p1n=rm,g1n=r0,m1n="[object AsyncFunction]",v1n="[object Function]",y1n="[object GeneratorFunction]",x1n="[object Proxy]";function b1n(t){if(!g1n(t))return!1;var e=p1n(t);return e==v1n||e==y1n||e==m1n||e==x1n}var yce=b1n;const mn=sn(yce);var w1n=ep,_1n=w1n["__core-js_shared__"],S1n=_1n,D7=S1n,c_e=function(){var t=/[^.]+$/.exec(D7&&D7.keys&&D7.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}();function C1n(t){return!!c_e&&c_e in t}var O1n=C1n,E1n=Function.prototype,T1n=E1n.toString;function k1n(t){if(t!=null){try{return T1n.call(t)}catch{}try{return t+""}catch{}}return""}var uHe=k1n,A1n=yce,P1n=O1n,M1n=r0,R1n=uHe,D1n=/[\\^$.*+?()[\]{}|]/g,I1n=/^\[object .+?Constructor\]$/,L1n=Function.prototype,$1n=Object.prototype,F1n=L1n.toString,N1n=$1n.hasOwnProperty,z1n=RegExp("^"+F1n.call(N1n).replace(D1n,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function j1n(t){if(!M1n(t)||P1n(t))return!1;var e=A1n(t)?z1n:I1n;return e.test(R1n(t))}var B1n=j1n;function U1n(t,e){return t==null?void 0:t[e]}var W1n=U1n,V1n=B1n,G1n=W1n;function H1n(t,e){var n=G1n(t,e);return V1n(n)?n:void 0}var E1=H1n,q1n=E1,X1n=q1n(Object,"create"),jU=X1n,u_e=jU;function Y1n(){this.__data__=u_e?u_e(null):{},this.size=0}var Q1n=Y1n;function K1n(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}var Z1n=K1n,J1n=jU,ewn="__lodash_hash_undefined__",twn=Object.prototype,nwn=twn.hasOwnProperty;function rwn(t){var e=this.__data__;if(J1n){var n=e[t];return n===ewn?void 0:n}return nwn.call(e,t)?e[t]:void 0}var iwn=rwn,own=jU,swn=Object.prototype,awn=swn.hasOwnProperty;function lwn(t){var e=this.__data__;return own?e[t]!==void 0:awn.call(e,t)}var cwn=lwn,uwn=jU,fwn="__lodash_hash_undefined__";function dwn(t,e){var n=this.__data__;return this.size+=this.has(t)?0:1,n[t]=uwn&&e===void 0?fwn:e,this}var hwn=dwn,pwn=Q1n,gwn=Z1n,mwn=iwn,vwn=cwn,ywn=hwn;function eE(t){var e=-1,n=t==null?0:t.length;for(this.clear();++e-1}var Lwn=Iwn,$wn=BU;function Fwn(t,e){var n=this.__data__,r=$wn(n,t);return r<0?(++this.size,n.push([t,e])):n[r][1]=e,this}var Nwn=Fwn,zwn=wwn,jwn=Awn,Bwn=Rwn,Uwn=Lwn,Wwn=Nwn;function tE(t){var e=-1,n=t==null?0:t.length;for(this.clear();++e0?1:-1},xx=function(e){return gD(e)&&e.indexOf("%")===e.length-1},at=function(e){return lSn(e)&&!rE(e)},So=function(e){return at(e)||gD(e)},dSn=0,iE=function(e){var n=++dSn;return"".concat(e||"").concat(n)},Fb=function(e,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(!at(e)&&!gD(e))return r;var o;if(xx(e)){var s=e.indexOf("%");o=n*parseFloat(e.slice(0,s))/100}else o=+e;return rE(o)&&(o=r),i&&o>n&&(o=n),o},ov=function(e){if(!e)return null;var n=Object.keys(e);return n&&n.length?e[n[0]]:null},hSn=function(e){if(!Array.isArray(e))return!1;for(var n=e.length,r={},i=0;i=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function xSn(t,e){if(t==null)return{};var n={},r=Object.keys(t),i,o;for(o=0;o=0)&&(n[i]=t[i]);return n}function jK(t){"@babel/helpers - typeof";return jK=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},jK(t)}var v_e={click:"onClick",mousedown:"onMouseDown",mouseup:"onMouseUp",mouseover:"onMouseOver",mousemove:"onMouseMove",mouseout:"onMouseOut",mouseenter:"onMouseEnter",mouseleave:"onMouseLeave",touchcancel:"onTouchCancel",touchend:"onTouchEnd",touchmove:"onTouchMove",touchstart:"onTouchStart"},hg=function(e){return typeof e=="string"?e:e?e.displayName||e.name||"Component":""},y_e=null,L7=null,Ece=function t(e){if(e===y_e&&Array.isArray(L7))return L7;var n=[];return D.Children.forEach(e,function(r){wn(r)||(SF.isFragment(r)?n=n.concat(t(r.props.children)):n.push(r))}),L7=n,y_e=e,n};function yu(t,e){var n=[],r=[];return Array.isArray(e)?r=e.map(function(i){return hg(i)}):r=[hg(e)],Ece(t).forEach(function(i){var o=vu(i,"type.displayName")||vu(i,"type.name");r.indexOf(o)!==-1&&n.push(i)}),n}function Yl(t,e){var n=yu(t,e);return n&&n[0]}var x_e=function(e){if(!e||!e.props)return!1;var n=e.props,r=n.width,i=n.height;return!(!at(r)||r<=0||!at(i)||i<=0)},bSn=["a","altGlyph","altGlyphDef","altGlyphItem","animate","animateColor","animateMotion","animateTransform","circle","clipPath","color-profile","cursor","defs","desc","ellipse","feBlend","feColormatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","filter","font","font-face","font-face-format","font-face-name","font-face-url","foreignObject","g","glyph","glyphRef","hkern","image","line","lineGradient","marker","mask","metadata","missing-glyph","mpath","path","pattern","polygon","polyline","radialGradient","rect","script","set","stop","style","svg","switch","symbol","text","textPath","title","tref","tspan","use","view","vkern"],wSn=function(e){return e&&e.type&&gD(e.type)&&bSn.indexOf(e.type)>=0},yHe=function(e){return e&&jK(e)==="object"&&"cx"in e&&"cy"in e&&"r"in e},_Sn=function(e,n,r,i){var o,s=(o=I7==null?void 0:I7[i])!==null&&o!==void 0?o:[];return!mn(e)&&(i&&s.includes(n)||gSn.includes(n))||r&&Oce.includes(n)},pn=function(e,n,r){if(!e||typeof e=="function"||typeof e=="boolean")return null;var i=e;if(D.isValidElement(e)&&(i=e.props),!JO(i))return null;var o={};return Object.keys(i).forEach(function(s){var a;_Sn((a=i)===null||a===void 0?void 0:a[s],s,n,r)&&(o[s]=i[s])}),o},BK=function t(e,n){if(e===n)return!0;var r=D.Children.count(e);if(r!==D.Children.count(n))return!1;if(r===0)return!0;if(r===1)return b_e(Array.isArray(e)?e[0]:e,Array.isArray(n)?n[0]:n);for(var i=0;i=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function TSn(t,e){if(t==null)return{};var n={},r=Object.keys(t),i,o;for(o=0;o=0)&&(n[i]=t[i]);return n}function WK(t){var e=t.children,n=t.width,r=t.height,i=t.viewBox,o=t.className,s=t.style,a=t.title,l=t.desc,c=ESn(t,OSn),u=i||{width:n,height:r,x:0,y:0},f=Oe("recharts-surface",o);return de.createElement("svg",UK({},pn(c,!0,"svg"),{className:f,width:n,height:r,style:s,viewBox:"".concat(u.x," ").concat(u.y," ").concat(u.width," ").concat(u.height)}),de.createElement("title",null,a),de.createElement("desc",null,l),e)}var kSn=["children","className"];function VK(){return VK=Object.assign?Object.assign.bind():function(t){for(var e=1;e=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function PSn(t,e){if(t==null)return{};var n={},r=Object.keys(t),i,o;for(o=0;o=0)&&(n[i]=t[i]);return n}var Ur=de.forwardRef(function(t,e){var n=t.children,r=t.className,i=ASn(t,kSn),o=Oe("recharts-layer",r);return de.createElement("g",VK({className:o},pn(i,!0),{ref:e}),n)}),pg=function(e,n){for(var r=arguments.length,i=new Array(r>2?r-2:0),o=2;oi?0:i+e),n=n>i?i:n,n<0&&(n+=i),i=e>n?0:n-e>>>0,e>>>=0;for(var o=Array(i);++r=r?t:DSn(t,e,n)}var LSn=ISn,$Sn="\\ud800-\\udfff",FSn="\\u0300-\\u036f",NSn="\\ufe20-\\ufe2f",zSn="\\u20d0-\\u20ff",jSn=FSn+NSn+zSn,BSn="\\ufe0e\\ufe0f",USn="\\u200d",WSn=RegExp("["+USn+$Sn+jSn+BSn+"]");function VSn(t){return WSn.test(t)}var xHe=VSn;function GSn(t){return t.split("")}var HSn=GSn,bHe="\\ud800-\\udfff",qSn="\\u0300-\\u036f",XSn="\\ufe20-\\ufe2f",YSn="\\u20d0-\\u20ff",QSn=qSn+XSn+YSn,KSn="\\ufe0e\\ufe0f",ZSn="["+bHe+"]",GK="["+QSn+"]",HK="\\ud83c[\\udffb-\\udfff]",JSn="(?:"+GK+"|"+HK+")",wHe="[^"+bHe+"]",_He="(?:\\ud83c[\\udde6-\\uddff]){2}",SHe="[\\ud800-\\udbff][\\udc00-\\udfff]",eCn="\\u200d",CHe=JSn+"?",OHe="["+KSn+"]?",tCn="(?:"+eCn+"(?:"+[wHe,_He,SHe].join("|")+")"+OHe+CHe+")*",nCn=OHe+CHe+tCn,rCn="(?:"+[wHe+GK+"?",GK,_He,SHe,ZSn].join("|")+")",iCn=RegExp(HK+"(?="+HK+")|"+rCn+nCn,"g");function oCn(t){return t.match(iCn)||[]}var sCn=oCn,aCn=HSn,lCn=xHe,cCn=sCn;function uCn(t){return lCn(t)?cCn(t):aCn(t)}var fCn=uCn,dCn=LSn,hCn=xHe,pCn=fCn,gCn=pHe;function mCn(t){return function(e){e=gCn(e);var n=hCn(e)?pCn(e):void 0,r=n?n[0]:e.charAt(0),i=n?dCn(n,1).join(""):e.slice(1);return r[t]()+i}}var vCn=mCn,yCn=vCn,xCn=yCn("toUpperCase"),bCn=xCn;const GU=sn(bCn);function TP(t){"@babel/helpers - typeof";return TP=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},TP(t)}var wCn=["type","size","sizeType"];function qK(){return qK=Object.assign?Object.assign.bind():function(t){for(var e=1;e=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function ECn(t,e){if(t==null)return{};var n={},r=Object.keys(t),i,o;for(o=0;o=0)&&(n[i]=t[i]);return n}var EHe={symbolCircle:Tre,symbolCross:Z2t,symbolDiamond:eTt,symbolSquare:tTt,symbolStar:oTt,symbolTriangle:sTt,symbolWye:lTt},TCn=Math.PI/180,kCn=function(e){var n="symbol".concat(GU(e));return EHe[n]||Tre},ACn=function(e,n,r){if(n==="area")return e;switch(r){case"cross":return 5*e*e/9;case"diamond":return .5*e*e/Math.sqrt(3);case"square":return e*e;case"star":{var i=18*TCn;return 1.25*e*e*(Math.tan(i)-Math.tan(i*2)*Math.pow(Math.tan(i),2))}case"triangle":return Math.sqrt(3)*e*e/4;case"wye":return(21-10*Math.sqrt(3))*e*e/8;default:return Math.PI*e*e/4}},PCn=function(e,n){EHe["symbol".concat(GU(e))]=n},Tce=function(e){var n=e.type,r=n===void 0?"circle":n,i=e.size,o=i===void 0?64:i,s=e.sizeType,a=s===void 0?"area":s,l=OCn(e,wCn),c=S_e(S_e({},l),{},{type:r,size:o,sizeType:a}),u=function(){var m=kCn(r),v=z$e().type(m).size(ACn(o,a,r));return v()},f=c.className,d=c.cx,h=c.cy,p=pn(c,!0);return d===+d&&h===+h&&o===+o?de.createElement("path",qK({},p,{className:Oe("recharts-symbols",f),transform:"translate(".concat(d,", ").concat(h,")"),d:u()})):null};Tce.registerSymbol=PCn;function CC(t){"@babel/helpers - typeof";return CC=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},CC(t)}function XK(){return XK=Object.assign?Object.assign.bind():function(t){for(var e=1;e`);var y=h.inactive?c:h.color;return de.createElement("li",RK({className:m,style:f,key:"legend-item-".concat(p)},kz(r.props,h,p)),de.createElement(TK,{width:s,height:s,viewBox:u,style:d},r.renderIcon(h)),de.createElement("span",{className:"recharts-legend-item-text",style:{color:y}},g?g(v,h,p):v))})}},{key:"render",value:function(){var r=this.props,i=r.payload,o=r.layout,s=r.align;if(!i||!i.length)return null;var a={padding:0,margin:0,textAlign:o==="horizontal"?s:"left"};return de.createElement("ul",{className:"recharts-default-legend",style:a},this.renderItems())}}]),e}(D.PureComponent);kP(uce,"displayName","Legend");kP(uce,"defaultProps",{iconSize:14,layout:"horizontal",align:"center",verticalAlign:"middle",inactiveColor:"#ccc"});var HCn=UU;function qCn(){this.__data__=new HCn,this.size=0}var XCn=qCn;function YCn(t){var e=this.__data__,n=e.delete(t);return this.size=e.size,n}var QCn=YCn;function KCn(t){return this.__data__.get(t)}var ZCn=KCn;function JCn(t){return this.__data__.has(t)}var eOn=JCn,tOn=UU,nOn=nce,rOn=rce,iOn=200;function oOn(t,e){var n=this.__data__;if(n instanceof tOn){var r=n.__data__;if(!nOn||r.lengtha))return!1;var c=o.get(t),u=o.get(e);if(c&&u)return c==e&&u==t;var f=-1,d=!0,h=n&TOn?new SOn:void 0;for(o.set(t,e),o.set(e,t);++f-1&&t%1==0&&t-1&&t%1==0&&t<=MEn}var pce=REn,DEn=im,IEn=pce,LEn=om,$En="[object Arguments]",FEn="[object Array]",NEn="[object Boolean]",zEn="[object Date]",jEn="[object Error]",BEn="[object Function]",UEn="[object Map]",WEn="[object Number]",VEn="[object Object]",GEn="[object RegExp]",HEn="[object Set]",qEn="[object String]",XEn="[object WeakMap]",YEn="[object ArrayBuffer]",QEn="[object DataView]",KEn="[object Float32Array]",ZEn="[object Float64Array]",JEn="[object Int8Array]",e2n="[object Int16Array]",t2n="[object Int32Array]",n2n="[object Uint8Array]",r2n="[object Uint8ClampedArray]",i2n="[object Uint16Array]",o2n="[object Uint32Array]",Xr={};Xr[KEn]=Xr[ZEn]=Xr[JEn]=Xr[e2n]=Xr[t2n]=Xr[n2n]=Xr[r2n]=Xr[i2n]=Xr[o2n]=!0;Xr[$En]=Xr[FEn]=Xr[YEn]=Xr[NEn]=Xr[QEn]=Xr[zEn]=Xr[jEn]=Xr[BEn]=Xr[UEn]=Xr[WEn]=Xr[VEn]=Xr[GEn]=Xr[HEn]=Xr[qEn]=Xr[XEn]=!1;function s2n(t){return LEn(t)&&IEn(t.length)&&!!Xr[DEn(t)]}var a2n=s2n;function l2n(t){return function(e){return t(e)}}var uHe=l2n,Rz={exports:{}};Rz.exports;(function(t,e){var n=LGe,r=e&&!e.nodeType&&e,i=r&&!0&&t&&!t.nodeType&&t,o=i&&i.exports===r,s=o&&n.process,a=function(){try{var l=i&&i.require&&i.require("util").types;return l||s&&s.binding&&s.binding("util")}catch{}}();t.exports=a})(Rz,Rz.exports);var c2n=Rz.exports,u2n=a2n,f2n=uHe,r_e=c2n,i_e=r_e&&r_e.isTypedArray,d2n=i_e?f2n(i_e):u2n,fHe=d2n,h2n=mEn,p2n=dce,g2n=Dl,m2n=cHe,v2n=hce,y2n=fHe,x2n=Object.prototype,b2n=x2n.hasOwnProperty;function w2n(t,e){var n=g2n(t),r=!n&&p2n(t),i=!n&&!r&&m2n(t),o=!n&&!r&&!i&&y2n(t),s=n||r||i||o,a=s?h2n(t.length,String):[],l=a.length;for(var c in t)(e||b2n.call(t,c))&&!(s&&(c=="length"||i&&(c=="offset"||c=="parent")||o&&(c=="buffer"||c=="byteLength"||c=="byteOffset")||v2n(c,l)))&&a.push(c);return a}var _2n=w2n,S2n=Object.prototype;function C2n(t){var e=t&&t.constructor,n=typeof e=="function"&&e.prototype||S2n;return t===n}var O2n=C2n;function E2n(t,e){return function(n){return t(e(n))}}var dHe=E2n,T2n=dHe,k2n=T2n(Object.keys,Object),A2n=k2n,P2n=O2n,M2n=A2n,R2n=Object.prototype,D2n=R2n.hasOwnProperty;function I2n(t){if(!P2n(t))return M2n(t);var e=[];for(var n in Object(t))D2n.call(t,n)&&n!="constructor"&&e.push(n);return e}var L2n=I2n,$2n=ece,F2n=pce;function N2n(t){return t!=null&&F2n(t.length)&&!$2n(t)}var xD=N2n,z2n=_2n,j2n=L2n,B2n=xD;function U2n(t){return B2n(t)?z2n(t):j2n(t)}var HU=U2n,W2n=iEn,V2n=pEn,G2n=HU;function H2n(t){return W2n(t,G2n,V2n)}var q2n=H2n,o_e=q2n,X2n=1,Y2n=Object.prototype,Q2n=Y2n.hasOwnProperty;function K2n(t,e,n,r,i,o){var s=n&X2n,a=o_e(t),l=a.length,c=o_e(e),u=c.length;if(l!=u&&!s)return!1;for(var f=l;f--;){var d=a[f];if(!(s?d in e:Q2n.call(e,d)))return!1}var h=o.get(t),p=o.get(e);if(h&&p)return h==e&&p==t;var g=!0;o.set(t,e),o.set(e,t);for(var m=s;++f-1}var Ykn=Xkn;function Qkn(t,e,n){for(var r=-1,i=t==null?0:t.length;++r=fAn){var c=e?null:cAn(t);if(c)return uAn(c);s=!1,i=lAn,l=new oAn}else l=e?[]:a;e:for(;++r=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function EAn(t,e){if(t==null)return{};var n={},r=Object.keys(t),i,o;for(o=0;o=0)&&(n[i]=t[i]);return n}function TAn(t){return t.value}function kAn(t,e){if(de.isValidElement(t))return de.cloneElement(t,e);if(typeof t=="function")return de.createElement(t,e);e.ref;var n=OAn(e,yAn);return de.createElement(uce,n)}var w_e=1,TC=function(t){SAn(e,t);function e(){var n;xAn(this,e);for(var r=arguments.length,i=new Array(r),o=0;ow_e||Math.abs(i.height-this.lastBoundingBox.height)>w_e)&&(this.lastBoundingBox.width=i.width,this.lastBoundingBox.height=i.height,r&&r(i)):(this.lastBoundingBox.width!==-1||this.lastBoundingBox.height!==-1)&&(this.lastBoundingBox.width=-1,this.lastBoundingBox.height=-1,r&&r(null))}},{key:"getBBoxSnapshot",value:function(){return this.lastBoundingBox.width>=0&&this.lastBoundingBox.height>=0?A0({},this.lastBoundingBox):{width:0,height:0}}},{key:"getDefaultPosition",value:function(r){var i=this.props,o=i.layout,s=i.align,a=i.verticalAlign,l=i.margin,c=i.chartWidth,u=i.chartHeight,f,d;if(!r||(r.left===void 0||r.left===null)&&(r.right===void 0||r.right===null))if(s==="center"&&o==="vertical"){var h=this.getBBoxSnapshot();f={left:((c||0)-h.width)/2}}else f=s==="right"?{right:l&&l.right||0}:{left:l&&l.left||0};if(!r||(r.top===void 0||r.top===null)&&(r.bottom===void 0||r.bottom===null))if(a==="middle"){var p=this.getBBoxSnapshot();d={top:((u||0)-p.height)/2}}else d=a==="bottom"?{bottom:l&&l.bottom||0}:{top:l&&l.top||0};return A0(A0({},f),d)}},{key:"render",value:function(){var r=this,i=this.props,o=i.content,s=i.width,a=i.height,l=i.wrapperStyle,c=i.payloadUniqBy,u=i.payload,f=A0(A0({position:"absolute",width:s||"auto",height:a||"auto"},this.getDefaultPosition(l)),l);return de.createElement("div",{className:"recharts-legend-wrapper",style:f,ref:function(h){r.wrapperNode=h}},kAn(o,A0(A0({},this.props),{},{payload:xHe(u,c,TAn)})))}}],[{key:"getWithHeight",value:function(r,i){var o=r.props.layout;return o==="vertical"&&at(r.props.height)?{height:r.props.height}:o==="horizontal"?{width:r.props.width||i}:null}}]),e}(D.PureComponent);qU(TC,"displayName","Legend");qU(TC,"defaultProps",{iconSize:14,layout:"horizontal",align:"center",verticalAlign:"bottom"});var __e=vD,AAn=dce,PAn=Dl,S_e=__e?__e.isConcatSpreadable:void 0;function MAn(t){return PAn(t)||AAn(t)||!!(S_e&&t&&t[S_e])}var RAn=MAn,DAn=aHe,IAn=RAn;function SHe(t,e,n,r,i){var o=-1,s=t.length;for(n||(n=IAn),i||(i=[]);++o0&&n(a)?e>1?SHe(a,e-1,n,r,i):DAn(i,a):r||(i[i.length]=a)}return i}var CHe=SHe;function LAn(t){return function(e,n,r){for(var i=-1,o=Object(e),s=r(e),a=s.length;a--;){var l=s[t?a:++i];if(n(o[l],l,o)===!1)break}return e}}var $An=LAn,FAn=$An,NAn=FAn(),zAn=NAn,jAn=zAn,BAn=HU;function UAn(t,e){return t&&jAn(t,e,BAn)}var OHe=UAn,WAn=xD;function VAn(t,e){return function(n,r){if(n==null)return n;if(!WAn(n))return t(n,r);for(var i=n.length,o=e?i:-1,s=Object(n);(e?o--:++oe||o&&s&&l&&!a&&!c||r&&s&&l||!n&&l||!i)return 1;if(!r&&!o&&!c&&t=a)return l;var c=n[r];return l*(c=="desc"?-1:1)}}return t.index-e.index}var iPn=rPn,C7=oce,oPn=sce,sPn=o0,aPn=EHe,lPn=JAn,cPn=uHe,uPn=iPn,fPn=lE,dPn=Dl;function hPn(t,e,n){e.length?e=C7(e,function(o){return dPn(o)?function(s){return oPn(s,o.length===1?o[0]:o)}:o}):e=[fPn];var r=-1;e=C7(e,cPn(sPn));var i=aPn(t,function(o,s,a){var l=C7(e,function(c){return c(o)});return{criteria:l,index:++r,value:o}});return lPn(i,function(o,s){return uPn(o,s,n)})}var pPn=hPn;function gPn(t,e,n){switch(n.length){case 0:return t.call(e);case 1:return t.call(e,n[0]);case 2:return t.call(e,n[0],n[1]);case 3:return t.call(e,n[0],n[1],n[2])}return t.apply(e,n)}var mPn=gPn,vPn=mPn,O_e=Math.max;function yPn(t,e,n){return e=O_e(e===void 0?t.length-1:e,0),function(){for(var r=arguments,i=-1,o=O_e(r.length-e,0),s=Array(o);++i0){if(++e>=kPn)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}var RPn=MPn,DPn=TPn,IPn=RPn,LPn=IPn(DPn),$Pn=LPn,FPn=lE,NPn=xPn,zPn=$Pn;function jPn(t,e){return zPn(NPn(t,e,FPn),t+"")}var BPn=jPn,UPn=tce,WPn=xD,VPn=hce,GPn=i0;function HPn(t,e,n){if(!GPn(n))return!1;var r=typeof e;return(r=="number"?WPn(n)&&VPn(e,n.length):r=="string"&&e in n)?UPn(n[e],t):!1}var XU=HPn,qPn=CHe,XPn=pPn,YPn=BPn,T_e=XU,QPn=YPn(function(t,e){if(t==null)return[];var n=e.length;return n>1&&T_e(t,e[0],e[1])?e=[]:n>2&&T_e(e[0],e[1],e[2])&&(e=[e[0]]),XPn(t,qPn(e,1),[])}),KPn=QPn;const vce=on(KPn);function AP(t){"@babel/helpers - typeof";return AP=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},AP(t)}function jK(){return jK=Object.assign?Object.assign.bind():function(t){for(var e=1;et.length)&&(e=t.length);for(var n=0,r=new Array(e);n=e.x),"".concat(A2,"-left"),at(n)&&e&&at(e.x)&&n=e.y),"".concat(A2,"-top"),at(r)&&e&&at(e.y)&&rg?Math.max(u,l[r]):Math.max(f,l[r])}function dMn(t){var e=t.translateX,n=t.translateY,r=t.useTranslate3d;return{transform:r?"translate3d(".concat(e,"px, ").concat(n,"px, 0)"):"translate(".concat(e,"px, ").concat(n,"px)")}}function hMn(t){var e=t.allowEscapeViewBox,n=t.coordinate,r=t.offsetTopLeft,i=t.position,o=t.reverseDirection,s=t.tooltipBox,a=t.useTranslate3d,l=t.viewBox,c,u,f;return s.height>0&&s.width>0&&n?(u=P_e({allowEscapeViewBox:e,coordinate:n,key:"x",offsetTopLeft:r,position:i,reverseDirection:o,tooltipDimension:s.width,viewBox:l,viewBoxDimension:l.width}),f=P_e({allowEscapeViewBox:e,coordinate:n,key:"y",offsetTopLeft:r,position:i,reverseDirection:o,tooltipDimension:s.height,viewBox:l,viewBoxDimension:l.height}),c=dMn({translateX:u,translateY:f,useTranslate3d:a})):c=uMn,{cssProperties:c,cssClasses:fMn({translateX:u,translateY:f,coordinate:n})}}function kC(t){"@babel/helpers - typeof";return kC=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},kC(t)}function M_e(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function R_e(t){for(var e=1;eD_e||Math.abs(r.height-this.state.lastBoundingBox.height)>D_e)&&this.setState({lastBoundingBox:{width:r.width,height:r.height}})}else(this.state.lastBoundingBox.width!==-1||this.state.lastBoundingBox.height!==-1)&&this.setState({lastBoundingBox:{width:-1,height:-1}})}},{key:"componentDidMount",value:function(){document.addEventListener("keydown",this.handleKeyDown),this.updateBBox()}},{key:"componentWillUnmount",value:function(){document.removeEventListener("keydown",this.handleKeyDown)}},{key:"componentDidUpdate",value:function(){var r,i;this.props.active&&this.updateBBox(),this.state.dismissed&&(((r=this.props.coordinate)===null||r===void 0?void 0:r.x)!==this.state.dismissedAtCoordinate.x||((i=this.props.coordinate)===null||i===void 0?void 0:i.y)!==this.state.dismissedAtCoordinate.y)&&(this.state.dismissed=!1)}},{key:"render",value:function(){var r=this,i=this.props,o=i.active,s=i.allowEscapeViewBox,a=i.animationDuration,l=i.animationEasing,c=i.children,u=i.coordinate,f=i.hasPayload,d=i.isAnimationActive,h=i.offset,p=i.position,g=i.reverseDirection,m=i.useTranslate3d,v=i.viewBox,y=i.wrapperStyle,x=hMn({allowEscapeViewBox:s,coordinate:u,offsetTopLeft:h,position:p,reverseDirection:g,tooltipBox:this.state.lastBoundingBox,useTranslate3d:m,viewBox:v}),b=x.cssClasses,w=x.cssProperties,_=R_e(R_e({transition:d&&o?"transform ".concat(a,"ms ").concat(l):void 0},w),{},{pointerEvents:"none",visibility:!this.state.dismissed&&o&&f?"visible":"hidden",position:"absolute",top:0,left:0},y);return de.createElement("div",{tabIndex:-1,className:b,style:_,ref:function(O){r.wrapperNode=O}},c)}}]),e}(D.PureComponent),_Mn=function(){return!(typeof window<"u"&&window.document&&window.document.createElement&&window.setTimeout)},_h={isSsr:_Mn(),get:function(e){return _h[e]},set:function(e,n){if(typeof e=="string")_h[e]=n;else{var r=Object.keys(e);r&&r.length&&r.forEach(function(i){_h[i]=e[i]})}}};function AC(t){"@babel/helpers - typeof";return AC=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},AC(t)}function I_e(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function L_e(t){for(var e=1;e0;return de.createElement(wMn,{allowEscapeViewBox:s,animationDuration:a,animationEasing:l,isAnimationActive:d,active:o,coordinate:u,hasPayload:_,offset:h,position:m,reverseDirection:v,useTranslate3d:y,viewBox:x,wrapperStyle:b},RMn(c,L_e(L_e({},this.props),{},{payload:w})))}}]),e}(D.PureComponent);yce(Rd,"displayName","Tooltip");yce(Rd,"defaultProps",{accessibilityLayer:!1,allowEscapeViewBox:{x:!1,y:!1},animationDuration:400,animationEasing:"ease",contentStyle:{},coordinate:{x:0,y:0},cursor:!0,cursorStyle:{},filterNull:!0,isAnimationActive:!_h.isSsr,itemStyle:{},labelStyle:{},offset:10,reverseDirection:{x:!1,y:!1},separator:" : ",trigger:"hover",useTranslate3d:!1,viewBox:{x:0,y:0,height:0,width:0},wrapperStyle:{}});var DMn=rp,IMn=function(){return DMn.Date.now()},LMn=IMn,$Mn=/\s/;function FMn(t){for(var e=t.length;e--&&$Mn.test(t.charAt(e)););return e}var NMn=FMn,zMn=NMn,jMn=/^\s+/;function BMn(t){return t&&t.slice(0,zMn(t)+1).replace(jMn,"")}var UMn=BMn,WMn=UMn,$_e=i0,VMn=JO,F_e=NaN,GMn=/^[-+]0x[0-9a-f]+$/i,HMn=/^0b[01]+$/i,qMn=/^0o[0-7]+$/i,XMn=parseInt;function YMn(t){if(typeof t=="number")return t;if(VMn(t))return F_e;if($_e(t)){var e=typeof t.valueOf=="function"?t.valueOf():t;t=$_e(e)?e+"":e}if(typeof t!="string")return t===0?t:+t;t=WMn(t);var n=HMn.test(t);return n||qMn.test(t)?XMn(t.slice(2),n?2:8):GMn.test(t)?F_e:+t}var RHe=YMn,QMn=i0,E7=LMn,N_e=RHe,KMn="Expected a function",ZMn=Math.max,JMn=Math.min;function eRn(t,e,n){var r,i,o,s,a,l,c=0,u=!1,f=!1,d=!0;if(typeof t!="function")throw new TypeError(KMn);e=N_e(e)||0,QMn(n)&&(u=!!n.leading,f="maxWait"in n,o=f?ZMn(N_e(n.maxWait)||0,e):o,d="trailing"in n?!!n.trailing:d);function h(_){var S=r,O=i;return r=i=void 0,c=_,s=t.apply(O,S),s}function p(_){return c=_,a=setTimeout(v,e),u?h(_):s}function g(_){var S=_-l,O=_-c,k=e-S;return f?JMn(k,o-O):k}function m(_){var S=_-l,O=_-c;return l===void 0||S>=e||S<0||f&&O>=o}function v(){var _=E7();if(m(_))return y(_);a=setTimeout(v,g(_))}function y(_){return a=void 0,d&&r?h(_):(r=i=void 0,s)}function x(){a!==void 0&&clearTimeout(a),c=0,r=l=i=a=void 0}function b(){return a===void 0?s:y(E7())}function w(){var _=E7(),S=m(_);if(r=arguments,i=this,l=_,S){if(a===void 0)return p(l);if(f)return clearTimeout(a),a=setTimeout(v,e),h(l)}return a===void 0&&(a=setTimeout(v,e)),s}return w.cancel=x,w.flush=b,w}var tRn=eRn,nRn=tRn,rRn=i0,iRn="Expected a function";function oRn(t,e,n){var r=!0,i=!0;if(typeof t!="function")throw new TypeError(iRn);return rRn(n)&&(r="leading"in n?!!n.leading:r,i="trailing"in n?!!n.trailing:i),nRn(t,e,{leading:r,maxWait:e,trailing:i})}var sRn=oRn;const DHe=on(sRn);function MP(t){"@babel/helpers - typeof";return MP=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},MP(t)}function z_e(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function ZL(t){for(var e=1;et.length)&&(e=t.length);for(var n=0,r=new Array(e);n0&&(P=DHe(P,g,{trailing:!0,leading:!1}));var T=new ResizeObserver(P),R=w.current.getBoundingClientRect(),I=R.width,B=R.height;return M(I,B),T.observe(w.current),function(){T.disconnect()}},[M,g]);var A=D.useMemo(function(){var P=k.containerWidth,T=k.containerHeight;if(P<0||T<0)return null;vg(xx(s)||xx(l),`The width(%s) and height(%s) are both fixed numbers, - maybe you don't need to use a ResponsiveContainer.`,s,l),vg(!n||n>0,"The aspect(%s) must be greater than zero.",n);var R=xx(s)?P:s,I=xx(l)?T:l;n&&n>0&&(R?I=R/n:I&&(R=I*n),d&&I>d&&(I=d)),vg(R>0||I>0,`The width(%s) and height(%s) of chart should be greater than 0, + H`).concat(Bc,"M").concat(2*a,",").concat(o,` + A`).concat(s,",").concat(s,",0,1,1,").concat(a,",").concat(o),className:"recharts-legend-icon"});if(r.type==="rect")return de.createElement("path",{stroke:"none",fill:l,d:"M0,".concat(Bc/8,"h").concat(Bc,"v").concat(Bc*3/4,"h").concat(-Bc,"z"),className:"recharts-legend-icon"});if(de.isValidElement(r.legendIcon)){var c=MCn({},r);return delete c.legendIcon,de.cloneElement(r.legendIcon,c)}return de.createElement(Tce,{fill:l,cx:o,cy:o,size:Bc,sizeType:"diameter",type:r.type})}},{key:"renderItems",value:function(){var r=this,i=this.props,o=i.payload,s=i.iconSize,a=i.layout,l=i.formatter,c=i.inactiveColor,u={x:0,y:0,width:Bc,height:Bc},f={display:a==="horizontal"?"inline-block":"block",marginRight:10},d={display:"inline-block",verticalAlign:"middle",marginRight:4};return o.map(function(h,p){var g=h.formatter||l,m=Oe(kP(kP({"recharts-legend-item":!0},"legend-item-".concat(p),!0),"inactive",h.inactive));if(h.type==="none")return null;var v=mn(h.value)?null:h.value;pg(!mn(h.value),`The name property is also required when using a function for the dataKey of a chart's cartesian components. Ex: `);var y=h.inactive?c:h.color;return de.createElement("li",XK({className:m,style:f,key:"legend-item-".concat(p)},Cz(r.props,h,p)),de.createElement(WK,{width:s,height:s,viewBox:u,style:d},r.renderIcon(h)),de.createElement("span",{className:"recharts-legend-item-text",style:{color:y}},g?g(v,h,p):v))})}},{key:"render",value:function(){var r=this.props,i=r.payload,o=r.layout,s=r.align;if(!i||!i.length)return null;var a={padding:0,margin:0,textAlign:o==="horizontal"?s:"left"};return de.createElement("ul",{className:"recharts-default-legend",style:a},this.renderItems())}}]),e}(D.PureComponent);kP(kce,"displayName","Legend");kP(kce,"defaultProps",{iconSize:14,layout:"horizontal",align:"center",verticalAlign:"middle",inactiveColor:"#ccc"});var jCn=UU;function BCn(){this.__data__=new jCn,this.size=0}var UCn=BCn;function WCn(t){var e=this.__data__,n=e.delete(t);return this.size=e.size,n}var VCn=WCn;function GCn(t){return this.__data__.get(t)}var HCn=GCn;function qCn(t){return this.__data__.has(t)}var XCn=qCn,YCn=UU,QCn=bce,KCn=wce,ZCn=200;function JCn(t,e){var n=this.__data__;if(n instanceof YCn){var r=n.__data__;if(!QCn||r.lengtha))return!1;var c=o.get(t),u=o.get(e);if(c&&u)return c==e&&u==t;var f=-1,d=!0,h=n&wOn?new vOn:void 0;for(o.set(t,e),o.set(e,t);++f-1&&t%1==0&&t-1&&t%1==0&&t<=OEn}var Rce=EEn,TEn=rm,kEn=Rce,AEn=im,PEn="[object Arguments]",MEn="[object Array]",REn="[object Boolean]",DEn="[object Date]",IEn="[object Error]",LEn="[object Function]",$En="[object Map]",FEn="[object Number]",NEn="[object Object]",zEn="[object RegExp]",jEn="[object Set]",BEn="[object String]",UEn="[object WeakMap]",WEn="[object ArrayBuffer]",VEn="[object DataView]",GEn="[object Float32Array]",HEn="[object Float64Array]",qEn="[object Int8Array]",XEn="[object Int16Array]",YEn="[object Int32Array]",QEn="[object Uint8Array]",KEn="[object Uint8ClampedArray]",ZEn="[object Uint16Array]",JEn="[object Uint32Array]",Xr={};Xr[GEn]=Xr[HEn]=Xr[qEn]=Xr[XEn]=Xr[YEn]=Xr[QEn]=Xr[KEn]=Xr[ZEn]=Xr[JEn]=!0;Xr[PEn]=Xr[MEn]=Xr[WEn]=Xr[REn]=Xr[VEn]=Xr[DEn]=Xr[IEn]=Xr[LEn]=Xr[$En]=Xr[FEn]=Xr[NEn]=Xr[zEn]=Xr[jEn]=Xr[BEn]=Xr[UEn]=!1;function e2n(t){return AEn(t)&&kEn(t.length)&&!!Xr[TEn(t)]}var t2n=e2n;function n2n(t){return function(e){return t(e)}}var FHe=n2n,kz={exports:{}};kz.exports;(function(t,e){var n=lHe,r=e&&!e.nodeType&&e,i=r&&!0&&t&&!t.nodeType&&t,o=i&&i.exports===r,s=o&&n.process,a=function(){try{var l=i&&i.require&&i.require("util").types;return l||s&&s.binding&&s.binding("util")}catch{}}();t.exports=a})(kz,kz.exports);var r2n=kz.exports,i2n=t2n,o2n=FHe,P_e=r2n,M_e=P_e&&P_e.isTypedArray,s2n=M_e?o2n(M_e):i2n,NHe=s2n,a2n=uEn,l2n=Pce,c2n=Ml,u2n=$He,f2n=Mce,d2n=NHe,h2n=Object.prototype,p2n=h2n.hasOwnProperty;function g2n(t,e){var n=c2n(t),r=!n&&l2n(t),i=!n&&!r&&u2n(t),o=!n&&!r&&!i&&d2n(t),s=n||r||i||o,a=s?a2n(t.length,String):[],l=a.length;for(var c in t)(e||p2n.call(t,c))&&!(s&&(c=="length"||i&&(c=="offset"||c=="parent")||o&&(c=="buffer"||c=="byteLength"||c=="byteOffset")||f2n(c,l)))&&a.push(c);return a}var m2n=g2n,v2n=Object.prototype;function y2n(t){var e=t&&t.constructor,n=typeof e=="function"&&e.prototype||v2n;return t===n}var x2n=y2n;function b2n(t,e){return function(n){return t(e(n))}}var zHe=b2n,w2n=zHe,_2n=w2n(Object.keys,Object),S2n=_2n,C2n=x2n,O2n=S2n,E2n=Object.prototype,T2n=E2n.hasOwnProperty;function k2n(t){if(!C2n(t))return O2n(t);var e=[];for(var n in Object(t))T2n.call(t,n)&&n!="constructor"&&e.push(n);return e}var A2n=k2n,P2n=yce,M2n=Rce;function R2n(t){return t!=null&&M2n(t.length)&&!P2n(t)}var mD=R2n,D2n=m2n,I2n=A2n,L2n=mD;function $2n(t){return L2n(t)?D2n(t):I2n(t)}var HU=$2n,F2n=ZOn,N2n=lEn,z2n=HU;function j2n(t){return F2n(t,z2n,N2n)}var B2n=j2n,R_e=B2n,U2n=1,W2n=Object.prototype,V2n=W2n.hasOwnProperty;function G2n(t,e,n,r,i,o){var s=n&U2n,a=R_e(t),l=a.length,c=R_e(e),u=c.length;if(l!=u&&!s)return!1;for(var f=l;f--;){var d=a[f];if(!(s?d in e:V2n.call(e,d)))return!1}var h=o.get(t),p=o.get(e);if(h&&p)return h==e&&p==t;var g=!0;o.set(t,e),o.set(e,t);for(var m=s;++f-1}var Wkn=Ukn;function Vkn(t,e,n){for(var r=-1,i=t==null?0:t.length;++r=oAn){var c=e?null:rAn(t);if(c)return iAn(c);s=!1,i=nAn,l=new Jkn}else l=e?[]:a;e:for(;++r=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function bAn(t,e){if(t==null)return{};var n={},r=Object.keys(t),i,o;for(o=0;o=0)&&(n[i]=t[i]);return n}function wAn(t){return t.value}function _An(t,e){if(de.isValidElement(t))return de.cloneElement(t,e);if(typeof t=="function")return de.createElement(t,e);e.ref;var n=xAn(e,dAn);return de.createElement(kce,n)}var X_e=1,EC=function(t){vAn(e,t);function e(){var n;hAn(this,e);for(var r=arguments.length,i=new Array(r),o=0;oX_e||Math.abs(i.height-this.lastBoundingBox.height)>X_e)&&(this.lastBoundingBox.width=i.width,this.lastBoundingBox.height=i.height,r&&r(i)):(this.lastBoundingBox.width!==-1||this.lastBoundingBox.height!==-1)&&(this.lastBoundingBox.width=-1,this.lastBoundingBox.height=-1,r&&r(null))}},{key:"getBBoxSnapshot",value:function(){return this.lastBoundingBox.width>=0&&this.lastBoundingBox.height>=0?A0({},this.lastBoundingBox):{width:0,height:0}}},{key:"getDefaultPosition",value:function(r){var i=this.props,o=i.layout,s=i.align,a=i.verticalAlign,l=i.margin,c=i.chartWidth,u=i.chartHeight,f,d;if(!r||(r.left===void 0||r.left===null)&&(r.right===void 0||r.right===null))if(s==="center"&&o==="vertical"){var h=this.getBBoxSnapshot();f={left:((c||0)-h.width)/2}}else f=s==="right"?{right:l&&l.right||0}:{left:l&&l.left||0};if(!r||(r.top===void 0||r.top===null)&&(r.bottom===void 0||r.bottom===null))if(a==="middle"){var p=this.getBBoxSnapshot();d={top:((u||0)-p.height)/2}}else d=a==="bottom"?{bottom:l&&l.bottom||0}:{top:l&&l.top||0};return A0(A0({},f),d)}},{key:"render",value:function(){var r=this,i=this.props,o=i.content,s=i.width,a=i.height,l=i.wrapperStyle,c=i.payloadUniqBy,u=i.payload,f=A0(A0({position:"absolute",width:s||"auto",height:a||"auto"},this.getDefaultPosition(l)),l);return de.createElement("div",{className:"recharts-legend-wrapper",style:f,ref:function(h){r.wrapperNode=h}},_An(o,A0(A0({},this.props),{},{payload:HHe(u,c,wAn)})))}}],[{key:"getWithHeight",value:function(r,i){var o=r.props.layout;return o==="vertical"&&at(r.props.height)?{height:r.props.height}:o==="horizontal"?{width:r.props.width||i}:null}}]),e}(D.PureComponent);qU(EC,"displayName","Legend");qU(EC,"defaultProps",{iconSize:14,layout:"horizontal",align:"center",verticalAlign:"bottom"});var Y_e=pD,SAn=Pce,CAn=Ml,Q_e=Y_e?Y_e.isConcatSpreadable:void 0;function OAn(t){return CAn(t)||SAn(t)||!!(Q_e&&t&&t[Q_e])}var EAn=OAn,TAn=IHe,kAn=EAn;function QHe(t,e,n,r,i){var o=-1,s=t.length;for(n||(n=kAn),i||(i=[]);++o0&&n(a)?e>1?QHe(a,e-1,n,r,i):TAn(i,a):r||(i[i.length]=a)}return i}var KHe=QHe;function AAn(t){return function(e,n,r){for(var i=-1,o=Object(e),s=r(e),a=s.length;a--;){var l=s[t?a:++i];if(n(o[l],l,o)===!1)break}return e}}var PAn=AAn,MAn=PAn,RAn=MAn(),DAn=RAn,IAn=DAn,LAn=HU;function $An(t,e){return t&&IAn(t,e,LAn)}var ZHe=$An,FAn=mD;function NAn(t,e){return function(n,r){if(n==null)return n;if(!FAn(n))return t(n,r);for(var i=n.length,o=e?i:-1,s=Object(n);(e?o--:++oe||o&&s&&l&&!a&&!c||r&&s&&l||!n&&l||!i)return 1;if(!r&&!o&&!c&&t=a)return l;var c=n[r];return l*(c=="desc"?-1:1)}}return t.index-e.index}var ZAn=KAn,z7=Sce,JAn=Cce,ePn=i0,tPn=JHe,nPn=qAn,rPn=FHe,iPn=ZAn,oPn=aE,sPn=Ml;function aPn(t,e,n){e.length?e=z7(e,function(o){return sPn(o)?function(s){return JAn(s,o.length===1?o[0]:o)}:o}):e=[oPn];var r=-1;e=z7(e,rPn(ePn));var i=tPn(t,function(o,s,a){var l=z7(e,function(c){return c(o)});return{criteria:l,index:++r,value:o}});return nPn(i,function(o,s){return iPn(o,s,n)})}var lPn=aPn;function cPn(t,e,n){switch(n.length){case 0:return t.call(e);case 1:return t.call(e,n[0]);case 2:return t.call(e,n[0],n[1]);case 3:return t.call(e,n[0],n[1],n[2])}return t.apply(e,n)}var uPn=cPn,fPn=uPn,Z_e=Math.max;function dPn(t,e,n){return e=Z_e(e===void 0?t.length-1:e,0),function(){for(var r=arguments,i=-1,o=Z_e(r.length-e,0),s=Array(o);++i0){if(++e>=_Pn)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}var EPn=OPn,TPn=wPn,kPn=EPn,APn=kPn(TPn),PPn=APn,MPn=aE,RPn=hPn,DPn=PPn;function IPn(t,e){return DPn(RPn(t,e,MPn),t+"")}var LPn=IPn,$Pn=xce,FPn=mD,NPn=Mce,zPn=r0;function jPn(t,e,n){if(!zPn(n))return!1;var r=typeof e;return(r=="number"?FPn(n)&&NPn(e,n.length):r=="string"&&e in n)?$Pn(n[e],t):!1}var XU=jPn,BPn=KHe,UPn=lPn,WPn=LPn,eSe=XU,VPn=WPn(function(t,e){if(t==null)return[];var n=e.length;return n>1&&eSe(t,e[0],e[1])?e=[]:n>2&&eSe(e[0],e[1],e[2])&&(e=[e[0]]),UPn(t,BPn(e,1),[])}),GPn=VPn;const Lce=sn(GPn);function AP(t){"@babel/helpers - typeof";return AP=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},AP(t)}function nZ(){return nZ=Object.assign?Object.assign.bind():function(t){for(var e=1;et.length)&&(e=t.length);for(var n=0,r=new Array(e);n=e.x),"".concat(k2,"-left"),at(n)&&e&&at(e.x)&&n=e.y),"".concat(k2,"-top"),at(r)&&e&&at(e.y)&&rg?Math.max(u,l[r]):Math.max(f,l[r])}function sMn(t){var e=t.translateX,n=t.translateY,r=t.useTranslate3d;return{transform:r?"translate3d(".concat(e,"px, ").concat(n,"px, 0)"):"translate(".concat(e,"px, ").concat(n,"px)")}}function aMn(t){var e=t.allowEscapeViewBox,n=t.coordinate,r=t.offsetTopLeft,i=t.position,o=t.reverseDirection,s=t.tooltipBox,a=t.useTranslate3d,l=t.viewBox,c,u,f;return s.height>0&&s.width>0&&n?(u=rSe({allowEscapeViewBox:e,coordinate:n,key:"x",offsetTopLeft:r,position:i,reverseDirection:o,tooltipDimension:s.width,viewBox:l,viewBoxDimension:l.width}),f=rSe({allowEscapeViewBox:e,coordinate:n,key:"y",offsetTopLeft:r,position:i,reverseDirection:o,tooltipDimension:s.height,viewBox:l,viewBoxDimension:l.height}),c=sMn({translateX:u,translateY:f,useTranslate3d:a})):c=iMn,{cssProperties:c,cssClasses:oMn({translateX:u,translateY:f,coordinate:n})}}function TC(t){"@babel/helpers - typeof";return TC=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},TC(t)}function iSe(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function oSe(t){for(var e=1;esSe||Math.abs(r.height-this.state.lastBoundingBox.height)>sSe)&&this.setState({lastBoundingBox:{width:r.width,height:r.height}})}else(this.state.lastBoundingBox.width!==-1||this.state.lastBoundingBox.height!==-1)&&this.setState({lastBoundingBox:{width:-1,height:-1}})}},{key:"componentDidMount",value:function(){document.addEventListener("keydown",this.handleKeyDown),this.updateBBox()}},{key:"componentWillUnmount",value:function(){document.removeEventListener("keydown",this.handleKeyDown)}},{key:"componentDidUpdate",value:function(){var r,i;this.props.active&&this.updateBBox(),this.state.dismissed&&(((r=this.props.coordinate)===null||r===void 0?void 0:r.x)!==this.state.dismissedAtCoordinate.x||((i=this.props.coordinate)===null||i===void 0?void 0:i.y)!==this.state.dismissedAtCoordinate.y)&&(this.state.dismissed=!1)}},{key:"render",value:function(){var r=this,i=this.props,o=i.active,s=i.allowEscapeViewBox,a=i.animationDuration,l=i.animationEasing,c=i.children,u=i.coordinate,f=i.hasPayload,d=i.isAnimationActive,h=i.offset,p=i.position,g=i.reverseDirection,m=i.useTranslate3d,v=i.viewBox,y=i.wrapperStyle,x=aMn({allowEscapeViewBox:s,coordinate:u,offsetTopLeft:h,position:p,reverseDirection:g,tooltipBox:this.state.lastBoundingBox,useTranslate3d:m,viewBox:v}),b=x.cssClasses,w=x.cssProperties,_=oSe(oSe({transition:d&&o?"transform ".concat(a,"ms ").concat(l):void 0},w),{},{pointerEvents:"none",visibility:!this.state.dismissed&&o&&f?"visible":"hidden",position:"absolute",top:0,left:0},y);return de.createElement("div",{tabIndex:-1,className:b,style:_,ref:function(O){r.wrapperNode=O}},c)}}]),e}(D.PureComponent),mMn=function(){return!(typeof window<"u"&&window.document&&window.document.createElement&&window.setTimeout)},xh={isSsr:mMn(),get:function(e){return xh[e]},set:function(e,n){if(typeof e=="string")xh[e]=n;else{var r=Object.keys(e);r&&r.length&&r.forEach(function(i){xh[i]=e[i]})}}};function kC(t){"@babel/helpers - typeof";return kC=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},kC(t)}function aSe(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function lSe(t){for(var e=1;e0;return de.createElement(gMn,{allowEscapeViewBox:s,animationDuration:a,animationEasing:l,isAnimationActive:d,active:o,coordinate:u,hasPayload:_,offset:h,position:m,reverseDirection:v,useTranslate3d:y,viewBox:x,wrapperStyle:b},EMn(c,lSe(lSe({},this.props),{},{payload:w})))}}]),e}(D.PureComponent);$ce(Pd,"displayName","Tooltip");$ce(Pd,"defaultProps",{accessibilityLayer:!1,allowEscapeViewBox:{x:!1,y:!1},animationDuration:400,animationEasing:"ease",contentStyle:{},coordinate:{x:0,y:0},cursor:!0,cursorStyle:{},filterNull:!0,isAnimationActive:!xh.isSsr,itemStyle:{},labelStyle:{},offset:10,reverseDirection:{x:!1,y:!1},separator:" : ",trigger:"hover",useTranslate3d:!1,viewBox:{x:0,y:0,height:0,width:0},wrapperStyle:{}});var TMn=ep,kMn=function(){return TMn.Date.now()},AMn=kMn,PMn=/\s/;function MMn(t){for(var e=t.length;e--&&PMn.test(t.charAt(e)););return e}var RMn=MMn,DMn=RMn,IMn=/^\s+/;function LMn(t){return t&&t.slice(0,DMn(t)+1).replace(IMn,"")}var $Mn=LMn,FMn=$Mn,cSe=r0,NMn=ZO,uSe=NaN,zMn=/^[-+]0x[0-9a-f]+$/i,jMn=/^0b[01]+$/i,BMn=/^0o[0-7]+$/i,UMn=parseInt;function WMn(t){if(typeof t=="number")return t;if(NMn(t))return uSe;if(cSe(t)){var e=typeof t.valueOf=="function"?t.valueOf():t;t=cSe(e)?e+"":e}if(typeof t!="string")return t===0?t:+t;t=FMn(t);var n=jMn.test(t);return n||BMn.test(t)?UMn(t.slice(2),n?2:8):zMn.test(t)?uSe:+t}var oqe=WMn,VMn=r0,B7=AMn,fSe=oqe,GMn="Expected a function",HMn=Math.max,qMn=Math.min;function XMn(t,e,n){var r,i,o,s,a,l,c=0,u=!1,f=!1,d=!0;if(typeof t!="function")throw new TypeError(GMn);e=fSe(e)||0,VMn(n)&&(u=!!n.leading,f="maxWait"in n,o=f?HMn(fSe(n.maxWait)||0,e):o,d="trailing"in n?!!n.trailing:d);function h(_){var S=r,O=i;return r=i=void 0,c=_,s=t.apply(O,S),s}function p(_){return c=_,a=setTimeout(v,e),u?h(_):s}function g(_){var S=_-l,O=_-c,k=e-S;return f?qMn(k,o-O):k}function m(_){var S=_-l,O=_-c;return l===void 0||S>=e||S<0||f&&O>=o}function v(){var _=B7();if(m(_))return y(_);a=setTimeout(v,g(_))}function y(_){return a=void 0,d&&r?h(_):(r=i=void 0,s)}function x(){a!==void 0&&clearTimeout(a),c=0,r=l=i=a=void 0}function b(){return a===void 0?s:y(B7())}function w(){var _=B7(),S=m(_);if(r=arguments,i=this,l=_,S){if(a===void 0)return p(l);if(f)return clearTimeout(a),a=setTimeout(v,e),h(l)}return a===void 0&&(a=setTimeout(v,e)),s}return w.cancel=x,w.flush=b,w}var YMn=XMn,QMn=YMn,KMn=r0,ZMn="Expected a function";function JMn(t,e,n){var r=!0,i=!0;if(typeof t!="function")throw new TypeError(ZMn);return KMn(n)&&(r="leading"in n?!!n.leading:r,i="trailing"in n?!!n.trailing:i),QMn(t,e,{leading:r,maxWait:e,trailing:i})}var eRn=JMn;const sqe=sn(eRn);function MP(t){"@babel/helpers - typeof";return MP=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},MP(t)}function dSe(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function XL(t){for(var e=1;et.length)&&(e=t.length);for(var n=0,r=new Array(e);n0&&(R=sqe(R,g,{trailing:!0,leading:!1}));var T=new ResizeObserver(R),M=w.current.getBoundingClientRect(),I=M.width,j=M.height;return P(I,j),T.observe(w.current),function(){T.disconnect()}},[P,g]);var A=D.useMemo(function(){var R=k.containerWidth,T=k.containerHeight;if(R<0||T<0)return null;pg(xx(s)||xx(l),`The width(%s) and height(%s) are both fixed numbers, + maybe you don't need to use a ResponsiveContainer.`,s,l),pg(!n||n>0,"The aspect(%s) must be greater than zero.",n);var M=xx(s)?R:s,I=xx(l)?T:l;n&&n>0&&(M?I=M/n:I&&(M=I*n),d&&I>d&&(I=d)),pg(M>0||I>0,`The width(%s) and height(%s) of chart should be greater than 0, please check the style of container, or the props width(%s) and height(%s), or add a minWidth(%s) or minHeight(%s) or use aspect(%s) to control the - height and width.`,R,I,s,l,u,f,n);var B=!Array.isArray(h)&&TF.isElement(h)&&mg(h.type).endsWith("Chart");return de.Children.map(h,function($){return TF.isElement($)?D.cloneElement($,ZL({width:R,height:I},B?{style:ZL({height:"100%",width:"100%",maxHeight:I,maxWidth:R},$.props.style)}:{})):$})},[n,h,l,d,f,u,k,s]);return de.createElement("div",{id:m?"".concat(m):void 0,className:Oe("recharts-responsive-container",v),style:ZL(ZL({},b),{},{width:s,height:l,minWidth:u,minHeight:f,maxHeight:d}),ref:w},A)}),LHe=function(e){return null};LHe.displayName="Cell";function RP(t){"@babel/helpers - typeof";return RP=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},RP(t)}function B_e(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function GK(t){for(var e=1;e1&&arguments[1]!==void 0?arguments[1]:{};if(e==null||_h.isSsr)return{width:0,height:0};var r=bRn(n),i=JSON.stringify({text:e,copyStyle:r});if(uw.widthCache[i])return uw.widthCache[i];try{var o=document.getElementById(U_e);o||(o=document.createElement("span"),o.setAttribute("id",U_e),o.setAttribute("aria-hidden","true"),document.body.appendChild(o));var s=GK(GK({},xRn),r);Object.assign(o.style,s),o.textContent="".concat(e);var a=o.getBoundingClientRect(),l={width:a.width,height:a.height};return uw.widthCache[i]=l,++uw.cacheCount>yRn&&(uw.cacheCount=0,uw.widthCache={}),l}catch{return{width:0,height:0}}},wRn=function(e){return{top:e.top+window.scrollY-document.documentElement.clientTop,left:e.left+window.scrollX-document.documentElement.clientLeft}};function DP(t){"@babel/helpers - typeof";return DP=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},DP(t)}function $z(t,e){return ORn(t)||CRn(t,e)||SRn(t,e)||_Rn()}function _Rn(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function SRn(t,e){if(t){if(typeof t=="string")return W_e(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);if(n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set")return Array.from(t);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return W_e(t,e)}}function W_e(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function zRn(t,e){if(t==null)return{};var n={},r=Object.keys(t),i,o;for(o=0;o=0)&&(n[i]=t[i]);return n}function Y_e(t,e){return WRn(t)||URn(t,e)||BRn(t,e)||jRn()}function jRn(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function BRn(t,e){if(t){if(typeof t=="string")return Q_e(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);if(n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set")return Array.from(t);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Q_e(t,e)}}function Q_e(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n0&&arguments[0]!==void 0?arguments[0]:[];return R.reduce(function(I,B){var $=B.word,z=B.width,L=I[I.length-1];if(L&&(i==null||o||L.width+z+rB.width?I:B})};if(!u)return h;for(var g="…",m=function(R){var I=f.slice(0,R),B=zHe({breakAll:c,style:l,children:I+g}).wordsWithComputedWidth,$=d(B),z=$.length>s||p($).width>Number(i);return[z,$]},v=0,y=f.length-1,x=0,b;v<=y&&x<=f.length-1;){var w=Math.floor((v+y)/2),_=w-1,S=m(_),O=Y_e(S,2),k=O[0],E=O[1],M=m(w),A=Y_e(M,1),P=A[0];if(!k&&!P&&(v=w+1),k&&P&&(y=w-1),!k&&P){b=E;break}x++}return b||h},K_e=function(e){var n=_n(e)?[]:e.toString().split(NHe);return[{words:n}]},GRn=function(e){var n=e.width,r=e.scaleToFit,i=e.children,o=e.style,s=e.breakAll,a=e.maxLines;if((n||r)&&!_h.isSsr){var l,c,u=zHe({breakAll:s,children:i,style:o});if(u){var f=u.wordsWithComputedWidth,d=u.spaceWidth;l=f,c=d}else return K_e(i);return VRn({breakAll:s,children:i,maxLines:a,style:o},l,c,n,r)}return K_e(i)},Z_e="#808080",Fz=function(e){var n=e.x,r=n===void 0?0:n,i=e.y,o=i===void 0?0:i,s=e.lineHeight,a=s===void 0?"1em":s,l=e.capHeight,c=l===void 0?"0.71em":l,u=e.scaleToFit,f=u===void 0?!1:u,d=e.textAnchor,h=d===void 0?"start":d,p=e.verticalAnchor,g=p===void 0?"end":p,m=e.fill,v=m===void 0?Z_e:m,y=X_e(e,FRn),x=D.useMemo(function(){return GRn({breakAll:y.breakAll,children:y.children,maxLines:y.maxLines,scaleToFit:f,style:y.style,width:y.width})},[y.breakAll,y.children,y.maxLines,f,y.style,y.width]),b=y.dx,w=y.dy,_=y.angle,S=y.className,O=y.breakAll,k=X_e(y,NRn);if(!Co(r)||!Co(o))return null;var E=r+(at(b)?b:0),M=o+(at(w)?w:0),A;switch(g){case"start":A=T7("calc(".concat(c,")"));break;case"middle":A=T7("calc(".concat((x.length-1)/2," * -").concat(a," + (").concat(c," / 2))"));break;default:A=T7("calc(".concat(x.length-1," * -").concat(a,")"));break}var P=[];if(f){var T=x[0].width,R=y.width;P.push("scale(".concat((at(R)?R/T:1)/T,")"))}return _&&P.push("rotate(".concat(_,", ").concat(E,", ").concat(M,")")),P.length&&(k.transform=P.join(" ")),de.createElement("text",HK({},pn(k,!0),{x:E,y:M,className:Oe("recharts-text",S),textAnchor:h,fill:v.includes("url")?Z_e:v}),x.map(function(I,B){var $=I.words.join(O?"":" ");return de.createElement("tspan",{x:E,dy:B===0?A:a,key:$},$)}))};const J_e=Object.freeze(Object.defineProperty({__proto__:null,scaleBand:TA,scaleDiverging:Lre,scaleDivergingLog:$re,scaleDivergingPow:EB,scaleDivergingSqrt:y3e,scaleDivergingSymlog:Fre,scaleIdentity:Sre,scaleImplicit:AN,scaleLinear:MA,scaleLog:Ore,scaleOrdinal:lR,scalePoint:ik,scalePow:wB,scaleQuantile:Are,scaleQuantize:Pre,scaleRadial:h3e,scaleSequential:SB,scaleSequentialLog:Dre,scaleSequentialPow:CB,scaleSequentialQuantile:v3e,scaleSequentialSqrt:m3e,scaleSequentialSymlog:Ire,scaleSqrt:d3e,scaleSymlog:Tre,scaleThreshold:Mre,scaleTime:p3e,scaleUtc:g3e,tickFormat:_re},Symbol.toStringTag,{value:"Module"}));var HRn=JO;function qRn(t,e,n){for(var r=-1,i=t.length;++re}var YRn=XRn,QRn=jHe,KRn=YRn,ZRn=lE;function JRn(t){return t&&t.length?QRn(t,ZRn,KRn):void 0}var eDn=JRn;const Cv=on(eDn);function tDn(t,e){return tt.e^o.s<0?1:-1;for(r=o.d.length,i=t.d.length,e=0,n=rt.d[e]^o.s<0?1:-1;return r===i?0:r>i^o.s<0?1:-1};Et.decimalPlaces=Et.dp=function(){var t=this,e=t.d.length-1,n=(e-t.e)*Qr;if(e=t.d[e],e)for(;e%10==0;e/=10)n--;return n<0?0:n};Et.dividedBy=Et.div=function(t){return yg(this,new this.constructor(t))};Et.dividedToIntegerBy=Et.idiv=function(t){var e=this,n=e.constructor;return Lr(yg(e,new n(t),0,1),n.precision)};Et.equals=Et.eq=function(t){return!this.cmp(t)};Et.exponent=function(){return uo(this)};Et.greaterThan=Et.gt=function(t){return this.cmp(t)>0};Et.greaterThanOrEqualTo=Et.gte=function(t){return this.cmp(t)>=0};Et.isInteger=Et.isint=function(){return this.e>this.d.length-2};Et.isNegative=Et.isneg=function(){return this.s<0};Et.isPositive=Et.ispos=function(){return this.s>0};Et.isZero=function(){return this.s===0};Et.lessThan=Et.lt=function(t){return this.cmp(t)<0};Et.lessThanOrEqualTo=Et.lte=function(t){return this.cmp(t)<1};Et.logarithm=Et.log=function(t){var e,n=this,r=n.constructor,i=r.precision,o=i+5;if(t===void 0)t=new r(10);else if(t=new r(t),t.s<1||t.eq(ic))throw Error(Lu+"NaN");if(n.s<1)throw Error(Lu+(n.s?"NaN":"-Infinity"));return n.eq(ic)?new r(0):(gi=!1,e=yg(IP(n,o),IP(t,o),o),gi=!0,Lr(e,i))};Et.minus=Et.sub=function(t){var e=this;return t=new e.constructor(t),e.s==t.s?VHe(e,t):UHe(e,(t.s=-t.s,t))};Et.modulo=Et.mod=function(t){var e,n=this,r=n.constructor,i=r.precision;if(t=new r(t),!t.s)throw Error(Lu+"NaN");return n.s?(gi=!1,e=yg(n,t,0,1).times(t),gi=!0,n.minus(e)):Lr(new r(n),i)};Et.naturalExponential=Et.exp=function(){return WHe(this)};Et.naturalLogarithm=Et.ln=function(){return IP(this)};Et.negated=Et.neg=function(){var t=new this.constructor(this);return t.s=-t.s||0,t};Et.plus=Et.add=function(t){var e=this;return t=new e.constructor(t),e.s==t.s?UHe(e,t):VHe(e,(t.s=-t.s,t))};Et.precision=Et.sd=function(t){var e,n,r,i=this;if(t!==void 0&&t!==!!t&&t!==1&&t!==0)throw Error(qx+t);if(e=uo(i)+1,r=i.d.length-1,n=r*Qr+1,r=i.d[r],r){for(;r%10==0;r/=10)n--;for(r=i.d[0];r>=10;r/=10)n++}return t&&e>n?e:n};Et.squareRoot=Et.sqrt=function(){var t,e,n,r,i,o,s,a=this,l=a.constructor;if(a.s<1){if(!a.s)return new l(0);throw Error(Lu+"NaN")}for(t=uo(a),gi=!1,i=Math.sqrt(+a),i==0||i==1/0?(e=ih(a.d),(e.length+t)%2==0&&(e+="0"),i=Math.sqrt(e),t=uE((t+1)/2)-(t<0||t%2),i==1/0?e="5e"+t:(e=i.toExponential(),e=e.slice(0,e.indexOf("e")+1)+t),r=new l(e)):r=new l(i.toString()),n=l.precision,i=s=n+3;;)if(o=r,r=o.plus(yg(a,o,s+2)).times(.5),ih(o.d).slice(0,s)===(e=ih(r.d)).slice(0,s)){if(e=e.slice(s-3,s+1),i==s&&e=="4999"){if(Lr(o,n+1,0),o.times(o).eq(a)){r=o;break}}else if(e!="9999")break;s+=4}return gi=!0,Lr(r,n)};Et.times=Et.mul=function(t){var e,n,r,i,o,s,a,l,c,u=this,f=u.constructor,d=u.d,h=(t=new f(t)).d;if(!u.s||!t.s)return new f(0);for(t.s*=u.s,n=u.e+t.e,l=d.length,c=h.length,l=0;){for(e=0,i=l+r;i>r;)a=o[i]+h[r]*d[i-r-1]+e,o[i--]=a%Mo|0,e=a/Mo|0;o[i]=(o[i]+e)%Mo|0}for(;!o[--s];)o.pop();return e?++n:o.shift(),t.d=o,t.e=n,gi?Lr(t,f.precision):t};Et.toDecimalPlaces=Et.todp=function(t,e){var n=this,r=n.constructor;return n=new r(n),t===void 0?n:($h(t,0,cE),e===void 0?e=r.rounding:$h(e,0,8),Lr(n,t+uo(n)+1,e))};Et.toExponential=function(t,e){var n,r=this,i=r.constructor;return t===void 0?n=N1(r,!0):($h(t,0,cE),e===void 0?e=i.rounding:$h(e,0,8),r=Lr(new i(r),t+1,e),n=N1(r,!0,t+1)),n};Et.toFixed=function(t,e){var n,r,i=this,o=i.constructor;return t===void 0?N1(i):($h(t,0,cE),e===void 0?e=o.rounding:$h(e,0,8),r=Lr(new o(i),t+uo(i)+1,e),n=N1(r.abs(),!1,t+uo(r)+1),i.isneg()&&!i.isZero()?"-"+n:n)};Et.toInteger=Et.toint=function(){var t=this,e=t.constructor;return Lr(new e(t),uo(t)+1,e.rounding)};Et.toNumber=function(){return+this};Et.toPower=Et.pow=function(t){var e,n,r,i,o,s,a=this,l=a.constructor,c=12,u=+(t=new l(t));if(!t.s)return new l(ic);if(a=new l(a),!a.s){if(t.s<1)throw Error(Lu+"Infinity");return a}if(a.eq(ic))return a;if(r=l.precision,t.eq(ic))return Lr(a,r);if(e=t.e,n=t.d.length-1,s=e>=n,o=a.s,s){if((n=u<0?-u:u)<=BHe){for(i=new l(ic),e=Math.ceil(r/Qr+4),gi=!1;n%2&&(i=i.times(a),tSe(i.d,e)),n=uE(n/2),n!==0;)a=a.times(a),tSe(a.d,e);return gi=!0,t.s<0?new l(ic).div(i):Lr(i,r)}}else if(o<0)throw Error(Lu+"NaN");return o=o<0&&t.d[Math.max(e,n)]&1?-1:1,a.s=1,gi=!1,i=t.times(IP(a,r+c)),gi=!0,i=WHe(i),i.s=o,i};Et.toPrecision=function(t,e){var n,r,i=this,o=i.constructor;return t===void 0?(n=uo(i),r=N1(i,n<=o.toExpNeg||n>=o.toExpPos)):($h(t,1,cE),e===void 0?e=o.rounding:$h(e,0,8),i=Lr(new o(i),t,e),n=uo(i),r=N1(i,t<=n||n<=o.toExpNeg,t)),r};Et.toSignificantDigits=Et.tosd=function(t,e){var n=this,r=n.constructor;return t===void 0?(t=r.precision,e=r.rounding):($h(t,1,cE),e===void 0?e=r.rounding:$h(e,0,8)),Lr(new r(n),t,e)};Et.toString=Et.valueOf=Et.val=Et.toJSON=Et[Symbol.for("nodejs.util.inspect.custom")]=function(){var t=this,e=uo(t),n=t.constructor;return N1(t,e<=n.toExpNeg||e>=n.toExpPos)};function UHe(t,e){var n,r,i,o,s,a,l,c,u=t.constructor,f=u.precision;if(!t.s||!e.s)return e.s||(e=new u(t)),gi?Lr(e,f):e;if(l=t.d,c=e.d,s=t.e,i=e.e,l=l.slice(),o=s-i,o){for(o<0?(r=l,o=-o,a=c.length):(r=c,i=s,a=l.length),s=Math.ceil(f/Qr),a=s>a?s+1:a+1,o>a&&(o=a,r.length=1),r.reverse();o--;)r.push(0);r.reverse()}for(a=l.length,o=c.length,a-o<0&&(o=a,r=c,c=l,l=r),n=0;o;)n=(l[--o]=l[o]+c[o]+n)/Mo|0,l[o]%=Mo;for(n&&(l.unshift(n),++i),a=l.length;l[--a]==0;)l.pop();return e.d=l,e.e=i,gi?Lr(e,f):e}function $h(t,e,n){if(t!==~~t||tn)throw Error(qx+t)}function ih(t){var e,n,r,i=t.length-1,o="",s=t[0];if(i>0){for(o+=s,e=1;es?1:-1;else for(a=l=0;ai[a]?1:-1;break}return l}function n(r,i,o){for(var s=0;o--;)r[o]-=s,s=r[o]1;)r.shift()}return function(r,i,o,s){var a,l,c,u,f,d,h,p,g,m,v,y,x,b,w,_,S,O,k=r.constructor,E=r.s==i.s?1:-1,M=r.d,A=i.d;if(!r.s)return new k(r);if(!i.s)throw Error(Lu+"Division by zero");for(l=r.e-i.e,S=A.length,w=M.length,h=new k(E),p=h.d=[],c=0;A[c]==(M[c]||0);)++c;if(A[c]>(M[c]||0)&&--l,o==null?y=o=k.precision:s?y=o+(uo(r)-uo(i))+1:y=o,y<0)return new k(0);if(y=y/Qr+2|0,c=0,S==1)for(u=0,A=A[0],y++;(c1&&(A=t(A,u),M=t(M,u),S=A.length,w=M.length),b=S,g=M.slice(0,S),m=g.length;m=Mo/2&&++_;do u=0,a=e(A,g,S,m),a<0?(v=g[0],S!=m&&(v=v*Mo+(g[1]||0)),u=v/_|0,u>1?(u>=Mo&&(u=Mo-1),f=t(A,u),d=f.length,m=g.length,a=e(f,g,d,m),a==1&&(u--,n(f,S16)throw Error(xce+uo(t));if(!t.s)return new u(ic);for(e==null?(gi=!1,a=f):a=e,s=new u(.03125);t.abs().gte(.1);)t=t.times(s),c+=5;for(r=Math.log(V0(2,c))/Math.LN10*2+5|0,a+=r,n=i=o=new u(ic),u.precision=a;;){if(i=Lr(i.times(t),a),n=n.times(++l),s=o.plus(yg(i,n,a)),ih(s.d).slice(0,a)===ih(o.d).slice(0,a)){for(;c--;)o=Lr(o.times(o),a);return u.precision=f,e==null?(gi=!0,Lr(o,f)):o}o=s}}function uo(t){for(var e=t.e*Qr,n=t.d[0];n>=10;n/=10)e++;return e}function k7(t,e,n){if(e>t.LN10.sd())throw gi=!0,n&&(t.precision=n),Error(Lu+"LN10 precision limit exceeded");return Lr(new t(t.LN10),e)}function ev(t){for(var e="";t--;)e+="0";return e}function IP(t,e){var n,r,i,o,s,a,l,c,u,f=1,d=10,h=t,p=h.d,g=h.constructor,m=g.precision;if(h.s<1)throw Error(Lu+(h.s?"NaN":"-Infinity"));if(h.eq(ic))return new g(0);if(e==null?(gi=!1,c=m):c=e,h.eq(10))return e==null&&(gi=!0),k7(g,c);if(c+=d,g.precision=c,n=ih(p),r=n.charAt(0),o=uo(h),Math.abs(o)<15e14){for(;r<7&&r!=1||r==1&&n.charAt(1)>3;)h=h.times(t),n=ih(h.d),r=n.charAt(0),f++;o=uo(h),r>1?(h=new g("0."+n),o++):h=new g(r+"."+n.slice(1))}else return l=k7(g,c+2,m).times(o+""),h=IP(new g(r+"."+n.slice(1)),c-d).plus(l),g.precision=m,e==null?(gi=!0,Lr(h,m)):h;for(a=s=h=yg(h.minus(ic),h.plus(ic),c),u=Lr(h.times(h),c),i=3;;){if(s=Lr(s.times(u),c),l=a.plus(yg(s,new g(i),c)),ih(l.d).slice(0,c)===ih(a.d).slice(0,c))return a=a.times(2),o!==0&&(a=a.plus(k7(g,c+2,m).times(o+""))),a=yg(a,new g(f),c),g.precision=m,e==null?(gi=!0,Lr(a,m)):a;a=l,i+=2}}function eSe(t,e){var n,r,i;for((n=e.indexOf("."))>-1&&(e=e.replace(".","")),(r=e.search(/e/i))>0?(n<0&&(n=r),n+=+e.slice(r+1),e=e.substring(0,r)):n<0&&(n=e.length),r=0;e.charCodeAt(r)===48;)++r;for(i=e.length;e.charCodeAt(i-1)===48;)--i;if(e=e.slice(r,i),e){if(i-=r,n=n-r-1,t.e=uE(n/Qr),t.d=[],r=(n+1)%Qr,n<0&&(r+=Qr),rNz||t.e<-Nz))throw Error(xce+n)}else t.s=0,t.e=0,t.d=[0];return t}function Lr(t,e,n){var r,i,o,s,a,l,c,u,f=t.d;for(s=1,o=f[0];o>=10;o/=10)s++;if(r=e-s,r<0)r+=Qr,i=e,c=f[u=0];else{if(u=Math.ceil((r+1)/Qr),o=f.length,u>=o)return t;for(c=o=f[u],s=1;o>=10;o/=10)s++;r%=Qr,i=r-Qr+s}if(n!==void 0&&(o=V0(10,s-i-1),a=c/o%10|0,l=e<0||f[u+1]!==void 0||c%o,l=n<4?(a||l)&&(n==0||n==(t.s<0?3:2)):a>5||a==5&&(n==4||l||n==6&&(r>0?i>0?c/V0(10,s-i):0:f[u-1])%10&1||n==(t.s<0?8:7))),e<1||!f[0])return l?(o=uo(t),f.length=1,e=e-o-1,f[0]=V0(10,(Qr-e%Qr)%Qr),t.e=uE(-e/Qr)||0):(f.length=1,f[0]=t.e=t.s=0),t;if(r==0?(f.length=u,o=1,u--):(f.length=u+1,o=V0(10,Qr-r),f[u]=i>0?(c/V0(10,s-i)%V0(10,i)|0)*o:0),l)for(;;)if(u==0){(f[0]+=o)==Mo&&(f[0]=1,++t.e);break}else{if(f[u]+=o,f[u]!=Mo)break;f[u--]=0,o=1}for(r=f.length;f[--r]===0;)f.pop();if(gi&&(t.e>Nz||t.e<-Nz))throw Error(xce+uo(t));return t}function VHe(t,e){var n,r,i,o,s,a,l,c,u,f,d=t.constructor,h=d.precision;if(!t.s||!e.s)return e.s?e.s=-e.s:e=new d(t),gi?Lr(e,h):e;if(l=t.d,f=e.d,r=e.e,c=t.e,l=l.slice(),s=c-r,s){for(u=s<0,u?(n=l,s=-s,a=f.length):(n=f,r=c,a=l.length),i=Math.max(Math.ceil(h/Qr),a)+2,s>i&&(s=i,n.length=1),n.reverse(),i=s;i--;)n.push(0);n.reverse()}else{for(i=l.length,a=f.length,u=i0;--i)l[a++]=0;for(i=f.length;i>s;){if(l[--i]0?o=o.charAt(0)+"."+o.slice(1)+ev(r):s>1&&(o=o.charAt(0)+"."+o.slice(1)),o=o+(i<0?"e":"e+")+i):i<0?(o="0."+ev(-i-1)+o,n&&(r=n-s)>0&&(o+=ev(r))):i>=s?(o+=ev(i+1-s),n&&(r=n-i-1)>0&&(o=o+"."+ev(r))):((r=i+1)0&&(i+1===s&&(o+="."),o+=ev(r))),t.s<0?"-"+o:o}function tSe(t,e){if(t.length>e)return t.length=e,!0}function GHe(t){var e,n,r;function i(o){var s=this;if(!(s instanceof i))return new i(o);if(s.constructor=i,o instanceof i){s.s=o.s,s.e=o.e,s.d=(o=o.d)?o.slice():o;return}if(typeof o=="number"){if(o*0!==0)throw Error(qx+o);if(o>0)s.s=1;else if(o<0)o=-o,s.s=-1;else{s.s=0,s.e=0,s.d=[0];return}if(o===~~o&&o<1e7){s.e=0,s.d=[o];return}return eSe(s,o.toString())}else if(typeof o!="string")throw Error(qx+o);if(o.charCodeAt(0)===45?(o=o.slice(1),s.s=-1):s.s=1,SDn.test(o))eSe(s,o);else throw Error(qx+o)}if(i.prototype=Et,i.ROUND_UP=0,i.ROUND_DOWN=1,i.ROUND_CEIL=2,i.ROUND_FLOOR=3,i.ROUND_HALF_UP=4,i.ROUND_HALF_DOWN=5,i.ROUND_HALF_EVEN=6,i.ROUND_HALF_CEIL=7,i.ROUND_HALF_FLOOR=8,i.clone=GHe,i.config=i.set=CDn,t===void 0&&(t={}),t)for(r=["precision","rounding","toExpNeg","toExpPos","LN10"],e=0;e=i[e+1]&&r<=i[e+2])this[n]=r;else throw Error(qx+n+": "+r);if((r=t[n="LN10"])!==void 0)if(r==Math.LN10)this[n]=new this(r);else throw Error(qx+n+": "+r);return this}var bce=GHe(_Dn);ic=new bce(1);const Cr=bce;function ODn(t){return ADn(t)||kDn(t)||TDn(t)||EDn()}function EDn(){throw new TypeError(`Invalid attempt to spread non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function TDn(t,e){if(t){if(typeof t=="string")return qK(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);if(n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set")return Array.from(t);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return qK(t,e)}}function kDn(t){if(typeof Symbol<"u"&&Symbol.iterator in Object(t))return Array.from(t)}function ADn(t){if(Array.isArray(t))return qK(t)}function qK(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n=e?n.apply(void 0,i):t(e-s,nSe(function(){for(var a=arguments.length,l=new Array(a),c=0;ct.length)&&(e=t.length);for(var n=0,r=new Array(e);n"u"||!(Symbol.iterator in Object(t)))){var n=[],r=!0,i=!1,o=void 0;try{for(var s=t[Symbol.iterator](),a;!(r=(a=s.next()).done)&&(n.push(a.value),!(e&&n.length===e));r=!0);}catch(l){i=!0,o=l}finally{try{!r&&s.return!=null&&s.return()}finally{if(i)throw o}}return n}}function VDn(t){if(Array.isArray(t))return t}function QHe(t){var e=LP(t,2),n=e[0],r=e[1],i=n,o=r;return n>r&&(i=r,o=n),[i,o]}function KHe(t,e,n){if(t.lte(0))return new Cr(0);var r=KU.getDigitCount(t.toNumber()),i=new Cr(10).pow(r),o=t.div(i),s=r!==1?.05:.1,a=new Cr(Math.ceil(o.div(s).toNumber())).add(n).mul(s),l=a.mul(i);return e?l:new Cr(Math.ceil(l))}function GDn(t,e,n){var r=1,i=new Cr(t);if(!i.isint()&&n){var o=Math.abs(t);o<1?(r=new Cr(10).pow(KU.getDigitCount(t)-1),i=new Cr(Math.floor(i.div(r).toNumber())).mul(r)):o>1&&(i=new Cr(Math.floor(t)))}else t===0?i=new Cr(Math.floor((e-1)/2)):n||(i=new Cr(Math.floor(t)));var s=Math.floor((e-1)/2),a=DDn(RDn(function(l){return i.add(new Cr(l-s).mul(r)).toNumber()}),XK);return a(0,e)}function ZHe(t,e,n,r){var i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:0;if(!Number.isFinite((e-t)/(n-1)))return{step:new Cr(0),tickMin:new Cr(0),tickMax:new Cr(0)};var o=KHe(new Cr(e).sub(t).div(n-1),r,i),s;t<=0&&e>=0?s=new Cr(0):(s=new Cr(t).add(e).div(2),s=s.sub(new Cr(s).mod(o)));var a=Math.ceil(s.sub(t).div(o).toNumber()),l=Math.ceil(new Cr(e).sub(s).div(o).toNumber()),c=a+l+1;return c>n?ZHe(t,e,n,r,i+1):(c0?l+(n-c):l,a=e>0?a:a+(n-c)),{step:o,tickMin:s.sub(new Cr(a).mul(o)),tickMax:s.add(new Cr(l).mul(o))})}function HDn(t){var e=LP(t,2),n=e[0],r=e[1],i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:6,o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,s=Math.max(i,2),a=QHe([n,r]),l=LP(a,2),c=l[0],u=l[1];if(c===-1/0||u===1/0){var f=u===1/0?[c].concat(QK(XK(0,i-1).map(function(){return 1/0}))):[].concat(QK(XK(0,i-1).map(function(){return-1/0})),[u]);return n>r?YK(f):f}if(c===u)return GDn(c,i,o);var d=ZHe(c,u,s,o),h=d.step,p=d.tickMin,g=d.tickMax,m=KU.rangeStep(p,g.add(new Cr(.1).mul(h)),h);return n>r?YK(m):m}function qDn(t,e){var n=LP(t,2),r=n[0],i=n[1],o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,s=QHe([r,i]),a=LP(s,2),l=a[0],c=a[1];if(l===-1/0||c===1/0)return[r,i];if(l===c)return[l];var u=Math.max(e,2),f=KHe(new Cr(c).sub(l).div(u-1),o,0),d=[].concat(QK(KU.rangeStep(new Cr(l),new Cr(c).sub(new Cr(.99).mul(f)),f)),[c]);return r>i?YK(d):d}var XDn=XHe(HDn),YDn=XHe(qDn),QDn="Invariant failed";function z1(t,e){throw new Error(QDn)}var KDn=["offset","layout","width","dataKey","data","dataPointFormatter","xAxis","yAxis"];function zz(){return zz=Object.assign?Object.assign.bind():function(t){for(var e=1;et.length)&&(e=t.length);for(var n=0,r=new Array(e);n=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function iIn(t,e){if(t==null)return{};var n={},r=Object.keys(t),i,o;for(o=0;o=0)&&(n[i]=t[i]);return n}function fE(t){var e=t.offset,n=t.layout,r=t.width,i=t.dataKey,o=t.data,s=t.dataPointFormatter,a=t.xAxis,l=t.yAxis,c=rIn(t,KDn),u=pn(c,!1);t.direction==="x"&&a.type!=="number"&&z1();var f=o.map(function(d){var h=s(d,i),p=h.x,g=h.y,m=h.value,v=h.errorVal;if(!v)return null;var y=[],x,b;if(Array.isArray(v)){var w=ZDn(v,2);x=w[0],b=w[1]}else x=b=v;if(n==="vertical"){var _=a.scale,S=g+e,O=S+r,k=S-r,E=_(m-x),M=_(m+b);y.push({x1:M,y1:O,x2:M,y2:k}),y.push({x1:E,y1:S,x2:M,y2:S}),y.push({x1:E,y1:O,x2:E,y2:k})}else if(n==="horizontal"){var A=l.scale,P=p+e,T=P-r,R=P+r,I=A(m-x),B=A(m+b);y.push({x1:T,y1:B,x2:R,y2:B}),y.push({x1:P,y1:I,x2:P,y2:B}),y.push({x1:T,y1:I,x2:R,y2:I})}return de.createElement(Ur,zz({className:"recharts-errorBar",key:"bar-".concat(y.map(function($){return"".concat($.x1,"-").concat($.x2,"-").concat($.y1,"-").concat($.y2)}))},u),y.map(function($){return de.createElement("line",zz({},$,{key:"line-".concat($.x1,"-").concat($.x2,"-").concat($.y1,"-").concat($.y2)}))}))});return de.createElement(Ur,{className:"recharts-errorBars"},f)}fE.defaultProps={stroke:"black",strokeWidth:1.5,width:5,offset:0,layout:"horizontal"};fE.displayName="ErrorBar";function $P(t){"@babel/helpers - typeof";return $P=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},$P(t)}function iSe(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function A7(t){for(var e=1;et.length)&&(e=t.length);for(var n=0,r=new Array(e);n1&&arguments[1]!==void 0?arguments[1]:[],i=arguments.length>2?arguments[2]:void 0,o=arguments.length>3?arguments[3]:void 0,s=-1,a=(n=r==null?void 0:r.length)!==null&&n!==void 0?n:0;if(a<=1)return 0;if(o&&o.axisType==="angleAxis"&&Math.abs(Math.abs(o.range[1]-o.range[0])-360)<=1e-6)for(var l=o.range,c=0;c0?i[c-1].coordinate:i[a-1].coordinate,f=i[c].coordinate,d=c>=a-1?i[0].coordinate:i[c+1].coordinate,h=void 0;if(Pf(f-u)!==Pf(d-f)){var p=[];if(Pf(d-f)===Pf(l[1]-l[0])){h=d;var g=f+l[1]-l[0];p[0]=Math.min(g,(g+u)/2),p[1]=Math.max(g,(g+u)/2)}else{h=u;var m=d+l[1]-l[0];p[0]=Math.min(f,(m+f)/2),p[1]=Math.max(f,(m+f)/2)}var v=[Math.min(f,(h+f)/2),Math.max(f,(h+f)/2)];if(e>v[0]&&e<=v[1]||e>=p[0]&&e<=p[1]){s=i[c].index;break}}else{var y=Math.min(u,d),x=Math.max(u,d);if(e>(y+f)/2&&e<=(x+f)/2){s=i[c].index;break}}}else for(var b=0;b0&&b(r[b].coordinate+r[b-1].coordinate)/2&&e<=(r[b].coordinate+r[b+1].coordinate)/2||b===a-1&&e>(r[b].coordinate+r[b-1].coordinate)/2){s=r[b].index;break}return s},wce=function(e){var n=e,r=n.type.displayName,i=e.props,o=i.stroke,s=i.fill,a;switch(r){case"Line":a=o;break;case"Area":case"Radar":a=o&&o!=="none"?o:s;break;default:a=s;break}return a},gIn=function(e){var n=e.barSize,r=e.totalSize,i=e.stackGroups,o=i===void 0?{}:i;if(!o)return{};for(var s={},a=Object.keys(o),l=0,c=a.length;l=0});if(v&&v.length){var y=v[0].props.barSize,x=v[0].props[m];s[x]||(s[x]=[]);var b=_n(y)?n:y;s[x].push({item:v[0],stackList:v.slice(1),barSize:_n(b)?void 0:F1(b,r,0)})}}return s},mIn=function(e){var n=e.barGap,r=e.barCategoryGap,i=e.bandSize,o=e.sizeList,s=o===void 0?[]:o,a=e.maxBarSize,l=s.length;if(l<1)return null;var c=F1(n,i,0,!0),u,f=[];if(s[0].barSize===+s[0].barSize){var d=!1,h=i/l,p=s.reduce(function(b,w){return b+w.barSize||0},0);p+=(l-1)*c,p>=i&&(p-=(l-1)*c,c=0),p>=i&&h>0&&(d=!0,h*=.9,p=l*h);var g=(i-p)/2>>0,m={offset:g-c,size:0};u=s.reduce(function(b,w){var _={item:w.item,position:{offset:m.offset+m.size+c,size:d?h:w.barSize}},S=[].concat(sSe(b),[_]);return m=S[S.length-1].position,w.stackList&&w.stackList.length&&w.stackList.forEach(function(O){S.push({item:O,position:m})}),S},f)}else{var v=F1(r,i,0,!0);i-2*v-(l-1)*c<=0&&(c=0);var y=(i-2*v-(l-1)*c)/l;y>1&&(y>>=0);var x=a===+a?Math.min(y,a):y;u=s.reduce(function(b,w,_){var S=[].concat(sSe(b),[{item:w.item,position:{offset:v+(y+c)*_+(y-x)/2,size:x}}]);return w.stackList&&w.stackList.length&&w.stackList.forEach(function(O){S.push({item:O,position:S[S.length-1].position})}),S},f)}return u},vIn=function(e,n,r,i){var o=r.children,s=r.width,a=r.margin,l=s-(a.left||0)-(a.right||0),c=JHe({children:o,legendWidth:l});if(c){var u=i||{},f=u.width,d=u.height,h=c.align,p=c.verticalAlign,g=c.layout;if((g==="vertical"||g==="horizontal"&&p==="middle")&&h!=="center"&&at(e[h]))return Kc(Kc({},e),{},rS({},h,e[h]+(f||0)));if((g==="horizontal"||g==="vertical"&&h==="center")&&p!=="middle"&&at(e[p]))return Kc(Kc({},e),{},rS({},p,e[p]+(d||0)))}return e},yIn=function(e,n,r){return _n(n)?!0:e==="horizontal"?n==="yAxis":e==="vertical"||r==="x"?n==="xAxis":r==="y"?n==="yAxis":!0},eqe=function(e,n,r,i,o){var s=n.props.children,a=yu(s,fE).filter(function(c){return yIn(i,o,c.props.direction)});if(a&&a.length){var l=a.map(function(c){return c.props.dataKey});return e.reduce(function(c,u){var f=Da(u,r);if(_n(f))return c;var d=Array.isArray(f)?[YU(f),Cv(f)]:[f,f],h=l.reduce(function(p,g){var m=Da(u,g,0),v=d[0]-Math.abs(Array.isArray(m)?m[0]:m),y=d[1]+Math.abs(Array.isArray(m)?m[1]:m);return[Math.min(v,p[0]),Math.max(y,p[1])]},[1/0,-1/0]);return[Math.min(h[0],c[0]),Math.max(h[1],c[1])]},[1/0,-1/0])}return null},xIn=function(e,n,r,i,o){var s=n.map(function(a){return eqe(e,a,r,o,i)}).filter(function(a){return!_n(a)});return s&&s.length?s.reduce(function(a,l){return[Math.min(a[0],l[0]),Math.max(a[1],l[1])]},[1/0,-1/0]):null},tqe=function(e,n,r,i,o){var s=n.map(function(l){var c=l.props.dataKey;return r==="number"&&c&&eqe(e,l,c,i)||Pk(e,c,r,o)});if(r==="number")return s.reduce(function(l,c){return[Math.min(l[0],c[0]),Math.max(l[1],c[1])]},[1/0,-1/0]);var a={};return s.reduce(function(l,c){for(var u=0,f=c.length;u=2?Pf(a[0]-a[1])*2*c:c,n&&(e.ticks||e.niceTicks)){var u=(e.ticks||e.niceTicks).map(function(f){var d=o?o.indexOf(f):f;return{coordinate:i(d)+c,value:f,offset:c}});return u.filter(function(f){return!iE(f.coordinate)})}return e.isCategorical&&e.categoricalDomain?e.categoricalDomain.map(function(f,d){return{coordinate:i(f)+c,value:f,index:d,offset:c}}):i.ticks&&!r?i.ticks(e.tickCount).map(function(f){return{coordinate:i(f)+c,value:f,offset:c}}):i.domain().map(function(f,d){return{coordinate:i(f)+c,value:o?o[f]:f,index:d,offset:c}})},P7=new WeakMap,e$=function(e,n){if(typeof n!="function")return e;P7.has(e)||P7.set(e,new WeakMap);var r=P7.get(e);if(r.has(n))return r.get(n);var i=function(){e.apply(void 0,arguments),n.apply(void 0,arguments)};return r.set(n,i),i},bIn=function(e,n,r){var i=e.scale,o=e.type,s=e.layout,a=e.axisType;if(i==="auto")return s==="radial"&&a==="radiusAxis"?{scale:TA(),realScaleType:"band"}:s==="radial"&&a==="angleAxis"?{scale:MA(),realScaleType:"linear"}:o==="category"&&n&&(n.indexOf("LineChart")>=0||n.indexOf("AreaChart")>=0||n.indexOf("ComposedChart")>=0&&!r)?{scale:ik(),realScaleType:"point"}:o==="category"?{scale:TA(),realScaleType:"band"}:{scale:MA(),realScaleType:"linear"};if(yD(i)){var l="scale".concat(GU(i));return{scale:(J_e[l]||ik)(),realScaleType:J_e[l]?l:"point"}}return mn(i)?{scale:i}:{scale:ik(),realScaleType:"point"}},aSe=1e-4,wIn=function(e){var n=e.domain();if(!(!n||n.length<=2)){var r=n.length,i=e.range(),o=Math.min(i[0],i[1])-aSe,s=Math.max(i[0],i[1])+aSe,a=e(n[0]),l=e(n[r-1]);(as||ls)&&e.domain([n[0],n[r-1]])}},_In=function(e,n){if(!e)return null;for(var r=0,i=e.length;ri)&&(o[1]=i),o[0]>i&&(o[0]=i),o[1]=0?(e[a][r][0]=o,e[a][r][1]=o+l,o=e[a][r][1]):(e[a][r][0]=s,e[a][r][1]=s+l,s=e[a][r][1])}},OIn=function(e){var n=e.length;if(!(n<=0))for(var r=0,i=e[0].length;r=0?(e[s][r][0]=o,e[s][r][1]=o+a,o=e[s][r][1]):(e[s][r][0]=0,e[s][r][1]=0)}},EIn={sign:CIn,expand:oTt,none:LS,silhouette:sTt,wiggle:aTt,positive:OIn},TIn=function(e,n,r){var i=n.map(function(a){return a.props.dataKey}),o=EIn[r],s=iTt().keys(i).value(function(a,l){return+Da(a,l,0)}).order(nX).offset(o);return s(e)},kIn=function(e,n,r,i,o,s){if(!e)return null;var a=s?n.reverse():n,l={},c=a.reduce(function(f,d){var h=d.props,p=h.stackId,g=h.hide;if(g)return f;var m=d.props[r],v=f[m]||{hasStack:!1,stackGroups:{}};if(Co(p)){var y=v.stackGroups[p]||{numericAxisId:r,cateAxisId:i,items:[]};y.items.push(d),v.hasStack=!0,v.stackGroups[p]=y}else v.stackGroups[oE("_stackId_")]={numericAxisId:r,cateAxisId:i,items:[d]};return Kc(Kc({},f),{},rS({},m,v))},l),u={};return Object.keys(c).reduce(function(f,d){var h=c[d];if(h.hasStack){var p={};h.stackGroups=Object.keys(h.stackGroups).reduce(function(g,m){var v=h.stackGroups[m];return Kc(Kc({},g),{},rS({},m,{numericAxisId:r,cateAxisId:i,items:v.items,stackedData:TIn(e,v.items,o)}))},p)}return Kc(Kc({},f),{},rS({},d,h))},u)},AIn=function(e,n){var r=n.realScaleType,i=n.type,o=n.tickCount,s=n.originalDomain,a=n.allowDecimals,l=r||n.scale;if(l!=="auto"&&l!=="linear")return null;if(o&&i==="number"&&s&&(s[0]==="auto"||s[1]==="auto")){var c=e.domain();if(!c.length)return null;var u=XDn(c,o,a);return e.domain([YU(u),Cv(u)]),{niceTicks:u}}if(o&&i==="number"){var f=e.domain(),d=YDn(f,o,a);return{niceTicks:d}}return null};function jz(t){var e=t.axis,n=t.ticks,r=t.bandSize,i=t.entry,o=t.index,s=t.dataKey;if(e.type==="category"){if(!e.allowDuplicatedCategory&&e.dataKey&&!_n(i[e.dataKey])){var a=Ez(n,"value",i[e.dataKey]);if(a)return a.coordinate+r/2}return n[o]?n[o].coordinate+r/2:null}var l=Da(i,_n(s)?e.dataKey:s);return _n(l)?null:e.scale(l)}var lSe=function(e){var n=e.axis,r=e.ticks,i=e.offset,o=e.bandSize,s=e.entry,a=e.index;if(n.type==="category")return r[a]?r[a].coordinate+i:null;var l=Da(s,n.dataKey,n.domain[a]);return _n(l)?null:n.scale(l)-o/2+i},PIn=function(e){var n=e.numericAxis,r=n.scale.domain();if(n.type==="number"){var i=Math.min(r[0],r[1]),o=Math.max(r[0],r[1]);return i<=0&&o>=0?0:o<0?o:i}return r[0]},MIn=function(e,n){var r=e.props.stackId;if(Co(r)){var i=n[r];if(i){var o=i.items.indexOf(e);return o>=0?i.stackedData[o]:null}}return null},RIn=function(e){return e.reduce(function(n,r){return[YU(r.concat([n[0]]).filter(at)),Cv(r.concat([n[1]]).filter(at))]},[1/0,-1/0])},iqe=function(e,n,r){return Object.keys(e).reduce(function(i,o){var s=e[o],a=s.stackedData,l=a.reduce(function(c,u){var f=RIn(u.slice(n,r+1));return[Math.min(c[0],f[0]),Math.max(c[1],f[1])]},[1/0,-1/0]);return[Math.min(l[0],i[0]),Math.max(l[1],i[1])]},[1/0,-1/0]).map(function(i){return i===1/0||i===-1/0?0:i})},cSe=/^dataMin[\s]*-[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,uSe=/^dataMax[\s]*\+[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,JK=function(e,n,r){if(mn(e))return e(n,r);if(!Array.isArray(e))return n;var i=[];if(at(e[0]))i[0]=r?e[0]:Math.min(e[0],n[0]);else if(cSe.test(e[0])){var o=+cSe.exec(e[0])[1];i[0]=n[0]-o}else mn(e[0])?i[0]=e[0](n[0]):i[0]=n[0];if(at(e[1]))i[1]=r?e[1]:Math.max(e[1],n[1]);else if(uSe.test(e[1])){var s=+uSe.exec(e[1])[1];i[1]=n[1]+s}else mn(e[1])?i[1]=e[1](n[1]):i[1]=n[1];return i},Bz=function(e,n,r){if(e&&e.scale&&e.scale.bandwidth){var i=e.scale.bandwidth();if(!r||i>0)return i}if(e&&n&&n.length>=2){for(var o=vce(n,function(f){return f.coordinate}),s=1/0,a=1,l=o.length;as&&(c=2*Math.PI-c),{radius:a,angle:$In(c),angleInRadian:c}},zIn=function(e){var n=e.startAngle,r=e.endAngle,i=Math.floor(n/360),o=Math.floor(r/360),s=Math.min(i,o);return{startAngle:n-s*360,endAngle:r-s*360}},jIn=function(e,n){var r=n.startAngle,i=n.endAngle,o=Math.floor(r/360),s=Math.floor(i/360),a=Math.min(o,s);return e+a*360},pSe=function(e,n){var r=e.x,i=e.y,o=NIn({x:r,y:i},n),s=o.radius,a=o.angle,l=n.innerRadius,c=n.outerRadius;if(sc)return!1;if(s===0)return!0;var u=zIn(n),f=u.startAngle,d=u.endAngle,h=a,p;if(f<=d){for(;h>d;)h-=360;for(;h=f&&h<=d}else{for(;h>f;)h-=360;for(;h=d&&h<=f}return p?hSe(hSe({},n),{},{radius:s,angle:jIn(h,n)}):null};function zP(t){"@babel/helpers - typeof";return zP=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},zP(t)}var BIn=["offset"];function UIn(t){return HIn(t)||GIn(t)||VIn(t)||WIn()}function WIn(){throw new TypeError(`Invalid attempt to spread non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function VIn(t,e){if(t){if(typeof t=="string")return eZ(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);if(n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set")return Array.from(t);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return eZ(t,e)}}function GIn(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function HIn(t){if(Array.isArray(t))return eZ(t)}function eZ(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function XIn(t,e){if(t==null)return{};var n={},r=Object.keys(t),i,o;for(o=0;o=0)&&(n[i]=t[i]);return n}function gSe(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function go(t){for(var e=1;e=0?1:-1,x,b;i==="insideStart"?(x=h+y*s,b=g):i==="insideEnd"?(x=p-y*s,b=!g):i==="end"&&(x=p+y*s,b=g),b=v<=0?b:!b;var w=ms(c,u,m,x),_=ms(c,u,m,x+(b?1:-1)*359),S="M".concat(w.x,",").concat(w.y,` + height and width.`,M,I,s,l,u,f,n);var j=!Array.isArray(h)&&SF.isElement(h)&&hg(h.type).endsWith("Chart");return de.Children.map(h,function(N){return SF.isElement(N)?D.cloneElement(N,XL({width:M,height:I},j?{style:XL({height:"100%",width:"100%",maxHeight:I,maxWidth:M},N.props.style)}:{})):N})},[n,h,l,d,f,u,k,s]);return de.createElement("div",{id:m?"".concat(m):void 0,className:Oe("recharts-responsive-container",v),style:XL(XL({},b),{},{width:s,height:l,minWidth:u,minHeight:f,maxHeight:d}),ref:w},A)}),lqe=function(e){return null};lqe.displayName="Cell";function RP(t){"@babel/helpers - typeof";return RP=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},RP(t)}function pSe(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function aZ(t){for(var e=1;e1&&arguments[1]!==void 0?arguments[1]:{};if(e==null||xh.isSsr)return{width:0,height:0};var r=pRn(n),i=JSON.stringify({text:e,copyStyle:r});if(cw.widthCache[i])return cw.widthCache[i];try{var o=document.getElementById(gSe);o||(o=document.createElement("span"),o.setAttribute("id",gSe),o.setAttribute("aria-hidden","true"),document.body.appendChild(o));var s=aZ(aZ({},hRn),r);Object.assign(o.style,s),o.textContent="".concat(e);var a=o.getBoundingClientRect(),l={width:a.width,height:a.height};return cw.widthCache[i]=l,++cw.cacheCount>dRn&&(cw.cacheCount=0,cw.widthCache={}),l}catch{return{width:0,height:0}}},gRn=function(e){return{top:e.top+window.scrollY-document.documentElement.clientTop,left:e.left+window.scrollX-document.documentElement.clientLeft}};function DP(t){"@babel/helpers - typeof";return DP=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},DP(t)}function Rz(t,e){return xRn(t)||yRn(t,e)||vRn(t,e)||mRn()}function mRn(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function vRn(t,e){if(t){if(typeof t=="string")return mSe(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);if(n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set")return Array.from(t);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return mSe(t,e)}}function mSe(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function DRn(t,e){if(t==null)return{};var n={},r=Object.keys(t),i,o;for(o=0;o=0)&&(n[i]=t[i]);return n}function _Se(t,e){return FRn(t)||$Rn(t,e)||LRn(t,e)||IRn()}function IRn(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function LRn(t,e){if(t){if(typeof t=="string")return SSe(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);if(n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set")return Array.from(t);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return SSe(t,e)}}function SSe(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n0&&arguments[0]!==void 0?arguments[0]:[];return M.reduce(function(I,j){var N=j.word,z=j.width,L=I[I.length-1];if(L&&(i==null||o||L.width+z+rj.width?I:j})};if(!u)return h;for(var g="…",m=function(M){var I=f.slice(0,M),j=dqe({breakAll:c,style:l,children:I+g}).wordsWithComputedWidth,N=d(j),z=N.length>s||p(N).width>Number(i);return[z,N]},v=0,y=f.length-1,x=0,b;v<=y&&x<=f.length-1;){var w=Math.floor((v+y)/2),_=w-1,S=m(_),O=_Se(S,2),k=O[0],E=O[1],P=m(w),A=_Se(P,1),R=A[0];if(!k&&!R&&(v=w+1),k&&R&&(y=w-1),!k&&R){b=E;break}x++}return b||h},CSe=function(e){var n=wn(e)?[]:e.toString().split(fqe);return[{words:n}]},zRn=function(e){var n=e.width,r=e.scaleToFit,i=e.children,o=e.style,s=e.breakAll,a=e.maxLines;if((n||r)&&!xh.isSsr){var l,c,u=dqe({breakAll:s,children:i,style:o});if(u){var f=u.wordsWithComputedWidth,d=u.spaceWidth;l=f,c=d}else return CSe(i);return NRn({breakAll:s,children:i,maxLines:a,style:o},l,c,n,r)}return CSe(i)},OSe="#808080",Dz=function(e){var n=e.x,r=n===void 0?0:n,i=e.y,o=i===void 0?0:i,s=e.lineHeight,a=s===void 0?"1em":s,l=e.capHeight,c=l===void 0?"0.71em":l,u=e.scaleToFit,f=u===void 0?!1:u,d=e.textAnchor,h=d===void 0?"start":d,p=e.verticalAnchor,g=p===void 0?"end":p,m=e.fill,v=m===void 0?OSe:m,y=wSe(e,MRn),x=D.useMemo(function(){return zRn({breakAll:y.breakAll,children:y.children,maxLines:y.maxLines,scaleToFit:f,style:y.style,width:y.width})},[y.breakAll,y.children,y.maxLines,f,y.style,y.width]),b=y.dx,w=y.dy,_=y.angle,S=y.className,O=y.breakAll,k=wSe(y,RRn);if(!So(r)||!So(o))return null;var E=r+(at(b)?b:0),P=o+(at(w)?w:0),A;switch(g){case"start":A=U7("calc(".concat(c,")"));break;case"middle":A=U7("calc(".concat((x.length-1)/2," * -").concat(a," + (").concat(c," / 2))"));break;default:A=U7("calc(".concat(x.length-1," * -").concat(a,")"));break}var R=[];if(f){var T=x[0].width,M=y.width;R.push("scale(".concat((at(M)?M/T:1)/T,")"))}return _&&R.push("rotate(".concat(_,", ").concat(E,", ").concat(P,")")),R.length&&(k.transform=R.join(" ")),de.createElement("text",lZ({},pn(k,!0),{x:E,y:P,className:Oe("recharts-text",S),textAnchor:h,fill:v.includes("url")?OSe:v}),x.map(function(I,j){var N=I.words.join(O?"":" ");return de.createElement("tspan",{x:E,dy:j===0?A:a,key:N},N)}))};const ESe=Object.freeze(Object.defineProperty({__proto__:null,scaleBand:EA,scaleDiverging:Kre,scaleDivergingLog:Zre,scaleDivergingPow:_B,scaleDivergingSqrt:j3e,scaleDivergingSymlog:Jre,scaleIdentity:zre,scaleImplicit:SN,scaleLinear:PA,scaleLog:Bre,scaleOrdinal:aR,scalePoint:rk,scalePow:vB,scaleQuantile:Gre,scaleQuantize:Hre,scaleRadial:L3e,scaleSequential:xB,scaleSequentialLog:Yre,scaleSequentialPow:bB,scaleSequentialQuantile:z3e,scaleSequentialSqrt:N3e,scaleSequentialSymlog:Qre,scaleSqrt:I3e,scaleSymlog:Wre,scaleThreshold:qre,scaleTime:$3e,scaleUtc:F3e,tickFormat:Nre},Symbol.toStringTag,{value:"Module"}));var jRn=ZO;function BRn(t,e,n){for(var r=-1,i=t.length;++re}var WRn=URn,VRn=hqe,GRn=WRn,HRn=aE;function qRn(t){return t&&t.length?VRn(t,HRn,GRn):void 0}var XRn=qRn;const Sv=sn(XRn);function YRn(t,e){return tt.e^o.s<0?1:-1;for(r=o.d.length,i=t.d.length,e=0,n=rt.d[e]^o.s<0?1:-1;return r===i?0:r>i^o.s<0?1:-1};Et.decimalPlaces=Et.dp=function(){var t=this,e=t.d.length-1,n=(e-t.e)*Qr;if(e=t.d[e],e)for(;e%10==0;e/=10)n--;return n<0?0:n};Et.dividedBy=Et.div=function(t){return gg(this,new this.constructor(t))};Et.dividedToIntegerBy=Et.idiv=function(t){var e=this,n=e.constructor;return Lr(gg(e,new n(t),0,1),n.precision)};Et.equals=Et.eq=function(t){return!this.cmp(t)};Et.exponent=function(){return co(this)};Et.greaterThan=Et.gt=function(t){return this.cmp(t)>0};Et.greaterThanOrEqualTo=Et.gte=function(t){return this.cmp(t)>=0};Et.isInteger=Et.isint=function(){return this.e>this.d.length-2};Et.isNegative=Et.isneg=function(){return this.s<0};Et.isPositive=Et.ispos=function(){return this.s>0};Et.isZero=function(){return this.s===0};Et.lessThan=Et.lt=function(t){return this.cmp(t)<0};Et.lessThanOrEqualTo=Et.lte=function(t){return this.cmp(t)<1};Et.logarithm=Et.log=function(t){var e,n=this,r=n.constructor,i=r.precision,o=i+5;if(t===void 0)t=new r(10);else if(t=new r(t),t.s<1||t.eq(nc))throw Error(Lu+"NaN");if(n.s<1)throw Error(Lu+(n.s?"NaN":"-Infinity"));return n.eq(nc)?new r(0):(mi=!1,e=gg(IP(n,o),IP(t,o),o),mi=!0,Lr(e,i))};Et.minus=Et.sub=function(t){var e=this;return t=new e.constructor(t),e.s==t.s?vqe(e,t):gqe(e,(t.s=-t.s,t))};Et.modulo=Et.mod=function(t){var e,n=this,r=n.constructor,i=r.precision;if(t=new r(t),!t.s)throw Error(Lu+"NaN");return n.s?(mi=!1,e=gg(n,t,0,1).times(t),mi=!0,n.minus(e)):Lr(new r(n),i)};Et.naturalExponential=Et.exp=function(){return mqe(this)};Et.naturalLogarithm=Et.ln=function(){return IP(this)};Et.negated=Et.neg=function(){var t=new this.constructor(this);return t.s=-t.s||0,t};Et.plus=Et.add=function(t){var e=this;return t=new e.constructor(t),e.s==t.s?gqe(e,t):vqe(e,(t.s=-t.s,t))};Et.precision=Et.sd=function(t){var e,n,r,i=this;if(t!==void 0&&t!==!!t&&t!==1&&t!==0)throw Error(qx+t);if(e=co(i)+1,r=i.d.length-1,n=r*Qr+1,r=i.d[r],r){for(;r%10==0;r/=10)n--;for(r=i.d[0];r>=10;r/=10)n++}return t&&e>n?e:n};Et.squareRoot=Et.sqrt=function(){var t,e,n,r,i,o,s,a=this,l=a.constructor;if(a.s<1){if(!a.s)return new l(0);throw Error(Lu+"NaN")}for(t=co(a),mi=!1,i=Math.sqrt(+a),i==0||i==1/0?(e=th(a.d),(e.length+t)%2==0&&(e+="0"),i=Math.sqrt(e),t=cE((t+1)/2)-(t<0||t%2),i==1/0?e="5e"+t:(e=i.toExponential(),e=e.slice(0,e.indexOf("e")+1)+t),r=new l(e)):r=new l(i.toString()),n=l.precision,i=s=n+3;;)if(o=r,r=o.plus(gg(a,o,s+2)).times(.5),th(o.d).slice(0,s)===(e=th(r.d)).slice(0,s)){if(e=e.slice(s-3,s+1),i==s&&e=="4999"){if(Lr(o,n+1,0),o.times(o).eq(a)){r=o;break}}else if(e!="9999")break;s+=4}return mi=!0,Lr(r,n)};Et.times=Et.mul=function(t){var e,n,r,i,o,s,a,l,c,u=this,f=u.constructor,d=u.d,h=(t=new f(t)).d;if(!u.s||!t.s)return new f(0);for(t.s*=u.s,n=u.e+t.e,l=d.length,c=h.length,l=0;){for(e=0,i=l+r;i>r;)a=o[i]+h[r]*d[i-r-1]+e,o[i--]=a%Mo|0,e=a/Mo|0;o[i]=(o[i]+e)%Mo|0}for(;!o[--s];)o.pop();return e?++n:o.shift(),t.d=o,t.e=n,mi?Lr(t,f.precision):t};Et.toDecimalPlaces=Et.todp=function(t,e){var n=this,r=n.constructor;return n=new r(n),t===void 0?n:(Dh(t,0,lE),e===void 0?e=r.rounding:Dh(e,0,8),Lr(n,t+co(n)+1,e))};Et.toExponential=function(t,e){var n,r=this,i=r.constructor;return t===void 0?n=Nb(r,!0):(Dh(t,0,lE),e===void 0?e=i.rounding:Dh(e,0,8),r=Lr(new i(r),t+1,e),n=Nb(r,!0,t+1)),n};Et.toFixed=function(t,e){var n,r,i=this,o=i.constructor;return t===void 0?Nb(i):(Dh(t,0,lE),e===void 0?e=o.rounding:Dh(e,0,8),r=Lr(new o(i),t+co(i)+1,e),n=Nb(r.abs(),!1,t+co(r)+1),i.isneg()&&!i.isZero()?"-"+n:n)};Et.toInteger=Et.toint=function(){var t=this,e=t.constructor;return Lr(new e(t),co(t)+1,e.rounding)};Et.toNumber=function(){return+this};Et.toPower=Et.pow=function(t){var e,n,r,i,o,s,a=this,l=a.constructor,c=12,u=+(t=new l(t));if(!t.s)return new l(nc);if(a=new l(a),!a.s){if(t.s<1)throw Error(Lu+"Infinity");return a}if(a.eq(nc))return a;if(r=l.precision,t.eq(nc))return Lr(a,r);if(e=t.e,n=t.d.length-1,s=e>=n,o=a.s,s){if((n=u<0?-u:u)<=pqe){for(i=new l(nc),e=Math.ceil(r/Qr+4),mi=!1;n%2&&(i=i.times(a),kSe(i.d,e)),n=cE(n/2),n!==0;)a=a.times(a),kSe(a.d,e);return mi=!0,t.s<0?new l(nc).div(i):Lr(i,r)}}else if(o<0)throw Error(Lu+"NaN");return o=o<0&&t.d[Math.max(e,n)]&1?-1:1,a.s=1,mi=!1,i=t.times(IP(a,r+c)),mi=!0,i=mqe(i),i.s=o,i};Et.toPrecision=function(t,e){var n,r,i=this,o=i.constructor;return t===void 0?(n=co(i),r=Nb(i,n<=o.toExpNeg||n>=o.toExpPos)):(Dh(t,1,lE),e===void 0?e=o.rounding:Dh(e,0,8),i=Lr(new o(i),t,e),n=co(i),r=Nb(i,t<=n||n<=o.toExpNeg,t)),r};Et.toSignificantDigits=Et.tosd=function(t,e){var n=this,r=n.constructor;return t===void 0?(t=r.precision,e=r.rounding):(Dh(t,1,lE),e===void 0?e=r.rounding:Dh(e,0,8)),Lr(new r(n),t,e)};Et.toString=Et.valueOf=Et.val=Et.toJSON=Et[Symbol.for("nodejs.util.inspect.custom")]=function(){var t=this,e=co(t),n=t.constructor;return Nb(t,e<=n.toExpNeg||e>=n.toExpPos)};function gqe(t,e){var n,r,i,o,s,a,l,c,u=t.constructor,f=u.precision;if(!t.s||!e.s)return e.s||(e=new u(t)),mi?Lr(e,f):e;if(l=t.d,c=e.d,s=t.e,i=e.e,l=l.slice(),o=s-i,o){for(o<0?(r=l,o=-o,a=c.length):(r=c,i=s,a=l.length),s=Math.ceil(f/Qr),a=s>a?s+1:a+1,o>a&&(o=a,r.length=1),r.reverse();o--;)r.push(0);r.reverse()}for(a=l.length,o=c.length,a-o<0&&(o=a,r=c,c=l,l=r),n=0;o;)n=(l[--o]=l[o]+c[o]+n)/Mo|0,l[o]%=Mo;for(n&&(l.unshift(n),++i),a=l.length;l[--a]==0;)l.pop();return e.d=l,e.e=i,mi?Lr(e,f):e}function Dh(t,e,n){if(t!==~~t||tn)throw Error(qx+t)}function th(t){var e,n,r,i=t.length-1,o="",s=t[0];if(i>0){for(o+=s,e=1;es?1:-1;else for(a=l=0;ai[a]?1:-1;break}return l}function n(r,i,o){for(var s=0;o--;)r[o]-=s,s=r[o]1;)r.shift()}return function(r,i,o,s){var a,l,c,u,f,d,h,p,g,m,v,y,x,b,w,_,S,O,k=r.constructor,E=r.s==i.s?1:-1,P=r.d,A=i.d;if(!r.s)return new k(r);if(!i.s)throw Error(Lu+"Division by zero");for(l=r.e-i.e,S=A.length,w=P.length,h=new k(E),p=h.d=[],c=0;A[c]==(P[c]||0);)++c;if(A[c]>(P[c]||0)&&--l,o==null?y=o=k.precision:s?y=o+(co(r)-co(i))+1:y=o,y<0)return new k(0);if(y=y/Qr+2|0,c=0,S==1)for(u=0,A=A[0],y++;(c1&&(A=t(A,u),P=t(P,u),S=A.length,w=P.length),b=S,g=P.slice(0,S),m=g.length;m=Mo/2&&++_;do u=0,a=e(A,g,S,m),a<0?(v=g[0],S!=m&&(v=v*Mo+(g[1]||0)),u=v/_|0,u>1?(u>=Mo&&(u=Mo-1),f=t(A,u),d=f.length,m=g.length,a=e(f,g,d,m),a==1&&(u--,n(f,S16)throw Error(Fce+co(t));if(!t.s)return new u(nc);for(e==null?(mi=!1,a=f):a=e,s=new u(.03125);t.abs().gte(.1);)t=t.times(s),c+=5;for(r=Math.log(V0(2,c))/Math.LN10*2+5|0,a+=r,n=i=o=new u(nc),u.precision=a;;){if(i=Lr(i.times(t),a),n=n.times(++l),s=o.plus(gg(i,n,a)),th(s.d).slice(0,a)===th(o.d).slice(0,a)){for(;c--;)o=Lr(o.times(o),a);return u.precision=f,e==null?(mi=!0,Lr(o,f)):o}o=s}}function co(t){for(var e=t.e*Qr,n=t.d[0];n>=10;n/=10)e++;return e}function W7(t,e,n){if(e>t.LN10.sd())throw mi=!0,n&&(t.precision=n),Error(Lu+"LN10 precision limit exceeded");return Lr(new t(t.LN10),e)}function Zm(t){for(var e="";t--;)e+="0";return e}function IP(t,e){var n,r,i,o,s,a,l,c,u,f=1,d=10,h=t,p=h.d,g=h.constructor,m=g.precision;if(h.s<1)throw Error(Lu+(h.s?"NaN":"-Infinity"));if(h.eq(nc))return new g(0);if(e==null?(mi=!1,c=m):c=e,h.eq(10))return e==null&&(mi=!0),W7(g,c);if(c+=d,g.precision=c,n=th(p),r=n.charAt(0),o=co(h),Math.abs(o)<15e14){for(;r<7&&r!=1||r==1&&n.charAt(1)>3;)h=h.times(t),n=th(h.d),r=n.charAt(0),f++;o=co(h),r>1?(h=new g("0."+n),o++):h=new g(r+"."+n.slice(1))}else return l=W7(g,c+2,m).times(o+""),h=IP(new g(r+"."+n.slice(1)),c-d).plus(l),g.precision=m,e==null?(mi=!0,Lr(h,m)):h;for(a=s=h=gg(h.minus(nc),h.plus(nc),c),u=Lr(h.times(h),c),i=3;;){if(s=Lr(s.times(u),c),l=a.plus(gg(s,new g(i),c)),th(l.d).slice(0,c)===th(a.d).slice(0,c))return a=a.times(2),o!==0&&(a=a.plus(W7(g,c+2,m).times(o+""))),a=gg(a,new g(f),c),g.precision=m,e==null?(mi=!0,Lr(a,m)):a;a=l,i+=2}}function TSe(t,e){var n,r,i;for((n=e.indexOf("."))>-1&&(e=e.replace(".","")),(r=e.search(/e/i))>0?(n<0&&(n=r),n+=+e.slice(r+1),e=e.substring(0,r)):n<0&&(n=e.length),r=0;e.charCodeAt(r)===48;)++r;for(i=e.length;e.charCodeAt(i-1)===48;)--i;if(e=e.slice(r,i),e){if(i-=r,n=n-r-1,t.e=cE(n/Qr),t.d=[],r=(n+1)%Qr,n<0&&(r+=Qr),rIz||t.e<-Iz))throw Error(Fce+n)}else t.s=0,t.e=0,t.d=[0];return t}function Lr(t,e,n){var r,i,o,s,a,l,c,u,f=t.d;for(s=1,o=f[0];o>=10;o/=10)s++;if(r=e-s,r<0)r+=Qr,i=e,c=f[u=0];else{if(u=Math.ceil((r+1)/Qr),o=f.length,u>=o)return t;for(c=o=f[u],s=1;o>=10;o/=10)s++;r%=Qr,i=r-Qr+s}if(n!==void 0&&(o=V0(10,s-i-1),a=c/o%10|0,l=e<0||f[u+1]!==void 0||c%o,l=n<4?(a||l)&&(n==0||n==(t.s<0?3:2)):a>5||a==5&&(n==4||l||n==6&&(r>0?i>0?c/V0(10,s-i):0:f[u-1])%10&1||n==(t.s<0?8:7))),e<1||!f[0])return l?(o=co(t),f.length=1,e=e-o-1,f[0]=V0(10,(Qr-e%Qr)%Qr),t.e=cE(-e/Qr)||0):(f.length=1,f[0]=t.e=t.s=0),t;if(r==0?(f.length=u,o=1,u--):(f.length=u+1,o=V0(10,Qr-r),f[u]=i>0?(c/V0(10,s-i)%V0(10,i)|0)*o:0),l)for(;;)if(u==0){(f[0]+=o)==Mo&&(f[0]=1,++t.e);break}else{if(f[u]+=o,f[u]!=Mo)break;f[u--]=0,o=1}for(r=f.length;f[--r]===0;)f.pop();if(mi&&(t.e>Iz||t.e<-Iz))throw Error(Fce+co(t));return t}function vqe(t,e){var n,r,i,o,s,a,l,c,u,f,d=t.constructor,h=d.precision;if(!t.s||!e.s)return e.s?e.s=-e.s:e=new d(t),mi?Lr(e,h):e;if(l=t.d,f=e.d,r=e.e,c=t.e,l=l.slice(),s=c-r,s){for(u=s<0,u?(n=l,s=-s,a=f.length):(n=f,r=c,a=l.length),i=Math.max(Math.ceil(h/Qr),a)+2,s>i&&(s=i,n.length=1),n.reverse(),i=s;i--;)n.push(0);n.reverse()}else{for(i=l.length,a=f.length,u=i0;--i)l[a++]=0;for(i=f.length;i>s;){if(l[--i]0?o=o.charAt(0)+"."+o.slice(1)+Zm(r):s>1&&(o=o.charAt(0)+"."+o.slice(1)),o=o+(i<0?"e":"e+")+i):i<0?(o="0."+Zm(-i-1)+o,n&&(r=n-s)>0&&(o+=Zm(r))):i>=s?(o+=Zm(i+1-s),n&&(r=n-i-1)>0&&(o=o+"."+Zm(r))):((r=i+1)0&&(i+1===s&&(o+="."),o+=Zm(r))),t.s<0?"-"+o:o}function kSe(t,e){if(t.length>e)return t.length=e,!0}function yqe(t){var e,n,r;function i(o){var s=this;if(!(s instanceof i))return new i(o);if(s.constructor=i,o instanceof i){s.s=o.s,s.e=o.e,s.d=(o=o.d)?o.slice():o;return}if(typeof o=="number"){if(o*0!==0)throw Error(qx+o);if(o>0)s.s=1;else if(o<0)o=-o,s.s=-1;else{s.s=0,s.e=0,s.d=[0];return}if(o===~~o&&o<1e7){s.e=0,s.d=[o];return}return TSe(s,o.toString())}else if(typeof o!="string")throw Error(qx+o);if(o.charCodeAt(0)===45?(o=o.slice(1),s.s=-1):s.s=1,vDn.test(o))TSe(s,o);else throw Error(qx+o)}if(i.prototype=Et,i.ROUND_UP=0,i.ROUND_DOWN=1,i.ROUND_CEIL=2,i.ROUND_FLOOR=3,i.ROUND_HALF_UP=4,i.ROUND_HALF_DOWN=5,i.ROUND_HALF_EVEN=6,i.ROUND_HALF_CEIL=7,i.ROUND_HALF_FLOOR=8,i.clone=yqe,i.config=i.set=yDn,t===void 0&&(t={}),t)for(r=["precision","rounding","toExpNeg","toExpPos","LN10"],e=0;e=i[e+1]&&r<=i[e+2])this[n]=r;else throw Error(qx+n+": "+r);if((r=t[n="LN10"])!==void 0)if(r==Math.LN10)this[n]=new this(r);else throw Error(qx+n+": "+r);return this}var Nce=yqe(mDn);nc=new Nce(1);const Cr=Nce;function xDn(t){return SDn(t)||_Dn(t)||wDn(t)||bDn()}function bDn(){throw new TypeError(`Invalid attempt to spread non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function wDn(t,e){if(t){if(typeof t=="string")return cZ(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);if(n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set")return Array.from(t);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return cZ(t,e)}}function _Dn(t){if(typeof Symbol<"u"&&Symbol.iterator in Object(t))return Array.from(t)}function SDn(t){if(Array.isArray(t))return cZ(t)}function cZ(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n=e?n.apply(void 0,i):t(e-s,ASe(function(){for(var a=arguments.length,l=new Array(a),c=0;ct.length)&&(e=t.length);for(var n=0,r=new Array(e);n"u"||!(Symbol.iterator in Object(t)))){var n=[],r=!0,i=!1,o=void 0;try{for(var s=t[Symbol.iterator](),a;!(r=(a=s.next()).done)&&(n.push(a.value),!(e&&n.length===e));r=!0);}catch(l){i=!0,o=l}finally{try{!r&&s.return!=null&&s.return()}finally{if(i)throw o}}return n}}function NDn(t){if(Array.isArray(t))return t}function Sqe(t){var e=LP(t,2),n=e[0],r=e[1],i=n,o=r;return n>r&&(i=r,o=n),[i,o]}function Cqe(t,e,n){if(t.lte(0))return new Cr(0);var r=KU.getDigitCount(t.toNumber()),i=new Cr(10).pow(r),o=t.div(i),s=r!==1?.05:.1,a=new Cr(Math.ceil(o.div(s).toNumber())).add(n).mul(s),l=a.mul(i);return e?l:new Cr(Math.ceil(l))}function zDn(t,e,n){var r=1,i=new Cr(t);if(!i.isint()&&n){var o=Math.abs(t);o<1?(r=new Cr(10).pow(KU.getDigitCount(t)-1),i=new Cr(Math.floor(i.div(r).toNumber())).mul(r)):o>1&&(i=new Cr(Math.floor(t)))}else t===0?i=new Cr(Math.floor((e-1)/2)):n||(i=new Cr(Math.floor(t)));var s=Math.floor((e-1)/2),a=TDn(EDn(function(l){return i.add(new Cr(l-s).mul(r)).toNumber()}),uZ);return a(0,e)}function Oqe(t,e,n,r){var i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:0;if(!Number.isFinite((e-t)/(n-1)))return{step:new Cr(0),tickMin:new Cr(0),tickMax:new Cr(0)};var o=Cqe(new Cr(e).sub(t).div(n-1),r,i),s;t<=0&&e>=0?s=new Cr(0):(s=new Cr(t).add(e).div(2),s=s.sub(new Cr(s).mod(o)));var a=Math.ceil(s.sub(t).div(o).toNumber()),l=Math.ceil(new Cr(e).sub(s).div(o).toNumber()),c=a+l+1;return c>n?Oqe(t,e,n,r,i+1):(c0?l+(n-c):l,a=e>0?a:a+(n-c)),{step:o,tickMin:s.sub(new Cr(a).mul(o)),tickMax:s.add(new Cr(l).mul(o))})}function jDn(t){var e=LP(t,2),n=e[0],r=e[1],i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:6,o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,s=Math.max(i,2),a=Sqe([n,r]),l=LP(a,2),c=l[0],u=l[1];if(c===-1/0||u===1/0){var f=u===1/0?[c].concat(dZ(uZ(0,i-1).map(function(){return 1/0}))):[].concat(dZ(uZ(0,i-1).map(function(){return-1/0})),[u]);return n>r?fZ(f):f}if(c===u)return zDn(c,i,o);var d=Oqe(c,u,s,o),h=d.step,p=d.tickMin,g=d.tickMax,m=KU.rangeStep(p,g.add(new Cr(.1).mul(h)),h);return n>r?fZ(m):m}function BDn(t,e){var n=LP(t,2),r=n[0],i=n[1],o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,s=Sqe([r,i]),a=LP(s,2),l=a[0],c=a[1];if(l===-1/0||c===1/0)return[r,i];if(l===c)return[l];var u=Math.max(e,2),f=Cqe(new Cr(c).sub(l).div(u-1),o,0),d=[].concat(dZ(KU.rangeStep(new Cr(l),new Cr(c).sub(new Cr(.99).mul(f)),f)),[c]);return r>i?fZ(d):d}var UDn=wqe(jDn),WDn=wqe(BDn),VDn="Invariant failed";function zb(t,e){throw new Error(VDn)}var GDn=["offset","layout","width","dataKey","data","dataPointFormatter","xAxis","yAxis"];function Lz(){return Lz=Object.assign?Object.assign.bind():function(t){for(var e=1;et.length)&&(e=t.length);for(var n=0,r=new Array(e);n=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function ZDn(t,e){if(t==null)return{};var n={},r=Object.keys(t),i,o;for(o=0;o=0)&&(n[i]=t[i]);return n}function uE(t){var e=t.offset,n=t.layout,r=t.width,i=t.dataKey,o=t.data,s=t.dataPointFormatter,a=t.xAxis,l=t.yAxis,c=KDn(t,GDn),u=pn(c,!1);t.direction==="x"&&a.type!=="number"&&zb();var f=o.map(function(d){var h=s(d,i),p=h.x,g=h.y,m=h.value,v=h.errorVal;if(!v)return null;var y=[],x,b;if(Array.isArray(v)){var w=HDn(v,2);x=w[0],b=w[1]}else x=b=v;if(n==="vertical"){var _=a.scale,S=g+e,O=S+r,k=S-r,E=_(m-x),P=_(m+b);y.push({x1:P,y1:O,x2:P,y2:k}),y.push({x1:E,y1:S,x2:P,y2:S}),y.push({x1:E,y1:O,x2:E,y2:k})}else if(n==="horizontal"){var A=l.scale,R=p+e,T=R-r,M=R+r,I=A(m-x),j=A(m+b);y.push({x1:T,y1:j,x2:M,y2:j}),y.push({x1:R,y1:I,x2:R,y2:j}),y.push({x1:T,y1:I,x2:M,y2:I})}return de.createElement(Ur,Lz({className:"recharts-errorBar",key:"bar-".concat(y.map(function(N){return"".concat(N.x1,"-").concat(N.x2,"-").concat(N.y1,"-").concat(N.y2)}))},u),y.map(function(N){return de.createElement("line",Lz({},N,{key:"line-".concat(N.x1,"-").concat(N.x2,"-").concat(N.y1,"-").concat(N.y2)}))}))});return de.createElement(Ur,{className:"recharts-errorBars"},f)}uE.defaultProps={stroke:"black",strokeWidth:1.5,width:5,offset:0,layout:"horizontal"};uE.displayName="ErrorBar";function $P(t){"@babel/helpers - typeof";return $P=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},$P(t)}function MSe(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function V7(t){for(var e=1;et.length)&&(e=t.length);for(var n=0,r=new Array(e);n1&&arguments[1]!==void 0?arguments[1]:[],i=arguments.length>2?arguments[2]:void 0,o=arguments.length>3?arguments[3]:void 0,s=-1,a=(n=r==null?void 0:r.length)!==null&&n!==void 0?n:0;if(a<=1)return 0;if(o&&o.axisType==="angleAxis"&&Math.abs(Math.abs(o.range[1]-o.range[0])-360)<=1e-6)for(var l=o.range,c=0;c0?i[c-1].coordinate:i[a-1].coordinate,f=i[c].coordinate,d=c>=a-1?i[0].coordinate:i[c+1].coordinate,h=void 0;if(Pf(f-u)!==Pf(d-f)){var p=[];if(Pf(d-f)===Pf(l[1]-l[0])){h=d;var g=f+l[1]-l[0];p[0]=Math.min(g,(g+u)/2),p[1]=Math.max(g,(g+u)/2)}else{h=u;var m=d+l[1]-l[0];p[0]=Math.min(f,(m+f)/2),p[1]=Math.max(f,(m+f)/2)}var v=[Math.min(f,(h+f)/2),Math.max(f,(h+f)/2)];if(e>v[0]&&e<=v[1]||e>=p[0]&&e<=p[1]){s=i[c].index;break}}else{var y=Math.min(u,d),x=Math.max(u,d);if(e>(y+f)/2&&e<=(x+f)/2){s=i[c].index;break}}}else for(var b=0;b0&&b(r[b].coordinate+r[b-1].coordinate)/2&&e<=(r[b].coordinate+r[b+1].coordinate)/2||b===a-1&&e>(r[b].coordinate+r[b-1].coordinate)/2){s=r[b].index;break}return s},zce=function(e){var n=e,r=n.type.displayName,i=e.props,o=i.stroke,s=i.fill,a;switch(r){case"Line":a=o;break;case"Area":case"Radar":a=o&&o!=="none"?o:s;break;default:a=s;break}return a},cIn=function(e){var n=e.barSize,r=e.totalSize,i=e.stackGroups,o=i===void 0?{}:i;if(!o)return{};for(var s={},a=Object.keys(o),l=0,c=a.length;l=0});if(v&&v.length){var y=v[0].props.barSize,x=v[0].props[m];s[x]||(s[x]=[]);var b=wn(y)?n:y;s[x].push({item:v[0],stackList:v.slice(1),barSize:wn(b)?void 0:Fb(b,r,0)})}}return s},uIn=function(e){var n=e.barGap,r=e.barCategoryGap,i=e.bandSize,o=e.sizeList,s=o===void 0?[]:o,a=e.maxBarSize,l=s.length;if(l<1)return null;var c=Fb(n,i,0,!0),u,f=[];if(s[0].barSize===+s[0].barSize){var d=!1,h=i/l,p=s.reduce(function(b,w){return b+w.barSize||0},0);p+=(l-1)*c,p>=i&&(p-=(l-1)*c,c=0),p>=i&&h>0&&(d=!0,h*=.9,p=l*h);var g=(i-p)/2>>0,m={offset:g-c,size:0};u=s.reduce(function(b,w){var _={item:w.item,position:{offset:m.offset+m.size+c,size:d?h:w.barSize}},S=[].concat(DSe(b),[_]);return m=S[S.length-1].position,w.stackList&&w.stackList.length&&w.stackList.forEach(function(O){S.push({item:O,position:m})}),S},f)}else{var v=Fb(r,i,0,!0);i-2*v-(l-1)*c<=0&&(c=0);var y=(i-2*v-(l-1)*c)/l;y>1&&(y>>=0);var x=a===+a?Math.min(y,a):y;u=s.reduce(function(b,w,_){var S=[].concat(DSe(b),[{item:w.item,position:{offset:v+(y+c)*_+(y-x)/2,size:x}}]);return w.stackList&&w.stackList.length&&w.stackList.forEach(function(O){S.push({item:O,position:S[S.length-1].position})}),S},f)}return u},fIn=function(e,n,r,i){var o=r.children,s=r.width,a=r.margin,l=s-(a.left||0)-(a.right||0),c=Eqe({children:o,legendWidth:l});if(c){var u=i||{},f=u.width,d=u.height,h=c.align,p=c.verticalAlign,g=c.layout;if((g==="vertical"||g==="horizontal"&&p==="middle")&&h!=="center"&&at(e[h]))return Qc(Qc({},e),{},rS({},h,e[h]+(f||0)));if((g==="horizontal"||g==="vertical"&&h==="center")&&p!=="middle"&&at(e[p]))return Qc(Qc({},e),{},rS({},p,e[p]+(d||0)))}return e},dIn=function(e,n,r){return wn(n)?!0:e==="horizontal"?n==="yAxis":e==="vertical"||r==="x"?n==="xAxis":r==="y"?n==="yAxis":!0},Tqe=function(e,n,r,i,o){var s=n.props.children,a=yu(s,uE).filter(function(c){return dIn(i,o,c.props.direction)});if(a&&a.length){var l=a.map(function(c){return c.props.dataKey});return e.reduce(function(c,u){var f=Ma(u,r);if(wn(f))return c;var d=Array.isArray(f)?[YU(f),Sv(f)]:[f,f],h=l.reduce(function(p,g){var m=Ma(u,g,0),v=d[0]-Math.abs(Array.isArray(m)?m[0]:m),y=d[1]+Math.abs(Array.isArray(m)?m[1]:m);return[Math.min(v,p[0]),Math.max(y,p[1])]},[1/0,-1/0]);return[Math.min(h[0],c[0]),Math.max(h[1],c[1])]},[1/0,-1/0])}return null},hIn=function(e,n,r,i,o){var s=n.map(function(a){return Tqe(e,a,r,o,i)}).filter(function(a){return!wn(a)});return s&&s.length?s.reduce(function(a,l){return[Math.min(a[0],l[0]),Math.max(a[1],l[1])]},[1/0,-1/0]):null},kqe=function(e,n,r,i,o){var s=n.map(function(l){var c=l.props.dataKey;return r==="number"&&c&&Tqe(e,l,c,i)||Ak(e,c,r,o)});if(r==="number")return s.reduce(function(l,c){return[Math.min(l[0],c[0]),Math.max(l[1],c[1])]},[1/0,-1/0]);var a={};return s.reduce(function(l,c){for(var u=0,f=c.length;u=2?Pf(a[0]-a[1])*2*c:c,n&&(e.ticks||e.niceTicks)){var u=(e.ticks||e.niceTicks).map(function(f){var d=o?o.indexOf(f):f;return{coordinate:i(d)+c,value:f,offset:c}});return u.filter(function(f){return!rE(f.coordinate)})}return e.isCategorical&&e.categoricalDomain?e.categoricalDomain.map(function(f,d){return{coordinate:i(f)+c,value:f,index:d,offset:c}}):i.ticks&&!r?i.ticks(e.tickCount).map(function(f){return{coordinate:i(f)+c,value:f,offset:c}}):i.domain().map(function(f,d){return{coordinate:i(f)+c,value:o?o[f]:f,index:d,offset:c}})},G7=new WeakMap,QL=function(e,n){if(typeof n!="function")return e;G7.has(e)||G7.set(e,new WeakMap);var r=G7.get(e);if(r.has(n))return r.get(n);var i=function(){e.apply(void 0,arguments),n.apply(void 0,arguments)};return r.set(n,i),i},pIn=function(e,n,r){var i=e.scale,o=e.type,s=e.layout,a=e.axisType;if(i==="auto")return s==="radial"&&a==="radiusAxis"?{scale:EA(),realScaleType:"band"}:s==="radial"&&a==="angleAxis"?{scale:PA(),realScaleType:"linear"}:o==="category"&&n&&(n.indexOf("LineChart")>=0||n.indexOf("AreaChart")>=0||n.indexOf("ComposedChart")>=0&&!r)?{scale:rk(),realScaleType:"point"}:o==="category"?{scale:EA(),realScaleType:"band"}:{scale:PA(),realScaleType:"linear"};if(gD(i)){var l="scale".concat(GU(i));return{scale:(ESe[l]||rk)(),realScaleType:ESe[l]?l:"point"}}return mn(i)?{scale:i}:{scale:rk(),realScaleType:"point"}},ISe=1e-4,gIn=function(e){var n=e.domain();if(!(!n||n.length<=2)){var r=n.length,i=e.range(),o=Math.min(i[0],i[1])-ISe,s=Math.max(i[0],i[1])+ISe,a=e(n[0]),l=e(n[r-1]);(as||ls)&&e.domain([n[0],n[r-1]])}},mIn=function(e,n){if(!e)return null;for(var r=0,i=e.length;ri)&&(o[1]=i),o[0]>i&&(o[0]=i),o[1]=0?(e[a][r][0]=o,e[a][r][1]=o+l,o=e[a][r][1]):(e[a][r][0]=s,e[a][r][1]=s+l,s=e[a][r][1])}},xIn=function(e){var n=e.length;if(!(n<=0))for(var r=0,i=e[0].length;r=0?(e[s][r][0]=o,e[s][r][1]=o+a,o=e[s][r][1]):(e[s][r][0]=0,e[s][r][1]=0)}},bIn={sign:yIn,expand:xTt,none:LS,silhouette:bTt,wiggle:wTt,positive:xIn},wIn=function(e,n,r){var i=n.map(function(a){return a.props.dataKey}),o=bIn[r],s=yTt().keys(i).value(function(a,l){return+Ma(a,l,0)}).order(hX).offset(o);return s(e)},_In=function(e,n,r,i,o,s){if(!e)return null;var a=s?n.reverse():n,l={},c=a.reduce(function(f,d){var h=d.props,p=h.stackId,g=h.hide;if(g)return f;var m=d.props[r],v=f[m]||{hasStack:!1,stackGroups:{}};if(So(p)){var y=v.stackGroups[p]||{numericAxisId:r,cateAxisId:i,items:[]};y.items.push(d),v.hasStack=!0,v.stackGroups[p]=y}else v.stackGroups[iE("_stackId_")]={numericAxisId:r,cateAxisId:i,items:[d]};return Qc(Qc({},f),{},rS({},m,v))},l),u={};return Object.keys(c).reduce(function(f,d){var h=c[d];if(h.hasStack){var p={};h.stackGroups=Object.keys(h.stackGroups).reduce(function(g,m){var v=h.stackGroups[m];return Qc(Qc({},g),{},rS({},m,{numericAxisId:r,cateAxisId:i,items:v.items,stackedData:wIn(e,v.items,o)}))},p)}return Qc(Qc({},f),{},rS({},d,h))},u)},SIn=function(e,n){var r=n.realScaleType,i=n.type,o=n.tickCount,s=n.originalDomain,a=n.allowDecimals,l=r||n.scale;if(l!=="auto"&&l!=="linear")return null;if(o&&i==="number"&&s&&(s[0]==="auto"||s[1]==="auto")){var c=e.domain();if(!c.length)return null;var u=UDn(c,o,a);return e.domain([YU(u),Sv(u)]),{niceTicks:u}}if(o&&i==="number"){var f=e.domain(),d=WDn(f,o,a);return{niceTicks:d}}return null};function $z(t){var e=t.axis,n=t.ticks,r=t.bandSize,i=t.entry,o=t.index,s=t.dataKey;if(e.type==="category"){if(!e.allowDuplicatedCategory&&e.dataKey&&!wn(i[e.dataKey])){var a=_z(n,"value",i[e.dataKey]);if(a)return a.coordinate+r/2}return n[o]?n[o].coordinate+r/2:null}var l=Ma(i,wn(s)?e.dataKey:s);return wn(l)?null:e.scale(l)}var LSe=function(e){var n=e.axis,r=e.ticks,i=e.offset,o=e.bandSize,s=e.entry,a=e.index;if(n.type==="category")return r[a]?r[a].coordinate+i:null;var l=Ma(s,n.dataKey,n.domain[a]);return wn(l)?null:n.scale(l)-o/2+i},CIn=function(e){var n=e.numericAxis,r=n.scale.domain();if(n.type==="number"){var i=Math.min(r[0],r[1]),o=Math.max(r[0],r[1]);return i<=0&&o>=0?0:o<0?o:i}return r[0]},OIn=function(e,n){var r=e.props.stackId;if(So(r)){var i=n[r];if(i){var o=i.items.indexOf(e);return o>=0?i.stackedData[o]:null}}return null},EIn=function(e){return e.reduce(function(n,r){return[YU(r.concat([n[0]]).filter(at)),Sv(r.concat([n[1]]).filter(at))]},[1/0,-1/0])},Mqe=function(e,n,r){return Object.keys(e).reduce(function(i,o){var s=e[o],a=s.stackedData,l=a.reduce(function(c,u){var f=EIn(u.slice(n,r+1));return[Math.min(c[0],f[0]),Math.max(c[1],f[1])]},[1/0,-1/0]);return[Math.min(l[0],i[0]),Math.max(l[1],i[1])]},[1/0,-1/0]).map(function(i){return i===1/0||i===-1/0?0:i})},$Se=/^dataMin[\s]*-[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,FSe=/^dataMax[\s]*\+[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,gZ=function(e,n,r){if(mn(e))return e(n,r);if(!Array.isArray(e))return n;var i=[];if(at(e[0]))i[0]=r?e[0]:Math.min(e[0],n[0]);else if($Se.test(e[0])){var o=+$Se.exec(e[0])[1];i[0]=n[0]-o}else mn(e[0])?i[0]=e[0](n[0]):i[0]=n[0];if(at(e[1]))i[1]=r?e[1]:Math.max(e[1],n[1]);else if(FSe.test(e[1])){var s=+FSe.exec(e[1])[1];i[1]=n[1]+s}else mn(e[1])?i[1]=e[1](n[1]):i[1]=n[1];return i},Fz=function(e,n,r){if(e&&e.scale&&e.scale.bandwidth){var i=e.scale.bandwidth();if(!r||i>0)return i}if(e&&n&&n.length>=2){for(var o=Lce(n,function(f){return f.coordinate}),s=1/0,a=1,l=o.length;as&&(c=2*Math.PI-c),{radius:a,angle:PIn(c),angleInRadian:c}},DIn=function(e){var n=e.startAngle,r=e.endAngle,i=Math.floor(n/360),o=Math.floor(r/360),s=Math.min(i,o);return{startAngle:n-s*360,endAngle:r-s*360}},IIn=function(e,n){var r=n.startAngle,i=n.endAngle,o=Math.floor(r/360),s=Math.floor(i/360),a=Math.min(o,s);return e+a*360},BSe=function(e,n){var r=e.x,i=e.y,o=RIn({x:r,y:i},n),s=o.radius,a=o.angle,l=n.innerRadius,c=n.outerRadius;if(sc)return!1;if(s===0)return!0;var u=DIn(n),f=u.startAngle,d=u.endAngle,h=a,p;if(f<=d){for(;h>d;)h-=360;for(;h=f&&h<=d}else{for(;h>f;)h-=360;for(;h=d&&h<=f}return p?jSe(jSe({},n),{},{radius:s,angle:IIn(h,n)}):null};function zP(t){"@babel/helpers - typeof";return zP=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},zP(t)}var LIn=["offset"];function $In(t){return jIn(t)||zIn(t)||NIn(t)||FIn()}function FIn(){throw new TypeError(`Invalid attempt to spread non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function NIn(t,e){if(t){if(typeof t=="string")return mZ(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);if(n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set")return Array.from(t);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return mZ(t,e)}}function zIn(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function jIn(t){if(Array.isArray(t))return mZ(t)}function mZ(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function UIn(t,e){if(t==null)return{};var n={},r=Object.keys(t),i,o;for(o=0;o=0)&&(n[i]=t[i]);return n}function USe(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function po(t){for(var e=1;e=0?1:-1,x,b;i==="insideStart"?(x=h+y*s,b=g):i==="insideEnd"?(x=p-y*s,b=!g):i==="end"&&(x=p+y*s,b=g),b=v<=0?b:!b;var w=ms(c,u,m,x),_=ms(c,u,m,x+(b?1:-1)*359),S="M".concat(w.x,",").concat(w.y,` A`).concat(m,",").concat(m,",0,1,").concat(b?0:1,`, - `).concat(_.x,",").concat(_.y),O=_n(e.id)?oE("recharts-radial-line-"):e.id;return de.createElement("text",jP({},r,{dominantBaseline:"central",className:Oe("recharts-radial-bar-label",a)}),de.createElement("defs",null,de.createElement("path",{id:O,d:S})),de.createElement("textPath",{xlinkHref:"#".concat(O)},n))},tLn=function(e){var n=e.viewBox,r=e.offset,i=e.position,o=n,s=o.cx,a=o.cy,l=o.innerRadius,c=o.outerRadius,u=o.startAngle,f=o.endAngle,d=(u+f)/2;if(i==="outside"){var h=ms(s,a,c+r,d),p=h.x,g=h.y;return{x:p,y:g,textAnchor:p>=s?"start":"end",verticalAnchor:"middle"}}if(i==="center")return{x:s,y:a,textAnchor:"middle",verticalAnchor:"middle"};if(i==="centerTop")return{x:s,y:a,textAnchor:"middle",verticalAnchor:"start"};if(i==="centerBottom")return{x:s,y:a,textAnchor:"middle",verticalAnchor:"end"};var m=(l+c)/2,v=ms(s,a,m,d),y=v.x,x=v.y;return{x:y,y:x,textAnchor:"middle",verticalAnchor:"middle"}},nLn=function(e){var n=e.viewBox,r=e.parentViewBox,i=e.offset,o=e.position,s=n,a=s.x,l=s.y,c=s.width,u=s.height,f=u>=0?1:-1,d=f*i,h=f>0?"end":"start",p=f>0?"start":"end",g=c>=0?1:-1,m=g*i,v=g>0?"end":"start",y=g>0?"start":"end";if(o==="top"){var x={x:a+c/2,y:l-f*i,textAnchor:"middle",verticalAnchor:h};return go(go({},x),r?{height:Math.max(l-r.y,0),width:c}:{})}if(o==="bottom"){var b={x:a+c/2,y:l+u+d,textAnchor:"middle",verticalAnchor:p};return go(go({},b),r?{height:Math.max(r.y+r.height-(l+u),0),width:c}:{})}if(o==="left"){var w={x:a-m,y:l+u/2,textAnchor:v,verticalAnchor:"middle"};return go(go({},w),r?{width:Math.max(w.x-r.x,0),height:u}:{})}if(o==="right"){var _={x:a+c+m,y:l+u/2,textAnchor:y,verticalAnchor:"middle"};return go(go({},_),r?{width:Math.max(r.x+r.width-_.x,0),height:u}:{})}var S=r?{width:c,height:u}:{};return o==="insideLeft"?go({x:a+m,y:l+u/2,textAnchor:y,verticalAnchor:"middle"},S):o==="insideRight"?go({x:a+c-m,y:l+u/2,textAnchor:v,verticalAnchor:"middle"},S):o==="insideTop"?go({x:a+c/2,y:l+d,textAnchor:"middle",verticalAnchor:p},S):o==="insideBottom"?go({x:a+c/2,y:l+u-d,textAnchor:"middle",verticalAnchor:h},S):o==="insideTopLeft"?go({x:a+m,y:l+d,textAnchor:y,verticalAnchor:p},S):o==="insideTopRight"?go({x:a+c-m,y:l+d,textAnchor:v,verticalAnchor:p},S):o==="insideBottomLeft"?go({x:a+m,y:l+u-d,textAnchor:y,verticalAnchor:h},S):o==="insideBottomRight"?go({x:a+c-m,y:l+u-d,textAnchor:v,verticalAnchor:h},S):eE(o)&&(at(o.x)||xx(o.x))&&(at(o.y)||xx(o.y))?go({x:a+F1(o.x,c),y:l+F1(o.y,u),textAnchor:"end",verticalAnchor:"end"},S):go({x:a+c/2,y:l+u/2,textAnchor:"middle",verticalAnchor:"middle"},S)},rLn=function(e){return"cx"in e&&at(e.cx)};function Vs(t){var e=t.offset,n=e===void 0?5:e,r=qIn(t,BIn),i=go({offset:n},r),o=i.viewBox,s=i.position,a=i.value,l=i.children,c=i.content,u=i.className,f=u===void 0?"":u,d=i.textBreakAll;if(!o||_n(a)&&_n(l)&&!D.isValidElement(c)&&!mn(c))return null;if(D.isValidElement(c))return D.cloneElement(c,i);var h;if(mn(c)){if(h=D.createElement(c,i),D.isValidElement(h))return h}else h=ZIn(i);var p=rLn(o),g=pn(i,!0);if(p&&(s==="insideStart"||s==="insideEnd"||s==="end"))return eLn(i,h,g);var m=p?tLn(i):nLn(i);return de.createElement(Fz,jP({className:Oe("recharts-label",f)},g,m,{breakAll:d}),h)}Vs.displayName="Label";var sqe=function(e){var n=e.cx,r=e.cy,i=e.angle,o=e.startAngle,s=e.endAngle,a=e.r,l=e.radius,c=e.innerRadius,u=e.outerRadius,f=e.x,d=e.y,h=e.top,p=e.left,g=e.width,m=e.height,v=e.clockWise,y=e.labelViewBox;if(y)return y;if(at(g)&&at(m)){if(at(f)&&at(d))return{x:f,y:d,width:g,height:m};if(at(h)&&at(p))return{x:h,y:p,width:g,height:m}}return at(f)&&at(d)?{x:f,y:d,width:0,height:0}:at(n)&&at(r)?{cx:n,cy:r,startAngle:o||i||0,endAngle:s||i||0,innerRadius:c||0,outerRadius:u||l||a||0,clockWise:v}:e.viewBox?e.viewBox:{}},iLn=function(e,n){return e?e===!0?de.createElement(Vs,{key:"label-implicit",viewBox:n}):Co(e)?de.createElement(Vs,{key:"label-implicit",viewBox:n,value:e}):D.isValidElement(e)?e.type===Vs?D.cloneElement(e,{key:"label-implicit",viewBox:n}):de.createElement(Vs,{key:"label-implicit",content:e,viewBox:n}):mn(e)?de.createElement(Vs,{key:"label-implicit",content:e,viewBox:n}):eE(e)?de.createElement(Vs,jP({viewBox:n},e,{key:"label-implicit"})):null:null},oLn=function(e,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(!e||!e.children&&r&&!e.label)return null;var i=e.children,o=sqe(e),s=yu(i,Vs).map(function(l,c){return D.cloneElement(l,{viewBox:n||o,key:"label-".concat(c)})});if(!r)return s;var a=iLn(e.label,n||o);return[a].concat(UIn(s))};Vs.parseViewBox=sqe;Vs.renderCallByParent=oLn;function sLn(t){var e=t==null?0:t.length;return e?t[e-1]:void 0}var aLn=sLn;const lLn=on(aLn);function BP(t){"@babel/helpers - typeof";return BP=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},BP(t)}var cLn=["valueAccessor"],uLn=["data","dataKey","clockWise","id","textBreakAll"];function fLn(t){return gLn(t)||pLn(t)||hLn(t)||dLn()}function dLn(){throw new TypeError(`Invalid attempt to spread non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function hLn(t,e){if(t){if(typeof t=="string")return tZ(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);if(n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set")return Array.from(t);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return tZ(t,e)}}function pLn(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function gLn(t){if(Array.isArray(t))return tZ(t)}function tZ(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function xLn(t,e){if(t==null)return{};var n={},r=Object.keys(t),i,o;for(o=0;o=0)&&(n[i]=t[i]);return n}var bLn=function(e){return Array.isArray(e.value)?lLn(e.value):e.value};function xg(t){var e=t.valueAccessor,n=e===void 0?bLn:e,r=ySe(t,cLn),i=r.data,o=r.dataKey,s=r.clockWise,a=r.id,l=r.textBreakAll,c=ySe(r,uLn);return!i||!i.length?null:de.createElement(Ur,{className:"recharts-label-list"},i.map(function(u,f){var d=_n(o)?n(u,f):Da(u&&u.payload,o),h=_n(a)?{}:{id:"".concat(a,"-").concat(f)};return de.createElement(Vs,Wz({},pn(u,!0),c,h,{parentViewBox:u.parentViewBox,value:d,textBreakAll:l,viewBox:Vs.parseViewBox(_n(s)?u:vSe(vSe({},u),{},{clockWise:s})),key:"label-".concat(f),index:f}))}))}xg.displayName="LabelList";function wLn(t,e){return t?t===!0?de.createElement(xg,{key:"labelList-implicit",data:e}):de.isValidElement(t)||mn(t)?de.createElement(xg,{key:"labelList-implicit",data:e,content:t}):eE(t)?de.createElement(xg,Wz({data:e},t,{key:"labelList-implicit"})):null:null}function _Ln(t,e){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(!t||!t.children&&n&&!t.label)return null;var r=t.children,i=yu(r,xg).map(function(s,a){return D.cloneElement(s,{data:e,key:"labelList-".concat(a)})});if(!n)return i;var o=wLn(t.label,e);return[o].concat(fLn(i))}xg.renderCallByParent=_Ln;function UP(t){"@babel/helpers - typeof";return UP=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},UP(t)}function nZ(){return nZ=Object.assign?Object.assign.bind():function(t){for(var e=1;e=s?"start":"end",verticalAnchor:"middle"}}if(i==="center")return{x:s,y:a,textAnchor:"middle",verticalAnchor:"middle"};if(i==="centerTop")return{x:s,y:a,textAnchor:"middle",verticalAnchor:"start"};if(i==="centerBottom")return{x:s,y:a,textAnchor:"middle",verticalAnchor:"end"};var m=(l+c)/2,v=ms(s,a,m,d),y=v.x,x=v.y;return{x:y,y:x,textAnchor:"middle",verticalAnchor:"middle"}},QIn=function(e){var n=e.viewBox,r=e.parentViewBox,i=e.offset,o=e.position,s=n,a=s.x,l=s.y,c=s.width,u=s.height,f=u>=0?1:-1,d=f*i,h=f>0?"end":"start",p=f>0?"start":"end",g=c>=0?1:-1,m=g*i,v=g>0?"end":"start",y=g>0?"start":"end";if(o==="top"){var x={x:a+c/2,y:l-f*i,textAnchor:"middle",verticalAnchor:h};return po(po({},x),r?{height:Math.max(l-r.y,0),width:c}:{})}if(o==="bottom"){var b={x:a+c/2,y:l+u+d,textAnchor:"middle",verticalAnchor:p};return po(po({},b),r?{height:Math.max(r.y+r.height-(l+u),0),width:c}:{})}if(o==="left"){var w={x:a-m,y:l+u/2,textAnchor:v,verticalAnchor:"middle"};return po(po({},w),r?{width:Math.max(w.x-r.x,0),height:u}:{})}if(o==="right"){var _={x:a+c+m,y:l+u/2,textAnchor:y,verticalAnchor:"middle"};return po(po({},_),r?{width:Math.max(r.x+r.width-_.x,0),height:u}:{})}var S=r?{width:c,height:u}:{};return o==="insideLeft"?po({x:a+m,y:l+u/2,textAnchor:y,verticalAnchor:"middle"},S):o==="insideRight"?po({x:a+c-m,y:l+u/2,textAnchor:v,verticalAnchor:"middle"},S):o==="insideTop"?po({x:a+c/2,y:l+d,textAnchor:"middle",verticalAnchor:p},S):o==="insideBottom"?po({x:a+c/2,y:l+u-d,textAnchor:"middle",verticalAnchor:h},S):o==="insideTopLeft"?po({x:a+m,y:l+d,textAnchor:y,verticalAnchor:p},S):o==="insideTopRight"?po({x:a+c-m,y:l+d,textAnchor:v,verticalAnchor:p},S):o==="insideBottomLeft"?po({x:a+m,y:l+u-d,textAnchor:y,verticalAnchor:h},S):o==="insideBottomRight"?po({x:a+c-m,y:l+u-d,textAnchor:v,verticalAnchor:h},S):JO(o)&&(at(o.x)||xx(o.x))&&(at(o.y)||xx(o.y))?po({x:a+Fb(o.x,c),y:l+Fb(o.y,u),textAnchor:"end",verticalAnchor:"end"},S):po({x:a+c/2,y:l+u/2,textAnchor:"middle",verticalAnchor:"middle"},S)},KIn=function(e){return"cx"in e&&at(e.cx)};function Ws(t){var e=t.offset,n=e===void 0?5:e,r=BIn(t,LIn),i=po({offset:n},r),o=i.viewBox,s=i.position,a=i.value,l=i.children,c=i.content,u=i.className,f=u===void 0?"":u,d=i.textBreakAll;if(!o||wn(a)&&wn(l)&&!D.isValidElement(c)&&!mn(c))return null;if(D.isValidElement(c))return D.cloneElement(c,i);var h;if(mn(c)){if(h=D.createElement(c,i),D.isValidElement(h))return h}else h=HIn(i);var p=KIn(o),g=pn(i,!0);if(p&&(s==="insideStart"||s==="insideEnd"||s==="end"))return XIn(i,h,g);var m=p?YIn(i):QIn(i);return de.createElement(Dz,jP({className:Oe("recharts-label",f)},g,m,{breakAll:d}),h)}Ws.displayName="Label";var Dqe=function(e){var n=e.cx,r=e.cy,i=e.angle,o=e.startAngle,s=e.endAngle,a=e.r,l=e.radius,c=e.innerRadius,u=e.outerRadius,f=e.x,d=e.y,h=e.top,p=e.left,g=e.width,m=e.height,v=e.clockWise,y=e.labelViewBox;if(y)return y;if(at(g)&&at(m)){if(at(f)&&at(d))return{x:f,y:d,width:g,height:m};if(at(h)&&at(p))return{x:h,y:p,width:g,height:m}}return at(f)&&at(d)?{x:f,y:d,width:0,height:0}:at(n)&&at(r)?{cx:n,cy:r,startAngle:o||i||0,endAngle:s||i||0,innerRadius:c||0,outerRadius:u||l||a||0,clockWise:v}:e.viewBox?e.viewBox:{}},ZIn=function(e,n){return e?e===!0?de.createElement(Ws,{key:"label-implicit",viewBox:n}):So(e)?de.createElement(Ws,{key:"label-implicit",viewBox:n,value:e}):D.isValidElement(e)?e.type===Ws?D.cloneElement(e,{key:"label-implicit",viewBox:n}):de.createElement(Ws,{key:"label-implicit",content:e,viewBox:n}):mn(e)?de.createElement(Ws,{key:"label-implicit",content:e,viewBox:n}):JO(e)?de.createElement(Ws,jP({viewBox:n},e,{key:"label-implicit"})):null:null},JIn=function(e,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(!e||!e.children&&r&&!e.label)return null;var i=e.children,o=Dqe(e),s=yu(i,Ws).map(function(l,c){return D.cloneElement(l,{viewBox:n||o,key:"label-".concat(c)})});if(!r)return s;var a=ZIn(e.label,n||o);return[a].concat($In(s))};Ws.parseViewBox=Dqe;Ws.renderCallByParent=JIn;function eLn(t){var e=t==null?0:t.length;return e?t[e-1]:void 0}var tLn=eLn;const nLn=sn(tLn);function BP(t){"@babel/helpers - typeof";return BP=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},BP(t)}var rLn=["valueAccessor"],iLn=["data","dataKey","clockWise","id","textBreakAll"];function oLn(t){return cLn(t)||lLn(t)||aLn(t)||sLn()}function sLn(){throw new TypeError(`Invalid attempt to spread non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function aLn(t,e){if(t){if(typeof t=="string")return vZ(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);if(n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set")return Array.from(t);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return vZ(t,e)}}function lLn(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function cLn(t){if(Array.isArray(t))return vZ(t)}function vZ(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function hLn(t,e){if(t==null)return{};var n={},r=Object.keys(t),i,o;for(o=0;o=0)&&(n[i]=t[i]);return n}var pLn=function(e){return Array.isArray(e.value)?nLn(e.value):e.value};function mg(t){var e=t.valueAccessor,n=e===void 0?pLn:e,r=GSe(t,rLn),i=r.data,o=r.dataKey,s=r.clockWise,a=r.id,l=r.textBreakAll,c=GSe(r,iLn);return!i||!i.length?null:de.createElement(Ur,{className:"recharts-label-list"},i.map(function(u,f){var d=wn(o)?n(u,f):Ma(u&&u.payload,o),h=wn(a)?{}:{id:"".concat(a,"-").concat(f)};return de.createElement(Ws,zz({},pn(u,!0),c,h,{parentViewBox:u.parentViewBox,value:d,textBreakAll:l,viewBox:Ws.parseViewBox(wn(s)?u:VSe(VSe({},u),{},{clockWise:s})),key:"label-".concat(f),index:f}))}))}mg.displayName="LabelList";function gLn(t,e){return t?t===!0?de.createElement(mg,{key:"labelList-implicit",data:e}):de.isValidElement(t)||mn(t)?de.createElement(mg,{key:"labelList-implicit",data:e,content:t}):JO(t)?de.createElement(mg,zz({data:e},t,{key:"labelList-implicit"})):null:null}function mLn(t,e){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(!t||!t.children&&n&&!t.label)return null;var r=t.children,i=yu(r,mg).map(function(s,a){return D.cloneElement(s,{data:e,key:"labelList-".concat(a)})});if(!n)return i;var o=gLn(t.label,e);return[o].concat(oLn(i))}mg.renderCallByParent=mLn;function UP(t){"@babel/helpers - typeof";return UP=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},UP(t)}function yZ(){return yZ=Object.assign?Object.assign.bind():function(t){for(var e=1;e180),",").concat(+(s>c),`, `).concat(f.x,",").concat(f.y,` `);if(i>0){var h=ms(n,r,i,s),p=ms(n,r,i,c);d+="L ".concat(p.x,",").concat(p.y,` A `).concat(i,",").concat(i,`,0, `).concat(+(Math.abs(l)>180),",").concat(+(s<=c),`, - `).concat(h.x,",").concat(h.y," Z")}else d+="L ".concat(n,",").concat(r," Z");return d},TLn=function(e){var n=e.cx,r=e.cy,i=e.innerRadius,o=e.outerRadius,s=e.cornerRadius,a=e.forceCornerRadius,l=e.cornerIsExternal,c=e.startAngle,u=e.endAngle,f=Pf(u-c),d=t$({cx:n,cy:r,radius:o,angle:c,sign:f,cornerRadius:s,cornerIsExternal:l}),h=d.circleTangency,p=d.lineTangency,g=d.theta,m=t$({cx:n,cy:r,radius:o,angle:u,sign:-f,cornerRadius:s,cornerIsExternal:l}),v=m.circleTangency,y=m.lineTangency,x=m.theta,b=l?Math.abs(c-u):Math.abs(c-u)-g-x;if(b<0)return a?"M ".concat(p.x,",").concat(p.y,` + `).concat(h.x,",").concat(h.y," Z")}else d+="L ".concat(n,",").concat(r," Z");return d},wLn=function(e){var n=e.cx,r=e.cy,i=e.innerRadius,o=e.outerRadius,s=e.cornerRadius,a=e.forceCornerRadius,l=e.cornerIsExternal,c=e.startAngle,u=e.endAngle,f=Pf(u-c),d=KL({cx:n,cy:r,radius:o,angle:c,sign:f,cornerRadius:s,cornerIsExternal:l}),h=d.circleTangency,p=d.lineTangency,g=d.theta,m=KL({cx:n,cy:r,radius:o,angle:u,sign:-f,cornerRadius:s,cornerIsExternal:l}),v=m.circleTangency,y=m.lineTangency,x=m.theta,b=l?Math.abs(c-u):Math.abs(c-u)-g-x;if(b<0)return a?"M ".concat(p.x,",").concat(p.y,` a`).concat(s,",").concat(s,",0,0,1,").concat(s*2,`,0 a`).concat(s,",").concat(s,",0,0,1,").concat(-s*2,`,0 - `):aqe({cx:n,cy:r,innerRadius:i,outerRadius:o,startAngle:c,endAngle:u});var w="M ".concat(p.x,",").concat(p.y,` + `):Iqe({cx:n,cy:r,innerRadius:i,outerRadius:o,startAngle:c,endAngle:u});var w="M ".concat(p.x,",").concat(p.y,` A`).concat(s,",").concat(s,",0,0,").concat(+(f<0),",").concat(h.x,",").concat(h.y,` A`).concat(o,",").concat(o,",0,").concat(+(b>180),",").concat(+(f<0),",").concat(v.x,",").concat(v.y,` A`).concat(s,",").concat(s,",0,0,").concat(+(f<0),",").concat(y.x,",").concat(y.y,` - `);if(i>0){var _=t$({cx:n,cy:r,radius:i,angle:c,sign:f,isExternal:!0,cornerRadius:s,cornerIsExternal:l}),S=_.circleTangency,O=_.lineTangency,k=_.theta,E=t$({cx:n,cy:r,radius:i,angle:u,sign:-f,isExternal:!0,cornerRadius:s,cornerIsExternal:l}),M=E.circleTangency,A=E.lineTangency,P=E.theta,T=l?Math.abs(c-u):Math.abs(c-u)-k-P;if(T<0&&s===0)return"".concat(w,"L").concat(n,",").concat(r,"Z");w+="L".concat(A.x,",").concat(A.y,` - A`).concat(s,",").concat(s,",0,0,").concat(+(f<0),",").concat(M.x,",").concat(M.y,` + `);if(i>0){var _=KL({cx:n,cy:r,radius:i,angle:c,sign:f,isExternal:!0,cornerRadius:s,cornerIsExternal:l}),S=_.circleTangency,O=_.lineTangency,k=_.theta,E=KL({cx:n,cy:r,radius:i,angle:u,sign:-f,isExternal:!0,cornerRadius:s,cornerIsExternal:l}),P=E.circleTangency,A=E.lineTangency,R=E.theta,T=l?Math.abs(c-u):Math.abs(c-u)-k-R;if(T<0&&s===0)return"".concat(w,"L").concat(n,",").concat(r,"Z");w+="L".concat(A.x,",").concat(A.y,` + A`).concat(s,",").concat(s,",0,0,").concat(+(f<0),",").concat(P.x,",").concat(P.y,` A`).concat(i,",").concat(i,",0,").concat(+(T>180),",").concat(+(f>0),",").concat(S.x,",").concat(S.y,` - A`).concat(s,",").concat(s,",0,0,").concat(+(f<0),",").concat(O.x,",").concat(O.y,"Z")}else w+="L".concat(n,",").concat(r,"Z");return w},kLn={cx:0,cy:0,innerRadius:0,outerRadius:0,startAngle:0,endAngle:0,cornerRadius:0,forceCornerRadius:!1,cornerIsExternal:!1},lqe=function(e){var n=bSe(bSe({},kLn),e),r=n.cx,i=n.cy,o=n.innerRadius,s=n.outerRadius,a=n.cornerRadius,l=n.forceCornerRadius,c=n.cornerIsExternal,u=n.startAngle,f=n.endAngle,d=n.className;if(s0&&Math.abs(u-f)<360?m=TLn({cx:r,cy:i,innerRadius:o,outerRadius:s,cornerRadius:Math.min(g,p/2),forceCornerRadius:l,cornerIsExternal:c,startAngle:u,endAngle:f}):m=aqe({cx:r,cy:i,innerRadius:o,outerRadius:s,startAngle:u,endAngle:f}),de.createElement("path",nZ({},pn(n,!0),{className:h,d:m,role:"img"}))};function WP(t){"@babel/helpers - typeof";return WP=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},WP(t)}function rZ(){return rZ=Object.assign?Object.assign.bind():function(t){for(var e=1;e0;)if(!n.equals(t[r],e[r],r,r,t,e,n))return!1;return!0}function NLn(t,e){return dE(t.getTime(),e.getTime())}function kSe(t,e,n){if(t.size!==e.size)return!1;for(var r={},i=t.entries(),o=0,s,a;(s=i.next())&&!s.done;){for(var l=e.entries(),c=!1,u=0;(a=l.next())&&!a.done;){var f=s.value,d=f[0],h=f[1],p=a.value,g=p[0],m=p[1];!c&&!r[u]&&(c=n.equals(d,g,o,u,t,e,n)&&n.equals(h,m,d,g,t,e,n))&&(r[u]=!0),u++}if(!c)return!1;o++}return!0}function zLn(t,e,n){var r=TSe(t),i=r.length;if(TSe(e).length!==i)return!1;for(var o;i-- >0;)if(o=r[i],o===uqe&&(t.$$typeof||e.$$typeof)&&t.$$typeof!==e.$$typeof||!cqe(e,o)||!n.equals(t[o],e[o],o,o,t,e,n))return!1;return!0}function R2(t,e,n){var r=OSe(t),i=r.length;if(OSe(e).length!==i)return!1;for(var o,s,a;i-- >0;)if(o=r[i],o===uqe&&(t.$$typeof||e.$$typeof)&&t.$$typeof!==e.$$typeof||!cqe(e,o)||!n.equals(t[o],e[o],o,o,t,e,n)||(s=ESe(t,o),a=ESe(e,o),(s||a)&&(!s||!a||s.configurable!==a.configurable||s.enumerable!==a.enumerable||s.writable!==a.writable)))return!1;return!0}function jLn(t,e){return dE(t.valueOf(),e.valueOf())}function BLn(t,e){return t.source===e.source&&t.flags===e.flags}function ASe(t,e,n){if(t.size!==e.size)return!1;for(var r={},i=t.values(),o,s;(o=i.next())&&!o.done;){for(var a=e.values(),l=!1,c=0;(s=a.next())&&!s.done;)!l&&!r[c]&&(l=n.equals(o.value,s.value,o.value,s.value,t,e,n))&&(r[c]=!0),c++;if(!l)return!1}return!0}function ULn(t,e){var n=t.length;if(e.length!==n)return!1;for(;n-- >0;)if(t[n]!==e[n])return!1;return!0}var WLn="[object Arguments]",VLn="[object Boolean]",GLn="[object Date]",HLn="[object Map]",qLn="[object Number]",XLn="[object Object]",YLn="[object RegExp]",QLn="[object Set]",KLn="[object String]",ZLn=Array.isArray,PSe=typeof ArrayBuffer=="function"&&ArrayBuffer.isView?ArrayBuffer.isView:null,MSe=Object.assign,JLn=Object.prototype.toString.call.bind(Object.prototype.toString);function e$n(t){var e=t.areArraysEqual,n=t.areDatesEqual,r=t.areMapsEqual,i=t.areObjectsEqual,o=t.arePrimitiveWrappersEqual,s=t.areRegExpsEqual,a=t.areSetsEqual,l=t.areTypedArraysEqual;return function(u,f,d){if(u===f)return!0;if(u==null||f==null||typeof u!="object"||typeof f!="object")return u!==u&&f!==f;var h=u.constructor;if(h!==f.constructor)return!1;if(h===Object)return i(u,f,d);if(ZLn(u))return e(u,f,d);if(PSe!=null&&PSe(u))return l(u,f,d);if(h===Date)return n(u,f,d);if(h===RegExp)return s(u,f,d);if(h===Map)return r(u,f,d);if(h===Set)return a(u,f,d);var p=JLn(u);return p===GLn?n(u,f,d):p===YLn?s(u,f,d):p===HLn?r(u,f,d):p===QLn?a(u,f,d):p===XLn?typeof u.then!="function"&&typeof f.then!="function"&&i(u,f,d):p===WLn?i(u,f,d):p===VLn||p===qLn||p===KLn?o(u,f,d):!1}}function t$n(t){var e=t.circular,n=t.createCustomConfig,r=t.strict,i={areArraysEqual:r?R2:FLn,areDatesEqual:NLn,areMapsEqual:r?CSe(kSe,R2):kSe,areObjectsEqual:r?R2:zLn,arePrimitiveWrappersEqual:jLn,areRegExpsEqual:BLn,areSetsEqual:r?CSe(ASe,R2):ASe,areTypedArraysEqual:r?R2:ULn};if(n&&(i=MSe({},i,n(i))),e){var o=r$(i.areArraysEqual),s=r$(i.areMapsEqual),a=r$(i.areObjectsEqual),l=r$(i.areSetsEqual);i=MSe({},i,{areArraysEqual:o,areMapsEqual:s,areObjectsEqual:a,areSetsEqual:l})}return i}function n$n(t){return function(e,n,r,i,o,s,a){return t(e,n,a)}}function r$n(t){var e=t.circular,n=t.comparator,r=t.createState,i=t.equals,o=t.strict;if(r)return function(l,c){var u=r(),f=u.cache,d=f===void 0?e?new WeakMap:void 0:f,h=u.meta;return n(l,c,{cache:d,equals:i,meta:h,strict:o})};if(e)return function(l,c){return n(l,c,{cache:new WeakMap,equals:i,meta:void 0,strict:o})};var s={cache:void 0,equals:i,meta:void 0,strict:o};return function(l,c){return n(l,c,s)}}var i$n=s0();s0({strict:!0});s0({circular:!0});s0({circular:!0,strict:!0});s0({createInternalComparator:function(){return dE}});s0({strict:!0,createInternalComparator:function(){return dE}});s0({circular:!0,createInternalComparator:function(){return dE}});s0({circular:!0,createInternalComparator:function(){return dE},strict:!0});function s0(t){t===void 0&&(t={});var e=t.circular,n=e===void 0?!1:e,r=t.createInternalComparator,i=t.createState,o=t.strict,s=o===void 0?!1:o,a=t$n(t),l=e$n(a),c=r?r(l):n$n(l);return r$n({circular:n,comparator:l,createState:i,equals:c,strict:s})}function o$n(t){typeof requestAnimationFrame<"u"&&requestAnimationFrame(t)}function RSe(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,n=-1,r=function i(o){n<0&&(n=o),o-n>e?(t(o),n=-1):o$n(i)};requestAnimationFrame(r)}function iZ(t){"@babel/helpers - typeof";return iZ=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},iZ(t)}function s$n(t){return u$n(t)||c$n(t)||l$n(t)||a$n()}function a$n(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function l$n(t,e){if(t){if(typeof t=="string")return DSe(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);if(n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set")return Array.from(t);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return DSe(t,e)}}function DSe(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);nt.length)&&(e=t.length);for(var n=0,r=new Array(e);n1?1:v<0?0:v},g=function(v){for(var y=v>1?1:v,x=y,b=0;b<8;++b){var w=f(x)-y,_=h(x);if(Math.abs(w-y)0&&arguments[0]!==void 0?arguments[0]:{},n=e.stiff,r=n===void 0?100:n,i=e.damping,o=i===void 0?8:i,s=e.dt,a=s===void 0?17:s,l=function(u,f,d){var h=-(u-f)*r,p=d*o,g=d+(h-p)*a/1e3,m=d*a/1e3+u;return Math.abs(m-f)t.length)&&(e=t.length);for(var n=0,r=new Array(e);n=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function B$n(t,e){if(t==null)return{};var n={},r=Object.keys(t),i,o;for(o=0;o=0)&&(n[i]=t[i]);return n}function M7(t){return G$n(t)||V$n(t)||W$n(t)||U$n()}function U$n(){throw new TypeError(`Invalid attempt to spread non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function W$n(t,e){if(t){if(typeof t=="string")return cZ(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);if(n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set")return Array.from(t);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return cZ(t,e)}}function V$n(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function G$n(t){if(Array.isArray(t))return cZ(t)}function cZ(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function Hz(t){return Hz=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},Hz(t)}var Fh=function(t){Q$n(n,t);var e=K$n(n);function n(r,i){var o;H$n(this,n),o=e.call(this,r,i);var s=o.props,a=s.isActive,l=s.attributeName,c=s.from,u=s.to,f=s.steps,d=s.children,h=s.duration;if(o.handleStyleChange=o.handleStyleChange.bind(dZ(o)),o.changeStyle=o.changeStyle.bind(dZ(o)),!a||h<=0)return o.state={style:{}},typeof d=="function"&&(o.state={style:u}),fZ(o);if(f&&f.length)o.state={style:f[0].style};else if(c){if(typeof d=="function")return o.state={style:c},fZ(o);o.state={style:l?IT({},l,c):c}}else o.state={style:{}};return o}return X$n(n,[{key:"componentDidMount",value:function(){var i=this.props,o=i.isActive,s=i.canBegin;this.mounted=!0,!(!o||!s)&&this.runAnimation(this.props)}},{key:"componentDidUpdate",value:function(i){var o=this.props,s=o.isActive,a=o.canBegin,l=o.attributeName,c=o.shouldReAnimate,u=o.to,f=o.from,d=this.state.style;if(a){if(!s){var h={style:l?IT({},l,u):u};this.state&&d&&(l&&d[l]!==u||!l&&d!==u)&&this.setState(h);return}if(!(i$n(i.to,u)&&i.canBegin&&i.isActive)){var p=!i.canBegin||!i.isActive;this.manager&&this.manager.stop(),this.stopJSAnimation&&this.stopJSAnimation();var g=p||c?f:i.to;if(this.state&&d){var m={style:l?IT({},l,g):g};(l&&d[l]!==g||!l&&d!==g)&&this.setState(m)}this.runAnimation(Ku(Ku({},this.props),{},{from:g,begin:0}))}}}},{key:"componentWillUnmount",value:function(){this.mounted=!1;var i=this.props.onAnimationEnd;this.unSubscribe&&this.unSubscribe(),this.manager&&(this.manager.stop(),this.manager=null),this.stopJSAnimation&&this.stopJSAnimation(),i&&i()}},{key:"handleStyleChange",value:function(i){this.changeStyle(i)}},{key:"changeStyle",value:function(i){this.mounted&&this.setState({style:i})}},{key:"runJSAnimation",value:function(i){var o=this,s=i.from,a=i.to,l=i.duration,c=i.easing,u=i.begin,f=i.onAnimationEnd,d=i.onAnimationStart,h=N$n(s,a,T$n(c),l,this.changeStyle),p=function(){o.stopJSAnimation=h()};this.manager.start([d,u,p,l,f])}},{key:"runStepAnimation",value:function(i){var o=this,s=i.steps,a=i.begin,l=i.onAnimationStart,c=s[0],u=c.style,f=c.duration,d=f===void 0?0:f,h=function(g,m,v){if(v===0)return g;var y=m.duration,x=m.easing,b=x===void 0?"ease":x,w=m.style,_=m.properties,S=m.onAnimationEnd,O=v>0?s[v-1]:m,k=_||Object.keys(w);if(typeof b=="function"||b==="spring")return[].concat(M7(g),[o.runJSAnimation.bind(o,{from:O.style,to:w,duration:y,easing:b}),y]);var E=$Se(k,y,b),M=Ku(Ku(Ku({},O.style),w),{},{transition:E});return[].concat(M7(g),[M,y,S]).filter(g$n)};return this.manager.start([l].concat(M7(s.reduce(h,[u,Math.max(d,a)])),[i.onAnimationEnd]))}},{key:"runAnimation",value:function(i){this.manager||(this.manager=f$n());var o=i.begin,s=i.duration,a=i.attributeName,l=i.to,c=i.easing,u=i.onAnimationStart,f=i.onAnimationEnd,d=i.steps,h=i.children,p=this.manager;if(this.unSubscribe=p.subscribe(this.handleStyleChange),typeof c=="function"||typeof h=="function"||c==="spring"){this.runJSAnimation(i);return}if(d.length>1){this.runStepAnimation(i);return}var g=a?IT({},a,l):l,m=$Se(Object.keys(g),s,c);p.start([u,o,Ku(Ku({},g),{},{transition:m}),s,f])}},{key:"render",value:function(){var i=this.props,o=i.children;i.begin;var s=i.duration;i.attributeName,i.easing;var a=i.isActive;i.steps,i.from,i.to,i.canBegin,i.onAnimationEnd,i.shouldReAnimate,i.onAnimationReStart;var l=j$n(i,z$n),c=D.Children.count(o),u=this.state.style;if(typeof o=="function")return o(u);if(!a||c===0||s<=0)return o;var f=function(h){var p=h.props,g=p.style,m=g===void 0?{}:g,v=p.className,y=D.cloneElement(h,Ku(Ku({},l),{},{style:Ku(Ku({},m),u),className:v}));return y};return c===1?f(D.Children.only(o)):de.createElement("div",null,D.Children.map(o,function(d){return f(d)}))}}]),n}(D.PureComponent);Fh.displayName="Animate";Fh.defaultProps={begin:0,duration:1e3,from:"",to:"",attributeName:"",easing:"ease",isActive:!0,canBegin:!0,steps:[],onAnimationEnd:function(){},onAnimationStart:function(){}};Fh.propTypes={from:pe.oneOfType([pe.object,pe.string]),to:pe.oneOfType([pe.object,pe.string]),attributeName:pe.string,duration:pe.number,begin:pe.number,easing:pe.oneOfType([pe.string,pe.func]),steps:pe.arrayOf(pe.shape({duration:pe.number.isRequired,style:pe.object.isRequired,easing:pe.oneOfType([pe.oneOf(["ease","ease-in","ease-out","ease-in-out","linear"]),pe.func]),properties:pe.arrayOf("string"),onAnimationEnd:pe.func})),children:pe.oneOfType([pe.node,pe.func]),isActive:pe.bool,canBegin:pe.bool,onAnimationEnd:pe.func,shouldReAnimate:pe.bool,onAnimationStart:pe.func,onAnimationReStart:pe.func};pe.object,pe.object,pe.object,pe.element;pe.object,pe.object,pe.object,pe.oneOfType([pe.array,pe.element]),pe.any;function HP(t){"@babel/helpers - typeof";return HP=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},HP(t)}function qz(){return qz=Object.assign?Object.assign.bind():function(t){for(var e=1;et.length)&&(e=t.length);for(var n=0,r=new Array(e);n=0?1:-1,l=r>=0?1:-1,c=i>=0&&r>=0||i<0&&r<0?1:0,u;if(s>0&&o instanceof Array){for(var f=[0,0,0,0],d=0,h=4;ds?s:o[d];u="M".concat(e,",").concat(n+a*f[0]),f[0]>0&&(u+="A ".concat(f[0],",").concat(f[0],",0,0,").concat(c,",").concat(e+l*f[0],",").concat(n)),u+="L ".concat(e+r-l*f[1],",").concat(n),f[1]>0&&(u+="A ".concat(f[1],",").concat(f[1],",0,0,").concat(c,`, + A`).concat(s,",").concat(s,",0,0,").concat(+(f<0),",").concat(O.x,",").concat(O.y,"Z")}else w+="L".concat(n,",").concat(r,"Z");return w},_Ln={cx:0,cy:0,innerRadius:0,outerRadius:0,startAngle:0,endAngle:0,cornerRadius:0,forceCornerRadius:!1,cornerIsExternal:!1},Lqe=function(e){var n=qSe(qSe({},_Ln),e),r=n.cx,i=n.cy,o=n.innerRadius,s=n.outerRadius,a=n.cornerRadius,l=n.forceCornerRadius,c=n.cornerIsExternal,u=n.startAngle,f=n.endAngle,d=n.className;if(s0&&Math.abs(u-f)<360?m=wLn({cx:r,cy:i,innerRadius:o,outerRadius:s,cornerRadius:Math.min(g,p/2),forceCornerRadius:l,cornerIsExternal:c,startAngle:u,endAngle:f}):m=Iqe({cx:r,cy:i,innerRadius:o,outerRadius:s,startAngle:u,endAngle:f}),de.createElement("path",yZ({},pn(n,!0),{className:h,d:m,role:"img"}))};function WP(t){"@babel/helpers - typeof";return WP=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},WP(t)}function xZ(){return xZ=Object.assign?Object.assign.bind():function(t){for(var e=1;e0;)if(!n.equals(t[r],e[r],r,r,t,e,n))return!1;return!0}function RLn(t,e){return fE(t.getTime(),e.getTime())}function tCe(t,e,n){if(t.size!==e.size)return!1;for(var r={},i=t.entries(),o=0,s,a;(s=i.next())&&!s.done;){for(var l=e.entries(),c=!1,u=0;(a=l.next())&&!a.done;){var f=s.value,d=f[0],h=f[1],p=a.value,g=p[0],m=p[1];!c&&!r[u]&&(c=n.equals(d,g,o,u,t,e,n)&&n.equals(h,m,d,g,t,e,n))&&(r[u]=!0),u++}if(!c)return!1;o++}return!0}function DLn(t,e,n){var r=eCe(t),i=r.length;if(eCe(e).length!==i)return!1;for(var o;i-- >0;)if(o=r[i],o===Fqe&&(t.$$typeof||e.$$typeof)&&t.$$typeof!==e.$$typeof||!$qe(e,o)||!n.equals(t[o],e[o],o,o,t,e,n))return!1;return!0}function M2(t,e,n){var r=ZSe(t),i=r.length;if(ZSe(e).length!==i)return!1;for(var o,s,a;i-- >0;)if(o=r[i],o===Fqe&&(t.$$typeof||e.$$typeof)&&t.$$typeof!==e.$$typeof||!$qe(e,o)||!n.equals(t[o],e[o],o,o,t,e,n)||(s=JSe(t,o),a=JSe(e,o),(s||a)&&(!s||!a||s.configurable!==a.configurable||s.enumerable!==a.enumerable||s.writable!==a.writable)))return!1;return!0}function ILn(t,e){return fE(t.valueOf(),e.valueOf())}function LLn(t,e){return t.source===e.source&&t.flags===e.flags}function nCe(t,e,n){if(t.size!==e.size)return!1;for(var r={},i=t.values(),o,s;(o=i.next())&&!o.done;){for(var a=e.values(),l=!1,c=0;(s=a.next())&&!s.done;)!l&&!r[c]&&(l=n.equals(o.value,s.value,o.value,s.value,t,e,n))&&(r[c]=!0),c++;if(!l)return!1}return!0}function $Ln(t,e){var n=t.length;if(e.length!==n)return!1;for(;n-- >0;)if(t[n]!==e[n])return!1;return!0}var FLn="[object Arguments]",NLn="[object Boolean]",zLn="[object Date]",jLn="[object Map]",BLn="[object Number]",ULn="[object Object]",WLn="[object RegExp]",VLn="[object Set]",GLn="[object String]",HLn=Array.isArray,rCe=typeof ArrayBuffer=="function"&&ArrayBuffer.isView?ArrayBuffer.isView:null,iCe=Object.assign,qLn=Object.prototype.toString.call.bind(Object.prototype.toString);function XLn(t){var e=t.areArraysEqual,n=t.areDatesEqual,r=t.areMapsEqual,i=t.areObjectsEqual,o=t.arePrimitiveWrappersEqual,s=t.areRegExpsEqual,a=t.areSetsEqual,l=t.areTypedArraysEqual;return function(u,f,d){if(u===f)return!0;if(u==null||f==null||typeof u!="object"||typeof f!="object")return u!==u&&f!==f;var h=u.constructor;if(h!==f.constructor)return!1;if(h===Object)return i(u,f,d);if(HLn(u))return e(u,f,d);if(rCe!=null&&rCe(u))return l(u,f,d);if(h===Date)return n(u,f,d);if(h===RegExp)return s(u,f,d);if(h===Map)return r(u,f,d);if(h===Set)return a(u,f,d);var p=qLn(u);return p===zLn?n(u,f,d):p===WLn?s(u,f,d):p===jLn?r(u,f,d):p===VLn?a(u,f,d):p===ULn?typeof u.then!="function"&&typeof f.then!="function"&&i(u,f,d):p===FLn?i(u,f,d):p===NLn||p===BLn||p===GLn?o(u,f,d):!1}}function YLn(t){var e=t.circular,n=t.createCustomConfig,r=t.strict,i={areArraysEqual:r?M2:MLn,areDatesEqual:RLn,areMapsEqual:r?KSe(tCe,M2):tCe,areObjectsEqual:r?M2:DLn,arePrimitiveWrappersEqual:ILn,areRegExpsEqual:LLn,areSetsEqual:r?KSe(nCe,M2):nCe,areTypedArraysEqual:r?M2:$Ln};if(n&&(i=iCe({},i,n(i))),e){var o=JL(i.areArraysEqual),s=JL(i.areMapsEqual),a=JL(i.areObjectsEqual),l=JL(i.areSetsEqual);i=iCe({},i,{areArraysEqual:o,areMapsEqual:s,areObjectsEqual:a,areSetsEqual:l})}return i}function QLn(t){return function(e,n,r,i,o,s,a){return t(e,n,a)}}function KLn(t){var e=t.circular,n=t.comparator,r=t.createState,i=t.equals,o=t.strict;if(r)return function(l,c){var u=r(),f=u.cache,d=f===void 0?e?new WeakMap:void 0:f,h=u.meta;return n(l,c,{cache:d,equals:i,meta:h,strict:o})};if(e)return function(l,c){return n(l,c,{cache:new WeakMap,equals:i,meta:void 0,strict:o})};var s={cache:void 0,equals:i,meta:void 0,strict:o};return function(l,c){return n(l,c,s)}}var ZLn=o0();o0({strict:!0});o0({circular:!0});o0({circular:!0,strict:!0});o0({createInternalComparator:function(){return fE}});o0({strict:!0,createInternalComparator:function(){return fE}});o0({circular:!0,createInternalComparator:function(){return fE}});o0({circular:!0,createInternalComparator:function(){return fE},strict:!0});function o0(t){t===void 0&&(t={});var e=t.circular,n=e===void 0?!1:e,r=t.createInternalComparator,i=t.createState,o=t.strict,s=o===void 0?!1:o,a=YLn(t),l=XLn(a),c=r?r(l):QLn(l);return KLn({circular:n,comparator:l,createState:i,equals:c,strict:s})}function JLn(t){typeof requestAnimationFrame<"u"&&requestAnimationFrame(t)}function oCe(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,n=-1,r=function i(o){n<0&&(n=o),o-n>e?(t(o),n=-1):JLn(i)};requestAnimationFrame(r)}function bZ(t){"@babel/helpers - typeof";return bZ=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},bZ(t)}function e$n(t){return i$n(t)||r$n(t)||n$n(t)||t$n()}function t$n(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function n$n(t,e){if(t){if(typeof t=="string")return sCe(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);if(n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set")return Array.from(t);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return sCe(t,e)}}function sCe(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);nt.length)&&(e=t.length);for(var n=0,r=new Array(e);n1?1:v<0?0:v},g=function(v){for(var y=v>1?1:v,x=y,b=0;b<8;++b){var w=f(x)-y,_=h(x);if(Math.abs(w-y)0&&arguments[0]!==void 0?arguments[0]:{},n=e.stiff,r=n===void 0?100:n,i=e.damping,o=i===void 0?8:i,s=e.dt,a=s===void 0?17:s,l=function(u,f,d){var h=-(u-f)*r,p=d*o,g=d+(h-p)*a/1e3,m=d*a/1e3+u;return Math.abs(m-f)t.length)&&(e=t.length);for(var n=0,r=new Array(e);n=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function L$n(t,e){if(t==null)return{};var n={},r=Object.keys(t),i,o;for(o=0;o=0)&&(n[i]=t[i]);return n}function H7(t){return z$n(t)||N$n(t)||F$n(t)||$$n()}function $$n(){throw new TypeError(`Invalid attempt to spread non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function F$n(t,e){if(t){if(typeof t=="string")return OZ(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);if(n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set")return Array.from(t);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return OZ(t,e)}}function N$n(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function z$n(t){if(Array.isArray(t))return OZ(t)}function OZ(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function Uz(t){return Uz=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},Uz(t)}var Ih=function(t){V$n(n,t);var e=G$n(n);function n(r,i){var o;j$n(this,n),o=e.call(this,r,i);var s=o.props,a=s.isActive,l=s.attributeName,c=s.from,u=s.to,f=s.steps,d=s.children,h=s.duration;if(o.handleStyleChange=o.handleStyleChange.bind(kZ(o)),o.changeStyle=o.changeStyle.bind(kZ(o)),!a||h<=0)return o.state={style:{}},typeof d=="function"&&(o.state={style:u}),TZ(o);if(f&&f.length)o.state={style:f[0].style};else if(c){if(typeof d=="function")return o.state={style:c},TZ(o);o.state={style:l?DT({},l,c):c}}else o.state={style:{}};return o}return U$n(n,[{key:"componentDidMount",value:function(){var i=this.props,o=i.isActive,s=i.canBegin;this.mounted=!0,!(!o||!s)&&this.runAnimation(this.props)}},{key:"componentDidUpdate",value:function(i){var o=this.props,s=o.isActive,a=o.canBegin,l=o.attributeName,c=o.shouldReAnimate,u=o.to,f=o.from,d=this.state.style;if(a){if(!s){var h={style:l?DT({},l,u):u};this.state&&d&&(l&&d[l]!==u||!l&&d!==u)&&this.setState(h);return}if(!(ZLn(i.to,u)&&i.canBegin&&i.isActive)){var p=!i.canBegin||!i.isActive;this.manager&&this.manager.stop(),this.stopJSAnimation&&this.stopJSAnimation();var g=p||c?f:i.to;if(this.state&&d){var m={style:l?DT({},l,g):g};(l&&d[l]!==g||!l&&d!==g)&&this.setState(m)}this.runAnimation(Ku(Ku({},this.props),{},{from:g,begin:0}))}}}},{key:"componentWillUnmount",value:function(){this.mounted=!1;var i=this.props.onAnimationEnd;this.unSubscribe&&this.unSubscribe(),this.manager&&(this.manager.stop(),this.manager=null),this.stopJSAnimation&&this.stopJSAnimation(),i&&i()}},{key:"handleStyleChange",value:function(i){this.changeStyle(i)}},{key:"changeStyle",value:function(i){this.mounted&&this.setState({style:i})}},{key:"runJSAnimation",value:function(i){var o=this,s=i.from,a=i.to,l=i.duration,c=i.easing,u=i.begin,f=i.onAnimationEnd,d=i.onAnimationStart,h=R$n(s,a,w$n(c),l,this.changeStyle),p=function(){o.stopJSAnimation=h()};this.manager.start([d,u,p,l,f])}},{key:"runStepAnimation",value:function(i){var o=this,s=i.steps,a=i.begin,l=i.onAnimationStart,c=s[0],u=c.style,f=c.duration,d=f===void 0?0:f,h=function(g,m,v){if(v===0)return g;var y=m.duration,x=m.easing,b=x===void 0?"ease":x,w=m.style,_=m.properties,S=m.onAnimationEnd,O=v>0?s[v-1]:m,k=_||Object.keys(w);if(typeof b=="function"||b==="spring")return[].concat(H7(g),[o.runJSAnimation.bind(o,{from:O.style,to:w,duration:y,easing:b}),y]);var E=cCe(k,y,b),P=Ku(Ku(Ku({},O.style),w),{},{transition:E});return[].concat(H7(g),[P,y,S]).filter(c$n)};return this.manager.start([l].concat(H7(s.reduce(h,[u,Math.max(d,a)])),[i.onAnimationEnd]))}},{key:"runAnimation",value:function(i){this.manager||(this.manager=o$n());var o=i.begin,s=i.duration,a=i.attributeName,l=i.to,c=i.easing,u=i.onAnimationStart,f=i.onAnimationEnd,d=i.steps,h=i.children,p=this.manager;if(this.unSubscribe=p.subscribe(this.handleStyleChange),typeof c=="function"||typeof h=="function"||c==="spring"){this.runJSAnimation(i);return}if(d.length>1){this.runStepAnimation(i);return}var g=a?DT({},a,l):l,m=cCe(Object.keys(g),s,c);p.start([u,o,Ku(Ku({},g),{},{transition:m}),s,f])}},{key:"render",value:function(){var i=this.props,o=i.children;i.begin;var s=i.duration;i.attributeName,i.easing;var a=i.isActive;i.steps,i.from,i.to,i.canBegin,i.onAnimationEnd,i.shouldReAnimate,i.onAnimationReStart;var l=I$n(i,D$n),c=D.Children.count(o),u=this.state.style;if(typeof o=="function")return o(u);if(!a||c===0||s<=0)return o;var f=function(h){var p=h.props,g=p.style,m=g===void 0?{}:g,v=p.className,y=D.cloneElement(h,Ku(Ku({},l),{},{style:Ku(Ku({},m),u),className:v}));return y};return c===1?f(D.Children.only(o)):de.createElement("div",null,D.Children.map(o,function(d){return f(d)}))}}]),n}(D.PureComponent);Ih.displayName="Animate";Ih.defaultProps={begin:0,duration:1e3,from:"",to:"",attributeName:"",easing:"ease",isActive:!0,canBegin:!0,steps:[],onAnimationEnd:function(){},onAnimationStart:function(){}};Ih.propTypes={from:pe.oneOfType([pe.object,pe.string]),to:pe.oneOfType([pe.object,pe.string]),attributeName:pe.string,duration:pe.number,begin:pe.number,easing:pe.oneOfType([pe.string,pe.func]),steps:pe.arrayOf(pe.shape({duration:pe.number.isRequired,style:pe.object.isRequired,easing:pe.oneOfType([pe.oneOf(["ease","ease-in","ease-out","ease-in-out","linear"]),pe.func]),properties:pe.arrayOf("string"),onAnimationEnd:pe.func})),children:pe.oneOfType([pe.node,pe.func]),isActive:pe.bool,canBegin:pe.bool,onAnimationEnd:pe.func,shouldReAnimate:pe.bool,onAnimationStart:pe.func,onAnimationReStart:pe.func};pe.object,pe.object,pe.object,pe.element;pe.object,pe.object,pe.object,pe.oneOfType([pe.array,pe.element]),pe.any;function HP(t){"@babel/helpers - typeof";return HP=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},HP(t)}function Wz(){return Wz=Object.assign?Object.assign.bind():function(t){for(var e=1;et.length)&&(e=t.length);for(var n=0,r=new Array(e);n=0?1:-1,l=r>=0?1:-1,c=i>=0&&r>=0||i<0&&r<0?1:0,u;if(s>0&&o instanceof Array){for(var f=[0,0,0,0],d=0,h=4;ds?s:o[d];u="M".concat(e,",").concat(n+a*f[0]),f[0]>0&&(u+="A ".concat(f[0],",").concat(f[0],",0,0,").concat(c,",").concat(e+l*f[0],",").concat(n)),u+="L ".concat(e+r-l*f[1],",").concat(n),f[1]>0&&(u+="A ".concat(f[1],",").concat(f[1],",0,0,").concat(c,`, `).concat(e+r,",").concat(n+a*f[1])),u+="L ".concat(e+r,",").concat(n+i-a*f[2]),f[2]>0&&(u+="A ".concat(f[2],",").concat(f[2],",0,0,").concat(c,`, `).concat(e+r-l*f[2],",").concat(n+i)),u+="L ".concat(e+l*f[3],",").concat(n+i),f[3]>0&&(u+="A ".concat(f[3],",").concat(f[3],",0,0,").concat(c,`, `).concat(e,",").concat(n+i-a*f[3])),u+="Z"}else if(s>0&&o===+o&&o>0){var p=Math.min(s,o);u="M ".concat(e,",").concat(n+a*p,` @@ -574,22 +576,22 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho L `).concat(e+r,",").concat(n+i-a*p,` A `).concat(p,",").concat(p,",0,0,").concat(c,",").concat(e+r-l*p,",").concat(n+i,` L `).concat(e+l*p,",").concat(n+i,` - A `).concat(p,",").concat(p,",0,0,").concat(c,",").concat(e,",").concat(n+i-a*p," Z")}else u="M ".concat(e,",").concat(n," h ").concat(r," v ").concat(i," h ").concat(-r," Z");return u},a3n=function(e,n){if(!e||!n)return!1;var r=e.x,i=e.y,o=n.x,s=n.y,a=n.width,l=n.height;if(Math.abs(a)>0&&Math.abs(l)>0){var c=Math.min(o,o+a),u=Math.max(o,o+a),f=Math.min(s,s+l),d=Math.max(s,s+l);return r>=c&&r<=u&&i>=f&&i<=d}return!1},l3n={x:0,y:0,width:0,height:0,radius:0,isAnimationActive:!1,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},_ce=function(e){var n=VSe(VSe({},l3n),e),r=D.useRef(),i=D.useState(-1),o=J$n(i,2),s=o[0],a=o[1];D.useEffect(function(){if(r.current&&r.current.getTotalLength)try{var b=r.current.getTotalLength();b&&a(b)}catch{}},[]);var l=n.x,c=n.y,u=n.width,f=n.height,d=n.radius,h=n.className,p=n.animationEasing,g=n.animationDuration,m=n.animationBegin,v=n.isAnimationActive,y=n.isUpdateAnimationActive;if(l!==+l||c!==+c||u!==+u||f!==+f||u===0||f===0)return null;var x=Oe("recharts-rectangle",h);return y?de.createElement(Fh,{canBegin:s>0,from:{width:u,height:f,x:l,y:c},to:{width:u,height:f,x:l,y:c},duration:g,animationEasing:p,isActive:y},function(b){var w=b.width,_=b.height,S=b.x,O=b.y;return de.createElement(Fh,{canBegin:s>0,from:"0px ".concat(s===-1?1:s,"px"),to:"".concat(s,"px 0px"),attributeName:"strokeDasharray",begin:m,duration:g,isActive:v,easing:p},de.createElement("path",qz({},pn(n,!0),{className:x,d:GSe(S,O,w,_,d),ref:r})))}):de.createElement("path",qz({},pn(n,!0),{className:x,d:GSe(l,c,u,f,d)}))};function hZ(){return hZ=Object.assign?Object.assign.bind():function(t){for(var e=1;e=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function g3n(t,e){if(t==null)return{};var n={},r=Object.keys(t),i,o;for(o=0;o=0)&&(n[i]=t[i]);return n}var m3n=function(e,n,r,i,o,s){return"M".concat(e,",").concat(o,"v").concat(i,"M").concat(s,",").concat(n,"h").concat(r)},v3n=function(e){var n=e.x,r=n===void 0?0:n,i=e.y,o=i===void 0?0:i,s=e.top,a=s===void 0?0:s,l=e.left,c=l===void 0?0:l,u=e.width,f=u===void 0?0:u,d=e.height,h=d===void 0?0:d,p=e.className,g=p3n(e,c3n),m=u3n({x:r,y:o,top:a,left:c,width:f,height:h},g);return!at(r)||!at(o)||!at(f)||!at(h)||!at(a)||!at(c)?null:de.createElement("path",pZ({},pn(m,!0),{className:Oe("recharts-cross",p),d:m3n(r,o,f,h,a,c)}))},y3n=dHe,x3n=y3n(Object.getPrototypeOf,Object),b3n=x3n,w3n=im,_3n=b3n,S3n=om,C3n="[object Object]",O3n=Function.prototype,E3n=Object.prototype,vqe=O3n.toString,T3n=E3n.hasOwnProperty,k3n=vqe.call(Object);function A3n(t){if(!S3n(t)||w3n(t)!=C3n)return!1;var e=_3n(t);if(e===null)return!0;var n=T3n.call(e,"constructor")&&e.constructor;return typeof n=="function"&&n instanceof n&&vqe.call(n)==k3n}var P3n=A3n;const M3n=on(P3n);var R3n=im,D3n=om,I3n="[object Boolean]";function L3n(t){return t===!0||t===!1||D3n(t)&&R3n(t)==I3n}var $3n=L3n;const F3n=on($3n);function XP(t){"@babel/helpers - typeof";return XP=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},XP(t)}function Xz(){return Xz=Object.assign?Object.assign.bind():function(t){for(var e=1;et.length)&&(e=t.length);for(var n=0,r=new Array(e);n0,from:{upperWidth:0,lowerWidth:0,height:d,x:l,y:c},to:{upperWidth:u,lowerWidth:f,height:d,x:l,y:c},duration:g,animationEasing:p,isActive:v},function(x){var b=x.upperWidth,w=x.lowerWidth,_=x.height,S=x.x,O=x.y;return de.createElement(Fh,{canBegin:s>0,from:"0px ".concat(s===-1?1:s,"px"),to:"".concat(s,"px 0px"),attributeName:"strokeDasharray",begin:m,duration:g,easing:p},de.createElement("path",Xz({},pn(n,!0),{className:y,d:QSe(S,O,b,w,_),ref:r})))}):de.createElement("g",null,de.createElement("path",Xz({},pn(n,!0),{className:y,d:QSe(l,c,u,f,d)})))},X3n=["option","shapeType","propTransformer","activeClassName","isActive"];function YP(t){"@babel/helpers - typeof";return YP=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},YP(t)}function Y3n(t,e){if(t==null)return{};var n=Q3n(t,e),r,i;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);for(i=0;i=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function Q3n(t,e){if(t==null)return{};var n={},r=Object.keys(t),i,o;for(o=0;o=0)&&(n[i]=t[i]);return n}function KSe(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function Yz(t){for(var e=1;e0&&r.handleDrag(i.changedTouches[0])}),Hl(Cd(r),"handleDragEnd",function(){r.setState({isTravellerMoving:!1,isSlideMoving:!1},function(){var i=r.props,o=i.endIndex,s=i.onDragEnd,a=i.startIndex;s==null||s({endIndex:o,startIndex:a})}),r.detachDragEndListener()}),Hl(Cd(r),"handleLeaveWrapper",function(){(r.state.isTravellerMoving||r.state.isSlideMoving)&&(r.leaveTimer=window.setTimeout(r.handleDragEnd,r.props.leaveTimeOut))}),Hl(Cd(r),"handleEnterSlideOrTraveller",function(){r.setState({isTextActive:!0})}),Hl(Cd(r),"handleLeaveSlideOrTraveller",function(){r.setState({isTextActive:!1})}),Hl(Cd(r),"handleSlideDragStart",function(i){var o=iCe(i)?i.changedTouches[0]:i;r.setState({isTravellerMoving:!1,isSlideMoving:!0,slideMoveStartX:o.pageX}),r.attachDragEndListener()}),r.travellerDragStartHandlers={startX:r.handleTravellerDragStart.bind(Cd(r),"startX"),endX:r.handleTravellerDragStart.bind(Cd(r),"endX")},r.state={},r}return PFn(e,[{key:"componentWillUnmount",value:function(){this.leaveTimer&&(clearTimeout(this.leaveTimer),this.leaveTimer=null),this.detachDragEndListener()}},{key:"getIndex",value:function(r){var i=r.startX,o=r.endX,s=this.state.scaleValues,a=this.props,l=a.gap,c=a.data,u=c.length-1,f=Math.min(i,o),d=Math.max(i,o),h=e.getIndexInRange(s,f),p=e.getIndexInRange(s,d);return{startIndex:h-h%l,endIndex:p===u?u:p-p%l}}},{key:"getTextOfTick",value:function(r){var i=this.props,o=i.data,s=i.tickFormatter,a=i.dataKey,l=Da(o[r],a,r);return mn(s)?s(l,r):l}},{key:"attachDragEndListener",value:function(){window.addEventListener("mouseup",this.handleDragEnd,!0),window.addEventListener("touchend",this.handleDragEnd,!0),window.addEventListener("mousemove",this.handleDrag,!0)}},{key:"detachDragEndListener",value:function(){window.removeEventListener("mouseup",this.handleDragEnd,!0),window.removeEventListener("touchend",this.handleDragEnd,!0),window.removeEventListener("mousemove",this.handleDrag,!0)}},{key:"handleSlideDrag",value:function(r){var i=this.state,o=i.slideMoveStartX,s=i.startX,a=i.endX,l=this.props,c=l.x,u=l.width,f=l.travellerWidth,d=l.startIndex,h=l.endIndex,p=l.onChange,g=r.pageX-o;g>0?g=Math.min(g,c+u-f-a,c+u-f-s):g<0&&(g=Math.max(g,c-s,c-a));var m=this.getIndex({startX:s+g,endX:a+g});(m.startIndex!==d||m.endIndex!==h)&&p&&p(m),this.setState({startX:s+g,endX:a+g,slideMoveStartX:r.pageX})}},{key:"handleTravellerDragStart",value:function(r,i){var o=iCe(i)?i.changedTouches[0]:i;this.setState({isSlideMoving:!1,isTravellerMoving:!0,movingTravellerId:r,brushMoveStartX:o.pageX}),this.attachDragEndListener()}},{key:"handleTravellerMove",value:function(r){var i=this.state,o=i.brushMoveStartX,s=i.movingTravellerId,a=i.endX,l=i.startX,c=this.state[s],u=this.props,f=u.x,d=u.width,h=u.travellerWidth,p=u.onChange,g=u.gap,m=u.data,v={startX:this.state.startX,endX:this.state.endX},y=r.pageX-o;y>0?y=Math.min(y,f+d-h-c):y<0&&(y=Math.max(y,f-c)),v[s]=c+y;var x=this.getIndex(v),b=x.startIndex,w=x.endIndex,_=function(){var O=m.length-1;return s==="startX"&&(a>l?b%g===0:w%g===0)||al?w%g===0:b%g===0)||a>l&&w===O};this.setState(Hl(Hl({},s,c+y),"brushMoveStartX",r.pageX),function(){p&&_()&&p(x)})}},{key:"handleTravellerMoveKeyboard",value:function(r,i){var o=this,s=this.state,a=s.scaleValues,l=s.startX,c=s.endX,u=this.state[i],f=a.indexOf(u);if(f!==-1){var d=f+r;if(!(d===-1||d>=a.length)){var h=a[d];i==="startX"&&h>=c||i==="endX"&&h<=l||this.setState(Hl({},i,h),function(){o.props.onChange(o.getIndex({startX:o.state.startX,endX:o.state.endX}))})}}}},{key:"renderBackground",value:function(){var r=this.props,i=r.x,o=r.y,s=r.width,a=r.height,l=r.fill,c=r.stroke;return de.createElement("rect",{stroke:c,fill:l,x:i,y:o,width:s,height:a})}},{key:"renderPanorama",value:function(){var r=this.props,i=r.x,o=r.y,s=r.width,a=r.height,l=r.data,c=r.children,u=r.padding,f=D.Children.only(c);return f?de.cloneElement(f,{x:i,y:o,width:s,height:a,margin:u,compact:!0,data:l}):null}},{key:"renderTravellerLayer",value:function(r,i){var o,s,a=this,l=this.props,c=l.y,u=l.travellerWidth,f=l.height,d=l.traveller,h=l.ariaLabel,p=l.data,g=l.startIndex,m=l.endIndex,v=Math.max(r,this.props.x),y=D7(D7({},pn(this.props,!1)),{},{x:v,y:c,width:u,height:f}),x=h||"Min value: ".concat((o=p[g])===null||o===void 0?void 0:o.name,", Max value: ").concat((s=p[m])===null||s===void 0?void 0:s.name);return de.createElement(Ur,{tabIndex:0,role:"slider","aria-label":x,"aria-valuenow":r,className:"recharts-brush-traveller",onMouseEnter:this.handleEnterSlideOrTraveller,onMouseLeave:this.handleLeaveSlideOrTraveller,onMouseDown:this.travellerDragStartHandlers[i],onTouchStart:this.travellerDragStartHandlers[i],onKeyDown:function(w){["ArrowLeft","ArrowRight"].includes(w.key)&&(w.preventDefault(),w.stopPropagation(),a.handleTravellerMoveKeyboard(w.key==="ArrowRight"?1:-1,i))},onFocus:function(){a.setState({isTravellerFocused:!0})},onBlur:function(){a.setState({isTravellerFocused:!1})},style:{cursor:"col-resize"}},e.renderTraveller(d,y))}},{key:"renderSlide",value:function(r,i){var o=this.props,s=o.y,a=o.height,l=o.stroke,c=o.travellerWidth,u=Math.min(r,i)+c,f=Math.max(Math.abs(i-r)-c,0);return de.createElement("rect",{className:"recharts-brush-slide",onMouseEnter:this.handleEnterSlideOrTraveller,onMouseLeave:this.handleLeaveSlideOrTraveller,onMouseDown:this.handleSlideDragStart,onTouchStart:this.handleSlideDragStart,style:{cursor:"move"},stroke:"none",fill:l,fillOpacity:.2,x:u,y:s,width:f,height:a})}},{key:"renderText",value:function(){var r=this.props,i=r.startIndex,o=r.endIndex,s=r.y,a=r.height,l=r.travellerWidth,c=r.stroke,u=this.state,f=u.startX,d=u.endX,h=5,p={pointerEvents:"none",fill:c};return de.createElement(Ur,{className:"recharts-brush-texts"},de.createElement(Fz,Kz({textAnchor:"end",verticalAnchor:"middle",x:Math.min(f,d)-h,y:s+a/2},p),this.getTextOfTick(i)),de.createElement(Fz,Kz({textAnchor:"start",verticalAnchor:"middle",x:Math.max(f,d)+l+h,y:s+a/2},p),this.getTextOfTick(o)))}},{key:"render",value:function(){var r=this.props,i=r.data,o=r.className,s=r.children,a=r.x,l=r.y,c=r.width,u=r.height,f=r.alwaysShowText,d=this.state,h=d.startX,p=d.endX,g=d.isTextActive,m=d.isSlideMoving,v=d.isTravellerMoving,y=d.isTravellerFocused;if(!i||!i.length||!at(a)||!at(l)||!at(c)||!at(u)||c<=0||u<=0)return null;var x=Oe("recharts-brush",o),b=de.Children.count(s)===1,w=kFn("userSelect","none");return de.createElement(Ur,{className:x,onMouseLeave:this.handleLeaveWrapper,onTouchMove:this.handleTouchMove,style:w},this.renderBackground(),b&&this.renderPanorama(),this.renderSlide(h,p),this.renderTravellerLayer(h,"startX"),this.renderTravellerLayer(p,"endX"),(g||m||v||y||f)&&this.renderText())}}],[{key:"renderDefaultTraveller",value:function(r){var i=r.x,o=r.y,s=r.width,a=r.height,l=r.stroke,c=Math.floor(o+a/2)-1;return de.createElement(de.Fragment,null,de.createElement("rect",{x:i,y:o,width:s,height:a,fill:l,stroke:"none"}),de.createElement("line",{x1:i+1,y1:c,x2:i+s-1,y2:c,fill:"none",stroke:"#fff"}),de.createElement("line",{x1:i+1,y1:c+2,x2:i+s-1,y2:c+2,fill:"none",stroke:"#fff"}))}},{key:"renderTraveller",value:function(r,i){var o;return de.isValidElement(r)?o=de.cloneElement(r,i):mn(r)?o=r(i):o=e.renderDefaultTraveller(i),o}},{key:"getDerivedStateFromProps",value:function(r,i){var o=r.data,s=r.width,a=r.x,l=r.travellerWidth,c=r.updateId,u=r.startIndex,f=r.endIndex;if(o!==i.prevData||c!==i.prevUpdateId)return D7({prevData:o,prevTravellerWidth:l,prevUpdateId:c,prevX:a,prevWidth:s},o&&o.length?LFn({data:o,width:s,x:a,travellerWidth:l,startIndex:u,endIndex:f}):{scale:null,scaleValues:null});if(i.scale&&(s!==i.prevWidth||a!==i.prevX||l!==i.prevTravellerWidth)){i.scale.range([a,a+s-l]);var d=i.scale.domain().map(function(h){return i.scale(h)});return{prevData:o,prevTravellerWidth:l,prevUpdateId:c,prevX:a,prevWidth:s,startX:i.scale(r.startIndex),endX:i.scale(r.endIndex),scaleValues:d}}return null}},{key:"getIndexInRange",value:function(r,i){for(var o=r.length,s=0,a=o-1;a-s>1;){var l=Math.floor((s+a)/2);r[l]>i?a=l:s=l}return i>=r[a]?a:s}}]),e}(D.PureComponent);Hl(j1,"displayName","Brush");Hl(j1,"defaultProps",{height:40,travellerWidth:5,gap:1,fill:"#fff",stroke:"#666",padding:{top:1,right:1,bottom:1,left:1},leaveTimeOut:1e3,alwaysShowText:!1});var $Fn=mce;function FFn(t,e){var n;return $Fn(t,function(r,i,o){return n=e(r,i,o),!n}),!!n}var NFn=FFn,zFn=iHe,jFn=o0,BFn=NFn,UFn=Dl,WFn=XU;function VFn(t,e,n){var r=UFn(t)?zFn:BFn;return n&&WFn(t,e,n)&&(e=void 0),r(t,jFn(e))}var GFn=VFn;const HFn=on(GFn);var Sh=function(e,n){var r=e.alwaysShow,i=e.ifOverflow;return r&&(i="extendDomain"),i===n},oCe=THe;function qFn(t,e,n){e=="__proto__"&&oCe?oCe(t,e,{configurable:!0,enumerable:!0,value:n,writable:!0}):t[e]=n}var XFn=qFn,YFn=XFn,QFn=OHe,KFn=o0;function ZFn(t,e){var n={};return e=KFn(e),QFn(t,function(r,i,o){YFn(n,i,e(r,i,o))}),n}var JFn=ZFn;const eNn=on(JFn);function tNn(t,e){for(var n=-1,r=t==null?0:t.length;++n=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function yNn(t,e){if(t==null)return{};var n={},r=Object.keys(t),i,o;for(o=0;o=0)&&(n[i]=t[i]);return n}function xNn(t,e){var n=t.x,r=t.y,i=vNn(t,hNn),o="".concat(n),s=parseInt(o,10),a="".concat(r),l=parseInt(a,10),c="".concat(e.height||i.height),u=parseInt(c,10),f="".concat(e.width||i.width),d=parseInt(f,10);return D2(D2(D2(D2(D2({},e),i),s?{x:s}:{}),l?{y:l}:{}),{},{height:u,width:d,name:e.name,radius:e.radius})}function aCe(t){return de.createElement(rFn,mZ({shapeType:"rectangle",propTransformer:xNn,activeClassName:"recharts-active-bar"},t))}var bNn=function(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return function(r,i){if(typeof e=="number")return e;var o=typeof r=="number";return o?e(r,i):(o||z1(),n)}},wNn=["value","background"],Sqe;function DC(t){"@babel/helpers - typeof";return DC=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},DC(t)}function _Nn(t,e){if(t==null)return{};var n=SNn(t,e),r,i;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);for(i=0;i=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function SNn(t,e){if(t==null)return{};var n={},r=Object.keys(t),i,o;for(o=0;o=0)&&(n[i]=t[i]);return n}function Jz(){return Jz=Object.assign?Object.assign.bind():function(t){for(var e=1;e0&&Math.abs(T)0&&Math.abs(P)0&&(P=Math.min((H||0)-(T[q-1]||0),P))}),Number.isFinite(P)){var R=P/A,I=g.layout==="vertical"?r.height:r.width;if(g.padding==="gap"&&(S=R*I/2),g.padding==="no-gap"){var B=F1(e.barCategoryGap,R*I),$=R*I/2;S=$-B-($-B)/I*B}}}i==="xAxis"?O=[r.left+(x.left||0)+(S||0),r.left+r.width-(x.right||0)-(S||0)]:i==="yAxis"?O=l==="horizontal"?[r.top+r.height-(x.bottom||0),r.top+(x.top||0)]:[r.top+(x.top||0)+(S||0),r.top+r.height-(x.bottom||0)-(S||0)]:O=g.range,w&&(O=[O[1],O[0]]);var z=bIn(g,o,d),L=z.scale,j=z.realScaleType;L.domain(v).range(O),wIn(L);var N=AIn(L,gf(gf({},g),{},{realScaleType:j}));i==="xAxis"?(M=m==="top"&&!b||m==="bottom"&&b,k=r.left,E=f[_]-M*g.height):i==="yAxis"&&(M=m==="left"&&!b||m==="right"&&b,k=f[_]-M*g.width,E=r.top);var F=gf(gf(gf({},g),N),{},{realScaleType:j,x:k,y:E,scale:L,width:i==="xAxis"?r.width:g.width,height:i==="yAxis"?r.height:g.height});return F.bandSize=Bz(F,N),!g.hide&&i==="xAxis"?f[_]+=(M?-1:1)*F.height:g.hide||(f[_]+=(M?-1:1)*F.width),gf(gf({},h),{},t8({},p,F))},{})},Tqe=function(e,n){var r=e.x,i=e.y,o=n.x,s=n.y;return{x:Math.min(r,o),y:Math.min(i,s),width:Math.abs(o-r),height:Math.abs(s-i)}},DNn=function(e){var n=e.x1,r=e.y1,i=e.x2,o=e.y2;return Tqe({x:n,y:r},{x:i,y:o})},kqe=function(){function t(e){PNn(this,t),this.scale=e}return MNn(t,[{key:"domain",get:function(){return this.scale.domain}},{key:"range",get:function(){return this.scale.range}},{key:"rangeMin",get:function(){return this.range()[0]}},{key:"rangeMax",get:function(){return this.range()[1]}},{key:"bandwidth",get:function(){return this.scale.bandwidth}},{key:"apply",value:function(n){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=r.bandAware,o=r.position;if(n!==void 0){if(o)switch(o){case"start":return this.scale(n);case"middle":{var s=this.bandwidth?this.bandwidth()/2:0;return this.scale(n)+s}case"end":{var a=this.bandwidth?this.bandwidth():0;return this.scale(n)+a}default:return this.scale(n)}if(i){var l=this.bandwidth?this.bandwidth()/2:0;return this.scale(n)+l}return this.scale(n)}}},{key:"isInRange",value:function(n){var r=this.range(),i=r[0],o=r[r.length-1];return i<=o?n>=i&&n<=o:n>=o&&n<=i}}],[{key:"create",value:function(n){return new t(n)}}]),t}();t8(kqe,"EPS",1e-4);var Cce=function(e){var n=Object.keys(e).reduce(function(r,i){return gf(gf({},r),{},t8({},i,kqe.create(e[i])))},{});return gf(gf({},n),{},{apply:function(i){var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},s=o.bandAware,a=o.position;return eNn(i,function(l,c){return n[c].apply(l,{bandAware:s,position:a})})},isInRange:function(i){return _qe(i,function(o,s){return n[s].isInRange(o)})}})};function INn(t){return(t%180+180)%180}var LNn=function(e){var n=e.width,r=e.height,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,o=INn(i),s=o*Math.PI/180,a=Math.atan(r/n),l=s>a&&s-1?i[o?e[s]:s]:void 0}}var jNn=zNn,BNn=yqe;function UNn(t){var e=BNn(t),n=e%1;return e===e?n?e-n:e:0}var WNn=UNn,VNn=yHe,GNn=o0,HNn=WNn,qNn=Math.max;function XNn(t,e,n){var r=t==null?0:t.length;if(!r)return-1;var i=n==null?0:HNn(n);return i<0&&(i=qNn(r+i,0)),VNn(t,GNn(e),i)}var YNn=XNn,QNn=jNn,KNn=YNn,ZNn=QNn(KNn),JNn=ZNn;const e5n=on(JNn);var t5n=O_n(function(t){return{x:t.left,y:t.top,width:t.width,height:t.height}},function(t){return["l",t.left,"t",t.top,"w",t.width,"h",t.height].join("")}),Oce=D.createContext(void 0),Ece=D.createContext(void 0),Aqe=D.createContext(void 0),Pqe=D.createContext({}),Mqe=D.createContext(void 0),Rqe=D.createContext(0),Dqe=D.createContext(0),dCe=function(e){var n=e.state,r=n.xAxisMap,i=n.yAxisMap,o=n.offset,s=e.clipPathId,a=e.children,l=e.width,c=e.height,u=t5n(o);return de.createElement(Oce.Provider,{value:r},de.createElement(Ece.Provider,{value:i},de.createElement(Pqe.Provider,{value:o},de.createElement(Aqe.Provider,{value:u},de.createElement(Mqe.Provider,{value:s},de.createElement(Rqe.Provider,{value:c},de.createElement(Dqe.Provider,{value:l},a)))))))},n5n=function(){return D.useContext(Mqe)},Iqe=function(e){var n=D.useContext(Oce);n==null&&z1();var r=n[e];return r==null&&z1(),r},r5n=function(){var e=D.useContext(Oce);return sv(e)},i5n=function(){var e=D.useContext(Ece),n=e5n(e,function(r){return _qe(r.domain,Number.isFinite)});return n||sv(e)},Lqe=function(e){var n=D.useContext(Ece);n==null&&z1();var r=n[e];return r==null&&z1(),r},o5n=function(){var e=D.useContext(Aqe);return e},s5n=function(){return D.useContext(Pqe)},Tce=function(){return D.useContext(Dqe)},kce=function(){return D.useContext(Rqe)};function eM(t){"@babel/helpers - typeof";return eM=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},eM(t)}function hCe(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function pCe(t){for(var e=1;et.length)&&(e=t.length);for(var n=0,r=new Array(e);nt*i)return!1;var o=n();return t*(e-t*o/2-r)>=0&&t*(e+t*o/2-i)<=0}function T5n(t,e){return $qe(t,e+1)}function k5n(t,e,n,r,i){for(var o=(r||[]).slice(),s=e.start,a=e.end,l=0,c=1,u=s,f=function(){var p=r==null?void 0:r[l];if(p===void 0)return{v:$qe(r,c)};var g=l,m,v=function(){return m===void 0&&(m=n(p,g)),m},y=p.coordinate,x=l===0||tj(t,y,v,u,a);x||(l=0,u=s,c+=1),x&&(u=y+t*(v()/2+i),l+=c)},d;c<=o.length;)if(d=f(),d)return d.v;return[]}function rM(t){"@babel/helpers - typeof";return rM=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},rM(t)}function bCe(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function zs(t){for(var e=1;e0?h.coordinate-m*t:h.coordinate})}else o[d]=h=zs(zs({},h),{},{tickCoord:h.coordinate});var v=tj(t,h.tickCoord,g,a,l);v&&(l=h.tickCoord-t*(g()/2+i),o[d]=zs(zs({},h),{},{isShow:!0}))},u=s-1;u>=0;u--)c(u);return o}function D5n(t,e,n,r,i,o){var s=(r||[]).slice(),a=s.length,l=e.start,c=e.end;if(o){var u=r[a-1],f=n(u,a-1),d=t*(u.coordinate+t*f/2-c);s[a-1]=u=zs(zs({},u),{},{tickCoord:d>0?u.coordinate-d*t:u.coordinate});var h=tj(t,u.tickCoord,function(){return f},l,c);h&&(c=u.tickCoord-t*(f/2+i),s[a-1]=zs(zs({},u),{},{isShow:!0}))}for(var p=o?a-1:a,g=function(y){var x=s[y],b,w=function(){return b===void 0&&(b=n(x,y)),b};if(y===0){var _=t*(x.coordinate-t*w()/2-l);s[y]=x=zs(zs({},x),{},{tickCoord:_<0?x.coordinate-_*t:x.coordinate})}else s[y]=x=zs(zs({},x),{},{tickCoord:x.coordinate});var S=tj(t,x.tickCoord,w,l,c);S&&(l=x.tickCoord+t*(w()/2+i),s[y]=zs(zs({},x),{},{isShow:!0}))},m=0;m=2?Pf(i[1].coordinate-i[0].coordinate):1,v=E5n(o,m,h);return l==="equidistantPreserveStart"?k5n(m,v,g,i,s):(l==="preserveStart"||l==="preserveStartEnd"?d=D5n(m,v,g,i,s,l==="preserveStartEnd"):d=R5n(m,v,g,i,s),d.filter(function(y){return y.isShow}))}var I5n=["viewBox"],L5n=["viewBox"],$5n=["ticks"];function IC(t){"@babel/helpers - typeof";return IC=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},IC(t)}function x_(){return x_=Object.assign?Object.assign.bind():function(t){for(var e=1;e=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function F5n(t,e){if(t==null)return{};var n={},r=Object.keys(t),i,o;for(o=0;o=0)&&(n[i]=t[i]);return n}function N5n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function _Ce(t,e){for(var n=0;n0?l(this.props):l(h)),s<=0||a<=0||!p||!p.length?null:de.createElement(Ur,{className:Oe("recharts-cartesian-axis",c),ref:function(m){r.layerReference=m}},o&&this.renderAxisLine(),this.renderTicks(p,this.state.fontSize,this.state.letterSpacing),Vs.renderCallByParent(this.props))}}],[{key:"renderTickItem",value:function(r,i,o){var s;return de.isValidElement(r)?s=de.cloneElement(r,i):mn(r)?s=r(i):s=de.createElement(Fz,x_({},i,{className:"recharts-cartesian-axis-tick-value"}),o),s}}]),e}(D.Component);Pce(hE,"displayName","CartesianAxis");Pce(hE,"defaultProps",{x:0,y:0,width:0,height:0,viewBox:{x:0,y:0,width:0,height:0},orientation:"bottom",ticks:[],stroke:"#666",tickLine:!0,axisLine:!0,tick:!0,mirror:!1,minTickGap:5,tickSize:6,tickMargin:2,interval:"preserveEnd"});var G5n=["x1","y1","x2","y2","key"],H5n=["offset"];function B1(t){"@babel/helpers - typeof";return B1=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},B1(t)}function SCe(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function Gs(t){for(var e=1;e=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function Q5n(t,e){if(t==null)return{};var n={},r=Object.keys(t),i,o;for(o=0;o=0)&&(n[i]=t[i]);return n}var K5n=function(e){var n=e.fill;if(!n||n==="none")return null;var r=e.fillOpacity,i=e.x,o=e.y,s=e.width,a=e.height;return de.createElement("rect",{x:i,y:o,width:s,height:a,stroke:"none",fill:n,fillOpacity:r,className:"recharts-cartesian-grid-bg"})};function zqe(t,e){var n;if(de.isValidElement(t))n=de.cloneElement(t,e);else if(mn(t))n=t(e);else{var r=e.x1,i=e.y1,o=e.x2,s=e.y2,a=e.key,l=CCe(e,G5n),c=pn(l,!1);c.offset;var u=CCe(c,H5n);n=de.createElement("line",bx({},u,{x1:r,y1:i,x2:o,y2:s,fill:"none",key:a}))}return n}function Z5n(t){var e=t.x,n=t.width,r=t.horizontal,i=r===void 0?!0:r,o=t.horizontalPoints;if(!i||!o||!o.length)return null;var s=o.map(function(a,l){var c=Gs(Gs({},t),{},{x1:e,y1:a,x2:e+n,y2:a,key:"line-".concat(l),index:l});return zqe(i,c)});return de.createElement("g",{className:"recharts-cartesian-grid-horizontal"},s)}function J5n(t){var e=t.y,n=t.height,r=t.vertical,i=r===void 0?!0:r,o=t.verticalPoints;if(!i||!o||!o.length)return null;var s=o.map(function(a,l){var c=Gs(Gs({},t),{},{x1:a,y1:e,x2:a,y2:e+n,key:"line-".concat(l),index:l});return zqe(i,c)});return de.createElement("g",{className:"recharts-cartesian-grid-vertical"},s)}function ezn(t){var e=t.horizontalFill,n=t.fillOpacity,r=t.x,i=t.y,o=t.width,s=t.height,a=t.horizontalPoints,l=t.horizontal,c=l===void 0?!0:l;if(!c||!e||!e.length)return null;var u=a.map(function(d){return Math.round(d+i-i)}).sort(function(d,h){return d-h});i!==u[0]&&u.unshift(0);var f=u.map(function(d,h){var p=!u[h+1],g=p?i+s-d:u[h+1]-d;if(g<=0)return null;var m=h%e.length;return de.createElement("rect",{key:"react-".concat(h),y:d,x:r,height:g,width:o,stroke:"none",fill:e[m],fillOpacity:n,className:"recharts-cartesian-grid-bg"})});return de.createElement("g",{className:"recharts-cartesian-gridstripes-horizontal"},f)}function tzn(t){var e=t.vertical,n=e===void 0?!0:e,r=t.verticalFill,i=t.fillOpacity,o=t.x,s=t.y,a=t.width,l=t.height,c=t.verticalPoints;if(!n||!r||!r.length)return null;var u=c.map(function(d){return Math.round(d+o-o)}).sort(function(d,h){return d-h});o!==u[0]&&u.unshift(0);var f=u.map(function(d,h){var p=!u[h+1],g=p?o+a-d:u[h+1]-d;if(g<=0)return null;var m=h%r.length;return de.createElement("rect",{key:"react-".concat(h),x:d,y:s,width:g,height:l,stroke:"none",fill:r[m],fillOpacity:i,className:"recharts-cartesian-grid-bg"})});return de.createElement("g",{className:"recharts-cartesian-gridstripes-vertical"},f)}var nzn=function(e,n){var r=e.xAxis,i=e.width,o=e.height,s=e.offset;return rqe(Ace(Gs(Gs(Gs({},hE.defaultProps),r),{},{ticks:eg(r,!0),viewBox:{x:0,y:0,width:i,height:o}})),s.left,s.left+s.width,n)},rzn=function(e,n){var r=e.yAxis,i=e.width,o=e.height,s=e.offset;return rqe(Ace(Gs(Gs(Gs({},hE.defaultProps),r),{},{ticks:eg(r,!0),viewBox:{x:0,y:0,width:i,height:o}})),s.top,s.top+s.height,n)},fw={horizontal:!0,vertical:!0,horizontalPoints:[],verticalPoints:[],stroke:"#ccc",fill:"none",verticalFill:[],horizontalFill:[]};function Mce(t){var e,n,r,i,o,s,a=Tce(),l=kce(),c=s5n(),u=Gs(Gs({},t),{},{stroke:(e=t.stroke)!==null&&e!==void 0?e:fw.stroke,fill:(n=t.fill)!==null&&n!==void 0?n:fw.fill,horizontal:(r=t.horizontal)!==null&&r!==void 0?r:fw.horizontal,horizontalFill:(i=t.horizontalFill)!==null&&i!==void 0?i:fw.horizontalFill,vertical:(o=t.vertical)!==null&&o!==void 0?o:fw.vertical,verticalFill:(s=t.verticalFill)!==null&&s!==void 0?s:fw.verticalFill,x:at(t.x)?t.x:c.left,y:at(t.y)?t.y:c.top,width:at(t.width)?t.width:c.width,height:at(t.height)?t.height:c.height}),f=u.x,d=u.y,h=u.width,p=u.height,g=u.syncWithTicks,m=u.horizontalValues,v=u.verticalValues,y=r5n(),x=i5n();if(!at(h)||h<=0||!at(p)||p<=0||!at(f)||f!==+f||!at(d)||d!==+d)return null;var b=u.verticalCoordinatesGenerator||nzn,w=u.horizontalCoordinatesGenerator||rzn,_=u.horizontalPoints,S=u.verticalPoints;if((!_||!_.length)&&mn(w)){var O=m&&m.length,k=w({yAxis:x?Gs(Gs({},x),{},{ticks:O?m:x.ticks}):void 0,width:a,height:l,offset:c},O?!0:g);vg(Array.isArray(k),"horizontalCoordinatesGenerator should return Array but instead it returned [".concat(B1(k),"]")),Array.isArray(k)&&(_=k)}if((!S||!S.length)&&mn(b)){var E=v&&v.length,M=b({xAxis:y?Gs(Gs({},y),{},{ticks:E?v:y.ticks}):void 0,width:a,height:l,offset:c},E?!0:g);vg(Array.isArray(M),"verticalCoordinatesGenerator should return Array but instead it returned [".concat(B1(M),"]")),Array.isArray(M)&&(S=M)}return de.createElement("g",{className:"recharts-cartesian-grid"},de.createElement(K5n,{fill:u.fill,fillOpacity:u.fillOpacity,x:u.x,y:u.y,width:u.width,height:u.height}),de.createElement(Z5n,bx({},u,{offset:c,horizontalPoints:_,xAxis:y,yAxis:x})),de.createElement(J5n,bx({},u,{offset:c,verticalPoints:S,xAxis:y,yAxis:x})),de.createElement(ezn,bx({},u,{horizontalPoints:_})),de.createElement(tzn,bx({},u,{verticalPoints:S})))}Mce.displayName="CartesianGrid";var izn=["type","layout","connectNulls","ref"];function LC(t){"@babel/helpers - typeof";return LC=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},LC(t)}function ozn(t,e){if(t==null)return{};var n=szn(t,e),r,i;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);for(i=0;i=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function szn(t,e){if(t==null)return{};var n={},r=Object.keys(t),i,o;for(o=0;o=0)&&(n[i]=t[i]);return n}function Rk(){return Rk=Object.assign?Object.assign.bind():function(t){for(var e=1;et.length)&&(e=t.length);for(var n=0,r=new Array(e);nf){h=[].concat(dw(l.slice(0,p)),[f-g]);break}var m=h.length%2===0?[0,d]:[d];return[].concat(dw(e.repeat(l,u)),dw(h),m).map(function(v){return"".concat(v,"px")}).join(", ")}),mf($m(n),"id",oE("recharts-line-")),mf($m(n),"pathRef",function(s){n.mainCurve=s}),mf($m(n),"handleAnimationEnd",function(){n.setState({isAnimationFinished:!0}),n.props.onAnimationEnd&&n.props.onAnimationEnd()}),mf($m(n),"handleAnimationStart",function(){n.setState({isAnimationFinished:!1}),n.props.onAnimationStart&&n.props.onAnimationStart()}),n}return dzn(e,[{key:"componentDidMount",value:function(){if(this.props.isAnimationActive){var r=this.getTotalLength();this.setState({totalLength:r})}}},{key:"componentDidUpdate",value:function(){if(this.props.isAnimationActive){var r=this.getTotalLength();r!==this.state.totalLength&&this.setState({totalLength:r})}}},{key:"getTotalLength",value:function(){var r=this.mainCurve;try{return r&&r.getTotalLength&&r.getTotalLength()||0}catch{return 0}}},{key:"renderErrorBar",value:function(r,i){if(this.props.isAnimationActive&&!this.state.isAnimationFinished)return null;var o=this.props,s=o.points,a=o.xAxis,l=o.yAxis,c=o.layout,u=o.children,f=yu(u,fE);if(!f)return null;var d=function(g,m){return{x:g.x,y:g.y,value:g.value,errorVal:Da(g.payload,m)}},h={clipPath:r?"url(#clipPath-".concat(i,")"):null};return de.createElement(Ur,h,f.map(function(p){return de.cloneElement(p,{key:"bar-".concat(p.props.dataKey),data:s,xAxis:a,yAxis:l,layout:c,dataPointFormatter:d})}))}},{key:"renderDots",value:function(r,i,o){var s=this.props.isAnimationActive;if(s&&!this.state.isAnimationFinished)return null;var a=this.props,l=a.dot,c=a.points,u=a.dataKey,f=pn(this.props,!1),d=pn(l,!0),h=c.map(function(g,m){var v=Wl(Wl(Wl({key:"dot-".concat(m),r:3},f),d),{},{value:g.value,dataKey:u,cx:g.x,cy:g.y,index:m,payload:g.payload});return e.renderDotItem(l,v)}),p={clipPath:r?"url(#clipPath-".concat(i?"":"dots-").concat(o,")"):null};return de.createElement(Ur,Rk({className:"recharts-line-dots",key:"dots"},p),h)}},{key:"renderCurveStatically",value:function(r,i,o,s){var a=this.props,l=a.type,c=a.layout,u=a.connectNulls;a.ref;var f=ozn(a,izn),d=Wl(Wl(Wl({},pn(f,!0)),{},{fill:"none",className:"recharts-line-curve",clipPath:i?"url(#clipPath-".concat(o,")"):null,points:r},s),{},{type:l,layout:c,connectNulls:u});return de.createElement(iS,Rk({},d,{pathRef:this.pathRef}))}},{key:"renderCurveWithAnimation",value:function(r,i){var o=this,s=this.props,a=s.points,l=s.strokeDasharray,c=s.isAnimationActive,u=s.animationBegin,f=s.animationDuration,d=s.animationEasing,h=s.animationId,p=s.animateNewValues,g=s.width,m=s.height,v=this.state,y=v.prevPoints,x=v.totalLength;return de.createElement(Fh,{begin:u,duration:f,isActive:c,easing:d,from:{t:0},to:{t:1},key:"line-".concat(h),onAnimationEnd:this.handleAnimationEnd,onAnimationStart:this.handleAnimationStart},function(b){var w=b.t;if(y){var _=y.length/a.length,S=a.map(function(A,P){var T=Math.floor(P*_);if(y[T]){var R=y[T],I=ls(R.x,A.x),B=ls(R.y,A.y);return Wl(Wl({},A),{},{x:I(w),y:B(w)})}if(p){var $=ls(g*2,A.x),z=ls(m/2,A.y);return Wl(Wl({},A),{},{x:$(w),y:z(w)})}return Wl(Wl({},A),{},{x:A.x,y:A.y})});return o.renderCurveStatically(S,r,i)}var O=ls(0,x),k=O(w),E;if(l){var M="".concat(l).split(/[,\s]+/gim).map(function(A){return parseFloat(A)});E=o.getStrokeDasharray(k,x,M)}else E=o.generateSimpleStrokeDasharray(x,k);return o.renderCurveStatically(a,r,i,{strokeDasharray:E})})}},{key:"renderCurve",value:function(r,i){var o=this.props,s=o.points,a=o.isAnimationActive,l=this.state,c=l.prevPoints,u=l.totalLength;return a&&s&&s.length&&(!c&&u>0||!PC(c,s))?this.renderCurveWithAnimation(r,i):this.renderCurveStatically(s,r,i)}},{key:"render",value:function(){var r,i=this.props,o=i.hide,s=i.dot,a=i.points,l=i.className,c=i.xAxis,u=i.yAxis,f=i.top,d=i.left,h=i.width,p=i.height,g=i.isAnimationActive,m=i.id;if(o||!a||!a.length)return null;var v=this.state.isAnimationFinished,y=a.length===1,x=Oe("recharts-line",l),b=c&&c.allowDataOverflow,w=u&&u.allowDataOverflow,_=b||w,S=_n(m)?this.id:m,O=(r=pn(s,!1))!==null&&r!==void 0?r:{r:3,strokeWidth:2},k=O.r,E=k===void 0?3:k,M=O.strokeWidth,A=M===void 0?2:M,P=GGe(s)?s:{},T=P.clipDot,R=T===void 0?!0:T,I=E*2+A;return de.createElement(Ur,{className:x},b||w?de.createElement("defs",null,de.createElement("clipPath",{id:"clipPath-".concat(S)},de.createElement("rect",{x:b?d:d-h/2,y:w?f:f-p/2,width:b?h:h*2,height:w?p:p*2})),!R&&de.createElement("clipPath",{id:"clipPath-dots-".concat(S)},de.createElement("rect",{x:d-I/2,y:f-I/2,width:h+I,height:p+I}))):null,!y&&this.renderCurve(_,S),this.renderErrorBar(_,S),(y||s)&&this.renderDots(_,R,S),(!g||v)&&xg.renderCallByParent(this.props,a))}}],[{key:"getDerivedStateFromProps",value:function(r,i){return r.animationId!==i.prevAnimationId?{prevAnimationId:r.animationId,curPoints:r.points,prevPoints:i.curPoints}:r.points!==i.curPoints?{curPoints:r.points}:null}},{key:"repeat",value:function(r,i){for(var o=r.length%2!==0?[].concat(dw(r),[0]):r,s=[],a=0;a=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function xzn(t,e){if(t==null)return{};var n={},r=Object.keys(t),i,o;for(o=0;o=0)&&(n[i]=t[i]);return n}function wx(){return wx=Object.assign?Object.assign.bind():function(t){for(var e=1;e0||!PC(u,s)||!PC(f,a))?this.renderAreaWithAnimation(r,i):this.renderAreaStatically(s,a,r,i)}},{key:"render",value:function(){var r,i=this.props,o=i.hide,s=i.dot,a=i.points,l=i.className,c=i.top,u=i.left,f=i.xAxis,d=i.yAxis,h=i.width,p=i.height,g=i.isAnimationActive,m=i.id;if(o||!a||!a.length)return null;var v=this.state.isAnimationFinished,y=a.length===1,x=Oe("recharts-area",l),b=f&&f.allowDataOverflow,w=d&&d.allowDataOverflow,_=b||w,S=_n(m)?this.id:m,O=(r=pn(s,!1))!==null&&r!==void 0?r:{r:3,strokeWidth:2},k=O.r,E=k===void 0?3:k,M=O.strokeWidth,A=M===void 0?2:M,P=GGe(s)?s:{},T=P.clipDot,R=T===void 0?!0:T,I=E*2+A;return de.createElement(Ur,{className:x},b||w?de.createElement("defs",null,de.createElement("clipPath",{id:"clipPath-".concat(S)},de.createElement("rect",{x:b?u:u-h/2,y:w?c:c-p/2,width:b?h:h*2,height:w?p:p*2})),!R&&de.createElement("clipPath",{id:"clipPath-dots-".concat(S)},de.createElement("rect",{x:u-I/2,y:c-I/2,width:h+I,height:p+I}))):null,y?null:this.renderArea(_,S),(s||y)&&this.renderDots(_,R,S),(!g||v)&&xg.renderCallByParent(this.props,a))}}],[{key:"getDerivedStateFromProps",value:function(r,i){return r.animationId!==i.prevAnimationId?{prevAnimationId:r.animationId,curPoints:r.points,curBaseLine:r.baseLine,prevPoints:i.curPoints,prevBaseLine:i.curBaseLine}:r.points!==i.curPoints||r.baseLine!==i.curBaseLine?{curPoints:r.points,curBaseLine:r.baseLine}:null}}]),e}(D.PureComponent);Uqe=a0;oh(a0,"displayName","Area");oh(a0,"defaultProps",{stroke:"#3182bd",fill:"#3182bd",fillOpacity:.6,xAxisId:0,yAxisId:0,legendType:"line",connectNulls:!1,points:[],dot:!1,activeDot:!0,hide:!1,isAnimationActive:!_h.isSsr,animationBegin:0,animationDuration:1500,animationEasing:"ease"});oh(a0,"getBaseValue",function(t,e,n,r){var i=t.layout,o=t.baseValue,s=e.props.baseValue,a=s??o;if(at(a)&&typeof a=="number")return a;var l=i==="horizontal"?r:n,c=l.scale.domain();if(l.type==="number"){var u=Math.max(c[0],c[1]),f=Math.min(c[0],c[1]);return a==="dataMin"?f:a==="dataMax"||u<0?u:Math.max(Math.min(c[0],c[1]),0)}return a==="dataMin"?c[0]:a==="dataMax"?c[1]:c[0]});oh(a0,"getComposedData",function(t){var e=t.props,n=t.item,r=t.xAxis,i=t.yAxis,o=t.xAxisTicks,s=t.yAxisTicks,a=t.bandSize,l=t.dataKey,c=t.stackedData,u=t.dataStartIndex,f=t.displayedData,d=t.offset,h=e.layout,p=c&&c.length,g=Uqe.getBaseValue(e,n,r,i),m=h==="horizontal",v=!1,y=f.map(function(b,w){var _;p?_=c[u+w]:(_=Da(b,l),Array.isArray(_)?v=!0:_=[g,_]);var S=_[1]==null||p&&Da(b,l)==null;return m?{x:jz({axis:r,ticks:o,bandSize:a,entry:b,index:w}),y:S?null:i.scale(_[1]),value:_,payload:b}:{x:S?null:r.scale(_[1]),y:jz({axis:i,ticks:s,bandSize:a,entry:b,index:w}),value:_,payload:b}}),x;return p||v?x=y.map(function(b){var w=Array.isArray(b.value)?b.value[0]:null;return m?{x:b.x,y:w!=null&&b.y!=null?i.scale(w):null}:{x:w!=null?r.scale(w):null,y:b.y}}):x=m?i.scale(g):r.scale(g),Fm({points:y,baseLine:x,layout:h,isRange:v},d)});oh(a0,"renderDotItem",function(t,e){var n;if(de.isValidElement(t))n=de.cloneElement(t,e);else if(mn(t))n=t(e);else{var r=Oe("recharts-area-dot",typeof t!="boolean"?t.className:"");n=de.createElement(ZU,wx({},e,{className:r}))}return n});function OZ(){return OZ=Object.assign?Object.assign.bind():function(t){for(var e=1;et.length)&&(e=t.length);for(var n=0,r=new Array(e);n=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function Yzn(t,e){if(t==null)return{};var n={},r=Object.keys(t),i,o;for(o=0;o=0)&&(n[i]=t[i]);return n}function Qzn(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Kzn(t,e){for(var n=0;nt.length)&&(e=t.length);for(var n=0,r=new Array(e);n0?s:e&&e.length&&at(i)&&at(o)?e.slice(i,o+1):[]};function Zqe(t){return t==="number"?[0,"auto"]:void 0}var MZ=function(e,n,r,i){var o=e.graphicalItems,s=e.tooltipAxis,a=n8(n,e);return r<0||!o||!o.length||r>=a.length?null:o.reduce(function(l,c){var u,f=(u=c.props.data)!==null&&u!==void 0?u:n;f&&e.dataStartIndex+e.dataEndIndex!==0&&(f=f.slice(e.dataStartIndex,e.dataEndIndex+1));var d;if(s.dataKey&&!s.allowDuplicatedCategory){var h=f===void 0?a:f;d=Ez(h,s.dataKey,i)}else d=f&&f[r]||a[r];return d?[].concat(NC(l),[oqe(c,d)]):l},[])},ICe=function(e,n,r,i){var o=i||{x:e.chartX,y:e.chartY},s=ljn(o,r),a=e.orderedTooltipTicks,l=e.tooltipAxis,c=e.tooltipTicks,u=pIn(s,a,c,l);if(u>=0&&c){var f=c[u]&&c[u].value,d=MZ(e,n,u,f),h=cjn(r,a,u,o);return{activeTooltipIndex:u,activeLabel:f,activePayload:d,activeCoordinate:h}}return null},ujn=function(e,n){var r=n.axes,i=n.graphicalItems,o=n.axisType,s=n.axisIdKey,a=n.stackGroups,l=n.dataStartIndex,c=n.dataEndIndex,u=e.layout,f=e.children,d=e.stackOffset,h=nqe(u,o);return r.reduce(function(p,g){var m,v=g.props,y=v.type,x=v.dataKey,b=v.allowDataOverflow,w=v.allowDuplicatedCategory,_=v.scale,S=v.ticks,O=v.includeHidden,k=g.props[s];if(p[k])return p;var E=n8(e.data,{graphicalItems:i.filter(function(N){return N.props[s]===k}),dataStartIndex:l,dataEndIndex:c}),M=E.length,A,P,T;Fzn(g.props.domain,b,y)&&(A=JK(g.props.domain,null,b),h&&(y==="number"||_!=="auto")&&(T=Pk(E,x,"category")));var R=Zqe(y);if(!A||A.length===0){var I,B=(I=g.props.domain)!==null&&I!==void 0?I:R;if(x){if(A=Pk(E,x,y),y==="category"&&h){var $=xSn(A);w&&$?(P=A,A=Qz(0,M)):w||(A=fSe(B,A,g).reduce(function(N,F){return N.indexOf(F)>=0?N:[].concat(NC(N),[F])},[]))}else if(y==="category")w?A=A.filter(function(N){return N!==""&&!_n(N)}):A=fSe(B,A,g).reduce(function(N,F){return N.indexOf(F)>=0||F===""||_n(F)?N:[].concat(NC(N),[F])},[]);else if(y==="number"){var z=xIn(E,i.filter(function(N){return N.props[s]===k&&(O||!N.props.hide)}),x,o,u);z&&(A=z)}h&&(y==="number"||_!=="auto")&&(T=Pk(E,x,"category"))}else h?A=Qz(0,M):a&&a[k]&&a[k].hasStack&&y==="number"?A=d==="expand"?[0,1]:iqe(a[k].stackGroups,l,c):A=tqe(E,i.filter(function(N){return N.props[s]===k&&(O||!N.props.hide)}),y,u,!0);if(y==="number")A=kZ(f,A,k,o,S),B&&(A=JK(B,A,b));else if(y==="category"&&B){var L=B,j=A.every(function(N){return L.indexOf(N)>=0});j&&(A=L)}}return Ge(Ge({},p),{},Yt({},k,Ge(Ge({},g.props),{},{axisType:o,domain:A,categoricalDomain:T,duplicateDomain:P,originalDomain:(m=g.props.domain)!==null&&m!==void 0?m:R,isCategorical:h,layout:u})))},{})},fjn=function(e,n){var r=n.graphicalItems,i=n.Axis,o=n.axisType,s=n.axisIdKey,a=n.stackGroups,l=n.dataStartIndex,c=n.dataEndIndex,u=e.layout,f=e.children,d=n8(e.data,{graphicalItems:r,dataStartIndex:l,dataEndIndex:c}),h=d.length,p=nqe(u,o),g=-1;return r.reduce(function(m,v){var y=v.props[s],x=Zqe("number");if(!m[y]){g++;var b;return p?b=Qz(0,h):a&&a[y]&&a[y].hasStack?(b=iqe(a[y].stackGroups,l,c),b=kZ(f,b,y,o)):(b=JK(x,tqe(d,r.filter(function(w){return w.props[s]===y&&!w.props.hide}),"number",u),i.defaultProps.allowDataOverflow),b=kZ(f,b,y,o)),Ge(Ge({},m),{},Yt({},y,Ge(Ge({axisType:o},i.defaultProps),{},{hide:!0,orientation:vu(sjn,"".concat(o,".").concat(g%2),null),domain:b,originalDomain:x,isCategorical:p,layout:u})))}return m},{})},djn=function(e,n){var r=n.axisType,i=r===void 0?"xAxis":r,o=n.AxisComp,s=n.graphicalItems,a=n.stackGroups,l=n.dataStartIndex,c=n.dataEndIndex,u=e.children,f="".concat(i,"Id"),d=yu(u,o),h={};return d&&d.length?h=ujn(e,{axes:d,graphicalItems:s,axisType:i,axisIdKey:f,stackGroups:a,dataStartIndex:l,dataEndIndex:c}):s&&s.length&&(h=fjn(e,{Axis:o,graphicalItems:s,axisType:i,axisIdKey:f,stackGroups:a,dataStartIndex:l,dataEndIndex:c})),h},hjn=function(e){var n=sv(e),r=eg(n,!1,!0);return{tooltipTicks:r,orderedTooltipTicks:vce(r,function(i){return i.coordinate}),tooltipAxis:n,tooltipAxisBandSize:Bz(n,r)}},LCe=function(e){var n=e.children,r=e.defaultShowTooltip,i=Kl(n,j1),o=0,s=0;return e.data&&e.data.length!==0&&(s=e.data.length-1),i&&i.props&&(i.props.startIndex>=0&&(o=i.props.startIndex),i.props.endIndex>=0&&(s=i.props.endIndex)),{chartX:0,chartY:0,dataStartIndex:o,dataEndIndex:s,activeTooltipIndex:-1,isTooltipActive:!!r}},pjn=function(e){return!e||!e.length?!1:e.some(function(n){var r=mg(n&&n.type);return r&&r.indexOf("Bar")>=0})},$Ce=function(e){return e==="horizontal"?{numericAxisName:"yAxis",cateAxisName:"xAxis"}:e==="vertical"?{numericAxisName:"xAxis",cateAxisName:"yAxis"}:e==="centric"?{numericAxisName:"radiusAxis",cateAxisName:"angleAxis"}:{numericAxisName:"angleAxis",cateAxisName:"radiusAxis"}},gjn=function(e,n){var r=e.props,i=e.graphicalItems,o=e.xAxisMap,s=o===void 0?{}:o,a=e.yAxisMap,l=a===void 0?{}:a,c=r.width,u=r.height,f=r.children,d=r.margin||{},h=Kl(f,j1),p=Kl(f,TC),g=Object.keys(l).reduce(function(w,_){var S=l[_],O=S.orientation;return!S.mirror&&!S.hide?Ge(Ge({},w),{},Yt({},O,w[O]+S.width)):w},{left:d.left||0,right:d.right||0}),m=Object.keys(s).reduce(function(w,_){var S=s[_],O=S.orientation;return!S.mirror&&!S.hide?Ge(Ge({},w),{},Yt({},O,vu(w,"".concat(O))+S.height)):w},{top:d.top||0,bottom:d.bottom||0}),v=Ge(Ge({},m),g),y=v.bottom;h&&(v.bottom+=h.props.height||j1.defaultProps.height),p&&n&&(v=vIn(v,i,r,n));var x=c-v.left-v.right,b=u-v.top-v.bottom;return Ge(Ge({brushBottom:y},v),{},{width:Math.max(x,0),height:Math.max(b,0)})},mjn=function(e,n){if(n==="xAxis")return e[n].width;if(n==="yAxis")return e[n].height},Rce=function(e){var n,r=e.chartName,i=e.GraphicalChild,o=e.defaultTooltipEventType,s=o===void 0?"axis":o,a=e.validateTooltipEventTypes,l=a===void 0?["axis"]:a,c=e.axisComponents,u=e.legendContent,f=e.formatAxisMap,d=e.defaultProps,h=function(m,v){var y=v.graphicalItems,x=v.stackGroups,b=v.offset,w=v.updateId,_=v.dataStartIndex,S=v.dataEndIndex,O=m.barSize,k=m.layout,E=m.barGap,M=m.barCategoryGap,A=m.maxBarSize,P=$Ce(k),T=P.numericAxisName,R=P.cateAxisName,I=pjn(y),B=[];return y.forEach(function($,z){var L=n8(m.data,{graphicalItems:[$],dataStartIndex:_,dataEndIndex:S}),j=$.props,N=j.dataKey,F=j.maxBarSize,H=$.props["".concat(T,"Id")],q=$.props["".concat(R,"Id")],Y={},le=c.reduce(function(he,xe){var G=v["".concat(xe.axisType,"Map")],W=$.props["".concat(xe.axisType,"Id")];G&&G[W]||xe.axisType==="zAxis"||z1();var J=G[W];return Ge(Ge({},he),{},Yt(Yt({},xe.axisType,J),"".concat(xe.axisType,"Ticks"),eg(J)))},Y),K=le[R],ee=le["".concat(R,"Ticks")],re=x&&x[H]&&x[H].hasStack&&MIn($,x[H].stackGroups),me=mg($.type).indexOf("Bar")>=0,te=Bz(K,ee),ae=[],U=I&&gIn({barSize:O,stackGroups:x,totalSize:mjn(le,R)});if(me){var oe,ne,V=_n(F)?A:F,X=(oe=(ne=Bz(K,ee,!0))!==null&&ne!==void 0?ne:V)!==null&&oe!==void 0?oe:0;ae=mIn({barGap:E,barCategoryGap:M,bandSize:X!==te?X:te,sizeList:U[q],maxBarSize:V}),X!==te&&(ae=ae.map(function(he){return Ge(Ge({},he),{},{position:Ge(Ge({},he.position),{},{offset:he.position.offset-X/2})})}))}var Z=$&&$.type&&$.type.getComposedData;Z&&B.push({props:Ge(Ge({},Z(Ge(Ge({},le),{},{displayedData:L,props:m,dataKey:N,item:$,bandSize:te,barPosition:ae,offset:b,stackedData:re,layout:k,dataStartIndex:_,dataEndIndex:S}))),{},Yt(Yt(Yt({key:$.key||"item-".concat(z)},T,le[T]),R,le[R]),"animationId",w)),childIndex:PSn($,m.children),item:$})}),B},p=function(m,v){var y=m.props,x=m.dataStartIndex,b=m.dataEndIndex,w=m.updateId;if(!Hwe({props:y}))return null;var _=y.children,S=y.layout,O=y.stackOffset,k=y.data,E=y.reverseStackOrder,M=$Ce(S),A=M.numericAxisName,P=M.cateAxisName,T=yu(_,i),R=kIn(k,T,"".concat(A,"Id"),"".concat(P,"Id"),O,E),I=c.reduce(function(j,N){var F="".concat(N.axisType,"Map");return Ge(Ge({},j),{},Yt({},F,djn(y,Ge(Ge({},N),{},{graphicalItems:T,stackGroups:N.axisType===A&&R,dataStartIndex:x,dataEndIndex:b}))))},{}),B=gjn(Ge(Ge({},I),{},{props:y,graphicalItems:T}),v==null?void 0:v.legendBBox);Object.keys(I).forEach(function(j){I[j]=f(y,I[j],B,j.replace("Map",""),r)});var $=I["".concat(P,"Map")],z=hjn($),L=h(y,Ge(Ge({},I),{},{dataStartIndex:x,dataEndIndex:b,updateId:w,graphicalItems:T,stackGroups:R,offset:B}));return Ge(Ge({formattedGraphicalItems:L,graphicalItems:T,offset:B,stackGroups:R},z),I)};return n=function(g){tjn(m,g);function m(v){var y,x,b;return Qzn(this,m),b=Jzn(this,m,[v]),Yt(Wn(b),"eventEmitterSymbol",Symbol("rechartsEventEmitter")),Yt(Wn(b),"accessibilityManager",new $zn),Yt(Wn(b),"handleLegendBBoxUpdate",function(w){if(w){var _=b.state,S=_.dataStartIndex,O=_.dataEndIndex,k=_.updateId;b.setState(Ge({legendBBox:w},p({props:b.props,dataStartIndex:S,dataEndIndex:O,updateId:k},Ge(Ge({},b.state),{},{legendBBox:w}))))}}),Yt(Wn(b),"handleReceiveSyncEvent",function(w,_,S){if(b.props.syncId===w){if(S===b.eventEmitterSymbol&&typeof b.props.syncMethod!="function")return;b.applySyncEvent(_)}}),Yt(Wn(b),"handleBrushChange",function(w){var _=w.startIndex,S=w.endIndex;if(_!==b.state.dataStartIndex||S!==b.state.dataEndIndex){var O=b.state.updateId;b.setState(function(){return Ge({dataStartIndex:_,dataEndIndex:S},p({props:b.props,dataStartIndex:_,dataEndIndex:S,updateId:O},b.state))}),b.triggerSyncEvent({dataStartIndex:_,dataEndIndex:S})}}),Yt(Wn(b),"handleMouseEnter",function(w){var _=b.getMouseInfo(w);if(_){var S=Ge(Ge({},_),{},{isTooltipActive:!0});b.setState(S),b.triggerSyncEvent(S);var O=b.props.onMouseEnter;mn(O)&&O(S,w)}}),Yt(Wn(b),"triggeredAfterMouseMove",function(w){var _=b.getMouseInfo(w),S=_?Ge(Ge({},_),{},{isTooltipActive:!0}):{isTooltipActive:!1};b.setState(S),b.triggerSyncEvent(S);var O=b.props.onMouseMove;mn(O)&&O(S,w)}),Yt(Wn(b),"handleItemMouseEnter",function(w){b.setState(function(){return{isTooltipActive:!0,activeItem:w,activePayload:w.tooltipPayload,activeCoordinate:w.tooltipPosition||{x:w.cx,y:w.cy}}})}),Yt(Wn(b),"handleItemMouseLeave",function(){b.setState(function(){return{isTooltipActive:!1}})}),Yt(Wn(b),"handleMouseMove",function(w){w.persist(),b.throttleTriggeredAfterMouseMove(w)}),Yt(Wn(b),"handleMouseLeave",function(w){b.throttleTriggeredAfterMouseMove.cancel();var _={isTooltipActive:!1};b.setState(_),b.triggerSyncEvent(_);var S=b.props.onMouseLeave;mn(S)&&S(_,w)}),Yt(Wn(b),"handleOuterEvent",function(w){var _=ASn(w),S=vu(b.props,"".concat(_));if(_&&mn(S)){var O,k;/.*touch.*/i.test(_)?k=b.getMouseInfo(w.changedTouches[0]):k=b.getMouseInfo(w),S((O=k)!==null&&O!==void 0?O:{},w)}}),Yt(Wn(b),"handleClick",function(w){var _=b.getMouseInfo(w);if(_){var S=Ge(Ge({},_),{},{isTooltipActive:!0});b.setState(S),b.triggerSyncEvent(S);var O=b.props.onClick;mn(O)&&O(S,w)}}),Yt(Wn(b),"handleMouseDown",function(w){var _=b.props.onMouseDown;if(mn(_)){var S=b.getMouseInfo(w);_(S,w)}}),Yt(Wn(b),"handleMouseUp",function(w){var _=b.props.onMouseUp;if(mn(_)){var S=b.getMouseInfo(w);_(S,w)}}),Yt(Wn(b),"handleTouchMove",function(w){w.changedTouches!=null&&w.changedTouches.length>0&&b.throttleTriggeredAfterMouseMove(w.changedTouches[0])}),Yt(Wn(b),"handleTouchStart",function(w){w.changedTouches!=null&&w.changedTouches.length>0&&b.handleMouseDown(w.changedTouches[0])}),Yt(Wn(b),"handleTouchEnd",function(w){w.changedTouches!=null&&w.changedTouches.length>0&&b.handleMouseUp(w.changedTouches[0])}),Yt(Wn(b),"triggerSyncEvent",function(w){b.props.syncId!==void 0&&L7.emit($7,b.props.syncId,w,b.eventEmitterSymbol)}),Yt(Wn(b),"applySyncEvent",function(w){var _=b.props,S=_.layout,O=_.syncMethod,k=b.state.updateId,E=w.dataStartIndex,M=w.dataEndIndex;if(w.dataStartIndex!==void 0||w.dataEndIndex!==void 0)b.setState(Ge({dataStartIndex:E,dataEndIndex:M},p({props:b.props,dataStartIndex:E,dataEndIndex:M,updateId:k},b.state)));else if(w.activeTooltipIndex!==void 0){var A=w.chartX,P=w.chartY,T=w.activeTooltipIndex,R=b.state,I=R.offset,B=R.tooltipTicks;if(!I)return;if(typeof O=="function")T=O(B,w);else if(O==="value"){T=-1;for(var $=0;$=0){var re,me;if(A.dataKey&&!A.allowDuplicatedCategory){var te=typeof A.dataKey=="function"?ee:"payload.".concat(A.dataKey.toString());re=Ez($,te,T),me=z&&L&&Ez(L,te,T)}else re=$==null?void 0:$[P],me=z&&L&&L[P];if(q||H){var ae=w.props.activeIndex!==void 0?w.props.activeIndex:P;return[D.cloneElement(w,Ge(Ge(Ge({},O.props),le),{},{activeIndex:ae})),null,null]}if(!_n(re))return[K].concat(NC(b.renderActivePoints({item:O,activePoint:re,basePoint:me,childIndex:P,isRange:z})))}else{var U,oe=(U=b.getItemByXY(b.state.activeCoordinate))!==null&&U!==void 0?U:{graphicalItem:K},ne=oe.graphicalItem,V=ne.item,X=V===void 0?w:V,Z=ne.childIndex,he=Ge(Ge(Ge({},O.props),le),{},{activeIndex:Z});return[D.cloneElement(X,he),null,null]}return z?[K,null,null]:[K,null]}),Yt(Wn(b),"renderCustomized",function(w,_,S){return D.cloneElement(w,Ge(Ge({key:"recharts-customized-".concat(S)},b.props),b.state))}),Yt(Wn(b),"renderMap",{CartesianGrid:{handler:o$,once:!0},ReferenceArea:{handler:b.renderReferenceElement},ReferenceLine:{handler:o$},ReferenceDot:{handler:b.renderReferenceElement},XAxis:{handler:o$},YAxis:{handler:o$},Brush:{handler:b.renderBrush,once:!0},Bar:{handler:b.renderGraphicChild},Line:{handler:b.renderGraphicChild},Area:{handler:b.renderGraphicChild},Radar:{handler:b.renderGraphicChild},RadialBar:{handler:b.renderGraphicChild},Scatter:{handler:b.renderGraphicChild},Pie:{handler:b.renderGraphicChild},Funnel:{handler:b.renderGraphicChild},Tooltip:{handler:b.renderCursor,once:!0},PolarGrid:{handler:b.renderPolarGrid,once:!0},PolarAngleAxis:{handler:b.renderPolarAxis},PolarRadiusAxis:{handler:b.renderPolarAxis},Customized:{handler:b.renderCustomized}}),b.clipPathId="".concat((y=v.id)!==null&&y!==void 0?y:oE("recharts"),"-clip"),b.throttleTriggeredAfterMouseMove=DHe(b.triggeredAfterMouseMove,(x=v.throttleDelay)!==null&&x!==void 0?x:1e3/60),b.state={},b}return Zzn(m,[{key:"componentDidMount",value:function(){var y,x;this.addListener(),this.accessibilityManager.setDetails({container:this.container,offset:{left:(y=this.props.margin.left)!==null&&y!==void 0?y:0,top:(x=this.props.margin.top)!==null&&x!==void 0?x:0},coordinateList:this.state.tooltipTicks,mouseHandlerCallback:this.triggeredAfterMouseMove,layout:this.props.layout}),this.displayDefaultTooltip()}},{key:"displayDefaultTooltip",value:function(){var y=this.props,x=y.children,b=y.data,w=y.height,_=y.layout,S=Kl(x,Rd);if(S){var O=S.props.defaultIndex;if(!(typeof O!="number"||O<0||O>this.state.tooltipTicks.length)){var k=this.state.tooltipTicks[O]&&this.state.tooltipTicks[O].value,E=MZ(this.state,b,O,k),M=this.state.tooltipTicks[O].coordinate,A=(this.state.offset.top+w)/2,P=_==="horizontal",T=P?{x:M,y:A}:{y:M,x:A},R=this.state.formattedGraphicalItems.find(function(B){var $=B.item;return $.type.name==="Scatter"});R&&(T=Ge(Ge({},T),R.props.points[O].tooltipPosition),E=R.props.points[O].tooltipPayload);var I={activeTooltipIndex:O,isTooltipActive:!0,activeLabel:k,activePayload:E,activeCoordinate:T};this.setState(I),this.renderCursor(S),this.accessibilityManager.setIndex(O)}}}},{key:"getSnapshotBeforeUpdate",value:function(y,x){if(!this.props.accessibilityLayer)return null;if(this.state.tooltipTicks!==x.tooltipTicks&&this.accessibilityManager.setDetails({coordinateList:this.state.tooltipTicks}),this.props.layout!==y.layout&&this.accessibilityManager.setDetails({layout:this.props.layout}),this.props.margin!==y.margin){var b,w;this.accessibilityManager.setDetails({offset:{left:(b=this.props.margin.left)!==null&&b!==void 0?b:0,top:(w=this.props.margin.top)!==null&&w!==void 0?w:0}})}return null}},{key:"componentDidUpdate",value:function(y){OK([Kl(y.children,Rd)],[Kl(this.props.children,Rd)])||this.displayDefaultTooltip()}},{key:"componentWillUnmount",value:function(){this.removeListener(),this.throttleTriggeredAfterMouseMove.cancel()}},{key:"getTooltipEventType",value:function(){var y=Kl(this.props.children,Rd);if(y&&typeof y.props.shared=="boolean"){var x=y.props.shared?"axis":"item";return l.indexOf(x)>=0?x:s}return s}},{key:"getMouseInfo",value:function(y){if(!this.container)return null;var x=this.container,b=x.getBoundingClientRect(),w=wRn(b),_={chartX:Math.round(y.pageX-w.left),chartY:Math.round(y.pageY-w.top)},S=b.width/x.offsetWidth||1,O=this.inRange(_.chartX,_.chartY,S);if(!O)return null;var k=this.state,E=k.xAxisMap,M=k.yAxisMap,A=this.getTooltipEventType();if(A!=="axis"&&E&&M){var P=sv(E).scale,T=sv(M).scale,R=P&&P.invert?P.invert(_.chartX):null,I=T&&T.invert?T.invert(_.chartY):null;return Ge(Ge({},_),{},{xValue:R,yValue:I})}var B=ICe(this.state,this.props.data,this.props.layout,O);return B?Ge(Ge({},_),B):null}},{key:"inRange",value:function(y,x){var b=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,w=this.props.layout,_=y/b,S=x/b;if(w==="horizontal"||w==="vertical"){var O=this.state.offset,k=_>=O.left&&_<=O.left+O.width&&S>=O.top&&S<=O.top+O.height;return k?{x:_,y:S}:null}var E=this.state,M=E.angleAxisMap,A=E.radiusAxisMap;if(M&&A){var P=sv(M);return pSe({x:_,y:S},P)}return null}},{key:"parseEventsOfWrapper",value:function(){var y=this.props.children,x=this.getTooltipEventType(),b=Kl(y,Rd),w={};b&&x==="axis"&&(b.props.trigger==="click"?w={onClick:this.handleClick}:w={onMouseEnter:this.handleMouseEnter,onMouseMove:this.handleMouseMove,onMouseLeave:this.handleMouseLeave,onTouchMove:this.handleTouchMove,onTouchStart:this.handleTouchStart,onTouchEnd:this.handleTouchEnd});var _=Tz(this.props,this.handleOuterEvent);return Ge(Ge({},_),w)}},{key:"addListener",value:function(){L7.on($7,this.handleReceiveSyncEvent)}},{key:"removeListener",value:function(){L7.removeListener($7,this.handleReceiveSyncEvent)}},{key:"filterFormatItem",value:function(y,x,b){for(var w=this.state.formattedGraphicalItems,_=0,S=w.length;_!vr(t)||!Number.isFinite(t)?"":bA(t),wjn=t=>t.toPrecision(3),N7={legendContainer:{display:"flex",justifyContent:"center",columnGap:"12px",flexWrap:"wrap"},legendItem:{display:"flex",alignItems:"center"},legendCloseIcon:{marginLeft:"4px",cursor:"pointer",display:"flex",alignItems:"center"}};function _jn({payload:t,removeTimeSeries:e}){return!t||t.length===0?null:C.jsx(ot,{sx:N7.legendContainer,children:t.map((n,r)=>C.jsxs(ot,{sx:{...N7.legendItem,color:n.color},children:[C.jsx("span",{children:n.value}),e&&C.jsx(ot,{component:"span",sx:N7.legendCloseIcon,onMouseUp:()=>e(r),children:C.jsx(vU,{fontSize:"small"})})]},n.value))})}const z7={toolTipContainer:t=>({backgroundColor:"black",opacity:.8,color:"white",border:"2px solid black",borderRadius:t.spacing(2),padding:t.spacing(1.5)}),toolTipValue:{fontWeight:"bold"},toolTipLabel:t=>({fontWeight:"bold",paddingBottom:t.spacing(1)})},Sjn="#00000000",Cjn="#FAFFDD";function Ojn({active:t,label:e,payload:n}){if(!t||!vr(e)||!n||n.length===0)return null;const r=n.map((i,o)=>{const{name:s,value:a,unit:l,dataKey:c}=i;let u=i.color;if(!vr(a))return null;const f=s||"?",d=a.toFixed(3);u===Sjn&&(u=Cjn);let p=f.indexOf(":")!==-1?"":` (${c})`;return typeof l=="string"&&(p!==""?p=`${l} ${p}`:p=l),C.jsxs("div",{children:[C.jsxs("span",{children:[f,": "]}),C.jsx(ot,{component:"span",sx:z7.toolTipValue,style:{color:u},children:d}),C.jsxs("span",{children:[" ",p]})]},o)});return r?C.jsxs(ot,{sx:z7.toolTipContainer,children:[C.jsx(ot,{component:"span",sx:z7.toolTipLabel,children:`${lO(e)} UTC`}),r]}):null}function FCe({cx:t,cy:e,radius:n,stroke:r,fill:i,strokeWidth:o,symbol:s}){const l=n+.5*o,c=2*l,u=Math.floor(100*o/c+.5)+"%";let f;if(s==="diamond"){const g=1024*(n/c);f=C.jsx("polygon",{points:`${512-g},512 512,${512-g} ${512+g},512 512,${512+g}`,strokeWidth:u,stroke:r,fill:i})}else{const d=Math.floor(100*n/c+.5)+"%";f=C.jsx("circle",{cx:"50%",cy:"50%",r:d,strokeWidth:u,stroke:r,fill:i})}return vr(t)&&vr(e)?C.jsx("svg",{x:t-l,y:e-l,width:c,height:c,viewBox:"0 0 1024 1024",children:f}):null}function Ejn({timeSeriesGroup:t,timeSeriesIndex:e,selectTimeSeries:n,places:r,selectPlace:i,placeInfos:o,placeGroupTimeSeries:s,paletteMode:a,chartType:l,stdevBars:c}){const u=t.timeSeriesArray[e],f=u.source,d=()=>{n&&n(t.id,e,u),i(u.source.placeId,r,!0)};let h=f.variableName,p="red";if(f.placeId===null){h=`${f.datasetTitle}/${h}`;let x=null;s.forEach(b=>{if(x===null&&b.placeGroup.id===f.datasetId){const w=b.placeGroup.features;w.length>0&&w[0].properties&&(x=w[0].properties.color||null)}}),p=x||"red"}else if(o){const x=o[f.placeId];if(x){const{place:b,label:w,color:_}=x;if(b.geometry.type==="Point"){const S=b.geometry.coordinates[0],O=b.geometry.coordinates[1];h+=` (${w}: ${O.toFixed(5)},${S.toFixed(5)})`}else h+=` (${w})`;p=_}}const g=sPe(p,a);let m,v;u.source.placeId===null?(m=0,v={radius:5,strokeWidth:1.5,symbol:"diamond"}):(m=l==="point"?0:u.dataProgress,v={radius:3,strokeWidth:2,symbol:"circle"});const y=c&&f.valueDataKey&&f.errorDataKey&&C.jsx(fE,{dataKey:`ev${e}`,width:4,strokeWidth:1,stroke:g,strokeOpacity:.5});return l==="bar"?C.jsx(Tb,{type:"monotone",name:h,unit:f.variableUnits,dataKey:`v${e}`,fill:g,fillOpacity:m,isAnimationActive:!1,onClick:d,children:y},e):C.jsx(_D,{type:"monotone",name:h,unit:f.variableUnits,dataKey:`v${e}`,dot:C.jsx(FCe,{...v,stroke:g,fill:"white"}),activeDot:C.jsx(FCe,{...v,stroke:"white",fill:g}),stroke:g,strokeOpacity:m,isAnimationActive:!1,onClick:d,children:y},e)}const Tjn=lt(C.jsx("path",{d:"M19 12h-2v3h-3v2h5zM7 9h3V7H5v5h2zm14-6H3c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h18c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2m0 16.01H3V4.99h18z"}),"AspectRatio"),kjn=lt(C.jsx("path",{d:"M4 9h4v11H4zm12 4h4v7h-4zm-6-9h4v16h-4z"}),"BarChart"),Ajn=lt(C.jsx("path",{d:"M21.99 4c0-1.1-.89-2-1.99-2H4c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h14l4 4zM18 14H6v-2h12zm0-3H6V9h12zm0-3H6V6h12z"}),"Comment"),Pjn=lt(C.jsx("path",{d:"M4 20h16v2H4zM4 2h16v2H4zm9 7h3l-4-4-4 4h3v6H8l4 4 4-4h-3z"}),"Expand"),Mjn=lt(C.jsx("path",{d:"M17 4h3c1.1 0 2 .9 2 2v2h-2V6h-3zM4 8V6h3V4H4c-1.1 0-2 .9-2 2v2zm16 8v2h-3v2h3c1.1 0 2-.9 2-2v-2zM7 18H4v-2H2v2c0 1.1.9 2 2 2h3zM18 8H6v8h12z"}),"FitScreen"),Jqe=lt(C.jsx("path",{d:"M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2M5.5 7.5h2v-2H9v2h2V9H9v2H7.5V9h-2zM19 19H5L19 5zm-2-2v-1.5h-5V17z"}),"Iso"),Rjn=lt([C.jsx("circle",{cx:"7",cy:"14",r:"3"},"0"),C.jsx("circle",{cx:"11",cy:"6",r:"3"},"1"),C.jsx("circle",{cx:"16.6",cy:"17.6",r:"3"},"2")],"ScatterPlot"),Djn=lt(C.jsx("path",{d:"m3.5 18.49 6-6.01 4 4L22 6.92l-1.41-1.41-7.09 7.97-4-4L2 16.99z"}),"ShowChart"),Ijn=lt([C.jsx("circle",{cx:"12",cy:"12",r:"3.2"},"0"),C.jsx("path",{d:"M9 2 7.17 4H4c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2h-3.17L15 2zm3 15c-2.76 0-5-2.24-5-5s2.24-5 5-5 5 2.24 5 5-2.24 5-5 5"},"1")],"CameraAlt");function Ljn(t,e){if(t.match(/^[a-z]+:\/\//i))return t;if(t.match(/^\/\//))return window.location.protocol+t;if(t.match(/^[a-z]+:/i))return t;const n=document.implementation.createHTMLDocument(),r=n.createElement("base"),i=n.createElement("a");return n.head.appendChild(r),n.body.appendChild(i),e&&(r.href=e),i.href=t,i.href}const $jn=(()=>{let t=0;const e=()=>`0000${(Math.random()*36**4<<0).toString(36)}`.slice(-4);return()=>(t+=1,`u${e()}${t}`)})();function bg(t){const e=[];for(let n=0,r=t.length;nFl||t.height>Fl)&&(t.width>Fl&&t.height>Fl?t.width>t.height?(t.height*=Fl/t.width,t.width=Fl):(t.width*=Fl/t.height,t.height=Fl):t.width>Fl?(t.height*=Fl/t.width,t.width=Fl):(t.width*=Fl/t.height,t.height=Fl))}function aj(t){return new Promise((e,n)=>{const r=new Image;r.decode=()=>e(r),r.onload=()=>e(r),r.onerror=n,r.crossOrigin="anonymous",r.decoding="async",r.src=t})}async function Bjn(t){return Promise.resolve().then(()=>new XMLSerializer().serializeToString(t)).then(encodeURIComponent).then(e=>`data:image/svg+xml;charset=utf-8,${e}`)}async function Ujn(t,e,n){const r="http://www.w3.org/2000/svg",i=document.createElementNS(r,"svg"),o=document.createElementNS(r,"foreignObject");return i.setAttribute("width",`${e}`),i.setAttribute("height",`${n}`),i.setAttribute("viewBox",`0 0 ${e} ${n}`),o.setAttribute("width","100%"),o.setAttribute("height","100%"),o.setAttribute("x","0"),o.setAttribute("y","0"),o.setAttribute("externalResourcesRequired","true"),i.appendChild(o),o.appendChild(t),Bjn(i)}const xl=(t,e)=>{if(t instanceof e)return!0;const n=Object.getPrototypeOf(t);return n===null?!1:n.constructor.name===e.name||xl(n,e)};function Wjn(t){const e=t.getPropertyValue("content");return`${t.cssText} content: '${e.replace(/'|"/g,"")}';`}function Vjn(t){return bg(t).map(e=>{const n=t.getPropertyValue(e),r=t.getPropertyPriority(e);return`${e}: ${n}${r?" !important":""};`}).join(" ")}function Gjn(t,e,n){const r=`.${t}:${e}`,i=n.cssText?Wjn(n):Vjn(n);return document.createTextNode(`${r}{${i}}`)}function NCe(t,e,n){const r=window.getComputedStyle(t,n),i=r.getPropertyValue("content");if(i===""||i==="none")return;const o=$jn();try{e.className=`${e.className} ${o}`}catch{return}const s=document.createElement("style");s.appendChild(Gjn(o,n,r)),e.appendChild(s)}function Hjn(t,e){NCe(t,e,":before"),NCe(t,e,":after")}const zCe="application/font-woff",jCe="image/jpeg",qjn={woff:zCe,woff2:zCe,ttf:"application/font-truetype",eot:"application/vnd.ms-fontobject",png:"image/png",jpg:jCe,jpeg:jCe,gif:"image/gif",tiff:"image/tiff",svg:"image/svg+xml",webp:"image/webp"};function Xjn(t){const e=/\.([^./]*?)$/g.exec(t);return e?e[1]:""}function Dce(t){const e=Xjn(t).toLowerCase();return qjn[e]||""}function Yjn(t){return t.split(/,/)[1]}function RZ(t){return t.search(/^(data:)/)!==-1}function Qjn(t,e){return`data:${e};base64,${t}`}async function tXe(t,e,n){const r=await fetch(t,e);if(r.status===404)throw new Error(`Resource "${r.url}" not found`);const i=await r.blob();return new Promise((o,s)=>{const a=new FileReader;a.onerror=s,a.onloadend=()=>{try{o(n({res:r,result:a.result}))}catch(l){s(l)}},a.readAsDataURL(i)})}const j7={};function Kjn(t,e,n){let r=t.replace(/\?.*/,"");return n&&(r=t),/ttf|otf|eot|woff2?/i.test(r)&&(r=r.replace(/.*\//,"")),e?`[${e}]${r}`:r}async function Ice(t,e,n){const r=Kjn(t,e,n.includeQueryParams);if(j7[r]!=null)return j7[r];n.cacheBust&&(t+=(/\?/.test(t)?"&":"?")+new Date().getTime());let i;try{const o=await tXe(t,n.fetchRequestInit,({res:s,result:a})=>(e||(e=s.headers.get("Content-Type")||""),Yjn(a)));i=Qjn(o,e)}catch(o){i=n.imagePlaceholder||"";let s=`Failed to fetch resource: ${t}`;o&&(s=typeof o=="string"?o:o.message),s&&console.warn(s)}return j7[r]=i,i}async function Zjn(t){const e=t.toDataURL();return e==="data:,"?t.cloneNode(!1):aj(e)}async function Jjn(t,e){if(t.currentSrc){const o=document.createElement("canvas"),s=o.getContext("2d");o.width=t.clientWidth,o.height=t.clientHeight,s==null||s.drawImage(t,0,0,o.width,o.height);const a=o.toDataURL();return aj(a)}const n=t.poster,r=Dce(n),i=await Ice(n,r,e);return aj(i)}async function e4n(t){var e;try{if(!((e=t==null?void 0:t.contentDocument)===null||e===void 0)&&e.body)return await r8(t.contentDocument.body,{},!0)}catch{}return t.cloneNode(!1)}async function t4n(t,e){return xl(t,HTMLCanvasElement)?Zjn(t):xl(t,HTMLVideoElement)?Jjn(t,e):xl(t,HTMLIFrameElement)?e4n(t):t.cloneNode(!1)}const n4n=t=>t.tagName!=null&&t.tagName.toUpperCase()==="SLOT";async function r4n(t,e,n){var r,i;let o=[];return n4n(t)&&t.assignedNodes?o=bg(t.assignedNodes()):xl(t,HTMLIFrameElement)&&(!((r=t.contentDocument)===null||r===void 0)&&r.body)?o=bg(t.contentDocument.body.childNodes):o=bg(((i=t.shadowRoot)!==null&&i!==void 0?i:t).childNodes),o.length===0||xl(t,HTMLVideoElement)||await o.reduce((s,a)=>s.then(()=>r8(a,n)).then(l=>{l&&e.appendChild(l)}),Promise.resolve()),e}function i4n(t,e){const n=e.style;if(!n)return;const r=window.getComputedStyle(t);r.cssText?(n.cssText=r.cssText,n.transformOrigin=r.transformOrigin):bg(r).forEach(i=>{let o=r.getPropertyValue(i);i==="font-size"&&o.endsWith("px")&&(o=`${Math.floor(parseFloat(o.substring(0,o.length-2)))-.1}px`),xl(t,HTMLIFrameElement)&&i==="display"&&o==="inline"&&(o="block"),i==="d"&&e.getAttribute("d")&&(o=`path(${e.getAttribute("d")})`),n.setProperty(i,o,r.getPropertyPriority(i))})}function o4n(t,e){xl(t,HTMLTextAreaElement)&&(e.innerHTML=t.value),xl(t,HTMLInputElement)&&e.setAttribute("value",t.value)}function s4n(t,e){if(xl(t,HTMLSelectElement)){const n=e,r=Array.from(n.children).find(i=>t.value===i.getAttribute("value"));r&&r.setAttribute("selected","")}}function a4n(t,e){return xl(e,Element)&&(i4n(t,e),Hjn(t,e),o4n(t,e),s4n(t,e)),e}async function l4n(t,e){const n=t.querySelectorAll?t.querySelectorAll("use"):[];if(n.length===0)return t;const r={};for(let o=0;ot4n(r,e)).then(r=>r4n(t,r,e)).then(r=>a4n(t,r)).then(r=>l4n(r,e))}const nXe=/url\((['"]?)([^'"]+?)\1\)/g,c4n=/url\([^)]+\)\s*format\((["']?)([^"']+)\1\)/g,u4n=/src:\s*(?:url\([^)]+\)\s*format\([^)]+\)[,;]\s*)+/g;function f4n(t){const e=t.replace(/([.*+?^${}()|\[\]\/\\])/g,"\\$1");return new RegExp(`(url\\(['"]?)(${e})(['"]?\\))`,"g")}function d4n(t){const e=[];return t.replace(nXe,(n,r,i)=>(e.push(i),n)),e.filter(n=>!RZ(n))}async function h4n(t,e,n,r,i){try{const o=n?Ljn(e,n):e,s=Dce(e);let a;return i||(a=await Ice(o,s,r)),t.replace(f4n(e),`$1${a}$3`)}catch{}return t}function p4n(t,{preferredFontFormat:e}){return e?t.replace(u4n,n=>{for(;;){const[r,,i]=c4n.exec(n)||[];if(!i)return"";if(i===e)return`src: ${r};`}}):t}function rXe(t){return t.search(nXe)!==-1}async function iXe(t,e,n){if(!rXe(t))return t;const r=p4n(t,n);return d4n(r).reduce((o,s)=>o.then(a=>h4n(a,s,e,n)),Promise.resolve(r))}async function s$(t,e,n){var r;const i=(r=e.style)===null||r===void 0?void 0:r.getPropertyValue(t);if(i){const o=await iXe(i,null,n);return e.style.setProperty(t,o,e.style.getPropertyPriority(t)),!0}return!1}async function g4n(t,e){await s$("background",t,e)||await s$("background-image",t,e),await s$("mask",t,e)||await s$("mask-image",t,e)}async function m4n(t,e){const n=xl(t,HTMLImageElement);if(!(n&&!RZ(t.src))&&!(xl(t,SVGImageElement)&&!RZ(t.href.baseVal)))return;const r=n?t.src:t.href.baseVal,i=await Ice(r,Dce(r),e);await new Promise((o,s)=>{t.onload=o,t.onerror=s;const a=t;a.decode&&(a.decode=o),a.loading==="lazy"&&(a.loading="eager"),n?(t.srcset="",t.src=i):t.href.baseVal=i})}async function v4n(t,e){const r=bg(t.childNodes).map(i=>oXe(i,e));await Promise.all(r).then(()=>t)}async function oXe(t,e){xl(t,Element)&&(await g4n(t,e),await m4n(t,e),await v4n(t,e))}function y4n(t,e){const{style:n}=t;e.backgroundColor&&(n.backgroundColor=e.backgroundColor),e.width&&(n.width=`${e.width}px`),e.height&&(n.height=`${e.height}px`);const r=e.style;return r!=null&&Object.keys(r).forEach(i=>{n[i]=r[i]}),t}const BCe={};async function UCe(t){let e=BCe[t];if(e!=null)return e;const r=await(await fetch(t)).text();return e={url:t,cssText:r},BCe[t]=e,e}async function WCe(t,e){let n=t.cssText;const r=/url\(["']?([^"')]+)["']?\)/g,o=(n.match(/url\([^)]+\)/g)||[]).map(async s=>{let a=s.replace(r,"$1");return a.startsWith("https://")||(a=new URL(a,t.url).href),tXe(a,e.fetchRequestInit,({result:l})=>(n=n.replace(s,`url(${l})`),[s,l]))});return Promise.all(o).then(()=>n)}function VCe(t){if(t==null)return[];const e=[],n=/(\/\*[\s\S]*?\*\/)/gi;let r=t.replace(n,"");const i=new RegExp("((@.*?keyframes [\\s\\S]*?){([\\s\\S]*?}\\s*?)})","gi");for(;;){const l=i.exec(r);if(l===null)break;e.push(l[0])}r=r.replace(i,"");const o=/@import[\s\S]*?url\([^)]*\)[\s\S]*?;/gi,s="((\\s*?(?:\\/\\*[\\s\\S]*?\\*\\/)?\\s*?@media[\\s\\S]*?){([\\s\\S]*?)}\\s*?})|(([\\s\\S]*?){([\\s\\S]*?)})",a=new RegExp(s,"gi");for(;;){let l=o.exec(r);if(l===null){if(l=a.exec(r),l===null)break;o.lastIndex=a.lastIndex}else a.lastIndex=o.lastIndex;e.push(l[0])}return e}async function x4n(t,e){const n=[],r=[];return t.forEach(i=>{if("cssRules"in i)try{bg(i.cssRules||[]).forEach((o,s)=>{if(o.type===CSSRule.IMPORT_RULE){let a=s+1;const l=o.href,c=UCe(l).then(u=>WCe(u,e)).then(u=>VCe(u).forEach(f=>{try{i.insertRule(f,f.startsWith("@import")?a+=1:i.cssRules.length)}catch(d){console.error("Error inserting rule from remote css",{rule:f,error:d})}})).catch(u=>{console.error("Error loading remote css",u.toString())});r.push(c)}})}catch(o){const s=t.find(a=>a.href==null)||document.styleSheets[0];i.href!=null&&r.push(UCe(i.href).then(a=>WCe(a,e)).then(a=>VCe(a).forEach(l=>{s.insertRule(l,i.cssRules.length)})).catch(a=>{console.error("Error loading remote stylesheet",a)})),console.error("Error inlining remote css file",o)}}),Promise.all(r).then(()=>(t.forEach(i=>{if("cssRules"in i)try{bg(i.cssRules||[]).forEach(o=>{n.push(o)})}catch(o){console.error(`Error while reading CSS rules from ${i.href}`,o)}}),n))}function b4n(t){return t.filter(e=>e.type===CSSRule.FONT_FACE_RULE).filter(e=>rXe(e.style.getPropertyValue("src")))}async function w4n(t,e){if(t.ownerDocument==null)throw new Error("Provided element is not within a Document");const n=bg(t.ownerDocument.styleSheets),r=await x4n(n,e);return b4n(r)}async function _4n(t,e){const n=await w4n(t,e);return(await Promise.all(n.map(i=>{const o=i.parentStyleSheet?i.parentStyleSheet.href:null;return iXe(i.cssText,o,e)}))).join(` -`)}async function S4n(t,e){const n=e.fontEmbedCSS!=null?e.fontEmbedCSS:e.skipFonts?null:await _4n(t,e);if(n){const r=document.createElement("style"),i=document.createTextNode(n);r.appendChild(i),t.firstChild?t.insertBefore(r,t.firstChild):t.appendChild(r)}}async function C4n(t,e={}){const{width:n,height:r}=eXe(t,e),i=await r8(t,e,!0);return await S4n(i,e),await oXe(i,e),y4n(i,e),await Ujn(i,n,r)}async function sXe(t,e={}){const{width:n,height:r}=eXe(t,e),i=await C4n(t,e),o=await aj(i),s=document.createElement("canvas"),a=s.getContext("2d"),l=e.pixelRatio||zjn(),c=e.canvasWidth||n,u=e.canvasHeight||r;return s.width=c*l,s.height=u*l,e.skipAutoScale||jjn(s),s.style.width=`${c}`,s.style.height=`${u}`,e.backgroundColor&&(a.fillStyle=e.backgroundColor,a.fillRect(0,0,s.width,s.height)),a.drawImage(o,0,0,s.width,s.height),s}async function O4n(t,e={}){return(await sXe(t,e)).toDataURL()}async function E4n(t,e={}){return(await sXe(t,e)).toDataURL("image/jpeg",e.quality||1)}const GCe={png:O4n,jpeg:E4n};function T4n(t,e){k4n(t,e).then(()=>{e!=null&&e.handleSuccess&&e.handleSuccess()}).catch(n=>{if(e!=null&&e.handleError)e.handleError(n);else throw n})}async function k4n(t,e={}){const n=t,r=e.format||"png";if(!(r in GCe))throw new Error(`Image format '${r}' is unknown or not supported.`);const i=await GCe[r](n,{backgroundColor:"#00000000",canvasWidth:e.width||(e.height||n.clientHeight)*n.clientWidth/n.clientHeight,canvasHeight:e.height||(e.width||n.clientWidth)*n.clientHeight/n.clientWidth}),s=await(await fetch(i)).blob();await navigator.clipboard.write([new ClipboardItem({"image/png":s})])}function aXe({elementRef:t,postMessage:e}){const n=()=>{e("success",ge.get("Snapshot copied to clipboard"))},r=o=>{const s="Error copying snapshot to clipboard";console.error(s+":",o),e("error",ge.get(s))},i=()=>{t.current?T4n(t.current,{format:"png",width:2e3,handleSuccess:n,handleError:r}):r(new Error("missing element reference"))};return C.jsx(lu,{tooltipText:ge.get("Copy snapshot of chart to clipboard"),onClick:i,icon:C.jsx(Ijn,{fontSize:"inherit"})})}function A4n({sx:t,timeSeriesGroupId:e,placeGroupTimeSeries:n,addPlaceGroupTimeSeries:r}){const[i,o]=de.useState(null),s=f=>{o(f.currentTarget)},a=()=>{o(null)},l=f=>{o(null),r(e,f)},c=[];n.forEach(f=>{Object.getOwnPropertyNames(f.timeSeries).forEach(d=>{const h=`${f.placeGroup.title} / ${d}`;c.push(C.jsx(_i,{onClick:()=>l(f.timeSeries[d]),children:h},h))})});const u=!!i;return C.jsxs(C.Fragment,{children:[C.jsx(Ht,{size:"small",sx:t,"aria-label":"Add","aria-controls":u?"basic-menu":void 0,"aria-haspopup":"true","aria-expanded":u?"true":void 0,onClick:s,disabled:c.length===0,children:C.jsx(Rt,{arrow:!0,title:ge.get("Add time-series from places"),children:C.jsx(EU,{fontSize:"inherit"})})}),C.jsx(Z1,{id:"basic-menu",anchorEl:i,open:u,onClose:a,MenuListProps:{"aria-labelledby":"basic-button"},children:c})]})}const a$={container:t=>({padding:t.spacing(1),display:"flex",flexDirection:"column",gap:t.spacing(1)}),minMaxBox:t=>({display:"flex",justifyContent:"center",gap:t.spacing(1)}),minTextField:{maxWidth:"8em"},maxTextField:{maxWidth:"8em"}};function P4n({anchorEl:t,valueRange:e,setValueRange:n}){const[r,i]=D.useState(e?[e[0]+"",e[1]+""]:["0","1"]);if(!t)return null;const o=[Number.parseFloat(r[0]),Number.parseFloat(r[1])],s=Number.isFinite(o[0])&&Number.isFinite(o[1])&&o[0]{const d=f.target.value;i([d,r[1]])},l=f=>{const d=f.target.value;i([r[0],d])},c=()=>{n(o)},u=()=>{n(void 0)};return C.jsx(K1,{anchorEl:t,open:!0,onClose:u,anchorOrigin:{vertical:"bottom",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"center"},children:C.jsxs(ot,{sx:a$.container,children:[C.jsxs(ot,{component:"form",sx:a$.minMaxBox,children:[C.jsx(ui,{sx:a$.minTextField,label:"Y-Minimum",variant:"filled",size:"small",value:r[0],error:!s,onChange:f=>a(f)}),C.jsx(ui,{sx:a$.maxTextField,label:"Y-Maximum",variant:"filled",size:"small",value:r[1],error:!s,onChange:f=>l(f)})]}),C.jsx(oD,{onDone:c,doneDisabled:!s,onCancel:u,size:"medium"})]})})}const l$="stddev",P0={headerContainer:{display:"flex",flexDirection:"row",justifyContent:"right"},actionsContainer:{display:"flex",flexDirection:"row",flexWrap:"nowrap",alignItems:"center",gap:"1px"},responsiveContainer:{flexGrow:"1px"},actionButton:{zIndex:1e3,opacity:.8},chartTitle:{fontSize:"inherit",fontWeight:"normal"},chartTypes:t=>({paddingLeft:t.spacing(1),paddingRight:t.spacing(1)})};function M4n({timeSeriesGroup:t,placeGroupTimeSeries:e,addPlaceGroupTimeSeries:n,removeTimeSeriesGroup:r,resetZoom:i,loading:o,zoomed:s,zoomMode:a,setZoomMode:l,showTooltips:c,setShowTooltips:u,chartType:f,setChartType:d,stdevBarsDisabled:h,stdevBars:p,setStdevBars:g,valueRange:m,setValueRange:v,chartElement:y,postMessage:x}){const b=D.useRef(null),[w,_]=D.useState(!1),S=()=>{_(!w)},O=E=>{_(!1),E&&v(E)},k=(E,M)=>{const A=new Set(M),P=A.has(l$);A.delete(l$),A.delete(f),M=Array.from(A),d(M.length===1?M[0]:f),g(P)};return C.jsx(ot,{sx:P0.headerContainer,children:C.jsxs(ot,{sx:P0.actionsContainer,children:[s&&C.jsx(Rt,{arrow:!0,title:ge.get("Zoom to full range"),children:C.jsx(Ht,{sx:P0.actionButton,onClick:i,size:"small",children:C.jsx(Mjn,{fontSize:"inherit"})},"zoomOutButton")}),C.jsx(Rt,{arrow:!0,title:ge.get("Toggle zoom mode (or press CTRL key)"),children:C.jsx(yr,{value:"zoomMode",selected:a,onClick:()=>l(!a),size:"small",children:C.jsx(Tjn,{fontSize:"inherit"})})}),C.jsx(P4n,{anchorEl:w?b.current:null,valueRange:m,setValueRange:O}),C.jsx(Rt,{arrow:!0,title:ge.get("Enter fixed y-range"),children:C.jsx(yr,{ref:b,value:"valueRange",selected:w,onClick:S,size:"small",children:C.jsx(Pjn,{fontSize:"inherit"})})}),C.jsx(Rt,{arrow:!0,title:ge.get("Toggle showing info popup on hover"),children:C.jsx(yr,{value:"showTooltips",selected:c,onClick:()=>u(!c),size:"small",children:C.jsx(Ajn,{fontSize:"inherit"})})}),C.jsxs(KC,{value:p?[f,l$]:[f],onChange:k,size:"small",sx:P0.chartTypes,children:[C.jsx(Rt,{arrow:!0,title:ge.get("Show points"),children:C.jsx(yr,{value:"point",size:"small",children:C.jsx(Rjn,{fontSize:"inherit"})})}),C.jsx(Rt,{arrow:!0,title:ge.get("Show lines"),children:C.jsx(yr,{value:"line",size:"small",children:C.jsx(Djn,{fontSize:"inherit"})})}),C.jsx(Rt,{arrow:!0,title:ge.get("Show bars"),children:C.jsx(yr,{value:"bar",size:"small",children:C.jsx(kjn,{fontSize:"inherit"})})}),C.jsx(Rt,{arrow:!0,title:ge.get("Show standard deviation (if any)"),children:C.jsx(yr,{value:l$,size:"small",disabled:h,children:C.jsx(Jqe,{fontSize:"inherit"})})})]}),C.jsx(aXe,{elementRef:y,postMessage:x}),C.jsx(A4n,{sx:P0.actionButton,timeSeriesGroupId:t.id,placeGroupTimeSeries:e,addPlaceGroupTimeSeries:n}),o?C.jsx(Y1,{size:24,sx:P0.actionButton,color:"secondary"}):C.jsx(Ht,{sx:P0.actionButton,"aria-label":"Close",onClick:()=>r(t.id),size:"small",children:C.jsx(VO,{fontSize:"inherit"})})]})})}const R4n=oa("div")(({theme:t})=>({userSelect:"none",marginTop:t.spacing(1),width:"99%",height:"32vh",display:"flex",flexDirection:"column",alignItems:"flex-stretch"})),D4n={style:{textAnchor:"middle"},angle:-90,position:"left",offset:0};function I4n({timeSeriesGroup:t,selectTimeSeries:e,selectedTime:n,selectTime:r,selectedTimeRange:i,selectTimeRange:o,places:s,selectPlace:a,placeInfos:l,dataTimeRange:c,chartTypeDefault:u,includeStdev:f,removeTimeSeries:d,removeTimeSeriesGroup:h,placeGroupTimeSeries:p,addPlaceGroupTimeSeries:g,postMessage:m}){const v=X1(),[y,x]=D.useState(!1),[b,w]=D.useState(!0),[_,S]=D.useState(u),[O,k]=D.useState(f),[E,M]=D.useState({}),A=D.useRef(),P=D.useRef(),T=D.useRef(),R=D.useRef(null),I=D.useRef(null),B=D.useMemo(()=>{const W=new Map;t.timeSeriesArray.forEach((se,ye)=>{const ie=`v${ye}`,fe=`ev${ye}`,Q=se.source.valueDataKey,_e=se.source.errorDataKey;se.data.forEach(we=>{const Ie=W.get(we.time);let Pe;Ie===void 0?(Pe={time:we.time},W.set(we.time,Pe)):Pe=Ie;const Me=we[Q];if(vr(Me)&&isFinite(Me)&&(Pe[ie]=Me),_e){const Te=we[_e];vr(Te)&&isFinite(Te)&&(Pe[fe]=Te)}})});const J=Array.from(W.values());return J.sort((se,ye)=>se.time-ye.time),J},[t]),$=D.useMemo(()=>t.timeSeriesArray.map(W=>W.dataProgress?W.dataProgress:0),[t]),z=$.reduce((W,J)=>W+J,0)/$.length,L=z>0&&z<1,j=!!i&&!lbt(i,c||null);t.timeSeriesArray.forEach(W=>{W.source.valueDataKey});const N=t.variableUnits||ge.get("unknown units"),F=`${ge.get("Quantity")} (${N})`,H=v.palette.primary.light,q=v.palette.primary.main,Y=v.palette.text.primary,le=()=>{vr(E.x1)&&M({})},K=W=>{if(!W)return;const{chartX:J,chartY:se}=W;if(!vr(J)||!vr(se))return;const ye=Z(J,se);if(ye){const[ie,fe]=ye;M({x1:ie,y1:fe})}},ee=(W,J)=>{const{x1:se,y1:ye}=E;if(!vr(se)||!vr(ye)||!W)return;const{chartX:ie,chartY:fe}=W;if(!vr(ie)||!vr(fe))return;const Q=Z(ie,fe);if(Q){const[_e,we]=Q;J.ctrlKey||y?_e!==se&&we!==ye&&M({x1:se,y1:ye,x2:_e,y2:we}):_e!==se&&M({x1:se,y1:ye,x2:_e})}},re=W=>{const[J,se]=HCe(E);le(),J&&J[0]{le()},te=()=>{le()},ae=W=>{d(t.id,W)},U=()=>{le(),o(c||null,t.id,null)},oe=W=>{W&&o(i,t.id,W)},ne=(W,J)=>{if(T.current=[W,J],R.current){const se=R.current.getElementsByClassName("recharts-legend-wrapper");se.length!==0&&(I.current=se.item(0))}},V=([W,J])=>{const se=(J-W)*.1;return i?A.current=i:A.current=[W-se,J+se],A.current},X=([W,J])=>{const se=(J-W)*.1;if(t.variableRange)P.current=t.variableRange;else{const ye=W-se;P.current=[ye<0&&W-1e-6>0?0:ye,J+se]}return P.current},Z=(W,J)=>{const se=I.current;if(!T.current||!A.current||!P.current||!se)return;const[ye,ie]=A.current,[fe,Q]=P.current,[_e,we]=T.current,Ie=se.clientHeight,Pe=65,Me=5,Te=5,Le=38,ue=_e-Pe-Te,$e=we-Me-Le-Ie,Se=(W-Pe)/ue,He=(J-Me)/$e;return[ye+Se*(ie-ye),Q-He*(Q-fe)]},[he,xe]=HCe(E),G=_==="bar"?yjn:vjn;return C.jsxs(R4n,{children:[C.jsx(M4n,{timeSeriesGroup:t,placeGroupTimeSeries:p,addPlaceGroupTimeSeries:g,removeTimeSeriesGroup:h,resetZoom:U,loading:L,zoomed:j,zoomMode:y,setZoomMode:x,showTooltips:b,setShowTooltips:w,chartType:_,setChartType:S,stdevBarsDisabled:!f,stdevBars:O,setStdevBars:k,valueRange:P.current,setValueRange:oe,chartElement:R,postMessage:m}),C.jsx(IHe,{width:"98%",onResize:ne,ref:R,children:C.jsxs(G,{onMouseDown:K,onMouseMove:ee,onMouseUp:re,onMouseEnter:me,onMouseLeave:te,syncId:"anyId",style:{color:Y,fontSize:"0.8em"},data:B,barGap:1,barSize:30,maxBarSize:30,children:[C.jsx(Ab,{dataKey:"time",type:"number",tickCount:6,domain:V,tickFormatter:bjn,stroke:Y,allowDataOverflow:!0}),C.jsx(Pb,{type:"number",tickCount:5,domain:X,tickFormatter:wjn,stroke:Y,allowDataOverflow:!0,label:{...D4n,value:F}}),C.jsx(Mce,{strokeDasharray:"3 3"}),b&&!vr(E.x1)&&C.jsx(Rd,{content:C.jsx(Ojn,{})}),C.jsx(TC,{content:C.jsx(_jn,{removeTimeSeries:ae})}),t.timeSeriesArray.map((W,J)=>Ejn({timeSeriesGroup:t,timeSeriesIndex:J,selectTimeSeries:e,places:s,selectPlace:a,placeGroupTimeSeries:p,placeInfos:l,chartType:_,stdevBars:O,paletteMode:v.palette.mode})),he&&C.jsx(kb,{x1:he[0],y1:xe?xe[0]:void 0,x2:he[1],y2:xe?xe[1]:void 0,strokeOpacity:.3,fill:H,fillOpacity:.3}),n!==null&&C.jsx(bD,{isFront:!0,x:n,stroke:q,strokeWidth:3,strokeOpacity:.5})]})})]})}function HCe(t){const{x1:e,x2:n,y1:r,y2:i}=t;let o,s;return vr(e)&&vr(n)&&(o=eC.jsx(I4n,{timeSeriesGroup:l,dataTimeRange:n,selectedTimeRange:r,selectTimeRange:i,...a},l.id))]})}const z4n=t=>({locale:t.controlState.locale,timeSeriesGroups:t.dataState.timeSeriesGroups,selectedTime:t.controlState.selectedTime,selectedTimeRange:t.controlState.selectedTimeRange,dataTimeRange:Zwt(t),chartTypeDefault:t.controlState.timeSeriesChartTypeDefault,includeStdev:t.controlState.timeSeriesIncludeStdev,placeInfos:i_t(t),places:JM(t),placeGroupTimeSeries:gbt(t),canAddTimeSeries:yDe(t)}),j4n={selectTime:rU,selectTimeRange:IUe,removeTimeSeries:jQt,removeTimeSeriesGroup:BQt,selectPlace:nU,addPlaceGroupTimeSeries:zQt,addTimeSeries:tU,postMessage:ws},B4n=Rn(z4n,j4n)(N4n),U4n=lt(C.jsx("path",{d:"M22 18v-2H8V4h2L7 1 4 4h2v2H2v2h4v8c0 1.1.9 2 2 2h8v2h-2l3 3 3-3h-2v-2zM10 8h6v6h2V8c0-1.1-.9-2-2-2h-6z"}),"Transform");function W4n(t){return t.count===0}function V4n(t){return t.count===1}function G4n(t){return t.count>1}function H4n({statisticsRecord:t}){const e=t.statistics;return C.jsx(Pee,{size:"small",children:C.jsx(Mee,{children:W4n(e)?C.jsxs(Ad,{children:[C.jsx(si,{children:ge.get("Value")}),C.jsx(si,{align:"right",children:"NaN"})]}):V4n(e)?C.jsxs(Ad,{children:[C.jsx(si,{children:ge.get("Value")}),C.jsx(si,{align:"right",children:I2(e.mean)})]}):C.jsxs(C.Fragment,{children:[C.jsxs(Ad,{children:[C.jsx(si,{children:ge.get("Count")}),C.jsx(si,{align:"right",children:e.count})]}),C.jsxs(Ad,{children:[C.jsx(si,{children:ge.get("Minimum")}),C.jsx(si,{align:"right",children:I2(e.minimum)})]}),C.jsxs(Ad,{children:[C.jsx(si,{children:ge.get("Maximum")}),C.jsx(si,{align:"right",children:I2(e.maximum)})]}),C.jsxs(Ad,{children:[C.jsx(si,{children:ge.get("Mean")}),C.jsx(si,{align:"right",children:I2(e.mean)})]}),C.jsxs(Ad,{children:[C.jsx(si,{children:ge.get("Deviation")}),C.jsx(si,{align:"right",children:I2(e.deviation)})]})]})})})}function I2(t){return by(t,3)}function q4n({statisticsRecord:t,showBrush:e,showDetails:n}){const r=Na(),i=t.statistics,o=D.useMemo(()=>{if(!i.histogram)return null;const{values:y,edges:x}=i.histogram;return y.map((b,w)=>({x:.5*(x[w]+x[w+1]),y:b,i:w}))},[i]),[s,a]=D.useState([0,o?o.length-1:-1]);if(D.useEffect(()=>{o&&a([0,o.length-1])},[o]),o===null)return null;const{placeInfo:l}=t.source,[c,u]=s,f=o[c]?o[c].x:NaN,d=o[u]?o[u].x:NaN,h=Math.max(i.mean-i.deviation,i.minimum,f),p=Math.min(i.mean+i.deviation,i.maximum,d),g=r.palette.text.primary,m=r.palette.text.primary,v=({startIndex:y,endIndex:x})=>{vr(y)&&vr(x)&&a([y,x])};return C.jsx(IHe,{width:"100%",height:"100%",children:C.jsxs(xjn,{data:o,margin:{top:0,right:e?30:5,bottom:1,left:2},style:{color:m,fontSize:"0.8em"},children:[C.jsx(Mce,{strokeDasharray:"3 3"}),C.jsx(Ab,{type:"number",dataKey:"x",domain:[f,d],tickCount:10,tickFormatter:y=>by(y,2)}),C.jsx(Pb,{}),C.jsx(a0,{type:"monotone",dataKey:"y",stroke:l.color,fill:l.color}),n&&C.jsx(bD,{x:i.mean,isFront:!0,stroke:g,strokeWidth:2,strokeOpacity:.5}),n&&C.jsx(kb,{x1:h,x2:p,isFront:!1,stroke:g,strokeWidth:1,strokeOpacity:.3,fill:g,fillOpacity:.05}),e&&C.jsx(j1,{dataKey:"i",height:22,startIndex:c,endIndex:u,tickFormatter:y=>by(o[y].x,1),onChange:v})]})})}const c$={container:{padding:1,width:"100%"},header:{display:"flex",justifyContent:"space-between",alignItems:"center",paddingBottom:.5},actions:{display:"flex",gap:.1},body:{display:"flex"}};function u$({phrase:t}){return C.jsx("span",{style:{color:"red"},children:`<${ge.get(t)}?>`})}function lXe({dataset:t,variable:e,time:n,placeInfo:r,actions:i,body:o,containerRef:s}){const a=t?t.title:C.jsx(u$,{phrase:"Dataset"}),l=e?e.name:C.jsx(u$,{phrase:"Variable"}),c=t==null?void 0:t.dimensions.some(d=>d.name=="time"),u=n?ARe(n):c?C.jsx(u$,{phrase:"Time"}):null,f=r?r.label:C.jsx(u$,{phrase:"Place"});return C.jsxs(ot,{sx:c$.container,ref:s,children:[C.jsxs(ot,{sx:c$.header,children:[C.jsxs(Jt,{fontSize:"small",children:[a," / ",l,u&&`, ${u}`,", ",f]}),C.jsx(ot,{sx:c$.actions,children:i})]}),o&&C.jsx(ot,{sx:c$.body,children:o})]})}const qCe={table:{flexGrow:0},chart:{flexGrow:1}};function X4n({locale:t,statisticsRecord:e,rowIndex:n,removeStatistics:r,postMessage:i}){const o=D.useRef(null),[s,a]=D.useState(!1),[l,c]=D.useState(!1),{dataset:u,variable:f,time:d,placeInfo:h}=e.source,p=G4n(e.statistics),g=()=>{c(!l)},m=()=>{a(!s)},v=()=>{r(n)};return C.jsx(lXe,{dataset:u,variable:f,time:d,placeInfo:h,containerRef:o,actions:C.jsxs(C.Fragment,{children:[p&&C.jsxs(KC,{size:"small",children:[C.jsx(Rt,{arrow:!0,title:ge.get("Toggle adjustable x-range"),children:C.jsx(yr,{selected:s,onClick:m,value:"brush",size:"small",children:C.jsx(U4n,{fontSize:"inherit"})})}),C.jsx(Rt,{arrow:!0,title:ge.get("Show standard deviation (if any)"),children:C.jsx(yr,{selected:l,onClick:g,value:"details",size:"small",children:C.jsx(Jqe,{fontSize:"inherit"})})})]}),p&&C.jsx(aXe,{elementRef:o,postMessage:i}),C.jsx(Ht,{size:"small",onClick:v,children:C.jsx(VO,{fontSize:"inherit"})})]}),body:C.jsxs(C.Fragment,{children:[C.jsx(ot,{sx:qCe.table,children:C.jsx(H4n,{locale:t,statisticsRecord:e})}),C.jsx(ot,{sx:qCe.chart,children:C.jsx(q4n,{showBrush:s,showDetails:l,statisticsRecord:e})})]})})}const Y4n={progress:{color:"primary"}};function Q4n({selectedDataset:t,selectedVariable:e,selectedTime:n,selectedPlaceInfo:r,canAddStatistics:i,addStatistics:o,statisticsLoading:s}){return C.jsx(lXe,{dataset:t,variable:e,time:n,placeInfo:r,actions:s?C.jsx(Y1,{size:20,sx:Y4n.progress}):C.jsx(Ht,{size:"small",disabled:!i,onClick:o,color:"primary",children:C.jsx(EU,{fontSize:"inherit"})})})}const K4n={container:{padding:1,display:"flex",flexDirection:"column",alignItems:"flex-start"}};function Z4n({selectedDataset:t,selectedVariable:e,selectedTime:n,selectedPlaceInfo:r,statisticsLoading:i,statisticsRecords:o,canAddStatistics:s,addStatistics:a,removeStatistics:l,postMessage:c}){return C.jsxs(ot,{sx:K4n.container,children:[C.jsx(Q4n,{selectedDataset:t,selectedVariable:e,selectedTime:n,selectedPlaceInfo:r,canAddStatistics:s,addStatistics:a,statisticsLoading:i}),o.map((u,f)=>C.jsx(X4n,{statisticsRecord:u,rowIndex:f,removeStatistics:l,postMessage:c},f))]})}const J4n=t=>({selectedDataset:ho(t),selectedVariable:ja(t),selectedTime:pO(t),selectedPlaceInfo:eR(t),statisticsLoading:hbt(t),statisticsRecords:o_t(t),canAddStatistics:xDe(t)}),eBn={addStatistics:oUe,removeStatistics:FQt,postMessage:ws},tBn=Rn(J4n,eBn)(Z4n);/** + A `).concat(p,",").concat(p,",0,0,").concat(c,",").concat(e,",").concat(n+i-a*p," Z")}else u="M ".concat(e,",").concat(n," h ").concat(r," v ").concat(i," h ").concat(-r," Z");return u},t3n=function(e,n){if(!e||!n)return!1;var r=e.x,i=e.y,o=n.x,s=n.y,a=n.width,l=n.height;if(Math.abs(a)>0&&Math.abs(l)>0){var c=Math.min(o,o+a),u=Math.max(o,o+a),f=Math.min(s,s+l),d=Math.max(s,s+l);return r>=c&&r<=u&&i>=f&&i<=d}return!1},n3n={x:0,y:0,width:0,height:0,radius:0,isAnimationActive:!1,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},jce=function(e){var n=vCe(vCe({},n3n),e),r=D.useRef(),i=D.useState(-1),o=q$n(i,2),s=o[0],a=o[1];D.useEffect(function(){if(r.current&&r.current.getTotalLength)try{var b=r.current.getTotalLength();b&&a(b)}catch{}},[]);var l=n.x,c=n.y,u=n.width,f=n.height,d=n.radius,h=n.className,p=n.animationEasing,g=n.animationDuration,m=n.animationBegin,v=n.isAnimationActive,y=n.isUpdateAnimationActive;if(l!==+l||c!==+c||u!==+u||f!==+f||u===0||f===0)return null;var x=Oe("recharts-rectangle",h);return y?de.createElement(Ih,{canBegin:s>0,from:{width:u,height:f,x:l,y:c},to:{width:u,height:f,x:l,y:c},duration:g,animationEasing:p,isActive:y},function(b){var w=b.width,_=b.height,S=b.x,O=b.y;return de.createElement(Ih,{canBegin:s>0,from:"0px ".concat(s===-1?1:s,"px"),to:"".concat(s,"px 0px"),attributeName:"strokeDasharray",begin:m,duration:g,isActive:v,easing:p},de.createElement("path",Wz({},pn(n,!0),{className:x,d:yCe(S,O,w,_,d),ref:r})))}):de.createElement("path",Wz({},pn(n,!0),{className:x,d:yCe(l,c,u,f,d)}))};function AZ(){return AZ=Object.assign?Object.assign.bind():function(t){for(var e=1;e=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function c3n(t,e){if(t==null)return{};var n={},r=Object.keys(t),i,o;for(o=0;o=0)&&(n[i]=t[i]);return n}var u3n=function(e,n,r,i,o,s){return"M".concat(e,",").concat(o,"v").concat(i,"M").concat(s,",").concat(n,"h").concat(r)},f3n=function(e){var n=e.x,r=n===void 0?0:n,i=e.y,o=i===void 0?0:i,s=e.top,a=s===void 0?0:s,l=e.left,c=l===void 0?0:l,u=e.width,f=u===void 0?0:u,d=e.height,h=d===void 0?0:d,p=e.className,g=l3n(e,r3n),m=i3n({x:r,y:o,top:a,left:c,width:f,height:h},g);return!at(r)||!at(o)||!at(f)||!at(h)||!at(a)||!at(c)?null:de.createElement("path",PZ({},pn(m,!0),{className:Oe("recharts-cross",p),d:u3n(r,o,f,h,a,c)}))},d3n=zHe,h3n=d3n(Object.getPrototypeOf,Object),p3n=h3n,g3n=rm,m3n=p3n,v3n=im,y3n="[object Object]",x3n=Function.prototype,b3n=Object.prototype,Vqe=x3n.toString,w3n=b3n.hasOwnProperty,_3n=Vqe.call(Object);function S3n(t){if(!v3n(t)||g3n(t)!=y3n)return!1;var e=m3n(t);if(e===null)return!0;var n=w3n.call(e,"constructor")&&e.constructor;return typeof n=="function"&&n instanceof n&&Vqe.call(n)==_3n}var C3n=S3n;const O3n=sn(C3n);var E3n=rm,T3n=im,k3n="[object Boolean]";function A3n(t){return t===!0||t===!1||T3n(t)&&E3n(t)==k3n}var P3n=A3n;const M3n=sn(P3n);function XP(t){"@babel/helpers - typeof";return XP=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},XP(t)}function Vz(){return Vz=Object.assign?Object.assign.bind():function(t){for(var e=1;et.length)&&(e=t.length);for(var n=0,r=new Array(e);n0,from:{upperWidth:0,lowerWidth:0,height:d,x:l,y:c},to:{upperWidth:u,lowerWidth:f,height:d,x:l,y:c},duration:g,animationEasing:p,isActive:v},function(x){var b=x.upperWidth,w=x.lowerWidth,_=x.height,S=x.x,O=x.y;return de.createElement(Ih,{canBegin:s>0,from:"0px ".concat(s===-1?1:s,"px"),to:"".concat(s,"px 0px"),attributeName:"strokeDasharray",begin:m,duration:g,easing:p},de.createElement("path",Vz({},pn(n,!0),{className:y,d:SCe(S,O,b,w,_),ref:r})))}):de.createElement("g",null,de.createElement("path",Vz({},pn(n,!0),{className:y,d:SCe(l,c,u,f,d)})))},U3n=["option","shapeType","propTransformer","activeClassName","isActive"];function YP(t){"@babel/helpers - typeof";return YP=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},YP(t)}function W3n(t,e){if(t==null)return{};var n=V3n(t,e),r,i;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);for(i=0;i=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function V3n(t,e){if(t==null)return{};var n={},r=Object.keys(t),i,o;for(o=0;o=0)&&(n[i]=t[i]);return n}function CCe(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function Gz(t){for(var e=1;e0&&r.handleDrag(i.changedTouches[0])}),Vl(_d(r),"handleDragEnd",function(){r.setState({isTravellerMoving:!1,isSlideMoving:!1},function(){var i=r.props,o=i.endIndex,s=i.onDragEnd,a=i.startIndex;s==null||s({endIndex:o,startIndex:a})}),r.detachDragEndListener()}),Vl(_d(r),"handleLeaveWrapper",function(){(r.state.isTravellerMoving||r.state.isSlideMoving)&&(r.leaveTimer=window.setTimeout(r.handleDragEnd,r.props.leaveTimeOut))}),Vl(_d(r),"handleEnterSlideOrTraveller",function(){r.setState({isTextActive:!0})}),Vl(_d(r),"handleLeaveSlideOrTraveller",function(){r.setState({isTextActive:!1})}),Vl(_d(r),"handleSlideDragStart",function(i){var o=MCe(i)?i.changedTouches[0]:i;r.setState({isTravellerMoving:!1,isSlideMoving:!0,slideMoveStartX:o.pageX}),r.attachDragEndListener()}),r.travellerDragStartHandlers={startX:r.handleTravellerDragStart.bind(_d(r),"startX"),endX:r.handleTravellerDragStart.bind(_d(r),"endX")},r.state={},r}return CFn(e,[{key:"componentWillUnmount",value:function(){this.leaveTimer&&(clearTimeout(this.leaveTimer),this.leaveTimer=null),this.detachDragEndListener()}},{key:"getIndex",value:function(r){var i=r.startX,o=r.endX,s=this.state.scaleValues,a=this.props,l=a.gap,c=a.data,u=c.length-1,f=Math.min(i,o),d=Math.max(i,o),h=e.getIndexInRange(s,f),p=e.getIndexInRange(s,d);return{startIndex:h-h%l,endIndex:p===u?u:p-p%l}}},{key:"getTextOfTick",value:function(r){var i=this.props,o=i.data,s=i.tickFormatter,a=i.dataKey,l=Ma(o[r],a,r);return mn(s)?s(l,r):l}},{key:"attachDragEndListener",value:function(){window.addEventListener("mouseup",this.handleDragEnd,!0),window.addEventListener("touchend",this.handleDragEnd,!0),window.addEventListener("mousemove",this.handleDrag,!0)}},{key:"detachDragEndListener",value:function(){window.removeEventListener("mouseup",this.handleDragEnd,!0),window.removeEventListener("touchend",this.handleDragEnd,!0),window.removeEventListener("mousemove",this.handleDrag,!0)}},{key:"handleSlideDrag",value:function(r){var i=this.state,o=i.slideMoveStartX,s=i.startX,a=i.endX,l=this.props,c=l.x,u=l.width,f=l.travellerWidth,d=l.startIndex,h=l.endIndex,p=l.onChange,g=r.pageX-o;g>0?g=Math.min(g,c+u-f-a,c+u-f-s):g<0&&(g=Math.max(g,c-s,c-a));var m=this.getIndex({startX:s+g,endX:a+g});(m.startIndex!==d||m.endIndex!==h)&&p&&p(m),this.setState({startX:s+g,endX:a+g,slideMoveStartX:r.pageX})}},{key:"handleTravellerDragStart",value:function(r,i){var o=MCe(i)?i.changedTouches[0]:i;this.setState({isSlideMoving:!1,isTravellerMoving:!0,movingTravellerId:r,brushMoveStartX:o.pageX}),this.attachDragEndListener()}},{key:"handleTravellerMove",value:function(r){var i=this.state,o=i.brushMoveStartX,s=i.movingTravellerId,a=i.endX,l=i.startX,c=this.state[s],u=this.props,f=u.x,d=u.width,h=u.travellerWidth,p=u.onChange,g=u.gap,m=u.data,v={startX:this.state.startX,endX:this.state.endX},y=r.pageX-o;y>0?y=Math.min(y,f+d-h-c):y<0&&(y=Math.max(y,f-c)),v[s]=c+y;var x=this.getIndex(v),b=x.startIndex,w=x.endIndex,_=function(){var O=m.length-1;return s==="startX"&&(a>l?b%g===0:w%g===0)||al?w%g===0:b%g===0)||a>l&&w===O};this.setState(Vl(Vl({},s,c+y),"brushMoveStartX",r.pageX),function(){p&&_()&&p(x)})}},{key:"handleTravellerMoveKeyboard",value:function(r,i){var o=this,s=this.state,a=s.scaleValues,l=s.startX,c=s.endX,u=this.state[i],f=a.indexOf(u);if(f!==-1){var d=f+r;if(!(d===-1||d>=a.length)){var h=a[d];i==="startX"&&h>=c||i==="endX"&&h<=l||this.setState(Vl({},i,h),function(){o.props.onChange(o.getIndex({startX:o.state.startX,endX:o.state.endX}))})}}}},{key:"renderBackground",value:function(){var r=this.props,i=r.x,o=r.y,s=r.width,a=r.height,l=r.fill,c=r.stroke;return de.createElement("rect",{stroke:c,fill:l,x:i,y:o,width:s,height:a})}},{key:"renderPanorama",value:function(){var r=this.props,i=r.x,o=r.y,s=r.width,a=r.height,l=r.data,c=r.children,u=r.padding,f=D.Children.only(c);return f?de.cloneElement(f,{x:i,y:o,width:s,height:a,margin:u,compact:!0,data:l}):null}},{key:"renderTravellerLayer",value:function(r,i){var o,s,a=this,l=this.props,c=l.y,u=l.travellerWidth,f=l.height,d=l.traveller,h=l.ariaLabel,p=l.data,g=l.startIndex,m=l.endIndex,v=Math.max(r,this.props.x),y=X7(X7({},pn(this.props,!1)),{},{x:v,y:c,width:u,height:f}),x=h||"Min value: ".concat((o=p[g])===null||o===void 0?void 0:o.name,", Max value: ").concat((s=p[m])===null||s===void 0?void 0:s.name);return de.createElement(Ur,{tabIndex:0,role:"slider","aria-label":x,"aria-valuenow":r,className:"recharts-brush-traveller",onMouseEnter:this.handleEnterSlideOrTraveller,onMouseLeave:this.handleLeaveSlideOrTraveller,onMouseDown:this.travellerDragStartHandlers[i],onTouchStart:this.travellerDragStartHandlers[i],onKeyDown:function(w){["ArrowLeft","ArrowRight"].includes(w.key)&&(w.preventDefault(),w.stopPropagation(),a.handleTravellerMoveKeyboard(w.key==="ArrowRight"?1:-1,i))},onFocus:function(){a.setState({isTravellerFocused:!0})},onBlur:function(){a.setState({isTravellerFocused:!1})},style:{cursor:"col-resize"}},e.renderTraveller(d,y))}},{key:"renderSlide",value:function(r,i){var o=this.props,s=o.y,a=o.height,l=o.stroke,c=o.travellerWidth,u=Math.min(r,i)+c,f=Math.max(Math.abs(i-r)-c,0);return de.createElement("rect",{className:"recharts-brush-slide",onMouseEnter:this.handleEnterSlideOrTraveller,onMouseLeave:this.handleLeaveSlideOrTraveller,onMouseDown:this.handleSlideDragStart,onTouchStart:this.handleSlideDragStart,style:{cursor:"move"},stroke:"none",fill:l,fillOpacity:.2,x:u,y:s,width:f,height:a})}},{key:"renderText",value:function(){var r=this.props,i=r.startIndex,o=r.endIndex,s=r.y,a=r.height,l=r.travellerWidth,c=r.stroke,u=this.state,f=u.startX,d=u.endX,h=5,p={pointerEvents:"none",fill:c};return de.createElement(Ur,{className:"recharts-brush-texts"},de.createElement(Dz,qz({textAnchor:"end",verticalAnchor:"middle",x:Math.min(f,d)-h,y:s+a/2},p),this.getTextOfTick(i)),de.createElement(Dz,qz({textAnchor:"start",verticalAnchor:"middle",x:Math.max(f,d)+l+h,y:s+a/2},p),this.getTextOfTick(o)))}},{key:"render",value:function(){var r=this.props,i=r.data,o=r.className,s=r.children,a=r.x,l=r.y,c=r.width,u=r.height,f=r.alwaysShowText,d=this.state,h=d.startX,p=d.endX,g=d.isTextActive,m=d.isSlideMoving,v=d.isTravellerMoving,y=d.isTravellerFocused;if(!i||!i.length||!at(a)||!at(l)||!at(c)||!at(u)||c<=0||u<=0)return null;var x=Oe("recharts-brush",o),b=de.Children.count(s)===1,w=_Fn("userSelect","none");return de.createElement(Ur,{className:x,onMouseLeave:this.handleLeaveWrapper,onTouchMove:this.handleTouchMove,style:w},this.renderBackground(),b&&this.renderPanorama(),this.renderSlide(h,p),this.renderTravellerLayer(h,"startX"),this.renderTravellerLayer(p,"endX"),(g||m||v||y||f)&&this.renderText())}}],[{key:"renderDefaultTraveller",value:function(r){var i=r.x,o=r.y,s=r.width,a=r.height,l=r.stroke,c=Math.floor(o+a/2)-1;return de.createElement(de.Fragment,null,de.createElement("rect",{x:i,y:o,width:s,height:a,fill:l,stroke:"none"}),de.createElement("line",{x1:i+1,y1:c,x2:i+s-1,y2:c,fill:"none",stroke:"#fff"}),de.createElement("line",{x1:i+1,y1:c+2,x2:i+s-1,y2:c+2,fill:"none",stroke:"#fff"}))}},{key:"renderTraveller",value:function(r,i){var o;return de.isValidElement(r)?o=de.cloneElement(r,i):mn(r)?o=r(i):o=e.renderDefaultTraveller(i),o}},{key:"getDerivedStateFromProps",value:function(r,i){var o=r.data,s=r.width,a=r.x,l=r.travellerWidth,c=r.updateId,u=r.startIndex,f=r.endIndex;if(o!==i.prevData||c!==i.prevUpdateId)return X7({prevData:o,prevTravellerWidth:l,prevUpdateId:c,prevX:a,prevWidth:s},o&&o.length?AFn({data:o,width:s,x:a,travellerWidth:l,startIndex:u,endIndex:f}):{scale:null,scaleValues:null});if(i.scale&&(s!==i.prevWidth||a!==i.prevX||l!==i.prevTravellerWidth)){i.scale.range([a,a+s-l]);var d=i.scale.domain().map(function(h){return i.scale(h)});return{prevData:o,prevTravellerWidth:l,prevUpdateId:c,prevX:a,prevWidth:s,startX:i.scale(r.startIndex),endX:i.scale(r.endIndex),scaleValues:d}}return null}},{key:"getIndexInRange",value:function(r,i){for(var o=r.length,s=0,a=o-1;a-s>1;){var l=Math.floor((s+a)/2);r[l]>i?a=l:s=l}return i>=r[a]?a:s}}]),e}(D.PureComponent);Vl(jb,"displayName","Brush");Vl(jb,"defaultProps",{height:40,travellerWidth:5,gap:1,fill:"#fff",stroke:"#666",padding:{top:1,right:1,bottom:1,left:1},leaveTimeOut:1e3,alwaysShowText:!1});var PFn=Ice;function MFn(t,e){var n;return PFn(t,function(r,i,o){return n=e(r,i,o),!n}),!!n}var RFn=MFn,DFn=MHe,IFn=i0,LFn=RFn,$Fn=Ml,FFn=XU;function NFn(t,e,n){var r=$Fn(t)?DFn:LFn;return n&&FFn(t,e,n)&&(e=void 0),r(t,IFn(e))}var zFn=NFn;const jFn=sn(zFn);var bh=function(e,n){var r=e.alwaysShow,i=e.ifOverflow;return r&&(i="extendDomain"),i===n},RCe=eqe;function BFn(t,e,n){e=="__proto__"&&RCe?RCe(t,e,{configurable:!0,enumerable:!0,value:n,writable:!0}):t[e]=n}var UFn=BFn,WFn=UFn,VFn=ZHe,GFn=i0;function HFn(t,e){var n={};return e=GFn(e),VFn(t,function(r,i,o){WFn(n,i,e(r,i,o))}),n}var qFn=HFn;const XFn=sn(qFn);function YFn(t,e){for(var n=-1,r=t==null?0:t.length;++n=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function dNn(t,e){if(t==null)return{};var n={},r=Object.keys(t),i,o;for(o=0;o=0)&&(n[i]=t[i]);return n}function hNn(t,e){var n=t.x,r=t.y,i=fNn(t,aNn),o="".concat(n),s=parseInt(o,10),a="".concat(r),l=parseInt(a,10),c="".concat(e.height||i.height),u=parseInt(c,10),f="".concat(e.width||i.width),d=parseInt(f,10);return R2(R2(R2(R2(R2({},e),i),s?{x:s}:{}),l?{y:l}:{}),{},{height:u,width:d,name:e.name,radius:e.radius})}function ICe(t){return de.createElement(K3n,RZ({shapeType:"rectangle",propTransformer:hNn,activeClassName:"recharts-active-bar"},t))}var pNn=function(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return function(r,i){if(typeof e=="number")return e;var o=typeof r=="number";return o?e(r,i):(o||zb(),n)}},gNn=["value","background"],Qqe;function RC(t){"@babel/helpers - typeof";return RC=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},RC(t)}function mNn(t,e){if(t==null)return{};var n=vNn(t,e),r,i;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);for(i=0;i=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function vNn(t,e){if(t==null)return{};var n={},r=Object.keys(t),i,o;for(o=0;o=0)&&(n[i]=t[i]);return n}function Yz(){return Yz=Object.assign?Object.assign.bind():function(t){for(var e=1;e0&&Math.abs(T)0&&Math.abs(R)0&&(R=Math.min((q||0)-(T[G-1]||0),R))}),Number.isFinite(R)){var M=R/A,I=g.layout==="vertical"?r.height:r.width;if(g.padding==="gap"&&(S=M*I/2),g.padding==="no-gap"){var j=Fb(e.barCategoryGap,M*I),N=M*I/2;S=N-j-(N-j)/I*j}}}i==="xAxis"?O=[r.left+(x.left||0)+(S||0),r.left+r.width-(x.right||0)-(S||0)]:i==="yAxis"?O=l==="horizontal"?[r.top+r.height-(x.bottom||0),r.top+(x.top||0)]:[r.top+(x.top||0)+(S||0),r.top+r.height-(x.bottom||0)-(S||0)]:O=g.range,w&&(O=[O[1],O[0]]);var z=pIn(g,o,d),L=z.scale,B=z.realScaleType;L.domain(v).range(O),gIn(L);var F=SIn(L,gf(gf({},g),{},{realScaleType:B}));i==="xAxis"?(P=m==="top"&&!b||m==="bottom"&&b,k=r.left,E=f[_]-P*g.height):i==="yAxis"&&(P=m==="left"&&!b||m==="right"&&b,k=f[_]-P*g.width,E=r.top);var $=gf(gf(gf({},g),F),{},{realScaleType:B,x:k,y:E,scale:L,width:i==="xAxis"?r.width:g.width,height:i==="yAxis"?r.height:g.height});return $.bandSize=Fz($,F),!g.hide&&i==="xAxis"?f[_]+=(P?-1:1)*$.height:g.hide||(f[_]+=(P?-1:1)*$.width),gf(gf({},h),{},t8({},p,$))},{})},eXe=function(e,n){var r=e.x,i=e.y,o=n.x,s=n.y;return{x:Math.min(r,o),y:Math.min(i,s),width:Math.abs(o-r),height:Math.abs(s-i)}},TNn=function(e){var n=e.x1,r=e.y1,i=e.x2,o=e.y2;return eXe({x:n,y:r},{x:i,y:o})},tXe=function(){function t(e){CNn(this,t),this.scale=e}return ONn(t,[{key:"domain",get:function(){return this.scale.domain}},{key:"range",get:function(){return this.scale.range}},{key:"rangeMin",get:function(){return this.range()[0]}},{key:"rangeMax",get:function(){return this.range()[1]}},{key:"bandwidth",get:function(){return this.scale.bandwidth}},{key:"apply",value:function(n){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=r.bandAware,o=r.position;if(n!==void 0){if(o)switch(o){case"start":return this.scale(n);case"middle":{var s=this.bandwidth?this.bandwidth()/2:0;return this.scale(n)+s}case"end":{var a=this.bandwidth?this.bandwidth():0;return this.scale(n)+a}default:return this.scale(n)}if(i){var l=this.bandwidth?this.bandwidth()/2:0;return this.scale(n)+l}return this.scale(n)}}},{key:"isInRange",value:function(n){var r=this.range(),i=r[0],o=r[r.length-1];return i<=o?n>=i&&n<=o:n>=o&&n<=i}}],[{key:"create",value:function(n){return new t(n)}}]),t}();t8(tXe,"EPS",1e-4);var Uce=function(e){var n=Object.keys(e).reduce(function(r,i){return gf(gf({},r),{},t8({},i,tXe.create(e[i])))},{});return gf(gf({},n),{},{apply:function(i){var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},s=o.bandAware,a=o.position;return XFn(i,function(l,c){return n[c].apply(l,{bandAware:s,position:a})})},isInRange:function(i){return Yqe(i,function(o,s){return n[s].isInRange(o)})}})};function kNn(t){return(t%180+180)%180}var ANn=function(e){var n=e.width,r=e.height,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,o=kNn(i),s=o*Math.PI/180,a=Math.atan(r/n),l=s>a&&s-1?i[o?e[s]:s]:void 0}}var INn=DNn,LNn=Gqe;function $Nn(t){var e=LNn(t),n=e%1;return e===e?n?e-n:e:0}var FNn=$Nn,NNn=GHe,zNn=i0,jNn=FNn,BNn=Math.max;function UNn(t,e,n){var r=t==null?0:t.length;if(!r)return-1;var i=n==null?0:jNn(n);return i<0&&(i=BNn(r+i,0)),NNn(t,zNn(e),i)}var WNn=UNn,VNn=INn,GNn=WNn,HNn=VNn(GNn),qNn=HNn;const XNn=sn(qNn);var YNn=x_n(function(t){return{x:t.left,y:t.top,width:t.width,height:t.height}},function(t){return["l",t.left,"t",t.top,"w",t.width,"h",t.height].join("")}),Wce=D.createContext(void 0),Vce=D.createContext(void 0),nXe=D.createContext(void 0),rXe=D.createContext({}),iXe=D.createContext(void 0),oXe=D.createContext(0),sXe=D.createContext(0),zCe=function(e){var n=e.state,r=n.xAxisMap,i=n.yAxisMap,o=n.offset,s=e.clipPathId,a=e.children,l=e.width,c=e.height,u=YNn(o);return de.createElement(Wce.Provider,{value:r},de.createElement(Vce.Provider,{value:i},de.createElement(rXe.Provider,{value:o},de.createElement(nXe.Provider,{value:u},de.createElement(iXe.Provider,{value:s},de.createElement(oXe.Provider,{value:c},de.createElement(sXe.Provider,{value:l},a)))))))},QNn=function(){return D.useContext(iXe)},aXe=function(e){var n=D.useContext(Wce);n==null&&zb();var r=n[e];return r==null&&zb(),r},KNn=function(){var e=D.useContext(Wce);return ov(e)},ZNn=function(){var e=D.useContext(Vce),n=XNn(e,function(r){return Yqe(r.domain,Number.isFinite)});return n||ov(e)},lXe=function(e){var n=D.useContext(Vce);n==null&&zb();var r=n[e];return r==null&&zb(),r},JNn=function(){var e=D.useContext(nXe);return e},e5n=function(){return D.useContext(rXe)},Gce=function(){return D.useContext(sXe)},Hce=function(){return D.useContext(oXe)};function eM(t){"@babel/helpers - typeof";return eM=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},eM(t)}function jCe(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function BCe(t){for(var e=1;et.length)&&(e=t.length);for(var n=0,r=new Array(e);nt*i)return!1;var o=n();return t*(e-t*o/2-r)>=0&&t*(e+t*o/2-i)<=0}function w5n(t,e){return cXe(t,e+1)}function _5n(t,e,n,r,i){for(var o=(r||[]).slice(),s=e.start,a=e.end,l=0,c=1,u=s,f=function(){var p=r==null?void 0:r[l];if(p===void 0)return{v:cXe(r,c)};var g=l,m,v=function(){return m===void 0&&(m=n(p,g)),m},y=p.coordinate,x=l===0||Kz(t,y,v,u,a);x||(l=0,u=s,c+=1),x&&(u=y+t*(v()/2+i),l+=c)},d;c<=o.length;)if(d=f(),d)return d.v;return[]}function rM(t){"@babel/helpers - typeof";return rM=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},rM(t)}function qCe(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function Ns(t){for(var e=1;e0?h.coordinate-m*t:h.coordinate})}else o[d]=h=Ns(Ns({},h),{},{tickCoord:h.coordinate});var v=Kz(t,h.tickCoord,g,a,l);v&&(l=h.tickCoord-t*(g()/2+i),o[d]=Ns(Ns({},h),{},{isShow:!0}))},u=s-1;u>=0;u--)c(u);return o}function T5n(t,e,n,r,i,o){var s=(r||[]).slice(),a=s.length,l=e.start,c=e.end;if(o){var u=r[a-1],f=n(u,a-1),d=t*(u.coordinate+t*f/2-c);s[a-1]=u=Ns(Ns({},u),{},{tickCoord:d>0?u.coordinate-d*t:u.coordinate});var h=Kz(t,u.tickCoord,function(){return f},l,c);h&&(c=u.tickCoord-t*(f/2+i),s[a-1]=Ns(Ns({},u),{},{isShow:!0}))}for(var p=o?a-1:a,g=function(y){var x=s[y],b,w=function(){return b===void 0&&(b=n(x,y)),b};if(y===0){var _=t*(x.coordinate-t*w()/2-l);s[y]=x=Ns(Ns({},x),{},{tickCoord:_<0?x.coordinate-_*t:x.coordinate})}else s[y]=x=Ns(Ns({},x),{},{tickCoord:x.coordinate});var S=Kz(t,x.tickCoord,w,l,c);S&&(l=x.tickCoord+t*(w()/2+i),s[y]=Ns(Ns({},x),{},{isShow:!0}))},m=0;m=2?Pf(i[1].coordinate-i[0].coordinate):1,v=b5n(o,m,h);return l==="equidistantPreserveStart"?_5n(m,v,g,i,s):(l==="preserveStart"||l==="preserveStartEnd"?d=T5n(m,v,g,i,s,l==="preserveStartEnd"):d=E5n(m,v,g,i,s),d.filter(function(y){return y.isShow}))}var k5n=["viewBox"],A5n=["viewBox"],P5n=["ticks"];function DC(t){"@babel/helpers - typeof";return DC=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},DC(t)}function y_(){return y_=Object.assign?Object.assign.bind():function(t){for(var e=1;e=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function M5n(t,e){if(t==null)return{};var n={},r=Object.keys(t),i,o;for(o=0;o=0)&&(n[i]=t[i]);return n}function R5n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function YCe(t,e){for(var n=0;n0?l(this.props):l(h)),s<=0||a<=0||!p||!p.length?null:de.createElement(Ur,{className:Oe("recharts-cartesian-axis",c),ref:function(m){r.layerReference=m}},o&&this.renderAxisLine(),this.renderTicks(p,this.state.fontSize,this.state.letterSpacing),Ws.renderCallByParent(this.props))}}],[{key:"renderTickItem",value:function(r,i,o){var s;return de.isValidElement(r)?s=de.cloneElement(r,i):mn(r)?s=r(i):s=de.createElement(Dz,y_({},i,{className:"recharts-cartesian-axis-tick-value"}),o),s}}]),e}(D.Component);Xce(dE,"displayName","CartesianAxis");Xce(dE,"defaultProps",{x:0,y:0,width:0,height:0,viewBox:{x:0,y:0,width:0,height:0},orientation:"bottom",ticks:[],stroke:"#666",tickLine:!0,axisLine:!0,tick:!0,mirror:!1,minTickGap:5,tickSize:6,tickMargin:2,interval:"preserveEnd"});var z5n=["x1","y1","x2","y2","key"],j5n=["offset"];function Bb(t){"@babel/helpers - typeof";return Bb=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Bb(t)}function QCe(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function Vs(t){for(var e=1;e=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function V5n(t,e){if(t==null)return{};var n={},r=Object.keys(t),i,o;for(o=0;o=0)&&(n[i]=t[i]);return n}var G5n=function(e){var n=e.fill;if(!n||n==="none")return null;var r=e.fillOpacity,i=e.x,o=e.y,s=e.width,a=e.height;return de.createElement("rect",{x:i,y:o,width:s,height:a,stroke:"none",fill:n,fillOpacity:r,className:"recharts-cartesian-grid-bg"})};function dXe(t,e){var n;if(de.isValidElement(t))n=de.cloneElement(t,e);else if(mn(t))n=t(e);else{var r=e.x1,i=e.y1,o=e.x2,s=e.y2,a=e.key,l=KCe(e,z5n),c=pn(l,!1);c.offset;var u=KCe(c,j5n);n=de.createElement("line",bx({},u,{x1:r,y1:i,x2:o,y2:s,fill:"none",key:a}))}return n}function H5n(t){var e=t.x,n=t.width,r=t.horizontal,i=r===void 0?!0:r,o=t.horizontalPoints;if(!i||!o||!o.length)return null;var s=o.map(function(a,l){var c=Vs(Vs({},t),{},{x1:e,y1:a,x2:e+n,y2:a,key:"line-".concat(l),index:l});return dXe(i,c)});return de.createElement("g",{className:"recharts-cartesian-grid-horizontal"},s)}function q5n(t){var e=t.y,n=t.height,r=t.vertical,i=r===void 0?!0:r,o=t.verticalPoints;if(!i||!o||!o.length)return null;var s=o.map(function(a,l){var c=Vs(Vs({},t),{},{x1:a,y1:e,x2:a,y2:e+n,key:"line-".concat(l),index:l});return dXe(i,c)});return de.createElement("g",{className:"recharts-cartesian-grid-vertical"},s)}function X5n(t){var e=t.horizontalFill,n=t.fillOpacity,r=t.x,i=t.y,o=t.width,s=t.height,a=t.horizontalPoints,l=t.horizontal,c=l===void 0?!0:l;if(!c||!e||!e.length)return null;var u=a.map(function(d){return Math.round(d+i-i)}).sort(function(d,h){return d-h});i!==u[0]&&u.unshift(0);var f=u.map(function(d,h){var p=!u[h+1],g=p?i+s-d:u[h+1]-d;if(g<=0)return null;var m=h%e.length;return de.createElement("rect",{key:"react-".concat(h),y:d,x:r,height:g,width:o,stroke:"none",fill:e[m],fillOpacity:n,className:"recharts-cartesian-grid-bg"})});return de.createElement("g",{className:"recharts-cartesian-gridstripes-horizontal"},f)}function Y5n(t){var e=t.vertical,n=e===void 0?!0:e,r=t.verticalFill,i=t.fillOpacity,o=t.x,s=t.y,a=t.width,l=t.height,c=t.verticalPoints;if(!n||!r||!r.length)return null;var u=c.map(function(d){return Math.round(d+o-o)}).sort(function(d,h){return d-h});o!==u[0]&&u.unshift(0);var f=u.map(function(d,h){var p=!u[h+1],g=p?o+a-d:u[h+1]-d;if(g<=0)return null;var m=h%r.length;return de.createElement("rect",{key:"react-".concat(h),x:d,y:s,width:g,height:l,stroke:"none",fill:r[m],fillOpacity:i,className:"recharts-cartesian-grid-bg"})});return de.createElement("g",{className:"recharts-cartesian-gridstripes-vertical"},f)}var Q5n=function(e,n){var r=e.xAxis,i=e.width,o=e.height,s=e.offset;return Pqe(qce(Vs(Vs(Vs({},dE.defaultProps),r),{},{ticks:Kp(r,!0),viewBox:{x:0,y:0,width:i,height:o}})),s.left,s.left+s.width,n)},K5n=function(e,n){var r=e.yAxis,i=e.width,o=e.height,s=e.offset;return Pqe(qce(Vs(Vs(Vs({},dE.defaultProps),r),{},{ticks:Kp(r,!0),viewBox:{x:0,y:0,width:i,height:o}})),s.top,s.top+s.height,n)},uw={horizontal:!0,vertical:!0,horizontalPoints:[],verticalPoints:[],stroke:"#ccc",fill:"none",verticalFill:[],horizontalFill:[]};function Yce(t){var e,n,r,i,o,s,a=Gce(),l=Hce(),c=e5n(),u=Vs(Vs({},t),{},{stroke:(e=t.stroke)!==null&&e!==void 0?e:uw.stroke,fill:(n=t.fill)!==null&&n!==void 0?n:uw.fill,horizontal:(r=t.horizontal)!==null&&r!==void 0?r:uw.horizontal,horizontalFill:(i=t.horizontalFill)!==null&&i!==void 0?i:uw.horizontalFill,vertical:(o=t.vertical)!==null&&o!==void 0?o:uw.vertical,verticalFill:(s=t.verticalFill)!==null&&s!==void 0?s:uw.verticalFill,x:at(t.x)?t.x:c.left,y:at(t.y)?t.y:c.top,width:at(t.width)?t.width:c.width,height:at(t.height)?t.height:c.height}),f=u.x,d=u.y,h=u.width,p=u.height,g=u.syncWithTicks,m=u.horizontalValues,v=u.verticalValues,y=KNn(),x=ZNn();if(!at(h)||h<=0||!at(p)||p<=0||!at(f)||f!==+f||!at(d)||d!==+d)return null;var b=u.verticalCoordinatesGenerator||Q5n,w=u.horizontalCoordinatesGenerator||K5n,_=u.horizontalPoints,S=u.verticalPoints;if((!_||!_.length)&&mn(w)){var O=m&&m.length,k=w({yAxis:x?Vs(Vs({},x),{},{ticks:O?m:x.ticks}):void 0,width:a,height:l,offset:c},O?!0:g);pg(Array.isArray(k),"horizontalCoordinatesGenerator should return Array but instead it returned [".concat(Bb(k),"]")),Array.isArray(k)&&(_=k)}if((!S||!S.length)&&mn(b)){var E=v&&v.length,P=b({xAxis:y?Vs(Vs({},y),{},{ticks:E?v:y.ticks}):void 0,width:a,height:l,offset:c},E?!0:g);pg(Array.isArray(P),"verticalCoordinatesGenerator should return Array but instead it returned [".concat(Bb(P),"]")),Array.isArray(P)&&(S=P)}return de.createElement("g",{className:"recharts-cartesian-grid"},de.createElement(G5n,{fill:u.fill,fillOpacity:u.fillOpacity,x:u.x,y:u.y,width:u.width,height:u.height}),de.createElement(H5n,bx({},u,{offset:c,horizontalPoints:_,xAxis:y,yAxis:x})),de.createElement(q5n,bx({},u,{offset:c,verticalPoints:S,xAxis:y,yAxis:x})),de.createElement(X5n,bx({},u,{horizontalPoints:_})),de.createElement(Y5n,bx({},u,{verticalPoints:S})))}Yce.displayName="CartesianGrid";var Z5n=["type","layout","connectNulls","ref"];function IC(t){"@babel/helpers - typeof";return IC=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},IC(t)}function J5n(t,e){if(t==null)return{};var n=ezn(t,e),r,i;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);for(i=0;i=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function ezn(t,e){if(t==null)return{};var n={},r=Object.keys(t),i,o;for(o=0;o=0)&&(n[i]=t[i]);return n}function Mk(){return Mk=Object.assign?Object.assign.bind():function(t){for(var e=1;et.length)&&(e=t.length);for(var n=0,r=new Array(e);nf){h=[].concat(fw(l.slice(0,p)),[f-g]);break}var m=h.length%2===0?[0,d]:[d];return[].concat(fw(e.repeat(l,u)),fw(h),m).map(function(v){return"".concat(v,"px")}).join(", ")}),mf(Im(n),"id",iE("recharts-line-")),mf(Im(n),"pathRef",function(s){n.mainCurve=s}),mf(Im(n),"handleAnimationEnd",function(){n.setState({isAnimationFinished:!0}),n.props.onAnimationEnd&&n.props.onAnimationEnd()}),mf(Im(n),"handleAnimationStart",function(){n.setState({isAnimationFinished:!1}),n.props.onAnimationStart&&n.props.onAnimationStart()}),n}return szn(e,[{key:"componentDidMount",value:function(){if(this.props.isAnimationActive){var r=this.getTotalLength();this.setState({totalLength:r})}}},{key:"componentDidUpdate",value:function(){if(this.props.isAnimationActive){var r=this.getTotalLength();r!==this.state.totalLength&&this.setState({totalLength:r})}}},{key:"getTotalLength",value:function(){var r=this.mainCurve;try{return r&&r.getTotalLength&&r.getTotalLength()||0}catch{return 0}}},{key:"renderErrorBar",value:function(r,i){if(this.props.isAnimationActive&&!this.state.isAnimationFinished)return null;var o=this.props,s=o.points,a=o.xAxis,l=o.yAxis,c=o.layout,u=o.children,f=yu(u,uE);if(!f)return null;var d=function(g,m){return{x:g.x,y:g.y,value:g.value,errorVal:Ma(g.payload,m)}},h={clipPath:r?"url(#clipPath-".concat(i,")"):null};return de.createElement(Ur,h,f.map(function(p){return de.cloneElement(p,{key:"bar-".concat(p.props.dataKey),data:s,xAxis:a,yAxis:l,layout:c,dataPointFormatter:d})}))}},{key:"renderDots",value:function(r,i,o){var s=this.props.isAnimationActive;if(s&&!this.state.isAnimationFinished)return null;var a=this.props,l=a.dot,c=a.points,u=a.dataKey,f=pn(this.props,!1),d=pn(l,!0),h=c.map(function(g,m){var v=Bl(Bl(Bl({key:"dot-".concat(m),r:3},f),d),{},{value:g.value,dataKey:u,cx:g.x,cy:g.y,index:m,payload:g.payload});return e.renderDotItem(l,v)}),p={clipPath:r?"url(#clipPath-".concat(i?"":"dots-").concat(o,")"):null};return de.createElement(Ur,Mk({className:"recharts-line-dots",key:"dots"},p),h)}},{key:"renderCurveStatically",value:function(r,i,o,s){var a=this.props,l=a.type,c=a.layout,u=a.connectNulls;a.ref;var f=J5n(a,Z5n),d=Bl(Bl(Bl({},pn(f,!0)),{},{fill:"none",className:"recharts-line-curve",clipPath:i?"url(#clipPath-".concat(o,")"):null,points:r},s),{},{type:l,layout:c,connectNulls:u});return de.createElement(iS,Mk({},d,{pathRef:this.pathRef}))}},{key:"renderCurveWithAnimation",value:function(r,i){var o=this,s=this.props,a=s.points,l=s.strokeDasharray,c=s.isAnimationActive,u=s.animationBegin,f=s.animationDuration,d=s.animationEasing,h=s.animationId,p=s.animateNewValues,g=s.width,m=s.height,v=this.state,y=v.prevPoints,x=v.totalLength;return de.createElement(Ih,{begin:u,duration:f,isActive:c,easing:d,from:{t:0},to:{t:1},key:"line-".concat(h),onAnimationEnd:this.handleAnimationEnd,onAnimationStart:this.handleAnimationStart},function(b){var w=b.t;if(y){var _=y.length/a.length,S=a.map(function(A,R){var T=Math.floor(R*_);if(y[T]){var M=y[T],I=ls(M.x,A.x),j=ls(M.y,A.y);return Bl(Bl({},A),{},{x:I(w),y:j(w)})}if(p){var N=ls(g*2,A.x),z=ls(m/2,A.y);return Bl(Bl({},A),{},{x:N(w),y:z(w)})}return Bl(Bl({},A),{},{x:A.x,y:A.y})});return o.renderCurveStatically(S,r,i)}var O=ls(0,x),k=O(w),E;if(l){var P="".concat(l).split(/[,\s]+/gim).map(function(A){return parseFloat(A)});E=o.getStrokeDasharray(k,x,P)}else E=o.generateSimpleStrokeDasharray(x,k);return o.renderCurveStatically(a,r,i,{strokeDasharray:E})})}},{key:"renderCurve",value:function(r,i){var o=this.props,s=o.points,a=o.isAnimationActive,l=this.state,c=l.prevPoints,u=l.totalLength;return a&&s&&s.length&&(!c&&u>0||!AC(c,s))?this.renderCurveWithAnimation(r,i):this.renderCurveStatically(s,r,i)}},{key:"render",value:function(){var r,i=this.props,o=i.hide,s=i.dot,a=i.points,l=i.className,c=i.xAxis,u=i.yAxis,f=i.top,d=i.left,h=i.width,p=i.height,g=i.isAnimationActive,m=i.id;if(o||!a||!a.length)return null;var v=this.state.isAnimationFinished,y=a.length===1,x=Oe("recharts-line",l),b=c&&c.allowDataOverflow,w=u&&u.allowDataOverflow,_=b||w,S=wn(m)?this.id:m,O=(r=pn(s,!1))!==null&&r!==void 0?r:{r:3,strokeWidth:2},k=O.r,E=k===void 0?3:k,P=O.strokeWidth,A=P===void 0?2:P,R=yHe(s)?s:{},T=R.clipDot,M=T===void 0?!0:T,I=E*2+A;return de.createElement(Ur,{className:x},b||w?de.createElement("defs",null,de.createElement("clipPath",{id:"clipPath-".concat(S)},de.createElement("rect",{x:b?d:d-h/2,y:w?f:f-p/2,width:b?h:h*2,height:w?p:p*2})),!M&&de.createElement("clipPath",{id:"clipPath-dots-".concat(S)},de.createElement("rect",{x:d-I/2,y:f-I/2,width:h+I,height:p+I}))):null,!y&&this.renderCurve(_,S),this.renderErrorBar(_,S),(y||s)&&this.renderDots(_,M,S),(!g||v)&&mg.renderCallByParent(this.props,a))}}],[{key:"getDerivedStateFromProps",value:function(r,i){return r.animationId!==i.prevAnimationId?{prevAnimationId:r.animationId,curPoints:r.points,prevPoints:i.curPoints}:r.points!==i.curPoints?{curPoints:r.points}:null}},{key:"repeat",value:function(r,i){for(var o=r.length%2!==0?[].concat(fw(r),[0]):r,s=[],a=0;a=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function hzn(t,e){if(t==null)return{};var n={},r=Object.keys(t),i,o;for(o=0;o=0)&&(n[i]=t[i]);return n}function wx(){return wx=Object.assign?Object.assign.bind():function(t){for(var e=1;e0||!AC(u,s)||!AC(f,a))?this.renderAreaWithAnimation(r,i):this.renderAreaStatically(s,a,r,i)}},{key:"render",value:function(){var r,i=this.props,o=i.hide,s=i.dot,a=i.points,l=i.className,c=i.top,u=i.left,f=i.xAxis,d=i.yAxis,h=i.width,p=i.height,g=i.isAnimationActive,m=i.id;if(o||!a||!a.length)return null;var v=this.state.isAnimationFinished,y=a.length===1,x=Oe("recharts-area",l),b=f&&f.allowDataOverflow,w=d&&d.allowDataOverflow,_=b||w,S=wn(m)?this.id:m,O=(r=pn(s,!1))!==null&&r!==void 0?r:{r:3,strokeWidth:2},k=O.r,E=k===void 0?3:k,P=O.strokeWidth,A=P===void 0?2:P,R=yHe(s)?s:{},T=R.clipDot,M=T===void 0?!0:T,I=E*2+A;return de.createElement(Ur,{className:x},b||w?de.createElement("defs",null,de.createElement("clipPath",{id:"clipPath-".concat(S)},de.createElement("rect",{x:b?u:u-h/2,y:w?c:c-p/2,width:b?h:h*2,height:w?p:p*2})),!M&&de.createElement("clipPath",{id:"clipPath-dots-".concat(S)},de.createElement("rect",{x:u-I/2,y:c-I/2,width:h+I,height:p+I}))):null,y?null:this.renderArea(_,S),(s||y)&&this.renderDots(_,M,S),(!g||v)&&mg.renderCallByParent(this.props,a))}}],[{key:"getDerivedStateFromProps",value:function(r,i){return r.animationId!==i.prevAnimationId?{prevAnimationId:r.animationId,curPoints:r.points,curBaseLine:r.baseLine,prevPoints:i.curPoints,prevBaseLine:i.curBaseLine}:r.points!==i.curPoints||r.baseLine!==i.curBaseLine?{curPoints:r.points,curBaseLine:r.baseLine}:null}}]),e}(D.PureComponent);gXe=s0;nh(s0,"displayName","Area");nh(s0,"defaultProps",{stroke:"#3182bd",fill:"#3182bd",fillOpacity:.6,xAxisId:0,yAxisId:0,legendType:"line",connectNulls:!1,points:[],dot:!1,activeDot:!0,hide:!1,isAnimationActive:!xh.isSsr,animationBegin:0,animationDuration:1500,animationEasing:"ease"});nh(s0,"getBaseValue",function(t,e,n,r){var i=t.layout,o=t.baseValue,s=e.props.baseValue,a=s??o;if(at(a)&&typeof a=="number")return a;var l=i==="horizontal"?r:n,c=l.scale.domain();if(l.type==="number"){var u=Math.max(c[0],c[1]),f=Math.min(c[0],c[1]);return a==="dataMin"?f:a==="dataMax"||u<0?u:Math.max(Math.min(c[0],c[1]),0)}return a==="dataMin"?c[0]:a==="dataMax"?c[1]:c[0]});nh(s0,"getComposedData",function(t){var e=t.props,n=t.item,r=t.xAxis,i=t.yAxis,o=t.xAxisTicks,s=t.yAxisTicks,a=t.bandSize,l=t.dataKey,c=t.stackedData,u=t.dataStartIndex,f=t.displayedData,d=t.offset,h=e.layout,p=c&&c.length,g=gXe.getBaseValue(e,n,r,i),m=h==="horizontal",v=!1,y=f.map(function(b,w){var _;p?_=c[u+w]:(_=Ma(b,l),Array.isArray(_)?v=!0:_=[g,_]);var S=_[1]==null||p&&Ma(b,l)==null;return m?{x:$z({axis:r,ticks:o,bandSize:a,entry:b,index:w}),y:S?null:i.scale(_[1]),value:_,payload:b}:{x:S?null:r.scale(_[1]),y:$z({axis:i,ticks:s,bandSize:a,entry:b,index:w}),value:_,payload:b}}),x;return p||v?x=y.map(function(b){var w=Array.isArray(b.value)?b.value[0]:null;return m?{x:b.x,y:w!=null&&b.y!=null?i.scale(w):null}:{x:w!=null?r.scale(w):null,y:b.y}}):x=m?i.scale(g):r.scale(g),Lm({points:y,baseLine:x,layout:h,isRange:v},d)});nh(s0,"renderDotItem",function(t,e){var n;if(de.isValidElement(t))n=de.cloneElement(t,e);else if(mn(t))n=t(e);else{var r=Oe("recharts-area-dot",typeof t!="boolean"?t.className:"");n=de.createElement(ZU,wx({},e,{className:r}))}return n});function BZ(){return BZ=Object.assign?Object.assign.bind():function(t){for(var e=1;et.length)&&(e=t.length);for(var n=0,r=new Array(e);n=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function Wzn(t,e){if(t==null)return{};var n={},r=Object.keys(t),i,o;for(o=0;o=0)&&(n[i]=t[i]);return n}function Vzn(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Gzn(t,e){for(var n=0;nt.length)&&(e=t.length);for(var n=0,r=new Array(e);n0?s:e&&e.length&&at(i)&&at(o)?e.slice(i,o+1):[]};function OXe(t){return t==="number"?[0,"auto"]:void 0}var qZ=function(e,n,r,i){var o=e.graphicalItems,s=e.tooltipAxis,a=n8(n,e);return r<0||!o||!o.length||r>=a.length?null:o.reduce(function(l,c){var u,f=(u=c.props.data)!==null&&u!==void 0?u:n;f&&e.dataStartIndex+e.dataEndIndex!==0&&(f=f.slice(e.dataStartIndex,e.dataEndIndex+1));var d;if(s.dataKey&&!s.allowDuplicatedCategory){var h=f===void 0?a:f;d=_z(h,s.dataKey,i)}else d=f&&f[r]||a[r];return d?[].concat(FC(l),[Rqe(c,d)]):l},[])},aOe=function(e,n,r,i){var o=i||{x:e.chartX,y:e.chartY},s=njn(o,r),a=e.orderedTooltipTicks,l=e.tooltipAxis,c=e.tooltipTicks,u=lIn(s,a,c,l);if(u>=0&&c){var f=c[u]&&c[u].value,d=qZ(e,n,u,f),h=rjn(r,a,u,o);return{activeTooltipIndex:u,activeLabel:f,activePayload:d,activeCoordinate:h}}return null},ijn=function(e,n){var r=n.axes,i=n.graphicalItems,o=n.axisType,s=n.axisIdKey,a=n.stackGroups,l=n.dataStartIndex,c=n.dataEndIndex,u=e.layout,f=e.children,d=e.stackOffset,h=Aqe(u,o);return r.reduce(function(p,g){var m,v=g.props,y=v.type,x=v.dataKey,b=v.allowDataOverflow,w=v.allowDuplicatedCategory,_=v.scale,S=v.ticks,O=v.includeHidden,k=g.props[s];if(p[k])return p;var E=n8(e.data,{graphicalItems:i.filter(function(F){return F.props[s]===k}),dataStartIndex:l,dataEndIndex:c}),P=E.length,A,R,T;Mzn(g.props.domain,b,y)&&(A=gZ(g.props.domain,null,b),h&&(y==="number"||_!=="auto")&&(T=Ak(E,x,"category")));var M=OXe(y);if(!A||A.length===0){var I,j=(I=g.props.domain)!==null&&I!==void 0?I:M;if(x){if(A=Ak(E,x,y),y==="category"&&h){var N=hSn(A);w&&N?(R=A,A=Hz(0,P)):w||(A=NSe(j,A,g).reduce(function(F,$){return F.indexOf($)>=0?F:[].concat(FC(F),[$])},[]))}else if(y==="category")w?A=A.filter(function(F){return F!==""&&!wn(F)}):A=NSe(j,A,g).reduce(function(F,$){return F.indexOf($)>=0||$===""||wn($)?F:[].concat(FC(F),[$])},[]);else if(y==="number"){var z=hIn(E,i.filter(function(F){return F.props[s]===k&&(O||!F.props.hide)}),x,o,u);z&&(A=z)}h&&(y==="number"||_!=="auto")&&(T=Ak(E,x,"category"))}else h?A=Hz(0,P):a&&a[k]&&a[k].hasStack&&y==="number"?A=d==="expand"?[0,1]:Mqe(a[k].stackGroups,l,c):A=kqe(E,i.filter(function(F){return F.props[s]===k&&(O||!F.props.hide)}),y,u,!0);if(y==="number")A=VZ(f,A,k,o,S),j&&(A=gZ(j,A,b));else if(y==="category"&&j){var L=j,B=A.every(function(F){return L.indexOf(F)>=0});B&&(A=L)}}return Ge(Ge({},p),{},Yt({},k,Ge(Ge({},g.props),{},{axisType:o,domain:A,categoricalDomain:T,duplicateDomain:R,originalDomain:(m=g.props.domain)!==null&&m!==void 0?m:M,isCategorical:h,layout:u})))},{})},ojn=function(e,n){var r=n.graphicalItems,i=n.Axis,o=n.axisType,s=n.axisIdKey,a=n.stackGroups,l=n.dataStartIndex,c=n.dataEndIndex,u=e.layout,f=e.children,d=n8(e.data,{graphicalItems:r,dataStartIndex:l,dataEndIndex:c}),h=d.length,p=Aqe(u,o),g=-1;return r.reduce(function(m,v){var y=v.props[s],x=OXe("number");if(!m[y]){g++;var b;return p?b=Hz(0,h):a&&a[y]&&a[y].hasStack?(b=Mqe(a[y].stackGroups,l,c),b=VZ(f,b,y,o)):(b=gZ(x,kqe(d,r.filter(function(w){return w.props[s]===y&&!w.props.hide}),"number",u),i.defaultProps.allowDataOverflow),b=VZ(f,b,y,o)),Ge(Ge({},m),{},Yt({},y,Ge(Ge({axisType:o},i.defaultProps),{},{hide:!0,orientation:vu(ejn,"".concat(o,".").concat(g%2),null),domain:b,originalDomain:x,isCategorical:p,layout:u})))}return m},{})},sjn=function(e,n){var r=n.axisType,i=r===void 0?"xAxis":r,o=n.AxisComp,s=n.graphicalItems,a=n.stackGroups,l=n.dataStartIndex,c=n.dataEndIndex,u=e.children,f="".concat(i,"Id"),d=yu(u,o),h={};return d&&d.length?h=ijn(e,{axes:d,graphicalItems:s,axisType:i,axisIdKey:f,stackGroups:a,dataStartIndex:l,dataEndIndex:c}):s&&s.length&&(h=ojn(e,{Axis:o,graphicalItems:s,axisType:i,axisIdKey:f,stackGroups:a,dataStartIndex:l,dataEndIndex:c})),h},ajn=function(e){var n=ov(e),r=Kp(n,!1,!0);return{tooltipTicks:r,orderedTooltipTicks:Lce(r,function(i){return i.coordinate}),tooltipAxis:n,tooltipAxisBandSize:Fz(n,r)}},lOe=function(e){var n=e.children,r=e.defaultShowTooltip,i=Yl(n,jb),o=0,s=0;return e.data&&e.data.length!==0&&(s=e.data.length-1),i&&i.props&&(i.props.startIndex>=0&&(o=i.props.startIndex),i.props.endIndex>=0&&(s=i.props.endIndex)),{chartX:0,chartY:0,dataStartIndex:o,dataEndIndex:s,activeTooltipIndex:-1,isTooltipActive:!!r}},ljn=function(e){return!e||!e.length?!1:e.some(function(n){var r=hg(n&&n.type);return r&&r.indexOf("Bar")>=0})},cOe=function(e){return e==="horizontal"?{numericAxisName:"yAxis",cateAxisName:"xAxis"}:e==="vertical"?{numericAxisName:"xAxis",cateAxisName:"yAxis"}:e==="centric"?{numericAxisName:"radiusAxis",cateAxisName:"angleAxis"}:{numericAxisName:"angleAxis",cateAxisName:"radiusAxis"}},cjn=function(e,n){var r=e.props,i=e.graphicalItems,o=e.xAxisMap,s=o===void 0?{}:o,a=e.yAxisMap,l=a===void 0?{}:a,c=r.width,u=r.height,f=r.children,d=r.margin||{},h=Yl(f,jb),p=Yl(f,EC),g=Object.keys(l).reduce(function(w,_){var S=l[_],O=S.orientation;return!S.mirror&&!S.hide?Ge(Ge({},w),{},Yt({},O,w[O]+S.width)):w},{left:d.left||0,right:d.right||0}),m=Object.keys(s).reduce(function(w,_){var S=s[_],O=S.orientation;return!S.mirror&&!S.hide?Ge(Ge({},w),{},Yt({},O,vu(w,"".concat(O))+S.height)):w},{top:d.top||0,bottom:d.bottom||0}),v=Ge(Ge({},m),g),y=v.bottom;h&&(v.bottom+=h.props.height||jb.defaultProps.height),p&&n&&(v=fIn(v,i,r,n));var x=c-v.left-v.right,b=u-v.top-v.bottom;return Ge(Ge({brushBottom:y},v),{},{width:Math.max(x,0),height:Math.max(b,0)})},ujn=function(e,n){if(n==="xAxis")return e[n].width;if(n==="yAxis")return e[n].height},Qce=function(e){var n,r=e.chartName,i=e.GraphicalChild,o=e.defaultTooltipEventType,s=o===void 0?"axis":o,a=e.validateTooltipEventTypes,l=a===void 0?["axis"]:a,c=e.axisComponents,u=e.legendContent,f=e.formatAxisMap,d=e.defaultProps,h=function(m,v){var y=v.graphicalItems,x=v.stackGroups,b=v.offset,w=v.updateId,_=v.dataStartIndex,S=v.dataEndIndex,O=m.barSize,k=m.layout,E=m.barGap,P=m.barCategoryGap,A=m.maxBarSize,R=cOe(k),T=R.numericAxisName,M=R.cateAxisName,I=ljn(y),j=[];return y.forEach(function(N,z){var L=n8(m.data,{graphicalItems:[N],dataStartIndex:_,dataEndIndex:S}),B=N.props,F=B.dataKey,$=B.maxBarSize,q=N.props["".concat(T,"Id")],G=N.props["".concat(M,"Id")],Y={},le=c.reduce(function(he,xe){var H=v["".concat(xe.axisType,"Map")],W=N.props["".concat(xe.axisType,"Id")];H&&H[W]||xe.axisType==="zAxis"||zb();var J=H[W];return Ge(Ge({},he),{},Yt(Yt({},xe.axisType,J),"".concat(xe.axisType,"Ticks"),Kp(J)))},Y),K=le[M],ee=le["".concat(M,"Ticks")],re=x&&x[q]&&x[q].hasStack&&OIn(N,x[q].stackGroups),ge=hg(N.type).indexOf("Bar")>=0,te=Fz(K,ee),ae=[],U=I&&cIn({barSize:O,stackGroups:x,totalSize:ujn(le,M)});if(ge){var oe,ne,V=wn($)?A:$,X=(oe=(ne=Fz(K,ee,!0))!==null&&ne!==void 0?ne:V)!==null&&oe!==void 0?oe:0;ae=uIn({barGap:E,barCategoryGap:P,bandSize:X!==te?X:te,sizeList:U[G],maxBarSize:V}),X!==te&&(ae=ae.map(function(he){return Ge(Ge({},he),{},{position:Ge(Ge({},he.position),{},{offset:he.position.offset-X/2})})}))}var Z=N&&N.type&&N.type.getComposedData;Z&&j.push({props:Ge(Ge({},Z(Ge(Ge({},le),{},{displayedData:L,props:m,dataKey:F,item:N,bandSize:te,barPosition:ae,offset:b,stackedData:re,layout:k,dataStartIndex:_,dataEndIndex:S}))),{},Yt(Yt(Yt({key:N.key||"item-".concat(z)},T,le[T]),M,le[M]),"animationId",w)),childIndex:CSn(N,m.children),item:N})}),j},p=function(m,v){var y=m.props,x=m.dataStartIndex,b=m.dataEndIndex,w=m.updateId;if(!x_e({props:y}))return null;var _=y.children,S=y.layout,O=y.stackOffset,k=y.data,E=y.reverseStackOrder,P=cOe(S),A=P.numericAxisName,R=P.cateAxisName,T=yu(_,i),M=_In(k,T,"".concat(A,"Id"),"".concat(R,"Id"),O,E),I=c.reduce(function(B,F){var $="".concat(F.axisType,"Map");return Ge(Ge({},B),{},Yt({},$,sjn(y,Ge(Ge({},F),{},{graphicalItems:T,stackGroups:F.axisType===A&&M,dataStartIndex:x,dataEndIndex:b}))))},{}),j=cjn(Ge(Ge({},I),{},{props:y,graphicalItems:T}),v==null?void 0:v.legendBBox);Object.keys(I).forEach(function(B){I[B]=f(y,I[B],j,B.replace("Map",""),r)});var N=I["".concat(R,"Map")],z=ajn(N),L=h(y,Ge(Ge({},I),{},{dataStartIndex:x,dataEndIndex:b,updateId:w,graphicalItems:T,stackGroups:M,offset:j}));return Ge(Ge({formattedGraphicalItems:L,graphicalItems:T,offset:j,stackGroups:M},z),I)};return n=function(g){Yzn(m,g);function m(v){var y,x,b;return Vzn(this,m),b=qzn(this,m,[v]),Yt(Wn(b),"eventEmitterSymbol",Symbol("rechartsEventEmitter")),Yt(Wn(b),"accessibilityManager",new Pzn),Yt(Wn(b),"handleLegendBBoxUpdate",function(w){if(w){var _=b.state,S=_.dataStartIndex,O=_.dataEndIndex,k=_.updateId;b.setState(Ge({legendBBox:w},p({props:b.props,dataStartIndex:S,dataEndIndex:O,updateId:k},Ge(Ge({},b.state),{},{legendBBox:w}))))}}),Yt(Wn(b),"handleReceiveSyncEvent",function(w,_,S){if(b.props.syncId===w){if(S===b.eventEmitterSymbol&&typeof b.props.syncMethod!="function")return;b.applySyncEvent(_)}}),Yt(Wn(b),"handleBrushChange",function(w){var _=w.startIndex,S=w.endIndex;if(_!==b.state.dataStartIndex||S!==b.state.dataEndIndex){var O=b.state.updateId;b.setState(function(){return Ge({dataStartIndex:_,dataEndIndex:S},p({props:b.props,dataStartIndex:_,dataEndIndex:S,updateId:O},b.state))}),b.triggerSyncEvent({dataStartIndex:_,dataEndIndex:S})}}),Yt(Wn(b),"handleMouseEnter",function(w){var _=b.getMouseInfo(w);if(_){var S=Ge(Ge({},_),{},{isTooltipActive:!0});b.setState(S),b.triggerSyncEvent(S);var O=b.props.onMouseEnter;mn(O)&&O(S,w)}}),Yt(Wn(b),"triggeredAfterMouseMove",function(w){var _=b.getMouseInfo(w),S=_?Ge(Ge({},_),{},{isTooltipActive:!0}):{isTooltipActive:!1};b.setState(S),b.triggerSyncEvent(S);var O=b.props.onMouseMove;mn(O)&&O(S,w)}),Yt(Wn(b),"handleItemMouseEnter",function(w){b.setState(function(){return{isTooltipActive:!0,activeItem:w,activePayload:w.tooltipPayload,activeCoordinate:w.tooltipPosition||{x:w.cx,y:w.cy}}})}),Yt(Wn(b),"handleItemMouseLeave",function(){b.setState(function(){return{isTooltipActive:!1}})}),Yt(Wn(b),"handleMouseMove",function(w){w.persist(),b.throttleTriggeredAfterMouseMove(w)}),Yt(Wn(b),"handleMouseLeave",function(w){b.throttleTriggeredAfterMouseMove.cancel();var _={isTooltipActive:!1};b.setState(_),b.triggerSyncEvent(_);var S=b.props.onMouseLeave;mn(S)&&S(_,w)}),Yt(Wn(b),"handleOuterEvent",function(w){var _=SSn(w),S=vu(b.props,"".concat(_));if(_&&mn(S)){var O,k;/.*touch.*/i.test(_)?k=b.getMouseInfo(w.changedTouches[0]):k=b.getMouseInfo(w),S((O=k)!==null&&O!==void 0?O:{},w)}}),Yt(Wn(b),"handleClick",function(w){var _=b.getMouseInfo(w);if(_){var S=Ge(Ge({},_),{},{isTooltipActive:!0});b.setState(S),b.triggerSyncEvent(S);var O=b.props.onClick;mn(O)&&O(S,w)}}),Yt(Wn(b),"handleMouseDown",function(w){var _=b.props.onMouseDown;if(mn(_)){var S=b.getMouseInfo(w);_(S,w)}}),Yt(Wn(b),"handleMouseUp",function(w){var _=b.props.onMouseUp;if(mn(_)){var S=b.getMouseInfo(w);_(S,w)}}),Yt(Wn(b),"handleTouchMove",function(w){w.changedTouches!=null&&w.changedTouches.length>0&&b.throttleTriggeredAfterMouseMove(w.changedTouches[0])}),Yt(Wn(b),"handleTouchStart",function(w){w.changedTouches!=null&&w.changedTouches.length>0&&b.handleMouseDown(w.changedTouches[0])}),Yt(Wn(b),"handleTouchEnd",function(w){w.changedTouches!=null&&w.changedTouches.length>0&&b.handleMouseUp(w.changedTouches[0])}),Yt(Wn(b),"triggerSyncEvent",function(w){b.props.syncId!==void 0&&Q7.emit(K7,b.props.syncId,w,b.eventEmitterSymbol)}),Yt(Wn(b),"applySyncEvent",function(w){var _=b.props,S=_.layout,O=_.syncMethod,k=b.state.updateId,E=w.dataStartIndex,P=w.dataEndIndex;if(w.dataStartIndex!==void 0||w.dataEndIndex!==void 0)b.setState(Ge({dataStartIndex:E,dataEndIndex:P},p({props:b.props,dataStartIndex:E,dataEndIndex:P,updateId:k},b.state)));else if(w.activeTooltipIndex!==void 0){var A=w.chartX,R=w.chartY,T=w.activeTooltipIndex,M=b.state,I=M.offset,j=M.tooltipTicks;if(!I)return;if(typeof O=="function")T=O(j,w);else if(O==="value"){T=-1;for(var N=0;N=0){var re,ge;if(A.dataKey&&!A.allowDuplicatedCategory){var te=typeof A.dataKey=="function"?ee:"payload.".concat(A.dataKey.toString());re=_z(N,te,T),ge=z&&L&&_z(L,te,T)}else re=N==null?void 0:N[R],ge=z&&L&&L[R];if(G||q){var ae=w.props.activeIndex!==void 0?w.props.activeIndex:R;return[D.cloneElement(w,Ge(Ge(Ge({},O.props),le),{},{activeIndex:ae})),null,null]}if(!wn(re))return[K].concat(FC(b.renderActivePoints({item:O,activePoint:re,basePoint:ge,childIndex:R,isRange:z})))}else{var U,oe=(U=b.getItemByXY(b.state.activeCoordinate))!==null&&U!==void 0?U:{graphicalItem:K},ne=oe.graphicalItem,V=ne.item,X=V===void 0?w:V,Z=ne.childIndex,he=Ge(Ge(Ge({},O.props),le),{},{activeIndex:Z});return[D.cloneElement(X,he),null,null]}return z?[K,null,null]:[K,null]}),Yt(Wn(b),"renderCustomized",function(w,_,S){return D.cloneElement(w,Ge(Ge({key:"recharts-customized-".concat(S)},b.props),b.state))}),Yt(Wn(b),"renderMap",{CartesianGrid:{handler:t$,once:!0},ReferenceArea:{handler:b.renderReferenceElement},ReferenceLine:{handler:t$},ReferenceDot:{handler:b.renderReferenceElement},XAxis:{handler:t$},YAxis:{handler:t$},Brush:{handler:b.renderBrush,once:!0},Bar:{handler:b.renderGraphicChild},Line:{handler:b.renderGraphicChild},Area:{handler:b.renderGraphicChild},Radar:{handler:b.renderGraphicChild},RadialBar:{handler:b.renderGraphicChild},Scatter:{handler:b.renderGraphicChild},Pie:{handler:b.renderGraphicChild},Funnel:{handler:b.renderGraphicChild},Tooltip:{handler:b.renderCursor,once:!0},PolarGrid:{handler:b.renderPolarGrid,once:!0},PolarAngleAxis:{handler:b.renderPolarAxis},PolarRadiusAxis:{handler:b.renderPolarAxis},Customized:{handler:b.renderCustomized}}),b.clipPathId="".concat((y=v.id)!==null&&y!==void 0?y:iE("recharts"),"-clip"),b.throttleTriggeredAfterMouseMove=sqe(b.triggeredAfterMouseMove,(x=v.throttleDelay)!==null&&x!==void 0?x:1e3/60),b.state={},b}return Hzn(m,[{key:"componentDidMount",value:function(){var y,x;this.addListener(),this.accessibilityManager.setDetails({container:this.container,offset:{left:(y=this.props.margin.left)!==null&&y!==void 0?y:0,top:(x=this.props.margin.top)!==null&&x!==void 0?x:0},coordinateList:this.state.tooltipTicks,mouseHandlerCallback:this.triggeredAfterMouseMove,layout:this.props.layout}),this.displayDefaultTooltip()}},{key:"displayDefaultTooltip",value:function(){var y=this.props,x=y.children,b=y.data,w=y.height,_=y.layout,S=Yl(x,Pd);if(S){var O=S.props.defaultIndex;if(!(typeof O!="number"||O<0||O>this.state.tooltipTicks.length)){var k=this.state.tooltipTicks[O]&&this.state.tooltipTicks[O].value,E=qZ(this.state,b,O,k),P=this.state.tooltipTicks[O].coordinate,A=(this.state.offset.top+w)/2,R=_==="horizontal",T=R?{x:P,y:A}:{y:P,x:A},M=this.state.formattedGraphicalItems.find(function(j){var N=j.item;return N.type.name==="Scatter"});M&&(T=Ge(Ge({},T),M.props.points[O].tooltipPosition),E=M.props.points[O].tooltipPayload);var I={activeTooltipIndex:O,isTooltipActive:!0,activeLabel:k,activePayload:E,activeCoordinate:T};this.setState(I),this.renderCursor(S),this.accessibilityManager.setIndex(O)}}}},{key:"getSnapshotBeforeUpdate",value:function(y,x){if(!this.props.accessibilityLayer)return null;if(this.state.tooltipTicks!==x.tooltipTicks&&this.accessibilityManager.setDetails({coordinateList:this.state.tooltipTicks}),this.props.layout!==y.layout&&this.accessibilityManager.setDetails({layout:this.props.layout}),this.props.margin!==y.margin){var b,w;this.accessibilityManager.setDetails({offset:{left:(b=this.props.margin.left)!==null&&b!==void 0?b:0,top:(w=this.props.margin.top)!==null&&w!==void 0?w:0}})}return null}},{key:"componentDidUpdate",value:function(y){BK([Yl(y.children,Pd)],[Yl(this.props.children,Pd)])||this.displayDefaultTooltip()}},{key:"componentWillUnmount",value:function(){this.removeListener(),this.throttleTriggeredAfterMouseMove.cancel()}},{key:"getTooltipEventType",value:function(){var y=Yl(this.props.children,Pd);if(y&&typeof y.props.shared=="boolean"){var x=y.props.shared?"axis":"item";return l.indexOf(x)>=0?x:s}return s}},{key:"getMouseInfo",value:function(y){if(!this.container)return null;var x=this.container,b=x.getBoundingClientRect(),w=gRn(b),_={chartX:Math.round(y.pageX-w.left),chartY:Math.round(y.pageY-w.top)},S=b.width/x.offsetWidth||1,O=this.inRange(_.chartX,_.chartY,S);if(!O)return null;var k=this.state,E=k.xAxisMap,P=k.yAxisMap,A=this.getTooltipEventType();if(A!=="axis"&&E&&P){var R=ov(E).scale,T=ov(P).scale,M=R&&R.invert?R.invert(_.chartX):null,I=T&&T.invert?T.invert(_.chartY):null;return Ge(Ge({},_),{},{xValue:M,yValue:I})}var j=aOe(this.state,this.props.data,this.props.layout,O);return j?Ge(Ge({},_),j):null}},{key:"inRange",value:function(y,x){var b=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,w=this.props.layout,_=y/b,S=x/b;if(w==="horizontal"||w==="vertical"){var O=this.state.offset,k=_>=O.left&&_<=O.left+O.width&&S>=O.top&&S<=O.top+O.height;return k?{x:_,y:S}:null}var E=this.state,P=E.angleAxisMap,A=E.radiusAxisMap;if(P&&A){var R=ov(P);return BSe({x:_,y:S},R)}return null}},{key:"parseEventsOfWrapper",value:function(){var y=this.props.children,x=this.getTooltipEventType(),b=Yl(y,Pd),w={};b&&x==="axis"&&(b.props.trigger==="click"?w={onClick:this.handleClick}:w={onMouseEnter:this.handleMouseEnter,onMouseMove:this.handleMouseMove,onMouseLeave:this.handleMouseLeave,onTouchMove:this.handleTouchMove,onTouchStart:this.handleTouchStart,onTouchEnd:this.handleTouchEnd});var _=Sz(this.props,this.handleOuterEvent);return Ge(Ge({},_),w)}},{key:"addListener",value:function(){Q7.on(K7,this.handleReceiveSyncEvent)}},{key:"removeListener",value:function(){Q7.removeListener(K7,this.handleReceiveSyncEvent)}},{key:"filterFormatItem",value:function(y,x,b){for(var w=this.state.formattedGraphicalItems,_=0,S=w.length;_!vr(t)||!Number.isFinite(t)?"":bA(t),gjn=t=>t.toPrecision(3),J7={legendContainer:{display:"flex",justifyContent:"center",columnGap:"12px",flexWrap:"wrap"},legendItem:{display:"flex",alignItems:"center"},legendCloseIcon:{marginLeft:"4px",cursor:"pointer",display:"flex",alignItems:"center"}};function mjn({payload:t,removeTimeSeries:e}){return!t||t.length===0?null:C.jsx(ot,{sx:J7.legendContainer,children:t.map((n,r)=>C.jsxs(ot,{sx:{...J7.legendItem,color:n.color},children:[C.jsx("span",{children:n.value}),e&&C.jsx(ot,{component:"span",sx:J7.legendCloseIcon,onMouseUp:()=>e(r),children:C.jsx(vU,{fontSize:"small"})})]},n.value))})}const eG={toolTipContainer:t=>({backgroundColor:"black",opacity:.8,color:"white",border:"2px solid black",borderRadius:t.spacing(2),padding:t.spacing(1.5)}),toolTipValue:{fontWeight:"bold"},toolTipLabel:t=>({fontWeight:"bold",paddingBottom:t.spacing(1)})},vjn="#00000000",yjn="#FAFFDD";function xjn({active:t,label:e,payload:n}){if(!t||!vr(e)||!n||n.length===0)return null;const r=n.map((i,o)=>{const{name:s,value:a,unit:l,dataKey:c}=i;let u=i.color;if(!vr(a))return null;const f=s||"?",d=a.toFixed(3);u===vjn&&(u=yjn);let p=f.indexOf(":")!==-1?"":` (${c})`;return typeof l=="string"&&(p!==""?p=`${l} ${p}`:p=l),C.jsxs("div",{children:[C.jsxs("span",{children:[f,": "]}),C.jsx(ot,{component:"span",sx:eG.toolTipValue,style:{color:u},children:d}),C.jsxs("span",{children:[" ",p]})]},o)});return r?C.jsxs(ot,{sx:eG.toolTipContainer,children:[C.jsx(ot,{component:"span",sx:eG.toolTipLabel,children:`${oO(e)} UTC`}),r]}):null}function uOe({cx:t,cy:e,radius:n,stroke:r,fill:i,strokeWidth:o,symbol:s}){const l=n+.5*o,c=2*l,u=Math.floor(100*o/c+.5)+"%";let f;if(s==="diamond"){const g=1024*(n/c);f=C.jsx("polygon",{points:`${512-g},512 512,${512-g} ${512+g},512 512,${512+g}`,strokeWidth:u,stroke:r,fill:i})}else{const d=Math.floor(100*n/c+.5)+"%";f=C.jsx("circle",{cx:"50%",cy:"50%",r:d,strokeWidth:u,stroke:r,fill:i})}return vr(t)&&vr(e)?C.jsx("svg",{x:t-l,y:e-l,width:c,height:c,viewBox:"0 0 1024 1024",children:f}):null}function bjn({timeSeriesGroup:t,timeSeriesIndex:e,selectTimeSeries:n,places:r,selectPlace:i,placeInfos:o,placeGroupTimeSeries:s,paletteMode:a,chartType:l,stdevBars:c}){const u=t.timeSeriesArray[e],f=u.source,d=()=>{n&&n(t.id,e,u),i(u.source.placeId,r,!0)};let h=f.variableName,p="red";if(f.placeId===null){h=`${f.datasetTitle}/${h}`;let x=null;s.forEach(b=>{if(x===null&&b.placeGroup.id===f.datasetId){const w=b.placeGroup.features;w.length>0&&w[0].properties&&(x=w[0].properties.color||null)}}),p=x||"red"}else if(o){const x=o[f.placeId];if(x){const{place:b,label:w,color:_}=x;if(b.geometry.type==="Point"){const S=b.geometry.coordinates[0],O=b.geometry.coordinates[1];h+=` (${w}: ${O.toFixed(5)},${S.toFixed(5)})`}else h+=` (${w})`;p=_}}const g=DPe(p,a);let m,v;u.source.placeId===null?(m=0,v={radius:5,strokeWidth:1.5,symbol:"diamond"}):(m=l==="point"?0:u.dataProgress,v={radius:3,strokeWidth:2,symbol:"circle"});const y=c&&f.valueDataKey&&f.errorDataKey&&C.jsx(uE,{dataKey:`ev${e}`,width:4,strokeWidth:1,stroke:g,strokeOpacity:.5});return l==="bar"?C.jsx(T1,{type:"monotone",name:h,unit:f.variableUnits,dataKey:`v${e}`,fill:g,fillOpacity:m,isAnimationActive:!1,onClick:d,children:y},e):C.jsx(xD,{type:"monotone",name:h,unit:f.variableUnits,dataKey:`v${e}`,dot:C.jsx(uOe,{...v,stroke:g,fill:"white"}),activeDot:C.jsx(uOe,{...v,stroke:"white",fill:g}),stroke:g,strokeOpacity:m,isAnimationActive:!1,onClick:d,children:y},e)}const wjn=ct(C.jsx("path",{d:"M19 12h-2v3h-3v2h5zM7 9h3V7H5v5h2zm14-6H3c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h18c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2m0 16.01H3V4.99h18z"}),"AspectRatio"),_jn=ct(C.jsx("path",{d:"M4 9h4v11H4zm12 4h4v7h-4zm-6-9h4v16h-4z"}),"BarChart"),Sjn=ct(C.jsx("path",{d:"M21.99 4c0-1.1-.89-2-1.99-2H4c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h14l4 4zM18 14H6v-2h12zm0-3H6V9h12zm0-3H6V6h12z"}),"Comment"),Cjn=ct(C.jsx("path",{d:"M4 20h16v2H4zM4 2h16v2H4zm9 7h3l-4-4-4 4h3v6H8l4 4 4-4h-3z"}),"Expand"),Ojn=ct(C.jsx("path",{d:"M17 4h3c1.1 0 2 .9 2 2v2h-2V6h-3zM4 8V6h3V4H4c-1.1 0-2 .9-2 2v2zm16 8v2h-3v2h3c1.1 0 2-.9 2-2v-2zM7 18H4v-2H2v2c0 1.1.9 2 2 2h3zM18 8H6v8h12z"}),"FitScreen"),EXe=ct(C.jsx("path",{d:"M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2M5.5 7.5h2v-2H9v2h2V9H9v2H7.5V9h-2zM19 19H5L19 5zm-2-2v-1.5h-5V17z"}),"Iso"),Ejn=ct([C.jsx("circle",{cx:"7",cy:"14",r:"3"},"0"),C.jsx("circle",{cx:"11",cy:"6",r:"3"},"1"),C.jsx("circle",{cx:"16.6",cy:"17.6",r:"3"},"2")],"ScatterPlot"),Tjn=ct(C.jsx("path",{d:"m3.5 18.49 6-6.01 4 4L22 6.92l-1.41-1.41-7.09 7.97-4-4L2 16.99z"}),"ShowChart"),kjn=ct([C.jsx("circle",{cx:"12",cy:"12",r:"3.2"},"0"),C.jsx("path",{d:"M9 2 7.17 4H4c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2h-3.17L15 2zm3 15c-2.76 0-5-2.24-5-5s2.24-5 5-5 5 2.24 5 5-2.24 5-5 5"},"1")],"CameraAlt");function Ajn(t,e){if(t.match(/^[a-z]+:\/\//i))return t;if(t.match(/^\/\//))return window.location.protocol+t;if(t.match(/^[a-z]+:/i))return t;const n=document.implementation.createHTMLDocument(),r=n.createElement("base"),i=n.createElement("a");return n.head.appendChild(r),n.body.appendChild(i),e&&(r.href=e),i.href=t,i.href}const Pjn=(()=>{let t=0;const e=()=>`0000${(Math.random()*36**4<<0).toString(36)}`.slice(-4);return()=>(t+=1,`u${e()}${t}`)})();function vg(t){const e=[];for(let n=0,r=t.length;nLl||t.height>Ll)&&(t.width>Ll&&t.height>Ll?t.width>t.height?(t.height*=Ll/t.width,t.width=Ll):(t.width*=Ll/t.height,t.height=Ll):t.width>Ll?(t.height*=Ll/t.width,t.width=Ll):(t.width*=Ll/t.height,t.height=Ll))}function rj(t){return new Promise((e,n)=>{const r=new Image;r.decode=()=>e(r),r.onload=()=>e(r),r.onerror=n,r.crossOrigin="anonymous",r.decoding="async",r.src=t})}async function Ljn(t){return Promise.resolve().then(()=>new XMLSerializer().serializeToString(t)).then(encodeURIComponent).then(e=>`data:image/svg+xml;charset=utf-8,${e}`)}async function $jn(t,e,n){const r="http://www.w3.org/2000/svg",i=document.createElementNS(r,"svg"),o=document.createElementNS(r,"foreignObject");return i.setAttribute("width",`${e}`),i.setAttribute("height",`${n}`),i.setAttribute("viewBox",`0 0 ${e} ${n}`),o.setAttribute("width","100%"),o.setAttribute("height","100%"),o.setAttribute("x","0"),o.setAttribute("y","0"),o.setAttribute("externalResourcesRequired","true"),i.appendChild(o),o.appendChild(t),Ljn(i)}const vl=(t,e)=>{if(t instanceof e)return!0;const n=Object.getPrototypeOf(t);return n===null?!1:n.constructor.name===e.name||vl(n,e)};function Fjn(t){const e=t.getPropertyValue("content");return`${t.cssText} content: '${e.replace(/'|"/g,"")}';`}function Njn(t){return vg(t).map(e=>{const n=t.getPropertyValue(e),r=t.getPropertyPriority(e);return`${e}: ${n}${r?" !important":""};`}).join(" ")}function zjn(t,e,n){const r=`.${t}:${e}`,i=n.cssText?Fjn(n):Njn(n);return document.createTextNode(`${r}{${i}}`)}function fOe(t,e,n){const r=window.getComputedStyle(t,n),i=r.getPropertyValue("content");if(i===""||i==="none")return;const o=Pjn();try{e.className=`${e.className} ${o}`}catch{return}const s=document.createElement("style");s.appendChild(zjn(o,n,r)),e.appendChild(s)}function jjn(t,e){fOe(t,e,":before"),fOe(t,e,":after")}const dOe="application/font-woff",hOe="image/jpeg",Bjn={woff:dOe,woff2:dOe,ttf:"application/font-truetype",eot:"application/vnd.ms-fontobject",png:"image/png",jpg:hOe,jpeg:hOe,gif:"image/gif",tiff:"image/tiff",svg:"image/svg+xml",webp:"image/webp"};function Ujn(t){const e=/\.([^./]*?)$/g.exec(t);return e?e[1]:""}function Kce(t){const e=Ujn(t).toLowerCase();return Bjn[e]||""}function Wjn(t){return t.split(/,/)[1]}function XZ(t){return t.search(/^(data:)/)!==-1}function Vjn(t,e){return`data:${e};base64,${t}`}async function kXe(t,e,n){const r=await fetch(t,e);if(r.status===404)throw new Error(`Resource "${r.url}" not found`);const i=await r.blob();return new Promise((o,s)=>{const a=new FileReader;a.onerror=s,a.onloadend=()=>{try{o(n({res:r,result:a.result}))}catch(l){s(l)}},a.readAsDataURL(i)})}const tG={};function Gjn(t,e,n){let r=t.replace(/\?.*/,"");return n&&(r=t),/ttf|otf|eot|woff2?/i.test(r)&&(r=r.replace(/.*\//,"")),e?`[${e}]${r}`:r}async function Zce(t,e,n){const r=Gjn(t,e,n.includeQueryParams);if(tG[r]!=null)return tG[r];n.cacheBust&&(t+=(/\?/.test(t)?"&":"?")+new Date().getTime());let i;try{const o=await kXe(t,n.fetchRequestInit,({res:s,result:a})=>(e||(e=s.headers.get("Content-Type")||""),Wjn(a)));i=Vjn(o,e)}catch(o){i=n.imagePlaceholder||"";let s=`Failed to fetch resource: ${t}`;o&&(s=typeof o=="string"?o:o.message),s&&console.warn(s)}return tG[r]=i,i}async function Hjn(t){const e=t.toDataURL();return e==="data:,"?t.cloneNode(!1):rj(e)}async function qjn(t,e){if(t.currentSrc){const o=document.createElement("canvas"),s=o.getContext("2d");o.width=t.clientWidth,o.height=t.clientHeight,s==null||s.drawImage(t,0,0,o.width,o.height);const a=o.toDataURL();return rj(a)}const n=t.poster,r=Kce(n),i=await Zce(n,r,e);return rj(i)}async function Xjn(t){var e;try{if(!((e=t==null?void 0:t.contentDocument)===null||e===void 0)&&e.body)return await r8(t.contentDocument.body,{},!0)}catch{}return t.cloneNode(!1)}async function Yjn(t,e){return vl(t,HTMLCanvasElement)?Hjn(t):vl(t,HTMLVideoElement)?qjn(t,e):vl(t,HTMLIFrameElement)?Xjn(t):t.cloneNode(!1)}const Qjn=t=>t.tagName!=null&&t.tagName.toUpperCase()==="SLOT";async function Kjn(t,e,n){var r,i;let o=[];return Qjn(t)&&t.assignedNodes?o=vg(t.assignedNodes()):vl(t,HTMLIFrameElement)&&(!((r=t.contentDocument)===null||r===void 0)&&r.body)?o=vg(t.contentDocument.body.childNodes):o=vg(((i=t.shadowRoot)!==null&&i!==void 0?i:t).childNodes),o.length===0||vl(t,HTMLVideoElement)||await o.reduce((s,a)=>s.then(()=>r8(a,n)).then(l=>{l&&e.appendChild(l)}),Promise.resolve()),e}function Zjn(t,e){const n=e.style;if(!n)return;const r=window.getComputedStyle(t);r.cssText?(n.cssText=r.cssText,n.transformOrigin=r.transformOrigin):vg(r).forEach(i=>{let o=r.getPropertyValue(i);i==="font-size"&&o.endsWith("px")&&(o=`${Math.floor(parseFloat(o.substring(0,o.length-2)))-.1}px`),vl(t,HTMLIFrameElement)&&i==="display"&&o==="inline"&&(o="block"),i==="d"&&e.getAttribute("d")&&(o=`path(${e.getAttribute("d")})`),n.setProperty(i,o,r.getPropertyPriority(i))})}function Jjn(t,e){vl(t,HTMLTextAreaElement)&&(e.innerHTML=t.value),vl(t,HTMLInputElement)&&e.setAttribute("value",t.value)}function e4n(t,e){if(vl(t,HTMLSelectElement)){const n=e,r=Array.from(n.children).find(i=>t.value===i.getAttribute("value"));r&&r.setAttribute("selected","")}}function t4n(t,e){return vl(e,Element)&&(Zjn(t,e),jjn(t,e),Jjn(t,e),e4n(t,e)),e}async function n4n(t,e){const n=t.querySelectorAll?t.querySelectorAll("use"):[];if(n.length===0)return t;const r={};for(let o=0;oYjn(r,e)).then(r=>Kjn(t,r,e)).then(r=>t4n(t,r)).then(r=>n4n(r,e))}const AXe=/url\((['"]?)([^'"]+?)\1\)/g,r4n=/url\([^)]+\)\s*format\((["']?)([^"']+)\1\)/g,i4n=/src:\s*(?:url\([^)]+\)\s*format\([^)]+\)[,;]\s*)+/g;function o4n(t){const e=t.replace(/([.*+?^${}()|\[\]\/\\])/g,"\\$1");return new RegExp(`(url\\(['"]?)(${e})(['"]?\\))`,"g")}function s4n(t){const e=[];return t.replace(AXe,(n,r,i)=>(e.push(i),n)),e.filter(n=>!XZ(n))}async function a4n(t,e,n,r,i){try{const o=n?Ajn(e,n):e,s=Kce(e);let a;return i||(a=await Zce(o,s,r)),t.replace(o4n(e),`$1${a}$3`)}catch{}return t}function l4n(t,{preferredFontFormat:e}){return e?t.replace(i4n,n=>{for(;;){const[r,,i]=r4n.exec(n)||[];if(!i)return"";if(i===e)return`src: ${r};`}}):t}function PXe(t){return t.search(AXe)!==-1}async function MXe(t,e,n){if(!PXe(t))return t;const r=l4n(t,n);return s4n(r).reduce((o,s)=>o.then(a=>a4n(a,s,e,n)),Promise.resolve(r))}async function n$(t,e,n){var r;const i=(r=e.style)===null||r===void 0?void 0:r.getPropertyValue(t);if(i){const o=await MXe(i,null,n);return e.style.setProperty(t,o,e.style.getPropertyPriority(t)),!0}return!1}async function c4n(t,e){await n$("background",t,e)||await n$("background-image",t,e),await n$("mask",t,e)||await n$("mask-image",t,e)}async function u4n(t,e){const n=vl(t,HTMLImageElement);if(!(n&&!XZ(t.src))&&!(vl(t,SVGImageElement)&&!XZ(t.href.baseVal)))return;const r=n?t.src:t.href.baseVal,i=await Zce(r,Kce(r),e);await new Promise((o,s)=>{t.onload=o,t.onerror=s;const a=t;a.decode&&(a.decode=o),a.loading==="lazy"&&(a.loading="eager"),n?(t.srcset="",t.src=i):t.href.baseVal=i})}async function f4n(t,e){const r=vg(t.childNodes).map(i=>RXe(i,e));await Promise.all(r).then(()=>t)}async function RXe(t,e){vl(t,Element)&&(await c4n(t,e),await u4n(t,e),await f4n(t,e))}function d4n(t,e){const{style:n}=t;e.backgroundColor&&(n.backgroundColor=e.backgroundColor),e.width&&(n.width=`${e.width}px`),e.height&&(n.height=`${e.height}px`);const r=e.style;return r!=null&&Object.keys(r).forEach(i=>{n[i]=r[i]}),t}const pOe={};async function gOe(t){let e=pOe[t];if(e!=null)return e;const r=await(await fetch(t)).text();return e={url:t,cssText:r},pOe[t]=e,e}async function mOe(t,e){let n=t.cssText;const r=/url\(["']?([^"')]+)["']?\)/g,o=(n.match(/url\([^)]+\)/g)||[]).map(async s=>{let a=s.replace(r,"$1");return a.startsWith("https://")||(a=new URL(a,t.url).href),kXe(a,e.fetchRequestInit,({result:l})=>(n=n.replace(s,`url(${l})`),[s,l]))});return Promise.all(o).then(()=>n)}function vOe(t){if(t==null)return[];const e=[],n=/(\/\*[\s\S]*?\*\/)/gi;let r=t.replace(n,"");const i=new RegExp("((@.*?keyframes [\\s\\S]*?){([\\s\\S]*?}\\s*?)})","gi");for(;;){const l=i.exec(r);if(l===null)break;e.push(l[0])}r=r.replace(i,"");const o=/@import[\s\S]*?url\([^)]*\)[\s\S]*?;/gi,s="((\\s*?(?:\\/\\*[\\s\\S]*?\\*\\/)?\\s*?@media[\\s\\S]*?){([\\s\\S]*?)}\\s*?})|(([\\s\\S]*?){([\\s\\S]*?)})",a=new RegExp(s,"gi");for(;;){let l=o.exec(r);if(l===null){if(l=a.exec(r),l===null)break;o.lastIndex=a.lastIndex}else a.lastIndex=o.lastIndex;e.push(l[0])}return e}async function h4n(t,e){const n=[],r=[];return t.forEach(i=>{if("cssRules"in i)try{vg(i.cssRules||[]).forEach((o,s)=>{if(o.type===CSSRule.IMPORT_RULE){let a=s+1;const l=o.href,c=gOe(l).then(u=>mOe(u,e)).then(u=>vOe(u).forEach(f=>{try{i.insertRule(f,f.startsWith("@import")?a+=1:i.cssRules.length)}catch(d){console.error("Error inserting rule from remote css",{rule:f,error:d})}})).catch(u=>{console.error("Error loading remote css",u.toString())});r.push(c)}})}catch(o){const s=t.find(a=>a.href==null)||document.styleSheets[0];i.href!=null&&r.push(gOe(i.href).then(a=>mOe(a,e)).then(a=>vOe(a).forEach(l=>{s.insertRule(l,i.cssRules.length)})).catch(a=>{console.error("Error loading remote stylesheet",a)})),console.error("Error inlining remote css file",o)}}),Promise.all(r).then(()=>(t.forEach(i=>{if("cssRules"in i)try{vg(i.cssRules||[]).forEach(o=>{n.push(o)})}catch(o){console.error(`Error while reading CSS rules from ${i.href}`,o)}}),n))}function p4n(t){return t.filter(e=>e.type===CSSRule.FONT_FACE_RULE).filter(e=>PXe(e.style.getPropertyValue("src")))}async function g4n(t,e){if(t.ownerDocument==null)throw new Error("Provided element is not within a Document");const n=vg(t.ownerDocument.styleSheets),r=await h4n(n,e);return p4n(r)}async function m4n(t,e){const n=await g4n(t,e);return(await Promise.all(n.map(i=>{const o=i.parentStyleSheet?i.parentStyleSheet.href:null;return MXe(i.cssText,o,e)}))).join(` +`)}async function v4n(t,e){const n=e.fontEmbedCSS!=null?e.fontEmbedCSS:e.skipFonts?null:await m4n(t,e);if(n){const r=document.createElement("style"),i=document.createTextNode(n);r.appendChild(i),t.firstChild?t.insertBefore(r,t.firstChild):t.appendChild(r)}}async function y4n(t,e={}){const{width:n,height:r}=TXe(t,e),i=await r8(t,e,!0);return await v4n(i,e),await RXe(i,e),d4n(i,e),await $jn(i,n,r)}async function DXe(t,e={}){const{width:n,height:r}=TXe(t,e),i=await y4n(t,e),o=await rj(i),s=document.createElement("canvas"),a=s.getContext("2d"),l=e.pixelRatio||Djn(),c=e.canvasWidth||n,u=e.canvasHeight||r;return s.width=c*l,s.height=u*l,e.skipAutoScale||Ijn(s),s.style.width=`${c}`,s.style.height=`${u}`,e.backgroundColor&&(a.fillStyle=e.backgroundColor,a.fillRect(0,0,s.width,s.height)),a.drawImage(o,0,0,s.width,s.height),s}async function x4n(t,e={}){return(await DXe(t,e)).toDataURL()}async function b4n(t,e={}){return(await DXe(t,e)).toDataURL("image/jpeg",e.quality||1)}const yOe={png:x4n,jpeg:b4n};function w4n(t,e){_4n(t,e).then(()=>{e!=null&&e.handleSuccess&&e.handleSuccess()}).catch(n=>{if(e!=null&&e.handleError)e.handleError(n);else throw n})}async function _4n(t,e={}){const n=t,r=e.format||"png";if(!(r in yOe))throw new Error(`Image format '${r}' is unknown or not supported.`);const i=await yOe[r](n,{backgroundColor:"#00000000",canvasWidth:e.width||(e.height||n.clientHeight)*n.clientWidth/n.clientHeight,canvasHeight:e.height||(e.width||n.clientWidth)*n.clientHeight/n.clientWidth}),s=await(await fetch(i)).blob();await navigator.clipboard.write([new ClipboardItem({"image/png":s})])}function IXe({elementRef:t,postMessage:e}){const n=()=>{e("success",me.get("Snapshot copied to clipboard"))},r=o=>{const s="Error copying snapshot to clipboard";console.error(s+":",o),e("error",me.get(s))},i=()=>{t.current?w4n(t.current,{format:"png",width:2e3,handleSuccess:n,handleError:r}):r(new Error("missing element reference"))};return C.jsx(lu,{tooltipText:me.get("Copy snapshot of chart to clipboard"),onClick:i,icon:C.jsx(kjn,{fontSize:"inherit"})})}function S4n({sx:t,timeSeriesGroupId:e,placeGroupTimeSeries:n,addPlaceGroupTimeSeries:r}){const[i,o]=de.useState(null),s=f=>{o(f.currentTarget)},a=()=>{o(null)},l=f=>{o(null),r(e,f)},c=[];n.forEach(f=>{Object.getOwnPropertyNames(f.timeSeries).forEach(d=>{const h=`${f.placeGroup.title} / ${d}`;c.push(C.jsx(ti,{onClick:()=>l(f.timeSeries[d]),children:h},h))})});const u=!!i;return C.jsxs(C.Fragment,{children:[C.jsx(Ht,{size:"small",sx:t,"aria-label":"Add","aria-controls":u?"basic-menu":void 0,"aria-haspopup":"true","aria-expanded":u?"true":void 0,onClick:s,disabled:c.length===0,children:C.jsx(Lt,{arrow:!0,title:me.get("Add time-series from places"),children:C.jsx(EU,{fontSize:"inherit"})})}),C.jsx($y,{id:"basic-menu",anchorEl:i,open:u,onClose:a,MenuListProps:{"aria-labelledby":"basic-button"},children:c})]})}const r$={container:t=>({padding:t.spacing(1),display:"flex",flexDirection:"column",gap:t.spacing(1)}),minMaxBox:t=>({display:"flex",justifyContent:"center",gap:t.spacing(1)}),minTextField:{maxWidth:"8em"},maxTextField:{maxWidth:"8em"}};function C4n({anchorEl:t,valueRange:e,setValueRange:n}){const[r,i]=D.useState(e?[e[0]+"",e[1]+""]:["0","1"]);if(!t)return null;const o=[Number.parseFloat(r[0]),Number.parseFloat(r[1])],s=Number.isFinite(o[0])&&Number.isFinite(o[1])&&o[0]{const d=f.target.value;i([d,r[1]])},l=f=>{const d=f.target.value;i([r[0],d])},c=()=>{n(o)},u=()=>{n(void 0)};return C.jsx(Qb,{anchorEl:t,open:!0,onClose:u,anchorOrigin:{vertical:"bottom",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"center"},children:C.jsxs(ot,{sx:r$.container,children:[C.jsxs(ot,{component:"form",sx:r$.minMaxBox,children:[C.jsx(di,{sx:r$.minTextField,label:"Y-Minimum",variant:"filled",size:"small",value:r[0],error:!s,onChange:f=>a(f)}),C.jsx(di,{sx:r$.maxTextField,label:"Y-Maximum",variant:"filled",size:"small",value:r[1],error:!s,onChange:f=>l(f)})]}),C.jsx(nD,{onDone:c,doneDisabled:!s,onCancel:u,size:"medium"})]})})}const i$="stddev",P0={headerContainer:{display:"flex",flexDirection:"row",justifyContent:"right"},actionsContainer:{display:"flex",flexDirection:"row",flexWrap:"nowrap",alignItems:"center",gap:"1px"},responsiveContainer:{flexGrow:"1px"},actionButton:{zIndex:1e3,opacity:.8},chartTitle:{fontSize:"inherit",fontWeight:"normal"},chartTypes:t=>({paddingLeft:t.spacing(1),paddingRight:t.spacing(1)})};function O4n({timeSeriesGroup:t,placeGroupTimeSeries:e,addPlaceGroupTimeSeries:n,removeTimeSeriesGroup:r,resetZoom:i,loading:o,zoomed:s,zoomMode:a,setZoomMode:l,showTooltips:c,setShowTooltips:u,chartType:f,setChartType:d,stdevBarsDisabled:h,stdevBars:p,setStdevBars:g,valueRange:m,setValueRange:v,chartElement:y,postMessage:x}){const b=D.useRef(null),[w,_]=D.useState(!1),S=()=>{_(!w)},O=E=>{_(!1),E&&v(E)},k=(E,P)=>{const A=new Set(P),R=A.has(i$);A.delete(i$),A.delete(f),P=Array.from(A),d(P.length===1?P[0]:f),g(R)};return C.jsx(ot,{sx:P0.headerContainer,children:C.jsxs(ot,{sx:P0.actionsContainer,children:[s&&C.jsx(Lt,{arrow:!0,title:me.get("Zoom to full range"),children:C.jsx(Ht,{sx:P0.actionButton,onClick:i,size:"small",children:C.jsx(Ojn,{fontSize:"inherit"})},"zoomOutButton")}),C.jsx(Lt,{arrow:!0,title:me.get("Toggle zoom mode (or press CTRL key)"),children:C.jsx(yr,{value:"zoomMode",selected:a,onClick:()=>l(!a),size:"small",children:C.jsx(wjn,{fontSize:"inherit"})})}),C.jsx(C4n,{anchorEl:w?b.current:null,valueRange:m,setValueRange:O}),C.jsx(Lt,{arrow:!0,title:me.get("Enter fixed y-range"),children:C.jsx(yr,{ref:b,value:"valueRange",selected:w,onClick:S,size:"small",children:C.jsx(Cjn,{fontSize:"inherit"})})}),C.jsx(Lt,{arrow:!0,title:me.get("Toggle showing info popup on hover"),children:C.jsx(yr,{value:"showTooltips",selected:c,onClick:()=>u(!c),size:"small",children:C.jsx(Sjn,{fontSize:"inherit"})})}),C.jsxs(QC,{value:p?[f,i$]:[f],onChange:k,size:"small",sx:P0.chartTypes,children:[C.jsx(Lt,{arrow:!0,title:me.get("Show points"),children:C.jsx(yr,{value:"point",size:"small",children:C.jsx(Ejn,{fontSize:"inherit"})})}),C.jsx(Lt,{arrow:!0,title:me.get("Show lines"),children:C.jsx(yr,{value:"line",size:"small",children:C.jsx(Tjn,{fontSize:"inherit"})})}),C.jsx(Lt,{arrow:!0,title:me.get("Show bars"),children:C.jsx(yr,{value:"bar",size:"small",children:C.jsx(_jn,{fontSize:"inherit"})})}),C.jsx(Lt,{arrow:!0,title:me.get("Show standard deviation (if any)"),children:C.jsx(yr,{value:i$,size:"small",disabled:h,children:C.jsx(EXe,{fontSize:"inherit"})})})]}),C.jsx(IXe,{elementRef:y,postMessage:x}),C.jsx(S4n,{sx:P0.actionButton,timeSeriesGroupId:t.id,placeGroupTimeSeries:e,addPlaceGroupTimeSeries:n}),o?C.jsx(Dy,{size:24,sx:P0.actionButton,color:"secondary"}):C.jsx(Ht,{sx:P0.actionButton,"aria-label":"Close",onClick:()=>r(t.id),size:"small",children:C.jsx(WO,{fontSize:"inherit"})})]})})}const E4n=ra("div")(({theme:t})=>({userSelect:"none",marginTop:t.spacing(1),width:"99%",height:"32vh",display:"flex",flexDirection:"column",alignItems:"flex-stretch"})),T4n={style:{textAnchor:"middle"},angle:-90,position:"left",offset:0};function k4n({timeSeriesGroup:t,selectTimeSeries:e,selectedTime:n,selectTime:r,selectedTimeRange:i,selectTimeRange:o,places:s,selectPlace:a,placeInfos:l,dataTimeRange:c,chartTypeDefault:u,includeStdev:f,removeTimeSeries:d,removeTimeSeriesGroup:h,placeGroupTimeSeries:p,addPlaceGroupTimeSeries:g,postMessage:m}){const v=Xb(),[y,x]=D.useState(!1),[b,w]=D.useState(!0),[_,S]=D.useState(u),[O,k]=D.useState(f),[E,P]=D.useState({}),A=D.useRef(),R=D.useRef(),T=D.useRef(),M=D.useRef(null),I=D.useRef(null),j=D.useMemo(()=>{const W=new Map;t.timeSeriesArray.forEach((se,ye)=>{const ie=`v${ye}`,fe=`ev${ye}`,Q=se.source.valueDataKey,_e=se.source.errorDataKey;se.data.forEach(we=>{const Ie=W.get(we.time);let Pe;Ie===void 0?(Pe={time:we.time},W.set(we.time,Pe)):Pe=Ie;const Me=we[Q];if(vr(Me)&&isFinite(Me)&&(Pe[ie]=Me),_e){const Te=we[_e];vr(Te)&&isFinite(Te)&&(Pe[fe]=Te)}})});const J=Array.from(W.values());return J.sort((se,ye)=>se.time-ye.time),J},[t]),N=D.useMemo(()=>t.timeSeriesArray.map(W=>W.dataProgress?W.dataProgress:0),[t]),z=N.reduce((W,J)=>W+J,0)/N.length,L=z>0&&z<1,B=!!i&&!h1t(i,c||null);t.timeSeriesArray.forEach(W=>{W.source.valueDataKey});const F=t.variableUnits||me.get("unknown units"),$=`${me.get("Quantity")} (${F})`,q=v.palette.primary.light,G=v.palette.primary.main,Y=v.palette.text.primary,le=()=>{vr(E.x1)&&P({})},K=W=>{if(!W)return;const{chartX:J,chartY:se}=W;if(!vr(J)||!vr(se))return;const ye=Z(J,se);if(ye){const[ie,fe]=ye;P({x1:ie,y1:fe})}},ee=(W,J)=>{const{x1:se,y1:ye}=E;if(!vr(se)||!vr(ye)||!W)return;const{chartX:ie,chartY:fe}=W;if(!vr(ie)||!vr(fe))return;const Q=Z(ie,fe);if(Q){const[_e,we]=Q;J.ctrlKey||y?_e!==se&&we!==ye&&P({x1:se,y1:ye,x2:_e,y2:we}):_e!==se&&P({x1:se,y1:ye,x2:_e})}},re=W=>{const[J,se]=xOe(E);le(),J&&J[0]{le()},te=()=>{le()},ae=W=>{d(t.id,W)},U=()=>{le(),o(c||null,t.id,null)},oe=W=>{W&&o(i,t.id,W)},ne=(W,J)=>{if(T.current=[W,J],M.current){const se=M.current.getElementsByClassName("recharts-legend-wrapper");se.length!==0&&(I.current=se.item(0))}},V=([W,J])=>{const se=(J-W)*.1;return i?A.current=i:A.current=[W-se,J+se],A.current},X=([W,J])=>{const se=(J-W)*.1;if(t.variableRange)R.current=t.variableRange;else{const ye=W-se;R.current=[ye<0&&W-1e-6>0?0:ye,J+se]}return R.current},Z=(W,J)=>{const se=I.current;if(!T.current||!A.current||!R.current||!se)return;const[ye,ie]=A.current,[fe,Q]=R.current,[_e,we]=T.current,Ie=se.clientHeight,Pe=65,Me=5,Te=5,Le=38,ue=_e-Pe-Te,$e=we-Me-Le-Ie,Se=(W-Pe)/ue,Xe=(J-Me)/$e;return[ye+Se*(ie-ye),Q-Xe*(Q-fe)]},[he,xe]=xOe(E),H=_==="bar"?djn:fjn;return C.jsxs(E4n,{children:[C.jsx(O4n,{timeSeriesGroup:t,placeGroupTimeSeries:p,addPlaceGroupTimeSeries:g,removeTimeSeriesGroup:h,resetZoom:U,loading:L,zoomed:B,zoomMode:y,setZoomMode:x,showTooltips:b,setShowTooltips:w,chartType:_,setChartType:S,stdevBarsDisabled:!f,stdevBars:O,setStdevBars:k,valueRange:R.current,setValueRange:oe,chartElement:M,postMessage:m}),C.jsx(aqe,{width:"98%",onResize:ne,ref:M,children:C.jsxs(H,{onMouseDown:K,onMouseMove:ee,onMouseUp:re,onMouseEnter:ge,onMouseLeave:te,syncId:"anyId",style:{color:Y,fontSize:"0.8em"},data:j,barGap:1,barSize:30,maxBarSize:30,children:[C.jsx(A1,{dataKey:"time",type:"number",tickCount:6,domain:V,tickFormatter:pjn,stroke:Y,allowDataOverflow:!0}),C.jsx(P1,{type:"number",tickCount:5,domain:X,tickFormatter:gjn,stroke:Y,allowDataOverflow:!0,label:{...T4n,value:$}}),C.jsx(Yce,{strokeDasharray:"3 3"}),b&&!vr(E.x1)&&C.jsx(Pd,{content:C.jsx(xjn,{})}),C.jsx(EC,{content:C.jsx(mjn,{removeTimeSeries:ae})}),t.timeSeriesArray.map((W,J)=>bjn({timeSeriesGroup:t,timeSeriesIndex:J,selectTimeSeries:e,places:s,selectPlace:a,placeGroupTimeSeries:p,placeInfos:l,chartType:_,stdevBars:O,paletteMode:v.palette.mode})),he&&C.jsx(k1,{x1:he[0],y1:xe?xe[0]:void 0,x2:he[1],y2:xe?xe[1]:void 0,strokeOpacity:.3,fill:q,fillOpacity:.3}),n!==null&&C.jsx(vD,{isFront:!0,x:n,stroke:G,strokeWidth:3,strokeOpacity:.5})]})})]})}function xOe(t){const{x1:e,x2:n,y1:r,y2:i}=t;let o,s;return vr(e)&&vr(n)&&(o=eC.jsx(k4n,{timeSeriesGroup:l,dataTimeRange:n,selectedTimeRange:r,selectTimeRange:i,...a},l.id))]})}const D4n=t=>({locale:t.controlState.locale,timeSeriesGroups:t.dataState.timeSeriesGroups,selectedTime:t.controlState.selectedTime,selectedTimeRange:t.controlState.selectedTimeRange,dataTimeRange:f_t(t),chartTypeDefault:t.controlState.timeSeriesChartTypeDefault,includeStdev:t.controlState.timeSeriesIncludeStdev,placeInfos:y_t(t),places:ZM(t),placeGroupTimeSeries:b1t(t),canAddTimeSeries:WDe(t)}),I4n={selectTime:tU,selectTimeRange:a8e,removeTimeSeries:$Qt,removeTimeSeriesGroup:FQt,selectPlace:eU,addPlaceGroupTimeSeries:LQt,addTimeSeries:J6,postMessage:gc},L4n=Rn(D4n,I4n)(R4n),$4n=ct(C.jsx("path",{d:"M22 18v-2H8V4h2L7 1 4 4h2v2H2v2h4v8c0 1.1.9 2 2 2h8v2h-2l3 3 3-3h-2v-2zM10 8h6v6h2V8c0-1.1-.9-2-2-2h-6z"}),"Transform");function F4n(t){return t.count===0}function N4n(t){return t.count===1}function z4n(t){return t.count>1}function j4n({statisticsRecord:t}){const e=t.statistics;return C.jsx(Hee,{size:"small",children:C.jsx(qee,{children:F4n(e)?C.jsxs(Td,{children:[C.jsx(li,{children:me.get("Value")}),C.jsx(li,{align:"right",children:"NaN"})]}):N4n(e)?C.jsxs(Td,{children:[C.jsx(li,{children:me.get("Value")}),C.jsx(li,{align:"right",children:D2(e.mean)})]}):C.jsxs(C.Fragment,{children:[C.jsxs(Td,{children:[C.jsx(li,{children:me.get("Count")}),C.jsx(li,{align:"right",children:e.count})]}),C.jsxs(Td,{children:[C.jsx(li,{children:me.get("Minimum")}),C.jsx(li,{align:"right",children:D2(e.minimum)})]}),C.jsxs(Td,{children:[C.jsx(li,{children:me.get("Maximum")}),C.jsx(li,{align:"right",children:D2(e.maximum)})]}),C.jsxs(Td,{children:[C.jsx(li,{children:me.get("Mean")}),C.jsx(li,{align:"right",children:D2(e.mean)})]}),C.jsxs(Td,{children:[C.jsx(li,{children:me.get("Deviation")}),C.jsx(li,{align:"right",children:D2(e.deviation)})]})]})})})}function D2(t){return xy(t,3)}function B4n({statisticsRecord:t,showBrush:e,showDetails:n}){const r=$a(),i=t.statistics,o=D.useMemo(()=>{if(!i.histogram)return null;const{values:y,edges:x}=i.histogram;return y.map((b,w)=>({x:.5*(x[w]+x[w+1]),y:b,i:w}))},[i]),[s,a]=D.useState([0,o?o.length-1:-1]);if(D.useEffect(()=>{o&&a([0,o.length-1])},[o]),o===null)return null;const{placeInfo:l}=t.source,[c,u]=s,f=o[c]?o[c].x:NaN,d=o[u]?o[u].x:NaN,h=Math.max(i.mean-i.deviation,i.minimum,f),p=Math.min(i.mean+i.deviation,i.maximum,d),g=r.palette.text.primary,m=r.palette.text.primary,v=({startIndex:y,endIndex:x})=>{vr(y)&&vr(x)&&a([y,x])};return C.jsx(aqe,{width:"100%",height:"100%",children:C.jsxs(hjn,{data:o,margin:{top:0,right:e?30:5,bottom:1,left:2},style:{color:m,fontSize:"0.8em"},children:[C.jsx(Yce,{strokeDasharray:"3 3"}),C.jsx(A1,{type:"number",dataKey:"x",domain:[f,d],tickCount:10,tickFormatter:y=>xy(y,2)}),C.jsx(P1,{}),C.jsx(s0,{type:"monotone",dataKey:"y",stroke:l.color,fill:l.color}),n&&C.jsx(vD,{x:i.mean,isFront:!0,stroke:g,strokeWidth:2,strokeOpacity:.5}),n&&C.jsx(k1,{x1:h,x2:p,isFront:!1,stroke:g,strokeWidth:1,strokeOpacity:.3,fill:g,fillOpacity:.05}),e&&C.jsx(jb,{dataKey:"i",height:22,startIndex:c,endIndex:u,tickFormatter:y=>xy(o[y].x,1),onChange:v})]})})}const o$={container:{padding:1,width:"100%"},header:{display:"flex",justifyContent:"space-between",alignItems:"center",paddingBottom:.5},actions:{display:"flex",gap:.1},body:{display:"flex"}};function s$({phrase:t}){return C.jsx("span",{style:{color:"red"},children:`<${me.get(t)}?>`})}function LXe({dataset:t,variable:e,time:n,placeInfo:r,actions:i,body:o,containerRef:s}){const a=t?t.title:C.jsx(s$,{phrase:"Dataset"}),l=e?e.name:C.jsx(s$,{phrase:"Variable"}),c=t==null?void 0:t.dimensions.some(d=>d.name=="time"),u=n?qRe(n):c?C.jsx(s$,{phrase:"Time"}):null,f=r?r.label:C.jsx(s$,{phrase:"Place"});return C.jsxs(ot,{sx:o$.container,ref:s,children:[C.jsxs(ot,{sx:o$.header,children:[C.jsxs(Jt,{fontSize:"small",children:[a," / ",l,u&&`, ${u}`,", ",f]}),C.jsx(ot,{sx:o$.actions,children:i})]}),o&&C.jsx(ot,{sx:o$.body,children:o})]})}const bOe={table:{flexGrow:0},chart:{flexGrow:1}};function U4n({locale:t,statisticsRecord:e,rowIndex:n,removeStatistics:r,postMessage:i}){const o=D.useRef(null),[s,a]=D.useState(!1),[l,c]=D.useState(!1),{dataset:u,variable:f,time:d,placeInfo:h}=e.source,p=z4n(e.statistics),g=()=>{c(!l)},m=()=>{a(!s)},v=()=>{r(n)};return C.jsx(LXe,{dataset:u,variable:f,time:d,placeInfo:h,containerRef:o,actions:C.jsxs(C.Fragment,{children:[p&&C.jsxs(QC,{size:"small",children:[C.jsx(Lt,{arrow:!0,title:me.get("Toggle adjustable x-range"),children:C.jsx(yr,{selected:s,onClick:m,value:"brush",size:"small",children:C.jsx($4n,{fontSize:"inherit"})})}),C.jsx(Lt,{arrow:!0,title:me.get("Show standard deviation (if any)"),children:C.jsx(yr,{selected:l,onClick:g,value:"details",size:"small",children:C.jsx(EXe,{fontSize:"inherit"})})})]}),p&&C.jsx(IXe,{elementRef:o,postMessage:i}),C.jsx(Ht,{size:"small",onClick:v,children:C.jsx(WO,{fontSize:"inherit"})})]}),body:C.jsxs(C.Fragment,{children:[C.jsx(ot,{sx:bOe.table,children:C.jsx(j4n,{locale:t,statisticsRecord:e})}),C.jsx(ot,{sx:bOe.chart,children:C.jsx(B4n,{showBrush:s,showDetails:l,statisticsRecord:e})})]})})}const W4n={progress:{color:"primary"}};function V4n({selectedDataset:t,selectedVariable:e,selectedTime:n,selectedPlaceInfo:r,canAddStatistics:i,addStatistics:o,statisticsLoading:s}){return C.jsx(LXe,{dataset:t,variable:e,time:n,placeInfo:r,actions:s?C.jsx(Dy,{size:20,sx:W4n.progress}):C.jsx(Ht,{size:"small",disabled:!i,onClick:o,color:"primary",children:C.jsx(EU,{fontSize:"inherit"})})})}const G4n={container:{padding:1,display:"flex",flexDirection:"column",alignItems:"flex-start"}};function H4n({selectedDataset:t,selectedVariable:e,selectedTime:n,selectedPlaceInfo:r,statisticsLoading:i,statisticsRecords:o,canAddStatistics:s,addStatistics:a,removeStatistics:l,postMessage:c}){return C.jsxs(ot,{sx:G4n.container,children:[C.jsx(V4n,{selectedDataset:t,selectedVariable:e,selectedTime:n,selectedPlaceInfo:r,canAddStatistics:s,addStatistics:a,statisticsLoading:i}),o.map((u,f)=>C.jsx(U4n,{statisticsRecord:u,rowIndex:f,removeStatistics:l,postMessage:c},f))]})}const q4n=t=>({selectedDataset:fo(t),selectedVariable:Na(t),selectedTime:i1(t),selectedPlaceInfo:JM(t),statisticsLoading:y1t(t),statisticsRecords:x_t(t),canAddStatistics:VDe(t)}),X4n={addStatistics:RUe,removeStatistics:DQt,postMessage:gc},Y4n=Rn(q4n,X4n)(H4n);/** * @license * Copyright 2010-2022 Three.js Authors * SPDX-License-Identifier: MIT - */const Lce="144",hw={LEFT:0,MIDDLE:1,RIGHT:2,ROTATE:0,DOLLY:1,PAN:2},pw={ROTATE:0,PAN:1,DOLLY_PAN:2,DOLLY_ROTATE:3},nBn=0,XCe=1,rBn=2,cXe=1,iBn=2,FT=3,zC=0,vc=1,tg=2,qv=0,oS=1,YCe=2,QCe=3,KCe=4,oBn=5,Bw=100,sBn=101,aBn=102,ZCe=103,JCe=104,lBn=200,cBn=201,uBn=202,fBn=203,uXe=204,fXe=205,dBn=206,hBn=207,pBn=208,gBn=209,mBn=210,vBn=0,yBn=1,xBn=2,DZ=3,bBn=4,wBn=5,_Bn=6,SBn=7,dXe=0,CBn=1,OBn=2,wg=0,EBn=1,TBn=2,kBn=3,ABn=4,PBn=5,hXe=300,jC=301,BC=302,IZ=303,LZ=304,i8=306,$Z=1e3,eu=1001,FZ=1002,tl=1003,eOe=1004,tOe=1005,nl=1006,MBn=1007,o8=1008,U1=1009,RBn=1010,DBn=1011,pXe=1012,IBn=1013,_x=1014,Ev=1015,sM=1016,LBn=1017,$Bn=1018,sS=1020,FBn=1021,NBn=1022,sh=1023,zBn=1024,jBn=1025,Xx=1026,UC=1027,gXe=1028,BBn=1029,UBn=1030,WBn=1031,VBn=1033,B7=33776,U7=33777,W7=33778,V7=33779,nOe=35840,rOe=35841,iOe=35842,oOe=35843,GBn=36196,sOe=37492,aOe=37496,lOe=37808,cOe=37809,uOe=37810,fOe=37811,dOe=37812,hOe=37813,pOe=37814,gOe=37815,mOe=37816,vOe=37817,yOe=37818,xOe=37819,bOe=37820,wOe=37821,_Oe=36492,W1=3e3,Pi=3001,HBn=3200,qBn=3201,XBn=0,YBn=1,Mp="srgb",Sx="srgb-linear",G7=7680,QBn=519,SOe=35044,COe="300 es",NZ=1035;class Mb{addEventListener(e,n){this._listeners===void 0&&(this._listeners={});const r=this._listeners;r[e]===void 0&&(r[e]=[]),r[e].indexOf(n)===-1&&r[e].push(n)}hasEventListener(e,n){if(this._listeners===void 0)return!1;const r=this._listeners;return r[e]!==void 0&&r[e].indexOf(n)!==-1}removeEventListener(e,n){if(this._listeners===void 0)return;const i=this._listeners[e];if(i!==void 0){const o=i.indexOf(n);o!==-1&&i.splice(o,1)}}dispatchEvent(e){if(this._listeners===void 0)return;const r=this._listeners[e.type];if(r!==void 0){e.target=this;const i=r.slice(0);for(let o=0,s=i.length;o>8&255]+Rs[t>>16&255]+Rs[t>>24&255]+"-"+Rs[e&255]+Rs[e>>8&255]+"-"+Rs[e>>16&15|64]+Rs[e>>24&255]+"-"+Rs[n&63|128]+Rs[n>>8&255]+"-"+Rs[n>>16&255]+Rs[n>>24&255]+Rs[r&255]+Rs[r>>8&255]+Rs[r>>16&255]+Rs[r>>24&255]).toLowerCase()}function rl(t,e,n){return Math.max(e,Math.min(n,t))}function KBn(t,e){return(t%e+e)%e}function q7(t,e,n){return(1-n)*t+n*e}function EOe(t){return(t&t-1)===0&&t!==0}function zZ(t){return Math.pow(2,Math.floor(Math.log(t)/Math.LN2))}function f$(t,e){switch(e.constructor){case Float32Array:return t;case Uint16Array:return t/65535;case Uint8Array:return t/255;case Int16Array:return Math.max(t/32767,-1);case Int8Array:return Math.max(t/127,-1);default:throw new Error("Invalid component type.")}}function Nl(t,e){switch(e.constructor){case Float32Array:return t;case Uint16Array:return Math.round(t*65535);case Uint8Array:return Math.round(t*255);case Int16Array:return Math.round(t*32767);case Int8Array:return Math.round(t*127);default:throw new Error("Invalid component type.")}}class En{constructor(e=0,n=0){En.prototype.isVector2=!0,this.x=e,this.y=n}get width(){return this.x}set width(e){this.x=e}get height(){return this.y}set height(e){this.y=e}set(e,n){return this.x=e,this.y=n,this}setScalar(e){return this.x=e,this.y=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setComponent(e,n){switch(e){case 0:this.x=n;break;case 1:this.y=n;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y)}copy(e){return this.x=e.x,this.y=e.y,this}add(e){return this.x+=e.x,this.y+=e.y,this}addScalar(e){return this.x+=e,this.y+=e,this}addVectors(e,n){return this.x=e.x+n.x,this.y=e.y+n.y,this}addScaledVector(e,n){return this.x+=e.x*n,this.y+=e.y*n,this}sub(e){return this.x-=e.x,this.y-=e.y,this}subScalar(e){return this.x-=e,this.y-=e,this}subVectors(e,n){return this.x=e.x-n.x,this.y=e.y-n.y,this}multiply(e){return this.x*=e.x,this.y*=e.y,this}multiplyScalar(e){return this.x*=e,this.y*=e,this}divide(e){return this.x/=e.x,this.y/=e.y,this}divideScalar(e){return this.multiplyScalar(1/e)}applyMatrix3(e){const n=this.x,r=this.y,i=e.elements;return this.x=i[0]*n+i[3]*r+i[6],this.y=i[1]*n+i[4]*r+i[7],this}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this}clamp(e,n){return this.x=Math.max(e.x,Math.min(n.x,this.x)),this.y=Math.max(e.y,Math.min(n.y,this.y)),this}clampScalar(e,n){return this.x=Math.max(e,Math.min(n,this.x)),this.y=Math.max(e,Math.min(n,this.y)),this}clampLength(e,n){const r=this.length();return this.divideScalar(r||1).multiplyScalar(Math.max(e,Math.min(n,r)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}roundToZero(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this}negate(){return this.x=-this.x,this.y=-this.y,this}dot(e){return this.x*e.x+this.y*e.y}cross(e){return this.x*e.y-this.y*e.x}lengthSq(){return this.x*this.x+this.y*this.y}length(){return Math.sqrt(this.x*this.x+this.y*this.y)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)}normalize(){return this.divideScalar(this.length()||1)}angle(){return Math.atan2(-this.y,-this.x)+Math.PI}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const n=this.x-e.x,r=this.y-e.y;return n*n+r*r}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,n){return this.x+=(e.x-this.x)*n,this.y+=(e.y-this.y)*n,this}lerpVectors(e,n,r){return this.x=e.x+(n.x-e.x)*r,this.y=e.y+(n.y-e.y)*r,this}equals(e){return e.x===this.x&&e.y===this.y}fromArray(e,n=0){return this.x=e[n],this.y=e[n+1],this}toArray(e=[],n=0){return e[n]=this.x,e[n+1]=this.y,e}fromBufferAttribute(e,n){return this.x=e.getX(n),this.y=e.getY(n),this}rotateAround(e,n){const r=Math.cos(n),i=Math.sin(n),o=this.x-e.x,s=this.y-e.y;return this.x=o*r-s*i+e.x,this.y=o*i+s*r+e.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y}}class fc{constructor(){fc.prototype.isMatrix3=!0,this.elements=[1,0,0,0,1,0,0,0,1]}set(e,n,r,i,o,s,a,l,c){const u=this.elements;return u[0]=e,u[1]=i,u[2]=a,u[3]=n,u[4]=o,u[5]=l,u[6]=r,u[7]=s,u[8]=c,this}identity(){return this.set(1,0,0,0,1,0,0,0,1),this}copy(e){const n=this.elements,r=e.elements;return n[0]=r[0],n[1]=r[1],n[2]=r[2],n[3]=r[3],n[4]=r[4],n[5]=r[5],n[6]=r[6],n[7]=r[7],n[8]=r[8],this}extractBasis(e,n,r){return e.setFromMatrix3Column(this,0),n.setFromMatrix3Column(this,1),r.setFromMatrix3Column(this,2),this}setFromMatrix4(e){const n=e.elements;return this.set(n[0],n[4],n[8],n[1],n[5],n[9],n[2],n[6],n[10]),this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,n){const r=e.elements,i=n.elements,o=this.elements,s=r[0],a=r[3],l=r[6],c=r[1],u=r[4],f=r[7],d=r[2],h=r[5],p=r[8],g=i[0],m=i[3],v=i[6],y=i[1],x=i[4],b=i[7],w=i[2],_=i[5],S=i[8];return o[0]=s*g+a*y+l*w,o[3]=s*m+a*x+l*_,o[6]=s*v+a*b+l*S,o[1]=c*g+u*y+f*w,o[4]=c*m+u*x+f*_,o[7]=c*v+u*b+f*S,o[2]=d*g+h*y+p*w,o[5]=d*m+h*x+p*_,o[8]=d*v+h*b+p*S,this}multiplyScalar(e){const n=this.elements;return n[0]*=e,n[3]*=e,n[6]*=e,n[1]*=e,n[4]*=e,n[7]*=e,n[2]*=e,n[5]*=e,n[8]*=e,this}determinant(){const e=this.elements,n=e[0],r=e[1],i=e[2],o=e[3],s=e[4],a=e[5],l=e[6],c=e[7],u=e[8];return n*s*u-n*a*c-r*o*u+r*a*l+i*o*c-i*s*l}invert(){const e=this.elements,n=e[0],r=e[1],i=e[2],o=e[3],s=e[4],a=e[5],l=e[6],c=e[7],u=e[8],f=u*s-a*c,d=a*l-u*o,h=c*o-s*l,p=n*f+r*d+i*h;if(p===0)return this.set(0,0,0,0,0,0,0,0,0);const g=1/p;return e[0]=f*g,e[1]=(i*c-u*r)*g,e[2]=(a*r-i*s)*g,e[3]=d*g,e[4]=(u*n-i*l)*g,e[5]=(i*o-a*n)*g,e[6]=h*g,e[7]=(r*l-c*n)*g,e[8]=(s*n-r*o)*g,this}transpose(){let e;const n=this.elements;return e=n[1],n[1]=n[3],n[3]=e,e=n[2],n[2]=n[6],n[6]=e,e=n[5],n[5]=n[7],n[7]=e,this}getNormalMatrix(e){return this.setFromMatrix4(e).invert().transpose()}transposeIntoArray(e){const n=this.elements;return e[0]=n[0],e[1]=n[3],e[2]=n[6],e[3]=n[1],e[4]=n[4],e[5]=n[7],e[6]=n[2],e[7]=n[5],e[8]=n[8],this}setUvTransform(e,n,r,i,o,s,a){const l=Math.cos(o),c=Math.sin(o);return this.set(r*l,r*c,-r*(l*s+c*a)+s+e,-i*c,i*l,-i*(-c*s+l*a)+a+n,0,0,1),this}scale(e,n){const r=this.elements;return r[0]*=e,r[3]*=e,r[6]*=e,r[1]*=n,r[4]*=n,r[7]*=n,this}rotate(e){const n=Math.cos(e),r=Math.sin(e),i=this.elements,o=i[0],s=i[3],a=i[6],l=i[1],c=i[4],u=i[7];return i[0]=n*o+r*l,i[3]=n*s+r*c,i[6]=n*a+r*u,i[1]=-r*o+n*l,i[4]=-r*s+n*c,i[7]=-r*a+n*u,this}translate(e,n){const r=this.elements;return r[0]+=e*r[2],r[3]+=e*r[5],r[6]+=e*r[8],r[1]+=n*r[2],r[4]+=n*r[5],r[7]+=n*r[8],this}equals(e){const n=this.elements,r=e.elements;for(let i=0;i<9;i++)if(n[i]!==r[i])return!1;return!0}fromArray(e,n=0){for(let r=0;r<9;r++)this.elements[r]=e[r+n];return this}toArray(e=[],n=0){const r=this.elements;return e[n]=r[0],e[n+1]=r[1],e[n+2]=r[2],e[n+3]=r[3],e[n+4]=r[4],e[n+5]=r[5],e[n+6]=r[6],e[n+7]=r[7],e[n+8]=r[8],e}clone(){return new this.constructor().fromArray(this.elements)}}function mXe(t){for(let e=t.length-1;e>=0;--e)if(t[e]>=65535)return!0;return!1}function aM(t){return document.createElementNS("http://www.w3.org/1999/xhtml",t)}function Yx(t){return t<.04045?t*.0773993808:Math.pow(t*.9478672986+.0521327014,2.4)}function eF(t){return t<.0031308?t*12.92:1.055*Math.pow(t,.41666)-.055}const X7={[Mp]:{[Sx]:Yx},[Sx]:{[Mp]:eF}},Zu={legacyMode:!0,get workingColorSpace(){return Sx},set workingColorSpace(t){console.warn("THREE.ColorManagement: .workingColorSpace is readonly.")},convert:function(t,e,n){if(this.legacyMode||e===n||!e||!n)return t;if(X7[e]&&X7[e][n]!==void 0){const r=X7[e][n];return t.r=r(t.r),t.g=r(t.g),t.b=r(t.b),t}throw new Error("Unsupported color space conversion.")},fromWorkingColorSpace:function(t,e){return this.convert(t,this.workingColorSpace,e)},toWorkingColorSpace:function(t,e){return this.convert(t,e,this.workingColorSpace)}},vXe={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074},po={r:0,g:0,b:0},Ju={h:0,s:0,l:0},d$={h:0,s:0,l:0};function Y7(t,e,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+(e-t)*6*n:n<1/2?e:n<2/3?t+(e-t)*6*(2/3-n):t}function h$(t,e){return e.r=t.r,e.g=t.g,e.b=t.b,e}class ci{constructor(e,n,r){return this.isColor=!0,this.r=1,this.g=1,this.b=1,n===void 0&&r===void 0?this.set(e):this.setRGB(e,n,r)}set(e){return e&&e.isColor?this.copy(e):typeof e=="number"?this.setHex(e):typeof e=="string"&&this.setStyle(e),this}setScalar(e){return this.r=e,this.g=e,this.b=e,this}setHex(e,n=Mp){return e=Math.floor(e),this.r=(e>>16&255)/255,this.g=(e>>8&255)/255,this.b=(e&255)/255,Zu.toWorkingColorSpace(this,n),this}setRGB(e,n,r,i=Sx){return this.r=e,this.g=n,this.b=r,Zu.toWorkingColorSpace(this,i),this}setHSL(e,n,r,i=Sx){if(e=KBn(e,1),n=rl(n,0,1),r=rl(r,0,1),n===0)this.r=this.g=this.b=r;else{const o=r<=.5?r*(1+n):r+n-r*n,s=2*r-o;this.r=Y7(s,o,e+1/3),this.g=Y7(s,o,e),this.b=Y7(s,o,e-1/3)}return Zu.toWorkingColorSpace(this,i),this}setStyle(e,n=Mp){function r(o){o!==void 0&&parseFloat(o)<1&&console.warn("THREE.Color: Alpha component of "+e+" will be ignored.")}let i;if(i=/^((?:rgb|hsl)a?)\(([^\)]*)\)/.exec(e)){let o;const s=i[1],a=i[2];switch(s){case"rgb":case"rgba":if(o=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(a))return this.r=Math.min(255,parseInt(o[1],10))/255,this.g=Math.min(255,parseInt(o[2],10))/255,this.b=Math.min(255,parseInt(o[3],10))/255,Zu.toWorkingColorSpace(this,n),r(o[4]),this;if(o=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(a))return this.r=Math.min(100,parseInt(o[1],10))/100,this.g=Math.min(100,parseInt(o[2],10))/100,this.b=Math.min(100,parseInt(o[3],10))/100,Zu.toWorkingColorSpace(this,n),r(o[4]),this;break;case"hsl":case"hsla":if(o=/^\s*(\d*\.?\d+)\s*,\s*(\d*\.?\d+)\%\s*,\s*(\d*\.?\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(a)){const l=parseFloat(o[1])/360,c=parseFloat(o[2])/100,u=parseFloat(o[3])/100;return r(o[4]),this.setHSL(l,c,u,n)}break}}else if(i=/^\#([A-Fa-f\d]+)$/.exec(e)){const o=i[1],s=o.length;if(s===3)return this.r=parseInt(o.charAt(0)+o.charAt(0),16)/255,this.g=parseInt(o.charAt(1)+o.charAt(1),16)/255,this.b=parseInt(o.charAt(2)+o.charAt(2),16)/255,Zu.toWorkingColorSpace(this,n),this;if(s===6)return this.r=parseInt(o.charAt(0)+o.charAt(1),16)/255,this.g=parseInt(o.charAt(2)+o.charAt(3),16)/255,this.b=parseInt(o.charAt(4)+o.charAt(5),16)/255,Zu.toWorkingColorSpace(this,n),this}return e&&e.length>0?this.setColorName(e,n):this}setColorName(e,n=Mp){const r=vXe[e.toLowerCase()];return r!==void 0?this.setHex(r,n):console.warn("THREE.Color: Unknown color "+e),this}clone(){return new this.constructor(this.r,this.g,this.b)}copy(e){return this.r=e.r,this.g=e.g,this.b=e.b,this}copySRGBToLinear(e){return this.r=Yx(e.r),this.g=Yx(e.g),this.b=Yx(e.b),this}copyLinearToSRGB(e){return this.r=eF(e.r),this.g=eF(e.g),this.b=eF(e.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(e=Mp){return Zu.fromWorkingColorSpace(h$(this,po),e),rl(po.r*255,0,255)<<16^rl(po.g*255,0,255)<<8^rl(po.b*255,0,255)<<0}getHexString(e=Mp){return("000000"+this.getHex(e).toString(16)).slice(-6)}getHSL(e,n=Sx){Zu.fromWorkingColorSpace(h$(this,po),n);const r=po.r,i=po.g,o=po.b,s=Math.max(r,i,o),a=Math.min(r,i,o);let l,c;const u=(a+s)/2;if(a===s)l=0,c=0;else{const f=s-a;switch(c=u<=.5?f/(s+a):f/(2-s-a),s){case r:l=(i-o)/f+(i"u")return e.src;let n;if(e instanceof HTMLCanvasElement)n=e;else{gw===void 0&&(gw=aM("canvas")),gw.width=e.width,gw.height=e.height;const r=gw.getContext("2d");e instanceof ImageData?r.putImageData(e,0,0):r.drawImage(e,0,0,e.width,e.height),n=gw}return n.width>2048||n.height>2048?(console.warn("THREE.ImageUtils.getDataURL: Image converted to jpg for performance reasons",e),n.toDataURL("image/jpeg",.6)):n.toDataURL("image/png")}static sRGBToLinear(e){if(typeof HTMLImageElement<"u"&&e instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&e instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&e instanceof ImageBitmap){const n=aM("canvas");n.width=e.width,n.height=e.height;const r=n.getContext("2d");r.drawImage(e,0,0,e.width,e.height);const i=r.getImageData(0,0,e.width,e.height),o=i.data;for(let s=0;s1)switch(this.wrapS){case $Z:e.x=e.x-Math.floor(e.x);break;case eu:e.x=e.x<0?0:1;break;case FZ:Math.abs(Math.floor(e.x)%2)===1?e.x=Math.ceil(e.x)-e.x:e.x=e.x-Math.floor(e.x);break}if(e.y<0||e.y>1)switch(this.wrapT){case $Z:e.y=e.y-Math.floor(e.y);break;case eu:e.y=e.y<0?0:1;break;case FZ:Math.abs(Math.floor(e.y)%2)===1?e.y=Math.ceil(e.y)-e.y:e.y=e.y-Math.floor(e.y);break}return this.flipY&&(e.y=1-e.y),e}set needsUpdate(e){e===!0&&(this.version++,this.source.needsUpdate=!0)}}Ac.DEFAULT_IMAGE=null;Ac.DEFAULT_MAPPING=hXe;class vs{constructor(e=0,n=0,r=0,i=1){vs.prototype.isVector4=!0,this.x=e,this.y=n,this.z=r,this.w=i}get width(){return this.z}set width(e){this.z=e}get height(){return this.w}set height(e){this.w=e}set(e,n,r,i){return this.x=e,this.y=n,this.z=r,this.w=i,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this.w=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setW(e){return this.w=e,this}setComponent(e,n){switch(e){case 0:this.x=n;break;case 1:this.y=n;break;case 2:this.z=n;break;case 3:this.w=n;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;case 3:return this.w;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y,this.z,this.w)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this.w=e.w!==void 0?e.w:1,this}add(e){return this.x+=e.x,this.y+=e.y,this.z+=e.z,this.w+=e.w,this}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this.w+=e,this}addVectors(e,n){return this.x=e.x+n.x,this.y=e.y+n.y,this.z=e.z+n.z,this.w=e.w+n.w,this}addScaledVector(e,n){return this.x+=e.x*n,this.y+=e.y*n,this.z+=e.z*n,this.w+=e.w*n,this}sub(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this.w-=e.w,this}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this.w-=e,this}subVectors(e,n){return this.x=e.x-n.x,this.y=e.y-n.y,this.z=e.z-n.z,this.w=e.w-n.w,this}multiply(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this.w*=e.w,this}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this.w*=e,this}applyMatrix4(e){const n=this.x,r=this.y,i=this.z,o=this.w,s=e.elements;return this.x=s[0]*n+s[4]*r+s[8]*i+s[12]*o,this.y=s[1]*n+s[5]*r+s[9]*i+s[13]*o,this.z=s[2]*n+s[6]*r+s[10]*i+s[14]*o,this.w=s[3]*n+s[7]*r+s[11]*i+s[15]*o,this}divideScalar(e){return this.multiplyScalar(1/e)}setAxisAngleFromQuaternion(e){this.w=2*Math.acos(e.w);const n=Math.sqrt(1-e.w*e.w);return n<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=e.x/n,this.y=e.y/n,this.z=e.z/n),this}setAxisAngleFromRotationMatrix(e){let n,r,i,o;const l=e.elements,c=l[0],u=l[4],f=l[8],d=l[1],h=l[5],p=l[9],g=l[2],m=l[6],v=l[10];if(Math.abs(u-d)<.01&&Math.abs(f-g)<.01&&Math.abs(p-m)<.01){if(Math.abs(u+d)<.1&&Math.abs(f+g)<.1&&Math.abs(p+m)<.1&&Math.abs(c+h+v-3)<.1)return this.set(1,0,0,0),this;n=Math.PI;const x=(c+1)/2,b=(h+1)/2,w=(v+1)/2,_=(u+d)/4,S=(f+g)/4,O=(p+m)/4;return x>b&&x>w?x<.01?(r=0,i=.707106781,o=.707106781):(r=Math.sqrt(x),i=_/r,o=S/r):b>w?b<.01?(r=.707106781,i=0,o=.707106781):(i=Math.sqrt(b),r=_/i,o=O/i):w<.01?(r=.707106781,i=.707106781,o=0):(o=Math.sqrt(w),r=S/o,i=O/o),this.set(r,i,o,n),this}let y=Math.sqrt((m-p)*(m-p)+(f-g)*(f-g)+(d-u)*(d-u));return Math.abs(y)<.001&&(y=1),this.x=(m-p)/y,this.y=(f-g)/y,this.z=(d-u)/y,this.w=Math.acos((c+h+v-1)/2),this}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this.w=Math.min(this.w,e.w),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this.w=Math.max(this.w,e.w),this}clamp(e,n){return this.x=Math.max(e.x,Math.min(n.x,this.x)),this.y=Math.max(e.y,Math.min(n.y,this.y)),this.z=Math.max(e.z,Math.min(n.z,this.z)),this.w=Math.max(e.w,Math.min(n.w,this.w)),this}clampScalar(e,n){return this.x=Math.max(e,Math.min(n,this.x)),this.y=Math.max(e,Math.min(n,this.y)),this.z=Math.max(e,Math.min(n,this.z)),this.w=Math.max(e,Math.min(n,this.w)),this}clampLength(e,n){const r=this.length();return this.divideScalar(r||1).multiplyScalar(Math.max(e,Math.min(n,r)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this.w=Math.floor(this.w),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this.w=Math.ceil(this.w),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this.w=Math.round(this.w),this}roundToZero(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this.z=this.z<0?Math.ceil(this.z):Math.floor(this.z),this.w=this.w<0?Math.ceil(this.w):Math.floor(this.w),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z+this.w*e.w}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)+Math.abs(this.w)}normalize(){return this.divideScalar(this.length()||1)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,n){return this.x+=(e.x-this.x)*n,this.y+=(e.y-this.y)*n,this.z+=(e.z-this.z)*n,this.w+=(e.w-this.w)*n,this}lerpVectors(e,n,r){return this.x=e.x+(n.x-e.x)*r,this.y=e.y+(n.y-e.y)*r,this.z=e.z+(n.z-e.z)*r,this.w=e.w+(n.w-e.w)*r,this}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z&&e.w===this.w}fromArray(e,n=0){return this.x=e[n],this.y=e[n+1],this.z=e[n+2],this.w=e[n+3],this}toArray(e=[],n=0){return e[n]=this.x,e[n+1]=this.y,e[n+2]=this.z,e[n+3]=this.w,e}fromBufferAttribute(e,n){return this.x=e.getX(n),this.y=e.getY(n),this.z=e.getZ(n),this.w=e.getW(n),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this.w=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z,yield this.w}}class V1 extends Mb{constructor(e,n,r={}){super(),this.isWebGLRenderTarget=!0,this.width=e,this.height=n,this.depth=1,this.scissor=new vs(0,0,e,n),this.scissorTest=!1,this.viewport=new vs(0,0,e,n);const i={width:e,height:n,depth:1};this.texture=new Ac(i,r.mapping,r.wrapS,r.wrapT,r.magFilter,r.minFilter,r.format,r.type,r.anisotropy,r.encoding),this.texture.isRenderTargetTexture=!0,this.texture.flipY=!1,this.texture.generateMipmaps=r.generateMipmaps!==void 0?r.generateMipmaps:!1,this.texture.internalFormat=r.internalFormat!==void 0?r.internalFormat:null,this.texture.minFilter=r.minFilter!==void 0?r.minFilter:nl,this.depthBuffer=r.depthBuffer!==void 0?r.depthBuffer:!0,this.stencilBuffer=r.stencilBuffer!==void 0?r.stencilBuffer:!1,this.depthTexture=r.depthTexture!==void 0?r.depthTexture:null,this.samples=r.samples!==void 0?r.samples:0}setSize(e,n,r=1){(this.width!==e||this.height!==n||this.depth!==r)&&(this.width=e,this.height=n,this.depth=r,this.texture.image.width=e,this.texture.image.height=n,this.texture.image.depth=r,this.dispose()),this.viewport.set(0,0,e,n),this.scissor.set(0,0,e,n)}clone(){return new this.constructor().copy(this)}copy(e){this.width=e.width,this.height=e.height,this.depth=e.depth,this.viewport.copy(e.viewport),this.texture=e.texture.clone(),this.texture.isRenderTargetTexture=!0;const n=Object.assign({},e.texture.image);return this.texture.source=new xXe(n),this.depthBuffer=e.depthBuffer,this.stencilBuffer=e.stencilBuffer,e.depthTexture!==null&&(this.depthTexture=e.depthTexture.clone()),this.samples=e.samples,this}dispose(){this.dispatchEvent({type:"dispose"})}}class bXe extends Ac{constructor(e=null,n=1,r=1,i=1){super(null),this.isDataArrayTexture=!0,this.image={data:e,width:n,height:r,depth:i},this.magFilter=tl,this.minFilter=tl,this.wrapR=eu,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}class wXe extends Ac{constructor(e=null,n=1,r=1,i=1){super(null),this.isData3DTexture=!0,this.image={data:e,width:n,height:r,depth:i},this.magFilter=tl,this.minFilter=tl,this.wrapR=eu,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}class G1{constructor(e=0,n=0,r=0,i=1){this.isQuaternion=!0,this._x=e,this._y=n,this._z=r,this._w=i}static slerpFlat(e,n,r,i,o,s,a){let l=r[i+0],c=r[i+1],u=r[i+2],f=r[i+3];const d=o[s+0],h=o[s+1],p=o[s+2],g=o[s+3];if(a===0){e[n+0]=l,e[n+1]=c,e[n+2]=u,e[n+3]=f;return}if(a===1){e[n+0]=d,e[n+1]=h,e[n+2]=p,e[n+3]=g;return}if(f!==g||l!==d||c!==h||u!==p){let m=1-a;const v=l*d+c*h+u*p+f*g,y=v>=0?1:-1,x=1-v*v;if(x>Number.EPSILON){const w=Math.sqrt(x),_=Math.atan2(w,v*y);m=Math.sin(m*_)/w,a=Math.sin(a*_)/w}const b=a*y;if(l=l*m+d*b,c=c*m+h*b,u=u*m+p*b,f=f*m+g*b,m===1-a){const w=1/Math.sqrt(l*l+c*c+u*u+f*f);l*=w,c*=w,u*=w,f*=w}}e[n]=l,e[n+1]=c,e[n+2]=u,e[n+3]=f}static multiplyQuaternionsFlat(e,n,r,i,o,s){const a=r[i],l=r[i+1],c=r[i+2],u=r[i+3],f=o[s],d=o[s+1],h=o[s+2],p=o[s+3];return e[n]=a*p+u*f+l*h-c*d,e[n+1]=l*p+u*d+c*f-a*h,e[n+2]=c*p+u*h+a*d-l*f,e[n+3]=u*p-a*f-l*d-c*h,e}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get w(){return this._w}set w(e){this._w=e,this._onChangeCallback()}set(e,n,r,i){return this._x=e,this._y=n,this._z=r,this._w=i,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._w)}copy(e){return this._x=e.x,this._y=e.y,this._z=e.z,this._w=e.w,this._onChangeCallback(),this}setFromEuler(e,n){const r=e._x,i=e._y,o=e._z,s=e._order,a=Math.cos,l=Math.sin,c=a(r/2),u=a(i/2),f=a(o/2),d=l(r/2),h=l(i/2),p=l(o/2);switch(s){case"XYZ":this._x=d*u*f+c*h*p,this._y=c*h*f-d*u*p,this._z=c*u*p+d*h*f,this._w=c*u*f-d*h*p;break;case"YXZ":this._x=d*u*f+c*h*p,this._y=c*h*f-d*u*p,this._z=c*u*p-d*h*f,this._w=c*u*f+d*h*p;break;case"ZXY":this._x=d*u*f-c*h*p,this._y=c*h*f+d*u*p,this._z=c*u*p+d*h*f,this._w=c*u*f-d*h*p;break;case"ZYX":this._x=d*u*f-c*h*p,this._y=c*h*f+d*u*p,this._z=c*u*p-d*h*f,this._w=c*u*f+d*h*p;break;case"YZX":this._x=d*u*f+c*h*p,this._y=c*h*f+d*u*p,this._z=c*u*p-d*h*f,this._w=c*u*f-d*h*p;break;case"XZY":this._x=d*u*f-c*h*p,this._y=c*h*f-d*u*p,this._z=c*u*p+d*h*f,this._w=c*u*f+d*h*p;break;default:console.warn("THREE.Quaternion: .setFromEuler() encountered an unknown order: "+s)}return n!==!1&&this._onChangeCallback(),this}setFromAxisAngle(e,n){const r=n/2,i=Math.sin(r);return this._x=e.x*i,this._y=e.y*i,this._z=e.z*i,this._w=Math.cos(r),this._onChangeCallback(),this}setFromRotationMatrix(e){const n=e.elements,r=n[0],i=n[4],o=n[8],s=n[1],a=n[5],l=n[9],c=n[2],u=n[6],f=n[10],d=r+a+f;if(d>0){const h=.5/Math.sqrt(d+1);this._w=.25/h,this._x=(u-l)*h,this._y=(o-c)*h,this._z=(s-i)*h}else if(r>a&&r>f){const h=2*Math.sqrt(1+r-a-f);this._w=(u-l)/h,this._x=.25*h,this._y=(i+s)/h,this._z=(o+c)/h}else if(a>f){const h=2*Math.sqrt(1+a-r-f);this._w=(o-c)/h,this._x=(i+s)/h,this._y=.25*h,this._z=(l+u)/h}else{const h=2*Math.sqrt(1+f-r-a);this._w=(s-i)/h,this._x=(o+c)/h,this._y=(l+u)/h,this._z=.25*h}return this._onChangeCallback(),this}setFromUnitVectors(e,n){let r=e.dot(n)+1;return rMath.abs(e.z)?(this._x=-e.y,this._y=e.x,this._z=0,this._w=r):(this._x=0,this._y=-e.z,this._z=e.y,this._w=r)):(this._x=e.y*n.z-e.z*n.y,this._y=e.z*n.x-e.x*n.z,this._z=e.x*n.y-e.y*n.x,this._w=r),this.normalize()}angleTo(e){return 2*Math.acos(Math.abs(rl(this.dot(e),-1,1)))}rotateTowards(e,n){const r=this.angleTo(e);if(r===0)return this;const i=Math.min(1,n/r);return this.slerp(e,i),this}identity(){return this.set(0,0,0,1)}invert(){return this.conjugate()}conjugate(){return this._x*=-1,this._y*=-1,this._z*=-1,this._onChangeCallback(),this}dot(e){return this._x*e._x+this._y*e._y+this._z*e._z+this._w*e._w}lengthSq(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w}length(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)}normalize(){let e=this.length();return e===0?(this._x=0,this._y=0,this._z=0,this._w=1):(e=1/e,this._x=this._x*e,this._y=this._y*e,this._z=this._z*e,this._w=this._w*e),this._onChangeCallback(),this}multiply(e){return this.multiplyQuaternions(this,e)}premultiply(e){return this.multiplyQuaternions(e,this)}multiplyQuaternions(e,n){const r=e._x,i=e._y,o=e._z,s=e._w,a=n._x,l=n._y,c=n._z,u=n._w;return this._x=r*u+s*a+i*c-o*l,this._y=i*u+s*l+o*a-r*c,this._z=o*u+s*c+r*l-i*a,this._w=s*u-r*a-i*l-o*c,this._onChangeCallback(),this}slerp(e,n){if(n===0)return this;if(n===1)return this.copy(e);const r=this._x,i=this._y,o=this._z,s=this._w;let a=s*e._w+r*e._x+i*e._y+o*e._z;if(a<0?(this._w=-e._w,this._x=-e._x,this._y=-e._y,this._z=-e._z,a=-a):this.copy(e),a>=1)return this._w=s,this._x=r,this._y=i,this._z=o,this;const l=1-a*a;if(l<=Number.EPSILON){const h=1-n;return this._w=h*s+n*this._w,this._x=h*r+n*this._x,this._y=h*i+n*this._y,this._z=h*o+n*this._z,this.normalize(),this._onChangeCallback(),this}const c=Math.sqrt(l),u=Math.atan2(c,a),f=Math.sin((1-n)*u)/c,d=Math.sin(n*u)/c;return this._w=s*f+this._w*d,this._x=r*f+this._x*d,this._y=i*f+this._y*d,this._z=o*f+this._z*d,this._onChangeCallback(),this}slerpQuaternions(e,n,r){return this.copy(e).slerp(n,r)}random(){const e=Math.random(),n=Math.sqrt(1-e),r=Math.sqrt(e),i=2*Math.PI*Math.random(),o=2*Math.PI*Math.random();return this.set(n*Math.cos(i),r*Math.sin(o),r*Math.cos(o),n*Math.sin(i))}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._w===this._w}fromArray(e,n=0){return this._x=e[n],this._y=e[n+1],this._z=e[n+2],this._w=e[n+3],this._onChangeCallback(),this}toArray(e=[],n=0){return e[n]=this._x,e[n+1]=this._y,e[n+2]=this._z,e[n+3]=this._w,e}fromBufferAttribute(e,n){return this._x=e.getX(n),this._y=e.getY(n),this._z=e.getZ(n),this._w=e.getW(n),this}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._w}}class Ce{constructor(e=0,n=0,r=0){Ce.prototype.isVector3=!0,this.x=e,this.y=n,this.z=r}set(e,n,r){return r===void 0&&(r=this.z),this.x=e,this.y=n,this.z=r,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setComponent(e,n){switch(e){case 0:this.x=n;break;case 1:this.y=n;break;case 2:this.z=n;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y,this.z)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this}add(e){return this.x+=e.x,this.y+=e.y,this.z+=e.z,this}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this}addVectors(e,n){return this.x=e.x+n.x,this.y=e.y+n.y,this.z=e.z+n.z,this}addScaledVector(e,n){return this.x+=e.x*n,this.y+=e.y*n,this.z+=e.z*n,this}sub(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this}subVectors(e,n){return this.x=e.x-n.x,this.y=e.y-n.y,this.z=e.z-n.z,this}multiply(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this}multiplyVectors(e,n){return this.x=e.x*n.x,this.y=e.y*n.y,this.z=e.z*n.z,this}applyEuler(e){return this.applyQuaternion(TOe.setFromEuler(e))}applyAxisAngle(e,n){return this.applyQuaternion(TOe.setFromAxisAngle(e,n))}applyMatrix3(e){const n=this.x,r=this.y,i=this.z,o=e.elements;return this.x=o[0]*n+o[3]*r+o[6]*i,this.y=o[1]*n+o[4]*r+o[7]*i,this.z=o[2]*n+o[5]*r+o[8]*i,this}applyNormalMatrix(e){return this.applyMatrix3(e).normalize()}applyMatrix4(e){const n=this.x,r=this.y,i=this.z,o=e.elements,s=1/(o[3]*n+o[7]*r+o[11]*i+o[15]);return this.x=(o[0]*n+o[4]*r+o[8]*i+o[12])*s,this.y=(o[1]*n+o[5]*r+o[9]*i+o[13])*s,this.z=(o[2]*n+o[6]*r+o[10]*i+o[14])*s,this}applyQuaternion(e){const n=this.x,r=this.y,i=this.z,o=e.x,s=e.y,a=e.z,l=e.w,c=l*n+s*i-a*r,u=l*r+a*n-o*i,f=l*i+o*r-s*n,d=-o*n-s*r-a*i;return this.x=c*l+d*-o+u*-a-f*-s,this.y=u*l+d*-s+f*-o-c*-a,this.z=f*l+d*-a+c*-s-u*-o,this}project(e){return this.applyMatrix4(e.matrixWorldInverse).applyMatrix4(e.projectionMatrix)}unproject(e){return this.applyMatrix4(e.projectionMatrixInverse).applyMatrix4(e.matrixWorld)}transformDirection(e){const n=this.x,r=this.y,i=this.z,o=e.elements;return this.x=o[0]*n+o[4]*r+o[8]*i,this.y=o[1]*n+o[5]*r+o[9]*i,this.z=o[2]*n+o[6]*r+o[10]*i,this.normalize()}divide(e){return this.x/=e.x,this.y/=e.y,this.z/=e.z,this}divideScalar(e){return this.multiplyScalar(1/e)}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this}clamp(e,n){return this.x=Math.max(e.x,Math.min(n.x,this.x)),this.y=Math.max(e.y,Math.min(n.y,this.y)),this.z=Math.max(e.z,Math.min(n.z,this.z)),this}clampScalar(e,n){return this.x=Math.max(e,Math.min(n,this.x)),this.y=Math.max(e,Math.min(n,this.y)),this.z=Math.max(e,Math.min(n,this.z)),this}clampLength(e,n){const r=this.length();return this.divideScalar(r||1).multiplyScalar(Math.max(e,Math.min(n,r)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this}roundToZero(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this.z=this.z<0?Math.ceil(this.z):Math.floor(this.z),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)}normalize(){return this.divideScalar(this.length()||1)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,n){return this.x+=(e.x-this.x)*n,this.y+=(e.y-this.y)*n,this.z+=(e.z-this.z)*n,this}lerpVectors(e,n,r){return this.x=e.x+(n.x-e.x)*r,this.y=e.y+(n.y-e.y)*r,this.z=e.z+(n.z-e.z)*r,this}cross(e){return this.crossVectors(this,e)}crossVectors(e,n){const r=e.x,i=e.y,o=e.z,s=n.x,a=n.y,l=n.z;return this.x=i*l-o*a,this.y=o*s-r*l,this.z=r*a-i*s,this}projectOnVector(e){const n=e.lengthSq();if(n===0)return this.set(0,0,0);const r=e.dot(this)/n;return this.copy(e).multiplyScalar(r)}projectOnPlane(e){return K7.copy(this).projectOnVector(e),this.sub(K7)}reflect(e){return this.sub(K7.copy(e).multiplyScalar(2*this.dot(e)))}angleTo(e){const n=Math.sqrt(this.lengthSq()*e.lengthSq());if(n===0)return Math.PI/2;const r=this.dot(e)/n;return Math.acos(rl(r,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const n=this.x-e.x,r=this.y-e.y,i=this.z-e.z;return n*n+r*r+i*i}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)+Math.abs(this.z-e.z)}setFromSpherical(e){return this.setFromSphericalCoords(e.radius,e.phi,e.theta)}setFromSphericalCoords(e,n,r){const i=Math.sin(n)*e;return this.x=i*Math.sin(r),this.y=Math.cos(n)*e,this.z=i*Math.cos(r),this}setFromCylindrical(e){return this.setFromCylindricalCoords(e.radius,e.theta,e.y)}setFromCylindricalCoords(e,n,r){return this.x=e*Math.sin(n),this.y=r,this.z=e*Math.cos(n),this}setFromMatrixPosition(e){const n=e.elements;return this.x=n[12],this.y=n[13],this.z=n[14],this}setFromMatrixScale(e){const n=this.setFromMatrixColumn(e,0).length(),r=this.setFromMatrixColumn(e,1).length(),i=this.setFromMatrixColumn(e,2).length();return this.x=n,this.y=r,this.z=i,this}setFromMatrixColumn(e,n){return this.fromArray(e.elements,n*4)}setFromMatrix3Column(e,n){return this.fromArray(e.elements,n*3)}setFromEuler(e){return this.x=e._x,this.y=e._y,this.z=e._z,this}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z}fromArray(e,n=0){return this.x=e[n],this.y=e[n+1],this.z=e[n+2],this}toArray(e=[],n=0){return e[n]=this.x,e[n+1]=this.y,e[n+2]=this.z,e}fromBufferAttribute(e,n){return this.x=e.getX(n),this.y=e.getY(n),this.z=e.getZ(n),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this}randomDirection(){const e=(Math.random()-.5)*2,n=Math.random()*Math.PI*2,r=Math.sqrt(1-e**2);return this.x=r*Math.cos(n),this.y=r*Math.sin(n),this.z=e,this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z}}const K7=new Ce,TOe=new G1;class pE{constructor(e=new Ce(1/0,1/0,1/0),n=new Ce(-1/0,-1/0,-1/0)){this.isBox3=!0,this.min=e,this.max=n}set(e,n){return this.min.copy(e),this.max.copy(n),this}setFromArray(e){let n=1/0,r=1/0,i=1/0,o=-1/0,s=-1/0,a=-1/0;for(let l=0,c=e.length;lo&&(o=u),f>s&&(s=f),d>a&&(a=d)}return this.min.set(n,r,i),this.max.set(o,s,a),this}setFromBufferAttribute(e){let n=1/0,r=1/0,i=1/0,o=-1/0,s=-1/0,a=-1/0;for(let l=0,c=e.count;lo&&(o=u),f>s&&(s=f),d>a&&(a=d)}return this.min.set(n,r,i),this.max.set(o,s,a),this}setFromPoints(e){this.makeEmpty();for(let n=0,r=e.length;nthis.max.x||e.ythis.max.y||e.zthis.max.z)}containsBox(e){return this.min.x<=e.min.x&&e.max.x<=this.max.x&&this.min.y<=e.min.y&&e.max.y<=this.max.y&&this.min.z<=e.min.z&&e.max.z<=this.max.z}getParameter(e,n){return n.set((e.x-this.min.x)/(this.max.x-this.min.x),(e.y-this.min.y)/(this.max.y-this.min.y),(e.z-this.min.z)/(this.max.z-this.min.z))}intersectsBox(e){return!(e.max.xthis.max.x||e.max.ythis.max.y||e.max.zthis.max.z)}intersectsSphere(e){return this.clampPoint(e.center,M0),M0.distanceToSquared(e.center)<=e.radius*e.radius}intersectsPlane(e){let n,r;return e.normal.x>0?(n=e.normal.x*this.min.x,r=e.normal.x*this.max.x):(n=e.normal.x*this.max.x,r=e.normal.x*this.min.x),e.normal.y>0?(n+=e.normal.y*this.min.y,r+=e.normal.y*this.max.y):(n+=e.normal.y*this.max.y,r+=e.normal.y*this.min.y),e.normal.z>0?(n+=e.normal.z*this.min.z,r+=e.normal.z*this.max.z):(n+=e.normal.z*this.max.z,r+=e.normal.z*this.min.z),n<=-e.constant&&r>=-e.constant}intersectsTriangle(e){if(this.isEmpty())return!1;this.getCenter(L2),p$.subVectors(this.max,L2),mw.subVectors(e.a,L2),vw.subVectors(e.b,L2),yw.subVectors(e.c,L2),wm.subVectors(vw,mw),_m.subVectors(yw,vw),R0.subVectors(mw,yw);let n=[0,-wm.z,wm.y,0,-_m.z,_m.y,0,-R0.z,R0.y,wm.z,0,-wm.x,_m.z,0,-_m.x,R0.z,0,-R0.x,-wm.y,wm.x,0,-_m.y,_m.x,0,-R0.y,R0.x,0];return!J7(n,mw,vw,yw,p$)||(n=[1,0,0,0,1,0,0,0,1],!J7(n,mw,vw,yw,p$))?!1:(g$.crossVectors(wm,_m),n=[g$.x,g$.y,g$.z],J7(n,mw,vw,yw,p$))}clampPoint(e,n){return n.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return M0.copy(e).clamp(this.min,this.max).sub(e).length()}getBoundingSphere(e){return this.getCenter(e.center),e.radius=this.getSize(M0).length()*.5,e}intersect(e){return this.min.max(e.min),this.max.min(e.max),this.isEmpty()&&this.makeEmpty(),this}union(e){return this.min.min(e.min),this.max.max(e.max),this}applyMatrix4(e){return this.isEmpty()?this:(gp[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(e),gp[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(e),gp[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(e),gp[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(e),gp[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(e),gp[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(e),gp[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(e),gp[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(e),this.setFromPoints(gp),this)}translate(e){return this.min.add(e),this.max.add(e),this}equals(e){return e.min.equals(this.min)&&e.max.equals(this.max)}}const gp=[new Ce,new Ce,new Ce,new Ce,new Ce,new Ce,new Ce,new Ce],M0=new Ce,Z7=new pE,mw=new Ce,vw=new Ce,yw=new Ce,wm=new Ce,_m=new Ce,R0=new Ce,L2=new Ce,p$=new Ce,g$=new Ce,D0=new Ce;function J7(t,e,n,r,i){for(let o=0,s=t.length-3;o<=s;o+=3){D0.fromArray(t,o);const a=i.x*Math.abs(D0.x)+i.y*Math.abs(D0.y)+i.z*Math.abs(D0.z),l=e.dot(D0),c=n.dot(D0),u=r.dot(D0);if(Math.max(-Math.max(l,c,u),Math.min(l,c,u))>a)return!1}return!0}const JBn=new pE,kOe=new Ce,m$=new Ce,eG=new Ce;class s8{constructor(e=new Ce,n=-1){this.center=e,this.radius=n}set(e,n){return this.center.copy(e),this.radius=n,this}setFromPoints(e,n){const r=this.center;n!==void 0?r.copy(n):JBn.setFromPoints(e).getCenter(r);let i=0;for(let o=0,s=e.length;othis.radius*this.radius&&(n.sub(this.center).normalize(),n.multiplyScalar(this.radius).add(this.center)),n}getBoundingBox(e){return this.isEmpty()?(e.makeEmpty(),e):(e.set(this.center,this.center),e.expandByScalar(this.radius),e)}applyMatrix4(e){return this.center.applyMatrix4(e),this.radius=this.radius*e.getMaxScaleOnAxis(),this}translate(e){return this.center.add(e),this}expandByPoint(e){eG.subVectors(e,this.center);const n=eG.lengthSq();if(n>this.radius*this.radius){const r=Math.sqrt(n),i=(r-this.radius)*.5;this.center.add(eG.multiplyScalar(i/r)),this.radius+=i}return this}union(e){return this.center.equals(e.center)===!0?m$.set(0,0,1).multiplyScalar(e.radius):m$.subVectors(e.center,this.center).normalize().multiplyScalar(e.radius),this.expandByPoint(kOe.copy(e.center).add(m$)),this.expandByPoint(kOe.copy(e.center).sub(m$)),this}equals(e){return e.center.equals(this.center)&&e.radius===this.radius}clone(){return new this.constructor().copy(this)}}const mp=new Ce,tG=new Ce,v$=new Ce,Sm=new Ce,nG=new Ce,y$=new Ce,rG=new Ce;class _Xe{constructor(e=new Ce,n=new Ce(0,0,-1)){this.origin=e,this.direction=n}set(e,n){return this.origin.copy(e),this.direction.copy(n),this}copy(e){return this.origin.copy(e.origin),this.direction.copy(e.direction),this}at(e,n){return n.copy(this.direction).multiplyScalar(e).add(this.origin)}lookAt(e){return this.direction.copy(e).sub(this.origin).normalize(),this}recast(e){return this.origin.copy(this.at(e,mp)),this}closestPointToPoint(e,n){n.subVectors(e,this.origin);const r=n.dot(this.direction);return r<0?n.copy(this.origin):n.copy(this.direction).multiplyScalar(r).add(this.origin)}distanceToPoint(e){return Math.sqrt(this.distanceSqToPoint(e))}distanceSqToPoint(e){const n=mp.subVectors(e,this.origin).dot(this.direction);return n<0?this.origin.distanceToSquared(e):(mp.copy(this.direction).multiplyScalar(n).add(this.origin),mp.distanceToSquared(e))}distanceSqToSegment(e,n,r,i){tG.copy(e).add(n).multiplyScalar(.5),v$.copy(n).sub(e).normalize(),Sm.copy(this.origin).sub(tG);const o=e.distanceTo(n)*.5,s=-this.direction.dot(v$),a=Sm.dot(this.direction),l=-Sm.dot(v$),c=Sm.lengthSq(),u=Math.abs(1-s*s);let f,d,h,p;if(u>0)if(f=s*l-a,d=s*a-l,p=o*u,f>=0)if(d>=-p)if(d<=p){const g=1/u;f*=g,d*=g,h=f*(f+s*d+2*a)+d*(s*f+d+2*l)+c}else d=o,f=Math.max(0,-(s*d+a)),h=-f*f+d*(d+2*l)+c;else d=-o,f=Math.max(0,-(s*d+a)),h=-f*f+d*(d+2*l)+c;else d<=-p?(f=Math.max(0,-(-s*o+a)),d=f>0?-o:Math.min(Math.max(-o,-l),o),h=-f*f+d*(d+2*l)+c):d<=p?(f=0,d=Math.min(Math.max(-o,-l),o),h=d*(d+2*l)+c):(f=Math.max(0,-(s*o+a)),d=f>0?o:Math.min(Math.max(-o,-l),o),h=-f*f+d*(d+2*l)+c);else d=s>0?-o:o,f=Math.max(0,-(s*d+a)),h=-f*f+d*(d+2*l)+c;return r&&r.copy(this.direction).multiplyScalar(f).add(this.origin),i&&i.copy(v$).multiplyScalar(d).add(tG),h}intersectSphere(e,n){mp.subVectors(e.center,this.origin);const r=mp.dot(this.direction),i=mp.dot(mp)-r*r,o=e.radius*e.radius;if(i>o)return null;const s=Math.sqrt(o-i),a=r-s,l=r+s;return a<0&&l<0?null:a<0?this.at(l,n):this.at(a,n)}intersectsSphere(e){return this.distanceSqToPoint(e.center)<=e.radius*e.radius}distanceToPlane(e){const n=e.normal.dot(this.direction);if(n===0)return e.distanceToPoint(this.origin)===0?0:null;const r=-(this.origin.dot(e.normal)+e.constant)/n;return r>=0?r:null}intersectPlane(e,n){const r=this.distanceToPlane(e);return r===null?null:this.at(r,n)}intersectsPlane(e){const n=e.distanceToPoint(this.origin);return n===0||e.normal.dot(this.direction)*n<0}intersectBox(e,n){let r,i,o,s,a,l;const c=1/this.direction.x,u=1/this.direction.y,f=1/this.direction.z,d=this.origin;return c>=0?(r=(e.min.x-d.x)*c,i=(e.max.x-d.x)*c):(r=(e.max.x-d.x)*c,i=(e.min.x-d.x)*c),u>=0?(o=(e.min.y-d.y)*u,s=(e.max.y-d.y)*u):(o=(e.max.y-d.y)*u,s=(e.min.y-d.y)*u),r>s||o>i||((o>r||r!==r)&&(r=o),(s=0?(a=(e.min.z-d.z)*f,l=(e.max.z-d.z)*f):(a=(e.max.z-d.z)*f,l=(e.min.z-d.z)*f),r>l||a>i)||((a>r||r!==r)&&(r=a),(l=0?r:i,n)}intersectsBox(e){return this.intersectBox(e,mp)!==null}intersectTriangle(e,n,r,i,o){nG.subVectors(n,e),y$.subVectors(r,e),rG.crossVectors(nG,y$);let s=this.direction.dot(rG),a;if(s>0){if(i)return null;a=1}else if(s<0)a=-1,s=-s;else return null;Sm.subVectors(this.origin,e);const l=a*this.direction.dot(y$.crossVectors(Sm,y$));if(l<0)return null;const c=a*this.direction.dot(nG.cross(Sm));if(c<0||l+c>s)return null;const u=-a*Sm.dot(rG);return u<0?null:this.at(u/s,o)}applyMatrix4(e){return this.origin.applyMatrix4(e),this.direction.transformDirection(e),this}equals(e){return e.origin.equals(this.origin)&&e.direction.equals(this.direction)}clone(){return new this.constructor().copy(this)}}class Wr{constructor(){Wr.prototype.isMatrix4=!0,this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]}set(e,n,r,i,o,s,a,l,c,u,f,d,h,p,g,m){const v=this.elements;return v[0]=e,v[4]=n,v[8]=r,v[12]=i,v[1]=o,v[5]=s,v[9]=a,v[13]=l,v[2]=c,v[6]=u,v[10]=f,v[14]=d,v[3]=h,v[7]=p,v[11]=g,v[15]=m,this}identity(){return this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1),this}clone(){return new Wr().fromArray(this.elements)}copy(e){const n=this.elements,r=e.elements;return n[0]=r[0],n[1]=r[1],n[2]=r[2],n[3]=r[3],n[4]=r[4],n[5]=r[5],n[6]=r[6],n[7]=r[7],n[8]=r[8],n[9]=r[9],n[10]=r[10],n[11]=r[11],n[12]=r[12],n[13]=r[13],n[14]=r[14],n[15]=r[15],this}copyPosition(e){const n=this.elements,r=e.elements;return n[12]=r[12],n[13]=r[13],n[14]=r[14],this}setFromMatrix3(e){const n=e.elements;return this.set(n[0],n[3],n[6],0,n[1],n[4],n[7],0,n[2],n[5],n[8],0,0,0,0,1),this}extractBasis(e,n,r){return e.setFromMatrixColumn(this,0),n.setFromMatrixColumn(this,1),r.setFromMatrixColumn(this,2),this}makeBasis(e,n,r){return this.set(e.x,n.x,r.x,0,e.y,n.y,r.y,0,e.z,n.z,r.z,0,0,0,0,1),this}extractRotation(e){const n=this.elements,r=e.elements,i=1/xw.setFromMatrixColumn(e,0).length(),o=1/xw.setFromMatrixColumn(e,1).length(),s=1/xw.setFromMatrixColumn(e,2).length();return n[0]=r[0]*i,n[1]=r[1]*i,n[2]=r[2]*i,n[3]=0,n[4]=r[4]*o,n[5]=r[5]*o,n[6]=r[6]*o,n[7]=0,n[8]=r[8]*s,n[9]=r[9]*s,n[10]=r[10]*s,n[11]=0,n[12]=0,n[13]=0,n[14]=0,n[15]=1,this}makeRotationFromEuler(e){const n=this.elements,r=e.x,i=e.y,o=e.z,s=Math.cos(r),a=Math.sin(r),l=Math.cos(i),c=Math.sin(i),u=Math.cos(o),f=Math.sin(o);if(e.order==="XYZ"){const d=s*u,h=s*f,p=a*u,g=a*f;n[0]=l*u,n[4]=-l*f,n[8]=c,n[1]=h+p*c,n[5]=d-g*c,n[9]=-a*l,n[2]=g-d*c,n[6]=p+h*c,n[10]=s*l}else if(e.order==="YXZ"){const d=l*u,h=l*f,p=c*u,g=c*f;n[0]=d+g*a,n[4]=p*a-h,n[8]=s*c,n[1]=s*f,n[5]=s*u,n[9]=-a,n[2]=h*a-p,n[6]=g+d*a,n[10]=s*l}else if(e.order==="ZXY"){const d=l*u,h=l*f,p=c*u,g=c*f;n[0]=d-g*a,n[4]=-s*f,n[8]=p+h*a,n[1]=h+p*a,n[5]=s*u,n[9]=g-d*a,n[2]=-s*c,n[6]=a,n[10]=s*l}else if(e.order==="ZYX"){const d=s*u,h=s*f,p=a*u,g=a*f;n[0]=l*u,n[4]=p*c-h,n[8]=d*c+g,n[1]=l*f,n[5]=g*c+d,n[9]=h*c-p,n[2]=-c,n[6]=a*l,n[10]=s*l}else if(e.order==="YZX"){const d=s*l,h=s*c,p=a*l,g=a*c;n[0]=l*u,n[4]=g-d*f,n[8]=p*f+h,n[1]=f,n[5]=s*u,n[9]=-a*u,n[2]=-c*u,n[6]=h*f+p,n[10]=d-g*f}else if(e.order==="XZY"){const d=s*l,h=s*c,p=a*l,g=a*c;n[0]=l*u,n[4]=-f,n[8]=c*u,n[1]=d*f+g,n[5]=s*u,n[9]=h*f-p,n[2]=p*f-h,n[6]=a*u,n[10]=g*f+d}return n[3]=0,n[7]=0,n[11]=0,n[12]=0,n[13]=0,n[14]=0,n[15]=1,this}makeRotationFromQuaternion(e){return this.compose(e6n,e,t6n)}lookAt(e,n,r){const i=this.elements;return zl.subVectors(e,n),zl.lengthSq()===0&&(zl.z=1),zl.normalize(),Cm.crossVectors(r,zl),Cm.lengthSq()===0&&(Math.abs(r.z)===1?zl.x+=1e-4:zl.z+=1e-4,zl.normalize(),Cm.crossVectors(r,zl)),Cm.normalize(),x$.crossVectors(zl,Cm),i[0]=Cm.x,i[4]=x$.x,i[8]=zl.x,i[1]=Cm.y,i[5]=x$.y,i[9]=zl.y,i[2]=Cm.z,i[6]=x$.z,i[10]=zl.z,this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,n){const r=e.elements,i=n.elements,o=this.elements,s=r[0],a=r[4],l=r[8],c=r[12],u=r[1],f=r[5],d=r[9],h=r[13],p=r[2],g=r[6],m=r[10],v=r[14],y=r[3],x=r[7],b=r[11],w=r[15],_=i[0],S=i[4],O=i[8],k=i[12],E=i[1],M=i[5],A=i[9],P=i[13],T=i[2],R=i[6],I=i[10],B=i[14],$=i[3],z=i[7],L=i[11],j=i[15];return o[0]=s*_+a*E+l*T+c*$,o[4]=s*S+a*M+l*R+c*z,o[8]=s*O+a*A+l*I+c*L,o[12]=s*k+a*P+l*B+c*j,o[1]=u*_+f*E+d*T+h*$,o[5]=u*S+f*M+d*R+h*z,o[9]=u*O+f*A+d*I+h*L,o[13]=u*k+f*P+d*B+h*j,o[2]=p*_+g*E+m*T+v*$,o[6]=p*S+g*M+m*R+v*z,o[10]=p*O+g*A+m*I+v*L,o[14]=p*k+g*P+m*B+v*j,o[3]=y*_+x*E+b*T+w*$,o[7]=y*S+x*M+b*R+w*z,o[11]=y*O+x*A+b*I+w*L,o[15]=y*k+x*P+b*B+w*j,this}multiplyScalar(e){const n=this.elements;return n[0]*=e,n[4]*=e,n[8]*=e,n[12]*=e,n[1]*=e,n[5]*=e,n[9]*=e,n[13]*=e,n[2]*=e,n[6]*=e,n[10]*=e,n[14]*=e,n[3]*=e,n[7]*=e,n[11]*=e,n[15]*=e,this}determinant(){const e=this.elements,n=e[0],r=e[4],i=e[8],o=e[12],s=e[1],a=e[5],l=e[9],c=e[13],u=e[2],f=e[6],d=e[10],h=e[14],p=e[3],g=e[7],m=e[11],v=e[15];return p*(+o*l*f-i*c*f-o*a*d+r*c*d+i*a*h-r*l*h)+g*(+n*l*h-n*c*d+o*s*d-i*s*h+i*c*u-o*l*u)+m*(+n*c*f-n*a*h-o*s*f+r*s*h+o*a*u-r*c*u)+v*(-i*a*u-n*l*f+n*a*d+i*s*f-r*s*d+r*l*u)}transpose(){const e=this.elements;let n;return n=e[1],e[1]=e[4],e[4]=n,n=e[2],e[2]=e[8],e[8]=n,n=e[6],e[6]=e[9],e[9]=n,n=e[3],e[3]=e[12],e[12]=n,n=e[7],e[7]=e[13],e[13]=n,n=e[11],e[11]=e[14],e[14]=n,this}setPosition(e,n,r){const i=this.elements;return e.isVector3?(i[12]=e.x,i[13]=e.y,i[14]=e.z):(i[12]=e,i[13]=n,i[14]=r),this}invert(){const e=this.elements,n=e[0],r=e[1],i=e[2],o=e[3],s=e[4],a=e[5],l=e[6],c=e[7],u=e[8],f=e[9],d=e[10],h=e[11],p=e[12],g=e[13],m=e[14],v=e[15],y=f*m*c-g*d*c+g*l*h-a*m*h-f*l*v+a*d*v,x=p*d*c-u*m*c-p*l*h+s*m*h+u*l*v-s*d*v,b=u*g*c-p*f*c+p*a*h-s*g*h-u*a*v+s*f*v,w=p*f*l-u*g*l-p*a*d+s*g*d+u*a*m-s*f*m,_=n*y+r*x+i*b+o*w;if(_===0)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);const S=1/_;return e[0]=y*S,e[1]=(g*d*o-f*m*o-g*i*h+r*m*h+f*i*v-r*d*v)*S,e[2]=(a*m*o-g*l*o+g*i*c-r*m*c-a*i*v+r*l*v)*S,e[3]=(f*l*o-a*d*o-f*i*c+r*d*c+a*i*h-r*l*h)*S,e[4]=x*S,e[5]=(u*m*o-p*d*o+p*i*h-n*m*h-u*i*v+n*d*v)*S,e[6]=(p*l*o-s*m*o-p*i*c+n*m*c+s*i*v-n*l*v)*S,e[7]=(s*d*o-u*l*o+u*i*c-n*d*c-s*i*h+n*l*h)*S,e[8]=b*S,e[9]=(p*f*o-u*g*o-p*r*h+n*g*h+u*r*v-n*f*v)*S,e[10]=(s*g*o-p*a*o+p*r*c-n*g*c-s*r*v+n*a*v)*S,e[11]=(u*a*o-s*f*o-u*r*c+n*f*c+s*r*h-n*a*h)*S,e[12]=w*S,e[13]=(u*g*i-p*f*i+p*r*d-n*g*d-u*r*m+n*f*m)*S,e[14]=(p*a*i-s*g*i-p*r*l+n*g*l+s*r*m-n*a*m)*S,e[15]=(s*f*i-u*a*i+u*r*l-n*f*l-s*r*d+n*a*d)*S,this}scale(e){const n=this.elements,r=e.x,i=e.y,o=e.z;return n[0]*=r,n[4]*=i,n[8]*=o,n[1]*=r,n[5]*=i,n[9]*=o,n[2]*=r,n[6]*=i,n[10]*=o,n[3]*=r,n[7]*=i,n[11]*=o,this}getMaxScaleOnAxis(){const e=this.elements,n=e[0]*e[0]+e[1]*e[1]+e[2]*e[2],r=e[4]*e[4]+e[5]*e[5]+e[6]*e[6],i=e[8]*e[8]+e[9]*e[9]+e[10]*e[10];return Math.sqrt(Math.max(n,r,i))}makeTranslation(e,n,r){return this.set(1,0,0,e,0,1,0,n,0,0,1,r,0,0,0,1),this}makeRotationX(e){const n=Math.cos(e),r=Math.sin(e);return this.set(1,0,0,0,0,n,-r,0,0,r,n,0,0,0,0,1),this}makeRotationY(e){const n=Math.cos(e),r=Math.sin(e);return this.set(n,0,r,0,0,1,0,0,-r,0,n,0,0,0,0,1),this}makeRotationZ(e){const n=Math.cos(e),r=Math.sin(e);return this.set(n,-r,0,0,r,n,0,0,0,0,1,0,0,0,0,1),this}makeRotationAxis(e,n){const r=Math.cos(n),i=Math.sin(n),o=1-r,s=e.x,a=e.y,l=e.z,c=o*s,u=o*a;return this.set(c*s+r,c*a-i*l,c*l+i*a,0,c*a+i*l,u*a+r,u*l-i*s,0,c*l-i*a,u*l+i*s,o*l*l+r,0,0,0,0,1),this}makeScale(e,n,r){return this.set(e,0,0,0,0,n,0,0,0,0,r,0,0,0,0,1),this}makeShear(e,n,r,i,o,s){return this.set(1,r,o,0,e,1,s,0,n,i,1,0,0,0,0,1),this}compose(e,n,r){const i=this.elements,o=n._x,s=n._y,a=n._z,l=n._w,c=o+o,u=s+s,f=a+a,d=o*c,h=o*u,p=o*f,g=s*u,m=s*f,v=a*f,y=l*c,x=l*u,b=l*f,w=r.x,_=r.y,S=r.z;return i[0]=(1-(g+v))*w,i[1]=(h+b)*w,i[2]=(p-x)*w,i[3]=0,i[4]=(h-b)*_,i[5]=(1-(d+v))*_,i[6]=(m+y)*_,i[7]=0,i[8]=(p+x)*S,i[9]=(m-y)*S,i[10]=(1-(d+g))*S,i[11]=0,i[12]=e.x,i[13]=e.y,i[14]=e.z,i[15]=1,this}decompose(e,n,r){const i=this.elements;let o=xw.set(i[0],i[1],i[2]).length();const s=xw.set(i[4],i[5],i[6]).length(),a=xw.set(i[8],i[9],i[10]).length();this.determinant()<0&&(o=-o),e.x=i[12],e.y=i[13],e.z=i[14],ef.copy(this);const c=1/o,u=1/s,f=1/a;return ef.elements[0]*=c,ef.elements[1]*=c,ef.elements[2]*=c,ef.elements[4]*=u,ef.elements[5]*=u,ef.elements[6]*=u,ef.elements[8]*=f,ef.elements[9]*=f,ef.elements[10]*=f,n.setFromRotationMatrix(ef),r.x=o,r.y=s,r.z=a,this}makePerspective(e,n,r,i,o,s){const a=this.elements,l=2*o/(n-e),c=2*o/(r-i),u=(n+e)/(n-e),f=(r+i)/(r-i),d=-(s+o)/(s-o),h=-2*s*o/(s-o);return a[0]=l,a[4]=0,a[8]=u,a[12]=0,a[1]=0,a[5]=c,a[9]=f,a[13]=0,a[2]=0,a[6]=0,a[10]=d,a[14]=h,a[3]=0,a[7]=0,a[11]=-1,a[15]=0,this}makeOrthographic(e,n,r,i,o,s){const a=this.elements,l=1/(n-e),c=1/(r-i),u=1/(s-o),f=(n+e)*l,d=(r+i)*c,h=(s+o)*u;return a[0]=2*l,a[4]=0,a[8]=0,a[12]=-f,a[1]=0,a[5]=2*c,a[9]=0,a[13]=-d,a[2]=0,a[6]=0,a[10]=-2*u,a[14]=-h,a[3]=0,a[7]=0,a[11]=0,a[15]=1,this}equals(e){const n=this.elements,r=e.elements;for(let i=0;i<16;i++)if(n[i]!==r[i])return!1;return!0}fromArray(e,n=0){for(let r=0;r<16;r++)this.elements[r]=e[r+n];return this}toArray(e=[],n=0){const r=this.elements;return e[n]=r[0],e[n+1]=r[1],e[n+2]=r[2],e[n+3]=r[3],e[n+4]=r[4],e[n+5]=r[5],e[n+6]=r[6],e[n+7]=r[7],e[n+8]=r[8],e[n+9]=r[9],e[n+10]=r[10],e[n+11]=r[11],e[n+12]=r[12],e[n+13]=r[13],e[n+14]=r[14],e[n+15]=r[15],e}}const xw=new Ce,ef=new Wr,e6n=new Ce(0,0,0),t6n=new Ce(1,1,1),Cm=new Ce,x$=new Ce,zl=new Ce,AOe=new Wr,POe=new G1;class CD{constructor(e=0,n=0,r=0,i=CD.DefaultOrder){this.isEuler=!0,this._x=e,this._y=n,this._z=r,this._order=i}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get order(){return this._order}set order(e){this._order=e,this._onChangeCallback()}set(e,n,r,i=this._order){return this._x=e,this._y=n,this._z=r,this._order=i,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._order)}copy(e){return this._x=e._x,this._y=e._y,this._z=e._z,this._order=e._order,this._onChangeCallback(),this}setFromRotationMatrix(e,n=this._order,r=!0){const i=e.elements,o=i[0],s=i[4],a=i[8],l=i[1],c=i[5],u=i[9],f=i[2],d=i[6],h=i[10];switch(n){case"XYZ":this._y=Math.asin(rl(a,-1,1)),Math.abs(a)<.9999999?(this._x=Math.atan2(-u,h),this._z=Math.atan2(-s,o)):(this._x=Math.atan2(d,c),this._z=0);break;case"YXZ":this._x=Math.asin(-rl(u,-1,1)),Math.abs(u)<.9999999?(this._y=Math.atan2(a,h),this._z=Math.atan2(l,c)):(this._y=Math.atan2(-f,o),this._z=0);break;case"ZXY":this._x=Math.asin(rl(d,-1,1)),Math.abs(d)<.9999999?(this._y=Math.atan2(-f,h),this._z=Math.atan2(-s,c)):(this._y=0,this._z=Math.atan2(l,o));break;case"ZYX":this._y=Math.asin(-rl(f,-1,1)),Math.abs(f)<.9999999?(this._x=Math.atan2(d,h),this._z=Math.atan2(l,o)):(this._x=0,this._z=Math.atan2(-s,c));break;case"YZX":this._z=Math.asin(rl(l,-1,1)),Math.abs(l)<.9999999?(this._x=Math.atan2(-u,c),this._y=Math.atan2(-f,o)):(this._x=0,this._y=Math.atan2(a,h));break;case"XZY":this._z=Math.asin(-rl(s,-1,1)),Math.abs(s)<.9999999?(this._x=Math.atan2(d,c),this._y=Math.atan2(a,o)):(this._x=Math.atan2(-u,h),this._y=0);break;default:console.warn("THREE.Euler: .setFromRotationMatrix() encountered an unknown order: "+n)}return this._order=n,r===!0&&this._onChangeCallback(),this}setFromQuaternion(e,n,r){return AOe.makeRotationFromQuaternion(e),this.setFromRotationMatrix(AOe,n,r)}setFromVector3(e,n=this._order){return this.set(e.x,e.y,e.z,n)}reorder(e){return POe.setFromEuler(this),this.setFromQuaternion(POe,e)}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._order===this._order}fromArray(e){return this._x=e[0],this._y=e[1],this._z=e[2],e[3]!==void 0&&(this._order=e[3]),this._onChangeCallback(),this}toArray(e=[],n=0){return e[n]=this._x,e[n+1]=this._y,e[n+2]=this._z,e[n+3]=this._order,e}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._order}toVector3(){console.error("THREE.Euler: .toVector3() has been removed. Use Vector3.setFromEuler() instead")}}CD.DefaultOrder="XYZ";CD.RotationOrders=["XYZ","YZX","ZXY","XZY","YXZ","ZYX"];class SXe{constructor(){this.mask=1}set(e){this.mask=(1<>>0}enable(e){this.mask|=1<1){for(let n=0;n1){for(let r=0;r0){i.children=[];for(let a=0;a0){i.animations=[];for(let a=0;a0&&(r.geometries=a),l.length>0&&(r.materials=l),c.length>0&&(r.textures=c),u.length>0&&(r.images=u),f.length>0&&(r.shapes=f),d.length>0&&(r.skeletons=d),h.length>0&&(r.animations=h),p.length>0&&(r.nodes=p)}return r.object=i,r;function s(a){const l=[];for(const c in a){const u=a[c];delete u.metadata,l.push(u)}return l}}clone(e){return new this.constructor().copy(this,e)}copy(e,n=!0){if(this.name=e.name,this.up.copy(e.up),this.position.copy(e.position),this.rotation.order=e.rotation.order,this.quaternion.copy(e.quaternion),this.scale.copy(e.scale),this.matrix.copy(e.matrix),this.matrixWorld.copy(e.matrixWorld),this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrixWorldNeedsUpdate=e.matrixWorldNeedsUpdate,this.matrixWorldAutoUpdate=e.matrixWorldAutoUpdate,this.layers.mask=e.layers.mask,this.visible=e.visible,this.castShadow=e.castShadow,this.receiveShadow=e.receiveShadow,this.frustumCulled=e.frustumCulled,this.renderOrder=e.renderOrder,this.userData=JSON.parse(JSON.stringify(e.userData)),n===!0)for(let r=0;r0?i.multiplyScalar(1/Math.sqrt(o)):i.set(0,0,0)}static getBarycoord(e,n,r,i,o){tf.subVectors(i,n),yp.subVectors(r,n),iG.subVectors(e,n);const s=tf.dot(tf),a=tf.dot(yp),l=tf.dot(iG),c=yp.dot(yp),u=yp.dot(iG),f=s*c-a*a;if(f===0)return o.set(-2,-1,-1);const d=1/f,h=(c*l-a*u)*d,p=(s*u-a*l)*d;return o.set(1-h-p,p,h)}static containsPoint(e,n,r,i){return this.getBarycoord(e,n,r,i,xp),xp.x>=0&&xp.y>=0&&xp.x+xp.y<=1}static getUV(e,n,r,i,o,s,a,l){return this.getBarycoord(e,n,r,i,xp),l.set(0,0),l.addScaledVector(o,xp.x),l.addScaledVector(s,xp.y),l.addScaledVector(a,xp.z),l}static isFrontFacing(e,n,r,i){return tf.subVectors(r,n),yp.subVectors(e,n),tf.cross(yp).dot(i)<0}set(e,n,r){return this.a.copy(e),this.b.copy(n),this.c.copy(r),this}setFromPointsAndIndices(e,n,r,i){return this.a.copy(e[n]),this.b.copy(e[r]),this.c.copy(e[i]),this}setFromAttributeAndIndices(e,n,r,i){return this.a.fromBufferAttribute(e,n),this.b.fromBufferAttribute(e,r),this.c.fromBufferAttribute(e,i),this}clone(){return new this.constructor().copy(this)}copy(e){return this.a.copy(e.a),this.b.copy(e.b),this.c.copy(e.c),this}getArea(){return tf.subVectors(this.c,this.b),yp.subVectors(this.a,this.b),tf.cross(yp).length()*.5}getMidpoint(e){return e.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(e){return Vp.getNormal(this.a,this.b,this.c,e)}getPlane(e){return e.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(e,n){return Vp.getBarycoord(e,this.a,this.b,this.c,n)}getUV(e,n,r,i,o){return Vp.getUV(e,this.a,this.b,this.c,n,r,i,o)}containsPoint(e){return Vp.containsPoint(e,this.a,this.b,this.c)}isFrontFacing(e){return Vp.isFrontFacing(this.a,this.b,this.c,e)}intersectsBox(e){return e.intersectsTriangle(this)}closestPointToPoint(e,n){const r=this.a,i=this.b,o=this.c;let s,a;ww.subVectors(i,r),_w.subVectors(o,r),oG.subVectors(e,r);const l=ww.dot(oG),c=_w.dot(oG);if(l<=0&&c<=0)return n.copy(r);sG.subVectors(e,i);const u=ww.dot(sG),f=_w.dot(sG);if(u>=0&&f<=u)return n.copy(i);const d=l*f-u*c;if(d<=0&&l>=0&&u<=0)return s=l/(l-u),n.copy(r).addScaledVector(ww,s);aG.subVectors(e,o);const h=ww.dot(aG),p=_w.dot(aG);if(p>=0&&h<=p)return n.copy(o);const g=h*c-l*p;if(g<=0&&c>=0&&p<=0)return a=c/(c-p),n.copy(r).addScaledVector(_w,a);const m=u*p-h*f;if(m<=0&&f-u>=0&&h-p>=0)return $Oe.subVectors(o,i),a=(f-u)/(f-u+(h-p)),n.copy(i).addScaledVector($Oe,a);const v=1/(m+g+d);return s=g*v,a=d*v,n.copy(r).addScaledVector(ww,s).addScaledVector(_w,a)}equals(e){return e.a.equals(this.a)&&e.b.equals(this.b)&&e.c.equals(this.c)}}let s6n=0;class OD extends Mb{constructor(){super(),this.isMaterial=!0,Object.defineProperty(this,"id",{value:s6n++}),this.uuid=SD(),this.name="",this.type="Material",this.blending=oS,this.side=zC,this.vertexColors=!1,this.opacity=1,this.transparent=!1,this.blendSrc=uXe,this.blendDst=fXe,this.blendEquation=Bw,this.blendSrcAlpha=null,this.blendDstAlpha=null,this.blendEquationAlpha=null,this.depthFunc=DZ,this.depthTest=!0,this.depthWrite=!0,this.stencilWriteMask=255,this.stencilFunc=QBn,this.stencilRef=0,this.stencilFuncMask=255,this.stencilFail=G7,this.stencilZFail=G7,this.stencilZPass=G7,this.stencilWrite=!1,this.clippingPlanes=null,this.clipIntersection=!1,this.clipShadows=!1,this.shadowSide=null,this.colorWrite=!0,this.precision=null,this.polygonOffset=!1,this.polygonOffsetFactor=0,this.polygonOffsetUnits=0,this.dithering=!1,this.alphaToCoverage=!1,this.premultipliedAlpha=!1,this.visible=!0,this.toneMapped=!0,this.userData={},this.version=0,this._alphaTest=0}get alphaTest(){return this._alphaTest}set alphaTest(e){this._alphaTest>0!=e>0&&this.version++,this._alphaTest=e}onBuild(){}onBeforeRender(){}onBeforeCompile(){}customProgramCacheKey(){return this.onBeforeCompile.toString()}setValues(e){if(e!==void 0)for(const n in e){const r=e[n];if(r===void 0){console.warn("THREE.Material: '"+n+"' parameter is undefined.");continue}const i=this[n];if(i===void 0){console.warn("THREE."+this.type+": '"+n+"' is not a property of this material.");continue}i&&i.isColor?i.set(r):i&&i.isVector3&&r&&r.isVector3?i.copy(r):this[n]=r}}toJSON(e){const n=e===void 0||typeof e=="string";n&&(e={textures:{},images:{}});const r={metadata:{version:4.5,type:"Material",generator:"Material.toJSON"}};r.uuid=this.uuid,r.type=this.type,this.name!==""&&(r.name=this.name),this.color&&this.color.isColor&&(r.color=this.color.getHex()),this.roughness!==void 0&&(r.roughness=this.roughness),this.metalness!==void 0&&(r.metalness=this.metalness),this.sheen!==void 0&&(r.sheen=this.sheen),this.sheenColor&&this.sheenColor.isColor&&(r.sheenColor=this.sheenColor.getHex()),this.sheenRoughness!==void 0&&(r.sheenRoughness=this.sheenRoughness),this.emissive&&this.emissive.isColor&&(r.emissive=this.emissive.getHex()),this.emissiveIntensity&&this.emissiveIntensity!==1&&(r.emissiveIntensity=this.emissiveIntensity),this.specular&&this.specular.isColor&&(r.specular=this.specular.getHex()),this.specularIntensity!==void 0&&(r.specularIntensity=this.specularIntensity),this.specularColor&&this.specularColor.isColor&&(r.specularColor=this.specularColor.getHex()),this.shininess!==void 0&&(r.shininess=this.shininess),this.clearcoat!==void 0&&(r.clearcoat=this.clearcoat),this.clearcoatRoughness!==void 0&&(r.clearcoatRoughness=this.clearcoatRoughness),this.clearcoatMap&&this.clearcoatMap.isTexture&&(r.clearcoatMap=this.clearcoatMap.toJSON(e).uuid),this.clearcoatRoughnessMap&&this.clearcoatRoughnessMap.isTexture&&(r.clearcoatRoughnessMap=this.clearcoatRoughnessMap.toJSON(e).uuid),this.clearcoatNormalMap&&this.clearcoatNormalMap.isTexture&&(r.clearcoatNormalMap=this.clearcoatNormalMap.toJSON(e).uuid,r.clearcoatNormalScale=this.clearcoatNormalScale.toArray()),this.iridescence!==void 0&&(r.iridescence=this.iridescence),this.iridescenceIOR!==void 0&&(r.iridescenceIOR=this.iridescenceIOR),this.iridescenceThicknessRange!==void 0&&(r.iridescenceThicknessRange=this.iridescenceThicknessRange),this.iridescenceMap&&this.iridescenceMap.isTexture&&(r.iridescenceMap=this.iridescenceMap.toJSON(e).uuid),this.iridescenceThicknessMap&&this.iridescenceThicknessMap.isTexture&&(r.iridescenceThicknessMap=this.iridescenceThicknessMap.toJSON(e).uuid),this.map&&this.map.isTexture&&(r.map=this.map.toJSON(e).uuid),this.matcap&&this.matcap.isTexture&&(r.matcap=this.matcap.toJSON(e).uuid),this.alphaMap&&this.alphaMap.isTexture&&(r.alphaMap=this.alphaMap.toJSON(e).uuid),this.lightMap&&this.lightMap.isTexture&&(r.lightMap=this.lightMap.toJSON(e).uuid,r.lightMapIntensity=this.lightMapIntensity),this.aoMap&&this.aoMap.isTexture&&(r.aoMap=this.aoMap.toJSON(e).uuid,r.aoMapIntensity=this.aoMapIntensity),this.bumpMap&&this.bumpMap.isTexture&&(r.bumpMap=this.bumpMap.toJSON(e).uuid,r.bumpScale=this.bumpScale),this.normalMap&&this.normalMap.isTexture&&(r.normalMap=this.normalMap.toJSON(e).uuid,r.normalMapType=this.normalMapType,r.normalScale=this.normalScale.toArray()),this.displacementMap&&this.displacementMap.isTexture&&(r.displacementMap=this.displacementMap.toJSON(e).uuid,r.displacementScale=this.displacementScale,r.displacementBias=this.displacementBias),this.roughnessMap&&this.roughnessMap.isTexture&&(r.roughnessMap=this.roughnessMap.toJSON(e).uuid),this.metalnessMap&&this.metalnessMap.isTexture&&(r.metalnessMap=this.metalnessMap.toJSON(e).uuid),this.emissiveMap&&this.emissiveMap.isTexture&&(r.emissiveMap=this.emissiveMap.toJSON(e).uuid),this.specularMap&&this.specularMap.isTexture&&(r.specularMap=this.specularMap.toJSON(e).uuid),this.specularIntensityMap&&this.specularIntensityMap.isTexture&&(r.specularIntensityMap=this.specularIntensityMap.toJSON(e).uuid),this.specularColorMap&&this.specularColorMap.isTexture&&(r.specularColorMap=this.specularColorMap.toJSON(e).uuid),this.envMap&&this.envMap.isTexture&&(r.envMap=this.envMap.toJSON(e).uuid,this.combine!==void 0&&(r.combine=this.combine)),this.envMapIntensity!==void 0&&(r.envMapIntensity=this.envMapIntensity),this.reflectivity!==void 0&&(r.reflectivity=this.reflectivity),this.refractionRatio!==void 0&&(r.refractionRatio=this.refractionRatio),this.gradientMap&&this.gradientMap.isTexture&&(r.gradientMap=this.gradientMap.toJSON(e).uuid),this.transmission!==void 0&&(r.transmission=this.transmission),this.transmissionMap&&this.transmissionMap.isTexture&&(r.transmissionMap=this.transmissionMap.toJSON(e).uuid),this.thickness!==void 0&&(r.thickness=this.thickness),this.thicknessMap&&this.thicknessMap.isTexture&&(r.thicknessMap=this.thicknessMap.toJSON(e).uuid),this.attenuationDistance!==void 0&&(r.attenuationDistance=this.attenuationDistance),this.attenuationColor!==void 0&&(r.attenuationColor=this.attenuationColor.getHex()),this.size!==void 0&&(r.size=this.size),this.shadowSide!==null&&(r.shadowSide=this.shadowSide),this.sizeAttenuation!==void 0&&(r.sizeAttenuation=this.sizeAttenuation),this.blending!==oS&&(r.blending=this.blending),this.side!==zC&&(r.side=this.side),this.vertexColors&&(r.vertexColors=!0),this.opacity<1&&(r.opacity=this.opacity),this.transparent===!0&&(r.transparent=this.transparent),r.depthFunc=this.depthFunc,r.depthTest=this.depthTest,r.depthWrite=this.depthWrite,r.colorWrite=this.colorWrite,r.stencilWrite=this.stencilWrite,r.stencilWriteMask=this.stencilWriteMask,r.stencilFunc=this.stencilFunc,r.stencilRef=this.stencilRef,r.stencilFuncMask=this.stencilFuncMask,r.stencilFail=this.stencilFail,r.stencilZFail=this.stencilZFail,r.stencilZPass=this.stencilZPass,this.rotation!==void 0&&this.rotation!==0&&(r.rotation=this.rotation),this.polygonOffset===!0&&(r.polygonOffset=!0),this.polygonOffsetFactor!==0&&(r.polygonOffsetFactor=this.polygonOffsetFactor),this.polygonOffsetUnits!==0&&(r.polygonOffsetUnits=this.polygonOffsetUnits),this.linewidth!==void 0&&this.linewidth!==1&&(r.linewidth=this.linewidth),this.dashSize!==void 0&&(r.dashSize=this.dashSize),this.gapSize!==void 0&&(r.gapSize=this.gapSize),this.scale!==void 0&&(r.scale=this.scale),this.dithering===!0&&(r.dithering=!0),this.alphaTest>0&&(r.alphaTest=this.alphaTest),this.alphaToCoverage===!0&&(r.alphaToCoverage=this.alphaToCoverage),this.premultipliedAlpha===!0&&(r.premultipliedAlpha=this.premultipliedAlpha),this.wireframe===!0&&(r.wireframe=this.wireframe),this.wireframeLinewidth>1&&(r.wireframeLinewidth=this.wireframeLinewidth),this.wireframeLinecap!=="round"&&(r.wireframeLinecap=this.wireframeLinecap),this.wireframeLinejoin!=="round"&&(r.wireframeLinejoin=this.wireframeLinejoin),this.flatShading===!0&&(r.flatShading=this.flatShading),this.visible===!1&&(r.visible=!1),this.toneMapped===!1&&(r.toneMapped=!1),this.fog===!1&&(r.fog=!1),JSON.stringify(this.userData)!=="{}"&&(r.userData=this.userData);function i(o){const s=[];for(const a in o){const l=o[a];delete l.metadata,s.push(l)}return s}if(n){const o=i(e.textures),s=i(e.images);o.length>0&&(r.textures=o),s.length>0&&(r.images=s)}return r}clone(){return new this.constructor().copy(this)}copy(e){this.name=e.name,this.blending=e.blending,this.side=e.side,this.vertexColors=e.vertexColors,this.opacity=e.opacity,this.transparent=e.transparent,this.blendSrc=e.blendSrc,this.blendDst=e.blendDst,this.blendEquation=e.blendEquation,this.blendSrcAlpha=e.blendSrcAlpha,this.blendDstAlpha=e.blendDstAlpha,this.blendEquationAlpha=e.blendEquationAlpha,this.depthFunc=e.depthFunc,this.depthTest=e.depthTest,this.depthWrite=e.depthWrite,this.stencilWriteMask=e.stencilWriteMask,this.stencilFunc=e.stencilFunc,this.stencilRef=e.stencilRef,this.stencilFuncMask=e.stencilFuncMask,this.stencilFail=e.stencilFail,this.stencilZFail=e.stencilZFail,this.stencilZPass=e.stencilZPass,this.stencilWrite=e.stencilWrite;const n=e.clippingPlanes;let r=null;if(n!==null){const i=n.length;r=new Array(i);for(let o=0;o!==i;++o)r[o]=n[o].clone()}return this.clippingPlanes=r,this.clipIntersection=e.clipIntersection,this.clipShadows=e.clipShadows,this.shadowSide=e.shadowSide,this.colorWrite=e.colorWrite,this.precision=e.precision,this.polygonOffset=e.polygonOffset,this.polygonOffsetFactor=e.polygonOffsetFactor,this.polygonOffsetUnits=e.polygonOffsetUnits,this.dithering=e.dithering,this.alphaTest=e.alphaTest,this.alphaToCoverage=e.alphaToCoverage,this.premultipliedAlpha=e.premultipliedAlpha,this.visible=e.visible,this.toneMapped=e.toneMapped,this.userData=JSON.parse(JSON.stringify(e.userData)),this}dispose(){this.dispatchEvent({type:"dispose"})}set needsUpdate(e){e===!0&&this.version++}}class $ce extends OD{constructor(e){super(),this.isMeshBasicMaterial=!0,this.type="MeshBasicMaterial",this.color=new ci(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=dXe,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.fog=e.fog,this}}const to=new Ce,w$=new En;class xu{constructor(e,n,r){if(Array.isArray(e))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.isBufferAttribute=!0,this.name="",this.array=e,this.itemSize=n,this.count=e!==void 0?e.length/n:0,this.normalized=r===!0,this.usage=SOe,this.updateRange={offset:0,count:-1},this.version=0}onUploadCallback(){}set needsUpdate(e){e===!0&&this.version++}setUsage(e){return this.usage=e,this}copy(e){return this.name=e.name,this.array=new e.array.constructor(e.array),this.itemSize=e.itemSize,this.count=e.count,this.normalized=e.normalized,this.usage=e.usage,this}copyAt(e,n,r){e*=this.itemSize,r*=n.itemSize;for(let i=0,o=this.itemSize;i0&&(e.userData=this.userData),this.parameters!==void 0){const l=this.parameters;for(const c in l)l[c]!==void 0&&(e[c]=l[c]);return e}e.data={attributes:{}};const n=this.index;n!==null&&(e.data.index={type:n.array.constructor.name,array:Array.prototype.slice.call(n.array)});const r=this.attributes;for(const l in r){const c=r[l];e.data.attributes[l]=c.toJSON(e.data)}const i={};let o=!1;for(const l in this.morphAttributes){const c=this.morphAttributes[l],u=[];for(let f=0,d=c.length;f0&&(i[l]=u,o=!0)}o&&(e.data.morphAttributes=i,e.data.morphTargetsRelative=this.morphTargetsRelative);const s=this.groups;s.length>0&&(e.data.groups=JSON.parse(JSON.stringify(s)));const a=this.boundingSphere;return a!==null&&(e.data.boundingSphere={center:a.center.toArray(),radius:a.radius}),e}clone(){return new this.constructor().copy(this)}copy(e){this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null;const n={};this.name=e.name;const r=e.index;r!==null&&this.setIndex(r.clone(n));const i=e.attributes;for(const c in i){const u=i[c];this.setAttribute(c,u.clone(n))}const o=e.morphAttributes;for(const c in o){const u=[],f=o[c];for(let d=0,h=f.length;d0){const i=n[r[0]];if(i!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let o=0,s=i.length;on.far?null:{distance:c,point:k$.clone(),object:t}}function A$(t,e,n,r,i,o,s,a,l,c,u,f){Om.fromBufferAttribute(i,c),Em.fromBufferAttribute(i,u),Tm.fromBufferAttribute(i,f);const d=t.morphTargetInfluences;if(o&&d){_$.set(0,0,0),S$.set(0,0,0),C$.set(0,0,0);for(let p=0,g=o.length;p0?1:-1,u.push(z.x,z.y,z.z),f.push(N/S),f.push(1-L/O),B+=1}}for(let L=0;L>8&255]+Ms[t>>16&255]+Ms[t>>24&255]+"-"+Ms[e&255]+Ms[e>>8&255]+"-"+Ms[e>>16&15|64]+Ms[e>>24&255]+"-"+Ms[n&63|128]+Ms[n>>8&255]+"-"+Ms[n>>16&255]+Ms[n>>24&255]+Ms[r&255]+Ms[r>>8&255]+Ms[r>>16&255]+Ms[r>>24&255]).toLowerCase()}function tl(t,e,n){return Math.max(e,Math.min(n,t))}function GBn(t,e){return(t%e+e)%e}function lG(t,e,n){return(1-n)*t+n*e}function JOe(t){return(t&t-1)===0&&t!==0}function tJ(t){return Math.pow(2,Math.floor(Math.log(t)/Math.LN2))}function a$(t,e){switch(e.constructor){case Float32Array:return t;case Uint16Array:return t/65535;case Uint8Array:return t/255;case Int16Array:return Math.max(t/32767,-1);case Int8Array:return Math.max(t/127,-1);default:throw new Error("Invalid component type.")}}function $l(t,e){switch(e.constructor){case Float32Array:return t;case Uint16Array:return Math.round(t*65535);case Uint8Array:return Math.round(t*255);case Int16Array:return Math.round(t*32767);case Int8Array:return Math.round(t*127);default:throw new Error("Invalid component type.")}}class On{constructor(e=0,n=0){On.prototype.isVector2=!0,this.x=e,this.y=n}get width(){return this.x}set width(e){this.x=e}get height(){return this.y}set height(e){this.y=e}set(e,n){return this.x=e,this.y=n,this}setScalar(e){return this.x=e,this.y=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setComponent(e,n){switch(e){case 0:this.x=n;break;case 1:this.y=n;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y)}copy(e){return this.x=e.x,this.y=e.y,this}add(e){return this.x+=e.x,this.y+=e.y,this}addScalar(e){return this.x+=e,this.y+=e,this}addVectors(e,n){return this.x=e.x+n.x,this.y=e.y+n.y,this}addScaledVector(e,n){return this.x+=e.x*n,this.y+=e.y*n,this}sub(e){return this.x-=e.x,this.y-=e.y,this}subScalar(e){return this.x-=e,this.y-=e,this}subVectors(e,n){return this.x=e.x-n.x,this.y=e.y-n.y,this}multiply(e){return this.x*=e.x,this.y*=e.y,this}multiplyScalar(e){return this.x*=e,this.y*=e,this}divide(e){return this.x/=e.x,this.y/=e.y,this}divideScalar(e){return this.multiplyScalar(1/e)}applyMatrix3(e){const n=this.x,r=this.y,i=e.elements;return this.x=i[0]*n+i[3]*r+i[6],this.y=i[1]*n+i[4]*r+i[7],this}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this}clamp(e,n){return this.x=Math.max(e.x,Math.min(n.x,this.x)),this.y=Math.max(e.y,Math.min(n.y,this.y)),this}clampScalar(e,n){return this.x=Math.max(e,Math.min(n,this.x)),this.y=Math.max(e,Math.min(n,this.y)),this}clampLength(e,n){const r=this.length();return this.divideScalar(r||1).multiplyScalar(Math.max(e,Math.min(n,r)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}roundToZero(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this}negate(){return this.x=-this.x,this.y=-this.y,this}dot(e){return this.x*e.x+this.y*e.y}cross(e){return this.x*e.y-this.y*e.x}lengthSq(){return this.x*this.x+this.y*this.y}length(){return Math.sqrt(this.x*this.x+this.y*this.y)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)}normalize(){return this.divideScalar(this.length()||1)}angle(){return Math.atan2(-this.y,-this.x)+Math.PI}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const n=this.x-e.x,r=this.y-e.y;return n*n+r*r}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,n){return this.x+=(e.x-this.x)*n,this.y+=(e.y-this.y)*n,this}lerpVectors(e,n,r){return this.x=e.x+(n.x-e.x)*r,this.y=e.y+(n.y-e.y)*r,this}equals(e){return e.x===this.x&&e.y===this.y}fromArray(e,n=0){return this.x=e[n],this.y=e[n+1],this}toArray(e=[],n=0){return e[n]=this.x,e[n+1]=this.y,e}fromBufferAttribute(e,n){return this.x=e.getX(n),this.y=e.getY(n),this}rotateAround(e,n){const r=Math.cos(n),i=Math.sin(n),o=this.x-e.x,s=this.y-e.y;return this.x=o*r-s*i+e.x,this.y=o*i+s*r+e.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y}}class cc{constructor(){cc.prototype.isMatrix3=!0,this.elements=[1,0,0,0,1,0,0,0,1]}set(e,n,r,i,o,s,a,l,c){const u=this.elements;return u[0]=e,u[1]=i,u[2]=a,u[3]=n,u[4]=o,u[5]=l,u[6]=r,u[7]=s,u[8]=c,this}identity(){return this.set(1,0,0,0,1,0,0,0,1),this}copy(e){const n=this.elements,r=e.elements;return n[0]=r[0],n[1]=r[1],n[2]=r[2],n[3]=r[3],n[4]=r[4],n[5]=r[5],n[6]=r[6],n[7]=r[7],n[8]=r[8],this}extractBasis(e,n,r){return e.setFromMatrix3Column(this,0),n.setFromMatrix3Column(this,1),r.setFromMatrix3Column(this,2),this}setFromMatrix4(e){const n=e.elements;return this.set(n[0],n[4],n[8],n[1],n[5],n[9],n[2],n[6],n[10]),this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,n){const r=e.elements,i=n.elements,o=this.elements,s=r[0],a=r[3],l=r[6],c=r[1],u=r[4],f=r[7],d=r[2],h=r[5],p=r[8],g=i[0],m=i[3],v=i[6],y=i[1],x=i[4],b=i[7],w=i[2],_=i[5],S=i[8];return o[0]=s*g+a*y+l*w,o[3]=s*m+a*x+l*_,o[6]=s*v+a*b+l*S,o[1]=c*g+u*y+f*w,o[4]=c*m+u*x+f*_,o[7]=c*v+u*b+f*S,o[2]=d*g+h*y+p*w,o[5]=d*m+h*x+p*_,o[8]=d*v+h*b+p*S,this}multiplyScalar(e){const n=this.elements;return n[0]*=e,n[3]*=e,n[6]*=e,n[1]*=e,n[4]*=e,n[7]*=e,n[2]*=e,n[5]*=e,n[8]*=e,this}determinant(){const e=this.elements,n=e[0],r=e[1],i=e[2],o=e[3],s=e[4],a=e[5],l=e[6],c=e[7],u=e[8];return n*s*u-n*a*c-r*o*u+r*a*l+i*o*c-i*s*l}invert(){const e=this.elements,n=e[0],r=e[1],i=e[2],o=e[3],s=e[4],a=e[5],l=e[6],c=e[7],u=e[8],f=u*s-a*c,d=a*l-u*o,h=c*o-s*l,p=n*f+r*d+i*h;if(p===0)return this.set(0,0,0,0,0,0,0,0,0);const g=1/p;return e[0]=f*g,e[1]=(i*c-u*r)*g,e[2]=(a*r-i*s)*g,e[3]=d*g,e[4]=(u*n-i*l)*g,e[5]=(i*o-a*n)*g,e[6]=h*g,e[7]=(r*l-c*n)*g,e[8]=(s*n-r*o)*g,this}transpose(){let e;const n=this.elements;return e=n[1],n[1]=n[3],n[3]=e,e=n[2],n[2]=n[6],n[6]=e,e=n[5],n[5]=n[7],n[7]=e,this}getNormalMatrix(e){return this.setFromMatrix4(e).invert().transpose()}transposeIntoArray(e){const n=this.elements;return e[0]=n[0],e[1]=n[3],e[2]=n[6],e[3]=n[1],e[4]=n[4],e[5]=n[7],e[6]=n[2],e[7]=n[5],e[8]=n[8],this}setUvTransform(e,n,r,i,o,s,a){const l=Math.cos(o),c=Math.sin(o);return this.set(r*l,r*c,-r*(l*s+c*a)+s+e,-i*c,i*l,-i*(-c*s+l*a)+a+n,0,0,1),this}scale(e,n){const r=this.elements;return r[0]*=e,r[3]*=e,r[6]*=e,r[1]*=n,r[4]*=n,r[7]*=n,this}rotate(e){const n=Math.cos(e),r=Math.sin(e),i=this.elements,o=i[0],s=i[3],a=i[6],l=i[1],c=i[4],u=i[7];return i[0]=n*o+r*l,i[3]=n*s+r*c,i[6]=n*a+r*u,i[1]=-r*o+n*l,i[4]=-r*s+n*c,i[7]=-r*a+n*u,this}translate(e,n){const r=this.elements;return r[0]+=e*r[2],r[3]+=e*r[5],r[6]+=e*r[8],r[1]+=n*r[2],r[4]+=n*r[5],r[7]+=n*r[8],this}equals(e){const n=this.elements,r=e.elements;for(let i=0;i<9;i++)if(n[i]!==r[i])return!1;return!0}fromArray(e,n=0){for(let r=0;r<9;r++)this.elements[r]=e[r+n];return this}toArray(e=[],n=0){const r=this.elements;return e[n]=r[0],e[n+1]=r[1],e[n+2]=r[2],e[n+3]=r[3],e[n+4]=r[4],e[n+5]=r[5],e[n+6]=r[6],e[n+7]=r[7],e[n+8]=r[8],e}clone(){return new this.constructor().fromArray(this.elements)}}function WXe(t){for(let e=t.length-1;e>=0;--e)if(t[e]>=65535)return!0;return!1}function aM(t){return document.createElementNS("http://www.w3.org/1999/xhtml",t)}function Yx(t){return t<.04045?t*.0773993808:Math.pow(t*.9478672986+.0521327014,2.4)}function Q3(t){return t<.0031308?t*12.92:1.055*Math.pow(t,.41666)-.055}const cG={[kp]:{[Sx]:Yx},[Sx]:{[kp]:Q3}},Zu={legacyMode:!0,get workingColorSpace(){return Sx},set workingColorSpace(t){console.warn("THREE.ColorManagement: .workingColorSpace is readonly.")},convert:function(t,e,n){if(this.legacyMode||e===n||!e||!n)return t;if(cG[e]&&cG[e][n]!==void 0){const r=cG[e][n];return t.r=r(t.r),t.g=r(t.g),t.b=r(t.b),t}throw new Error("Unsupported color space conversion.")},fromWorkingColorSpace:function(t,e){return this.convert(t,this.workingColorSpace,e)},toWorkingColorSpace:function(t,e){return this.convert(t,e,this.workingColorSpace)}},VXe={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074},ho={r:0,g:0,b:0},Ju={h:0,s:0,l:0},l$={h:0,s:0,l:0};function uG(t,e,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+(e-t)*6*n:n<1/2?e:n<2/3?t+(e-t)*6*(2/3-n):t}function c$(t,e){return e.r=t.r,e.g=t.g,e.b=t.b,e}class fi{constructor(e,n,r){return this.isColor=!0,this.r=1,this.g=1,this.b=1,n===void 0&&r===void 0?this.set(e):this.setRGB(e,n,r)}set(e){return e&&e.isColor?this.copy(e):typeof e=="number"?this.setHex(e):typeof e=="string"&&this.setStyle(e),this}setScalar(e){return this.r=e,this.g=e,this.b=e,this}setHex(e,n=kp){return e=Math.floor(e),this.r=(e>>16&255)/255,this.g=(e>>8&255)/255,this.b=(e&255)/255,Zu.toWorkingColorSpace(this,n),this}setRGB(e,n,r,i=Sx){return this.r=e,this.g=n,this.b=r,Zu.toWorkingColorSpace(this,i),this}setHSL(e,n,r,i=Sx){if(e=GBn(e,1),n=tl(n,0,1),r=tl(r,0,1),n===0)this.r=this.g=this.b=r;else{const o=r<=.5?r*(1+n):r+n-r*n,s=2*r-o;this.r=uG(s,o,e+1/3),this.g=uG(s,o,e),this.b=uG(s,o,e-1/3)}return Zu.toWorkingColorSpace(this,i),this}setStyle(e,n=kp){function r(o){o!==void 0&&parseFloat(o)<1&&console.warn("THREE.Color: Alpha component of "+e+" will be ignored.")}let i;if(i=/^((?:rgb|hsl)a?)\(([^\)]*)\)/.exec(e)){let o;const s=i[1],a=i[2];switch(s){case"rgb":case"rgba":if(o=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(a))return this.r=Math.min(255,parseInt(o[1],10))/255,this.g=Math.min(255,parseInt(o[2],10))/255,this.b=Math.min(255,parseInt(o[3],10))/255,Zu.toWorkingColorSpace(this,n),r(o[4]),this;if(o=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(a))return this.r=Math.min(100,parseInt(o[1],10))/100,this.g=Math.min(100,parseInt(o[2],10))/100,this.b=Math.min(100,parseInt(o[3],10))/100,Zu.toWorkingColorSpace(this,n),r(o[4]),this;break;case"hsl":case"hsla":if(o=/^\s*(\d*\.?\d+)\s*,\s*(\d*\.?\d+)\%\s*,\s*(\d*\.?\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(a)){const l=parseFloat(o[1])/360,c=parseFloat(o[2])/100,u=parseFloat(o[3])/100;return r(o[4]),this.setHSL(l,c,u,n)}break}}else if(i=/^\#([A-Fa-f\d]+)$/.exec(e)){const o=i[1],s=o.length;if(s===3)return this.r=parseInt(o.charAt(0)+o.charAt(0),16)/255,this.g=parseInt(o.charAt(1)+o.charAt(1),16)/255,this.b=parseInt(o.charAt(2)+o.charAt(2),16)/255,Zu.toWorkingColorSpace(this,n),this;if(s===6)return this.r=parseInt(o.charAt(0)+o.charAt(1),16)/255,this.g=parseInt(o.charAt(2)+o.charAt(3),16)/255,this.b=parseInt(o.charAt(4)+o.charAt(5),16)/255,Zu.toWorkingColorSpace(this,n),this}return e&&e.length>0?this.setColorName(e,n):this}setColorName(e,n=kp){const r=VXe[e.toLowerCase()];return r!==void 0?this.setHex(r,n):console.warn("THREE.Color: Unknown color "+e),this}clone(){return new this.constructor(this.r,this.g,this.b)}copy(e){return this.r=e.r,this.g=e.g,this.b=e.b,this}copySRGBToLinear(e){return this.r=Yx(e.r),this.g=Yx(e.g),this.b=Yx(e.b),this}copyLinearToSRGB(e){return this.r=Q3(e.r),this.g=Q3(e.g),this.b=Q3(e.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(e=kp){return Zu.fromWorkingColorSpace(c$(this,ho),e),tl(ho.r*255,0,255)<<16^tl(ho.g*255,0,255)<<8^tl(ho.b*255,0,255)<<0}getHexString(e=kp){return("000000"+this.getHex(e).toString(16)).slice(-6)}getHSL(e,n=Sx){Zu.fromWorkingColorSpace(c$(this,ho),n);const r=ho.r,i=ho.g,o=ho.b,s=Math.max(r,i,o),a=Math.min(r,i,o);let l,c;const u=(a+s)/2;if(a===s)l=0,c=0;else{const f=s-a;switch(c=u<=.5?f/(s+a):f/(2-s-a),s){case r:l=(i-o)/f+(i"u")return e.src;let n;if(e instanceof HTMLCanvasElement)n=e;else{pw===void 0&&(pw=aM("canvas")),pw.width=e.width,pw.height=e.height;const r=pw.getContext("2d");e instanceof ImageData?r.putImageData(e,0,0):r.drawImage(e,0,0,e.width,e.height),n=pw}return n.width>2048||n.height>2048?(console.warn("THREE.ImageUtils.getDataURL: Image converted to jpg for performance reasons",e),n.toDataURL("image/jpeg",.6)):n.toDataURL("image/png")}static sRGBToLinear(e){if(typeof HTMLImageElement<"u"&&e instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&e instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&e instanceof ImageBitmap){const n=aM("canvas");n.width=e.width,n.height=e.height;const r=n.getContext("2d");r.drawImage(e,0,0,e.width,e.height);const i=r.getImageData(0,0,e.width,e.height),o=i.data;for(let s=0;s1)switch(this.wrapS){case ZZ:e.x=e.x-Math.floor(e.x);break;case eu:e.x=e.x<0?0:1;break;case JZ:Math.abs(Math.floor(e.x)%2)===1?e.x=Math.ceil(e.x)-e.x:e.x=e.x-Math.floor(e.x);break}if(e.y<0||e.y>1)switch(this.wrapT){case ZZ:e.y=e.y-Math.floor(e.y);break;case eu:e.y=e.y<0?0:1;break;case JZ:Math.abs(Math.floor(e.y)%2)===1?e.y=Math.ceil(e.y)-e.y:e.y=e.y-Math.floor(e.y);break}return this.flipY&&(e.y=1-e.y),e}set needsUpdate(e){e===!0&&(this.version++,this.source.needsUpdate=!0)}}kc.DEFAULT_IMAGE=null;kc.DEFAULT_MAPPING=jXe;class vs{constructor(e=0,n=0,r=0,i=1){vs.prototype.isVector4=!0,this.x=e,this.y=n,this.z=r,this.w=i}get width(){return this.z}set width(e){this.z=e}get height(){return this.w}set height(e){this.w=e}set(e,n,r,i){return this.x=e,this.y=n,this.z=r,this.w=i,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this.w=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setW(e){return this.w=e,this}setComponent(e,n){switch(e){case 0:this.x=n;break;case 1:this.y=n;break;case 2:this.z=n;break;case 3:this.w=n;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;case 3:return this.w;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y,this.z,this.w)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this.w=e.w!==void 0?e.w:1,this}add(e){return this.x+=e.x,this.y+=e.y,this.z+=e.z,this.w+=e.w,this}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this.w+=e,this}addVectors(e,n){return this.x=e.x+n.x,this.y=e.y+n.y,this.z=e.z+n.z,this.w=e.w+n.w,this}addScaledVector(e,n){return this.x+=e.x*n,this.y+=e.y*n,this.z+=e.z*n,this.w+=e.w*n,this}sub(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this.w-=e.w,this}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this.w-=e,this}subVectors(e,n){return this.x=e.x-n.x,this.y=e.y-n.y,this.z=e.z-n.z,this.w=e.w-n.w,this}multiply(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this.w*=e.w,this}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this.w*=e,this}applyMatrix4(e){const n=this.x,r=this.y,i=this.z,o=this.w,s=e.elements;return this.x=s[0]*n+s[4]*r+s[8]*i+s[12]*o,this.y=s[1]*n+s[5]*r+s[9]*i+s[13]*o,this.z=s[2]*n+s[6]*r+s[10]*i+s[14]*o,this.w=s[3]*n+s[7]*r+s[11]*i+s[15]*o,this}divideScalar(e){return this.multiplyScalar(1/e)}setAxisAngleFromQuaternion(e){this.w=2*Math.acos(e.w);const n=Math.sqrt(1-e.w*e.w);return n<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=e.x/n,this.y=e.y/n,this.z=e.z/n),this}setAxisAngleFromRotationMatrix(e){let n,r,i,o;const l=e.elements,c=l[0],u=l[4],f=l[8],d=l[1],h=l[5],p=l[9],g=l[2],m=l[6],v=l[10];if(Math.abs(u-d)<.01&&Math.abs(f-g)<.01&&Math.abs(p-m)<.01){if(Math.abs(u+d)<.1&&Math.abs(f+g)<.1&&Math.abs(p+m)<.1&&Math.abs(c+h+v-3)<.1)return this.set(1,0,0,0),this;n=Math.PI;const x=(c+1)/2,b=(h+1)/2,w=(v+1)/2,_=(u+d)/4,S=(f+g)/4,O=(p+m)/4;return x>b&&x>w?x<.01?(r=0,i=.707106781,o=.707106781):(r=Math.sqrt(x),i=_/r,o=S/r):b>w?b<.01?(r=.707106781,i=0,o=.707106781):(i=Math.sqrt(b),r=_/i,o=O/i):w<.01?(r=.707106781,i=.707106781,o=0):(o=Math.sqrt(w),r=S/o,i=O/o),this.set(r,i,o,n),this}let y=Math.sqrt((m-p)*(m-p)+(f-g)*(f-g)+(d-u)*(d-u));return Math.abs(y)<.001&&(y=1),this.x=(m-p)/y,this.y=(f-g)/y,this.z=(d-u)/y,this.w=Math.acos((c+h+v-1)/2),this}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this.w=Math.min(this.w,e.w),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this.w=Math.max(this.w,e.w),this}clamp(e,n){return this.x=Math.max(e.x,Math.min(n.x,this.x)),this.y=Math.max(e.y,Math.min(n.y,this.y)),this.z=Math.max(e.z,Math.min(n.z,this.z)),this.w=Math.max(e.w,Math.min(n.w,this.w)),this}clampScalar(e,n){return this.x=Math.max(e,Math.min(n,this.x)),this.y=Math.max(e,Math.min(n,this.y)),this.z=Math.max(e,Math.min(n,this.z)),this.w=Math.max(e,Math.min(n,this.w)),this}clampLength(e,n){const r=this.length();return this.divideScalar(r||1).multiplyScalar(Math.max(e,Math.min(n,r)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this.w=Math.floor(this.w),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this.w=Math.ceil(this.w),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this.w=Math.round(this.w),this}roundToZero(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this.z=this.z<0?Math.ceil(this.z):Math.floor(this.z),this.w=this.w<0?Math.ceil(this.w):Math.floor(this.w),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z+this.w*e.w}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)+Math.abs(this.w)}normalize(){return this.divideScalar(this.length()||1)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,n){return this.x+=(e.x-this.x)*n,this.y+=(e.y-this.y)*n,this.z+=(e.z-this.z)*n,this.w+=(e.w-this.w)*n,this}lerpVectors(e,n,r){return this.x=e.x+(n.x-e.x)*r,this.y=e.y+(n.y-e.y)*r,this.z=e.z+(n.z-e.z)*r,this.w=e.w+(n.w-e.w)*r,this}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z&&e.w===this.w}fromArray(e,n=0){return this.x=e[n],this.y=e[n+1],this.z=e[n+2],this.w=e[n+3],this}toArray(e=[],n=0){return e[n]=this.x,e[n+1]=this.y,e[n+2]=this.z,e[n+3]=this.w,e}fromBufferAttribute(e,n){return this.x=e.getX(n),this.y=e.getY(n),this.z=e.getZ(n),this.w=e.getW(n),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this.w=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z,yield this.w}}class Vb extends M1{constructor(e,n,r={}){super(),this.isWebGLRenderTarget=!0,this.width=e,this.height=n,this.depth=1,this.scissor=new vs(0,0,e,n),this.scissorTest=!1,this.viewport=new vs(0,0,e,n);const i={width:e,height:n,depth:1};this.texture=new kc(i,r.mapping,r.wrapS,r.wrapT,r.magFilter,r.minFilter,r.format,r.type,r.anisotropy,r.encoding),this.texture.isRenderTargetTexture=!0,this.texture.flipY=!1,this.texture.generateMipmaps=r.generateMipmaps!==void 0?r.generateMipmaps:!1,this.texture.internalFormat=r.internalFormat!==void 0?r.internalFormat:null,this.texture.minFilter=r.minFilter!==void 0?r.minFilter:el,this.depthBuffer=r.depthBuffer!==void 0?r.depthBuffer:!0,this.stencilBuffer=r.stencilBuffer!==void 0?r.stencilBuffer:!1,this.depthTexture=r.depthTexture!==void 0?r.depthTexture:null,this.samples=r.samples!==void 0?r.samples:0}setSize(e,n,r=1){(this.width!==e||this.height!==n||this.depth!==r)&&(this.width=e,this.height=n,this.depth=r,this.texture.image.width=e,this.texture.image.height=n,this.texture.image.depth=r,this.dispose()),this.viewport.set(0,0,e,n),this.scissor.set(0,0,e,n)}clone(){return new this.constructor().copy(this)}copy(e){this.width=e.width,this.height=e.height,this.depth=e.depth,this.viewport.copy(e.viewport),this.texture=e.texture.clone(),this.texture.isRenderTargetTexture=!0;const n=Object.assign({},e.texture.image);return this.texture.source=new HXe(n),this.depthBuffer=e.depthBuffer,this.stencilBuffer=e.stencilBuffer,e.depthTexture!==null&&(this.depthTexture=e.depthTexture.clone()),this.samples=e.samples,this}dispose(){this.dispatchEvent({type:"dispose"})}}class qXe extends kc{constructor(e=null,n=1,r=1,i=1){super(null),this.isDataArrayTexture=!0,this.image={data:e,width:n,height:r,depth:i},this.magFilter=Ja,this.minFilter=Ja,this.wrapR=eu,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}class XXe extends kc{constructor(e=null,n=1,r=1,i=1){super(null),this.isData3DTexture=!0,this.image={data:e,width:n,height:r,depth:i},this.magFilter=Ja,this.minFilter=Ja,this.wrapR=eu,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}class Gb{constructor(e=0,n=0,r=0,i=1){this.isQuaternion=!0,this._x=e,this._y=n,this._z=r,this._w=i}static slerpFlat(e,n,r,i,o,s,a){let l=r[i+0],c=r[i+1],u=r[i+2],f=r[i+3];const d=o[s+0],h=o[s+1],p=o[s+2],g=o[s+3];if(a===0){e[n+0]=l,e[n+1]=c,e[n+2]=u,e[n+3]=f;return}if(a===1){e[n+0]=d,e[n+1]=h,e[n+2]=p,e[n+3]=g;return}if(f!==g||l!==d||c!==h||u!==p){let m=1-a;const v=l*d+c*h+u*p+f*g,y=v>=0?1:-1,x=1-v*v;if(x>Number.EPSILON){const w=Math.sqrt(x),_=Math.atan2(w,v*y);m=Math.sin(m*_)/w,a=Math.sin(a*_)/w}const b=a*y;if(l=l*m+d*b,c=c*m+h*b,u=u*m+p*b,f=f*m+g*b,m===1-a){const w=1/Math.sqrt(l*l+c*c+u*u+f*f);l*=w,c*=w,u*=w,f*=w}}e[n]=l,e[n+1]=c,e[n+2]=u,e[n+3]=f}static multiplyQuaternionsFlat(e,n,r,i,o,s){const a=r[i],l=r[i+1],c=r[i+2],u=r[i+3],f=o[s],d=o[s+1],h=o[s+2],p=o[s+3];return e[n]=a*p+u*f+l*h-c*d,e[n+1]=l*p+u*d+c*f-a*h,e[n+2]=c*p+u*h+a*d-l*f,e[n+3]=u*p-a*f-l*d-c*h,e}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get w(){return this._w}set w(e){this._w=e,this._onChangeCallback()}set(e,n,r,i){return this._x=e,this._y=n,this._z=r,this._w=i,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._w)}copy(e){return this._x=e.x,this._y=e.y,this._z=e.z,this._w=e.w,this._onChangeCallback(),this}setFromEuler(e,n){const r=e._x,i=e._y,o=e._z,s=e._order,a=Math.cos,l=Math.sin,c=a(r/2),u=a(i/2),f=a(o/2),d=l(r/2),h=l(i/2),p=l(o/2);switch(s){case"XYZ":this._x=d*u*f+c*h*p,this._y=c*h*f-d*u*p,this._z=c*u*p+d*h*f,this._w=c*u*f-d*h*p;break;case"YXZ":this._x=d*u*f+c*h*p,this._y=c*h*f-d*u*p,this._z=c*u*p-d*h*f,this._w=c*u*f+d*h*p;break;case"ZXY":this._x=d*u*f-c*h*p,this._y=c*h*f+d*u*p,this._z=c*u*p+d*h*f,this._w=c*u*f-d*h*p;break;case"ZYX":this._x=d*u*f-c*h*p,this._y=c*h*f+d*u*p,this._z=c*u*p-d*h*f,this._w=c*u*f+d*h*p;break;case"YZX":this._x=d*u*f+c*h*p,this._y=c*h*f+d*u*p,this._z=c*u*p-d*h*f,this._w=c*u*f-d*h*p;break;case"XZY":this._x=d*u*f-c*h*p,this._y=c*h*f-d*u*p,this._z=c*u*p+d*h*f,this._w=c*u*f+d*h*p;break;default:console.warn("THREE.Quaternion: .setFromEuler() encountered an unknown order: "+s)}return n!==!1&&this._onChangeCallback(),this}setFromAxisAngle(e,n){const r=n/2,i=Math.sin(r);return this._x=e.x*i,this._y=e.y*i,this._z=e.z*i,this._w=Math.cos(r),this._onChangeCallback(),this}setFromRotationMatrix(e){const n=e.elements,r=n[0],i=n[4],o=n[8],s=n[1],a=n[5],l=n[9],c=n[2],u=n[6],f=n[10],d=r+a+f;if(d>0){const h=.5/Math.sqrt(d+1);this._w=.25/h,this._x=(u-l)*h,this._y=(o-c)*h,this._z=(s-i)*h}else if(r>a&&r>f){const h=2*Math.sqrt(1+r-a-f);this._w=(u-l)/h,this._x=.25*h,this._y=(i+s)/h,this._z=(o+c)/h}else if(a>f){const h=2*Math.sqrt(1+a-r-f);this._w=(o-c)/h,this._x=(i+s)/h,this._y=.25*h,this._z=(l+u)/h}else{const h=2*Math.sqrt(1+f-r-a);this._w=(s-i)/h,this._x=(o+c)/h,this._y=(l+u)/h,this._z=.25*h}return this._onChangeCallback(),this}setFromUnitVectors(e,n){let r=e.dot(n)+1;return rMath.abs(e.z)?(this._x=-e.y,this._y=e.x,this._z=0,this._w=r):(this._x=0,this._y=-e.z,this._z=e.y,this._w=r)):(this._x=e.y*n.z-e.z*n.y,this._y=e.z*n.x-e.x*n.z,this._z=e.x*n.y-e.y*n.x,this._w=r),this.normalize()}angleTo(e){return 2*Math.acos(Math.abs(tl(this.dot(e),-1,1)))}rotateTowards(e,n){const r=this.angleTo(e);if(r===0)return this;const i=Math.min(1,n/r);return this.slerp(e,i),this}identity(){return this.set(0,0,0,1)}invert(){return this.conjugate()}conjugate(){return this._x*=-1,this._y*=-1,this._z*=-1,this._onChangeCallback(),this}dot(e){return this._x*e._x+this._y*e._y+this._z*e._z+this._w*e._w}lengthSq(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w}length(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)}normalize(){let e=this.length();return e===0?(this._x=0,this._y=0,this._z=0,this._w=1):(e=1/e,this._x=this._x*e,this._y=this._y*e,this._z=this._z*e,this._w=this._w*e),this._onChangeCallback(),this}multiply(e){return this.multiplyQuaternions(this,e)}premultiply(e){return this.multiplyQuaternions(e,this)}multiplyQuaternions(e,n){const r=e._x,i=e._y,o=e._z,s=e._w,a=n._x,l=n._y,c=n._z,u=n._w;return this._x=r*u+s*a+i*c-o*l,this._y=i*u+s*l+o*a-r*c,this._z=o*u+s*c+r*l-i*a,this._w=s*u-r*a-i*l-o*c,this._onChangeCallback(),this}slerp(e,n){if(n===0)return this;if(n===1)return this.copy(e);const r=this._x,i=this._y,o=this._z,s=this._w;let a=s*e._w+r*e._x+i*e._y+o*e._z;if(a<0?(this._w=-e._w,this._x=-e._x,this._y=-e._y,this._z=-e._z,a=-a):this.copy(e),a>=1)return this._w=s,this._x=r,this._y=i,this._z=o,this;const l=1-a*a;if(l<=Number.EPSILON){const h=1-n;return this._w=h*s+n*this._w,this._x=h*r+n*this._x,this._y=h*i+n*this._y,this._z=h*o+n*this._z,this.normalize(),this._onChangeCallback(),this}const c=Math.sqrt(l),u=Math.atan2(c,a),f=Math.sin((1-n)*u)/c,d=Math.sin(n*u)/c;return this._w=s*f+this._w*d,this._x=r*f+this._x*d,this._y=i*f+this._y*d,this._z=o*f+this._z*d,this._onChangeCallback(),this}slerpQuaternions(e,n,r){return this.copy(e).slerp(n,r)}random(){const e=Math.random(),n=Math.sqrt(1-e),r=Math.sqrt(e),i=2*Math.PI*Math.random(),o=2*Math.PI*Math.random();return this.set(n*Math.cos(i),r*Math.sin(o),r*Math.cos(o),n*Math.sin(i))}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._w===this._w}fromArray(e,n=0){return this._x=e[n],this._y=e[n+1],this._z=e[n+2],this._w=e[n+3],this._onChangeCallback(),this}toArray(e=[],n=0){return e[n]=this._x,e[n+1]=this._y,e[n+2]=this._z,e[n+3]=this._w,e}fromBufferAttribute(e,n){return this._x=e.getX(n),this._y=e.getY(n),this._z=e.getZ(n),this._w=e.getW(n),this}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._w}}class Ce{constructor(e=0,n=0,r=0){Ce.prototype.isVector3=!0,this.x=e,this.y=n,this.z=r}set(e,n,r){return r===void 0&&(r=this.z),this.x=e,this.y=n,this.z=r,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setComponent(e,n){switch(e){case 0:this.x=n;break;case 1:this.y=n;break;case 2:this.z=n;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y,this.z)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this}add(e){return this.x+=e.x,this.y+=e.y,this.z+=e.z,this}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this}addVectors(e,n){return this.x=e.x+n.x,this.y=e.y+n.y,this.z=e.z+n.z,this}addScaledVector(e,n){return this.x+=e.x*n,this.y+=e.y*n,this.z+=e.z*n,this}sub(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this}subVectors(e,n){return this.x=e.x-n.x,this.y=e.y-n.y,this.z=e.z-n.z,this}multiply(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this}multiplyVectors(e,n){return this.x=e.x*n.x,this.y=e.y*n.y,this.z=e.z*n.z,this}applyEuler(e){return this.applyQuaternion(eEe.setFromEuler(e))}applyAxisAngle(e,n){return this.applyQuaternion(eEe.setFromAxisAngle(e,n))}applyMatrix3(e){const n=this.x,r=this.y,i=this.z,o=e.elements;return this.x=o[0]*n+o[3]*r+o[6]*i,this.y=o[1]*n+o[4]*r+o[7]*i,this.z=o[2]*n+o[5]*r+o[8]*i,this}applyNormalMatrix(e){return this.applyMatrix3(e).normalize()}applyMatrix4(e){const n=this.x,r=this.y,i=this.z,o=e.elements,s=1/(o[3]*n+o[7]*r+o[11]*i+o[15]);return this.x=(o[0]*n+o[4]*r+o[8]*i+o[12])*s,this.y=(o[1]*n+o[5]*r+o[9]*i+o[13])*s,this.z=(o[2]*n+o[6]*r+o[10]*i+o[14])*s,this}applyQuaternion(e){const n=this.x,r=this.y,i=this.z,o=e.x,s=e.y,a=e.z,l=e.w,c=l*n+s*i-a*r,u=l*r+a*n-o*i,f=l*i+o*r-s*n,d=-o*n-s*r-a*i;return this.x=c*l+d*-o+u*-a-f*-s,this.y=u*l+d*-s+f*-o-c*-a,this.z=f*l+d*-a+c*-s-u*-o,this}project(e){return this.applyMatrix4(e.matrixWorldInverse).applyMatrix4(e.projectionMatrix)}unproject(e){return this.applyMatrix4(e.projectionMatrixInverse).applyMatrix4(e.matrixWorld)}transformDirection(e){const n=this.x,r=this.y,i=this.z,o=e.elements;return this.x=o[0]*n+o[4]*r+o[8]*i,this.y=o[1]*n+o[5]*r+o[9]*i,this.z=o[2]*n+o[6]*r+o[10]*i,this.normalize()}divide(e){return this.x/=e.x,this.y/=e.y,this.z/=e.z,this}divideScalar(e){return this.multiplyScalar(1/e)}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this}clamp(e,n){return this.x=Math.max(e.x,Math.min(n.x,this.x)),this.y=Math.max(e.y,Math.min(n.y,this.y)),this.z=Math.max(e.z,Math.min(n.z,this.z)),this}clampScalar(e,n){return this.x=Math.max(e,Math.min(n,this.x)),this.y=Math.max(e,Math.min(n,this.y)),this.z=Math.max(e,Math.min(n,this.z)),this}clampLength(e,n){const r=this.length();return this.divideScalar(r||1).multiplyScalar(Math.max(e,Math.min(n,r)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this}roundToZero(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this.z=this.z<0?Math.ceil(this.z):Math.floor(this.z),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)}normalize(){return this.divideScalar(this.length()||1)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,n){return this.x+=(e.x-this.x)*n,this.y+=(e.y-this.y)*n,this.z+=(e.z-this.z)*n,this}lerpVectors(e,n,r){return this.x=e.x+(n.x-e.x)*r,this.y=e.y+(n.y-e.y)*r,this.z=e.z+(n.z-e.z)*r,this}cross(e){return this.crossVectors(this,e)}crossVectors(e,n){const r=e.x,i=e.y,o=e.z,s=n.x,a=n.y,l=n.z;return this.x=i*l-o*a,this.y=o*s-r*l,this.z=r*a-i*s,this}projectOnVector(e){const n=e.lengthSq();if(n===0)return this.set(0,0,0);const r=e.dot(this)/n;return this.copy(e).multiplyScalar(r)}projectOnPlane(e){return dG.copy(this).projectOnVector(e),this.sub(dG)}reflect(e){return this.sub(dG.copy(e).multiplyScalar(2*this.dot(e)))}angleTo(e){const n=Math.sqrt(this.lengthSq()*e.lengthSq());if(n===0)return Math.PI/2;const r=this.dot(e)/n;return Math.acos(tl(r,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const n=this.x-e.x,r=this.y-e.y,i=this.z-e.z;return n*n+r*r+i*i}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)+Math.abs(this.z-e.z)}setFromSpherical(e){return this.setFromSphericalCoords(e.radius,e.phi,e.theta)}setFromSphericalCoords(e,n,r){const i=Math.sin(n)*e;return this.x=i*Math.sin(r),this.y=Math.cos(n)*e,this.z=i*Math.cos(r),this}setFromCylindrical(e){return this.setFromCylindricalCoords(e.radius,e.theta,e.y)}setFromCylindricalCoords(e,n,r){return this.x=e*Math.sin(n),this.y=r,this.z=e*Math.cos(n),this}setFromMatrixPosition(e){const n=e.elements;return this.x=n[12],this.y=n[13],this.z=n[14],this}setFromMatrixScale(e){const n=this.setFromMatrixColumn(e,0).length(),r=this.setFromMatrixColumn(e,1).length(),i=this.setFromMatrixColumn(e,2).length();return this.x=n,this.y=r,this.z=i,this}setFromMatrixColumn(e,n){return this.fromArray(e.elements,n*4)}setFromMatrix3Column(e,n){return this.fromArray(e.elements,n*3)}setFromEuler(e){return this.x=e._x,this.y=e._y,this.z=e._z,this}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z}fromArray(e,n=0){return this.x=e[n],this.y=e[n+1],this.z=e[n+2],this}toArray(e=[],n=0){return e[n]=this.x,e[n+1]=this.y,e[n+2]=this.z,e}fromBufferAttribute(e,n){return this.x=e.getX(n),this.y=e.getY(n),this.z=e.getZ(n),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this}randomDirection(){const e=(Math.random()-.5)*2,n=Math.random()*Math.PI*2,r=Math.sqrt(1-e**2);return this.x=r*Math.cos(n),this.y=r*Math.sin(n),this.z=e,this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z}}const dG=new Ce,eEe=new Gb;class hE{constructor(e=new Ce(1/0,1/0,1/0),n=new Ce(-1/0,-1/0,-1/0)){this.isBox3=!0,this.min=e,this.max=n}set(e,n){return this.min.copy(e),this.max.copy(n),this}setFromArray(e){let n=1/0,r=1/0,i=1/0,o=-1/0,s=-1/0,a=-1/0;for(let l=0,c=e.length;lo&&(o=u),f>s&&(s=f),d>a&&(a=d)}return this.min.set(n,r,i),this.max.set(o,s,a),this}setFromBufferAttribute(e){let n=1/0,r=1/0,i=1/0,o=-1/0,s=-1/0,a=-1/0;for(let l=0,c=e.count;lo&&(o=u),f>s&&(s=f),d>a&&(a=d)}return this.min.set(n,r,i),this.max.set(o,s,a),this}setFromPoints(e){this.makeEmpty();for(let n=0,r=e.length;nthis.max.x||e.ythis.max.y||e.zthis.max.z)}containsBox(e){return this.min.x<=e.min.x&&e.max.x<=this.max.x&&this.min.y<=e.min.y&&e.max.y<=this.max.y&&this.min.z<=e.min.z&&e.max.z<=this.max.z}getParameter(e,n){return n.set((e.x-this.min.x)/(this.max.x-this.min.x),(e.y-this.min.y)/(this.max.y-this.min.y),(e.z-this.min.z)/(this.max.z-this.min.z))}intersectsBox(e){return!(e.max.xthis.max.x||e.max.ythis.max.y||e.max.zthis.max.z)}intersectsSphere(e){return this.clampPoint(e.center,M0),M0.distanceToSquared(e.center)<=e.radius*e.radius}intersectsPlane(e){let n,r;return e.normal.x>0?(n=e.normal.x*this.min.x,r=e.normal.x*this.max.x):(n=e.normal.x*this.max.x,r=e.normal.x*this.min.x),e.normal.y>0?(n+=e.normal.y*this.min.y,r+=e.normal.y*this.max.y):(n+=e.normal.y*this.max.y,r+=e.normal.y*this.min.y),e.normal.z>0?(n+=e.normal.z*this.min.z,r+=e.normal.z*this.max.z):(n+=e.normal.z*this.max.z,r+=e.normal.z*this.min.z),n<=-e.constant&&r>=-e.constant}intersectsTriangle(e){if(this.isEmpty())return!1;this.getCenter(I2),u$.subVectors(this.max,I2),gw.subVectors(e.a,I2),mw.subVectors(e.b,I2),vw.subVectors(e.c,I2),xm.subVectors(mw,gw),bm.subVectors(vw,mw),R0.subVectors(gw,vw);let n=[0,-xm.z,xm.y,0,-bm.z,bm.y,0,-R0.z,R0.y,xm.z,0,-xm.x,bm.z,0,-bm.x,R0.z,0,-R0.x,-xm.y,xm.x,0,-bm.y,bm.x,0,-R0.y,R0.x,0];return!pG(n,gw,mw,vw,u$)||(n=[1,0,0,0,1,0,0,0,1],!pG(n,gw,mw,vw,u$))?!1:(f$.crossVectors(xm,bm),n=[f$.x,f$.y,f$.z],pG(n,gw,mw,vw,u$))}clampPoint(e,n){return n.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return M0.copy(e).clamp(this.min,this.max).sub(e).length()}getBoundingSphere(e){return this.getCenter(e.center),e.radius=this.getSize(M0).length()*.5,e}intersect(e){return this.min.max(e.min),this.max.min(e.max),this.isEmpty()&&this.makeEmpty(),this}union(e){return this.min.min(e.min),this.max.max(e.max),this}applyMatrix4(e){return this.isEmpty()?this:(dp[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(e),dp[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(e),dp[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(e),dp[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(e),dp[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(e),dp[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(e),dp[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(e),dp[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(e),this.setFromPoints(dp),this)}translate(e){return this.min.add(e),this.max.add(e),this}equals(e){return e.min.equals(this.min)&&e.max.equals(this.max)}}const dp=[new Ce,new Ce,new Ce,new Ce,new Ce,new Ce,new Ce,new Ce],M0=new Ce,hG=new hE,gw=new Ce,mw=new Ce,vw=new Ce,xm=new Ce,bm=new Ce,R0=new Ce,I2=new Ce,u$=new Ce,f$=new Ce,D0=new Ce;function pG(t,e,n,r,i){for(let o=0,s=t.length-3;o<=s;o+=3){D0.fromArray(t,o);const a=i.x*Math.abs(D0.x)+i.y*Math.abs(D0.y)+i.z*Math.abs(D0.z),l=e.dot(D0),c=n.dot(D0),u=r.dot(D0);if(Math.max(-Math.max(l,c,u),Math.min(l,c,u))>a)return!1}return!0}const qBn=new hE,tEe=new Ce,d$=new Ce,gG=new Ce;class s8{constructor(e=new Ce,n=-1){this.center=e,this.radius=n}set(e,n){return this.center.copy(e),this.radius=n,this}setFromPoints(e,n){const r=this.center;n!==void 0?r.copy(n):qBn.setFromPoints(e).getCenter(r);let i=0;for(let o=0,s=e.length;othis.radius*this.radius&&(n.sub(this.center).normalize(),n.multiplyScalar(this.radius).add(this.center)),n}getBoundingBox(e){return this.isEmpty()?(e.makeEmpty(),e):(e.set(this.center,this.center),e.expandByScalar(this.radius),e)}applyMatrix4(e){return this.center.applyMatrix4(e),this.radius=this.radius*e.getMaxScaleOnAxis(),this}translate(e){return this.center.add(e),this}expandByPoint(e){gG.subVectors(e,this.center);const n=gG.lengthSq();if(n>this.radius*this.radius){const r=Math.sqrt(n),i=(r-this.radius)*.5;this.center.add(gG.multiplyScalar(i/r)),this.radius+=i}return this}union(e){return this.center.equals(e.center)===!0?d$.set(0,0,1).multiplyScalar(e.radius):d$.subVectors(e.center,this.center).normalize().multiplyScalar(e.radius),this.expandByPoint(tEe.copy(e.center).add(d$)),this.expandByPoint(tEe.copy(e.center).sub(d$)),this}equals(e){return e.center.equals(this.center)&&e.radius===this.radius}clone(){return new this.constructor().copy(this)}}const hp=new Ce,mG=new Ce,h$=new Ce,wm=new Ce,vG=new Ce,p$=new Ce,yG=new Ce;class YXe{constructor(e=new Ce,n=new Ce(0,0,-1)){this.origin=e,this.direction=n}set(e,n){return this.origin.copy(e),this.direction.copy(n),this}copy(e){return this.origin.copy(e.origin),this.direction.copy(e.direction),this}at(e,n){return n.copy(this.direction).multiplyScalar(e).add(this.origin)}lookAt(e){return this.direction.copy(e).sub(this.origin).normalize(),this}recast(e){return this.origin.copy(this.at(e,hp)),this}closestPointToPoint(e,n){n.subVectors(e,this.origin);const r=n.dot(this.direction);return r<0?n.copy(this.origin):n.copy(this.direction).multiplyScalar(r).add(this.origin)}distanceToPoint(e){return Math.sqrt(this.distanceSqToPoint(e))}distanceSqToPoint(e){const n=hp.subVectors(e,this.origin).dot(this.direction);return n<0?this.origin.distanceToSquared(e):(hp.copy(this.direction).multiplyScalar(n).add(this.origin),hp.distanceToSquared(e))}distanceSqToSegment(e,n,r,i){mG.copy(e).add(n).multiplyScalar(.5),h$.copy(n).sub(e).normalize(),wm.copy(this.origin).sub(mG);const o=e.distanceTo(n)*.5,s=-this.direction.dot(h$),a=wm.dot(this.direction),l=-wm.dot(h$),c=wm.lengthSq(),u=Math.abs(1-s*s);let f,d,h,p;if(u>0)if(f=s*l-a,d=s*a-l,p=o*u,f>=0)if(d>=-p)if(d<=p){const g=1/u;f*=g,d*=g,h=f*(f+s*d+2*a)+d*(s*f+d+2*l)+c}else d=o,f=Math.max(0,-(s*d+a)),h=-f*f+d*(d+2*l)+c;else d=-o,f=Math.max(0,-(s*d+a)),h=-f*f+d*(d+2*l)+c;else d<=-p?(f=Math.max(0,-(-s*o+a)),d=f>0?-o:Math.min(Math.max(-o,-l),o),h=-f*f+d*(d+2*l)+c):d<=p?(f=0,d=Math.min(Math.max(-o,-l),o),h=d*(d+2*l)+c):(f=Math.max(0,-(s*o+a)),d=f>0?o:Math.min(Math.max(-o,-l),o),h=-f*f+d*(d+2*l)+c);else d=s>0?-o:o,f=Math.max(0,-(s*d+a)),h=-f*f+d*(d+2*l)+c;return r&&r.copy(this.direction).multiplyScalar(f).add(this.origin),i&&i.copy(h$).multiplyScalar(d).add(mG),h}intersectSphere(e,n){hp.subVectors(e.center,this.origin);const r=hp.dot(this.direction),i=hp.dot(hp)-r*r,o=e.radius*e.radius;if(i>o)return null;const s=Math.sqrt(o-i),a=r-s,l=r+s;return a<0&&l<0?null:a<0?this.at(l,n):this.at(a,n)}intersectsSphere(e){return this.distanceSqToPoint(e.center)<=e.radius*e.radius}distanceToPlane(e){const n=e.normal.dot(this.direction);if(n===0)return e.distanceToPoint(this.origin)===0?0:null;const r=-(this.origin.dot(e.normal)+e.constant)/n;return r>=0?r:null}intersectPlane(e,n){const r=this.distanceToPlane(e);return r===null?null:this.at(r,n)}intersectsPlane(e){const n=e.distanceToPoint(this.origin);return n===0||e.normal.dot(this.direction)*n<0}intersectBox(e,n){let r,i,o,s,a,l;const c=1/this.direction.x,u=1/this.direction.y,f=1/this.direction.z,d=this.origin;return c>=0?(r=(e.min.x-d.x)*c,i=(e.max.x-d.x)*c):(r=(e.max.x-d.x)*c,i=(e.min.x-d.x)*c),u>=0?(o=(e.min.y-d.y)*u,s=(e.max.y-d.y)*u):(o=(e.max.y-d.y)*u,s=(e.min.y-d.y)*u),r>s||o>i||((o>r||r!==r)&&(r=o),(s=0?(a=(e.min.z-d.z)*f,l=(e.max.z-d.z)*f):(a=(e.max.z-d.z)*f,l=(e.min.z-d.z)*f),r>l||a>i)||((a>r||r!==r)&&(r=a),(l=0?r:i,n)}intersectsBox(e){return this.intersectBox(e,hp)!==null}intersectTriangle(e,n,r,i,o){vG.subVectors(n,e),p$.subVectors(r,e),yG.crossVectors(vG,p$);let s=this.direction.dot(yG),a;if(s>0){if(i)return null;a=1}else if(s<0)a=-1,s=-s;else return null;wm.subVectors(this.origin,e);const l=a*this.direction.dot(p$.crossVectors(wm,p$));if(l<0)return null;const c=a*this.direction.dot(vG.cross(wm));if(c<0||l+c>s)return null;const u=-a*wm.dot(yG);return u<0?null:this.at(u/s,o)}applyMatrix4(e){return this.origin.applyMatrix4(e),this.direction.transformDirection(e),this}equals(e){return e.origin.equals(this.origin)&&e.direction.equals(this.direction)}clone(){return new this.constructor().copy(this)}}class Wr{constructor(){Wr.prototype.isMatrix4=!0,this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]}set(e,n,r,i,o,s,a,l,c,u,f,d,h,p,g,m){const v=this.elements;return v[0]=e,v[4]=n,v[8]=r,v[12]=i,v[1]=o,v[5]=s,v[9]=a,v[13]=l,v[2]=c,v[6]=u,v[10]=f,v[14]=d,v[3]=h,v[7]=p,v[11]=g,v[15]=m,this}identity(){return this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1),this}clone(){return new Wr().fromArray(this.elements)}copy(e){const n=this.elements,r=e.elements;return n[0]=r[0],n[1]=r[1],n[2]=r[2],n[3]=r[3],n[4]=r[4],n[5]=r[5],n[6]=r[6],n[7]=r[7],n[8]=r[8],n[9]=r[9],n[10]=r[10],n[11]=r[11],n[12]=r[12],n[13]=r[13],n[14]=r[14],n[15]=r[15],this}copyPosition(e){const n=this.elements,r=e.elements;return n[12]=r[12],n[13]=r[13],n[14]=r[14],this}setFromMatrix3(e){const n=e.elements;return this.set(n[0],n[3],n[6],0,n[1],n[4],n[7],0,n[2],n[5],n[8],0,0,0,0,1),this}extractBasis(e,n,r){return e.setFromMatrixColumn(this,0),n.setFromMatrixColumn(this,1),r.setFromMatrixColumn(this,2),this}makeBasis(e,n,r){return this.set(e.x,n.x,r.x,0,e.y,n.y,r.y,0,e.z,n.z,r.z,0,0,0,0,1),this}extractRotation(e){const n=this.elements,r=e.elements,i=1/yw.setFromMatrixColumn(e,0).length(),o=1/yw.setFromMatrixColumn(e,1).length(),s=1/yw.setFromMatrixColumn(e,2).length();return n[0]=r[0]*i,n[1]=r[1]*i,n[2]=r[2]*i,n[3]=0,n[4]=r[4]*o,n[5]=r[5]*o,n[6]=r[6]*o,n[7]=0,n[8]=r[8]*s,n[9]=r[9]*s,n[10]=r[10]*s,n[11]=0,n[12]=0,n[13]=0,n[14]=0,n[15]=1,this}makeRotationFromEuler(e){const n=this.elements,r=e.x,i=e.y,o=e.z,s=Math.cos(r),a=Math.sin(r),l=Math.cos(i),c=Math.sin(i),u=Math.cos(o),f=Math.sin(o);if(e.order==="XYZ"){const d=s*u,h=s*f,p=a*u,g=a*f;n[0]=l*u,n[4]=-l*f,n[8]=c,n[1]=h+p*c,n[5]=d-g*c,n[9]=-a*l,n[2]=g-d*c,n[6]=p+h*c,n[10]=s*l}else if(e.order==="YXZ"){const d=l*u,h=l*f,p=c*u,g=c*f;n[0]=d+g*a,n[4]=p*a-h,n[8]=s*c,n[1]=s*f,n[5]=s*u,n[9]=-a,n[2]=h*a-p,n[6]=g+d*a,n[10]=s*l}else if(e.order==="ZXY"){const d=l*u,h=l*f,p=c*u,g=c*f;n[0]=d-g*a,n[4]=-s*f,n[8]=p+h*a,n[1]=h+p*a,n[5]=s*u,n[9]=g-d*a,n[2]=-s*c,n[6]=a,n[10]=s*l}else if(e.order==="ZYX"){const d=s*u,h=s*f,p=a*u,g=a*f;n[0]=l*u,n[4]=p*c-h,n[8]=d*c+g,n[1]=l*f,n[5]=g*c+d,n[9]=h*c-p,n[2]=-c,n[6]=a*l,n[10]=s*l}else if(e.order==="YZX"){const d=s*l,h=s*c,p=a*l,g=a*c;n[0]=l*u,n[4]=g-d*f,n[8]=p*f+h,n[1]=f,n[5]=s*u,n[9]=-a*u,n[2]=-c*u,n[6]=h*f+p,n[10]=d-g*f}else if(e.order==="XZY"){const d=s*l,h=s*c,p=a*l,g=a*c;n[0]=l*u,n[4]=-f,n[8]=c*u,n[1]=d*f+g,n[5]=s*u,n[9]=h*f-p,n[2]=p*f-h,n[6]=a*u,n[10]=g*f+d}return n[3]=0,n[7]=0,n[11]=0,n[12]=0,n[13]=0,n[14]=0,n[15]=1,this}makeRotationFromQuaternion(e){return this.compose(XBn,e,YBn)}lookAt(e,n,r){const i=this.elements;return Fl.subVectors(e,n),Fl.lengthSq()===0&&(Fl.z=1),Fl.normalize(),_m.crossVectors(r,Fl),_m.lengthSq()===0&&(Math.abs(r.z)===1?Fl.x+=1e-4:Fl.z+=1e-4,Fl.normalize(),_m.crossVectors(r,Fl)),_m.normalize(),g$.crossVectors(Fl,_m),i[0]=_m.x,i[4]=g$.x,i[8]=Fl.x,i[1]=_m.y,i[5]=g$.y,i[9]=Fl.y,i[2]=_m.z,i[6]=g$.z,i[10]=Fl.z,this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,n){const r=e.elements,i=n.elements,o=this.elements,s=r[0],a=r[4],l=r[8],c=r[12],u=r[1],f=r[5],d=r[9],h=r[13],p=r[2],g=r[6],m=r[10],v=r[14],y=r[3],x=r[7],b=r[11],w=r[15],_=i[0],S=i[4],O=i[8],k=i[12],E=i[1],P=i[5],A=i[9],R=i[13],T=i[2],M=i[6],I=i[10],j=i[14],N=i[3],z=i[7],L=i[11],B=i[15];return o[0]=s*_+a*E+l*T+c*N,o[4]=s*S+a*P+l*M+c*z,o[8]=s*O+a*A+l*I+c*L,o[12]=s*k+a*R+l*j+c*B,o[1]=u*_+f*E+d*T+h*N,o[5]=u*S+f*P+d*M+h*z,o[9]=u*O+f*A+d*I+h*L,o[13]=u*k+f*R+d*j+h*B,o[2]=p*_+g*E+m*T+v*N,o[6]=p*S+g*P+m*M+v*z,o[10]=p*O+g*A+m*I+v*L,o[14]=p*k+g*R+m*j+v*B,o[3]=y*_+x*E+b*T+w*N,o[7]=y*S+x*P+b*M+w*z,o[11]=y*O+x*A+b*I+w*L,o[15]=y*k+x*R+b*j+w*B,this}multiplyScalar(e){const n=this.elements;return n[0]*=e,n[4]*=e,n[8]*=e,n[12]*=e,n[1]*=e,n[5]*=e,n[9]*=e,n[13]*=e,n[2]*=e,n[6]*=e,n[10]*=e,n[14]*=e,n[3]*=e,n[7]*=e,n[11]*=e,n[15]*=e,this}determinant(){const e=this.elements,n=e[0],r=e[4],i=e[8],o=e[12],s=e[1],a=e[5],l=e[9],c=e[13],u=e[2],f=e[6],d=e[10],h=e[14],p=e[3],g=e[7],m=e[11],v=e[15];return p*(+o*l*f-i*c*f-o*a*d+r*c*d+i*a*h-r*l*h)+g*(+n*l*h-n*c*d+o*s*d-i*s*h+i*c*u-o*l*u)+m*(+n*c*f-n*a*h-o*s*f+r*s*h+o*a*u-r*c*u)+v*(-i*a*u-n*l*f+n*a*d+i*s*f-r*s*d+r*l*u)}transpose(){const e=this.elements;let n;return n=e[1],e[1]=e[4],e[4]=n,n=e[2],e[2]=e[8],e[8]=n,n=e[6],e[6]=e[9],e[9]=n,n=e[3],e[3]=e[12],e[12]=n,n=e[7],e[7]=e[13],e[13]=n,n=e[11],e[11]=e[14],e[14]=n,this}setPosition(e,n,r){const i=this.elements;return e.isVector3?(i[12]=e.x,i[13]=e.y,i[14]=e.z):(i[12]=e,i[13]=n,i[14]=r),this}invert(){const e=this.elements,n=e[0],r=e[1],i=e[2],o=e[3],s=e[4],a=e[5],l=e[6],c=e[7],u=e[8],f=e[9],d=e[10],h=e[11],p=e[12],g=e[13],m=e[14],v=e[15],y=f*m*c-g*d*c+g*l*h-a*m*h-f*l*v+a*d*v,x=p*d*c-u*m*c-p*l*h+s*m*h+u*l*v-s*d*v,b=u*g*c-p*f*c+p*a*h-s*g*h-u*a*v+s*f*v,w=p*f*l-u*g*l-p*a*d+s*g*d+u*a*m-s*f*m,_=n*y+r*x+i*b+o*w;if(_===0)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);const S=1/_;return e[0]=y*S,e[1]=(g*d*o-f*m*o-g*i*h+r*m*h+f*i*v-r*d*v)*S,e[2]=(a*m*o-g*l*o+g*i*c-r*m*c-a*i*v+r*l*v)*S,e[3]=(f*l*o-a*d*o-f*i*c+r*d*c+a*i*h-r*l*h)*S,e[4]=x*S,e[5]=(u*m*o-p*d*o+p*i*h-n*m*h-u*i*v+n*d*v)*S,e[6]=(p*l*o-s*m*o-p*i*c+n*m*c+s*i*v-n*l*v)*S,e[7]=(s*d*o-u*l*o+u*i*c-n*d*c-s*i*h+n*l*h)*S,e[8]=b*S,e[9]=(p*f*o-u*g*o-p*r*h+n*g*h+u*r*v-n*f*v)*S,e[10]=(s*g*o-p*a*o+p*r*c-n*g*c-s*r*v+n*a*v)*S,e[11]=(u*a*o-s*f*o-u*r*c+n*f*c+s*r*h-n*a*h)*S,e[12]=w*S,e[13]=(u*g*i-p*f*i+p*r*d-n*g*d-u*r*m+n*f*m)*S,e[14]=(p*a*i-s*g*i-p*r*l+n*g*l+s*r*m-n*a*m)*S,e[15]=(s*f*i-u*a*i+u*r*l-n*f*l-s*r*d+n*a*d)*S,this}scale(e){const n=this.elements,r=e.x,i=e.y,o=e.z;return n[0]*=r,n[4]*=i,n[8]*=o,n[1]*=r,n[5]*=i,n[9]*=o,n[2]*=r,n[6]*=i,n[10]*=o,n[3]*=r,n[7]*=i,n[11]*=o,this}getMaxScaleOnAxis(){const e=this.elements,n=e[0]*e[0]+e[1]*e[1]+e[2]*e[2],r=e[4]*e[4]+e[5]*e[5]+e[6]*e[6],i=e[8]*e[8]+e[9]*e[9]+e[10]*e[10];return Math.sqrt(Math.max(n,r,i))}makeTranslation(e,n,r){return this.set(1,0,0,e,0,1,0,n,0,0,1,r,0,0,0,1),this}makeRotationX(e){const n=Math.cos(e),r=Math.sin(e);return this.set(1,0,0,0,0,n,-r,0,0,r,n,0,0,0,0,1),this}makeRotationY(e){const n=Math.cos(e),r=Math.sin(e);return this.set(n,0,r,0,0,1,0,0,-r,0,n,0,0,0,0,1),this}makeRotationZ(e){const n=Math.cos(e),r=Math.sin(e);return this.set(n,-r,0,0,r,n,0,0,0,0,1,0,0,0,0,1),this}makeRotationAxis(e,n){const r=Math.cos(n),i=Math.sin(n),o=1-r,s=e.x,a=e.y,l=e.z,c=o*s,u=o*a;return this.set(c*s+r,c*a-i*l,c*l+i*a,0,c*a+i*l,u*a+r,u*l-i*s,0,c*l-i*a,u*l+i*s,o*l*l+r,0,0,0,0,1),this}makeScale(e,n,r){return this.set(e,0,0,0,0,n,0,0,0,0,r,0,0,0,0,1),this}makeShear(e,n,r,i,o,s){return this.set(1,r,o,0,e,1,s,0,n,i,1,0,0,0,0,1),this}compose(e,n,r){const i=this.elements,o=n._x,s=n._y,a=n._z,l=n._w,c=o+o,u=s+s,f=a+a,d=o*c,h=o*u,p=o*f,g=s*u,m=s*f,v=a*f,y=l*c,x=l*u,b=l*f,w=r.x,_=r.y,S=r.z;return i[0]=(1-(g+v))*w,i[1]=(h+b)*w,i[2]=(p-x)*w,i[3]=0,i[4]=(h-b)*_,i[5]=(1-(d+v))*_,i[6]=(m+y)*_,i[7]=0,i[8]=(p+x)*S,i[9]=(m-y)*S,i[10]=(1-(d+g))*S,i[11]=0,i[12]=e.x,i[13]=e.y,i[14]=e.z,i[15]=1,this}decompose(e,n,r){const i=this.elements;let o=yw.set(i[0],i[1],i[2]).length();const s=yw.set(i[4],i[5],i[6]).length(),a=yw.set(i[8],i[9],i[10]).length();this.determinant()<0&&(o=-o),e.x=i[12],e.y=i[13],e.z=i[14],ef.copy(this);const c=1/o,u=1/s,f=1/a;return ef.elements[0]*=c,ef.elements[1]*=c,ef.elements[2]*=c,ef.elements[4]*=u,ef.elements[5]*=u,ef.elements[6]*=u,ef.elements[8]*=f,ef.elements[9]*=f,ef.elements[10]*=f,n.setFromRotationMatrix(ef),r.x=o,r.y=s,r.z=a,this}makePerspective(e,n,r,i,o,s){const a=this.elements,l=2*o/(n-e),c=2*o/(r-i),u=(n+e)/(n-e),f=(r+i)/(r-i),d=-(s+o)/(s-o),h=-2*s*o/(s-o);return a[0]=l,a[4]=0,a[8]=u,a[12]=0,a[1]=0,a[5]=c,a[9]=f,a[13]=0,a[2]=0,a[6]=0,a[10]=d,a[14]=h,a[3]=0,a[7]=0,a[11]=-1,a[15]=0,this}makeOrthographic(e,n,r,i,o,s){const a=this.elements,l=1/(n-e),c=1/(r-i),u=1/(s-o),f=(n+e)*l,d=(r+i)*c,h=(s+o)*u;return a[0]=2*l,a[4]=0,a[8]=0,a[12]=-f,a[1]=0,a[5]=2*c,a[9]=0,a[13]=-d,a[2]=0,a[6]=0,a[10]=-2*u,a[14]=-h,a[3]=0,a[7]=0,a[11]=0,a[15]=1,this}equals(e){const n=this.elements,r=e.elements;for(let i=0;i<16;i++)if(n[i]!==r[i])return!1;return!0}fromArray(e,n=0){for(let r=0;r<16;r++)this.elements[r]=e[r+n];return this}toArray(e=[],n=0){const r=this.elements;return e[n]=r[0],e[n+1]=r[1],e[n+2]=r[2],e[n+3]=r[3],e[n+4]=r[4],e[n+5]=r[5],e[n+6]=r[6],e[n+7]=r[7],e[n+8]=r[8],e[n+9]=r[9],e[n+10]=r[10],e[n+11]=r[11],e[n+12]=r[12],e[n+13]=r[13],e[n+14]=r[14],e[n+15]=r[15],e}}const yw=new Ce,ef=new Wr,XBn=new Ce(0,0,0),YBn=new Ce(1,1,1),_m=new Ce,g$=new Ce,Fl=new Ce,nEe=new Wr,rEe=new Gb;class wD{constructor(e=0,n=0,r=0,i=wD.DefaultOrder){this.isEuler=!0,this._x=e,this._y=n,this._z=r,this._order=i}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get order(){return this._order}set order(e){this._order=e,this._onChangeCallback()}set(e,n,r,i=this._order){return this._x=e,this._y=n,this._z=r,this._order=i,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._order)}copy(e){return this._x=e._x,this._y=e._y,this._z=e._z,this._order=e._order,this._onChangeCallback(),this}setFromRotationMatrix(e,n=this._order,r=!0){const i=e.elements,o=i[0],s=i[4],a=i[8],l=i[1],c=i[5],u=i[9],f=i[2],d=i[6],h=i[10];switch(n){case"XYZ":this._y=Math.asin(tl(a,-1,1)),Math.abs(a)<.9999999?(this._x=Math.atan2(-u,h),this._z=Math.atan2(-s,o)):(this._x=Math.atan2(d,c),this._z=0);break;case"YXZ":this._x=Math.asin(-tl(u,-1,1)),Math.abs(u)<.9999999?(this._y=Math.atan2(a,h),this._z=Math.atan2(l,c)):(this._y=Math.atan2(-f,o),this._z=0);break;case"ZXY":this._x=Math.asin(tl(d,-1,1)),Math.abs(d)<.9999999?(this._y=Math.atan2(-f,h),this._z=Math.atan2(-s,c)):(this._y=0,this._z=Math.atan2(l,o));break;case"ZYX":this._y=Math.asin(-tl(f,-1,1)),Math.abs(f)<.9999999?(this._x=Math.atan2(d,h),this._z=Math.atan2(l,o)):(this._x=0,this._z=Math.atan2(-s,c));break;case"YZX":this._z=Math.asin(tl(l,-1,1)),Math.abs(l)<.9999999?(this._x=Math.atan2(-u,c),this._y=Math.atan2(-f,o)):(this._x=0,this._y=Math.atan2(a,h));break;case"XZY":this._z=Math.asin(-tl(s,-1,1)),Math.abs(s)<.9999999?(this._x=Math.atan2(d,c),this._y=Math.atan2(a,o)):(this._x=Math.atan2(-u,h),this._y=0);break;default:console.warn("THREE.Euler: .setFromRotationMatrix() encountered an unknown order: "+n)}return this._order=n,r===!0&&this._onChangeCallback(),this}setFromQuaternion(e,n,r){return nEe.makeRotationFromQuaternion(e),this.setFromRotationMatrix(nEe,n,r)}setFromVector3(e,n=this._order){return this.set(e.x,e.y,e.z,n)}reorder(e){return rEe.setFromEuler(this),this.setFromQuaternion(rEe,e)}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._order===this._order}fromArray(e){return this._x=e[0],this._y=e[1],this._z=e[2],e[3]!==void 0&&(this._order=e[3]),this._onChangeCallback(),this}toArray(e=[],n=0){return e[n]=this._x,e[n+1]=this._y,e[n+2]=this._z,e[n+3]=this._order,e}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._order}toVector3(){console.error("THREE.Euler: .toVector3() has been removed. Use Vector3.setFromEuler() instead")}}wD.DefaultOrder="XYZ";wD.RotationOrders=["XYZ","YZX","ZXY","XZY","YXZ","ZYX"];class QXe{constructor(){this.mask=1}set(e){this.mask=(1<>>0}enable(e){this.mask|=1<1){for(let n=0;n1){for(let r=0;r0){i.children=[];for(let a=0;a0){i.animations=[];for(let a=0;a0&&(r.geometries=a),l.length>0&&(r.materials=l),c.length>0&&(r.textures=c),u.length>0&&(r.images=u),f.length>0&&(r.shapes=f),d.length>0&&(r.skeletons=d),h.length>0&&(r.animations=h),p.length>0&&(r.nodes=p)}return r.object=i,r;function s(a){const l=[];for(const c in a){const u=a[c];delete u.metadata,l.push(u)}return l}}clone(e){return new this.constructor().copy(this,e)}copy(e,n=!0){if(this.name=e.name,this.up.copy(e.up),this.position.copy(e.position),this.rotation.order=e.rotation.order,this.quaternion.copy(e.quaternion),this.scale.copy(e.scale),this.matrix.copy(e.matrix),this.matrixWorld.copy(e.matrixWorld),this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrixWorldNeedsUpdate=e.matrixWorldNeedsUpdate,this.matrixWorldAutoUpdate=e.matrixWorldAutoUpdate,this.layers.mask=e.layers.mask,this.visible=e.visible,this.castShadow=e.castShadow,this.receiveShadow=e.receiveShadow,this.frustumCulled=e.frustumCulled,this.renderOrder=e.renderOrder,this.userData=JSON.parse(JSON.stringify(e.userData)),n===!0)for(let r=0;r0?i.multiplyScalar(1/Math.sqrt(o)):i.set(0,0,0)}static getBarycoord(e,n,r,i,o){tf.subVectors(i,n),gp.subVectors(r,n),xG.subVectors(e,n);const s=tf.dot(tf),a=tf.dot(gp),l=tf.dot(xG),c=gp.dot(gp),u=gp.dot(xG),f=s*c-a*a;if(f===0)return o.set(-2,-1,-1);const d=1/f,h=(c*l-a*u)*d,p=(s*u-a*l)*d;return o.set(1-h-p,p,h)}static containsPoint(e,n,r,i){return this.getBarycoord(e,n,r,i,mp),mp.x>=0&&mp.y>=0&&mp.x+mp.y<=1}static getUV(e,n,r,i,o,s,a,l){return this.getBarycoord(e,n,r,i,mp),l.set(0,0),l.addScaledVector(o,mp.x),l.addScaledVector(s,mp.y),l.addScaledVector(a,mp.z),l}static isFrontFacing(e,n,r,i){return tf.subVectors(r,n),gp.subVectors(e,n),tf.cross(gp).dot(i)<0}set(e,n,r){return this.a.copy(e),this.b.copy(n),this.c.copy(r),this}setFromPointsAndIndices(e,n,r,i){return this.a.copy(e[n]),this.b.copy(e[r]),this.c.copy(e[i]),this}setFromAttributeAndIndices(e,n,r,i){return this.a.fromBufferAttribute(e,n),this.b.fromBufferAttribute(e,r),this.c.fromBufferAttribute(e,i),this}clone(){return new this.constructor().copy(this)}copy(e){return this.a.copy(e.a),this.b.copy(e.b),this.c.copy(e.c),this}getArea(){return tf.subVectors(this.c,this.b),gp.subVectors(this.a,this.b),tf.cross(gp).length()*.5}getMidpoint(e){return e.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(e){return Bp.getNormal(this.a,this.b,this.c,e)}getPlane(e){return e.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(e,n){return Bp.getBarycoord(e,this.a,this.b,this.c,n)}getUV(e,n,r,i,o){return Bp.getUV(e,this.a,this.b,this.c,n,r,i,o)}containsPoint(e){return Bp.containsPoint(e,this.a,this.b,this.c)}isFrontFacing(e){return Bp.isFrontFacing(this.a,this.b,this.c,e)}intersectsBox(e){return e.intersectsTriangle(this)}closestPointToPoint(e,n){const r=this.a,i=this.b,o=this.c;let s,a;bw.subVectors(i,r),ww.subVectors(o,r),bG.subVectors(e,r);const l=bw.dot(bG),c=ww.dot(bG);if(l<=0&&c<=0)return n.copy(r);wG.subVectors(e,i);const u=bw.dot(wG),f=ww.dot(wG);if(u>=0&&f<=u)return n.copy(i);const d=l*f-u*c;if(d<=0&&l>=0&&u<=0)return s=l/(l-u),n.copy(r).addScaledVector(bw,s);_G.subVectors(e,o);const h=bw.dot(_G),p=ww.dot(_G);if(p>=0&&h<=p)return n.copy(o);const g=h*c-l*p;if(g<=0&&c>=0&&p<=0)return a=c/(c-p),n.copy(r).addScaledVector(ww,a);const m=u*p-h*f;if(m<=0&&f-u>=0&&h-p>=0)return cEe.subVectors(o,i),a=(f-u)/(f-u+(h-p)),n.copy(i).addScaledVector(cEe,a);const v=1/(m+g+d);return s=g*v,a=d*v,n.copy(r).addScaledVector(bw,s).addScaledVector(ww,a)}equals(e){return e.a.equals(this.a)&&e.b.equals(this.b)&&e.c.equals(this.c)}}let e6n=0;class _D extends M1{constructor(){super(),this.isMaterial=!0,Object.defineProperty(this,"id",{value:e6n++}),this.uuid=bD(),this.name="",this.type="Material",this.blending=oS,this.side=NC,this.vertexColors=!1,this.opacity=1,this.transparent=!1,this.blendSrc=FXe,this.blendDst=NXe,this.blendEquation=jw,this.blendSrcAlpha=null,this.blendDstAlpha=null,this.blendEquationAlpha=null,this.depthFunc=YZ,this.depthTest=!0,this.depthWrite=!0,this.stencilWriteMask=255,this.stencilFunc=VBn,this.stencilRef=0,this.stencilFuncMask=255,this.stencilFail=sG,this.stencilZFail=sG,this.stencilZPass=sG,this.stencilWrite=!1,this.clippingPlanes=null,this.clipIntersection=!1,this.clipShadows=!1,this.shadowSide=null,this.colorWrite=!0,this.precision=null,this.polygonOffset=!1,this.polygonOffsetFactor=0,this.polygonOffsetUnits=0,this.dithering=!1,this.alphaToCoverage=!1,this.premultipliedAlpha=!1,this.visible=!0,this.toneMapped=!0,this.userData={},this.version=0,this._alphaTest=0}get alphaTest(){return this._alphaTest}set alphaTest(e){this._alphaTest>0!=e>0&&this.version++,this._alphaTest=e}onBuild(){}onBeforeRender(){}onBeforeCompile(){}customProgramCacheKey(){return this.onBeforeCompile.toString()}setValues(e){if(e!==void 0)for(const n in e){const r=e[n];if(r===void 0){console.warn("THREE.Material: '"+n+"' parameter is undefined.");continue}const i=this[n];if(i===void 0){console.warn("THREE."+this.type+": '"+n+"' is not a property of this material.");continue}i&&i.isColor?i.set(r):i&&i.isVector3&&r&&r.isVector3?i.copy(r):this[n]=r}}toJSON(e){const n=e===void 0||typeof e=="string";n&&(e={textures:{},images:{}});const r={metadata:{version:4.5,type:"Material",generator:"Material.toJSON"}};r.uuid=this.uuid,r.type=this.type,this.name!==""&&(r.name=this.name),this.color&&this.color.isColor&&(r.color=this.color.getHex()),this.roughness!==void 0&&(r.roughness=this.roughness),this.metalness!==void 0&&(r.metalness=this.metalness),this.sheen!==void 0&&(r.sheen=this.sheen),this.sheenColor&&this.sheenColor.isColor&&(r.sheenColor=this.sheenColor.getHex()),this.sheenRoughness!==void 0&&(r.sheenRoughness=this.sheenRoughness),this.emissive&&this.emissive.isColor&&(r.emissive=this.emissive.getHex()),this.emissiveIntensity&&this.emissiveIntensity!==1&&(r.emissiveIntensity=this.emissiveIntensity),this.specular&&this.specular.isColor&&(r.specular=this.specular.getHex()),this.specularIntensity!==void 0&&(r.specularIntensity=this.specularIntensity),this.specularColor&&this.specularColor.isColor&&(r.specularColor=this.specularColor.getHex()),this.shininess!==void 0&&(r.shininess=this.shininess),this.clearcoat!==void 0&&(r.clearcoat=this.clearcoat),this.clearcoatRoughness!==void 0&&(r.clearcoatRoughness=this.clearcoatRoughness),this.clearcoatMap&&this.clearcoatMap.isTexture&&(r.clearcoatMap=this.clearcoatMap.toJSON(e).uuid),this.clearcoatRoughnessMap&&this.clearcoatRoughnessMap.isTexture&&(r.clearcoatRoughnessMap=this.clearcoatRoughnessMap.toJSON(e).uuid),this.clearcoatNormalMap&&this.clearcoatNormalMap.isTexture&&(r.clearcoatNormalMap=this.clearcoatNormalMap.toJSON(e).uuid,r.clearcoatNormalScale=this.clearcoatNormalScale.toArray()),this.iridescence!==void 0&&(r.iridescence=this.iridescence),this.iridescenceIOR!==void 0&&(r.iridescenceIOR=this.iridescenceIOR),this.iridescenceThicknessRange!==void 0&&(r.iridescenceThicknessRange=this.iridescenceThicknessRange),this.iridescenceMap&&this.iridescenceMap.isTexture&&(r.iridescenceMap=this.iridescenceMap.toJSON(e).uuid),this.iridescenceThicknessMap&&this.iridescenceThicknessMap.isTexture&&(r.iridescenceThicknessMap=this.iridescenceThicknessMap.toJSON(e).uuid),this.map&&this.map.isTexture&&(r.map=this.map.toJSON(e).uuid),this.matcap&&this.matcap.isTexture&&(r.matcap=this.matcap.toJSON(e).uuid),this.alphaMap&&this.alphaMap.isTexture&&(r.alphaMap=this.alphaMap.toJSON(e).uuid),this.lightMap&&this.lightMap.isTexture&&(r.lightMap=this.lightMap.toJSON(e).uuid,r.lightMapIntensity=this.lightMapIntensity),this.aoMap&&this.aoMap.isTexture&&(r.aoMap=this.aoMap.toJSON(e).uuid,r.aoMapIntensity=this.aoMapIntensity),this.bumpMap&&this.bumpMap.isTexture&&(r.bumpMap=this.bumpMap.toJSON(e).uuid,r.bumpScale=this.bumpScale),this.normalMap&&this.normalMap.isTexture&&(r.normalMap=this.normalMap.toJSON(e).uuid,r.normalMapType=this.normalMapType,r.normalScale=this.normalScale.toArray()),this.displacementMap&&this.displacementMap.isTexture&&(r.displacementMap=this.displacementMap.toJSON(e).uuid,r.displacementScale=this.displacementScale,r.displacementBias=this.displacementBias),this.roughnessMap&&this.roughnessMap.isTexture&&(r.roughnessMap=this.roughnessMap.toJSON(e).uuid),this.metalnessMap&&this.metalnessMap.isTexture&&(r.metalnessMap=this.metalnessMap.toJSON(e).uuid),this.emissiveMap&&this.emissiveMap.isTexture&&(r.emissiveMap=this.emissiveMap.toJSON(e).uuid),this.specularMap&&this.specularMap.isTexture&&(r.specularMap=this.specularMap.toJSON(e).uuid),this.specularIntensityMap&&this.specularIntensityMap.isTexture&&(r.specularIntensityMap=this.specularIntensityMap.toJSON(e).uuid),this.specularColorMap&&this.specularColorMap.isTexture&&(r.specularColorMap=this.specularColorMap.toJSON(e).uuid),this.envMap&&this.envMap.isTexture&&(r.envMap=this.envMap.toJSON(e).uuid,this.combine!==void 0&&(r.combine=this.combine)),this.envMapIntensity!==void 0&&(r.envMapIntensity=this.envMapIntensity),this.reflectivity!==void 0&&(r.reflectivity=this.reflectivity),this.refractionRatio!==void 0&&(r.refractionRatio=this.refractionRatio),this.gradientMap&&this.gradientMap.isTexture&&(r.gradientMap=this.gradientMap.toJSON(e).uuid),this.transmission!==void 0&&(r.transmission=this.transmission),this.transmissionMap&&this.transmissionMap.isTexture&&(r.transmissionMap=this.transmissionMap.toJSON(e).uuid),this.thickness!==void 0&&(r.thickness=this.thickness),this.thicknessMap&&this.thicknessMap.isTexture&&(r.thicknessMap=this.thicknessMap.toJSON(e).uuid),this.attenuationDistance!==void 0&&(r.attenuationDistance=this.attenuationDistance),this.attenuationColor!==void 0&&(r.attenuationColor=this.attenuationColor.getHex()),this.size!==void 0&&(r.size=this.size),this.shadowSide!==null&&(r.shadowSide=this.shadowSide),this.sizeAttenuation!==void 0&&(r.sizeAttenuation=this.sizeAttenuation),this.blending!==oS&&(r.blending=this.blending),this.side!==NC&&(r.side=this.side),this.vertexColors&&(r.vertexColors=!0),this.opacity<1&&(r.opacity=this.opacity),this.transparent===!0&&(r.transparent=this.transparent),r.depthFunc=this.depthFunc,r.depthTest=this.depthTest,r.depthWrite=this.depthWrite,r.colorWrite=this.colorWrite,r.stencilWrite=this.stencilWrite,r.stencilWriteMask=this.stencilWriteMask,r.stencilFunc=this.stencilFunc,r.stencilRef=this.stencilRef,r.stencilFuncMask=this.stencilFuncMask,r.stencilFail=this.stencilFail,r.stencilZFail=this.stencilZFail,r.stencilZPass=this.stencilZPass,this.rotation!==void 0&&this.rotation!==0&&(r.rotation=this.rotation),this.polygonOffset===!0&&(r.polygonOffset=!0),this.polygonOffsetFactor!==0&&(r.polygonOffsetFactor=this.polygonOffsetFactor),this.polygonOffsetUnits!==0&&(r.polygonOffsetUnits=this.polygonOffsetUnits),this.linewidth!==void 0&&this.linewidth!==1&&(r.linewidth=this.linewidth),this.dashSize!==void 0&&(r.dashSize=this.dashSize),this.gapSize!==void 0&&(r.gapSize=this.gapSize),this.scale!==void 0&&(r.scale=this.scale),this.dithering===!0&&(r.dithering=!0),this.alphaTest>0&&(r.alphaTest=this.alphaTest),this.alphaToCoverage===!0&&(r.alphaToCoverage=this.alphaToCoverage),this.premultipliedAlpha===!0&&(r.premultipliedAlpha=this.premultipliedAlpha),this.wireframe===!0&&(r.wireframe=this.wireframe),this.wireframeLinewidth>1&&(r.wireframeLinewidth=this.wireframeLinewidth),this.wireframeLinecap!=="round"&&(r.wireframeLinecap=this.wireframeLinecap),this.wireframeLinejoin!=="round"&&(r.wireframeLinejoin=this.wireframeLinejoin),this.flatShading===!0&&(r.flatShading=this.flatShading),this.visible===!1&&(r.visible=!1),this.toneMapped===!1&&(r.toneMapped=!1),this.fog===!1&&(r.fog=!1),JSON.stringify(this.userData)!=="{}"&&(r.userData=this.userData);function i(o){const s=[];for(const a in o){const l=o[a];delete l.metadata,s.push(l)}return s}if(n){const o=i(e.textures),s=i(e.images);o.length>0&&(r.textures=o),s.length>0&&(r.images=s)}return r}clone(){return new this.constructor().copy(this)}copy(e){this.name=e.name,this.blending=e.blending,this.side=e.side,this.vertexColors=e.vertexColors,this.opacity=e.opacity,this.transparent=e.transparent,this.blendSrc=e.blendSrc,this.blendDst=e.blendDst,this.blendEquation=e.blendEquation,this.blendSrcAlpha=e.blendSrcAlpha,this.blendDstAlpha=e.blendDstAlpha,this.blendEquationAlpha=e.blendEquationAlpha,this.depthFunc=e.depthFunc,this.depthTest=e.depthTest,this.depthWrite=e.depthWrite,this.stencilWriteMask=e.stencilWriteMask,this.stencilFunc=e.stencilFunc,this.stencilRef=e.stencilRef,this.stencilFuncMask=e.stencilFuncMask,this.stencilFail=e.stencilFail,this.stencilZFail=e.stencilZFail,this.stencilZPass=e.stencilZPass,this.stencilWrite=e.stencilWrite;const n=e.clippingPlanes;let r=null;if(n!==null){const i=n.length;r=new Array(i);for(let o=0;o!==i;++o)r[o]=n[o].clone()}return this.clippingPlanes=r,this.clipIntersection=e.clipIntersection,this.clipShadows=e.clipShadows,this.shadowSide=e.shadowSide,this.colorWrite=e.colorWrite,this.precision=e.precision,this.polygonOffset=e.polygonOffset,this.polygonOffsetFactor=e.polygonOffsetFactor,this.polygonOffsetUnits=e.polygonOffsetUnits,this.dithering=e.dithering,this.alphaTest=e.alphaTest,this.alphaToCoverage=e.alphaToCoverage,this.premultipliedAlpha=e.premultipliedAlpha,this.visible=e.visible,this.toneMapped=e.toneMapped,this.userData=JSON.parse(JSON.stringify(e.userData)),this}dispose(){this.dispatchEvent({type:"dispose"})}set needsUpdate(e){e===!0&&this.version++}}class eue extends _D{constructor(e){super(),this.isMeshBasicMaterial=!0,this.type="MeshBasicMaterial",this.color=new fi(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=zXe,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.fog=e.fog,this}}const eo=new Ce,v$=new On;class xu{constructor(e,n,r){if(Array.isArray(e))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.isBufferAttribute=!0,this.name="",this.array=e,this.itemSize=n,this.count=e!==void 0?e.length/n:0,this.normalized=r===!0,this.usage=QOe,this.updateRange={offset:0,count:-1},this.version=0}onUploadCallback(){}set needsUpdate(e){e===!0&&this.version++}setUsage(e){return this.usage=e,this}copy(e){return this.name=e.name,this.array=new e.array.constructor(e.array),this.itemSize=e.itemSize,this.count=e.count,this.normalized=e.normalized,this.usage=e.usage,this}copyAt(e,n,r){e*=this.itemSize,r*=n.itemSize;for(let i=0,o=this.itemSize;i0&&(e.userData=this.userData),this.parameters!==void 0){const l=this.parameters;for(const c in l)l[c]!==void 0&&(e[c]=l[c]);return e}e.data={attributes:{}};const n=this.index;n!==null&&(e.data.index={type:n.array.constructor.name,array:Array.prototype.slice.call(n.array)});const r=this.attributes;for(const l in r){const c=r[l];e.data.attributes[l]=c.toJSON(e.data)}const i={};let o=!1;for(const l in this.morphAttributes){const c=this.morphAttributes[l],u=[];for(let f=0,d=c.length;f0&&(i[l]=u,o=!0)}o&&(e.data.morphAttributes=i,e.data.morphTargetsRelative=this.morphTargetsRelative);const s=this.groups;s.length>0&&(e.data.groups=JSON.parse(JSON.stringify(s)));const a=this.boundingSphere;return a!==null&&(e.data.boundingSphere={center:a.center.toArray(),radius:a.radius}),e}clone(){return new this.constructor().copy(this)}copy(e){this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null;const n={};this.name=e.name;const r=e.index;r!==null&&this.setIndex(r.clone(n));const i=e.attributes;for(const c in i){const u=i[c];this.setAttribute(c,u.clone(n))}const o=e.morphAttributes;for(const c in o){const u=[],f=o[c];for(let d=0,h=f.length;d0){const i=n[r[0]];if(i!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let o=0,s=i.length;on.far?null:{distance:c,point:C$.clone(),object:t}}function O$(t,e,n,r,i,o,s,a,l,c,u,f){Sm.fromBufferAttribute(i,c),Cm.fromBufferAttribute(i,u),Om.fromBufferAttribute(i,f);const d=t.morphTargetInfluences;if(o&&d){y$.set(0,0,0),x$.set(0,0,0),b$.set(0,0,0);for(let p=0,g=o.length;p0?1:-1,u.push(z.x,z.y,z.z),f.push(F/S),f.push(1-L/O),j+=1}}for(let L=0;L0&&(n.defines=this.defines),n.vertexShader=this.vertexShader,n.fragmentShader=this.fragmentShader;const r={};for(const i in this.extensions)this.extensions[i]===!0&&(r[i]=!0);return Object.keys(r).length>0&&(n.extensions=r),n}}class TXe extends bl{constructor(){super(),this.isCamera=!0,this.type="Camera",this.matrixWorldInverse=new Wr,this.projectionMatrix=new Wr,this.projectionMatrixInverse=new Wr}copy(e,n){return super.copy(e,n),this.matrixWorldInverse.copy(e.matrixWorldInverse),this.projectionMatrix.copy(e.projectionMatrix),this.projectionMatrixInverse.copy(e.projectionMatrixInverse),this}getWorldDirection(e){this.updateWorldMatrix(!0,!1);const n=this.matrixWorld.elements;return e.set(-n[8],-n[9],-n[10]).normalize()}updateMatrixWorld(e){super.updateMatrixWorld(e),this.matrixWorldInverse.copy(this.matrixWorld).invert()}updateWorldMatrix(e,n){super.updateWorldMatrix(e,n),this.matrixWorldInverse.copy(this.matrixWorld).invert()}clone(){return new this.constructor().copy(this)}}class wf extends TXe{constructor(e=50,n=1,r=.1,i=2e3){super(),this.isPerspectiveCamera=!0,this.type="PerspectiveCamera",this.fov=e,this.zoom=1,this.near=r,this.far=i,this.focus=10,this.aspect=n,this.view=null,this.filmGauge=35,this.filmOffset=0,this.updateProjectionMatrix()}copy(e,n){return super.copy(e,n),this.fov=e.fov,this.zoom=e.zoom,this.near=e.near,this.far=e.far,this.focus=e.focus,this.aspect=e.aspect,this.view=e.view===null?null:Object.assign({},e.view),this.filmGauge=e.filmGauge,this.filmOffset=e.filmOffset,this}setFocalLength(e){const n=.5*this.getFilmHeight()/e;this.fov=OOe*2*Math.atan(n),this.updateProjectionMatrix()}getFocalLength(){const e=Math.tan(H7*.5*this.fov);return .5*this.getFilmHeight()/e}getEffectiveFOV(){return OOe*2*Math.atan(Math.tan(H7*.5*this.fov)/this.zoom)}getFilmWidth(){return this.filmGauge*Math.min(this.aspect,1)}getFilmHeight(){return this.filmGauge/Math.max(this.aspect,1)}setViewOffset(e,n,r,i,o,s){this.aspect=e/n,this.view===null&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=e,this.view.fullHeight=n,this.view.offsetX=r,this.view.offsetY=i,this.view.width=o,this.view.height=s,this.updateProjectionMatrix()}clearViewOffset(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const e=this.near;let n=e*Math.tan(H7*.5*this.fov)/this.zoom,r=2*n,i=this.aspect*r,o=-.5*i;const s=this.view;if(this.view!==null&&this.view.enabled){const l=s.fullWidth,c=s.fullHeight;o+=s.offsetX*i/l,n-=s.offsetY*r/c,i*=s.width/l,r*=s.height/c}const a=this.filmOffset;a!==0&&(o+=e*a/this.getFilmWidth()),this.projectionMatrix.makePerspective(o,o+i,n,n-r,e,this.far),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(e){const n=super.toJSON(e);return n.object.fov=this.fov,n.object.zoom=this.zoom,n.object.near=this.near,n.object.far=this.far,n.object.focus=this.focus,n.object.aspect=this.aspect,this.view!==null&&(n.object.view=Object.assign({},this.view)),n.object.filmGauge=this.filmGauge,n.object.filmOffset=this.filmOffset,n}}const Ow=90,Ew=1;class d6n extends bl{constructor(e,n,r){super(),this.type="CubeCamera",this.renderTarget=r;const i=new wf(Ow,Ew,e,n);i.layers=this.layers,i.up.set(0,-1,0),i.lookAt(new Ce(1,0,0)),this.add(i);const o=new wf(Ow,Ew,e,n);o.layers=this.layers,o.up.set(0,-1,0),o.lookAt(new Ce(-1,0,0)),this.add(o);const s=new wf(Ow,Ew,e,n);s.layers=this.layers,s.up.set(0,0,1),s.lookAt(new Ce(0,1,0)),this.add(s);const a=new wf(Ow,Ew,e,n);a.layers=this.layers,a.up.set(0,0,-1),a.lookAt(new Ce(0,-1,0)),this.add(a);const l=new wf(Ow,Ew,e,n);l.layers=this.layers,l.up.set(0,-1,0),l.lookAt(new Ce(0,0,1)),this.add(l);const c=new wf(Ow,Ew,e,n);c.layers=this.layers,c.up.set(0,-1,0),c.lookAt(new Ce(0,0,-1)),this.add(c)}update(e,n){this.parent===null&&this.updateMatrixWorld();const r=this.renderTarget,[i,o,s,a,l,c]=this.children,u=e.getRenderTarget(),f=e.toneMapping,d=e.xr.enabled;e.toneMapping=wg,e.xr.enabled=!1;const h=r.texture.generateMipmaps;r.texture.generateMipmaps=!1,e.setRenderTarget(r,0),e.render(n,i),e.setRenderTarget(r,1),e.render(n,o),e.setRenderTarget(r,2),e.render(n,s),e.setRenderTarget(r,3),e.render(n,a),e.setRenderTarget(r,4),e.render(n,l),r.texture.generateMipmaps=h,e.setRenderTarget(r,5),e.render(n,c),e.setRenderTarget(u),e.toneMapping=f,e.xr.enabled=d,r.texture.needsPMREMUpdate=!0}}class kXe extends Ac{constructor(e,n,r,i,o,s,a,l,c,u){e=e!==void 0?e:[],n=n!==void 0?n:jC,super(e,n,r,i,o,s,a,l,c,u),this.isCubeTexture=!0,this.flipY=!1}get images(){return this.image}set images(e){this.image=e}}class h6n extends V1{constructor(e,n={}){super(e,e,n),this.isWebGLCubeRenderTarget=!0;const r={width:e,height:e,depth:1},i=[r,r,r,r,r,r];this.texture=new kXe(i,n.mapping,n.wrapS,n.wrapT,n.magFilter,n.minFilter,n.format,n.type,n.anisotropy,n.encoding),this.texture.isRenderTargetTexture=!0,this.texture.generateMipmaps=n.generateMipmaps!==void 0?n.generateMipmaps:!1,this.texture.minFilter=n.minFilter!==void 0?n.minFilter:nl}fromEquirectangularTexture(e,n){this.texture.type=n.type,this.texture.encoding=n.encoding,this.texture.generateMipmaps=n.generateMipmaps,this.texture.minFilter=n.minFilter,this.texture.magFilter=n.magFilter;const r={uniforms:{tEquirect:{value:null}},vertexShader:` +}`;class Ey extends _D{constructor(e){super(),this.isShaderMaterial=!0,this.type="ShaderMaterial",this.defines={},this.uniforms={},this.uniformsGroups=[],this.vertexShader=i6n,this.fragmentShader=o6n,this.linewidth=1,this.wireframe=!1,this.wireframeLinewidth=1,this.fog=!1,this.lights=!1,this.clipping=!1,this.extensions={derivatives:!1,fragDepth:!1,drawBuffers:!1,shaderTextureLOD:!1},this.defaultAttributeValues={color:[1,1,1],uv:[0,0],uv2:[0,0]},this.index0AttributeName=void 0,this.uniformsNeedUpdate=!1,this.glslVersion=null,e!==void 0&&this.setValues(e)}copy(e){return super.copy(e),this.fragmentShader=e.fragmentShader,this.vertexShader=e.vertexShader,this.uniforms=UC(e.uniforms),this.uniformsGroups=r6n(e.uniformsGroups),this.defines=Object.assign({},e.defines),this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.fog=e.fog,this.lights=e.lights,this.clipping=e.clipping,this.extensions=Object.assign({},e.extensions),this.glslVersion=e.glslVersion,this}toJSON(e){const n=super.toJSON(e);n.glslVersion=this.glslVersion,n.uniforms={};for(const i in this.uniforms){const s=this.uniforms[i].value;s&&s.isTexture?n.uniforms[i]={type:"t",value:s.toJSON(e).uuid}:s&&s.isColor?n.uniforms[i]={type:"c",value:s.getHex()}:s&&s.isVector2?n.uniforms[i]={type:"v2",value:s.toArray()}:s&&s.isVector3?n.uniforms[i]={type:"v3",value:s.toArray()}:s&&s.isVector4?n.uniforms[i]={type:"v4",value:s.toArray()}:s&&s.isMatrix3?n.uniforms[i]={type:"m3",value:s.toArray()}:s&&s.isMatrix4?n.uniforms[i]={type:"m4",value:s.toArray()}:n.uniforms[i]={value:s}}Object.keys(this.defines).length>0&&(n.defines=this.defines),n.vertexShader=this.vertexShader,n.fragmentShader=this.fragmentShader;const r={};for(const i in this.extensions)this.extensions[i]===!0&&(r[i]=!0);return Object.keys(r).length>0&&(n.extensions=r),n}}class eYe extends yl{constructor(){super(),this.isCamera=!0,this.type="Camera",this.matrixWorldInverse=new Wr,this.projectionMatrix=new Wr,this.projectionMatrixInverse=new Wr}copy(e,n){return super.copy(e,n),this.matrixWorldInverse.copy(e.matrixWorldInverse),this.projectionMatrix.copy(e.projectionMatrix),this.projectionMatrixInverse.copy(e.projectionMatrixInverse),this}getWorldDirection(e){this.updateWorldMatrix(!0,!1);const n=this.matrixWorld.elements;return e.set(-n[8],-n[9],-n[10]).normalize()}updateMatrixWorld(e){super.updateMatrixWorld(e),this.matrixWorldInverse.copy(this.matrixWorld).invert()}updateWorldMatrix(e,n){super.updateWorldMatrix(e,n),this.matrixWorldInverse.copy(this.matrixWorld).invert()}clone(){return new this.constructor().copy(this)}}class wf extends eYe{constructor(e=50,n=1,r=.1,i=2e3){super(),this.isPerspectiveCamera=!0,this.type="PerspectiveCamera",this.fov=e,this.zoom=1,this.near=r,this.far=i,this.focus=10,this.aspect=n,this.view=null,this.filmGauge=35,this.filmOffset=0,this.updateProjectionMatrix()}copy(e,n){return super.copy(e,n),this.fov=e.fov,this.zoom=e.zoom,this.near=e.near,this.far=e.far,this.focus=e.focus,this.aspect=e.aspect,this.view=e.view===null?null:Object.assign({},e.view),this.filmGauge=e.filmGauge,this.filmOffset=e.filmOffset,this}setFocalLength(e){const n=.5*this.getFilmHeight()/e;this.fov=ZOe*2*Math.atan(n),this.updateProjectionMatrix()}getFocalLength(){const e=Math.tan(aG*.5*this.fov);return .5*this.getFilmHeight()/e}getEffectiveFOV(){return ZOe*2*Math.atan(Math.tan(aG*.5*this.fov)/this.zoom)}getFilmWidth(){return this.filmGauge*Math.min(this.aspect,1)}getFilmHeight(){return this.filmGauge/Math.max(this.aspect,1)}setViewOffset(e,n,r,i,o,s){this.aspect=e/n,this.view===null&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=e,this.view.fullHeight=n,this.view.offsetX=r,this.view.offsetY=i,this.view.width=o,this.view.height=s,this.updateProjectionMatrix()}clearViewOffset(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const e=this.near;let n=e*Math.tan(aG*.5*this.fov)/this.zoom,r=2*n,i=this.aspect*r,o=-.5*i;const s=this.view;if(this.view!==null&&this.view.enabled){const l=s.fullWidth,c=s.fullHeight;o+=s.offsetX*i/l,n-=s.offsetY*r/c,i*=s.width/l,r*=s.height/c}const a=this.filmOffset;a!==0&&(o+=e*a/this.getFilmWidth()),this.projectionMatrix.makePerspective(o,o+i,n,n-r,e,this.far),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(e){const n=super.toJSON(e);return n.object.fov=this.fov,n.object.zoom=this.zoom,n.object.near=this.near,n.object.far=this.far,n.object.focus=this.focus,n.object.aspect=this.aspect,this.view!==null&&(n.object.view=Object.assign({},this.view)),n.object.filmGauge=this.filmGauge,n.object.filmOffset=this.filmOffset,n}}const Cw=90,Ow=1;class s6n extends yl{constructor(e,n,r){super(),this.type="CubeCamera",this.renderTarget=r;const i=new wf(Cw,Ow,e,n);i.layers=this.layers,i.up.set(0,-1,0),i.lookAt(new Ce(1,0,0)),this.add(i);const o=new wf(Cw,Ow,e,n);o.layers=this.layers,o.up.set(0,-1,0),o.lookAt(new Ce(-1,0,0)),this.add(o);const s=new wf(Cw,Ow,e,n);s.layers=this.layers,s.up.set(0,0,1),s.lookAt(new Ce(0,1,0)),this.add(s);const a=new wf(Cw,Ow,e,n);a.layers=this.layers,a.up.set(0,0,-1),a.lookAt(new Ce(0,-1,0)),this.add(a);const l=new wf(Cw,Ow,e,n);l.layers=this.layers,l.up.set(0,-1,0),l.lookAt(new Ce(0,0,1)),this.add(l);const c=new wf(Cw,Ow,e,n);c.layers=this.layers,c.up.set(0,-1,0),c.lookAt(new Ce(0,0,-1)),this.add(c)}update(e,n){this.parent===null&&this.updateMatrixWorld();const r=this.renderTarget,[i,o,s,a,l,c]=this.children,u=e.getRenderTarget(),f=e.toneMapping,d=e.xr.enabled;e.toneMapping=yg,e.xr.enabled=!1;const h=r.texture.generateMipmaps;r.texture.generateMipmaps=!1,e.setRenderTarget(r,0),e.render(n,i),e.setRenderTarget(r,1),e.render(n,o),e.setRenderTarget(r,2),e.render(n,s),e.setRenderTarget(r,3),e.render(n,a),e.setRenderTarget(r,4),e.render(n,l),r.texture.generateMipmaps=h,e.setRenderTarget(r,5),e.render(n,c),e.setRenderTarget(u),e.toneMapping=f,e.xr.enabled=d,r.texture.needsPMREMUpdate=!0}}class tYe extends kc{constructor(e,n,r,i,o,s,a,l,c,u){e=e!==void 0?e:[],n=n!==void 0?n:zC,super(e,n,r,i,o,s,a,l,c,u),this.isCubeTexture=!0,this.flipY=!1}get images(){return this.image}set images(e){this.image=e}}class a6n extends Vb{constructor(e,n={}){super(e,e,n),this.isWebGLCubeRenderTarget=!0;const r={width:e,height:e,depth:1},i=[r,r,r,r,r,r];this.texture=new tYe(i,n.mapping,n.wrapS,n.wrapT,n.magFilter,n.minFilter,n.format,n.type,n.anisotropy,n.encoding),this.texture.isRenderTargetTexture=!0,this.texture.generateMipmaps=n.generateMipmaps!==void 0?n.generateMipmaps:!1,this.texture.minFilter=n.minFilter!==void 0?n.minFilter:el}fromEquirectangularTexture(e,n){this.texture.type=n.type,this.texture.encoding=n.encoding,this.texture.generateMipmaps=n.generateMipmaps,this.texture.minFilter=n.minFilter,this.texture.magFilter=n.magFilter;const r={uniforms:{tEquirect:{value:null}},vertexShader:` varying vec3 vWorldDirection; @@ -624,28 +626,28 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho gl_FragColor = texture2D( tEquirect, sampleUV ); } - `},i=new gE(5,5,5),o=new Ty({name:"CubemapFromEquirect",uniforms:WC(r.uniforms),vertexShader:r.vertexShader,fragmentShader:r.fragmentShader,side:vc,blending:qv});o.uniforms.tEquirect.value=n;const s=new ah(i,o),a=n.minFilter;return n.minFilter===o8&&(n.minFilter=nl),new d6n(1,10,this).update(e,s),n.minFilter=a,s.geometry.dispose(),s.material.dispose(),this}clear(e,n,r,i){const o=e.getRenderTarget();for(let s=0;s<6;s++)e.setRenderTarget(this,s),e.clear(n,r,i);e.setRenderTarget(o)}}const pG=new Ce,p6n=new Ce,g6n=new fc;class G0{constructor(e=new Ce(1,0,0),n=0){this.isPlane=!0,this.normal=e,this.constant=n}set(e,n){return this.normal.copy(e),this.constant=n,this}setComponents(e,n,r,i){return this.normal.set(e,n,r),this.constant=i,this}setFromNormalAndCoplanarPoint(e,n){return this.normal.copy(e),this.constant=-n.dot(this.normal),this}setFromCoplanarPoints(e,n,r){const i=pG.subVectors(r,n).cross(p6n.subVectors(e,n)).normalize();return this.setFromNormalAndCoplanarPoint(i,e),this}copy(e){return this.normal.copy(e.normal),this.constant=e.constant,this}normalize(){const e=1/this.normal.length();return this.normal.multiplyScalar(e),this.constant*=e,this}negate(){return this.constant*=-1,this.normal.negate(),this}distanceToPoint(e){return this.normal.dot(e)+this.constant}distanceToSphere(e){return this.distanceToPoint(e.center)-e.radius}projectPoint(e,n){return n.copy(this.normal).multiplyScalar(-this.distanceToPoint(e)).add(e)}intersectLine(e,n){const r=e.delta(pG),i=this.normal.dot(r);if(i===0)return this.distanceToPoint(e.start)===0?n.copy(e.start):null;const o=-(e.start.dot(this.normal)+this.constant)/i;return o<0||o>1?null:n.copy(r).multiplyScalar(o).add(e.start)}intersectsLine(e){const n=this.distanceToPoint(e.start),r=this.distanceToPoint(e.end);return n<0&&r>0||r<0&&n>0}intersectsBox(e){return e.intersectsPlane(this)}intersectsSphere(e){return e.intersectsPlane(this)}coplanarPoint(e){return e.copy(this.normal).multiplyScalar(-this.constant)}applyMatrix4(e,n){const r=n||g6n.getNormalMatrix(e),i=this.coplanarPoint(pG).applyMatrix4(e),o=this.normal.applyMatrix3(r).normalize();return this.constant=-i.dot(o),this}translate(e){return this.constant-=e.dot(this.normal),this}equals(e){return e.normal.equals(this.normal)&&e.constant===this.constant}clone(){return new this.constructor().copy(this)}}const Tw=new s8,P$=new Ce;class AXe{constructor(e=new G0,n=new G0,r=new G0,i=new G0,o=new G0,s=new G0){this.planes=[e,n,r,i,o,s]}set(e,n,r,i,o,s){const a=this.planes;return a[0].copy(e),a[1].copy(n),a[2].copy(r),a[3].copy(i),a[4].copy(o),a[5].copy(s),this}copy(e){const n=this.planes;for(let r=0;r<6;r++)n[r].copy(e.planes[r]);return this}setFromProjectionMatrix(e){const n=this.planes,r=e.elements,i=r[0],o=r[1],s=r[2],a=r[3],l=r[4],c=r[5],u=r[6],f=r[7],d=r[8],h=r[9],p=r[10],g=r[11],m=r[12],v=r[13],y=r[14],x=r[15];return n[0].setComponents(a-i,f-l,g-d,x-m).normalize(),n[1].setComponents(a+i,f+l,g+d,x+m).normalize(),n[2].setComponents(a+o,f+c,g+h,x+v).normalize(),n[3].setComponents(a-o,f-c,g-h,x-v).normalize(),n[4].setComponents(a-s,f-u,g-p,x-y).normalize(),n[5].setComponents(a+s,f+u,g+p,x+y).normalize(),this}intersectsObject(e){const n=e.geometry;return n.boundingSphere===null&&n.computeBoundingSphere(),Tw.copy(n.boundingSphere).applyMatrix4(e.matrixWorld),this.intersectsSphere(Tw)}intersectsSprite(e){return Tw.center.set(0,0,0),Tw.radius=.7071067811865476,Tw.applyMatrix4(e.matrixWorld),this.intersectsSphere(Tw)}intersectsSphere(e){const n=this.planes,r=e.center,i=-e.radius;for(let o=0;o<6;o++)if(n[o].distanceToPoint(r)0?e.max.x:e.min.x,P$.y=i.normal.y>0?e.max.y:e.min.y,P$.z=i.normal.z>0?e.max.z:e.min.z,i.distanceToPoint(P$)<0)return!1}return!0}containsPoint(e){const n=this.planes;for(let r=0;r<6;r++)if(n[r].distanceToPoint(e)<0)return!1;return!0}clone(){return new this.constructor().copy(this)}}function PXe(){let t=null,e=!1,n=null,r=null;function i(o,s){n(o,s),r=t.requestAnimationFrame(i)}return{start:function(){e!==!0&&n!==null&&(r=t.requestAnimationFrame(i),e=!0)},stop:function(){t.cancelAnimationFrame(r),e=!1},setAnimationLoop:function(o){n=o},setContext:function(o){t=o}}}function m6n(t,e){const n=e.isWebGL2,r=new WeakMap;function i(c,u){const f=c.array,d=c.usage,h=t.createBuffer();t.bindBuffer(u,h),t.bufferData(u,f,d),c.onUploadCallback();let p;if(f instanceof Float32Array)p=5126;else if(f instanceof Uint16Array)if(c.isFloat16BufferAttribute)if(n)p=5131;else throw new Error("THREE.WebGLAttributes: Usage of Float16BufferAttribute requires WebGL2.");else p=5123;else if(f instanceof Int16Array)p=5122;else if(f instanceof Uint32Array)p=5125;else if(f instanceof Int32Array)p=5124;else if(f instanceof Int8Array)p=5120;else if(f instanceof Uint8Array)p=5121;else if(f instanceof Uint8ClampedArray)p=5121;else throw new Error("THREE.WebGLAttributes: Unsupported buffer data format: "+f);return{buffer:h,type:p,bytesPerElement:f.BYTES_PER_ELEMENT,version:c.version}}function o(c,u,f){const d=u.array,h=u.updateRange;t.bindBuffer(f,c),h.count===-1?t.bufferSubData(f,0,d):(n?t.bufferSubData(f,h.offset*d.BYTES_PER_ELEMENT,d,h.offset,h.count):t.bufferSubData(f,h.offset*d.BYTES_PER_ELEMENT,d.subarray(h.offset,h.offset+h.count)),h.count=-1)}function s(c){return c.isInterleavedBufferAttribute&&(c=c.data),r.get(c)}function a(c){c.isInterleavedBufferAttribute&&(c=c.data);const u=r.get(c);u&&(t.deleteBuffer(u.buffer),r.delete(c))}function l(c,u){if(c.isGLBufferAttribute){const d=r.get(c);(!d||d.version1?null:n.copy(r).multiplyScalar(o).add(e.start)}intersectsLine(e){const n=this.distanceToPoint(e.start),r=this.distanceToPoint(e.end);return n<0&&r>0||r<0&&n>0}intersectsBox(e){return e.intersectsPlane(this)}intersectsSphere(e){return e.intersectsPlane(this)}coplanarPoint(e){return e.copy(this.normal).multiplyScalar(-this.constant)}applyMatrix4(e,n){const r=n||c6n.getNormalMatrix(e),i=this.coplanarPoint(AG).applyMatrix4(e),o=this.normal.applyMatrix3(r).normalize();return this.constant=-i.dot(o),this}translate(e){return this.constant-=e.dot(this.normal),this}equals(e){return e.normal.equals(this.normal)&&e.constant===this.constant}clone(){return new this.constructor().copy(this)}}const Ew=new s8,E$=new Ce;class nYe{constructor(e=new G0,n=new G0,r=new G0,i=new G0,o=new G0,s=new G0){this.planes=[e,n,r,i,o,s]}set(e,n,r,i,o,s){const a=this.planes;return a[0].copy(e),a[1].copy(n),a[2].copy(r),a[3].copy(i),a[4].copy(o),a[5].copy(s),this}copy(e){const n=this.planes;for(let r=0;r<6;r++)n[r].copy(e.planes[r]);return this}setFromProjectionMatrix(e){const n=this.planes,r=e.elements,i=r[0],o=r[1],s=r[2],a=r[3],l=r[4],c=r[5],u=r[6],f=r[7],d=r[8],h=r[9],p=r[10],g=r[11],m=r[12],v=r[13],y=r[14],x=r[15];return n[0].setComponents(a-i,f-l,g-d,x-m).normalize(),n[1].setComponents(a+i,f+l,g+d,x+m).normalize(),n[2].setComponents(a+o,f+c,g+h,x+v).normalize(),n[3].setComponents(a-o,f-c,g-h,x-v).normalize(),n[4].setComponents(a-s,f-u,g-p,x-y).normalize(),n[5].setComponents(a+s,f+u,g+p,x+y).normalize(),this}intersectsObject(e){const n=e.geometry;return n.boundingSphere===null&&n.computeBoundingSphere(),Ew.copy(n.boundingSphere).applyMatrix4(e.matrixWorld),this.intersectsSphere(Ew)}intersectsSprite(e){return Ew.center.set(0,0,0),Ew.radius=.7071067811865476,Ew.applyMatrix4(e.matrixWorld),this.intersectsSphere(Ew)}intersectsSphere(e){const n=this.planes,r=e.center,i=-e.radius;for(let o=0;o<6;o++)if(n[o].distanceToPoint(r)0?e.max.x:e.min.x,E$.y=i.normal.y>0?e.max.y:e.min.y,E$.z=i.normal.z>0?e.max.z:e.min.z,i.distanceToPoint(E$)<0)return!1}return!0}containsPoint(e){const n=this.planes;for(let r=0;r<6;r++)if(n[r].distanceToPoint(e)<0)return!1;return!0}clone(){return new this.constructor().copy(this)}}function rYe(){let t=null,e=!1,n=null,r=null;function i(o,s){n(o,s),r=t.requestAnimationFrame(i)}return{start:function(){e!==!0&&n!==null&&(r=t.requestAnimationFrame(i),e=!0)},stop:function(){t.cancelAnimationFrame(r),e=!1},setAnimationLoop:function(o){n=o},setContext:function(o){t=o}}}function u6n(t,e){const n=e.isWebGL2,r=new WeakMap;function i(c,u){const f=c.array,d=c.usage,h=t.createBuffer();t.bindBuffer(u,h),t.bufferData(u,f,d),c.onUploadCallback();let p;if(f instanceof Float32Array)p=5126;else if(f instanceof Uint16Array)if(c.isFloat16BufferAttribute)if(n)p=5131;else throw new Error("THREE.WebGLAttributes: Usage of Float16BufferAttribute requires WebGL2.");else p=5123;else if(f instanceof Int16Array)p=5122;else if(f instanceof Uint32Array)p=5125;else if(f instanceof Int32Array)p=5124;else if(f instanceof Int8Array)p=5120;else if(f instanceof Uint8Array)p=5121;else if(f instanceof Uint8ClampedArray)p=5121;else throw new Error("THREE.WebGLAttributes: Unsupported buffer data format: "+f);return{buffer:h,type:p,bytesPerElement:f.BYTES_PER_ELEMENT,version:c.version}}function o(c,u,f){const d=u.array,h=u.updateRange;t.bindBuffer(f,c),h.count===-1?t.bufferSubData(f,0,d):(n?t.bufferSubData(f,h.offset*d.BYTES_PER_ELEMENT,d,h.offset,h.count):t.bufferSubData(f,h.offset*d.BYTES_PER_ELEMENT,d.subarray(h.offset,h.offset+h.count)),h.count=-1)}function s(c){return c.isInterleavedBufferAttribute&&(c=c.data),r.get(c)}function a(c){c.isInterleavedBufferAttribute&&(c=c.data);const u=r.get(c);u&&(t.deleteBuffer(u.buffer),r.delete(c))}function l(c,u){if(c.isGLBufferAttribute){const d=r.get(c);(!d||d.version 0 +#endif`,_6n=`#if NUM_CLIPPING_PLANES > 0 vec4 plane; #pragma unroll_loop_start for ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) { @@ -885,26 +887,26 @@ vec3 BRDF_Sheen( const in vec3 lightDir, const in vec3 viewDir, const in vec3 no #pragma unroll_loop_end if ( clipped ) discard; #endif -#endif`,A6n=`#if NUM_CLIPPING_PLANES > 0 +#endif`,S6n=`#if NUM_CLIPPING_PLANES > 0 varying vec3 vClipPosition; uniform vec4 clippingPlanes[ NUM_CLIPPING_PLANES ]; -#endif`,P6n=`#if NUM_CLIPPING_PLANES > 0 +#endif`,C6n=`#if NUM_CLIPPING_PLANES > 0 varying vec3 vClipPosition; -#endif`,M6n=`#if NUM_CLIPPING_PLANES > 0 +#endif`,O6n=`#if NUM_CLIPPING_PLANES > 0 vClipPosition = - mvPosition.xyz; -#endif`,R6n=`#if defined( USE_COLOR_ALPHA ) +#endif`,E6n=`#if defined( USE_COLOR_ALPHA ) diffuseColor *= vColor; #elif defined( USE_COLOR ) diffuseColor.rgb *= vColor; -#endif`,D6n=`#if defined( USE_COLOR_ALPHA ) +#endif`,T6n=`#if defined( USE_COLOR_ALPHA ) varying vec4 vColor; #elif defined( USE_COLOR ) varying vec3 vColor; -#endif`,I6n=`#if defined( USE_COLOR_ALPHA ) +#endif`,k6n=`#if defined( USE_COLOR_ALPHA ) varying vec4 vColor; #elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR ) varying vec3 vColor; -#endif`,L6n=`#if defined( USE_COLOR_ALPHA ) +#endif`,A6n=`#if defined( USE_COLOR_ALPHA ) vColor = vec4( 1.0 ); #elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR ) vColor = vec3( 1.0 ); @@ -914,7 +916,7 @@ vec3 BRDF_Sheen( const in vec3 lightDir, const in vec3 viewDir, const in vec3 no #endif #ifdef USE_INSTANCING_COLOR vColor.xyz *= instanceColor.xyz; -#endif`,$6n=`#define PI 3.141592653589793 +#endif`,P6n=`#define PI 3.141592653589793 #define PI2 6.283185307179586 #define PI_HALF 1.5707963267948966 #define RECIPROCAL_PI 0.3183098861837907 @@ -986,7 +988,7 @@ vec2 equirectUv( in vec3 dir ) { float u = atan( dir.z, dir.x ) * RECIPROCAL_PI2 + 0.5; float v = asin( clamp( dir.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5; return vec2( u, v ); -}`,F6n=`#ifdef ENVMAP_TYPE_CUBE_UV +}`,M6n=`#ifdef ENVMAP_TYPE_CUBE_UV #define cubeUV_minMipLevel 4.0 #define cubeUV_minTileSize 16.0 float getFace( vec3 direction ) { @@ -1084,7 +1086,7 @@ vec2 equirectUv( in vec3 dir ) { return vec4( mix( color0, color1, mipF ), 1.0 ); } } -#endif`,N6n=`vec3 transformedNormal = objectNormal; +#endif`,R6n=`vec3 transformedNormal = objectNormal; #ifdef USE_INSTANCING mat3 m = mat3( instanceMatrix ); transformedNormal /= vec3( dot( m[ 0 ], m[ 0 ] ), dot( m[ 1 ], m[ 1 ] ), dot( m[ 2 ], m[ 2 ] ) ); @@ -1099,23 +1101,23 @@ transformedNormal = normalMatrix * transformedNormal; #ifdef FLIP_SIDED transformedTangent = - transformedTangent; #endif -#endif`,z6n=`#ifdef USE_DISPLACEMENTMAP +#endif`,D6n=`#ifdef USE_DISPLACEMENTMAP uniform sampler2D displacementMap; uniform float displacementScale; uniform float displacementBias; -#endif`,j6n=`#ifdef USE_DISPLACEMENTMAP +#endif`,I6n=`#ifdef USE_DISPLACEMENTMAP transformed += normalize( objectNormal ) * ( texture2D( displacementMap, vUv ).x * displacementScale + displacementBias ); -#endif`,B6n=`#ifdef USE_EMISSIVEMAP +#endif`,L6n=`#ifdef USE_EMISSIVEMAP vec4 emissiveColor = texture2D( emissiveMap, vUv ); totalEmissiveRadiance *= emissiveColor.rgb; -#endif`,U6n=`#ifdef USE_EMISSIVEMAP +#endif`,$6n=`#ifdef USE_EMISSIVEMAP uniform sampler2D emissiveMap; -#endif`,W6n="gl_FragColor = linearToOutputTexel( gl_FragColor );",V6n=`vec4 LinearToLinear( in vec4 value ) { +#endif`,F6n="gl_FragColor = linearToOutputTexel( gl_FragColor );",N6n=`vec4 LinearToLinear( in vec4 value ) { return value; } vec4 LinearTosRGB( in vec4 value ) { return vec4( mix( pow( value.rgb, vec3( 0.41666 ) ) * 1.055 - vec3( 0.055 ), value.rgb * 12.92, vec3( lessThanEqual( value.rgb, vec3( 0.0031308 ) ) ) ), value.a ); -}`,G6n=`#ifdef USE_ENVMAP +}`,z6n=`#ifdef USE_ENVMAP #ifdef ENV_WORLDPOS vec3 cameraToFrag; if ( isOrthographic ) { @@ -1146,7 +1148,7 @@ vec4 LinearTosRGB( in vec4 value ) { #elif defined( ENVMAP_BLENDING_ADD ) outgoingLight += envColor.xyz * specularStrength * reflectivity; #endif -#endif`,H6n=`#ifdef USE_ENVMAP +#endif`,j6n=`#ifdef USE_ENVMAP uniform float envMapIntensity; uniform float flipEnvMap; #ifdef ENVMAP_TYPE_CUBE @@ -1155,7 +1157,7 @@ vec4 LinearTosRGB( in vec4 value ) { uniform sampler2D envMap; #endif -#endif`,q6n=`#ifdef USE_ENVMAP +#endif`,B6n=`#ifdef USE_ENVMAP uniform float reflectivity; #if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( LAMBERT ) #define ENV_WORLDPOS @@ -1166,7 +1168,7 @@ vec4 LinearTosRGB( in vec4 value ) { #else varying vec3 vReflect; #endif -#endif`,X6n=`#ifdef USE_ENVMAP +#endif`,U6n=`#ifdef USE_ENVMAP #if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( LAMBERT ) #define ENV_WORLDPOS #endif @@ -1177,7 +1179,7 @@ vec4 LinearTosRGB( in vec4 value ) { varying vec3 vReflect; uniform float refractionRatio; #endif -#endif`,Y6n=`#ifdef USE_ENVMAP +#endif`,W6n=`#ifdef USE_ENVMAP #ifdef ENV_WORLDPOS vWorldPosition = worldPosition.xyz; #else @@ -1194,18 +1196,18 @@ vec4 LinearTosRGB( in vec4 value ) { vReflect = refract( cameraToVertex, worldNormal, refractionRatio ); #endif #endif -#endif`,Q6n=`#ifdef USE_FOG +#endif`,V6n=`#ifdef USE_FOG vFogDepth = - mvPosition.z; -#endif`,K6n=`#ifdef USE_FOG +#endif`,G6n=`#ifdef USE_FOG varying float vFogDepth; -#endif`,Z6n=`#ifdef USE_FOG +#endif`,H6n=`#ifdef USE_FOG #ifdef FOG_EXP2 float fogFactor = 1.0 - exp( - fogDensity * fogDensity * vFogDepth * vFogDepth ); #else float fogFactor = smoothstep( fogNear, fogFar, vFogDepth ); #endif gl_FragColor.rgb = mix( gl_FragColor.rgb, fogColor, fogFactor ); -#endif`,J6n=`#ifdef USE_FOG +#endif`,q6n=`#ifdef USE_FOG uniform vec3 fogColor; varying float vFogDepth; #ifdef FOG_EXP2 @@ -1214,7 +1216,7 @@ vec4 LinearTosRGB( in vec4 value ) { uniform float fogNear; uniform float fogFar; #endif -#endif`,eUn=`#ifdef USE_GRADIENTMAP +#endif`,X6n=`#ifdef USE_GRADIENTMAP uniform sampler2D gradientMap; #endif vec3 getGradientIrradiance( vec3 normal, vec3 lightDirection ) { @@ -1226,16 +1228,16 @@ vec3 getGradientIrradiance( vec3 normal, vec3 lightDirection ) { vec2 fw = fwidth( coord ) * 0.5; return mix( vec3( 0.7 ), vec3( 1.0 ), smoothstep( 0.7 - fw.x, 0.7 + fw.x, coord.x ) ); #endif -}`,tUn=`#ifdef USE_LIGHTMAP +}`,Y6n=`#ifdef USE_LIGHTMAP vec4 lightMapTexel = texture2D( lightMap, vUv2 ); vec3 lightMapIrradiance = lightMapTexel.rgb * lightMapIntensity; reflectedLight.indirectDiffuse += lightMapIrradiance; -#endif`,nUn=`#ifdef USE_LIGHTMAP +#endif`,Q6n=`#ifdef USE_LIGHTMAP uniform sampler2D lightMap; uniform float lightMapIntensity; -#endif`,rUn=`LambertMaterial material; +#endif`,K6n=`LambertMaterial material; material.diffuseColor = diffuseColor.rgb; -material.specularStrength = specularStrength;`,iUn=`varying vec3 vViewPosition; +material.specularStrength = specularStrength;`,Z6n=`varying vec3 vViewPosition; struct LambertMaterial { vec3 diffuseColor; float specularStrength; @@ -1250,7 +1252,7 @@ void RE_IndirectDiffuse_Lambert( const in vec3 irradiance, const in GeometricCon } #define RE_Direct RE_Direct_Lambert #define RE_IndirectDiffuse RE_IndirectDiffuse_Lambert -#define Material_LightProbeLOD( material ) (0)`,oUn=`uniform bool receiveShadow; +#define Material_LightProbeLOD( material ) (0)`,J6n=`uniform bool receiveShadow; uniform vec3 ambientLightColor; uniform vec3 lightProbe[ 9 ]; vec3 shGetIrradianceAt( in vec3 normal, in vec3 shCoefficients[ 9 ] ) { @@ -1371,7 +1373,7 @@ float getSpotAttenuation( const in float coneCosine, const in float penumbraCosi vec3 irradiance = mix( hemiLight.groundColor, hemiLight.skyColor, hemiDiffuseWeight ); return irradiance; } -#endif`,sUn=`#if defined( USE_ENVMAP ) +#endif`,eUn=`#if defined( USE_ENVMAP ) vec3 getIBLIrradiance( const in vec3 normal ) { #if defined( ENVMAP_TYPE_CUBE_UV ) vec3 worldNormal = inverseTransformDirection( normal, viewMatrix ); @@ -1392,8 +1394,8 @@ float getSpotAttenuation( const in float coneCosine, const in float penumbraCosi return vec3( 0.0 ); #endif } -#endif`,aUn=`ToonMaterial material; -material.diffuseColor = diffuseColor.rgb;`,lUn=`varying vec3 vViewPosition; +#endif`,tUn=`ToonMaterial material; +material.diffuseColor = diffuseColor.rgb;`,nUn=`varying vec3 vViewPosition; struct ToonMaterial { vec3 diffuseColor; }; @@ -1406,11 +1408,11 @@ void RE_IndirectDiffuse_Toon( const in vec3 irradiance, const in GeometricContex } #define RE_Direct RE_Direct_Toon #define RE_IndirectDiffuse RE_IndirectDiffuse_Toon -#define Material_LightProbeLOD( material ) (0)`,cUn=`BlinnPhongMaterial material; +#define Material_LightProbeLOD( material ) (0)`,rUn=`BlinnPhongMaterial material; material.diffuseColor = diffuseColor.rgb; material.specularColor = specular; material.specularShininess = shininess; -material.specularStrength = specularStrength;`,uUn=`varying vec3 vViewPosition; +material.specularStrength = specularStrength;`,iUn=`varying vec3 vViewPosition; struct BlinnPhongMaterial { vec3 diffuseColor; vec3 specularColor; @@ -1428,7 +1430,7 @@ void RE_IndirectDiffuse_BlinnPhong( const in vec3 irradiance, const in Geometric } #define RE_Direct RE_Direct_BlinnPhong #define RE_IndirectDiffuse RE_IndirectDiffuse_BlinnPhong -#define Material_LightProbeLOD( material ) (0)`,fUn=`PhysicalMaterial material; +#define Material_LightProbeLOD( material ) (0)`,oUn=`PhysicalMaterial material; material.diffuseColor = diffuseColor.rgb * ( 1.0 - metalnessFactor ); vec3 dxy = max( abs( dFdx( geometryNormal ) ), abs( dFdy( geometryNormal ) ) ); float geometryRoughness = max( max( dxy.x, dxy.y ), dxy.z ); @@ -1492,7 +1494,7 @@ material.roughness = min( material.roughness, 1.0 ); #ifdef USE_SHEENROUGHNESSMAP material.sheenRoughness *= texture2D( sheenRoughnessMap, vUv ).a; #endif -#endif`,dUn=`struct PhysicalMaterial { +#endif`,sUn=`struct PhysicalMaterial { vec3 diffuseColor; float roughness; vec3 specularColor; @@ -1641,7 +1643,7 @@ void RE_IndirectSpecular_Physical( const in vec3 radiance, const in vec3 irradia #define RE_IndirectSpecular RE_IndirectSpecular_Physical float computeSpecularOcclusion( const in float dotNV, const in float ambientOcclusion, const in float roughness ) { return saturate( pow( dotNV + ambientOcclusion, exp2( - 16.0 * roughness - 1.0 ) ) - 1.0 + ambientOcclusion ); -}`,hUn=` +}`,aUn=` GeometricContext geometry; geometry.position = - vViewPosition; geometry.normal = normal; @@ -1754,7 +1756,7 @@ IncidentLight directLight; #if defined( RE_IndirectSpecular ) vec3 radiance = vec3( 0.0 ); vec3 clearcoatRadiance = vec3( 0.0 ); -#endif`,pUn=`#if defined( RE_IndirectDiffuse ) +#endif`,lUn=`#if defined( RE_IndirectDiffuse ) #ifdef USE_LIGHTMAP vec4 lightMapTexel = texture2D( lightMap, vUv2 ); vec3 lightMapIrradiance = lightMapTexel.rgb * lightMapIntensity; @@ -1769,25 +1771,25 @@ IncidentLight directLight; #ifdef USE_CLEARCOAT clearcoatRadiance += getIBLRadiance( geometry.viewDir, geometry.clearcoatNormal, material.clearcoatRoughness ); #endif -#endif`,gUn=`#if defined( RE_IndirectDiffuse ) +#endif`,cUn=`#if defined( RE_IndirectDiffuse ) RE_IndirectDiffuse( irradiance, geometry, material, reflectedLight ); #endif #if defined( RE_IndirectSpecular ) RE_IndirectSpecular( radiance, iblIrradiance, clearcoatRadiance, geometry, material, reflectedLight ); -#endif`,mUn=`#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT ) +#endif`,uUn=`#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT ) gl_FragDepthEXT = vIsPerspective == 0.0 ? gl_FragCoord.z : log2( vFragDepth ) * logDepthBufFC * 0.5; -#endif`,vUn=`#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT ) +#endif`,fUn=`#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT ) uniform float logDepthBufFC; varying float vFragDepth; varying float vIsPerspective; -#endif`,yUn=`#ifdef USE_LOGDEPTHBUF +#endif`,dUn=`#ifdef USE_LOGDEPTHBUF #ifdef USE_LOGDEPTHBUF_EXT varying float vFragDepth; varying float vIsPerspective; #else uniform float logDepthBufFC; #endif -#endif`,xUn=`#ifdef USE_LOGDEPTHBUF +#endif`,hUn=`#ifdef USE_LOGDEPTHBUF #ifdef USE_LOGDEPTHBUF_EXT vFragDepth = 1.0 + gl_Position.w; vIsPerspective = float( isPerspectiveMatrix( projectionMatrix ) ); @@ -1797,15 +1799,15 @@ IncidentLight directLight; gl_Position.z *= gl_Position.w; } #endif -#endif`,bUn=`#ifdef USE_MAP +#endif`,pUn=`#ifdef USE_MAP vec4 sampledDiffuseColor = texture2D( map, vUv ); #ifdef DECODE_VIDEO_TEXTURE sampledDiffuseColor = vec4( mix( pow( sampledDiffuseColor.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), sampledDiffuseColor.rgb * 0.0773993808, vec3( lessThanEqual( sampledDiffuseColor.rgb, vec3( 0.04045 ) ) ) ), sampledDiffuseColor.w ); #endif diffuseColor *= sampledDiffuseColor; -#endif`,wUn=`#ifdef USE_MAP +#endif`,gUn=`#ifdef USE_MAP uniform sampler2D map; -#endif`,_Un=`#if defined( USE_MAP ) || defined( USE_ALPHAMAP ) +#endif`,mUn=`#if defined( USE_MAP ) || defined( USE_ALPHAMAP ) vec2 uv = ( uvTransform * vec3( gl_PointCoord.x, 1.0 - gl_PointCoord.y, 1 ) ).xy; #endif #ifdef USE_MAP @@ -1813,7 +1815,7 @@ IncidentLight directLight; #endif #ifdef USE_ALPHAMAP diffuseColor.a *= texture2D( alphaMap, uv ).g; -#endif`,SUn=`#if defined( USE_MAP ) || defined( USE_ALPHAMAP ) +#endif`,vUn=`#if defined( USE_MAP ) || defined( USE_ALPHAMAP ) uniform mat3 uvTransform; #endif #ifdef USE_MAP @@ -1821,13 +1823,13 @@ IncidentLight directLight; #endif #ifdef USE_ALPHAMAP uniform sampler2D alphaMap; -#endif`,CUn=`float metalnessFactor = metalness; +#endif`,yUn=`float metalnessFactor = metalness; #ifdef USE_METALNESSMAP vec4 texelMetalness = texture2D( metalnessMap, vUv ); metalnessFactor *= texelMetalness.b; -#endif`,OUn=`#ifdef USE_METALNESSMAP +#endif`,xUn=`#ifdef USE_METALNESSMAP uniform sampler2D metalnessMap; -#endif`,EUn=`#if defined( USE_MORPHCOLORS ) && defined( MORPHTARGETS_TEXTURE ) +#endif`,bUn=`#if defined( USE_MORPHCOLORS ) && defined( MORPHTARGETS_TEXTURE ) vColor *= morphTargetBaseInfluence; for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) { #if defined( USE_COLOR_ALPHA ) @@ -1836,7 +1838,7 @@ IncidentLight directLight; if ( morphTargetInfluences[ i ] != 0.0 ) vColor += getMorph( gl_VertexID, i, 2 ).rgb * morphTargetInfluences[ i ]; #endif } -#endif`,TUn=`#ifdef USE_MORPHNORMALS +#endif`,wUn=`#ifdef USE_MORPHNORMALS objectNormal *= morphTargetBaseInfluence; #ifdef MORPHTARGETS_TEXTURE for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) { @@ -1848,7 +1850,7 @@ IncidentLight directLight; objectNormal += morphNormal2 * morphTargetInfluences[ 2 ]; objectNormal += morphNormal3 * morphTargetInfluences[ 3 ]; #endif -#endif`,kUn=`#ifdef USE_MORPHTARGETS +#endif`,_Un=`#ifdef USE_MORPHTARGETS uniform float morphTargetBaseInfluence; #ifdef MORPHTARGETS_TEXTURE uniform float morphTargetInfluences[ MORPHTARGETS_COUNT ]; @@ -1868,7 +1870,7 @@ IncidentLight directLight; uniform float morphTargetInfluences[ 4 ]; #endif #endif -#endif`,AUn=`#ifdef USE_MORPHTARGETS +#endif`,SUn=`#ifdef USE_MORPHTARGETS transformed *= morphTargetBaseInfluence; #ifdef MORPHTARGETS_TEXTURE for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) { @@ -1886,7 +1888,7 @@ IncidentLight directLight; transformed += morphTarget7 * morphTargetInfluences[ 7 ]; #endif #endif -#endif`,PUn=`float faceDirection = gl_FrontFacing ? 1.0 : - 1.0; +#endif`,CUn=`float faceDirection = gl_FrontFacing ? 1.0 : - 1.0; #ifdef FLAT_SHADED vec3 fdx = vec3( dFdx( vViewPosition.x ), dFdx( vViewPosition.y ), dFdx( vViewPosition.z ) ); vec3 fdy = vec3( dFdy( vViewPosition.x ), dFdy( vViewPosition.y ), dFdy( vViewPosition.z ) ); @@ -1908,7 +1910,7 @@ IncidentLight directLight; #endif #endif #endif -vec3 geometryNormal = normal;`,MUn=`#ifdef OBJECTSPACE_NORMALMAP +vec3 geometryNormal = normal;`,OUn=`#ifdef OBJECTSPACE_NORMALMAP normal = texture2D( normalMap, vUv ).xyz * 2.0 - 1.0; #ifdef FLIP_SIDED normal = - normal; @@ -1927,25 +1929,25 @@ vec3 geometryNormal = normal;`,MUn=`#ifdef OBJECTSPACE_NORMALMAP #endif #elif defined( USE_BUMPMAP ) normal = perturbNormalArb( - vViewPosition, normal, dHdxy_fwd(), faceDirection ); -#endif`,RUn=`#ifndef FLAT_SHADED +#endif`,EUn=`#ifndef FLAT_SHADED varying vec3 vNormal; #ifdef USE_TANGENT varying vec3 vTangent; varying vec3 vBitangent; #endif -#endif`,DUn=`#ifndef FLAT_SHADED +#endif`,TUn=`#ifndef FLAT_SHADED varying vec3 vNormal; #ifdef USE_TANGENT varying vec3 vTangent; varying vec3 vBitangent; #endif -#endif`,IUn=`#ifndef FLAT_SHADED +#endif`,kUn=`#ifndef FLAT_SHADED vNormal = normalize( transformedNormal ); #ifdef USE_TANGENT vTangent = normalize( transformedTangent ); vBitangent = normalize( cross( vNormal, vTangent ) * tangent.w ); #endif -#endif`,LUn=`#ifdef USE_NORMALMAP +#endif`,AUn=`#ifdef USE_NORMALMAP uniform sampler2D normalMap; uniform vec2 normalScale; #endif @@ -1967,9 +1969,9 @@ vec3 geometryNormal = normal;`,MUn=`#ifdef OBJECTSPACE_NORMALMAP float scale = ( det == 0.0 ) ? 0.0 : faceDirection * inversesqrt( det ); return normalize( T * ( mapN.x * scale ) + B * ( mapN.y * scale ) + N * mapN.z ); } -#endif`,$Un=`#ifdef USE_CLEARCOAT +#endif`,PUn=`#ifdef USE_CLEARCOAT vec3 clearcoatNormal = geometryNormal; -#endif`,FUn=`#ifdef USE_CLEARCOAT_NORMALMAP +#endif`,MUn=`#ifdef USE_CLEARCOAT_NORMALMAP vec3 clearcoatMapN = texture2D( clearcoatNormalMap, vUv ).xyz * 2.0 - 1.0; clearcoatMapN.xy *= clearcoatNormalScale; #ifdef USE_TANGENT @@ -1977,7 +1979,7 @@ vec3 geometryNormal = normal;`,MUn=`#ifdef OBJECTSPACE_NORMALMAP #else clearcoatNormal = perturbNormal2Arb( - vViewPosition, clearcoatNormal, clearcoatMapN, faceDirection ); #endif -#endif`,NUn=`#ifdef USE_CLEARCOATMAP +#endif`,RUn=`#ifdef USE_CLEARCOATMAP uniform sampler2D clearcoatMap; #endif #ifdef USE_CLEARCOAT_ROUGHNESSMAP @@ -1986,18 +1988,18 @@ vec3 geometryNormal = normal;`,MUn=`#ifdef OBJECTSPACE_NORMALMAP #ifdef USE_CLEARCOAT_NORMALMAP uniform sampler2D clearcoatNormalMap; uniform vec2 clearcoatNormalScale; -#endif`,zUn=`#ifdef USE_IRIDESCENCEMAP +#endif`,DUn=`#ifdef USE_IRIDESCENCEMAP uniform sampler2D iridescenceMap; #endif #ifdef USE_IRIDESCENCE_THICKNESSMAP uniform sampler2D iridescenceThicknessMap; -#endif`,jUn=`#ifdef OPAQUE +#endif`,IUn=`#ifdef OPAQUE diffuseColor.a = 1.0; #endif #ifdef USE_TRANSMISSION diffuseColor.a *= material.transmissionAlpha + 0.1; #endif -gl_FragColor = vec4( outgoingLight, diffuseColor.a );`,BUn=`vec3 packNormalToRGB( const in vec3 normal ) { +gl_FragColor = vec4( outgoingLight, diffuseColor.a );`,LUn=`vec3 packNormalToRGB( const in vec3 normal ) { return normalize( normal ) * 0.5 + 0.5; } vec3 unpackRGBToNormal( const in vec3 rgb ) { @@ -2032,29 +2034,29 @@ float viewZToPerspectiveDepth( const in float viewZ, const in float near, const } float perspectiveDepthToViewZ( const in float invClipZ, const in float near, const in float far ) { return ( near * far ) / ( ( far - near ) * invClipZ - far ); -}`,UUn=`#ifdef PREMULTIPLIED_ALPHA +}`,$Un=`#ifdef PREMULTIPLIED_ALPHA gl_FragColor.rgb *= gl_FragColor.a; -#endif`,WUn=`vec4 mvPosition = vec4( transformed, 1.0 ); +#endif`,FUn=`vec4 mvPosition = vec4( transformed, 1.0 ); #ifdef USE_INSTANCING mvPosition = instanceMatrix * mvPosition; #endif mvPosition = modelViewMatrix * mvPosition; -gl_Position = projectionMatrix * mvPosition;`,VUn=`#ifdef DITHERING +gl_Position = projectionMatrix * mvPosition;`,NUn=`#ifdef DITHERING gl_FragColor.rgb = dithering( gl_FragColor.rgb ); -#endif`,GUn=`#ifdef DITHERING +#endif`,zUn=`#ifdef DITHERING vec3 dithering( vec3 color ) { float grid_position = rand( gl_FragCoord.xy ); vec3 dither_shift_RGB = vec3( 0.25 / 255.0, -0.25 / 255.0, 0.25 / 255.0 ); dither_shift_RGB = mix( 2.0 * dither_shift_RGB, -2.0 * dither_shift_RGB, grid_position ); return color + dither_shift_RGB; } -#endif`,HUn=`float roughnessFactor = roughness; +#endif`,jUn=`float roughnessFactor = roughness; #ifdef USE_ROUGHNESSMAP vec4 texelRoughness = texture2D( roughnessMap, vUv ); roughnessFactor *= texelRoughness.g; -#endif`,qUn=`#ifdef USE_ROUGHNESSMAP +#endif`,BUn=`#ifdef USE_ROUGHNESSMAP uniform sampler2D roughnessMap; -#endif`,XUn=`#if NUM_SPOT_LIGHT_COORDS > 0 +#endif`,UUn=`#if NUM_SPOT_LIGHT_COORDS > 0 varying vec4 vSpotLightCoord[ NUM_SPOT_LIGHT_COORDS ]; #endif #if NUM_SPOT_LIGHT_MAPS > 0 @@ -2233,7 +2235,7 @@ gl_Position = projectionMatrix * mvPosition;`,VUn=`#ifdef DITHERING return texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp ); #endif } -#endif`,YUn=`#if NUM_SPOT_LIGHT_COORDS > 0 +#endif`,WUn=`#if NUM_SPOT_LIGHT_COORDS > 0 uniform mat4 spotLightMatrix[ NUM_SPOT_LIGHT_COORDS ]; varying vec4 vSpotLightCoord[ NUM_SPOT_LIGHT_COORDS ]; #endif @@ -2271,7 +2273,7 @@ gl_Position = projectionMatrix * mvPosition;`,VUn=`#ifdef DITHERING }; uniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ]; #endif -#endif`,QUn=`#if defined( USE_SHADOWMAP ) || ( NUM_SPOT_LIGHT_COORDS > 0 ) +#endif`,VUn=`#if defined( USE_SHADOWMAP ) || ( NUM_SPOT_LIGHT_COORDS > 0 ) #if NUM_DIR_LIGHT_SHADOWS > 0 || NUM_SPOT_LIGHT_COORDS > 0 || NUM_POINT_LIGHT_SHADOWS > 0 vec3 shadowWorldNormal = inverseTransformDirection( transformedNormal, viewMatrix ); vec4 shadowWorldPosition; @@ -2303,7 +2305,7 @@ gl_Position = projectionMatrix * mvPosition;`,VUn=`#ifdef DITHERING } #pragma unroll_loop_end #endif -#endif`,KUn=`float getShadowMask() { +#endif`,GUn=`float getShadowMask() { float shadow = 1.0; #ifdef USE_SHADOWMAP #if NUM_DIR_LIGHT_SHADOWS > 0 @@ -2335,12 +2337,12 @@ gl_Position = projectionMatrix * mvPosition;`,VUn=`#ifdef DITHERING #endif #endif return shadow; -}`,ZUn=`#ifdef USE_SKINNING +}`,HUn=`#ifdef USE_SKINNING mat4 boneMatX = getBoneMatrix( skinIndex.x ); mat4 boneMatY = getBoneMatrix( skinIndex.y ); mat4 boneMatZ = getBoneMatrix( skinIndex.z ); mat4 boneMatW = getBoneMatrix( skinIndex.w ); -#endif`,JUn=`#ifdef USE_SKINNING +#endif`,qUn=`#ifdef USE_SKINNING uniform mat4 bindMatrix; uniform mat4 bindMatrixInverse; uniform highp sampler2D boneTexture; @@ -2359,7 +2361,7 @@ gl_Position = projectionMatrix * mvPosition;`,VUn=`#ifdef DITHERING mat4 bone = mat4( v1, v2, v3, v4 ); return bone; } -#endif`,e8n=`#ifdef USE_SKINNING +#endif`,XUn=`#ifdef USE_SKINNING vec4 skinVertex = bindMatrix * vec4( transformed, 1.0 ); vec4 skinned = vec4( 0.0 ); skinned += boneMatX * skinVertex * skinWeight.x; @@ -2367,7 +2369,7 @@ gl_Position = projectionMatrix * mvPosition;`,VUn=`#ifdef DITHERING skinned += boneMatZ * skinVertex * skinWeight.z; skinned += boneMatW * skinVertex * skinWeight.w; transformed = ( bindMatrixInverse * skinned ).xyz; -#endif`,t8n=`#ifdef USE_SKINNING +#endif`,YUn=`#ifdef USE_SKINNING mat4 skinMatrix = mat4( 0.0 ); skinMatrix += skinWeight.x * boneMatX; skinMatrix += skinWeight.y * boneMatY; @@ -2378,17 +2380,17 @@ gl_Position = projectionMatrix * mvPosition;`,VUn=`#ifdef DITHERING #ifdef USE_TANGENT objectTangent = vec4( skinMatrix * vec4( objectTangent, 0.0 ) ).xyz; #endif -#endif`,n8n=`float specularStrength; +#endif`,QUn=`float specularStrength; #ifdef USE_SPECULARMAP vec4 texelSpecular = texture2D( specularMap, vUv ); specularStrength = texelSpecular.r; #else specularStrength = 1.0; -#endif`,r8n=`#ifdef USE_SPECULARMAP +#endif`,KUn=`#ifdef USE_SPECULARMAP uniform sampler2D specularMap; -#endif`,i8n=`#if defined( TONE_MAPPING ) +#endif`,ZUn=`#if defined( TONE_MAPPING ) gl_FragColor.rgb = toneMapping( gl_FragColor.rgb ); -#endif`,o8n=`#ifndef saturate +#endif`,JUn=`#ifndef saturate #define saturate( a ) clamp( a, 0.0, 1.0 ) #endif uniform float toneMappingExposure; @@ -2424,7 +2426,7 @@ vec3 ACESFilmicToneMapping( vec3 color ) { color = ACESOutputMat * color; return saturate( color ); } -vec3 CustomToneMapping( vec3 color ) { return color; }`,s8n=`#ifdef USE_TRANSMISSION +vec3 CustomToneMapping( vec3 color ) { return color; }`,e8n=`#ifdef USE_TRANSMISSION material.transmission = transmission; material.transmissionAlpha = 1.0; material.thickness = thickness; @@ -2445,7 +2447,7 @@ vec3 CustomToneMapping( vec3 color ) { return color; }`,s8n=`#ifdef USE_TRANSMIS material.attenuationColor, material.attenuationDistance ); material.transmissionAlpha = mix( material.transmissionAlpha, transmission.a, material.transmission ); totalDiffuse = mix( totalDiffuse, transmission.rgb, material.transmission ); -#endif`,a8n=`#ifdef USE_TRANSMISSION +#endif`,t8n=`#ifdef USE_TRANSMISSION uniform float transmission; uniform float thickness; uniform float attenuationDistance; @@ -2503,37 +2505,37 @@ vec3 CustomToneMapping( vec3 color ) { return color; }`,s8n=`#ifdef USE_TRANSMIS vec3 F = EnvironmentBRDF( n, v, specularColor, specularF90, roughness ); return vec4( ( 1.0 - F ) * attenuatedColor * diffuseColor, transmittedLight.a ); } -#endif`,l8n=`#if ( defined( USE_UV ) && ! defined( UVS_VERTEX_ONLY ) ) +#endif`,n8n=`#if ( defined( USE_UV ) && ! defined( UVS_VERTEX_ONLY ) ) varying vec2 vUv; -#endif`,c8n=`#ifdef USE_UV +#endif`,r8n=`#ifdef USE_UV #ifdef UVS_VERTEX_ONLY vec2 vUv; #else varying vec2 vUv; #endif uniform mat3 uvTransform; -#endif`,u8n=`#ifdef USE_UV +#endif`,i8n=`#ifdef USE_UV vUv = ( uvTransform * vec3( uv, 1 ) ).xy; -#endif`,f8n=`#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP ) +#endif`,o8n=`#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP ) varying vec2 vUv2; -#endif`,d8n=`#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP ) +#endif`,s8n=`#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP ) attribute vec2 uv2; varying vec2 vUv2; uniform mat3 uv2Transform; -#endif`,h8n=`#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP ) +#endif`,a8n=`#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP ) vUv2 = ( uv2Transform * vec3( uv2, 1 ) ).xy; -#endif`,p8n=`#if defined( USE_ENVMAP ) || defined( DISTANCE ) || defined ( USE_SHADOWMAP ) || defined ( USE_TRANSMISSION ) || NUM_SPOT_LIGHT_COORDS > 0 +#endif`,l8n=`#if defined( USE_ENVMAP ) || defined( DISTANCE ) || defined ( USE_SHADOWMAP ) || defined ( USE_TRANSMISSION ) || NUM_SPOT_LIGHT_COORDS > 0 vec4 worldPosition = vec4( transformed, 1.0 ); #ifdef USE_INSTANCING worldPosition = instanceMatrix * worldPosition; #endif worldPosition = modelMatrix * worldPosition; -#endif`;const g8n=`varying vec2 vUv; +#endif`;const c8n=`varying vec2 vUv; uniform mat3 uvTransform; void main() { vUv = ( uvTransform * vec3( uv, 1 ) ).xy; gl_Position = vec4( position.xy, 1.0, 1.0 ); -}`,m8n=`uniform sampler2D t2D; +}`,u8n=`uniform sampler2D t2D; varying vec2 vUv; void main() { gl_FragColor = texture2D( t2D, vUv ); @@ -2542,14 +2544,14 @@ void main() { #endif #include #include -}`,v8n=`varying vec3 vWorldDirection; +}`,f8n=`varying vec3 vWorldDirection; #include void main() { vWorldDirection = transformDirection( position, modelMatrix ); #include #include gl_Position.z = gl_Position.w; -}`,y8n=`#include +}`,d8n=`#include uniform float opacity; varying vec3 vWorldDirection; #include @@ -2560,7 +2562,7 @@ void main() { gl_FragColor.a *= opacity; #include #include -}`,x8n=`#include +}`,h8n=`#include #include #include #include @@ -2584,7 +2586,7 @@ void main() { #include #include vHighPrecisionZW = gl_Position.zw; -}`,b8n=`#if DEPTH_PACKING == 3200 +}`,p8n=`#if DEPTH_PACKING == 3200 uniform float opacity; #endif #include @@ -2612,7 +2614,7 @@ void main() { #elif DEPTH_PACKING == 3201 gl_FragColor = packDepthToRGBA( fragCoordZ ); #endif -}`,w8n=`#define DISTANCE +}`,g8n=`#define DISTANCE varying vec3 vWorldPosition; #include #include @@ -2636,7 +2638,7 @@ void main() { #include #include vWorldPosition = worldPosition.xyz; -}`,_8n=`#define DISTANCE +}`,m8n=`#define DISTANCE uniform vec3 referencePosition; uniform float nearDistance; uniform float farDistance; @@ -2658,13 +2660,13 @@ void main () { dist = ( dist - nearDistance ) / ( farDistance - nearDistance ); dist = saturate( dist ); gl_FragColor = packDepthToRGBA( dist ); -}`,S8n=`varying vec3 vWorldDirection; +}`,v8n=`varying vec3 vWorldDirection; #include void main() { vWorldDirection = transformDirection( position, modelMatrix ); #include #include -}`,C8n=`uniform sampler2D tEquirect; +}`,y8n=`uniform sampler2D tEquirect; varying vec3 vWorldDirection; #include void main() { @@ -2673,7 +2675,7 @@ void main() { gl_FragColor = texture2D( tEquirect, sampleUV ); #include #include -}`,O8n=`uniform float scale; +}`,x8n=`uniform float scale; attribute float lineDistance; varying float vLineDistance; #include @@ -2692,7 +2694,7 @@ void main() { #include #include #include -}`,E8n=`uniform vec3 diffuse; +}`,b8n=`uniform vec3 diffuse; uniform float opacity; uniform float dashSize; uniform float totalSize; @@ -2717,7 +2719,7 @@ void main() { #include #include #include -}`,T8n=`#include +}`,w8n=`#include #include #include #include @@ -2748,7 +2750,7 @@ void main() { #include #include #include -}`,k8n=`uniform vec3 diffuse; +}`,_8n=`uniform vec3 diffuse; uniform float opacity; #ifndef FLAT_SHADED varying vec3 vNormal; @@ -2795,7 +2797,7 @@ void main() { #include #include #include -}`,A8n=`#define LAMBERT +}`,S8n=`#define LAMBERT varying vec3 vViewPosition; #include #include @@ -2833,7 +2835,7 @@ void main() { #include #include #include -}`,P8n=`#define LAMBERT +}`,C8n=`#define LAMBERT uniform vec3 diffuse; uniform vec3 emissive; uniform float opacity; @@ -2889,7 +2891,7 @@ void main() { #include #include #include -}`,M8n=`#define MATCAP +}`,O8n=`#define MATCAP varying vec3 vViewPosition; #include #include @@ -2920,7 +2922,7 @@ void main() { #include #include vViewPosition = - mvPosition.xyz; -}`,R8n=`#define MATCAP +}`,E8n=`#define MATCAP uniform vec3 diffuse; uniform float opacity; uniform sampler2D matcap; @@ -2964,7 +2966,7 @@ void main() { #include #include #include -}`,D8n=`#define NORMAL +}`,T8n=`#define NORMAL #if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( TANGENTSPACE_NORMALMAP ) varying vec3 vViewPosition; #endif @@ -2994,7 +2996,7 @@ void main() { #if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( TANGENTSPACE_NORMALMAP ) vViewPosition = - mvPosition.xyz; #endif -}`,I8n=`#define NORMAL +}`,k8n=`#define NORMAL uniform float opacity; #if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( TANGENTSPACE_NORMALMAP ) varying vec3 vViewPosition; @@ -3015,7 +3017,7 @@ void main() { #ifdef OPAQUE gl_FragColor.a = 1.0; #endif -}`,L8n=`#define PHONG +}`,A8n=`#define PHONG varying vec3 vViewPosition; #include #include @@ -3053,7 +3055,7 @@ void main() { #include #include #include -}`,$8n=`#define PHONG +}`,P8n=`#define PHONG uniform vec3 diffuse; uniform vec3 emissive; uniform vec3 specular; @@ -3111,7 +3113,7 @@ void main() { #include #include #include -}`,F8n=`#define STANDARD +}`,M8n=`#define STANDARD varying vec3 vViewPosition; #ifdef USE_TRANSMISSION varying vec3 vWorldPosition; @@ -3153,7 +3155,7 @@ void main() { #ifdef USE_TRANSMISSION vWorldPosition = worldPosition.xyz; #endif -}`,N8n=`#define STANDARD +}`,R8n=`#define STANDARD #ifdef PHYSICAL #define IOR #define SPECULAR @@ -3269,7 +3271,7 @@ void main() { #include #include #include -}`,z8n=`#define TOON +}`,D8n=`#define TOON varying vec3 vViewPosition; #include #include @@ -3305,7 +3307,7 @@ void main() { #include #include #include -}`,j8n=`#define TOON +}`,I8n=`#define TOON uniform vec3 diffuse; uniform vec3 emissive; uniform float opacity; @@ -3357,7 +3359,7 @@ void main() { #include #include #include -}`,B8n=`uniform float size; +}`,L8n=`uniform float size; uniform float scale; #include #include @@ -3380,7 +3382,7 @@ void main() { #include #include #include -}`,U8n=`uniform vec3 diffuse; +}`,$8n=`uniform vec3 diffuse; uniform float opacity; #include #include @@ -3403,7 +3405,7 @@ void main() { #include #include #include -}`,W8n=`#include +}`,F8n=`#include #include #include #include @@ -3421,7 +3423,7 @@ void main() { #include #include #include -}`,V8n=`uniform vec3 color; +}`,N8n=`uniform vec3 color; uniform float opacity; #include #include @@ -3435,7 +3437,7 @@ void main() { #include #include #include -}`,G8n=`uniform float rotation; +}`,z8n=`uniform float rotation; uniform vec2 center; #include #include @@ -3461,7 +3463,7 @@ void main() { #include #include #include -}`,H8n=`uniform vec3 diffuse; +}`,j8n=`uniform vec3 diffuse; uniform float opacity; #include #include @@ -3484,7 +3486,7 @@ void main() { #include #include #include -}`,On={alphamap_fragment:v6n,alphamap_pars_fragment:y6n,alphatest_fragment:x6n,alphatest_pars_fragment:b6n,aomap_fragment:w6n,aomap_pars_fragment:_6n,begin_vertex:S6n,beginnormal_vertex:C6n,bsdfs:O6n,iridescence_fragment:E6n,bumpmap_pars_fragment:T6n,clipping_planes_fragment:k6n,clipping_planes_pars_fragment:A6n,clipping_planes_pars_vertex:P6n,clipping_planes_vertex:M6n,color_fragment:R6n,color_pars_fragment:D6n,color_pars_vertex:I6n,color_vertex:L6n,common:$6n,cube_uv_reflection_fragment:F6n,defaultnormal_vertex:N6n,displacementmap_pars_vertex:z6n,displacementmap_vertex:j6n,emissivemap_fragment:B6n,emissivemap_pars_fragment:U6n,encodings_fragment:W6n,encodings_pars_fragment:V6n,envmap_fragment:G6n,envmap_common_pars_fragment:H6n,envmap_pars_fragment:q6n,envmap_pars_vertex:X6n,envmap_physical_pars_fragment:sUn,envmap_vertex:Y6n,fog_vertex:Q6n,fog_pars_vertex:K6n,fog_fragment:Z6n,fog_pars_fragment:J6n,gradientmap_pars_fragment:eUn,lightmap_fragment:tUn,lightmap_pars_fragment:nUn,lights_lambert_fragment:rUn,lights_lambert_pars_fragment:iUn,lights_pars_begin:oUn,lights_toon_fragment:aUn,lights_toon_pars_fragment:lUn,lights_phong_fragment:cUn,lights_phong_pars_fragment:uUn,lights_physical_fragment:fUn,lights_physical_pars_fragment:dUn,lights_fragment_begin:hUn,lights_fragment_maps:pUn,lights_fragment_end:gUn,logdepthbuf_fragment:mUn,logdepthbuf_pars_fragment:vUn,logdepthbuf_pars_vertex:yUn,logdepthbuf_vertex:xUn,map_fragment:bUn,map_pars_fragment:wUn,map_particle_fragment:_Un,map_particle_pars_fragment:SUn,metalnessmap_fragment:CUn,metalnessmap_pars_fragment:OUn,morphcolor_vertex:EUn,morphnormal_vertex:TUn,morphtarget_pars_vertex:kUn,morphtarget_vertex:AUn,normal_fragment_begin:PUn,normal_fragment_maps:MUn,normal_pars_fragment:RUn,normal_pars_vertex:DUn,normal_vertex:IUn,normalmap_pars_fragment:LUn,clearcoat_normal_fragment_begin:$Un,clearcoat_normal_fragment_maps:FUn,clearcoat_pars_fragment:NUn,iridescence_pars_fragment:zUn,output_fragment:jUn,packing:BUn,premultiplied_alpha_fragment:UUn,project_vertex:WUn,dithering_fragment:VUn,dithering_pars_fragment:GUn,roughnessmap_fragment:HUn,roughnessmap_pars_fragment:qUn,shadowmap_pars_fragment:XUn,shadowmap_pars_vertex:YUn,shadowmap_vertex:QUn,shadowmask_pars_fragment:KUn,skinbase_vertex:ZUn,skinning_pars_vertex:JUn,skinning_vertex:e8n,skinnormal_vertex:t8n,specularmap_fragment:n8n,specularmap_pars_fragment:r8n,tonemapping_fragment:i8n,tonemapping_pars_fragment:o8n,transmission_fragment:s8n,transmission_pars_fragment:a8n,uv_pars_fragment:l8n,uv_pars_vertex:c8n,uv_vertex:u8n,uv2_pars_fragment:f8n,uv2_pars_vertex:d8n,uv2_vertex:h8n,worldpos_vertex:p8n,background_vert:g8n,background_frag:m8n,cube_vert:v8n,cube_frag:y8n,depth_vert:x8n,depth_frag:b8n,distanceRGBA_vert:w8n,distanceRGBA_frag:_8n,equirect_vert:S8n,equirect_frag:C8n,linedashed_vert:O8n,linedashed_frag:E8n,meshbasic_vert:T8n,meshbasic_frag:k8n,meshlambert_vert:A8n,meshlambert_frag:P8n,meshmatcap_vert:M8n,meshmatcap_frag:R8n,meshnormal_vert:D8n,meshnormal_frag:I8n,meshphong_vert:L8n,meshphong_frag:$8n,meshphysical_vert:F8n,meshphysical_frag:N8n,meshtoon_vert:z8n,meshtoon_frag:j8n,points_vert:B8n,points_frag:U8n,shadow_vert:W8n,shadow_frag:V8n,sprite_vert:G8n,sprite_frag:H8n},ft={common:{diffuse:{value:new ci(16777215)},opacity:{value:1},map:{value:null},uvTransform:{value:new fc},uv2Transform:{value:new fc},alphaMap:{value:null},alphaTest:{value:0}},specularmap:{specularMap:{value:null}},envmap:{envMap:{value:null},flipEnvMap:{value:-1},reflectivity:{value:1},ior:{value:1.5},refractionRatio:{value:.98}},aomap:{aoMap:{value:null},aoMapIntensity:{value:1}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1}},emissivemap:{emissiveMap:{value:null}},bumpmap:{bumpMap:{value:null},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalScale:{value:new En(1,1)}},displacementmap:{displacementMap:{value:null},displacementScale:{value:1},displacementBias:{value:0}},roughnessmap:{roughnessMap:{value:null}},metalnessmap:{metalnessMap:{value:null}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:25e-5},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new ci(16777215)}},lights:{ambientLightColor:{value:[]},lightProbe:{value:[]},directionalLights:{value:[],properties:{direction:{},color:{}}},directionalLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},directionalShadowMap:{value:[]},directionalShadowMatrix:{value:[]},spotLights:{value:[],properties:{color:{},position:{},direction:{},distance:{},coneCos:{},penumbraCos:{},decay:{}}},spotLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},spotLightMap:{value:[]},spotShadowMap:{value:[]},spotLightMatrix:{value:[]},pointLights:{value:[],properties:{color:{},position:{},decay:{},distance:{}}},pointLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{},shadowCameraNear:{},shadowCameraFar:{}}},pointShadowMap:{value:[]},pointShadowMatrix:{value:[]},hemisphereLights:{value:[],properties:{direction:{},skyColor:{},groundColor:{}}},rectAreaLights:{value:[],properties:{color:{},position:{},width:{},height:{}}},ltc_1:{value:null},ltc_2:{value:null}},points:{diffuse:{value:new ci(16777215)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},alphaTest:{value:0},uvTransform:{value:new fc}},sprite:{diffuse:{value:new ci(16777215)},opacity:{value:1},center:{value:new En(.5,.5)},rotation:{value:0},map:{value:null},alphaMap:{value:null},alphaTest:{value:0},uvTransform:{value:new fc}}},$d={basic:{uniforms:Ls([ft.common,ft.specularmap,ft.envmap,ft.aomap,ft.lightmap,ft.fog]),vertexShader:On.meshbasic_vert,fragmentShader:On.meshbasic_frag},lambert:{uniforms:Ls([ft.common,ft.specularmap,ft.envmap,ft.aomap,ft.lightmap,ft.emissivemap,ft.bumpmap,ft.normalmap,ft.displacementmap,ft.fog,ft.lights,{emissive:{value:new ci(0)}}]),vertexShader:On.meshlambert_vert,fragmentShader:On.meshlambert_frag},phong:{uniforms:Ls([ft.common,ft.specularmap,ft.envmap,ft.aomap,ft.lightmap,ft.emissivemap,ft.bumpmap,ft.normalmap,ft.displacementmap,ft.fog,ft.lights,{emissive:{value:new ci(0)},specular:{value:new ci(1118481)},shininess:{value:30}}]),vertexShader:On.meshphong_vert,fragmentShader:On.meshphong_frag},standard:{uniforms:Ls([ft.common,ft.envmap,ft.aomap,ft.lightmap,ft.emissivemap,ft.bumpmap,ft.normalmap,ft.displacementmap,ft.roughnessmap,ft.metalnessmap,ft.fog,ft.lights,{emissive:{value:new ci(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:On.meshphysical_vert,fragmentShader:On.meshphysical_frag},toon:{uniforms:Ls([ft.common,ft.aomap,ft.lightmap,ft.emissivemap,ft.bumpmap,ft.normalmap,ft.displacementmap,ft.gradientmap,ft.fog,ft.lights,{emissive:{value:new ci(0)}}]),vertexShader:On.meshtoon_vert,fragmentShader:On.meshtoon_frag},matcap:{uniforms:Ls([ft.common,ft.bumpmap,ft.normalmap,ft.displacementmap,ft.fog,{matcap:{value:null}}]),vertexShader:On.meshmatcap_vert,fragmentShader:On.meshmatcap_frag},points:{uniforms:Ls([ft.points,ft.fog]),vertexShader:On.points_vert,fragmentShader:On.points_frag},dashed:{uniforms:Ls([ft.common,ft.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:On.linedashed_vert,fragmentShader:On.linedashed_frag},depth:{uniforms:Ls([ft.common,ft.displacementmap]),vertexShader:On.depth_vert,fragmentShader:On.depth_frag},normal:{uniforms:Ls([ft.common,ft.bumpmap,ft.normalmap,ft.displacementmap,{opacity:{value:1}}]),vertexShader:On.meshnormal_vert,fragmentShader:On.meshnormal_frag},sprite:{uniforms:Ls([ft.sprite,ft.fog]),vertexShader:On.sprite_vert,fragmentShader:On.sprite_frag},background:{uniforms:{uvTransform:{value:new fc},t2D:{value:null}},vertexShader:On.background_vert,fragmentShader:On.background_frag},cube:{uniforms:Ls([ft.envmap,{opacity:{value:1}}]),vertexShader:On.cube_vert,fragmentShader:On.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:On.equirect_vert,fragmentShader:On.equirect_frag},distanceRGBA:{uniforms:Ls([ft.common,ft.displacementmap,{referencePosition:{value:new Ce},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:On.distanceRGBA_vert,fragmentShader:On.distanceRGBA_frag},shadow:{uniforms:Ls([ft.lights,ft.fog,{color:{value:new ci(0)},opacity:{value:1}}]),vertexShader:On.shadow_vert,fragmentShader:On.shadow_frag}};$d.physical={uniforms:Ls([$d.standard.uniforms,{clearcoat:{value:0},clearcoatMap:{value:null},clearcoatRoughness:{value:0},clearcoatRoughnessMap:{value:null},clearcoatNormalScale:{value:new En(1,1)},clearcoatNormalMap:{value:null},iridescence:{value:0},iridescenceMap:{value:null},iridescenceIOR:{value:1.3},iridescenceThicknessMinimum:{value:100},iridescenceThicknessMaximum:{value:400},iridescenceThicknessMap:{value:null},sheen:{value:0},sheenColor:{value:new ci(0)},sheenColorMap:{value:null},sheenRoughness:{value:1},sheenRoughnessMap:{value:null},transmission:{value:0},transmissionMap:{value:null},transmissionSamplerSize:{value:new En},transmissionSamplerMap:{value:null},thickness:{value:0},thicknessMap:{value:null},attenuationDistance:{value:0},attenuationColor:{value:new ci(0)},specularIntensity:{value:1},specularIntensityMap:{value:null},specularColor:{value:new ci(1,1,1)},specularColorMap:{value:null}}]),vertexShader:On.meshphysical_vert,fragmentShader:On.meshphysical_frag};function q8n(t,e,n,r,i,o){const s=new ci(0);let a=i===!0?0:1,l,c,u=null,f=0,d=null;function h(g,m){let v=!1,y=m.isScene===!0?m.background:null;y&&y.isTexture&&(y=e.get(y));const x=t.xr,b=x.getSession&&x.getSession();b&&b.environmentBlendMode==="additive"&&(y=null),y===null?p(s,a):y&&y.isColor&&(p(y,1),v=!0),(t.autoClear||v)&&t.clear(t.autoClearColor,t.autoClearDepth,t.autoClearStencil),y&&(y.isCubeTexture||y.mapping===i8)?(c===void 0&&(c=new ah(new gE(1,1,1),new Ty({name:"BackgroundCubeMaterial",uniforms:WC($d.cube.uniforms),vertexShader:$d.cube.vertexShader,fragmentShader:$d.cube.fragmentShader,side:vc,depthTest:!1,depthWrite:!1,fog:!1})),c.geometry.deleteAttribute("normal"),c.geometry.deleteAttribute("uv"),c.onBeforeRender=function(w,_,S){this.matrixWorld.copyPosition(S.matrixWorld)},Object.defineProperty(c.material,"envMap",{get:function(){return this.uniforms.envMap.value}}),r.update(c)),c.material.uniforms.envMap.value=y,c.material.uniforms.flipEnvMap.value=y.isCubeTexture&&y.isRenderTargetTexture===!1?-1:1,(u!==y||f!==y.version||d!==t.toneMapping)&&(c.material.needsUpdate=!0,u=y,f=y.version,d=t.toneMapping),c.layers.enableAll(),g.unshift(c,c.geometry,c.material,0,0,null)):y&&y.isTexture&&(l===void 0&&(l=new ah(new a8(2,2),new Ty({name:"BackgroundMaterial",uniforms:WC($d.background.uniforms),vertexShader:$d.background.vertexShader,fragmentShader:$d.background.fragmentShader,side:zC,depthTest:!1,depthWrite:!1,fog:!1})),l.geometry.deleteAttribute("normal"),Object.defineProperty(l.material,"map",{get:function(){return this.uniforms.t2D.value}}),r.update(l)),l.material.uniforms.t2D.value=y,y.matrixAutoUpdate===!0&&y.updateMatrix(),l.material.uniforms.uvTransform.value.copy(y.matrix),(u!==y||f!==y.version||d!==t.toneMapping)&&(l.material.needsUpdate=!0,u=y,f=y.version,d=t.toneMapping),l.layers.enableAll(),g.unshift(l,l.geometry,l.material,0,0,null))}function p(g,m){n.buffers.color.setClear(g.r,g.g,g.b,m,o)}return{getClearColor:function(){return s},setClearColor:function(g,m=1){s.set(g),a=m,p(s,a)},getClearAlpha:function(){return a},setClearAlpha:function(g){a=g,p(s,a)},render:h}}function X8n(t,e,n,r){const i=t.getParameter(34921),o=r.isWebGL2?null:e.get("OES_vertex_array_object"),s=r.isWebGL2||o!==null,a={},l=m(null);let c=l,u=!1;function f(T,R,I,B,$){let z=!1;if(s){const L=g(B,I,R);c!==L&&(c=L,h(c.object)),z=v(T,B,I,$),z&&y(T,B,I,$)}else{const L=R.wireframe===!0;(c.geometry!==B.id||c.program!==I.id||c.wireframe!==L)&&(c.geometry=B.id,c.program=I.id,c.wireframe=L,z=!0)}$!==null&&n.update($,34963),(z||u)&&(u=!1,O(T,R,I,B),$!==null&&t.bindBuffer(34963,n.get($).buffer))}function d(){return r.isWebGL2?t.createVertexArray():o.createVertexArrayOES()}function h(T){return r.isWebGL2?t.bindVertexArray(T):o.bindVertexArrayOES(T)}function p(T){return r.isWebGL2?t.deleteVertexArray(T):o.deleteVertexArrayOES(T)}function g(T,R,I){const B=I.wireframe===!0;let $=a[T.id];$===void 0&&($={},a[T.id]=$);let z=$[R.id];z===void 0&&(z={},$[R.id]=z);let L=z[B];return L===void 0&&(L=m(d()),z[B]=L),L}function m(T){const R=[],I=[],B=[];for(let $=0;$=0){const H=$[N];let q=z[N];if(q===void 0&&(N==="instanceMatrix"&&T.instanceMatrix&&(q=T.instanceMatrix),N==="instanceColor"&&T.instanceColor&&(q=T.instanceColor)),H===void 0||H.attribute!==q||q&&H.data!==q.data)return!0;L++}return c.attributesNum!==L||c.index!==B}function y(T,R,I,B){const $={},z=R.attributes;let L=0;const j=I.getAttributes();for(const N in j)if(j[N].location>=0){let H=z[N];H===void 0&&(N==="instanceMatrix"&&T.instanceMatrix&&(H=T.instanceMatrix),N==="instanceColor"&&T.instanceColor&&(H=T.instanceColor));const q={};q.attribute=H,H&&H.data&&(q.data=H.data),$[N]=q,L++}c.attributes=$,c.attributesNum=L,c.index=B}function x(){const T=c.newAttributes;for(let R=0,I=T.length;R=0){let F=$[j];if(F===void 0&&(j==="instanceMatrix"&&T.instanceMatrix&&(F=T.instanceMatrix),j==="instanceColor"&&T.instanceColor&&(F=T.instanceColor)),F!==void 0){const H=F.normalized,q=F.itemSize,Y=n.get(F);if(Y===void 0)continue;const le=Y.buffer,K=Y.type,ee=Y.bytesPerElement;if(F.isInterleavedBufferAttribute){const re=F.data,me=re.stride,te=F.offset;if(re.isInstancedInterleavedBuffer){for(let ae=0;ae0&&t.getShaderPrecisionFormat(35632,36338).precision>0)return"highp";S="mediump"}return S==="mediump"&&t.getShaderPrecisionFormat(35633,36337).precision>0&&t.getShaderPrecisionFormat(35632,36337).precision>0?"mediump":"lowp"}const s=typeof WebGL2RenderingContext<"u"&&t instanceof WebGL2RenderingContext||typeof WebGL2ComputeRenderingContext<"u"&&t instanceof WebGL2ComputeRenderingContext;let a=n.precision!==void 0?n.precision:"highp";const l=o(a);l!==a&&(console.warn("THREE.WebGLRenderer:",a,"not supported, using",l,"instead."),a=l);const c=s||e.has("WEBGL_draw_buffers"),u=n.logarithmicDepthBuffer===!0,f=t.getParameter(34930),d=t.getParameter(35660),h=t.getParameter(3379),p=t.getParameter(34076),g=t.getParameter(34921),m=t.getParameter(36347),v=t.getParameter(36348),y=t.getParameter(36349),x=d>0,b=s||e.has("OES_texture_float"),w=x&&b,_=s?t.getParameter(36183):0;return{isWebGL2:s,drawBuffers:c,getMaxAnisotropy:i,getMaxPrecision:o,precision:a,logarithmicDepthBuffer:u,maxTextures:f,maxVertexTextures:d,maxTextureSize:h,maxCubemapSize:p,maxAttributes:g,maxVertexUniforms:m,maxVaryings:v,maxFragmentUniforms:y,vertexTextures:x,floatFragmentTextures:b,floatVertexTextures:w,maxSamples:_}}function K8n(t){const e=this;let n=null,r=0,i=!1,o=!1;const s=new G0,a=new fc,l={value:null,needsUpdate:!1};this.uniform=l,this.numPlanes=0,this.numIntersection=0,this.init=function(f,d,h){const p=f.length!==0||d||r!==0||i;return i=d,n=u(f,h,0),r=f.length,p},this.beginShadows=function(){o=!0,u(null)},this.endShadows=function(){o=!1,c()},this.setState=function(f,d,h){const p=f.clippingPlanes,g=f.clipIntersection,m=f.clipShadows,v=t.get(f);if(!i||p===null||p.length===0||o&&!m)o?u(null):c();else{const y=o?0:r,x=y*4;let b=v.clippingState||null;l.value=b,b=u(p,d,x,h);for(let w=0;w!==x;++w)b[w]=n[w];v.clippingState=b,this.numIntersection=g?this.numPlanes:0,this.numPlanes+=y}};function c(){l.value!==n&&(l.value=n,l.needsUpdate=r>0),e.numPlanes=r,e.numIntersection=0}function u(f,d,h,p){const g=f!==null?f.length:0;let m=null;if(g!==0){if(m=l.value,p!==!0||m===null){const v=h+g*4,y=d.matrixWorldInverse;a.getNormalMatrix(y),(m===null||m.length0){const c=new h6n(l.height/2);return c.fromEquirectangularTexture(t,s),e.set(s,c),s.addEventListener("dispose",i),n(c.texture,s.mapping)}else return null}}return s}function i(s){const a=s.target;a.removeEventListener("dispose",i);const l=e.get(a);l!==void 0&&(e.delete(a),l.dispose())}function o(){e=new WeakMap}return{get:r,dispose:o}}class MXe extends TXe{constructor(e=-1,n=1,r=1,i=-1,o=.1,s=2e3){super(),this.isOrthographicCamera=!0,this.type="OrthographicCamera",this.zoom=1,this.view=null,this.left=e,this.right=n,this.top=r,this.bottom=i,this.near=o,this.far=s,this.updateProjectionMatrix()}copy(e,n){return super.copy(e,n),this.left=e.left,this.right=e.right,this.top=e.top,this.bottom=e.bottom,this.near=e.near,this.far=e.far,this.zoom=e.zoom,this.view=e.view===null?null:Object.assign({},e.view),this}setViewOffset(e,n,r,i,o,s){this.view===null&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=e,this.view.fullHeight=n,this.view.offsetX=r,this.view.offsetY=i,this.view.width=o,this.view.height=s,this.updateProjectionMatrix()}clearViewOffset(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const e=(this.right-this.left)/(2*this.zoom),n=(this.top-this.bottom)/(2*this.zoom),r=(this.right+this.left)/2,i=(this.top+this.bottom)/2;let o=r-e,s=r+e,a=i+n,l=i-n;if(this.view!==null&&this.view.enabled){const c=(this.right-this.left)/this.view.fullWidth/this.zoom,u=(this.top-this.bottom)/this.view.fullHeight/this.zoom;o+=c*this.view.offsetX,s=o+c*this.view.width,a-=u*this.view.offsetY,l=a-u*this.view.height}this.projectionMatrix.makeOrthographic(o,s,a,l,this.near,this.far),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(e){const n=super.toJSON(e);return n.object.zoom=this.zoom,n.object.left=this.left,n.object.right=this.right,n.object.top=this.top,n.object.bottom=this.bottom,n.object.near=this.near,n.object.far=this.far,this.view!==null&&(n.object.view=Object.assign({},this.view)),n}}const b_=4,NOe=[.125,.215,.35,.446,.526,.582],ix=20,gG=new MXe,zOe=new ci;let mG=null;const H0=(1+Math.sqrt(5))/2,kw=1/H0,jOe=[new Ce(1,1,1),new Ce(-1,1,1),new Ce(1,1,-1),new Ce(-1,1,-1),new Ce(0,H0,kw),new Ce(0,H0,-kw),new Ce(kw,0,H0),new Ce(-kw,0,H0),new Ce(H0,kw,0),new Ce(-H0,kw,0)];class BOe{constructor(e){this._renderer=e,this._pingPongRenderTarget=null,this._lodMax=0,this._cubeSize=0,this._lodPlanes=[],this._sizeLods=[],this._sigmas=[],this._blurMaterial=null,this._cubemapMaterial=null,this._equirectMaterial=null,this._compileMaterial(this._blurMaterial)}fromScene(e,n=0,r=.1,i=100){mG=this._renderer.getRenderTarget(),this._setSize(256);const o=this._allocateTargets();return o.depthBuffer=!0,this._sceneToCubeUV(e,r,i,o),n>0&&this._blur(o,0,0,n),this._applyPMREM(o),this._cleanup(o),o}fromEquirectangular(e,n=null){return this._fromTexture(e,n)}fromCubemap(e,n=null){return this._fromTexture(e,n)}compileCubemapShader(){this._cubemapMaterial===null&&(this._cubemapMaterial=VOe(),this._compileMaterial(this._cubemapMaterial))}compileEquirectangularShader(){this._equirectMaterial===null&&(this._equirectMaterial=WOe(),this._compileMaterial(this._equirectMaterial))}dispose(){this._dispose(),this._cubemapMaterial!==null&&this._cubemapMaterial.dispose(),this._equirectMaterial!==null&&this._equirectMaterial.dispose()}_setSize(e){this._lodMax=Math.floor(Math.log2(e)),this._cubeSize=Math.pow(2,this._lodMax)}_dispose(){this._blurMaterial!==null&&this._blurMaterial.dispose(),this._pingPongRenderTarget!==null&&this._pingPongRenderTarget.dispose();for(let e=0;e2?x:0,x,x),u.setRenderTarget(i),g&&u.render(p,a),u.render(e,a)}p.geometry.dispose(),p.material.dispose(),u.toneMapping=d,u.autoClear=f,e.background=m}_textureToCubeUV(e,n){const r=this._renderer,i=e.mapping===jC||e.mapping===BC;i?(this._cubemapMaterial===null&&(this._cubemapMaterial=VOe()),this._cubemapMaterial.uniforms.flipEnvMap.value=e.isRenderTargetTexture===!1?-1:1):this._equirectMaterial===null&&(this._equirectMaterial=WOe());const o=i?this._cubemapMaterial:this._equirectMaterial,s=new ah(this._lodPlanes[0],o),a=o.uniforms;a.envMap.value=e;const l=this._cubeSize;M$(n,0,0,3*l,2*l),r.setRenderTarget(n),r.render(s,gG)}_applyPMREM(e){const n=this._renderer,r=n.autoClear;n.autoClear=!1;for(let i=1;iix&&console.warn(`sigmaRadians, ${o}, is too large and will clip, as it requested ${m} samples when the maximum is set to ${ix}`);const v=[];let y=0;for(let S=0;Sx-b_?i-x+b_:0),_=4*(this._cubeSize-b);M$(n,w,_,3*b,2*b),l.setRenderTarget(n),l.render(f,gG)}}function J8n(t){const e=[],n=[],r=[];let i=t;const o=t-b_+1+NOe.length;for(let s=0;st-b_?l=NOe[s-t+b_-1]:s===0&&(l=0),r.push(l);const c=1/(a-2),u=-c,f=1+c,d=[u,u,f,u,f,f,u,u,f,f,u,f],h=6,p=6,g=3,m=2,v=1,y=new Float32Array(g*p*h),x=new Float32Array(m*p*h),b=new Float32Array(v*p*h);for(let _=0;_2?0:-1,k=[S,O,0,S+2/3,O,0,S+2/3,O+1,0,S,O,0,S+2/3,O+1,0,S,O+1,0];y.set(k,g*p*_),x.set(d,m*p*_);const E=[_,_,_,_,_,_];b.set(E,v*p*_)}const w=new sm;w.setAttribute("position",new xu(y,g)),w.setAttribute("uv",new xu(x,m)),w.setAttribute("faceIndex",new xu(b,v)),e.push(w),i>b_&&i--}return{lodPlanes:e,sizeLods:n,sigmas:r}}function UOe(t,e,n){const r=new V1(t,e,n);return r.texture.mapping=i8,r.texture.name="PMREM.cubeUv",r.scissorTest=!0,r}function M$(t,e,n,r,i){t.viewport.set(e,n,r,i),t.scissor.set(e,n,r,i)}function eWn(t,e,n){const r=new Float32Array(ix),i=new Ce(0,1,0);return new Ty({name:"SphericalGaussianBlur",defines:{n:ix,CUBEUV_TEXEL_WIDTH:1/e,CUBEUV_TEXEL_HEIGHT:1/n,CUBEUV_MAX_MIP:`${t}.0`},uniforms:{envMap:{value:null},samples:{value:1},weights:{value:r},latitudinal:{value:!1},dTheta:{value:0},mipInt:{value:0},poleAxis:{value:i}},vertexShader:Fce(),fragmentShader:` +}`,Cn={alphamap_fragment:f6n,alphamap_pars_fragment:d6n,alphatest_fragment:h6n,alphatest_pars_fragment:p6n,aomap_fragment:g6n,aomap_pars_fragment:m6n,begin_vertex:v6n,beginnormal_vertex:y6n,bsdfs:x6n,iridescence_fragment:b6n,bumpmap_pars_fragment:w6n,clipping_planes_fragment:_6n,clipping_planes_pars_fragment:S6n,clipping_planes_pars_vertex:C6n,clipping_planes_vertex:O6n,color_fragment:E6n,color_pars_fragment:T6n,color_pars_vertex:k6n,color_vertex:A6n,common:P6n,cube_uv_reflection_fragment:M6n,defaultnormal_vertex:R6n,displacementmap_pars_vertex:D6n,displacementmap_vertex:I6n,emissivemap_fragment:L6n,emissivemap_pars_fragment:$6n,encodings_fragment:F6n,encodings_pars_fragment:N6n,envmap_fragment:z6n,envmap_common_pars_fragment:j6n,envmap_pars_fragment:B6n,envmap_pars_vertex:U6n,envmap_physical_pars_fragment:eUn,envmap_vertex:W6n,fog_vertex:V6n,fog_pars_vertex:G6n,fog_fragment:H6n,fog_pars_fragment:q6n,gradientmap_pars_fragment:X6n,lightmap_fragment:Y6n,lightmap_pars_fragment:Q6n,lights_lambert_fragment:K6n,lights_lambert_pars_fragment:Z6n,lights_pars_begin:J6n,lights_toon_fragment:tUn,lights_toon_pars_fragment:nUn,lights_phong_fragment:rUn,lights_phong_pars_fragment:iUn,lights_physical_fragment:oUn,lights_physical_pars_fragment:sUn,lights_fragment_begin:aUn,lights_fragment_maps:lUn,lights_fragment_end:cUn,logdepthbuf_fragment:uUn,logdepthbuf_pars_fragment:fUn,logdepthbuf_pars_vertex:dUn,logdepthbuf_vertex:hUn,map_fragment:pUn,map_pars_fragment:gUn,map_particle_fragment:mUn,map_particle_pars_fragment:vUn,metalnessmap_fragment:yUn,metalnessmap_pars_fragment:xUn,morphcolor_vertex:bUn,morphnormal_vertex:wUn,morphtarget_pars_vertex:_Un,morphtarget_vertex:SUn,normal_fragment_begin:CUn,normal_fragment_maps:OUn,normal_pars_fragment:EUn,normal_pars_vertex:TUn,normal_vertex:kUn,normalmap_pars_fragment:AUn,clearcoat_normal_fragment_begin:PUn,clearcoat_normal_fragment_maps:MUn,clearcoat_pars_fragment:RUn,iridescence_pars_fragment:DUn,output_fragment:IUn,packing:LUn,premultiplied_alpha_fragment:$Un,project_vertex:FUn,dithering_fragment:NUn,dithering_pars_fragment:zUn,roughnessmap_fragment:jUn,roughnessmap_pars_fragment:BUn,shadowmap_pars_fragment:UUn,shadowmap_pars_vertex:WUn,shadowmap_vertex:VUn,shadowmask_pars_fragment:GUn,skinbase_vertex:HUn,skinning_pars_vertex:qUn,skinning_vertex:XUn,skinnormal_vertex:YUn,specularmap_fragment:QUn,specularmap_pars_fragment:KUn,tonemapping_fragment:ZUn,tonemapping_pars_fragment:JUn,transmission_fragment:e8n,transmission_pars_fragment:t8n,uv_pars_fragment:n8n,uv_pars_vertex:r8n,uv_vertex:i8n,uv2_pars_fragment:o8n,uv2_pars_vertex:s8n,uv2_vertex:a8n,worldpos_vertex:l8n,background_vert:c8n,background_frag:u8n,cube_vert:f8n,cube_frag:d8n,depth_vert:h8n,depth_frag:p8n,distanceRGBA_vert:g8n,distanceRGBA_frag:m8n,equirect_vert:v8n,equirect_frag:y8n,linedashed_vert:x8n,linedashed_frag:b8n,meshbasic_vert:w8n,meshbasic_frag:_8n,meshlambert_vert:S8n,meshlambert_frag:C8n,meshmatcap_vert:O8n,meshmatcap_frag:E8n,meshnormal_vert:T8n,meshnormal_frag:k8n,meshphong_vert:A8n,meshphong_frag:P8n,meshphysical_vert:M8n,meshphysical_frag:R8n,meshtoon_vert:D8n,meshtoon_frag:I8n,points_vert:L8n,points_frag:$8n,shadow_vert:F8n,shadow_frag:N8n,sprite_vert:z8n,sprite_frag:j8n},ft={common:{diffuse:{value:new fi(16777215)},opacity:{value:1},map:{value:null},uvTransform:{value:new cc},uv2Transform:{value:new cc},alphaMap:{value:null},alphaTest:{value:0}},specularmap:{specularMap:{value:null}},envmap:{envMap:{value:null},flipEnvMap:{value:-1},reflectivity:{value:1},ior:{value:1.5},refractionRatio:{value:.98}},aomap:{aoMap:{value:null},aoMapIntensity:{value:1}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1}},emissivemap:{emissiveMap:{value:null}},bumpmap:{bumpMap:{value:null},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalScale:{value:new On(1,1)}},displacementmap:{displacementMap:{value:null},displacementScale:{value:1},displacementBias:{value:0}},roughnessmap:{roughnessMap:{value:null}},metalnessmap:{metalnessMap:{value:null}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:25e-5},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new fi(16777215)}},lights:{ambientLightColor:{value:[]},lightProbe:{value:[]},directionalLights:{value:[],properties:{direction:{},color:{}}},directionalLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},directionalShadowMap:{value:[]},directionalShadowMatrix:{value:[]},spotLights:{value:[],properties:{color:{},position:{},direction:{},distance:{},coneCos:{},penumbraCos:{},decay:{}}},spotLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},spotLightMap:{value:[]},spotShadowMap:{value:[]},spotLightMatrix:{value:[]},pointLights:{value:[],properties:{color:{},position:{},decay:{},distance:{}}},pointLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{},shadowCameraNear:{},shadowCameraFar:{}}},pointShadowMap:{value:[]},pointShadowMatrix:{value:[]},hemisphereLights:{value:[],properties:{direction:{},skyColor:{},groundColor:{}}},rectAreaLights:{value:[],properties:{color:{},position:{},width:{},height:{}}},ltc_1:{value:null},ltc_2:{value:null}},points:{diffuse:{value:new fi(16777215)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},alphaTest:{value:0},uvTransform:{value:new cc}},sprite:{diffuse:{value:new fi(16777215)},opacity:{value:1},center:{value:new On(.5,.5)},rotation:{value:0},map:{value:null},alphaMap:{value:null},alphaTest:{value:0},uvTransform:{value:new cc}}},Id={basic:{uniforms:Is([ft.common,ft.specularmap,ft.envmap,ft.aomap,ft.lightmap,ft.fog]),vertexShader:Cn.meshbasic_vert,fragmentShader:Cn.meshbasic_frag},lambert:{uniforms:Is([ft.common,ft.specularmap,ft.envmap,ft.aomap,ft.lightmap,ft.emissivemap,ft.bumpmap,ft.normalmap,ft.displacementmap,ft.fog,ft.lights,{emissive:{value:new fi(0)}}]),vertexShader:Cn.meshlambert_vert,fragmentShader:Cn.meshlambert_frag},phong:{uniforms:Is([ft.common,ft.specularmap,ft.envmap,ft.aomap,ft.lightmap,ft.emissivemap,ft.bumpmap,ft.normalmap,ft.displacementmap,ft.fog,ft.lights,{emissive:{value:new fi(0)},specular:{value:new fi(1118481)},shininess:{value:30}}]),vertexShader:Cn.meshphong_vert,fragmentShader:Cn.meshphong_frag},standard:{uniforms:Is([ft.common,ft.envmap,ft.aomap,ft.lightmap,ft.emissivemap,ft.bumpmap,ft.normalmap,ft.displacementmap,ft.roughnessmap,ft.metalnessmap,ft.fog,ft.lights,{emissive:{value:new fi(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:Cn.meshphysical_vert,fragmentShader:Cn.meshphysical_frag},toon:{uniforms:Is([ft.common,ft.aomap,ft.lightmap,ft.emissivemap,ft.bumpmap,ft.normalmap,ft.displacementmap,ft.gradientmap,ft.fog,ft.lights,{emissive:{value:new fi(0)}}]),vertexShader:Cn.meshtoon_vert,fragmentShader:Cn.meshtoon_frag},matcap:{uniforms:Is([ft.common,ft.bumpmap,ft.normalmap,ft.displacementmap,ft.fog,{matcap:{value:null}}]),vertexShader:Cn.meshmatcap_vert,fragmentShader:Cn.meshmatcap_frag},points:{uniforms:Is([ft.points,ft.fog]),vertexShader:Cn.points_vert,fragmentShader:Cn.points_frag},dashed:{uniforms:Is([ft.common,ft.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:Cn.linedashed_vert,fragmentShader:Cn.linedashed_frag},depth:{uniforms:Is([ft.common,ft.displacementmap]),vertexShader:Cn.depth_vert,fragmentShader:Cn.depth_frag},normal:{uniforms:Is([ft.common,ft.bumpmap,ft.normalmap,ft.displacementmap,{opacity:{value:1}}]),vertexShader:Cn.meshnormal_vert,fragmentShader:Cn.meshnormal_frag},sprite:{uniforms:Is([ft.sprite,ft.fog]),vertexShader:Cn.sprite_vert,fragmentShader:Cn.sprite_frag},background:{uniforms:{uvTransform:{value:new cc},t2D:{value:null}},vertexShader:Cn.background_vert,fragmentShader:Cn.background_frag},cube:{uniforms:Is([ft.envmap,{opacity:{value:1}}]),vertexShader:Cn.cube_vert,fragmentShader:Cn.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:Cn.equirect_vert,fragmentShader:Cn.equirect_frag},distanceRGBA:{uniforms:Is([ft.common,ft.displacementmap,{referencePosition:{value:new Ce},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:Cn.distanceRGBA_vert,fragmentShader:Cn.distanceRGBA_frag},shadow:{uniforms:Is([ft.lights,ft.fog,{color:{value:new fi(0)},opacity:{value:1}}]),vertexShader:Cn.shadow_vert,fragmentShader:Cn.shadow_frag}};Id.physical={uniforms:Is([Id.standard.uniforms,{clearcoat:{value:0},clearcoatMap:{value:null},clearcoatRoughness:{value:0},clearcoatRoughnessMap:{value:null},clearcoatNormalScale:{value:new On(1,1)},clearcoatNormalMap:{value:null},iridescence:{value:0},iridescenceMap:{value:null},iridescenceIOR:{value:1.3},iridescenceThicknessMinimum:{value:100},iridescenceThicknessMaximum:{value:400},iridescenceThicknessMap:{value:null},sheen:{value:0},sheenColor:{value:new fi(0)},sheenColorMap:{value:null},sheenRoughness:{value:1},sheenRoughnessMap:{value:null},transmission:{value:0},transmissionMap:{value:null},transmissionSamplerSize:{value:new On},transmissionSamplerMap:{value:null},thickness:{value:0},thicknessMap:{value:null},attenuationDistance:{value:0},attenuationColor:{value:new fi(0)},specularIntensity:{value:1},specularIntensityMap:{value:null},specularColor:{value:new fi(1,1,1)},specularColorMap:{value:null}}]),vertexShader:Cn.meshphysical_vert,fragmentShader:Cn.meshphysical_frag};function B8n(t,e,n,r,i,o){const s=new fi(0);let a=i===!0?0:1,l,c,u=null,f=0,d=null;function h(g,m){let v=!1,y=m.isScene===!0?m.background:null;y&&y.isTexture&&(y=e.get(y));const x=t.xr,b=x.getSession&&x.getSession();b&&b.environmentBlendMode==="additive"&&(y=null),y===null?p(s,a):y&&y.isColor&&(p(y,1),v=!0),(t.autoClear||v)&&t.clear(t.autoClearColor,t.autoClearDepth,t.autoClearStencil),y&&(y.isCubeTexture||y.mapping===i8)?(c===void 0&&(c=new ih(new pE(1,1,1),new Ey({name:"BackgroundCubeMaterial",uniforms:UC(Id.cube.uniforms),vertexShader:Id.cube.vertexShader,fragmentShader:Id.cube.fragmentShader,side:mc,depthTest:!1,depthWrite:!1,fog:!1})),c.geometry.deleteAttribute("normal"),c.geometry.deleteAttribute("uv"),c.onBeforeRender=function(w,_,S){this.matrixWorld.copyPosition(S.matrixWorld)},Object.defineProperty(c.material,"envMap",{get:function(){return this.uniforms.envMap.value}}),r.update(c)),c.material.uniforms.envMap.value=y,c.material.uniforms.flipEnvMap.value=y.isCubeTexture&&y.isRenderTargetTexture===!1?-1:1,(u!==y||f!==y.version||d!==t.toneMapping)&&(c.material.needsUpdate=!0,u=y,f=y.version,d=t.toneMapping),c.layers.enableAll(),g.unshift(c,c.geometry,c.material,0,0,null)):y&&y.isTexture&&(l===void 0&&(l=new ih(new a8(2,2),new Ey({name:"BackgroundMaterial",uniforms:UC(Id.background.uniforms),vertexShader:Id.background.vertexShader,fragmentShader:Id.background.fragmentShader,side:NC,depthTest:!1,depthWrite:!1,fog:!1})),l.geometry.deleteAttribute("normal"),Object.defineProperty(l.material,"map",{get:function(){return this.uniforms.t2D.value}}),r.update(l)),l.material.uniforms.t2D.value=y,y.matrixAutoUpdate===!0&&y.updateMatrix(),l.material.uniforms.uvTransform.value.copy(y.matrix),(u!==y||f!==y.version||d!==t.toneMapping)&&(l.material.needsUpdate=!0,u=y,f=y.version,d=t.toneMapping),l.layers.enableAll(),g.unshift(l,l.geometry,l.material,0,0,null))}function p(g,m){n.buffers.color.setClear(g.r,g.g,g.b,m,o)}return{getClearColor:function(){return s},setClearColor:function(g,m=1){s.set(g),a=m,p(s,a)},getClearAlpha:function(){return a},setClearAlpha:function(g){a=g,p(s,a)},render:h}}function U8n(t,e,n,r){const i=t.getParameter(34921),o=r.isWebGL2?null:e.get("OES_vertex_array_object"),s=r.isWebGL2||o!==null,a={},l=m(null);let c=l,u=!1;function f(T,M,I,j,N){let z=!1;if(s){const L=g(j,I,M);c!==L&&(c=L,h(c.object)),z=v(T,j,I,N),z&&y(T,j,I,N)}else{const L=M.wireframe===!0;(c.geometry!==j.id||c.program!==I.id||c.wireframe!==L)&&(c.geometry=j.id,c.program=I.id,c.wireframe=L,z=!0)}N!==null&&n.update(N,34963),(z||u)&&(u=!1,O(T,M,I,j),N!==null&&t.bindBuffer(34963,n.get(N).buffer))}function d(){return r.isWebGL2?t.createVertexArray():o.createVertexArrayOES()}function h(T){return r.isWebGL2?t.bindVertexArray(T):o.bindVertexArrayOES(T)}function p(T){return r.isWebGL2?t.deleteVertexArray(T):o.deleteVertexArrayOES(T)}function g(T,M,I){const j=I.wireframe===!0;let N=a[T.id];N===void 0&&(N={},a[T.id]=N);let z=N[M.id];z===void 0&&(z={},N[M.id]=z);let L=z[j];return L===void 0&&(L=m(d()),z[j]=L),L}function m(T){const M=[],I=[],j=[];for(let N=0;N=0){const q=N[F];let G=z[F];if(G===void 0&&(F==="instanceMatrix"&&T.instanceMatrix&&(G=T.instanceMatrix),F==="instanceColor"&&T.instanceColor&&(G=T.instanceColor)),q===void 0||q.attribute!==G||G&&q.data!==G.data)return!0;L++}return c.attributesNum!==L||c.index!==j}function y(T,M,I,j){const N={},z=M.attributes;let L=0;const B=I.getAttributes();for(const F in B)if(B[F].location>=0){let q=z[F];q===void 0&&(F==="instanceMatrix"&&T.instanceMatrix&&(q=T.instanceMatrix),F==="instanceColor"&&T.instanceColor&&(q=T.instanceColor));const G={};G.attribute=q,q&&q.data&&(G.data=q.data),N[F]=G,L++}c.attributes=N,c.attributesNum=L,c.index=j}function x(){const T=c.newAttributes;for(let M=0,I=T.length;M=0){let $=N[B];if($===void 0&&(B==="instanceMatrix"&&T.instanceMatrix&&($=T.instanceMatrix),B==="instanceColor"&&T.instanceColor&&($=T.instanceColor)),$!==void 0){const q=$.normalized,G=$.itemSize,Y=n.get($);if(Y===void 0)continue;const le=Y.buffer,K=Y.type,ee=Y.bytesPerElement;if($.isInterleavedBufferAttribute){const re=$.data,ge=re.stride,te=$.offset;if(re.isInstancedInterleavedBuffer){for(let ae=0;ae0&&t.getShaderPrecisionFormat(35632,36338).precision>0)return"highp";S="mediump"}return S==="mediump"&&t.getShaderPrecisionFormat(35633,36337).precision>0&&t.getShaderPrecisionFormat(35632,36337).precision>0?"mediump":"lowp"}const s=typeof WebGL2RenderingContext<"u"&&t instanceof WebGL2RenderingContext||typeof WebGL2ComputeRenderingContext<"u"&&t instanceof WebGL2ComputeRenderingContext;let a=n.precision!==void 0?n.precision:"highp";const l=o(a);l!==a&&(console.warn("THREE.WebGLRenderer:",a,"not supported, using",l,"instead."),a=l);const c=s||e.has("WEBGL_draw_buffers"),u=n.logarithmicDepthBuffer===!0,f=t.getParameter(34930),d=t.getParameter(35660),h=t.getParameter(3379),p=t.getParameter(34076),g=t.getParameter(34921),m=t.getParameter(36347),v=t.getParameter(36348),y=t.getParameter(36349),x=d>0,b=s||e.has("OES_texture_float"),w=x&&b,_=s?t.getParameter(36183):0;return{isWebGL2:s,drawBuffers:c,getMaxAnisotropy:i,getMaxPrecision:o,precision:a,logarithmicDepthBuffer:u,maxTextures:f,maxVertexTextures:d,maxTextureSize:h,maxCubemapSize:p,maxAttributes:g,maxVertexUniforms:m,maxVaryings:v,maxFragmentUniforms:y,vertexTextures:x,floatFragmentTextures:b,floatVertexTextures:w,maxSamples:_}}function G8n(t){const e=this;let n=null,r=0,i=!1,o=!1;const s=new G0,a=new cc,l={value:null,needsUpdate:!1};this.uniform=l,this.numPlanes=0,this.numIntersection=0,this.init=function(f,d,h){const p=f.length!==0||d||r!==0||i;return i=d,n=u(f,h,0),r=f.length,p},this.beginShadows=function(){o=!0,u(null)},this.endShadows=function(){o=!1,c()},this.setState=function(f,d,h){const p=f.clippingPlanes,g=f.clipIntersection,m=f.clipShadows,v=t.get(f);if(!i||p===null||p.length===0||o&&!m)o?u(null):c();else{const y=o?0:r,x=y*4;let b=v.clippingState||null;l.value=b,b=u(p,d,x,h);for(let w=0;w!==x;++w)b[w]=n[w];v.clippingState=b,this.numIntersection=g?this.numPlanes:0,this.numPlanes+=y}};function c(){l.value!==n&&(l.value=n,l.needsUpdate=r>0),e.numPlanes=r,e.numIntersection=0}function u(f,d,h,p){const g=f!==null?f.length:0;let m=null;if(g!==0){if(m=l.value,p!==!0||m===null){const v=h+g*4,y=d.matrixWorldInverse;a.getNormalMatrix(y),(m===null||m.length0){const c=new a6n(l.height/2);return c.fromEquirectangularTexture(t,s),e.set(s,c),s.addEventListener("dispose",i),n(c.texture,s.mapping)}else return null}}return s}function i(s){const a=s.target;a.removeEventListener("dispose",i);const l=e.get(a);l!==void 0&&(e.delete(a),l.dispose())}function o(){e=new WeakMap}return{get:r,dispose:o}}class iYe extends eYe{constructor(e=-1,n=1,r=1,i=-1,o=.1,s=2e3){super(),this.isOrthographicCamera=!0,this.type="OrthographicCamera",this.zoom=1,this.view=null,this.left=e,this.right=n,this.top=r,this.bottom=i,this.near=o,this.far=s,this.updateProjectionMatrix()}copy(e,n){return super.copy(e,n),this.left=e.left,this.right=e.right,this.top=e.top,this.bottom=e.bottom,this.near=e.near,this.far=e.far,this.zoom=e.zoom,this.view=e.view===null?null:Object.assign({},e.view),this}setViewOffset(e,n,r,i,o,s){this.view===null&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=e,this.view.fullHeight=n,this.view.offsetX=r,this.view.offsetY=i,this.view.width=o,this.view.height=s,this.updateProjectionMatrix()}clearViewOffset(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const e=(this.right-this.left)/(2*this.zoom),n=(this.top-this.bottom)/(2*this.zoom),r=(this.right+this.left)/2,i=(this.top+this.bottom)/2;let o=r-e,s=r+e,a=i+n,l=i-n;if(this.view!==null&&this.view.enabled){const c=(this.right-this.left)/this.view.fullWidth/this.zoom,u=(this.top-this.bottom)/this.view.fullHeight/this.zoom;o+=c*this.view.offsetX,s=o+c*this.view.width,a-=u*this.view.offsetY,l=a-u*this.view.height}this.projectionMatrix.makeOrthographic(o,s,a,l,this.near,this.far),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(e){const n=super.toJSON(e);return n.object.zoom=this.zoom,n.object.left=this.left,n.object.right=this.right,n.object.top=this.top,n.object.bottom=this.bottom,n.object.near=this.near,n.object.far=this.far,this.view!==null&&(n.object.view=Object.assign({},this.view)),n}}const x_=4,fEe=[.125,.215,.35,.446,.526,.582],ix=20,PG=new iYe,dEe=new fi;let MG=null;const H0=(1+Math.sqrt(5))/2,Tw=1/H0,hEe=[new Ce(1,1,1),new Ce(-1,1,1),new Ce(1,1,-1),new Ce(-1,1,-1),new Ce(0,H0,Tw),new Ce(0,H0,-Tw),new Ce(Tw,0,H0),new Ce(-Tw,0,H0),new Ce(H0,Tw,0),new Ce(-H0,Tw,0)];class pEe{constructor(e){this._renderer=e,this._pingPongRenderTarget=null,this._lodMax=0,this._cubeSize=0,this._lodPlanes=[],this._sizeLods=[],this._sigmas=[],this._blurMaterial=null,this._cubemapMaterial=null,this._equirectMaterial=null,this._compileMaterial(this._blurMaterial)}fromScene(e,n=0,r=.1,i=100){MG=this._renderer.getRenderTarget(),this._setSize(256);const o=this._allocateTargets();return o.depthBuffer=!0,this._sceneToCubeUV(e,r,i,o),n>0&&this._blur(o,0,0,n),this._applyPMREM(o),this._cleanup(o),o}fromEquirectangular(e,n=null){return this._fromTexture(e,n)}fromCubemap(e,n=null){return this._fromTexture(e,n)}compileCubemapShader(){this._cubemapMaterial===null&&(this._cubemapMaterial=vEe(),this._compileMaterial(this._cubemapMaterial))}compileEquirectangularShader(){this._equirectMaterial===null&&(this._equirectMaterial=mEe(),this._compileMaterial(this._equirectMaterial))}dispose(){this._dispose(),this._cubemapMaterial!==null&&this._cubemapMaterial.dispose(),this._equirectMaterial!==null&&this._equirectMaterial.dispose()}_setSize(e){this._lodMax=Math.floor(Math.log2(e)),this._cubeSize=Math.pow(2,this._lodMax)}_dispose(){this._blurMaterial!==null&&this._blurMaterial.dispose(),this._pingPongRenderTarget!==null&&this._pingPongRenderTarget.dispose();for(let e=0;e2?x:0,x,x),u.setRenderTarget(i),g&&u.render(p,a),u.render(e,a)}p.geometry.dispose(),p.material.dispose(),u.toneMapping=d,u.autoClear=f,e.background=m}_textureToCubeUV(e,n){const r=this._renderer,i=e.mapping===zC||e.mapping===jC;i?(this._cubemapMaterial===null&&(this._cubemapMaterial=vEe()),this._cubemapMaterial.uniforms.flipEnvMap.value=e.isRenderTargetTexture===!1?-1:1):this._equirectMaterial===null&&(this._equirectMaterial=mEe());const o=i?this._cubemapMaterial:this._equirectMaterial,s=new ih(this._lodPlanes[0],o),a=o.uniforms;a.envMap.value=e;const l=this._cubeSize;T$(n,0,0,3*l,2*l),r.setRenderTarget(n),r.render(s,PG)}_applyPMREM(e){const n=this._renderer,r=n.autoClear;n.autoClear=!1;for(let i=1;iix&&console.warn(`sigmaRadians, ${o}, is too large and will clip, as it requested ${m} samples when the maximum is set to ${ix}`);const v=[];let y=0;for(let S=0;Sx-x_?i-x+x_:0),_=4*(this._cubeSize-b);T$(n,w,_,3*b,2*b),l.setRenderTarget(n),l.render(f,PG)}}function q8n(t){const e=[],n=[],r=[];let i=t;const o=t-x_+1+fEe.length;for(let s=0;st-x_?l=fEe[s-t+x_-1]:s===0&&(l=0),r.push(l);const c=1/(a-2),u=-c,f=1+c,d=[u,u,f,u,f,f,u,u,f,f,u,f],h=6,p=6,g=3,m=2,v=1,y=new Float32Array(g*p*h),x=new Float32Array(m*p*h),b=new Float32Array(v*p*h);for(let _=0;_2?0:-1,k=[S,O,0,S+2/3,O,0,S+2/3,O+1,0,S,O,0,S+2/3,O+1,0,S,O+1,0];y.set(k,g*p*_),x.set(d,m*p*_);const E=[_,_,_,_,_,_];b.set(E,v*p*_)}const w=new om;w.setAttribute("position",new xu(y,g)),w.setAttribute("uv",new xu(x,m)),w.setAttribute("faceIndex",new xu(b,v)),e.push(w),i>x_&&i--}return{lodPlanes:e,sizeLods:n,sigmas:r}}function gEe(t,e,n){const r=new Vb(t,e,n);return r.texture.mapping=i8,r.texture.name="PMREM.cubeUv",r.scissorTest=!0,r}function T$(t,e,n,r,i){t.viewport.set(e,n,r,i),t.scissor.set(e,n,r,i)}function X8n(t,e,n){const r=new Float32Array(ix),i=new Ce(0,1,0);return new Ey({name:"SphericalGaussianBlur",defines:{n:ix,CUBEUV_TEXEL_WIDTH:1/e,CUBEUV_TEXEL_HEIGHT:1/n,CUBEUV_MAX_MIP:`${t}.0`},uniforms:{envMap:{value:null},samples:{value:1},weights:{value:r},latitudinal:{value:!1},dTheta:{value:0},mipInt:{value:0},poleAxis:{value:i}},vertexShader:tue(),fragmentShader:` precision mediump float; precision mediump int; @@ -3544,7 +3546,7 @@ void main() { } } - `,blending:qv,depthTest:!1,depthWrite:!1})}function WOe(){return new Ty({name:"EquirectangularToCubeUV",uniforms:{envMap:{value:null}},vertexShader:Fce(),fragmentShader:` + `,blending:Hv,depthTest:!1,depthWrite:!1})}function mEe(){return new Ey({name:"EquirectangularToCubeUV",uniforms:{envMap:{value:null}},vertexShader:tue(),fragmentShader:` precision mediump float; precision mediump int; @@ -3563,7 +3565,7 @@ void main() { gl_FragColor = vec4( texture2D ( envMap, uv ).rgb, 1.0 ); } - `,blending:qv,depthTest:!1,depthWrite:!1})}function VOe(){return new Ty({name:"CubemapToCubeUV",uniforms:{envMap:{value:null},flipEnvMap:{value:-1}},vertexShader:Fce(),fragmentShader:` + `,blending:Hv,depthTest:!1,depthWrite:!1})}function vEe(){return new Ey({name:"CubemapToCubeUV",uniforms:{envMap:{value:null},flipEnvMap:{value:-1}},vertexShader:tue(),fragmentShader:` precision mediump float; precision mediump int; @@ -3579,7 +3581,7 @@ void main() { gl_FragColor = textureCube( envMap, vec3( flipEnvMap * vOutputDirection.x, vOutputDirection.yz ) ); } - `,blending:qv,depthTest:!1,depthWrite:!1})}function Fce(){return` + `,blending:Hv,depthTest:!1,depthWrite:!1})}function tue(){return` precision mediump float; precision mediump int; @@ -3634,39 +3636,39 @@ void main() { gl_Position = vec4( position, 1.0 ); } - `}function tWn(t){let e=new WeakMap,n=null;function r(a){if(a&&a.isTexture){const l=a.mapping,c=l===IZ||l===LZ,u=l===jC||l===BC;if(c||u)if(a.isRenderTargetTexture&&a.needsPMREMUpdate===!0){a.needsPMREMUpdate=!1;let f=e.get(a);return n===null&&(n=new BOe(t)),f=c?n.fromEquirectangular(a,f):n.fromCubemap(a,f),e.set(a,f),f.texture}else{if(e.has(a))return e.get(a).texture;{const f=a.image;if(c&&f&&f.height>0||u&&f&&i(f)){n===null&&(n=new BOe(t));const d=c?n.fromEquirectangular(a):n.fromCubemap(a);return e.set(a,d),a.addEventListener("dispose",o),d.texture}else return null}}}return a}function i(a){let l=0;const c=6;for(let u=0;ue.maxTextureSize&&(M=Math.ceil(E/e.maxTextureSize),E=e.maxTextureSize);const A=new Float32Array(E*M*4*g),P=new bXe(A,E,M,g);P.type=Ev,P.needsUpdate=!0;const T=k*4;for(let I=0;I0)return t;const i=e*n;let o=GOe[i];if(o===void 0&&(o=new Float32Array(i),GOe[i]=o),e!==0){r.toArray(o,0);for(let s=1,a=0;s!==e;++s)a+=n,t[s].toArray(o,a)}return o}function Ia(t,e){if(t.length!==e.length)return!1;for(let n=0,r=t.length;n0||u&&f&&i(f)){n===null&&(n=new pEe(t));const d=c?n.fromEquirectangular(a):n.fromCubemap(a);return e.set(a,d),a.addEventListener("dispose",o),d.texture}else return null}}}return a}function i(a){let l=0;const c=6;for(let u=0;ue.maxTextureSize&&(P=Math.ceil(E/e.maxTextureSize),E=e.maxTextureSize);const A=new Float32Array(E*P*4*g),R=new qXe(A,E,P,g);R.type=Ov,R.needsUpdate=!0;const T=k*4;for(let I=0;I0)return t;const i=e*n;let o=yEe[i];if(o===void 0&&(o=new Float32Array(i),yEe[i]=o),e!==0){r.toArray(o,0);for(let s=1,a=0;s!==e;++s)a+=n,t[s].toArray(o,a)}return o}function Ra(t,e){if(t.length!==e.length)return!1;for(let n=0,r=t.length;n":" "} ${a}: ${n[s]}`)}return r.join(` -`)}function nVn(t){switch(t){case W1:return["Linear","( value )"];case Pi:return["sRGB","( value )"];default:return console.warn("THREE.WebGLProgram: Unsupported encoding:",t),["Linear","( value )"]}}function ZOe(t,e,n){const r=t.getShaderParameter(e,35713),i=t.getShaderInfoLog(e).trim();if(r&&i==="")return"";const o=/ERROR: 0:(\d+)/.exec(i);if(o){const s=parseInt(o[1]);return n.toUpperCase()+` +`)}function QWn(t){switch(t){case Wb:return["Linear","( value )"];case Mi:return["sRGB","( value )"];default:return console.warn("THREE.WebGLProgram: Unsupported encoding:",t),["Linear","( value )"]}}function OEe(t,e,n){const r=t.getShaderParameter(e,35713),i=t.getShaderInfoLog(e).trim();if(r&&i==="")return"";const o=/ERROR: 0:(\d+)/.exec(i);if(o){const s=parseInt(o[1]);return n.toUpperCase()+` `+i+` -`+tVn(t.getShaderSource(e),s)}else return i}function rVn(t,e){const n=nVn(e);return"vec4 "+t+"( vec4 value ) { return LinearTo"+n[0]+n[1]+"; }"}function iVn(t,e){let n;switch(e){case EBn:n="Linear";break;case TBn:n="Reinhard";break;case kBn:n="OptimizedCineon";break;case ABn:n="ACESFilmic";break;case PBn:n="Custom";break;default:console.warn("THREE.WebGLProgram: Unsupported toneMapping:",e),n="Linear"}return"vec3 "+t+"( vec3 color ) { return "+n+"ToneMapping( color ); }"}function oVn(t){return[t.extensionDerivatives||t.envMapCubeUVHeight||t.bumpMap||t.tangentSpaceNormalMap||t.clearcoatNormalMap||t.flatShading||t.shaderID==="physical"?"#extension GL_OES_standard_derivatives : enable":"",(t.extensionFragDepth||t.logarithmicDepthBuffer)&&t.rendererExtensionFragDepth?"#extension GL_EXT_frag_depth : enable":"",t.extensionDrawBuffers&&t.rendererExtensionDrawBuffers?"#extension GL_EXT_draw_buffers : require":"",(t.extensionShaderTextureLOD||t.envMap||t.transmission)&&t.rendererExtensionShaderTextureLod?"#extension GL_EXT_shader_texture_lod : enable":""].filter(NT).join(` -`)}function sVn(t){const e=[];for(const n in t){const r=t[n];r!==!1&&e.push("#define "+n+" "+r)}return e.join(` -`)}function aVn(t,e){const n={},r=t.getProgramParameter(e,35721);for(let i=0;i/gm;function jZ(t){return t.replace(lVn,cVn)}function cVn(t,e){const n=On[e];if(n===void 0)throw new Error("Can not resolve #include <"+e+">");return jZ(n)}const uVn=/#pragma unroll_loop_start\s+for\s*\(\s*int\s+i\s*=\s*(\d+)\s*;\s*i\s*<\s*(\d+)\s*;\s*i\s*\+\+\s*\)\s*{([\s\S]+?)}\s+#pragma unroll_loop_end/g;function tEe(t){return t.replace(uVn,fVn)}function fVn(t,e,n,r){let i="";for(let o=parseInt(e);o/gm;function nJ(t){return t.replace(nVn,rVn)}function rVn(t,e){const n=Cn[e];if(n===void 0)throw new Error("Can not resolve #include <"+e+">");return nJ(n)}const iVn=/#pragma unroll_loop_start\s+for\s*\(\s*int\s+i\s*=\s*(\d+)\s*;\s*i\s*<\s*(\d+)\s*;\s*i\s*\+\+\s*\)\s*{([\s\S]+?)}\s+#pragma unroll_loop_end/g;function kEe(t){return t.replace(iVn,oVn)}function oVn(t,e,n,r){let i="";for(let o=parseInt(e);o0&&(m+=` -`),v=[h,p].filter(NT).join(` +`),v=[h,p].filter(FT).join(` `),v.length>0&&(v+=` -`)):(m=[nEe(n),"#define SHADER_NAME "+n.shaderName,p,n.instancing?"#define USE_INSTANCING":"",n.instancingColor?"#define USE_INSTANCING_COLOR":"",n.supportsVertexTextures?"#define VERTEX_TEXTURES":"",n.useFog&&n.fog?"#define USE_FOG":"",n.useFog&&n.fogExp2?"#define FOG_EXP2":"",n.map?"#define USE_MAP":"",n.envMap?"#define USE_ENVMAP":"",n.envMap?"#define "+u:"",n.lightMap?"#define USE_LIGHTMAP":"",n.aoMap?"#define USE_AOMAP":"",n.emissiveMap?"#define USE_EMISSIVEMAP":"",n.bumpMap?"#define USE_BUMPMAP":"",n.normalMap?"#define USE_NORMALMAP":"",n.normalMap&&n.objectSpaceNormalMap?"#define OBJECTSPACE_NORMALMAP":"",n.normalMap&&n.tangentSpaceNormalMap?"#define TANGENTSPACE_NORMALMAP":"",n.clearcoatMap?"#define USE_CLEARCOATMAP":"",n.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",n.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",n.iridescenceMap?"#define USE_IRIDESCENCEMAP":"",n.iridescenceThicknessMap?"#define USE_IRIDESCENCE_THICKNESSMAP":"",n.displacementMap&&n.supportsVertexTextures?"#define USE_DISPLACEMENTMAP":"",n.specularMap?"#define USE_SPECULARMAP":"",n.specularIntensityMap?"#define USE_SPECULARINTENSITYMAP":"",n.specularColorMap?"#define USE_SPECULARCOLORMAP":"",n.roughnessMap?"#define USE_ROUGHNESSMAP":"",n.metalnessMap?"#define USE_METALNESSMAP":"",n.alphaMap?"#define USE_ALPHAMAP":"",n.transmission?"#define USE_TRANSMISSION":"",n.transmissionMap?"#define USE_TRANSMISSIONMAP":"",n.thicknessMap?"#define USE_THICKNESSMAP":"",n.sheenColorMap?"#define USE_SHEENCOLORMAP":"",n.sheenRoughnessMap?"#define USE_SHEENROUGHNESSMAP":"",n.vertexTangents?"#define USE_TANGENT":"",n.vertexColors?"#define USE_COLOR":"",n.vertexAlphas?"#define USE_COLOR_ALPHA":"",n.vertexUvs?"#define USE_UV":"",n.uvsVertexOnly?"#define UVS_VERTEX_ONLY":"",n.flatShading?"#define FLAT_SHADED":"",n.skinning?"#define USE_SKINNING":"",n.morphTargets?"#define USE_MORPHTARGETS":"",n.morphNormals&&n.flatShading===!1?"#define USE_MORPHNORMALS":"",n.morphColors&&n.isWebGL2?"#define USE_MORPHCOLORS":"",n.morphTargetsCount>0&&n.isWebGL2?"#define MORPHTARGETS_TEXTURE":"",n.morphTargetsCount>0&&n.isWebGL2?"#define MORPHTARGETS_TEXTURE_STRIDE "+n.morphTextureStride:"",n.morphTargetsCount>0&&n.isWebGL2?"#define MORPHTARGETS_COUNT "+n.morphTargetsCount:"",n.doubleSided?"#define DOUBLE_SIDED":"",n.flipSided?"#define FLIP_SIDED":"",n.shadowMapEnabled?"#define USE_SHADOWMAP":"",n.shadowMapEnabled?"#define "+l:"",n.sizeAttenuation?"#define USE_SIZEATTENUATION":"",n.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",n.logarithmicDepthBuffer&&n.rendererExtensionFragDepth?"#define USE_LOGDEPTHBUF_EXT":"","uniform mat4 modelMatrix;","uniform mat4 modelViewMatrix;","uniform mat4 projectionMatrix;","uniform mat4 viewMatrix;","uniform mat3 normalMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;","#ifdef USE_INSTANCING"," attribute mat4 instanceMatrix;","#endif","#ifdef USE_INSTANCING_COLOR"," attribute vec3 instanceColor;","#endif","attribute vec3 position;","attribute vec3 normal;","attribute vec2 uv;","#ifdef USE_TANGENT"," attribute vec4 tangent;","#endif","#if defined( USE_COLOR_ALPHA )"," attribute vec4 color;","#elif defined( USE_COLOR )"," attribute vec3 color;","#endif","#if ( defined( USE_MORPHTARGETS ) && ! defined( MORPHTARGETS_TEXTURE ) )"," attribute vec3 morphTarget0;"," attribute vec3 morphTarget1;"," attribute vec3 morphTarget2;"," attribute vec3 morphTarget3;"," #ifdef USE_MORPHNORMALS"," attribute vec3 morphNormal0;"," attribute vec3 morphNormal1;"," attribute vec3 morphNormal2;"," attribute vec3 morphNormal3;"," #else"," attribute vec3 morphTarget4;"," attribute vec3 morphTarget5;"," attribute vec3 morphTarget6;"," attribute vec3 morphTarget7;"," #endif","#endif","#ifdef USE_SKINNING"," attribute vec4 skinIndex;"," attribute vec4 skinWeight;","#endif",` -`].filter(NT).join(` -`),v=[h,nEe(n),"#define SHADER_NAME "+n.shaderName,p,n.useFog&&n.fog?"#define USE_FOG":"",n.useFog&&n.fogExp2?"#define FOG_EXP2":"",n.map?"#define USE_MAP":"",n.matcap?"#define USE_MATCAP":"",n.envMap?"#define USE_ENVMAP":"",n.envMap?"#define "+c:"",n.envMap?"#define "+u:"",n.envMap?"#define "+f:"",d?"#define CUBEUV_TEXEL_WIDTH "+d.texelWidth:"",d?"#define CUBEUV_TEXEL_HEIGHT "+d.texelHeight:"",d?"#define CUBEUV_MAX_MIP "+d.maxMip+".0":"",n.lightMap?"#define USE_LIGHTMAP":"",n.aoMap?"#define USE_AOMAP":"",n.emissiveMap?"#define USE_EMISSIVEMAP":"",n.bumpMap?"#define USE_BUMPMAP":"",n.normalMap?"#define USE_NORMALMAP":"",n.normalMap&&n.objectSpaceNormalMap?"#define OBJECTSPACE_NORMALMAP":"",n.normalMap&&n.tangentSpaceNormalMap?"#define TANGENTSPACE_NORMALMAP":"",n.clearcoat?"#define USE_CLEARCOAT":"",n.clearcoatMap?"#define USE_CLEARCOATMAP":"",n.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",n.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",n.iridescence?"#define USE_IRIDESCENCE":"",n.iridescenceMap?"#define USE_IRIDESCENCEMAP":"",n.iridescenceThicknessMap?"#define USE_IRIDESCENCE_THICKNESSMAP":"",n.specularMap?"#define USE_SPECULARMAP":"",n.specularIntensityMap?"#define USE_SPECULARINTENSITYMAP":"",n.specularColorMap?"#define USE_SPECULARCOLORMAP":"",n.roughnessMap?"#define USE_ROUGHNESSMAP":"",n.metalnessMap?"#define USE_METALNESSMAP":"",n.alphaMap?"#define USE_ALPHAMAP":"",n.alphaTest?"#define USE_ALPHATEST":"",n.sheen?"#define USE_SHEEN":"",n.sheenColorMap?"#define USE_SHEENCOLORMAP":"",n.sheenRoughnessMap?"#define USE_SHEENROUGHNESSMAP":"",n.transmission?"#define USE_TRANSMISSION":"",n.transmissionMap?"#define USE_TRANSMISSIONMAP":"",n.thicknessMap?"#define USE_THICKNESSMAP":"",n.decodeVideoTexture?"#define DECODE_VIDEO_TEXTURE":"",n.vertexTangents?"#define USE_TANGENT":"",n.vertexColors||n.instancingColor?"#define USE_COLOR":"",n.vertexAlphas?"#define USE_COLOR_ALPHA":"",n.vertexUvs?"#define USE_UV":"",n.uvsVertexOnly?"#define UVS_VERTEX_ONLY":"",n.gradientMap?"#define USE_GRADIENTMAP":"",n.flatShading?"#define FLAT_SHADED":"",n.doubleSided?"#define DOUBLE_SIDED":"",n.flipSided?"#define FLIP_SIDED":"",n.shadowMapEnabled?"#define USE_SHADOWMAP":"",n.shadowMapEnabled?"#define "+l:"",n.premultipliedAlpha?"#define PREMULTIPLIED_ALPHA":"",n.physicallyCorrectLights?"#define PHYSICALLY_CORRECT_LIGHTS":"",n.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",n.logarithmicDepthBuffer&&n.rendererExtensionFragDepth?"#define USE_LOGDEPTHBUF_EXT":"","uniform mat4 viewMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;",n.toneMapping!==wg?"#define TONE_MAPPING":"",n.toneMapping!==wg?On.tonemapping_pars_fragment:"",n.toneMapping!==wg?iVn("toneMapping",n.toneMapping):"",n.dithering?"#define DITHERING":"",n.opaque?"#define OPAQUE":"",On.encodings_pars_fragment,rVn("linearToOutputTexel",n.outputEncoding),n.useDepthPacking?"#define DEPTH_PACKING "+n.depthPacking:"",` -`].filter(NT).join(` -`)),s=jZ(s),s=JOe(s,n),s=eEe(s,n),a=jZ(a),a=JOe(a,n),a=eEe(a,n),s=tEe(s),a=tEe(a),n.isWebGL2&&n.isRawShaderMaterial!==!0&&(y=`#version 300 es +`)):(m=[AEe(n),"#define SHADER_NAME "+n.shaderName,p,n.instancing?"#define USE_INSTANCING":"",n.instancingColor?"#define USE_INSTANCING_COLOR":"",n.supportsVertexTextures?"#define VERTEX_TEXTURES":"",n.useFog&&n.fog?"#define USE_FOG":"",n.useFog&&n.fogExp2?"#define FOG_EXP2":"",n.map?"#define USE_MAP":"",n.envMap?"#define USE_ENVMAP":"",n.envMap?"#define "+u:"",n.lightMap?"#define USE_LIGHTMAP":"",n.aoMap?"#define USE_AOMAP":"",n.emissiveMap?"#define USE_EMISSIVEMAP":"",n.bumpMap?"#define USE_BUMPMAP":"",n.normalMap?"#define USE_NORMALMAP":"",n.normalMap&&n.objectSpaceNormalMap?"#define OBJECTSPACE_NORMALMAP":"",n.normalMap&&n.tangentSpaceNormalMap?"#define TANGENTSPACE_NORMALMAP":"",n.clearcoatMap?"#define USE_CLEARCOATMAP":"",n.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",n.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",n.iridescenceMap?"#define USE_IRIDESCENCEMAP":"",n.iridescenceThicknessMap?"#define USE_IRIDESCENCE_THICKNESSMAP":"",n.displacementMap&&n.supportsVertexTextures?"#define USE_DISPLACEMENTMAP":"",n.specularMap?"#define USE_SPECULARMAP":"",n.specularIntensityMap?"#define USE_SPECULARINTENSITYMAP":"",n.specularColorMap?"#define USE_SPECULARCOLORMAP":"",n.roughnessMap?"#define USE_ROUGHNESSMAP":"",n.metalnessMap?"#define USE_METALNESSMAP":"",n.alphaMap?"#define USE_ALPHAMAP":"",n.transmission?"#define USE_TRANSMISSION":"",n.transmissionMap?"#define USE_TRANSMISSIONMAP":"",n.thicknessMap?"#define USE_THICKNESSMAP":"",n.sheenColorMap?"#define USE_SHEENCOLORMAP":"",n.sheenRoughnessMap?"#define USE_SHEENROUGHNESSMAP":"",n.vertexTangents?"#define USE_TANGENT":"",n.vertexColors?"#define USE_COLOR":"",n.vertexAlphas?"#define USE_COLOR_ALPHA":"",n.vertexUvs?"#define USE_UV":"",n.uvsVertexOnly?"#define UVS_VERTEX_ONLY":"",n.flatShading?"#define FLAT_SHADED":"",n.skinning?"#define USE_SKINNING":"",n.morphTargets?"#define USE_MORPHTARGETS":"",n.morphNormals&&n.flatShading===!1?"#define USE_MORPHNORMALS":"",n.morphColors&&n.isWebGL2?"#define USE_MORPHCOLORS":"",n.morphTargetsCount>0&&n.isWebGL2?"#define MORPHTARGETS_TEXTURE":"",n.morphTargetsCount>0&&n.isWebGL2?"#define MORPHTARGETS_TEXTURE_STRIDE "+n.morphTextureStride:"",n.morphTargetsCount>0&&n.isWebGL2?"#define MORPHTARGETS_COUNT "+n.morphTargetsCount:"",n.doubleSided?"#define DOUBLE_SIDED":"",n.flipSided?"#define FLIP_SIDED":"",n.shadowMapEnabled?"#define USE_SHADOWMAP":"",n.shadowMapEnabled?"#define "+l:"",n.sizeAttenuation?"#define USE_SIZEATTENUATION":"",n.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",n.logarithmicDepthBuffer&&n.rendererExtensionFragDepth?"#define USE_LOGDEPTHBUF_EXT":"","uniform mat4 modelMatrix;","uniform mat4 modelViewMatrix;","uniform mat4 projectionMatrix;","uniform mat4 viewMatrix;","uniform mat3 normalMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;","#ifdef USE_INSTANCING"," attribute mat4 instanceMatrix;","#endif","#ifdef USE_INSTANCING_COLOR"," attribute vec3 instanceColor;","#endif","attribute vec3 position;","attribute vec3 normal;","attribute vec2 uv;","#ifdef USE_TANGENT"," attribute vec4 tangent;","#endif","#if defined( USE_COLOR_ALPHA )"," attribute vec4 color;","#elif defined( USE_COLOR )"," attribute vec3 color;","#endif","#if ( defined( USE_MORPHTARGETS ) && ! defined( MORPHTARGETS_TEXTURE ) )"," attribute vec3 morphTarget0;"," attribute vec3 morphTarget1;"," attribute vec3 morphTarget2;"," attribute vec3 morphTarget3;"," #ifdef USE_MORPHNORMALS"," attribute vec3 morphNormal0;"," attribute vec3 morphNormal1;"," attribute vec3 morphNormal2;"," attribute vec3 morphNormal3;"," #else"," attribute vec3 morphTarget4;"," attribute vec3 morphTarget5;"," attribute vec3 morphTarget6;"," attribute vec3 morphTarget7;"," #endif","#endif","#ifdef USE_SKINNING"," attribute vec4 skinIndex;"," attribute vec4 skinWeight;","#endif",` +`].filter(FT).join(` +`),v=[h,AEe(n),"#define SHADER_NAME "+n.shaderName,p,n.useFog&&n.fog?"#define USE_FOG":"",n.useFog&&n.fogExp2?"#define FOG_EXP2":"",n.map?"#define USE_MAP":"",n.matcap?"#define USE_MATCAP":"",n.envMap?"#define USE_ENVMAP":"",n.envMap?"#define "+c:"",n.envMap?"#define "+u:"",n.envMap?"#define "+f:"",d?"#define CUBEUV_TEXEL_WIDTH "+d.texelWidth:"",d?"#define CUBEUV_TEXEL_HEIGHT "+d.texelHeight:"",d?"#define CUBEUV_MAX_MIP "+d.maxMip+".0":"",n.lightMap?"#define USE_LIGHTMAP":"",n.aoMap?"#define USE_AOMAP":"",n.emissiveMap?"#define USE_EMISSIVEMAP":"",n.bumpMap?"#define USE_BUMPMAP":"",n.normalMap?"#define USE_NORMALMAP":"",n.normalMap&&n.objectSpaceNormalMap?"#define OBJECTSPACE_NORMALMAP":"",n.normalMap&&n.tangentSpaceNormalMap?"#define TANGENTSPACE_NORMALMAP":"",n.clearcoat?"#define USE_CLEARCOAT":"",n.clearcoatMap?"#define USE_CLEARCOATMAP":"",n.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",n.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",n.iridescence?"#define USE_IRIDESCENCE":"",n.iridescenceMap?"#define USE_IRIDESCENCEMAP":"",n.iridescenceThicknessMap?"#define USE_IRIDESCENCE_THICKNESSMAP":"",n.specularMap?"#define USE_SPECULARMAP":"",n.specularIntensityMap?"#define USE_SPECULARINTENSITYMAP":"",n.specularColorMap?"#define USE_SPECULARCOLORMAP":"",n.roughnessMap?"#define USE_ROUGHNESSMAP":"",n.metalnessMap?"#define USE_METALNESSMAP":"",n.alphaMap?"#define USE_ALPHAMAP":"",n.alphaTest?"#define USE_ALPHATEST":"",n.sheen?"#define USE_SHEEN":"",n.sheenColorMap?"#define USE_SHEENCOLORMAP":"",n.sheenRoughnessMap?"#define USE_SHEENROUGHNESSMAP":"",n.transmission?"#define USE_TRANSMISSION":"",n.transmissionMap?"#define USE_TRANSMISSIONMAP":"",n.thicknessMap?"#define USE_THICKNESSMAP":"",n.decodeVideoTexture?"#define DECODE_VIDEO_TEXTURE":"",n.vertexTangents?"#define USE_TANGENT":"",n.vertexColors||n.instancingColor?"#define USE_COLOR":"",n.vertexAlphas?"#define USE_COLOR_ALPHA":"",n.vertexUvs?"#define USE_UV":"",n.uvsVertexOnly?"#define UVS_VERTEX_ONLY":"",n.gradientMap?"#define USE_GRADIENTMAP":"",n.flatShading?"#define FLAT_SHADED":"",n.doubleSided?"#define DOUBLE_SIDED":"",n.flipSided?"#define FLIP_SIDED":"",n.shadowMapEnabled?"#define USE_SHADOWMAP":"",n.shadowMapEnabled?"#define "+l:"",n.premultipliedAlpha?"#define PREMULTIPLIED_ALPHA":"",n.physicallyCorrectLights?"#define PHYSICALLY_CORRECT_LIGHTS":"",n.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",n.logarithmicDepthBuffer&&n.rendererExtensionFragDepth?"#define USE_LOGDEPTHBUF_EXT":"","uniform mat4 viewMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;",n.toneMapping!==yg?"#define TONE_MAPPING":"",n.toneMapping!==yg?Cn.tonemapping_pars_fragment:"",n.toneMapping!==yg?ZWn("toneMapping",n.toneMapping):"",n.dithering?"#define DITHERING":"",n.opaque?"#define OPAQUE":"",Cn.encodings_pars_fragment,KWn("linearToOutputTexel",n.outputEncoding),n.useDepthPacking?"#define DEPTH_PACKING "+n.depthPacking:"",` +`].filter(FT).join(` +`)),s=nJ(s),s=EEe(s,n),s=TEe(s,n),a=nJ(a),a=EEe(a,n),a=TEe(a,n),s=kEe(s),a=kEe(a),n.isWebGL2&&n.isRawShaderMaterial!==!0&&(y=`#version 300 es `,m=["precision mediump sampler2DArray;","#define attribute in","#define varying out","#define texture2D texture"].join(` `)+` -`+m,v=["#define varying in",n.glslVersion===COe?"":"layout(location = 0) out highp vec4 pc_fragColor;",n.glslVersion===COe?"":"#define gl_FragColor pc_fragColor","#define gl_FragDepthEXT gl_FragDepth","#define texture2D texture","#define textureCube texture","#define texture2DProj textureProj","#define texture2DLodEXT textureLod","#define texture2DProjLodEXT textureProjLod","#define textureCubeLodEXT textureLod","#define texture2DGradEXT textureGrad","#define texture2DProjGradEXT textureProjGrad","#define textureCubeGradEXT textureGrad"].join(` +`+m,v=["#define varying in",n.glslVersion===KOe?"":"layout(location = 0) out highp vec4 pc_fragColor;",n.glslVersion===KOe?"":"#define gl_FragColor pc_fragColor","#define gl_FragDepthEXT gl_FragDepth","#define texture2D texture","#define textureCube texture","#define texture2DProj textureProj","#define texture2DLodEXT textureLod","#define texture2DProjLodEXT textureProjLod","#define textureCubeLodEXT textureLod","#define texture2DGradEXT textureGrad","#define texture2DProjGradEXT textureProjGrad","#define textureCubeGradEXT textureGrad"].join(` `)+` -`+v);const x=y+m+s,b=y+v+a,w=KOe(i,35633,x),_=KOe(i,35632,b);if(i.attachShader(g,w),i.attachShader(g,_),n.index0AttributeName!==void 0?i.bindAttribLocation(g,0,n.index0AttributeName):n.morphTargets===!0&&i.bindAttribLocation(g,0,"position"),i.linkProgram(g),t.debug.checkShaderErrors){const k=i.getProgramInfoLog(g).trim(),E=i.getShaderInfoLog(w).trim(),M=i.getShaderInfoLog(_).trim();let A=!0,P=!0;if(i.getProgramParameter(g,35714)===!1){A=!1;const T=ZOe(i,w,"vertex"),R=ZOe(i,_,"fragment");console.error("THREE.WebGLProgram: Shader Error "+i.getError()+" - VALIDATE_STATUS "+i.getProgramParameter(g,35715)+` +`+v);const x=y+m+s,b=y+v+a,w=CEe(i,35633,x),_=CEe(i,35632,b);if(i.attachShader(g,w),i.attachShader(g,_),n.index0AttributeName!==void 0?i.bindAttribLocation(g,0,n.index0AttributeName):n.morphTargets===!0&&i.bindAttribLocation(g,0,"position"),i.linkProgram(g),t.debug.checkShaderErrors){const k=i.getProgramInfoLog(g).trim(),E=i.getShaderInfoLog(w).trim(),P=i.getShaderInfoLog(_).trim();let A=!0,R=!0;if(i.getProgramParameter(g,35714)===!1){A=!1;const T=OEe(i,w,"vertex"),M=OEe(i,_,"fragment");console.error("THREE.WebGLProgram: Shader Error "+i.getError()+" - VALIDATE_STATUS "+i.getProgramParameter(g,35715)+` Program Info Log: `+k+` `+T+` -`+R)}else k!==""?console.warn("THREE.WebGLProgram: Program Info Log:",k):(E===""||M==="")&&(P=!1);P&&(this.diagnostics={runnable:A,programLog:k,vertexShader:{log:E,prefix:m},fragmentShader:{log:M,prefix:v}})}i.deleteShader(w),i.deleteShader(_);let S;this.getUniforms=function(){return S===void 0&&(S=new tF(i,g)),S};let O;return this.getAttributes=function(){return O===void 0&&(O=aVn(i,g)),O},this.destroy=function(){r.releaseStatesOfProgram(this),i.deleteProgram(g),this.program=void 0},this.name=n.shaderName,this.id=eVn++,this.cacheKey=e,this.usedTimes=1,this.program=g,this.vertexShader=w,this.fragmentShader=_,this}let yVn=0;class xVn{constructor(){this.shaderCache=new Map,this.materialCache=new Map}update(e){const n=e.vertexShader,r=e.fragmentShader,i=this._getShaderStage(n),o=this._getShaderStage(r),s=this._getShaderCacheForMaterial(e);return s.has(i)===!1&&(s.add(i),i.usedTimes++),s.has(o)===!1&&(s.add(o),o.usedTimes++),this}remove(e){const n=this.materialCache.get(e);for(const r of n)r.usedTimes--,r.usedTimes===0&&this.shaderCache.delete(r.code);return this.materialCache.delete(e),this}getVertexShaderID(e){return this._getShaderStage(e.vertexShader).id}getFragmentShaderID(e){return this._getShaderStage(e.fragmentShader).id}dispose(){this.shaderCache.clear(),this.materialCache.clear()}_getShaderCacheForMaterial(e){const n=this.materialCache;let r=n.get(e);return r===void 0&&(r=new Set,n.set(e,r)),r}_getShaderStage(e){const n=this.shaderCache;let r=n.get(e);return r===void 0&&(r=new bVn(e),n.set(e,r)),r}}class bVn{constructor(e){this.id=yVn++,this.code=e,this.usedTimes=0}}function wVn(t,e,n,r,i,o,s){const a=new SXe,l=new xVn,c=[],u=i.isWebGL2,f=i.logarithmicDepthBuffer,d=i.vertexTextures;let h=i.precision;const p={MeshDepthMaterial:"depth",MeshDistanceMaterial:"distanceRGBA",MeshNormalMaterial:"normal",MeshBasicMaterial:"basic",MeshLambertMaterial:"lambert",MeshPhongMaterial:"phong",MeshToonMaterial:"toon",MeshStandardMaterial:"physical",MeshPhysicalMaterial:"physical",MeshMatcapMaterial:"matcap",LineBasicMaterial:"basic",LineDashedMaterial:"dashed",PointsMaterial:"points",ShadowMaterial:"shadow",SpriteMaterial:"sprite"};function g(O,k,E,M,A){const P=M.fog,T=A.geometry,R=O.isMeshStandardMaterial?M.environment:null,I=(O.isMeshStandardMaterial?n:e).get(O.envMap||R),B=I&&I.mapping===i8?I.image.height:null,$=p[O.type];O.precision!==null&&(h=i.getMaxPrecision(O.precision),h!==O.precision&&console.warn("THREE.WebGLProgram.getParameters:",O.precision,"not supported, using",h,"instead."));const z=T.morphAttributes.position||T.morphAttributes.normal||T.morphAttributes.color,L=z!==void 0?z.length:0;let j=0;T.morphAttributes.position!==void 0&&(j=1),T.morphAttributes.normal!==void 0&&(j=2),T.morphAttributes.color!==void 0&&(j=3);let N,F,H,q;if($){const me=$d[$];N=me.vertexShader,F=me.fragmentShader}else N=O.vertexShader,F=O.fragmentShader,l.update(O),H=l.getVertexShaderID(O),q=l.getFragmentShaderID(O);const Y=t.getRenderTarget(),le=O.alphaTest>0,K=O.clearcoat>0,ee=O.iridescence>0;return{isWebGL2:u,shaderID:$,shaderName:O.type,vertexShader:N,fragmentShader:F,defines:O.defines,customVertexShaderID:H,customFragmentShaderID:q,isRawShaderMaterial:O.isRawShaderMaterial===!0,glslVersion:O.glslVersion,precision:h,instancing:A.isInstancedMesh===!0,instancingColor:A.isInstancedMesh===!0&&A.instanceColor!==null,supportsVertexTextures:d,outputEncoding:Y===null?t.outputEncoding:Y.isXRRenderTarget===!0?Y.texture.encoding:W1,map:!!O.map,matcap:!!O.matcap,envMap:!!I,envMapMode:I&&I.mapping,envMapCubeUVHeight:B,lightMap:!!O.lightMap,aoMap:!!O.aoMap,emissiveMap:!!O.emissiveMap,bumpMap:!!O.bumpMap,normalMap:!!O.normalMap,objectSpaceNormalMap:O.normalMapType===YBn,tangentSpaceNormalMap:O.normalMapType===XBn,decodeVideoTexture:!!O.map&&O.map.isVideoTexture===!0&&O.map.encoding===Pi,clearcoat:K,clearcoatMap:K&&!!O.clearcoatMap,clearcoatRoughnessMap:K&&!!O.clearcoatRoughnessMap,clearcoatNormalMap:K&&!!O.clearcoatNormalMap,iridescence:ee,iridescenceMap:ee&&!!O.iridescenceMap,iridescenceThicknessMap:ee&&!!O.iridescenceThicknessMap,displacementMap:!!O.displacementMap,roughnessMap:!!O.roughnessMap,metalnessMap:!!O.metalnessMap,specularMap:!!O.specularMap,specularIntensityMap:!!O.specularIntensityMap,specularColorMap:!!O.specularColorMap,opaque:O.transparent===!1&&O.blending===oS,alphaMap:!!O.alphaMap,alphaTest:le,gradientMap:!!O.gradientMap,sheen:O.sheen>0,sheenColorMap:!!O.sheenColorMap,sheenRoughnessMap:!!O.sheenRoughnessMap,transmission:O.transmission>0,transmissionMap:!!O.transmissionMap,thicknessMap:!!O.thicknessMap,combine:O.combine,vertexTangents:!!O.normalMap&&!!T.attributes.tangent,vertexColors:O.vertexColors,vertexAlphas:O.vertexColors===!0&&!!T.attributes.color&&T.attributes.color.itemSize===4,vertexUvs:!!O.map||!!O.bumpMap||!!O.normalMap||!!O.specularMap||!!O.alphaMap||!!O.emissiveMap||!!O.roughnessMap||!!O.metalnessMap||!!O.clearcoatMap||!!O.clearcoatRoughnessMap||!!O.clearcoatNormalMap||!!O.iridescenceMap||!!O.iridescenceThicknessMap||!!O.displacementMap||!!O.transmissionMap||!!O.thicknessMap||!!O.specularIntensityMap||!!O.specularColorMap||!!O.sheenColorMap||!!O.sheenRoughnessMap,uvsVertexOnly:!(O.map||O.bumpMap||O.normalMap||O.specularMap||O.alphaMap||O.emissiveMap||O.roughnessMap||O.metalnessMap||O.clearcoatNormalMap||O.iridescenceMap||O.iridescenceThicknessMap||O.transmission>0||O.transmissionMap||O.thicknessMap||O.specularIntensityMap||O.specularColorMap||O.sheen>0||O.sheenColorMap||O.sheenRoughnessMap)&&!!O.displacementMap,fog:!!P,useFog:O.fog===!0,fogExp2:P&&P.isFogExp2,flatShading:!!O.flatShading,sizeAttenuation:O.sizeAttenuation,logarithmicDepthBuffer:f,skinning:A.isSkinnedMesh===!0,morphTargets:T.morphAttributes.position!==void 0,morphNormals:T.morphAttributes.normal!==void 0,morphColors:T.morphAttributes.color!==void 0,morphTargetsCount:L,morphTextureStride:j,numDirLights:k.directional.length,numPointLights:k.point.length,numSpotLights:k.spot.length,numSpotLightMaps:k.spotLightMap.length,numRectAreaLights:k.rectArea.length,numHemiLights:k.hemi.length,numDirLightShadows:k.directionalShadowMap.length,numPointLightShadows:k.pointShadowMap.length,numSpotLightShadows:k.spotShadowMap.length,numSpotLightShadowsWithMaps:k.numSpotLightShadowsWithMaps,numClippingPlanes:s.numPlanes,numClipIntersection:s.numIntersection,dithering:O.dithering,shadowMapEnabled:t.shadowMap.enabled&&E.length>0,shadowMapType:t.shadowMap.type,toneMapping:O.toneMapped?t.toneMapping:wg,physicallyCorrectLights:t.physicallyCorrectLights,premultipliedAlpha:O.premultipliedAlpha,doubleSided:O.side===tg,flipSided:O.side===vc,useDepthPacking:!!O.depthPacking,depthPacking:O.depthPacking||0,index0AttributeName:O.index0AttributeName,extensionDerivatives:O.extensions&&O.extensions.derivatives,extensionFragDepth:O.extensions&&O.extensions.fragDepth,extensionDrawBuffers:O.extensions&&O.extensions.drawBuffers,extensionShaderTextureLOD:O.extensions&&O.extensions.shaderTextureLOD,rendererExtensionFragDepth:u||r.has("EXT_frag_depth"),rendererExtensionDrawBuffers:u||r.has("WEBGL_draw_buffers"),rendererExtensionShaderTextureLod:u||r.has("EXT_shader_texture_lod"),customProgramCacheKey:O.customProgramCacheKey()}}function m(O){const k=[];if(O.shaderID?k.push(O.shaderID):(k.push(O.customVertexShaderID),k.push(O.customFragmentShaderID)),O.defines!==void 0)for(const E in O.defines)k.push(E),k.push(O.defines[E]);return O.isRawShaderMaterial===!1&&(v(k,O),y(k,O),k.push(t.outputEncoding)),k.push(O.customProgramCacheKey),k.join()}function v(O,k){O.push(k.precision),O.push(k.outputEncoding),O.push(k.envMapMode),O.push(k.envMapCubeUVHeight),O.push(k.combine),O.push(k.vertexUvs),O.push(k.fogExp2),O.push(k.sizeAttenuation),O.push(k.morphTargetsCount),O.push(k.morphAttributeCount),O.push(k.numDirLights),O.push(k.numPointLights),O.push(k.numSpotLights),O.push(k.numSpotLightMaps),O.push(k.numHemiLights),O.push(k.numRectAreaLights),O.push(k.numDirLightShadows),O.push(k.numPointLightShadows),O.push(k.numSpotLightShadows),O.push(k.numSpotLightShadowsWithMaps),O.push(k.shadowMapType),O.push(k.toneMapping),O.push(k.numClippingPlanes),O.push(k.numClipIntersection),O.push(k.depthPacking)}function y(O,k){a.disableAll(),k.isWebGL2&&a.enable(0),k.supportsVertexTextures&&a.enable(1),k.instancing&&a.enable(2),k.instancingColor&&a.enable(3),k.map&&a.enable(4),k.matcap&&a.enable(5),k.envMap&&a.enable(6),k.lightMap&&a.enable(7),k.aoMap&&a.enable(8),k.emissiveMap&&a.enable(9),k.bumpMap&&a.enable(10),k.normalMap&&a.enable(11),k.objectSpaceNormalMap&&a.enable(12),k.tangentSpaceNormalMap&&a.enable(13),k.clearcoat&&a.enable(14),k.clearcoatMap&&a.enable(15),k.clearcoatRoughnessMap&&a.enable(16),k.clearcoatNormalMap&&a.enable(17),k.iridescence&&a.enable(18),k.iridescenceMap&&a.enable(19),k.iridescenceThicknessMap&&a.enable(20),k.displacementMap&&a.enable(21),k.specularMap&&a.enable(22),k.roughnessMap&&a.enable(23),k.metalnessMap&&a.enable(24),k.gradientMap&&a.enable(25),k.alphaMap&&a.enable(26),k.alphaTest&&a.enable(27),k.vertexColors&&a.enable(28),k.vertexAlphas&&a.enable(29),k.vertexUvs&&a.enable(30),k.vertexTangents&&a.enable(31),k.uvsVertexOnly&&a.enable(32),O.push(a.mask),a.disableAll(),k.fog&&a.enable(0),k.useFog&&a.enable(1),k.flatShading&&a.enable(2),k.logarithmicDepthBuffer&&a.enable(3),k.skinning&&a.enable(4),k.morphTargets&&a.enable(5),k.morphNormals&&a.enable(6),k.morphColors&&a.enable(7),k.premultipliedAlpha&&a.enable(8),k.shadowMapEnabled&&a.enable(9),k.physicallyCorrectLights&&a.enable(10),k.doubleSided&&a.enable(11),k.flipSided&&a.enable(12),k.useDepthPacking&&a.enable(13),k.dithering&&a.enable(14),k.specularIntensityMap&&a.enable(15),k.specularColorMap&&a.enable(16),k.transmission&&a.enable(17),k.transmissionMap&&a.enable(18),k.thicknessMap&&a.enable(19),k.sheen&&a.enable(20),k.sheenColorMap&&a.enable(21),k.sheenRoughnessMap&&a.enable(22),k.decodeVideoTexture&&a.enable(23),k.opaque&&a.enable(24),O.push(a.mask)}function x(O){const k=p[O.type];let E;if(k){const M=$d[k];E=EXe.clone(M.uniforms)}else E=O.uniforms;return E}function b(O,k){let E;for(let M=0,A=c.length;M0?r.push(v):h.transparent===!0?i.push(v):n.push(v)}function l(f,d,h,p,g,m){const v=s(f,d,h,p,g,m);h.transmission>0?r.unshift(v):h.transparent===!0?i.unshift(v):n.unshift(v)}function c(f,d){n.length>1&&n.sort(f||SVn),r.length>1&&r.sort(d||rEe),i.length>1&&i.sort(d||rEe)}function u(){for(let f=e,d=t.length;f=o.length?(s=new iEe,o.push(s)):s=o[i],s}function n(){t=new WeakMap}return{get:e,dispose:n}}function OVn(){const t={};return{get:function(e){if(t[e.id]!==void 0)return t[e.id];let n;switch(e.type){case"DirectionalLight":n={direction:new Ce,color:new ci};break;case"SpotLight":n={position:new Ce,direction:new Ce,color:new ci,distance:0,coneCos:0,penumbraCos:0,decay:0};break;case"PointLight":n={position:new Ce,color:new ci,distance:0,decay:0};break;case"HemisphereLight":n={direction:new Ce,skyColor:new ci,groundColor:new ci};break;case"RectAreaLight":n={color:new ci,position:new Ce,halfWidth:new Ce,halfHeight:new Ce};break}return t[e.id]=n,n}}}function EVn(){const t={};return{get:function(e){if(t[e.id]!==void 0)return t[e.id];let n;switch(e.type){case"DirectionalLight":n={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new En};break;case"SpotLight":n={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new En};break;case"PointLight":n={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new En,shadowCameraNear:1,shadowCameraFar:1e3};break}return t[e.id]=n,n}}}let TVn=0;function kVn(t,e){return(e.castShadow?2:0)-(t.castShadow?2:0)+(e.map?1:0)-(t.map?1:0)}function AVn(t,e){const n=new OVn,r=EVn(),i={version:0,hash:{directionalLength:-1,pointLength:-1,spotLength:-1,rectAreaLength:-1,hemiLength:-1,numDirectionalShadows:-1,numPointShadows:-1,numSpotShadows:-1,numSpotMaps:-1},ambient:[0,0,0],probe:[],directional:[],directionalShadow:[],directionalShadowMap:[],directionalShadowMatrix:[],spot:[],spotLightMap:[],spotShadow:[],spotShadowMap:[],spotLightMatrix:[],rectArea:[],rectAreaLTC1:null,rectAreaLTC2:null,point:[],pointShadow:[],pointShadowMap:[],pointShadowMatrix:[],hemi:[],numSpotLightShadowsWithMaps:0};for(let u=0;u<9;u++)i.probe.push(new Ce);const o=new Ce,s=new Wr,a=new Wr;function l(u,f){let d=0,h=0,p=0;for(let M=0;M<9;M++)i.probe[M].set(0,0,0);let g=0,m=0,v=0,y=0,x=0,b=0,w=0,_=0,S=0,O=0;u.sort(kVn);const k=f!==!0?Math.PI:1;for(let M=0,A=u.length;M0&&(e.isWebGL2||t.has("OES_texture_float_linear")===!0?(i.rectAreaLTC1=ft.LTC_FLOAT_1,i.rectAreaLTC2=ft.LTC_FLOAT_2):t.has("OES_texture_half_float_linear")===!0?(i.rectAreaLTC1=ft.LTC_HALF_1,i.rectAreaLTC2=ft.LTC_HALF_2):console.error("THREE.WebGLRenderer: Unable to use RectAreaLight. Missing WebGL extensions.")),i.ambient[0]=d,i.ambient[1]=h,i.ambient[2]=p;const E=i.hash;(E.directionalLength!==g||E.pointLength!==m||E.spotLength!==v||E.rectAreaLength!==y||E.hemiLength!==x||E.numDirectionalShadows!==b||E.numPointShadows!==w||E.numSpotShadows!==_||E.numSpotMaps!==S)&&(i.directional.length=g,i.spot.length=v,i.rectArea.length=y,i.point.length=m,i.hemi.length=x,i.directionalShadow.length=b,i.directionalShadowMap.length=b,i.pointShadow.length=w,i.pointShadowMap.length=w,i.spotShadow.length=_,i.spotShadowMap.length=_,i.directionalShadowMatrix.length=b,i.pointShadowMatrix.length=w,i.spotLightMatrix.length=_+S-O,i.spotLightMap.length=S,i.numSpotLightShadowsWithMaps=O,E.directionalLength=g,E.pointLength=m,E.spotLength=v,E.rectAreaLength=y,E.hemiLength=x,E.numDirectionalShadows=b,E.numPointShadows=w,E.numSpotShadows=_,E.numSpotMaps=S,i.version=TVn++)}function c(u,f){let d=0,h=0,p=0,g=0,m=0;const v=f.matrixWorldInverse;for(let y=0,x=u.length;y=a.length?(l=new oEe(t,e),a.push(l)):l=a[s],l}function i(){n=new WeakMap}return{get:r,dispose:i}}class MVn extends OD{constructor(e){super(),this.isMeshDepthMaterial=!0,this.type="MeshDepthMaterial",this.depthPacking=HBn,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.setValues(e)}copy(e){return super.copy(e),this.depthPacking=e.depthPacking,this.map=e.map,this.alphaMap=e.alphaMap,this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this}}class RVn extends OD{constructor(e){super(),this.isMeshDistanceMaterial=!0,this.type="MeshDistanceMaterial",this.referencePosition=new Ce,this.nearDistance=1,this.farDistance=1e3,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.setValues(e)}copy(e){return super.copy(e),this.referencePosition.copy(e.referencePosition),this.nearDistance=e.nearDistance,this.farDistance=e.farDistance,this.map=e.map,this.alphaMap=e.alphaMap,this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this}}const DVn=`void main() { +`+M)}else k!==""?console.warn("THREE.WebGLProgram: Program Info Log:",k):(E===""||P==="")&&(R=!1);R&&(this.diagnostics={runnable:A,programLog:k,vertexShader:{log:E,prefix:m},fragmentShader:{log:P,prefix:v}})}i.deleteShader(w),i.deleteShader(_);let S;this.getUniforms=function(){return S===void 0&&(S=new K3(i,g)),S};let O;return this.getAttributes=function(){return O===void 0&&(O=tVn(i,g)),O},this.destroy=function(){r.releaseStatesOfProgram(this),i.deleteProgram(g),this.program=void 0},this.name=n.shaderName,this.id=XWn++,this.cacheKey=e,this.usedTimes=1,this.program=g,this.vertexShader=w,this.fragmentShader=_,this}let dVn=0;class hVn{constructor(){this.shaderCache=new Map,this.materialCache=new Map}update(e){const n=e.vertexShader,r=e.fragmentShader,i=this._getShaderStage(n),o=this._getShaderStage(r),s=this._getShaderCacheForMaterial(e);return s.has(i)===!1&&(s.add(i),i.usedTimes++),s.has(o)===!1&&(s.add(o),o.usedTimes++),this}remove(e){const n=this.materialCache.get(e);for(const r of n)r.usedTimes--,r.usedTimes===0&&this.shaderCache.delete(r.code);return this.materialCache.delete(e),this}getVertexShaderID(e){return this._getShaderStage(e.vertexShader).id}getFragmentShaderID(e){return this._getShaderStage(e.fragmentShader).id}dispose(){this.shaderCache.clear(),this.materialCache.clear()}_getShaderCacheForMaterial(e){const n=this.materialCache;let r=n.get(e);return r===void 0&&(r=new Set,n.set(e,r)),r}_getShaderStage(e){const n=this.shaderCache;let r=n.get(e);return r===void 0&&(r=new pVn(e),n.set(e,r)),r}}class pVn{constructor(e){this.id=dVn++,this.code=e,this.usedTimes=0}}function gVn(t,e,n,r,i,o,s){const a=new QXe,l=new hVn,c=[],u=i.isWebGL2,f=i.logarithmicDepthBuffer,d=i.vertexTextures;let h=i.precision;const p={MeshDepthMaterial:"depth",MeshDistanceMaterial:"distanceRGBA",MeshNormalMaterial:"normal",MeshBasicMaterial:"basic",MeshLambertMaterial:"lambert",MeshPhongMaterial:"phong",MeshToonMaterial:"toon",MeshStandardMaterial:"physical",MeshPhysicalMaterial:"physical",MeshMatcapMaterial:"matcap",LineBasicMaterial:"basic",LineDashedMaterial:"dashed",PointsMaterial:"points",ShadowMaterial:"shadow",SpriteMaterial:"sprite"};function g(O,k,E,P,A){const R=P.fog,T=A.geometry,M=O.isMeshStandardMaterial?P.environment:null,I=(O.isMeshStandardMaterial?n:e).get(O.envMap||M),j=I&&I.mapping===i8?I.image.height:null,N=p[O.type];O.precision!==null&&(h=i.getMaxPrecision(O.precision),h!==O.precision&&console.warn("THREE.WebGLProgram.getParameters:",O.precision,"not supported, using",h,"instead."));const z=T.morphAttributes.position||T.morphAttributes.normal||T.morphAttributes.color,L=z!==void 0?z.length:0;let B=0;T.morphAttributes.position!==void 0&&(B=1),T.morphAttributes.normal!==void 0&&(B=2),T.morphAttributes.color!==void 0&&(B=3);let F,$,q,G;if(N){const ge=Id[N];F=ge.vertexShader,$=ge.fragmentShader}else F=O.vertexShader,$=O.fragmentShader,l.update(O),q=l.getVertexShaderID(O),G=l.getFragmentShaderID(O);const Y=t.getRenderTarget(),le=O.alphaTest>0,K=O.clearcoat>0,ee=O.iridescence>0;return{isWebGL2:u,shaderID:N,shaderName:O.type,vertexShader:F,fragmentShader:$,defines:O.defines,customVertexShaderID:q,customFragmentShaderID:G,isRawShaderMaterial:O.isRawShaderMaterial===!0,glslVersion:O.glslVersion,precision:h,instancing:A.isInstancedMesh===!0,instancingColor:A.isInstancedMesh===!0&&A.instanceColor!==null,supportsVertexTextures:d,outputEncoding:Y===null?t.outputEncoding:Y.isXRRenderTarget===!0?Y.texture.encoding:Wb,map:!!O.map,matcap:!!O.matcap,envMap:!!I,envMapMode:I&&I.mapping,envMapCubeUVHeight:j,lightMap:!!O.lightMap,aoMap:!!O.aoMap,emissiveMap:!!O.emissiveMap,bumpMap:!!O.bumpMap,normalMap:!!O.normalMap,objectSpaceNormalMap:O.normalMapType===WBn,tangentSpaceNormalMap:O.normalMapType===UBn,decodeVideoTexture:!!O.map&&O.map.isVideoTexture===!0&&O.map.encoding===Mi,clearcoat:K,clearcoatMap:K&&!!O.clearcoatMap,clearcoatRoughnessMap:K&&!!O.clearcoatRoughnessMap,clearcoatNormalMap:K&&!!O.clearcoatNormalMap,iridescence:ee,iridescenceMap:ee&&!!O.iridescenceMap,iridescenceThicknessMap:ee&&!!O.iridescenceThicknessMap,displacementMap:!!O.displacementMap,roughnessMap:!!O.roughnessMap,metalnessMap:!!O.metalnessMap,specularMap:!!O.specularMap,specularIntensityMap:!!O.specularIntensityMap,specularColorMap:!!O.specularColorMap,opaque:O.transparent===!1&&O.blending===oS,alphaMap:!!O.alphaMap,alphaTest:le,gradientMap:!!O.gradientMap,sheen:O.sheen>0,sheenColorMap:!!O.sheenColorMap,sheenRoughnessMap:!!O.sheenRoughnessMap,transmission:O.transmission>0,transmissionMap:!!O.transmissionMap,thicknessMap:!!O.thicknessMap,combine:O.combine,vertexTangents:!!O.normalMap&&!!T.attributes.tangent,vertexColors:O.vertexColors,vertexAlphas:O.vertexColors===!0&&!!T.attributes.color&&T.attributes.color.itemSize===4,vertexUvs:!!O.map||!!O.bumpMap||!!O.normalMap||!!O.specularMap||!!O.alphaMap||!!O.emissiveMap||!!O.roughnessMap||!!O.metalnessMap||!!O.clearcoatMap||!!O.clearcoatRoughnessMap||!!O.clearcoatNormalMap||!!O.iridescenceMap||!!O.iridescenceThicknessMap||!!O.displacementMap||!!O.transmissionMap||!!O.thicknessMap||!!O.specularIntensityMap||!!O.specularColorMap||!!O.sheenColorMap||!!O.sheenRoughnessMap,uvsVertexOnly:!(O.map||O.bumpMap||O.normalMap||O.specularMap||O.alphaMap||O.emissiveMap||O.roughnessMap||O.metalnessMap||O.clearcoatNormalMap||O.iridescenceMap||O.iridescenceThicknessMap||O.transmission>0||O.transmissionMap||O.thicknessMap||O.specularIntensityMap||O.specularColorMap||O.sheen>0||O.sheenColorMap||O.sheenRoughnessMap)&&!!O.displacementMap,fog:!!R,useFog:O.fog===!0,fogExp2:R&&R.isFogExp2,flatShading:!!O.flatShading,sizeAttenuation:O.sizeAttenuation,logarithmicDepthBuffer:f,skinning:A.isSkinnedMesh===!0,morphTargets:T.morphAttributes.position!==void 0,morphNormals:T.morphAttributes.normal!==void 0,morphColors:T.morphAttributes.color!==void 0,morphTargetsCount:L,morphTextureStride:B,numDirLights:k.directional.length,numPointLights:k.point.length,numSpotLights:k.spot.length,numSpotLightMaps:k.spotLightMap.length,numRectAreaLights:k.rectArea.length,numHemiLights:k.hemi.length,numDirLightShadows:k.directionalShadowMap.length,numPointLightShadows:k.pointShadowMap.length,numSpotLightShadows:k.spotShadowMap.length,numSpotLightShadowsWithMaps:k.numSpotLightShadowsWithMaps,numClippingPlanes:s.numPlanes,numClipIntersection:s.numIntersection,dithering:O.dithering,shadowMapEnabled:t.shadowMap.enabled&&E.length>0,shadowMapType:t.shadowMap.type,toneMapping:O.toneMapped?t.toneMapping:yg,physicallyCorrectLights:t.physicallyCorrectLights,premultipliedAlpha:O.premultipliedAlpha,doubleSided:O.side===Zp,flipSided:O.side===mc,useDepthPacking:!!O.depthPacking,depthPacking:O.depthPacking||0,index0AttributeName:O.index0AttributeName,extensionDerivatives:O.extensions&&O.extensions.derivatives,extensionFragDepth:O.extensions&&O.extensions.fragDepth,extensionDrawBuffers:O.extensions&&O.extensions.drawBuffers,extensionShaderTextureLOD:O.extensions&&O.extensions.shaderTextureLOD,rendererExtensionFragDepth:u||r.has("EXT_frag_depth"),rendererExtensionDrawBuffers:u||r.has("WEBGL_draw_buffers"),rendererExtensionShaderTextureLod:u||r.has("EXT_shader_texture_lod"),customProgramCacheKey:O.customProgramCacheKey()}}function m(O){const k=[];if(O.shaderID?k.push(O.shaderID):(k.push(O.customVertexShaderID),k.push(O.customFragmentShaderID)),O.defines!==void 0)for(const E in O.defines)k.push(E),k.push(O.defines[E]);return O.isRawShaderMaterial===!1&&(v(k,O),y(k,O),k.push(t.outputEncoding)),k.push(O.customProgramCacheKey),k.join()}function v(O,k){O.push(k.precision),O.push(k.outputEncoding),O.push(k.envMapMode),O.push(k.envMapCubeUVHeight),O.push(k.combine),O.push(k.vertexUvs),O.push(k.fogExp2),O.push(k.sizeAttenuation),O.push(k.morphTargetsCount),O.push(k.morphAttributeCount),O.push(k.numDirLights),O.push(k.numPointLights),O.push(k.numSpotLights),O.push(k.numSpotLightMaps),O.push(k.numHemiLights),O.push(k.numRectAreaLights),O.push(k.numDirLightShadows),O.push(k.numPointLightShadows),O.push(k.numSpotLightShadows),O.push(k.numSpotLightShadowsWithMaps),O.push(k.shadowMapType),O.push(k.toneMapping),O.push(k.numClippingPlanes),O.push(k.numClipIntersection),O.push(k.depthPacking)}function y(O,k){a.disableAll(),k.isWebGL2&&a.enable(0),k.supportsVertexTextures&&a.enable(1),k.instancing&&a.enable(2),k.instancingColor&&a.enable(3),k.map&&a.enable(4),k.matcap&&a.enable(5),k.envMap&&a.enable(6),k.lightMap&&a.enable(7),k.aoMap&&a.enable(8),k.emissiveMap&&a.enable(9),k.bumpMap&&a.enable(10),k.normalMap&&a.enable(11),k.objectSpaceNormalMap&&a.enable(12),k.tangentSpaceNormalMap&&a.enable(13),k.clearcoat&&a.enable(14),k.clearcoatMap&&a.enable(15),k.clearcoatRoughnessMap&&a.enable(16),k.clearcoatNormalMap&&a.enable(17),k.iridescence&&a.enable(18),k.iridescenceMap&&a.enable(19),k.iridescenceThicknessMap&&a.enable(20),k.displacementMap&&a.enable(21),k.specularMap&&a.enable(22),k.roughnessMap&&a.enable(23),k.metalnessMap&&a.enable(24),k.gradientMap&&a.enable(25),k.alphaMap&&a.enable(26),k.alphaTest&&a.enable(27),k.vertexColors&&a.enable(28),k.vertexAlphas&&a.enable(29),k.vertexUvs&&a.enable(30),k.vertexTangents&&a.enable(31),k.uvsVertexOnly&&a.enable(32),O.push(a.mask),a.disableAll(),k.fog&&a.enable(0),k.useFog&&a.enable(1),k.flatShading&&a.enable(2),k.logarithmicDepthBuffer&&a.enable(3),k.skinning&&a.enable(4),k.morphTargets&&a.enable(5),k.morphNormals&&a.enable(6),k.morphColors&&a.enable(7),k.premultipliedAlpha&&a.enable(8),k.shadowMapEnabled&&a.enable(9),k.physicallyCorrectLights&&a.enable(10),k.doubleSided&&a.enable(11),k.flipSided&&a.enable(12),k.useDepthPacking&&a.enable(13),k.dithering&&a.enable(14),k.specularIntensityMap&&a.enable(15),k.specularColorMap&&a.enable(16),k.transmission&&a.enable(17),k.transmissionMap&&a.enable(18),k.thicknessMap&&a.enable(19),k.sheen&&a.enable(20),k.sheenColorMap&&a.enable(21),k.sheenRoughnessMap&&a.enable(22),k.decodeVideoTexture&&a.enable(23),k.opaque&&a.enable(24),O.push(a.mask)}function x(O){const k=p[O.type];let E;if(k){const P=Id[k];E=JXe.clone(P.uniforms)}else E=O.uniforms;return E}function b(O,k){let E;for(let P=0,A=c.length;P0?r.push(v):h.transparent===!0?i.push(v):n.push(v)}function l(f,d,h,p,g,m){const v=s(f,d,h,p,g,m);h.transmission>0?r.unshift(v):h.transparent===!0?i.unshift(v):n.unshift(v)}function c(f,d){n.length>1&&n.sort(f||vVn),r.length>1&&r.sort(d||PEe),i.length>1&&i.sort(d||PEe)}function u(){for(let f=e,d=t.length;f=o.length?(s=new MEe,o.push(s)):s=o[i],s}function n(){t=new WeakMap}return{get:e,dispose:n}}function xVn(){const t={};return{get:function(e){if(t[e.id]!==void 0)return t[e.id];let n;switch(e.type){case"DirectionalLight":n={direction:new Ce,color:new fi};break;case"SpotLight":n={position:new Ce,direction:new Ce,color:new fi,distance:0,coneCos:0,penumbraCos:0,decay:0};break;case"PointLight":n={position:new Ce,color:new fi,distance:0,decay:0};break;case"HemisphereLight":n={direction:new Ce,skyColor:new fi,groundColor:new fi};break;case"RectAreaLight":n={color:new fi,position:new Ce,halfWidth:new Ce,halfHeight:new Ce};break}return t[e.id]=n,n}}}function bVn(){const t={};return{get:function(e){if(t[e.id]!==void 0)return t[e.id];let n;switch(e.type){case"DirectionalLight":n={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new On};break;case"SpotLight":n={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new On};break;case"PointLight":n={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new On,shadowCameraNear:1,shadowCameraFar:1e3};break}return t[e.id]=n,n}}}let wVn=0;function _Vn(t,e){return(e.castShadow?2:0)-(t.castShadow?2:0)+(e.map?1:0)-(t.map?1:0)}function SVn(t,e){const n=new xVn,r=bVn(),i={version:0,hash:{directionalLength:-1,pointLength:-1,spotLength:-1,rectAreaLength:-1,hemiLength:-1,numDirectionalShadows:-1,numPointShadows:-1,numSpotShadows:-1,numSpotMaps:-1},ambient:[0,0,0],probe:[],directional:[],directionalShadow:[],directionalShadowMap:[],directionalShadowMatrix:[],spot:[],spotLightMap:[],spotShadow:[],spotShadowMap:[],spotLightMatrix:[],rectArea:[],rectAreaLTC1:null,rectAreaLTC2:null,point:[],pointShadow:[],pointShadowMap:[],pointShadowMatrix:[],hemi:[],numSpotLightShadowsWithMaps:0};for(let u=0;u<9;u++)i.probe.push(new Ce);const o=new Ce,s=new Wr,a=new Wr;function l(u,f){let d=0,h=0,p=0;for(let P=0;P<9;P++)i.probe[P].set(0,0,0);let g=0,m=0,v=0,y=0,x=0,b=0,w=0,_=0,S=0,O=0;u.sort(_Vn);const k=f!==!0?Math.PI:1;for(let P=0,A=u.length;P0&&(e.isWebGL2||t.has("OES_texture_float_linear")===!0?(i.rectAreaLTC1=ft.LTC_FLOAT_1,i.rectAreaLTC2=ft.LTC_FLOAT_2):t.has("OES_texture_half_float_linear")===!0?(i.rectAreaLTC1=ft.LTC_HALF_1,i.rectAreaLTC2=ft.LTC_HALF_2):console.error("THREE.WebGLRenderer: Unable to use RectAreaLight. Missing WebGL extensions.")),i.ambient[0]=d,i.ambient[1]=h,i.ambient[2]=p;const E=i.hash;(E.directionalLength!==g||E.pointLength!==m||E.spotLength!==v||E.rectAreaLength!==y||E.hemiLength!==x||E.numDirectionalShadows!==b||E.numPointShadows!==w||E.numSpotShadows!==_||E.numSpotMaps!==S)&&(i.directional.length=g,i.spot.length=v,i.rectArea.length=y,i.point.length=m,i.hemi.length=x,i.directionalShadow.length=b,i.directionalShadowMap.length=b,i.pointShadow.length=w,i.pointShadowMap.length=w,i.spotShadow.length=_,i.spotShadowMap.length=_,i.directionalShadowMatrix.length=b,i.pointShadowMatrix.length=w,i.spotLightMatrix.length=_+S-O,i.spotLightMap.length=S,i.numSpotLightShadowsWithMaps=O,E.directionalLength=g,E.pointLength=m,E.spotLength=v,E.rectAreaLength=y,E.hemiLength=x,E.numDirectionalShadows=b,E.numPointShadows=w,E.numSpotShadows=_,E.numSpotMaps=S,i.version=wVn++)}function c(u,f){let d=0,h=0,p=0,g=0,m=0;const v=f.matrixWorldInverse;for(let y=0,x=u.length;y=a.length?(l=new REe(t,e),a.push(l)):l=a[s],l}function i(){n=new WeakMap}return{get:r,dispose:i}}class OVn extends _D{constructor(e){super(),this.isMeshDepthMaterial=!0,this.type="MeshDepthMaterial",this.depthPacking=jBn,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.setValues(e)}copy(e){return super.copy(e),this.depthPacking=e.depthPacking,this.map=e.map,this.alphaMap=e.alphaMap,this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this}}class EVn extends _D{constructor(e){super(),this.isMeshDistanceMaterial=!0,this.type="MeshDistanceMaterial",this.referencePosition=new Ce,this.nearDistance=1,this.farDistance=1e3,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.setValues(e)}copy(e){return super.copy(e),this.referencePosition.copy(e.referencePosition),this.nearDistance=e.nearDistance,this.farDistance=e.farDistance,this.map=e.map,this.alphaMap=e.alphaMap,this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this}}const TVn=`void main() { gl_Position = vec4( position, 1.0 ); -}`,IVn=`uniform sampler2D shadow_pass; +}`,kVn=`uniform sampler2D shadow_pass; uniform vec2 resolution; uniform float radius; #include @@ -3692,7 +3694,7 @@ void main() { squared_mean = squared_mean / samples; float std_dev = sqrt( squared_mean - mean * mean ); gl_FragColor = pack2HalfToRGBA( vec2( mean, std_dev ) ); -}`;function LVn(t,e,n){let r=new AXe;const i=new En,o=new En,s=new vs,a=new MVn({depthPacking:qBn}),l=new RVn,c={},u=n.maxTextureSize,f={0:vc,1:zC,2:tg},d=new Ty({defines:{VSM_SAMPLES:8},uniforms:{shadow_pass:{value:null},resolution:{value:new En},radius:{value:4}},vertexShader:DVn,fragmentShader:IVn}),h=d.clone();h.defines.HORIZONTAL_PASS=1;const p=new sm;p.setAttribute("position",new xu(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));const g=new ah(p,d),m=this;this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=cXe,this.render=function(b,w,_){if(m.enabled===!1||m.autoUpdate===!1&&m.needsUpdate===!1||b.length===0)return;const S=t.getRenderTarget(),O=t.getActiveCubeFace(),k=t.getActiveMipmapLevel(),E=t.state;E.setBlending(qv),E.buffers.color.setClear(1,1,1,1),E.buffers.depth.setTest(!0),E.setScissorTest(!1);for(let M=0,A=b.length;Mu||i.y>u)&&(i.x>u&&(o.x=Math.floor(u/R.x),i.x=o.x*R.x,T.mapSize.x=o.x),i.y>u&&(o.y=Math.floor(u/R.y),i.y=o.y*R.y,T.mapSize.y=o.y)),T.map===null){const B=this.type!==FT?{minFilter:tl,magFilter:tl}:{};T.map=new V1(i.x,i.y,B),T.map.texture.name=P.name+".shadowMap",T.camera.updateProjectionMatrix()}t.setRenderTarget(T.map),t.clear();const I=T.getViewportCount();for(let B=0;B0){const A=E.uuid,P=w.uuid;let T=c[A];T===void 0&&(T={},c[A]=T);let R=T[P];R===void 0&&(R=E.clone(),T[P]=R),E=R}return E.visible=w.visible,E.wireframe=w.wireframe,k===FT?E.side=w.shadowSide!==null?w.shadowSide:w.side:E.side=w.shadowSide!==null?w.shadowSide:f[w.side],E.alphaMap=w.alphaMap,E.alphaTest=w.alphaTest,E.clipShadows=w.clipShadows,E.clippingPlanes=w.clippingPlanes,E.clipIntersection=w.clipIntersection,E.displacementMap=w.displacementMap,E.displacementScale=w.displacementScale,E.displacementBias=w.displacementBias,E.wireframeLinewidth=w.wireframeLinewidth,E.linewidth=w.linewidth,_.isPointLight===!0&&E.isMeshDistanceMaterial===!0&&(E.referencePosition.setFromMatrixPosition(_.matrixWorld),E.nearDistance=S,E.farDistance=O),E}function x(b,w,_,S,O){if(b.visible===!1)return;if(b.layers.test(w.layers)&&(b.isMesh||b.isLine||b.isPoints)&&(b.castShadow||b.receiveShadow&&O===FT)&&(!b.frustumCulled||r.intersectsObject(b))){b.modelViewMatrix.multiplyMatrices(_.matrixWorldInverse,b.matrixWorld);const M=e.update(b),A=b.material;if(Array.isArray(A)){const P=M.groups;for(let T=0,R=P.length;T=1):$.indexOf("OpenGL ES")!==-1&&(B=parseFloat(/^OpenGL ES (\d)/.exec($)[1]),I=B>=2);let z=null,L={};const j=t.getParameter(3088),N=t.getParameter(2978),F=new vs().fromArray(j),H=new vs().fromArray(N);function q(ue,$e,Se){const He=new Uint8Array(4),tt=t.createTexture();t.bindTexture(ue,tt),t.texParameteri(ue,10241,9728),t.texParameteri(ue,10240,9728);for(let ut=0;utse||G.height>se)&&(ye=se/Math.max(G.width,G.height)),ye<1||W===!0)if(typeof HTMLImageElement<"u"&&G instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&G instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&G instanceof ImageBitmap){const ie=W?zZ:Math.floor,fe=ie(ye*G.width),Q=ie(ye*G.height);g===void 0&&(g=y(fe,Q));const _e=J?y(fe,Q):g;return _e.width=fe,_e.height=Q,_e.getContext("2d").drawImage(G,0,0,fe,Q),console.warn("THREE.WebGLRenderer: Texture has been resized from ("+G.width+"x"+G.height+") to ("+fe+"x"+Q+")."),_e}else return"data"in G&&console.warn("THREE.WebGLRenderer: Image in DataTexture is too big ("+G.width+"x"+G.height+")."),G;return G}function b(G){return EOe(G.width)&&EOe(G.height)}function w(G){return a?!1:G.wrapS!==eu||G.wrapT!==eu||G.minFilter!==tl&&G.minFilter!==nl}function _(G,W){return G.generateMipmaps&&W&&G.minFilter!==tl&&G.minFilter!==nl}function S(G){t.generateMipmap(G)}function O(G,W,J,se,ye=!1){if(a===!1)return W;if(G!==null){if(t[G]!==void 0)return t[G];console.warn("THREE.WebGLRenderer: Attempt to use non-existing WebGL internal format '"+G+"'")}let ie=W;return W===6403&&(J===5126&&(ie=33326),J===5131&&(ie=33325),J===5121&&(ie=33321)),W===33319&&(J===5126&&(ie=33328),J===5131&&(ie=33327),J===5121&&(ie=33323)),W===6408&&(J===5126&&(ie=34836),J===5131&&(ie=34842),J===5121&&(ie=se===Pi&&ye===!1?35907:32856),J===32819&&(ie=32854),J===32820&&(ie=32855)),(ie===33325||ie===33326||ie===33327||ie===33328||ie===34842||ie===34836)&&e.get("EXT_color_buffer_float"),ie}function k(G,W,J){return _(G,J)===!0||G.isFramebufferTexture&&G.minFilter!==tl&&G.minFilter!==nl?Math.log2(Math.max(W.width,W.height))+1:G.mipmaps!==void 0&&G.mipmaps.length>0?G.mipmaps.length:G.isCompressedTexture&&Array.isArray(G.image)?W.mipmaps.length:1}function E(G){return G===tl||G===eOe||G===tOe?9728:9729}function M(G){const W=G.target;W.removeEventListener("dispose",M),P(W),W.isVideoTexture&&p.delete(W)}function A(G){const W=G.target;W.removeEventListener("dispose",A),R(W)}function P(G){const W=r.get(G);if(W.__webglInit===void 0)return;const J=G.source,se=m.get(J);if(se){const ye=se[W.__cacheKey];ye.usedTimes--,ye.usedTimes===0&&T(G),Object.keys(se).length===0&&m.delete(J)}r.remove(G)}function T(G){const W=r.get(G);t.deleteTexture(W.__webglTexture);const J=G.source,se=m.get(J);delete se[W.__cacheKey],s.memory.textures--}function R(G){const W=G.texture,J=r.get(G),se=r.get(W);if(se.__webglTexture!==void 0&&(t.deleteTexture(se.__webglTexture),s.memory.textures--),G.depthTexture&&G.depthTexture.dispose(),G.isWebGLCubeRenderTarget)for(let ye=0;ye<6;ye++)t.deleteFramebuffer(J.__webglFramebuffer[ye]),J.__webglDepthbuffer&&t.deleteRenderbuffer(J.__webglDepthbuffer[ye]);else{if(t.deleteFramebuffer(J.__webglFramebuffer),J.__webglDepthbuffer&&t.deleteRenderbuffer(J.__webglDepthbuffer),J.__webglMultisampledFramebuffer&&t.deleteFramebuffer(J.__webglMultisampledFramebuffer),J.__webglColorRenderbuffer)for(let ye=0;ye=l&&console.warn("THREE.WebGLTextures: Trying to use "+G+" texture units while this GPU supports only "+l),I+=1,G}function z(G){const W=[];return W.push(G.wrapS),W.push(G.wrapT),W.push(G.magFilter),W.push(G.minFilter),W.push(G.anisotropy),W.push(G.internalFormat),W.push(G.format),W.push(G.type),W.push(G.generateMipmaps),W.push(G.premultiplyAlpha),W.push(G.flipY),W.push(G.unpackAlignment),W.push(G.encoding),W.join()}function L(G,W){const J=r.get(G);if(G.isVideoTexture&&he(G),G.isRenderTargetTexture===!1&&G.version>0&&J.__version!==G.version){const se=G.image;if(se===null)console.warn("THREE.WebGLRenderer: Texture marked for update but no image data found.");else if(se.complete===!1)console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete");else{K(J,G,W);return}}n.activeTexture(33984+W),n.bindTexture(3553,J.__webglTexture)}function j(G,W){const J=r.get(G);if(G.version>0&&J.__version!==G.version){K(J,G,W);return}n.activeTexture(33984+W),n.bindTexture(35866,J.__webglTexture)}function N(G,W){const J=r.get(G);if(G.version>0&&J.__version!==G.version){K(J,G,W);return}n.activeTexture(33984+W),n.bindTexture(32879,J.__webglTexture)}function F(G,W){const J=r.get(G);if(G.version>0&&J.__version!==G.version){ee(J,G,W);return}n.activeTexture(33984+W),n.bindTexture(34067,J.__webglTexture)}const H={[$Z]:10497,[eu]:33071,[FZ]:33648},q={[tl]:9728,[eOe]:9984,[tOe]:9986,[nl]:9729,[MBn]:9985,[o8]:9987};function Y(G,W,J){if(J?(t.texParameteri(G,10242,H[W.wrapS]),t.texParameteri(G,10243,H[W.wrapT]),(G===32879||G===35866)&&t.texParameteri(G,32882,H[W.wrapR]),t.texParameteri(G,10240,q[W.magFilter]),t.texParameteri(G,10241,q[W.minFilter])):(t.texParameteri(G,10242,33071),t.texParameteri(G,10243,33071),(G===32879||G===35866)&&t.texParameteri(G,32882,33071),(W.wrapS!==eu||W.wrapT!==eu)&&console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.wrapS and Texture.wrapT should be set to THREE.ClampToEdgeWrapping."),t.texParameteri(G,10240,E(W.magFilter)),t.texParameteri(G,10241,E(W.minFilter)),W.minFilter!==tl&&W.minFilter!==nl&&console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.minFilter should be set to THREE.NearestFilter or THREE.LinearFilter.")),e.has("EXT_texture_filter_anisotropic")===!0){const se=e.get("EXT_texture_filter_anisotropic");if(W.type===Ev&&e.has("OES_texture_float_linear")===!1||a===!1&&W.type===sM&&e.has("OES_texture_half_float_linear")===!1)return;(W.anisotropy>1||r.get(W).__currentAnisotropy)&&(t.texParameterf(G,se.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(W.anisotropy,i.getMaxAnisotropy())),r.get(W).__currentAnisotropy=W.anisotropy)}}function le(G,W){let J=!1;G.__webglInit===void 0&&(G.__webglInit=!0,W.addEventListener("dispose",M));const se=W.source;let ye=m.get(se);ye===void 0&&(ye={},m.set(se,ye));const ie=z(W);if(ie!==G.__cacheKey){ye[ie]===void 0&&(ye[ie]={texture:t.createTexture(),usedTimes:0},s.memory.textures++,J=!0),ye[ie].usedTimes++;const fe=ye[G.__cacheKey];fe!==void 0&&(ye[G.__cacheKey].usedTimes--,fe.usedTimes===0&&T(W)),G.__cacheKey=ie,G.__webglTexture=ye[ie].texture}return J}function K(G,W,J){let se=3553;W.isDataArrayTexture&&(se=35866),W.isData3DTexture&&(se=32879);const ye=le(G,W),ie=W.source;if(n.activeTexture(33984+J),n.bindTexture(se,G.__webglTexture),ie.version!==ie.__currentVersion||ye===!0){t.pixelStorei(37440,W.flipY),t.pixelStorei(37441,W.premultiplyAlpha),t.pixelStorei(3317,W.unpackAlignment),t.pixelStorei(37443,0);const fe=w(W)&&b(W.image)===!1;let Q=x(W.image,fe,!1,u);Q=xe(W,Q);const _e=b(Q)||a,we=o.convert(W.format,W.encoding);let Ie=o.convert(W.type),Pe=O(W.internalFormat,we,Ie,W.encoding,W.isVideoTexture);Y(se,W,_e);let Me;const Te=W.mipmaps,Le=a&&W.isVideoTexture!==!0,ue=ie.__currentVersion===void 0||ye===!0,$e=k(W,Q,_e);if(W.isDepthTexture)Pe=6402,a?W.type===Ev?Pe=36012:W.type===_x?Pe=33190:W.type===sS?Pe=35056:Pe=33189:W.type===Ev&&console.error("WebGLRenderer: Floating point depth texture requires WebGL2."),W.format===Xx&&Pe===6402&&W.type!==pXe&&W.type!==_x&&(console.warn("THREE.WebGLRenderer: Use UnsignedShortType or UnsignedIntType for DepthFormat DepthTexture."),W.type=_x,Ie=o.convert(W.type)),W.format===UC&&Pe===6402&&(Pe=34041,W.type!==sS&&(console.warn("THREE.WebGLRenderer: Use UnsignedInt248Type for DepthStencilFormat DepthTexture."),W.type=sS,Ie=o.convert(W.type))),ue&&(Le?n.texStorage2D(3553,1,Pe,Q.width,Q.height):n.texImage2D(3553,0,Pe,Q.width,Q.height,0,we,Ie,null));else if(W.isDataTexture)if(Te.length>0&&_e){Le&&ue&&n.texStorage2D(3553,$e,Pe,Te[0].width,Te[0].height);for(let Se=0,He=Te.length;Se>=1,He>>=1}}else if(Te.length>0&&_e){Le&&ue&&n.texStorage2D(3553,$e,Pe,Te[0].width,Te[0].height);for(let Se=0,He=Te.length;Se0&&ue++,n.texStorage2D(34067,ue,Me,Q[0].width,Q[0].height));for(let Se=0;Se<6;Se++)if(fe){Te?n.texSubImage2D(34069+Se,0,0,0,Q[Se].width,Q[Se].height,Ie,Pe,Q[Se].data):n.texImage2D(34069+Se,0,Me,Q[Se].width,Q[Se].height,0,Ie,Pe,Q[Se].data);for(let He=0;He<$e.length;He++){const ut=$e[He].image[Se].image;Te?n.texSubImage2D(34069+Se,He+1,0,0,ut.width,ut.height,Ie,Pe,ut.data):n.texImage2D(34069+Se,He+1,Me,ut.width,ut.height,0,Ie,Pe,ut.data)}}else{Te?n.texSubImage2D(34069+Se,0,0,0,Ie,Pe,Q[Se]):n.texImage2D(34069+Se,0,Me,Ie,Pe,Q[Se]);for(let He=0;He<$e.length;He++){const tt=$e[He];Te?n.texSubImage2D(34069+Se,He+1,0,0,Ie,Pe,tt.image[Se]):n.texImage2D(34069+Se,He+1,Me,Ie,Pe,tt.image[Se])}}}_(W,we)&&S(34067),ye.__currentVersion=ye.version,W.onUpdate&&W.onUpdate(W)}G.__version=W.version}function re(G,W,J,se,ye){const ie=o.convert(J.format,J.encoding),fe=o.convert(J.type),Q=O(J.internalFormat,ie,fe,J.encoding);r.get(W).__hasExternalTextures||(ye===32879||ye===35866?n.texImage3D(ye,0,Q,W.width,W.height,W.depth,0,ie,fe,null):n.texImage2D(ye,0,Q,W.width,W.height,0,ie,fe,null)),n.bindFramebuffer(36160,G),Z(W)?d.framebufferTexture2DMultisampleEXT(36160,se,ye,r.get(J).__webglTexture,0,X(W)):t.framebufferTexture2D(36160,se,ye,r.get(J).__webglTexture,0),n.bindFramebuffer(36160,null)}function me(G,W,J){if(t.bindRenderbuffer(36161,G),W.depthBuffer&&!W.stencilBuffer){let se=33189;if(J||Z(W)){const ye=W.depthTexture;ye&&ye.isDepthTexture&&(ye.type===Ev?se=36012:ye.type===_x&&(se=33190));const ie=X(W);Z(W)?d.renderbufferStorageMultisampleEXT(36161,ie,se,W.width,W.height):t.renderbufferStorageMultisample(36161,ie,se,W.width,W.height)}else t.renderbufferStorage(36161,se,W.width,W.height);t.framebufferRenderbuffer(36160,36096,36161,G)}else if(W.depthBuffer&&W.stencilBuffer){const se=X(W);J&&Z(W)===!1?t.renderbufferStorageMultisample(36161,se,35056,W.width,W.height):Z(W)?d.renderbufferStorageMultisampleEXT(36161,se,35056,W.width,W.height):t.renderbufferStorage(36161,34041,W.width,W.height),t.framebufferRenderbuffer(36160,33306,36161,G)}else{const se=W.isWebGLMultipleRenderTargets===!0?W.texture:[W.texture];for(let ye=0;ye0&&Z(G)===!1){const Q=ie?W:[W];J.__webglMultisampledFramebuffer=t.createFramebuffer(),J.__webglColorRenderbuffer=[],n.bindFramebuffer(36160,J.__webglMultisampledFramebuffer);for(let _e=0;_e0&&Z(G)===!1){const W=G.isWebGLMultipleRenderTargets?G.texture:[G.texture],J=G.width,se=G.height;let ye=16384;const ie=[],fe=G.stencilBuffer?33306:36096,Q=r.get(G),_e=G.isWebGLMultipleRenderTargets===!0;if(_e)for(let we=0;we0&&e.has("WEBGL_multisampled_render_to_texture")===!0&&W.__useRenderToTexture!==!1}function he(G){const W=s.render.frame;p.get(G)!==W&&(p.set(G,W),G.update())}function xe(G,W){const J=G.encoding,se=G.format,ye=G.type;return G.isCompressedTexture===!0||G.isVideoTexture===!0||G.format===NZ||J!==W1&&(J===Pi?a===!1?e.has("EXT_sRGB")===!0&&se===sh?(G.format=NZ,G.minFilter=nl,G.generateMipmaps=!1):W=yXe.sRGBToLinear(W):(se!==sh||ye!==U1)&&console.warn("THREE.WebGLTextures: sRGB encoded textures have to use RGBAFormat and UnsignedByteType."):console.error("THREE.WebGLTextures: Unsupported texture encoding:",J)),W}this.allocateTextureUnit=$,this.resetTextureUnits=B,this.setTexture2D=L,this.setTexture2DArray=j,this.setTexture3D=N,this.setTextureCube=F,this.rebindTextures=U,this.setupRenderTarget=oe,this.updateRenderTargetMipmap=ne,this.updateMultisampleRenderTarget=V,this.setupDepthRenderbuffer=ae,this.setupFrameBufferTexture=re,this.useMultisampledRTT=Z}function NVn(t,e,n){const r=n.isWebGL2;function i(o,s=null){let a;if(o===U1)return 5121;if(o===LBn)return 32819;if(o===$Bn)return 32820;if(o===RBn)return 5120;if(o===DBn)return 5122;if(o===pXe)return 5123;if(o===IBn)return 5124;if(o===_x)return 5125;if(o===Ev)return 5126;if(o===sM)return r?5131:(a=e.get("OES_texture_half_float"),a!==null?a.HALF_FLOAT_OES:null);if(o===FBn)return 6406;if(o===sh)return 6408;if(o===zBn)return 6409;if(o===jBn)return 6410;if(o===Xx)return 6402;if(o===UC)return 34041;if(o===gXe)return 6403;if(o===NBn)return console.warn("THREE.WebGLRenderer: THREE.RGBFormat has been removed. Use THREE.RGBAFormat instead. https://github.com/mrdoob/three.js/pull/23228"),6408;if(o===NZ)return a=e.get("EXT_sRGB"),a!==null?a.SRGB_ALPHA_EXT:null;if(o===BBn)return 36244;if(o===UBn)return 33319;if(o===WBn)return 33320;if(o===VBn)return 36249;if(o===B7||o===U7||o===W7||o===V7)if(s===Pi)if(a=e.get("WEBGL_compressed_texture_s3tc_srgb"),a!==null){if(o===B7)return a.COMPRESSED_SRGB_S3TC_DXT1_EXT;if(o===U7)return a.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT;if(o===W7)return a.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT;if(o===V7)return a.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT}else return null;else if(a=e.get("WEBGL_compressed_texture_s3tc"),a!==null){if(o===B7)return a.COMPRESSED_RGB_S3TC_DXT1_EXT;if(o===U7)return a.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(o===W7)return a.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(o===V7)return a.COMPRESSED_RGBA_S3TC_DXT5_EXT}else return null;if(o===nOe||o===rOe||o===iOe||o===oOe)if(a=e.get("WEBGL_compressed_texture_pvrtc"),a!==null){if(o===nOe)return a.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(o===rOe)return a.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(o===iOe)return a.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(o===oOe)return a.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}else return null;if(o===GBn)return a=e.get("WEBGL_compressed_texture_etc1"),a!==null?a.COMPRESSED_RGB_ETC1_WEBGL:null;if(o===sOe||o===aOe)if(a=e.get("WEBGL_compressed_texture_etc"),a!==null){if(o===sOe)return s===Pi?a.COMPRESSED_SRGB8_ETC2:a.COMPRESSED_RGB8_ETC2;if(o===aOe)return s===Pi?a.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:a.COMPRESSED_RGBA8_ETC2_EAC}else return null;if(o===lOe||o===cOe||o===uOe||o===fOe||o===dOe||o===hOe||o===pOe||o===gOe||o===mOe||o===vOe||o===yOe||o===xOe||o===bOe||o===wOe)if(a=e.get("WEBGL_compressed_texture_astc"),a!==null){if(o===lOe)return s===Pi?a.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR:a.COMPRESSED_RGBA_ASTC_4x4_KHR;if(o===cOe)return s===Pi?a.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR:a.COMPRESSED_RGBA_ASTC_5x4_KHR;if(o===uOe)return s===Pi?a.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR:a.COMPRESSED_RGBA_ASTC_5x5_KHR;if(o===fOe)return s===Pi?a.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR:a.COMPRESSED_RGBA_ASTC_6x5_KHR;if(o===dOe)return s===Pi?a.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR:a.COMPRESSED_RGBA_ASTC_6x6_KHR;if(o===hOe)return s===Pi?a.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR:a.COMPRESSED_RGBA_ASTC_8x5_KHR;if(o===pOe)return s===Pi?a.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR:a.COMPRESSED_RGBA_ASTC_8x6_KHR;if(o===gOe)return s===Pi?a.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR:a.COMPRESSED_RGBA_ASTC_8x8_KHR;if(o===mOe)return s===Pi?a.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR:a.COMPRESSED_RGBA_ASTC_10x5_KHR;if(o===vOe)return s===Pi?a.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR:a.COMPRESSED_RGBA_ASTC_10x6_KHR;if(o===yOe)return s===Pi?a.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR:a.COMPRESSED_RGBA_ASTC_10x8_KHR;if(o===xOe)return s===Pi?a.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR:a.COMPRESSED_RGBA_ASTC_10x10_KHR;if(o===bOe)return s===Pi?a.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR:a.COMPRESSED_RGBA_ASTC_12x10_KHR;if(o===wOe)return s===Pi?a.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR:a.COMPRESSED_RGBA_ASTC_12x12_KHR}else return null;if(o===_Oe)if(a=e.get("EXT_texture_compression_bptc"),a!==null){if(o===_Oe)return s===Pi?a.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT:a.COMPRESSED_RGBA_BPTC_UNORM_EXT}else return null;return o===sS?r?34042:(a=e.get("WEBGL_depth_texture"),a!==null?a.UNSIGNED_INT_24_8_WEBGL:null):t[o]!==void 0?t[o]:null}return{convert:i}}class zVn extends wf{constructor(e=[]){super(),this.isArrayCamera=!0,this.cameras=e}}class R$ extends bl{constructor(){super(),this.isGroup=!0,this.type="Group"}}const jVn={type:"move"};class yG{constructor(){this._targetRay=null,this._grip=null,this._hand=null}getHandSpace(){return this._hand===null&&(this._hand=new R$,this._hand.matrixAutoUpdate=!1,this._hand.visible=!1,this._hand.joints={},this._hand.inputState={pinching:!1}),this._hand}getTargetRaySpace(){return this._targetRay===null&&(this._targetRay=new R$,this._targetRay.matrixAutoUpdate=!1,this._targetRay.visible=!1,this._targetRay.hasLinearVelocity=!1,this._targetRay.linearVelocity=new Ce,this._targetRay.hasAngularVelocity=!1,this._targetRay.angularVelocity=new Ce),this._targetRay}getGripSpace(){return this._grip===null&&(this._grip=new R$,this._grip.matrixAutoUpdate=!1,this._grip.visible=!1,this._grip.hasLinearVelocity=!1,this._grip.linearVelocity=new Ce,this._grip.hasAngularVelocity=!1,this._grip.angularVelocity=new Ce),this._grip}dispatchEvent(e){return this._targetRay!==null&&this._targetRay.dispatchEvent(e),this._grip!==null&&this._grip.dispatchEvent(e),this._hand!==null&&this._hand.dispatchEvent(e),this}disconnect(e){return this.dispatchEvent({type:"disconnected",data:e}),this._targetRay!==null&&(this._targetRay.visible=!1),this._grip!==null&&(this._grip.visible=!1),this._hand!==null&&(this._hand.visible=!1),this}update(e,n,r){let i=null,o=null,s=null;const a=this._targetRay,l=this._grip,c=this._hand;if(e&&n.session.visibilityState!=="visible-blurred"){if(c&&e.hand){s=!0;for(const g of e.hand.values()){const m=n.getJointPose(g,r);if(c.joints[g.jointName]===void 0){const y=new R$;y.matrixAutoUpdate=!1,y.visible=!1,c.joints[g.jointName]=y,c.add(y)}const v=c.joints[g.jointName];m!==null&&(v.matrix.fromArray(m.transform.matrix),v.matrix.decompose(v.position,v.rotation,v.scale),v.jointRadius=m.radius),v.visible=m!==null}const u=c.joints["index-finger-tip"],f=c.joints["thumb-tip"],d=u.position.distanceTo(f.position),h=.02,p=.005;c.inputState.pinching&&d>h+p?(c.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:e.handedness,target:this})):!c.inputState.pinching&&d<=h-p&&(c.inputState.pinching=!0,this.dispatchEvent({type:"pinchstart",handedness:e.handedness,target:this}))}else l!==null&&e.gripSpace&&(o=n.getPose(e.gripSpace,r),o!==null&&(l.matrix.fromArray(o.transform.matrix),l.matrix.decompose(l.position,l.rotation,l.scale),o.linearVelocity?(l.hasLinearVelocity=!0,l.linearVelocity.copy(o.linearVelocity)):l.hasLinearVelocity=!1,o.angularVelocity?(l.hasAngularVelocity=!0,l.angularVelocity.copy(o.angularVelocity)):l.hasAngularVelocity=!1));a!==null&&(i=n.getPose(e.targetRaySpace,r),i===null&&o!==null&&(i=o),i!==null&&(a.matrix.fromArray(i.transform.matrix),a.matrix.decompose(a.position,a.rotation,a.scale),i.linearVelocity?(a.hasLinearVelocity=!0,a.linearVelocity.copy(i.linearVelocity)):a.hasLinearVelocity=!1,i.angularVelocity?(a.hasAngularVelocity=!0,a.angularVelocity.copy(i.angularVelocity)):a.hasAngularVelocity=!1,this.dispatchEvent(jVn)))}return a!==null&&(a.visible=i!==null),l!==null&&(l.visible=o!==null),c!==null&&(c.visible=s!==null),this}}class BVn extends Ac{constructor(e,n,r,i,o,s,a,l,c,u){if(u=u!==void 0?u:Xx,u!==Xx&&u!==UC)throw new Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");r===void 0&&u===Xx&&(r=_x),r===void 0&&u===UC&&(r=sS),super(null,i,o,s,a,l,u,r,c),this.isDepthTexture=!0,this.image={width:e,height:n},this.magFilter=a!==void 0?a:tl,this.minFilter=l!==void 0?l:tl,this.flipY=!1,this.generateMipmaps=!1}}class UVn extends Mb{constructor(e,n){super();const r=this;let i=null,o=1,s=null,a="local-floor",l=null,c=null,u=null,f=null,d=null,h=null;const p=n.getContextAttributes();let g=null,m=null;const v=[],y=[],x=new wf;x.layers.enable(1),x.viewport=new vs;const b=new wf;b.layers.enable(2),b.viewport=new vs;const w=[x,b],_=new zVn;_.layers.enable(1),_.layers.enable(2);let S=null,O=null;this.cameraAutoUpdate=!0,this.enabled=!1,this.isPresenting=!1,this.getController=function(z){let L=v[z];return L===void 0&&(L=new yG,v[z]=L),L.getTargetRaySpace()},this.getControllerGrip=function(z){let L=v[z];return L===void 0&&(L=new yG,v[z]=L),L.getGripSpace()},this.getHand=function(z){let L=v[z];return L===void 0&&(L=new yG,v[z]=L),L.getHandSpace()};function k(z){const L=y.indexOf(z.inputSource);if(L===-1)return;const j=v[L];j!==void 0&&j.dispatchEvent({type:z.type,data:z.inputSource})}function E(){i.removeEventListener("select",k),i.removeEventListener("selectstart",k),i.removeEventListener("selectend",k),i.removeEventListener("squeeze",k),i.removeEventListener("squeezestart",k),i.removeEventListener("squeezeend",k),i.removeEventListener("end",E),i.removeEventListener("inputsourceschange",M);for(let z=0;z=0&&(y[N]=null,v[N].dispatchEvent({type:"disconnected",data:j}))}for(let L=0;L=y.length){y.push(j),N=H;break}else if(y[H]===null){y[H]=j,N=H;break}if(N===-1)break}const F=v[N];F&&F.dispatchEvent({type:"connected",data:j})}}const A=new Ce,P=new Ce;function T(z,L,j){A.setFromMatrixPosition(L.matrixWorld),P.setFromMatrixPosition(j.matrixWorld);const N=A.distanceTo(P),F=L.projectionMatrix.elements,H=j.projectionMatrix.elements,q=F[14]/(F[10]-1),Y=F[14]/(F[10]+1),le=(F[9]+1)/F[5],K=(F[9]-1)/F[5],ee=(F[8]-1)/F[0],re=(H[8]+1)/H[0],me=q*ee,te=q*re,ae=N/(-ee+re),U=ae*-ee;L.matrixWorld.decompose(z.position,z.quaternion,z.scale),z.translateX(U),z.translateZ(ae),z.matrixWorld.compose(z.position,z.quaternion,z.scale),z.matrixWorldInverse.copy(z.matrixWorld).invert();const oe=q+ae,ne=Y+ae,V=me-U,X=te+(N-U),Z=le*Y/ne*oe,he=K*Y/ne*oe;z.projectionMatrix.makePerspective(V,X,Z,he,oe,ne)}function R(z,L){L===null?z.matrixWorld.copy(z.matrix):z.matrixWorld.multiplyMatrices(L.matrixWorld,z.matrix),z.matrixWorldInverse.copy(z.matrixWorld).invert()}this.updateCamera=function(z){if(i===null)return;_.near=b.near=x.near=z.near,_.far=b.far=x.far=z.far,(S!==_.near||O!==_.far)&&(i.updateRenderState({depthNear:_.near,depthFar:_.far}),S=_.near,O=_.far);const L=z.parent,j=_.cameras;R(_,L);for(let F=0;F0&&(g.alphaTest.value=m.alphaTest);const v=e.get(m).envMap;if(v&&(g.envMap.value=v,g.flipEnvMap.value=v.isCubeTexture&&v.isRenderTargetTexture===!1?-1:1,g.reflectivity.value=m.reflectivity,g.ior.value=m.ior,g.refractionRatio.value=m.refractionRatio),m.lightMap){g.lightMap.value=m.lightMap;const b=t.physicallyCorrectLights!==!0?Math.PI:1;g.lightMapIntensity.value=m.lightMapIntensity*b}m.aoMap&&(g.aoMap.value=m.aoMap,g.aoMapIntensity.value=m.aoMapIntensity);let y;m.map?y=m.map:m.specularMap?y=m.specularMap:m.displacementMap?y=m.displacementMap:m.normalMap?y=m.normalMap:m.bumpMap?y=m.bumpMap:m.roughnessMap?y=m.roughnessMap:m.metalnessMap?y=m.metalnessMap:m.alphaMap?y=m.alphaMap:m.emissiveMap?y=m.emissiveMap:m.clearcoatMap?y=m.clearcoatMap:m.clearcoatNormalMap?y=m.clearcoatNormalMap:m.clearcoatRoughnessMap?y=m.clearcoatRoughnessMap:m.iridescenceMap?y=m.iridescenceMap:m.iridescenceThicknessMap?y=m.iridescenceThicknessMap:m.specularIntensityMap?y=m.specularIntensityMap:m.specularColorMap?y=m.specularColorMap:m.transmissionMap?y=m.transmissionMap:m.thicknessMap?y=m.thicknessMap:m.sheenColorMap?y=m.sheenColorMap:m.sheenRoughnessMap&&(y=m.sheenRoughnessMap),y!==void 0&&(y.isWebGLRenderTarget&&(y=y.texture),y.matrixAutoUpdate===!0&&y.updateMatrix(),g.uvTransform.value.copy(y.matrix));let x;m.aoMap?x=m.aoMap:m.lightMap&&(x=m.lightMap),x!==void 0&&(x.isWebGLRenderTarget&&(x=x.texture),x.matrixAutoUpdate===!0&&x.updateMatrix(),g.uv2Transform.value.copy(x.matrix))}function o(g,m){g.diffuse.value.copy(m.color),g.opacity.value=m.opacity}function s(g,m){g.dashSize.value=m.dashSize,g.totalSize.value=m.dashSize+m.gapSize,g.scale.value=m.scale}function a(g,m,v,y){g.diffuse.value.copy(m.color),g.opacity.value=m.opacity,g.size.value=m.size*v,g.scale.value=y*.5,m.map&&(g.map.value=m.map),m.alphaMap&&(g.alphaMap.value=m.alphaMap),m.alphaTest>0&&(g.alphaTest.value=m.alphaTest);let x;m.map?x=m.map:m.alphaMap&&(x=m.alphaMap),x!==void 0&&(x.matrixAutoUpdate===!0&&x.updateMatrix(),g.uvTransform.value.copy(x.matrix))}function l(g,m){g.diffuse.value.copy(m.color),g.opacity.value=m.opacity,g.rotation.value=m.rotation,m.map&&(g.map.value=m.map),m.alphaMap&&(g.alphaMap.value=m.alphaMap),m.alphaTest>0&&(g.alphaTest.value=m.alphaTest);let v;m.map?v=m.map:m.alphaMap&&(v=m.alphaMap),v!==void 0&&(v.matrixAutoUpdate===!0&&v.updateMatrix(),g.uvTransform.value.copy(v.matrix))}function c(g,m){g.specular.value.copy(m.specular),g.shininess.value=Math.max(m.shininess,1e-4)}function u(g,m){m.gradientMap&&(g.gradientMap.value=m.gradientMap)}function f(g,m){g.roughness.value=m.roughness,g.metalness.value=m.metalness,m.roughnessMap&&(g.roughnessMap.value=m.roughnessMap),m.metalnessMap&&(g.metalnessMap.value=m.metalnessMap),e.get(m).envMap&&(g.envMapIntensity.value=m.envMapIntensity)}function d(g,m,v){g.ior.value=m.ior,m.sheen>0&&(g.sheenColor.value.copy(m.sheenColor).multiplyScalar(m.sheen),g.sheenRoughness.value=m.sheenRoughness,m.sheenColorMap&&(g.sheenColorMap.value=m.sheenColorMap),m.sheenRoughnessMap&&(g.sheenRoughnessMap.value=m.sheenRoughnessMap)),m.clearcoat>0&&(g.clearcoat.value=m.clearcoat,g.clearcoatRoughness.value=m.clearcoatRoughness,m.clearcoatMap&&(g.clearcoatMap.value=m.clearcoatMap),m.clearcoatRoughnessMap&&(g.clearcoatRoughnessMap.value=m.clearcoatRoughnessMap),m.clearcoatNormalMap&&(g.clearcoatNormalScale.value.copy(m.clearcoatNormalScale),g.clearcoatNormalMap.value=m.clearcoatNormalMap,m.side===vc&&g.clearcoatNormalScale.value.negate())),m.iridescence>0&&(g.iridescence.value=m.iridescence,g.iridescenceIOR.value=m.iridescenceIOR,g.iridescenceThicknessMinimum.value=m.iridescenceThicknessRange[0],g.iridescenceThicknessMaximum.value=m.iridescenceThicknessRange[1],m.iridescenceMap&&(g.iridescenceMap.value=m.iridescenceMap),m.iridescenceThicknessMap&&(g.iridescenceThicknessMap.value=m.iridescenceThicknessMap)),m.transmission>0&&(g.transmission.value=m.transmission,g.transmissionSamplerMap.value=v.texture,g.transmissionSamplerSize.value.set(v.width,v.height),m.transmissionMap&&(g.transmissionMap.value=m.transmissionMap),g.thickness.value=m.thickness,m.thicknessMap&&(g.thicknessMap.value=m.thicknessMap),g.attenuationDistance.value=m.attenuationDistance,g.attenuationColor.value.copy(m.attenuationColor)),g.specularIntensity.value=m.specularIntensity,g.specularColor.value.copy(m.specularColor),m.specularIntensityMap&&(g.specularIntensityMap.value=m.specularIntensityMap),m.specularColorMap&&(g.specularColorMap.value=m.specularColorMap)}function h(g,m){m.matcap&&(g.matcap.value=m.matcap)}function p(g,m){g.referencePosition.value.copy(m.referencePosition),g.nearDistance.value=m.nearDistance,g.farDistance.value=m.farDistance}return{refreshFogUniforms:n,refreshMaterialUniforms:r}}function VVn(t,e,n,r){let i={},o={},s=[];const a=n.isWebGL2?t.getParameter(35375):0;function l(y,x){const b=x.program;r.uniformBlockBinding(y,b)}function c(y,x){let b=i[y.id];b===void 0&&(p(y),b=u(y),i[y.id]=b,y.addEventListener("dispose",m));const w=x.program;r.updateUBOMapping(y,w);const _=e.render.frame;o[y.id]!==_&&(d(y),o[y.id]=_)}function u(y){const x=f();y.__bindingPointIndex=x;const b=t.createBuffer(),w=y.__size,_=y.usage;return t.bindBuffer(35345,b),t.bufferData(35345,w,_),t.bindBuffer(35345,null),t.bindBufferBase(35345,x,b),b}function f(){for(let y=0;y0){_=b%w;const M=w-_;_!==0&&M-E.boundary<0&&(b+=w-_,k.__offset=b)}b+=E.storage}return _=b%w,_>0&&(b+=w-_),y.__size=b,y.__cache={},this}function g(y){const x=y.value,b={boundary:0,storage:0};return typeof x=="number"?(b.boundary=4,b.storage=4):x.isVector2?(b.boundary=8,b.storage=8):x.isVector3||x.isColor?(b.boundary=16,b.storage=12):x.isVector4?(b.boundary=16,b.storage=16):x.isMatrix3?(b.boundary=48,b.storage=48):x.isMatrix4?(b.boundary=64,b.storage=64):x.isTexture?console.warn("THREE.WebGLRenderer: Texture samplers can not be part of an uniforms group."):console.warn("THREE.WebGLRenderer: Unsupported uniform value type.",x),b}function m(y){const x=y.target;x.removeEventListener("dispose",m);const b=s.indexOf(x.__bindingPointIndex);s.splice(b,1),t.deleteBuffer(i[x.id]),delete i[x.id],delete o[x.id]}function v(){for(const y in i)t.deleteBuffer(i[y]);s=[],i={},o={}}return{bind:l,update:c,dispose:v}}function GVn(){const t=aM("canvas");return t.style.display="block",t}function $Xe(t={}){this.isWebGLRenderer=!0;const e=t.canvas!==void 0?t.canvas:GVn(),n=t.context!==void 0?t.context:null,r=t.depth!==void 0?t.depth:!0,i=t.stencil!==void 0?t.stencil:!0,o=t.antialias!==void 0?t.antialias:!1,s=t.premultipliedAlpha!==void 0?t.premultipliedAlpha:!0,a=t.preserveDrawingBuffer!==void 0?t.preserveDrawingBuffer:!1,l=t.powerPreference!==void 0?t.powerPreference:"default",c=t.failIfMajorPerformanceCaveat!==void 0?t.failIfMajorPerformanceCaveat:!1;let u;n!==null?u=n.getContextAttributes().alpha:u=t.alpha!==void 0?t.alpha:!1;let f=null,d=null;const h=[],p=[];this.domElement=e,this.debug={checkShaderErrors:!0},this.autoClear=!0,this.autoClearColor=!0,this.autoClearDepth=!0,this.autoClearStencil=!0,this.sortObjects=!0,this.clippingPlanes=[],this.localClippingEnabled=!1,this.outputEncoding=W1,this.physicallyCorrectLights=!1,this.toneMapping=wg,this.toneMappingExposure=1,Object.defineProperties(this,{gammaFactor:{get:function(){return console.warn("THREE.WebGLRenderer: .gammaFactor has been removed."),2},set:function(){console.warn("THREE.WebGLRenderer: .gammaFactor has been removed.")}}});const g=this;let m=!1,v=0,y=0,x=null,b=-1,w=null;const _=new vs,S=new vs;let O=null,k=e.width,E=e.height,M=1,A=null,P=null;const T=new vs(0,0,k,E),R=new vs(0,0,k,E);let I=!1;const B=new AXe;let $=!1,z=!1,L=null;const j=new Wr,N=new En,F=new Ce,H={background:null,fog:null,environment:null,overrideMaterial:null,isScene:!0};function q(){return x===null?M:1}let Y=n;function le(ce,Ae){for(let Fe=0;Fe0?d=p[p.length-1]:d=null,h.pop(),h.length>0?f=h[h.length-1]:f=null};function Ji(ce,Ae,Fe,ke){if(ce.visible===!1)return;if(ce.layers.test(Ae.layers)){if(ce.isGroup)Fe=ce.renderOrder;else if(ce.isLOD)ce.autoUpdate===!0&&ce.update(Ae);else if(ce.isLight)d.pushLight(ce),ce.castShadow&&d.pushShadow(ce);else if(ce.isSprite){if(!ce.frustumCulled||B.intersectsSprite(ce)){ke&&F.setFromMatrixPosition(ce.matrixWorld).applyMatrix4(j);const Nt=X.update(ce),an=ce.material;an.visible&&f.push(ce,Nt,an,Fe,F.z,null)}}else if((ce.isMesh||ce.isLine||ce.isPoints)&&(ce.isSkinnedMesh&&ce.skeleton.frame!==me.render.frame&&(ce.skeleton.update(),ce.skeleton.frame=me.render.frame),!ce.frustumCulled||B.intersectsObject(ce))){ke&&F.setFromMatrixPosition(ce.matrixWorld).applyMatrix4(j);const Nt=X.update(ce),an=ce.material;if(Array.isArray(an)){const tn=Nt.groups;for(let Qn=0,Bn=tn.length;Qn0&&Gt(Be,Ae,Fe),ke&&re.viewport(_.copy(ke)),Be.length>0&&fr(Be,Ae,Fe),Ct.length>0&&fr(Ct,Ae,Fe),Nt.length>0&&fr(Nt,Ae,Fe),re.buffers.depth.setTest(!0),re.buffers.depth.setMask(!0),re.buffers.color.setMask(!0),re.setPolygonOffset(!1)}function Gt(ce,Ae,Fe){const ke=ee.isWebGL2;L===null&&(L=new V1(1,1,{generateMipmaps:!0,type:K.has("EXT_color_buffer_half_float")?sM:U1,minFilter:o8,samples:ke&&o===!0?4:0})),g.getDrawingBufferSize(N),ke?L.setSize(N.x,N.y):L.setSize(zZ(N.x),zZ(N.y));const Be=g.getRenderTarget();g.setRenderTarget(L),g.clear();const Ct=g.toneMapping;g.toneMapping=wg,fr(ce,Ae,Fe),g.toneMapping=Ct,ae.updateMultisampleRenderTarget(L),ae.updateRenderTargetMipmap(L),g.setRenderTarget(Be)}function fr(ce,Ae,Fe){const ke=Ae.isScene===!0?Ae.overrideMaterial:null;for(let Be=0,Ct=ce.length;Be0&&ae.useMultisampledRTT(ce)===!1?Be=te.get(ce).__webglMultisampledFramebuffer:Be=Qn,_.copy(ce.viewport),S.copy(ce.scissor),O=ce.scissorTest}else _.copy(T).multiplyScalar(M).floor(),S.copy(R).multiplyScalar(M).floor(),O=I;if(re.bindFramebuffer(36160,Be)&&ee.drawBuffers&&ke&&re.drawBuffers(ce,Be),re.viewport(_),re.scissor(S),re.setScissorTest(O),Ct){const tn=te.get(ce.texture);Y.framebufferTexture2D(36160,36064,34069+Ae,tn.__webglTexture,Fe)}else if(Nt){const tn=te.get(ce.texture),Qn=Ae||0;Y.framebufferTextureLayer(36160,36064,tn.__webglTexture,Fe||0,Qn)}b=-1},this.readRenderTargetPixels=function(ce,Ae,Fe,ke,Be,Ct,Nt){if(!(ce&&ce.isWebGLRenderTarget)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");return}let an=te.get(ce).__webglFramebuffer;if(ce.isWebGLCubeRenderTarget&&Nt!==void 0&&(an=an[Nt]),an){re.bindFramebuffer(36160,an);try{const tn=ce.texture,Qn=tn.format,Bn=tn.type;if(Qn!==sh&&Q.convert(Qn)!==Y.getParameter(35739)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");return}const Un=Bn===sM&&(K.has("EXT_color_buffer_half_float")||ee.isWebGL2&&K.has("EXT_color_buffer_float"));if(Bn!==U1&&Q.convert(Bn)!==Y.getParameter(35738)&&!(Bn===Ev&&(ee.isWebGL2||K.has("OES_texture_float")||K.has("WEBGL_color_buffer_float")))&&!Un){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");return}Ae>=0&&Ae<=ce.width-ke&&Fe>=0&&Fe<=ce.height-Be&&Y.readPixels(Ae,Fe,ke,Be,Q.convert(Qn),Q.convert(Bn),Ct)}finally{const tn=x!==null?te.get(x).__webglFramebuffer:null;re.bindFramebuffer(36160,tn)}}},this.copyFramebufferToTexture=function(ce,Ae,Fe=0){const ke=Math.pow(2,-Fe),Be=Math.floor(Ae.image.width*ke),Ct=Math.floor(Ae.image.height*ke);ae.setTexture2D(Ae,0),Y.copyTexSubImage2D(3553,Fe,0,0,ce.x,ce.y,Be,Ct),re.unbindTexture()},this.copyTextureToTexture=function(ce,Ae,Fe,ke=0){const Be=Ae.image.width,Ct=Ae.image.height,Nt=Q.convert(Fe.format),an=Q.convert(Fe.type);ae.setTexture2D(Fe,0),Y.pixelStorei(37440,Fe.flipY),Y.pixelStorei(37441,Fe.premultiplyAlpha),Y.pixelStorei(3317,Fe.unpackAlignment),Ae.isDataTexture?Y.texSubImage2D(3553,ke,ce.x,ce.y,Be,Ct,Nt,an,Ae.image.data):Ae.isCompressedTexture?Y.compressedTexSubImage2D(3553,ke,ce.x,ce.y,Ae.mipmaps[0].width,Ae.mipmaps[0].height,Nt,Ae.mipmaps[0].data):Y.texSubImage2D(3553,ke,ce.x,ce.y,Nt,an,Ae.image),ke===0&&Fe.generateMipmaps&&Y.generateMipmap(3553),re.unbindTexture()},this.copyTextureToTexture3D=function(ce,Ae,Fe,ke,Be=0){if(g.isWebGL1Renderer){console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: can only be used with WebGL2.");return}const Ct=ce.max.x-ce.min.x+1,Nt=ce.max.y-ce.min.y+1,an=ce.max.z-ce.min.z+1,tn=Q.convert(ke.format),Qn=Q.convert(ke.type);let Bn;if(ke.isData3DTexture)ae.setTexture3D(ke,0),Bn=32879;else if(ke.isDataArrayTexture)ae.setTexture2DArray(ke,0),Bn=35866;else{console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: only supports THREE.DataTexture3D and THREE.DataTexture2DArray.");return}Y.pixelStorei(37440,ke.flipY),Y.pixelStorei(37441,ke.premultiplyAlpha),Y.pixelStorei(3317,ke.unpackAlignment);const Un=Y.getParameter(3314),Ti=Y.getParameter(32878),c0=Y.getParameter(3316),Db=Y.getParameter(3315),Ib=Y.getParameter(32877),dd=Fe.isCompressedTexture?Fe.mipmaps[0]:Fe.image;Y.pixelStorei(3314,dd.width),Y.pixelStorei(32878,dd.height),Y.pixelStorei(3316,ce.min.x),Y.pixelStorei(3315,ce.min.y),Y.pixelStorei(32877,ce.min.z),Fe.isDataTexture||Fe.isData3DTexture?Y.texSubImage3D(Bn,Be,Ae.x,Ae.y,Ae.z,Ct,Nt,an,tn,Qn,dd.data):Fe.isCompressedTexture?(console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: untested support for compressed srcTexture."),Y.compressedTexSubImage3D(Bn,Be,Ae.x,Ae.y,Ae.z,Ct,Nt,an,tn,dd.data)):Y.texSubImage3D(Bn,Be,Ae.x,Ae.y,Ae.z,Ct,Nt,an,tn,Qn,dd),Y.pixelStorei(3314,Un),Y.pixelStorei(32878,Ti),Y.pixelStorei(3316,c0),Y.pixelStorei(3315,Db),Y.pixelStorei(32877,Ib),Be===0&&ke.generateMipmaps&&Y.generateMipmap(Bn),re.unbindTexture()},this.initTexture=function(ce){ce.isCubeTexture?ae.setTextureCube(ce,0):ce.isData3DTexture?ae.setTexture3D(ce,0):ce.isDataArrayTexture?ae.setTexture2DArray(ce,0):ae.setTexture2D(ce,0),re.unbindTexture()},this.resetState=function(){v=0,y=0,x=null,re.reset(),_e.reset()},typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}class HVn extends $Xe{}HVn.prototype.isWebGL1Renderer=!0;class qVn extends bl{constructor(){super(),this.isScene=!0,this.type="Scene",this.background=null,this.environment=null,this.fog=null,this.overrideMaterial=null,typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}copy(e,n){return super.copy(e,n),e.background!==null&&(this.background=e.background.clone()),e.environment!==null&&(this.environment=e.environment.clone()),e.fog!==null&&(this.fog=e.fog.clone()),e.overrideMaterial!==null&&(this.overrideMaterial=e.overrideMaterial.clone()),this.matrixAutoUpdate=e.matrixAutoUpdate,this}toJSON(e){const n=super.toJSON(e);return this.fog!==null&&(n.object.fog=this.fog.toJSON()),n}get autoUpdate(){return console.warn("THREE.Scene: autoUpdate was renamed to matrixWorldAutoUpdate in r144."),this.matrixWorldAutoUpdate}set autoUpdate(e){console.warn("THREE.Scene: autoUpdate was renamed to matrixWorldAutoUpdate in r144."),this.matrixWorldAutoUpdate=e}}class FXe extends OD{constructor(e){super(),this.isLineBasicMaterial=!0,this.type="LineBasicMaterial",this.color=new ci(16777215),this.linewidth=1,this.linecap="round",this.linejoin="round",this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.linewidth=e.linewidth,this.linecap=e.linecap,this.linejoin=e.linejoin,this.fog=e.fog,this}}const sEe=new Ce,aEe=new Ce,lEe=new Wr,xG=new _Xe,D$=new s8;class XVn extends bl{constructor(e=new sm,n=new FXe){super(),this.isLine=!0,this.type="Line",this.geometry=e,this.material=n,this.updateMorphTargets()}copy(e,n){return super.copy(e,n),this.material=e.material,this.geometry=e.geometry,this}computeLineDistances(){const e=this.geometry;if(e.index===null){const n=e.attributes.position,r=[0];for(let i=1,o=n.count;il)continue;d.applyMatrix4(this.matrixWorld);const O=e.ray.origin.distanceTo(d);Oe.far||n.push({distance:O,point:f.clone().applyMatrix4(this.matrixWorld),index:x,face:null,faceIndex:null,object:this})}}else{const v=Math.max(0,s.start),y=Math.min(m.count,s.start+s.count);for(let x=v,b=y-1;xl)continue;d.applyMatrix4(this.matrixWorld);const _=e.ray.origin.distanceTo(d);_e.far||n.push({distance:_,point:f.clone().applyMatrix4(this.matrixWorld),index:x,face:null,faceIndex:null,object:this})}}}updateMorphTargets(){const n=this.geometry.morphAttributes,r=Object.keys(n);if(r.length>0){const i=n[r[0]];if(i!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let o=0,s=i.length;o{n&&n(o),this.manager.itemEnd(e)},0),o;if(bp[e]!==void 0){bp[e].push({onLoad:n,onProgress:r,onError:i});return}bp[e]=[],bp[e].push({onLoad:n,onProgress:r,onError:i});const s=new Request(e,{headers:new Headers(this.requestHeader),credentials:this.withCredentials?"include":"same-origin"}),a=this.mimeType,l=this.responseType;fetch(s).then(c=>{if(c.status===200||c.status===0){if(c.status===0&&console.warn("THREE.FileLoader: HTTP Status 0 received."),typeof ReadableStream>"u"||c.body===void 0||c.body.getReader===void 0)return c;const u=bp[e],f=c.body.getReader(),d=c.headers.get("Content-Length"),h=d?parseInt(d):0,p=h!==0;let g=0;const m=new ReadableStream({start(v){y();function y(){f.read().then(({done:x,value:b})=>{if(x)v.close();else{g+=b.byteLength;const w=new ProgressEvent("progress",{lengthComputable:p,loaded:g,total:h});for(let _=0,S=u.length;_{switch(l){case"arraybuffer":return c.arrayBuffer();case"blob":return c.blob();case"document":return c.text().then(u=>new DOMParser().parseFromString(u,a));case"json":return c.json();default:if(a===void 0)return c.text();{const f=/charset="?([^;"\s]*)"?/i.exec(a),d=f&&f[1]?f[1].toLowerCase():void 0,h=new TextDecoder(d);return c.arrayBuffer().then(p=>h.decode(p))}}}).then(c=>{lj.add(e,c);const u=bp[e];delete bp[e];for(let f=0,d=u.length;f{const u=bp[e];if(u===void 0)throw this.manager.itemError(e),c;delete bp[e];for(let f=0,d=u.length;f{this.manager.itemEnd(e)}),this.manager.itemStart(e)}setResponseType(e){return this.responseType=e,this}setMimeType(e){return this.mimeType=e,this}}class e9n extends c8{constructor(e){super(e)}load(e,n,r,i){this.path!==void 0&&(e=this.path+e),e=this.manager.resolveURL(e);const o=this,s=lj.get(e);if(s!==void 0)return o.manager.itemStart(e),setTimeout(function(){n&&n(s),o.manager.itemEnd(e)},0),s;const a=aM("img");function l(){u(),lj.add(e,this),n&&n(this),o.manager.itemEnd(e)}function c(f){u(),i&&i(f),o.manager.itemError(e),o.manager.itemEnd(e)}function u(){a.removeEventListener("load",l,!1),a.removeEventListener("error",c,!1)}return a.addEventListener("load",l,!1),a.addEventListener("error",c,!1),e.slice(0,5)!=="data:"&&this.crossOrigin!==void 0&&(a.crossOrigin=this.crossOrigin),o.manager.itemStart(e),a.src=e,a}}class t9n extends c8{constructor(e){super(e)}load(e,n,r,i){const o=new Ac,s=new e9n(this.manager);return s.setCrossOrigin(this.crossOrigin),s.setPath(this.path),s.load(e,function(a){o.image=a,o.needsUpdate=!0,n!==void 0&&n(o)},r,i),o}}class fEe{constructor(e=1,n=0,r=0){return this.radius=e,this.phi=n,this.theta=r,this}set(e,n,r){return this.radius=e,this.phi=n,this.theta=r,this}copy(e){return this.radius=e.radius,this.phi=e.phi,this.theta=e.theta,this}makeSafe(){return this.phi=Math.max(1e-6,Math.min(Math.PI-1e-6,this.phi)),this}setFromVector3(e){return this.setFromCartesianCoords(e.x,e.y,e.z)}setFromCartesianCoords(e,n,r){return this.radius=Math.sqrt(e*e+n*n+r*r),this.radius===0?(this.theta=0,this.phi=0):(this.theta=Math.atan2(e,r),this.phi=Math.acos(rl(n/this.radius,-1,1))),this}clone(){return new this.constructor().copy(this)}}const I$=new pE;class n9n extends YVn{constructor(e,n=16776960){const r=new Uint16Array([0,1,1,2,2,3,3,0,4,5,5,6,6,7,7,4,0,4,1,5,2,6,3,7]),i=new Float32Array(8*3),o=new sm;o.setIndex(new xu(r,1)),o.setAttribute("position",new xu(i,3)),super(o,new FXe({color:n,toneMapped:!1})),this.object=e,this.type="BoxHelper",this.matrixAutoUpdate=!1,this.update()}update(e){if(e!==void 0&&console.warn("THREE.BoxHelper: .update() has no longer arguments."),this.object!==void 0&&I$.setFromObject(this.object),I$.isEmpty())return;const n=I$.min,r=I$.max,i=this.geometry.attributes.position,o=i.array;o[0]=r.x,o[1]=r.y,o[2]=r.z,o[3]=n.x,o[4]=r.y,o[5]=r.z,o[6]=n.x,o[7]=n.y,o[8]=r.z,o[9]=r.x,o[10]=n.y,o[11]=r.z,o[12]=r.x,o[13]=r.y,o[14]=n.z,o[15]=n.x,o[16]=r.y,o[17]=n.z,o[18]=n.x,o[19]=n.y,o[20]=n.z,o[21]=r.x,o[22]=n.y,o[23]=n.z,i.needsUpdate=!0,this.geometry.computeBoundingSphere()}setFromObject(e){return this.object=e,this.update(),this}copy(e,n){return super.copy(e,n),this.object=e.object,this}}typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("register",{detail:{revision:Lce}}));typeof window<"u"&&(window.__THREE__?console.warn("WARNING: Multiple instances of Three.js being imported."):window.__THREE__=Lce);const dEe={type:"change"},bG={type:"start"},hEe={type:"end"};class r9n extends Mb{constructor(e,n){super(),this.object=e,this.domElement=n,this.domElement.style.touchAction="none",this.enabled=!0,this.target=new Ce,this.minDistance=0,this.maxDistance=1/0,this.minZoom=0,this.maxZoom=1/0,this.minPolarAngle=0,this.maxPolarAngle=Math.PI,this.minAzimuthAngle=-1/0,this.maxAzimuthAngle=1/0,this.enableDamping=!1,this.dampingFactor=.05,this.enableZoom=!0,this.zoomSpeed=1,this.enableRotate=!0,this.rotateSpeed=1,this.enablePan=!0,this.panSpeed=1,this.screenSpacePanning=!0,this.keyPanSpeed=7,this.autoRotate=!1,this.autoRotateSpeed=2,this.keys={LEFT:"ArrowLeft",UP:"ArrowUp",RIGHT:"ArrowRight",BOTTOM:"ArrowDown"},this.mouseButtons={LEFT:hw.ROTATE,MIDDLE:hw.DOLLY,RIGHT:hw.PAN},this.touches={ONE:pw.ROTATE,TWO:pw.DOLLY_PAN},this.target0=this.target.clone(),this.position0=this.object.position.clone(),this.zoom0=this.object.zoom,this._domElementKeyEvents=null,this.getPolarAngle=function(){return a.phi},this.getAzimuthalAngle=function(){return a.theta},this.getDistance=function(){return this.object.position.distanceTo(this.target)},this.listenToKeyEvents=function(Q){Q.addEventListener("keydown",xe),this._domElementKeyEvents=Q},this.saveState=function(){r.target0.copy(r.target),r.position0.copy(r.object.position),r.zoom0=r.object.zoom},this.reset=function(){r.target.copy(r.target0),r.object.position.copy(r.position0),r.object.zoom=r.zoom0,r.object.updateProjectionMatrix(),r.dispatchEvent(dEe),r.update(),o=i.NONE},this.update=function(){const Q=new Ce,_e=new G1().setFromUnitVectors(e.up,new Ce(0,1,0)),we=_e.clone().invert(),Ie=new Ce,Pe=new G1,Me=2*Math.PI;return function(){const Le=r.object.position;Q.copy(Le).sub(r.target),Q.applyQuaternion(_e),a.setFromVector3(Q),r.autoRotate&&o===i.NONE&&k(S()),r.enableDamping?(a.theta+=l.theta*r.dampingFactor,a.phi+=l.phi*r.dampingFactor):(a.theta+=l.theta,a.phi+=l.phi);let ue=r.minAzimuthAngle,$e=r.maxAzimuthAngle;return isFinite(ue)&&isFinite($e)&&(ue<-Math.PI?ue+=Me:ue>Math.PI&&(ue-=Me),$e<-Math.PI?$e+=Me:$e>Math.PI&&($e-=Me),ue<=$e?a.theta=Math.max(ue,Math.min($e,a.theta)):a.theta=a.theta>(ue+$e)/2?Math.max(ue,a.theta):Math.min($e,a.theta)),a.phi=Math.max(r.minPolarAngle,Math.min(r.maxPolarAngle,a.phi)),a.makeSafe(),a.radius*=c,a.radius=Math.max(r.minDistance,Math.min(r.maxDistance,a.radius)),r.enableDamping===!0?r.target.addScaledVector(u,r.dampingFactor):r.target.add(u),Q.setFromSpherical(a),Q.applyQuaternion(we),Le.copy(r.target).add(Q),r.object.lookAt(r.target),r.enableDamping===!0?(l.theta*=1-r.dampingFactor,l.phi*=1-r.dampingFactor,u.multiplyScalar(1-r.dampingFactor)):(l.set(0,0,0),u.set(0,0,0)),c=1,f||Ie.distanceToSquared(r.object.position)>s||8*(1-Pe.dot(r.object.quaternion))>s?(r.dispatchEvent(dEe),Ie.copy(r.object.position),Pe.copy(r.object.quaternion),f=!1,!0):!1}}(),this.dispose=function(){r.domElement.removeEventListener("contextmenu",J),r.domElement.removeEventListener("pointerdown",U),r.domElement.removeEventListener("pointercancel",V),r.domElement.removeEventListener("wheel",he),r.domElement.removeEventListener("pointermove",oe),r.domElement.removeEventListener("pointerup",ne),r._domElementKeyEvents!==null&&r._domElementKeyEvents.removeEventListener("keydown",xe)};const r=this,i={NONE:-1,ROTATE:0,DOLLY:1,PAN:2,TOUCH_ROTATE:3,TOUCH_PAN:4,TOUCH_DOLLY_PAN:5,TOUCH_DOLLY_ROTATE:6};let o=i.NONE;const s=1e-6,a=new fEe,l=new fEe;let c=1;const u=new Ce;let f=!1;const d=new En,h=new En,p=new En,g=new En,m=new En,v=new En,y=new En,x=new En,b=new En,w=[],_={};function S(){return 2*Math.PI/60/60*r.autoRotateSpeed}function O(){return Math.pow(.95,r.zoomSpeed)}function k(Q){l.theta-=Q}function E(Q){l.phi-=Q}const M=function(){const Q=new Ce;return function(we,Ie){Q.setFromMatrixColumn(Ie,0),Q.multiplyScalar(-we),u.add(Q)}}(),A=function(){const Q=new Ce;return function(we,Ie){r.screenSpacePanning===!0?Q.setFromMatrixColumn(Ie,1):(Q.setFromMatrixColumn(Ie,0),Q.crossVectors(r.object.up,Q)),Q.multiplyScalar(we),u.add(Q)}}(),P=function(){const Q=new Ce;return function(we,Ie){const Pe=r.domElement;if(r.object.isPerspectiveCamera){const Me=r.object.position;Q.copy(Me).sub(r.target);let Te=Q.length();Te*=Math.tan(r.object.fov/2*Math.PI/180),M(2*we*Te/Pe.clientHeight,r.object.matrix),A(2*Ie*Te/Pe.clientHeight,r.object.matrix)}else r.object.isOrthographicCamera?(M(we*(r.object.right-r.object.left)/r.object.zoom/Pe.clientWidth,r.object.matrix),A(Ie*(r.object.top-r.object.bottom)/r.object.zoom/Pe.clientHeight,r.object.matrix)):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - pan disabled."),r.enablePan=!1)}}();function T(Q){r.object.isPerspectiveCamera?c/=Q:r.object.isOrthographicCamera?(r.object.zoom=Math.max(r.minZoom,Math.min(r.maxZoom,r.object.zoom*Q)),r.object.updateProjectionMatrix(),f=!0):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),r.enableZoom=!1)}function R(Q){r.object.isPerspectiveCamera?c*=Q:r.object.isOrthographicCamera?(r.object.zoom=Math.max(r.minZoom,Math.min(r.maxZoom,r.object.zoom/Q)),r.object.updateProjectionMatrix(),f=!0):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),r.enableZoom=!1)}function I(Q){d.set(Q.clientX,Q.clientY)}function B(Q){y.set(Q.clientX,Q.clientY)}function $(Q){g.set(Q.clientX,Q.clientY)}function z(Q){h.set(Q.clientX,Q.clientY),p.subVectors(h,d).multiplyScalar(r.rotateSpeed);const _e=r.domElement;k(2*Math.PI*p.x/_e.clientHeight),E(2*Math.PI*p.y/_e.clientHeight),d.copy(h),r.update()}function L(Q){x.set(Q.clientX,Q.clientY),b.subVectors(x,y),b.y>0?T(O()):b.y<0&&R(O()),y.copy(x),r.update()}function j(Q){m.set(Q.clientX,Q.clientY),v.subVectors(m,g).multiplyScalar(r.panSpeed),P(v.x,v.y),g.copy(m),r.update()}function N(Q){Q.deltaY<0?R(O()):Q.deltaY>0&&T(O()),r.update()}function F(Q){let _e=!1;switch(Q.code){case r.keys.UP:P(0,r.keyPanSpeed),_e=!0;break;case r.keys.BOTTOM:P(0,-r.keyPanSpeed),_e=!0;break;case r.keys.LEFT:P(r.keyPanSpeed,0),_e=!0;break;case r.keys.RIGHT:P(-r.keyPanSpeed,0),_e=!0;break}_e&&(Q.preventDefault(),r.update())}function H(){if(w.length===1)d.set(w[0].pageX,w[0].pageY);else{const Q=.5*(w[0].pageX+w[1].pageX),_e=.5*(w[0].pageY+w[1].pageY);d.set(Q,_e)}}function q(){if(w.length===1)g.set(w[0].pageX,w[0].pageY);else{const Q=.5*(w[0].pageX+w[1].pageX),_e=.5*(w[0].pageY+w[1].pageY);g.set(Q,_e)}}function Y(){const Q=w[0].pageX-w[1].pageX,_e=w[0].pageY-w[1].pageY,we=Math.sqrt(Q*Q+_e*_e);y.set(0,we)}function le(){r.enableZoom&&Y(),r.enablePan&&q()}function K(){r.enableZoom&&Y(),r.enableRotate&&H()}function ee(Q){if(w.length===1)h.set(Q.pageX,Q.pageY);else{const we=fe(Q),Ie=.5*(Q.pageX+we.x),Pe=.5*(Q.pageY+we.y);h.set(Ie,Pe)}p.subVectors(h,d).multiplyScalar(r.rotateSpeed);const _e=r.domElement;k(2*Math.PI*p.x/_e.clientHeight),E(2*Math.PI*p.y/_e.clientHeight),d.copy(h)}function re(Q){if(w.length===1)m.set(Q.pageX,Q.pageY);else{const _e=fe(Q),we=.5*(Q.pageX+_e.x),Ie=.5*(Q.pageY+_e.y);m.set(we,Ie)}v.subVectors(m,g).multiplyScalar(r.panSpeed),P(v.x,v.y),g.copy(m)}function me(Q){const _e=fe(Q),we=Q.pageX-_e.x,Ie=Q.pageY-_e.y,Pe=Math.sqrt(we*we+Ie*Ie);x.set(0,Pe),b.set(0,Math.pow(x.y/y.y,r.zoomSpeed)),T(b.y),y.copy(x)}function te(Q){r.enableZoom&&me(Q),r.enablePan&&re(Q)}function ae(Q){r.enableZoom&&me(Q),r.enableRotate&&ee(Q)}function U(Q){r.enabled!==!1&&(w.length===0&&(r.domElement.setPointerCapture(Q.pointerId),r.domElement.addEventListener("pointermove",oe),r.domElement.addEventListener("pointerup",ne)),se(Q),Q.pointerType==="touch"?G(Q):X(Q))}function oe(Q){r.enabled!==!1&&(Q.pointerType==="touch"?W(Q):Z(Q))}function ne(Q){ye(Q),w.length===0&&(r.domElement.releasePointerCapture(Q.pointerId),r.domElement.removeEventListener("pointermove",oe),r.domElement.removeEventListener("pointerup",ne)),r.dispatchEvent(hEe),o=i.NONE}function V(Q){ye(Q)}function X(Q){let _e;switch(Q.button){case 0:_e=r.mouseButtons.LEFT;break;case 1:_e=r.mouseButtons.MIDDLE;break;case 2:_e=r.mouseButtons.RIGHT;break;default:_e=-1}switch(_e){case hw.DOLLY:if(r.enableZoom===!1)return;B(Q),o=i.DOLLY;break;case hw.ROTATE:if(Q.ctrlKey||Q.metaKey||Q.shiftKey){if(r.enablePan===!1)return;$(Q),o=i.PAN}else{if(r.enableRotate===!1)return;I(Q),o=i.ROTATE}break;case hw.PAN:if(Q.ctrlKey||Q.metaKey||Q.shiftKey){if(r.enableRotate===!1)return;I(Q),o=i.ROTATE}else{if(r.enablePan===!1)return;$(Q),o=i.PAN}break;default:o=i.NONE}o!==i.NONE&&r.dispatchEvent(bG)}function Z(Q){switch(o){case i.ROTATE:if(r.enableRotate===!1)return;z(Q);break;case i.DOLLY:if(r.enableZoom===!1)return;L(Q);break;case i.PAN:if(r.enablePan===!1)return;j(Q);break}}function he(Q){r.enabled===!1||r.enableZoom===!1||o!==i.NONE||(Q.preventDefault(),r.dispatchEvent(bG),N(Q),r.dispatchEvent(hEe))}function xe(Q){r.enabled===!1||r.enablePan===!1||F(Q)}function G(Q){switch(ie(Q),w.length){case 1:switch(r.touches.ONE){case pw.ROTATE:if(r.enableRotate===!1)return;H(),o=i.TOUCH_ROTATE;break;case pw.PAN:if(r.enablePan===!1)return;q(),o=i.TOUCH_PAN;break;default:o=i.NONE}break;case 2:switch(r.touches.TWO){case pw.DOLLY_PAN:if(r.enableZoom===!1&&r.enablePan===!1)return;le(),o=i.TOUCH_DOLLY_PAN;break;case pw.DOLLY_ROTATE:if(r.enableZoom===!1&&r.enableRotate===!1)return;K(),o=i.TOUCH_DOLLY_ROTATE;break;default:o=i.NONE}break;default:o=i.NONE}o!==i.NONE&&r.dispatchEvent(bG)}function W(Q){switch(ie(Q),o){case i.TOUCH_ROTATE:if(r.enableRotate===!1)return;ee(Q),r.update();break;case i.TOUCH_PAN:if(r.enablePan===!1)return;re(Q),r.update();break;case i.TOUCH_DOLLY_PAN:if(r.enableZoom===!1&&r.enablePan===!1)return;te(Q),r.update();break;case i.TOUCH_DOLLY_ROTATE:if(r.enableZoom===!1&&r.enableRotate===!1)return;ae(Q),r.update();break;default:o=i.NONE}}function J(Q){r.enabled!==!1&&Q.preventDefault()}function se(Q){w.push(Q)}function ye(Q){delete _[Q.pointerId];for(let _e=0;_eu||i.y>u)&&(i.x>u&&(o.x=Math.floor(u/M.x),i.x=o.x*M.x,T.mapSize.x=o.x),i.y>u&&(o.y=Math.floor(u/M.y),i.y=o.y*M.y,T.mapSize.y=o.y)),T.map===null){const j=this.type!==$T?{minFilter:Ja,magFilter:Ja}:{};T.map=new Vb(i.x,i.y,j),T.map.texture.name=R.name+".shadowMap",T.camera.updateProjectionMatrix()}t.setRenderTarget(T.map),t.clear();const I=T.getViewportCount();for(let j=0;j0){const A=E.uuid,R=w.uuid;let T=c[A];T===void 0&&(T={},c[A]=T);let M=T[R];M===void 0&&(M=E.clone(),T[R]=M),E=M}return E.visible=w.visible,E.wireframe=w.wireframe,k===$T?E.side=w.shadowSide!==null?w.shadowSide:w.side:E.side=w.shadowSide!==null?w.shadowSide:f[w.side],E.alphaMap=w.alphaMap,E.alphaTest=w.alphaTest,E.clipShadows=w.clipShadows,E.clippingPlanes=w.clippingPlanes,E.clipIntersection=w.clipIntersection,E.displacementMap=w.displacementMap,E.displacementScale=w.displacementScale,E.displacementBias=w.displacementBias,E.wireframeLinewidth=w.wireframeLinewidth,E.linewidth=w.linewidth,_.isPointLight===!0&&E.isMeshDistanceMaterial===!0&&(E.referencePosition.setFromMatrixPosition(_.matrixWorld),E.nearDistance=S,E.farDistance=O),E}function x(b,w,_,S,O){if(b.visible===!1)return;if(b.layers.test(w.layers)&&(b.isMesh||b.isLine||b.isPoints)&&(b.castShadow||b.receiveShadow&&O===$T)&&(!b.frustumCulled||r.intersectsObject(b))){b.modelViewMatrix.multiplyMatrices(_.matrixWorldInverse,b.matrixWorld);const P=e.update(b),A=b.material;if(Array.isArray(A)){const R=P.groups;for(let T=0,M=R.length;T=1):N.indexOf("OpenGL ES")!==-1&&(j=parseFloat(/^OpenGL ES (\d)/.exec(N)[1]),I=j>=2);let z=null,L={};const B=t.getParameter(3088),F=t.getParameter(2978),$=new vs().fromArray(B),q=new vs().fromArray(F);function G(ue,$e,Se){const Xe=new Uint8Array(4),tt=t.createTexture();t.bindTexture(ue,tt),t.texParameteri(ue,10241,9728),t.texParameteri(ue,10240,9728);for(let ut=0;utse||H.height>se)&&(ye=se/Math.max(H.width,H.height)),ye<1||W===!0)if(typeof HTMLImageElement<"u"&&H instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&H instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&H instanceof ImageBitmap){const ie=W?tJ:Math.floor,fe=ie(ye*H.width),Q=ie(ye*H.height);g===void 0&&(g=y(fe,Q));const _e=J?y(fe,Q):g;return _e.width=fe,_e.height=Q,_e.getContext("2d").drawImage(H,0,0,fe,Q),console.warn("THREE.WebGLRenderer: Texture has been resized from ("+H.width+"x"+H.height+") to ("+fe+"x"+Q+")."),_e}else return"data"in H&&console.warn("THREE.WebGLRenderer: Image in DataTexture is too big ("+H.width+"x"+H.height+")."),H;return H}function b(H){return JOe(H.width)&&JOe(H.height)}function w(H){return a?!1:H.wrapS!==eu||H.wrapT!==eu||H.minFilter!==Ja&&H.minFilter!==el}function _(H,W){return H.generateMipmaps&&W&&H.minFilter!==Ja&&H.minFilter!==el}function S(H){t.generateMipmap(H)}function O(H,W,J,se,ye=!1){if(a===!1)return W;if(H!==null){if(t[H]!==void 0)return t[H];console.warn("THREE.WebGLRenderer: Attempt to use non-existing WebGL internal format '"+H+"'")}let ie=W;return W===6403&&(J===5126&&(ie=33326),J===5131&&(ie=33325),J===5121&&(ie=33321)),W===33319&&(J===5126&&(ie=33328),J===5131&&(ie=33327),J===5121&&(ie=33323)),W===6408&&(J===5126&&(ie=34836),J===5131&&(ie=34842),J===5121&&(ie=se===Mi&&ye===!1?35907:32856),J===32819&&(ie=32854),J===32820&&(ie=32855)),(ie===33325||ie===33326||ie===33327||ie===33328||ie===34842||ie===34836)&&e.get("EXT_color_buffer_float"),ie}function k(H,W,J){return _(H,J)===!0||H.isFramebufferTexture&&H.minFilter!==Ja&&H.minFilter!==el?Math.log2(Math.max(W.width,W.height))+1:H.mipmaps!==void 0&&H.mipmaps.length>0?H.mipmaps.length:H.isCompressedTexture&&Array.isArray(H.image)?W.mipmaps.length:1}function E(H){return H===Ja||H===TOe||H===kOe?9728:9729}function P(H){const W=H.target;W.removeEventListener("dispose",P),R(W),W.isVideoTexture&&p.delete(W)}function A(H){const W=H.target;W.removeEventListener("dispose",A),M(W)}function R(H){const W=r.get(H);if(W.__webglInit===void 0)return;const J=H.source,se=m.get(J);if(se){const ye=se[W.__cacheKey];ye.usedTimes--,ye.usedTimes===0&&T(H),Object.keys(se).length===0&&m.delete(J)}r.remove(H)}function T(H){const W=r.get(H);t.deleteTexture(W.__webglTexture);const J=H.source,se=m.get(J);delete se[W.__cacheKey],s.memory.textures--}function M(H){const W=H.texture,J=r.get(H),se=r.get(W);if(se.__webglTexture!==void 0&&(t.deleteTexture(se.__webglTexture),s.memory.textures--),H.depthTexture&&H.depthTexture.dispose(),H.isWebGLCubeRenderTarget)for(let ye=0;ye<6;ye++)t.deleteFramebuffer(J.__webglFramebuffer[ye]),J.__webglDepthbuffer&&t.deleteRenderbuffer(J.__webglDepthbuffer[ye]);else{if(t.deleteFramebuffer(J.__webglFramebuffer),J.__webglDepthbuffer&&t.deleteRenderbuffer(J.__webglDepthbuffer),J.__webglMultisampledFramebuffer&&t.deleteFramebuffer(J.__webglMultisampledFramebuffer),J.__webglColorRenderbuffer)for(let ye=0;ye=l&&console.warn("THREE.WebGLTextures: Trying to use "+H+" texture units while this GPU supports only "+l),I+=1,H}function z(H){const W=[];return W.push(H.wrapS),W.push(H.wrapT),W.push(H.magFilter),W.push(H.minFilter),W.push(H.anisotropy),W.push(H.internalFormat),W.push(H.format),W.push(H.type),W.push(H.generateMipmaps),W.push(H.premultiplyAlpha),W.push(H.flipY),W.push(H.unpackAlignment),W.push(H.encoding),W.join()}function L(H,W){const J=r.get(H);if(H.isVideoTexture&&he(H),H.isRenderTargetTexture===!1&&H.version>0&&J.__version!==H.version){const se=H.image;if(se===null)console.warn("THREE.WebGLRenderer: Texture marked for update but no image data found.");else if(se.complete===!1)console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete");else{K(J,H,W);return}}n.activeTexture(33984+W),n.bindTexture(3553,J.__webglTexture)}function B(H,W){const J=r.get(H);if(H.version>0&&J.__version!==H.version){K(J,H,W);return}n.activeTexture(33984+W),n.bindTexture(35866,J.__webglTexture)}function F(H,W){const J=r.get(H);if(H.version>0&&J.__version!==H.version){K(J,H,W);return}n.activeTexture(33984+W),n.bindTexture(32879,J.__webglTexture)}function $(H,W){const J=r.get(H);if(H.version>0&&J.__version!==H.version){ee(J,H,W);return}n.activeTexture(33984+W),n.bindTexture(34067,J.__webglTexture)}const q={[ZZ]:10497,[eu]:33071,[JZ]:33648},G={[Ja]:9728,[TOe]:9984,[kOe]:9986,[el]:9729,[OBn]:9985,[o8]:9987};function Y(H,W,J){if(J?(t.texParameteri(H,10242,q[W.wrapS]),t.texParameteri(H,10243,q[W.wrapT]),(H===32879||H===35866)&&t.texParameteri(H,32882,q[W.wrapR]),t.texParameteri(H,10240,G[W.magFilter]),t.texParameteri(H,10241,G[W.minFilter])):(t.texParameteri(H,10242,33071),t.texParameteri(H,10243,33071),(H===32879||H===35866)&&t.texParameteri(H,32882,33071),(W.wrapS!==eu||W.wrapT!==eu)&&console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.wrapS and Texture.wrapT should be set to THREE.ClampToEdgeWrapping."),t.texParameteri(H,10240,E(W.magFilter)),t.texParameteri(H,10241,E(W.minFilter)),W.minFilter!==Ja&&W.minFilter!==el&&console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.minFilter should be set to THREE.NearestFilter or THREE.LinearFilter.")),e.has("EXT_texture_filter_anisotropic")===!0){const se=e.get("EXT_texture_filter_anisotropic");if(W.type===Ov&&e.has("OES_texture_float_linear")===!1||a===!1&&W.type===sM&&e.has("OES_texture_half_float_linear")===!1)return;(W.anisotropy>1||r.get(W).__currentAnisotropy)&&(t.texParameterf(H,se.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(W.anisotropy,i.getMaxAnisotropy())),r.get(W).__currentAnisotropy=W.anisotropy)}}function le(H,W){let J=!1;H.__webglInit===void 0&&(H.__webglInit=!0,W.addEventListener("dispose",P));const se=W.source;let ye=m.get(se);ye===void 0&&(ye={},m.set(se,ye));const ie=z(W);if(ie!==H.__cacheKey){ye[ie]===void 0&&(ye[ie]={texture:t.createTexture(),usedTimes:0},s.memory.textures++,J=!0),ye[ie].usedTimes++;const fe=ye[H.__cacheKey];fe!==void 0&&(ye[H.__cacheKey].usedTimes--,fe.usedTimes===0&&T(W)),H.__cacheKey=ie,H.__webglTexture=ye[ie].texture}return J}function K(H,W,J){let se=3553;W.isDataArrayTexture&&(se=35866),W.isData3DTexture&&(se=32879);const ye=le(H,W),ie=W.source;if(n.activeTexture(33984+J),n.bindTexture(se,H.__webglTexture),ie.version!==ie.__currentVersion||ye===!0){t.pixelStorei(37440,W.flipY),t.pixelStorei(37441,W.premultiplyAlpha),t.pixelStorei(3317,W.unpackAlignment),t.pixelStorei(37443,0);const fe=w(W)&&b(W.image)===!1;let Q=x(W.image,fe,!1,u);Q=xe(W,Q);const _e=b(Q)||a,we=o.convert(W.format,W.encoding);let Ie=o.convert(W.type),Pe=O(W.internalFormat,we,Ie,W.encoding,W.isVideoTexture);Y(se,W,_e);let Me;const Te=W.mipmaps,Le=a&&W.isVideoTexture!==!0,ue=ie.__currentVersion===void 0||ye===!0,$e=k(W,Q,_e);if(W.isDepthTexture)Pe=6402,a?W.type===Ov?Pe=36012:W.type===_x?Pe=33190:W.type===sS?Pe=35056:Pe=33189:W.type===Ov&&console.error("WebGLRenderer: Floating point depth texture requires WebGL2."),W.format===Xx&&Pe===6402&&W.type!==BXe&&W.type!==_x&&(console.warn("THREE.WebGLRenderer: Use UnsignedShortType or UnsignedIntType for DepthFormat DepthTexture."),W.type=_x,Ie=o.convert(W.type)),W.format===BC&&Pe===6402&&(Pe=34041,W.type!==sS&&(console.warn("THREE.WebGLRenderer: Use UnsignedInt248Type for DepthStencilFormat DepthTexture."),W.type=sS,Ie=o.convert(W.type))),ue&&(Le?n.texStorage2D(3553,1,Pe,Q.width,Q.height):n.texImage2D(3553,0,Pe,Q.width,Q.height,0,we,Ie,null));else if(W.isDataTexture)if(Te.length>0&&_e){Le&&ue&&n.texStorage2D(3553,$e,Pe,Te[0].width,Te[0].height);for(let Se=0,Xe=Te.length;Se>=1,Xe>>=1}}else if(Te.length>0&&_e){Le&&ue&&n.texStorage2D(3553,$e,Pe,Te[0].width,Te[0].height);for(let Se=0,Xe=Te.length;Se0&&ue++,n.texStorage2D(34067,ue,Me,Q[0].width,Q[0].height));for(let Se=0;Se<6;Se++)if(fe){Te?n.texSubImage2D(34069+Se,0,0,0,Q[Se].width,Q[Se].height,Ie,Pe,Q[Se].data):n.texImage2D(34069+Se,0,Me,Q[Se].width,Q[Se].height,0,Ie,Pe,Q[Se].data);for(let Xe=0;Xe<$e.length;Xe++){const ut=$e[Xe].image[Se].image;Te?n.texSubImage2D(34069+Se,Xe+1,0,0,ut.width,ut.height,Ie,Pe,ut.data):n.texImage2D(34069+Se,Xe+1,Me,ut.width,ut.height,0,Ie,Pe,ut.data)}}else{Te?n.texSubImage2D(34069+Se,0,0,0,Ie,Pe,Q[Se]):n.texImage2D(34069+Se,0,Me,Ie,Pe,Q[Se]);for(let Xe=0;Xe<$e.length;Xe++){const tt=$e[Xe];Te?n.texSubImage2D(34069+Se,Xe+1,0,0,Ie,Pe,tt.image[Se]):n.texImage2D(34069+Se,Xe+1,Me,Ie,Pe,tt.image[Se])}}}_(W,we)&&S(34067),ye.__currentVersion=ye.version,W.onUpdate&&W.onUpdate(W)}H.__version=W.version}function re(H,W,J,se,ye){const ie=o.convert(J.format,J.encoding),fe=o.convert(J.type),Q=O(J.internalFormat,ie,fe,J.encoding);r.get(W).__hasExternalTextures||(ye===32879||ye===35866?n.texImage3D(ye,0,Q,W.width,W.height,W.depth,0,ie,fe,null):n.texImage2D(ye,0,Q,W.width,W.height,0,ie,fe,null)),n.bindFramebuffer(36160,H),Z(W)?d.framebufferTexture2DMultisampleEXT(36160,se,ye,r.get(J).__webglTexture,0,X(W)):t.framebufferTexture2D(36160,se,ye,r.get(J).__webglTexture,0),n.bindFramebuffer(36160,null)}function ge(H,W,J){if(t.bindRenderbuffer(36161,H),W.depthBuffer&&!W.stencilBuffer){let se=33189;if(J||Z(W)){const ye=W.depthTexture;ye&&ye.isDepthTexture&&(ye.type===Ov?se=36012:ye.type===_x&&(se=33190));const ie=X(W);Z(W)?d.renderbufferStorageMultisampleEXT(36161,ie,se,W.width,W.height):t.renderbufferStorageMultisample(36161,ie,se,W.width,W.height)}else t.renderbufferStorage(36161,se,W.width,W.height);t.framebufferRenderbuffer(36160,36096,36161,H)}else if(W.depthBuffer&&W.stencilBuffer){const se=X(W);J&&Z(W)===!1?t.renderbufferStorageMultisample(36161,se,35056,W.width,W.height):Z(W)?d.renderbufferStorageMultisampleEXT(36161,se,35056,W.width,W.height):t.renderbufferStorage(36161,34041,W.width,W.height),t.framebufferRenderbuffer(36160,33306,36161,H)}else{const se=W.isWebGLMultipleRenderTargets===!0?W.texture:[W.texture];for(let ye=0;ye0&&Z(H)===!1){const Q=ie?W:[W];J.__webglMultisampledFramebuffer=t.createFramebuffer(),J.__webglColorRenderbuffer=[],n.bindFramebuffer(36160,J.__webglMultisampledFramebuffer);for(let _e=0;_e0&&Z(H)===!1){const W=H.isWebGLMultipleRenderTargets?H.texture:[H.texture],J=H.width,se=H.height;let ye=16384;const ie=[],fe=H.stencilBuffer?33306:36096,Q=r.get(H),_e=H.isWebGLMultipleRenderTargets===!0;if(_e)for(let we=0;we0&&e.has("WEBGL_multisampled_render_to_texture")===!0&&W.__useRenderToTexture!==!1}function he(H){const W=s.render.frame;p.get(H)!==W&&(p.set(H,W),H.update())}function xe(H,W){const J=H.encoding,se=H.format,ye=H.type;return H.isCompressedTexture===!0||H.isVideoTexture===!0||H.format===eJ||J!==Wb&&(J===Mi?a===!1?e.has("EXT_sRGB")===!0&&se===rh?(H.format=eJ,H.minFilter=el,H.generateMipmaps=!1):W=GXe.sRGBToLinear(W):(se!==rh||ye!==Ub)&&console.warn("THREE.WebGLTextures: sRGB encoded textures have to use RGBAFormat and UnsignedByteType."):console.error("THREE.WebGLTextures: Unsupported texture encoding:",J)),W}this.allocateTextureUnit=N,this.resetTextureUnits=j,this.setTexture2D=L,this.setTexture2DArray=B,this.setTexture3D=F,this.setTextureCube=$,this.rebindTextures=U,this.setupRenderTarget=oe,this.updateRenderTargetMipmap=ne,this.updateMultisampleRenderTarget=V,this.setupDepthRenderbuffer=ae,this.setupFrameBufferTexture=re,this.useMultisampledRTT=Z}function RVn(t,e,n){const r=n.isWebGL2;function i(o,s=null){let a;if(o===Ub)return 5121;if(o===ABn)return 32819;if(o===PBn)return 32820;if(o===EBn)return 5120;if(o===TBn)return 5122;if(o===BXe)return 5123;if(o===kBn)return 5124;if(o===_x)return 5125;if(o===Ov)return 5126;if(o===sM)return r?5131:(a=e.get("OES_texture_half_float"),a!==null?a.HALF_FLOAT_OES:null);if(o===MBn)return 6406;if(o===rh)return 6408;if(o===DBn)return 6409;if(o===IBn)return 6410;if(o===Xx)return 6402;if(o===BC)return 34041;if(o===UXe)return 6403;if(o===RBn)return console.warn("THREE.WebGLRenderer: THREE.RGBFormat has been removed. Use THREE.RGBAFormat instead. https://github.com/mrdoob/three.js/pull/23228"),6408;if(o===eJ)return a=e.get("EXT_sRGB"),a!==null?a.SRGB_ALPHA_EXT:null;if(o===LBn)return 36244;if(o===$Bn)return 33319;if(o===FBn)return 33320;if(o===NBn)return 36249;if(o===nG||o===rG||o===iG||o===oG)if(s===Mi)if(a=e.get("WEBGL_compressed_texture_s3tc_srgb"),a!==null){if(o===nG)return a.COMPRESSED_SRGB_S3TC_DXT1_EXT;if(o===rG)return a.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT;if(o===iG)return a.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT;if(o===oG)return a.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT}else return null;else if(a=e.get("WEBGL_compressed_texture_s3tc"),a!==null){if(o===nG)return a.COMPRESSED_RGB_S3TC_DXT1_EXT;if(o===rG)return a.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(o===iG)return a.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(o===oG)return a.COMPRESSED_RGBA_S3TC_DXT5_EXT}else return null;if(o===AOe||o===POe||o===MOe||o===ROe)if(a=e.get("WEBGL_compressed_texture_pvrtc"),a!==null){if(o===AOe)return a.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(o===POe)return a.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(o===MOe)return a.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(o===ROe)return a.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}else return null;if(o===zBn)return a=e.get("WEBGL_compressed_texture_etc1"),a!==null?a.COMPRESSED_RGB_ETC1_WEBGL:null;if(o===DOe||o===IOe)if(a=e.get("WEBGL_compressed_texture_etc"),a!==null){if(o===DOe)return s===Mi?a.COMPRESSED_SRGB8_ETC2:a.COMPRESSED_RGB8_ETC2;if(o===IOe)return s===Mi?a.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:a.COMPRESSED_RGBA8_ETC2_EAC}else return null;if(o===LOe||o===$Oe||o===FOe||o===NOe||o===zOe||o===jOe||o===BOe||o===UOe||o===WOe||o===VOe||o===GOe||o===HOe||o===qOe||o===XOe)if(a=e.get("WEBGL_compressed_texture_astc"),a!==null){if(o===LOe)return s===Mi?a.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR:a.COMPRESSED_RGBA_ASTC_4x4_KHR;if(o===$Oe)return s===Mi?a.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR:a.COMPRESSED_RGBA_ASTC_5x4_KHR;if(o===FOe)return s===Mi?a.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR:a.COMPRESSED_RGBA_ASTC_5x5_KHR;if(o===NOe)return s===Mi?a.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR:a.COMPRESSED_RGBA_ASTC_6x5_KHR;if(o===zOe)return s===Mi?a.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR:a.COMPRESSED_RGBA_ASTC_6x6_KHR;if(o===jOe)return s===Mi?a.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR:a.COMPRESSED_RGBA_ASTC_8x5_KHR;if(o===BOe)return s===Mi?a.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR:a.COMPRESSED_RGBA_ASTC_8x6_KHR;if(o===UOe)return s===Mi?a.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR:a.COMPRESSED_RGBA_ASTC_8x8_KHR;if(o===WOe)return s===Mi?a.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR:a.COMPRESSED_RGBA_ASTC_10x5_KHR;if(o===VOe)return s===Mi?a.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR:a.COMPRESSED_RGBA_ASTC_10x6_KHR;if(o===GOe)return s===Mi?a.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR:a.COMPRESSED_RGBA_ASTC_10x8_KHR;if(o===HOe)return s===Mi?a.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR:a.COMPRESSED_RGBA_ASTC_10x10_KHR;if(o===qOe)return s===Mi?a.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR:a.COMPRESSED_RGBA_ASTC_12x10_KHR;if(o===XOe)return s===Mi?a.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR:a.COMPRESSED_RGBA_ASTC_12x12_KHR}else return null;if(o===YOe)if(a=e.get("EXT_texture_compression_bptc"),a!==null){if(o===YOe)return s===Mi?a.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT:a.COMPRESSED_RGBA_BPTC_UNORM_EXT}else return null;return o===sS?r?34042:(a=e.get("WEBGL_depth_texture"),a!==null?a.UNSIGNED_INT_24_8_WEBGL:null):t[o]!==void 0?t[o]:null}return{convert:i}}class DVn extends wf{constructor(e=[]){super(),this.isArrayCamera=!0,this.cameras=e}}class k$ extends yl{constructor(){super(),this.isGroup=!0,this.type="Group"}}const IVn={type:"move"};class DG{constructor(){this._targetRay=null,this._grip=null,this._hand=null}getHandSpace(){return this._hand===null&&(this._hand=new k$,this._hand.matrixAutoUpdate=!1,this._hand.visible=!1,this._hand.joints={},this._hand.inputState={pinching:!1}),this._hand}getTargetRaySpace(){return this._targetRay===null&&(this._targetRay=new k$,this._targetRay.matrixAutoUpdate=!1,this._targetRay.visible=!1,this._targetRay.hasLinearVelocity=!1,this._targetRay.linearVelocity=new Ce,this._targetRay.hasAngularVelocity=!1,this._targetRay.angularVelocity=new Ce),this._targetRay}getGripSpace(){return this._grip===null&&(this._grip=new k$,this._grip.matrixAutoUpdate=!1,this._grip.visible=!1,this._grip.hasLinearVelocity=!1,this._grip.linearVelocity=new Ce,this._grip.hasAngularVelocity=!1,this._grip.angularVelocity=new Ce),this._grip}dispatchEvent(e){return this._targetRay!==null&&this._targetRay.dispatchEvent(e),this._grip!==null&&this._grip.dispatchEvent(e),this._hand!==null&&this._hand.dispatchEvent(e),this}disconnect(e){return this.dispatchEvent({type:"disconnected",data:e}),this._targetRay!==null&&(this._targetRay.visible=!1),this._grip!==null&&(this._grip.visible=!1),this._hand!==null&&(this._hand.visible=!1),this}update(e,n,r){let i=null,o=null,s=null;const a=this._targetRay,l=this._grip,c=this._hand;if(e&&n.session.visibilityState!=="visible-blurred"){if(c&&e.hand){s=!0;for(const g of e.hand.values()){const m=n.getJointPose(g,r);if(c.joints[g.jointName]===void 0){const y=new k$;y.matrixAutoUpdate=!1,y.visible=!1,c.joints[g.jointName]=y,c.add(y)}const v=c.joints[g.jointName];m!==null&&(v.matrix.fromArray(m.transform.matrix),v.matrix.decompose(v.position,v.rotation,v.scale),v.jointRadius=m.radius),v.visible=m!==null}const u=c.joints["index-finger-tip"],f=c.joints["thumb-tip"],d=u.position.distanceTo(f.position),h=.02,p=.005;c.inputState.pinching&&d>h+p?(c.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:e.handedness,target:this})):!c.inputState.pinching&&d<=h-p&&(c.inputState.pinching=!0,this.dispatchEvent({type:"pinchstart",handedness:e.handedness,target:this}))}else l!==null&&e.gripSpace&&(o=n.getPose(e.gripSpace,r),o!==null&&(l.matrix.fromArray(o.transform.matrix),l.matrix.decompose(l.position,l.rotation,l.scale),o.linearVelocity?(l.hasLinearVelocity=!0,l.linearVelocity.copy(o.linearVelocity)):l.hasLinearVelocity=!1,o.angularVelocity?(l.hasAngularVelocity=!0,l.angularVelocity.copy(o.angularVelocity)):l.hasAngularVelocity=!1));a!==null&&(i=n.getPose(e.targetRaySpace,r),i===null&&o!==null&&(i=o),i!==null&&(a.matrix.fromArray(i.transform.matrix),a.matrix.decompose(a.position,a.rotation,a.scale),i.linearVelocity?(a.hasLinearVelocity=!0,a.linearVelocity.copy(i.linearVelocity)):a.hasLinearVelocity=!1,i.angularVelocity?(a.hasAngularVelocity=!0,a.angularVelocity.copy(i.angularVelocity)):a.hasAngularVelocity=!1,this.dispatchEvent(IVn)))}return a!==null&&(a.visible=i!==null),l!==null&&(l.visible=o!==null),c!==null&&(c.visible=s!==null),this}}class LVn extends kc{constructor(e,n,r,i,o,s,a,l,c,u){if(u=u!==void 0?u:Xx,u!==Xx&&u!==BC)throw new Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");r===void 0&&u===Xx&&(r=_x),r===void 0&&u===BC&&(r=sS),super(null,i,o,s,a,l,u,r,c),this.isDepthTexture=!0,this.image={width:e,height:n},this.magFilter=a!==void 0?a:Ja,this.minFilter=l!==void 0?l:Ja,this.flipY=!1,this.generateMipmaps=!1}}class $Vn extends M1{constructor(e,n){super();const r=this;let i=null,o=1,s=null,a="local-floor",l=null,c=null,u=null,f=null,d=null,h=null;const p=n.getContextAttributes();let g=null,m=null;const v=[],y=[],x=new wf;x.layers.enable(1),x.viewport=new vs;const b=new wf;b.layers.enable(2),b.viewport=new vs;const w=[x,b],_=new DVn;_.layers.enable(1),_.layers.enable(2);let S=null,O=null;this.cameraAutoUpdate=!0,this.enabled=!1,this.isPresenting=!1,this.getController=function(z){let L=v[z];return L===void 0&&(L=new DG,v[z]=L),L.getTargetRaySpace()},this.getControllerGrip=function(z){let L=v[z];return L===void 0&&(L=new DG,v[z]=L),L.getGripSpace()},this.getHand=function(z){let L=v[z];return L===void 0&&(L=new DG,v[z]=L),L.getHandSpace()};function k(z){const L=y.indexOf(z.inputSource);if(L===-1)return;const B=v[L];B!==void 0&&B.dispatchEvent({type:z.type,data:z.inputSource})}function E(){i.removeEventListener("select",k),i.removeEventListener("selectstart",k),i.removeEventListener("selectend",k),i.removeEventListener("squeeze",k),i.removeEventListener("squeezestart",k),i.removeEventListener("squeezeend",k),i.removeEventListener("end",E),i.removeEventListener("inputsourceschange",P);for(let z=0;z=0&&(y[F]=null,v[F].dispatchEvent({type:"disconnected",data:B}))}for(let L=0;L=y.length){y.push(B),F=q;break}else if(y[q]===null){y[q]=B,F=q;break}if(F===-1)break}const $=v[F];$&&$.dispatchEvent({type:"connected",data:B})}}const A=new Ce,R=new Ce;function T(z,L,B){A.setFromMatrixPosition(L.matrixWorld),R.setFromMatrixPosition(B.matrixWorld);const F=A.distanceTo(R),$=L.projectionMatrix.elements,q=B.projectionMatrix.elements,G=$[14]/($[10]-1),Y=$[14]/($[10]+1),le=($[9]+1)/$[5],K=($[9]-1)/$[5],ee=($[8]-1)/$[0],re=(q[8]+1)/q[0],ge=G*ee,te=G*re,ae=F/(-ee+re),U=ae*-ee;L.matrixWorld.decompose(z.position,z.quaternion,z.scale),z.translateX(U),z.translateZ(ae),z.matrixWorld.compose(z.position,z.quaternion,z.scale),z.matrixWorldInverse.copy(z.matrixWorld).invert();const oe=G+ae,ne=Y+ae,V=ge-U,X=te+(F-U),Z=le*Y/ne*oe,he=K*Y/ne*oe;z.projectionMatrix.makePerspective(V,X,Z,he,oe,ne)}function M(z,L){L===null?z.matrixWorld.copy(z.matrix):z.matrixWorld.multiplyMatrices(L.matrixWorld,z.matrix),z.matrixWorldInverse.copy(z.matrixWorld).invert()}this.updateCamera=function(z){if(i===null)return;_.near=b.near=x.near=z.near,_.far=b.far=x.far=z.far,(S!==_.near||O!==_.far)&&(i.updateRenderState({depthNear:_.near,depthFar:_.far}),S=_.near,O=_.far);const L=z.parent,B=_.cameras;M(_,L);for(let $=0;$0&&(g.alphaTest.value=m.alphaTest);const v=e.get(m).envMap;if(v&&(g.envMap.value=v,g.flipEnvMap.value=v.isCubeTexture&&v.isRenderTargetTexture===!1?-1:1,g.reflectivity.value=m.reflectivity,g.ior.value=m.ior,g.refractionRatio.value=m.refractionRatio),m.lightMap){g.lightMap.value=m.lightMap;const b=t.physicallyCorrectLights!==!0?Math.PI:1;g.lightMapIntensity.value=m.lightMapIntensity*b}m.aoMap&&(g.aoMap.value=m.aoMap,g.aoMapIntensity.value=m.aoMapIntensity);let y;m.map?y=m.map:m.specularMap?y=m.specularMap:m.displacementMap?y=m.displacementMap:m.normalMap?y=m.normalMap:m.bumpMap?y=m.bumpMap:m.roughnessMap?y=m.roughnessMap:m.metalnessMap?y=m.metalnessMap:m.alphaMap?y=m.alphaMap:m.emissiveMap?y=m.emissiveMap:m.clearcoatMap?y=m.clearcoatMap:m.clearcoatNormalMap?y=m.clearcoatNormalMap:m.clearcoatRoughnessMap?y=m.clearcoatRoughnessMap:m.iridescenceMap?y=m.iridescenceMap:m.iridescenceThicknessMap?y=m.iridescenceThicknessMap:m.specularIntensityMap?y=m.specularIntensityMap:m.specularColorMap?y=m.specularColorMap:m.transmissionMap?y=m.transmissionMap:m.thicknessMap?y=m.thicknessMap:m.sheenColorMap?y=m.sheenColorMap:m.sheenRoughnessMap&&(y=m.sheenRoughnessMap),y!==void 0&&(y.isWebGLRenderTarget&&(y=y.texture),y.matrixAutoUpdate===!0&&y.updateMatrix(),g.uvTransform.value.copy(y.matrix));let x;m.aoMap?x=m.aoMap:m.lightMap&&(x=m.lightMap),x!==void 0&&(x.isWebGLRenderTarget&&(x=x.texture),x.matrixAutoUpdate===!0&&x.updateMatrix(),g.uv2Transform.value.copy(x.matrix))}function o(g,m){g.diffuse.value.copy(m.color),g.opacity.value=m.opacity}function s(g,m){g.dashSize.value=m.dashSize,g.totalSize.value=m.dashSize+m.gapSize,g.scale.value=m.scale}function a(g,m,v,y){g.diffuse.value.copy(m.color),g.opacity.value=m.opacity,g.size.value=m.size*v,g.scale.value=y*.5,m.map&&(g.map.value=m.map),m.alphaMap&&(g.alphaMap.value=m.alphaMap),m.alphaTest>0&&(g.alphaTest.value=m.alphaTest);let x;m.map?x=m.map:m.alphaMap&&(x=m.alphaMap),x!==void 0&&(x.matrixAutoUpdate===!0&&x.updateMatrix(),g.uvTransform.value.copy(x.matrix))}function l(g,m){g.diffuse.value.copy(m.color),g.opacity.value=m.opacity,g.rotation.value=m.rotation,m.map&&(g.map.value=m.map),m.alphaMap&&(g.alphaMap.value=m.alphaMap),m.alphaTest>0&&(g.alphaTest.value=m.alphaTest);let v;m.map?v=m.map:m.alphaMap&&(v=m.alphaMap),v!==void 0&&(v.matrixAutoUpdate===!0&&v.updateMatrix(),g.uvTransform.value.copy(v.matrix))}function c(g,m){g.specular.value.copy(m.specular),g.shininess.value=Math.max(m.shininess,1e-4)}function u(g,m){m.gradientMap&&(g.gradientMap.value=m.gradientMap)}function f(g,m){g.roughness.value=m.roughness,g.metalness.value=m.metalness,m.roughnessMap&&(g.roughnessMap.value=m.roughnessMap),m.metalnessMap&&(g.metalnessMap.value=m.metalnessMap),e.get(m).envMap&&(g.envMapIntensity.value=m.envMapIntensity)}function d(g,m,v){g.ior.value=m.ior,m.sheen>0&&(g.sheenColor.value.copy(m.sheenColor).multiplyScalar(m.sheen),g.sheenRoughness.value=m.sheenRoughness,m.sheenColorMap&&(g.sheenColorMap.value=m.sheenColorMap),m.sheenRoughnessMap&&(g.sheenRoughnessMap.value=m.sheenRoughnessMap)),m.clearcoat>0&&(g.clearcoat.value=m.clearcoat,g.clearcoatRoughness.value=m.clearcoatRoughness,m.clearcoatMap&&(g.clearcoatMap.value=m.clearcoatMap),m.clearcoatRoughnessMap&&(g.clearcoatRoughnessMap.value=m.clearcoatRoughnessMap),m.clearcoatNormalMap&&(g.clearcoatNormalScale.value.copy(m.clearcoatNormalScale),g.clearcoatNormalMap.value=m.clearcoatNormalMap,m.side===mc&&g.clearcoatNormalScale.value.negate())),m.iridescence>0&&(g.iridescence.value=m.iridescence,g.iridescenceIOR.value=m.iridescenceIOR,g.iridescenceThicknessMinimum.value=m.iridescenceThicknessRange[0],g.iridescenceThicknessMaximum.value=m.iridescenceThicknessRange[1],m.iridescenceMap&&(g.iridescenceMap.value=m.iridescenceMap),m.iridescenceThicknessMap&&(g.iridescenceThicknessMap.value=m.iridescenceThicknessMap)),m.transmission>0&&(g.transmission.value=m.transmission,g.transmissionSamplerMap.value=v.texture,g.transmissionSamplerSize.value.set(v.width,v.height),m.transmissionMap&&(g.transmissionMap.value=m.transmissionMap),g.thickness.value=m.thickness,m.thicknessMap&&(g.thicknessMap.value=m.thicknessMap),g.attenuationDistance.value=m.attenuationDistance,g.attenuationColor.value.copy(m.attenuationColor)),g.specularIntensity.value=m.specularIntensity,g.specularColor.value.copy(m.specularColor),m.specularIntensityMap&&(g.specularIntensityMap.value=m.specularIntensityMap),m.specularColorMap&&(g.specularColorMap.value=m.specularColorMap)}function h(g,m){m.matcap&&(g.matcap.value=m.matcap)}function p(g,m){g.referencePosition.value.copy(m.referencePosition),g.nearDistance.value=m.nearDistance,g.farDistance.value=m.farDistance}return{refreshFogUniforms:n,refreshMaterialUniforms:r}}function NVn(t,e,n,r){let i={},o={},s=[];const a=n.isWebGL2?t.getParameter(35375):0;function l(y,x){const b=x.program;r.uniformBlockBinding(y,b)}function c(y,x){let b=i[y.id];b===void 0&&(p(y),b=u(y),i[y.id]=b,y.addEventListener("dispose",m));const w=x.program;r.updateUBOMapping(y,w);const _=e.render.frame;o[y.id]!==_&&(d(y),o[y.id]=_)}function u(y){const x=f();y.__bindingPointIndex=x;const b=t.createBuffer(),w=y.__size,_=y.usage;return t.bindBuffer(35345,b),t.bufferData(35345,w,_),t.bindBuffer(35345,null),t.bindBufferBase(35345,x,b),b}function f(){for(let y=0;y0){_=b%w;const P=w-_;_!==0&&P-E.boundary<0&&(b+=w-_,k.__offset=b)}b+=E.storage}return _=b%w,_>0&&(b+=w-_),y.__size=b,y.__cache={},this}function g(y){const x=y.value,b={boundary:0,storage:0};return typeof x=="number"?(b.boundary=4,b.storage=4):x.isVector2?(b.boundary=8,b.storage=8):x.isVector3||x.isColor?(b.boundary=16,b.storage=12):x.isVector4?(b.boundary=16,b.storage=16):x.isMatrix3?(b.boundary=48,b.storage=48):x.isMatrix4?(b.boundary=64,b.storage=64):x.isTexture?console.warn("THREE.WebGLRenderer: Texture samplers can not be part of an uniforms group."):console.warn("THREE.WebGLRenderer: Unsupported uniform value type.",x),b}function m(y){const x=y.target;x.removeEventListener("dispose",m);const b=s.indexOf(x.__bindingPointIndex);s.splice(b,1),t.deleteBuffer(i[x.id]),delete i[x.id],delete o[x.id]}function v(){for(const y in i)t.deleteBuffer(i[y]);s=[],i={},o={}}return{bind:l,update:c,dispose:v}}function zVn(){const t=aM("canvas");return t.style.display="block",t}function cYe(t={}){this.isWebGLRenderer=!0;const e=t.canvas!==void 0?t.canvas:zVn(),n=t.context!==void 0?t.context:null,r=t.depth!==void 0?t.depth:!0,i=t.stencil!==void 0?t.stencil:!0,o=t.antialias!==void 0?t.antialias:!1,s=t.premultipliedAlpha!==void 0?t.premultipliedAlpha:!0,a=t.preserveDrawingBuffer!==void 0?t.preserveDrawingBuffer:!1,l=t.powerPreference!==void 0?t.powerPreference:"default",c=t.failIfMajorPerformanceCaveat!==void 0?t.failIfMajorPerformanceCaveat:!1;let u;n!==null?u=n.getContextAttributes().alpha:u=t.alpha!==void 0?t.alpha:!1;let f=null,d=null;const h=[],p=[];this.domElement=e,this.debug={checkShaderErrors:!0},this.autoClear=!0,this.autoClearColor=!0,this.autoClearDepth=!0,this.autoClearStencil=!0,this.sortObjects=!0,this.clippingPlanes=[],this.localClippingEnabled=!1,this.outputEncoding=Wb,this.physicallyCorrectLights=!1,this.toneMapping=yg,this.toneMappingExposure=1,Object.defineProperties(this,{gammaFactor:{get:function(){return console.warn("THREE.WebGLRenderer: .gammaFactor has been removed."),2},set:function(){console.warn("THREE.WebGLRenderer: .gammaFactor has been removed.")}}});const g=this;let m=!1,v=0,y=0,x=null,b=-1,w=null;const _=new vs,S=new vs;let O=null,k=e.width,E=e.height,P=1,A=null,R=null;const T=new vs(0,0,k,E),M=new vs(0,0,k,E);let I=!1;const j=new nYe;let N=!1,z=!1,L=null;const B=new Wr,F=new On,$=new Ce,q={background:null,fog:null,environment:null,overrideMaterial:null,isScene:!0};function G(){return x===null?P:1}let Y=n;function le(ce,Ae){for(let Fe=0;Fe0?d=p[p.length-1]:d=null,h.pop(),h.length>0?f=h[h.length-1]:f=null};function Zi(ce,Ae,Fe,ke){if(ce.visible===!1)return;if(ce.layers.test(Ae.layers)){if(ce.isGroup)Fe=ce.renderOrder;else if(ce.isLOD)ce.autoUpdate===!0&&ce.update(Ae);else if(ce.isLight)d.pushLight(ce),ce.castShadow&&d.pushShadow(ce);else if(ce.isSprite){if(!ce.frustumCulled||j.intersectsSprite(ce)){ke&&$.setFromMatrixPosition(ce.matrixWorld).applyMatrix4(B);const Nt=X.update(ce),an=ce.material;an.visible&&f.push(ce,Nt,an,Fe,$.z,null)}}else if((ce.isMesh||ce.isLine||ce.isPoints)&&(ce.isSkinnedMesh&&ce.skeleton.frame!==ge.render.frame&&(ce.skeleton.update(),ce.skeleton.frame=ge.render.frame),!ce.frustumCulled||j.intersectsObject(ce))){ke&&$.setFromMatrixPosition(ce.matrixWorld).applyMatrix4(B);const Nt=X.update(ce),an=ce.material;if(Array.isArray(an)){const tn=Nt.groups;for(let Qn=0,Bn=tn.length;Qn0&&Gt(Be,Ae,Fe),ke&&re.viewport(_.copy(ke)),Be.length>0&&fr(Be,Ae,Fe),Ct.length>0&&fr(Ct,Ae,Fe),Nt.length>0&&fr(Nt,Ae,Fe),re.buffers.depth.setTest(!0),re.buffers.depth.setMask(!0),re.buffers.color.setMask(!0),re.setPolygonOffset(!1)}function Gt(ce,Ae,Fe){const ke=ee.isWebGL2;L===null&&(L=new Vb(1,1,{generateMipmaps:!0,type:K.has("EXT_color_buffer_half_float")?sM:Ub,minFilter:o8,samples:ke&&o===!0?4:0})),g.getDrawingBufferSize(F),ke?L.setSize(F.x,F.y):L.setSize(tJ(F.x),tJ(F.y));const Be=g.getRenderTarget();g.setRenderTarget(L),g.clear();const Ct=g.toneMapping;g.toneMapping=yg,fr(ce,Ae,Fe),g.toneMapping=Ct,ae.updateMultisampleRenderTarget(L),ae.updateRenderTargetMipmap(L),g.setRenderTarget(Be)}function fr(ce,Ae,Fe){const ke=Ae.isScene===!0?Ae.overrideMaterial:null;for(let Be=0,Ct=ce.length;Be0&&ae.useMultisampledRTT(ce)===!1?Be=te.get(ce).__webglMultisampledFramebuffer:Be=Qn,_.copy(ce.viewport),S.copy(ce.scissor),O=ce.scissorTest}else _.copy(T).multiplyScalar(P).floor(),S.copy(M).multiplyScalar(P).floor(),O=I;if(re.bindFramebuffer(36160,Be)&&ee.drawBuffers&&ke&&re.drawBuffers(ce,Be),re.viewport(_),re.scissor(S),re.setScissorTest(O),Ct){const tn=te.get(ce.texture);Y.framebufferTexture2D(36160,36064,34069+Ae,tn.__webglTexture,Fe)}else if(Nt){const tn=te.get(ce.texture),Qn=Ae||0;Y.framebufferTextureLayer(36160,36064,tn.__webglTexture,Fe||0,Qn)}b=-1},this.readRenderTargetPixels=function(ce,Ae,Fe,ke,Be,Ct,Nt){if(!(ce&&ce.isWebGLRenderTarget)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");return}let an=te.get(ce).__webglFramebuffer;if(ce.isWebGLCubeRenderTarget&&Nt!==void 0&&(an=an[Nt]),an){re.bindFramebuffer(36160,an);try{const tn=ce.texture,Qn=tn.format,Bn=tn.type;if(Qn!==rh&&Q.convert(Qn)!==Y.getParameter(35739)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");return}const Un=Bn===sM&&(K.has("EXT_color_buffer_half_float")||ee.isWebGL2&&K.has("EXT_color_buffer_float"));if(Bn!==Ub&&Q.convert(Bn)!==Y.getParameter(35738)&&!(Bn===Ov&&(ee.isWebGL2||K.has("OES_texture_float")||K.has("WEBGL_color_buffer_float")))&&!Un){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");return}Ae>=0&&Ae<=ce.width-ke&&Fe>=0&&Fe<=ce.height-Be&&Y.readPixels(Ae,Fe,ke,Be,Q.convert(Qn),Q.convert(Bn),Ct)}finally{const tn=x!==null?te.get(x).__webglFramebuffer:null;re.bindFramebuffer(36160,tn)}}},this.copyFramebufferToTexture=function(ce,Ae,Fe=0){const ke=Math.pow(2,-Fe),Be=Math.floor(Ae.image.width*ke),Ct=Math.floor(Ae.image.height*ke);ae.setTexture2D(Ae,0),Y.copyTexSubImage2D(3553,Fe,0,0,ce.x,ce.y,Be,Ct),re.unbindTexture()},this.copyTextureToTexture=function(ce,Ae,Fe,ke=0){const Be=Ae.image.width,Ct=Ae.image.height,Nt=Q.convert(Fe.format),an=Q.convert(Fe.type);ae.setTexture2D(Fe,0),Y.pixelStorei(37440,Fe.flipY),Y.pixelStorei(37441,Fe.premultiplyAlpha),Y.pixelStorei(3317,Fe.unpackAlignment),Ae.isDataTexture?Y.texSubImage2D(3553,ke,ce.x,ce.y,Be,Ct,Nt,an,Ae.image.data):Ae.isCompressedTexture?Y.compressedTexSubImage2D(3553,ke,ce.x,ce.y,Ae.mipmaps[0].width,Ae.mipmaps[0].height,Nt,Ae.mipmaps[0].data):Y.texSubImage2D(3553,ke,ce.x,ce.y,Nt,an,Ae.image),ke===0&&Fe.generateMipmaps&&Y.generateMipmap(3553),re.unbindTexture()},this.copyTextureToTexture3D=function(ce,Ae,Fe,ke,Be=0){if(g.isWebGL1Renderer){console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: can only be used with WebGL2.");return}const Ct=ce.max.x-ce.min.x+1,Nt=ce.max.y-ce.min.y+1,an=ce.max.z-ce.min.z+1,tn=Q.convert(ke.format),Qn=Q.convert(ke.type);let Bn;if(ke.isData3DTexture)ae.setTexture3D(ke,0),Bn=32879;else if(ke.isDataArrayTexture)ae.setTexture2DArray(ke,0),Bn=35866;else{console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: only supports THREE.DataTexture3D and THREE.DataTexture2DArray.");return}Y.pixelStorei(37440,ke.flipY),Y.pixelStorei(37441,ke.premultiplyAlpha),Y.pixelStorei(3317,ke.unpackAlignment);const Un=Y.getParameter(3314),ki=Y.getParameter(32878),l0=Y.getParameter(3316),D1=Y.getParameter(3315),I1=Y.getParameter(32877),fd=Fe.isCompressedTexture?Fe.mipmaps[0]:Fe.image;Y.pixelStorei(3314,fd.width),Y.pixelStorei(32878,fd.height),Y.pixelStorei(3316,ce.min.x),Y.pixelStorei(3315,ce.min.y),Y.pixelStorei(32877,ce.min.z),Fe.isDataTexture||Fe.isData3DTexture?Y.texSubImage3D(Bn,Be,Ae.x,Ae.y,Ae.z,Ct,Nt,an,tn,Qn,fd.data):Fe.isCompressedTexture?(console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: untested support for compressed srcTexture."),Y.compressedTexSubImage3D(Bn,Be,Ae.x,Ae.y,Ae.z,Ct,Nt,an,tn,fd.data)):Y.texSubImage3D(Bn,Be,Ae.x,Ae.y,Ae.z,Ct,Nt,an,tn,Qn,fd),Y.pixelStorei(3314,Un),Y.pixelStorei(32878,ki),Y.pixelStorei(3316,l0),Y.pixelStorei(3315,D1),Y.pixelStorei(32877,I1),Be===0&&ke.generateMipmaps&&Y.generateMipmap(Bn),re.unbindTexture()},this.initTexture=function(ce){ce.isCubeTexture?ae.setTextureCube(ce,0):ce.isData3DTexture?ae.setTexture3D(ce,0):ce.isDataArrayTexture?ae.setTexture2DArray(ce,0):ae.setTexture2D(ce,0),re.unbindTexture()},this.resetState=function(){v=0,y=0,x=null,re.reset(),_e.reset()},typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}class jVn extends cYe{}jVn.prototype.isWebGL1Renderer=!0;class BVn extends yl{constructor(){super(),this.isScene=!0,this.type="Scene",this.background=null,this.environment=null,this.fog=null,this.overrideMaterial=null,typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}copy(e,n){return super.copy(e,n),e.background!==null&&(this.background=e.background.clone()),e.environment!==null&&(this.environment=e.environment.clone()),e.fog!==null&&(this.fog=e.fog.clone()),e.overrideMaterial!==null&&(this.overrideMaterial=e.overrideMaterial.clone()),this.matrixAutoUpdate=e.matrixAutoUpdate,this}toJSON(e){const n=super.toJSON(e);return this.fog!==null&&(n.object.fog=this.fog.toJSON()),n}get autoUpdate(){return console.warn("THREE.Scene: autoUpdate was renamed to matrixWorldAutoUpdate in r144."),this.matrixWorldAutoUpdate}set autoUpdate(e){console.warn("THREE.Scene: autoUpdate was renamed to matrixWorldAutoUpdate in r144."),this.matrixWorldAutoUpdate=e}}class uYe extends _D{constructor(e){super(),this.isLineBasicMaterial=!0,this.type="LineBasicMaterial",this.color=new fi(16777215),this.linewidth=1,this.linecap="round",this.linejoin="round",this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.linewidth=e.linewidth,this.linecap=e.linecap,this.linejoin=e.linejoin,this.fog=e.fog,this}}const DEe=new Ce,IEe=new Ce,LEe=new Wr,IG=new YXe,A$=new s8;class UVn extends yl{constructor(e=new om,n=new uYe){super(),this.isLine=!0,this.type="Line",this.geometry=e,this.material=n,this.updateMorphTargets()}copy(e,n){return super.copy(e,n),this.material=e.material,this.geometry=e.geometry,this}computeLineDistances(){const e=this.geometry;if(e.index===null){const n=e.attributes.position,r=[0];for(let i=1,o=n.count;il)continue;d.applyMatrix4(this.matrixWorld);const O=e.ray.origin.distanceTo(d);Oe.far||n.push({distance:O,point:f.clone().applyMatrix4(this.matrixWorld),index:x,face:null,faceIndex:null,object:this})}}else{const v=Math.max(0,s.start),y=Math.min(m.count,s.start+s.count);for(let x=v,b=y-1;xl)continue;d.applyMatrix4(this.matrixWorld);const _=e.ray.origin.distanceTo(d);_e.far||n.push({distance:_,point:f.clone().applyMatrix4(this.matrixWorld),index:x,face:null,faceIndex:null,object:this})}}}updateMorphTargets(){const n=this.geometry.morphAttributes,r=Object.keys(n);if(r.length>0){const i=n[r[0]];if(i!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let o=0,s=i.length;o{n&&n(o),this.manager.itemEnd(e)},0),o;if(vp[e]!==void 0){vp[e].push({onLoad:n,onProgress:r,onError:i});return}vp[e]=[],vp[e].push({onLoad:n,onProgress:r,onError:i});const s=new Request(e,{headers:new Headers(this.requestHeader),credentials:this.withCredentials?"include":"same-origin"}),a=this.mimeType,l=this.responseType;fetch(s).then(c=>{if(c.status===200||c.status===0){if(c.status===0&&console.warn("THREE.FileLoader: HTTP Status 0 received."),typeof ReadableStream>"u"||c.body===void 0||c.body.getReader===void 0)return c;const u=vp[e],f=c.body.getReader(),d=c.headers.get("Content-Length"),h=d?parseInt(d):0,p=h!==0;let g=0;const m=new ReadableStream({start(v){y();function y(){f.read().then(({done:x,value:b})=>{if(x)v.close();else{g+=b.byteLength;const w=new ProgressEvent("progress",{lengthComputable:p,loaded:g,total:h});for(let _=0,S=u.length;_{switch(l){case"arraybuffer":return c.arrayBuffer();case"blob":return c.blob();case"document":return c.text().then(u=>new DOMParser().parseFromString(u,a));case"json":return c.json();default:if(a===void 0)return c.text();{const f=/charset="?([^;"\s]*)"?/i.exec(a),d=f&&f[1]?f[1].toLowerCase():void 0,h=new TextDecoder(d);return c.arrayBuffer().then(p=>h.decode(p))}}}).then(c=>{ij.add(e,c);const u=vp[e];delete vp[e];for(let f=0,d=u.length;f{const u=vp[e];if(u===void 0)throw this.manager.itemError(e),c;delete vp[e];for(let f=0,d=u.length;f{this.manager.itemEnd(e)}),this.manager.itemStart(e)}setResponseType(e){return this.responseType=e,this}setMimeType(e){return this.mimeType=e,this}}class XVn extends c8{constructor(e){super(e)}load(e,n,r,i){this.path!==void 0&&(e=this.path+e),e=this.manager.resolveURL(e);const o=this,s=ij.get(e);if(s!==void 0)return o.manager.itemStart(e),setTimeout(function(){n&&n(s),o.manager.itemEnd(e)},0),s;const a=aM("img");function l(){u(),ij.add(e,this),n&&n(this),o.manager.itemEnd(e)}function c(f){u(),i&&i(f),o.manager.itemError(e),o.manager.itemEnd(e)}function u(){a.removeEventListener("load",l,!1),a.removeEventListener("error",c,!1)}return a.addEventListener("load",l,!1),a.addEventListener("error",c,!1),e.slice(0,5)!=="data:"&&this.crossOrigin!==void 0&&(a.crossOrigin=this.crossOrigin),o.manager.itemStart(e),a.src=e,a}}class YVn extends c8{constructor(e){super(e)}load(e,n,r,i){const o=new kc,s=new XVn(this.manager);return s.setCrossOrigin(this.crossOrigin),s.setPath(this.path),s.load(e,function(a){o.image=a,o.needsUpdate=!0,n!==void 0&&n(o)},r,i),o}}class NEe{constructor(e=1,n=0,r=0){return this.radius=e,this.phi=n,this.theta=r,this}set(e,n,r){return this.radius=e,this.phi=n,this.theta=r,this}copy(e){return this.radius=e.radius,this.phi=e.phi,this.theta=e.theta,this}makeSafe(){return this.phi=Math.max(1e-6,Math.min(Math.PI-1e-6,this.phi)),this}setFromVector3(e){return this.setFromCartesianCoords(e.x,e.y,e.z)}setFromCartesianCoords(e,n,r){return this.radius=Math.sqrt(e*e+n*n+r*r),this.radius===0?(this.theta=0,this.phi=0):(this.theta=Math.atan2(e,r),this.phi=Math.acos(tl(n/this.radius,-1,1))),this}clone(){return new this.constructor().copy(this)}}const P$=new hE;class QVn extends WVn{constructor(e,n=16776960){const r=new Uint16Array([0,1,1,2,2,3,3,0,4,5,5,6,6,7,7,4,0,4,1,5,2,6,3,7]),i=new Float32Array(8*3),o=new om;o.setIndex(new xu(r,1)),o.setAttribute("position",new xu(i,3)),super(o,new uYe({color:n,toneMapped:!1})),this.object=e,this.type="BoxHelper",this.matrixAutoUpdate=!1,this.update()}update(e){if(e!==void 0&&console.warn("THREE.BoxHelper: .update() has no longer arguments."),this.object!==void 0&&P$.setFromObject(this.object),P$.isEmpty())return;const n=P$.min,r=P$.max,i=this.geometry.attributes.position,o=i.array;o[0]=r.x,o[1]=r.y,o[2]=r.z,o[3]=n.x,o[4]=r.y,o[5]=r.z,o[6]=n.x,o[7]=n.y,o[8]=r.z,o[9]=r.x,o[10]=n.y,o[11]=r.z,o[12]=r.x,o[13]=r.y,o[14]=n.z,o[15]=n.x,o[16]=r.y,o[17]=n.z,o[18]=n.x,o[19]=n.y,o[20]=n.z,o[21]=r.x,o[22]=n.y,o[23]=n.z,i.needsUpdate=!0,this.geometry.computeBoundingSphere()}setFromObject(e){return this.object=e,this.update(),this}copy(e,n){return super.copy(e,n),this.object=e.object,this}}typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("register",{detail:{revision:Jce}}));typeof window<"u"&&(window.__THREE__?console.warn("WARNING: Multiple instances of Three.js being imported."):window.__THREE__=Jce);const zEe={type:"change"},LG={type:"start"},jEe={type:"end"};class KVn extends M1{constructor(e,n){super(),this.object=e,this.domElement=n,this.domElement.style.touchAction="none",this.enabled=!0,this.target=new Ce,this.minDistance=0,this.maxDistance=1/0,this.minZoom=0,this.maxZoom=1/0,this.minPolarAngle=0,this.maxPolarAngle=Math.PI,this.minAzimuthAngle=-1/0,this.maxAzimuthAngle=1/0,this.enableDamping=!1,this.dampingFactor=.05,this.enableZoom=!0,this.zoomSpeed=1,this.enableRotate=!0,this.rotateSpeed=1,this.enablePan=!0,this.panSpeed=1,this.screenSpacePanning=!0,this.keyPanSpeed=7,this.autoRotate=!1,this.autoRotateSpeed=2,this.keys={LEFT:"ArrowLeft",UP:"ArrowUp",RIGHT:"ArrowRight",BOTTOM:"ArrowDown"},this.mouseButtons={LEFT:dw.ROTATE,MIDDLE:dw.DOLLY,RIGHT:dw.PAN},this.touches={ONE:hw.ROTATE,TWO:hw.DOLLY_PAN},this.target0=this.target.clone(),this.position0=this.object.position.clone(),this.zoom0=this.object.zoom,this._domElementKeyEvents=null,this.getPolarAngle=function(){return a.phi},this.getAzimuthalAngle=function(){return a.theta},this.getDistance=function(){return this.object.position.distanceTo(this.target)},this.listenToKeyEvents=function(Q){Q.addEventListener("keydown",xe),this._domElementKeyEvents=Q},this.saveState=function(){r.target0.copy(r.target),r.position0.copy(r.object.position),r.zoom0=r.object.zoom},this.reset=function(){r.target.copy(r.target0),r.object.position.copy(r.position0),r.object.zoom=r.zoom0,r.object.updateProjectionMatrix(),r.dispatchEvent(zEe),r.update(),o=i.NONE},this.update=function(){const Q=new Ce,_e=new Gb().setFromUnitVectors(e.up,new Ce(0,1,0)),we=_e.clone().invert(),Ie=new Ce,Pe=new Gb,Me=2*Math.PI;return function(){const Le=r.object.position;Q.copy(Le).sub(r.target),Q.applyQuaternion(_e),a.setFromVector3(Q),r.autoRotate&&o===i.NONE&&k(S()),r.enableDamping?(a.theta+=l.theta*r.dampingFactor,a.phi+=l.phi*r.dampingFactor):(a.theta+=l.theta,a.phi+=l.phi);let ue=r.minAzimuthAngle,$e=r.maxAzimuthAngle;return isFinite(ue)&&isFinite($e)&&(ue<-Math.PI?ue+=Me:ue>Math.PI&&(ue-=Me),$e<-Math.PI?$e+=Me:$e>Math.PI&&($e-=Me),ue<=$e?a.theta=Math.max(ue,Math.min($e,a.theta)):a.theta=a.theta>(ue+$e)/2?Math.max(ue,a.theta):Math.min($e,a.theta)),a.phi=Math.max(r.minPolarAngle,Math.min(r.maxPolarAngle,a.phi)),a.makeSafe(),a.radius*=c,a.radius=Math.max(r.minDistance,Math.min(r.maxDistance,a.radius)),r.enableDamping===!0?r.target.addScaledVector(u,r.dampingFactor):r.target.add(u),Q.setFromSpherical(a),Q.applyQuaternion(we),Le.copy(r.target).add(Q),r.object.lookAt(r.target),r.enableDamping===!0?(l.theta*=1-r.dampingFactor,l.phi*=1-r.dampingFactor,u.multiplyScalar(1-r.dampingFactor)):(l.set(0,0,0),u.set(0,0,0)),c=1,f||Ie.distanceToSquared(r.object.position)>s||8*(1-Pe.dot(r.object.quaternion))>s?(r.dispatchEvent(zEe),Ie.copy(r.object.position),Pe.copy(r.object.quaternion),f=!1,!0):!1}}(),this.dispose=function(){r.domElement.removeEventListener("contextmenu",J),r.domElement.removeEventListener("pointerdown",U),r.domElement.removeEventListener("pointercancel",V),r.domElement.removeEventListener("wheel",he),r.domElement.removeEventListener("pointermove",oe),r.domElement.removeEventListener("pointerup",ne),r._domElementKeyEvents!==null&&r._domElementKeyEvents.removeEventListener("keydown",xe)};const r=this,i={NONE:-1,ROTATE:0,DOLLY:1,PAN:2,TOUCH_ROTATE:3,TOUCH_PAN:4,TOUCH_DOLLY_PAN:5,TOUCH_DOLLY_ROTATE:6};let o=i.NONE;const s=1e-6,a=new NEe,l=new NEe;let c=1;const u=new Ce;let f=!1;const d=new On,h=new On,p=new On,g=new On,m=new On,v=new On,y=new On,x=new On,b=new On,w=[],_={};function S(){return 2*Math.PI/60/60*r.autoRotateSpeed}function O(){return Math.pow(.95,r.zoomSpeed)}function k(Q){l.theta-=Q}function E(Q){l.phi-=Q}const P=function(){const Q=new Ce;return function(we,Ie){Q.setFromMatrixColumn(Ie,0),Q.multiplyScalar(-we),u.add(Q)}}(),A=function(){const Q=new Ce;return function(we,Ie){r.screenSpacePanning===!0?Q.setFromMatrixColumn(Ie,1):(Q.setFromMatrixColumn(Ie,0),Q.crossVectors(r.object.up,Q)),Q.multiplyScalar(we),u.add(Q)}}(),R=function(){const Q=new Ce;return function(we,Ie){const Pe=r.domElement;if(r.object.isPerspectiveCamera){const Me=r.object.position;Q.copy(Me).sub(r.target);let Te=Q.length();Te*=Math.tan(r.object.fov/2*Math.PI/180),P(2*we*Te/Pe.clientHeight,r.object.matrix),A(2*Ie*Te/Pe.clientHeight,r.object.matrix)}else r.object.isOrthographicCamera?(P(we*(r.object.right-r.object.left)/r.object.zoom/Pe.clientWidth,r.object.matrix),A(Ie*(r.object.top-r.object.bottom)/r.object.zoom/Pe.clientHeight,r.object.matrix)):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - pan disabled."),r.enablePan=!1)}}();function T(Q){r.object.isPerspectiveCamera?c/=Q:r.object.isOrthographicCamera?(r.object.zoom=Math.max(r.minZoom,Math.min(r.maxZoom,r.object.zoom*Q)),r.object.updateProjectionMatrix(),f=!0):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),r.enableZoom=!1)}function M(Q){r.object.isPerspectiveCamera?c*=Q:r.object.isOrthographicCamera?(r.object.zoom=Math.max(r.minZoom,Math.min(r.maxZoom,r.object.zoom/Q)),r.object.updateProjectionMatrix(),f=!0):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),r.enableZoom=!1)}function I(Q){d.set(Q.clientX,Q.clientY)}function j(Q){y.set(Q.clientX,Q.clientY)}function N(Q){g.set(Q.clientX,Q.clientY)}function z(Q){h.set(Q.clientX,Q.clientY),p.subVectors(h,d).multiplyScalar(r.rotateSpeed);const _e=r.domElement;k(2*Math.PI*p.x/_e.clientHeight),E(2*Math.PI*p.y/_e.clientHeight),d.copy(h),r.update()}function L(Q){x.set(Q.clientX,Q.clientY),b.subVectors(x,y),b.y>0?T(O()):b.y<0&&M(O()),y.copy(x),r.update()}function B(Q){m.set(Q.clientX,Q.clientY),v.subVectors(m,g).multiplyScalar(r.panSpeed),R(v.x,v.y),g.copy(m),r.update()}function F(Q){Q.deltaY<0?M(O()):Q.deltaY>0&&T(O()),r.update()}function $(Q){let _e=!1;switch(Q.code){case r.keys.UP:R(0,r.keyPanSpeed),_e=!0;break;case r.keys.BOTTOM:R(0,-r.keyPanSpeed),_e=!0;break;case r.keys.LEFT:R(r.keyPanSpeed,0),_e=!0;break;case r.keys.RIGHT:R(-r.keyPanSpeed,0),_e=!0;break}_e&&(Q.preventDefault(),r.update())}function q(){if(w.length===1)d.set(w[0].pageX,w[0].pageY);else{const Q=.5*(w[0].pageX+w[1].pageX),_e=.5*(w[0].pageY+w[1].pageY);d.set(Q,_e)}}function G(){if(w.length===1)g.set(w[0].pageX,w[0].pageY);else{const Q=.5*(w[0].pageX+w[1].pageX),_e=.5*(w[0].pageY+w[1].pageY);g.set(Q,_e)}}function Y(){const Q=w[0].pageX-w[1].pageX,_e=w[0].pageY-w[1].pageY,we=Math.sqrt(Q*Q+_e*_e);y.set(0,we)}function le(){r.enableZoom&&Y(),r.enablePan&&G()}function K(){r.enableZoom&&Y(),r.enableRotate&&q()}function ee(Q){if(w.length===1)h.set(Q.pageX,Q.pageY);else{const we=fe(Q),Ie=.5*(Q.pageX+we.x),Pe=.5*(Q.pageY+we.y);h.set(Ie,Pe)}p.subVectors(h,d).multiplyScalar(r.rotateSpeed);const _e=r.domElement;k(2*Math.PI*p.x/_e.clientHeight),E(2*Math.PI*p.y/_e.clientHeight),d.copy(h)}function re(Q){if(w.length===1)m.set(Q.pageX,Q.pageY);else{const _e=fe(Q),we=.5*(Q.pageX+_e.x),Ie=.5*(Q.pageY+_e.y);m.set(we,Ie)}v.subVectors(m,g).multiplyScalar(r.panSpeed),R(v.x,v.y),g.copy(m)}function ge(Q){const _e=fe(Q),we=Q.pageX-_e.x,Ie=Q.pageY-_e.y,Pe=Math.sqrt(we*we+Ie*Ie);x.set(0,Pe),b.set(0,Math.pow(x.y/y.y,r.zoomSpeed)),T(b.y),y.copy(x)}function te(Q){r.enableZoom&&ge(Q),r.enablePan&&re(Q)}function ae(Q){r.enableZoom&&ge(Q),r.enableRotate&&ee(Q)}function U(Q){r.enabled!==!1&&(w.length===0&&(r.domElement.setPointerCapture(Q.pointerId),r.domElement.addEventListener("pointermove",oe),r.domElement.addEventListener("pointerup",ne)),se(Q),Q.pointerType==="touch"?H(Q):X(Q))}function oe(Q){r.enabled!==!1&&(Q.pointerType==="touch"?W(Q):Z(Q))}function ne(Q){ye(Q),w.length===0&&(r.domElement.releasePointerCapture(Q.pointerId),r.domElement.removeEventListener("pointermove",oe),r.domElement.removeEventListener("pointerup",ne)),r.dispatchEvent(jEe),o=i.NONE}function V(Q){ye(Q)}function X(Q){let _e;switch(Q.button){case 0:_e=r.mouseButtons.LEFT;break;case 1:_e=r.mouseButtons.MIDDLE;break;case 2:_e=r.mouseButtons.RIGHT;break;default:_e=-1}switch(_e){case dw.DOLLY:if(r.enableZoom===!1)return;j(Q),o=i.DOLLY;break;case dw.ROTATE:if(Q.ctrlKey||Q.metaKey||Q.shiftKey){if(r.enablePan===!1)return;N(Q),o=i.PAN}else{if(r.enableRotate===!1)return;I(Q),o=i.ROTATE}break;case dw.PAN:if(Q.ctrlKey||Q.metaKey||Q.shiftKey){if(r.enableRotate===!1)return;I(Q),o=i.ROTATE}else{if(r.enablePan===!1)return;N(Q),o=i.PAN}break;default:o=i.NONE}o!==i.NONE&&r.dispatchEvent(LG)}function Z(Q){switch(o){case i.ROTATE:if(r.enableRotate===!1)return;z(Q);break;case i.DOLLY:if(r.enableZoom===!1)return;L(Q);break;case i.PAN:if(r.enablePan===!1)return;B(Q);break}}function he(Q){r.enabled===!1||r.enableZoom===!1||o!==i.NONE||(Q.preventDefault(),r.dispatchEvent(LG),F(Q),r.dispatchEvent(jEe))}function xe(Q){r.enabled===!1||r.enablePan===!1||$(Q)}function H(Q){switch(ie(Q),w.length){case 1:switch(r.touches.ONE){case hw.ROTATE:if(r.enableRotate===!1)return;q(),o=i.TOUCH_ROTATE;break;case hw.PAN:if(r.enablePan===!1)return;G(),o=i.TOUCH_PAN;break;default:o=i.NONE}break;case 2:switch(r.touches.TWO){case hw.DOLLY_PAN:if(r.enableZoom===!1&&r.enablePan===!1)return;le(),o=i.TOUCH_DOLLY_PAN;break;case hw.DOLLY_ROTATE:if(r.enableZoom===!1&&r.enableRotate===!1)return;K(),o=i.TOUCH_DOLLY_ROTATE;break;default:o=i.NONE}break;default:o=i.NONE}o!==i.NONE&&r.dispatchEvent(LG)}function W(Q){switch(ie(Q),o){case i.TOUCH_ROTATE:if(r.enableRotate===!1)return;ee(Q),r.update();break;case i.TOUCH_PAN:if(r.enablePan===!1)return;re(Q),r.update();break;case i.TOUCH_DOLLY_PAN:if(r.enableZoom===!1&&r.enablePan===!1)return;te(Q),r.update();break;case i.TOUCH_DOLLY_ROTATE:if(r.enableZoom===!1&&r.enableRotate===!1)return;ae(Q),r.update();break;default:o=i.NONE}}function J(Q){r.enabled!==!1&&Q.preventDefault()}function se(Q){w.push(Q)}function ye(Q){delete _[Q.pointerId];for(let _e=0;_e>>1|(ti&21845)<<1;km=(km&52428)>>>2|(km&13107)<<2,km=(km&61680)>>>4|(km&3855)<<4,BZ[ti]=((km&65280)>>>8|(km&255)<<8)>>>1}var Ik=function(t,e,n){for(var r=t.length,i=0,o=new Cx(e);i>>l]=c}else for(a=new Cx(r),i=0;i>>15-t[i]);return a},ED=new oc(288);for(var ti=0;ti<144;++ti)ED[ti]=8;for(var ti=144;ti<256;++ti)ED[ti]=9;for(var ti=256;ti<280;++ti)ED[ti]=7;for(var ti=280;ti<288;++ti)ED[ti]=8;var VXe=new oc(32);for(var ti=0;ti<32;++ti)VXe[ti]=5;var h9n=Ik(ED,9,1),p9n=Ik(VXe,5,1),wG=function(t){for(var e=t[0],n=1;ne&&(e=t[n]);return e},nf=function(t,e,n){var r=e/8|0;return(t[r]|t[r+1]<<8)>>(e&7)&n},_G=function(t,e){var n=e/8|0;return(t[n]|t[n+1]<<8|t[n+2]<<16)>>(e&7)},g9n=function(t){return(t+7)/8|0},m9n=function(t,e,n){(n==null||n>t.length)&&(n=t.length);var r=new(t.BYTES_PER_ELEMENT==2?Cx:t.BYTES_PER_ELEMENT==4?NXe:oc)(n-e);return r.set(t.subarray(e,n)),r},v9n=["unexpected EOF","invalid block type","invalid length/literal","invalid distance","stream finished","no stream handler",,"no callback","invalid UTF-8 data","extra field too long","date not in range 1980-2099","filename too long","stream finishing","invalid zip data"],Rp=function(t,e,n){var r=new Error(e||v9n[t]);if(r.code=t,Error.captureStackTrace&&Error.captureStackTrace(r,Rp),!n)throw r;return r},y9n=function(t,e,n){var r=t.length;if(!r||n&&n.f&&!n.l)return e||new oc(0);var i=!e||n,o=!n||n.i;n||(n={}),e||(e=new oc(r*3));var s=function(Y){var le=e.length;if(Y>le){var K=new oc(Math.max(le*2,Y));K.set(e),e=K}},a=n.f||0,l=n.p||0,c=n.b||0,u=n.l,f=n.d,d=n.m,h=n.n,p=r*8;do{if(!u){a=nf(t,l,1);var g=nf(t,l+1,3);if(l+=3,g)if(g==1)u=h9n,f=p9n,d=9,h=5;else if(g==2){var x=nf(t,l,31)+257,b=nf(t,l+10,15)+4,w=x+nf(t,l+5,31)+1;l+=14;for(var _=new oc(w),S=new oc(19),O=0;O>>4;if(m<16)_[O++]=m;else{var P=0,T=0;for(m==16?(T=3+nf(t,l,3),l+=2,P=_[O-1]):m==17?(T=3+nf(t,l,7),l+=3):m==18&&(T=11+nf(t,l,127),l+=7);T--;)_[O++]=P}}var R=_.subarray(0,x),I=_.subarray(x);d=wG(R),h=wG(I),u=Ik(R,d,1),f=Ik(I,h,1)}else Rp(1);else{var m=g9n(l)+4,v=t[m-4]|t[m-3]<<8,y=m+v;if(y>r){o&&Rp(0);break}i&&s(c+v),e.set(t.subarray(m,y),c),n.b=c+=v,n.p=l=y*8,n.f=a;continue}if(l>p){o&&Rp(0);break}}i&&s(c+131072);for(var B=(1<>>4;if(l+=P&15,l>p){o&&Rp(0);break}if(P||Rp(2),L<256)e[c++]=L;else if(L==256){z=l,u=null;break}else{var j=L-254;if(L>264){var O=L-257,N=zXe[O];j=nf(t,l,(1<>>4;F||Rp(3),l+=F&15;var I=d9n[H];if(H>3){var N=jXe[H];I+=_G(t,l)&(1<p){o&&Rp(0);break}i&&s(c+131072);for(var q=c+j;c>3&1)+(e>>4&1);r>0;r-=!t[n++]);return n+(e&2)},w9n=function(t){var e=t.length;return(t[e-4]|t[e-3]<<8|t[e-2]<<16|t[e-1]<<24)>>>0};function _9n(t,e){return y9n(t.subarray(b9n(t),-8),new oc(w9n(t)))}var S9n=typeof TextDecoder<"u"&&new TextDecoder,C9n=0;try{S9n.decode(x9n,{stream:!0}),C9n=1}catch{}class O9n{constructor(e,n,r){const i=this;this.volume=e,n=n||0,Object.defineProperty(this,"index",{get:function(){return n},set:function(a){return n=a,i.geometryNeedsUpdate=!0,n}}),this.axis=r||"z",this.canvas=document.createElement("canvas"),this.canvasBuffer=document.createElement("canvas"),this.updateGeometry();const o=new Ac(this.canvas);o.minFilter=nl,o.wrapS=o.wrapT=eu;const s=new $ce({map:o,side:tg,transparent:!0});this.mesh=new ah(this.geometry,s),this.mesh.matrixAutoUpdate=!1,this.geometryNeedsUpdate=!0,this.repaint()}repaint(){this.geometryNeedsUpdate&&this.updateGeometry();const e=this.iLength,n=this.jLength,r=this.sliceAccess,i=this.volume,o=this.canvasBuffer,s=this.ctxBuffer,a=s.getImageData(0,0,e,n),l=a.data,c=i.data,u=i.upperThreshold,f=i.lowerThreshold,d=i.windowLow,h=i.windowHigh;let p=0;if(i.dataType==="label")for(let g=0;g=this.colorMap.length?v%this.colorMap.length+1:v;const y=this.colorMap[v];l[4*p]=y>>24&255,l[4*p+1]=y>>16&255,l[4*p+2]=y>>8&255,l[4*p+3]=y&255,p++}else for(let g=0;g=v&&f<=v?y:0,v=Math.floor(255*(v-d)/(h-d)),v=v>255?255:v<0?0:v|0,l[4*p]=v,l[4*p+1]=v,l[4*p+2]=v,l[4*p+3]=y,p++}s.putImageData(a,0,0),this.ctx.drawImage(o,0,0,e,n,0,0,this.canvas.width,this.canvas.height),this.mesh.material.map.needsUpdate=!0}updateGeometry(){const e=this.volume.extractPerpendicularPlane(this.axis,this.index);this.sliceAccess=e.sliceAccess,this.jLength=e.jLength,this.iLength=e.iLength,this.matrix=e.matrix,this.canvas.width=e.planeWidth,this.canvas.height=e.planeHeight,this.canvasBuffer.width=this.iLength,this.canvasBuffer.height=this.jLength,this.ctx=this.canvas.getContext("2d"),this.ctxBuffer=this.canvasBuffer.getContext("2d"),this.geometry&&this.geometry.dispose(),this.geometry=new a8(e.planeWidth,e.planeHeight),this.mesh&&(this.mesh.geometry=this.geometry,this.mesh.matrix.identity(),this.mesh.applyMatrix4(this.matrix)),this.geometryNeedsUpdate=!1}}class E9n{constructor(e,n,r,i,o){if(e!==void 0){switch(this.xLength=Number(e)||1,this.yLength=Number(n)||1,this.zLength=Number(r)||1,this.axisOrder=["x","y","z"],i){case"Uint8":case"uint8":case"uchar":case"unsigned char":case"uint8_t":this.data=new Uint8Array(o);break;case"Int8":case"int8":case"signed char":case"int8_t":this.data=new Int8Array(o);break;case"Int16":case"int16":case"short":case"short int":case"signed short":case"signed short int":case"int16_t":this.data=new Int16Array(o);break;case"Uint16":case"uint16":case"ushort":case"unsigned short":case"unsigned short int":case"uint16_t":this.data=new Uint16Array(o);break;case"Int32":case"int32":case"int":case"signed int":case"int32_t":this.data=new Int32Array(o);break;case"Uint32":case"uint32":case"uint":case"unsigned int":case"uint32_t":this.data=new Uint32Array(o);break;case"longlong":case"long long":case"long long int":case"signed long long":case"signed long long int":case"int64":case"int64_t":case"ulonglong":case"unsigned long long":case"unsigned long long int":case"uint64":case"uint64_t":throw new Error("Error in Volume constructor : this type is not supported in JavaScript");case"Float32":case"float32":case"float":this.data=new Float32Array(o);break;case"Float64":case"float64":case"double":this.data=new Float64Array(o);break;default:this.data=new Uint8Array(o)}if(this.data.length!==this.xLength*this.yLength*this.zLength)throw new Error("Error in Volume constructor, lengths are not matching arrayBuffer size")}this.spacing=[1,1,1],this.offset=[0,0,0],this.matrix=new fc,this.matrix.identity();let s=-1/0;Object.defineProperty(this,"lowerThreshold",{get:function(){return s},set:function(l){s=l,this.sliceList.forEach(function(c){c.geometryNeedsUpdate=!0})}});let a=1/0;Object.defineProperty(this,"upperThreshold",{get:function(){return a},set:function(l){a=l,this.sliceList.forEach(function(c){c.geometryNeedsUpdate=!0})}}),this.sliceList=[]}getData(e,n,r){return this.data[r*this.xLength*this.yLength+n*this.xLength+e]}access(e,n,r){return r*this.xLength*this.yLength+n*this.xLength+e}reverseAccess(e){const n=Math.floor(e/(this.yLength*this.xLength)),r=Math.floor((e-n*this.yLength*this.xLength)/this.xLength);return[e-n*this.yLength*this.xLength-r*this.xLength,r,n]}map(e,n){const r=this.data.length;n=n||this;for(let i=0;i.9}),x=[l,c,a].find(function(_){return Math.abs(_.dot(v[1]))>.9}),b=[l,c,a].find(function(_){return Math.abs(_.dot(v[2]))>.9});function w(_,S){const O=y===a?s:y.arglet==="i"?_:S,k=x===a?s:x.arglet==="i"?_:S,E=b===a?s:b.arglet==="i"?_:S,M=y.dot(v[0])>0?O:f.xLength-1-O,A=x.dot(v[1])>0?k:f.yLength-1-k,P=b.dot(v[2])>0?E:f.zLength-1-E;return f.access(M,A,P)}return{iLength:h,jLength:p,sliceAccess:w,matrix:u,planeWidth:g,planeHeight:m}}extractSlice(e,n){const r=new O9n(this,n,e);return this.sliceList.push(r),r}repaintAllSlices(){return this.sliceList.forEach(function(e){e.repaint()}),this}computeMinMax(){let e=1/0,n=-1/0;const r=this.data.length;let i=0;for(i=0;i0,o=!0,s={};function a(O,k){k==null&&(k=1);let E=1,M=Uint8Array;switch(O){case"uchar":break;case"schar":M=Int8Array;break;case"ushort":M=Uint16Array,E=2;break;case"sshort":M=Int16Array,E=2;break;case"uint":M=Uint32Array,E=4;break;case"sint":M=Int32Array,E=4;break;case"float":M=Float32Array,E=4;break;case"complex":M=Float64Array,E=8;break;case"double":M=Float64Array,E=8;break}let A=new M(n.slice(r,r+=k*E));return i!==o&&(A=l(A,E)),k===1?A[0]:A}function l(O,k){const E=new Uint8Array(O.buffer,O.byteOffset,O.byteLength);for(let M=0;MP;A--,P++){const T=E[P];E[P]=E[A],E[A]=T}return O}function c(O){let k,E,M,A,P,T,R,I;const B=O.split(/\r?\n/);for(R=0,I=B.length;R13)&&A!==32?M+=String.fromCharCode(A):(M!==""&&(R[I]=B(M,T),I++),M="");return M!==""&&(R[I]=B(M,T),I++),R}const f=a("uchar",e.byteLength),d=f.length;let h=null,p=0,g;for(g=1;gA[0]!==0),k=s.vectors.findIndex(A=>A[1]!==0),E=s.vectors.findIndex(A=>A[2]!==0),M=[];M[O]="x",M[k]="y",M[E]="z",m.axisOrder=M}else m.axisOrder=["x","y","z"];const b=new Ce().fromArray(s.vectors[0]).length(),w=new Ce().fromArray(s.vectors[1]).length(),_=new Ce().fromArray(s.vectors[2]).length();m.spacing=[b,w,_],m.matrix=new Wr;const S=new Wr;if(s.space==="left-posterior-superior"?S.set(-1,0,0,0,0,-1,0,0,0,0,1,0,0,0,0,1):s.space==="left-anterior-superior"&&S.set(1,0,0,0,0,1,0,0,0,0,-1,0,0,0,0,1),!s.vectors)m.matrix.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1);else{const O=s.vectors,k=new Wr().set(O[0][0],O[1][0],O[2][0],0,O[0][1],O[1][1],O[2][1],0,O[0][2],O[1][2],O[2][2],0,0,0,0,1);m.matrix=new Wr().multiplyMatrices(k,S)}return m.inverseMatrix=new Wr,m.inverseMatrix.copy(m.matrix).invert(),m.RASDimensions=new Ce(m.xLength,m.yLength,m.zLength).applyMatrix4(m.matrix).round().toArray().map(Math.abs),m.lowerThreshold===-1/0&&(m.lowerThreshold=y),m.upperThreshold===1/0&&(m.upperThreshold=x),m}parseChars(e,n,r){n===void 0&&(n=0),r===void 0&&(r=e.length);let i="",o;for(o=n;o{n.setVolume(f,Lk.getVolumeOptions(this.props)),SG[s]=f,a(s,{status:"ok"})},()=>{},f=>{f.response instanceof Response?f.response.json().then(d=>{const h=d.error,p=!!h&&h.message;h&&h.exception&&console.debug("exception:",h.exception),a(s,{status:"error",message:p||`${f}`})}):a(s,{status:"error",message:`${f}`})})}}}render(){const{volumeId:n}=this.props;let r,i;if(!n)r=[C.jsx(Jt,{variant:"subtitle2",children:"Cannot display 3D volume"},"subtitle2"),C.jsx(Jt,{variant:"body2",children:"To display a volume, a variable and a place that represents an area must be selected. Please note that the 3D volume rendering is still an experimental feature."},"body2")];else{const o=this.props.volumeStates[n];(!o||o.status==="error"||!SG[n])&&(i=[C.jsx(Vr,{onClick:this.handleLoadVolume,disabled:!!o&&o.status==="loading",children:ge.get("Load Volume Data")},"load"),C.jsx(Jt,{variant:"body2",children:ge.get("Please note that the 3D volume rendering is still an experimental feature.")},"note")]),o&&(o.status==="loading"?r=C.jsx(Y1,{style:{margin:10}}):o.status==="error"&&(r=C.jsx(Jt,{variant:"body2",color:"red",children:`Failed loading volume: ${o.message}`})))}return r&&(r=C.jsx("div",{style:pEe,children:r})),i&&(i=C.jsx("div",{style:pEe,children:i})),C.jsxs("div",{style:R9n,children:[i,r,C.jsx("canvas",{id:"VolumeCanvas-canvas",ref:this.canvasRef,style:A9n}),!r&&!i&&M9n]})}updateVolumeScene(){const n=this.canvasRef.current;if(n===null){this.volumeScene=null;return}let r;this.props.volumeId&&(r=SG[this.props.volumeId]);let i=!1;(this.volumeScene===null||this.volumeScene.canvas!==n)&&(this.volumeScene=new l9n(n),i=!0),i&&r?this.volumeScene.setVolume(r,Lk.getVolumeOptions(this.props)):this.volumeScene.setVolumeOptions(Lk.getVolumeOptions(this.props))}}function gEe(t){let e=Number.POSITIVE_INFINITY,n=Number.POSITIVE_INFINITY,r=Number.NEGATIVE_INFINITY,i=Number.NEGATIVE_INFINITY;for(const o of t){const s=o[0],a=o[1];e=Math.min(e,s),n=Math.min(n,a),r=Math.max(r,s),i=Math.max(i,a)}return[e,n,r,i]}function D9n(t){let[e,n,r,i]=t[0];for(const o of t.slice(1))e=Math.min(e,o[0]),n=Math.min(n,o[1]),r=Math.max(r,o[2]),i=Math.max(i,o[3]);return[e,n,r,i]}const cj={card:t=>({maxWidth:"100%",marginBottom:t.spacing(1),marginRight:t.spacing(1)}),info:t=>({marginRight:t.spacing(1)}),close:{marginLeft:"auto"},cardContent:{padding:8},isoEditor:{display:"flex",flexDirection:"row"},isoTextField:{minWidth:"16em",marginLeft:"1em"},isoSlider:{minWidth:200}},I9n=({selectedDataset:t,selectedVariable:e,selectedPlaceInfo:n,variableColorBar:r,volumeId:i,volumeRenderMode:o,setVolumeRenderMode:s,volumeStates:a,updateVolumeState:l,updateVariableVolume:c,serverUrl:u})=>{let f=.5;e&&(typeof e.volumeIsoThreshold=="number"?f=e.volumeIsoThreshold:f=.5*(e.colorBarMin+e.colorBarMax),typeof e.volumeRenderMode=="string"&&(o=e.volumeRenderMode));const d=p=>{c(t.id,e.name,r,o,p)},h=(p,g)=>{g!==null&&(s(g),e&&c(t.id,e.name,r,g,f))};return C.jsxs(LAe,{sx:cj.card,children:[C.jsx($Ae,{disableSpacing:!0,children:e&&C.jsxs(C.Fragment,{children:[C.jsxs(KC,{size:"small",exclusive:!0,value:o,onChange:h,children:[C.jsx(yr,{value:"mip",size:"small",children:C.jsx(Rt,{arrow:!0,title:"Maximum intensity projection",children:C.jsx("span",{children:"MIP"})})},"mip"),C.jsx(yr,{value:"aip",size:"small",children:C.jsx(Rt,{arrow:!0,title:"Average intensity projection",children:C.jsx("span",{children:"AIP"})})},"aip"),C.jsx(yr,{value:"iso",size:"small",children:C.jsx(Rt,{arrow:!0,title:"Iso-surface extraction",children:C.jsx("span",{children:"ISO"})})},"iso")]},0),o==="iso"&&C.jsx(L9n,{minValue:e.colorBarMin,maxValue:e.colorBarMax,value:f,setValue:d})]})}),C.jsx(FAe,{sx:cj.cardContent,children:C.jsx(Lk,{selectedDataset:t,selectedVariable:e,selectedPlaceInfo:n,variableColorBar:r,volumeRenderMode:o,volumeIsoThreshold:f,volumeId:i,volumeStates:a,updateVolumeState:l,serverUrl:u})})]})},L9n=({value:t,minValue:e,maxValue:n,setValue:r,disabled:i})=>{const[o,s]=de.useState(t),[a,l]=de.useState(""+t),[c,u]=de.useState(null);function f(g){const m=g.target.value||"";l(m);const v=parseFloat(m);Number.isNaN(v)?u("Not a number"):vn?u("Out of range"):u(null)}function d(g){if(g.key==="Enter"&&!c){const m=parseFloat(a);s(m),r(m)}}function h(g,m){s(m),l(m.toFixed(2))}function p(g,m){r(m)}return C.jsx(ui,{sx:cj.isoTextField,disabled:i,label:"Iso-Threshold",variant:"filled",size:"small",value:a,error:c!==null,onChange:f,onKeyPress:d,InputProps:{endAdornment:C.jsx(QC,{size:"small",sx:cj.isoSlider,min:e,max:n,value:o,step:(n-e)/20,onChange:h,onChangeCommitted:p})}})},$9n=t=>({locale:t.controlState.locale,selectedDataset:ho(t),selectedVariable:ja(t),selectedPlaceInfo:eR(t),variableColorBar:Bte(t),volumeRenderMode:t.controlState.volumeRenderMode,volumeId:r_t(t),volumeStates:t.controlState.volumeStates,serverUrl:ji(t).url}),F9n={setVolumeRenderMode:xKt,updateVolumeState:bKt,updateVariableVolume:KQt},N9n=Rn($9n,F9n)(I9n),z9n={info:C.jsx(yVe,{fontSize:"inherit"}),timeSeries:C.jsx(Mdn,{fontSize:"inherit"}),stats:C.jsx(Y8e,{fontSize:"inherit"}),volume:C.jsx(Rdn,{fontSize:"inherit"})},j9n={info:"Info",timeSeries:"Time-Series",stats:"Statistics",volume:"Volume"},L$={tabs:{minHeight:"34px"},tab:{padding:"5px 10px",textTransform:"none",fontWeight:"regular",minHeight:"32px"},tabBoxHeader:{borderBottom:1,borderColor:"divider",position:"sticky",top:0,zIndex:1100,backgroundColor:"background.paper"}},B9n=t=>({sidebarPanelId:t.controlState.sidebarPanelId}),U9n={setSidebarPanelId:Nae};function W9n({sidebarPanelId:t,setSidebarPanelId:e}){const n=iQt(),r=D.useMemo(()=>n.panels||[],[n]),i=D.useMemo(()=>r.reduce((s,a,l)=>(s.set(a.name,l),s),new Map),[r]),o=D.useCallback((s,a)=>{e(a);const l=i.get(a);typeof l=="number"&&HYt("panels",l,{visible:!0})},[i,e]);return C.jsxs(ot,{sx:{width:"100%"},children:[C.jsx(ot,{sx:L$.tabBoxHeader,children:C.jsxs(Ree,{value:t,onChange:o,variant:"scrollable",sx:L$.tabs,children:[lwt.map(s=>C.jsx(SS,{icon:z9n[s],iconPosition:"start",sx:L$.tab,disableRipple:!0,value:s,label:ge.get(j9n[s])},s)),r.map(s=>C.jsx(SS,{sx:L$.tab,disableRipple:!0,value:s.name,label:s.container.title},s.name))]})}),t==="info"&&C.jsx(j1n,{}),t==="stats"&&C.jsx(tBn,{}),t==="timeSeries"&&C.jsx(B4n,{}),t==="volume"&&C.jsx(N9n,{}),r.map((s,a)=>t===s.name&&C.jsx(Ddn,{contribution:s,panelIndex:a},s.name))]})}const V9n=Rn(B9n,U9n)(W9n),$$={containerHor:{flexGrow:1,overflow:"hidden"},containerVer:{flexGrow:1,overflowX:"hidden",overflowY:"auto"},viewerHor:{height:"100%",overflow:"hidden",padding:0},viewerVer:{width:"100%",overflow:"hidden",padding:0},sidebarHor:{flex:"auto",overflowX:"hidden",overflowY:"auto"},sidebarVer:{width:"100%",overflow:"hidden"},viewer:{overflow:"hidden",width:"100%",height:"100%"}},G9n=t=>({sidebarOpen:t.controlState.sidebarOpen,sidebarPosition:t.controlState.sidebarPosition}),H9n={setSidebarPosition:yKt},mEe=()=>window.innerWidth/window.innerHeight>=1?"hor":"ver";function q9n({sidebarOpen:t,sidebarPosition:e,setSidebarPosition:n}){const[r,i]=D.useState(null),[o,s]=D.useState(mEe()),a=D.useRef(null),l=Na();D.useEffect(()=>(c(),a.current=new ResizeObserver(c),a.current.observe(document.documentElement),()=>{a.current&&a.current.disconnect()}),[]),D.useEffect(()=>{r&&r.updateSize()},[r,e]);const c=()=>{s(mEe())},u=o==="hor"?"Hor":"Ver";return t?C.jsxs(dfn,{dir:o,splitPosition:e,setSplitPosition:n,style:$$["container"+u],child1Style:$$["viewer"+u],child2Style:$$["sidebar"+u],children:[C.jsx(k1e,{onMapRef:i,theme:l}),C.jsx(V9n,{})]}):C.jsx("div",{style:$$.viewer,children:C.jsx(k1e,{onMapRef:i,theme:l})})}const X9n=Rn(G9n,H9n)(q9n);var u8={exports:{}},GXe={};function HXe(t){var e,n,r="";if(typeof t=="string"||typeof t=="number")r+=t;else if(typeof t=="object")if(Array.isArray(t))for(e=0;e0&&arguments[0]!==void 0?arguments[0]:"transform";if(typeof window>"u")return"";const n=(t=window.document)===null||t===void 0||(t=t.documentElement)===null||t===void 0?void 0:t.style;if(!n||e in n)return"";for(let r=0;re===n.identifier)||t.changedTouches&&(0,yc.findInArray)(t.changedTouches,n=>e===n.identifier)}function m7n(t){if(t.targetTouches&&t.targetTouches[0])return t.targetTouches[0].identifier;if(t.changedTouches&&t.changedTouches[0])return t.changedTouches[0].identifier}function v7n(t){if(!t)return;let e=t.getElementById("react-draggable-style-el");e||(e=t.createElement("style"),e.type="text/css",e.id="react-draggable-style-el",e.innerHTML=`.react-draggable-transparent-selection *::-moz-selection {all: inherit;} + }`};function JVn(){try{const t=document.createElement("canvas");return!!(window.WebGL2RenderingContext&&t.getContext("webgl2"))}catch{return!1}}class e9n{constructor(){gn(this,"textures");this.textures={}}get(e,n){const r=lN(e);let i=this.textures[r];return i||(i=new YVn().load(`data:image/png;base64,${e.imageData}`,n),this.textures[r]=i),i}}const t9n=new e9n;class n9n{constructor(e){gn(this,"canvas");gn(this,"camera");gn(this,"renderer");gn(this,"scene");gn(this,"material");if(!JVn())throw new Error("Missing WebGL2");this.render=this.render.bind(this);const n=new cYe({canvas:e});n.setPixelRatio(window.devicePixelRatio),n.setSize(e.clientWidth,e.clientHeight);const r=100,i=e.clientWidth/e.clientHeight,o=new iYe(-r*i,r*i,r,-r,-1e3,1e3);o.position.set(0,0,100),o.up.set(0,1,0);const s=new KVn(o,n.domElement);s.target.set(100,50,0),s.minZoom=.1,s.maxZoom=500,s.enablePan=!0,s.update(),this.canvas=e,this.renderer=n,this.camera=o,this.scene=null,this.material=null,s.addEventListener("change",this.render),e.addEventListener("resize",this.onCanvasResize)}setVolume(e,n){const r=new XXe(e.data,e.xLength,e.yLength,e.zLength);r.format=UXe,r.type=Ov,r.minFilter=r.magFilter=el,r.unpackAlignment=1,r.needsUpdate=!0;const i=ZVn,o=JXe.clone(i.uniforms),[s,a,l]=e.spacing,c=Math.floor(s*e.xLength),u=Math.floor(a*e.yLength),f=Math.floor(l*e.zLength);o.u_data.value=r,o.u_size.value.set(c,u,f);const d=new Ey({uniforms:o,vertexShader:i.vertexShader,fragmentShader:i.fragmentShader,side:mc}),h=new pE(c,u,f);h.translate(c/2,u/2,f/2);const p=new ih(h,d),g=new BVn;g.add(p),g.add(new QVn(p)),this.scene=g,this.material=d,this.setVolumeOptions(n)}setVolumeOptions(e){const n=this.material;if(n!==null){const{value1:r,value2:i,isoThreshold:o,renderMode:s,colorBar:a}=e,l=n.uniforms;l.u_clim.value.set(r,i),l.u_renderthreshold.value=o,l.u_renderstyle.value=s==="mip"?0:s==="aip"?1:2,l.u_cmdata.value=t9n.get(a,this.render),this.render()}}getMaterial(){if(this.material===null)throw new Error("Volume not set!");return this.material}onCanvasResize(){console.warn("Alarm: Canvas resize!");const e=this.renderer.domElement;this.renderer.setSize(e.clientWidth,e.clientHeight);const n=e.clientWidth/e.clientHeight,r=this.camera.top-this.camera.bottom;this.camera.left=-r*n/2,this.camera.right=r*n/2,this.camera.updateProjectionMatrix(),this.render()}render(){this.scene!==null&&this.renderer.render(this.scene,this.camera)}}var rc=Uint8Array,Cx=Uint16Array,fYe=Uint32Array,dYe=new rc([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),hYe=new rc([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),r9n=new rc([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),pYe=function(t,e){for(var n=new Cx(31),r=0;r<31;++r)n[r]=e+=1<>>1|(ni&21845)<<1;Em=(Em&52428)>>>2|(Em&13107)<<2,Em=(Em&61680)>>>4|(Em&3855)<<4,rJ[ni]=((Em&65280)>>>8|(Em&255)<<8)>>>1}var Dk=function(t,e,n){for(var r=t.length,i=0,o=new Cx(e);i>>l]=c}else for(a=new Cx(r),i=0;i>>15-t[i]);return a},SD=new rc(288);for(var ni=0;ni<144;++ni)SD[ni]=8;for(var ni=144;ni<256;++ni)SD[ni]=9;for(var ni=256;ni<280;++ni)SD[ni]=7;for(var ni=280;ni<288;++ni)SD[ni]=8;var vYe=new rc(32);for(var ni=0;ni<32;++ni)vYe[ni]=5;var a9n=Dk(SD,9,1),l9n=Dk(vYe,5,1),$G=function(t){for(var e=t[0],n=1;ne&&(e=t[n]);return e},nf=function(t,e,n){var r=e/8|0;return(t[r]|t[r+1]<<8)>>(e&7)&n},FG=function(t,e){var n=e/8|0;return(t[n]|t[n+1]<<8|t[n+2]<<16)>>(e&7)},c9n=function(t){return(t+7)/8|0},u9n=function(t,e,n){(n==null||n>t.length)&&(n=t.length);var r=new(t.BYTES_PER_ELEMENT==2?Cx:t.BYTES_PER_ELEMENT==4?fYe:rc)(n-e);return r.set(t.subarray(e,n)),r},f9n=["unexpected EOF","invalid block type","invalid length/literal","invalid distance","stream finished","no stream handler",,"no callback","invalid UTF-8 data","extra field too long","date not in range 1980-2099","filename too long","stream finishing","invalid zip data"],Ap=function(t,e,n){var r=new Error(e||f9n[t]);if(r.code=t,Error.captureStackTrace&&Error.captureStackTrace(r,Ap),!n)throw r;return r},d9n=function(t,e,n){var r=t.length;if(!r||n&&n.f&&!n.l)return e||new rc(0);var i=!e||n,o=!n||n.i;n||(n={}),e||(e=new rc(r*3));var s=function(Y){var le=e.length;if(Y>le){var K=new rc(Math.max(le*2,Y));K.set(e),e=K}},a=n.f||0,l=n.p||0,c=n.b||0,u=n.l,f=n.d,d=n.m,h=n.n,p=r*8;do{if(!u){a=nf(t,l,1);var g=nf(t,l+1,3);if(l+=3,g)if(g==1)u=a9n,f=l9n,d=9,h=5;else if(g==2){var x=nf(t,l,31)+257,b=nf(t,l+10,15)+4,w=x+nf(t,l+5,31)+1;l+=14;for(var _=new rc(w),S=new rc(19),O=0;O>>4;if(m<16)_[O++]=m;else{var R=0,T=0;for(m==16?(T=3+nf(t,l,3),l+=2,R=_[O-1]):m==17?(T=3+nf(t,l,7),l+=3):m==18&&(T=11+nf(t,l,127),l+=7);T--;)_[O++]=R}}var M=_.subarray(0,x),I=_.subarray(x);d=$G(M),h=$G(I),u=Dk(M,d,1),f=Dk(I,h,1)}else Ap(1);else{var m=c9n(l)+4,v=t[m-4]|t[m-3]<<8,y=m+v;if(y>r){o&&Ap(0);break}i&&s(c+v),e.set(t.subarray(m,y),c),n.b=c+=v,n.p=l=y*8,n.f=a;continue}if(l>p){o&&Ap(0);break}}i&&s(c+131072);for(var j=(1<>>4;if(l+=R&15,l>p){o&&Ap(0);break}if(R||Ap(2),L<256)e[c++]=L;else if(L==256){z=l,u=null;break}else{var B=L-254;if(L>264){var O=L-257,F=dYe[O];B=nf(t,l,(1<>>4;$||Ap(3),l+=$&15;var I=s9n[q];if(q>3){var F=hYe[q];I+=FG(t,l)&(1<p){o&&Ap(0);break}i&&s(c+131072);for(var G=c+B;c>3&1)+(e>>4&1);r>0;r-=!t[n++]);return n+(e&2)},g9n=function(t){var e=t.length;return(t[e-4]|t[e-3]<<8|t[e-2]<<16|t[e-1]<<24)>>>0};function m9n(t,e){return d9n(t.subarray(p9n(t),-8),new rc(g9n(t)))}var v9n=typeof TextDecoder<"u"&&new TextDecoder,y9n=0;try{v9n.decode(h9n,{stream:!0}),y9n=1}catch{}class x9n{constructor(e,n,r){const i=this;this.volume=e,n=n||0,Object.defineProperty(this,"index",{get:function(){return n},set:function(a){return n=a,i.geometryNeedsUpdate=!0,n}}),this.axis=r||"z",this.canvas=document.createElement("canvas"),this.canvasBuffer=document.createElement("canvas"),this.updateGeometry();const o=new kc(this.canvas);o.minFilter=el,o.wrapS=o.wrapT=eu;const s=new eue({map:o,side:Zp,transparent:!0});this.mesh=new ih(this.geometry,s),this.mesh.matrixAutoUpdate=!1,this.geometryNeedsUpdate=!0,this.repaint()}repaint(){this.geometryNeedsUpdate&&this.updateGeometry();const e=this.iLength,n=this.jLength,r=this.sliceAccess,i=this.volume,o=this.canvasBuffer,s=this.ctxBuffer,a=s.getImageData(0,0,e,n),l=a.data,c=i.data,u=i.upperThreshold,f=i.lowerThreshold,d=i.windowLow,h=i.windowHigh;let p=0;if(i.dataType==="label")for(let g=0;g=this.colorMap.length?v%this.colorMap.length+1:v;const y=this.colorMap[v];l[4*p]=y>>24&255,l[4*p+1]=y>>16&255,l[4*p+2]=y>>8&255,l[4*p+3]=y&255,p++}else for(let g=0;g=v&&f<=v?y:0,v=Math.floor(255*(v-d)/(h-d)),v=v>255?255:v<0?0:v|0,l[4*p]=v,l[4*p+1]=v,l[4*p+2]=v,l[4*p+3]=y,p++}s.putImageData(a,0,0),this.ctx.drawImage(o,0,0,e,n,0,0,this.canvas.width,this.canvas.height),this.mesh.material.map.needsUpdate=!0}updateGeometry(){const e=this.volume.extractPerpendicularPlane(this.axis,this.index);this.sliceAccess=e.sliceAccess,this.jLength=e.jLength,this.iLength=e.iLength,this.matrix=e.matrix,this.canvas.width=e.planeWidth,this.canvas.height=e.planeHeight,this.canvasBuffer.width=this.iLength,this.canvasBuffer.height=this.jLength,this.ctx=this.canvas.getContext("2d"),this.ctxBuffer=this.canvasBuffer.getContext("2d"),this.geometry&&this.geometry.dispose(),this.geometry=new a8(e.planeWidth,e.planeHeight),this.mesh&&(this.mesh.geometry=this.geometry,this.mesh.matrix.identity(),this.mesh.applyMatrix4(this.matrix)),this.geometryNeedsUpdate=!1}}class b9n{constructor(e,n,r,i,o){if(e!==void 0){switch(this.xLength=Number(e)||1,this.yLength=Number(n)||1,this.zLength=Number(r)||1,this.axisOrder=["x","y","z"],i){case"Uint8":case"uint8":case"uchar":case"unsigned char":case"uint8_t":this.data=new Uint8Array(o);break;case"Int8":case"int8":case"signed char":case"int8_t":this.data=new Int8Array(o);break;case"Int16":case"int16":case"short":case"short int":case"signed short":case"signed short int":case"int16_t":this.data=new Int16Array(o);break;case"Uint16":case"uint16":case"ushort":case"unsigned short":case"unsigned short int":case"uint16_t":this.data=new Uint16Array(o);break;case"Int32":case"int32":case"int":case"signed int":case"int32_t":this.data=new Int32Array(o);break;case"Uint32":case"uint32":case"uint":case"unsigned int":case"uint32_t":this.data=new Uint32Array(o);break;case"longlong":case"long long":case"long long int":case"signed long long":case"signed long long int":case"int64":case"int64_t":case"ulonglong":case"unsigned long long":case"unsigned long long int":case"uint64":case"uint64_t":throw new Error("Error in Volume constructor : this type is not supported in JavaScript");case"Float32":case"float32":case"float":this.data=new Float32Array(o);break;case"Float64":case"float64":case"double":this.data=new Float64Array(o);break;default:this.data=new Uint8Array(o)}if(this.data.length!==this.xLength*this.yLength*this.zLength)throw new Error("Error in Volume constructor, lengths are not matching arrayBuffer size")}this.spacing=[1,1,1],this.offset=[0,0,0],this.matrix=new cc,this.matrix.identity();let s=-1/0;Object.defineProperty(this,"lowerThreshold",{get:function(){return s},set:function(l){s=l,this.sliceList.forEach(function(c){c.geometryNeedsUpdate=!0})}});let a=1/0;Object.defineProperty(this,"upperThreshold",{get:function(){return a},set:function(l){a=l,this.sliceList.forEach(function(c){c.geometryNeedsUpdate=!0})}}),this.sliceList=[]}getData(e,n,r){return this.data[r*this.xLength*this.yLength+n*this.xLength+e]}access(e,n,r){return r*this.xLength*this.yLength+n*this.xLength+e}reverseAccess(e){const n=Math.floor(e/(this.yLength*this.xLength)),r=Math.floor((e-n*this.yLength*this.xLength)/this.xLength);return[e-n*this.yLength*this.xLength-r*this.xLength,r,n]}map(e,n){const r=this.data.length;n=n||this;for(let i=0;i.9}),x=[l,c,a].find(function(_){return Math.abs(_.dot(v[1]))>.9}),b=[l,c,a].find(function(_){return Math.abs(_.dot(v[2]))>.9});function w(_,S){const O=y===a?s:y.arglet==="i"?_:S,k=x===a?s:x.arglet==="i"?_:S,E=b===a?s:b.arglet==="i"?_:S,P=y.dot(v[0])>0?O:f.xLength-1-O,A=x.dot(v[1])>0?k:f.yLength-1-k,R=b.dot(v[2])>0?E:f.zLength-1-E;return f.access(P,A,R)}return{iLength:h,jLength:p,sliceAccess:w,matrix:u,planeWidth:g,planeHeight:m}}extractSlice(e,n){const r=new x9n(this,n,e);return this.sliceList.push(r),r}repaintAllSlices(){return this.sliceList.forEach(function(e){e.repaint()}),this}computeMinMax(){let e=1/0,n=-1/0;const r=this.data.length;let i=0;for(i=0;i0,o=!0,s={};function a(O,k){k==null&&(k=1);let E=1,P=Uint8Array;switch(O){case"uchar":break;case"schar":P=Int8Array;break;case"ushort":P=Uint16Array,E=2;break;case"sshort":P=Int16Array,E=2;break;case"uint":P=Uint32Array,E=4;break;case"sint":P=Int32Array,E=4;break;case"float":P=Float32Array,E=4;break;case"complex":P=Float64Array,E=8;break;case"double":P=Float64Array,E=8;break}let A=new P(n.slice(r,r+=k*E));return i!==o&&(A=l(A,E)),k===1?A[0]:A}function l(O,k){const E=new Uint8Array(O.buffer,O.byteOffset,O.byteLength);for(let P=0;PR;A--,R++){const T=E[R];E[R]=E[A],E[A]=T}return O}function c(O){let k,E,P,A,R,T,M,I;const j=O.split(/\r?\n/);for(M=0,I=j.length;M13)&&A!==32?P+=String.fromCharCode(A):(P!==""&&(M[I]=j(P,T),I++),P="");return P!==""&&(M[I]=j(P,T),I++),M}const f=a("uchar",e.byteLength),d=f.length;let h=null,p=0,g;for(g=1;gA[0]!==0),k=s.vectors.findIndex(A=>A[1]!==0),E=s.vectors.findIndex(A=>A[2]!==0),P=[];P[O]="x",P[k]="y",P[E]="z",m.axisOrder=P}else m.axisOrder=["x","y","z"];const b=new Ce().fromArray(s.vectors[0]).length(),w=new Ce().fromArray(s.vectors[1]).length(),_=new Ce().fromArray(s.vectors[2]).length();m.spacing=[b,w,_],m.matrix=new Wr;const S=new Wr;if(s.space==="left-posterior-superior"?S.set(-1,0,0,0,0,-1,0,0,0,0,1,0,0,0,0,1):s.space==="left-anterior-superior"&&S.set(1,0,0,0,0,1,0,0,0,0,-1,0,0,0,0,1),!s.vectors)m.matrix.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1);else{const O=s.vectors,k=new Wr().set(O[0][0],O[1][0],O[2][0],0,O[0][1],O[1][1],O[2][1],0,O[0][2],O[1][2],O[2][2],0,0,0,0,1);m.matrix=new Wr().multiplyMatrices(k,S)}return m.inverseMatrix=new Wr,m.inverseMatrix.copy(m.matrix).invert(),m.RASDimensions=new Ce(m.xLength,m.yLength,m.zLength).applyMatrix4(m.matrix).round().toArray().map(Math.abs),m.lowerThreshold===-1/0&&(m.lowerThreshold=y),m.upperThreshold===1/0&&(m.upperThreshold=x),m}parseChars(e,n,r){n===void 0&&(n=0),r===void 0&&(r=e.length);let i="",o;for(o=n;o{n.setVolume(f,Ik.getVolumeOptions(this.props)),NG[s]=f,a(s,{status:"ok"})},()=>{},f=>{f.response instanceof Response?f.response.json().then(d=>{const h=d.error,p=!!h&&h.message;h&&h.exception&&console.debug("exception:",h.exception),a(s,{status:"error",message:p||`${f}`})}):a(s,{status:"error",message:`${f}`})})}}}render(){const{volumeId:n}=this.props;let r,i;if(!n)r=[C.jsx(Jt,{variant:"subtitle2",children:"Cannot display 3D volume"},"subtitle2"),C.jsx(Jt,{variant:"body2",children:"To display a volume, a variable and a place that represents an area must be selected. Please note that the 3D volume rendering is still an experimental feature."},"body2")];else{const o=this.props.volumeStates[n];(!o||o.status==="error"||!NG[n])&&(i=[C.jsx(Vr,{onClick:this.handleLoadVolume,disabled:!!o&&o.status==="loading",children:me.get("Load Volume Data")},"load"),C.jsx(Jt,{variant:"body2",children:me.get("Please note that the 3D volume rendering is still an experimental feature.")},"note")]),o&&(o.status==="loading"?r=C.jsx(Dy,{style:{margin:10}}):o.status==="error"&&(r=C.jsx(Jt,{variant:"body2",color:"red",children:`Failed loading volume: ${o.message}`})))}return r&&(r=C.jsx("div",{style:BEe,children:r})),i&&(i=C.jsx("div",{style:BEe,children:i})),C.jsxs("div",{style:E9n,children:[i,r,C.jsx("canvas",{id:"VolumeCanvas-canvas",ref:this.canvasRef,style:S9n}),!r&&!i&&O9n]})}updateVolumeScene(){const n=this.canvasRef.current;if(n===null){this.volumeScene=null;return}let r;this.props.volumeId&&(r=NG[this.props.volumeId]);let i=!1;(this.volumeScene===null||this.volumeScene.canvas!==n)&&(this.volumeScene=new n9n(n),i=!0),i&&r?this.volumeScene.setVolume(r,Ik.getVolumeOptions(this.props)):this.volumeScene.setVolumeOptions(Ik.getVolumeOptions(this.props))}}function UEe(t){let e=Number.POSITIVE_INFINITY,n=Number.POSITIVE_INFINITY,r=Number.NEGATIVE_INFINITY,i=Number.NEGATIVE_INFINITY;for(const o of t){const s=o[0],a=o[1];e=Math.min(e,s),n=Math.min(n,a),r=Math.max(r,s),i=Math.max(i,a)}return[e,n,r,i]}function T9n(t){let[e,n,r,i]=t[0];for(const o of t.slice(1))e=Math.min(e,o[0]),n=Math.min(n,o[1]),r=Math.max(r,o[2]),i=Math.max(i,o[3]);return[e,n,r,i]}const oj={card:t=>({maxWidth:"100%",marginBottom:t.spacing(1),marginRight:t.spacing(1)}),info:t=>({marginRight:t.spacing(1)}),close:{marginLeft:"auto"},cardContent:{padding:8},isoEditor:{display:"flex",flexDirection:"row"},isoTextField:{minWidth:"16em",marginLeft:"1em"},isoSlider:{minWidth:200}},k9n=({selectedDataset:t,selectedVariable:e,selectedPlaceInfo:n,variableColorBar:r,volumeId:i,volumeRenderMode:o,setVolumeRenderMode:s,volumeStates:a,updateVolumeState:l,updateVariableVolume:c,serverUrl:u})=>{let f=.5;e&&(typeof e.volumeIsoThreshold=="number"?f=e.volumeIsoThreshold:f=.5*(e.colorBarMin+e.colorBarMax),typeof e.volumeRenderMode=="string"&&(o=e.volumeRenderMode));const d=p=>{c(t.id,e.name,r,o,p)},h=(p,g)=>{g!==null&&(s(g),e&&c(t.id,e.name,r,g,f))};return C.jsxs(lPe,{sx:oj.card,children:[C.jsx(cPe,{disableSpacing:!0,children:e&&C.jsxs(C.Fragment,{children:[C.jsxs(QC,{size:"small",exclusive:!0,value:o,onChange:h,children:[C.jsx(yr,{value:"mip",size:"small",children:C.jsx(Lt,{arrow:!0,title:"Maximum intensity projection",children:C.jsx("span",{children:"MIP"})})},"mip"),C.jsx(yr,{value:"aip",size:"small",children:C.jsx(Lt,{arrow:!0,title:"Average intensity projection",children:C.jsx("span",{children:"AIP"})})},"aip"),C.jsx(yr,{value:"iso",size:"small",children:C.jsx(Lt,{arrow:!0,title:"Iso-surface extraction",children:C.jsx("span",{children:"ISO"})})},"iso")]},0),o==="iso"&&C.jsx(A9n,{minValue:e.colorBarMin,maxValue:e.colorBarMax,value:f,setValue:d})]})}),C.jsx(uPe,{sx:oj.cardContent,children:C.jsx(Ik,{selectedDataset:t,selectedVariable:e,selectedPlaceInfo:n,variableColorBar:r,volumeRenderMode:o,volumeIsoThreshold:f,volumeId:i,volumeStates:a,updateVolumeState:l,serverUrl:u})})]})},A9n=({value:t,minValue:e,maxValue:n,setValue:r,disabled:i})=>{const[o,s]=de.useState(t),[a,l]=de.useState(""+t),[c,u]=de.useState(null);function f(g){const m=g.target.value||"";l(m);const v=parseFloat(m);Number.isNaN(v)?u("Not a number"):vn?u("Out of range"):u(null)}function d(g){if(g.key==="Enter"&&!c){const m=parseFloat(a);s(m),r(m)}}function h(g,m){s(m),l(m.toFixed(2))}function p(g,m){r(m)}return C.jsx(di,{sx:oj.isoTextField,disabled:i,label:"Iso-Threshold",variant:"filled",size:"small",value:a,error:c!==null,onChange:f,onKeyPress:d,InputProps:{endAdornment:C.jsx(YC,{size:"small",sx:oj.isoSlider,min:e,max:n,value:o,step:(n-e)/20,onChange:h,onChangeCommitted:p})}})},P9n=t=>({locale:t.controlState.locale,selectedDataset:fo(t),selectedVariable:Na(t),selectedPlaceInfo:JM(t),variableColorBar:ine(t),volumeRenderMode:t.controlState.volumeRenderMode,volumeId:v_t(t),volumeStates:t.controlState.volumeStates,serverUrl:Oo(t).url}),M9n={setVolumeRenderMode:pKt,updateVolumeState:gKt,updateVariableVolume:HQt},R9n=Rn(P9n,M9n)(k9n),D9n={info:C.jsx(GVe,{fontSize:"inherit"}),timeSeries:C.jsx(Odn,{fontSize:"inherit"}),stats:C.jsx(_We,{fontSize:"inherit"}),volume:C.jsx(Edn,{fontSize:"inherit"})},I9n={info:"Info",timeSeries:"Time-Series",stats:"Statistics",volume:"Volume"},M$={tabs:{minHeight:"34px"},tab:{padding:"5px 10px",textTransform:"none",fontWeight:"regular",minHeight:"32px"},tabBoxHeader:{borderBottom:1,borderColor:"divider",position:"sticky",top:0,zIndex:1100,backgroundColor:"background.paper"}},L9n=t=>({sidebarPanelId:t.controlState.sidebarPanelId}),$9n={setSidebarPanelId:nle};function F9n({sidebarPanelId:t,setSidebarPanelId:e}){const n=KYt(),r=D.useMemo(()=>n.panels||[],[n]),i=D.useMemo(()=>r.reduce((s,a,l)=>(s.set(a.name,l),s),new Map),[r]),o=D.useCallback((s,a)=>{e(a);const l=i.get(a);typeof l=="number"&&GYt("panels",l,{visible:!0})},[i,e]);return C.jsxs(ot,{sx:{width:"100%"},children:[C.jsx(ot,{sx:M$.tabBoxHeader,children:C.jsxs(Xee,{value:t,onChange:o,variant:"scrollable",sx:M$.tabs,children:[hwt.map(s=>C.jsx(SS,{icon:D9n[s],iconPosition:"start",sx:M$.tab,disableRipple:!0,value:s,label:me.get(I9n[s])},s)),r.map(s=>C.jsx(SS,{sx:M$.tab,disableRipple:!0,value:s.name,label:s.container.title},s.name))]})}),t==="info"&&C.jsx(Ibn,{}),t==="stats"&&C.jsx(Y4n,{}),t==="timeSeries"&&C.jsx(L4n,{}),t==="volume"&&C.jsx(R9n,{}),r.map((s,a)=>t===s.name&&C.jsx(Tdn,{contribution:s,panelIndex:a},s.name))]})}const N9n=Rn(L9n,$9n)(F9n),R$={containerHor:{flexGrow:1,overflow:"hidden"},containerVer:{flexGrow:1,overflowX:"hidden",overflowY:"auto"},viewerHor:{height:"100%",overflow:"hidden",padding:0},viewerVer:{width:"100%",overflow:"hidden",padding:0},sidebarHor:{flex:"auto",overflowX:"hidden",overflowY:"auto"},sidebarVer:{width:"100%",overflow:"hidden"},viewer:{overflow:"hidden",width:"100%",height:"100%"}},z9n=t=>({sidebarOpen:t.controlState.sidebarOpen,sidebarPosition:t.controlState.sidebarPosition}),j9n={setSidebarPosition:hKt},WEe=()=>window.innerWidth/window.innerHeight>=1?"hor":"ver";function B9n({sidebarOpen:t,sidebarPosition:e,setSidebarPosition:n}){const[r,i]=D.useState(null),[o,s]=D.useState(WEe()),a=D.useRef(null),l=$a();D.useEffect(()=>(c(),a.current=new ResizeObserver(c),a.current.observe(document.documentElement),()=>{a.current&&a.current.disconnect()}),[]),D.useEffect(()=>{r&&r.updateSize()},[r,e]);const c=()=>{s(WEe())},u=o==="hor"?"Hor":"Ver";return t?C.jsxs(sfn,{dir:o,splitPosition:e,setSplitPosition:n,style:R$["container"+u],child1Style:R$["viewer"+u],child2Style:R$["sidebar"+u],children:[C.jsx(t1e,{onMapRef:i,theme:l}),C.jsx(N9n,{})]}):C.jsx("div",{style:R$.viewer,children:C.jsx(t1e,{onMapRef:i,theme:l})})}const U9n=Rn(z9n,j9n)(B9n);var u8={exports:{}},yYe={};function xYe(t){var e,n,r="";if(typeof t=="string"||typeof t=="number")r+=t;else if(typeof t=="object")if(Array.isArray(t))for(e=0;e0&&arguments[0]!==void 0?arguments[0]:"transform";if(typeof window>"u")return"";const n=(t=window.document)===null||t===void 0||(t=t.documentElement)===null||t===void 0?void 0:t.style;if(!n||e in n)return"";for(let r=0;re===n.identifier)||t.changedTouches&&(0,vc.findInArray)(t.changedTouches,n=>e===n.identifier)}function u7n(t){if(t.targetTouches&&t.targetTouches[0])return t.targetTouches[0].identifier;if(t.changedTouches&&t.changedTouches[0])return t.changedTouches[0].identifier}function f7n(t){if(!t)return;let e=t.getElementById("react-draggable-style-el");e||(e=t.createElement("style"),e.type="text/css",e.id="react-draggable-style-el",e.innerHTML=`.react-draggable-transparent-selection *::-moz-selection {all: inherit;} `,e.innerHTML+=`.react-draggable-transparent-selection *::selection {all: inherit;} -`,t.getElementsByTagName("head")[0].appendChild(e)),t.body&&KXe(t.body,"react-draggable-transparent-selection")}function y7n(t){if(t)try{if(t.body&&ZXe(t.body,"react-draggable-transparent-selection"),t.selection)t.selection.empty();else{const e=(t.defaultView||window).getSelection();e&&e.type!=="Caret"&&e.removeAllRanges()}}catch{}}function KXe(t,e){t.classList?t.classList.add(e):t.className.match(new RegExp("(?:^|\\s)".concat(e,"(?!\\S)")))||(t.className+=" ".concat(e))}function ZXe(t,e){t.classList?t.classList.remove(e):t.className=t.className.replace(new RegExp("(?:^|\\s)".concat(e,"(?!\\S)"),"g"),"")}var op={};Object.defineProperty(op,"__esModule",{value:!0});op.canDragX=w7n;op.canDragY=_7n;op.createCoreData=C7n;op.createDraggableData=O7n;op.getBoundPosition=x7n;op.getControlPosition=S7n;op.snapToGrid=b7n;var Vl=ip,w_=Bi;function x7n(t,e,n){if(!t.props.bounds)return[e,n];let{bounds:r}=t.props;r=typeof r=="string"?r:E7n(r);const i=zce(t);if(typeof r=="string"){const{ownerDocument:o}=i,s=o.defaultView;let a;if(r==="parent"?a=i.parentNode:a=o.querySelector(r),!(a instanceof s.HTMLElement))throw new Error('Bounds selector "'+r+'" could not find an element.');const l=a,c=s.getComputedStyle(i),u=s.getComputedStyle(l);r={left:-i.offsetLeft+(0,Vl.int)(u.paddingLeft)+(0,Vl.int)(c.marginLeft),top:-i.offsetTop+(0,Vl.int)(u.paddingTop)+(0,Vl.int)(c.marginTop),right:(0,w_.innerWidth)(l)-(0,w_.outerWidth)(i)-i.offsetLeft+(0,Vl.int)(u.paddingRight)-(0,Vl.int)(c.marginRight),bottom:(0,w_.innerHeight)(l)-(0,w_.outerHeight)(i)-i.offsetTop+(0,Vl.int)(u.paddingBottom)-(0,Vl.int)(c.marginBottom)}}return(0,Vl.isNum)(r.right)&&(e=Math.min(e,r.right)),(0,Vl.isNum)(r.bottom)&&(n=Math.min(n,r.bottom)),(0,Vl.isNum)(r.left)&&(e=Math.max(e,r.left)),(0,Vl.isNum)(r.top)&&(n=Math.max(n,r.top)),[e,n]}function b7n(t,e,n){const r=Math.round(e/t[0])*t[0],i=Math.round(n/t[1])*t[1];return[r,i]}function w7n(t){return t.props.axis==="both"||t.props.axis==="x"}function _7n(t){return t.props.axis==="both"||t.props.axis==="y"}function S7n(t,e,n){const r=typeof e=="number"?(0,w_.getTouch)(t,e):null;if(typeof e=="number"&&!r)return null;const i=zce(n),o=n.props.offsetParent||i.offsetParent||i.ownerDocument.body;return(0,w_.offsetXYFromParent)(r||t,o,n.props.scale)}function C7n(t,e,n){const r=!(0,Vl.isNum)(t.lastX),i=zce(t);return r?{node:i,deltaX:0,deltaY:0,lastX:e,lastY:n,x:e,y:n}:{node:i,deltaX:e-t.lastX,deltaY:n-t.lastY,lastX:t.lastX,lastY:t.lastY,x:e,y:n}}function O7n(t,e){const n=t.props.scale;return{node:e.node,x:t.state.x+e.deltaX/n,y:t.state.y+e.deltaY/n,deltaX:e.deltaX/n,deltaY:e.deltaY/n,lastX:t.state.x,lastY:t.state.y}}function E7n(t){return{left:t.left,top:t.top,right:t.right,bottom:t.bottom}}function zce(t){const e=t.findDOMNode();if(!e)throw new Error(": Unmounted during event!");return e}var f8={},d8={};Object.defineProperty(d8,"__esModule",{value:!0});d8.default=T7n;function T7n(){}Object.defineProperty(f8,"__esModule",{value:!0});f8.default=void 0;var OG=A7n(D),Wa=jce(hM),k7n=jce(qC),Ds=Bi,Am=op,EG=ip,N2=jce(d8);function jce(t){return t&&t.__esModule?t:{default:t}}function JXe(t){if(typeof WeakMap!="function")return null;var e=new WeakMap,n=new WeakMap;return(JXe=function(r){return r?n:e})(t)}function A7n(t,e){if(t&&t.__esModule)return t;if(t===null||typeof t!="object"&&typeof t!="function")return{default:t};var n=JXe(e);if(n&&n.has(t))return n.get(t);var r={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in t)if(o!=="default"&&Object.prototype.hasOwnProperty.call(t,o)){var s=i?Object.getOwnPropertyDescriptor(t,o):null;s&&(s.get||s.set)?Object.defineProperty(r,o,s):r[o]=t[o]}return r.default=t,n&&n.set(t,r),r}function ha(t,e,n){return e=P7n(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function P7n(t){var e=M7n(t,"string");return typeof e=="symbol"?e:String(e)}function M7n(t,e){if(typeof t!="object"||t===null)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}const sf={touch:{start:"touchstart",move:"touchmove",stop:"touchend"},mouse:{start:"mousedown",move:"mousemove",stop:"mouseup"}};let Pm=sf.mouse,h8=class extends OG.Component{constructor(){super(...arguments),ha(this,"dragging",!1),ha(this,"lastX",NaN),ha(this,"lastY",NaN),ha(this,"touchIdentifier",null),ha(this,"mounted",!1),ha(this,"handleDragStart",e=>{if(this.props.onMouseDown(e),!this.props.allowAnyClick&&typeof e.button=="number"&&e.button!==0)return!1;const n=this.findDOMNode();if(!n||!n.ownerDocument||!n.ownerDocument.body)throw new Error(" not mounted on DragStart!");const{ownerDocument:r}=n;if(this.props.disabled||!(e.target instanceof r.defaultView.Node)||this.props.handle&&!(0,Ds.matchesSelectorAndParentsTo)(e.target,this.props.handle,n)||this.props.cancel&&(0,Ds.matchesSelectorAndParentsTo)(e.target,this.props.cancel,n))return;e.type==="touchstart"&&e.preventDefault();const i=(0,Ds.getTouchIdentifier)(e);this.touchIdentifier=i;const o=(0,Am.getControlPosition)(e,i,this);if(o==null)return;const{x:s,y:a}=o,l=(0,Am.createCoreData)(this,s,a);(0,N2.default)("DraggableCore: handleDragStart: %j",l),(0,N2.default)("calling",this.props.onStart),!(this.props.onStart(e,l)===!1||this.mounted===!1)&&(this.props.enableUserSelectHack&&(0,Ds.addUserSelectStyles)(r),this.dragging=!0,this.lastX=s,this.lastY=a,(0,Ds.addEvent)(r,Pm.move,this.handleDrag),(0,Ds.addEvent)(r,Pm.stop,this.handleDragStop))}),ha(this,"handleDrag",e=>{const n=(0,Am.getControlPosition)(e,this.touchIdentifier,this);if(n==null)return;let{x:r,y:i}=n;if(Array.isArray(this.props.grid)){let a=r-this.lastX,l=i-this.lastY;if([a,l]=(0,Am.snapToGrid)(this.props.grid,a,l),!a&&!l)return;r=this.lastX+a,i=this.lastY+l}const o=(0,Am.createCoreData)(this,r,i);if((0,N2.default)("DraggableCore: handleDrag: %j",o),this.props.onDrag(e,o)===!1||this.mounted===!1){try{this.handleDragStop(new MouseEvent("mouseup"))}catch{const l=document.createEvent("MouseEvents");l.initMouseEvent("mouseup",!0,!0,window,0,0,0,0,0,!1,!1,!1,!1,0,null),this.handleDragStop(l)}return}this.lastX=r,this.lastY=i}),ha(this,"handleDragStop",e=>{if(!this.dragging)return;const n=(0,Am.getControlPosition)(e,this.touchIdentifier,this);if(n==null)return;let{x:r,y:i}=n;if(Array.isArray(this.props.grid)){let l=r-this.lastX||0,c=i-this.lastY||0;[l,c]=(0,Am.snapToGrid)(this.props.grid,l,c),r=this.lastX+l,i=this.lastY+c}const o=(0,Am.createCoreData)(this,r,i);if(this.props.onStop(e,o)===!1||this.mounted===!1)return!1;const a=this.findDOMNode();a&&this.props.enableUserSelectHack&&(0,Ds.removeUserSelectStyles)(a.ownerDocument),(0,N2.default)("DraggableCore: handleDragStop: %j",o),this.dragging=!1,this.lastX=NaN,this.lastY=NaN,a&&((0,N2.default)("DraggableCore: Removing handlers"),(0,Ds.removeEvent)(a.ownerDocument,Pm.move,this.handleDrag),(0,Ds.removeEvent)(a.ownerDocument,Pm.stop,this.handleDragStop))}),ha(this,"onMouseDown",e=>(Pm=sf.mouse,this.handleDragStart(e))),ha(this,"onMouseUp",e=>(Pm=sf.mouse,this.handleDragStop(e))),ha(this,"onTouchStart",e=>(Pm=sf.touch,this.handleDragStart(e))),ha(this,"onTouchEnd",e=>(Pm=sf.touch,this.handleDragStop(e)))}componentDidMount(){this.mounted=!0;const e=this.findDOMNode();e&&(0,Ds.addEvent)(e,sf.touch.start,this.onTouchStart,{passive:!1})}componentWillUnmount(){this.mounted=!1;const e=this.findDOMNode();if(e){const{ownerDocument:n}=e;(0,Ds.removeEvent)(n,sf.mouse.move,this.handleDrag),(0,Ds.removeEvent)(n,sf.touch.move,this.handleDrag),(0,Ds.removeEvent)(n,sf.mouse.stop,this.handleDragStop),(0,Ds.removeEvent)(n,sf.touch.stop,this.handleDragStop),(0,Ds.removeEvent)(e,sf.touch.start,this.onTouchStart,{passive:!1}),this.props.enableUserSelectHack&&(0,Ds.removeUserSelectStyles)(n)}}findDOMNode(){var e,n;return(e=this.props)!==null&&e!==void 0&&e.nodeRef?(n=this.props)===null||n===void 0||(n=n.nodeRef)===null||n===void 0?void 0:n.current:k7n.default.findDOMNode(this)}render(){return OG.cloneElement(OG.Children.only(this.props.children),{onMouseDown:this.onMouseDown,onMouseUp:this.onMouseUp,onTouchEnd:this.onTouchEnd})}};f8.default=h8;ha(h8,"displayName","DraggableCore");ha(h8,"propTypes",{allowAnyClick:Wa.default.bool,children:Wa.default.node.isRequired,disabled:Wa.default.bool,enableUserSelectHack:Wa.default.bool,offsetParent:function(t,e){if(t[e]&&t[e].nodeType!==1)throw new Error("Draggable's offsetParent must be a DOM Node.")},grid:Wa.default.arrayOf(Wa.default.number),handle:Wa.default.string,cancel:Wa.default.string,nodeRef:Wa.default.object,onStart:Wa.default.func,onDrag:Wa.default.func,onStop:Wa.default.func,onMouseDown:Wa.default.func,scale:Wa.default.number,className:EG.dontSetMe,style:EG.dontSetMe,transform:EG.dontSetMe});ha(h8,"defaultProps",{allowAnyClick:!1,disabled:!1,enableUserSelectHack:!0,onStart:function(){},onDrag:function(){},onStop:function(){},onMouseDown:function(){},scale:1});(function(t){Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"DraggableCore",{enumerable:!0,get:function(){return l.default}}),t.default=void 0;var e=d(D),n=u(hM),r=u(qC),i=u(Q9n),o=Bi,s=op,a=ip,l=u(f8),c=u(d8);function u(y){return y&&y.__esModule?y:{default:y}}function f(y){if(typeof WeakMap!="function")return null;var x=new WeakMap,b=new WeakMap;return(f=function(w){return w?b:x})(y)}function d(y,x){if(y&&y.__esModule)return y;if(y===null||typeof y!="object"&&typeof y!="function")return{default:y};var b=f(x);if(b&&b.has(y))return b.get(y);var w={},_=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var S in y)if(S!=="default"&&Object.prototype.hasOwnProperty.call(y,S)){var O=_?Object.getOwnPropertyDescriptor(y,S):null;O&&(O.get||O.set)?Object.defineProperty(w,S,O):w[S]=y[S]}return w.default=y,b&&b.set(y,w),w}function h(){return h=Object.assign?Object.assign.bind():function(y){for(var x=1;x{if((0,c.default)("Draggable: onDragStart: %j",w),this.props.onStart(b,(0,s.createDraggableData)(this,w))===!1)return!1;this.setState({dragging:!0,dragged:!0})}),p(this,"onDrag",(b,w)=>{if(!this.state.dragging)return!1;(0,c.default)("Draggable: onDrag: %j",w);const _=(0,s.createDraggableData)(this,w),S={x:_.x,y:_.y,slackX:0,slackY:0};if(this.props.bounds){const{x:k,y:E}=S;S.x+=this.state.slackX,S.y+=this.state.slackY;const[M,A]=(0,s.getBoundPosition)(this,S.x,S.y);S.x=M,S.y=A,S.slackX=this.state.slackX+(k-S.x),S.slackY=this.state.slackY+(E-S.y),_.x=S.x,_.y=S.y,_.deltaX=S.x-this.state.x,_.deltaY=S.y-this.state.y}if(this.props.onDrag(b,_)===!1)return!1;this.setState(S)}),p(this,"onDragStop",(b,w)=>{if(!this.state.dragging||this.props.onStop(b,(0,s.createDraggableData)(this,w))===!1)return!1;(0,c.default)("Draggable: onDragStop: %j",w);const S={dragging:!1,slackX:0,slackY:0};if(!!this.props.position){const{x:k,y:E}=this.props.position;S.x=k,S.y=E}this.setState(S)}),this.state={dragging:!1,dragged:!1,x:x.position?x.position.x:x.defaultPosition.x,y:x.position?x.position.y:x.defaultPosition.y,prevPropsPosition:{...x.position},slackX:0,slackY:0,isElementSVG:!1},x.position&&!(x.onDrag||x.onStop)&&console.warn("A `position` was applied to this , without drag handlers. This will make this component effectively undraggable. Please attach `onDrag` or `onStop` handlers so you can adjust the `position` of this element.")}componentDidMount(){typeof window.SVGElement<"u"&&this.findDOMNode()instanceof window.SVGElement&&this.setState({isElementSVG:!0})}componentWillUnmount(){this.setState({dragging:!1})}findDOMNode(){var x,b;return(x=(b=this.props)===null||b===void 0||(b=b.nodeRef)===null||b===void 0?void 0:b.current)!==null&&x!==void 0?x:r.default.findDOMNode(this)}render(){const{axis:x,bounds:b,children:w,defaultPosition:_,defaultClassName:S,defaultClassNameDragging:O,defaultClassNameDragged:k,position:E,positionOffset:M,scale:A,...P}=this.props;let T={},R=null;const B=!!!E||this.state.dragging,$=E||_,z={x:(0,s.canDragX)(this)&&B?this.state.x:$.x,y:(0,s.canDragY)(this)&&B?this.state.y:$.y};this.state.isElementSVG?R=(0,o.createSVGTransform)(z,M):T=(0,o.createCSSTransform)(z,M);const L=(0,i.default)(w.props.className||"",S,{[O]:this.state.dragging,[k]:this.state.dragged});return e.createElement(l.default,h({},P,{onStart:this.onDragStart,onDrag:this.onDrag,onStop:this.onDragStop}),e.cloneElement(e.Children.only(w),{className:L,style:{...w.props.style,...T},transform:R}))}}t.default=v,p(v,"displayName","Draggable"),p(v,"propTypes",{...l.default.propTypes,axis:n.default.oneOf(["both","x","y","none"]),bounds:n.default.oneOfType([n.default.shape({left:n.default.number,right:n.default.number,top:n.default.number,bottom:n.default.number}),n.default.string,n.default.oneOf([!1])]),defaultClassName:n.default.string,defaultClassNameDragging:n.default.string,defaultClassNameDragged:n.default.string,defaultPosition:n.default.shape({x:n.default.number,y:n.default.number}),positionOffset:n.default.shape({x:n.default.oneOfType([n.default.number,n.default.string]),y:n.default.oneOfType([n.default.number,n.default.string])}),position:n.default.shape({x:n.default.number,y:n.default.number}),className:a.dontSetMe,style:a.dontSetMe,transform:a.dontSetMe}),p(v,"defaultProps",{...l.default.defaultProps,axis:"both",bounds:!1,defaultClassName:"react-draggable",defaultClassNameDragging:"react-draggable-dragging",defaultClassNameDragged:"react-draggable-dragged",defaultPosition:{x:0,y:0},scale:1})})(GXe);const{default:eYe,DraggableCore:R7n}=GXe;u8.exports=eYe;u8.exports.default=eYe;u8.exports.DraggableCore=R7n;var tYe=u8.exports;const D7n=on(tYe);var Bce={exports:{}},TD={},Uce={};Uce.__esModule=!0;Uce.cloneElement=z7n;var I7n=L7n(D);function L7n(t){return t&&t.__esModule?t:{default:t}}function xEe(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function bEe(t){for(var e=1;e=0)&&(n[i]=t[i]);return n}function wEe(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function TG(t){for(var e=1;eMath.abs(d*u)?o=i/u:i=o*u}var h=i,p=o,g=this.slack||[0,0],m=g[0],v=g[1];return i+=m,o+=v,a&&(i=Math.max(a[0],i),o=Math.max(a[1],o)),l&&(i=Math.min(l[0],i),o=Math.min(l[1],o)),this.slack=[m+(h-i),v+(p-o)],[i,o]},n.resizeHandler=function(i,o){var s=this;return function(a,l){var c=l.node,u=l.deltaX,f=l.deltaY;i==="onResizeStart"&&s.resetData();var d=(s.props.axis==="both"||s.props.axis==="x")&&o!=="n"&&o!=="s",h=(s.props.axis==="both"||s.props.axis==="y")&&o!=="e"&&o!=="w";if(!(!d&&!h)){var p=o[0],g=o[o.length-1],m=c.getBoundingClientRect();if(s.lastHandleRect!=null){if(g==="w"){var v=m.left-s.lastHandleRect.left;u+=v}if(p==="n"){var y=m.top-s.lastHandleRect.top;f+=y}}s.lastHandleRect=m,g==="w"&&(u=-u),p==="n"&&(f=-f);var x=s.props.width+(d?u/s.props.transformScale:0),b=s.props.height+(h?f/s.props.transformScale:0),w=s.runConstraints(x,b);x=w[0],b=w[1];var _=x!==s.props.width||b!==s.props.height,S=typeof s.props[i]=="function"?s.props[i]:null,O=i==="onResize"&&!_;S&&!O&&(a.persist==null||a.persist(),S(a,{node:c,size:{width:x,height:b},handle:o})),i==="onResizeStop"&&s.resetData()}}},n.renderResizeHandle=function(i,o){var s=this.props.handle;if(!s)return z2.createElement("span",{className:"react-resizable-handle react-resizable-handle-"+i,ref:o});if(typeof s=="function")return s(i,o);var a=typeof s.type=="string",l=TG({ref:o},a?{}:{handleAxis:i});return z2.cloneElement(s,l)},n.render=function(){var i=this,o=this.props,s=o.children,a=o.className,l=o.draggableOpts;o.width,o.height,o.handle,o.handleSize,o.lockAspectRatio,o.axis,o.minConstraints,o.maxConstraints,o.onResize,o.onResizeStop,o.onResizeStart;var c=o.resizeHandles;o.transformScale;var u=q7n(o,G7n);return(0,W7n.cloneElement)(s,TG(TG({},u),{},{className:(a?a+" ":"")+"react-resizable",children:[].concat(s.props.children,c.map(function(f){var d,h=(d=i.handleRefs[f])!=null?d:i.handleRefs[f]=z2.createRef();return z2.createElement(U7n.DraggableCore,UZ({},l,{nodeRef:h,key:"resizableHandle-"+f,onStop:i.resizeHandler("onResizeStop",f),onStart:i.resizeHandler("onResizeStart",f),onDrag:i.resizeHandler("onResize",f)}),i.renderResizeHandle(f,h))}))}))},e}(z2.Component);TD.default=Wce;Wce.propTypes=V7n.resizableProps;Wce.defaultProps={axis:"both",handleSize:[20,20],lockAspectRatio:!1,minConstraints:[20,20],maxConstraints:[1/0,1/0],resizeHandles:["se"],transformScale:1};var p8={};p8.__esModule=!0;p8.default=void 0;var kG=nGn(D),Z7n=rYe(hM),J7n=rYe(TD),eGn=kD,tGn=["handle","handleSize","onResize","onResizeStart","onResizeStop","draggableOpts","minConstraints","maxConstraints","lockAspectRatio","axis","width","height","resizeHandles","style","transformScale"];function rYe(t){return t&&t.__esModule?t:{default:t}}function iYe(t){if(typeof WeakMap!="function")return null;var e=new WeakMap,n=new WeakMap;return(iYe=function(i){return i?n:e})(t)}function nGn(t,e){if(t&&t.__esModule)return t;if(t===null||typeof t!="object"&&typeof t!="function")return{default:t};var n=iYe(e);if(n&&n.has(t))return n.get(t);var r={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in t)if(o!=="default"&&Object.prototype.hasOwnProperty.call(t,o)){var s=i?Object.getOwnPropertyDescriptor(t,o):null;s&&(s.get||s.set)?Object.defineProperty(r,o,s):r[o]=t[o]}return r.default=t,n&&n.set(t,r),r}function VZ(){return VZ=Object.assign?Object.assign.bind():function(t){for(var e=1;e=0)&&(n[i]=t[i]);return n}function aGn(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,GZ(t,e)}function GZ(t,e){return GZ=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},GZ(t,e)}var oYe=function(t){aGn(e,t);function e(){for(var r,i=arguments.length,o=new Array(i),s=0;sn(t,!i.visible)}),r?C.jsx(Oh,{}):C.jsx(Oh,{variant:"inset",component:"li",style:{margin:"0 0 0 52px"}})]})}const cGn={x:48,y:128},uGn={width:320,height:520},N$={resizeBox:{position:"absolute",zIndex:1e3},windowPaper:{width:"100%",height:"100%",display:"flex",flexDirection:"column"},windowHeader:t=>({display:"flex",justifyContent:"space-between",alignItems:"center",cursor:"move",padding:1,marginBottom:"2px",borderBottom:`1px solid ${t.palette.mode==="dark"?"#FFFFFF3F":"#0000003F"}`}),windowTitle:{fontWeight:"bolder"}};function fGn(t){const[e,n]=D.useState(cGn),[r,i]=D.useState(uGn),{layerMenuOpen:o,setLayerMenuOpen:s,openDialog:a,...l}=t;if(!o)return null;console.log("layerProps",l);const c=()=>{a("userOverlays")},u=()=>{a("userBaseMaps")},f=()=>{s(!1)},d=(p,g)=>{n({...g})},h=(p,g)=>{i({...g.size})};return C.jsx(D7n,{handle:"#layer-select-header",position:e,onStop:d,children:C.jsx(lGn,{width:r.width,height:r.height,style:N$.resizeBox,onResize:h,children:C.jsxs(Al,{elevation:10,sx:N$.windowPaper,component:"div",children:[C.jsxs(ot,{id:"layer-select-header",sx:N$.windowHeader,children:[C.jsx(ot,{component:"span",sx:N$.windowTitle,children:ge.get("Layers")}),C.jsx(Ht,{size:"small",onClick:f,children:C.jsx(VO,{fontSize:"inherit"})})]}),C.jsx(ot,{sx:{width:"100%",overflow:"auto",flexGrow:1},children:C.jsxs(_4,{dense:!0,children:[C.jsx(wp,{layerId:"overlay",...l}),C.jsx(wp,{layerId:"userPlaces",...l}),C.jsx(wp,{layerId:"datasetPlaces",...l}),C.jsx(wp,{layerId:"datasetBoundary",...l}),C.jsx(wp,{layerId:"datasetVariable",...l}),C.jsx(wp,{layerId:"datasetVariable2",...l}),C.jsx(wp,{layerId:"datasetRgb",...l}),C.jsx(wp,{layerId:"datasetRgb2",...l}),C.jsx(wp,{layerId:"baseMap",...l,last:!0}),C.jsx(_i,{onClick:u,children:ge.get("User Base Maps")+"..."}),C.jsx(_i,{onClick:c,children:ge.get("User Overlays")+"..."})]})})]})})})}const dGn=t=>({locale:t.controlState.locale,layerMenuOpen:t.controlState.layerMenuOpen,layerStates:I_t(t)}),hGn={openDialog:_b,setLayerMenuOpen:zUe,setLayerVisibility:uKt},pGn=Rn(dGn,hGn)(fGn),gGn=t=>({locale:t.controlState.locale,hasConsent:t.controlState.privacyNoticeAccepted,compact:wn.instance.branding.compact}),mGn={},vGn=be("main")(({theme:t})=>({padding:0,width:"100vw",height:"100vh",overflow:"hidden",display:"flex",flexDirection:"column",alignItems:"stretch",[t.breakpoints.up("md")]:{overflow:"hidden"}})),yGn=({hasConsent:t,compact:e})=>C.jsxs(vGn,{children:[!e&&C.jsx(C4,{variant:"dense"}),t&&C.jsxs(C.Fragment,{children:[C.jsx(ufn,{}),C.jsx(X9n,{}),C.jsx(pGn,{})]})]}),xGn=Rn(gGn,mGn)(yGn),bGn={icon:t=>({marginRight:t.spacing(2)})};function wGn({open:t,settings:e,updateSettings:n,syncWithServer:r}){const[i,o]=D.useState(null),{store:s}=D.useContext(Aj);if(D.useEffect(()=>{const c=ge.get("docs/privacy-note.en.md");fetch(c).then(u=>u.text()).then(u=>o(u))}),!t)return null;function a(){n({...e,privacyNoticeAccepted:!0}),r(s)}function l(){try{window.history.length>0?window.history.back():typeof window.home=="function"?window.home():window.location.href="about:home"}catch(c){console.error(c)}}return C.jsxs(ed,{open:t,disableEscapeKeyDown:!0,keepMounted:!0,scroll:"body",children:[C.jsx(Iy,{children:ge.get("Privacy Notice")}),C.jsx(zf,{children:C.jsx(eat,{children:i===null?C.jsx(Y1,{}):C.jsx(mU,{children:i,linkTarget:"_blank"})})}),C.jsxs(Q1,{children:[C.jsxs(Vr,{onClick:a,children:[C.jsx(sYe,{sx:bGn.icon}),ge.get("Accept and continue")]}),C.jsx(Vr,{onClick:l,children:ge.get("Leave")})]})]})}const _Gn=t=>({open:!t.controlState.privacyNoticeAccepted,settings:t.controlState}),SGn={updateSettings:ZR,syncWithServer:Iae},CGn=Rn(_Gn,SGn)(wGn),OGn=oa(Y1)(({theme:t})=>({margin:t.spacing(2)})),EGn=oa(Jt)(({theme:t})=>({margin:t.spacing(1)})),TGn=oa("div")(({theme:t})=>({margin:t.spacing(1),textAlign:"center",display:"flex",alignItems:"center",flexDirection:"column"}));function kGn({messages:t}){return t.length===0?null:C.jsxs(ed,{open:!0,"aria-labelledby":"loading",children:[C.jsx(Iy,{id:"loading",children:ge.get("Please wait...")}),C.jsxs(TGn,{children:[C.jsx(OGn,{}),t.map((e,n)=>C.jsx(EGn,{children:e},n))]})]})}const AGn=t=>({locale:t.controlState.locale,messages:A_t(t)}),PGn={},MGn=Rn(AGn,PGn)(kGn),RGn=lt(C.jsx("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m1 15h-2v-2h2zm0-4h-2V7h2z"}),"Error"),DGn=lt(C.jsx("path",{d:"M1 21h22L12 2zm12-3h-2v-2h2zm0-4h-2v-4h2z"}),"Warning"),IGn=lt(C.jsx("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m-2 15-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8z"}),"CheckCircle"),LGn={success:IGn,warning:DGn,error:RGn,info:yVe},$Gn=oa("span")(()=>({display:"flex",alignItems:"center"})),z$={close:{p:.5},success:t=>({color:t.palette.error.contrastText,backgroundColor:Ip[600]}),error:t=>({color:t.palette.error.contrastText,backgroundColor:t.palette.error.dark}),info:t=>({color:t.palette.error.contrastText,backgroundColor:t.palette.primary.dark}),warning:t=>({color:t.palette.error.contrastText,backgroundColor:wke[700]}),icon:{fontSize:20},iconVariant:t=>({opacity:.9,marginRight:t.spacing(1),fontSize:20}),message:{display:"flex",alignItems:"center"}},FGn={vertical:"bottom",horizontal:"center"};function NGn({className:t,message:e,hideMessage:n}){const r=()=>{n(e.id)};if(!e)return null;const i=LGn[e.type];return C.jsx(Zct,{open:!0,anchorOrigin:FGn,autoHideDuration:5e3,onClose:r,children:C.jsx(JAe,{sx:z$[e.type],className:t,"aria-describedby":"client-snackbar",message:C.jsxs($Gn,{id:"client-snackbar",children:[C.jsx(i,{sx:z$.iconVariant}),e.text]}),action:[C.jsx(Ht,{"aria-label":"Close",color:"inherit",sx:z$.close,onClick:r,size:"large",children:C.jsx(VO,{sx:z$.icon})},"close")]})},e.type+":"+e.text)}const zGn=t=>{const e=t.messageLogState.newEntries;return{locale:t.controlState.locale,message:e.length>0?e[0]:null}},jGn={hideMessage:oQt},BGn=Rn(zGn,jGn)(NGn),HZ=lt(C.jsx("path",{d:"M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6z"}),"Add"),lYe=lt(C.jsx("path",{d:"M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7H6zM19 4h-3.5l-1-1h-5l-1 1H5v2h14z"}),"Delete"),Aw={formControl:t=>({marginLeft:t.spacing(1),marginRight:t.spacing(1),width:200}),textField:t=>({marginLeft:t.spacing(1),marginRight:t.spacing(1),width:200}),textField2:t=>({marginLeft:t.spacing(1),marginRight:t.spacing(1),width:400}),button:t=>({margin:t.spacing(.1)})};function UGn({open:t,servers:e,selectedServer:n,closeDialog:r,configureServers:i}){const o=D.useRef(!1),[s,a]=D.useState(e),[l,c]=D.useState(n),[u,f]=D.useState("select");D.useEffect(()=>{o.current&&(a(e),c(n)),o.current=!0},[e,n]);const{store:d}=D.useContext(Aj),h=()=>{u==="select"?(r("server"),i(s,l.id,d)):u==="add"?E():u==="edit"&&M()},p=()=>{u==="select"?_():A()},g=()=>{_()},m=$=>{const z=$.target.value,L=s.find(j=>j.id===z);c(L)},v=$=>{const z=$.target.value,L={...l,name:z};c(L)},y=$=>{const z=$.target.value,L={...l,url:z};c(L)},x=()=>{f("add")},b=()=>{f("edit")},w=()=>{P()},_=()=>{r("server")},S=()=>{const $=l.id;return s.findIndex(z=>z.id===$)},O=($,z)=>{const L=[...s];L[$]=z,a(L),c(z),f("select")},k=($,z)=>{a($),c(z),f("select")},E=()=>{const $={...l,id:Uf("server-")},z=[...s,$];k(z,$)},M=()=>{O(S(),{...l})},A=()=>{const $=S();O(S(),s[$])},P=()=>{const $=[...s];if($.length<2)throw new Error("internal error: server list cannot be emptied");const z=S(),L=$[z+(z>0?-1:1)];$.splice(z,1),k($,L)},T=s.map(($,z)=>C.jsx(_i,{value:$.id,children:$.name},z));let R;u==="add"?R=ge.get("Add"):u==="edit"?R=ge.get("Save"):R=ge.get("OK");let I;u==="add"?I=ge.get("Add Server"):u==="edit"?I=ge.get("Edit Server"):I=ge.get("Select Server");let B;return u==="add"||u==="edit"?B=C.jsxs(zf,{dividers:!0,children:[C.jsx(ui,{variant:"standard",required:!0,id:"server-name",label:"Name",sx:Aw.textField,margin:"normal",value:l.name,onChange:v}),C.jsx("br",{}),C.jsx(ui,{variant:"standard",required:!0,id:"server-url",label:"URL",sx:Aw.textField2,margin:"normal",value:l.url,onChange:y})]}):B=C.jsx(zf,{dividers:!0,children:C.jsxs("div",{children:[C.jsxs(Gg,{variant:"standard",sx:Aw.formControl,children:[C.jsx(Ly,{htmlFor:"server-name",children:"Name"}),C.jsx(Hg,{variant:"standard",value:l.id,onChange:m,inputProps:{name:"server-name",id:"server-name"},children:T}),C.jsx(Eee,{children:l.url})]}),C.jsx(Ht,{sx:Aw.button,"aria-label":"Add",color:"primary",onClick:x,size:"large",children:C.jsx(HZ,{fontSize:"small"})}),C.jsx(Ht,{sx:Aw.button,"aria-label":"Edit",onClick:b,size:"large",children:C.jsx(GO,{fontSize:"small"})}),C.jsx(Ht,{sx:Aw.button,"aria-label":"Delete",disabled:s.length<2,onClick:w,size:"large",children:C.jsx(lYe,{fontSize:"small"})})]})}),C.jsxs(ed,{open:t,onClose:g,"aria-labelledby":"server-dialog-title",children:[C.jsx(Iy,{id:"server-dialog-title",children:I}),B,C.jsxs(Q1,{children:[C.jsx(Vr,{onClick:p,children:ge.get("Cancel")}),C.jsx(Vr,{onClick:h,autoFocus:!0,children:R})]})]})}const WGn=t=>({open:!!t.controlState.dialogOpen.server,servers:RRe(t),selectedServer:ji(t)}),VGn={closeDialog:BO,configureServers:WQt},GGn=Rn(WGn,VGn)(UGn),SEe=({anchorElement:t,layers:e,selectedLayerId:n,setSelectedLayerId:r,onClose:i})=>C.jsx(Z1,{anchorEl:t,keepMounted:!0,open:!!t,onClose:i,children:t&&e.map(o=>C.jsx(_i,{selected:o.id===n,onClick:()=>r(o.id===n?null:o.id),dense:!0,children:C.jsx(du,{primary:uN(o)})},o.id))}),AG={settingsPanelTitle:t=>({marginBottom:t.spacing(1)}),settingsPanelPaper:t=>({backgroundColor:(t.palette.mode==="dark"?Pg:Ag)(t.palette.background.paper,.1),marginBottom:t.spacing(2)}),settingsPanelList:{margin:0}},Uw=({title:t,children:e})=>{const n=de.Children.count(e),r=[];return de.Children.forEach(e,(i,o)=>{r.push(i),o{let i;e||(i={marginBottom:10});const o=C.jsx(du,{primary:t,secondary:e});let s;return r&&(s=C.jsx(aA,{children:r})),n?C.jsxs(VAe,{style:i,onClick:n,children:[o,s]}):C.jsxs(M_,{style:i,children:[o,s]})},Tv=({propertyName:t,settings:e,updateSettings:n,disabled:r})=>C.jsx(ePe,{checked:!!e[t],onChange:()=>n({...e,[t]:!e[t]}),disabled:r}),HGn=({propertyName:t,settings:e,updateSettings:n,options:r,disabled:i})=>{const o=(s,a)=>{n({...e,[t]:a})};return C.jsx(kee,{row:!0,value:e[t],onChange:o,children:r.map(([s,a])=>C.jsx(Px,{control:C.jsx(ek,{}),value:a,label:s,disabled:i},s))})},j2={textField:t=>({marginLeft:t.spacing(1),marginRight:t.spacing(1),fontSize:t.typography.fontSize/2}),intTextField:t=>({marginLeft:t.spacing(1),marginRight:t.spacing(1),fontSize:t.typography.fontSize/2,width:t.spacing(6)}),localeAvatar:{margin:10}},CEe=[["doNothing","Do nothing"],["pan","Pan"],["panAndZoom","Pan and zoom"]],qGn=[["point","Points"],["line","Lines"],["bar","Bars"]],XGn=({open:t,closeDialog:e,settings:n,selectedServer:r,baseMapLayers:i,overlayLayers:o,updateSettings:s,changeLocale:a,openDialog:l,viewerVersion:c,serverInfo:u})=>{const[f,d]=de.useState(null),[h,p]=de.useState(null),[g,m]=de.useState(null),[v,y]=de.useState(n.timeChunkSize+"");if(de.useEffect(()=>{const F=parseInt(v);!Number.isNaN(F)&&F!==n.timeChunkSize&&s({timeChunkSize:F})},[v,n,s]),!t)return null;function x(){e("settings")}function b(){l("server")}function w(F){s({timeAnimationInterval:parseInt(F.target.value)})}function _(F){s({timeSeriesChartTypeDefault:F.target.value})}function S(F){s({datasetLocateMode:F.target.value})}function O(F){s({placeLocateMode:F.target.value})}function k(F){y(F.target.value)}let E=null;f&&(E=Object.getOwnPropertyNames(ge.languages).map(F=>{const H=ge.languages[F];return C.jsx(_i,{selected:F===n.locale,onClick:()=>a(F),children:C.jsx(du,{primary:H})},F)}));function M(F){d(F.currentTarget)}function A(){d(null)}function P(F){p(F.currentTarget)}function T(){p(null)}const R=F=>{F.stopPropagation(),l("userBaseMaps")},I=fN(i,n.selectedBaseMapId),B=uN(I);function $(F){m(F.currentTarget)}function z(){m(null)}const L=F=>{F.stopPropagation(),l("userOverlays")},j=fN(o,n.selectedOverlayId),N=uN(j);return C.jsxs("div",{children:[C.jsxs(ed,{open:t,fullWidth:!0,maxWidth:"sm",onClose:x,scroll:"body",children:[C.jsx(Iy,{children:ge.get("Settings")}),C.jsxs(zf,{children:[C.jsxs(Uw,{title:ge.get("General"),children:[C.jsx(yi,{label:ge.get("Server"),value:r.name,onClick:b}),C.jsx(yi,{label:ge.get("Language"),value:ge.languages[n.locale],onClick:M}),C.jsx(yi,{label:ge.get("Time interval of the player"),children:C.jsx(ui,{variant:"standard",select:!0,sx:j2.textField,value:n.timeAnimationInterval,onChange:w,margin:"normal",children:awt.map((F,H)=>C.jsx(_i,{value:F,children:F+" ms"},H))})})]}),C.jsxs(Uw,{title:ge.get("Time-Series"),children:[C.jsx(yi,{label:ge.get("Show chart after adding a place"),value:j$(n.autoShowTimeSeries),children:C.jsx(Tv,{propertyName:"autoShowTimeSeries",settings:n,updateSettings:s})}),C.jsx(yi,{label:ge.get("Default chart type"),children:C.jsx(ui,{variant:"standard",select:!0,sx:j2.textField,value:n.timeSeriesChartTypeDefault,onChange:_,margin:"normal",children:qGn.map(([F,H])=>C.jsx(_i,{value:F,children:ge.get(H)},F))})}),C.jsx(yi,{label:ge.get("Calculate standard deviation"),value:j$(n.timeSeriesIncludeStdev),children:C.jsx(Tv,{propertyName:"timeSeriesIncludeStdev",settings:n,updateSettings:s})}),C.jsx(yi,{label:ge.get("Calculate median instead of mean (disables standard deviation)"),value:j$(n.timeSeriesUseMedian),children:C.jsx(Tv,{propertyName:"timeSeriesUseMedian",settings:n,updateSettings:s})}),C.jsx(yi,{label:ge.get("Minimal number of data points in a time series update"),children:C.jsx(ui,{variant:"standard",sx:j2.intTextField,value:v,onChange:k,margin:"normal",size:"small"})})]}),C.jsxs(Uw,{title:ge.get("Map"),children:[C.jsx(yi,{label:ge.get("Base map"),value:B,onClick:P,children:C.jsx(Vr,{onClick:R,children:ge.get("User Base Maps")+"..."})}),C.jsx(yi,{label:ge.get("Overlay"),value:N,onClick:$,children:C.jsx(Vr,{onClick:L,children:ge.get("User Overlays")+"..."})}),C.jsx(yi,{label:ge.get("Projection"),children:C.jsx(HGn,{propertyName:"mapProjection",settings:n,updateSettings:s,options:[[ge.get("Geographic"),sO],[ge.get("Mercator"),Ate]]})}),C.jsx(yi,{label:ge.get("Image smoothing"),value:j$(n.imageSmoothingEnabled),children:C.jsx(Tv,{propertyName:"imageSmoothingEnabled",settings:n,updateSettings:s})}),C.jsx(yi,{label:ge.get("On dataset selection"),children:C.jsx(ui,{variant:"standard",select:!0,sx:j2.textField,value:n.datasetLocateMode,onChange:S,margin:"normal",children:CEe.map(([F,H])=>C.jsx(_i,{value:F,children:ge.get(H)},F))})}),C.jsx(yi,{label:ge.get("On place selection"),children:C.jsx(ui,{variant:"standard",select:!0,sx:j2.textField,value:n.placeLocateMode,onChange:O,margin:"normal",children:CEe.map(([F,H])=>C.jsx(_i,{value:F,children:ge.get(H)},F))})})]}),C.jsx(Uw,{title:ge.get("Legal Agreement"),children:C.jsx(yi,{label:ge.get("Privacy notice"),value:n.privacyNoticeAccepted?ge.get("Accepted"):"",children:C.jsx(Vr,{disabled:!n.privacyNoticeAccepted,onClick:()=>{s({privacyNoticeAccepted:!1}),window.location.reload()},children:ge.get("Revoke consent")})})}),C.jsxs(Uw,{title:ge.get("System Information"),children:[C.jsx(yi,{label:`xcube Viewer ${ge.get("version")}`,value:c}),C.jsx(yi,{label:`xcube Server ${ge.get("version")}`,value:u?u.version:ge.get("Cannot reach server")})]})]})]}),C.jsx(Z1,{anchorEl:f,keepMounted:!0,open:!!f,onClose:A,children:E}),C.jsx(SEe,{anchorElement:h,layers:i,selectedLayerId:n.selectedBaseMapId,setSelectedLayerId:F=>s({selectedBaseMapId:F}),onClose:T}),C.jsx(SEe,{anchorElement:g,layers:o,selectedLayerId:n.selectedOverlayId,setSelectedLayerId:F=>s({selectedOverlayId:F}),onClose:z})]})},j$=t=>t?ge.get("On"):ge.get("Off"),YGn=t=>({locale:t.controlState.locale,open:t.controlState.dialogOpen.settings,settings:t.controlState,baseMapLayers:Wte(t),overlayLayers:Vte(t),selectedServer:ji(t),viewerVersion:Q6e,serverInfo:t.dataState.serverInfo}),QGn={closeDialog:BO,updateSettings:ZR,changeLocale:QUe,openDialog:_b},KGn=Rn(YGn,QGn)(XGn),OEe={separatorTextField:t=>({marginLeft:t.spacing(1),marginRight:t.spacing(1),fontSize:t.typography.fontSize/2,maxWidth:"6em"}),fileNameTextField:t=>({marginLeft:t.spacing(1),marginRight:t.spacing(1),fontSize:t.typography.fontSize/2})},ZGn=({open:t,closeDialog:e,settings:n,updateSettings:r,downloadTimeSeries:i})=>{const o=()=>{e("export")};function s(c){r({exportFileName:c.target.value})}function a(c){r({exportTimeSeriesSeparator:c.target.value})}const l=()=>{o(),i()};return C.jsx("div",{children:C.jsxs(ed,{open:t,fullWidth:!0,maxWidth:"xs",onClose:o,scroll:"body",children:[C.jsx(zf,{children:C.jsxs(Uw,{title:ge.get("Export Settings"),children:[C.jsx(yi,{label:ge.get("Include time-series data")+" (*.txt)",value:B$(n.exportTimeSeries),children:C.jsx(Tv,{propertyName:"exportTimeSeries",settings:n,updateSettings:r})}),C.jsx(yi,{label:ge.get("Separator for time-series data"),children:C.jsx(ui,{variant:"standard",sx:OEe.separatorTextField,value:n.exportTimeSeriesSeparator,onChange:a,disabled:!n.exportTimeSeries,margin:"normal",size:"small"})}),C.jsx(yi,{label:ge.get("Include places data")+" (*.geojson)",value:B$(n.exportPlaces),children:C.jsx(Tv,{propertyName:"exportPlaces",settings:n,updateSettings:r})}),C.jsx(yi,{label:ge.get("Combine place data in one file"),value:B$(n.exportPlacesAsCollection),children:C.jsx(Tv,{propertyName:"exportPlacesAsCollection",settings:n,updateSettings:r,disabled:!n.exportPlaces})}),C.jsx(yi,{label:ge.get("As ZIP archive"),value:B$(n.exportZipArchive),children:C.jsx(Tv,{propertyName:"exportZipArchive",settings:n,updateSettings:r})}),C.jsx(yi,{label:ge.get("File name"),children:C.jsx(ui,{variant:"standard",sx:OEe.fileNameTextField,value:n.exportFileName,onChange:s,margin:"normal",size:"small"})})]})}),C.jsx(Q1,{children:C.jsx(Vr,{onClick:l,disabled:!tHn(n),children:ge.get("Download")})})]})})},B$=t=>t?ge.get("On"):ge.get("Off"),JGn=t=>/^[0-9a-zA-Z_-]+$/.test(t),eHn=t=>t.toUpperCase()==="TAB"||t.length===1,tHn=t=>(t.exportTimeSeries||t.exportPlaces)&&JGn(t.exportFileName)&&(!t.exportTimeSeries||eHn(t.exportTimeSeriesSeparator)),nHn=t=>({locale:t.controlState.locale,open:!!t.controlState.dialogOpen.export,settings:t.controlState}),rHn={closeDialog:BO,updateSettings:ZR,downloadTimeSeries:ZQt},iHn=Rn(nHn,rHn)(ZGn),oHn=lt(C.jsx("path",{d:"M16.59 8.59 12 13.17 7.41 8.59 6 10l6 6 6-6z"}),"ExpandMore"),sHn=lt(C.jsx("path",{d:"m12 8-6 6 1.41 1.41L12 10.83l4.59 4.58L18 14z"}),"ExpandLess"),aHn=({title:t,accept:e,multiple:n,disabled:r,onSelect:i,className:o})=>{const s=D.useRef(null),a=c=>{if(c.target.files!==null&&c.target.files.length){const u=[];for(let f=0;f{s.current!==null&&s.current.click()};return C.jsxs(C.Fragment,{children:[C.jsx("input",{type:"file",accept:e,multiple:n,ref:s,hidden:!0,onChange:a,disabled:r}),C.jsx(Vr,{onClick:l,disabled:r,className:o,variant:"outlined",size:"small",children:t})]})},PG={parse:t=>t,format:t=>typeof t=="string"?t:`${t}`,validate:t=>!0};function Vce(){return t=>{const{options:e,updateOptions:n,optionKey:r,label:i,style:o,className:s,disabled:a,parse:l,format:c,validate:u}=t,f=e[r],d=h=>{const p=h.target.value,g=(l||PG.parse)(p);n({[r]:g})};return C.jsx(ui,{label:ge.get(i),value:(c||PG.format)(f),error:!(u||PG.validate)(f),onChange:d,style:o,className:s,disabled:a,size:"small",variant:"standard"})}}const B2=Vce(),lHn=oa("div")(({theme:t})=>({paddingTop:t.spacing(2)})),cHn=({options:t,updateOptions:e})=>C.jsx(lHn,{children:C.jsxs("div",{style:{display:"grid",gap:12,paddingTop:12,gridTemplateColumns:"auto auto"},children:[C.jsx(B2,{optionKey:"timeNames",label:"Time property names",options:t,updateOptions:e}),C.jsx("div",{id:"spareField"}),C.jsx(B2,{label:"Group property names",optionKey:"groupNames",options:t,updateOptions:e}),C.jsx(B2,{label:"Group prefix (used as fallback)",optionKey:"groupPrefix",options:t,updateOptions:e}),C.jsx(B2,{label:"Label property names",optionKey:"labelNames",options:t,updateOptions:e}),C.jsx(B2,{label:"Label prefix (used as fallback)",optionKey:"labelPrefix",options:t,updateOptions:e})]})}),fa=Vce(),uHn=oa("div")(({theme:t})=>({paddingTop:t.spacing(2)})),fHn=({options:t,updateOptions:e})=>{const n=t.forceGeometry;return C.jsxs(uHn,{children:[C.jsxs("div",{style:{display:"grid",gap:12,paddingTop:12,gridTemplateColumns:"auto auto"},children:[C.jsx(fa,{optionKey:"xNames",label:"X/longitude column names",options:t,updateOptions:e,disabled:n}),C.jsx(fa,{optionKey:"yNames",label:"Y/latitude column names",options:t,updateOptions:e,disabled:n}),C.jsxs("span",{children:[C.jsx(zF,{checked:t.forceGeometry,onChange:r=>e({forceGeometry:r.target.checked}),size:"small"}),C.jsx("span",{children:"Use geometry column"})]}),C.jsx(fa,{optionKey:"geometryNames",label:"Geometry column names",options:t,updateOptions:e,disabled:!n}),C.jsx(fa,{optionKey:"timeNames",label:"Time column names",options:t,updateOptions:e}),C.jsx("div",{id:"spareField"}),C.jsx(fa,{optionKey:"groupNames",label:"Group column names",options:t,updateOptions:e}),C.jsx(fa,{optionKey:"groupPrefix",label:"Group prefix (used as fallback)",options:t,updateOptions:e}),C.jsx(fa,{optionKey:"labelNames",label:"Label column names",options:t,updateOptions:e}),C.jsx(fa,{optionKey:"labelPrefix",label:"Label prefix (used as fallback)",options:t,updateOptions:e})]}),C.jsxs("div",{style:{display:"grid",gap:12,paddingTop:12,gridTemplateColumns:"auto auto auto"},children:[C.jsx(fa,{optionKey:"separator",label:"Separator character",options:t,updateOptions:e}),C.jsx(fa,{optionKey:"comment",label:"Comment character",options:t,updateOptions:e}),C.jsx(fa,{optionKey:"quote",label:"Quote character",options:t,updateOptions:e}),C.jsx(fa,{optionKey:"escape",label:"Escape character",options:t,updateOptions:e}),C.jsx("div",{}),C.jsxs("span",{children:[C.jsx(zF,{checked:t.trim,onChange:r=>e({trim:r.target.checked}),size:"small"}),C.jsx("span",{children:"Remove whitespaces"})]}),C.jsx(fa,{optionKey:"nanToken",label:"Not-a-number token",options:t,updateOptions:e}),C.jsx(fa,{optionKey:"trueToken",label:"True token",options:t,updateOptions:e}),C.jsx(fa,{optionKey:"falseToken",label:"False token",options:t,updateOptions:e})]})]})},U2=Vce(),dHn=oa("div")(({theme:t})=>({paddingTop:t.spacing(2)})),hHn=({options:t,updateOptions:e})=>C.jsx(dHn,{children:C.jsxs("div",{style:{display:"grid",gap:12,paddingTop:12,gridTemplateColumns:"auto auto"},children:[C.jsx(U2,{optionKey:"time",label:"Time (UTC, ISO-format)",options:t,updateOptions:e}),C.jsx("div",{id:"spareField"}),C.jsx(U2,{label:"Group",options:t,optionKey:"group",updateOptions:e}),C.jsx(U2,{label:"Group prefix (used as fallback)",optionKey:"groupPrefix",options:t,updateOptions:e,disabled:t.group.trim()!==""}),C.jsx(U2,{label:"Label",optionKey:"label",options:t,updateOptions:e}),C.jsx(U2,{label:"Label prefix (used as fallback)",optionKey:"labelPrefix",options:t,updateOptions:e,disabled:t.label.trim()!==""})]})}),MG={csv:{...GRe,codeExt:[]},geojson:{...HRe,codeExt:[_Ge()]},wkt:{...qRe,codeExt:[]}},RG={spacer:{flexGrow:1},actionButton:t=>({marginRight:t.spacing(1)}),error:{fontSize:"small"}},pHn=oa("div")(({theme:t})=>({paddingTop:t.spacing(.5),display:"flex",flexDirection:"row",alignItems:"center"})),gHn=oa(aHn)(({theme:t})=>({marginRight:t.spacing(1)})),mHn=({open:t,closeDialog:e,userPlacesFormatName:n,userPlacesFormatOptions:r,updateSettings:i,addUserPlacesFromText:o,nextMapInteraction:s,setMapInteraction:a})=>{const[l,c]=D.useState(""),[u,f]=D.useState(null),[d,h]=D.useState(!1),[p,g]=D.useState(!1),[m,v]=D.useState(n),[y,x]=D.useState(r);if(D.useEffect(()=>{v(n)},[n]),D.useEffect(()=>{x(r)},[r]),!t)return null;const b=()=>{a("Select"),e("addUserPlacesFromText"),i({userPlacesFormatName:m,userPlacesFormatOptions:y}),o(l)},w=()=>{a(s),e("addUserPlacesFromText")},_=()=>{c("")},S=I=>{const B=I[0];h(!0);const $=new FileReader;$.onloadend=()=>{const z=$.result;v(epe(z)),c(z),h(!1)},$.onabort=$.onerror=()=>{h(!1)},$.readAsText(B,"UTF-8")},O=()=>{c("")},k=()=>{console.info("PASTE!",l)},E=I=>{let B=m;l===""&&I.length>10&&(B=epe(I),v(B)),c(I),f(MG[B].checkError(I))};function M(I){v(I.target.value)}function A(I){x({...y,csv:{...y.csv,...I}})}function P(I){x({...y,geojson:{...y.geojson,...I}})}function T(I){x({...y,wkt:{...y.wkt,...I}})}let R;return m==="csv"?R=C.jsx(fHn,{options:y.csv,updateOptions:A}):m==="geojson"?R=C.jsx(cHn,{options:y.geojson,updateOptions:P}):R=C.jsx(hHn,{options:y.wkt,updateOptions:T}),C.jsxs(ed,{fullWidth:!0,open:t,onClose:w,"aria-labelledby":"server-dialog-title",children:[C.jsx(Iy,{id:"server-dialog-title",children:ge.get("Import places")}),C.jsxs(zf,{dividers:!0,children:[C.jsxs(kee,{row:!0,value:m,onChange:I=>M(I),children:[C.jsx(Px,{value:"csv",label:ge.get(GRe.name),control:C.jsx(ek,{})},"csv"),C.jsx(Px,{value:"geojson",label:ge.get(HRe.name),control:C.jsx(ek,{})},"geojson"),C.jsx(Px,{value:"wkt",label:ge.get(qRe.name),control:C.jsx(ek,{})},"wkt")]}),C.jsx(FU,{theme:wn.instance.branding.themeName||"light",placeholder:ge.get("Enter text or drag & drop a text file."),autoFocus:!0,height:"400px",extensions:MG[m].codeExt,value:l,onChange:E,onDrop:O,onPaste:k,onPasteCapture:k}),u&&C.jsx(Jt,{color:"error",sx:RG.error,children:u}),C.jsxs(pHn,{children:[C.jsx(gHn,{title:ge.get("From File")+"...",accept:MG[m].fileExt,multiple:!1,onSelect:S,disabled:d}),C.jsx(Vr,{onClick:_,disabled:l.trim()===""||d,sx:RG.actionButton,variant:"outlined",size:"small",children:ge.get("Clear")}),C.jsx(ot,{sx:RG.spacer}),C.jsx(Vr,{onClick:()=>g(!p),endIcon:p?C.jsx(sHn,{}):C.jsx(oHn,{}),variant:"outlined",size:"small",children:ge.get("Options")})]}),C.jsx(DF,{in:p,timeout:"auto",unmountOnExit:!0,children:R})]}),C.jsxs(Q1,{children:[C.jsx(Vr,{onClick:w,variant:"text",children:ge.get("Cancel")}),C.jsx(Vr,{onClick:b,disabled:l.trim()===""||u!==null||d,variant:"text",children:ge.get("OK")})]})]})},vHn=t=>({open:t.controlState.dialogOpen.addUserPlacesFromText,userPlacesFormatName:t.controlState.userPlacesFormatName,userPlacesFormatOptions:t.controlState.userPlacesFormatOptions,nextMapInteraction:t.controlState.lastMapInteraction}),yHn={closeDialog:BO,updateSettings:ZR,setMapInteraction:FUe,addUserPlacesFromText:tUe},xHn=Rn(vHn,yHn)(mHn),cYe=lt(C.jsx("path",{d:"M16 1H4c-1.1 0-2 .9-2 2v14h2V3h12zm3 4H8c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h11c1.1 0 2-.9 2-2V7c0-1.1-.9-2-2-2m0 16H8V7h11z"}),"ContentCopy");function Gce(t,e){return uYe(t,e,[]).join("")}function uYe(t,e,n){if(t.nodeType==Node.CDATA_SECTION_NODE||t.nodeType==Node.TEXT_NODE)n.push(t.nodeValue);else{var r=void 0;for(r=t.firstChild;r;r=r.nextSibling)uYe(r,e,n)}return n}function bHn(t){return"documentElement"in t}function wHn(t){return new DOMParser().parseFromString(t,"application/xml")}function fYe(t,e){return function(n,r){var i=t.call(this,n,r);if(i!==void 0){var o=r[r.length-1];o.push(i)}}}function ql(t,e,n){return function(r,i){var o=t.call(this,r,i);if(o!==void 0){var s=i[i.length-1],a=r.localName,l=void 0;a in s?l=s[a]:(l=[],s[a]=l),l.push(o)}}}function Lt(t,e,n){return function(r,i){var o=t.call(this,r,i);if(o!==void 0){var s=i[i.length-1],a=r.localName;s[a]=o}}}function Es(t,e,n){var r={},i,o;for(i=0,o=t.length;i{const n=e.Name,r=e.Title||n;let i;const o=e.Attribution;if(dj(o)){const s=o.Title,a=o.OnlineResource;s&&a?i=`© ${s}`:a?i=`${a}`:s&&(i=`${s}`)}return{name:n,title:r,attribution:i}})}function uqn(t){const e=sqn.read(t);if(dj(e)){const n=e.Capability;if(dj(n))return qZ(n,!0)}throw new Error("invalid WMSCapabilities object")}function qZ(t,e){let n,r;if(e)n=t.Layer;else{const{Layer:o,...s}=t;n=o,r=s}let i;return Array.isArray(n)?i=n.flatMap(o=>qZ(o)):dj(n)?i=qZ(n):i=[{}],i.map(o=>fqn(r,o))}function fqn(t,e){if(!t)return e;if(typeof(t.Name||e.Name)!="string")throw new Error("invalid WMSCapabilities: missing Layer/Name");const r=t.Title,i=e.Title,o=r&&i?`${r} / ${i}`:i||r;return{...t,...e,Title:o}}function dj(t){return t!==null&&typeof t=="object"&&!Array.isArray(t)}const dqn=({userLayer:t,onChange:e,onCancel:n})=>{const[r,i]=D.useState(t.url),[o,s]=D.useState(null),[a,l]=D.useState(-1);D.useEffect(()=>{aqn(r).then(f=>{s(f)})},[r]),D.useEffect(()=>{if(o&&t.wms){const{layerName:f}=t.wms;l(o.findIndex(d=>d.name===f))}else l(-1)},[o,t.wms]);const c=()=>o&&o.length&&a!=-1,u=()=>{o&&a!==-1&&e({...t,group:$te,title:o[a].title,url:r.trim(),attribution:o[a].attribution,wms:{layerName:o[a].name}})};return C.jsxs(ot,{sx:{display:"flex",gap:2,flexDirection:"column",padding:"5px 15px"},children:[C.jsx(ui,{required:!0,label:ge.get("WMS URL"),variant:"standard",size:"small",value:r,fullWidth:!0,onChange:f=>i(f.currentTarget.value)}),C.jsx(Hg,{disabled:!o||!o.length,variant:"standard",onChange:f=>l(f.target.value),value:a,size:"small",renderValue:()=>o&&o.length&&a>=0?o[a].title:ge.get("WMS Layer"),children:(o||[]).map((f,d)=>C.jsx(_i,{value:d,selected:a===d,children:C.jsx(du,{primary:f.title})},f.name))}),C.jsx(oD,{onDone:u,onCancel:n,doneDisabled:!c(),helpUrl:ge.get("docs/add-layer-wms.en.md")})]})},hqn=({userLayer:t,onChange:e,onCancel:n})=>{const[r,i]=de.useState(t.title),[o,s]=de.useState(t.url),[a,l]=de.useState(t.attribution||""),c=(d,h)=>{const p=d!=="",g=h!==""&&(h.startsWith("http://")||h.trim().startsWith("https://"));return p&&g},u=()=>c(r.trim(),o.trim()),f=()=>e({...t,group:$te,title:r.trim(),url:o.trim(),attribution:a.trim()});return C.jsxs(ot,{sx:{display:"flex",gap:1,flexDirection:"column",padding:"5px 15px"},children:[C.jsx(ui,{required:!0,label:ge.get("XYZ Layer URL"),variant:"standard",size:"small",value:o,fullWidth:!0,onChange:d=>s(d.currentTarget.value)}),C.jsxs(ot,{sx:{display:"flex",gap:1},children:[C.jsx(ui,{required:!0,label:ge.get("Layer Title"),variant:"standard",size:"small",sx:{flexGrow:.3},value:r,onChange:d=>i(d.currentTarget.value)}),C.jsx(ui,{label:ge.get("Layer Attribution"),variant:"standard",size:"small",sx:{flexGrow:.7},value:a,onChange:d=>l(d.currentTarget.value)})]}),C.jsx(oD,{onDone:f,onCancel:n,doneDisabled:!u(),helpUrl:ge.get("docs/add-layer-xyz.en.md")})]})},pqn={paper:t=>({backgroundColor:(t.palette.mode==="dark"?Pg:Ag)(t.palette.background.paper,.1),marginBottom:t.spacing(2)})},EEe=({userLayers:t,setUserLayers:e,selectedId:n,setSelectedId:r})=>{const[i,o]=de.useState(n),[s,a]=de.useState(null),[l,c]=hVe();if(!open)return null;const u=x=>{c(()=>e(t)),a({editId:x.id,editMode:"edit"})},f=x=>{c(void 0);const b=t.findIndex(w=>w.id===x.id);e([...t.slice(0,b+1),{...x,id:Uf("user-layer"),title:x.title+" Copy"},...t.slice(b+1)])},d=x=>{c(void 0);const b=t.findIndex(w=>w.id===x.id);x.id===n&&r(i),x.id===i&&o(null),e([...t.slice(0,b),...t.slice(b+1)])},h=x=>{c(()=>e(t));const b=Uf("user-layer-");e([...t,{id:b,group:$te,title:"",url:"",attribution:"",wms:x==="wms"?{layerName:""}:void 0}]),a({editId:b,editMode:"add"})},p=()=>{h("wms")},g=()=>{h("xyz")},m=x=>{c(void 0);const b=t.findIndex(w=>w.id===x.id);n===x.id&&r(i),e([...t.slice(0,b),x,...t.slice(b+1)]),a(null)},v=()=>{if(l(),s&&s.editMode==="add"){const x=t.findIndex(b=>b.id===s.editId);e([...t.slice(0,x),...t.slice(x+1)])}a(null)},y=s!==null;return C.jsx(Al,{sx:pqn.paper,children:C.jsxs(DM,{component:"nav",dense:!0,children:[t.map(x=>{const b=n===x.id;return s&&s.editId===x.id?x.wms?C.jsx(dqn,{userLayer:x,onChange:m,onCancel:v},x.id):C.jsx(hqn,{userLayer:x,onChange:m,onCancel:v},x.id):C.jsxs(VAe,{selected:b,onClick:()=>r(b?null:x.id),children:[C.jsx(du,{primary:x.title,secondary:x.url}),C.jsxs(aA,{children:[C.jsx(Ht,{onClick:()=>u(x),size:"small",disabled:y,children:C.jsx(GO,{})}),C.jsx(Ht,{onClick:()=>f(x),size:"small",disabled:y,children:C.jsx(cYe,{})}),C.jsx(Ht,{onClick:()=>d(x),size:"small",disabled:y,children:C.jsx(VO,{})})]})]},x.id)}),!y&&C.jsx(M_,{sx:{minHeight:"3em"},children:C.jsx(aA,{children:C.jsxs(ot,{sx:{display:"flex",gap:2,paddingTop:2},children:[C.jsx(Rt,{title:ge.get("Add layer from a Web Map Service"),children:C.jsx(Vr,{onClick:p,startIcon:C.jsx(HZ,{}),children:"WMS"})}),C.jsx(Rt,{title:ge.get("Add layer from a Tiled Web Map"),children:C.jsx(Vr,{onClick:g,startIcon:C.jsx(HZ,{}),children:"XYZ"})})]})})})]})})},gqn=({dialogId:t,open:e,closeDialog:n,settings:r,updateSettings:i})=>{const[o,s]=de.useState(t==="userBaseMaps"?0:1);if(!e)return null;const a=r.userBaseMaps,l=m=>{i({userBaseMaps:m})},c=r.userOverlays,u=m=>{i({userOverlays:m})},f=r.selectedBaseMapId,d=m=>{i({selectedBaseMapId:m})},h=r.selectedOverlayId,p=m=>{i({selectedOverlayId:m})};function g(){n(t)}return C.jsxs(ed,{open:e,fullWidth:!0,maxWidth:"sm",onClose:g,scroll:"body",children:[C.jsx(Iy,{children:ge.get("User Layers")}),C.jsxs(zf,{children:[C.jsx(ot,{sx:{borderBottom:1,borderColor:"divider"},children:C.jsxs(Ree,{value:o,onChange:(m,v)=>s(v),children:[C.jsx(SS,{label:"Base Maps"}),C.jsx(SS,{label:"Overlays"})]})}),o===0&&C.jsx(EEe,{userLayers:a,setUserLayers:l,selectedId:f,setSelectedId:d},"baseMaps"),o===1&&C.jsx(EEe,{userLayers:c,setUserLayers:u,selectedId:h,setSelectedId:p},"overlays")]})]})},mqn=(t,e)=>({open:t.controlState.dialogOpen[e.dialogId],settings:t.controlState,dialogId:e.dialogId}),vqn={closeDialog:BO,updateSettings:ZR},TEe=Rn(mqn,vqn)(gqn);function mYe({selected:t,title:e,actions:n}){return C.jsxs(C4,{sx:{pl:{sm:2},pr:{xs:1,sm:1},...t&&{background:r=>Tt(r.palette.primary.main,r.palette.action.activatedOpacity)}},children:[C.jsx(lQ,{}),C.jsx(Jt,{sx:{flex:"1 1 100%",paddingLeft:1},children:e}),n]})}const yqn={container:{display:"flex",flexDirection:"column",height:"100%"},tableContainer:{overflowY:"auto",flexGrow:1}};function xqn({userVariables:t,setUserVariables:e,selectedIndex:n,setSelectedIndex:r,setEditedVariable:i}){const o=n>=0?t[n]:null,s=n>=0,a=d=>{r(n!==d?d:-1)},l=()=>{i({editMode:"add",variable:onn()})},c=()=>{const d=t[n];e([...t.slice(0,n+1),snn(d),...t.slice(n+1)]),r(n+1)},u=()=>{i({editMode:"edit",variable:o})},f=()=>{e([...t.slice(0,n),...t.slice(n+1)]),n>=t.length-1&&r(t.length-2)};return C.jsxs(C.Fragment,{children:[C.jsx(mYe,{selected:n!==null,title:ge.get("Manage user variables"),actions:C.jsxs(C.Fragment,{children:[C.jsx(Rt,{title:ge.get("Add user variable"),children:C.jsx(Ht,{color:"primary",onClick:l,children:C.jsx(EU,{})})}),s&&C.jsx(Rt,{title:ge.get("Duplicate user variable"),children:C.jsx(Ht,{onClick:c,children:C.jsx(cYe,{})})}),s&&C.jsx(Rt,{title:ge.get("Edit user variable"),children:C.jsx(Ht,{onClick:u,children:C.jsx(GO,{})})}),s&&C.jsx(Rt,{title:ge.get("Remove user variable"),children:C.jsx(Ht,{onClick:f,children:C.jsx(lYe,{})})})]})}),C.jsx(nPe,{sx:yqn.tableContainer,children:C.jsxs(Pee,{size:"small",children:[C.jsx(Rut,{children:C.jsxs(Ad,{children:[C.jsx(si,{sx:{width:"15%"},children:ge.get("Name")}),C.jsx(si,{sx:{width:"15%"},children:ge.get("Title")}),C.jsx(si,{sx:{width:"10%"},children:ge.get("Units")}),C.jsx(si,{children:ge.get("Expression")})]})}),C.jsx(Mee,{children:t.map((d,h)=>C.jsxs(Ad,{hover:!0,selected:h===n,onClick:()=>a(h),children:[C.jsx(si,{component:"th",scope:"row",children:d.name}),C.jsx(si,{children:d.title}),C.jsx(si,{children:d.units}),C.jsx(si,{children:d.expression||""})]},d.id))})]})})]})}const bqn=lt(C.jsx("path",{d:"M10 18h4v-2h-4zM3 6v2h18V6zm3 7h12v-2H6z"}),"FilterList"),wqn=/^[a-zA-Z_$][a-zA-Z0-9_$]*$/;function _qn(t){return wqn.test(t)}const kEe={expressionPart:{padding:.2},expressionPartChip:{fontFamily:"monospace"}};function AEe({part:t,partType:e,onPartClicked:n}){return C.jsx(ot,{component:"span",sx:kEe.expressionPart,children:C.jsx(RAe,{label:t,sx:kEe.expressionPartChip,size:"small",variant:"outlined",color:e==="variables"||e==="constants"?"default":e.includes("Functions")?"primary":"secondary",onClick:()=>n(t)})})}function Sqn({anchorEl:t,exprPartTypes:e,setExprPartTypes:n,onClose:r}){const i=o=>{n({...e,[o]:!e[o]})};return C.jsx(Z1,{open:!!t,anchorEl:t,onClose:r,children:Q8e.map(o=>C.jsx(aYe,{selected:e[o],title:ge.get(lnn[o]),onClick:()=>i(o),dense:!0},o))})}function Cqn({expression:t,onExpressionChange:e,variableNames:n,expressionCapabilities:r,handleInsertPartRef:i}){const o=X1(),s=D.useRef(null),a=D.useCallback(c=>{var f;const u=(f=s.current)==null?void 0:f.view;if(u){const d=u.state.selection.main,h=u.state.sliceDoc(d.from,d.to).trim();h!==""&&c.includes("X")&&(c=c.replace("X",h));const p=u.state.replaceSelection(c);p&&u.dispatch(p)}},[]);D.useEffect(()=>{i.current=a},[i,a]);const l=D.useCallback(c=>{const u=c.matchBefore(/\w*/);return u===null||u.from==u.to&&!c.explicit?null:{from:u.from,options:[...n.map(f=>({label:f,type:"variable"})),...r.namespace.constants.map(f=>({label:f,type:"variable"})),...r.namespace.arrayFunctions.map(f=>({label:f,type:"function"})),...r.namespace.otherFunctions.map(f=>({label:f,type:"function"}))]}},[n,r.namespace]);return C.jsx(FU,{theme:o.palette.mode||"none",width:"100%",height:"100px",placeholder:ge.get("Use keys CTRL+SPACE to show autocompletions"),extensions:[mGe({override:[l]})],value:t,onChange:e,ref:s})}async function Oqn(t,e,n){if(n.trim()==="")return ge.get("Must not be empty");const r=`${t}/expressions/validate/${eO(e)}/${encodeURIComponent(n)}`;try{return await rMe(r),null}catch(i){const o=i.message;if(o){const s=o.indexOf("("),a=o.lastIndexOf(")");return o.slice(s>=0?s+1:0,a>=0?a:o.length)}return ge.get("Invalid expression")}}const U$={container:{display:"flex",flexDirection:"column",height:"100%"},content:{flexGrow:1,display:"flex",flexDirection:"column",gap:2,padding:1},propertiesRow:{display:"flex",gap:1},expressionRow:{flexGrow:1},expressionParts:{paddingTop:1,overflowY:"auto"},expressionPart:{padding:.2},expressionPartChip:{fontFamily:"monospace"}};function Eqn({userVariables:t,setUserVariables:e,editedVariable:n,setEditedVariable:r,contextDataset:i,expressionCapabilities:o,serverUrl:s}){const[a,l]=D.useState(ann),[c,u]=D.useState(null),f=[...t,...i.variables],d=i.variables.filter(N=>!jM(N)).map(N=>N.name),{id:h,name:p,title:g,units:m,expression:v}=n.variable,y=f.findIndex(N=>N.id!==h&&N.name===p)>=0,x=!_qn(p),b=y?ge.get("Already in use"):x?ge.get("Not a valid identifier"):null,w=!b,[_,S]=D.useState(null),k=w&&!_,E=D.useRef(null);D.useEffect(()=>{const N=setTimeout(()=>{Oqn(s,i.id,n.variable.expression).then(S)},500);return()=>{clearTimeout(N)}},[s,i.id,n.variable.expression]);const M=(N,F)=>{r({...n,variable:{...n.variable,[N]:F}})},A=()=>{if(n.editMode==="add")e([n.variable,...t]);else{const N=t.findIndex(F=>F.id===n.variable.id);if(N>=0){const F=[...t];F[N]=n.variable,e(F)}}r(null)},P=()=>{r(null)},T=N=>{M("name",N.target.value)},R=N=>{M("title",N.target.value)},I=N=>{M("units",N.target.value)},B=N=>{M("expression",N)},$=N=>{E.current(N)},z=N=>{u(N.currentTarget)},L=()=>{u(null)},j=[C.jsx(Ht,{size:"small",onClick:z,children:C.jsx(Rt,{arrow:!0,title:ge.get("Display further elements to be used in expressions"),children:C.jsx(bqn,{})})},"filter")];return Q8e.forEach(N=>{a[N]&&(N==="variables"?d.forEach(F=>{j.push(C.jsx(AEe,{part:F,partType:N,onPartClicked:$},`${N}-${F}`))}):o.namespace[N].forEach(F=>{j.push(C.jsx(AEe,{part:F,partType:N,onPartClicked:$},`${N}-${F}`))}))}),C.jsxs(C.Fragment,{children:[C.jsx(Sqn,{anchorEl:c,exprPartTypes:a,setExprPartTypes:l,onClose:L}),C.jsx(mYe,{selected:!0,title:n.editMode==="add"?ge.get("Add user variable"):ge.get("Edit user variable"),actions:C.jsx(oD,{size:"medium",onDone:A,doneDisabled:!k,onCancel:P})}),C.jsxs(ot,{sx:U$.content,children:[C.jsxs(ot,{sx:U$.propertiesRow,children:[C.jsx(ui,{sx:{flexGrow:.3},error:!w,helperText:b,size:"small",variant:"standard",label:ge.get("Name"),value:p,onChange:T}),C.jsx(ui,{sx:{flexGrow:.6},size:"small",variant:"standard",label:ge.get("Title"),value:g,onChange:R}),C.jsx(ui,{sx:{flexGrow:.1},size:"small",variant:"standard",label:ge.get("Units"),value:m,onChange:I})]}),C.jsxs(ot,{sx:U$.expressionRow,children:[C.jsx(Jt,{sx:N=>({paddingBottom:1,color:N.palette.text.secondary}),children:ge.get("Expression")}),C.jsx(Cqn,{expression:v,onExpressionChange:B,variableNames:d,expressionCapabilities:o,handleInsertPartRef:E}),_&&C.jsx(Jt,{sx:{paddingBottom:1},color:"error",fontSize:"small",children:_}),C.jsx(ot,{sx:U$.expressionParts,children:j})]})]})]})}const PEe={dialogContent:{height:420},dialogActions:{display:"flex",justifyContent:"space-between",gap:.2}};function Tqn({open:t,closeDialog:e,selectedDataset:n,selectedVariableName:r,selectVariable:i,userVariables:o,updateDatasetUserVariables:s,expressionCapabilities:a,serverUrl:l}){const[c,u]=D.useState(o),[f,d]=D.useState(c.findIndex(v=>v.name===r)),[h,p]=D.useState(null);if(D.useEffect(()=>{u(o)},[o]),!t||!n||!a)return null;function g(){s(n.id,c),e(K5),f>=0&&i(c[f].name)}function m(){u(o),e(K5)}return C.jsxs(ed,{open:t,fullWidth:!0,maxWidth:"md",onClose:m,scroll:"body",children:[C.jsx(Iy,{children:ge.get("User Variables")}),C.jsx(zf,{dividers:!0,sx:PEe.dialogContent,children:h===null?C.jsx(xqn,{userVariables:c,setUserVariables:u,selectedIndex:f,setSelectedIndex:d,setEditedVariable:p}):C.jsx(Eqn,{userVariables:c,setUserVariables:u,editedVariable:h,setEditedVariable:p,contextDataset:n,expressionCapabilities:a,serverUrl:l})}),C.jsxs(Q1,{sx:PEe.dialogActions,children:[C.jsx(ot,{children:C.jsx(pVe,{size:"medium",helpUrl:ge.get("docs/user-variables.en.md")})}),C.jsxs(ot,{children:[C.jsx(Vr,{onClick:m,children:ge.get("Cancel")}),C.jsx(Vr,{onClick:g,disabled:h!==null||!kqn(c),children:ge.get("OK")})]})]})]})}function kqn(t){const e=new Set;return t.forEach(n=>e.add(n.name)),e.size===t.length}const Aqn=t=>({open:t.controlState.dialogOpen[K5],selectedDataset:ho(t),selectedVariableName:uO(t),userVariables:Gwt(t),expressionCapabilities:dbt(t),serverUrl:ji(t).url}),Pqn={closeDialog:BO,selectVariable:PUe,updateDatasetUserVariables:CQt},Mqn=Rn(Aqn,Pqn)(Tqn),Rqn=t=>({compact:wn.instance.branding.compact}),Dqn={},Iqn=()=>r4({typography:{fontSize:12,htmlFontSize:14},palette:{mode:wn.instance.branding.themeName,primary:wn.instance.branding.primaryColor,secondary:wn.instance.branding.secondaryColor}}),Lqn=({compact:t})=>C.jsx(Ddt,{children:C.jsx(iet,{injectFirst:!0,children:C.jsxs(knt,{theme:Iqn(),children:[C.jsx(yst,{}),!t&&C.jsx(Qtn,{}),C.jsx(xGn,{}),C.jsxs(C.Fragment,{children:[C.jsx(MGn,{}),C.jsx(GGn,{}),C.jsx(KGn,{}),C.jsx(TEe,{dialogId:"userOverlays"},"userOverlays"),C.jsx(TEe,{dialogId:"userBaseMaps"},"userBaseMaps"),C.jsx(Mqn,{}),C.jsx(xHn,{}),C.jsx(iHn,{}),C.jsx(CGn,{}),C.jsx(BGn,{})]})]})})}),$qn=Rn(Rqn,Dqn)(Lqn);function Fqn(t,e,n){switch(t===void 0&&(t=cwt()),e.type){case Tae:{const{controlState:r}=e.persistedState.state;return{...t,...r}}case zae:{const r={...t,...e.settings};return md(r),r}case JUe:return md(t),t;case eP:{let r=t.selectedDatasetId||jp.get("dataset"),i=t.selectedVariableName||jp.get("variable"),o=t.mapInteraction,s=dA(e.datasets,r);const a=s&&dq(s,i)||null;return s?a||(i=s.variables.length?s.variables[0].name:null):(r=null,i=null,s=e.datasets.length?e.datasets[0]:null,s&&(r=s.id,s.variables.length>0&&(i=s.variables[0].name))),r||(o="Select"),{...t,selectedDatasetId:r,selectedVariableName:i,mapInteraction:o}}case xUe:{let r=t.selectedVariableName;const i=dA(e.datasets,e.selectedDatasetId);!dq(i,r)&&i.variables.length>0&&(r=i.variables[0].name);const s=e.selectedDatasetId,a=aMe(i),l=a?a[1]:null;return{...t,selectedDatasetId:s,selectedVariableName:r,selectedTimeRange:a,selectedTime:l}}case SUe:{const{location:r}=e;return t.flyTo!==r?{...t,flyTo:r}:t}case CUe:{const r=e.selectedPlaceGroupIds;return{...t,selectedPlaceGroupIds:r,selectedPlaceId:null}}case OUe:{const{placeId:r}=e;return{...t,selectedPlaceId:r}}case AUe:return{...t,selectedVariableName:e.selectedVariableName};case EUe:return{...t,layerVisibilities:{...t.layerVisibilities,[e.layerId]:e.visible}};case TUe:{const{mapPointInfoBoxEnabled:r}=e;return{...t,mapPointInfoBoxEnabled:r}}case kUe:{const{variableCompareMode:r}=e;return{...t,variableCompareMode:r,variableSplitPos:void 0}}case Lae:{const{variableSplitPos:r}=e;return{...t,variableSplitPos:r}}case RUe:{let{selectedTime:r}=e;if(r!==null&&n){const i=Rq(n),o=i?lRe(i,r):-1;o>=0&&(r=i[o])}return t.selectedTime!==r?{...t,selectedTime:r}:t}case DUe:{if(n){let r=CDe(n);if(r>=0){const i=Rq(n);r+=e.increment,r<0&&(r=i.length-1),r>i.length-1&&(r=0);let o=i[r];const s=t.selectedTimeRange;if(s!==null&&(os[1]&&(o=s[1])),t.selectedTime!==o)return{...t,selectedTime:o}}}return t}case $ae:return{...t,selectedTimeRange:e.selectedTimeRange};case mKt:return{...t,timeSeriesUpdateMode:e.timeSeriesUpdateMode};case LUe:return{...t,timeAnimationActive:e.timeAnimationActive,timeAnimationInterval:e.timeAnimationInterval};case Aae:{const{id:r,selected:i}=e;return i?Nqn(t,_f,r):t}case Pae:{const{placeGroups:r}=e;return r.length>0?{...t,selectedPlaceGroupIds:[...t.selectedPlaceGroupIds||[],r[0].id]}:t}case Mae:{const{placeGroupId:r,newName:i}=e;return r===_f?{...t,userDrawnPlaceGroupName:i}:t}case Rae:{const{placeId:r,places:i}=e;if(r===t.selectedPlaceId){let o=null;const s=i.findIndex(a=>a.id===r);return s>=0&&(s0&&(o=i[s-1].id)),{...t,selectedPlaceId:o}}return t}case n8e:{const r=e.colorBarId;return{...t,userColorBars:[{id:r,type:"continuous",code:fMe},...t.userColorBars]}}case r8e:{const r=e.colorBarId,i=t.userColorBars.findIndex(o=>o.id===r);if(i>=0){const o={...t,userColorBars:[...t.userColorBars.slice(0,i),...t.userColorBars.slice(i+1)]};return md(o),o}return t}case s8e:{const r=e.userColorBar,i=t.userColorBars.findIndex(o=>o.id===r.id);return i>=0?{...t,userColorBars:[...t.userColorBars.slice(0,i),{...r},...t.userColorBars.slice(i+1)]}:t}case $Ue:{let r={...t,mapInteraction:e.mapInteraction,lastMapInteraction:t.mapInteraction};return e.mapInteraction==="Geometry"&&(r={...r,dialogOpen:{...t.dialogOpen,addUserPlacesFromText:!0}}),r}case NUe:{const{layerMenuOpen:r}=e;return t={...t,layerMenuOpen:r},md(t),t}case jUe:{const{sidebarPosition:r}=e;return t={...t,sidebarPosition:r},t}case BUe:{const{sidebarOpen:r}=e;return t={...t,sidebarOpen:r},md(t),t}case UUe:{const{sidebarPanelId:r}=e;return t={...t,sidebarPanelId:r},md(t),t}case WUe:return t={...t,volumeRenderMode:e.volumeRenderMode},md(t),t;case VUe:{const{volumeId:r,volumeState:i}=e;return t={...t,volumeStates:{...t.volumeStates,[r]:i}},t}case GUe:{const r={...t.infoCardElementStates};return Object.getOwnPropertyNames(r).forEach(i=>{r[i]={...r[i],visible:e.visibleElements.includes(i)}}),t={...t,infoCardElementStates:r},md(t),t}case HUe:{const{elementType:r,viewMode:i}=e,o={...t,infoCardElementStates:{...t.infoCardElementStates,[r]:{...t.infoCardElementStates[r],viewMode:i}}};return md(o),o}case qUe:return{...t,activities:{...t.activities,[e.id]:e.message}};case XUe:{const r={...t.activities};return delete r[e.id],{...t,activities:r}}case YUe:{const r=e.locale;return ge.locale=r,r!==t.locale&&(t={...t,locale:r},md(t)),t}case KUe:{const r=e.dialogId;return{...t,dialogOpen:{...t.dialogOpen,[r]:!0}}}case ZUe:{const r=e.dialogId;return{...t,dialogOpen:{...t.dialogOpen,[r]:!1}}}case MUe:{const{selectedDataset2Id:r,selectedVariable2Name:i}=e;return r===t.selectedDataset2Id&&i===t.selectedVariable2Name?{...t,selectedDataset2Id:null,selectedVariable2Name:null,variableCompareMode:!1,variableSplitPos:void 0}:{...t,selectedDataset2Id:r,selectedVariable2Name:i,variableCompareMode:!0}}case Dae:if(t.selectedServerId!==e.selectedServerId)return{...t,selectedServerId:e.selectedServerId}}return t}function Nqn(t,e,n){let r=t.selectedPlaceGroupIds;return!t.selectedPlaceGroupIds||t.selectedPlaceGroupIds.length===0?r=[e]:t.selectedPlaceGroupIds.find(i=>i===e)||(r=[...t.selectedPlaceGroupIds,e]),{...t,selectedPlaceGroupIds:r,selectedPlaceId:n}}function zqn(){const t=twt(),e=[{...wn.instance.server}];return t.forEach(n=>{e.find(r=>r.id===n.id)||e.push(n)}),{serverInfo:null,expressionCapabilities:null,datasets:[],colorBars:null,statistics:{loading:!1,records:[]},timeSeriesGroups:[],userPlaceGroups:[],userServers:e}}function jqn(t,e){switch(t===void 0&&(t=zqn()),e.type){case Tae:{const{dataState:n}=e.persistedState.state;return{...t,...n}}case Y5:return{...t,serverInfo:e.serverInfo};case hUe:return{...t,expressionCapabilities:e.expressionCapabilities};case eP:return{...t,datasets:e.datasets};case eUe:{const{datasetId:n,userVariables:r}=e,i=t.datasets.findIndex(l=>l.id===n),o=t.datasets[i],[s,a]=lte(o);return{...t,datasets:[...t.datasets.slice(0,i),{...o,variables:[...s,...r]},...t.datasets.slice(i+1)]}}case gUe:{const{datasetId:n,variableName:r,colorBarName:i,colorBarMinMax:o,colorBarNorm:s,opacity:a}=e,l={colorBarName:i,colorBarMin:o[0],colorBarMax:o[1],colorBarNorm:s,opacity:a};return MEe(t,n,r,l)}case vUe:{const{datasetId:n,variableName:r,volumeRenderMode:i,volumeIsoThreshold:o}=e;return MEe(t,n,r,{volumeRenderMode:i,volumeIsoThreshold:o})}case kae:{const n=e.placeGroup,r=t.datasets.map(i=>{if(i.placeGroups){const o=i.placeGroups.findIndex(s=>s.id===n.id);if(o>=0){const s=[...i.placeGroups];return s[o]=n,{...i,placeGroups:s}}}return i});return{...t,datasets:r}}case Aae:{const{placeGroupTitle:n,id:r,properties:i,geometry:o}=e,s={type:"Feature",id:r,properties:i,geometry:o},a=t.userPlaceGroups,l=a.findIndex(c=>c.id===_f);if(l>=0){const c=a[l];return{...t,userPlaceGroups:[...a.slice(0,l),{...c,features:[...c.features,s]},...a.slice(l+1)]}}else{const c=n&&n!==""?n:ge.get("My places");return{...t,userPlaceGroups:[{type:"FeatureCollection",id:_f,title:c,features:[s]},...a]}}}case Pae:{const{placeGroups:n}=e;return{...t,userPlaceGroups:[...t.userPlaceGroups,...n]}}case Mae:{const{placeGroupId:n,newName:r}=e,i=t.userPlaceGroups,o=i.findIndex(s=>s.id===n);if(o>=0){const s=i[o];return{...t,userPlaceGroups:[...i.slice(0,o),{...s,title:r},...i.slice(o+1)]}}return t}case nUe:{const{placeGroupId:n,placeId:r,newName:i}=e,o=t.userPlaceGroups,s=DEe(o,n,r,{label:i});return s?{...t,userPlaceGroups:s}:t}case rUe:{const{placeGroupId:n,placeId:r,placeStyle:i}=e,o=t.userPlaceGroups,s=DEe(o,n,r,i);return s?{...t,userPlaceGroups:s}:t}case Rae:{const{placeGroupId:n,placeId:r}=e,i=t.userPlaceGroups,o=i.findIndex(s=>s.id===n);if(o>=0){const s=i[o],a=s.features.findIndex(l=>l.id===r);if(a>=0){const l=REe(t.timeSeriesGroups,[r]);let c=t.timeSeriesGroups;return l.forEach(u=>{c=LG(c,u,"remove","append")}),{...t,userPlaceGroups:[...i.slice(0,o),{...s,features:[...s.features.slice(0,a),...s.features.slice(a+1)]},...i.slice(o+1)],timeSeriesGroups:c}}}return t}case iUe:{const{placeGroupId:n}=e,r=t.userPlaceGroups,i=r.findIndex(o=>o.id===n);if(i>=0){const s=r[i].features.map(c=>c.id),a=REe(t.timeSeriesGroups,s);let l=t.timeSeriesGroups;return a.forEach(c=>{l=LG(l,c,"remove","append")}),{...t,userPlaceGroups:[...r.slice(0,i),...r.slice(i+1)],timeSeriesGroups:l}}return t}case pUe:return{...t,colorBars:e.colorBars};case cUe:{const{timeSeriesGroupId:n,timeSeries:r}=e,i=t.timeSeriesGroups,o=i.findIndex(l=>l.id===n),s=i[o],a=[...i];return a[o]={...s,timeSeriesArray:[...s.timeSeriesArray,r]},{...t,timeSeriesGroups:a}}case sUe:{const n=t.statistics;if(e.statistics===null)return{...t,statistics:{...n,loading:!0}};const r=n.records;return{...t,statistics:{...n,loading:!1,records:[e.statistics,...r]}}}case aUe:{const{index:n}=e,r=t.statistics,i=r.records;return{...t,statistics:{...r,records:[...i.slice(0,n),...i.slice(n+1)]}}}case lUe:{const{timeSeries:n,updateMode:r,dataMode:i}=e,o=LG(t.timeSeriesGroups,n,r,i);return o!==t.timeSeriesGroups?{...t,timeSeriesGroups:o}:t}case uUe:{const n=t.timeSeriesGroups.findIndex(r=>r.id===e.groupId);if(n>=0){const r=[...t.timeSeriesGroups],i={...r[n]},o=[...i.timeSeriesArray];return o.splice(e.index,1),i.timeSeriesArray=o,r[n]=i,{...t,timeSeriesGroups:r}}return t}case fUe:{const n=t.timeSeriesGroups.findIndex(r=>r.id===e.id);if(n>=0){const r=[...t.timeSeriesGroups];return r.splice(n,1),{...t,timeSeriesGroups:r}}return t}case dUe:return{...t,timeSeriesGroups:[]};case $ae:{const{selectedGroupId:n,selectedValueRange:r}=e;if(!n)return t;const i=t.timeSeriesGroups.findIndex(s=>s.id===n),o=r||void 0;return{...t,timeSeriesGroups:[...t.timeSeriesGroups.slice(0,i),{...t.timeSeriesGroups[i],variableRange:o},...t.timeSeriesGroups.slice(i+1)]}}case Dae:return t.userServers!==e.servers?(ewt(e.servers),{...t,userServers:e.servers}):t;default:return t}}function MEe(t,e,n,r){const i=t.datasets.findIndex(o=>o.id===e);if(i>=0){const o=t.datasets[i],s=o.variables.findIndex(a=>a.name===n);if(s>=0){const a=o.variables[s],l=t.datasets.slice(),c=o.variables.slice();return c[s]={...a,...r},l[i]={...o,variables:c},{...t,datasets:l}}}return t}function LG(t,e,n,r){let i=e,o;const s=t.findIndex(a=>a.variableUnits===i.source.variableUnits);if(s>=0){const a=t[s],l=a.timeSeriesArray,c=l.findIndex(f=>f.source.datasetId===i.source.datasetId&&f.source.variableName===i.source.variableName&&f.source.placeId===i.source.placeId);let u;if(c>=0){const f=l[c];r==="append"&&(i={...i,data:[...i.data,...f.data]}),n==="replace"?u=[i]:n==="add"?(u=l.slice(),u[c]=i):(u=l.slice(),u.splice(c,1))}else n==="replace"?u=[i]:n==="add"?u=[i,...l]:u=l;n==="replace"?o=[{...a,timeSeriesArray:u}]:n==="add"?(o=t.slice(),o[s]={...a,timeSeriesArray:u}):u.length>=0?(o=t.slice(),o[s]={...a,timeSeriesArray:u}):(o=t.slice(),o.splice(s,1))}else n==="replace"?o=[{id:Uf("ts-"),variableUnits:i.source.variableUnits,timeSeriesArray:[i]}]:n==="add"?o=[{id:Uf("ts-"),variableUnits:i.source.variableUnits,timeSeriesArray:[i]},...t]:o=t;return o}function REe(t,e){const n=[];return t.forEach(r=>{r.timeSeriesArray.forEach(i=>{e.forEach(o=>{i.source.placeId===o&&n.push(i)})})}),n}function DEe(t,e,n,r){const i=t.findIndex(o=>o.id===e);if(i>=0){const o=t[i],s=o.features,a=s.findIndex(l=>l.id===n);if(a>=0){const l=s[a];return[...t.slice(0,i),{...o,features:[...s.slice(0,a),{...l,properties:{...l.properties,...r}},...s.slice(a+1)]},...t.slice(i+1)]}}}function Bqn(){return{newEntries:[],oldEntries:[]}}let Uqn=0;function Wqn(t,e){t===void 0&&(t=Bqn());const n=t.newEntries;switch(e.type){case X6e:{const r=e.messageType,i=e.messageText;let o=n.length?n[0]:null;return o&&r===o.type&&i===o.text?t:(o={id:++Uqn,type:r,text:i},{...t,newEntries:[o,...n]})}case Y6e:{const r=n.findIndex(i=>i.id===e.messageId);if(r>=0){const i=n[r],o=[...n];o.splice(r,1);const s=[i,...t.oldEntries];return{...t,newEntries:o,oldEntries:s}}}}return t}function Vqn(){return{accessToken:null}}function Gqn(t,e){switch(t===void 0&&(t=Vqn()),e.type){case q8e:return{...t,accessToken:e.accessToken}}return t}function Hqn(t,e){return{dataState:jqn(t&&t.dataState,e),controlState:Fqn(t&&t.controlState,e,t),messageLogState:Wqn(t&&t.messageLogState,e),userAuthState:Gqn(t&&t.userAuthState,e)}}console.debug("baseUrl:",ZC);wn.load().then(()=>{const t=(o,s)=>s.type!==Lae,e=iJe.createLogger({collapsed:!0,diff:!1,predicate:t}),n=rJe(pke,e),r=dke(Hqn,n),i=r.dispatch;i(QUe(r.getState().controlState.locale)),i(OKt()),r.getState().controlState.privacyNoticeAccepted&&i(Iae(r,!0)),$G.createRoot(document.getElementById("root")).render(C.jsx(eZe,{store:r,children:C.jsx($qn,{})}))}); +`,t.getElementsByTagName("head")[0].appendChild(e)),t.body&&CYe(t.body,"react-draggable-transparent-selection")}function d7n(t){if(t)try{if(t.body&&OYe(t.body,"react-draggable-transparent-selection"),t.selection)t.selection.empty();else{const e=(t.defaultView||window).getSelection();e&&e.type!=="Caret"&&e.removeAllRanges()}}catch{}}function CYe(t,e){t.classList?t.classList.add(e):t.className.match(new RegExp("(?:^|\\s)".concat(e,"(?!\\S)")))||(t.className+=" ".concat(e))}function OYe(t,e){t.classList?t.classList.remove(e):t.className=t.className.replace(new RegExp("(?:^|\\s)".concat(e,"(?!\\S)"),"g"),"")}var np={};Object.defineProperty(np,"__esModule",{value:!0});np.canDragX=g7n;np.canDragY=m7n;np.createCoreData=y7n;np.createDraggableData=x7n;np.getBoundPosition=h7n;np.getControlPosition=v7n;np.snapToGrid=p7n;var Ul=tp,b_=ji;function h7n(t,e,n){if(!t.props.bounds)return[e,n];let{bounds:r}=t.props;r=typeof r=="string"?r:b7n(r);const i=rue(t);if(typeof r=="string"){const{ownerDocument:o}=i,s=o.defaultView;let a;if(r==="parent"?a=i.parentNode:a=o.querySelector(r),!(a instanceof s.HTMLElement))throw new Error('Bounds selector "'+r+'" could not find an element.');const l=a,c=s.getComputedStyle(i),u=s.getComputedStyle(l);r={left:-i.offsetLeft+(0,Ul.int)(u.paddingLeft)+(0,Ul.int)(c.marginLeft),top:-i.offsetTop+(0,Ul.int)(u.paddingTop)+(0,Ul.int)(c.marginTop),right:(0,b_.innerWidth)(l)-(0,b_.outerWidth)(i)-i.offsetLeft+(0,Ul.int)(u.paddingRight)-(0,Ul.int)(c.marginRight),bottom:(0,b_.innerHeight)(l)-(0,b_.outerHeight)(i)-i.offsetTop+(0,Ul.int)(u.paddingBottom)-(0,Ul.int)(c.marginBottom)}}return(0,Ul.isNum)(r.right)&&(e=Math.min(e,r.right)),(0,Ul.isNum)(r.bottom)&&(n=Math.min(n,r.bottom)),(0,Ul.isNum)(r.left)&&(e=Math.max(e,r.left)),(0,Ul.isNum)(r.top)&&(n=Math.max(n,r.top)),[e,n]}function p7n(t,e,n){const r=Math.round(e/t[0])*t[0],i=Math.round(n/t[1])*t[1];return[r,i]}function g7n(t){return t.props.axis==="both"||t.props.axis==="x"}function m7n(t){return t.props.axis==="both"||t.props.axis==="y"}function v7n(t,e,n){const r=typeof e=="number"?(0,b_.getTouch)(t,e):null;if(typeof e=="number"&&!r)return null;const i=rue(n),o=n.props.offsetParent||i.offsetParent||i.ownerDocument.body;return(0,b_.offsetXYFromParent)(r||t,o,n.props.scale)}function y7n(t,e,n){const r=!(0,Ul.isNum)(t.lastX),i=rue(t);return r?{node:i,deltaX:0,deltaY:0,lastX:e,lastY:n,x:e,y:n}:{node:i,deltaX:e-t.lastX,deltaY:n-t.lastY,lastX:t.lastX,lastY:t.lastY,x:e,y:n}}function x7n(t,e){const n=t.props.scale;return{node:e.node,x:t.state.x+e.deltaX/n,y:t.state.y+e.deltaY/n,deltaX:e.deltaX/n,deltaY:e.deltaY/n,lastX:t.state.x,lastY:t.state.y}}function b7n(t){return{left:t.left,top:t.top,right:t.right,bottom:t.bottom}}function rue(t){const e=t.findDOMNode();if(!e)throw new Error(": Unmounted during event!");return e}var f8={},d8={};Object.defineProperty(d8,"__esModule",{value:!0});d8.default=w7n;function w7n(){}Object.defineProperty(f8,"__esModule",{value:!0});f8.default=void 0;var jG=S7n(D),Ba=iue(hM),_7n=iue(HC),Rs=ji,Tm=np,BG=tp,F2=iue(d8);function iue(t){return t&&t.__esModule?t:{default:t}}function EYe(t){if(typeof WeakMap!="function")return null;var e=new WeakMap,n=new WeakMap;return(EYe=function(r){return r?n:e})(t)}function S7n(t,e){if(t&&t.__esModule)return t;if(t===null||typeof t!="object"&&typeof t!="function")return{default:t};var n=EYe(e);if(n&&n.has(t))return n.get(t);var r={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in t)if(o!=="default"&&Object.prototype.hasOwnProperty.call(t,o)){var s=i?Object.getOwnPropertyDescriptor(t,o):null;s&&(s.get||s.set)?Object.defineProperty(r,o,s):r[o]=t[o]}return r.default=t,n&&n.set(t,r),r}function fa(t,e,n){return e=C7n(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function C7n(t){var e=O7n(t,"string");return typeof e=="symbol"?e:String(e)}function O7n(t,e){if(typeof t!="object"||t===null)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}const sf={touch:{start:"touchstart",move:"touchmove",stop:"touchend"},mouse:{start:"mousedown",move:"mousemove",stop:"mouseup"}};let km=sf.mouse,h8=class extends jG.Component{constructor(){super(...arguments),fa(this,"dragging",!1),fa(this,"lastX",NaN),fa(this,"lastY",NaN),fa(this,"touchIdentifier",null),fa(this,"mounted",!1),fa(this,"handleDragStart",e=>{if(this.props.onMouseDown(e),!this.props.allowAnyClick&&typeof e.button=="number"&&e.button!==0)return!1;const n=this.findDOMNode();if(!n||!n.ownerDocument||!n.ownerDocument.body)throw new Error(" not mounted on DragStart!");const{ownerDocument:r}=n;if(this.props.disabled||!(e.target instanceof r.defaultView.Node)||this.props.handle&&!(0,Rs.matchesSelectorAndParentsTo)(e.target,this.props.handle,n)||this.props.cancel&&(0,Rs.matchesSelectorAndParentsTo)(e.target,this.props.cancel,n))return;e.type==="touchstart"&&e.preventDefault();const i=(0,Rs.getTouchIdentifier)(e);this.touchIdentifier=i;const o=(0,Tm.getControlPosition)(e,i,this);if(o==null)return;const{x:s,y:a}=o,l=(0,Tm.createCoreData)(this,s,a);(0,F2.default)("DraggableCore: handleDragStart: %j",l),(0,F2.default)("calling",this.props.onStart),!(this.props.onStart(e,l)===!1||this.mounted===!1)&&(this.props.enableUserSelectHack&&(0,Rs.addUserSelectStyles)(r),this.dragging=!0,this.lastX=s,this.lastY=a,(0,Rs.addEvent)(r,km.move,this.handleDrag),(0,Rs.addEvent)(r,km.stop,this.handleDragStop))}),fa(this,"handleDrag",e=>{const n=(0,Tm.getControlPosition)(e,this.touchIdentifier,this);if(n==null)return;let{x:r,y:i}=n;if(Array.isArray(this.props.grid)){let a=r-this.lastX,l=i-this.lastY;if([a,l]=(0,Tm.snapToGrid)(this.props.grid,a,l),!a&&!l)return;r=this.lastX+a,i=this.lastY+l}const o=(0,Tm.createCoreData)(this,r,i);if((0,F2.default)("DraggableCore: handleDrag: %j",o),this.props.onDrag(e,o)===!1||this.mounted===!1){try{this.handleDragStop(new MouseEvent("mouseup"))}catch{const l=document.createEvent("MouseEvents");l.initMouseEvent("mouseup",!0,!0,window,0,0,0,0,0,!1,!1,!1,!1,0,null),this.handleDragStop(l)}return}this.lastX=r,this.lastY=i}),fa(this,"handleDragStop",e=>{if(!this.dragging)return;const n=(0,Tm.getControlPosition)(e,this.touchIdentifier,this);if(n==null)return;let{x:r,y:i}=n;if(Array.isArray(this.props.grid)){let l=r-this.lastX||0,c=i-this.lastY||0;[l,c]=(0,Tm.snapToGrid)(this.props.grid,l,c),r=this.lastX+l,i=this.lastY+c}const o=(0,Tm.createCoreData)(this,r,i);if(this.props.onStop(e,o)===!1||this.mounted===!1)return!1;const a=this.findDOMNode();a&&this.props.enableUserSelectHack&&(0,Rs.removeUserSelectStyles)(a.ownerDocument),(0,F2.default)("DraggableCore: handleDragStop: %j",o),this.dragging=!1,this.lastX=NaN,this.lastY=NaN,a&&((0,F2.default)("DraggableCore: Removing handlers"),(0,Rs.removeEvent)(a.ownerDocument,km.move,this.handleDrag),(0,Rs.removeEvent)(a.ownerDocument,km.stop,this.handleDragStop))}),fa(this,"onMouseDown",e=>(km=sf.mouse,this.handleDragStart(e))),fa(this,"onMouseUp",e=>(km=sf.mouse,this.handleDragStop(e))),fa(this,"onTouchStart",e=>(km=sf.touch,this.handleDragStart(e))),fa(this,"onTouchEnd",e=>(km=sf.touch,this.handleDragStop(e)))}componentDidMount(){this.mounted=!0;const e=this.findDOMNode();e&&(0,Rs.addEvent)(e,sf.touch.start,this.onTouchStart,{passive:!1})}componentWillUnmount(){this.mounted=!1;const e=this.findDOMNode();if(e){const{ownerDocument:n}=e;(0,Rs.removeEvent)(n,sf.mouse.move,this.handleDrag),(0,Rs.removeEvent)(n,sf.touch.move,this.handleDrag),(0,Rs.removeEvent)(n,sf.mouse.stop,this.handleDragStop),(0,Rs.removeEvent)(n,sf.touch.stop,this.handleDragStop),(0,Rs.removeEvent)(e,sf.touch.start,this.onTouchStart,{passive:!1}),this.props.enableUserSelectHack&&(0,Rs.removeUserSelectStyles)(n)}}findDOMNode(){var e,n;return(e=this.props)!==null&&e!==void 0&&e.nodeRef?(n=this.props)===null||n===void 0||(n=n.nodeRef)===null||n===void 0?void 0:n.current:_7n.default.findDOMNode(this)}render(){return jG.cloneElement(jG.Children.only(this.props.children),{onMouseDown:this.onMouseDown,onMouseUp:this.onMouseUp,onTouchEnd:this.onTouchEnd})}};f8.default=h8;fa(h8,"displayName","DraggableCore");fa(h8,"propTypes",{allowAnyClick:Ba.default.bool,children:Ba.default.node.isRequired,disabled:Ba.default.bool,enableUserSelectHack:Ba.default.bool,offsetParent:function(t,e){if(t[e]&&t[e].nodeType!==1)throw new Error("Draggable's offsetParent must be a DOM Node.")},grid:Ba.default.arrayOf(Ba.default.number),handle:Ba.default.string,cancel:Ba.default.string,nodeRef:Ba.default.object,onStart:Ba.default.func,onDrag:Ba.default.func,onStop:Ba.default.func,onMouseDown:Ba.default.func,scale:Ba.default.number,className:BG.dontSetMe,style:BG.dontSetMe,transform:BG.dontSetMe});fa(h8,"defaultProps",{allowAnyClick:!1,disabled:!1,enableUserSelectHack:!0,onStart:function(){},onDrag:function(){},onStop:function(){},onMouseDown:function(){},scale:1});(function(t){Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"DraggableCore",{enumerable:!0,get:function(){return l.default}}),t.default=void 0;var e=d(D),n=u(hM),r=u(HC),i=u(V9n),o=ji,s=np,a=tp,l=u(f8),c=u(d8);function u(y){return y&&y.__esModule?y:{default:y}}function f(y){if(typeof WeakMap!="function")return null;var x=new WeakMap,b=new WeakMap;return(f=function(w){return w?b:x})(y)}function d(y,x){if(y&&y.__esModule)return y;if(y===null||typeof y!="object"&&typeof y!="function")return{default:y};var b=f(x);if(b&&b.has(y))return b.get(y);var w={},_=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var S in y)if(S!=="default"&&Object.prototype.hasOwnProperty.call(y,S)){var O=_?Object.getOwnPropertyDescriptor(y,S):null;O&&(O.get||O.set)?Object.defineProperty(w,S,O):w[S]=y[S]}return w.default=y,b&&b.set(y,w),w}function h(){return h=Object.assign?Object.assign.bind():function(y){for(var x=1;x{if((0,c.default)("Draggable: onDragStart: %j",w),this.props.onStart(b,(0,s.createDraggableData)(this,w))===!1)return!1;this.setState({dragging:!0,dragged:!0})}),p(this,"onDrag",(b,w)=>{if(!this.state.dragging)return!1;(0,c.default)("Draggable: onDrag: %j",w);const _=(0,s.createDraggableData)(this,w),S={x:_.x,y:_.y,slackX:0,slackY:0};if(this.props.bounds){const{x:k,y:E}=S;S.x+=this.state.slackX,S.y+=this.state.slackY;const[P,A]=(0,s.getBoundPosition)(this,S.x,S.y);S.x=P,S.y=A,S.slackX=this.state.slackX+(k-S.x),S.slackY=this.state.slackY+(E-S.y),_.x=S.x,_.y=S.y,_.deltaX=S.x-this.state.x,_.deltaY=S.y-this.state.y}if(this.props.onDrag(b,_)===!1)return!1;this.setState(S)}),p(this,"onDragStop",(b,w)=>{if(!this.state.dragging||this.props.onStop(b,(0,s.createDraggableData)(this,w))===!1)return!1;(0,c.default)("Draggable: onDragStop: %j",w);const S={dragging:!1,slackX:0,slackY:0};if(!!this.props.position){const{x:k,y:E}=this.props.position;S.x=k,S.y=E}this.setState(S)}),this.state={dragging:!1,dragged:!1,x:x.position?x.position.x:x.defaultPosition.x,y:x.position?x.position.y:x.defaultPosition.y,prevPropsPosition:{...x.position},slackX:0,slackY:0,isElementSVG:!1},x.position&&!(x.onDrag||x.onStop)&&console.warn("A `position` was applied to this , without drag handlers. This will make this component effectively undraggable. Please attach `onDrag` or `onStop` handlers so you can adjust the `position` of this element.")}componentDidMount(){typeof window.SVGElement<"u"&&this.findDOMNode()instanceof window.SVGElement&&this.setState({isElementSVG:!0})}componentWillUnmount(){this.setState({dragging:!1})}findDOMNode(){var x,b;return(x=(b=this.props)===null||b===void 0||(b=b.nodeRef)===null||b===void 0?void 0:b.current)!==null&&x!==void 0?x:r.default.findDOMNode(this)}render(){const{axis:x,bounds:b,children:w,defaultPosition:_,defaultClassName:S,defaultClassNameDragging:O,defaultClassNameDragged:k,position:E,positionOffset:P,scale:A,...R}=this.props;let T={},M=null;const j=!!!E||this.state.dragging,N=E||_,z={x:(0,s.canDragX)(this)&&j?this.state.x:N.x,y:(0,s.canDragY)(this)&&j?this.state.y:N.y};this.state.isElementSVG?M=(0,o.createSVGTransform)(z,P):T=(0,o.createCSSTransform)(z,P);const L=(0,i.default)(w.props.className||"",S,{[O]:this.state.dragging,[k]:this.state.dragged});return e.createElement(l.default,h({},R,{onStart:this.onDragStart,onDrag:this.onDrag,onStop:this.onDragStop}),e.cloneElement(e.Children.only(w),{className:L,style:{...w.props.style,...T},transform:M}))}}t.default=v,p(v,"displayName","Draggable"),p(v,"propTypes",{...l.default.propTypes,axis:n.default.oneOf(["both","x","y","none"]),bounds:n.default.oneOfType([n.default.shape({left:n.default.number,right:n.default.number,top:n.default.number,bottom:n.default.number}),n.default.string,n.default.oneOf([!1])]),defaultClassName:n.default.string,defaultClassNameDragging:n.default.string,defaultClassNameDragged:n.default.string,defaultPosition:n.default.shape({x:n.default.number,y:n.default.number}),positionOffset:n.default.shape({x:n.default.oneOfType([n.default.number,n.default.string]),y:n.default.oneOfType([n.default.number,n.default.string])}),position:n.default.shape({x:n.default.number,y:n.default.number}),className:a.dontSetMe,style:a.dontSetMe,transform:a.dontSetMe}),p(v,"defaultProps",{...l.default.defaultProps,axis:"both",bounds:!1,defaultClassName:"react-draggable",defaultClassNameDragging:"react-draggable-dragging",defaultClassNameDragged:"react-draggable-dragged",defaultPosition:{x:0,y:0},scale:1})})(yYe);const{default:TYe,DraggableCore:E7n}=yYe;u8.exports=TYe;u8.exports.default=TYe;u8.exports.DraggableCore=E7n;var kYe=u8.exports;const T7n=sn(kYe);var oue={exports:{}},CD={},sue={};sue.__esModule=!0;sue.cloneElement=D7n;var k7n=A7n(D);function A7n(t){return t&&t.__esModule?t:{default:t}}function HEe(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function qEe(t){for(var e=1;e=0)&&(n[i]=t[i]);return n}function XEe(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function UG(t){for(var e=1;eMath.abs(d*u)?o=i/u:i=o*u}var h=i,p=o,g=this.slack||[0,0],m=g[0],v=g[1];return i+=m,o+=v,a&&(i=Math.max(a[0],i),o=Math.max(a[1],o)),l&&(i=Math.min(l[0],i),o=Math.min(l[1],o)),this.slack=[m+(h-i),v+(p-o)],[i,o]},n.resizeHandler=function(i,o){var s=this;return function(a,l){var c=l.node,u=l.deltaX,f=l.deltaY;i==="onResizeStart"&&s.resetData();var d=(s.props.axis==="both"||s.props.axis==="x")&&o!=="n"&&o!=="s",h=(s.props.axis==="both"||s.props.axis==="y")&&o!=="e"&&o!=="w";if(!(!d&&!h)){var p=o[0],g=o[o.length-1],m=c.getBoundingClientRect();if(s.lastHandleRect!=null){if(g==="w"){var v=m.left-s.lastHandleRect.left;u+=v}if(p==="n"){var y=m.top-s.lastHandleRect.top;f+=y}}s.lastHandleRect=m,g==="w"&&(u=-u),p==="n"&&(f=-f);var x=s.props.width+(d?u/s.props.transformScale:0),b=s.props.height+(h?f/s.props.transformScale:0),w=s.runConstraints(x,b);x=w[0],b=w[1];var _=x!==s.props.width||b!==s.props.height,S=typeof s.props[i]=="function"?s.props[i]:null,O=i==="onResize"&&!_;S&&!O&&(a.persist==null||a.persist(),S(a,{node:c,size:{width:x,height:b},handle:o})),i==="onResizeStop"&&s.resetData()}}},n.renderResizeHandle=function(i,o){var s=this.props.handle;if(!s)return N2.createElement("span",{className:"react-resizable-handle react-resizable-handle-"+i,ref:o});if(typeof s=="function")return s(i,o);var a=typeof s.type=="string",l=UG({ref:o},a?{}:{handleAxis:i});return N2.cloneElement(s,l)},n.render=function(){var i=this,o=this.props,s=o.children,a=o.className,l=o.draggableOpts;o.width,o.height,o.handle,o.handleSize,o.lockAspectRatio,o.axis,o.minConstraints,o.maxConstraints,o.onResize,o.onResizeStop,o.onResizeStart;var c=o.resizeHandles;o.transformScale;var u=B7n(o,z7n);return(0,F7n.cloneElement)(s,UG(UG({},u),{},{className:(a?a+" ":"")+"react-resizable",children:[].concat(s.props.children,c.map(function(f){var d,h=(d=i.handleRefs[f])!=null?d:i.handleRefs[f]=N2.createRef();return N2.createElement($7n.DraggableCore,iJ({},l,{nodeRef:h,key:"resizableHandle-"+f,onStop:i.resizeHandler("onResizeStop",f),onStart:i.resizeHandler("onResizeStart",f),onDrag:i.resizeHandler("onResize",f)}),i.renderResizeHandle(f,h))}))}))},e}(N2.Component);CD.default=aue;aue.propTypes=N7n.resizableProps;aue.defaultProps={axis:"both",handleSize:[20,20],lockAspectRatio:!1,minConstraints:[20,20],maxConstraints:[1/0,1/0],resizeHandles:["se"],transformScale:1};var p8={};p8.__esModule=!0;p8.default=void 0;var WG=Q7n(D),H7n=PYe(hM),q7n=PYe(CD),X7n=OD,Y7n=["handle","handleSize","onResize","onResizeStart","onResizeStop","draggableOpts","minConstraints","maxConstraints","lockAspectRatio","axis","width","height","resizeHandles","style","transformScale"];function PYe(t){return t&&t.__esModule?t:{default:t}}function MYe(t){if(typeof WeakMap!="function")return null;var e=new WeakMap,n=new WeakMap;return(MYe=function(i){return i?n:e})(t)}function Q7n(t,e){if(t&&t.__esModule)return t;if(t===null||typeof t!="object"&&typeof t!="function")return{default:t};var n=MYe(e);if(n&&n.has(t))return n.get(t);var r={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in t)if(o!=="default"&&Object.prototype.hasOwnProperty.call(t,o)){var s=i?Object.getOwnPropertyDescriptor(t,o):null;s&&(s.get||s.set)?Object.defineProperty(r,o,s):r[o]=t[o]}return r.default=t,n&&n.set(t,r),r}function sJ(){return sJ=Object.assign?Object.assign.bind():function(t){for(var e=1;e=0)&&(n[i]=t[i]);return n}function tGn(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,aJ(t,e)}function aJ(t,e){return aJ=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},aJ(t,e)}var RYe=function(t){tGn(e,t);function e(){for(var r,i=arguments.length,o=new Array(i),s=0;sn(t,!i.visible)}),r?C.jsx(_h,{}):C.jsx(_h,{variant:"inset",component:"li",style:{margin:"0 0 0 52px"}})]})}const rGn={x:48,y:128},iGn={width:320,height:520},I$={resizeBox:{position:"absolute",zIndex:1e3},windowPaper:{width:"100%",height:"100%",display:"flex",flexDirection:"column"},windowHeader:t=>({display:"flex",justifyContent:"space-between",alignItems:"center",cursor:"move",padding:1,marginBottom:"2px",borderBottom:`1px solid ${t.palette.mode==="dark"?"#FFFFFF3F":"#0000003F"}`}),windowTitle:{fontWeight:"bolder"}};function oGn(t){const[e,n]=D.useState(rGn),[r,i]=D.useState(iGn),{layerMenuOpen:o,setLayerMenuOpen:s,openDialog:a,...l}=t;if(!o)return null;console.log("layerProps",l);const c=()=>{a("userOverlays")},u=()=>{a("userBaseMaps")},f=()=>{s(!1)},d=(p,g)=>{n({...g})},h=(p,g)=>{i({...g.size})};return C.jsx(T7n,{handle:"#layer-select-header",position:e,onStop:d,children:C.jsx(nGn,{width:r.width,height:r.height,style:I$.resizeBox,onResize:h,children:C.jsxs(Tl,{elevation:10,sx:I$.windowPaper,component:"div",children:[C.jsxs(ot,{id:"layer-select-header",sx:I$.windowHeader,children:[C.jsx(ot,{component:"span",sx:I$.windowTitle,children:me.get("Layers")}),C.jsx(Ht,{size:"small",onClick:f,children:C.jsx(WO,{fontSize:"inherit"})})]}),C.jsx(ot,{sx:{width:"100%",overflow:"auto",flexGrow:1},children:C.jsxs(y4,{dense:!0,children:[C.jsx(yp,{layerId:"overlay",...l}),C.jsx(yp,{layerId:"userPlaces",...l}),C.jsx(yp,{layerId:"datasetPlaces",...l}),C.jsx(yp,{layerId:"datasetBoundary",...l}),C.jsx(yp,{layerId:"datasetVariable",...l}),C.jsx(yp,{layerId:"datasetVariable2",...l}),C.jsx(yp,{layerId:"datasetRgb",...l}),C.jsx(yp,{layerId:"datasetRgb2",...l}),C.jsx(yp,{layerId:"baseMap",...l,last:!0}),C.jsx(ti,{onClick:u,children:me.get("User Base Maps")+"..."}),C.jsx(ti,{onClick:c,children:me.get("User Overlays")+"..."})]})})]})})})}const sGn=t=>({locale:t.controlState.locale,layerMenuOpen:t.controlState.layerMenuOpen,layerStates:X_t(t)}),aGn={openDialog:_1,setLayerMenuOpen:d8e,setLayerVisibility:oKt},lGn=Rn(sGn,aGn)(oGn),cGn=t=>({locale:t.controlState.locale,hasConsent:t.controlState.privacyNoticeAccepted,compact:Pn.instance.branding.compact}),uGn={},fGn=be("main")(({theme:t})=>({padding:0,width:"100vw",height:"100vh",overflow:"hidden",display:"flex",flexDirection:"column",alignItems:"stretch",[t.breakpoints.up("md")]:{overflow:"hidden"}})),dGn=({hasConsent:t,compact:e})=>C.jsxs(fGn,{children:[!e&&C.jsx(b4,{variant:"dense"}),t&&C.jsxs(C.Fragment,{children:[C.jsx(ifn,{}),C.jsx(U9n,{}),C.jsx(lGn,{})]})]}),hGn=Rn(cGn,uGn)(dGn),pGn={icon:t=>({marginRight:t.spacing(2)})};function gGn({open:t,settings:e,updateSettings:n,syncWithServer:r}){const[i,o]=D.useState(null),{store:s}=D.useContext(Oj);if(D.useEffect(()=>{const c=me.get("docs/privacy-note.en.md");fetch(c).then(u=>u.text()).then(u=>o(u))}),!t)return null;function a(){n({...e,privacyNoticeAccepted:!0}),r(s)}function l(){try{window.history.length>0?window.history.back():typeof window.home=="function"?window.home():window.location.href="about:home"}catch(c){console.error(c)}}return C.jsxs(ed,{open:t,disableEscapeKeyDown:!0,keepMounted:!0,scroll:"body",children:[C.jsx(Iy,{children:me.get("Privacy Notice")}),C.jsx(zf,{children:C.jsx(Tat,{children:i===null?C.jsx(Dy,{}):C.jsx(mU,{children:i,linkTarget:"_blank"})})}),C.jsxs(Yb,{children:[C.jsxs(Vr,{onClick:a,children:[C.jsx(DYe,{sx:pGn.icon}),me.get("Accept and continue")]}),C.jsx(Vr,{onClick:l,children:me.get("Leave")})]})]})}const mGn=t=>({open:!t.controlState.privacyNoticeAccepted,settings:t.controlState}),vGn={updateSettings:YR,syncWithServer:Zae},yGn=Rn(mGn,vGn)(gGn),xGn=ra(Dy)(({theme:t})=>({margin:t.spacing(2)})),bGn=ra(Jt)(({theme:t})=>({margin:t.spacing(1)})),wGn=ra("div")(({theme:t})=>({margin:t.spacing(1),textAlign:"center",display:"flex",alignItems:"center",flexDirection:"column"}));function _Gn({messages:t}){return t.length===0?null:C.jsxs(ed,{open:!0,"aria-labelledby":"loading",children:[C.jsx(Iy,{id:"loading",children:me.get("Please wait...")}),C.jsxs(wGn,{children:[C.jsx(xGn,{}),t.map((e,n)=>C.jsx(bGn,{children:e},n))]})]})}const SGn=t=>({locale:t.controlState.locale,messages:W_t(t)}),CGn={},OGn=Rn(SGn,CGn)(_Gn),EGn=ct(C.jsx("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m1 15h-2v-2h2zm0-4h-2V7h2z"}),"Error"),TGn=ct(C.jsx("path",{d:"M1 21h22L12 2zm12-3h-2v-2h2zm0-4h-2v-4h2z"}),"Warning"),kGn=ct(C.jsx("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m-2 15-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8z"}),"CheckCircle"),AGn={success:kGn,warning:TGn,error:EGn,info:GVe},PGn=ra("span")(()=>({display:"flex",alignItems:"center"})),L$={close:{p:.5},success:t=>({color:t.palette.error.contrastText,backgroundColor:Mp[600]}),error:t=>({color:t.palette.error.contrastText,backgroundColor:t.palette.error.dark}),info:t=>({color:t.palette.error.contrastText,backgroundColor:t.palette.primary.dark}),warning:t=>({color:t.palette.error.contrastText,backgroundColor:Xke[700]}),icon:{fontSize:20},iconVariant:t=>({opacity:.9,marginRight:t.spacing(1),fontSize:20}),message:{display:"flex",alignItems:"center"}},MGn={vertical:"bottom",horizontal:"center"};function RGn({className:t,message:e,hideMessage:n}){const r=()=>{n(e.id)};if(!e)return null;const i=AGn[e.type];return C.jsx(kut,{open:!0,anchorOrigin:MGn,autoHideDuration:5e3,onClose:r,children:C.jsx(EPe,{sx:L$[e.type],className:t,"aria-describedby":"client-snackbar",message:C.jsxs(PGn,{id:"client-snackbar",children:[C.jsx(i,{sx:L$.iconVariant}),e.text]}),action:[C.jsx(Ht,{"aria-label":"Close",color:"inherit",sx:L$.close,onClick:r,size:"large",children:C.jsx(WO,{sx:L$.icon})},"close")]})},e.type+":"+e.text)}const DGn=t=>{const e=t.messageLogState.newEntries;return{locale:t.controlState.locale,message:e.length>0?e[0]:null}},IGn={hideMessage:lQt},LGn=Rn(DGn,IGn)(RGn),lJ=ct(C.jsx("path",{d:"M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6z"}),"Add"),LYe=ct(C.jsx("path",{d:"M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7H6zM19 4h-3.5l-1-1h-5l-1 1H5v2h14z"}),"Delete"),kw={formControl:t=>({marginLeft:t.spacing(1),marginRight:t.spacing(1),width:200}),textField:t=>({marginLeft:t.spacing(1),marginRight:t.spacing(1),width:200}),textField2:t=>({marginLeft:t.spacing(1),marginRight:t.spacing(1),width:400}),button:t=>({margin:t.spacing(.1)})};function $Gn({open:t,servers:e,selectedServer:n,closeDialog:r,configureServers:i}){const o=D.useRef(!1),[s,a]=D.useState(e),[l,c]=D.useState(n),[u,f]=D.useState("select");D.useEffect(()=>{o.current&&(a(e),c(n)),o.current=!0},[e,n]);const{store:d}=D.useContext(Oj),h=()=>{u==="select"?(r("server"),i(s,l.id,d)):u==="add"?E():u==="edit"&&P()},p=()=>{u==="select"?_():A()},g=()=>{_()},m=N=>{const z=N.target.value,L=s.find(B=>B.id===z);c(L)},v=N=>{const z=N.target.value,L={...l,name:z};c(L)},y=N=>{const z=N.target.value,L={...l,url:z};c(L)},x=()=>{f("add")},b=()=>{f("edit")},w=()=>{R()},_=()=>{r("server")},S=()=>{const N=l.id;return s.findIndex(z=>z.id===N)},O=(N,z)=>{const L=[...s];L[N]=z,a(L),c(z),f("select")},k=(N,z)=>{a(N),c(z),f("select")},E=()=>{const N={...l,id:Uf("server-")},z=[...s,N];k(z,N)},P=()=>{O(S(),{...l})},A=()=>{const N=S();O(S(),s[N])},R=()=>{const N=[...s];if(N.length<2)throw new Error("internal error: server list cannot be emptied");const z=S(),L=N[z+(z>0?-1:1)];N.splice(z,1),k(N,L)},T=s.map((N,z)=>C.jsx(ti,{value:N.id,children:N.name},z));let M;u==="add"?M=me.get("Add"):u==="edit"?M=me.get("Save"):M=me.get("OK");let I;u==="add"?I=me.get("Add Server"):u==="edit"?I=me.get("Edit Server"):I=me.get("Select Server");let j;return u==="add"||u==="edit"?j=C.jsxs(zf,{dividers:!0,children:[C.jsx(di,{variant:"standard",required:!0,id:"server-name",label:"Name",sx:kw.textField,margin:"normal",value:l.name,onChange:v}),C.jsx("br",{}),C.jsx(di,{variant:"standard",required:!0,id:"server-url",label:"URL",sx:kw.textField2,margin:"normal",value:l.url,onChange:y})]}):j=C.jsx(zf,{dividers:!0,children:C.jsxs("div",{children:[C.jsxs(Ug,{variant:"standard",sx:kw.formControl,children:[C.jsx(Ly,{htmlFor:"server-name",children:"Name"}),C.jsx(Wg,{variant:"standard",value:l.id,onChange:m,inputProps:{name:"server-name",id:"server-name"},children:T}),C.jsx(Uee,{children:l.url})]}),C.jsx(Ht,{sx:kw.button,"aria-label":"Add",color:"primary",onClick:x,size:"large",children:C.jsx(lJ,{fontSize:"small"})}),C.jsx(Ht,{sx:kw.button,"aria-label":"Edit",onClick:b,size:"large",children:C.jsx(VO,{fontSize:"small"})}),C.jsx(Ht,{sx:kw.button,"aria-label":"Delete",disabled:s.length<2,onClick:w,size:"large",children:C.jsx(LYe,{fontSize:"small"})})]})}),C.jsxs(ed,{open:t,onClose:g,"aria-labelledby":"server-dialog-title",children:[C.jsx(Iy,{id:"server-dialog-title",children:I}),j,C.jsxs(Yb,{children:[C.jsx(Vr,{onClick:p,children:me.get("Cancel")}),C.jsx(Vr,{onClick:h,autoFocus:!0,children:M})]})]})}const FGn=t=>({open:!!t.controlState.dialogOpen.server,servers:QRe(t),selectedServer:Oo(t)}),NGn={closeDialog:jO,configureServers:zQt},zGn=Rn(FGn,NGn)($Gn),QEe=({anchorElement:t,layers:e,selectedLayerId:n,setSelectedLayerId:r,onClose:i})=>C.jsx($y,{anchorEl:t,keepMounted:!0,open:!!t,onClose:i,children:t&&e.map(o=>C.jsx(ti,{selected:o.id===n,onClick:()=>r(o.id===n?null:o.id),dense:!0,children:C.jsx(du,{primary:sN(o)})},o.id))}),VG={settingsPanelTitle:t=>({marginBottom:t.spacing(1)}),settingsPanelPaper:t=>({backgroundColor:(t.palette.mode==="dark"?Tg:Eg)(t.palette.background.paper,.1),marginBottom:t.spacing(2)}),settingsPanelList:{margin:0}},Bw=({title:t,children:e})=>{const n=de.Children.count(e),r=[];return de.Children.forEach(e,(i,o)=>{r.push(i),o{let i;e||(i={marginBottom:10});const o=C.jsx(du,{primary:t,secondary:e});let s;return r&&(s=C.jsx(aA,{children:r})),n?C.jsxs(vPe,{style:i,onClick:n,children:[o,s]}):C.jsxs(P_,{style:i,children:[o,s]})},Ev=({propertyName:t,settings:e,updateSettings:n,disabled:r})=>C.jsx(TPe,{checked:!!e[t],onChange:()=>n({...e,[t]:!e[t]}),disabled:r}),jGn=({propertyName:t,settings:e,updateSettings:n,options:r,disabled:i})=>{const o=(s,a)=>{n({...e,[t]:a})};return C.jsx(Vee,{row:!0,value:e[t],onChange:o,children:r.map(([s,a])=>C.jsx(Px,{control:C.jsx(JT,{}),value:a,label:s,disabled:i},s))})},z2={textField:t=>({marginLeft:t.spacing(1),marginRight:t.spacing(1),fontSize:t.typography.fontSize/2}),intTextField:t=>({marginLeft:t.spacing(1),marginRight:t.spacing(1),fontSize:t.typography.fontSize/2,width:t.spacing(6)}),localeAvatar:{margin:10}},KEe=[["doNothing","Do nothing"],["pan","Pan"],["panAndZoom","Pan and zoom"]],BGn=[["point","Points"],["line","Lines"],["bar","Bars"]],UGn=({open:t,closeDialog:e,settings:n,selectedServer:r,baseMapLayers:i,overlayLayers:o,updateSettings:s,changeLocale:a,openDialog:l,viewerVersion:c,serverInfo:u})=>{const[f,d]=de.useState(null),[h,p]=de.useState(null),[g,m]=de.useState(null),[v,y]=de.useState(n.timeChunkSize+"");if(de.useEffect(()=>{const $=parseInt(v);!Number.isNaN($)&&$!==n.timeChunkSize&&s({timeChunkSize:$})},[v,n,s]),!t)return null;function x(){e("settings")}function b(){l("server")}function w($){s({timeAnimationInterval:parseInt($.target.value)})}function _($){s({timeSeriesChartTypeDefault:$.target.value})}function S($){s({datasetLocateMode:$.target.value})}function O($){s({placeLocateMode:$.target.value})}function k($){y($.target.value)}let E=null;f&&(E=Object.getOwnPropertyNames(me.languages).map($=>{const q=me.languages[$];return C.jsx(ti,{selected:$===n.locale,onClick:()=>a($),children:C.jsx(du,{primary:q})},$)}));function P($){d($.currentTarget)}function A(){d(null)}function R($){p($.currentTarget)}function T(){p(null)}const M=$=>{$.stopPropagation(),l("userBaseMaps")},I=aN(i,n.selectedBaseMapId),j=sN(I);function N($){m($.currentTarget)}function z(){m(null)}const L=$=>{$.stopPropagation(),l("userOverlays")},B=aN(o,n.selectedOverlayId),F=sN(B);return C.jsxs("div",{children:[C.jsxs(ed,{open:t,fullWidth:!0,maxWidth:"sm",onClose:x,scroll:"body",children:[C.jsx(Iy,{children:me.get("Settings")}),C.jsxs(zf,{children:[C.jsxs(Bw,{title:me.get("General"),children:[C.jsx(xi,{label:me.get("Server"),value:r.name,onClick:b}),C.jsx(xi,{label:me.get("Language"),value:me.languages[n.locale],onClick:P}),C.jsx(xi,{label:me.get("Time interval of the player"),children:C.jsx(di,{variant:"standard",select:!0,sx:z2.textField,value:n.timeAnimationInterval,onChange:w,margin:"normal",children:dwt.map(($,q)=>C.jsx(ti,{value:$,children:$+" ms"},q))})})]}),C.jsxs(Bw,{title:me.get("Time-Series"),children:[C.jsx(xi,{label:me.get("Show chart after adding a place"),value:$$(n.autoShowTimeSeries),children:C.jsx(Ev,{propertyName:"autoShowTimeSeries",settings:n,updateSettings:s})}),C.jsx(xi,{label:me.get("Default chart type"),children:C.jsx(di,{variant:"standard",select:!0,sx:z2.textField,value:n.timeSeriesChartTypeDefault,onChange:_,margin:"normal",children:BGn.map(([$,q])=>C.jsx(ti,{value:$,children:me.get(q)},$))})}),C.jsx(xi,{label:me.get("Calculate standard deviation"),value:$$(n.timeSeriesIncludeStdev),children:C.jsx(Ev,{propertyName:"timeSeriesIncludeStdev",settings:n,updateSettings:s})}),C.jsx(xi,{label:me.get("Calculate median instead of mean (disables standard deviation)"),value:$$(n.timeSeriesUseMedian),children:C.jsx(Ev,{propertyName:"timeSeriesUseMedian",settings:n,updateSettings:s})}),C.jsx(xi,{label:me.get("Minimal number of data points in a time series update"),children:C.jsx(di,{variant:"standard",sx:z2.intTextField,value:v,onChange:k,margin:"normal",size:"small"})})]}),C.jsxs(Bw,{title:me.get("Map"),children:[C.jsx(xi,{label:me.get("Base map"),value:j,onClick:R,children:C.jsx(Vr,{onClick:M,children:me.get("User Base Maps")+"..."})}),C.jsx(xi,{label:me.get("Overlay"),value:F,onClick:N,children:C.jsx(Vr,{onClick:L,children:me.get("User Overlays")+"..."})}),C.jsx(xi,{label:me.get("Projection"),children:C.jsx(jGn,{propertyName:"mapProjection",settings:n,updateSettings:s,options:[[me.get("Geographic"),tO],[me.get("Mercator"),jte]]})}),C.jsx(xi,{label:me.get("Image smoothing"),value:$$(n.imageSmoothingEnabled),children:C.jsx(Ev,{propertyName:"imageSmoothingEnabled",settings:n,updateSettings:s})}),C.jsx(xi,{label:me.get("On dataset selection"),children:C.jsx(di,{variant:"standard",select:!0,sx:z2.textField,value:n.datasetLocateMode,onChange:S,margin:"normal",children:KEe.map(([$,q])=>C.jsx(ti,{value:$,children:me.get(q)},$))})}),C.jsx(xi,{label:me.get("On place selection"),children:C.jsx(di,{variant:"standard",select:!0,sx:z2.textField,value:n.placeLocateMode,onChange:O,margin:"normal",children:KEe.map(([$,q])=>C.jsx(ti,{value:$,children:me.get(q)},$))})})]}),C.jsx(Bw,{title:me.get("Legal Agreement"),children:C.jsx(xi,{label:me.get("Privacy notice"),value:n.privacyNoticeAccepted?me.get("Accepted"):"",children:C.jsx(Vr,{disabled:!n.privacyNoticeAccepted,onClick:()=>{s({privacyNoticeAccepted:!1}),window.location.reload()},children:me.get("Revoke consent")})})}),C.jsxs(Bw,{title:me.get("System Information"),children:[C.jsx(xi,{label:`xcube Viewer ${me.get("version")}`,value:c}),C.jsx(xi,{label:`xcube Server ${me.get("version")}`,value:u?u.version:me.get("Cannot reach server")})]})]})]}),C.jsx($y,{anchorEl:f,keepMounted:!0,open:!!f,onClose:A,children:E}),C.jsx(QEe,{anchorElement:h,layers:i,selectedLayerId:n.selectedBaseMapId,setSelectedLayerId:$=>s({selectedBaseMapId:$}),onClose:T}),C.jsx(QEe,{anchorElement:g,layers:o,selectedLayerId:n.selectedOverlayId,setSelectedLayerId:$=>s({selectedOverlayId:$}),onClose:z})]})},$$=t=>t?me.get("On"):me.get("Off"),WGn="1.4.0-dev.0",VGn=t=>({locale:t.controlState.locale,open:t.controlState.dialogOpen.settings,settings:t.controlState,baseMapLayers:ane(t),overlayLayers:lne(t),selectedServer:Oo(t),viewerVersion:WGn,serverInfo:t.dataState.serverInfo}),GGn={closeDialog:jO,updateSettings:YR,changeLocale:S8e,openDialog:_1},HGn=Rn(VGn,GGn)(UGn),ZEe={separatorTextField:t=>({marginLeft:t.spacing(1),marginRight:t.spacing(1),fontSize:t.typography.fontSize/2,maxWidth:"6em"}),fileNameTextField:t=>({marginLeft:t.spacing(1),marginRight:t.spacing(1),fontSize:t.typography.fontSize/2})},qGn=({open:t,closeDialog:e,settings:n,updateSettings:r,downloadTimeSeries:i})=>{const o=()=>{e("export")};function s(c){r({exportFileName:c.target.value})}function a(c){r({exportTimeSeriesSeparator:c.target.value})}const l=()=>{o(),i()};return C.jsx("div",{children:C.jsxs(ed,{open:t,fullWidth:!0,maxWidth:"xs",onClose:o,scroll:"body",children:[C.jsx(zf,{children:C.jsxs(Bw,{title:me.get("Export Settings"),children:[C.jsx(xi,{label:me.get("Include time-series data")+" (*.txt)",value:F$(n.exportTimeSeries),children:C.jsx(Ev,{propertyName:"exportTimeSeries",settings:n,updateSettings:r})}),C.jsx(xi,{label:me.get("Separator for time-series data"),children:C.jsx(di,{variant:"standard",sx:ZEe.separatorTextField,value:n.exportTimeSeriesSeparator,onChange:a,disabled:!n.exportTimeSeries,margin:"normal",size:"small"})}),C.jsx(xi,{label:me.get("Include places data")+" (*.geojson)",value:F$(n.exportPlaces),children:C.jsx(Ev,{propertyName:"exportPlaces",settings:n,updateSettings:r})}),C.jsx(xi,{label:me.get("Combine place data in one file"),value:F$(n.exportPlacesAsCollection),children:C.jsx(Ev,{propertyName:"exportPlacesAsCollection",settings:n,updateSettings:r,disabled:!n.exportPlaces})}),C.jsx(xi,{label:me.get("As ZIP archive"),value:F$(n.exportZipArchive),children:C.jsx(Ev,{propertyName:"exportZipArchive",settings:n,updateSettings:r})}),C.jsx(xi,{label:me.get("File name"),children:C.jsx(di,{variant:"standard",sx:ZEe.fileNameTextField,value:n.exportFileName,onChange:s,margin:"normal",size:"small"})})]})}),C.jsx(Yb,{children:C.jsx(Vr,{onClick:l,disabled:!QGn(n),children:me.get("Download")})})]})})},F$=t=>t?me.get("On"):me.get("Off"),XGn=t=>/^[0-9a-zA-Z_-]+$/.test(t),YGn=t=>t.toUpperCase()==="TAB"||t.length===1,QGn=t=>(t.exportTimeSeries||t.exportPlaces)&&XGn(t.exportFileName)&&(!t.exportTimeSeries||YGn(t.exportTimeSeriesSeparator)),KGn=t=>({locale:t.controlState.locale,open:!!t.controlState.dialogOpen.export,settings:t.controlState}),ZGn={closeDialog:jO,updateSettings:YR,downloadTimeSeries:qQt},JGn=Rn(KGn,ZGn)(qGn),eHn=ct(C.jsx("path",{d:"M16.59 8.59 12 13.17 7.41 8.59 6 10l6 6 6-6z"}),"ExpandMore"),tHn=ct(C.jsx("path",{d:"m12 8-6 6 1.41 1.41L12 10.83l4.59 4.58L18 14z"}),"ExpandLess"),nHn=({title:t,accept:e,multiple:n,disabled:r,onSelect:i,className:o})=>{const s=D.useRef(null),a=c=>{if(c.target.files!==null&&c.target.files.length){const u=[];for(let f=0;f{s.current!==null&&s.current.click()};return C.jsxs(C.Fragment,{children:[C.jsx("input",{type:"file",accept:e,multiple:n,ref:s,hidden:!0,onChange:a,disabled:r}),C.jsx(Vr,{onClick:l,disabled:r,className:o,variant:"outlined",size:"small",children:t})]})},GG={parse:t=>t,format:t=>typeof t=="string"?t:`${t}`,validate:t=>!0};function lue(){return t=>{const{options:e,updateOptions:n,optionKey:r,label:i,style:o,className:s,disabled:a,parse:l,format:c,validate:u}=t,f=e[r],d=h=>{const p=h.target.value,g=(l||GG.parse)(p);n({[r]:g})};return C.jsx(di,{label:me.get(i),value:(c||GG.format)(f),error:!(u||GG.validate)(f),onChange:d,style:o,className:s,disabled:a,size:"small",variant:"standard"})}}const j2=lue(),rHn=ra("div")(({theme:t})=>({paddingTop:t.spacing(2)})),iHn=({options:t,updateOptions:e})=>C.jsx(rHn,{children:C.jsxs("div",{style:{display:"grid",gap:12,paddingTop:12,gridTemplateColumns:"auto auto"},children:[C.jsx(j2,{optionKey:"timeNames",label:"Time property names",options:t,updateOptions:e}),C.jsx("div",{id:"spareField"}),C.jsx(j2,{label:"Group property names",optionKey:"groupNames",options:t,updateOptions:e}),C.jsx(j2,{label:"Group prefix (used as fallback)",optionKey:"groupPrefix",options:t,updateOptions:e}),C.jsx(j2,{label:"Label property names",optionKey:"labelNames",options:t,updateOptions:e}),C.jsx(j2,{label:"Label prefix (used as fallback)",optionKey:"labelPrefix",options:t,updateOptions:e})]})}),ca=lue(),oHn=ra("div")(({theme:t})=>({paddingTop:t.spacing(2)})),sHn=({options:t,updateOptions:e})=>{const n=t.forceGeometry;return C.jsxs(oHn,{children:[C.jsxs("div",{style:{display:"grid",gap:12,paddingTop:12,gridTemplateColumns:"auto auto"},children:[C.jsx(ca,{optionKey:"xNames",label:"X/longitude column names",options:t,updateOptions:e,disabled:n}),C.jsx(ca,{optionKey:"yNames",label:"Y/latitude column names",options:t,updateOptions:e,disabled:n}),C.jsxs("span",{children:[C.jsx(LF,{checked:t.forceGeometry,onChange:r=>e({forceGeometry:r.target.checked}),size:"small"}),C.jsx("span",{children:"Use geometry column"})]}),C.jsx(ca,{optionKey:"geometryNames",label:"Geometry column names",options:t,updateOptions:e,disabled:!n}),C.jsx(ca,{optionKey:"timeNames",label:"Time column names",options:t,updateOptions:e}),C.jsx("div",{id:"spareField"}),C.jsx(ca,{optionKey:"groupNames",label:"Group column names",options:t,updateOptions:e}),C.jsx(ca,{optionKey:"groupPrefix",label:"Group prefix (used as fallback)",options:t,updateOptions:e}),C.jsx(ca,{optionKey:"labelNames",label:"Label column names",options:t,updateOptions:e}),C.jsx(ca,{optionKey:"labelPrefix",label:"Label prefix (used as fallback)",options:t,updateOptions:e})]}),C.jsxs("div",{style:{display:"grid",gap:12,paddingTop:12,gridTemplateColumns:"auto auto auto"},children:[C.jsx(ca,{optionKey:"separator",label:"Separator character",options:t,updateOptions:e}),C.jsx(ca,{optionKey:"comment",label:"Comment character",options:t,updateOptions:e}),C.jsx(ca,{optionKey:"quote",label:"Quote character",options:t,updateOptions:e}),C.jsx(ca,{optionKey:"escape",label:"Escape character",options:t,updateOptions:e}),C.jsx("div",{}),C.jsxs("span",{children:[C.jsx(LF,{checked:t.trim,onChange:r=>e({trim:r.target.checked}),size:"small"}),C.jsx("span",{children:"Remove whitespaces"})]}),C.jsx(ca,{optionKey:"nanToken",label:"Not-a-number token",options:t,updateOptions:e}),C.jsx(ca,{optionKey:"trueToken",label:"True token",options:t,updateOptions:e}),C.jsx(ca,{optionKey:"falseToken",label:"False token",options:t,updateOptions:e})]})]})},B2=lue(),aHn=ra("div")(({theme:t})=>({paddingTop:t.spacing(2)})),lHn=({options:t,updateOptions:e})=>C.jsx(aHn,{children:C.jsxs("div",{style:{display:"grid",gap:12,paddingTop:12,gridTemplateColumns:"auto auto"},children:[C.jsx(B2,{optionKey:"time",label:"Time (UTC, ISO-format)",options:t,updateOptions:e}),C.jsx("div",{id:"spareField"}),C.jsx(B2,{label:"Group",options:t,optionKey:"group",updateOptions:e}),C.jsx(B2,{label:"Group prefix (used as fallback)",optionKey:"groupPrefix",options:t,updateOptions:e,disabled:t.group.trim()!==""}),C.jsx(B2,{label:"Label",optionKey:"label",options:t,updateOptions:e}),C.jsx(B2,{label:"Label prefix (used as fallback)",optionKey:"labelPrefix",options:t,updateOptions:e,disabled:t.label.trim()!==""})]})}),HG={csv:{...fDe,codeExt:[]},geojson:{...dDe,codeExt:[YGe()]},wkt:{...hDe,codeExt:[]}},qG={spacer:{flexGrow:1},actionButton:t=>({marginRight:t.spacing(1)}),error:{fontSize:"small"}},cHn=ra("div")(({theme:t})=>({paddingTop:t.spacing(.5),display:"flex",flexDirection:"row",alignItems:"center"})),uHn=ra(nHn)(({theme:t})=>({marginRight:t.spacing(1)})),fHn=({open:t,closeDialog:e,userPlacesFormatName:n,userPlacesFormatOptions:r,updateSettings:i,addUserPlacesFromText:o,nextMapInteraction:s,setMapInteraction:a})=>{const[l,c]=D.useState(""),[u,f]=D.useState(null),[d,h]=D.useState(!1),[p,g]=D.useState(!1),[m,v]=D.useState(n),[y,x]=D.useState(r);if(D.useEffect(()=>{v(n)},[n]),D.useEffect(()=>{x(r)},[r]),!t)return null;const b=()=>{a("Select"),e("addUserPlacesFromText"),i({userPlacesFormatName:m,userPlacesFormatOptions:y}),o(l)},w=()=>{a(s),e("addUserPlacesFromText")},_=()=>{c("")},S=I=>{const j=I[0];h(!0);const N=new FileReader;N.onloadend=()=>{const z=N.result;v(vpe(z)),c(z),h(!1)},N.onabort=N.onerror=()=>{h(!1)},N.readAsText(j,"UTF-8")},O=()=>{c("")},k=()=>{console.info("PASTE!",l)},E=I=>{let j=m;l===""&&I.length>10&&(j=vpe(I),v(j)),c(I),f(HG[j].checkError(I))};function P(I){v(I.target.value)}function A(I){x({...y,csv:{...y.csv,...I}})}function R(I){x({...y,geojson:{...y.geojson,...I}})}function T(I){x({...y,wkt:{...y.wkt,...I}})}let M;return m==="csv"?M=C.jsx(sHn,{options:y.csv,updateOptions:A}):m==="geojson"?M=C.jsx(iHn,{options:y.geojson,updateOptions:R}):M=C.jsx(lHn,{options:y.wkt,updateOptions:T}),C.jsxs(ed,{fullWidth:!0,open:t,onClose:w,"aria-labelledby":"server-dialog-title",children:[C.jsx(Iy,{id:"server-dialog-title",children:me.get("Import places")}),C.jsxs(zf,{dividers:!0,children:[C.jsxs(Vee,{row:!0,value:m,onChange:I=>P(I),children:[C.jsx(Px,{value:"csv",label:me.get(fDe.name),control:C.jsx(JT,{})},"csv"),C.jsx(Px,{value:"geojson",label:me.get(dDe.name),control:C.jsx(JT,{})},"geojson"),C.jsx(Px,{value:"wkt",label:me.get(hDe.name),control:C.jsx(JT,{})},"wkt")]}),C.jsx(FU,{theme:Pn.instance.branding.themeName||"light",placeholder:me.get("Enter text or drag & drop a text file."),autoFocus:!0,height:"400px",extensions:HG[m].codeExt,value:l,onChange:E,onDrop:O,onPaste:k,onPasteCapture:k}),u&&C.jsx(Jt,{color:"error",sx:qG.error,children:u}),C.jsxs(cHn,{children:[C.jsx(uHn,{title:me.get("From File")+"...",accept:HG[m].fileExt,multiple:!1,onSelect:S,disabled:d}),C.jsx(Vr,{onClick:_,disabled:l.trim()===""||d,sx:qG.actionButton,variant:"outlined",size:"small",children:me.get("Clear")}),C.jsx(ot,{sx:qG.spacer}),C.jsx(Vr,{onClick:()=>g(!p),endIcon:p?C.jsx(tHn,{}):C.jsx(eHn,{}),variant:"outlined",size:"small",children:me.get("Options")})]}),C.jsx(AF,{in:p,timeout:"auto",unmountOnExit:!0,children:M})]}),C.jsxs(Yb,{children:[C.jsx(Vr,{onClick:w,variant:"text",children:me.get("Cancel")}),C.jsx(Vr,{onClick:b,disabled:l.trim()===""||u!==null||d,variant:"text",children:me.get("OK")})]})]})},dHn=t=>({open:t.controlState.dialogOpen.addUserPlacesFromText,userPlacesFormatName:t.controlState.userPlacesFormatName,userPlacesFormatOptions:t.controlState.userPlacesFormatOptions,nextMapInteraction:t.controlState.lastMapInteraction}),hHn={closeDialog:jO,updateSettings:YR,setMapInteraction:u8e,addUserPlacesFromText:kUe},pHn=Rn(dHn,hHn)(fHn),$Ye=ct(C.jsx("path",{d:"M16 1H4c-1.1 0-2 .9-2 2v14h2V3h12zm3 4H8c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h11c1.1 0 2-.9 2-2V7c0-1.1-.9-2-2-2m0 16H8V7h11z"}),"ContentCopy");function cue(t,e){return FYe(t,e,[]).join("")}function FYe(t,e,n){if(t.nodeType==Node.CDATA_SECTION_NODE||t.nodeType==Node.TEXT_NODE)n.push(t.nodeValue);else{var r=void 0;for(r=t.firstChild;r;r=r.nextSibling)FYe(r,e,n)}return n}function gHn(t){return"documentElement"in t}function mHn(t){return new DOMParser().parseFromString(t,"application/xml")}function NYe(t,e){return function(n,r){var i=t.call(this,n,r);if(i!==void 0){var o=r[r.length-1];o.push(i)}}}function Gl(t,e,n){return function(r,i){var o=t.call(this,r,i);if(o!==void 0){var s=i[i.length-1],a=r.localName,l=void 0;a in s?l=s[a]:(l=[],s[a]=l),l.push(o)}}}function It(t,e,n){return function(r,i){var o=t.call(this,r,i);if(o!==void 0){var s=i[i.length-1],a=r.localName;s[a]=o}}}function Os(t,e,n){var r={},i,o;for(i=0,o=t.length;i{const n=e.Name,r=e.Title||n;let i;const o=e.Attribution;if(lj(o)){const s=o.Title,a=o.OnlineResource;s&&a?i=`© ${s}`:a?i=`${a}`:s&&(i=`${s}`)}return{name:n,title:r,attribution:i}})}function oqn(t){const e=tqn.read(t);if(lj(e)){const n=e.Capability;if(lj(n))return cJ(n,!0)}throw new Error("invalid WMSCapabilities object")}function cJ(t,e){let n,r;if(e)n=t.Layer;else{const{Layer:o,...s}=t;n=o,r=s}let i;return Array.isArray(n)?i=n.flatMap(o=>cJ(o)):lj(n)?i=cJ(n):i=[{}],i.map(o=>sqn(r,o))}function sqn(t,e){if(!t)return e;if(typeof(t.Name||e.Name)!="string")throw new Error("invalid WMSCapabilities: missing Layer/Name");const r=t.Title,i=e.Title,o=r&&i?`${r} / ${i}`:i||r;return{...t,...e,Title:o}}function lj(t){return t!==null&&typeof t=="object"&&!Array.isArray(t)}const aqn=({userLayer:t,onChange:e,onCancel:n})=>{const[r,i]=D.useState(t.url),[o,s]=D.useState(null),[a,l]=D.useState(-1);D.useEffect(()=>{nqn(r).then(f=>{s(f)})},[r]),D.useEffect(()=>{if(o&&t.wms){const{layerName:f}=t.wms;l(o.findIndex(d=>d.name===f))}else l(-1)},[o,t.wms]);const c=()=>o&&o.length&&a!=-1,u=()=>{o&&a!==-1&&e({...t,group:Zte,title:o[a].title,url:r.trim(),attribution:o[a].attribution,wms:{layerName:o[a].name}})};return C.jsxs(ot,{sx:{display:"flex",gap:2,flexDirection:"column",padding:"5px 15px"},children:[C.jsx(di,{required:!0,label:me.get("WMS URL"),variant:"standard",size:"small",value:r,fullWidth:!0,onChange:f=>i(f.currentTarget.value)}),C.jsx(Wg,{disabled:!o||!o.length,variant:"standard",onChange:f=>l(f.target.value),value:a,size:"small",renderValue:()=>o&&o.length&&a>=0?o[a].title:me.get("WMS Layer"),children:(o||[]).map((f,d)=>C.jsx(ti,{value:d,selected:a===d,children:C.jsx(du,{primary:f.title})},f.name))}),C.jsx(nD,{onDone:u,onCancel:n,doneDisabled:!c(),helpUrl:me.get("docs/add-layer-wms.en.md")})]})},lqn=({userLayer:t,onChange:e,onCancel:n})=>{const[r,i]=de.useState(t.title),[o,s]=de.useState(t.url),[a,l]=de.useState(t.attribution||""),c=(d,h)=>{const p=d!=="",g=h!==""&&(h.startsWith("http://")||h.trim().startsWith("https://"));return p&&g},u=()=>c(r.trim(),o.trim()),f=()=>e({...t,group:Zte,title:r.trim(),url:o.trim(),attribution:a.trim()});return C.jsxs(ot,{sx:{display:"flex",gap:1,flexDirection:"column",padding:"5px 15px"},children:[C.jsx(di,{required:!0,label:me.get("XYZ Layer URL"),variant:"standard",size:"small",value:o,fullWidth:!0,onChange:d=>s(d.currentTarget.value)}),C.jsxs(ot,{sx:{display:"flex",gap:1},children:[C.jsx(di,{required:!0,label:me.get("Layer Title"),variant:"standard",size:"small",sx:{flexGrow:.3},value:r,onChange:d=>i(d.currentTarget.value)}),C.jsx(di,{label:me.get("Layer Attribution"),variant:"standard",size:"small",sx:{flexGrow:.7},value:a,onChange:d=>l(d.currentTarget.value)})]}),C.jsx(nD,{onDone:f,onCancel:n,doneDisabled:!u(),helpUrl:me.get("docs/add-layer-xyz.en.md")})]})},cqn={paper:t=>({backgroundColor:(t.palette.mode==="dark"?Tg:Eg)(t.palette.background.paper,.1),marginBottom:t.spacing(2)})},JEe=({userLayers:t,setUserLayers:e,selectedId:n,setSelectedId:r})=>{const[i,o]=de.useState(n),[s,a]=de.useState(null),[l,c]=jVe();if(!open)return null;const u=x=>{c(()=>e(t)),a({editId:x.id,editMode:"edit"})},f=x=>{c(void 0);const b=t.findIndex(w=>w.id===x.id);e([...t.slice(0,b+1),{...x,id:Uf("user-layer"),title:x.title+" Copy"},...t.slice(b+1)])},d=x=>{c(void 0);const b=t.findIndex(w=>w.id===x.id);x.id===n&&r(i),x.id===i&&o(null),e([...t.slice(0,b),...t.slice(b+1)])},h=x=>{c(()=>e(t));const b=Uf("user-layer-");e([...t,{id:b,group:Zte,title:"",url:"",attribution:"",wms:x==="wms"?{layerName:""}:void 0}]),a({editId:b,editMode:"add"})},p=()=>{h("wms")},g=()=>{h("xyz")},m=x=>{c(void 0);const b=t.findIndex(w=>w.id===x.id);n===x.id&&r(i),e([...t.slice(0,b),x,...t.slice(b+1)]),a(null)},v=()=>{if(l(),s&&s.editMode==="add"){const x=t.findIndex(b=>b.id===s.editId);e([...t.slice(0,x),...t.slice(x+1)])}a(null)},y=s!==null;return C.jsx(Tl,{sx:cqn.paper,children:C.jsxs(DM,{component:"nav",dense:!0,children:[t.map(x=>{const b=n===x.id;return s&&s.editId===x.id?x.wms?C.jsx(aqn,{userLayer:x,onChange:m,onCancel:v},x.id):C.jsx(lqn,{userLayer:x,onChange:m,onCancel:v},x.id):C.jsxs(vPe,{selected:b,onClick:()=>r(b?null:x.id),children:[C.jsx(du,{primary:x.title,secondary:x.url}),C.jsxs(aA,{children:[C.jsx(Ht,{onClick:()=>u(x),size:"small",disabled:y,children:C.jsx(VO,{})}),C.jsx(Ht,{onClick:()=>f(x),size:"small",disabled:y,children:C.jsx($Ye,{})}),C.jsx(Ht,{onClick:()=>d(x),size:"small",disabled:y,children:C.jsx(WO,{})})]})]},x.id)}),!y&&C.jsx(P_,{sx:{minHeight:"3em"},children:C.jsx(aA,{children:C.jsxs(ot,{sx:{display:"flex",gap:2,paddingTop:2},children:[C.jsx(Lt,{title:me.get("Add layer from a Web Map Service"),children:C.jsx(Vr,{onClick:p,startIcon:C.jsx(lJ,{}),children:"WMS"})}),C.jsx(Lt,{title:me.get("Add layer from a Tiled Web Map"),children:C.jsx(Vr,{onClick:g,startIcon:C.jsx(lJ,{}),children:"XYZ"})})]})})})]})})},uqn=({dialogId:t,open:e,closeDialog:n,settings:r,updateSettings:i})=>{const[o,s]=de.useState(t==="userBaseMaps"?0:1);if(!e)return null;const a=r.userBaseMaps,l=m=>{i({userBaseMaps:m})},c=r.userOverlays,u=m=>{i({userOverlays:m})},f=r.selectedBaseMapId,d=m=>{i({selectedBaseMapId:m})},h=r.selectedOverlayId,p=m=>{i({selectedOverlayId:m})};function g(){n(t)}return C.jsxs(ed,{open:e,fullWidth:!0,maxWidth:"sm",onClose:g,scroll:"body",children:[C.jsx(Iy,{children:me.get("User Layers")}),C.jsxs(zf,{children:[C.jsx(ot,{sx:{borderBottom:1,borderColor:"divider"},children:C.jsxs(Xee,{value:o,onChange:(m,v)=>s(v),children:[C.jsx(SS,{label:"Base Maps"}),C.jsx(SS,{label:"Overlays"})]})}),o===0&&C.jsx(JEe,{userLayers:a,setUserLayers:l,selectedId:f,setSelectedId:d},"baseMaps"),o===1&&C.jsx(JEe,{userLayers:c,setUserLayers:u,selectedId:h,setSelectedId:p},"overlays")]})]})},fqn=(t,e)=>({open:t.controlState.dialogOpen[e.dialogId],settings:t.controlState,dialogId:e.dialogId}),dqn={closeDialog:jO,updateSettings:YR},e2e=Rn(fqn,dqn)(uqn);function WYe({selected:t,title:e,actions:n}){return C.jsxs(b4,{sx:{pl:{sm:2},pr:{xs:1,sm:1},...t&&{background:r=>kt(r.palette.primary.main,r.palette.action.activatedOpacity)}},children:[C.jsx(CQ,{}),C.jsx(Jt,{sx:{flex:"1 1 100%",paddingLeft:1},children:e}),n]})}const hqn={container:{display:"flex",flexDirection:"column",height:"100%"},tableContainer:{overflowY:"auto",flexGrow:1}};function pqn({userVariables:t,setUserVariables:e,selectedIndex:n,setSelectedIndex:r,setEditedVariable:i}){const o=n>=0?t[n]:null,s=n>=0,a=d=>{r(n!==d?d:-1)},l=()=>{i({editMode:"add",variable:Jtn()})},c=()=>{const d=t[n];e([...t.slice(0,n+1),enn(d),...t.slice(n+1)]),r(n+1)},u=()=>{i({editMode:"edit",variable:o})},f=()=>{e([...t.slice(0,n),...t.slice(n+1)]),n>=t.length-1&&r(t.length-2)};return C.jsxs(C.Fragment,{children:[C.jsx(WYe,{selected:n!==null,title:me.get("Manage user variables"),actions:C.jsxs(C.Fragment,{children:[C.jsx(Lt,{title:me.get("Add user variable"),children:C.jsx(Ht,{color:"primary",onClick:l,children:C.jsx(EU,{})})}),s&&C.jsx(Lt,{title:me.get("Duplicate user variable"),children:C.jsx(Ht,{onClick:c,children:C.jsx($Ye,{})})}),s&&C.jsx(Lt,{title:me.get("Edit user variable"),children:C.jsx(Ht,{onClick:u,children:C.jsx(VO,{})})}),s&&C.jsx(Lt,{title:me.get("Remove user variable"),children:C.jsx(Ht,{onClick:f,children:C.jsx(LYe,{})})})]})}),C.jsx(APe,{sx:hqn.tableContainer,children:C.jsxs(Hee,{size:"small",children:[C.jsx(lft,{children:C.jsxs(Td,{children:[C.jsx(li,{sx:{width:"15%"},children:me.get("Name")}),C.jsx(li,{sx:{width:"15%"},children:me.get("Title")}),C.jsx(li,{sx:{width:"10%"},children:me.get("Units")}),C.jsx(li,{children:me.get("Expression")})]})}),C.jsx(qee,{children:t.map((d,h)=>C.jsxs(Td,{hover:!0,selected:h===n,onClick:()=>a(h),children:[C.jsx(li,{component:"th",scope:"row",children:d.name}),C.jsx(li,{children:d.title}),C.jsx(li,{children:d.units}),C.jsx(li,{children:d.expression||""})]},d.id))})]})})]})}const gqn=ct(C.jsx("path",{d:"M10 18h4v-2h-4zM3 6v2h18V6zm3 7h12v-2H6z"}),"FilterList"),mqn=/^[a-zA-Z_$][a-zA-Z0-9_$]*$/;function vqn(t){return mqn.test(t)}const t2e={expressionPart:{padding:.2},expressionPartChip:{fontFamily:"monospace"}};function n2e({part:t,partType:e,onPartClicked:n}){return C.jsx(ot,{component:"span",sx:t2e.expressionPart,children:C.jsx(oPe,{label:t,sx:t2e.expressionPartChip,size:"small",variant:"outlined",color:e==="variables"||e==="constants"?"default":e.includes("Functions")?"primary":"secondary",onClick:()=>n(t)})})}function yqn({anchorEl:t,exprPartTypes:e,setExprPartTypes:n,onClose:r}){const i=o=>{n({...e,[o]:!e[o]})};return C.jsx($y,{open:!!t,anchorEl:t,onClose:r,children:SWe.map(o=>C.jsx(IYe,{selected:e[o],title:me.get(nnn[o]),onClick:()=>i(o),dense:!0},o))})}function xqn({expression:t,onExpressionChange:e,variableNames:n,expressionCapabilities:r,handleInsertPartRef:i}){const o=Xb(),s=D.useRef(null),a=D.useCallback(c=>{var f;const u=(f=s.current)==null?void 0:f.view;if(u){const d=u.state.selection.main,h=u.state.sliceDoc(d.from,d.to).trim();h!==""&&c.includes("X")&&(c=c.replace("X",h));const p=u.state.replaceSelection(c);p&&u.dispatch(p)}},[]);D.useEffect(()=>{i.current=a},[i,a]);const l=D.useCallback(c=>{const u=c.matchBefore(/\w*/);return u===null||u.from==u.to&&!c.explicit?null:{from:u.from,options:[...n.map(f=>({label:f,type:"variable"})),...r.namespace.constants.map(f=>({label:f,type:"variable"})),...r.namespace.arrayFunctions.map(f=>({label:f,type:"function"})),...r.namespace.otherFunctions.map(f=>({label:f,type:"function"}))]}},[n,r.namespace]);return C.jsx(FU,{theme:o.palette.mode||"none",width:"100%",height:"100px",placeholder:me.get("Use keys CTRL+SPACE to show autocompletions"),extensions:[WGe({override:[l]})],value:t,onChange:e,ref:s})}async function bqn(t,e,n){if(n.trim()==="")return me.get("Must not be empty");const r=`${t}/expressions/validate/${cO(e)}/${encodeURIComponent(n)}`;try{return await JRe(r),null}catch(i){const o=i.message;if(o){const s=o.indexOf("("),a=o.lastIndexOf(")");return o.slice(s>=0?s+1:0,a>=0?a:o.length)}return me.get("Invalid expression")}}const N$={container:{display:"flex",flexDirection:"column",height:"100%"},content:{flexGrow:1,display:"flex",flexDirection:"column",gap:2,padding:1},propertiesRow:{display:"flex",gap:1},expressionRow:{flexGrow:1},expressionParts:{paddingTop:1,overflowY:"auto"},expressionPart:{padding:.2},expressionPartChip:{fontFamily:"monospace"}};function wqn({userVariables:t,setUserVariables:e,editedVariable:n,setEditedVariable:r,contextDataset:i,expressionCapabilities:o,serverUrl:s}){const[a,l]=D.useState(tnn),[c,u]=D.useState(null),f=[...t,...i.variables],d=i.variables.filter(F=>!XM(F)).map(F=>F.name),{id:h,name:p,title:g,units:m,expression:v}=n.variable,y=f.findIndex(F=>F.id!==h&&F.name===p)>=0,x=!vqn(p),b=y?me.get("Already in use"):x?me.get("Not a valid identifier"):null,w=!b,[_,S]=D.useState(null),k=w&&!_,E=D.useRef(null);D.useEffect(()=>{const F=setTimeout(()=>{bqn(s,i.id,n.variable.expression).then(S)},500);return()=>{clearTimeout(F)}},[s,i.id,n.variable.expression]);const P=(F,$)=>{r({...n,variable:{...n.variable,[F]:$}})},A=()=>{if(n.editMode==="add")e([n.variable,...t]);else{const F=t.findIndex($=>$.id===n.variable.id);if(F>=0){const $=[...t];$[F]=n.variable,e($)}}r(null)},R=()=>{r(null)},T=F=>{P("name",F.target.value)},M=F=>{P("title",F.target.value)},I=F=>{P("units",F.target.value)},j=F=>{P("expression",F)},N=F=>{E.current(F)},z=F=>{u(F.currentTarget)},L=()=>{u(null)},B=[C.jsx(Ht,{size:"small",onClick:z,children:C.jsx(Lt,{arrow:!0,title:me.get("Display further elements to be used in expressions"),children:C.jsx(gqn,{})})},"filter")];return SWe.forEach(F=>{a[F]&&(F==="variables"?d.forEach($=>{B.push(C.jsx(n2e,{part:$,partType:F,onPartClicked:N},`${F}-${$}`))}):o.namespace[F].forEach($=>{B.push(C.jsx(n2e,{part:$,partType:F,onPartClicked:N},`${F}-${$}`))}))}),C.jsxs(C.Fragment,{children:[C.jsx(yqn,{anchorEl:c,exprPartTypes:a,setExprPartTypes:l,onClose:L}),C.jsx(WYe,{selected:!0,title:n.editMode==="add"?me.get("Add user variable"):me.get("Edit user variable"),actions:C.jsx(nD,{size:"medium",onDone:A,doneDisabled:!k,onCancel:R})}),C.jsxs(ot,{sx:N$.content,children:[C.jsxs(ot,{sx:N$.propertiesRow,children:[C.jsx(di,{sx:{flexGrow:.3},error:!w,helperText:b,size:"small",variant:"standard",label:me.get("Name"),value:p,onChange:T}),C.jsx(di,{sx:{flexGrow:.6},size:"small",variant:"standard",label:me.get("Title"),value:g,onChange:M}),C.jsx(di,{sx:{flexGrow:.1},size:"small",variant:"standard",label:me.get("Units"),value:m,onChange:I})]}),C.jsxs(ot,{sx:N$.expressionRow,children:[C.jsx(Jt,{sx:F=>({paddingBottom:1,color:F.palette.text.secondary}),children:me.get("Expression")}),C.jsx(xqn,{expression:v,onExpressionChange:j,variableNames:d,expressionCapabilities:o,handleInsertPartRef:E}),_&&C.jsx(Jt,{sx:{paddingBottom:1},color:"error",fontSize:"small",children:_}),C.jsx(ot,{sx:N$.expressionParts,children:B})]})]})]})}const r2e={dialogContent:{height:420},dialogActions:{display:"flex",justifyContent:"space-between",gap:.2}};function _qn({open:t,closeDialog:e,selectedDataset:n,selectedVariableName:r,selectVariable:i,userVariables:o,updateDatasetUserVariables:s,expressionCapabilities:a,serverUrl:l}){const[c,u]=D.useState(o),[f,d]=D.useState(c.findIndex(v=>v.name===r)),[h,p]=D.useState(null);if(D.useEffect(()=>{u(o)},[o]),!t||!n||!a)return null;function g(){s(n.id,c),e(q5),f>=0&&i(c[f].name)}function m(){u(o),e(q5)}return C.jsxs(ed,{open:t,fullWidth:!0,maxWidth:"md",onClose:m,scroll:"body",children:[C.jsx(Iy,{children:me.get("User Variables")}),C.jsx(zf,{dividers:!0,sx:r2e.dialogContent,children:h===null?C.jsx(pqn,{userVariables:c,setUserVariables:u,selectedIndex:f,setSelectedIndex:d,setEditedVariable:p}):C.jsx(wqn,{userVariables:c,setUserVariables:u,editedVariable:h,setEditedVariable:p,contextDataset:n,expressionCapabilities:a,serverUrl:l})}),C.jsxs(Yb,{sx:r2e.dialogActions,children:[C.jsx(ot,{children:C.jsx(BVe,{size:"medium",helpUrl:me.get("docs/user-variables.en.md")})}),C.jsxs(ot,{children:[C.jsx(Vr,{onClick:m,children:me.get("Cancel")}),C.jsx(Vr,{onClick:g,disabled:h!==null||!Sqn(c),children:me.get("OK")})]})]})]})}function Sqn(t){const e=new Set;return t.forEach(n=>e.add(n.name)),e.size===t.length}const Cqn=t=>({open:t.controlState.dialogOpen[q5],selectedDataset:fo(t),selectedVariableName:n1(t),userVariables:i_t(t),expressionCapabilities:v1t(t),serverUrl:Oo(t).url}),Oqn={closeDialog:jO,selectVariable:r8e,updateDatasetUserVariables:bQt},Eqn=Rn(Cqn,Oqn)(_qn),Tqn=t=>({compact:Pn.instance.branding.compact}),kqn={},Aqn=()=>Jj({typography:{fontSize:12,htmlFontSize:14},palette:{mode:Pn.instance.branding.themeName,primary:Pn.instance.branding.primaryColor,secondary:Pn.instance.branding.secondaryColor}}),Pqn=({compact:t})=>C.jsx(cht,{children:C.jsx(Det,{injectFirst:!0,children:C.jsxs(trt,{theme:Aqn(),children:[C.jsx(Gst,{}),!t&&C.jsx(Vtn,{}),C.jsx(hGn,{}),C.jsxs(C.Fragment,{children:[C.jsx(OGn,{}),C.jsx(zGn,{}),C.jsx(HGn,{}),C.jsx(e2e,{dialogId:"userOverlays"},"userOverlays"),C.jsx(e2e,{dialogId:"userBaseMaps"},"userBaseMaps"),C.jsx(Eqn,{}),C.jsx(pHn,{}),C.jsx(JGn,{}),C.jsx(yGn,{}),C.jsx(LGn,{})]})]})})}),Mqn=Rn(Tqn,kqn)(Pqn);function Rqn(t,e,n){switch(t===void 0&&(t=pwt()),e.type){case rle:{const r={...t,...e.settings};return gd(r),r}case E8e:return gd(t),t;case eP:{let r=t.selectedDatasetId||tv.get("dataset"),i=t.selectedVariableName||tv.get("variable"),o=t.mapInteraction,s=yA(e.datasets,r);const a=s&&Nq(s,i)||null;return s?a||(i=s.variables.length?s.variables[0].name:null):(r=null,i=null,s=e.datasets.length?e.datasets[0]:null,s&&(r=s.id,s.variables.length>0&&(i=s.variables[0].name))),r||(o="Select"),{...t,selectedDatasetId:r,selectedVariableName:i,mapInteraction:o}}case HUe:{let r=t.selectedVariableName;const i=yA(e.datasets,e.selectedDatasetId);!Nq(i,r)&&i.variables.length>0&&(r=i.variables[0].name);const s=e.selectedDatasetId,a=CRe(i),l=a?a[1]:null;return{...t,selectedDatasetId:s,selectedVariableName:r,selectedTimeRange:a,selectedTime:l}}case QUe:{const{location:r}=e;return t.flyTo!==r?{...t,flyTo:r}:t}case KUe:{const r=e.selectedPlaceGroupIds;return{...t,selectedPlaceGroupIds:r,selectedPlaceId:null}}case ZUe:{const{placeId:r}=e;return{...t,selectedPlaceId:r}}case n8e:return{...t,selectedVariableName:e.selectedVariableName};case JUe:return{...t,layerVisibilities:{...t.layerVisibilities,[e.layerId]:e.visible}};case e8e:{const{mapPointInfoBoxEnabled:r}=e;return{...t,mapPointInfoBoxEnabled:r}}case t8e:{const{variableCompareMode:r}=e;return{...t,variableCompareMode:r,variableSplitPos:void 0}}case Jae:{const{variableSplitPos:r}=e;return{...t,variableSplitPos:r}}case o8e:{let{selectedTime:r}=e;if(r!==null&&n){const i=qq(n),o=i?ERe(i,r):-1;o>=0&&(r=i[o])}return t.selectedTime!==r?{...t,selectedTime:r}:t}case s8e:{if(n){let r=YDe(n);if(r>=0){const i=qq(n);r+=e.increment,r<0&&(r=i.length-1),r>i.length-1&&(r=0);let o=i[r];const s=t.selectedTimeRange;if(s!==null&&(os[1]&&(o=s[1])),t.selectedTime!==o)return{...t,selectedTime:o}}}return t}case ele:return{...t,selectedTimeRange:e.selectedTimeRange};case fKt:return{...t,timeSeriesUpdateMode:e.timeSeriesUpdateMode};case l8e:return{...t,timeAnimationActive:e.timeAnimationActive,timeAnimationInterval:e.timeAnimationInterval};case qae:{const{id:r,selected:i}=e;return i?Dqn(t,_f,r):t}case Xae:{const{placeGroups:r}=e;return r.length>0?{...t,selectedPlaceGroupIds:[...t.selectedPlaceGroupIds||[],r[0].id]}:t}case Yae:{const{placeGroupId:r,newName:i}=e;return r===_f?{...t,userDrawnPlaceGroupName:i}:t}case Qae:{const{placeId:r,places:i}=e;if(r===t.selectedPlaceId){let o=null;const s=i.findIndex(a=>a.id===r);return s>=0&&(s0&&(o=i[s-1].id)),{...t,selectedPlaceId:o}}return t}case A8e:{const r=e.colorBarId;return{...t,userColorBars:[{id:r,type:"continuous",code:yDe},...t.userColorBars]}}case P8e:{const r=e.colorBarId,i=t.userColorBars.findIndex(o=>o.id===r);if(i>=0){const o={...t,userColorBars:[...t.userColorBars.slice(0,i),...t.userColorBars.slice(i+1)]};return gd(o),o}return t}case D8e:{const r=e.userColorBar,i=t.userColorBars.findIndex(o=>o.id===r.id);return i>=0?{...t,userColorBars:[...t.userColorBars.slice(0,i),{...r},...t.userColorBars.slice(i+1)]}:t}case c8e:{let r={...t,mapInteraction:e.mapInteraction,lastMapInteraction:t.mapInteraction};return e.mapInteraction==="Geometry"&&(r={...r,dialogOpen:{...t.dialogOpen,addUserPlacesFromText:!0}}),r}case f8e:{const{layerMenuOpen:r}=e;return t={...t,layerMenuOpen:r},gd(t),t}case h8e:{const{sidebarPosition:r}=e;return t={...t,sidebarPosition:r},t}case p8e:{const{sidebarOpen:r}=e;return t={...t,sidebarOpen:r},gd(t),t}case g8e:{const{sidebarPanelId:r}=e;return t={...t,sidebarPanelId:r},gd(t),t}case m8e:return t={...t,volumeRenderMode:e.volumeRenderMode},gd(t),t;case v8e:{const{volumeId:r,volumeState:i}=e;return t={...t,volumeStates:{...t.volumeStates,[r]:i}},t}case y8e:{const r={...t.infoCardElementStates};return Object.getOwnPropertyNames(r).forEach(i=>{r[i]={...r[i],visible:e.visibleElements.includes(i)}}),t={...t,infoCardElementStates:r},gd(t),t}case x8e:{const{elementType:r,viewMode:i}=e,o={...t,infoCardElementStates:{...t.infoCardElementStates,[r]:{...t.infoCardElementStates[r],viewMode:i}}};return gd(o),o}case b8e:return{...t,activities:{...t.activities,[e.id]:e.message}};case w8e:{const r={...t.activities};return delete r[e.id],{...t,activities:r}}case _8e:{const r=e.locale;return me.locale=r,r!==t.locale&&(t={...t,locale:r},gd(t)),t}case C8e:{const r=e.dialogId;return{...t,dialogOpen:{...t.dialogOpen,[r]:!0}}}case O8e:{const r=e.dialogId;return{...t,dialogOpen:{...t.dialogOpen,[r]:!1}}}case i8e:{const{selectedDataset2Id:r,selectedVariable2Name:i}=e;return r===t.selectedDataset2Id&&i===t.selectedVariable2Name?{...t,selectedDataset2Id:null,selectedVariable2Name:null,variableCompareMode:!1,variableSplitPos:void 0}:{...t,selectedDataset2Id:r,selectedVariable2Name:i,variableCompareMode:!0}}case Kae:if(t.selectedServerId!==e.selectedServerId)return{...t,selectedServerId:e.selectedServerId}}return t}function Dqn(t,e,n){let r=t.selectedPlaceGroupIds;return!t.selectedPlaceGroupIds||t.selectedPlaceGroupIds.length===0?r=[e]:t.selectedPlaceGroupIds.find(i=>i===e)||(r=[...t.selectedPlaceGroupIds,e]),{...t,selectedPlaceGroupIds:r,selectedPlaceId:n}}function Iqn(){const t=swt(),e=[{...Pn.instance.server}];return t.forEach(n=>{e.find(r=>r.id===n.id)||e.push(n)}),{serverInfo:null,expressionCapabilities:null,datasets:[],colorBars:null,statistics:{loading:!1,records:[]},timeSeriesGroups:[],userPlaceGroups:[],userServers:e}}function Lqn(t,e){switch(t===void 0&&(t=Iqn()),e.type){case G5:return{...t,serverInfo:e.serverInfo};case jUe:return{...t,expressionCapabilities:e.expressionCapabilities};case eP:return{...t,datasets:e.datasets};case TUe:{const{datasetId:n,userVariables:r}=e,i=t.datasets.findIndex(l=>l.id===n),o=t.datasets[i],[s,a]=Bte(o);return{...t,datasets:[...t.datasets.slice(0,i),{...o,variables:[...s,...r]},...t.datasets.slice(i+1)]}}case UUe:{const{datasetId:n,variableName:r,colorBarName:i,colorBarMinMax:o,colorBarNorm:s,opacity:a}=e,l={colorBarName:i,colorBarMin:o[0],colorBarMax:o[1],colorBarNorm:s,opacity:a};return i2e(t,n,r,l)}case VUe:{const{datasetId:n,variableName:r,volumeRenderMode:i,volumeIsoThreshold:o}=e;return i2e(t,n,r,{volumeRenderMode:i,volumeIsoThreshold:o})}case Hae:{const n=e.placeGroup,r=t.datasets.map(i=>{if(i.placeGroups){const o=i.placeGroups.findIndex(s=>s.id===n.id);if(o>=0){const s=[...i.placeGroups];return s[o]=n,{...i,placeGroups:s}}}return i});return{...t,datasets:r}}case qae:{const{placeGroupTitle:n,id:r,properties:i,geometry:o}=e,s={type:"Feature",id:r,properties:i,geometry:o},a=t.userPlaceGroups,l=a.findIndex(c=>c.id===_f);if(l>=0){const c=a[l];return{...t,userPlaceGroups:[...a.slice(0,l),{...c,features:[...c.features,s]},...a.slice(l+1)]}}else{const c=n&&n!==""?n:me.get("My places");return{...t,userPlaceGroups:[{type:"FeatureCollection",id:_f,title:c,features:[s]},...a]}}}case Xae:{const{placeGroups:n}=e;return{...t,userPlaceGroups:[...t.userPlaceGroups,...n]}}case Yae:{const{placeGroupId:n,newName:r}=e,i=t.userPlaceGroups,o=i.findIndex(s=>s.id===n);if(o>=0){const s=i[o];return{...t,userPlaceGroups:[...i.slice(0,o),{...s,title:r},...i.slice(o+1)]}}return t}case AUe:{const{placeGroupId:n,placeId:r,newName:i}=e,o=t.userPlaceGroups,s=s2e(o,n,r,{label:i});return s?{...t,userPlaceGroups:s}:t}case PUe:{const{placeGroupId:n,placeId:r,placeStyle:i}=e,o=t.userPlaceGroups,s=s2e(o,n,r,i);return s?{...t,userPlaceGroups:s}:t}case Qae:{const{placeGroupId:n,placeId:r}=e,i=t.userPlaceGroups,o=i.findIndex(s=>s.id===n);if(o>=0){const s=i[o],a=s.features.findIndex(l=>l.id===r);if(a>=0){const l=o2e(t.timeSeriesGroups,[r]);let c=t.timeSeriesGroups;return l.forEach(u=>{c=QG(c,u,"remove","append")}),{...t,userPlaceGroups:[...i.slice(0,o),{...s,features:[...s.features.slice(0,a),...s.features.slice(a+1)]},...i.slice(o+1)],timeSeriesGroups:c}}}return t}case MUe:{const{placeGroupId:n}=e,r=t.userPlaceGroups,i=r.findIndex(o=>o.id===n);if(i>=0){const s=r[i].features.map(c=>c.id),a=o2e(t.timeSeriesGroups,s);let l=t.timeSeriesGroups;return a.forEach(c=>{l=QG(l,c,"remove","append")}),{...t,userPlaceGroups:[...r.slice(0,i),...r.slice(i+1)],timeSeriesGroups:l}}return t}case BUe:return{...t,colorBars:e.colorBars};case $Ue:{const{timeSeriesGroupId:n,timeSeries:r}=e,i=t.timeSeriesGroups,o=i.findIndex(l=>l.id===n),s=i[o],a=[...i];return a[o]={...s,timeSeriesArray:[...s.timeSeriesArray,r]},{...t,timeSeriesGroups:a}}case DUe:{const n=t.statistics;if(e.statistics===null)return{...t,statistics:{...n,loading:!0}};const r=n.records;return{...t,statistics:{...n,loading:!1,records:[e.statistics,...r]}}}case IUe:{const{index:n}=e,r=t.statistics,i=r.records;return{...t,statistics:{...r,records:[...i.slice(0,n),...i.slice(n+1)]}}}case LUe:{const{timeSeries:n,updateMode:r,dataMode:i}=e,o=QG(t.timeSeriesGroups,n,r,i);return o!==t.timeSeriesGroups?{...t,timeSeriesGroups:o}:t}case FUe:{const n=t.timeSeriesGroups.findIndex(r=>r.id===e.groupId);if(n>=0){const r=[...t.timeSeriesGroups],i={...r[n]},o=[...i.timeSeriesArray];return o.splice(e.index,1),i.timeSeriesArray=o,r[n]=i,{...t,timeSeriesGroups:r}}return t}case NUe:{const n=t.timeSeriesGroups.findIndex(r=>r.id===e.id);if(n>=0){const r=[...t.timeSeriesGroups];return r.splice(n,1),{...t,timeSeriesGroups:r}}return t}case zUe:return{...t,timeSeriesGroups:[]};case ele:{const{selectedGroupId:n,selectedValueRange:r}=e;if(!n)return t;const i=t.timeSeriesGroups.findIndex(s=>s.id===n),o=r||void 0;return{...t,timeSeriesGroups:[...t.timeSeriesGroups.slice(0,i),{...t.timeSeriesGroups[i],variableRange:o},...t.timeSeriesGroups.slice(i+1)]}}case Kae:return t.userServers!==e.servers?(owt(e.servers),{...t,userServers:e.servers}):t;default:return t}}function i2e(t,e,n,r){const i=t.datasets.findIndex(o=>o.id===e);if(i>=0){const o=t.datasets[i],s=o.variables.findIndex(a=>a.name===n);if(s>=0){const a=o.variables[s],l=t.datasets.slice(),c=o.variables.slice();return c[s]={...a,...r},l[i]={...o,variables:c},{...t,datasets:l}}}return t}function QG(t,e,n,r){let i=e,o;const s=t.findIndex(a=>a.variableUnits===i.source.variableUnits);if(s>=0){const a=t[s],l=a.timeSeriesArray,c=l.findIndex(f=>f.source.datasetId===i.source.datasetId&&f.source.variableName===i.source.variableName&&f.source.placeId===i.source.placeId);let u;if(c>=0){const f=l[c];r==="append"&&(i={...i,data:[...i.data,...f.data]}),n==="replace"?u=[i]:n==="add"?(u=l.slice(),u[c]=i):(u=l.slice(),u.splice(c,1))}else n==="replace"?u=[i]:n==="add"?u=[i,...l]:u=l;n==="replace"?o=[{...a,timeSeriesArray:u}]:n==="add"?(o=t.slice(),o[s]={...a,timeSeriesArray:u}):u.length>=0?(o=t.slice(),o[s]={...a,timeSeriesArray:u}):(o=t.slice(),o.splice(s,1))}else n==="replace"?o=[{id:Uf("ts-"),variableUnits:i.source.variableUnits,timeSeriesArray:[i]}]:n==="add"?o=[{id:Uf("ts-"),variableUnits:i.source.variableUnits,timeSeriesArray:[i]},...t]:o=t;return o}function o2e(t,e){const n=[];return t.forEach(r=>{r.timeSeriesArray.forEach(i=>{e.forEach(o=>{i.source.placeId===o&&n.push(i)})})}),n}function s2e(t,e,n,r){const i=t.findIndex(o=>o.id===e);if(i>=0){const o=t[i],s=o.features,a=s.findIndex(l=>l.id===n);if(a>=0){const l=s[a];return[...t.slice(0,i),{...o,features:[...s.slice(0,a),{...l,properties:{...l.properties,...r}},...s.slice(a+1)]},...t.slice(i+1)]}}}function $qn(){return{newEntries:[],oldEntries:[]}}let Fqn=0;function Nqn(t,e){t===void 0&&(t=$qn());const n=t.newEntries;switch(e.type){case SUe:{const r=e.messageType,i=e.messageText;let o=n.length?n[0]:null;return o&&r===o.type&&i===o.text?t:(o={id:++Fqn,type:r,text:i},{...t,newEntries:[o,...n]})}case CUe:{const r=n.findIndex(i=>i.id===e.messageId);if(r>=0){const i=n[r],o=[...n];o.splice(r,1);const s=[i,...t.oldEntries];return{...t,newEntries:o,oldEntries:s}}}}return t}function zqn(){return{accessToken:null}}function jqn(t,e){switch(t===void 0&&(t=zqn()),e.type){case bWe:return{...t,accessToken:e.accessToken}}return t}function Bqn(t,e){return{dataState:Lqn(t&&t.dataState,e),controlState:Rqn(t&&t.controlState,e,t),messageLogState:Nqn(t&&t.messageLogState,e),userAuthState:jqn(t&&t.userAuthState,e)}}Pn.load().then(()=>{const t=(o,s)=>s.type!==Jae,e=MJe.createLogger({collapsed:!0,diff:!1,predicate:t}),n=PJe(Bke,e),r=zke(Bqn,n),i=r.dispatch;i(S8e(r.getState().controlState.locale)),i(bKt()),r.getState().controlState.privacyNoticeAccepted&&i(Zae(r)),KG.createRoot(document.getElementById("root")).render(C.jsx(TZe,{store:r,children:C.jsx(Mqn,{})}))}); diff --git a/xcube/webapi/viewer/dist/index.html b/xcube/webapi/viewer/dist/index.html index adb862e6b..a924e3f6a 100644 --- a/xcube/webapi/viewer/dist/index.html +++ b/xcube/webapi/viewer/dist/index.html @@ -38,7 +38,7 @@ xcube Viewer - +